Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 46b4818..4d5191b 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -30,3 +30,4 @@
 c235f4a8559d196879c56af80159f67ee5d0e720 jdk7-b53
 2ef382b1bbd58a68e668391c6145a4b2066c5b96 jdk7-b54
 aea0ace7a1e43619800931d42bbf69c579361c2d jdk7-b55
+ba12117a5e6c918578d6b2a8c693232a33289024 jdk7-b56
diff --git a/README-builds.html b/README-builds.html
index 1f4a498..ad7d16c 100644
--- a/README-builds.html
+++ b/README-builds.html
@@ -68,6 +68,7 @@
                             </li>
                             <li><a href="#zip">Zip and Unzip</a> </li>
                             <li><a href="#freetype">FreeType2 Fonts</a> </li>
+                            <li><a href="#jibx">JIBX Libraries</a> </li>
                             <li>Linux and Solaris:
                                 <ul>
                                     <li><a href="#cups">CUPS Include files</a> </li>
@@ -586,6 +587,11 @@
                     package</a>.
                 </li>
                 <li>
+                    Install the
+                    <a href="#jibx">JIBX Libraries</a>, set
+                    <tt><a href="#ALT_JIBX_LIBS_PATH">ALT_JIBX_LIBS_PATH</a></tt>.
+                </li>
+                <li>
                     Install
                     <a href="#ant">Ant</a>, 
                     make sure it is in your PATH.
@@ -651,6 +657,11 @@
                     <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
                 </li>
                 <li>
+                    Install the
+                    <a href="#jibx">JIBX Libraries</a>, set
+                    <tt><a href="#ALT_JIBX_LIBS_PATH">ALT_JIBX_LIBS_PATH</a></tt>.
+                </li>
+                <li>
                     Install
                     <a href="#ant">Ant</a>, 
                     make sure it is in your PATH.
@@ -746,6 +757,11 @@
                     <a href="#dxsdk">Microsoft DirectX SDK</a>.
                 </li>
                 <li>
+                    Install the
+                    <a href="#jibx">JIBX Libraries</a>, set
+                    <tt><a href="#ALT_JIBX_LIBS_PATH">ALT_JIBX_LIBS_PATH</a></tt>.
+                </li>
+                <li>
                     Install
                     <a href="#ant">Ant</a>, 
                     make sure it is in your PATH and set
@@ -874,6 +890,27 @@
                 fine for most JDK developers.
             </blockquote>
             <!-- ------------------------------------------------------ -->
+            <h4><a name="jibx">JIBX</a></h4>
+            <blockquote>
+                JIBX libraries version 1.1.5 is required for building the OpenJDK.
+                Namely, the following JAR files from the JIBX distribution package
+                are required:
+                <ul>
+                    <li>bcel.jar
+                    <li>jibx-bind.jar
+                    <li>jibx-run.jar
+                    <li>xpp3.jar
+                </ul>
+                <p>
+                You can download the package from the
+                <a href="http://jibx.sourceforge.net" target="_blank">JIBX site</a>.
+                <p>
+                You will need to set the
+                <tt><a href="#ALT_JIBX_LIBS_PATH">ALT_JIBX_LIBS_PATH</a></tt>
+                environment variable to refer to place where the JAR files,
+                above, are located.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
             <h4><a name="compilers">Compilers</a></h4>
             <blockquote>
                 <strong><a name="gcc">Linux gcc/binutils</a></strong>
@@ -1425,6 +1462,12 @@
                     The default will refer to 
                     <tt>jdk/src/share/lib/security/cacerts</tt>.
                 </dd>
+                <dt><tt><a name="ALT_JIBX_LIBS_PATH">ALT_JIBX_LIBS_PATH</a></tt></dt>
+                <dd>
+                    The location of the <a href="#jibx">JIBX libraries</a> file.
+                    The default value is
+                    <tt>$(ALT_SLASH_JAVA)/devtools/share/jibx/lib</tt>.
+                </dd>
                 <dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
                 <dd>
                     The location of the CUPS header files.
diff --git a/corba/.hgtags b/corba/.hgtags
index d9ca864..fb97578 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -30,3 +30,4 @@
 3c4d73194f6f89f040ae3b2d257335dfa8a1b2b5 jdk7-b53
 8130ac858d6789d5853d23044ba4a992afda574a jdk7-b54
 7a869f16ba83060c34b77620406cfa89d1cd7084 jdk7-b55
+553a664b807bb3a3c93f3b5a3c20ff0a90e08371 jdk7-b56
diff --git a/corba/make/jprt.config b/corba/make/jprt.config
deleted file mode 100644
index 37d0086..0000000
--- a/corba/make/jprt.config
+++ /dev/null
@@ -1,330 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-#
-# Copyright 2006-2009 Sun Microsystems, Inc.  All Rights Reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Sun designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Sun in the LICENSE file that accompanied this code.
-#
-# This code 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
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-#############################################################################
-#
-# JPRT shell configuration for building.
-#
-# Input environment variables:
-#    ALT_BOOTDIR
-#    ALT_SLASH_JAVA
-#    ALT_JDK_IMPORT_PATH
-#    Windows Only:
-#      PATH
-#      VS71COMNTOOLS
-#      PROCESSOR_IDENTIFIER
-#      ROOTDIR
-#
-# Output variable settings:
-#    make            Full path to GNU make
-#    compiler_path   Path to compiler bin directory
-#    compiler_name   Unique name of this compiler
-#
-# Output environment variables:
-#    PATH
-#    ALT_COMPILER_PATH
-#    Windows Only:
-#      ALT_MSDEVTOOLS_PATH
-#      ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
-#      LIB
-#      INCLUDE
-#
-# After JDK6, most settings will be found via ALT_SLASH_JAVA or
-#   by way of other system environment variables. If this was JDK5
-#   or an older JDK, you might need to export more ALT_* variables.
-#
-# On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at:
-#          C:/Program Files/Microsoft Platform SDK
-#
-#############################################################################
-
-#############################################################################
-# Error
-error() # message
-{
-  echo "ERROR: $1"
-  exit 6
-}
-# Directory must exist
-dirMustExist() # dir name
-{
-  if [ ! -d "$1" ] ; then
-    error "Directory for $2 does not exist: $1"
-  fi
-}
-# File must exist
-fileMustExist() # dir name
-{
-  if [ ! -f "$1" ] ; then
-    error "File for $2 does not exist: $1"
-  fi
-}
-#############################################################################
-
-# Should be set by JPRT as the 3 basic inputs
-bootdir="${ALT_BOOTDIR}"
-slashjava="${ALT_SLASH_JAVA}"
-jdk_import="${ALT_JDK_IMPORT_PATH}"
-
-# The /java/devtools items
-jdk_devtools="${slashjava}/devtools"
-share="${jdk_devtools}/share"
-
-# The 3 bin directories in common to all platforms
-sharebin="${share}/bin"
-
-# Check input
-dirMustExist "${bootdir}"         ALT_BOOTDIR
-dirMustExist "${slashjava}"       ALT_SLASH_JAVA
-dirMustExist "${jdk_import}"      ALT_JDK_IMPORT_PATH
-
-# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
-osname=`uname -s`
-if [ "${osname}" = SunOS ] ; then
-   
-    # SOLARIS: Sparc or X86
-    osarch=`uname -p`
-    if [ "${osarch}" = sparc ] ; then
-	solaris_arch=sparc
-    else
-	solaris_arch=i386
-    fi
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
-        compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
-    else
-	compiler_name=SS12
-    fi
-    compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}
-
-    # Add basic solaris system paths
-    path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-
-    # Find GNU make
-    make=/usr/sfw/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=/opt/sfw/bin/gmake
-	if [ ! -f ${make} ] ; then
-	    make=${jdk_devtools}/${solaris_arch}/bin/gnumake
-        fi 
-    fi
-    fileMustExist "${make}" make
-
-    # File creation mask
-    umask 002
-
-elif [ "${osname}" = Linux ] ; then
-   
-    # LINUX: X86, AMD64
-    osarch=`uname -m`
-    if [ "${osarch}" = i686 ] ; then
-	linux_arch=i586
-    elif [ "${osarch}" = x86_64 ] ; then
-	linux_arch=amd64
-    fi
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    compiler_path=/usr/bin
-    compiler_name=usr_bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}
-    
-    # Add basic paths
-    path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-    
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-   
-else
-
-    # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
-    #   Also, blanks in pathnames gives GNU make headaches, so anything placed
-    #   in any ALT_* variable should be the short windows dosname.
-   
-    # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
-    #   Assumption here is that you are in a shell window via MKS or cygwin.
-    #   MKS install should have defined the environment variable ROOTDIR.
-    #   We also need to figure out which one we have: X86, AMD64
-    if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
-	windows_arch=amd64
-    else
-	windows_arch=i586
-    fi
-    
-    # We need to determine if we are running a CYGWIN shell or an MKS shell
-    #    (if uname isn't available, then it will be unix_toolset=unknown)
-    unix_toolset=unknown
-    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
-        # We kind of assume ROOTDIR is where MKS is and it's ok
-        unix_toolset=MKS
-        mkshome=`dosname -s "${ROOTDIR}"`
-	# Utility to convert to short pathnames without spaces
-	dosname="${mkshome}/mksnt/dosname -s"
-        # Most unix utilities are in the mksnt directory of ROOTDIR
-        unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${sharebin};${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-	devtools_path="${jdk_devtools}/win32/bin"
-	path4sdk="${devtools_path};${path4sdk}"
-	# Normally this need not be set, but on Windows it's default is C:/UTILS
-        ALT_DEVTOOLS_PATH="${devtools_path}"
-	export ALT_DEVTOOLS_PATH
-        dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
-        # Find GNU make
-        make="${devtools_path}/gnumake.exe"
-        fileMustExist "${make}" make
-    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
-        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
-        unix_toolset=CYGWIN
-	# Utility to convert to short pathnames without spaces
-	dosname="/usr/bin/cygpath -a -m -s"
-        # Most unix utilities are in the /usr/bin
-        unixcommand_path="/usr/bin"
-        path4sdk="${sharebin};${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-        # Find GNU make
-        make="${unixcommand_path}/make.exe"
-        fileMustExist "${make}" make
-    else
-      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
-    fi
-
-    # WINDOWS: Compiler setup (nasty part)
-    #   NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
-    #   NOTE: CYGWIN has a link.exe too, make sure the compilers are first
-    if [ "${windows_arch}" = i586 ] ; then
-        # 32bit Windows compiler settings
-        # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
-        vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
-        # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
-        msdev_root="${vs_root}/Common7/Tools"
-        msdevtools_path="${msdev_root}/bin"
-        vc7_root="${vs_root}/Vc7"
-        compiler_path="${vc7_root}/bin"
-        compiler_name=VS2003
-        platform_sdk="${vc7_root}/PlatformSDK"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${vc7_root}/atlmfc/include"
-        include4sdk="${include4sdk};${vc7_root}/include"
-        include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
-        include4sdk="${include4sdk};${platform_sdk}/include"
-        include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
-        lib4sdk="${vc7_root}/atlmfc/lib"
-        lib4sdk="${lib4sdk};${vc7_root}/lib"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib"
-        lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
-	path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
-        path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
-	path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
-        path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
-	path4sdk="${compiler_path};${path4sdk}"
-    elif [ "${windows_arch}" = amd64 ] ; then
-        # AMD64 64bit Windows compiler settings
-	if [ "${MSSDK}" != "" ] ; then
-	    platform_sdk="${MSSDK}"
-	else
-	    platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
-	fi
-	compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
-        compiler_name=VS2005_PSDK
-	msdevtools_path="${platform_sdk}/Bin"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${platform_sdk}/Include"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
-	include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
-	include4sdk="${include4sdk};${platform_sdk}/Include/atl"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt"
-        lib4sdk="${platform_sdk}/Lib/AMD64"
-        lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${platform_sdk}/bin;${path4sdk}"
-        path4sdk="${compiler_path};${path4sdk}"
-    fi
-    # Export LIB and INCLUDE
-    unset lib
-    unset Lib
-    LIB="${lib4sdk}"
-    export LIB
-    unset include
-    unset Include
-    INCLUDE="${include4sdk}"
-    export INCLUDE
-    # Set the ALT variable
-    ALT_COMPILER_PATH=`${dosname} "${compiler_path}"`
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"`
-    export ALT_MSDEVTOOLS_PATH
-    dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH
-    
-    # WINDOWS: Get the previous JDK to be used to bootstrap the build
-    path4sdk="${bootdir}/bin;${path4sdk}"
-
-    # Turn all \\ into /, remove duplicates and trailing /
-    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
-    
-    # For windows, it's hard to know where the system is, so we just add this
-    #    to PATH.
-    path4sdk="${slash_path};${PATH}"
-    
-    # Convert path4sdk to cygwin style
-    if [ "${unix_toolset}" = CYGWIN ] ; then
-	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
-    fi
-
-fi
-
-# Export PATH setting
-PATH="${path4sdk}"
-export PATH
-
-# Things we need to unset
-unset LD_LIBRARY_PATH
-unset LD_LIBRARY_PATH_32
-unset LD_LIBRARY_PATH_64
-unset JAVA_HOME
-
diff --git a/corba/make/jprt.properties b/corba/make/jprt.properties
index fdb5d96..50a286b 100644
--- a/corba/make/jprt.properties
+++ b/corba/make/jprt.properties
@@ -32,8 +32,8 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java
index 4925c73..c57942f 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,7 @@
     // We should convert endOfStream to a final static dummy end node
     private boolean endOfStream = true;
     private BufferQueue fragmentQueue = new BufferQueue();
+    private long FRAGMENT_TIMEOUT = 60000;
 
     // REVISIT - This should go in BufferManagerRead. But, since
     //           BufferManagerRead is an interface. BufferManagerRead
@@ -111,9 +112,16 @@
                     throw wrapper.endOfStream() ;
                 }
 
+                boolean interrupted = false;
                 try {
-                    fragmentQueue.wait();
-                } catch (InterruptedException e) {}
+                    fragmentQueue.wait(FRAGMENT_TIMEOUT);
+                } catch (InterruptedException e) {
+                    interrupted = true;
+                }
+
+                if (!interrupted && fragmentQueue.size() == 0) {
+                    throw wrapper.bufferReadManagerTimeout();
+                }
 
                 if (receivedCancel) {
                     throw new RequestCanceledException(cancelReqId);
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
index c9b79df..b23049c 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -153,22 +153,22 @@
                 desc = new ObjectStreamClass(cl, superdesc,
                                              serializable, externalizable);
             }
+            // Must always call init.  See bug 4488137.  This code was
+            // incorrectly changed to return immediately on a non-null
+            // cache result.  That allowed threads to gain access to
+            // unintialized instances.
+            //
+            // History: Note, the following init() call was originally within
+            // the synchronization block, as it currently is now. Later, the
+            // init() call was moved outside the synchronization block, and
+            // the init() method used a private member variable lock, to
+            // avoid performance problems. See bug 4165204. But that lead to
+            // a deadlock situation, see bug 5104239. Hence, the init() method
+            // has now been moved back into the synchronization block. The
+            // right approach to solving these problems would be to rewrite
+            // this class, based on the latest java.io.ObjectStreamClass.
+            desc.init();
         }
-
-        // Must always call init.  See bug 4488137.  This code was
-        // incorrectly changed to return immediately on a non-null
-        // cache result.  That allowed threads to gain access to
-        // unintialized instances.
-        //
-        // All threads must sync on the member variable lock
-        // and check the initialization state.
-        //
-        // Another possibility is to continue to synchronize on the
-        // descriptorFor array, but that leads to poor performance
-        // (see bug 4165204 "ObjectStreamClass can hold global lock
-        // for a very long time").
-        desc.init();
-
         return desc;
     }
 
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java
index 5cde4bf..c0cb1d8 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,6 +76,7 @@
     private ORB orb ;
     private POASystemException wrapper ;
     private OMGSystemException omgWrapper ;
+    private boolean isShuttingDown = false;
 
     public POASystemException getWrapper()
     {
@@ -166,6 +167,7 @@
         // pm.deactivate removes itself from poaManagers!
         Iterator managers = null ;
         synchronized (this) {
+            isShuttingDown = true ;
             managers = (new HashSet(poaManagers)).iterator();
         }
 
@@ -208,9 +210,15 @@
             ClosureFactory.makeFuture( rpClosure ) ) ;
     }
 
+
     public synchronized POA getRootPOA()
     {
         if (rootPOA == null) {
+            // See if we are trying to getRootPOA while shutting down the ORB.
+            if (isShuttingDown) {
+                throw omgWrapper.noObjectAdaptor( ) ;
+            }
+
             try {
                 Object obj = orb.resolve_initial_references(
                     ORBConstants.ROOT_POA_NAME ) ;
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
index 52b5cbf..45fa6dd 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -185,7 +185,6 @@
 
     private java.lang.Object runObj = new java.lang.Object();
     private java.lang.Object shutdownObj = new java.lang.Object();
-    private java.lang.Object waitForCompletionObj = new java.lang.Object();
     private static final byte STATUS_OPERATING = 1;
     private static final byte STATUS_SHUTTING_DOWN = 2;
     private static final byte STATUS_SHUTDOWN = 3;
@@ -194,7 +193,6 @@
 
     // XXX Should we move invocation tracking to the first level server dispatcher?
     private java.lang.Object invocationObj = new java.lang.Object();
-    private int numInvocations = 0;
 
     // thread local variable to store a boolean to detect deadlock in
     // ORB.shutdown(true).
@@ -1245,37 +1243,48 @@
 
     public void shutdown(boolean wait_for_completion)
     {
-        synchronized (this) {
-            checkShutdownState();
+        // to wait for completion, we would deadlock, so throw a standard
+        // OMG exception.
+        if (wait_for_completion && ((Boolean)isProcessingInvocation.get()).booleanValue()) {
+            throw omgWrapper.shutdownWaitForCompletionDeadlock() ;
         }
 
-        // Avoid more than one thread performing shutdown at a time.
-        synchronized (shutdownObj) {
-            checkShutdownState();
-            // This is to avoid deadlock
-            if (wait_for_completion &&
-                isProcessingInvocation.get() == Boolean.TRUE) {
-                throw omgWrapper.shutdownWaitForCompletionDeadlock() ;
-            }
+        boolean doShutdown = false ;
 
-            status = STATUS_SHUTTING_DOWN;
-            // XXX access to requestDispatcherRegistry should be protected
-            // by the ORBImpl instance monitor, but is not here in the
-            // shutdownServants call.
-            shutdownServants(wait_for_completion);
-            if (wait_for_completion) {
-                synchronized ( waitForCompletionObj ) {
-                    while (numInvocations > 0) {
-                        try {
-                            waitForCompletionObj.wait();
-                        } catch (InterruptedException ex) {}
-                    }
+        synchronized (this) {
+            checkShutdownState() ;
+
+            if (status == STATUS_SHUTTING_DOWN) {
+                if (!wait_for_completion)
+                // If we are already shutting down and don't want
+                // to wait, nothing to do: return.
+                return ;
+            } else {
+                // The ORB status was STATUS_OPERATING, so start the shutdown.
+                status = STATUS_SHUTTING_DOWN ;
+                doShutdown = true ;
+            }
+        }
+
+        // At this point, status is SHUTTING_DOWN.
+        // All shutdown calls with wait_for_completion == true must synchronize
+        // here.  Only the first call will be made with doShutdown == true.
+        synchronized (shutdownObj) {
+            if (doShutdown) {
+                // shutdownServants will set all POAManagers into the
+                // INACTIVE state, causing request to be rejected.
+                // If wait_for_completion is true, this will not return until
+                // all invocations have completed.
+                shutdownServants(wait_for_completion);
+
+                synchronized (runObj) {
+                    runObj.notifyAll();
+                }
+
+                synchronized (this) {
+                    status = STATUS_SHUTDOWN;
                 }
             }
-            synchronized ( runObj ) {
-                runObj.notifyAll();
-            }
-            status = STATUS_SHUTDOWN;
         }
     }
 
@@ -1314,23 +1323,13 @@
     {
         synchronized (invocationObj) {
             isProcessingInvocation.set(Boolean.TRUE);
-            numInvocations++;
         }
     }
 
     public void finishedDispatch()
     {
         synchronized (invocationObj) {
-            numInvocations--;
             isProcessingInvocation.set(Boolean.FALSE);
-            if (numInvocations == 0) {
-                synchronized (waitForCompletionObj) {
-                    waitForCompletionObj.notifyAll();
-                }
-            } else if (numInvocations < 0) {
-                throw wrapper.numInvocationsAlreadyZero(
-                    CompletionStatus.COMPLETED_YES ) ;
-            }
         }
     }
 
@@ -1341,12 +1340,24 @@
      */
     public synchronized void destroy()
     {
-        if (status == STATUS_OPERATING) {
+        boolean shutdownFirst = false ;
+
+        synchronized (this) {
+            shutdownFirst = (status == STATUS_OPERATING) ;
+        }
+
+        if (shutdownFirst) {
             shutdown(true);
         }
-        getCorbaTransportManager().close();
-        getPIHandler().destroyInterceptors() ;
-        status = STATUS_DESTROYED;
+
+        synchronized (this) {
+            if (status < STATUS_DESTROYED) {
+                getCorbaTransportManager().close();
+                getPIHandler().destroyInterceptors() ;
+                status = STATUS_DESTROYED;
+            }
+        }
+
     }
 
     /**
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java
index 4c43ee6..ecd9539 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -135,7 +135,7 @@
 public class ORBSingleton extends ORB
 {
     // This is used to support read_Object.
-    private static ORB fullORB;
+    private ORB fullORB;
     private static PresentationManager.StubFactoryFactory staticStubFactoryFactory =
         PresentationDefaults.getStaticStubFactoryFactory() ;
 
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
index ab5106d..dd5af6e 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -806,25 +806,6 @@
         return result ;
     }
 
-    public static void setDaemon(Thread thread)
-    {
-        // Catch exceptions since setDaemon can cause a
-        // security exception to be thrown under netscape
-        // in the Applet mode
-        final Thread finalThread = thread;
-        try {
-            AccessController.doPrivileged(new PrivilegedAction() {
-                    public java.lang.Object run() {
-                        finalThread.setDaemon(true);
-                        return null;
-                    }
-                });
-        } catch (Exception e) {
-            // REVISIT: Object to get static method. Ignore it.
-            dprint(new Object(), "setDaemon: Exception: " + e);
-        }
-    }
-
     public static String operationNameAndRequestId(CorbaMessageMediator m)
     {
         return "op/" + m.getOperationName() + " id/" + m.getRequestId();
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java
index 9d07b45..0bb9d94 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,8 @@
 import com.sun.corba.se.spi.resolver.Resolver;
 
 import com.sun.corba.se.impl.encoding.EncapsInputStream;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
+import com.sun.corba.se.impl.logging.ORBUtilSystemException;
+import com.sun.corba.se.impl.logging.OMGSystemException;
 import com.sun.corba.se.impl.naming.namingutil.INSURLHandler;
 import com.sun.corba.se.impl.naming.namingutil.IIOPEndpointInfo;
 import com.sun.corba.se.impl.naming.namingutil.INSURL;
@@ -76,6 +77,7 @@
 {
     ORB orb;
     ORBUtilSystemException wrapper ;
+    OMGSystemException omgWrapper ;
     Resolver bootstrapResolver ;
 
     // Root Naming Context for default resolution of names.
@@ -90,6 +92,8 @@
         this.orb = orb ;
         wrapper = ORBUtilSystemException.get( orb,
             CORBALogDomains.ORB_RESOLVER ) ;
+        omgWrapper = OMGSystemException.get( orb,
+            CORBALogDomains.ORB_RESOLVER ) ;
         this.bootstrapResolver = bootstrapResolver ;
     }
 
@@ -126,6 +130,8 @@
                 return getIORFromString( str ) ;
             else {
                 INSURL insURL = insURLHandler.parseURL( str ) ;
+                if (insURL == null)
+                    throw omgWrapper.soBadSchemeName() ;
                 return resolveINSURL( insURL ) ;
             }
         }
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
index e160eec..5dbfedb 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2001-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1057,7 +1057,9 @@
 
             // IIOPOutputStream will cleanup the connection info when it
             // sees this exception.
-            throw wrapper.writeErrorSend(e1) ;
+            SystemException exc = wrapper.writeErrorSend(e1);
+            purgeCalls(exc, false, true);
+            throw exc;
         }
     }
 
diff --git a/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc b/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc
index 40cdb88..7c46f35 100644
--- a/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc
+++ b/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc
@@ -1,6 +1,6 @@
 ;
 
-; Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+; Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
 ; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 ;
 ; This code is free software; you can redistribute it and/or modify it
@@ -144,6 +144,8 @@
 	     15 WARNING "Read of full message failed : bytes requested = {0} bytes read = {1} max wait time = {2} total time spent waiting = {3}")
 	    (CREATE_LISTENER_FAILED 
 	     16 SEVERE "Unable to create listener thread on the specified port: {0}")
+	    (BUFFER_READ_MANAGER_TIMEOUT
+	     17 WARNING "Timeout while reading data in buffer manager")
 	    )
 	(DATA_CONVERSION
 	    (BAD_STRINGIFIED_IOR_LEN 1  WARNING "A character did not map to the transmission code set")
diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java
index 20432ed..1722182 100644
--- a/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java
+++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2086,8 +2086,8 @@
 
     if (token.type == Token.LeftBrace) {
       repIDStack.push(((IDLID)repIDStack.peek ()).clone ()) ;
-      ((IDLID)repIDStack.peek ()).appendToName (name);
       structEntry = makeStructEntry( name, entry, false ) ;
+      ((IDLID)repIDStack.peek ()).appendToName (name);
       prep.openScope (structEntry);
       match (Token.LeftBrace) ;
       member (structEntry) ;
@@ -2174,8 +2174,8 @@
 
     if (token.type == Token.Switch) {
       repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
-      ((IDLID)repIDStack.peek ()).appendToName (name);
       unionEntry = makeUnionEntry( name, entry, false ) ;
+      ((IDLID)repIDStack.peek ()).appendToName (name);
       match (Token.Switch);
       match (Token.LeftParen);
       unionEntry.type (switchTypeSpec (unionEntry));
@@ -2641,8 +2641,8 @@
   private void exceptDcl (SymtabEntry entry) throws IOException, ParseException
   {
     match (Token.Exception);
-    ExceptionEntry exceptEntry = stFactory.exceptionEntry (entry, (IDLID)repIDStack.peek ());
     repIDStack.push (((IDLID)repIDStack.peek ()).clone ());
+    ExceptionEntry exceptEntry = stFactory.exceptionEntry (entry, (IDLID)repIDStack.peek ());
     ((IDLID)repIDStack.peek ()).appendToName (token.name);
     exceptEntry.sourceFile (scanner.fileEntry ());
     // Comment must immediately precede "exception" keyword
diff --git a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java
index 5c1f498..597d318 100644
--- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java
@@ -91,4 +91,3 @@
   }
 
 }
-
diff --git a/corba/src/share/classes/org/omg/CORBA/ORB.java b/corba/src/share/classes/org/omg/CORBA/ORB.java
index cecdefe..dde0930 100644
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -289,7 +289,7 @@
      *
      * @return the singleton ORB
      */
-    public static ORB init() {
+    public static synchronized ORB init() {
         if (singleton == null) {
             String className = getSystemProperty(ORBSingletonClassKey);
             if (className == null)
diff --git a/hotspot/.hgignore b/hotspot/.hgignore
index 2c5fe5b..fec499b 100644
--- a/hotspot/.hgignore
+++ b/hotspot/.hgignore
@@ -1,7 +1,7 @@
 ^build/
 ^dist/
 ^nbproject/private/
-^src/share/tools/hsdis/bin/
+^src/share/tools/hsdis/build/
 ^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/
 ^src/share/tools/IdealGraphVisualizer/build/
 ^src/share/tools/IdealGraphVisualizer/dist/
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 39d5182..0f927fb 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -30,3 +30,4 @@
 032c6af894dae8d939b3dd31d82042549e7793e0 jdk7-b53
 fafab5d5349c7c066d677538db67a1ee0fb33bd2 jdk7-b54
 f8e839c086152da70d6ec5913ba6f9f509282e8d jdk7-b55
+a3fd9e40ff2e854f6169eb6d09d491a28634d04f jdk7-b56
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index a99670b..03e5df8 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=16
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=01
+HS_BUILD_NUMBER=02
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties
index 6332008..2ab768f 100644
--- a/hotspot/make/jprt.properties
+++ b/hotspot/make/jprt.properties
@@ -46,24 +46,28 @@
 jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8
 jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8
 jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8
+jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8
 jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}}
 
 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
 jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8
 jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8
 jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8
+jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8
 jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
 
 jprt.my.solaris.i586.jdk7=solaris_i586_5.10
 jprt.my.solaris.i586.jdk6=solaris_i586_5.8
 jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8
 jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8
+jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8
 jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}}
 
 jprt.my.solaris.x64.jdk7=solaris_x64_5.10
 jprt.my.solaris.x64.jdk6=solaris_x64_5.10
 jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10
 jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10
+jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10
 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
 
 jprt.my.linux.i586=linux_i586
diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make
index 501268e..f88cfdf 100644
--- a/hotspot/make/solaris/makefiles/sparcWorks.make
+++ b/hotspot/make/solaris/makefiles/sparcWorks.make
@@ -46,7 +46,7 @@
 $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p')
 
 # Pick which compiler is validated
-ifeq ($(JDK_MINOR_VERSION),6)
+ifeq ($(JRE_RELEASE_VER),1.6.0)
   # Validated compiler for JDK6 is SS11 (5.8)
   VALIDATED_COMPILER_REV   := 5.8
   VALIDATED_C_COMPILER_REV := 5.8
@@ -101,18 +101,9 @@
 
 # New architecture options started in SS12 (5.9), we need both styles to build.
 #   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
-#   Note: SS12 default for 32bit sparc is now the same as v8plus, so the
-#         settings below have changed all SS12 32bit sparc builds to be v8plus.
-#         The older SS11 (5.8) settings have remained as they always have been.
-ifeq ($(TYPE),COMPILER2)
-  ARCHFLAG_OLD/sparc   = -xarch=v8plus
-else
-  ifeq ($(TYPE),TIERED)
-    ARCHFLAG_OLD/sparc = -xarch=v8plus
-  else
-    ARCHFLAG_OLD/sparc = -xarch=v8
-  endif
-endif
+#   Note: default for 32bit sparc is now the same as v8plus, so the
+#         settings below have changed all 32bit sparc builds to be v8plus.
+ARCHFLAG_OLD/sparc   = -xarch=v8plus
 ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
 ARCHFLAG_OLD/sparcv9 = -xarch=v9
 ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make
index 151c280..eafb441 100644
--- a/hotspot/make/windows/makefiles/vm.make
+++ b/hotspot/make/windows/makefiles/vm.make
@@ -55,10 +55,16 @@
 CPP_FLAGS=$(CPP_FLAGS) /D "COMPILER1" /D "COMPILER2"
 !endif
 
+!if "$(BUILDARCH)" == "i486"
+HOTSPOT_LIB_ARCH=i386
+!else
+HOTSPOT_LIB_ARCH=$(BUILDARCH)
+!endif
+
 # The following variables are defined in the generated local.make file.
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_RELEASE_VERSION=\"$(HS_BUILD_VER)\""
 CPP_FLAGS=$(CPP_FLAGS) /D "JRE_RELEASE_VERSION=\"$(JRE_RELEASE_VER)\""
-CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(BUILDARCH)\""
+CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_LIB_ARCH=\"$(HOTSPOT_LIB_ARCH)\""
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\""
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
index d36caf5..b9d8047 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
@@ -25,24 +25,36 @@
 #include "incls/_precompiled.incl"
 #include "incls/_assembler_sparc.cpp.incl"
 
-// Implementation of Address
-
-Address::Address( addr_type t, int which ) {
-  switch (t) {
-   case extra_in_argument:
-   case extra_out_argument:
-     _base = t == extra_in_argument ? FP : SP;
-     _hi   = 0;
-// Warning:  In LP64 mode, _disp will occupy more than 10 bits.
-//           This is inconsistent with the other constructors but op
-//           codes such as ld or ldx, only access disp() to get their
-//           simm13 argument.
-     _disp = ((which - Argument::n_register_parameters + frame::memory_parameter_word_sp_offset) * BytesPerWord) + STACK_BIAS;
-    break;
-   default:
-    ShouldNotReachHere();
-    break;
+// Convert the raw encoding form into the form expected by the
+// constructor for Address.
+Address Address::make_raw(int base, int index, int scale, int disp, bool disp_is_oop) {
+  assert(scale == 0, "not supported");
+  RelocationHolder rspec;
+  if (disp_is_oop) {
+    rspec = Relocation::spec_simple(relocInfo::oop_type);
   }
+
+  Register rindex = as_Register(index);
+  if (rindex != G0) {
+    Address madr(as_Register(base), rindex);
+    madr._rspec = rspec;
+    return madr;
+  } else {
+    Address madr(as_Register(base), disp);
+    madr._rspec = rspec;
+    return madr;
+  }
+}
+
+Address Argument::address_in_frame() const {
+  // Warning: In LP64 mode disp will occupy more than 10 bits, but
+  //          op codes such as ld or ldx, only access disp() to get
+  //          their simm13 argument.
+  int disp = ((_number - Argument::n_register_parameters + frame::memory_parameter_word_sp_offset) * BytesPerWord) + STACK_BIAS;
+  if (is_in())
+    return Address(FP, disp); // In argument.
+  else
+    return Address(SP, disp); // Out argument.
 }
 
 static const char* argumentNames[][2] = {
@@ -614,16 +626,17 @@
 }
 
 // This code sequence is relocatable to any address, even on LP64.
-void MacroAssembler::jumpl( Address& a, Register d, int offset, const char* file, int line ) {
+void MacroAssembler::jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) {
   assert_not_delayed();
   // Force fixed length sethi because NativeJump and NativeFarCall don't handle
   // variable length instruction streams.
-  sethi(a, /*ForceRelocatable=*/ true);
+  patchable_sethi(addrlit, temp);
+  Address a(temp, addrlit.low10() + offset);  // Add the offset to the displacement.
   if (TraceJumps) {
 #ifndef PRODUCT
     // Must do the add here so relocation can find the remainder of the
     // value to be relocated.
-    add(a.base(), a.disp() + offset, a.base(), a.rspec(offset));
+    add(a.base(), a.disp(), a.base(), addrlit.rspec(offset));
     save_frame(0);
     verify_thread();
     ld(G2_thread, in_bytes(JavaThread::jmp_ring_index_offset()), O0);
@@ -652,15 +665,15 @@
     restore();
     jmpl(a.base(), G0, d);
 #else
-    jmpl(a, d, offset);
+    jmpl(a.base(), a.disp(), d);
 #endif /* PRODUCT */
   } else {
-    jmpl(a, d, offset);
+    jmpl(a.base(), a.disp(), d);
   }
 }
 
-void MacroAssembler::jump( Address& a, int offset, const char* file, int line ) {
-  jumpl( a, G0, offset, file, line );
+void MacroAssembler::jump(AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
+  jumpl(addrlit, temp, G0, offset, file, line);
 }
 
 
@@ -678,7 +691,8 @@
     st_ptr(savePtr.as_register(), savePtr.address_in_frame());
   }
   // return the address of the first memory slot
-  add(inArg.address_in_frame(), d);
+  Address a = inArg.address_in_frame();
+  add(a.base(), a.disp(), d);
 }
 
 // Conditional breakpoint (for assertion checks in assembly code)
@@ -702,7 +716,6 @@
 // offset to write to within the page. This minimizes bus traffic
 // due to cache line collision.
 void MacroAssembler::serialize_memory(Register thread, Register tmp1, Register tmp2) {
-  Address mem_serialize_page(tmp1, os::get_memory_serialize_page());
   srl(thread, os::get_serialize_page_shift_count(), tmp2);
   if (Assembler::is_simm13(os::vm_page_size())) {
     and3(tmp2, (os::vm_page_size() - sizeof(int)), tmp2);
@@ -711,7 +724,7 @@
     set((os::vm_page_size() - sizeof(int)), tmp1);
     and3(tmp2, tmp1, tmp2);
   }
-  load_address(mem_serialize_page);
+  set(os::get_memory_serialize_page(), tmp1);
   st(G0, tmp1, tmp2);
 }
 
@@ -830,10 +843,10 @@
   mov(G3, L2);                  // avoid clobbering G3 also
   mov(G4, L5);                  // avoid clobbering G4
 #ifdef ASSERT
-  Address last_get_thread_addr(L3, (address)&last_get_thread);
-  sethi(last_get_thread_addr);
+  AddressLiteral last_get_thread_addrlit(&last_get_thread);
+  set(last_get_thread_addrlit, L3);
   inc(L4, get_pc(L4) + 2 * BytesPerInstWord); // skip getpc() code + inc + st_ptr to point L4 at call
-  st_ptr(L4, last_get_thread_addr);
+  st_ptr(L4, L3, 0);
 #endif
   call(CAST_FROM_FN_PTR(address, reinitialize_thread), relocInfo::runtime_call_type);
   delayed()->nop();
@@ -919,13 +932,9 @@
 // %%% maybe get rid of [re]set_last_Java_frame
 void MacroAssembler::set_last_Java_frame(Register last_java_sp, Register last_Java_pc) {
   assert_not_delayed();
-  Address flags(G2_thread,
-                0,
-                in_bytes(JavaThread::frame_anchor_offset()) +
-                         in_bytes(JavaFrameAnchor::flags_offset()));
-  Address pc_addr(G2_thread,
-                  0,
-                  in_bytes(JavaThread::last_Java_pc_offset()));
+  Address flags(G2_thread, JavaThread::frame_anchor_offset() +
+                           JavaFrameAnchor::flags_offset());
+  Address pc_addr(G2_thread, JavaThread::last_Java_pc_offset());
 
   // Always set last_Java_pc and flags first because once last_Java_sp is visible
   // has_last_Java_frame is true and users will look at the rest of the fields.
@@ -977,22 +986,18 @@
 #endif // ASSERT
   assert( last_java_sp != G4_scratch, "bad register usage in set_last_Java_frame");
   add( last_java_sp, STACK_BIAS, G4_scratch );
-  st_ptr(G4_scratch,    Address(G2_thread, 0, in_bytes(JavaThread::last_Java_sp_offset())));
+  st_ptr(G4_scratch, G2_thread, JavaThread::last_Java_sp_offset());
 #else
-  st_ptr(last_java_sp,    Address(G2_thread, 0, in_bytes(JavaThread::last_Java_sp_offset())));
+  st_ptr(last_java_sp, G2_thread, JavaThread::last_Java_sp_offset());
 #endif // _LP64
 }
 
 void MacroAssembler::reset_last_Java_frame(void) {
   assert_not_delayed();
 
-  Address sp_addr(G2_thread, 0, in_bytes(JavaThread::last_Java_sp_offset()));
-  Address pc_addr(G2_thread,
-                  0,
-                  in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::last_Java_pc_offset()));
-  Address flags(G2_thread,
-                0,
-                in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset()));
+  Address sp_addr(G2_thread, JavaThread::last_Java_sp_offset());
+  Address pc_addr(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset());
+  Address flags  (G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset());
 
 #ifdef ASSERT
   // check that it WAS previously set
@@ -1063,7 +1068,7 @@
   check_and_handle_popframe(scratch_reg);
   check_and_handle_earlyret(scratch_reg);
 
-  Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
+  Address exception_addr(G2_thread, Thread::pending_exception_offset());
   ld_ptr(exception_addr, scratch_reg);
   br_null(scratch_reg,false,pt,L);
   delayed()->nop();
@@ -1186,7 +1191,7 @@
 
 void MacroAssembler::get_vm_result(Register oop_result) {
   verify_thread();
-  Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset()));
+  Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
   ld_ptr(    vm_result_addr, oop_result);
   st_ptr(G0, vm_result_addr);
   verify_oop(oop_result);
@@ -1195,7 +1200,7 @@
 
 void MacroAssembler::get_vm_result_2(Register oop_result) {
   verify_thread();
-  Address vm_result_addr_2(G2_thread, 0, in_bytes(JavaThread::vm_result_2_offset()));
+  Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
   ld_ptr(vm_result_addr_2, oop_result);
   st_ptr(G0, vm_result_addr_2);
   verify_oop(oop_result);
@@ -1206,7 +1211,7 @@
 // leave it undisturbed.
 void MacroAssembler::set_vm_result(Register oop_result) {
   verify_thread();
-  Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset()));
+  Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
   verify_oop(oop_result);
 
 # ifdef ASSERT
@@ -1234,81 +1239,78 @@
 #else
   srl(obj, CardTableModRefBS::card_shift, obj);
 #endif
-  assert( tmp != obj, "need separate temp reg");
-  Address rs(tmp, (address)byte_map_base);
-  load_address(rs);
-  stb(G0, rs.base(), obj);
-}
-
-// %%% Note:  The following six instructions have been moved,
-//            unchanged, from assembler_sparc.inline.hpp.
-//            They will be refactored at a later date.
-
-void MacroAssembler::sethi(intptr_t imm22a,
-                            Register d,
-                            bool ForceRelocatable,
-                            RelocationHolder const& rspec) {
-  Address adr( d, (address)imm22a, rspec );
-  MacroAssembler::sethi( adr, ForceRelocatable );
+  assert(tmp != obj, "need separate temp reg");
+  set((address) byte_map_base, tmp);
+  stb(G0, tmp, obj);
 }
 
 
-void MacroAssembler::sethi(Address& a, bool ForceRelocatable) {
+void MacroAssembler::internal_sethi(const AddressLiteral& addrlit, Register d, bool ForceRelocatable) {
   address save_pc;
   int shiftcnt;
-  // if addr of local, do not need to load it
-  assert(a.base() != FP  &&  a.base() != SP, "just use ld or st for locals");
 #ifdef _LP64
 # ifdef CHECK_DELAY
-  assert_not_delayed( (char *)"cannot put two instructions in delay slot" );
+  assert_not_delayed((char*) "cannot put two instructions in delay slot");
 # endif
   v9_dep();
-//  ForceRelocatable = 1;
   save_pc = pc();
-  if (a.hi32() == 0 && a.low32() >= 0) {
-    Assembler::sethi(a.low32(), a.base(), a.rspec());
+
+  int msb32 = (int) (addrlit.value() >> 32);
+  int lsb32 = (int) (addrlit.value());
+
+  if (msb32 == 0 && lsb32 >= 0) {
+    Assembler::sethi(lsb32, d, addrlit.rspec());
   }
-  else if (a.hi32() == -1) {
-    Assembler::sethi(~a.low32(), a.base(), a.rspec());
-    xor3(a.base(), ~low10(~0), a.base());
+  else if (msb32 == -1) {
+    Assembler::sethi(~lsb32, d, addrlit.rspec());
+    xor3(d, ~low10(~0), d);
   }
   else {
-    Assembler::sethi(a.hi32(), a.base(), a.rspec() );   // 22
-    if ( a.hi32() & 0x3ff )                     // Any bits?
-      or3( a.base(), a.hi32() & 0x3ff ,a.base() ); // High 32 bits are now in low 32
-    if ( a.low32() & 0xFFFFFC00 ) {             // done?
-      if( (a.low32() >> 20) & 0xfff ) {         // Any bits set?
-        sllx(a.base(), 12, a.base());           // Make room for next 12 bits
-        or3( a.base(), (a.low32() >> 20) & 0xfff,a.base() ); // Or in next 12
-        shiftcnt = 0;                           // We already shifted
+    Assembler::sethi(msb32, d, addrlit.rspec());  // msb 22-bits
+    if (msb32 & 0x3ff)                            // Any bits?
+      or3(d, msb32 & 0x3ff, d);                   // msb 32-bits are now in lsb 32
+    if (lsb32 & 0xFFFFFC00) {                     // done?
+      if ((lsb32 >> 20) & 0xfff) {                // Any bits set?
+        sllx(d, 12, d);                           // Make room for next 12 bits
+        or3(d, (lsb32 >> 20) & 0xfff, d);         // Or in next 12
+        shiftcnt = 0;                             // We already shifted
       }
       else
         shiftcnt = 12;
-      if( (a.low32() >> 10) & 0x3ff ) {
-        sllx(a.base(), shiftcnt+10, a.base());// Make room for last 10 bits
-        or3( a.base(), (a.low32() >> 10) & 0x3ff,a.base() ); // Or in next 10
+      if ((lsb32 >> 10) & 0x3ff) {
+        sllx(d, shiftcnt + 10, d);                // Make room for last 10 bits
+        or3(d, (lsb32 >> 10) & 0x3ff, d);         // Or in next 10
         shiftcnt = 0;
       }
       else
         shiftcnt = 10;
-      sllx(a.base(), shiftcnt+10 , a.base());           // Shift leaving disp field 0'd
+      sllx(d, shiftcnt + 10, d);                  // Shift leaving disp field 0'd
     }
     else
-      sllx( a.base(), 32, a.base() );
+      sllx(d, 32, d);
   }
-  // Pad out the instruction sequence so it can be
-  // patched later.
-  if ( ForceRelocatable || (a.rtype() != relocInfo::none &&
-                            a.rtype() != relocInfo::runtime_call_type) ) {
-    while ( pc() < (save_pc + (7 * BytesPerInstWord )) )
+  // Pad out the instruction sequence so it can be patched later.
+  if (ForceRelocatable || (addrlit.rtype() != relocInfo::none &&
+                           addrlit.rtype() != relocInfo::runtime_call_type)) {
+    while (pc() < (save_pc + (7 * BytesPerInstWord)))
       nop();
   }
 #else
-  Assembler::sethi(a.hi(), a.base(), a.rspec());
+  Assembler::sethi(addrlit.value(), d, addrlit.rspec());
 #endif
-
 }
 
+
+void MacroAssembler::sethi(const AddressLiteral& addrlit, Register d) {
+  internal_sethi(addrlit, d, false);
+}
+
+
+void MacroAssembler::patchable_sethi(const AddressLiteral& addrlit, Register d) {
+  internal_sethi(addrlit, d, true);
+}
+
+
 int MacroAssembler::size_of_sethi(address a, bool worst_case) {
 #ifdef _LP64
   if (worst_case) return 7;
@@ -1339,61 +1341,50 @@
   return size_of_sethi(NULL, true) + 1;
 }
 
-void MacroAssembler::set(intptr_t value, Register d,
-                         RelocationHolder const& rspec) {
-  Address val( d, (address)value, rspec);
 
-  if ( rspec.type() == relocInfo::none ) {
+void MacroAssembler::internal_set(const AddressLiteral& addrlit, Register d, bool ForceRelocatable) {
+  intptr_t value = addrlit.value();
+
+  if (!ForceRelocatable && addrlit.rspec().type() == relocInfo::none) {
     // can optimize
-    if (-4096 <= value  &&  value <= 4095) {
+    if (-4096 <= value && value <= 4095) {
       or3(G0, value, d); // setsw (this leaves upper 32 bits sign-extended)
       return;
     }
     if (inv_hi22(hi22(value)) == value) {
-      sethi(val);
+      sethi(addrlit, d);
       return;
     }
   }
-  assert_not_delayed( (char *)"cannot put two instructions in delay slot" );
-  sethi( val );
-  if (rspec.type() != relocInfo::none || (value & 0x3ff) != 0) {
-    add( d, value &  0x3ff, d, rspec);
+  assert_not_delayed((char*) "cannot put two instructions in delay slot");
+  internal_sethi(addrlit, d, ForceRelocatable);
+  if (ForceRelocatable || addrlit.rspec().type() != relocInfo::none || addrlit.low10() != 0) {
+    add(d, addrlit.low10(), d, addrlit.rspec());
   }
 }
 
-void MacroAssembler::setsw(int value, Register d,
-                           RelocationHolder const& rspec) {
-  Address val( d, (address)value, rspec);
-  if ( rspec.type() == relocInfo::none ) {
-    // can optimize
-    if (-4096 <= value  &&  value <= 4095) {
-      or3(G0, value, d);
-      return;
-    }
-    if (inv_hi22(hi22(value)) == value) {
-      sethi( val );
-#ifndef _LP64
-      if ( value < 0 ) {
-        assert_not_delayed();
-        sra (d, G0, d);
-      }
-#endif
-      return;
-    }
-  }
-  assert_not_delayed();
-  sethi( val );
-  add( d, value &  0x3ff, d, rspec);
-
-  // (A negative value could be loaded in 2 insns with sethi/xor,
-  // but it would take a more complex relocation.)
-#ifndef _LP64
-  if ( value < 0)
-    sra(d, G0, d);
-#endif
+void MacroAssembler::set(const AddressLiteral& al, Register d) {
+  internal_set(al, d, false);
 }
 
-// %%% End of moved six set instructions.
+void MacroAssembler::set(intptr_t value, Register d) {
+  AddressLiteral al(value);
+  internal_set(al, d, false);
+}
+
+void MacroAssembler::set(address addr, Register d, RelocationHolder const& rspec) {
+  AddressLiteral al(addr, rspec);
+  internal_set(al, d, false);
+}
+
+void MacroAssembler::patchable_set(const AddressLiteral& al, Register d) {
+  internal_set(al, d, true);
+}
+
+void MacroAssembler::patchable_set(intptr_t value, Register d) {
+  AddressLiteral al(value);
+  internal_set(al, d, true);
+}
 
 
 void MacroAssembler::set64(jlong value, Register d, Register tmp) {
@@ -1512,17 +1503,17 @@
 }
 
 
-Address MacroAssembler::allocate_oop_address(jobject obj, Register d) {
+AddressLiteral MacroAssembler::allocate_oop_address(jobject obj) {
   assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
   int oop_index = oop_recorder()->allocate_index(obj);
-  return Address(d, address(obj), oop_Relocation::spec(oop_index));
+  return AddressLiteral(obj, oop_Relocation::spec(oop_index));
 }
 
 
-Address MacroAssembler::constant_oop_address(jobject obj, Register d) {
+AddressLiteral MacroAssembler::constant_oop_address(jobject obj) {
   assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
   int oop_index = oop_recorder()->find_index(obj);
-  return Address(d, address(obj), oop_Relocation::spec(oop_index));
+  return AddressLiteral(obj, oop_Relocation::spec(oop_index));
 }
 
 void  MacroAssembler::set_narrow_oop(jobject obj, Register d) {
@@ -1682,7 +1673,7 @@
   sprintf(real_msg, "%s%s(%s:%d)", msg, buffer, file, line);
 
   // Call indirectly to solve generation ordering problem
-  Address a(O7, (address)StubRoutines::verify_oop_subroutine_entry_address());
+  AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
 
   // Make some space on stack above the current register window.
   // Enough to hold 8 64-bit registers.
@@ -1718,7 +1709,7 @@
   sprintf(real_msg, "%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
 
   // Call indirectly to solve generation ordering problem
-  Address a(O7, (address)StubRoutines::verify_oop_subroutine_entry_address());
+  AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
 
   // Make some space on stack above the current register window.
   // Enough to hold 8 64-bit registers.
@@ -1772,11 +1763,7 @@
   { // count number of verifies
     Register O2_adr   = O2;
     Register O3_accum = O3;
-    Address count_addr( O2_adr, (address) StubRoutines::verify_oop_count_addr() );
-    sethi(count_addr);
-    ld(count_addr, O3_accum);
-    inc(O3_accum);
-    st(O3_accum, count_addr);
+    inc_counter(StubRoutines::verify_oop_count_addr(), O2_adr, O3_accum);
   }
 
   Register O2_mask = O2;
@@ -1870,8 +1857,8 @@
   assert(StubRoutines::Sparc::stop_subroutine_entry_address(), "hasn't been generated yet");
 
   // call indirectly to solve generation ordering problem
-  Address a(O5, (address)StubRoutines::Sparc::stop_subroutine_entry_address());
-  load_ptr_contents(a, O5);
+  AddressLiteral al(StubRoutines::Sparc::stop_subroutine_entry_address());
+  load_ptr_contents(al, O5);
   jmpl(O5, 0, O7);
   delayed()->nop();
 }
@@ -1891,7 +1878,7 @@
     assert(StubRoutines::Sparc::stop_subroutine_entry_address(), "hasn't been generated yet");
 
     // call indirectly to solve generation ordering problem
-    Address a(O5, (address)StubRoutines::Sparc::stop_subroutine_entry_address());
+    AddressLiteral a(StubRoutines::Sparc::stop_subroutine_entry_address());
     load_ptr_contents(a, O5);
     jmpl(O5, 0, O7);
     delayed()->nop();
@@ -2003,7 +1990,7 @@
   subcc( Rparam_words, Argument::n_register_parameters, Rresult); // how many mem words?
   Label no_extras;
   br( negative, true, pt, no_extras ); // if neg, clear reg
-  delayed()->set( 0, Rresult);         // annuled, so only if taken
+  delayed()->set(0, Rresult);          // annuled, so only if taken
   bind( no_extras );
 }
 
@@ -2623,7 +2610,7 @@
     return RegisterOrConstant(value + offset);
 
   // load indirectly to solve generation ordering problem
-  Address a(tmp, (address) delayed_value_addr);
+  AddressLiteral a(delayed_value_addr);
   load_ptr_contents(a, tmp);
 
 #ifdef ASSERT
@@ -3107,21 +3094,21 @@
   delayed()->nop();
 
   load_klass(obj_reg, temp_reg);
-  ld_ptr(Address(temp_reg, 0, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
+  ld_ptr(Address(temp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
   or3(G2_thread, temp_reg, temp_reg);
   xor3(mark_reg, temp_reg, temp_reg);
   andcc(temp_reg, ~((int) markOopDesc::age_mask_in_place), temp_reg);
   if (counters != NULL) {
     cond_inc(Assembler::equal, (address) counters->biased_lock_entry_count_addr(), mark_reg, temp_reg);
     // Reload mark_reg as we may need it later
-    ld_ptr(Address(obj_reg, 0, oopDesc::mark_offset_in_bytes()), mark_reg);
+    ld_ptr(Address(obj_reg, oopDesc::mark_offset_in_bytes()), mark_reg);
   }
   brx(Assembler::equal, true, Assembler::pt, done);
   delayed()->nop();
 
   Label try_revoke_bias;
   Label try_rebias;
-  Address mark_addr = Address(obj_reg, 0, oopDesc::mark_offset_in_bytes());
+  Address mark_addr = Address(obj_reg, oopDesc::mark_offset_in_bytes());
   assert(mark_addr.disp() == 0, "cas must take a zero displacement");
 
   // At this point we know that the header has the bias pattern and
@@ -3185,7 +3172,7 @@
   // FIXME: due to a lack of registers we currently blow away the age
   // bits in this situation. Should attempt to preserve them.
   load_klass(obj_reg, temp_reg);
-  ld_ptr(Address(temp_reg, 0, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
+  ld_ptr(Address(temp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
   or3(G2_thread, temp_reg, temp_reg);
   casn(mark_addr.base(), mark_reg, temp_reg);
   // If the biasing toward our thread failed, this means that
@@ -3216,7 +3203,7 @@
   // FIXME: due to a lack of registers we currently blow away the age
   // bits in this situation. Should attempt to preserve them.
   load_klass(obj_reg, temp_reg);
-  ld_ptr(Address(temp_reg, 0, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
+  ld_ptr(Address(temp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()), temp_reg);
   casn(mark_addr.base(), mark_reg, temp_reg);
   // Fall through to the normal CAS-based lock, because no matter what
   // the result of the above CAS, some thread must have succeeded in
@@ -3283,7 +3270,7 @@
                                           Register Rbox, Register Rscratch,
                                           BiasedLockingCounters* counters,
                                           bool try_bias) {
-   Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes());
+   Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
 
    verify_oop(Roop);
    Label done ;
@@ -3386,7 +3373,7 @@
          // If m->owner != null goto IsLocked
          // Pessimistic form: Test-and-CAS vs CAS
          // The optimistic form avoids RTS->RTO cache line upgrades.
-         ld_ptr (Address (Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2), Rscratch) ;
+         ld_ptr (Rmark, ObjectMonitor::owner_offset_in_bytes() - 2, Rscratch);
          andcc  (Rscratch, Rscratch, G0) ;
          brx    (Assembler::notZero, false, Assembler::pn, done) ;
          delayed()->nop() ;
@@ -3482,7 +3469,7 @@
          // Test-and-CAS vs CAS
          // Pessimistic form avoids futile (doomed) CAS attempts
          // The optimistic form avoids RTS->RTO cache line upgrades.
-         ld_ptr (Address (Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2), Rscratch) ;
+         ld_ptr (Rmark, ObjectMonitor::owner_offset_in_bytes() - 2, Rscratch);
          andcc  (Rscratch, Rscratch, G0) ;
          brx    (Assembler::notZero, false, Assembler::pn, done) ;
          delayed()->nop() ;
@@ -3508,7 +3495,7 @@
 void MacroAssembler::compiler_unlock_object(Register Roop, Register Rmark,
                                             Register Rbox, Register Rscratch,
                                             bool try_bias) {
-   Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes());
+   Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
 
    Label done ;
 
@@ -3568,14 +3555,14 @@
    // Note that we use 1-0 locking by default for the inflated case.  We
    // close the resultant (and rare) race by having contented threads in
    // monitorenter periodically poll _owner.
-   ld_ptr (Address(Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2), Rscratch) ;
-   ld_ptr (Address(Rmark, 0, ObjectMonitor::recursions_offset_in_bytes()-2), Rbox) ;
+   ld_ptr (Rmark, ObjectMonitor::owner_offset_in_bytes() - 2, Rscratch);
+   ld_ptr (Rmark, ObjectMonitor::recursions_offset_in_bytes() - 2, Rbox);
    xor3   (Rscratch, G2_thread, Rscratch) ;
    orcc   (Rbox, Rscratch, Rbox) ;
    brx    (Assembler::notZero, false, Assembler::pn, done) ;
    delayed()->
-   ld_ptr (Address (Rmark, 0, ObjectMonitor::EntryList_offset_in_bytes()-2), Rscratch) ;
-   ld_ptr (Address (Rmark, 0, ObjectMonitor::cxq_offset_in_bytes()-2), Rbox) ;
+   ld_ptr (Rmark, ObjectMonitor::EntryList_offset_in_bytes() - 2, Rscratch);
+   ld_ptr (Rmark, ObjectMonitor::cxq_offset_in_bytes() - 2, Rbox);
    orcc   (Rbox, Rscratch, G0) ;
    if (EmitSync & 65536) {
       Label LSucc ;
@@ -3583,12 +3570,12 @@
       delayed()->nop() ;
       br     (Assembler::always, false, Assembler::pt, done) ;
       delayed()->
-      st_ptr (G0, Address (Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2)) ;
+      st_ptr (G0, Rmark, ObjectMonitor::owner_offset_in_bytes() - 2);
 
       bind   (LSucc) ;
-      st_ptr (G0, Address (Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2)) ;
+      st_ptr (G0, Rmark, ObjectMonitor::owner_offset_in_bytes() - 2);
       if (os::is_MP()) { membar (StoreLoad) ; }
-      ld_ptr (Address (Rmark, 0, ObjectMonitor::succ_offset_in_bytes()-2), Rscratch) ;
+      ld_ptr (Rmark, ObjectMonitor::succ_offset_in_bytes() - 2, Rscratch);
       andcc  (Rscratch, Rscratch, G0) ;
       brx    (Assembler::notZero, false, Assembler::pt, done) ;
       delayed()-> andcc (G0, G0, G0) ;
@@ -3606,7 +3593,7 @@
       delayed()->nop() ;
       br     (Assembler::always, false, Assembler::pt, done) ;
       delayed()->
-      st_ptr (G0, Address (Rmark, 0, ObjectMonitor::owner_offset_in_bytes()-2)) ;
+      st_ptr (G0, Rmark, ObjectMonitor::owner_offset_in_bytes() - 2);
    }
 
    bind   (LStacked) ;
@@ -4005,20 +3992,26 @@
   bind(L);
 }
 
-void MacroAssembler::inc_counter(address counter_ptr, Register Rtmp1, Register Rtmp2) {
-  Address counter_addr(Rtmp1, counter_ptr);
-  load_contents(counter_addr, Rtmp2);
+void MacroAssembler::inc_counter(address counter_addr, Register Rtmp1, Register Rtmp2) {
+  AddressLiteral addrlit(counter_addr);
+  sethi(addrlit, Rtmp1);                 // Move hi22 bits into temporary register.
+  Address addr(Rtmp1, addrlit.low10());  // Build an address with low10 bits.
+  ld(addr, Rtmp2);
   inc(Rtmp2);
-  store_contents(Rtmp2, counter_addr);
+  st(Rtmp2, addr);
+}
+
+void MacroAssembler::inc_counter(int* counter_addr, Register Rtmp1, Register Rtmp2) {
+  inc_counter((address) counter_addr, Rtmp1, Rtmp2);
 }
 
 SkipIfEqual::SkipIfEqual(
     MacroAssembler* masm, Register temp, const bool* flag_addr,
     Assembler::Condition condition) {
   _masm = masm;
-  Address flag(temp, (address)flag_addr, relocInfo::none);
-  _masm->sethi(flag);
-  _masm->ldub(flag, temp);
+  AddressLiteral flag(flag_addr);
+  _masm->sethi(flag, temp);
+  _masm->ldub(temp, flag.low10(), temp);
   _masm->tst(temp);
   _masm->br(condition, false, Assembler::pt, _label);
   _masm->delayed()->nop();
@@ -4333,8 +4326,8 @@
 #else
   masm.srl(O0, CardTableModRefBS::card_shift, O0);
 #endif
-  Address rs(O1, (address)byte_map_base);
-  masm.load_address(rs); // O1 := <card table base>
+  AddressLiteral addrlit(byte_map_base);
+  masm.set(addrlit, O1); // O1 := <card table base>
   masm.ldub(O0, O1, O2); // O2 := [O0 + O1]
 
   masm.br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
@@ -4494,10 +4487,9 @@
 #else
     post_filter_masm->srl(store_addr, CardTableModRefBS::card_shift, store_addr);
 #endif
-    assert( tmp != store_addr, "need separate temp reg");
-    Address rs(tmp, (address)bs->byte_map_base);
-    load_address(rs);
-    stb(G0, rs.base(), store_addr);
+    assert(tmp != store_addr, "need separate temp reg");
+    set(bs->byte_map_base, tmp);
+    stb(G0, tmp, store_addr);
   }
 
   bind(filtered);
@@ -4516,24 +4508,6 @@
   card_table_write(bs->byte_map_base, tmp, store_addr);
 }
 
-// Loading values by size and signed-ness
-void MacroAssembler::load_sized_value(Register s1, RegisterOrConstant s2, Register d,
-                                      int size_in_bytes, bool is_signed) {
-  switch (size_in_bytes ^ (is_signed ? -1 : 0)) {
-  case ~8:  // fall through:
-  case  8:  ld_long( s1, s2, d ); break;
-  case ~4:  ldsw(    s1, s2, d ); break;
-  case  4:  lduw(    s1, s2, d ); break;
-  case ~2:  ldsh(    s1, s2, d ); break;
-  case  2:  lduh(    s1, s2, d ); break;
-  case ~1:  ldsb(    s1, s2, d ); break;
-  case  1:  ldub(    s1, s2, d ); break;
-  default:  ShouldNotReachHere();
-  }
-}
-
-
-
 void MacroAssembler::load_klass(Register src_oop, Register klass) {
   // The number of bytes in this code is used by
   // MachCallDynamicJavaNode::ret_addr_offset()
@@ -4563,12 +4537,12 @@
   }
 }
 
-void MacroAssembler::load_heap_oop(const Address& s, Register d, int offset) {
+void MacroAssembler::load_heap_oop(const Address& s, Register d) {
   if (UseCompressedOops) {
-    lduw(s, d, offset);
+    lduw(s, d);
     decode_heap_oop(d);
   } else {
-    ld_ptr(s, d, offset);
+    ld_ptr(s, d);
   }
 }
 
@@ -4714,7 +4688,7 @@
 void MacroAssembler::reinit_heapbase() {
   if (UseCompressedOops) {
     // call indirectly to solve generation ordering problem
-    Address base(G6_heapbase, (address)Universe::narrow_oop_base_addr());
+    AddressLiteral base(Universe::narrow_oop_base_addr());
     load_ptr_contents(base, G6_heapbase);
   }
 }
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
index cfd9359..cd538ad 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
@@ -274,21 +274,90 @@
 
 class Address VALUE_OBJ_CLASS_SPEC {
  private:
-  Register              _base;
-#ifdef _LP64
-  int                   _hi32;          // bits 63::32
-  int                   _low32;         // bits 31::0
-#endif
-  int                   _hi;
-  int                   _disp;
-  RelocationHolder      _rspec;
+  Register           _base;           // Base register.
+  RegisterOrConstant _index_or_disp;  // Index register or constant displacement.
+  RelocationHolder   _rspec;
 
-  RelocationHolder rspec_from_rtype(relocInfo::relocType rt, address a = NULL) {
-    switch (rt) {
+ public:
+  Address() : _base(noreg), _index_or_disp(noreg) {}
+
+  Address(Register base, RegisterOrConstant index_or_disp)
+    : _base(base),
+      _index_or_disp(index_or_disp) {
+  }
+
+  Address(Register base, Register index)
+    : _base(base),
+      _index_or_disp(index) {
+  }
+
+  Address(Register base, int disp)
+    : _base(base),
+      _index_or_disp(disp) {
+  }
+
+#ifdef ASSERT
+  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+  Address(Register base, ByteSize disp)
+    : _base(base),
+      _index_or_disp(in_bytes(disp)) {
+  }
+#endif
+
+  // accessors
+  Register base()      const { return _base; }
+  Register index()     const { return _index_or_disp.as_register(); }
+  int      disp()      const { return _index_or_disp.as_constant(); }
+
+  bool     has_index() const { return _index_or_disp.is_register(); }
+  bool     has_disp()  const { return _index_or_disp.is_constant(); }
+
+  const relocInfo::relocType rtype() { return _rspec.type(); }
+  const RelocationHolder&    rspec() { return _rspec; }
+
+  RelocationHolder rspec(int offset) const {
+    return offset == 0 ? _rspec : _rspec.plus(offset);
+  }
+
+  inline bool is_simm13(int offset = 0);  // check disp+offset for overflow
+
+  Address plus_disp(int plusdisp) const {     // bump disp by a small amount
+    assert(_index_or_disp.is_constant(), "must have a displacement");
+    Address a(base(), disp() + plusdisp);
+    return a;
+  }
+
+  Address after_save() const {
+    Address a = (*this);
+    a._base = a._base->after_save();
+    return a;
+  }
+
+  Address after_restore() const {
+    Address a = (*this);
+    a._base = a._base->after_restore();
+    return a;
+  }
+
+  // Convert the raw encoding form into the form expected by the
+  // constructor for Address.
+  static Address make_raw(int base, int index, int scale, int disp, bool disp_is_oop);
+
+  friend class Assembler;
+};
+
+
+class AddressLiteral VALUE_OBJ_CLASS_SPEC {
+ private:
+  address          _address;
+  RelocationHolder _rspec;
+
+  RelocationHolder rspec_from_rtype(relocInfo::relocType rtype, address addr) {
+    switch (rtype) {
     case relocInfo::external_word_type:
-      return external_word_Relocation::spec(a);
+      return external_word_Relocation::spec(addr);
     case relocInfo::internal_word_type:
-      return internal_word_Relocation::spec(a);
+      return internal_word_Relocation::spec(addr);
 #ifdef _LP64
     case relocInfo::opt_virtual_call_type:
       return opt_virtual_call_Relocation::spec();
@@ -305,127 +374,86 @@
     }
   }
 
+ protected:
+  // creation
+  AddressLiteral() : _address(NULL), _rspec(NULL) {}
+
  public:
-  Address(Register b, address a, relocInfo::relocType rt = relocInfo::none)
-    : _rspec(rspec_from_rtype(rt, a))
-  {
-    _base  = b;
+  AddressLiteral(address addr, RelocationHolder const& rspec)
+    : _address(addr),
+      _rspec(rspec) {}
+
+  // Some constructors to avoid casting at the call site.
+  AddressLiteral(jobject obj, RelocationHolder const& rspec)
+    : _address((address) obj),
+      _rspec(rspec) {}
+
+  AddressLiteral(intptr_t value, RelocationHolder const& rspec)
+    : _address((address) value),
+      _rspec(rspec) {}
+
+  AddressLiteral(address addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+    _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  // Some constructors to avoid casting at the call site.
+  AddressLiteral(address* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+    _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  AddressLiteral(bool* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  AddressLiteral(const bool* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  AddressLiteral(signed char* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  AddressLiteral(int* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
+  AddressLiteral(intptr_t addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
 #ifdef _LP64
-    _hi32  = (intptr_t)a >> 32;    // top 32 bits in 64 bit word
-    _low32 = (intptr_t)a & ~0;     // low 32 bits in 64 bit word
+  // 32-bit complains about a multiple declaration for int*.
+  AddressLiteral(intptr_t* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
 #endif
-    _hi    = (intptr_t)a & ~0x3ff; // top    22 bits in low word
-    _disp  = (intptr_t)a &  0x3ff; // bottom 10 bits
-  }
 
-  Address(Register b, address a, RelocationHolder const& rspec)
-    : _rspec(rspec)
-  {
-    _base  = b;
-#ifdef _LP64
-    _hi32  = (intptr_t)a >> 32;    // top 32 bits in 64 bit word
-    _low32 = (intptr_t)a & ~0;     // low 32 bits in 64 bit word
-#endif
-    _hi    = (intptr_t)a & ~0x3ff; // top    22 bits
-    _disp  = (intptr_t)a &  0x3ff; // bottom 10 bits
-  }
+  AddressLiteral(oop addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
 
-  Address(Register b, intptr_t h, intptr_t d, RelocationHolder const& rspec = RelocationHolder())
-    : _rspec(rspec)
-  {
-    _base  = b;
-#ifdef _LP64
-// [RGV] Put in Assert to force me to check usage of this constructor
-     assert( h == 0, "Check usage of this constructor" );
-    _hi32  = h;
-    _low32 = d;
-    _hi    = h;
-    _disp  = d;
-#else
-    _hi    = h;
-    _disp  = d;
-#endif
-  }
+  AddressLiteral(float* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
 
-  Address()
-    : _rspec(RelocationHolder())
-  {
-    _base  = G0;
-#ifdef _LP64
-    _hi32  = 0;
-    _low32 = 0;
-#endif
-    _hi    = 0;
-    _disp  = 0;
-  }
+  AddressLiteral(double* addr, relocInfo::relocType rtype = relocInfo::none)
+    : _address((address) addr),
+      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
 
-  // fancier constructors
+  intptr_t value() const { return (intptr_t) _address; }
+  int      low10() const;
 
-  enum addr_type {
-    extra_in_argument,  // in the In registers
-    extra_out_argument  // in the Outs
-  };
+  const relocInfo::relocType rtype() const { return _rspec.type(); }
+  const RelocationHolder&    rspec() const { return _rspec; }
 
-  Address( addr_type, int );
-
-  // accessors
-
-  Register               base() const { return _base; }
-#ifdef _LP64
-  int                   hi32()  const { return _hi32; }
-  int                   low32() const { return _low32; }
-#endif
-  int                      hi() const { return _hi;  }
-  int                    disp() const { return _disp; }
-#ifdef _LP64
-  intptr_t              value() const { return ((intptr_t)_hi32 << 32) |
-                                                (intptr_t)(uint32_t)_low32; }
-#else
-  int                   value() const { return _hi | _disp; }
-#endif
-  const relocInfo::relocType  rtype() { return _rspec.type(); }
-  const RelocationHolder&     rspec() { return _rspec; }
-
-  RelocationHolder      rspec(int offset) const {
+  RelocationHolder rspec(int offset) const {
     return offset == 0 ? _rspec : _rspec.plus(offset);
   }
-
-  inline bool is_simm13(int offset = 0);  // check disp+offset for overflow
-
-  Address plus_disp(int disp) const {     // bump disp by a small amount
-    Address a = (*this);
-    a._disp += disp;
-    return a;
-  }
-
-  Address split_disp() const {            // deal with disp overflow
-    Address a = (*this);
-    int hi_disp = _disp & ~0x3ff;
-    if (hi_disp != 0) {
-      a._disp -= hi_disp;
-      a._hi   += hi_disp;
-    }
-    return a;
-  }
-
-  Address after_save() const {
-    Address a = (*this);
-    a._base = a._base->after_save();
-    return a;
-  }
-
-  Address after_restore() const {
-    Address a = (*this);
-    a._base = a._base->after_restore();
-    return a;
-  }
-
-  friend class Assembler;
 };
 
 
 inline Address RegisterImpl::address_in_saved_window() const {
-   return (Address(SP, 0, (sp_offset_in_saved_window() * wordSize) + STACK_BIAS));
+   return (Address(SP, (sp_offset_in_saved_window() * wordSize) + STACK_BIAS));
 }
 
 
@@ -495,11 +523,7 @@
   // When applied to a register-based argument, give the corresponding address
   // into the 6-word area "into which callee may store register arguments"
   // (This is a different place than the corresponding register-save area location.)
-  Address address_in_frame() const {
-    return Address( is_in()   ? Address::extra_in_argument
-                              : Address::extra_out_argument,
-                    _number );
-  }
+  Address address_in_frame() const;
 
   // debugging
   const char* name() const;
@@ -521,6 +545,7 @@
 
 
   friend class AbstractAssembler;
+  friend class AddressLiteral;
 
   // code patchers need various routines like inv_wdisp()
   friend class NativeInstruction;
@@ -1093,11 +1118,11 @@
 
   // pp 135 (addc was addx in v8)
 
-  inline void add(    Register s1, Register s2, Register d );
-  inline void add(    Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none);
-  inline void add(    Register s1, int simm13a, Register d, RelocationHolder const& rspec);
-  inline void add(    Register s1, RegisterOrConstant s2, Register d, int offset = 0);
-  inline void add(    const Address&  a,                  Register d, int offset = 0);
+  inline void add(Register s1, Register s2, Register d );
+  inline void add(Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none);
+  inline void add(Register s1, int simm13a, Register d, RelocationHolder const& rspec);
+  inline void add(Register s1, RegisterOrConstant s2, Register d, int offset = 0);
+  inline void add(const Address& a, Register d, int offset = 0) { add( a.base(), a.disp() + offset, d, a.rspec(offset)); }
 
   void addcc(  Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
   void addcc(  Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
@@ -1252,14 +1277,12 @@
   void jmpl( Register s1, Register s2, Register d );
   void jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec = RelocationHolder() );
 
-  inline void jmpl( Address& a, Register d, int offset = 0);
-
   // 171
 
-  inline void ldf(    FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d );
-  inline void ldf(    FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d );
+  inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
+  inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder());
 
-  inline void ldf(    FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0);
+  inline void ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0);
 
 
   inline void ldfsr(  Register s1, Register s2 );
@@ -1303,15 +1326,20 @@
   inline void ldd(   Register s1, Register s2, Register d );
   inline void ldd(   Register s1, int simm13a, Register d);
 
-  inline void ldsb( const Address& a, Register d, int offset = 0 );
-  inline void ldsh( const Address& a, Register d, int offset = 0 );
-  inline void ldsw( const Address& a, Register d, int offset = 0 );
-  inline void ldub( const Address& a, Register d, int offset = 0 );
-  inline void lduh( const Address& a, Register d, int offset = 0 );
-  inline void lduw( const Address& a, Register d, int offset = 0 );
-  inline void ldx(  const Address& a, Register d, int offset = 0 );
-  inline void ld(   const Address& a, Register d, int offset = 0 );
-  inline void ldd(  const Address& a, Register d, int offset = 0 );
+#ifdef ASSERT
+  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+  inline void ld(    Register s1, ByteSize simm13a, Register d);
+#endif
+
+  inline void ldsb(const Address& a, Register d, int offset = 0);
+  inline void ldsh(const Address& a, Register d, int offset = 0);
+  inline void ldsw(const Address& a, Register d, int offset = 0);
+  inline void ldub(const Address& a, Register d, int offset = 0);
+  inline void lduh(const Address& a, Register d, int offset = 0);
+  inline void lduw(const Address& a, Register d, int offset = 0);
+  inline void ldx( const Address& a, Register d, int offset = 0);
+  inline void ld(  const Address& a, Register d, int offset = 0);
+  inline void ldd( const Address& a, Register d, int offset = 0);
 
   inline void ldub(  Register s1, RegisterOrConstant s2, Register d );
   inline void ldsb(  Register s1, RegisterOrConstant s2, Register d );
@@ -1536,6 +1564,11 @@
   inline void std(  Register d, Register s1, Register s2 );
   inline void std(  Register d, Register s1, int simm13a);
 
+#ifdef ASSERT
+  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+  inline void st(   Register d, Register s1, ByteSize simm13a);
+#endif
+
   inline void stb(  Register d, const Address& a, int offset = 0 );
   inline void sth(  Register d, const Address& a, int offset = 0 );
   inline void stw(  Register d, const Address& a, int offset = 0 );
@@ -1684,8 +1717,8 @@
 
 #define JMP2(r1, r2) jmp(r1, r2, __FILE__, __LINE__)
 #define JMP(r1, off) jmp(r1, off, __FILE__, __LINE__)
-#define JUMP(a, off)     jump(a, off, __FILE__, __LINE__)
-#define JUMPL(a, d, off) jumpl(a, d, off, __FILE__, __LINE__)
+#define JUMP(a, temp, off)     jump(a, temp, off, __FILE__, __LINE__)
+#define JUMPL(a, temp, d, off) jumpl(a, temp, d, off, __FILE__, __LINE__)
 
 
 class MacroAssembler: public Assembler {
@@ -1830,17 +1863,26 @@
 #endif
 
   // sethi Macro handles optimizations and relocations
-  void sethi( Address& a, bool ForceRelocatable = false );
-  void sethi( intptr_t imm22a, Register d, bool ForceRelocatable = false, RelocationHolder const& rspec = RelocationHolder());
+private:
+  void internal_sethi(const AddressLiteral& addrlit, Register d, bool ForceRelocatable);
+public:
+  void sethi(const AddressLiteral& addrlit, Register d);
+  void patchable_sethi(const AddressLiteral& addrlit, Register d);
 
   // compute the size of a sethi/set
   static int  size_of_sethi( address a, bool worst_case = false );
   static int  worst_case_size_of_set();
 
   // set may be either setsw or setuw (high 32 bits may be zero or sign)
-  void set(    intptr_t value, Register d, RelocationHolder const& rspec = RelocationHolder() );
-  void setsw(  int value, Register d, RelocationHolder const& rspec = RelocationHolder() );
-  void set64(  jlong value, Register d, Register tmp);
+private:
+  void internal_set(const AddressLiteral& al, Register d, bool ForceRelocatable);
+public:
+  void set(const AddressLiteral& addrlit, Register d);
+  void set(intptr_t value, Register d);
+  void set(address addr, Register d, RelocationHolder const& rspec);
+  void patchable_set(const AddressLiteral& addrlit, Register d);
+  void patchable_set(intptr_t value, Register d);
+  void set64(jlong value, Register d, Register tmp);
 
   // sign-extend 32 to 64
   inline void signx( Register s, Register d ) { sra( s, G0, d); }
@@ -1930,24 +1972,22 @@
   inline void mov( int simm13a, Register d) { or3( G0, simm13a, d); }
 
   // address pseudos: make these names unlike instruction names to avoid confusion
-  inline void split_disp(    Address& a, Register temp );
   inline intptr_t load_pc_address( Register reg, int bytes_to_skip );
-  inline void load_address(  Address& a, int offset = 0 );
-  inline void load_contents( Address& a, Register d, int offset = 0 );
-  inline void load_ptr_contents( Address& a, Register d, int offset = 0 );
-  inline void store_contents( Register s, Address& a, int offset = 0 );
-  inline void store_ptr_contents( Register s, Address& a, int offset = 0 );
-  inline void jumpl_to( Address& a, Register d, int offset = 0 );
-  inline void jump_to(  Address& a,             int offset = 0 );
-  inline void jump_indirect_to(  Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0 );
+  inline void load_contents(AddressLiteral& addrlit, Register d, int offset = 0);
+  inline void load_ptr_contents(AddressLiteral& addrlit, Register d, int offset = 0);
+  inline void store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
+  inline void store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
+  inline void jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
+  inline void jump_to(AddressLiteral& addrlit, Register temp, int offset = 0);
+  inline void jump_indirect_to(Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0);
 
   // ring buffer traceable jumps
 
   void jmp2( Register r1, Register r2, const char* file, int line );
   void jmp ( Register r1, int offset,  const char* file, int line );
 
-  void jumpl( Address& a, Register d, int offset, const char* file, int line );
-  void jump ( Address& a,             int offset, const char* file, int line );
+  void jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
+  void jump (AddressLiteral& addrlit, Register temp,             int offset, const char* file, int line);
 
 
   // argument pseudos:
@@ -1972,29 +2012,31 @@
   // Functions for isolating 64 bit loads for LP64
   // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's
   // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's
-  inline void ld_ptr(   Register s1, Register s2, Register d );
-  inline void ld_ptr(   Register s1, int simm13a, Register d);
-  inline void ld_ptr(   Register s1, RegisterOrConstant s2, Register d );
-  inline void ld_ptr(  const Address& a, Register d, int offset = 0 );
-  inline void st_ptr(  Register d, Register s1, Register s2 );
-  inline void st_ptr(  Register d, Register s1, int simm13a);
-  inline void st_ptr(  Register d, Register s1, RegisterOrConstant s2 );
-  inline void st_ptr(  Register d, const Address& a, int offset = 0 );
+  inline void ld_ptr(Register s1, Register s2, Register d);
+  inline void ld_ptr(Register s1, int simm13a, Register d);
+  inline void ld_ptr(Register s1, RegisterOrConstant s2, Register d);
+  inline void ld_ptr(const Address& a, Register d, int offset = 0);
+  inline void st_ptr(Register d, Register s1, Register s2);
+  inline void st_ptr(Register d, Register s1, int simm13a);
+  inline void st_ptr(Register d, Register s1, RegisterOrConstant s2);
+  inline void st_ptr(Register d, const Address& a, int offset = 0);
+
+#ifdef ASSERT
+  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+  inline void ld_ptr(Register s1, ByteSize simm13a, Register d);
+  inline void st_ptr(Register d, Register s1, ByteSize simm13a);
+#endif
 
   // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's
   // st_long will perform st for 32 bit VM's and stx for 64 bit VM's
-  inline void ld_long( Register s1, Register s2, Register d );
-  inline void ld_long( Register s1, int simm13a, Register d );
-  inline void ld_long( Register s1, RegisterOrConstant s2, Register d );
-  inline void ld_long( const Address& a, Register d, int offset = 0 );
-  inline void st_long( Register d, Register s1, Register s2 );
-  inline void st_long( Register d, Register s1, int simm13a );
-  inline void st_long( Register d, Register s1, RegisterOrConstant s2 );
-  inline void st_long( Register d, const Address& a, int offset = 0 );
-
-  // Loading values by size and signed-ness
-  void load_sized_value(Register s1, RegisterOrConstant s2, Register d,
-                        int size_in_bytes, bool is_signed);
+  inline void ld_long(Register s1, Register s2, Register d);
+  inline void ld_long(Register s1, int simm13a, Register d);
+  inline void ld_long(Register s1, RegisterOrConstant s2, Register d);
+  inline void ld_long(const Address& a, Register d, int offset = 0);
+  inline void st_long(Register d, Register s1, Register s2);
+  inline void st_long(Register d, Register s1, int simm13a);
+  inline void st_long(Register d, Register s1, RegisterOrConstant s2);
+  inline void st_long(Register d, const Address& a, int offset = 0);
 
   // Helpers for address formation.
   // They update the dest in place, whether it is a register or constant.
@@ -2049,8 +2091,8 @@
   // These are idioms to flag the need for care with accessing bools but on
   // this platform we assume byte size
 
-  inline void stbool( Register d, const Address& a, int offset = 0 ) { stb(d, a, offset); }
-  inline void ldbool( const Address& a, Register d, int offset = 0 ) { ldsb( a, d, offset ); }
+  inline void stbool(Register d, const Address& a) { stb(d, a); }
+  inline void ldbool(const Address& a, Register d) { ldsb(a, d); }
   inline void tstbool( Register s ) { tst(s); }
   inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); }
 
@@ -2060,7 +2102,7 @@
   void store_klass_gap(Register s, Register dst_oop);
 
    // oop manipulations
-  void load_heap_oop(const Address& s, Register d, int offset = 0);
+  void load_heap_oop(const Address& s, Register d);
   void load_heap_oop(Register s1, Register s2, Register d);
   void load_heap_oop(Register s1, int simm13a, Register d);
   void store_heap_oop(Register d, Register s1, Register s2);
@@ -2190,11 +2232,11 @@
   void print_CPU_state();
 
   // oops in code
-  Address allocate_oop_address( jobject obj, Register d ); // allocate_index
-  Address constant_oop_address( jobject obj, Register d ); // find_index
-  inline void set_oop         ( jobject obj, Register d ); // uses allocate_oop_address
-  inline void set_oop_constant( jobject obj, Register d ); // uses constant_oop_address
-  inline void set_oop         ( Address obj_addr );        // same as load_address
+  AddressLiteral allocate_oop_address(jobject obj);                          // allocate_index
+  AddressLiteral constant_oop_address(jobject obj);                          // find_index
+  inline void    set_oop             (jobject obj, Register d);              // uses allocate_oop_address
+  inline void    set_oop_constant    (jobject obj, Register d);              // uses constant_oop_address
+  inline void    set_oop             (AddressLiteral& obj_addr, Register d); // same as load_address
 
   void set_narrow_oop( jobject obj, Register d );
 
@@ -2410,7 +2452,8 @@
   // Conditionally (non-atomically) increments passed counter address, preserving condition codes.
   void cond_inc(Condition cond, address counter_addr, Register Rtemp1, Register Rtemp2);
   // Unconditional increment.
-  void inc_counter(address counter_addr, Register Rtemp1, Register Rtemp2);
+  void inc_counter(address counter_addr, Register Rtmp1, Register Rtmp2);
+  void inc_counter(int*    counter_addr, Register Rtmp1, Register Rtmp2);
 
 #undef VIRTUAL
 
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
index 692c865..b9708ff 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
@@ -38,6 +38,11 @@
 inline bool Address::is_simm13(int offset) { return Assembler::is_simm13(disp() + offset); }
 
 
+inline int AddressLiteral::low10() const {
+  return Assembler::low10(value());
+}
+
+
 // inlines for SPARC assembler -- dmu 5/97
 
 inline void Assembler::check_delay() {
@@ -63,10 +68,9 @@
 }
 
 
-inline void Assembler::add(    Register s1, Register s2, Register d )                             { emit_long( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
-inline void Assembler::add(    Register s1, int simm13a, Register d, relocInfo::relocType rtype ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rtype ); }
-inline void Assembler::add(    Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec ); }
-inline void Assembler::add(    const Address& a, Register d, int offset) { add( a.base(), a.disp() + offset, d, a.rspec(offset)); }
+inline void Assembler::add(Register s1, Register s2, Register d )                             { emit_long( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
+inline void Assembler::add(Register s1, int simm13a, Register d, relocInfo::relocType rtype ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rtype ); }
+inline void Assembler::add(Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec ); }
 
 inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only();  emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt);  has_delay_slot(); }
 inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { bpr( c, a, p, s1, target(L)); }
@@ -95,13 +99,10 @@
 inline void Assembler::jmpl( Register s1, Register s2, Register d                          ) { emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
 inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec);  has_delay_slot(); }
 
-inline void Assembler::jmpl( Address& a, Register d, int offset) { jmpl( a.base(), a.disp() + offset, d, a.rspec(offset)); }
+inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
+inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); }
 
-
-inline void Assembler::ldf(    FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
-inline void Assembler::ldf(    FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
-
-inline void Assembler::ldf(    FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset) { relocate(a.rspec(offset)); ldf( w, a.base(), a.disp() + offset, d); }
+inline void Assembler::ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset) { relocate(a.rspec(offset)); ldf( w, a.base(), a.disp() + offset, d); }
 
 inline void Assembler::ldfsr(  Register s1, Register s2) { v9_dep();   emit_long( op(ldst_op) |             op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::ldfsr(  Register s1, int simm13a) { v9_dep();   emit_data( op(ldst_op) |             op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
@@ -136,50 +137,69 @@
 
 #ifdef _LP64
 // Make all 32 bit loads signed so 64 bit registers maintain proper sign
-inline void Assembler::ld(  Register s1, Register s2, Register d) { ldsw( s1, s2, d); }
-inline void Assembler::ld(  Register s1, int simm13a, Register d) { ldsw( s1, simm13a, d); }
+inline void Assembler::ld(  Register s1, Register s2, Register d)      { ldsw( s1, s2, d); }
+inline void Assembler::ld(  Register s1, int simm13a, Register d)      { ldsw( s1, simm13a, d); }
 #else
-inline void Assembler::ld(  Register s1, Register s2, Register d) { lduw( s1, s2, d); }
-inline void Assembler::ld(  Register s1, int simm13a, Register d) { lduw( s1, simm13a, d); }
+inline void Assembler::ld(  Register s1, Register s2, Register d)      { lduw( s1, s2, d); }
+inline void Assembler::ld(  Register s1, int simm13a, Register d)      { lduw( s1, simm13a, d); }
 #endif
 
-inline void Assembler::ldub(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsb(s1, s2.as_register(), d);
-  else                   ldsb(s1, s2.as_constant(), d);
+#ifdef ASSERT
+  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+# ifdef _LP64
+inline void Assembler::ld(  Register s1, ByteSize simm13a, Register d) { ldsw( s1, in_bytes(simm13a), d); }
+# else
+inline void Assembler::ld(  Register s1, ByteSize simm13a, Register d) { lduw( s1, in_bytes(simm13a), d); }
+# endif
+#endif
+
+inline void Assembler::ld(  const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ld(  a.base(), a.index(),         d); }
+  else               {                          ld(  a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ldsb(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsb(s1, s2.as_register(), d);
-  else                   ldsb(s1, s2.as_constant(), d);
+inline void Assembler::ldsb(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldsb(a.base(), a.index(),         d); }
+  else               {                          ldsb(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::lduh(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsh(s1, s2.as_register(), d);
-  else                   ldsh(s1, s2.as_constant(), d);
+inline void Assembler::ldsh(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldsh(a.base(), a.index(),         d); }
+  else               {                          ldsh(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ldsh(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsh(s1, s2.as_register(), d);
-  else                   ldsh(s1, s2.as_constant(), d);
+inline void Assembler::ldsw(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldsw(a.base(), a.index(),         d); }
+  else               {                          ldsw(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::lduw(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsw(s1, s2.as_register(), d);
-  else                   ldsw(s1, s2.as_constant(), d);
+inline void Assembler::ldub(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldub(a.base(), a.index(),         d); }
+  else               {                          ldub(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ldsw(  Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldsw(s1, s2.as_register(), d);
-  else                   ldsw(s1, s2.as_constant(), d);
+inline void Assembler::lduh(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); lduh(a.base(), a.index(),         d); }
+  else               {                          lduh(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ldx(   Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldx(s1, s2.as_register(), d);
-  else                   ldx(s1, s2.as_constant(), d);
+inline void Assembler::lduw(const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); lduw(a.base(), a.index(),         d); }
+  else               {                          lduw(a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ld(    Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ld(s1, s2.as_register(), d);
-  else                   ld(s1, s2.as_constant(), d);
+inline void Assembler::ldd( const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldd( a.base(), a.index(),         d); }
+  else               {                          ldd( a.base(), a.disp() + offset, d); }
 }
-inline void Assembler::ldd(   Register s1, RegisterOrConstant s2, Register d) {
-  if (s2.is_register())  ldd(s1, s2.as_register(), d);
-  else                   ldd(s1, s2.as_constant(), d);
+inline void Assembler::ldx( const Address& a, Register d, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); ldx( a.base(), a.index(),         d); }
+  else               {                          ldx( a.base(), a.disp() + offset, d); }
 }
 
+inline void Assembler::ldub(Register s1, RegisterOrConstant s2, Register d) { ldub(Address(s1, s2), d); }
+inline void Assembler::ldsb(Register s1, RegisterOrConstant s2, Register d) { ldsb(Address(s1, s2), d); }
+inline void Assembler::lduh(Register s1, RegisterOrConstant s2, Register d) { lduh(Address(s1, s2), d); }
+inline void Assembler::ldsh(Register s1, RegisterOrConstant s2, Register d) { ldsh(Address(s1, s2), d); }
+inline void Assembler::lduw(Register s1, RegisterOrConstant s2, Register d) { lduw(Address(s1, s2), d); }
+inline void Assembler::ldsw(Register s1, RegisterOrConstant s2, Register d) { ldsw(Address(s1, s2), d); }
+inline void Assembler::ldx( Register s1, RegisterOrConstant s2, Register d) { ldx( Address(s1, s2), d); }
+inline void Assembler::ld(  Register s1, RegisterOrConstant s2, Register d) { ld(  Address(s1, s2), d); }
+inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); }
+
 // form effective addresses this way:
 inline void Assembler::add(   Register s1, RegisterOrConstant s2, Register d, int offset) {
   if (s2.is_register())  add(s1, s2.as_register(), d);
@@ -187,17 +207,6 @@
   if (offset != 0)       add(d,  offset,                    d);
 }
 
-inline void Assembler::ld(   const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ld(   a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldsb( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldsb( a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldsh( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldsh( a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldsw( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldsw( a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldub( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldub( a.base(), a.disp() + offset, d ); }
-inline void Assembler::lduh( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); lduh( a.base(), a.disp() + offset, d ); }
-inline void Assembler::lduw( const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); lduw( a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldd(  const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldd(  a.base(), a.disp() + offset, d ); }
-inline void Assembler::ldx(  const Address& a, Register d, int offset ) { relocate(a.rspec(offset)); ldx(  a.base(), a.disp() + offset, d ); }
-
-
 inline void Assembler::ldstub(  Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::ldstub(  Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
 
@@ -240,36 +249,44 @@
 inline void Assembler::std(  Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_long( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); }
 inline void Assembler::std(  Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
 
-inline void Assembler::st(  Register d, Register s1, Register s2) { stw(d, s1, s2); }
-inline void Assembler::st(  Register d, Register s1, int simm13a) { stw(d, s1, simm13a); }
+inline void Assembler::st( Register d, Register s1, Register s2)      { stw(d, s1, s2); }
+inline void Assembler::st( Register d, Register s1, int simm13a)      { stw(d, s1, simm13a); }
 
-inline void Assembler::stb(  Register d, Register s1, RegisterOrConstant s2) {
-  if (s2.is_register())  stb(d, s1, s2.as_register());
-  else                   stb(d, s1, s2.as_constant());
+#ifdef ASSERT
+// ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+inline void Assembler::st( Register d, Register s1, ByteSize simm13a) { stw(d, s1, in_bytes(simm13a)); }
+#endif
+
+inline void Assembler::stb(Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); stb(d, a.base(), a.index()        ); }
+  else               {                          stb(d, a.base(), a.disp() + offset); }
 }
-inline void Assembler::sth(  Register d, Register s1, RegisterOrConstant s2) {
-  if (s2.is_register())  sth(d, s1, s2.as_register());
-  else                   sth(d, s1, s2.as_constant());
+inline void Assembler::sth(Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); sth(d, a.base(), a.index()        ); }
+  else               {                          sth(d, a.base(), a.disp() + offset); }
 }
-inline void Assembler::stx(  Register d, Register s1, RegisterOrConstant s2) {
-  if (s2.is_register())  stx(d, s1, s2.as_register());
-  else                   stx(d, s1, s2.as_constant());
+inline void Assembler::stw(Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); stw(d, a.base(), a.index()        ); }
+  else               {                          stw(d, a.base(), a.disp() + offset); }
 }
-inline void Assembler::std( Register d, Register s1, RegisterOrConstant s2) {
-  if (s2.is_register())  std(d, s1, s2.as_register());
-  else                   std(d, s1, s2.as_constant());
+inline void Assembler::st( Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); st( d, a.base(), a.index()        ); }
+  else               {                          st( d, a.base(), a.disp() + offset); }
 }
-inline void Assembler::st(  Register d, Register s1, RegisterOrConstant s2) {
-  if (s2.is_register())  st(d, s1, s2.as_register());
-  else                   st(d, s1, s2.as_constant());
+inline void Assembler::std(Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); std(d, a.base(), a.index()        ); }
+  else               {                          std(d, a.base(), a.disp() + offset); }
+}
+inline void Assembler::stx(Register d, const Address& a, int offset) {
+  if (a.has_index()) { assert(offset == 0, ""); stx(d, a.base(), a.index()        ); }
+  else               {                          stx(d, a.base(), a.disp() + offset); }
 }
 
-inline void Assembler::stb( Register d, const Address& a, int offset) { relocate(a.rspec(offset)); stb( d, a.base(), a.disp() + offset); }
-inline void Assembler::sth( Register d, const Address& a, int offset) { relocate(a.rspec(offset)); sth( d, a.base(), a.disp() + offset); }
-inline void Assembler::stw( Register d, const Address& a, int offset) { relocate(a.rspec(offset)); stw( d, a.base(), a.disp() + offset); }
-inline void Assembler::st(  Register d, const Address& a, int offset) { relocate(a.rspec(offset)); st(  d, a.base(), a.disp() + offset); }
-inline void Assembler::std( Register d, const Address& a, int offset) { relocate(a.rspec(offset)); std( d, a.base(), a.disp() + offset); }
-inline void Assembler::stx( Register d, const Address& a, int offset) { relocate(a.rspec(offset)); stx( d, a.base(), a.disp() + offset); }
+inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); }
+inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); }
+inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); }
+inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); }
+inline void Assembler::st( Register d, Register s1, RegisterOrConstant s2) { st( d, Address(s1, s2)); }
 
 // v8 p 99
 
@@ -294,39 +311,46 @@
 // Use the right loads/stores for the platform
 inline void MacroAssembler::ld_ptr( Register s1, Register s2, Register d ) {
 #ifdef _LP64
-  Assembler::ldx( s1, s2, d);
+  Assembler::ldx(s1, s2, d);
 #else
-  Assembler::ld(  s1, s2, d);
+  Assembler::ld( s1, s2, d);
 #endif
 }
 
 inline void MacroAssembler::ld_ptr( Register s1, int simm13a, Register d ) {
 #ifdef _LP64
-  Assembler::ldx( s1, simm13a, d);
+  Assembler::ldx(s1, simm13a, d);
 #else
-  Assembler::ld(  s1, simm13a, d);
+  Assembler::ld( s1, simm13a, d);
 #endif
 }
 
+#ifdef ASSERT
+// ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+inline void MacroAssembler::ld_ptr( Register s1, ByteSize simm13a, Register d ) {
+  ld_ptr(s1, in_bytes(simm13a), d);
+}
+#endif
+
 inline void MacroAssembler::ld_ptr( Register s1, RegisterOrConstant s2, Register d ) {
 #ifdef _LP64
-  Assembler::ldx( s1, s2, d);
+  Assembler::ldx(s1, s2, d);
 #else
-  Assembler::ld(  s1, s2, d);
+  Assembler::ld( s1, s2, d);
 #endif
 }
 
-inline void MacroAssembler::ld_ptr( const Address& a, Register d, int offset ) {
+inline void MacroAssembler::ld_ptr(const Address& a, Register d, int offset) {
 #ifdef _LP64
-  Assembler::ldx(  a, d, offset );
+  Assembler::ldx(a, d, offset);
 #else
-  Assembler::ld(   a, d, offset );
+  Assembler::ld( a, d, offset);
 #endif
 }
 
 inline void MacroAssembler::st_ptr( Register d, Register s1, Register s2 ) {
 #ifdef _LP64
-  Assembler::stx( d, s1, s2);
+  Assembler::stx(d, s1, s2);
 #else
   Assembler::st( d, s1, s2);
 #endif
@@ -334,25 +358,32 @@
 
 inline void MacroAssembler::st_ptr( Register d, Register s1, int simm13a ) {
 #ifdef _LP64
-  Assembler::stx( d, s1, simm13a);
+  Assembler::stx(d, s1, simm13a);
 #else
   Assembler::st( d, s1, simm13a);
 #endif
 }
 
+#ifdef ASSERT
+// ByteSize is only a class when ASSERT is defined, otherwise it's an int.
+inline void MacroAssembler::st_ptr( Register d, Register s1, ByteSize simm13a ) {
+  st_ptr(d, s1, in_bytes(simm13a));
+}
+#endif
+
 inline void MacroAssembler::st_ptr( Register d, Register s1, RegisterOrConstant s2 ) {
 #ifdef _LP64
-  Assembler::stx( d, s1, s2);
+  Assembler::stx(d, s1, s2);
 #else
   Assembler::st( d, s1, s2);
 #endif
 }
 
-inline void MacroAssembler::st_ptr(  Register d, const Address& a, int offset) {
+inline void MacroAssembler::st_ptr(Register d, const Address& a, int offset) {
 #ifdef _LP64
-  Assembler::stx(  d, a, offset);
+  Assembler::stx(d, a, offset);
 #else
-  Assembler::st(  d, a, offset);
+  Assembler::st( d, a, offset);
 #endif
 }
 
@@ -381,11 +412,11 @@
 #endif
 }
 
-inline void MacroAssembler::ld_long( const Address& a, Register d, int offset ) {
+inline void MacroAssembler::ld_long(const Address& a, Register d, int offset) {
 #ifdef _LP64
-  Assembler::ldx(a, d, offset );
+  Assembler::ldx(a, d, offset);
 #else
-  Assembler::ldd(a, d, offset );
+  Assembler::ldd(a, d, offset);
 #endif
 }
 
@@ -427,7 +458,7 @@
 #ifdef _LP64
   Assembler::sllx(s1, s2, d);
 #else
-  Assembler::sll(s1, s2, d);
+  Assembler::sll( s1, s2, d);
 #endif
 }
 
@@ -435,7 +466,7 @@
 #ifdef _LP64
   Assembler::sllx(s1, imm6a, d);
 #else
-  Assembler::sll(s1, imm6a, d);
+  Assembler::sll( s1, imm6a, d);
 #endif
 }
 
@@ -443,7 +474,7 @@
 #ifdef _LP64
   Assembler::srlx(s1, s2, d);
 #else
-  Assembler::srl(s1, s2, d);
+  Assembler::srl( s1, s2, d);
 #endif
 }
 
@@ -451,7 +482,7 @@
 #ifdef _LP64
   Assembler::srlx(s1, imm6a, d);
 #else
-  Assembler::srl(s1, imm6a, d);
+  Assembler::srl( s1, imm6a, d);
 #endif
 }
 
@@ -541,9 +572,8 @@
   disp = (intptr_t)d - (intptr_t)pc();
   if ( disp != (intptr_t)(int32_t)disp ) {
     relocate(rt);
-    Address dest(O7, (address)d);
-    sethi(dest, /*ForceRelocatable=*/ true);
-    jmpl(dest, O7);
+    AddressLiteral dest(d);
+    jumpl_to(dest, O7, O7);
   }
   else {
     Assembler::call( d, rt );
@@ -603,96 +633,72 @@
   return thepc;
 }
 
-inline void MacroAssembler::load_address( Address& a, int offset ) {
+
+inline void MacroAssembler::load_contents(AddressLiteral& addrlit, Register d, int offset) {
   assert_not_delayed();
-#ifdef _LP64
-  sethi(a);
-  add(a, a.base(), offset);
-#else
-  if (a.hi() == 0 && a.rtype() == relocInfo::none) {
-    set(a.disp() + offset, a.base());
-  }
-  else {
-    sethi(a);
-    add(a, a.base(), offset);
-  }
-#endif
+  sethi(addrlit, d);
+  ld(d, addrlit.low10() + offset, d);
 }
 
 
-inline void MacroAssembler::split_disp( Address& a, Register temp ) {
+inline void MacroAssembler::load_ptr_contents(AddressLiteral& addrlit, Register d, int offset) {
   assert_not_delayed();
-  a = a.split_disp();
-  Assembler::sethi(a.hi(), temp, a.rspec());
-  add(a.base(), temp, a.base());
+  sethi(addrlit, d);
+  ld_ptr(d, addrlit.low10() + offset, d);
 }
 
 
-inline void MacroAssembler::load_contents( Address& a, Register d, int offset ) {
+inline void MacroAssembler::store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
   assert_not_delayed();
-  sethi(a);
-  ld(a, d, offset);
+  sethi(addrlit, temp);
+  st(s, temp, addrlit.low10() + offset);
 }
 
 
-inline void MacroAssembler::load_ptr_contents( Address& a, Register d, int offset ) {
+inline void MacroAssembler::store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
   assert_not_delayed();
-  sethi(a);
-  ld_ptr(a, d, offset);
-}
-
-
-inline void MacroAssembler::store_contents( Register s, Address& a, int offset ) {
-  assert_not_delayed();
-  sethi(a);
-  st(s, a, offset);
-}
-
-
-inline void MacroAssembler::store_ptr_contents( Register s, Address& a, int offset ) {
-  assert_not_delayed();
-  sethi(a);
-  st_ptr(s, a, offset);
+  sethi(addrlit, temp);
+  st_ptr(s, temp, addrlit.low10() + offset);
 }
 
 
 // This code sequence is relocatable to any address, even on LP64.
-inline void MacroAssembler::jumpl_to( Address& a, Register d, int offset ) {
+inline void MacroAssembler::jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset) {
   assert_not_delayed();
   // Force fixed length sethi because NativeJump and NativeFarCall don't handle
   // variable length instruction streams.
-  sethi(a, /*ForceRelocatable=*/ true);
-  jmpl(a, d, offset);
+  patchable_sethi(addrlit, temp);
+  jmpl(temp, addrlit.low10() + offset, d);
 }
 
 
-inline void MacroAssembler::jump_to( Address& a, int offset ) {
-  jumpl_to( a, G0, offset );
+inline void MacroAssembler::jump_to(AddressLiteral& addrlit, Register temp, int offset) {
+  jumpl_to(addrlit, temp, G0, offset);
 }
 
 
-inline void MacroAssembler::jump_indirect_to(  Address& a, Register temp,
-                                               int ld_offset, int jmp_offset ) {
+inline void MacroAssembler::jump_indirect_to(Address& a, Register temp,
+                                             int ld_offset, int jmp_offset) {
   assert_not_delayed();
-  //sethi(a);                   // sethi is caller responsibility for this one
+  //sethi(al);                   // sethi is caller responsibility for this one
   ld_ptr(a, temp, ld_offset);
   jmp(temp, jmp_offset);
 }
 
 
-inline void MacroAssembler::set_oop( jobject obj, Register d ) {
-  set_oop(allocate_oop_address(obj, d));
+inline void MacroAssembler::set_oop(jobject obj, Register d) {
+  set_oop(allocate_oop_address(obj), d);
 }
 
 
-inline void MacroAssembler::set_oop_constant( jobject obj, Register d ) {
-  set_oop(constant_oop_address(obj, d));
+inline void MacroAssembler::set_oop_constant(jobject obj, Register d) {
+  set_oop(constant_oop_address(obj), d);
 }
 
 
-inline void MacroAssembler::set_oop( Address obj_addr ) {
-  assert(obj_addr.rspec().type()==relocInfo::oop_type, "must be an oop reloc");
-  load_address(obj_addr);
+inline void MacroAssembler::set_oop(AddressLiteral& obj_addr, Register d) {
+  assert(obj_addr.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
+  set(obj_addr, d);
 }
 
 
diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
index 87a411d..d5ea7dd 100644
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -277,10 +277,11 @@
 
   if (_id == load_klass_id) {
     // produce a copy of the load klass instruction for use by the being initialized case
+#ifdef ASSERT
     address start = __ pc();
-    Address addr = Address(_obj, address(NULL), oop_Relocation::spec(_oop_index));
-    __ sethi(addr, true);
-    __ add(addr, _obj, 0);
+#endif
+    AddressLiteral addrlit(NULL, oop_Relocation::spec(_oop_index));
+    __ patchable_set(addrlit, _obj);
 
 #ifdef ASSERT
     for (int i = 0; i < _bytes_to_copy; i++) {
diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
index 7bbf107..fbdf455 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -327,7 +327,7 @@
 
 
 Address FrameMap::make_new_address(ByteSize sp_offset) const {
-  return Address(SP, 0, STACK_BIAS + in_bytes(sp_offset));
+  return Address(SP, STACK_BIAS + in_bytes(sp_offset));
 }
 
 
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
index 1e8c190..9e91c1d 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
@@ -196,7 +196,7 @@
       // verify the interpreter's monitor has a non-null object
       {
         Label L;
-        __ ld_ptr(Address(OSR_buf, 0, slot_offset + BasicObjectLock::obj_offset_in_bytes()), O7);
+        __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7);
         __ cmp(G0, O7);
         __ br(Assembler::notEqual, false, Assembler::pt, L);
         __ delayed()->nop();
@@ -205,9 +205,9 @@
       }
 #endif // ASSERT
       // Copy the lock field into the compiled activation.
-      __ ld_ptr(Address(OSR_buf, 0, slot_offset + BasicObjectLock::lock_offset_in_bytes()), O7);
+      __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::lock_offset_in_bytes(), O7);
       __ st_ptr(O7, frame_map()->address_for_monitor_lock(i));
-      __ ld_ptr(Address(OSR_buf, 0, slot_offset + BasicObjectLock::obj_offset_in_bytes()), O7);
+      __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7);
       __ st_ptr(O7, frame_map()->address_for_monitor_object(i));
     }
   }
@@ -238,21 +238,21 @@
     int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
     int  count_offset = java_lang_String:: count_offset_in_bytes();
 
-    __ ld_ptr(Address(str0, 0,  value_offset), tmp0);
-    __ ld(Address(str0, 0, offset_offset), tmp2);
+    __ ld_ptr(str0, value_offset, tmp0);
+    __ ld(str0, offset_offset, tmp2);
     __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
-    __ ld(Address(str0, 0, count_offset), str0);
+    __ ld(str0, count_offset, str0);
     __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
 
     // str1 may be null
     add_debug_info_for_null_check_here(info);
 
-    __ ld_ptr(Address(str1, 0,  value_offset), tmp1);
+    __ ld_ptr(str1, value_offset, tmp1);
     __ add(tmp0, tmp2, tmp0);
 
-    __ ld(Address(str1, 0, offset_offset), tmp2);
+    __ ld(str1, offset_offset, tmp2);
     __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
-    __ ld(Address(str1, 0, count_offset), str1);
+    __ ld(str1, count_offset, str1);
     __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
     __ subcc(str0, str1, O7);
     __ add(tmp1, tmp2, tmp1);
@@ -412,9 +412,9 @@
 #endif // ASSERT
   compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset());
 
-  Address deopt_blob(G3_scratch, SharedRuntime::deopt_blob()->unpack());
+  AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
 
-  __ JUMP(deopt_blob, 0); // sethi;jmp
+  __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
   __ delayed()->nop();
 
   assert(code_offset() - offset <= deopt_handler_size, "overflow");
@@ -441,13 +441,12 @@
   int oop_index = __ oop_recorder()->allocate_index((jobject)NULL);
   PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_klass_id, oop_index);
 
-  Address addr = Address(reg, address(NULL), oop_Relocation::spec(oop_index));
-  assert(addr.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
+  AddressLiteral addrlit(NULL, oop_Relocation::spec(oop_index));
+  assert(addrlit.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
   // It may not seem necessary to use a sethi/add pair to load a NULL into dest, but the
   // NULL will be dynamically patched later and the patched value may be large.  We must
   // therefore generate the sethi/add as a placeholders
-  __ sethi(addr, true);
-  __ add(addr, reg, 0);
+  __ patchable_set(addrlit, reg);
 
   patching_epilog(patch, lir_patch_normal, reg, info);
 }
@@ -706,7 +705,7 @@
 
 void LIR_Assembler::vtable_call(int vtable_offset, CodeEmitInfo* info) {
   add_debug_info_for_null_check_here(info);
-  __ ld_ptr(Address(O0, 0,  oopDesc::klass_offset_in_bytes()), G3_scratch);
+  __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch);
   if (__ is_simm13(vtable_offset) ) {
     __ ld_ptr(G3_scratch, vtable_offset, G5_method);
   } else {
@@ -715,7 +714,7 @@
     // ld_ptr, set_hi, set
     __ ld_ptr(G3_scratch, G5_method, G5_method);
   }
-  __ ld_ptr(G5_method, in_bytes(methodOopDesc::from_compiled_offset()), G3_scratch);
+  __ ld_ptr(G5_method, methodOopDesc::from_compiled_offset(), G3_scratch);
   __ callr(G3_scratch, G0);
   // the peephole pass fills the delay slot
 }
@@ -738,8 +737,7 @@
       default      : ShouldNotReachHere();
     }
   } else {
-    __ sethi(disp & ~0x3ff, O7, true);
-    __ add(O7, disp & 0x3ff, O7);
+    __ set(disp, O7);
     if (info != NULL) add_debug_info_for_null_check_here(info);
     load_offset = code_offset();
     switch(ld_type) {
@@ -775,8 +773,7 @@
       default      : ShouldNotReachHere();
     }
   } else {
-    __ sethi(offset & ~0x3ff, O7, true);
-    __ add(O7, offset & 0x3ff, O7);
+    __ set(offset, O7);
     if (info != NULL) add_debug_info_for_null_check_here(info);
     switch (type) {
       case T_BOOLEAN: // fall through
@@ -813,8 +810,7 @@
       __ ldf(w, s, disp, d);
     }
   } else {
-    __ sethi(disp & ~0x3ff, O7, true);
-    __ add(O7, disp & 0x3ff, O7);
+    __ set(disp, O7);
     if (info != NULL) add_debug_info_for_null_check_here(info);
     __ ldf(w, s, O7, d);
   }
@@ -839,8 +835,7 @@
       __ stf(w, value, base, offset);
     }
   } else {
-    __ sethi(offset & ~0x3ff, O7, true);
-    __ add(O7, offset & 0x3ff, O7);
+    __ set(offset, O7);
     if (info != NULL) add_debug_info_for_null_check_here(info);
     __ stf(w, value, O7, base);
   }
@@ -852,8 +847,7 @@
   if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
     assert(!unaligned, "can't handle this");
     // for offsets larger than a simm13 we setup the offset in O7
-    __ sethi(offset & ~0x3ff, O7, true);
-    __ add(O7, offset & 0x3ff, O7);
+    __ set(offset, O7);
     store_offset = store(from_reg, base, O7, type);
   } else {
     if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register());
@@ -937,8 +931,7 @@
     assert(base != O7, "destroying register");
     assert(!unaligned, "can't handle this");
     // for offsets larger than a simm13 we setup the offset in O7
-    __ sethi(offset & ~0x3ff, O7, true);
-    __ add(O7, offset & 0x3ff, O7);
+    __ set(offset, O7);
     load_offset = load(base, O7, to_reg, type);
   } else {
     load_offset = code_offset();
@@ -1213,7 +1206,7 @@
           assert(to_reg->is_single_fpu(), "wrong register kind");
 
           __ set(con, O7);
-          Address temp_slot(SP, 0, (frame::register_save_words * wordSize) + STACK_BIAS);
+          Address temp_slot(SP, (frame::register_save_words * wordSize) + STACK_BIAS);
           __ st(O7, temp_slot);
           __ ldf(FloatRegisterImpl::S, temp_slot, to_reg->as_float_reg());
         }
@@ -1238,8 +1231,8 @@
         } else {
           ShouldNotReachHere();
           assert(to_reg->is_double_fpu(), "wrong register kind");
-          Address temp_slot_lo(SP, 0, ((frame::register_save_words  ) * wordSize) + STACK_BIAS);
-          Address temp_slot_hi(SP, 0, ((frame::register_save_words) * wordSize) + (longSize/2) + STACK_BIAS);
+          Address temp_slot_lo(SP, ((frame::register_save_words  ) * wordSize) + STACK_BIAS);
+          Address temp_slot_hi(SP, ((frame::register_save_words) * wordSize) + (longSize/2) + STACK_BIAS);
           __ set(low(con),  O7);
           __ st(O7, temp_slot_lo);
           __ set(high(con), O7);
@@ -1267,17 +1260,16 @@
           break;
         }
         RelocationHolder rspec = internal_word_Relocation::spec(const_addr);
+        AddressLiteral const_addrlit(const_addr, rspec);
         if (to_reg->is_single_fpu()) {
-          __ sethi(  (intx)const_addr & ~0x3ff, O7, true, rspec);
+          __ patchable_sethi(const_addrlit, O7);
           __ relocate(rspec);
-
-          int offset = (intx)const_addr & 0x3ff;
-          __ ldf (FloatRegisterImpl::S, O7, offset, to_reg->as_float_reg());
+          __ ldf(FloatRegisterImpl::S, O7, const_addrlit.low10(), to_reg->as_float_reg());
 
         } else {
           assert(to_reg->is_single_cpu(), "Must be a cpu register.");
 
-          __ set((intx)const_addr, O7, rspec);
+          __ set(const_addrlit, O7);
           load(O7, 0, to_reg->as_register(), T_INT);
         }
       }
@@ -1293,10 +1285,10 @@
         RelocationHolder rspec = internal_word_Relocation::spec(const_addr);
 
         if (to_reg->is_double_fpu()) {
-          __ sethi(  (intx)const_addr & ~0x3ff, O7, true, rspec);
-          int offset = (intx)const_addr & 0x3ff;
+          AddressLiteral const_addrlit(const_addr, rspec);
+          __ patchable_sethi(const_addrlit, O7);
           __ relocate(rspec);
-          __ ldf (FloatRegisterImpl::D, O7, offset, to_reg->as_double_reg());
+          __ ldf (FloatRegisterImpl::D, O7, const_addrlit.low10(), to_reg->as_double_reg());
         } else {
           assert(to_reg->is_double_cpu(), "Must be a long register.");
 #ifdef _LP64
@@ -1317,7 +1309,7 @@
 
 Address LIR_Assembler::as_Address(LIR_Address* addr) {
   Register reg = addr->base()->as_register();
-  return Address(reg, 0, addr->disp());
+  return Address(reg, addr->disp());
 }
 
 
@@ -1360,13 +1352,13 @@
 
 Address LIR_Assembler::as_Address_hi(LIR_Address* addr) {
   Address base = as_Address(addr);
-  return Address(base.base(), 0, base.disp() + hi_word_offset_in_bytes);
+  return Address(base.base(), base.disp() + hi_word_offset_in_bytes);
 }
 
 
 Address LIR_Assembler::as_Address_lo(LIR_Address* addr) {
   Address base = as_Address(addr);
-  return Address(base.base(), 0, base.disp() + lo_word_offset_in_bytes);
+  return Address(base.base(), base.disp() + lo_word_offset_in_bytes);
 }
 
 
@@ -1396,8 +1388,7 @@
   if (addr->index()->is_illegal()) {
     if (!Assembler::is_simm13(disp_value) && (!unaligned || Assembler::is_simm13(disp_value + 4))) {
       if (needs_patching) {
-        __ sethi(0, O7, true);
-        __ add(O7, 0, O7);
+        __ patchable_set(0, O7);
       } else {
         __ set(disp_value, O7);
       }
@@ -1544,8 +1535,7 @@
   if (addr->index()->is_illegal()) {
     if (!Assembler::is_simm13(disp_value) && (!unaligned || Assembler::is_simm13(disp_value + 4))) {
       if (needs_patching) {
-        __ sethi(0, O7, true);
-        __ add(O7, 0, O7);
+        __ patchable_set(0, O7);
       } else {
         __ set(disp_value, O7);
       }
@@ -1627,8 +1617,8 @@
 
   __ set_oop(NULL, G5);
   // must be set to -1 at code generation time
-  Address a(G3, (address)-1);
-  __ jump_to(a, 0);
+  AddressLiteral addrlit(-1);
+  __ jump_to(addrlit, G3);
   __ delayed()->nop();
 
   assert(__ offset() - start <= call_stub_size, "stub too big");
@@ -2063,7 +2053,7 @@
     address pc_for_athrow  = __ pc();
     int pc_for_athrow_offset = __ offset();
     RelocationHolder rspec = internal_word_Relocation::spec(pc_for_athrow);
-    __ set((intptr_t)pc_for_athrow, Oissuing_pc, rspec);
+    __ set(pc_for_athrow, Oissuing_pc, rspec);
     add_call_info(pc_for_athrow_offset, info); // for exception handler
 
     __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
@@ -2451,7 +2441,7 @@
       }
 
 
-      Address flags_addr(mdo, 0, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias);
+      Address flags_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias);
       __ ldub(flags_addr, data_val);
       __ or3(data_val, BitData::null_seen_byte_constant(), data_val);
       __ stb(data_val, flags_addr);
@@ -2738,7 +2728,7 @@
     __ add(mdo, O7, mdo);
   }
 
-  Address counter_addr(mdo, 0, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
+  Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
   __ lduw(counter_addr, tmp1);
   __ add(tmp1, DataLayout::counter_increment, tmp1);
   __ stw(tmp1, counter_addr);
@@ -2764,8 +2754,8 @@
       for (i = 0; i < VirtualCallData::row_limit(); i++) {
         ciKlass* receiver = vc_data->receiver(i);
         if (known_klass->equals(receiver)) {
-          Address data_addr(mdo, 0, md->byte_offset_of_slot(data,
-                                                            VirtualCallData::receiver_count_offset(i)) -
+          Address data_addr(mdo, md->byte_offset_of_slot(data,
+                                                         VirtualCallData::receiver_count_offset(i)) -
                             mdo_offset_bias);
           __ lduw(data_addr, tmp1);
           __ add(tmp1, DataLayout::counter_increment, tmp1);
@@ -2782,11 +2772,11 @@
       for (i = 0; i < VirtualCallData::row_limit(); i++) {
         ciKlass* receiver = vc_data->receiver(i);
         if (receiver == NULL) {
-          Address recv_addr(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
+          Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
                             mdo_offset_bias);
           jobject2reg(known_klass->encoding(), tmp1);
           __ st_ptr(tmp1, recv_addr);
-          Address data_addr(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
+          Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
                             mdo_offset_bias);
           __ lduw(data_addr, tmp1);
           __ add(tmp1, DataLayout::counter_increment, tmp1);
@@ -2795,20 +2785,20 @@
         }
       }
     } else {
-      load(Address(recv, 0, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
+      load(Address(recv, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);
       Label update_done;
       uint i;
       for (i = 0; i < VirtualCallData::row_limit(); i++) {
         Label next_test;
         // See if the receiver is receiver[n].
-        Address receiver_addr(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
+        Address receiver_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
                               mdo_offset_bias);
         __ ld_ptr(receiver_addr, tmp1);
         __ verify_oop(tmp1);
         __ cmp(recv, tmp1);
         __ brx(Assembler::notEqual, false, Assembler::pt, next_test);
         __ delayed()->nop();
-        Address data_addr(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
+        Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
                           mdo_offset_bias);
         __ lduw(data_addr, tmp1);
         __ add(tmp1, DataLayout::counter_increment, tmp1);
@@ -2821,7 +2811,7 @@
       // Didn't find receiver; find next empty slot and fill it in
       for (i = 0; i < VirtualCallData::row_limit(); i++) {
         Label next_test;
-        Address recv_addr(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
+        Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
                           mdo_offset_bias);
         load(recv_addr, tmp1, T_OBJECT);
         __ tst(tmp1);
@@ -2829,8 +2819,8 @@
         __ delayed()->nop();
         __ st_ptr(recv, recv_addr);
         __ set(DataLayout::counter_increment, tmp1);
-        __ st_ptr(tmp1, Address(mdo, 0, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
-                                mdo_offset_bias));
+        __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
+                  mdo_offset_bias);
         if (i < (VirtualCallData::row_limit() - 1)) {
           __ br(Assembler::always, false, Assembler::pt, update_done);
           __ delayed()->nop();
diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
index a002e24..de264af 100644
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,13 +29,13 @@
   Label L;
   const Register temp_reg = G3_scratch;
   // Note: needs more testing of out-of-line vs. inline slow case
-  Address ic_miss(temp_reg, SharedRuntime::get_ic_miss_stub());
   verify_oop(receiver);
   ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg);
   cmp(temp_reg, iCache);
   brx(Assembler::equal, true, Assembler::pt, L);
   delayed()->nop();
-  jump_to(ic_miss, 0);
+  AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
+  jump_to(ic_miss, temp_reg);
   delayed()->nop();
   align(CodeEntryAlignment);
   bind(L);
@@ -84,7 +84,7 @@
 
   Label done;
 
-  Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes());
+  Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
 
   // The following move must be the first instruction of emitted since debug
   // information may be generated for it.
@@ -132,7 +132,7 @@
 
   Label done;
 
-  Address mark_addr(Roop, 0, oopDesc::mark_offset_in_bytes());
+  Address mark_addr(Roop, oopDesc::mark_offset_in_bytes());
   assert(mark_addr.disp() == 0, "cas must take a zero displacement");
 
   if (UseBiasedLocking) {
@@ -370,7 +370,7 @@
 
 void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
   if (!VerifyOops) return;
-  verify_oop_addr(Address(SP, 0, stack_offset + STACK_BIAS));
+  verify_oop_addr(Address(SP, stack_offset + STACK_BIAS));
 }
 
 void C1_MacroAssembler::verify_not_null_oop(Register r) {
diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
index 6dfb8ef..864d488 100644
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,13 @@
 
   // check for pending exceptions
   { Label L;
-    Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
     ld_ptr(exception_addr, Gtemp);
     br_null(Gtemp, false, pt, L);
     delayed()->nop();
-    Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset()));
+    Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
     st_ptr(G0, vm_result_addr);
-    Address vm_result_addr_2(G2_thread, 0, in_bytes(JavaThread::vm_result_2_offset()));
+    Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
     st_ptr(G0, vm_result_addr_2);
 
     if (frame_size() == no_frame_size) {
@@ -73,8 +73,8 @@
     } else if (_stub_id == Runtime1::forward_exception_id) {
       should_not_reach_here();
     } else {
-      Address exc(G4, Runtime1::entry_for(Runtime1::forward_exception_id));
-      jump_to(exc, 0);
+      AddressLiteral exc(Runtime1::entry_for(Runtime1::forward_exception_id));
+      jump_to(exc, G4);
       delayed()->nop();
     }
     bind(L);
@@ -85,7 +85,7 @@
     get_vm_result  (oop_result1);
   } else {
     // be a little paranoid and clear the result
-    Address vm_result_addr(G2_thread, 0, in_bytes(JavaThread::vm_result_offset()));
+    Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
     st_ptr(G0, vm_result_addr);
   }
 
@@ -93,7 +93,7 @@
     get_vm_result_2(oop_result2);
   } else {
     // be a little paranoid and clear the result
-    Address vm_result_addr_2(G2_thread, 0, in_bytes(JavaThread::vm_result_2_offset()));
+    Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
     st_ptr(G0, vm_result_addr_2);
   }
 
@@ -479,8 +479,8 @@
         Register G4_length = G4; // Incoming
         Register O0_obj   = O0; // Outgoing
 
-        Address klass_lh(G5_klass, 0, ((klassOopDesc::header_size() * HeapWordSize)
-                                       + Klass::layout_helper_offset_in_bytes()));
+        Address klass_lh(G5_klass, ((klassOopDesc::header_size() * HeapWordSize)
+                                    + Klass::layout_helper_offset_in_bytes()));
         assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise");
         assert(Klass::_lh_header_size_mask == 0xFF, "bytewise");
         // Use this offset to pick out an individual byte of the layout_helper:
@@ -902,8 +902,8 @@
         __ srl(addr, CardTableModRefBS::card_shift, addr);
 #endif
 
-        Address rs(cardtable, (address)byte_map_base);
-        __ load_address(rs); // cardtable := <card table base>
+        AddressLiteral rs(byte_map_base);
+        __ set(rs, cardtable);         // cardtable := <card table base>
         __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable]
 
         __ br_on_reg_cond(Assembler::rc_nz, /*annul*/false, Assembler::pt,
@@ -1022,8 +1022,8 @@
 
   __ restore();
 
-  Address exc(G4, Runtime1::entry_for(Runtime1::unwind_exception_id));
-  __ jump_to(exc, 0);
+  AddressLiteral exc(Runtime1::entry_for(Runtime1::unwind_exception_id));
+  __ jump_to(exc, G4);
   __ delayed()->nop();
 
 
diff --git a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
index 38ec7aa..878ffc1 100644
--- a/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2004-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,8 +106,7 @@
   __ and3(L0, 255, L4);                 // Isolate L3 = method offset;.
   __ sll(L4, LogBytesPerWord, L4);
   __ ld_ptr(L3, L4, L4);                // Get address of correct virtual method
-  Address method(L4, 0);
-  __ jmpl(method, G0);                  // Jump to correct method.
+  __ jmpl(L4, 0, G0);                   // Jump to correct method.
   __ delayed()->restore();              // Restore registers.
 
   __ flush();
diff --git a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
index a95dca5..87e3dab 100644
--- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,14 +46,13 @@
   // (1) the oop is old (i.e., doesn't matter for scavenges)
   // (2) these ICStubs are removed *before* a GC happens, so the roots disappear
   assert(cached_oop == NULL || cached_oop->is_perm(), "must be old oop");
-  Address cached_oop_addr(G5_inline_cache_reg, address(cached_oop));
-  // Force the sethi to generate the fixed sequence so next_instruction_address works
-  masm->sethi(cached_oop_addr, true /* ForceRelocatable */ );
-  masm->add(cached_oop_addr, G5_inline_cache_reg);
+  AddressLiteral cached_oop_addrlit(cached_oop, relocInfo::none);
+  // Force the set to generate the fixed sequence so next_instruction_address works
+  masm->patchable_set(cached_oop_addrlit, G5_inline_cache_reg);
   assert(G3_scratch != G5_method, "Do not clobber the method oop in the transition stub");
   assert(G3_scratch != G5_inline_cache_reg, "Do not clobber the inline cache register in the transition stub");
-  Address entry(G3_scratch, entry_point);
-  masm->JUMP(entry, 0);
+  AddressLiteral entry(entry_point);
+  masm->JUMP(entry, G3_scratch, 0);
   masm->delayed()->nop();
   masm->flush();
 }
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
index e843d3f..d0d831e 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,8 +35,8 @@
 
 // This file specializes the assember with interpreter-specific macros
 
-const Address InterpreterMacroAssembler::l_tmp( FP, 0,  (frame::interpreter_frame_l_scratch_fp_offset    * wordSize ) + STACK_BIAS);
-const Address InterpreterMacroAssembler::d_tmp( FP, 0,  (frame::interpreter_frame_d_scratch_fp_offset    * wordSize) + STACK_BIAS);
+const Address InterpreterMacroAssembler::l_tmp(FP, (frame::interpreter_frame_l_scratch_fp_offset * wordSize) + STACK_BIAS);
+const Address InterpreterMacroAssembler::d_tmp(FP, (frame::interpreter_frame_d_scratch_fp_offset * wordSize) + STACK_BIAS);
 
 #else // CC_INTERP
 #ifndef STATE
@@ -78,14 +78,12 @@
   sll(Lbyte_code, LogBytesPerWord, Lbyte_code);         // multiply by wordSize
   ld_ptr(IdispatchTables, Lbyte_code, IdispatchAddress);// get entry addr
 #else
-  ldub( Lbcp, bcp_incr, Lbyte_code);               // load next bytecode
+  ldub( Lbcp, bcp_incr, Lbyte_code);                    // load next bytecode
   // dispatch table to use
-  Address tbl(G3_scratch, (address)Interpreter::dispatch_table(state));
-
-  sethi(tbl);
-  sll(Lbyte_code, LogBytesPerWord, Lbyte_code);    // multiply by wordSize
-  add(tbl, tbl.base(), 0);
-  ld_ptr( G3_scratch, Lbyte_code, IdispatchAddress);     // get entry addr
+  AddressLiteral tbl(Interpreter::dispatch_table(state));
+  sll(Lbyte_code, LogBytesPerWord, Lbyte_code);         // multiply by wordSize
+  set(tbl, G3_scratch);                                 // compute addr of table
+  ld_ptr(G3_scratch, Lbyte_code, IdispatchAddress);     // get entry addr
 #endif
 }
 
@@ -165,8 +163,7 @@
     Label L;
 
     // Check the "pending popframe condition" flag in the current thread
-    Address popframe_condition_addr(G2_thread, 0, in_bytes(JavaThread::popframe_condition_offset()));
-    ld(popframe_condition_addr, scratch_reg);
+    ld(G2_thread, JavaThread::popframe_condition_offset(), scratch_reg);
 
     // Initiate popframe handling only if it is not already being processed.  If the flag
     // has the popframe_processing bit set, it means that this code is called *during* popframe
@@ -192,11 +189,10 @@
 
 void InterpreterMacroAssembler::load_earlyret_value(TosState state) {
   Register thr_state = G4_scratch;
-  ld_ptr(Address(G2_thread, 0, in_bytes(JavaThread::jvmti_thread_state_offset())),
-         thr_state);
-  const Address tos_addr(thr_state, 0, in_bytes(JvmtiThreadState::earlyret_tos_offset()));
-  const Address oop_addr(thr_state, 0, in_bytes(JvmtiThreadState::earlyret_oop_offset()));
-  const Address val_addr(thr_state, 0, in_bytes(JvmtiThreadState::earlyret_value_offset()));
+  ld_ptr(G2_thread, JavaThread::jvmti_thread_state_offset(), thr_state);
+  const Address tos_addr(thr_state, JvmtiThreadState::earlyret_tos_offset());
+  const Address oop_addr(thr_state, JvmtiThreadState::earlyret_oop_offset());
+  const Address val_addr(thr_state, JvmtiThreadState::earlyret_value_offset());
   switch (state) {
   case ltos: ld_long(val_addr, Otos_l);                   break;
   case atos: ld_ptr(oop_addr, Otos_l);
@@ -222,8 +218,7 @@
   if (JvmtiExport::can_force_early_return()) {
     Label L;
     Register thr_state = G3_scratch;
-    ld_ptr(Address(G2_thread, 0, in_bytes(JavaThread::jvmti_thread_state_offset())),
-           thr_state);
+    ld_ptr(G2_thread, JavaThread::jvmti_thread_state_offset(), thr_state);
     tst(thr_state);
     br(zero, false, pt, L); // if (thread->jvmti_thread_state() == NULL) exit;
     delayed()->nop();
@@ -231,16 +226,14 @@
     // Initiate earlyret handling only if it is not already being processed.
     // If the flag has the earlyret_processing bit set, it means that this code
     // is called *during* earlyret handling - we don't want to reenter.
-    ld(Address(thr_state, 0, in_bytes(JvmtiThreadState::earlyret_state_offset())),
-       G4_scratch);
+    ld(thr_state, JvmtiThreadState::earlyret_state_offset(), G4_scratch);
     cmp(G4_scratch, JvmtiThreadState::earlyret_pending);
     br(Assembler::notEqual, false, pt, L);
     delayed()->nop();
 
     // Call Interpreter::remove_activation_early_entry() to get the address of the
     // same-named entrypoint in the generated interpreter code
-    Address tos_addr(thr_state, 0, in_bytes(JvmtiThreadState::earlyret_tos_offset()));
-    ld(tos_addr, Otos_l1);
+    ld(thr_state, JvmtiThreadState::earlyret_tos_offset(), Otos_l1);
     call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, Interpreter::remove_activation_early_entry), Otos_l1);
 
     // Jump to Interpreter::_remove_activation_early_entry
@@ -294,10 +287,9 @@
   } else {
 #endif
     // dispatch table to use
-    Address tbl(G3_scratch, (address)table);
-
+    AddressLiteral tbl(table);
     sll(Lbyte_code, LogBytesPerWord, Lbyte_code);       // multiply by wordSize
-    load_address(tbl);                                  // compute addr of table
+    set(tbl, G3_scratch);                               // compute addr of table
     ld_ptr(G3_scratch, Lbyte_code, G3_scratch);         // get entry addr
 #ifdef FAST_DISPATCH
   }
@@ -601,26 +593,17 @@
 
   // Reset SP by subtracting more space from Lesp.
   Label done;
-
-  const Address max_stack   (Lmethod, 0, in_bytes(methodOopDesc::max_stack_offset()));
-  const Address access_flags(Lmethod, 0, in_bytes(methodOopDesc::access_flags_offset()));
-
   verify_oop(Lmethod);
-
-
-  assert( G4_scratch    != Gframe_size,
-          "Only you can prevent register aliasing!");
+  assert(G4_scratch != Gframe_size, "Only you can prevent register aliasing!");
 
   // A native does not need to do this, since its callee does not change SP.
-  ld(access_flags, Gframe_size);
+  ld(Lmethod, methodOopDesc::access_flags_offset(), Gframe_size);  // Load access flags.
   btst(JVM_ACC_NATIVE, Gframe_size);
   br(Assembler::notZero, false, Assembler::pt, done);
   delayed()->nop();
 
-  //
   // Compute max expression stack+register save area
-  //
-  lduh( max_stack, Gframe_size );
+  lduh(Lmethod, in_bytes(methodOopDesc::max_stack_offset()), Gframe_size);  // Load max stack.
   if (TaggedStackInterpreter) sll ( Gframe_size, 1, Gframe_size);  // max_stack * 2 for TAGS
   add( Gframe_size, frame::memory_parameter_word_sp_offset, Gframe_size );
 
@@ -721,8 +704,7 @@
     verify_thread();
     Label skip_compiled_code;
 
-    const Address interp_only       (G2_thread, 0, in_bytes(JavaThread::interp_only_mode_offset()));
-
+    const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset());
     ld(interp_only, scratch);
     tst(scratch);
     br(Assembler::notZero, true, Assembler::pn, skip_compiled_code);
@@ -916,8 +898,8 @@
                                                 Register Rscratch,
                                                 Label&   ok ) {
   assert(throw_entry_point != NULL, "entry point must be generated by now");
-  Address dest(Rscratch, throw_entry_point);
-  jump_to(dest);
+  AddressLiteral dest(throw_entry_point);
+  jump_to(dest, Rscratch);
   delayed()->nop();
   bind(ok);
 }
@@ -1035,18 +1017,18 @@
   Label unlocked, unlock, no_unlock;
 
   // get the value of _do_not_unlock_if_synchronized into G1_scratch
-  const Address do_not_unlock_if_synchronized(G2_thread, 0,
-    in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
+  const Address do_not_unlock_if_synchronized(G2_thread,
+    JavaThread::do_not_unlock_if_synchronized_offset());
   ldbool(do_not_unlock_if_synchronized, G1_scratch);
   stbool(G0, do_not_unlock_if_synchronized); // reset the flag
 
   // check if synchronized method
-  const Address access_flags(Lmethod, 0, in_bytes(methodOopDesc::access_flags_offset()));
+  const Address access_flags(Lmethod, methodOopDesc::access_flags_offset());
   interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
   push(state); // save tos
-  ld(access_flags, G3_scratch);
+  ld(access_flags, G3_scratch); // Load access flags.
   btst(JVM_ACC_SYNCHRONIZED, G3_scratch);
-  br( zero, false, pt, unlocked);
+  br(zero, false, pt, unlocked);
   delayed()->nop();
 
   // Don't unlock anything if the _do_not_unlock_if_synchronized flag
@@ -1236,8 +1218,8 @@
     Register obj_reg = Object;
     Register mark_reg = G4_scratch;
     Register temp_reg = G1_scratch;
-    Address  lock_addr = Address(lock_reg, 0, BasicObjectLock::lock_offset_in_bytes());
-    Address  mark_addr = Address(obj_reg, 0, oopDesc::mark_offset_in_bytes());
+    Address  lock_addr(lock_reg, BasicObjectLock::lock_offset_in_bytes());
+    Address  mark_addr(obj_reg, oopDesc::mark_offset_in_bytes());
     Label    done;
 
     Label slow_case;
@@ -1315,9 +1297,8 @@
     Register obj_reg = G3_scratch;
     Register mark_reg = G4_scratch;
     Register displaced_header_reg = G1_scratch;
-    Address  lock_addr = Address(lock_reg, 0, BasicObjectLock::lock_offset_in_bytes());
-    Address  lockobj_addr = Address(lock_reg, 0, BasicObjectLock::obj_offset_in_bytes());
-    Address  mark_addr = Address(obj_reg, 0, oopDesc::mark_offset_in_bytes());
+    Address  lockobj_addr(lock_reg, BasicObjectLock::obj_offset_in_bytes());
+    Address  mark_addr(obj_reg, oopDesc::mark_offset_in_bytes());
     Label    done;
 
     if (UseBiasedLocking) {
@@ -1328,7 +1309,8 @@
     }
 
     // Test first if we are in the fast recursive case
-    ld_ptr(lock_addr, displaced_header_reg, BasicLock::displaced_header_offset_in_bytes());
+    Address lock_addr(lock_reg, BasicObjectLock::lock_offset_in_bytes() + BasicLock::displaced_header_offset_in_bytes());
+    ld_ptr(lock_addr, displaced_header_reg);
     br_null(displaced_header_reg, true, Assembler::pn, done);
     delayed()->st_ptr(G0, lockobj_addr);  // free entry
 
@@ -1384,7 +1366,7 @@
   Label zero_continue;
 
   // Test MDO to avoid the call if it is NULL.
-  ld_ptr(Lmethod, in_bytes(methodOopDesc::method_data_offset()), ImethodDataPtr);
+  ld_ptr(Lmethod, methodOopDesc::method_data_offset(), ImethodDataPtr);
   test_method_data_pointer(zero_continue);
   call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), Lmethod, Lbcp);
   set_method_data_pointer_offset(O0);
@@ -1413,7 +1395,7 @@
   // If the mdp is valid, it will point to a DataLayout header which is
   // consistent with the bcp.  The converse is highly probable also.
   lduh(ImethodDataPtr, in_bytes(DataLayout::bci_offset()), G3_scratch);
-  ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::const_offset())), O5);
+  ld_ptr(Lmethod, methodOopDesc::const_offset(), O5);
   add(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()), G3_scratch);
   add(G3_scratch, O5, G3_scratch);
   cmp(Lbcp, G3_scratch);
@@ -1424,7 +1406,7 @@
   // %%% should use call_VM_leaf here?
   //call_VM_leaf(noreg, ..., Lmethod, Lbcp, ImethodDataPtr);
   save_frame_and_mov(sizeof(jdouble) / wordSize, Lmethod, O0, Lbcp, O1);
-  Address d_save(FP, 0, -sizeof(jdouble) + STACK_BIAS);
+  Address d_save(FP, -sizeof(jdouble) + STACK_BIAS);
   stf(FloatRegisterImpl::D, Ftos_d, d_save);
   mov(temp_reg->after_save(), O2);
   save_thread(L7_thread_cache);
@@ -1456,14 +1438,14 @@
 #endif
 
   // Test to see if we should create a method data oop
-  Address profile_limit(Rtmp, (address)&InvocationCounter::InterpreterProfileLimit);
+  AddressLiteral profile_limit((address) &InvocationCounter::InterpreterProfileLimit);
 #ifdef _LP64
   delayed()->nop();
-  sethi(profile_limit);
+  sethi(profile_limit, Rtmp);
 #else
-  delayed()->sethi(profile_limit);
+  delayed()->sethi(profile_limit, Rtmp);
 #endif
-  ld(profile_limit, Rtmp);
+  ld(Rtmp, profile_limit.low10(), Rtmp);
   cmp(invocation_count, Rtmp);
   br(Assembler::lessUnsigned, false, Assembler::pn, profile_continue);
   delayed()->nop();
@@ -1521,7 +1503,7 @@
                                                       Register bumped_count,
                                                       bool decrement) {
   // Locate the counter at a fixed offset from the mdp:
-  Address counter(ImethodDataPtr, 0, constant);
+  Address counter(ImethodDataPtr, constant);
   increment_mdp_data_at(counter, bumped_count, decrement);
 }
 
@@ -1535,7 +1517,7 @@
                                                       bool decrement) {
   // Add the constant to reg to get the offset.
   add(ImethodDataPtr, reg, scratch2);
-  Address counter(scratch2, 0, constant);
+  Address counter(scratch2, constant);
   increment_mdp_data_at(counter, bumped_count, decrement);
 }
 
@@ -2201,7 +2183,7 @@
 
 
 Address InterpreterMacroAssembler::top_most_monitor() {
-  return Address(FP, 0, top_most_monitor_byte_offset());
+  return Address(FP, top_most_monitor_byte_offset());
 }
 
 
@@ -2214,15 +2196,15 @@
 void InterpreterMacroAssembler::increment_invocation_counter( Register Rtmp, Register Rtmp2 ) {
   assert(UseCompiler, "incrementing must be useful");
 #ifdef CC_INTERP
-  Address inv_counter(G5_method, 0, in_bytes(methodOopDesc::invocation_counter_offset()
-                            + InvocationCounter::counter_offset()));
-  Address be_counter(G5_method, 0, in_bytes(methodOopDesc::backedge_counter_offset()
-                            + InvocationCounter::counter_offset()));
+  Address inv_counter(G5_method, methodOopDesc::invocation_counter_offset() +
+                                 InvocationCounter::counter_offset());
+  Address be_counter (G5_method, methodOopDesc::backedge_counter_offset() +
+                                 InvocationCounter::counter_offset());
 #else
-  Address inv_counter(Lmethod, 0, in_bytes(methodOopDesc::invocation_counter_offset()
-                            + InvocationCounter::counter_offset()));
-  Address be_counter(Lmethod, 0, in_bytes(methodOopDesc::backedge_counter_offset()
-                            + InvocationCounter::counter_offset()));
+  Address inv_counter(Lmethod, methodOopDesc::invocation_counter_offset() +
+                               InvocationCounter::counter_offset());
+  Address be_counter (Lmethod, methodOopDesc::backedge_counter_offset() +
+                               InvocationCounter::counter_offset());
 #endif /* CC_INTERP */
   int delta = InvocationCounter::count_increment;
 
@@ -2250,15 +2232,15 @@
 void InterpreterMacroAssembler::increment_backedge_counter( Register Rtmp, Register Rtmp2 ) {
   assert(UseCompiler, "incrementing must be useful");
 #ifdef CC_INTERP
-  Address be_counter(G5_method, 0, in_bytes(methodOopDesc::backedge_counter_offset()
-                            + InvocationCounter::counter_offset()));
-  Address inv_counter(G5_method, 0, in_bytes(methodOopDesc::invocation_counter_offset()
-                            +  InvocationCounter::counter_offset()));
+  Address be_counter (G5_method, methodOopDesc::backedge_counter_offset() +
+                                 InvocationCounter::counter_offset());
+  Address inv_counter(G5_method, methodOopDesc::invocation_counter_offset() +
+                                 InvocationCounter::counter_offset());
 #else
-  Address be_counter(Lmethod, 0, in_bytes(methodOopDesc::backedge_counter_offset()
-                            + InvocationCounter::counter_offset()));
-  Address inv_counter(Lmethod, 0, in_bytes(methodOopDesc::invocation_counter_offset()
-                            + InvocationCounter::counter_offset()));
+  Address be_counter (Lmethod, methodOopDesc::backedge_counter_offset() +
+                               InvocationCounter::counter_offset());
+  Address inv_counter(Lmethod, methodOopDesc::invocation_counter_offset() +
+                               InvocationCounter::counter_offset());
 #endif /* CC_INTERP */
   int delta = InvocationCounter::count_increment;
   // Load each counter in a register
@@ -2289,7 +2271,7 @@
   assert_different_registers(backedge_count, Rtmp, branch_bcp);
   assert(UseOnStackReplacement,"Must UseOnStackReplacement to test_backedge_count_for_osr");
 
-  Address limit(Rtmp, address(&InvocationCounter::InterpreterBackwardBranchLimit));
+  AddressLiteral limit(&InvocationCounter::InterpreterBackwardBranchLimit);
   load_contents(limit, Rtmp);
   cmp(backedge_count, Rtmp);
   br(Assembler::lessUnsigned, false, Assembler::pt, did_not_overflow);
@@ -2435,9 +2417,7 @@
   if (JvmtiExport::can_post_interpreter_events()) {
     Label L;
     Register temp_reg = O5;
-
-    const Address interp_only       (G2_thread, 0, in_bytes(JavaThread::interp_only_mode_offset()));
-
+    const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset());
     ld(interp_only, temp_reg);
     tst(temp_reg);
     br(zero, false, pt, L);
@@ -2489,9 +2469,7 @@
   if (mode == NotifyJVMTI && JvmtiExport::can_post_interpreter_events()) {
     Label L;
     Register temp_reg = O5;
-
-    const Address interp_only       (G2_thread, 0, in_bytes(JavaThread::interp_only_mode_offset()));
-
+    const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset());
     ld(interp_only, temp_reg);
     tst(temp_reg);
     br(zero, false, pt, L);
diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
index f6cb8e7..7306f2a 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,7 +105,7 @@
   // the handle for a receiver will never be null
   bool do_NULL_check = offset() != 0 || is_static();
 
-  Address     h_arg = Address(Llocals, 0, Interpreter::local_offset_in_bytes(offset()));
+  Address     h_arg = Address(Llocals, Interpreter::local_offset_in_bytes(offset()));
   __ ld_ptr(h_arg, Rtmp1);
 #ifdef ASSERT
   if (TaggedStackInterpreter) {
@@ -120,14 +120,14 @@
   }
 #endif // ASSERT
   if (!do_NULL_check) {
-    __ add(h_arg, Rtmp2);
+    __ add(h_arg.base(), h_arg.disp(), Rtmp2);
   } else {
     if (Rtmp1 == Rtmp2)
           __ tst(Rtmp1);
     else  __ addcc(G0, Rtmp1, Rtmp2); // optimize mov/test pair
     Label L;
     __ brx(Assembler::notZero, true, Assembler::pt, L);
-    __ delayed()->add(h_arg, Rtmp2);
+    __ delayed()->add(h_arg.base(), h_arg.disp(), Rtmp2);
     __ bind(L);
   }
   __ store_ptr_argument(Rtmp2, jni_arg);    // this is often a no-op
@@ -140,10 +140,10 @@
   iterate(fingerprint);
 
   // return result handler
-  Address result_handler(Lscratch, Interpreter::result_handler(method()->result_type()));
-  __ sethi(result_handler);
+  AddressLiteral result_handler(Interpreter::result_handler(method()->result_type()));
+  __ sethi(result_handler, Lscratch);
   __ retl();
-  __ delayed()->add(result_handler, result_handler.base());
+  __ delayed()->add(Lscratch, result_handler.low10(), Lscratch);
 
   __ flush();
 }
diff --git a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
index 31253ba..a0a4a6b 100644
--- a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2004-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,10 +57,10 @@
 
   Label label1, label2;
 
-  address cnt_addr = SafepointSynchronize::safepoint_counter_addr();
-  Address ca(O3, cnt_addr);
-  __ sethi (ca);
-  __ ld (ca, G4);
+  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
+  __ sethi (cnt_addrlit, O3);
+  Address cnt_addr(O3, cnt_addrlit.low10());
+  __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
@@ -77,7 +77,7 @@
     default:        ShouldNotReachHere();
   }
 
-  __ ld (ca, O5);
+  __ ld (cnt_addr, O5);
   __ cmp (O5, G4);
   __ br (Assembler::notEqual, false, Assembler::pn, label2);
   __ delayed()->mov (O7, G1);
@@ -136,10 +136,10 @@
 
   Label label1, label2;
 
-  address cnt_addr = SafepointSynchronize::safepoint_counter_addr();
-  Address ca(G3, cnt_addr);
-  __ sethi (ca);
-  __ ld (ca, G4);
+  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
+  __ sethi (cnt_addrlit, G3);
+  Address cnt_addr(G3, cnt_addrlit.low10());
+  __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
@@ -159,7 +159,7 @@
   __ ldx (O5, 0, O3);
 #endif
 
-  __ ld (ca, G1);
+  __ ld (cnt_addr, G1);
   __ cmp (G1, G4);
   __ br (Assembler::notEqual, false, Assembler::pn, label2);
   __ delayed()->mov (O7, G1);
@@ -208,10 +208,10 @@
 
   Label label1, label2;
 
-  address cnt_addr = SafepointSynchronize::safepoint_counter_addr();
-  Address ca(O3, cnt_addr);
-  __ sethi (ca);
-  __ ld (ca, G4);
+  AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
+  __ sethi (cnt_addrlit, O3);
+  Address cnt_addr(O3, cnt_addrlit.low10());
+  __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
@@ -225,7 +225,7 @@
     default:       ShouldNotReachHere();
   }
 
-  __ ld (ca, O5);
+  __ ld (cnt_addr, O5);
   __ cmp (O5, G4);
   __ br (Assembler::notEqual, false, Assembler::pn, label2);
   __ delayed()->mov (O7, G1);
diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
index 16e3c67..df9c778 100644
--- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,7 @@
 
   destreg = inv_rd(*(unsigned int *)instaddr);
   // Generate a the new sequence
-  Address dest( destreg, (address)x );
-  _masm->sethi( dest, true );
+  _masm->patchable_sethi(x, destreg);
   ICache::invalidate_range(instaddr, 7 * BytesPerInstWord);
 }
 
@@ -227,8 +226,8 @@
   CodeBuffer buf(addr_at(0), instruction_size + 1);
   MacroAssembler* _masm = new MacroAssembler(&buf);
   // Generate the new sequence
-  Address(O7, dest);
-  _masm->jumpl_to(dest, O7);
+  AddressLiteral(dest);
+  _masm->jumpl_to(dest, O7, O7);
   ICache::invalidate_range(addr_at(0), instruction_size );
 #endif
 }
@@ -361,10 +360,12 @@
 
   VM_Version::allow_all();
 
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none);
-  a->add(I3, low10(0xaaaabbbb), I3);
-  a->sethi(0xccccdddd, O2, true, RelocationHolder::none);
-  a->add(O2, low10(0xccccdddd), O2);
+  AddressLiteral al1(0xaaaabbbb, relocInfo::external_word_type);
+  a->sethi(al1, I3);
+  a->add(I3, al1.low10(), I3);
+  AddressLiteral al2(0xccccdddd, relocInfo::external_word_type);
+  a->sethi(al2, O2);
+  a->add(O2, al2.low10(), O2);
 
   nm = nativeMovConstReg_at( cb.code_begin() );
   nm->print();
@@ -468,12 +469,14 @@
 
   VM_Version::allow_all();
 
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none);
+  AddressLiteral al1(0xaaaabbbb, relocInfo::external_word_type);
+  a->sethi(al1, I3);
   a->nop();
-  a->add(I3, low10(0xaaaabbbb), I3);
-  a->sethi(0xccccdddd, O2, true, RelocationHolder::none);
+  a->add(I3, al1.low10(), I3);
+  AddressLiteral al2(0xccccdddd, relocInfo::external_word_type);
+  a->sethi(al2, O2);
   a->nop();
-  a->add(O2, low10(0xccccdddd), O2);
+  a->add(O2, al2.low10(), O2);
 
   nm = nativeMovConstRegPatching_at( cb.code_begin() );
   nm->print();
@@ -562,51 +565,53 @@
 
   VM_Version::allow_all();
 
-  a->ldsw( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  AddressLiteral al1(0xffffffff, relocInfo::external_word_type);
+  AddressLiteral al2(0xaaaabbbb, relocInfo::external_word_type);
+  a->ldsw( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldsw( G5, I3, G4 ); idx++;
-  a->ldsb( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldsb( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldsb( G5, I3, G4 ); idx++;
-  a->ldsh( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldsh( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldsh( G5, I3, G4 ); idx++;
-  a->lduw( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->lduw( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->lduw( G5, I3, G4 ); idx++;
-  a->ldub( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldub( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldub( G5, I3, G4 ); idx++;
-  a->lduh( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->lduh( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->lduh( G5, I3, G4 ); idx++;
-  a->ldx( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldx( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldx( G5, I3, G4 ); idx++;
-  a->ldd( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldd( G5, al1.low10(), G4 ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldd( G5, I3, G4 ); idx++;
   a->ldf( FloatRegisterImpl::D, O2, -1, F14 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->ldf( FloatRegisterImpl::S, O0, I3, F15 ); idx++;
 
-  a->stw( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stw( G5, G4, al1.low10() ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->stw( G5, G4, I3 ); idx++;
-  a->stb( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stb( G5, G4, al1.low10() ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->stb( G5, G4, I3 ); idx++;
-  a->sth( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->sth( G5, G4, al1.low10() ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->sth( G5, G4, I3 ); idx++;
-  a->stx( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stx( G5, G4, al1.low10() ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->stx( G5, G4, I3 ); idx++;
-  a->std( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->std( G5, G4, al1.low10() ); idx++;
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->std( G5, G4, I3 ); idx++;
   a->stf( FloatRegisterImpl::S, F18, O2, -1 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->add(I3, low10(0xaaaabbbb), I3);
+  a->sethi(al2, I3); a->add(I3, al2.low10(), I3);
   a->stf( FloatRegisterImpl::S, F15, O0, I3 ); idx++;
 
   nm = nativeMovRegMem_at( cb.code_begin() );
@@ -705,51 +710,52 @@
 
   VM_Version::allow_all();
 
-  a->ldsw( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  AddressLiteral al(0xffffffff, relocInfo::external_word_type);
+  a->ldsw( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->ldsw( G5, I3, G4 ); idx++;
-  a->ldsb( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldsb( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->ldsb( G5, I3, G4 ); idx++;
-  a->ldsh( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldsh( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->ldsh( G5, I3, G4 ); idx++;
-  a->lduw( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->lduw( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->lduw( G5, I3, G4 ); idx++;
-  a->ldub( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->ldub( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->ldub( G5, I3, G4 ); idx++;
-  a->lduh( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->lduh( G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->lduh( G5, I3, G4 ); idx++;
-  a->ldx( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
-  a->ldx( G5, I3, G4 ); idx++;
-  a->ldd( G5, low10(0xffffffff), G4 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
-  a->ldd( G5, I3, G4 ); idx++;
-  a->ldf( FloatRegisterImpl::D, O2, -1, F14 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
-  a->ldf( FloatRegisterImpl::S, O0, I3, F15 ); idx++;
+  a->ldx(  G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
+  a->ldx(  G5, I3, G4 ); idx++;
+  a->ldd(  G5, al.low10(), G4); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
+  a->ldd(  G5, I3, G4 ); idx++;
+  a->ldf(  FloatRegisterImpl::D, O2, -1, F14 ); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
+  a->ldf(  FloatRegisterImpl::S, O0, I3, F15 ); idx++;
 
-  a->stw( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stw( G5, G4, al.low10()); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->stw( G5, G4, I3 ); idx++;
-  a->stb( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stb( G5, G4, al.low10()); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->stb( G5, G4, I3 ); idx++;
-  a->sth( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->sth( G5, G4, al.low10()); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->sth( G5, G4, I3 ); idx++;
-  a->stx( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->stx( G5, G4, al.low10()); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->stx( G5, G4, I3 ); idx++;
-  a->std( G5, G4, low10(0xffffffff) ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->std( G5, G4, al.low10()); idx++;
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->std( G5, G4, I3 ); idx++;
   a->stf( FloatRegisterImpl::S, F18, O2, -1 ); idx++;
-  a->sethi(0xaaaabbbb, I3, true, RelocationHolder::none); a->nop(); a->add(I3, low10(0xaaaabbbb), I3);
+  a->sethi(al, I3); a->nop(); a->add(I3, al.low10(), I3);
   a->stf( FloatRegisterImpl::S, F15, O0, I3 ); idx++;
 
   nm = nativeMovRegMemPatching_at( cb.code_begin() );
@@ -833,11 +839,12 @@
 
   VM_Version::allow_all();
 
-  a->sethi(0x7fffbbbb, I3, true, RelocationHolder::none);
-  a->jmpl(I3, low10(0x7fffbbbb), G0, RelocationHolder::none);
+  AddressLiteral al(0x7fffbbbb, relocInfo::external_word_type);
+  a->sethi(al, I3);
+  a->jmpl(I3, al.low10(), G0, RelocationHolder::none);
   a->delayed()->nop();
-  a->sethi(0x7fffbbbb, I3, true, RelocationHolder::none);
-  a->jmpl(I3, low10(0x7fffbbbb), L3, RelocationHolder::none);
+  a->sethi(al, I3);
+  a->jmpl(I3, al.low10(), L3, RelocationHolder::none);
   a->delayed()->nop();
 
   nj = nativeJump_at( cb.code_begin() );
diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
index ab36555..61a43a8 100644
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -99,13 +99,6 @@
       break;
     }
     ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x );
-#ifdef COMPILER2
-    // [RGV] Someone must have missed putting in a reloc entry for the
-    // add in compiler2.
-    inst2 = ip->long_at( NativeMovConstReg::add_offset );
-    guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
-    ip->set_long_at(NativeMovConstReg::add_offset,ip->set_data32_simm13( inst2, (intptr_t)x+o));
-#endif
 #else
     guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
     inst &= ~Assembler::hi22(     -1);
diff --git a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
index 181990e..9ae48cb 100644
--- a/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,8 +74,8 @@
   int start = __ offset();
 
   __ verify_thread();
-  __ st_ptr(Oexception,  Address(G2_thread, 0, in_bytes(JavaThread::exception_oop_offset())));
-  __ st_ptr(Oissuing_pc, Address(G2_thread, 0, in_bytes(JavaThread::exception_pc_offset())));
+  __ st_ptr(Oexception,  G2_thread, JavaThread::exception_oop_offset());
+  __ st_ptr(Oissuing_pc, G2_thread, JavaThread::exception_pc_offset());
 
   // This call does all the hard work. It checks if an exception catch
   // exists in the method.
@@ -120,19 +120,19 @@
   // Since this may be the deopt blob we must set O7 to look like we returned
   // from the original pc that threw the exception
 
-  __ ld_ptr(Address(G2_thread, 0, in_bytes(JavaThread::exception_pc_offset())), O7);
+  __ ld_ptr(G2_thread, JavaThread::exception_pc_offset(), O7);
   __ sub(O7, frame::pc_return_offset, O7);
 
 
   assert(Assembler::is_simm13(in_bytes(JavaThread::exception_oop_offset())), "exception offset overflows simm13, following ld instruction cannot be in delay slot");
-  __ ld_ptr(Address(G2_thread, 0, in_bytes(JavaThread::exception_oop_offset())), Oexception); // O0
+  __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception); // O0
 #ifdef ASSERT
-  __ st_ptr(G0, Address(G2_thread, 0, in_bytes(JavaThread::exception_handler_pc_offset())));
-  __ st_ptr(G0, Address(G2_thread, 0, in_bytes(JavaThread::exception_pc_offset())));
+  __ st_ptr(G0, G2_thread, JavaThread::exception_handler_pc_offset());
+  __ st_ptr(G0, G2_thread, JavaThread::exception_pc_offset());
 #endif
   __ JMP(G3_scratch, 0);
   // Clear the exception oop so GC no longer processes it as a root.
-  __ delayed()->st_ptr(G0, Address(G2_thread, 0, in_bytes(JavaThread::exception_oop_offset())));
+  __ delayed()->st_ptr(G0, G2_thread, JavaThread::exception_oop_offset());
 
   // -------------
   // make sure all code is generated
diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index e2bd044..6dd0a1f 100644
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -625,9 +625,9 @@
   __ mov(I7, O1);                // VM needs caller's callsite
   // Must be a leaf call...
   // can be very far once the blob has been relocated
-  Address dest(O7, CAST_FROM_FN_PTR(address, SharedRuntime::fixup_callers_callsite));
+  AddressLiteral dest(CAST_FROM_FN_PTR(address, SharedRuntime::fixup_callers_callsite));
   __ relocate(relocInfo::runtime_call_type);
-  __ jumpl_to(dest, O7);
+  __ jumpl_to(dest, O7, O7);
   __ delayed()->mov(G2_thread, L7_thread_cache);
   __ mov(L7_thread_cache, G2_thread);
   __ mov(L1, G1);
@@ -1152,7 +1152,7 @@
 #ifndef _LP64
     if (g3_crushed) {
       // Rats load was wasted, at least it is in cache...
-      __ ld_ptr(G5_method, in_bytes(methodOopDesc::from_compiled_offset()), G3);
+      __ ld_ptr(G5_method, methodOopDesc::from_compiled_offset(), G3);
     }
 #endif /* _LP64 */
 
@@ -1165,7 +1165,7 @@
     // we try and find the callee by normal means a safepoint
     // is possible. So we stash the desired callee in the thread
     // and the vm will find there should this case occur.
-    Address callee_target_addr(G2_thread, 0, in_bytes(JavaThread::callee_target_offset()));
+    Address callee_target_addr(G2_thread, JavaThread::callee_target_offset());
     __ st_ptr(G5_method, callee_target_addr);
 
     if (StressNonEntrant) {
@@ -1218,7 +1218,7 @@
     Register R_temp   = G1;   // another scratch register
 #endif
 
-    Address ic_miss(G3_scratch, SharedRuntime::get_ic_miss_stub());
+    AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
 
     __ verify_oop(O0);
     __ verify_oop(G5_method);
@@ -1240,7 +1240,7 @@
     Label ok, ok2;
     __ brx(Assembler::equal, false, Assembler::pt, ok);
     __ delayed()->ld_ptr(G5_method, compiledICHolderOopDesc::holder_method_offset(), G5_method);
-    __ jump_to(ic_miss);
+    __ jump_to(ic_miss, G3_scratch);
     __ delayed()->nop();
 
     __ bind(ok);
@@ -1251,7 +1251,7 @@
     __ bind(ok2);
     __ br_null(G3_scratch, false, __ pt, skip_fixup);
     __ delayed()->ld_ptr(G5_method, in_bytes(methodOopDesc::interpreter_entry_offset()), G3_scratch);
-    __ jump_to(ic_miss);
+    __ jump_to(ic_miss, G3_scratch);
     __ delayed()->nop();
 
   }
@@ -1444,8 +1444,8 @@
   // without calling into the VM: it's the empty function.  Just pop this
   // frame and then jump to forward_exception_entry; O7 will contain the
   // native caller's return PC.
-  Address exception_entry(G3_scratch, StubRoutines::forward_exception_entry());
-  __ jump_to(exception_entry);
+ AddressLiteral exception_entry(StubRoutines::forward_exception_entry());
+  __ jump_to(exception_entry, G3_scratch);
   __ delayed()->restore();      // Pop this frame off.
   __ bind(L);
 }
@@ -1822,14 +1822,14 @@
   {
     Label L;
     const Register temp_reg = G3_scratch;
-    Address ic_miss(temp_reg, SharedRuntime::get_ic_miss_stub());
+    AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
     __ verify_oop(O0);
     __ load_klass(O0, temp_reg);
     __ cmp(temp_reg, G5_inline_cache_reg);
     __ brx(Assembler::equal, true, Assembler::pt, L);
     __ delayed()->nop();
 
-    __ jump_to(ic_miss, 0);
+    __ jump_to(ic_miss, temp_reg);
     __ delayed()->nop();
     __ align(CodeEntryAlignment);
     __ bind(L);
@@ -2261,21 +2261,19 @@
 
   // Transition from _thread_in_Java to _thread_in_native.
   __ set(_thread_in_native, G3_scratch);
-  __ st(G3_scratch, G2_thread, in_bytes(JavaThread::thread_state_offset()));
+  __ st(G3_scratch, G2_thread, JavaThread::thread_state_offset());
 
   // We flushed the windows ages ago now mark them as flushed
 
   // mark windows as flushed
   __ set(JavaFrameAnchor::flushed, G3_scratch);
 
-  Address flags(G2_thread,
-                0,
-                in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset()));
+  Address flags(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset());
 
 #ifdef _LP64
-  Address dest(O7, method->native_function());
+  AddressLiteral dest(method->native_function());
   __ relocate(relocInfo::runtime_call_type);
-  __ jumpl_to(dest, O7);
+  __ jumpl_to(dest, O7, O7);
 #else
   __ call(method->native_function(), relocInfo::runtime_call_type);
 #endif
@@ -2316,7 +2314,7 @@
   // Block, if necessary, before resuming in _thread_in_Java state.
   // In order for GC to work, don't clear the last_Java_sp until after blocking.
   { Label no_block;
-    Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
+    AddressLiteral sync_state(SafepointSynchronize::address_of_state());
 
     // Switch thread to "native transition" state before reading the synchronization state.
     // This additional state is necessary because reading and testing the synchronization
@@ -2326,7 +2324,7 @@
     //     Thread A is resumed to finish this native method, but doesn't block here since it
     //     didn't see any synchronization is progress, and escapes.
     __ set(_thread_in_native_trans, G3_scratch);
-    __ st(G3_scratch, G2_thread, in_bytes(JavaThread::thread_state_offset()));
+    __ st(G3_scratch, G2_thread, JavaThread::thread_state_offset());
     if(os::is_MP()) {
       if (UseMembar) {
         // Force this write out before the read below
@@ -2343,10 +2341,9 @@
     __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
 
     Label L;
-    Address suspend_state(G2_thread, 0, in_bytes(JavaThread::suspend_flags_offset()));
+    Address suspend_state(G2_thread, JavaThread::suspend_flags_offset());
     __ br(Assembler::notEqual, false, Assembler::pn, L);
-    __ delayed()->
-      ld(suspend_state, G3_scratch);
+    __ delayed()->ld(suspend_state, G3_scratch);
     __ cmp(G3_scratch, 0);
     __ br(Assembler::equal, false, Assembler::pt, no_block);
     __ delayed()->nop();
@@ -2372,11 +2369,11 @@
 
 
   __ set(_thread_in_Java, G3_scratch);
-  __ st(G3_scratch, G2_thread, in_bytes(JavaThread::thread_state_offset()));
+  __ st(G3_scratch, G2_thread, JavaThread::thread_state_offset());
 
 
   Label no_reguard;
-  __ ld(G2_thread, in_bytes(JavaThread::stack_guard_state_offset()), G3_scratch);
+  __ ld(G2_thread, JavaThread::stack_guard_state_offset(), G3_scratch);
   __ cmp(G3_scratch, JavaThread::stack_guard_yellow_disabled);
   __ br(Assembler::notEqual, false, Assembler::pt, no_reguard);
   __ delayed()->nop();
@@ -2684,14 +2681,14 @@
   {
     Label L;
     const Register temp_reg = G3_scratch;
-    Address ic_miss(temp_reg, SharedRuntime::get_ic_miss_stub());
+    AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
     __ verify_oop(O0);
     __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), temp_reg);
     __ cmp(temp_reg, G5_inline_cache_reg);
     __ brx(Assembler::equal, true, Assembler::pt, L);
     __ delayed()->nop();
 
-    __ jump_to(ic_miss, 0);
+    __ jump_to(ic_miss, temp_reg);
     __ delayed()->nop();
     __ align(CodeEntryAlignment);
     __ bind(L);
@@ -3155,15 +3152,13 @@
   // Do this after the caller's return address is on top of stack
   if (UseStackBanging) {
     // Get total frame size for interpreted frames
-    __ ld(Address(O2UnrollBlock, 0,
-         Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()), O4);
+    __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4);
     __ bang_stack_size(O4, O3, G3_scratch);
   }
 
-  __ ld(Address(O2UnrollBlock, 0, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()), O4array_size);
-  __ ld_ptr(Address(O2UnrollBlock, 0, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()), G3pcs);
-
-  __ ld_ptr(Address(O2UnrollBlock, 0, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()), O3array);
+  __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size);
+  __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs);
+  __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes(), O3array);
 
   // Adjust old interpreter frame to make space for new frame's extra java locals
   //
@@ -3176,7 +3171,7 @@
   // for each frame we create and keep up the illusion every where.
   //
 
-  __ ld(Address(O2UnrollBlock, 0, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()), O7);
+  __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes(), O7);
   __ mov(SP, O5_savedSP);       // remember initial sender's original sp before adjustment
   __ sub(SP, O7, SP);
 
@@ -3225,9 +3220,9 @@
   Register        I5exception_tmp    = I5;
   Register        G4exception_tmp    = G4_scratch;
   int             frame_size_words;
-  Address         saved_Freturn0_addr(FP, 0, -sizeof(double) + STACK_BIAS);
+  Address         saved_Freturn0_addr(FP, -sizeof(double) + STACK_BIAS);
 #if !defined(_LP64) && defined(COMPILER2)
-  Address         saved_Greturn1_addr(FP, 0, -sizeof(double) -sizeof(jlong) + STACK_BIAS);
+  Address         saved_Greturn1_addr(FP, -sizeof(double) -sizeof(jlong) + STACK_BIAS);
 #endif
   Label           cont;
 
@@ -3289,7 +3284,7 @@
   // save exception oop in JavaThread and fall through into the
   // exception_in_tls case since they are handled in same way except
   // for where the pending exception is kept.
-  __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
+  __ st_ptr(Oexception, G2_thread, JavaThread::exception_oop_offset());
 
   //
   // Vanilla deoptimization with an exception pending in exception_oop
@@ -3306,7 +3301,7 @@
   {
     // verify that there is really an exception oop in exception_oop
     Label has_exception;
-    __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception);
+    __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception);
     __ br_notnull(Oexception, false, Assembler::pt, has_exception);
     __ delayed()-> nop();
     __ stop("no exception in thread");
@@ -3314,7 +3309,7 @@
 
     // verify that there is no pending exception
     Label no_pending_exception;
-    Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
     __ ld_ptr(exception_addr, Oexception);
     __ br_null(Oexception, false, Assembler::pt, no_pending_exception);
     __ delayed()->nop();
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index c65cc54..b6d3a72 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -980,8 +980,8 @@
   // This code sequence is relocatable to any address, even on LP64.
   if ( force_far_call ) {
     __ relocate(rtype);
-    Address dest(O7, (address)entry_point);
-    __ jumpl_to(dest, O7);
+    AddressLiteral dest(entry_point);
+    __ jumpl_to(dest, O7, O7);
   }
   else
 #endif
@@ -1031,17 +1031,6 @@
 void emit_lo(CodeBuffer &cbuf, int val) {  }
 void emit_hi(CodeBuffer &cbuf, int val) {  }
 
-void emit_ptr(CodeBuffer &cbuf, intptr_t val, Register reg, bool ForceRelocatable) {
-  MacroAssembler _masm(&cbuf);
-  if (ForceRelocatable) {
-    Address addr(reg, (address)val);
-    __ sethi(addr, ForceRelocatable);
-    __ add(addr, reg);
-  } else {
-    __ set(val, reg);
-  }
-}
-
 
 //=============================================================================
 
@@ -1149,8 +1138,8 @@
 
   // If this does safepoint polling, then do it here
   if( do_polling() && ra_->C->is_method_compilation() ) {
-    Address polling_page(L0, (address)os::get_polling_page());
-    __ sethi(polling_page, false);
+    AddressLiteral polling_page(os::get_polling_page());
+    __ sethi(polling_page, L0);
     __ relocate(relocInfo::poll_return_type);
     __ ld_ptr( L0, 0, G0 );
   }
@@ -1576,8 +1565,8 @@
   __ set_oop(NULL, reg_to_register_object(Matcher::inline_cache_reg_encode()));
 
   __ set_inst_mark();
-  Address a(G3, (address)-1);
-  __ JUMP(a, 0);
+  AddressLiteral addrlit(-1);
+  __ JUMP(addrlit, G3, 0);
 
   __ delayed()->nop();
 
@@ -1662,7 +1651,7 @@
 // Emit exception handler code.
 int emit_exception_handler(CodeBuffer& cbuf) {
   Register temp_reg = G3;
-  Address exception_blob(temp_reg, OptoRuntime::exception_blob()->instructions_begin());
+  AddressLiteral exception_blob(OptoRuntime::exception_blob()->instructions_begin());
   MacroAssembler _masm(&cbuf);
 
   address base =
@@ -1671,7 +1660,7 @@
 
   int offset = __ offset();
 
-  __ JUMP(exception_blob, 0); // sethi;jmp
+  __ JUMP(exception_blob, temp_reg, 0); // sethi;jmp
   __ delayed()->nop();
 
   assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
@@ -1685,7 +1674,7 @@
   // Can't use any of the current frame's registers as we may have deopted
   // at a poll and everything (including G3) can be live.
   Register temp_reg = L0;
-  Address deopt_blob(temp_reg, SharedRuntime::deopt_blob()->unpack());
+  AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
   MacroAssembler _masm(&cbuf);
 
   address base =
@@ -1694,7 +1683,7 @@
 
   int offset = __ offset();
   __ save_frame(0);
-  __ JUMP(deopt_blob, 0); // sethi;jmp
+  __ JUMP(deopt_blob, temp_reg, 0); // sethi;jmp
   __ delayed()->restore();
 
   assert(__ offset() - offset <= (int) size_deopt_handler(), "overflow");
@@ -2261,9 +2250,8 @@
     address table_base = __ address_table_constant(_index2label);
     RelocationHolder rspec = internal_word_Relocation::spec(table_base);
 
-    // Load table address
-    Address the_pc(table_reg, table_base, rspec);
-    __ load_address(the_pc);
+    // Move table address into a register.
+    __ set(table_base, table_reg, rspec);
 
     // Jump to base address + switch value
     __ ld_ptr(table_reg, switch_reg, table_reg);
@@ -2402,13 +2390,13 @@
   // The 64 bit pointer is stored in the generated code stream
   enc_class SetPtr( immP src, iRegP rd ) %{
     Register dest = reg_to_register_object($rd$$reg);
+    MacroAssembler _masm(&cbuf);
     // [RGV] This next line should be generated from ADLC
     if ( _opnds[1]->constant_is_oop() ) {
       intptr_t val = $src$$constant;
-      MacroAssembler _masm(&cbuf);
       __ set_oop_constant((jobject)val, dest);
     } else {          // non-oop pointers, e.g. card mark base, heap top
-      emit_ptr(cbuf, $src$$constant, dest, /*ForceRelocatable=*/ false);
+      __ set($src$$constant, dest);
     }
   %}
 
@@ -2789,46 +2777,6 @@
     __ set64( $src$$constant, dest, temp );
   %}
 
-  enc_class LdImmF(immF src, regF dst, o7RegP tmp) %{    // Load Immediate
-    address float_address = MacroAssembler(&cbuf).float_constant($src$$constant);
-    RelocationHolder rspec = internal_word_Relocation::spec(float_address);
-#ifdef _LP64
-    Register   tmp_reg = reg_to_register_object($tmp$$reg);
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit_ptr(cbuf, (intptr_t)float_address, tmp_reg, /*ForceRelocatable=*/ true);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::ldf_op3, $tmp$$reg, 0 );
-#else  // _LP64
-    uint *code;
-    int tmp_reg = $tmp$$reg;
-
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit2_22( cbuf, Assembler::branch_op, tmp_reg, Assembler::sethi_op2, (intptr_t) float_address );
-
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::ldf_op3, tmp_reg, (intptr_t) float_address );
-#endif // _LP64
-  %}
-
-  enc_class LdImmD(immD src, regD dst, o7RegP tmp) %{    // Load Immediate
-    address double_address = MacroAssembler(&cbuf).double_constant($src$$constant);
-    RelocationHolder rspec = internal_word_Relocation::spec(double_address);
-#ifdef _LP64
-    Register   tmp_reg = reg_to_register_object($tmp$$reg);
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit_ptr(cbuf, (intptr_t)double_address, tmp_reg, /*ForceRelocatable=*/ true);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::lddf_op3, $tmp$$reg, 0 );
-#else // _LP64
-    uint *code;
-    int tmp_reg = $tmp$$reg;
-
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit2_22( cbuf, Assembler::branch_op, tmp_reg, Assembler::sethi_op2, (intptr_t) double_address );
-
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::lddf_op3, tmp_reg, (intptr_t) double_address );
-#endif // _LP64
-  %}
-
   enc_class LdReplImmI(immI src, regD dst, o7RegP tmp, int count, int width) %{
     // Load a constant replicated "count" times with width "width"
     int bit_width = $width$$constant * 8;
@@ -2840,28 +2788,15 @@
         val |= elt_val;
     }
     jdouble dval = *(jdouble*)&val; // coerce to double type
-    address double_address = MacroAssembler(&cbuf).double_constant(dval);
+    MacroAssembler _masm(&cbuf);
+    address double_address = __ double_constant(dval);
     RelocationHolder rspec = internal_word_Relocation::spec(double_address);
-#ifdef _LP64
-    Register   tmp_reg = reg_to_register_object($tmp$$reg);
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit_ptr(cbuf, (intptr_t)double_address, tmp_reg, /*ForceRelocatable=*/ true);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::lddf_op3, $tmp$$reg, 0 );
-#else // _LP64
-    uint *code;
-    int tmp_reg = $tmp$$reg;
+    AddressLiteral addrlit(double_address, rspec);
 
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit2_22( cbuf, Assembler::branch_op, tmp_reg, Assembler::sethi_op2, (intptr_t) double_address );
-
-    cbuf.relocate(cbuf.code_end(), rspec, 0);
-    emit3_simm10( cbuf, Assembler::ldst_op, $dst$$reg, Assembler::lddf_op3, tmp_reg, (intptr_t) double_address );
-#endif // _LP64
-  %}
-
-
-  enc_class ShouldNotEncodeThis ( ) %{
-    ShouldNotCallThis();
+    __ sethi(addrlit, $tmp$$Register);
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
+    __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
   %}
 
   // Compiler ensures base is doubleword aligned and cnt is count of doublewords
@@ -2901,19 +2836,19 @@
     int  count_offset = java_lang_String:: count_offset_in_bytes();
 
     // load str1 (jchar*) base address into tmp1_reg
-    __ load_heap_oop(Address(str1_reg, 0,  value_offset), tmp1_reg);
-    __ ld(Address(str1_reg, 0, offset_offset), result_reg);
+    __ load_heap_oop(str1_reg, value_offset, tmp1_reg);
+    __ ld(str1_reg, offset_offset, result_reg);
     __ add(tmp1_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1_reg);
-    __    ld(Address(str1_reg, 0, count_offset), str1_reg); // hoisted
+    __   ld(str1_reg, count_offset, str1_reg); // hoisted
     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
-    __    load_heap_oop(Address(str2_reg, 0,  value_offset), tmp2_reg); // hoisted
+    __   load_heap_oop(str2_reg, value_offset, tmp2_reg); // hoisted
     __ add(result_reg, tmp1_reg, tmp1_reg);
 
     // load str2 (jchar*) base address into tmp2_reg
-    // __ ld_ptr(Address(str2_reg, 0,  value_offset), tmp2_reg); // hoisted
-    __ ld(Address(str2_reg, 0, offset_offset), result_reg);
+    // __ ld_ptr(str2_reg, value_offset, tmp2_reg); // hoisted
+    __ ld(str2_reg, offset_offset, result_reg);
     __ add(tmp2_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp2_reg);
-    __    ld(Address(str2_reg, 0, count_offset), str2_reg); // hoisted
+    __   ld(str2_reg, count_offset, str2_reg); // hoisted
     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
     __   subcc(str1_reg, str2_reg, O7); // hoisted
     __ add(result_reg, tmp2_reg, tmp2_reg);
@@ -2922,8 +2857,8 @@
     // difference of the string lengths (stack)
 
     // discard string base pointers, after loading up the lengths
-    // __ ld(Address(str1_reg, 0, count_offset), str1_reg); // hoisted
-    // __ ld(Address(str2_reg, 0, count_offset), str2_reg); // hoisted
+    // __ ld(str1_reg, count_offset, str1_reg); // hoisted
+    // __ ld(str2_reg, count_offset, str2_reg); // hoisted
 
     // See if the lengths are different, and calculate min in str1_reg.
     // Stash diff in O7 in case we need it for a tie-breaker.
@@ -3020,19 +2955,19 @@
     int  count_offset = java_lang_String:: count_offset_in_bytes();
 
     // load str1 (jchar*) base address into tmp1_reg
-    __ load_heap_oop(Address(str1_reg, 0,  value_offset), tmp1_reg);
-    __ ld(Address(str1_reg, 0, offset_offset), result_reg);
+    __ load_heap_oop(Address(str1_reg, value_offset), tmp1_reg);
+    __ ld(Address(str1_reg, offset_offset), result_reg);
     __ add(tmp1_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1_reg);
-    __    ld(Address(str1_reg, 0, count_offset), str1_reg); // hoisted
+    __    ld(Address(str1_reg, count_offset), str1_reg); // hoisted
     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
-    __    load_heap_oop(Address(str2_reg, 0,  value_offset), tmp2_reg); // hoisted
+    __    load_heap_oop(Address(str2_reg, value_offset), tmp2_reg); // hoisted
     __ add(result_reg, tmp1_reg, tmp1_reg);
 
     // load str2 (jchar*) base address into tmp2_reg
-    // __ ld_ptr(Address(str2_reg, 0,  value_offset), tmp2_reg); // hoisted
-    __ ld(Address(str2_reg, 0, offset_offset), result_reg);
+    // __ ld_ptr(Address(str2_reg, value_offset), tmp2_reg); // hoisted
+    __ ld(Address(str2_reg, offset_offset), result_reg);
     __ add(tmp2_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp2_reg);
-    __    ld(Address(str2_reg, 0, count_offset), str2_reg); // hoisted
+    __    ld(Address(str2_reg, count_offset), str2_reg); // hoisted
     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
     __   cmp(str1_reg, str2_reg); // hoisted
     __ add(result_reg, tmp2_reg, tmp2_reg);
@@ -3139,8 +3074,8 @@
     __ delayed()->mov(G0, result_reg);    // not equal
 
     //load the lengths of arrays
-    __ ld(Address(ary1_reg, 0, length_offset), tmp1_reg);
-    __ ld(Address(ary2_reg, 0, length_offset), tmp2_reg);
+    __ ld(Address(ary1_reg, length_offset), tmp1_reg);
+    __ ld(Address(ary2_reg, length_offset), tmp2_reg);
 
     // return false if the two arrays are not equal length
     __ cmp(tmp1_reg, tmp2_reg);
@@ -3202,19 +3137,20 @@
   enc_class enc_rethrow() %{
     cbuf.set_inst_mark();
     Register temp_reg = G3;
-    Address rethrow_stub(temp_reg, OptoRuntime::rethrow_stub());
+    AddressLiteral rethrow_stub(OptoRuntime::rethrow_stub());
     assert(temp_reg != reg_to_register_object(R_I0_num), "temp must not break oop_reg");
     MacroAssembler _masm(&cbuf);
 #ifdef ASSERT
     __ save_frame(0);
-    Address last_rethrow_addr(L1, (address)&last_rethrow);
-    __ sethi(last_rethrow_addr);
+    AddressLiteral last_rethrow_addrlit(&last_rethrow);
+    __ sethi(last_rethrow_addrlit, L1);
+    Address addr(L1, last_rethrow_addrlit.low10());
     __ get_pc(L2);
     __ inc(L2, 3 * BytesPerInstWord);  // skip this & 2 more insns to point at jump_to
-    __ st_ptr(L2, last_rethrow_addr);
+    __ st_ptr(L2, addr);
     __ restore();
 #endif
-    __ JUMP(rethrow_stub, 0); // sethi;jmp
+    __ JUMP(rethrow_stub, temp_reg, 0); // sethi;jmp
     __ delayed()->nop();
   %}
 
@@ -5493,8 +5429,9 @@
 
   size(4);
   format %{ "LDSB   $mem,$dst\t! byte" %}
-  opcode(Assembler::ldsb_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldsb($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5505,8 +5442,9 @@
 
   size(4);
   format %{ "LDSB   $mem,$dst\t! byte -> long" %}
-  opcode(Assembler::ldsb_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldsb($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5517,8 +5455,9 @@
 
   size(4);
   format %{ "LDUB   $mem,$dst\t! ubyte" %}
-  opcode(Assembler::ldub_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldub($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5529,8 +5468,9 @@
 
   size(4);
   format %{ "LDUB   $mem,$dst\t! ubyte -> long" %}
-  opcode(Assembler::ldub_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldub($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5541,8 +5481,9 @@
 
   size(4);
   format %{ "LDSH   $mem,$dst\t! short" %}
-  opcode(Assembler::ldsh_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldsh($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5553,8 +5494,9 @@
 
   size(4);
   format %{ "LDSH   $mem,$dst\t! short -> long" %}
-  opcode(Assembler::ldsh_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldsh($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5565,8 +5507,9 @@
 
   size(4);
   format %{ "LDUH   $mem,$dst\t! ushort/char" %}
-  opcode(Assembler::lduh_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ lduh($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5577,8 +5520,9 @@
 
   size(4);
   format %{ "LDUH   $mem,$dst\t! ushort/char -> long" %}
-  opcode(Assembler::lduh_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ lduh($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mask_mem);
 %}
 
@@ -5589,8 +5533,9 @@
 
   size(4);
   format %{ "LDUW   $mem,$dst\t! int" %}
-  opcode(Assembler::lduw_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ lduw($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mem);
 %}
 
@@ -5601,8 +5546,9 @@
 
   size(4);
   format %{ "LDSW   $mem,$dst\t! int -> long" %}
-  opcode(Assembler::ldsw_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldsw($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mem);
 %}
 
@@ -5613,8 +5559,9 @@
 
   size(4);
   format %{ "LDUW   $mem,$dst\t! uint -> long" %}
-  opcode(Assembler::lduw_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ lduw($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mem);
 %}
 
@@ -5625,8 +5572,9 @@
 
   size(4);
   format %{ "LDX    $mem,$dst\t! long" %}
-  opcode(Assembler::ldx_op3);
-  ins_encode(simple_form3_mem_reg( mem, dst ) );
+  ins_encode %{
+    __ ldx($mem$$Address, $dst$$Register);
+  %}
   ins_pipe(iload_mem);
 %}
 
@@ -5721,31 +5669,29 @@
 
 #ifndef _LP64
   format %{ "LDUW   $mem,$dst\t! ptr" %}
-  opcode(Assembler::lduw_op3, 0, REGP_OP);
+  ins_encode %{
+    __ lduw($mem$$Address, $dst$$Register);
+  %}
 #else
   format %{ "LDX    $mem,$dst\t! ptr" %}
-  opcode(Assembler::ldx_op3, 0, REGP_OP);
+  ins_encode %{
+    __ ldx($mem$$Address, $dst$$Register);
+  %}
 #endif
-  ins_encode( form3_mem_reg( mem, dst ) );
   ins_pipe(iload_mem);
 %}
 
 // Load Compressed Pointer
 instruct loadN(iRegN dst, memory mem) %{
-   match(Set dst (LoadN mem));
-   ins_cost(MEMORY_REF_COST);
-   size(4);
+  match(Set dst (LoadN mem));
+  ins_cost(MEMORY_REF_COST);
+  size(4);
 
-   format %{ "LDUW   $mem,$dst\t! compressed ptr" %}
-   ins_encode %{
-     Register index = $mem$$index$$Register;
-     if (index != G0) {
-       __ lduw($mem$$base$$Register, index, $dst$$Register);
-     } else {
-       __ lduw($mem$$base$$Register, $mem$$disp, $dst$$Register);
-     }
-   %}
-   ins_pipe(iload_mem);
+  format %{ "LDUW   $mem,$dst\t! compressed ptr" %}
+  ins_encode %{
+    __ lduw($mem$$Address, $dst$$Register);
+  %}
+  ins_pipe(iload_mem);
 %}
 
 // Load Klass Pointer
@@ -5756,12 +5702,15 @@
 
 #ifndef _LP64
   format %{ "LDUW   $mem,$dst\t! klass ptr" %}
-  opcode(Assembler::lduw_op3, 0, REGP_OP);
+  ins_encode %{
+    __ lduw($mem$$Address, $dst$$Register);
+  %}
 #else
   format %{ "LDX    $mem,$dst\t! klass ptr" %}
-  opcode(Assembler::ldx_op3, 0, REGP_OP);
+  ins_encode %{
+    __ ldx($mem$$Address, $dst$$Register);
+  %}
 #endif
-  ins_encode( form3_mem_reg( mem, dst ) );
   ins_pipe(iload_mem);
 %}
 
@@ -5772,16 +5721,8 @@
   size(4);
 
   format %{ "LDUW   $mem,$dst\t! compressed klass ptr" %}
-
   ins_encode %{
-     Register base = as_Register($mem$$base);
-     Register index = as_Register($mem$$index);
-     Register dst = $dst$$Register;
-     if (index != G0) {
-       __ lduw(base, index, dst);
-     } else {
-       __ lduw(base, $mem$$disp, dst);
-     }
+    __ lduw($mem$$Address, $dst$$Register);
   %}
   ins_pipe(iload_mem);
 %}
@@ -5867,8 +5808,8 @@
   ins_cost(DEFAULT_COST);
   format %{ "SET    $src,$dst\t!ptr" %}
   ins_encode %{
-    Address polling_page(reg_to_register_object($dst$$reg), (address)os::get_polling_page());
-    __ sethi(polling_page, false );
+    AddressLiteral polling_page(os::get_polling_page());
+    __ sethi(polling_page, reg_to_register_object($dst$$reg));
   %}
   ins_pipe(loadConP_poll);
 %}
@@ -5927,14 +5868,21 @@
   effect(KILL tmp);
 
 #ifdef _LP64
-  size(36);
+  size(8*4);
 #else
-  size(8);
+  size(2*4);
 #endif
 
   format %{ "SETHI  hi(&$src),$tmp\t!get float $src from table\n\t"
             "LDF    [$tmp+lo(&$src)],$dst" %}
-  ins_encode( LdImmF(src, dst, tmp) );
+  ins_encode %{
+    address float_address = __ float_constant($src$$constant);
+    RelocationHolder rspec = internal_word_Relocation::spec(float_address);
+    AddressLiteral addrlit(float_address, rspec);
+
+    __ sethi(addrlit, $tmp$$Register);
+    __ ldf(FloatRegisterImpl::S, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
+  %}
   ins_pipe(loadConFD);
 %}
 
@@ -5943,14 +5891,23 @@
   effect(KILL tmp);
 
 #ifdef _LP64
-  size(36);
+  size(8*4);
 #else
-  size(8);
+  size(2*4);
 #endif
 
   format %{ "SETHI  hi(&$src),$tmp\t!get double $src from table\n\t"
             "LDDF   [$tmp+lo(&$src)],$dst" %}
-  ins_encode( LdImmD(src, dst, tmp) );
+  ins_encode %{
+    address double_address = __ double_constant($src$$constant);
+    RelocationHolder rspec = internal_word_Relocation::spec(double_address);
+    AddressLiteral addrlit(double_address, rspec);
+
+    __ sethi(addrlit, $tmp$$Register);
+    // XXX This is a quick fix for 6833573.
+    //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);
+    __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);
+  %}
   ins_pipe(loadConFD);
 %}
 
diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index 62c2016..a2dc150 100644
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,16 +68,9 @@
 #ifdef PRODUCT
 #define inc_counter_np(a,b,c) (0)
 #else
-  void inc_counter_np_(int& counter, Register t1, Register t2) {
-    Address counter_addr(t2, (address) &counter);
-    __ sethi(counter_addr);
-    __ ld(counter_addr, t1);
-    __ inc(t1);
-    __ st(t1, counter_addr);
-  }
 #define inc_counter_np(counter, t1, t2) \
   BLOCK_COMMENT("inc_counter " #counter); \
-  inc_counter_np_(counter, t1, t2);
+  __ inc_counter(&counter, t1, t2);
 #endif
 
   //----------------------------------------------------------------------------------------------------
@@ -325,9 +318,9 @@
     __ verify_thread();
 
     const Register& temp_reg = Gtemp;
-    Address pending_exception_addr    (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
-    Address exception_file_offset_addr(G2_thread, 0, in_bytes(Thread::exception_file_offset   ()));
-    Address exception_line_offset_addr(G2_thread, 0, in_bytes(Thread::exception_line_offset   ()));
+    Address pending_exception_addr    (G2_thread, Thread::pending_exception_offset());
+    Address exception_file_offset_addr(G2_thread, Thread::exception_file_offset   ());
+    Address exception_line_offset_addr(G2_thread, Thread::exception_line_offset   ());
 
     // set pending exception
     __ verify_oop(Oexception);
@@ -340,8 +333,8 @@
     // complete return to VM
     assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
 
-    Address stub_ret(temp_reg, StubRoutines::_call_stub_return_address);
-    __ jump_to(stub_ret);
+    AddressLiteral stub_ret(StubRoutines::_call_stub_return_address);
+    __ jump_to(stub_ret, temp_reg);
     __ delayed()->nop();
 
     return start;
@@ -366,7 +359,7 @@
 
     const Register& handler_reg = Gtemp;
 
-    Address exception_addr (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
 
 #ifdef ASSERT
     // make sure that this code is only executed if there is a pending exception
@@ -456,8 +449,7 @@
     int frame_complete = __ offset();
 
     if (restore_saved_exception_pc) {
-      Address saved_exception_pc(G2_thread, 0, in_bytes(JavaThread::saved_exception_pc_offset()));
-      __ ld_ptr(saved_exception_pc, I7);
+      __ ld_ptr(G2_thread, JavaThread::saved_exception_pc_offset(), I7);
       __ sub(I7, frame::pc_return_offset, I7);
     }
 
@@ -481,7 +473,7 @@
 #ifdef ASSERT
     Label L;
 
-    Address exception_addr(G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
     Register scratch_reg = Gtemp;
     __ ld_ptr(exception_addr, scratch_reg);
     __ br_notnull(scratch_reg, false, Assembler::pt, L);
@@ -835,7 +827,7 @@
     address start = __ pc();
 
     const int preserve_register_words = (64 * 2);
-    Address preserve_addr(FP, 0, (-preserve_register_words * wordSize) + STACK_BIAS);
+    Address preserve_addr(FP, (-preserve_register_words * wordSize) + STACK_BIAS);
 
     Register Lthread = L7_thread_cache;
     int i;
@@ -1106,21 +1098,19 @@
           __ srl_ptr(addr, CardTableModRefBS::card_shift, addr);
           __ srl_ptr(count, CardTableModRefBS::card_shift, count);
           __ sub(count, addr, count);
-          Address rs(tmp, (address)ct->byte_map_base);
-          __ load_address(rs);
+          AddressLiteral rs(ct->byte_map_base);
+          __ set(rs, tmp);
         __ BIND(L_loop);
-          __ stb(G0, rs.base(), addr);
+          __ stb(G0, tmp, addr);
           __ subcc(count, 1, count);
           __ brx(Assembler::greaterEqual, false, Assembler::pt, L_loop);
           __ delayed()->add(addr, 1, addr);
-
-          }
+        }
         break;
       case BarrierSet::ModRef:
         break;
-      default      :
+      default:
         ShouldNotReachHere();
-
     }
   }
 
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index 6cbcf92..b83ed82 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -87,8 +87,8 @@
   }
   // throw exception
   assert(Interpreter::throw_exception_entry() != NULL, "generate it first");
-  Address thrower(G3_scratch, Interpreter::throw_exception_entry());
-  __ jump_to (thrower);
+  AddressLiteral thrower(Interpreter::throw_exception_entry());
+  __ jump_to(thrower, G3_scratch);
   __ delayed()->nop();
   return entry;
 }
@@ -150,7 +150,8 @@
 }
 
 
-address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
+address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) {
+  assert(!unbox, "NYI");//6815692//
   address compiled_entry = __ pc();
   Label cont;
 
@@ -186,8 +187,8 @@
   const Register cache = G3_scratch;
   const Register size  = G1_scratch;
   __ get_cache_and_index_at_bcp(cache, G1_scratch, 1);
-  __ ld_ptr(Address(cache, 0, in_bytes(constantPoolCacheOopDesc::base_offset()) +
-                    in_bytes(ConstantPoolCacheEntry::flags_offset())), size);
+  __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() +
+                   ConstantPoolCacheEntry::flags_offset(), size);
   __ and3(size, 0xFF, size);                   // argument size in words
   __ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes
   __ add(Lesp, size, Lesp);                    // pop arguments
@@ -201,9 +202,8 @@
   address entry = __ pc();
   __ get_constant_pool_cache(LcpoolCache); // load LcpoolCache
   { Label L;
-    Address exception_addr (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
-
-    __ ld_ptr(exception_addr, Gtemp);
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
+    __ ld_ptr(exception_addr, Gtemp);  // Load pending exception.
     __ tst(Gtemp);
     __ brx(Assembler::equal, false, Assembler::pt, L);
     __ delayed()->nop();
@@ -282,7 +282,7 @@
   // Update standard invocation counters
   __ increment_invocation_counter(O0, G3_scratch);
   if (ProfileInterpreter) {  // %%% Merge this into methodDataOop
-    Address interpreter_invocation_counter(Lmethod, 0, in_bytes(methodOopDesc::interpreter_invocation_counter_offset()));
+    Address interpreter_invocation_counter(Lmethod, methodOopDesc::interpreter_invocation_counter_offset());
     __ ld(interpreter_invocation_counter, G3_scratch);
     __ inc(G3_scratch);
     __ st(G3_scratch, interpreter_invocation_counter);
@@ -290,9 +290,9 @@
 
   if (ProfileInterpreter && profile_method != NULL) {
     // Test to see if we should create a method data oop
-    Address profile_limit(G3_scratch, (address)&InvocationCounter::InterpreterProfileLimit);
-    __ sethi(profile_limit);
-    __ ld(profile_limit, G3_scratch);
+    AddressLiteral profile_limit(&InvocationCounter::InterpreterProfileLimit);
+    __ sethi(profile_limit, G3_scratch);
+    __ ld(G3_scratch, profile_limit.low10(), G3_scratch);
     __ cmp(O0, G3_scratch);
     __ br(Assembler::lessUnsigned, false, Assembler::pn, *profile_method_continue);
     __ delayed()->nop();
@@ -301,9 +301,9 @@
     __ test_method_data_pointer(*profile_method);
   }
 
-  Address invocation_limit(G3_scratch, (address)&InvocationCounter::InterpreterInvocationLimit);
-  __ sethi(invocation_limit);
-  __ ld(invocation_limit, G3_scratch);
+  AddressLiteral invocation_limit(&InvocationCounter::InterpreterInvocationLimit);
+  __ sethi(invocation_limit, G3_scratch);
+  __ ld(G3_scratch, invocation_limit.low10(), G3_scratch);
   __ cmp(O0, G3_scratch);
   __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow);
   __ delayed()->nop();
@@ -314,8 +314,7 @@
 // ebx - methodOop
 //
 void InterpreterGenerator::lock_method(void) {
-  const Address access_flags      (Lmethod, 0, in_bytes(methodOopDesc::access_flags_offset()));
-  __ ld(access_flags, O0);
+  __ ld(Lmethod, in_bytes(methodOopDesc::access_flags_offset()), O0);  // Load access flags.
 
 #ifdef ASSERT
  { Label ok;
@@ -359,8 +358,7 @@
                                                          Register Rscratch,
                                                          Register Rscratch2) {
   const int page_size = os::vm_page_size();
-  Address saved_exception_pc(G2_thread, 0,
-                             in_bytes(JavaThread::saved_exception_pc_offset()));
+  Address saved_exception_pc(G2_thread, JavaThread::saved_exception_pc_offset());
   Label after_frame_check;
 
   assert_different_registers(Rframe_size, Rscratch, Rscratch2);
@@ -372,7 +370,7 @@
   __ delayed()->nop();
 
   // get the stack base, and in debug, verify it is non-zero
-  __ ld_ptr( G2_thread, in_bytes(Thread::stack_base_offset()), Rscratch );
+  __ ld_ptr( G2_thread, Thread::stack_base_offset(), Rscratch );
 #ifdef ASSERT
   Label base_not_zero;
   __ cmp( Rscratch, G0 );
@@ -384,7 +382,7 @@
 
   // get the stack size, and in debug, verify it is non-zero
   assert( sizeof(size_t) == sizeof(intptr_t), "wrong load size" );
-  __ ld_ptr( G2_thread, in_bytes(Thread::stack_size_offset()), Rscratch2 );
+  __ ld_ptr( G2_thread, Thread::stack_size_offset(), Rscratch2 );
 #ifdef ASSERT
   Label size_not_zero;
   __ cmp( Rscratch2, G0 );
@@ -459,9 +457,9 @@
   // (gri - 2/25/2000)
 
 
-  const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset()));
-  const Address size_of_locals    (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset()));
-  const Address max_stack         (G5_method, 0, in_bytes(methodOopDesc::max_stack_offset()));
+  const Address size_of_parameters(G5_method, methodOopDesc::size_of_parameters_offset());
+  const Address size_of_locals    (G5_method, methodOopDesc::size_of_locals_offset());
+  const Address max_stack         (G5_method, methodOopDesc::max_stack_offset());
   int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong );
 
   const int extra_space =
@@ -538,8 +536,8 @@
   if (native_call) {
     __ mov(G0, Lbcp);
   } else {
-    __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc::const_offset())), Lbcp );
-    __ add(Address(Lbcp, 0, in_bytes(constMethodOopDesc::codes_offset())), Lbcp );
+    __ ld_ptr(G5_method, methodOopDesc::const_offset(), Lbcp);
+    __ add(Lbcp, in_bytes(constMethodOopDesc::codes_offset()), Lbcp);
   }
   __ mov( G5_method, Lmethod);                 // set Lmethod
   __ get_constant_pool_cache( LcpoolCache );   // set LcpoolCache
@@ -577,8 +575,8 @@
   // do nothing for empty methods (do not even increment invocation counter)
   if ( UseFastEmptyMethods) {
     // If we need a safepoint check, generate full interpreter entry.
-    Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
-    __ load_contents(sync_state, G3_scratch);
+    AddressLiteral sync_state(SafepointSynchronize::address_of_state());
+    __ set(sync_state, G3_scratch);
     __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
     __ br(Assembler::notEqual, false, Assembler::pn, slow_path);
     __ delayed()->nop();
@@ -616,7 +614,7 @@
   if ( UseFastAccessorMethods && !UseCompressedOops ) {
     // Check if we need to reach a safepoint and generate full interpreter
     // frame if so.
-    Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
+    AddressLiteral sync_state(SafepointSynchronize::address_of_state());
     __ load_contents(sync_state, G3_scratch);
     __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
     __ br(Assembler::notEqual, false, Assembler::pn, slow_path);
@@ -631,8 +629,8 @@
 
     // read first instruction word and extract bytecode @ 1 and index @ 2
     // get first 4 bytes of the bytecodes (big endian!)
-    __ ld_ptr(Address(G5_method, 0, in_bytes(methodOopDesc::const_offset())), G1_scratch);
-    __ ld(Address(G1_scratch, 0, in_bytes(constMethodOopDesc::codes_offset())), G1_scratch);
+    __ ld_ptr(G5_method, methodOopDesc::const_offset(), G1_scratch);
+    __ ld(G1_scratch, constMethodOopDesc::codes_offset(), G1_scratch);
 
     // move index @ 2 far left then to the right most two bytes.
     __ sll(G1_scratch, 2*BitsPerByte, G1_scratch);
@@ -640,7 +638,7 @@
                       ConstantPoolCacheEntry::size()) * BytesPerWord), G1_scratch);
 
     // get constant pool cache
-    __ ld_ptr(G5_method, in_bytes(methodOopDesc::constants_offset()), G3_scratch);
+    __ ld_ptr(G5_method, methodOopDesc::constants_offset(), G3_scratch);
     __ ld_ptr(G3_scratch, constantPoolOopDesc::cache_offset_in_bytes(), G3_scratch);
 
     // get specific constant pool cache entry
@@ -649,7 +647,7 @@
     // Check the constant Pool cache entry to see if it has been resolved.
     // If not, need the slow path.
     ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset();
-    __ ld_ptr(G3_scratch, in_bytes(cp_base_offset + ConstantPoolCacheEntry::indices_offset()), G1_scratch);
+    __ ld_ptr(G3_scratch, cp_base_offset + ConstantPoolCacheEntry::indices_offset(), G1_scratch);
     __ srl(G1_scratch, 2*BitsPerByte, G1_scratch);
     __ and3(G1_scratch, 0xFF, G1_scratch);
     __ cmp(G1_scratch, Bytecodes::_getfield);
@@ -657,8 +655,8 @@
     __ delayed()->nop();
 
     // Get the type and return field offset from the constant pool cache
-    __ ld_ptr(G3_scratch, in_bytes(cp_base_offset + ConstantPoolCacheEntry::flags_offset()), G1_scratch);
-    __ ld_ptr(G3_scratch, in_bytes(cp_base_offset + ConstantPoolCacheEntry::f2_offset()), G3_scratch);
+    __ ld_ptr(G3_scratch, cp_base_offset + ConstantPoolCacheEntry::flags_offset(), G1_scratch);
+    __ ld_ptr(G3_scratch, cp_base_offset + ConstantPoolCacheEntry::f2_offset(), G3_scratch);
 
     Label xreturn_path;
     // Need to differentiate between igetfield, agetfield, bgetfield etc.
@@ -717,7 +715,7 @@
   // make sure registers are different!
   assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
 
-  const Address Laccess_flags     (Lmethod, 0, in_bytes(methodOopDesc::access_flags_offset()));
+  const Address Laccess_flags(Lmethod, methodOopDesc::access_flags_offset());
 
   __ verify_oop(G5_method);
 
@@ -727,7 +725,7 @@
   // make sure method is native & not abstract
   // rethink these assertions - they can be simplified and shared (gri 2/25/2000)
 #ifdef ASSERT
-  __ ld(G5_method, in_bytes(methodOopDesc::access_flags_offset()), Gtmp1);
+  __ ld(G5_method, methodOopDesc::access_flags_offset(), Gtmp1);
   {
     Label L;
     __ btst(JVM_ACC_NATIVE, Gtmp1);
@@ -754,10 +752,10 @@
 
   // this slot will be set later, we initialize it to null here just in
   // case we get a GC before the actual value is stored later
-  __ st_ptr(G0, Address(FP, 0, (frame::interpreter_frame_oop_temp_offset*wordSize) + STACK_BIAS));
+  __ st_ptr(G0, FP, (frame::interpreter_frame_oop_temp_offset * wordSize) + STACK_BIAS);
 
-  const Address do_not_unlock_if_synchronized(G2_thread, 0,
-      in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
+  const Address do_not_unlock_if_synchronized(G2_thread,
+    JavaThread::do_not_unlock_if_synchronized_offset());
   // Since at this point in the method invocation the exception handler
   // would try to exit the monitor of synchronized methods which hasn't
   // been entered yet, we set the thread local variable
@@ -824,12 +822,13 @@
 
   // get signature handler
   { Label L;
-    __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::signature_handler_offset())), G3_scratch);
+    Address signature_handler(Lmethod, methodOopDesc::signature_handler_offset());
+    __ ld_ptr(signature_handler, G3_scratch);
     __ tst(G3_scratch);
     __ brx(Assembler::notZero, false, Assembler::pt, L);
     __ delayed()->nop();
     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), Lmethod);
-    __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::signature_handler_offset())), G3_scratch);
+    __ ld_ptr(signature_handler, G3_scratch);
     __ bind(L);
   }
 
@@ -842,10 +841,9 @@
   // Flush the method pointer to the register save area
   __ st_ptr(Lmethod, SP, (Lmethod->sp_offset_in_saved_window() * wordSize) + STACK_BIAS);
   __ mov(Llocals, O1);
-  // calculate where the mirror handle body is allocated in the interpreter frame:
 
-  Address mirror(FP, 0, (frame::interpreter_frame_oop_temp_offset*wordSize) + STACK_BIAS);
-  __ add(mirror, O2);
+  // calculate where the mirror handle body is allocated in the interpreter frame:
+  __ add(FP, (frame::interpreter_frame_oop_temp_offset * wordSize) + STACK_BIAS, O2);
 
   // Calculate current frame size
   __ sub(SP, FP, O3);         // Calculate negative of current frame size
@@ -882,14 +880,13 @@
     __ ld(Laccess_flags, O0);
     __ btst(JVM_ACC_STATIC, O0);
     __ br( Assembler::zero, false, Assembler::pt, not_static);
-    __ delayed()->
-      // get native function entry point(O0 is a good temp until the very end)
-       ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::native_function_offset())), O0);
+    // get native function entry point(O0 is a good temp until the very end)
+    __ delayed()->ld_ptr(Lmethod, in_bytes(methodOopDesc::native_function_offset()), O0);
     // for static methods insert the mirror argument
     const int mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
 
-    __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc:: constants_offset())), O1);
-    __ ld_ptr(Address(O1, 0, constantPoolOopDesc::pool_holder_offset_in_bytes()), O1);
+    __ ld_ptr(Lmethod, methodOopDesc:: constants_offset(), O1);
+    __ ld_ptr(O1, constantPoolOopDesc::pool_holder_offset_in_bytes(), O1);
     __ ld_ptr(O1, mirror_offset, O1);
 #ifdef ASSERT
     if (!PrintSignatureHandlers)  // do not dirty the output with this
@@ -944,15 +941,13 @@
   __ flush_windows();
 
   // mark windows as flushed
-  Address flags(G2_thread,
-                0,
-                in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset()));
+  Address flags(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset());
   __ set(JavaFrameAnchor::flushed, G3_scratch);
   __ st(G3_scratch, flags);
 
   // Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready.
 
-  Address thread_state(G2_thread, 0, in_bytes(JavaThread::thread_state_offset()));
+  Address thread_state(G2_thread, JavaThread::thread_state_offset());
 #ifdef ASSERT
   { Label L;
     __ ld(thread_state, G3_scratch);
@@ -982,7 +977,7 @@
   // Block, if necessary, before resuming in _thread_in_Java state.
   // In order for GC to work, don't clear the last_Java_sp until after blocking.
   { Label no_block;
-    Address sync_state(G3_scratch, SafepointSynchronize::address_of_state());
+    AddressLiteral sync_state(SafepointSynchronize::address_of_state());
 
     // Switch thread to "native transition" state before reading the synchronization state.
     // This additional state is necessary because reading and testing the synchronization
@@ -1009,10 +1004,8 @@
     __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
 
     Label L;
-    Address suspend_state(G2_thread, 0, in_bytes(JavaThread::suspend_flags_offset()));
     __ br(Assembler::notEqual, false, Assembler::pn, L);
-    __ delayed()->
-      ld(suspend_state, G3_scratch);
+    __ delayed()->ld(G2_thread, JavaThread::suspend_flags_offset(), G3_scratch);
     __ cmp(G3_scratch, 0);
     __ br(Assembler::equal, false, Assembler::pt, no_block);
     __ delayed()->nop();
@@ -1054,7 +1047,7 @@
   __ st(G3_scratch, thread_state);
 
   // reset handle block
-  __ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), G3_scratch);
+  __ ld_ptr(G2_thread, JavaThread::active_handles_offset(), G3_scratch);
   __ st_ptr(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
 
   // If we have an oop result store it where it will be safe for any further gc
@@ -1083,8 +1076,7 @@
 
   // handle exceptions (exception handling will handle unlocking!)
   { Label L;
-    Address exception_addr (G2_thread, 0, in_bytes(Thread::pending_exception_offset()));
-
+    Address exception_addr(G2_thread, Thread::pending_exception_offset());
     __ ld_ptr(exception_addr, Gtemp);
     __ tst(Gtemp);
     __ brx(Assembler::equal, false, Assembler::pt, L);
@@ -1170,11 +1162,11 @@
   // make sure registers are different!
   assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
 
-  const Address size_of_parameters(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset()));
-  const Address size_of_locals    (G5_method, 0, in_bytes(methodOopDesc::size_of_locals_offset()));
+  const Address size_of_parameters(G5_method, methodOopDesc::size_of_parameters_offset());
+  const Address size_of_locals    (G5_method, methodOopDesc::size_of_locals_offset());
   // Seems like G5_method is live at the point this is used. So we could make this look consistent
   // and use in the asserts.
-  const Address access_flags      (Lmethod, 0, in_bytes(methodOopDesc::access_flags_offset()));
+  const Address access_flags      (Lmethod,   methodOopDesc::access_flags_offset());
 
   __ verify_oop(G5_method);
 
@@ -1184,7 +1176,7 @@
   // make sure method is not native & not abstract
   // rethink these assertions - they can be simplified and shared (gri 2/25/2000)
 #ifdef ASSERT
-  __ ld(G5_method, in_bytes(methodOopDesc::access_flags_offset()), Gtmp1);
+  __ ld(G5_method, methodOopDesc::access_flags_offset(), Gtmp1);
   {
     Label L;
     __ btst(JVM_ACC_NATIVE, Gtmp1);
@@ -1239,8 +1231,8 @@
   __ brx( Assembler::lessEqualUnsigned, true, Assembler::pt, clear_loop );
   __ delayed()->st_ptr( init_value, O2, 0 );
 
-  const Address do_not_unlock_if_synchronized(G2_thread, 0,
-        in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
+  const Address do_not_unlock_if_synchronized(G2_thread,
+    JavaThread::do_not_unlock_if_synchronized_offset());
   // Since at this point in the method invocation the exception handler
   // would try to exit the monitor of synchronized methods which hasn't
   // been entered yet, we set the thread local variable
@@ -1716,7 +1708,7 @@
   //
 
   Interpreter::_remove_activation_preserving_args_entry = __ pc();
-  Address popframe_condition_addr (G2_thread, 0, in_bytes(JavaThread::popframe_condition_offset()));
+  Address popframe_condition_addr(G2_thread, JavaThread::popframe_condition_offset());
   // Set the popframe_processing bit in popframe_condition indicating that we are
   // currently handling popframe, so that call_VMs that may happen later do not trigger new
   // popframe handling cycles.
@@ -1758,7 +1750,7 @@
     __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::popframe_preserve_args), G2_thread, Gtmp1, Gtmp2);
     // Inform deoptimization that it is responsible for restoring these arguments
     __ set(JavaThread::popframe_force_deopt_reexecution_bit, Gtmp1);
-    Address popframe_condition_addr(G2_thread, 0, in_bytes(JavaThread::popframe_condition_offset()));
+    Address popframe_condition_addr(G2_thread, JavaThread::popframe_condition_offset());
     __ st(Gtmp1, popframe_condition_addr);
 
     // Return from the current method
@@ -1807,7 +1799,7 @@
   __ verify_oop(Oexception);
 
     const int return_reg_adjustment = frame::pc_return_offset;
-  Address issuing_pc_addr(I7, 0, return_reg_adjustment);
+  Address issuing_pc_addr(I7, return_reg_adjustment);
 
   // We are done with this activation frame; find out where to go next.
   // The continuation point will be an exception handler, which expects
@@ -1853,8 +1845,8 @@
   __ empty_expression_stack();
   __ load_earlyret_value(state);
 
-  __ ld_ptr(Address(G2_thread, 0, in_bytes(JavaThread::jvmti_thread_state_offset())), G3_scratch);
-  Address cond_addr(G3_scratch, 0, in_bytes(JvmtiThreadState::earlyret_state_offset()));
+  __ ld_ptr(G2_thread, JavaThread::jvmti_thread_state_offset(), G3_scratch);
+  Address cond_addr(G3_scratch, JvmtiThreadState::earlyret_state_offset());
 
   // Clear the earlyret state
   __ stw(G0 /* JvmtiThreadState::earlyret_inactive */, cond_addr);
@@ -1921,43 +1913,33 @@
 // helpers for generate_and_dispatch
 
 void TemplateInterpreterGenerator::count_bytecode() {
-  Address c(G3_scratch, (address)&BytecodeCounter::_counter_value);
-  __ load_contents(c, G4_scratch);
-  __ inc(G4_scratch);
-  __ st(G4_scratch, c);
+  __ inc_counter(&BytecodeCounter::_counter_value, G3_scratch, G4_scratch);
 }
 
 
 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
-  Address bucket( G3_scratch, (address) &BytecodeHistogram::_counters[t->bytecode()] );
-  __ load_contents(bucket, G4_scratch);
-  __ inc(G4_scratch);
-  __ st(G4_scratch, bucket);
+  __ inc_counter(&BytecodeHistogram::_counters[t->bytecode()], G3_scratch, G4_scratch);
 }
 
 
 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
-  address index_addr      = (address)&BytecodePairHistogram::_index;
-  Address index(G3_scratch, index_addr);
-
-  address counters_addr   = (address)&BytecodePairHistogram::_counters;
-  Address counters(G3_scratch, counters_addr);
+  AddressLiteral index   (&BytecodePairHistogram::_index);
+  AddressLiteral counters((address) &BytecodePairHistogram::_counters);
 
   // get index, shift out old bytecode, bring in new bytecode, and store it
   // _index = (_index >> log2_number_of_codes) |
   //          (bytecode << log2_number_of_codes);
 
-
-  __ load_contents( index,      G4_scratch );
+  __ load_contents(index, G4_scratch);
   __ srl( G4_scratch, BytecodePairHistogram::log2_number_of_codes, G4_scratch );
   __ set( ((int)t->bytecode()) << BytecodePairHistogram::log2_number_of_codes,  G3_scratch );
   __ or3( G3_scratch,  G4_scratch, G4_scratch );
-  __ store_contents( G4_scratch, index );
+  __ store_contents(G4_scratch, index, G3_scratch);
 
   // bump bucket contents
   // _counters[_index] ++;
 
-  __ load_address( counters );  // loads into G3_scratch
+  __ set(counters, G3_scratch);                       // loads into G3_scratch
   __ sll( G4_scratch, LogBytesPerWord, G4_scratch );  // Index is word address
   __ add (G3_scratch, G4_scratch, G3_scratch);        // Add in index
   __ ld (G3_scratch, 0, G4_scratch);
@@ -1978,9 +1960,9 @@
 
 
 void TemplateInterpreterGenerator::stop_interpreter_at() {
-  Address counter(G3_scratch , (address)&BytecodeCounter::_counter_value);
-  __ load_contents    (counter, G3_scratch );
-  Address stop_at(G4_scratch, (address)&StopInterpreterAt);
+  AddressLiteral counter(&BytecodeCounter::_counter_value);
+  __ load_contents(counter, G3_scratch);
+  AddressLiteral stop_at(&StopInterpreterAt);
   __ load_ptr_contents(stop_at, G4_scratch);
   __ cmp(G3_scratch, G4_scratch);
   __ breakpoint_trap(Assembler::equal);
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index a4c1fa8..0849aae 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@
 
 Address TemplateTable::at_bcp(int offset) {
   assert(_desc->uses_bcp(), "inconsistent uses_bcp information");
-  return Address( Lbcp, 0, offset);
+  return Address(Lbcp, offset);
 }
 
 
@@ -217,9 +217,9 @@
    case 1:  p = &one;   break;
    case 2:  p = &two;   break;
   }
-  Address a(G3_scratch, (address)p);
-  __ sethi(a);
-  __ ldf(FloatRegisterImpl::S, a, Ftos_f);
+  AddressLiteral a(p);
+  __ sethi(a, G3_scratch);
+  __ ldf(FloatRegisterImpl::S, G3_scratch, a.low10(), Ftos_f);
 }
 
 
@@ -232,9 +232,9 @@
    case 0:  p = &zero;  break;
    case 1:  p = &one;   break;
   }
-  Address a(G3_scratch, (address)p);
-  __ sethi(a);
-  __ ldf(FloatRegisterImpl::D, a, Ftos_d);
+  AddressLiteral a(p);
+  __ sethi(a, G3_scratch);
+  __ ldf(FloatRegisterImpl::D, G3_scratch, a.low10(), Ftos_d);
 }
 
 
@@ -1548,7 +1548,7 @@
   // non-JSR normal-branch stuff occurring below.
   if( is_jsr ) {
     // compute return address as bci in Otos_i
-    __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::const_offset())), G3_scratch);
+    __ ld_ptr(Lmethod, methodOopDesc::const_offset(), G3_scratch);
     __ sub(Lbcp, G3_scratch, G3_scratch);
     __ sub(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()) - (is_wide ? 5 : 3), Otos_i);
 
@@ -1665,7 +1665,7 @@
 
   __ profile_ret(vtos, Otos_i, G4_scratch);
 
-  __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::const_offset())), G3_scratch);
+  __ ld_ptr(Lmethod, methodOopDesc::const_offset(), G3_scratch);
   __ add(G3_scratch, Otos_i, G3_scratch);
   __ add(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()), Lbcp);
   __ dispatch_next(vtos);
@@ -1680,7 +1680,7 @@
 
   __ profile_ret(vtos, Otos_i, G4_scratch);
 
-  __ ld_ptr(Address(Lmethod, 0, in_bytes(methodOopDesc::const_offset())), G3_scratch);
+  __ ld_ptr(Lmethod, methodOopDesc::const_offset(), G3_scratch);
   __ add(G3_scratch, Otos_i, G3_scratch);
   __ add(G3_scratch, in_bytes(constMethodOopDesc::codes_offset()), Lbcp);
   __ dispatch_next(vtos);
@@ -1968,8 +1968,8 @@
   Label resolved;
 
   __ get_cache_and_index_at_bcp(Rcache, index, 1);
-  __ ld_ptr(Address(Rcache, 0, in_bytes(constantPoolCacheOopDesc::base_offset() +
-                                        ConstantPoolCacheEntry::indices_offset())), Lbyte_code);
+  __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
+                    ConstantPoolCacheEntry::indices_offset(), Lbyte_code);
 
   __ srl(  Lbyte_code, shift_count, Lbyte_code );
   __ and3( Lbyte_code,        0xFF, Lbyte_code );
@@ -2029,11 +2029,11 @@
     resolve_cache_and_index(byte_no, Rcache, Rscratch);
   }
 
-  __ ld_ptr(Address(Rcache, 0, method_offset), Rmethod);
+  __ ld_ptr(Rcache, method_offset, Rmethod);
   if (Ritable_index != noreg) {
-    __ ld_ptr(Address(Rcache, 0, index_offset), Ritable_index);
+    __ ld_ptr(Rcache, index_offset, Ritable_index);
   }
-  __ ld_ptr(Address(Rcache, 0, flags_offset),  Rflags);
+  __ ld_ptr(Rcache, flags_offset, Rflags);
 }
 
 // The Rcache register must be set before call
@@ -2047,13 +2047,10 @@
 
   ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset();
 
-  __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset +
-                             ConstantPoolCacheEntry::flags_offset())), Rflags);
-  __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset +
-                             ConstantPoolCacheEntry::f2_offset())), Roffset);
+  __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::flags_offset(), Rflags);
+  __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::f2_offset(), Roffset);
   if (is_static) {
-    __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset +
-                             ConstantPoolCacheEntry::f1_offset())), Robj);
+    __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::f1_offset(), Robj);
   }
 }
 
@@ -2070,9 +2067,7 @@
     // the time to call into the VM.
     Label Label1;
     assert_different_registers(Rcache, index, G1_scratch);
-    Address get_field_access_count_addr(G1_scratch,
-                                        (address)JvmtiExport::get_field_access_count_addr(),
-                                        relocInfo::none);
+    AddressLiteral get_field_access_count_addr(JvmtiExport::get_field_access_count_addr());
     __ load_contents(get_field_access_count_addr, G1_scratch);
     __ tst(G1_scratch);
     __ br(Assembler::zero, false, Assembler::pt, Label1);
@@ -2293,7 +2288,7 @@
   __ get_cache_and_index_at_bcp(Rcache, index, 1);
   jvmti_post_field_access(Rcache, index, /*is_static*/false, /*has_tos*/true);
 
-  __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset + ConstantPoolCacheEntry::f2_offset())), Roffset);
+  __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::f2_offset(), Roffset);
 
   __ null_check(Otos_i);
   __ verify_oop(Otos_i);
@@ -2304,7 +2299,7 @@
     Assembler::Membar_mask_bits(Assembler::LoadLoad | Assembler::LoadStore);
   if (__ membar_has_effect(membar_bits)) {
     // Get volatile flag
-    __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset + ConstantPoolCacheEntry::f2_offset())), Rflags);
+    __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::f2_offset(), Rflags);
     __ set((1 << ConstantPoolCacheEntry::volatileField), Lscratch);
   }
 
@@ -2355,7 +2350,7 @@
     // Check to see if a field modification watch has been set before we take
     // the time to call into the VM.
     Label done;
-    Address get_field_modification_count_addr(G4_scratch, (address)JvmtiExport::get_field_modification_count_addr(), relocInfo::none);
+    AddressLiteral get_field_modification_count_addr(JvmtiExport::get_field_modification_count_addr());
     __ load_contents(get_field_modification_count_addr, G4_scratch);
     __ tst(G4_scratch);
     __ br(Assembler::zero, false, Assembler::pt, done);
@@ -2408,9 +2403,7 @@
     // the time to call into the VM.
     Label Label1;
     assert_different_registers(Rcache, index, G1_scratch);
-    Address get_field_modification_count_addr(G1_scratch,
-                                              (address)JvmtiExport::get_field_modification_count_addr(),
-                                              relocInfo::none);
+    AddressLiteral get_field_modification_count_addr(JvmtiExport::get_field_modification_count_addr());
     __ load_contents(get_field_modification_count_addr, G1_scratch);
     __ tst(G1_scratch);
     __ br(Assembler::zero, false, Assembler::pt, Label1);
@@ -2433,7 +2426,7 @@
       // the type to determine where the object is.
 
       Label two_word, valsizeknown;
-      __ ld_ptr(Address(G1_scratch, 0, in_bytes(cp_base_offset + ConstantPoolCacheEntry::flags_offset())), Rflags);
+      __ ld_ptr(G1_scratch, cp_base_offset + ConstantPoolCacheEntry::flags_offset(), Rflags);
       __ mov(Lesp, G4_scratch);
       __ srl(Rflags, ConstantPoolCacheEntry::tosBits, Rflags);
       // Make sure we don't need to mask Rflags for tosBits after the above shift
@@ -2689,8 +2682,7 @@
 
   Label notVolatile, checkVolatile, exit;
   if (__ membar_has_effect(read_bits) || __ membar_has_effect(write_bits)) {
-    __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset +
-                             ConstantPoolCacheEntry::flags_offset())), Rflags);
+    __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::flags_offset(), Rflags);
     __ set((1 << ConstantPoolCacheEntry::volatileField), Lscratch);
     __ and3(Rflags, Lscratch, Lscratch);
     if (__ membar_has_effect(read_bits)) {
@@ -2702,8 +2694,7 @@
     }
   }
 
-  __ ld_ptr(Address(Rcache, 0, in_bytes(cp_base_offset +
-                             ConstantPoolCacheEntry::f2_offset())), Roffset);
+  __ ld_ptr(Rcache, cp_base_offset + ConstantPoolCacheEntry::f2_offset(), Roffset);
   pop_and_check_object(Rclass);
 
   switch (bytecode()) {
@@ -2755,7 +2746,7 @@
 
   // access constant pool cache  (is resolved)
   __ get_cache_and_index_at_bcp(Rcache, G4_scratch, 2);
-  __ ld_ptr(Address(Rcache, 0, in_bytes(constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f2_offset())), Roffset);
+  __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f2_offset(), Roffset);
   __ add(Lbcp, 1, Lbcp);       // needed to report exception at the correct bcp
 
   __ verify_oop(Rreceiver);
@@ -2775,7 +2766,7 @@
   if (__ membar_has_effect(membar_bits)) {
 
     // Get is_volatile value in Rflags and check if membar is needed
-    __ ld_ptr(Address(Rcache, 0, in_bytes(constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::flags_offset())), Rflags);
+    __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::flags_offset(), Rflags);
 
     // Test volatile
     Label notVolatile;
@@ -2853,8 +2844,8 @@
   __ verify_oop(O0);
 
   // get return address
-  Address table(Rtemp, (address)Interpreter::return_3_addrs_by_index_table());
-  __ load_address(table);
+  AddressLiteral table(Interpreter::return_3_addrs_by_index_table());
+  __ set(table, Rtemp);
   __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);          // get return type
   // Make sure we don't need to mask Rret for tosBits after the above shift
   ConstantPoolCacheEntry::verify_tosBits();
@@ -2886,7 +2877,7 @@
   __ verify_oop(G5_method);
 
   // Load receiver from stack slot
-  __ lduh(Address(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())), G4_scratch);
+  __ lduh(G5_method, in_bytes(methodOopDesc::size_of_parameters_offset()), G4_scratch);
   __ load_receiver(G4_scratch, O0);
 
   // receiver NULL check
@@ -2895,8 +2886,8 @@
   __ profile_final_call(O4);
 
   // get return address
-  Address table(Rtemp, (address)Interpreter::return_3_addrs_by_index_table());
-  __ load_address(table);
+  AddressLiteral table(Interpreter::return_3_addrs_by_index_table());
+  __ set(table, Rtemp);
   __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);          // get return type
   // Make sure we don't need to mask Rret for tosBits after the above shift
   ConstantPoolCacheEntry::verify_tosBits();
@@ -2920,7 +2911,7 @@
 
   __ verify_oop(G5_method);
 
-  __ lduh(Address(G5_method, 0, in_bytes(methodOopDesc::size_of_parameters_offset())), G4_scratch);
+  __ lduh(G5_method, in_bytes(methodOopDesc::size_of_parameters_offset()), G4_scratch);
   __ load_receiver(G4_scratch, O0);
 
   // receiver NULL check
@@ -2929,8 +2920,8 @@
   __ profile_call(O4);
 
   // get return address
-  Address table(Rtemp, (address)Interpreter::return_3_addrs_by_index_table());
-  __ load_address(table);
+  AddressLiteral table(Interpreter::return_3_addrs_by_index_table());
+  __ set(table, Rtemp);
   __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);          // get return type
   // Make sure we don't need to mask Rret for tosBits after the above shift
   ConstantPoolCacheEntry::verify_tosBits();
@@ -2956,8 +2947,8 @@
   __ profile_call(O4);
 
   // get return address
-  Address table(Rtemp, (address)Interpreter::return_3_addrs_by_index_table());
-  __ load_address(table);
+  AddressLiteral table(Interpreter::return_3_addrs_by_index_table());
+  __ set(table, Rtemp);
   __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);          // get return type
   // Make sure we don't need to mask Rret for tosBits after the above shift
   ConstantPoolCacheEntry::verify_tosBits();
@@ -3021,8 +3012,8 @@
   __ mov(Rflags, Rret);
 
   // get return address
-  Address table(Rscratch, (address)Interpreter::return_5_addrs_by_index_table());
-  __ load_address(table);
+  AddressLiteral table(Interpreter::return_5_addrs_by_index_table());
+  __ set(table, Rscratch);
   __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);          // get return type
   // Make sure we don't need to mask Rret for tosBits after the above shift
   ConstantPoolCacheEntry::verify_tosBits();
@@ -3059,7 +3050,7 @@
   Label search;
   Register Rtemp = Rflags;
 
-  __ ld(Address(RklassOop, 0, instanceKlass::vtable_length_offset() * wordSize), Rtemp);
+  __ ld(RklassOop, instanceKlass::vtable_length_offset() * wordSize, Rtemp);
   if (align_object_offset(1) > 1) {
     __ round_to(Rtemp, align_object_offset(1));
   }
@@ -3125,6 +3116,24 @@
 }
 
 
+void TemplateTable::invokedynamic(int byte_no) {
+  transition(vtos, vtos);
+
+  if (!EnableInvokeDynamic) {
+    // We should not encounter this bytecode if !EnableInvokeDynamic.
+    // The verifier will stop it.  However, if we get past the verifier,
+    // this will stop the thread in a reasonable way, without crashing the JVM.
+    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
+                     InterpreterRuntime::throw_IncompatibleClassChangeError));
+    // the call_VM checks for exception, so we should never return here.
+    __ should_not_reach_here();
+    return;
+  }
+
+  __ stop("invokedynamic NYI");//6815692//
+}
+
+
 //----------------------------------------------------------------------------------------------------
 // Allocation
 
@@ -3624,9 +3633,9 @@
   transition(vtos, vtos);
   __ ldub(Lbcp, 1, G3_scratch);// get next bc
   __ sll(G3_scratch, LogBytesPerWord, G3_scratch);
-  Address ep(G4_scratch, (address)Interpreter::_wentry_point);
-  __ load_address(ep);
-  __ ld_ptr(ep.base(), G3_scratch, G3_scratch);
+  AddressLiteral ep(Interpreter::_wentry_point);
+  __ set(ep, G4_scratch);
+  __ ld_ptr(G4_scratch, G3_scratch, G3_scratch);
   __ jmp(G3_scratch, G0);
   __ delayed()->nop();
   // Note: the Lbcp increment step is part of the individual wide bytecode implementations
diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
index 5439e2a..22b76fb 100644
--- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,11 +48,7 @@
 
 #ifndef PRODUCT
   if (CountCompiledCalls) {
-    Address ctr(G5, SharedRuntime::nof_megamorphic_calls_addr());
-    __ sethi(ctr);
-    __ ld(ctr, G3_scratch);
-    __ inc(G3_scratch);
-    __ st(G3_scratch, ctr);
+    __ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), G5, G3_scratch);
   }
 #endif /* PRODUCT */
 
@@ -154,11 +150,7 @@
 
 #ifndef PRODUCT
   if (CountCompiledCalls) {
-    Address ctr(L0, SharedRuntime::nof_megamorphic_calls_addr());
-    __ sethi(ctr);
-    __ ld(ctr, L1);
-    __ inc(L1);
-    __ st(L1, ctr);
+    __ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), L0, L1);
   }
 #endif /* PRODUCT */
 
@@ -198,8 +190,8 @@
   __ delayed()->nop();
 
   __ bind(throw_icce);
-  Address icce(G3_scratch, StubRoutines::throw_IncompatibleClassChangeError_entry());
-  __ jump_to(icce, 0);
+  AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry());
+  __ jump_to(icce, G3_scratch);
   __ delayed()->restore();
 
   masm->flush();
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
index 413e597..9dc29f3 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
@@ -189,20 +189,33 @@
 }
 
 
-void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset) {
+void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_offset, bool giant_index) {
   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
+  if (!giant_index) {
+    load_unsigned_short(reg, Address(rsi, bcp_offset));
+  } else {
+    assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic");
+    movl(reg, Address(rsi, bcp_offset));
+    assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line");
+    notl(reg);  // convert to plain index
+  }
+}
+
+
+void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index,
+                                                           int bcp_offset, bool giant_index) {
   assert(cache != index, "must use different registers");
-  load_unsigned_short(index, Address(rsi, bcp_offset));
+  get_cache_index_at_bcp(index, bcp_offset, giant_index);
   movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
   assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below");
   shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index
 }
 
 
-void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {
-  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
+void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp,
+                                                               int bcp_offset, bool giant_index) {
   assert(cache != tmp, "must use different register");
-  load_unsigned_short(tmp, Address(rsi, bcp_offset));
+  get_cache_index_at_bcp(tmp, bcp_offset, giant_index);
   assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below");
                                // convert from field index to ConstantPoolCacheEntry index
                                // and from word offset to byte offset
@@ -1214,7 +1227,9 @@
 }
 
 
-void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register mdp, Register reg2) {
+void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register mdp,
+                                                     Register reg2,
+                                                     bool receiver_can_be_null) {
   if (ProfileInterpreter) {
     Label profile_continue;
 
@@ -1224,8 +1239,15 @@
     // We are making a call.  Increment the count.
     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
 
+    Label skip_receiver_profile;
+    if (receiver_can_be_null) {
+      testptr(receiver, receiver);
+      jcc(Assembler::zero, skip_receiver_profile);
+    }
+
     // Record the receiver type.
     record_klass_in_profile(receiver, mdp, reg2);
+    bind(skip_receiver_profile);
 
     // The method data pointer needs to be updated to reflect the new target.
     update_mdp_by_constant(mdp,
diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
index 3500b5f..23bca41 100644
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp
@@ -76,8 +76,9 @@
   void get_cpool_and_tags(Register cpool, Register tags)   { get_constant_pool(cpool); movptr(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes()));
   }
   void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset);
-  void get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset);
-  void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset);
+  void get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset, bool giant_index = false);
+  void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, bool giant_index = false);
+  void get_cache_index_at_bcp(Register index, int bcp_offset, bool giant_index = false);
 
   // Expression stack
   void f2ieee();                                           // truncate ftos to 32bits
@@ -226,7 +227,8 @@
   void profile_not_taken_branch(Register mdp);
   void profile_call(Register mdp);
   void profile_final_call(Register mdp);
-  void profile_virtual_call(Register receiver, Register mdp, Register scratch2);
+  void profile_virtual_call(Register receiver, Register mdp, Register scratch2,
+                            bool receiver_can_be_null = false);
   void profile_ret(Register return_bci, Register mdp);
   void profile_null_seen(Register mdp);
   void profile_typecheck(Register mdp, Register klass, Register scratch);
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index 5769873..1f20ee4 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -156,13 +156,22 @@
 }
 
 
-address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
+address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) {
+  TosState incoming_state = state;
+  if (EnableInvokeDynamic) {
+    if (unbox) {
+      incoming_state = atos;
+    }
+  } else {
+    assert(!unbox, "old behavior");
+  }
+
   Label interpreter_entry;
   address compiled_entry = __ pc();
 
 #ifdef COMPILER2
   // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases
-  if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) {
+  if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) {
     for (int i = 1; i < 8; i++) {
         __ ffree(i);
     }
@@ -170,7 +179,7 @@
     __ empty_FPU_stack();
   }
 #endif
-  if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) {
+  if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) {
     __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled");
   } else {
     __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled");
@@ -186,12 +195,12 @@
 
   // In SSE mode, interpreter returns FP results in xmm0 but they need
   // to end up back on the FPU so it can operate on them.
-  if (state == ftos && UseSSE >= 1) {
+  if (incoming_state == ftos && UseSSE >= 1) {
     __ subptr(rsp, wordSize);
     __ movflt(Address(rsp, 0), xmm0);
     __ fld_s(Address(rsp, 0));
     __ addptr(rsp, wordSize);
-  } else if (state == dtos && UseSSE >= 2) {
+  } else if (incoming_state == dtos && UseSSE >= 2) {
     __ subptr(rsp, 2*wordSize);
     __ movdbl(Address(rsp, 0), xmm0);
     __ fld_d(Address(rsp, 0));
@@ -207,13 +216,102 @@
 
   __ restore_bcp();
   __ restore_locals();
-  __ get_cache_and_index_at_bcp(rbx, rcx, 1);
+
+  Label L_fail;
+
+  if (unbox && state != atos) {
+    // cast and unbox
+    BasicType type = as_BasicType(state);
+    if (type == T_BYTE)  type = T_BOOLEAN; // FIXME
+    KlassHandle boxk = SystemDictionaryHandles::box_klass(type);
+    __ mov32(rbx, ExternalAddress((address) boxk.raw_value()));
+    __ testl(rax, rax);
+    Label L_got_value, L_get_value;
+    // convert nulls to zeroes (avoid NPEs here)
+    if (!(type == T_FLOAT || type == T_DOUBLE)) {
+      // if rax already contains zero bits, forge ahead
+      __ jcc(Assembler::zero, L_got_value);
+    } else {
+      __ jcc(Assembler::notZero, L_get_value);
+      __ fldz();
+      __ jmp(L_got_value);
+    }
+    __ bind(L_get_value);
+    __ cmp32(rbx, Address(rax, oopDesc::klass_offset_in_bytes()));
+    __ jcc(Assembler::notEqual, L_fail);
+    int offset = java_lang_boxing_object::value_offset_in_bytes(type);
+    // Cf. TemplateTable::getfield_or_static
+    switch (type) {
+      case T_BYTE:     // fall through:
+      case T_BOOLEAN:  __ load_signed_byte(rax, Address(rax, offset));    break;
+      case T_CHAR:     __ load_unsigned_short(rax, Address(rax, offset)); break;
+      case T_SHORT:    __ load_signed_short(rax, Address(rax, offset));   break;
+      case T_INT:      __ movl(rax, Address(rax, offset));                break;
+      case T_FLOAT:    __ fld_s(Address(rax, offset));                    break;
+      case T_DOUBLE:   __ fld_d(Address(rax, offset));                    break;
+      // Access to java.lang.Double.value does not need to be atomic:
+      case T_LONG:   { __ movl(rdx, Address(rax, offset + 4));
+                       __ movl(rax, Address(rax, offset + 0));  }         break;
+      default: ShouldNotReachHere();
+    }
+    __ bind(L_got_value);
+  }
+
+  Label L_got_cache, L_giant_index;
+  if (EnableInvokeDynamic) {
+    __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic);
+    __ jcc(Assembler::equal, L_giant_index);
+  }
+  __ get_cache_and_index_at_bcp(rbx, rcx, 1, false);
+  __ bind(L_got_cache);
+  if (unbox && state == atos) {
+    // insert a casting conversion, to keep verifier sane
+    Label L_ok, L_ok_pops;
+    __ testl(rax, rax);
+    __ jcc(Assembler::zero, L_ok);
+    __ push(rax);               // save the object to check
+    __ push(rbx);               // save CP cache reference
+    __ movl(rdx, Address(rax, oopDesc::klass_offset_in_bytes()));
+    __ movl(rbx, Address(rbx, rcx,
+                      Address::times_4, constantPoolCacheOopDesc::base_offset() +
+                      ConstantPoolCacheEntry::f1_offset()));
+    __ movl(rbx, Address(rbx, __ delayed_value(sun_dyn_CallSiteImpl::type_offset_in_bytes, rcx)));
+    __ movl(rbx, Address(rbx, __ delayed_value(java_dyn_MethodType::rtype_offset_in_bytes, rcx)));
+    __ movl(rax, Address(rbx, __ delayed_value(java_lang_Class::klass_offset_in_bytes, rcx)));
+    __ check_klass_subtype(rdx, rax, rbx, L_ok_pops);
+    __ pop(rcx);                // pop and discard CP cache
+    __ mov(rbx, rax);           // target supertype into rbx for L_fail
+    __ pop(rax);                // failed object into rax for L_fail
+    __ jmp(L_fail);
+
+    __ bind(L_ok_pops);
+    // restore pushed temp regs:
+    __ pop(rbx);
+    __ pop(rax);
+    __ bind(L_ok);
+  }
   __ movl(rbx, Address(rbx, rcx,
                     Address::times_ptr, constantPoolCacheOopDesc::base_offset() +
                     ConstantPoolCacheEntry::flags_offset()));
   __ andptr(rbx, 0xFF);
   __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale()));
   __ dispatch_next(state, step);
+
+  // out of the main line of code...
+  if (EnableInvokeDynamic) {
+    __ bind(L_giant_index);
+    __ get_cache_and_index_at_bcp(rbx, rcx, 1, true);
+    __ jmp(L_got_cache);
+
+    if (unbox) {
+      __ bind(L_fail);
+      __ push(rbx);             // missed klass (required)
+      __ push(rax);             // bad object (actual)
+      __ movptr(rdx, ExternalAddress((address) &Interpreter::_throw_WrongMethodType_entry));
+      __ call(rdx);
+    }
+  }
+
   return entry;
 }
 
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index cd9d089..4f0c3c9 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -166,7 +166,8 @@
 
 
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
-                                                                int step) {
+                                                                int step, bool unbox) {
+  assert(!unbox, "NYI");//6815692//
 
   // amd64 doesn't need to do anything special about compiled returns
   // to the interpreter so the code that exists on x86 to place a sentinel
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index 7c40e41..50ae319 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -206,12 +206,12 @@
     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), scratch, rsi, bc);
 #ifndef ASSERT
     __ jmpb(patch_done);
-    __ bind(fast_patch);
-  }
 #else
     __ jmp(patch_done);
+#endif
     __ bind(fast_patch);
   }
+#ifdef ASSERT
   Label okay;
   __ load_unsigned_byte(scratch, at_bcp(0));
   __ cmpl(scratch, (int)Bytecodes::java_code(bytecode));
@@ -2105,6 +2105,7 @@
 
 void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register index) {
   assert(byte_no == 1 || byte_no == 2, "byte_no out of range");
+  bool is_invokedynamic = (bytecode() == Bytecodes::_invokedynamic);
 
   Register temp = rbx;
 
@@ -2112,16 +2113,19 @@
 
   const int shift_count = (1 + byte_no)*BitsPerByte;
   Label resolved;
-  __ get_cache_and_index_at_bcp(Rcache, index, 1);
-  __ movl(temp, Address(Rcache,
-                          index,
-                          Address::times_ptr,
-                          constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::indices_offset()));
-  __ shrl(temp, shift_count);
-  // have we resolved this bytecode?
-  __ andptr(temp, 0xFF);
-  __ cmpl(temp, (int)bytecode());
-  __ jcc(Assembler::equal, resolved);
+  __ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic);
+  if (is_invokedynamic) {
+    // we are resolved if the f1 field contains a non-null CallSite object
+    __ cmpptr(Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()), (int32_t) NULL_WORD);
+    __ jcc(Assembler::notEqual, resolved);
+  } else {
+    __ movl(temp, Address(Rcache, index, Address::times_4, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::indices_offset()));
+    __ shrl(temp, shift_count);
+    // have we resolved this bytecode?
+    __ andl(temp, 0xFF);
+    __ cmpl(temp, (int)bytecode());
+    __ jcc(Assembler::equal, resolved);
+  }
 
   // resolve first time through
   address entry;
@@ -2134,12 +2138,13 @@
     case Bytecodes::_invokespecial  : // fall through
     case Bytecodes::_invokestatic   : // fall through
     case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke);  break;
+    case Bytecodes::_invokedynamic  : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break;
     default                         : ShouldNotReachHere();                                 break;
   }
   __ movl(temp, (int)bytecode());
   __ call_VM(noreg, entry, temp);
   // Update registers with resolved info
-  __ get_cache_and_index_at_bcp(Rcache, index, 1);
+  __ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic);
   __ bind(resolved);
 }
 
@@ -2884,12 +2889,17 @@
 }
 
 
-void TemplateTable::prepare_invoke(Register method, Register index, int byte_no, Bytecodes::Code code) {
+void TemplateTable::prepare_invoke(Register method, Register index, int byte_no) {
+  bool is_invdyn_bootstrap = (byte_no < 0);
+  if (is_invdyn_bootstrap)  byte_no = -byte_no;
+
   // determine flags
+  Bytecodes::Code code = bytecode();
   const bool is_invokeinterface  = code == Bytecodes::_invokeinterface;
+  const bool is_invokedynamic    = code == Bytecodes::_invokedynamic;
   const bool is_invokevirtual    = code == Bytecodes::_invokevirtual;
   const bool is_invokespecial    = code == Bytecodes::_invokespecial;
-  const bool load_receiver       = code != Bytecodes::_invokestatic;
+  const bool load_receiver      = (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic);
   const bool receiver_null_check = is_invokespecial;
   const bool save_flags = is_invokeinterface || is_invokevirtual;
   // setup registers & access constant pool cache
@@ -2897,6 +2907,8 @@
   const Register flags  = rdx;
   assert_different_registers(method, index, recv, flags);
 
+  assert(!is_invdyn_bootstrap || is_invokedynamic, "byte_no<0 hack only for invdyn");
+
   // save 'interpreter return address'
   __ save_bcp();
 
@@ -2907,8 +2919,13 @@
     __ movl(recv, flags);
     __ andl(recv, 0xFF);
     // recv count is 0 based?
-    __ movptr(recv, Address(rsp, recv, Interpreter::stackElementScale(), -Interpreter::expr_offset_in_bytes(1)));
-    __ verify_oop(recv);
+    Address recv_addr(rsp, recv, Interpreter::stackElementScale(), -Interpreter::expr_offset_in_bytes(1));
+    if (is_invokedynamic) {
+      __ lea(recv, recv_addr);
+    } else {
+      __ movptr(recv, recv_addr);
+      __ verify_oop(recv);
+    }
   }
 
   // do null check if needed
@@ -2926,8 +2943,14 @@
   ConstantPoolCacheEntry::verify_tosBits();
   // load return address
   {
-    ExternalAddress table(is_invokeinterface ? (address)Interpreter::return_5_addrs_by_index_table() :
-                                               (address)Interpreter::return_3_addrs_by_index_table());
+    address table_addr;
+    if (is_invdyn_bootstrap)
+      table_addr = (address)Interpreter::return_5_unbox_addrs_by_index_table();
+    else if (is_invokeinterface || is_invokedynamic)
+      table_addr = (address)Interpreter::return_5_addrs_by_index_table();
+    else
+      table_addr = (address)Interpreter::return_3_addrs_by_index_table();
+    ExternalAddress table(table_addr);
     __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr)));
   }
 
@@ -2990,7 +3013,7 @@
 
 void TemplateTable::invokevirtual(int byte_no) {
   transition(vtos, vtos);
-  prepare_invoke(rbx, noreg, byte_no, bytecode());
+  prepare_invoke(rbx, noreg, byte_no);
 
   // rbx,: index
   // rcx: receiver
@@ -3002,7 +3025,7 @@
 
 void TemplateTable::invokespecial(int byte_no) {
   transition(vtos, vtos);
-  prepare_invoke(rbx, noreg, byte_no, bytecode());
+  prepare_invoke(rbx, noreg, byte_no);
   // do the call
   __ verify_oop(rbx);
   __ profile_call(rax);
@@ -3012,7 +3035,7 @@
 
 void TemplateTable::invokestatic(int byte_no) {
   transition(vtos, vtos);
-  prepare_invoke(rbx, noreg, byte_no, bytecode());
+  prepare_invoke(rbx, noreg, byte_no);
   // do the call
   __ verify_oop(rbx);
   __ profile_call(rax);
@@ -3028,7 +3051,7 @@
 
 void TemplateTable::invokeinterface(int byte_no) {
   transition(vtos, vtos);
-  prepare_invoke(rax, rbx, byte_no, bytecode());
+  prepare_invoke(rax, rbx, byte_no);
 
   // rax,: Interface
   // rbx,: index
@@ -3102,6 +3125,84 @@
   __ should_not_reach_here();
 }
 
+void TemplateTable::invokedynamic(int byte_no) {
+  transition(vtos, vtos);
+
+  if (!EnableInvokeDynamic) {
+    // We should not encounter this bytecode if !EnableInvokeDynamic.
+    // The verifier will stop it.  However, if we get past the verifier,
+    // this will stop the thread in a reasonable way, without crashing the JVM.
+    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
+                     InterpreterRuntime::throw_IncompatibleClassChangeError));
+    // the call_VM checks for exception, so we should never return here.
+    __ should_not_reach_here();
+    return;
+  }
+
+  prepare_invoke(rax, rbx, byte_no);
+
+  // rax: CallSite object (f1)
+  // rbx: unused (f2)
+  // rcx: receiver address
+  // rdx: flags (unused)
+
+  if (ProfileInterpreter) {
+    Label L;
+    // %%% should make a type profile for any invokedynamic that takes a ref argument
+    // profile this call
+    __ profile_call(rsi);
+  }
+
+  Label handle_unlinked_site;
+  __ movptr(rcx, Address(rax, __ delayed_value(sun_dyn_CallSiteImpl::target_offset_in_bytes, rcx)));
+  __ testptr(rcx, rcx);
+  __ jcc(Assembler::zero, handle_unlinked_site);
+
+  __ prepare_to_jump_from_interpreted();
+  __ jump_to_method_handle_entry(rcx, rdx);
+
+  // Initial calls come here...
+  __ bind(handle_unlinked_site);
+  __ pop(rcx);                 // remove return address pushed by prepare_invoke
+
+  // box stacked arguments into an array for the bootstrap method
+  address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::bootstrap_invokedynamic);
+  __ restore_bcp();      // rsi must be correct for call_VM
+  __ call_VM(rax, entry, rax);
+  __ movl(rdi, rax);            // protect bootstrap MH from prepare_invoke
+
+  // recompute return address
+  __ restore_bcp();      // rsi must be correct for prepare_invoke
+  prepare_invoke(rax, rbx, -byte_no);  // smashes rcx, rdx
+  // rax: CallSite object (f1)
+  // rbx: unused (f2)
+  // rdi: bootstrap MH
+  // rdx: flags
+
+  // now load up the arglist, which has been neatly boxed
+  __ get_thread(rcx);
+  __ movptr(rdx, Address(rcx, JavaThread::vm_result_2_offset()));
+  __ movptr(Address(rcx, JavaThread::vm_result_2_offset()), NULL_WORD);
+  __ verify_oop(rdx);
+  // rdx = arglist
+
+  // save SP now, before we add the bootstrap call to the stack
+  // We must preserve a fiction that the original arguments are outgoing,
+  // because the return sequence will reset the stack to this point
+  // and then pop all those arguments.  It seems error-prone to use
+  // a different argument list size just for bootstrapping.
+  __ prepare_to_jump_from_interpreted();
+
+  // Now let's play adapter, pushing the real arguments on the stack.
+  __ pop(rbx);                  // return PC
+  __ push(rdi);                 // boot MH
+  __ push(rax);                 // call site
+  __ push(rdx);                 // arglist
+  __ push(rbx);                 // return PC, again
+  __ mov(rcx, rdi);
+  __ jump_to_method_handle_entry(rcx, rdx);
+}
+
 //----------------------------------------------------------------------------------------------------
 // Allocation
 
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
index 8625720..a89eff6 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
@@ -22,8 +22,7 @@
  *
  */
 
-  static void prepare_invoke(Register method, Register index, int byte_no,
-                             Bytecodes::Code code);
+  static void prepare_invoke(Register method, Register index, int byte_no);
   static void invokevirtual_helper(Register index, Register recv,
                                    Register flags);
   static void volatile_barrier(Assembler::Membar_mask_bits order_constraint );
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index 048b8bb..07034a4 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -3058,6 +3058,23 @@
   return;
 }
 
+void TemplateTable::invokedynamic(int byte_no) {
+  transition(vtos, vtos);
+
+  if (!EnableInvokeDynamic) {
+    // We should not encounter this bytecode if !EnableInvokeDynamic.
+    // The verifier will stop it.  However, if we get past the verifier,
+    // this will stop the thread in a reasonable way, without crashing the JVM.
+    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
+                     InterpreterRuntime::throw_IncompatibleClassChangeError));
+    // the call_VM checks for exception, so we should never return here.
+    __ should_not_reach_here();
+    return;
+  }
+
+  __ stop("invokedynamic NYI");//6815692//
+}
+
 
 //-----------------------------------------------------------------------------
 // Allocation
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 0ae4c3e..1cf0cee 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -2632,6 +2632,8 @@
 
 char* os::reserve_memory_special(size_t bytes, char* addr, bool exec) {
 
+  const DWORD prot = exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
+
   if (UseLargePagesIndividualAllocation) {
     if (TracePageSizes && Verbose) {
        tty->print_cr("Reserving large pages individually.");
@@ -2694,13 +2696,7 @@
         p_new = (char *) VirtualAlloc(next_alloc_addr,
                                     bytes_to_rq,
                                     MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES,
-                                    PAGE_READWRITE);
-        if (p_new != NULL && exec) {
-          DWORD oldprot;
-          // Windows doc says to use VirtualProtect to get execute permissions
-          VirtualProtect(next_alloc_addr, bytes_to_rq,
-                         PAGE_EXECUTE_READWRITE, &oldprot);
-        }
+                                    prot);
       }
 
       if (p_new == NULL) {
@@ -2729,12 +2725,7 @@
   } else {
     // normal policy just allocate it all at once
     DWORD flag = MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES;
-    char * res = (char *)VirtualAlloc(NULL, bytes, flag, PAGE_READWRITE);
-    if (res != NULL && exec) {
-      DWORD oldprot;
-      // Windows doc says to use VirtualProtect to get execute permissions
-      VirtualProtect(res, bytes, PAGE_EXECUTE_READWRITE, &oldprot);
-    }
+    char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot);
     return res;
   }
 }
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
index 754195f..1a291cd 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp
@@ -39,7 +39,7 @@
 // ThreadStackSize 320 allows TaggedStackInterpreter and a couple of test cases
 // to run while keeping the number of threads that can be created high.
 define_pd_global(intx, ThreadStackSize,          320);
-define_pd_global(intx, VMThreadStackSize,        256);
+define_pd_global(intx, VMThreadStackSize,        512);
 define_pd_global(intx, SurvivorRatio,            8);
 define_pd_global(uintx, JVMInvokeMethodSlack,    10*K);
 #endif // AMD64
diff --git a/hotspot/src/share/tools/MakeDeps/BuildConfig.java b/hotspot/src/share/tools/MakeDeps/BuildConfig.java
index accdab6..ec26bc6 100644
--- a/hotspot/src/share/tools/MakeDeps/BuildConfig.java
+++ b/hotspot/src/share/tools/MakeDeps/BuildConfig.java
@@ -247,7 +247,7 @@
         sysDefines.add("HOTSPOT_BUILD_USER="+System.getProperty("user.name"));
         sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
         sysDefines.add("_JNI_IMPLEMENTATION_");
-        sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i486\\\"");
+        sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
 
         sysDefines.addAll(defines);
 
diff --git a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile
index 6bdf4b8..c1fd4ca 100644
--- a/hotspot/src/share/tools/hsdis/Makefile
+++ b/hotspot/src/share/tools/hsdis/Makefile
@@ -22,61 +22,75 @@
 #  
 #
 
-# Single gnu makefile for solaris, linux and windows (windows requires mks or
-# cygwin).
-
-ifeq            ($(BINUTILS),)
-# Pop all the way out of the workspace to look for binutils.
-# ...You probably want to override this setting.
-BINUTILS	= $(shell cd ../../../../..;pwd)/binutils-2.17-$(LIBARCH)
-endif
+# Single gnu makefile for solaris, linux and windows (windows requires cygwin and mingw)
 
 # Default arch; it is changed below as needed.
 ARCH		= i386
 OS		= $(shell uname)
 
-CPPFLAGS	+= -I$(BINUTILS)/include -I$(BINUTILS)/bfd
-CPPFLAGS	+= -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" -DLIBARCH_$(LIBARCH)
-CPPFLAGS	+= -DHOTSPOT_OS=\"$(OS)\" -DOS_$(OS)
-
 ## OS = SunOS ##
 ifeq		($(OS),SunOS)
-ARCH    	= $(shell uname -p)
+CPU             = $(shell uname -p)
+ARCH1=$(CPU:i586=i386)
+ARCH=$(ARCH1:i686=i386)
 OS		= solaris
 CC 		= cc
-CCFLAGS		+= -Kpic -g
-CCFLAGS/amd64   += -xarch=amd64
-CCFLAGS/sparcv9 += -xarch=v9
-CCFLAGS		+= $(CCFLAGS/$(LIBARCH))
+CFLAGS		+= -KPIC
+ifdef LP64
+ifeq ($(ARCH),sparc)
+ARCH            = sparcv9
+endif
+ifeq ($(ARCH),i386)
+ARCH            = amd64
+endif
+endif
+CFLAGS/sparcv9	+= -xarch=v9
+CFLAGS/amd64	+= -m64
+CFLAGS		+= $(CFLAGS/$(ARCH))
 DLDFLAGS	+= -G
+LDFLAGS         += -ldl
 OUTFLAGS	+= -o $@
 LIB_EXT		= .so
 else
 ## OS = Linux ##
 ifeq		($(OS),Linux)
-CPU             = $(shell uname -m)
-ifeq		($(CPU),ia64)
-ARCH    	= ia64
+ifneq           ($(MINGW),)
+LIB_EXT		= .dll
+CPPFLAGS += -I$(TARGET_DIR)/include
+LDFLAGS += -L$(TARGET_DIR)/lib
+OS=windows
+ifneq           ($(findstring x86_64-,$(MINGW)),)
+ARCH=amd64
 else
-ifeq		($(CPU),x86_64)
-CCFLAGS		+= -fPIC
-endif   # x86_64
-endif   # ia64
+ARCH=i386
+endif
+CC 		= $(MINGW)-gcc
+CONFIGURE_ARGS= --host=$(MINGW) --target=$(MINGW)
+else
+CPU             = $(shell uname -m)
+ARCH1=$(CPU:x86_64=amd64)
+ARCH=$(ARCH1:i686=i386)
+CFLAGS/i386	+= -m32
+CFLAGS/sparc	+= -m32
+CFLAGS/sparcv9	+= -m64
+CFLAGS/amd64	+= -m64
+CFLAGS		+= $(CFLAGS/$(ARCH))
+CFLAGS		+= -fPIC
 OS		= linux
-CC 		= gcc
-CCFLAGS		+= -O
-DLDFLAGS	+= -shared
-OUTFLAGS	+= -o $@
 LIB_EXT		= .so
-CPPFLAGS	+= -Iinclude -Iinclude/$(OS)_$(ARCH)/
+CC 		= gcc
+endif
+CFLAGS		+= -O
+DLDFLAGS	+= -shared
+LDFLAGS         += -ldl
+OUTFLAGS	+= -o $@
 ## OS = Windows ##
 else   # !SunOS, !Linux => Windows
-OS		= win
-CC		= cl
+OS		= windows
+CC		= gcc
 #CPPFLAGS	+= /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG"
-CCFLAGS		+=  /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
-CCFLAGS		+= -Iinclude -Iinclude/gnu -Iinclude/$(OS)_$(ARCH)
-CCFLAGS		+= /D"HOTSPOT_LIB_ARCH=\"$(LIBARCH)\""
+CFLAGS		+=  /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
+CFLAGS		+= LIBARCH=\"$(LIBARCH)\""
 DLDFLAGS	+= /dll /subsystem:windows /incremental:no \
 			/export:decode_instruction
 OUTFLAGS	+= /link /out:$@
@@ -94,21 +108,34 @@
 endif   # LIBARCH64/$(ARCH)
 endif   # LP64
 
-TARGET_DIR	= bin/$(OS)
+JDKARCH=$(LIBARCH:i386=i586)
+
+ifeq            ($(BINUTILS),)
+# Pop all the way out of the workspace to look for binutils.
+# ...You probably want to override this setting.
+BINUTILSDIR	= $(shell cd build/binutils;pwd)
+else
+BINUTILSDIR	= $(shell cd $(BINUTILS);pwd)
+endif
+
+CPPFLAGS	+= -I$(BINUTILSDIR)/include -I$(BINUTILS)/bfd -I$(TARGET_DIR)/bfd
+CPPFLAGS	+= -DLIBARCH_$(LIBARCH) -DLIBARCH=\"$(LIBARCH)\" -DLIB_EXT=\"$(LIB_EXT)\"
+
+TARGET_DIR	= build/$(OS)-$(JDKARCH)
 TARGET		= $(TARGET_DIR)/hsdis-$(LIBARCH)$(LIB_EXT)
 
 SOURCE		= hsdis.c
 
-LIBRARIES =	$(BINUTILS)/bfd/libbfd.a \
-		$(BINUTILS)/opcodes/libopcodes.a \
-		$(BINUTILS)/libiberty/libiberty.a
+LIBRARIES =	$(TARGET_DIR)/bfd/libbfd.a \
+		$(TARGET_DIR)/opcodes/libopcodes.a \
+		$(TARGET_DIR)/libiberty/libiberty.a
 
-DEMO_TARGET	= $(TARGET_DIR)/hsdis-demo-$(LIBARCH)
+DEMO_TARGET	= $(TARGET_DIR)/hsdis-demo
 DEMO_SOURCE	= hsdis-demo.c
 
 .PHONY:  all clean demo both
 
-all:  $(TARGET) demo
+all:  $(TARGET)
 
 both: all all64
 
@@ -117,16 +144,17 @@
 
 demo: $(TARGET) $(DEMO_TARGET)
 
-$(LIBRARIES):
-	@echo "*** Please build binutils first; see ./README: ***"
-	@sed < ./README '1,/__________/d' | head -20
-	@echo "..."; exit 1
+$(LIBRARIES): $(TARGET_DIR) $(TARGET_DIR)/Makefile
+	if [ ! -f $@ ]; then cd $(TARGET_DIR); make all-opcodes; fi
+
+$(TARGET_DIR)/Makefile:
+	(cd $(TARGET_DIR); CC=$(CC) CFLAGS="$(CFLAGS)" $(BINUTILSDIR)/configure --disable-nls $(CONFIGURE_ARGS))
 
 $(TARGET): $(SOURCE) $(LIBS) $(LIBRARIES) $(TARGET_DIR)
-	$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CCFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES)
+	$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES)
 
 $(DEMO_TARGET): $(DEMO_SOURCE) $(TARGET) $(TARGET_DIR)
-	$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CCFLAGS) $(DEMO_SOURCE) $(LDFLAGS)
+	$(CC) $(OUTFLAGS) -DTARGET_DIR=\"$(TARGET_DIR)\" $(CPPFLAGS) -g $(CFLAGS/$(ARCH)) $(DEMO_SOURCE) $(LDFLAGS)
 
 $(TARGET_DIR):
 	[ -d $@ ] || mkdir -p $@
diff --git a/hotspot/src/share/tools/hsdis/README b/hotspot/src/share/tools/hsdis/README
index 76c92a4..91118e0 100644
--- a/hotspot/src/share/tools/hsdis/README
+++ b/hotspot/src/share/tools/hsdis/README
@@ -32,61 +32,55 @@
 
 * Building
 
-To build this project you need a build of Gnu binutils to link against.
-It is known to work with binutils 2.17.
+To build this project you a copy of GNU binutils to build against.  It
+is known to work with binutils 2.17 and binutils 2.19.1.  Download a
+copy of the software from http://directory.fsf.org/project/binutils or
+one of it's mirrors.  Builds targetting windows should use at least
+2.19 and currently requires the use of a cross compiler.
 
-The makefile looks for this build in $BINUTILS, or (if that is not set),
-in  .../binutils-2.17-$LIBARCH, where LIBARCH (as in HotSpot) is one of
-the jre subdirectory keywords i386, amd64, sparc, sparcv9, etc.
+The makefile looks for the sources in build/binutils or you can
+specify it's location to the makefile using BINTUILS=path.  It will
+configure binutils and build it first and then build and link the
+disasembly adapter.  Make all will build the default target for your
+platform.  If you platform support both 32 and 64 simultaneously then
+"make both" will build them both at once.  "make all64" will
+explicitly build the 64 bit version.  By default this will build the
+disassembler library only.  If you build demo it will build a demo
+program that attempts to exercise the library.
 
-To build Gnu binutils, first download a copy of the software:
-  http://directory.fsf.org/project/binutils/
+Windows
 
-Unpack the binutils tarball into an empty directory:
-  chdir ../../../../..
-  tar -xzf - < ../binutils-2.17.tar.gz
-  mv binutils-2.17 binutils-2.17-i386  #or binutils-2.17-sparc
-  cd binutils-2.17-i386
+In theory this should be buildable on Windows but getting a working
+GNU build environment on Windows has proven difficult.  MINGW should
+be able to do it but at the time of this writing I was unable to get
+this working.  Instead you can use the mingw cross compiler on linux
+to produce the windows binaries.  For 32-bit windows you can install
+mingw32 using your package manager and it will be added to your path
+automatically.  For 64-bit you need to download the 64 bit mingw from
+http://sourceforge.net/projects/mingw-w64.  Grab a copy of the
+complete toolchain and unpack it somewhere.  Put the bin directory of
+the toolchain in your path.  The mingw installs contain cross compile
+versions of gcc that are named with a prefix to indicate what they are
+targetting and you must tell the Makefile which one to use.  This
+should either be i586-mingw32msvc or x86_64-pc-mingw32 depending on
+which on you are targetting and there should be a version of gcc in
+your path named i586-mingw32msvc-gcc or x86_64-pc-mingw32-gcc.  Tell
+the makefile what prefix to use to find the mingw tools by using
+MINGW=.  For example:
 
-From inside that directory, run configure and make:
-  ( export CFLAGS='-fPIC'
-    ./configure i386-pc-elf )
-  gnumake
+make MINGW=i586-mingw32msvc BINTUILS=build/binutils-2.19.1
 
-(Leave out or change the argument to configure if not on an i386 system.)
-
-Next, untar again into another empty directory for the LP64 version:
-  chdir ..
-  tar -xzf - < ../binutils-2.17.tar.gz
-  mv binutils-2.17 binutils-2.17-amd64  #or binutils-2.17-sparcv9
-  cd binutils-2.17-amd64
-
-From inside that directory, run configure for LP64 and make:
-  ( export ac_cv_c_bigendian=no CFLAGS='-m64 -fPIC' LDFLAGS=-m64
-    ./configure amd64-pc-elf )
-  gnumake
-
-The -fPIC option is needed because the generated code will be
-linked into the hsdid-$LIBARCH.so binary.  If you miss the
-option, the JVM will fail to load the disassembler.
-
-You probably want two builds, one for 32 and one for 64 bits.
-To build the 64-bit variation of a platforn, add LP64=1 to
-the make command line for hsdis.
-
-So, go back to the hsdis project and build:
-  chdir .../hsdis
-  gnumake
-  gnumake LP64=1
+will build the Win32 cross compiled version of hsdis based on 2.19.1.
 
 * Installing
 
-Products are named like bin/$OS/hsdis-$LIBARCH.so.
-You can install them on your LD_LIBRARY_PATH,
-or inside of your JRE next to $LIBARCH/libjvm.so.
+Products are named like build/$OS-$LIBARCH/hsdis-$LIBARCH.so.  You can
+install them on your LD_LIBRARY_PATH, or inside of your JRE next to
+$LIBARCH/libjvm.so.
 
 Now test:
-  export LD_LIBRARY_PATH .../hsdis/bin/solaris:$LD_LIBRARY_PATH
+
+  export LD_LIBRARY_PATH .../hsdis/build/$OS-$LIBARCH:$LD_LIBRARY_PATH
   dargs='-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly'
   dargs=$dargs' -XX:PrintAssemblyOptions=hsdis-print-bytes'
   java $dargs -Xbatch CompileCommand=print,*String.hashCode HelloWorld
diff --git a/hotspot/src/share/tools/hsdis/hsdis-demo.c b/hotspot/src/share/tools/hsdis/hsdis-demo.c
index adea76e..5132453 100644
--- a/hotspot/src/share/tools/hsdis/hsdis-demo.c
+++ b/hotspot/src/share/tools/hsdis/hsdis-demo.c
@@ -53,7 +53,7 @@
       else if (!strncmp(arg, "-options=", 9))
         options = arg+9;
       else
-        { printf("Usage: %s [-xml] [name...]\n"); exit(2); }
+        { printf("Usage: %s [-xml] [name...]\n", av[0]); exit(2); }
       continue;
     }
     greet(arg);
@@ -76,26 +76,14 @@
 
 #include "dlfcn.h"
 
-#ifdef HOTSPOT_LIB_ARCH
-#define LIBARCH HOTSPOT_LIB_ARCH
-#endif
-#ifdef HOTSPOT_OS
-#define OS HOTSPOT_OS
-#endif
-
 #define DECODE_INSTRUCTIONS_NAME "decode_instructions"
 #define HSDIS_NAME               "hsdis"
 static void* decode_instructions_pv = 0;
 static const char* hsdis_path[] = {
-  HSDIS_NAME".so",
-#ifdef OS
-  "bin/"OS"/"HSDIS_NAME".so",
-#endif
-#ifdef LIBARCH
-  HSDIS_NAME"-"LIBARCH".so",
-#ifdef OS
-  "bin/"OS"/"HSDIS_NAME"-"LIBARCH".so",
-#endif
+  HSDIS_NAME"-"LIBARCH LIB_EXT,
+  "./" HSDIS_NAME"-"LIBARCH LIB_EXT,
+#ifdef TARGET_DIR
+  TARGET_DIR"/"HSDIS_NAME"-"LIBARCH LIB_EXT,
 #endif
   NULL
 };
@@ -112,7 +100,7 @@
     for (dllib = NULL; dllib == NULL; ) {
       const char* next_lib = (*next_in_path++);
       if (next_lib == NULL)
-        return "cannot find plugin "HSDIS_NAME".so";
+        return "cannot find plugin "HSDIS_NAME LIB_EXT;
       dllib = dlopen(next_lib, RTLD_LAZY);
     }
   }
diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c
index 75b7efe..841a3af 100644
--- a/hotspot/src/share/tools/hsdis/hsdis.c
+++ b/hotspot/src/share/tools/hsdis/hsdis.c
@@ -33,6 +33,7 @@
 #include <libiberty.h>
 #include <bfd.h>
 #include <dis-asm.h>
+#include <inttypes.h>
 
 #ifndef bool
 #define bool int
@@ -404,21 +405,21 @@
 }
 
 static const char* native_arch_name() {
-  const char* res = HOTSPOT_LIB_ARCH;
+  const char* res = NULL;
+#ifdef LIBARCH_i386
+    res = "i386";
+#endif
 #ifdef LIBARCH_amd64
     res = "i386:x86-64";
 #endif
 #ifdef LIBARCH_sparc
     res = "sparc:v8plusb";
 #endif
-#ifdef LIBARCH_sparc
-    res = "sparc:v8plusb";
-#endif
 #ifdef LIBARCH_sparcv9
     res = "sparc:v9b";
 #endif
   if (res == NULL)
-    res = "HOTSPOT_LIB_ARCH is not set in Makefile!";
+    res = "architecture not set in Makefile!";
   return res;
 }
 
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index 5b7834c..a7ebacd 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -1524,6 +1524,11 @@
     code = Bytecodes::_invokespecial;
   }
 
+  if (code == Bytecodes::_invokedynamic) {
+    BAILOUT("invokedynamic NYI"); // FIXME
+    return;
+  }
+
   // NEEDS_CLEANUP
   // I've added the target-is_loaded() test below but I don't really understand
   // how klass->is_loaded() can be true and yet target->is_loaded() is false.
@@ -2431,8 +2436,8 @@
       case Bytecodes::_invokevirtual  : // fall through
       case Bytecodes::_invokespecial  : // fall through
       case Bytecodes::_invokestatic   : // fall through
+      case Bytecodes::_invokedynamic  : // fall through
       case Bytecodes::_invokeinterface: invoke(code); break;
-      case Bytecodes::_xxxunusedxxx   : ShouldNotReachHere(); break;
       case Bytecodes::_new            : new_instance(s.get_index_big()); break;
       case Bytecodes::_newarray       : new_type_array(); break;
       case Bytecodes::_anewarray      : new_object_array(); break;
@@ -2571,6 +2576,7 @@
     , Bytecodes::_invokevirtual
     , Bytecodes::_invokespecial
     , Bytecodes::_invokestatic
+    , Bytecodes::_invokedynamic
     , Bytecodes::_invokeinterface
     , Bytecodes::_new
     , Bytecodes::_newarray
diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
index 328c2e1..40332b1e 100644
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp
@@ -2956,9 +2956,11 @@
 
   NOT_PRODUCT(print_intervals("After Register Allocation"));
   NOT_PRODUCT(print_lir(2, "LIR after register allocation:"));
-  DEBUG_ONLY(verify());
 
   sort_intervals_after_allocation();
+
+  DEBUG_ONLY(verify());
+
   eliminate_spill_moves();
   assign_reg_num();
   CHECK_BAILOUT();
@@ -3147,6 +3149,16 @@
 
 
 void LinearScan::verify_no_oops_in_fixed_intervals() {
+  Interval* fixed_intervals;
+  Interval* other_intervals;
+  create_unhandled_lists(&fixed_intervals, &other_intervals, is_precolored_cpu_interval, NULL);
+
+  // to ensure a walking until the last instruction id, add a dummy interval
+  // with a high operation id
+  other_intervals = new Interval(any_reg);
+  other_intervals->add_range(max_jint - 2, max_jint - 1);
+  IntervalWalker* iw = new IntervalWalker(this, fixed_intervals, other_intervals);
+
   LIR_OpVisitState visitor;
   for (int i = 0; i < block_count(); i++) {
     BlockBegin* block = block_at(i);
@@ -3159,6 +3171,54 @@
 
       visitor.visit(op);
 
+      if (visitor.info_count() > 0) {
+        iw->walk_before(op->id());
+        bool check_live = true;
+        if (op->code() == lir_move) {
+          LIR_Op1* move = (LIR_Op1*)op;
+          check_live = (move->patch_code() == lir_patch_none);
+        }
+        LIR_OpBranch* branch = op->as_OpBranch();
+        if (branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) {
+          // Don't bother checking the stub in this case since the
+          // exception stub will never return to normal control flow.
+          check_live = false;
+        }
+
+        // Make sure none of the fixed registers is live across an
+        // oopmap since we can't handle that correctly.
+        if (check_live) {
+          for (Interval* interval = iw->active_first(fixedKind);
+               interval != Interval::end();
+               interval = interval->next()) {
+            if (interval->current_to() > op->id() + 1) {
+              // This interval is live out of this op so make sure
+              // that this interval represents some value that's
+              // referenced by this op either as an input or output.
+              bool ok = false;
+              for_each_visitor_mode(mode) {
+                int n = visitor.opr_count(mode);
+                for (int k = 0; k < n; k++) {
+                  LIR_Opr opr = visitor.opr_at(mode, k);
+                  if (opr->is_fixed_cpu()) {
+                    if (interval_at(reg_num(opr)) == interval) {
+                      ok = true;
+                      break;
+                    }
+                    int hi = reg_numHi(opr);
+                    if (hi != -1 && interval_at(hi) == interval) {
+                      ok = true;
+                      break;
+                    }
+                  }
+                }
+              }
+              assert(ok, "fixed intervals should never be live across an oopmap point");
+            }
+          }
+        }
+      }
+
       // oop-maps at calls do not contain registers, so check is not needed
       if (!visitor.has_call()) {
 
diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
index 4b3526d..e5b6b66 100644
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
@@ -833,6 +833,7 @@
       case Bytecodes::_invokevirtual:
       case Bytecodes::_invokespecial:
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokeinterface:
         { bool will_link;
           ciMethod* target = s.get_method(will_link);
@@ -848,9 +849,6 @@
           }
         }
         break;
-      case Bytecodes::_xxxunusedxxx:
-        ShouldNotReachHere();
-        break;
       case Bytecodes::_new:
         state.apush(allocated_obj);
         break;
diff --git a/hotspot/src/share/vm/ci/ciStreams.cpp b/hotspot/src/share/vm/ci/ciStreams.cpp
index 577c06d..5401e64 100644
--- a/hotspot/src/share/vm/ci/ciStreams.cpp
+++ b/hotspot/src/share/vm/ci/ciStreams.cpp
@@ -301,17 +301,19 @@
 // If this is a method invocation bytecode, get the constant pool
 // index of the invoked method.
 int ciBytecodeStream::get_method_index() {
+#ifdef ASSERT
   switch (cur_bc()) {
   case Bytecodes::_invokeinterface:
-    return Bytes::get_Java_u2(_pc-4);
   case Bytecodes::_invokevirtual:
   case Bytecodes::_invokespecial:
   case Bytecodes::_invokestatic:
-    return get_index_big();
+  case Bytecodes::_invokedynamic:
+    break;
   default:
     ShouldNotReachHere();
-    return 0;
   }
+#endif
+  return get_index_int();
 }
 
 // ------------------------------------------------------------------
@@ -337,6 +339,9 @@
 // for checking linkability when retrieving the associated method.
 ciKlass* ciBytecodeStream::get_declared_method_holder() {
   bool ignore;
+  // report as Dynamic for invokedynamic, which is syntactically classless
+  if (cur_bc() == Bytecodes::_invokedynamic)
+    return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_Dynamic(), false);
   return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore);
 }
 
diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp
index eebb604..cc3e55e 100644
--- a/hotspot/src/share/vm/ci/ciStreams.hpp
+++ b/hotspot/src/share/vm/ci/ciStreams.hpp
@@ -91,9 +91,10 @@
     _end = _start + max;
   }
 
-  address cur_bcp()             { return _bc_start; }  // Returns bcp to current instruction
+  address cur_bcp() const       { return _bc_start; }  // Returns bcp to current instruction
   int next_bci() const          { return _pc -_start; }
   int cur_bci() const           { return _bc_start - _start; }
+  int instruction_size() const  { return _pc - _bc_start; }
 
   Bytecodes::Code cur_bc() const{ return check_java(_bc); }
   Bytecodes::Code next_bc()     { return Bytecodes::java_code((Bytecodes::Code)* _pc); }
@@ -121,34 +122,39 @@
     return check_java(_bc);
   }
 
-  bool is_wide()  { return ( _pc == _was_wide ); }
+  bool is_wide() const { return ( _pc == _was_wide ); }
 
   // Get a byte index following this bytecode.
   // If prefixed with a wide bytecode, get a wide index.
   int get_index() const {
+    assert_index_size(is_wide() ? 2 : 1);
     return (_pc == _was_wide)   // was widened?
       ? Bytes::get_Java_u2(_bc_start+2) // yes, return wide index
       : _bc_start[1];           // no, return narrow index
   }
 
-  // Set a byte index following this bytecode.
-  // If prefixed with a wide bytecode, get a wide index.
-  void put_index(int idx) {
-      if (_pc == _was_wide)     // was widened?
-         Bytes::put_Java_u2(_bc_start+2,idx);   // yes, set wide index
-      else
-         _bc_start[1]=idx;              // no, set narrow index
+  // Get 2-byte index (getfield/putstatic/etc)
+  int get_index_big() const {
+    assert_index_size(2);
+    return Bytes::get_Java_u2(_bc_start+1);
   }
 
-  // Get 2-byte index (getfield/putstatic/etc)
-  int get_index_big() const { return Bytes::get_Java_u2(_bc_start+1); }
+  // Get 2-byte index (or 4-byte, for invokedynamic)
+  int get_index_int() const {
+    return has_giant_index() ? get_index_giant() : get_index_big();
+  }
+
+  // Get 4-byte index, for invokedynamic.
+  int get_index_giant() const {
+    assert_index_size(4);
+    return Bytes::get_native_u4(_bc_start+1);
+  }
+
+  bool has_giant_index() const { return (cur_bc() == Bytecodes::_invokedynamic); }
 
   // Get dimensions byte (multinewarray)
   int get_dimensions() const { return *(unsigned char*)(_pc-1); }
 
-  // Get unsigned index fast
-  int get_index_fast() const { return Bytes::get_native_u2(_pc-2); }
-
   // Sign-extended index byte/short, no widening
   int get_byte() const { return (int8_t)(_pc[-1]); }
   int get_short() const { return (int16_t)Bytes::get_Java_u2(_pc-2); }
@@ -225,6 +231,22 @@
   ciKlass*  get_declared_method_holder();
   int       get_method_holder_index();
   int       get_method_signature_index();
+
+ private:
+  void assert_index_size(int required_size) const {
+#ifdef ASSERT
+    int isize = instruction_size() - (is_wide() ? 1 : 0) - 1;
+    if (isize == 2 &&  cur_bc() == Bytecodes::_iinc)
+      isize = 1;
+    else if (isize <= 2)
+      ;                         // no change
+    else if (has_giant_index())
+      isize = 4;
+    else
+      isize = 2;
+    assert(isize = required_size, "wrong index size");
+#endif
+  }
 };
 
 
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index 2e93cd0..9e48c90 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -1217,31 +1217,34 @@
     // valid class file.  The class loader will check everything else.
     if (strchr(buffer, '.') == NULL) {
       _compile_the_world_counter++;
-      if (_compile_the_world_counter >= CompileTheWorldStartAt && _compile_the_world_counter <= CompileTheWorldStopAt) {
-        // Construct name without extension
-        symbolHandle sym = oopFactory::new_symbol_handle(buffer, CHECK);
-        // Use loader to load and initialize class
-        klassOop ik = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);
-        instanceKlassHandle k (THREAD, ik);
-        if (k.not_null() && !HAS_PENDING_EXCEPTION) {
-          k->initialize(THREAD);
+      if (_compile_the_world_counter > CompileTheWorldStopAt) return;
+
+      // Construct name without extension
+      symbolHandle sym = oopFactory::new_symbol_handle(buffer, CHECK);
+      // Use loader to load and initialize class
+      klassOop ik = SystemDictionary::resolve_or_null(sym, loader, Handle(), THREAD);
+      instanceKlassHandle k (THREAD, ik);
+      if (k.not_null() && !HAS_PENDING_EXCEPTION) {
+        k->initialize(THREAD);
+      }
+      bool exception_occurred = HAS_PENDING_EXCEPTION;
+      CLEAR_PENDING_EXCEPTION;
+      if (CompileTheWorldPreloadClasses && k.not_null()) {
+        constantPoolKlass::preload_and_initialize_all_classes(k->constants(), THREAD);
+        if (HAS_PENDING_EXCEPTION) {
+          // If something went wrong in preloading we just ignore it
+          CLEAR_PENDING_EXCEPTION;
+          tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_counter, buffer);
         }
-        bool exception_occurred = HAS_PENDING_EXCEPTION;
-        CLEAR_PENDING_EXCEPTION;
+      }
+
+      if (_compile_the_world_counter >= CompileTheWorldStartAt) {
         if (k.is_null() || (exception_occurred && !CompileTheWorldIgnoreInitErrors)) {
           // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
           tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_counter, buffer);
         } else {
           tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_counter, buffer);
           // Preload all classes to get around uncommon traps
-          if (CompileTheWorldPreloadClasses) {
-            constantPoolKlass::preload_and_initialize_all_classes(k->constants(), THREAD);
-            if (HAS_PENDING_EXCEPTION) {
-              // If something went wrong in preloading we just ignore it
-              CLEAR_PENDING_EXCEPTION;
-              tty->print_cr("Preloading failed for (%d) %s", _compile_the_world_counter, buffer);
-            }
-          }
           // Iterate over all methods in class
           for (int n = 0; n < k->methods()->length(); n++) {
             methodHandle m (THREAD, methodOop(k->methods()->obj_at(n)));
@@ -1253,16 +1256,28 @@
                 CLEAR_PENDING_EXCEPTION;
                 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string());
               }
-            if (TieredCompilation) {
-              // Clobber the first compile and force second tier compilation
-              m->clear_code();
-              CompileBroker::compile_method(m, InvocationEntryBci,
-                                            methodHandle(), 0, "CTW", THREAD);
-              if (HAS_PENDING_EXCEPTION) {
-                CLEAR_PENDING_EXCEPTION;
-                tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string());
+              if (TieredCompilation) {
+                // Clobber the first compile and force second tier compilation
+                nmethod* nm = m->code();
+                if (nm != NULL) {
+                  // Throw out the code so that the code cache doesn't fill up
+                  nm->make_not_entrant();
+                  m->clear_code();
+                }
+                CompileBroker::compile_method(m, InvocationEntryBci,
+                                              methodHandle(), 0, "CTW", THREAD);
+                if (HAS_PENDING_EXCEPTION) {
+                  CLEAR_PENDING_EXCEPTION;
+                  tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_counter, m->name()->as_C_string());
+                }
               }
             }
+
+            nmethod* nm = m->code();
+            if (nm != NULL) {
+              // Throw out the code so that the code cache doesn't fill up
+              nm->make_not_entrant();
+              m->clear_code();
             }
           }
         }
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 750ed71..248a103 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -2430,6 +2430,41 @@
 }
 
 
+// Support for sun_dyn_CallSiteImpl
+
+int sun_dyn_CallSiteImpl::_type_offset;
+int sun_dyn_CallSiteImpl::_target_offset;
+int sun_dyn_CallSiteImpl::_vmmethod_offset;
+
+void sun_dyn_CallSiteImpl::compute_offsets() {
+  if (!EnableInvokeDynamic)  return;
+  klassOop k = SystemDictionary::CallSiteImpl_klass();
+  if (k != NULL) {
+    compute_offset(_type_offset,   k, vmSymbols::type_name(),   vmSymbols::java_dyn_MethodType_signature(), true);
+    compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature(), true);
+    compute_offset(_vmmethod_offset, k, vmSymbols::vmmethod_name(), vmSymbols::object_signature(), true);
+  }
+}
+
+oop sun_dyn_CallSiteImpl::type(oop site) {
+  return site->obj_field(_type_offset);
+}
+
+oop sun_dyn_CallSiteImpl::target(oop site) {
+  return site->obj_field(_target_offset);
+}
+
+void sun_dyn_CallSiteImpl::set_target(oop site, oop target) {
+  site->obj_field_put(_target_offset, target);
+}
+
+oop sun_dyn_CallSiteImpl::vmmethod(oop site) {
+  return site->obj_field(_vmmethod_offset);
+}
+
+void sun_dyn_CallSiteImpl::set_vmmethod(oop site, oop ref) {
+  site->obj_field_put(_vmmethod_offset, ref);
+}
 
 
 // Support for java_security_AccessControlContext
@@ -2775,6 +2810,9 @@
     java_dyn_MethodType::compute_offsets();
     java_dyn_MethodTypeForm::compute_offsets();
   }
+  if (EnableInvokeDynamic) {
+    sun_dyn_CallSiteImpl::compute_offsets();
+  }
   java_security_AccessControlContext::compute_offsets();
   // Initialize reflection classes. The layouts of these classes
   // changed with the new reflection implementation in JDK 1.4, and
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index 8d699c8..51e2817 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -1060,6 +1060,33 @@
 };
 
 
+// Interface to sun.dyn.CallSiteImpl objects
+
+class sun_dyn_CallSiteImpl: AllStatic {
+  friend class JavaClasses;
+
+private:
+  static int _type_offset;
+  static int _target_offset;
+  static int _vmmethod_offset;
+
+  static void compute_offsets();
+
+public:
+  // Accessors
+  static oop            type(oop site);
+
+  static oop            target(oop site);
+  static void       set_target(oop site, oop target);
+
+  static oop            vmmethod(oop site);
+  static void       set_vmmethod(oop site, oop ref);
+
+  // Accessors for code generation:
+  static int target_offset_in_bytes()           { return _target_offset; }
+  static int type_offset_in_bytes()             { return _type_offset; }
+  static int vmmethod_offset_in_bytes()         { return _vmmethod_offset; }
+};
 
 
 // Interface to java.security.AccessControlContext objects
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index e6b4143..baec74f 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1951,6 +1951,16 @@
     // Skip the rest of the method handle classes, if MethodHandle is not loaded.
     scan = WKID(meth_group_end+1);
   }
+  WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass);
+  WKID indy_group_end   = WK_KLASS_ENUM_NAME(Dynamic_klass);
+  initialize_wk_klasses_until(indy_group_start, scan, CHECK);
+  if (EnableInvokeDynamic) {
+    initialize_wk_klasses_through(indy_group_start, scan, CHECK);
+  }
+  if (_well_known_klasses[indy_group_start] == NULL) {
+    // Skip the rest of the dynamic typing classes, if Linkage is not loaded.
+    scan = WKID(indy_group_end+1);
+  }
 
   initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
 
@@ -2367,6 +2377,76 @@
 }
 
 
+// Ask Java code to find or construct a java.dyn.CallSite for the given
+// name and signature, as interpreted relative to the given class loader.
+Handle SystemDictionary::make_dynamic_call_site(KlassHandle caller,
+                                                int caller_method_idnum,
+                                                int caller_bci,
+                                                symbolHandle name,
+                                                methodHandle mh_invdyn,
+                                                TRAPS) {
+  Handle empty;
+  // call sun.dyn.CallSiteImpl::makeSite(caller, name, mtype, cmid, cbci)
+  oop name_str_oop = StringTable::intern(name(), CHECK_(empty)); // not a handle!
+  JavaCallArguments args(Handle(THREAD, caller->java_mirror()));
+  args.push_oop(name_str_oop);
+  args.push_oop(mh_invdyn->method_handle_type());
+  args.push_int(caller_method_idnum);
+  args.push_int(caller_bci);
+  JavaValue result(T_OBJECT);
+  JavaCalls::call_static(&result,
+                         SystemDictionary::CallSiteImpl_klass(),
+                         vmSymbols::makeSite_name(), vmSymbols::makeSite_signature(),
+                         &args, CHECK_(empty));
+  oop call_site_oop = (oop) result.get_jobject();
+  sun_dyn_CallSiteImpl::set_vmmethod(call_site_oop, mh_invdyn());
+  if (TraceMethodHandles) {
+    tty->print_cr("Linked invokedynamic bci=%d site="INTPTR_FORMAT":", caller_bci, call_site_oop);
+    call_site_oop->print();
+    tty->cr();
+  }
+  return call_site_oop;
+}
+
+Handle SystemDictionary::find_bootstrap_method(KlassHandle caller,
+                                               KlassHandle search_bootstrap_klass,
+                                               TRAPS) {
+  Handle empty;
+  if (!caller->oop_is_instance())  return empty;
+
+  instanceKlassHandle ik(THREAD, caller());
+
+  if (ik->bootstrap_method() != NULL) {
+    return Handle(THREAD, ik->bootstrap_method());
+  }
+
+  // call java.dyn.Linkage::findBootstrapMethod(caller, sbk)
+  JavaCallArguments args(Handle(THREAD, ik->java_mirror()));
+  if (search_bootstrap_klass.is_null())
+    args.push_oop(Handle());
+  else
+    args.push_oop(search_bootstrap_klass->java_mirror());
+  JavaValue result(T_OBJECT);
+  JavaCalls::call_static(&result,
+                         SystemDictionary::Linkage_klass(),
+                         vmSymbols::findBootstrapMethod_name(),
+                         vmSymbols::findBootstrapMethod_signature(),
+                         &args, CHECK_(empty));
+  oop boot_method_oop = (oop) result.get_jobject();
+
+  if (boot_method_oop != NULL) {
+    // probably no race conditions, but let's be careful:
+    if (Atomic::cmpxchg_ptr(boot_method_oop, ik->adr_bootstrap_method(), NULL) == NULL)
+      ik->set_bootstrap_method(boot_method_oop);
+    else
+      boot_method_oop = ik->bootstrap_method();
+  } else {
+    boot_method_oop = ik->bootstrap_method();
+  }
+
+  return Handle(THREAD, boot_method_oop);
+}
+
 // Since the identity hash code for symbols changes when the symbols are
 // moved from the regular perm gen (hash in the mark word) to the shared
 // spaces (hash is the address), the classes loaded into the dictionary
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
index 0879143..14246e6 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
@@ -142,6 +142,12 @@
   template(MethodType_klass,             java_dyn_MethodType,            Opt) \
   template(MethodTypeForm_klass,         java_dyn_MethodTypeForm,        Opt) \
   template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \
+  template(Linkage_klass,                java_dyn_Linkage,               Opt) \
+  template(CallSite_klass,               java_dyn_CallSite,              Opt) \
+  template(CallSiteImpl_klass,           sun_dyn_CallSiteImpl,     Opt) \
+  template(Dynamic_klass,                java_dyn_Dynamic,               Opt) \
+  /* Note: MethodHandle must be first, and Dynamic last in group */           \
+                                                                              \
   template(vector_klass,                 java_util_Vector,               Pre) \
   template(hashtable_klass,              java_util_Hashtable,            Pre) \
   template(stringBuffer_klass,           java_lang_StringBuffer,         Pre) \
@@ -466,6 +472,21 @@
                                               Handle class_loader,
                                               Handle protection_domain,
                                               TRAPS);
+  // ask Java to create a dynamic call site, while linking an invokedynamic op
+  static Handle    make_dynamic_call_site(KlassHandle caller,
+                                          int caller_method_idnum,
+                                          int caller_bci,
+                                          symbolHandle name,
+                                          methodHandle mh_invoke,
+                                          TRAPS);
+
+  // coordinate with Java about bootstrap methods
+  static Handle    find_bootstrap_method(KlassHandle caller,
+                                         // This argument is non-null only when a
+                                         // classfile attribute has been found:
+                                         KlassHandle search_bootstrap_klass,
+                                         TRAPS);
+
   // Utility for printing loader "name" as part of tracing constraints
   static const char* loader_name(oop loader) {
     return ((loader) == NULL ? "<bootloader>" :
diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp
index 179de12..6e0fc7e 100644
--- a/hotspot/src/share/vm/classfile/verifier.cpp
+++ b/hotspot/src/share/vm/classfile/verifier.cpp
@@ -1174,6 +1174,7 @@
             &this_uninit, return_type, cp, CHECK_VERIFY(this));
           no_control_flow = false; break;
         case Bytecodes::_invokeinterface :
+        case Bytecodes::_invokedynamic :
           verify_invoke_instructions(
             &bcs, code_length, &current_frame,
             &this_uninit, return_type, cp, CHECK_VERIFY(this));
@@ -1895,12 +1896,23 @@
   Bytecodes::Code opcode = bcs->code();
   unsigned int types = (opcode == Bytecodes::_invokeinterface
                                 ? 1 << JVM_CONSTANT_InterfaceMethodref
+                      : opcode == Bytecodes::_invokedynamic
+                                ? 1 << JVM_CONSTANT_NameAndType
                                 : 1 << JVM_CONSTANT_Methodref);
   verify_cp_type(index, cp, types, CHECK_VERIFY(this));
 
   // Get method name and signature
-  symbolHandle method_name(THREAD, cp->name_ref_at(index));
-  symbolHandle method_sig(THREAD, cp->signature_ref_at(index));
+  symbolHandle method_name;
+  symbolHandle method_sig;
+  if (opcode == Bytecodes::_invokedynamic) {
+    int name_index = cp->name_ref_index_at(index);
+    int sig_index  = cp->signature_ref_index_at(index);
+    method_name = symbolHandle(THREAD, cp->symbol_at(name_index));
+    method_sig  = symbolHandle(THREAD, cp->symbol_at(sig_index));
+  } else {
+    method_name = symbolHandle(THREAD, cp->name_ref_at(index));
+    method_sig  = symbolHandle(THREAD, cp->signature_ref_at(index));
+  }
 
   if (!SignatureVerifier::is_valid_method_signature(method_sig)) {
     class_format_error(
@@ -1910,8 +1922,17 @@
   }
 
   // Get referenced class type
-  VerificationType ref_class_type = cp_ref_index_to_type(
-    index, cp, CHECK_VERIFY(this));
+  VerificationType ref_class_type;
+  if (opcode == Bytecodes::_invokedynamic) {
+    if (!EnableInvokeDynamic) {
+      class_format_error(
+        "invokedynamic instructions not enabled on this JVM",
+        _klass->external_name());
+      return;
+    }
+  } else {
+    ref_class_type = cp_ref_index_to_type(index, cp, CHECK_VERIFY(this));
+  }
 
   // For a small signature length, we just allocate 128 bytes instead
   // of parsing the signature once to find its size.
@@ -1970,6 +1991,14 @@
     }
   }
 
+  if (opcode == Bytecodes::_invokedynamic) {
+    address bcp = bcs->bcp();
+    if (*(bcp+3) != 0 || *(bcp+4) != 0) {
+      verify_error(bci, "Third and fourth operand bytes of invokedynamic must be zero");
+      return;
+    }
+  }
+
   if (method_name->byte_at(0) == '<') {
     // Make sure <init> can only be invoked by invokespecial
     if (opcode != Bytecodes::_invokespecial ||
@@ -1994,7 +2023,8 @@
     current_frame->pop_stack(sig_types[i], CHECK_VERIFY(this));
   }
   // Check objectref on operand stack
-  if (opcode != Bytecodes::_invokestatic) {
+  if (opcode != Bytecodes::_invokestatic &&
+      opcode != Bytecodes::_invokedynamic) {
     if (method_name() == vmSymbols::object_initializer_name()) {  // <init> method
       verify_invoke_init(bcs, ref_class_type, current_frame,
         code_length, this_uninit, cp, CHECK_VERIFY(this));
diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
index 7ed0928..7176e2e 100644
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
@@ -217,6 +217,9 @@
   template(base_name,                                 "base")                                     \
                                                                                                   \
   /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
+  template(java_dyn_Dynamic,                          "java/dyn/Dynamic")                         \
+  template(java_dyn_Linkage,                          "java/dyn/Linkage")                         \
+  template(java_dyn_CallSite,                         "java/dyn/CallSite")                        \
   template(java_dyn_MethodHandle,                     "java/dyn/MethodHandle")                    \
   template(java_dyn_MethodType,                       "java/dyn/MethodType")                      \
   template(java_dyn_WrongMethodTypeException,         "java/dyn/WrongMethodTypeException")        \
@@ -230,8 +233,13 @@
   template(sun_dyn_AdapterMethodHandle,               "sun/dyn/AdapterMethodHandle")              \
   template(sun_dyn_BoundMethodHandle,                 "sun/dyn/BoundMethodHandle")                \
   template(sun_dyn_DirectMethodHandle,                "sun/dyn/DirectMethodHandle")               \
+  template(sun_dyn_CallSiteImpl,                      "sun/dyn/CallSiteImpl")                     \
   template(makeImpl_name,                             "makeImpl") /*MethodType::makeImpl*/        \
   template(makeImpl_signature,    "(Ljava/lang/Class;[Ljava/lang/Class;ZZ)Ljava/dyn/MethodType;") \
+  template(makeSite_name,                             "makeSite") /*CallSiteImpl::makeImpl*/       \
+  template(makeSite_signature,    "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;II)Ljava/dyn/CallSite;") \
+  template(findBootstrapMethod_name,                  "findBootstrapMethod")                      \
+  template(findBootstrapMethod_signature, "(Ljava/lang/Class;Ljava/lang/Class;)Ljava/dyn/MethodHandle;") \
   NOT_LP64(  do_alias(machine_word_signature,         int_signature)  )                           \
   LP64_ONLY( do_alias(machine_word_signature,         long_signature) )                           \
                                                                                                   \
@@ -308,9 +316,11 @@
   template(bitCount_name,                             "bitCount")                                 \
   template(profile_name,                              "profile")                                  \
   template(equals_name,                               "equals")                                   \
+  template(target_name,                               "target")                                   \
   template(toString_name,                             "toString")                                 \
   template(values_name,                               "values")                                   \
   template(receiver_name,                             "receiver")                                 \
+  template(vmmethod_name,                             "vmmethod")                                 \
   template(vmtarget_name,                             "vmtarget")                                 \
   template(vmentry_name,                              "vmentry")                                  \
   template(vmslots_name,                              "vmslots")                                  \
diff --git a/hotspot/src/share/vm/includeDB_compiler1 b/hotspot/src/share/vm/includeDB_compiler1
index 3ea09fd..af25216 100644
--- a/hotspot/src/share/vm/includeDB_compiler1
+++ b/hotspot/src/share/vm/includeDB_compiler1
@@ -270,6 +270,7 @@
 
 c1_LinearScan.cpp                       bitMap.inline.hpp
 c1_LinearScan.cpp                       c1_CFGPrinter.hpp
+c1_LinearScan.cpp                       c1_CodeStubs.hpp
 c1_LinearScan.cpp                       c1_Compilation.hpp
 c1_LinearScan.cpp                       c1_FrameMap.hpp
 c1_LinearScan.cpp                       c1_IR.hpp
diff --git a/hotspot/src/share/vm/includeDB_core b/hotspot/src/share/vm/includeDB_core
index 2dac61f..f595248 100644
--- a/hotspot/src/share/vm/includeDB_core
+++ b/hotspot/src/share/vm/includeDB_core
@@ -4102,6 +4102,7 @@
 templateTable_<arch_model>.cpp          interpreterRuntime.hpp
 templateTable_<arch_model>.cpp          interpreter.hpp
 templateTable_<arch_model>.cpp          methodDataOop.hpp
+templateTable_<arch_model>.cpp          methodHandles.hpp
 templateTable_<arch_model>.cpp          objArrayKlass.hpp
 templateTable_<arch_model>.cpp          oop.inline.hpp
 templateTable_<arch_model>.cpp          sharedRuntime.hpp
diff --git a/hotspot/src/share/vm/includeDB_gc_parallel b/hotspot/src/share/vm/includeDB_gc_parallel
index ffc8a78..5f089b7 100644
--- a/hotspot/src/share/vm/includeDB_gc_parallel
+++ b/hotspot/src/share/vm/includeDB_gc_parallel
@@ -42,6 +42,12 @@
 constantPoolKlass.cpp                   psScavenge.inline.hpp
 constantPoolKlass.cpp                   parOopClosures.inline.hpp
 
+cpCacheKlass.cpp                        cardTableRS.hpp
+cpCacheKlass.cpp                        oop.pcgc.inline.hpp
+cpCacheKlass.cpp                        psPromotionManager.inline.hpp
+cpCacheKlass.cpp                        psScavenge.inline.hpp
+cpCacheKlass.cpp                        parOopClosures.inline.hpp
+
 genCollectedHeap.cpp                    concurrentMarkSweepThread.hpp
 genCollectedHeap.cpp                    vmCMSOperations.hpp
 
diff --git a/hotspot/src/share/vm/includeDB_jvmti b/hotspot/src/share/vm/includeDB_jvmti
index b6b4ee5..ba6dc9b 100644
--- a/hotspot/src/share/vm/includeDB_jvmti
+++ b/hotspot/src/share/vm/includeDB_jvmti
@@ -28,6 +28,7 @@
 jvmtiClassFileReconstituter.cpp         bytes_<arch>.hpp
 jvmtiClassFileReconstituter.cpp         jvmtiClassFileReconstituter.hpp
 jvmtiClassFileReconstituter.cpp         symbolTable.hpp
+jvmtiClassFileReconstituter.cpp         signature.hpp
 
 jvmtiClassFileReconstituter.hpp         jvmtiEnv.hpp
 
diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
index 782a91b..260288b 100644
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp
@@ -217,6 +217,73 @@
             stackElementSize()) + tag_offset_in_bytes();
   }
 
+  // access to stacked values according to type:
+  static oop* oop_addr_in_slot(intptr_t* slot_addr) {
+    return (oop*) slot_addr;
+  }
+  static jint* int_addr_in_slot(intptr_t* slot_addr) {
+    if ((int) sizeof(jint) < wordSize && !Bytes::is_Java_byte_ordering_different())
+      // big-endian LP64
+      return (jint*)(slot_addr + 1) - 1;
+    else
+      return (jint*) slot_addr;
+  }
+  static jlong long_in_slot(intptr_t* slot_addr) {
+    if (sizeof(intptr_t) >= sizeof(jlong)) {
+      return *(jlong*) slot_addr;
+    } else if (!TaggedStackInterpreter) {
+      return Bytes::get_native_u8((address)slot_addr);
+    } else {
+      assert(sizeof(intptr_t) * 2 == sizeof(jlong), "ILP32");
+      // assemble the long in memory order (not arithmetic order)
+      union { jlong j; jint i[2]; } u;
+      u.i[0] = (jint) slot_addr[0*stackElementSize()];
+      u.i[1] = (jint) slot_addr[1*stackElementSize()];
+      return u.j;
+    }
+  }
+  static void set_long_in_slot(intptr_t* slot_addr, jlong value) {
+    if (sizeof(intptr_t) >= sizeof(jlong)) {
+      *(jlong*) slot_addr = value;
+    } else if (!TaggedStackInterpreter) {
+      Bytes::put_native_u8((address)slot_addr, value);
+    } else {
+      assert(sizeof(intptr_t) * 2 == sizeof(jlong), "ILP32");
+      // assemble the long in memory order (not arithmetic order)
+      union { jlong j; jint i[2]; } u;
+      u.j = value;
+      slot_addr[0*stackElementSize()] = (intptr_t) u.i[0];
+      slot_addr[1*stackElementSize()] = (intptr_t) u.i[1];
+    }
+  }
+  static void get_jvalue_in_slot(intptr_t* slot_addr, BasicType type, jvalue* value) {
+    switch (type) {
+    case T_BOOLEAN: value->z = *int_addr_in_slot(slot_addr);            break;
+    case T_CHAR:    value->c = *int_addr_in_slot(slot_addr);            break;
+    case T_BYTE:    value->b = *int_addr_in_slot(slot_addr);            break;
+    case T_SHORT:   value->s = *int_addr_in_slot(slot_addr);            break;
+    case T_INT:     value->i = *int_addr_in_slot(slot_addr);            break;
+    case T_LONG:    value->j = long_in_slot(slot_addr);                 break;
+    case T_FLOAT:   value->f = *(jfloat*)int_addr_in_slot(slot_addr);   break;
+    case T_DOUBLE:  value->d = jdouble_cast(long_in_slot(slot_addr));   break;
+    case T_OBJECT:  value->l = (jobject)*oop_addr_in_slot(slot_addr);   break;
+    default:        ShouldNotReachHere();
+    }
+  }
+  static void set_jvalue_in_slot(intptr_t* slot_addr, BasicType type, jvalue* value) {
+    switch (type) {
+    case T_BOOLEAN: *int_addr_in_slot(slot_addr) = (value->z != 0);     break;
+    case T_CHAR:    *int_addr_in_slot(slot_addr) = value->c;            break;
+    case T_BYTE:    *int_addr_in_slot(slot_addr) = value->b;            break;
+    case T_SHORT:   *int_addr_in_slot(slot_addr) = value->s;            break;
+    case T_INT:     *int_addr_in_slot(slot_addr) = value->i;            break;
+    case T_LONG:    set_long_in_slot(slot_addr, value->j);              break;
+    case T_FLOAT:   *(jfloat*)int_addr_in_slot(slot_addr) = value->f;   break;
+    case T_DOUBLE:  set_long_in_slot(slot_addr, jlong_cast(value->d));  break;
+    case T_OBJECT:  *oop_addr_in_slot(slot_addr) = (oop) value->l;      break;
+    default:        ShouldNotReachHere();
+    }
+  }
 };
 
 //------------------------------------------------------------------------------------------------------------------------
diff --git a/hotspot/src/share/vm/interpreter/bytecode.cpp b/hotspot/src/share/vm/interpreter/bytecode.cpp
index ea46acb..f91d566 100644
--- a/hotspot/src/share/vm/interpreter/bytecode.cpp
+++ b/hotspot/src/share/vm/interpreter/bytecode.cpp
@@ -34,12 +34,6 @@
 }
 
 
-void Bytecode::set_fast_index(int i) {
-  assert(0 <= i && i < 0x10000, "illegal index value");
-  Bytes::put_native_u2(addr_at(1), (jushort)i);
-}
-
-
 bool Bytecode::check_must_rewrite() const {
   assert(Bytecodes::can_rewrite(code()), "post-check only");
 
@@ -118,7 +112,12 @@
 
 
 int Bytecode_invoke::index() const {
-  return Bytes::get_Java_u2(bcp() + 1);
+  // Note:  Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4,
+  // at the same time it allocates per-call-site CP cache entries.
+  if (has_giant_index())
+    return Bytes::get_native_u4(bcp() + 1);
+  else
+    return Bytes::get_Java_u2(bcp() + 1);
 }
 
 
diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp
index b9f65b2..64941d8 100644
--- a/hotspot/src/share/vm/interpreter/bytecode.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp
@@ -65,14 +65,6 @@
 // The base class for different kinds of bytecode abstractions.
 // Provides the primitive operations to manipulate code relative
 // to an objects 'this' pointer.
-//
-// Note: Even though it seems that the fast_index & set_fast_index
-//       functions are machine specific, they're not. They only use
-//       the natural way to store a 16bit index on a given machine,
-//       independent of the particular byte ordering. Since all other
-//       places in the system that refer to these indices use the
-//       same method (the natural byte ordering on the platform)
-//       this will always work and be machine-independent).
 
 class Bytecode: public ThisRelativeObj {
  protected:
@@ -83,24 +75,40 @@
   // Attributes
   address bcp() const                            { return addr_at(0); }
   address next_bcp() const                       { return addr_at(0) + Bytecodes::length_at(bcp()); }
+  int instruction_size() const                   { return Bytecodes::length_at(bcp()); }
 
   Bytecodes::Code code() const                   { return Bytecodes::code_at(addr_at(0)); }
   Bytecodes::Code java_code() const              { return Bytecodes::java_code(code()); }
   bool must_rewrite() const                      { return Bytecodes::can_rewrite(code()) && check_must_rewrite(); }
   bool is_active_breakpoint() const              { return Bytecodes::is_active_breakpoint_at(bcp()); }
 
-  int     one_byte_index() const                 { return byte_at(1); }
-  int     two_byte_index() const                 { return (byte_at(1) << 8) + byte_at(2); }
+  int     one_byte_index() const                 { assert_index_size(1); return byte_at(1); }
+  int     two_byte_index() const                 { assert_index_size(2); return (byte_at(1) << 8) + byte_at(2); }
+
   int     offset() const                         { return (two_byte_index() << 16) >> 16; }
   address destination() const                    { return bcp() + offset(); }
-  int     fast_index() const                     { return Bytes::get_native_u2(addr_at(1)); }
 
   // Attribute modification
   void    set_code(Bytecodes::Code code);
-  void    set_fast_index(int i);
 
   // Creation
   inline friend Bytecode* Bytecode_at(address bcp);
+
+ private:
+  void assert_index_size(int required_size) const {
+#ifdef ASSERT
+    int isize = instruction_size() - 1;
+    if (isize == 2 && code() == Bytecodes::_iinc)
+      isize = 1;
+    else if (isize <= 2)
+      ;                         // no change
+    else if (code() == Bytecodes::_invokedynamic)
+      isize = 4;
+    else
+      isize = 2;
+    assert(isize = required_size, "wrong index size");
+#endif
+  }
 };
 
 inline Bytecode* Bytecode_at(address bcp) {
@@ -195,6 +203,9 @@
   bool is_invokevirtual() const                  { return adjusted_invoke_code() == Bytecodes::_invokevirtual; }
   bool is_invokestatic() const                   { return adjusted_invoke_code() == Bytecodes::_invokestatic; }
   bool is_invokespecial() const                  { return adjusted_invoke_code() == Bytecodes::_invokespecial; }
+  bool is_invokedynamic() const                  { return adjusted_invoke_code() == Bytecodes::_invokedynamic; }
+
+  bool has_giant_index() const                   { return is_invokedynamic(); }
 
   bool is_valid() const                          { return is_invokeinterface() ||
                                                           is_invokevirtual()   ||
diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
index 3616c9d..7a3a012 100644
--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp
@@ -109,6 +109,7 @@
 
   Bytecodes::Code code() const                   { return _code; }
   bool            is_wide() const                { return _is_wide; }
+  int             instruction_size() const       { return (_next_bci - _bci); }
   bool            is_last_bytecode() const       { return _next_bci >= _end_bci; }
 
   address         bcp() const                    { return method()->code_base() + _bci; }
@@ -122,8 +123,29 @@
   int             dest_w() const                 { return bci() + (int  )Bytes::get_Java_u4(bcp() + 1); }
 
   // Unsigned indices, widening
-  int             get_index() const              { return (is_wide()) ? Bytes::get_Java_u2(bcp() + 2) : bcp()[1]; }
-  int             get_index_big() const          { return (int)Bytes::get_Java_u2(bcp() + 1);  }
+  int             get_index() const              { assert_index_size(is_wide() ? 2 : 1);
+                                                   return (is_wide()) ? Bytes::get_Java_u2(bcp() + 2) : bcp()[1]; }
+  int             get_index_big() const          { assert_index_size(2);
+                                                   return (int)Bytes::get_Java_u2(bcp() + 1);  }
+  int             get_index_int() const          { return has_giant_index() ? get_index_giant() : get_index_big(); }
+  int             get_index_giant() const        { assert_index_size(4); return Bytes::get_native_u4(bcp() + 1); }
+  int             has_giant_index() const        { return (code() == Bytecodes::_invokedynamic); }
+
+ private:
+  void assert_index_size(int required_size) const {
+#ifdef ASSERT
+    int isize = instruction_size() - (int)_is_wide - 1;
+    if (isize == 2 && code() == Bytecodes::_iinc)
+      isize = 1;
+    else if (isize <= 2)
+      ;                         // no change
+    else if (has_giant_index())
+      isize = 4;
+    else
+      isize = 2;
+    assert(isize = required_size, "wrong index size");
+#endif
+  }
 };
 
 // In BytecodeStream, non-java bytecodes will be translated into the
diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp
index 7ac0eaf..ed21686 100644
--- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp
+++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp
@@ -48,12 +48,15 @@
 
   int       get_index()              { return *(address)_next_pc++; }
   int       get_big_index()          { int i=Bytes::get_Java_u2(_next_pc); _next_pc+=2; return i; }
+  int       get_giant_index()        { int i=Bytes::get_native_u4(_next_pc); _next_pc+=4; return i; }
   int       get_index_special()      { return (is_wide()) ? get_big_index() : get_index(); }
   methodOop method()                 { return _current_method; }
   bool      is_wide()                { return _is_wide; }
 
 
+  bool      check_index(int i, bool in_cp_cache, int& cp_index, outputStream* st = tty);
   void      print_constant(int i, outputStream* st = tty);
+  void      print_field_or_method(int i, outputStream* st = tty);
   void      print_attributes(Bytecodes::Code code, int bci, outputStream* st = tty);
   void      bytecode_epilog(int bci, outputStream* st = tty);
 
@@ -182,7 +185,71 @@
   }
 }
 
+bool BytecodePrinter::check_index(int i, bool in_cp_cache, int& cp_index, outputStream* st) {
+  constantPoolOop constants = method()->constants();
+  int ilimit = constants->length(), climit = 0;
+
+  constantPoolCacheOop cache = NULL;
+  if (in_cp_cache) {
+    cache = constants->cache();
+    if (cache != NULL) {
+      //climit = cache->length();  // %%% private!
+      size_t size = cache->size() * HeapWordSize;
+      size -= sizeof(constantPoolCacheOopDesc);
+      size /= sizeof(ConstantPoolCacheEntry);
+      climit = (int) size;
+    }
+  }
+
+  if (in_cp_cache && constantPoolCacheOopDesc::is_secondary_index(i)) {
+    i = constantPoolCacheOopDesc::decode_secondary_index(i);
+    st->print(" secondary cache[%d] of", i);
+    if (i >= 0 && i < climit) {
+      if (!cache->entry_at(i)->is_secondary_entry()) {
+        st->print_cr(" not secondary entry?", i);
+        return false;
+      }
+      i = cache->entry_at(i)->main_entry_index();
+      goto check_cache_index;
+    } else {
+      st->print_cr(" not in cache[*]?", i);
+      return false;
+    }
+  }
+
+  if (cache != NULL) {
+    i = Bytes::swap_u2(i);
+    if (WizardMode)  st->print(" (swap=%d)", i);
+    goto check_cache_index;
+  }
+
+ check_cp_index:
+  if (i >= 0 && i < ilimit) {
+    if (WizardMode)  st->print(" cp[%d]", i);
+    cp_index = i;
+    return true;
+  }
+
+  st->print_cr(" CP[%d] not in CP", i);
+  return false;
+
+ check_cache_index:
+  if (i >= 0 && i < climit) {
+    if (cache->entry_at(i)->is_secondary_entry()) {
+      st->print_cr(" secondary entry?");
+      return false;
+    }
+    i = cache->entry_at(i)->constant_pool_index();
+    goto check_cp_index;
+  }
+  st->print_cr(" not in CP[*]?", i);
+  return false;
+}
+
 void BytecodePrinter::print_constant(int i, outputStream* st) {
+  int orig_i = i;
+  if (!check_index(orig_i, false, i, st))  return;
+
   constantPoolOop constants = method()->constants();
   constantTag tag = constants->tag_at(i);
 
@@ -203,7 +270,31 @@
     st->print_cr(" %s", constants->resolved_klass_at(i)->klass_part()->external_name());
   } else if (tag.is_unresolved_klass()) {
     st->print_cr(" <unresolved klass at %d>", i);
-  } else ShouldNotReachHere();
+  } else {
+    st->print_cr(" bad tag=%d at %d", tag.value(), i);
+  }
+}
+
+void BytecodePrinter::print_field_or_method(int i, outputStream* st) {
+  int orig_i = i;
+  if (!check_index(orig_i, true, i, st))  return;
+
+  constantPoolOop constants = method()->constants();
+  constantTag tag = constants->tag_at(i);
+
+  switch (tag.value()) {
+  case JVM_CONSTANT_InterfaceMethodref:
+  case JVM_CONSTANT_Methodref:
+  case JVM_CONSTANT_Fieldref:
+    break;
+  default:
+    st->print_cr(" bad tag=%d at %d", tag.value(), i);
+    return;
+  }
+
+  symbolOop name = constants->name_ref_at(orig_i);
+  symbolOop signature = constants->signature_ref_at(orig_i);
+  st->print_cr(" %d <%s> <%s> ", i, name->as_C_string(), signature->as_C_string());
 }
 
 
@@ -354,36 +445,28 @@
     case Bytecodes::_putstatic:
     case Bytecodes::_getstatic:
     case Bytecodes::_putfield:
-    case Bytecodes::_getfield: {
-        int i = get_big_index();
-        constantPoolOop constants = method()->constants();
-        symbolOop field = constants->name_ref_at(i);
-        st->print_cr(" %d <%s>", i, field->as_C_string());
-      }
+    case Bytecodes::_getfield:
+      print_field_or_method(get_big_index(), st);
       break;
 
     case Bytecodes::_invokevirtual:
     case Bytecodes::_invokespecial:
     case Bytecodes::_invokestatic:
-      { int i = get_big_index();
-        constantPoolOop constants = method()->constants();
-        symbolOop name = constants->name_ref_at(i);
-        symbolOop signature = constants->signature_ref_at(i);
-        st->print_cr(" %d <%s> <%s> ", i, name->as_C_string(), signature->as_C_string());
-      }
+      print_field_or_method(get_big_index(), st);
       break;
 
     case Bytecodes::_invokeinterface:
       { int i = get_big_index();
         int n = get_index();
-        get_index();
-        constantPoolOop constants = method()->constants();
-        symbolOop name = constants->name_ref_at(i);
-        symbolOop signature = constants->signature_ref_at(i);
-        st->print_cr(" %d <%s> <%s> %d", i, name->as_C_string(), signature->as_C_string(), n);
+        get_index();            // ignore zero byte
+        print_field_or_method(i, st);
       }
       break;
 
+    case Bytecodes::_invokedynamic:
+      print_field_or_method(get_giant_index(), st);
+      break;
+
     case Bytecodes::_new:
     case Bytecodes::_checkcast:
     case Bytecodes::_instanceof:
diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp
index 5f87594..56a89b3 100644
--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp
+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp
@@ -357,7 +357,7 @@
   def(_invokespecial       , "invokespecial"       , "bjj"  , NULL    , T_ILLEGAL, -1, true);
   def(_invokestatic        , "invokestatic"        , "bjj"  , NULL    , T_ILLEGAL,  0, true);
   def(_invokeinterface     , "invokeinterface"     , "bjj__", NULL    , T_ILLEGAL, -1, true);
-  def(_xxxunusedxxx        , "xxxunusedxxx"        , NULL   , NULL    , T_VOID   ,  0, false);
+  def(_invokedynamic       , "invokedynamic"       , "bjjjj", NULL    , T_ILLEGAL, -1, true );
   def(_new                 , "new"                 , "bii"  , NULL    , T_OBJECT ,  1, true );
   def(_newarray            , "newarray"            , "bc"   , NULL    , T_OBJECT ,  0, true );
   def(_anewarray           , "anewarray"           , "bii"  , NULL    , T_OBJECT ,  0, true );
diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp
index 609591c..bf88872 100644
--- a/hotspot/src/share/vm/interpreter/bytecodes.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp
@@ -218,7 +218,7 @@
     _invokespecial        = 183, // 0xb7
     _invokestatic         = 184, // 0xb8
     _invokeinterface      = 185, // 0xb9
-    _xxxunusedxxx         = 186, // 0xba
+    _invokedynamic        = 186, // 0xba     // if EnableInvokeDynamic
     _new                  = 187, // 0xbb
     _newarray             = 188, // 0xbc
     _anewarray            = 189, // 0xbd
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
index 5d4a164..f50fd2b 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -681,6 +681,133 @@
 IRT_END
 
 
+// First time execution:  Resolve symbols, create a permanent CallSiteImpl object.
+IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
+  ResourceMark rm(thread);
+
+  assert(EnableInvokeDynamic, "");
+
+  const Bytecodes::Code bytecode = Bytecodes::_invokedynamic;
+
+  methodHandle caller_method(thread, method(thread));
+
+  // first determine if there is a bootstrap method
+  {
+    KlassHandle caller_klass(thread, caller_method->method_holder());
+    Handle bootm = SystemDictionary::find_bootstrap_method(caller_klass, KlassHandle(), CHECK);
+    if (bootm.is_null()) {
+      // If there is no bootstrap method, throw IncompatibleClassChangeError.
+      // This is a valid generic error type for resolution (JLS 12.3.3).
+      char buf[200];
+      jio_snprintf(buf, sizeof(buf), "Class %s has not declared a bootstrap method for invokedynamic",
+                   (Klass::cast(caller_klass()))->external_name());
+      THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+    }
+  }
+
+  constantPoolHandle pool(thread, caller_method->constants());
+  pool->set_invokedynamic();    // mark header to flag active call sites
+
+  int raw_index = four_byte_index(thread);
+  assert(constantPoolCacheOopDesc::is_secondary_index(raw_index), "invokedynamic indexes marked specially");
+
+  // there are two CPC entries that are of interest:
+  int site_index = constantPoolCacheOopDesc::decode_secondary_index(raw_index);
+  int main_index = pool->cache()->entry_at(site_index)->main_entry_index();
+  // and there is one CP entry, a NameAndType:
+  int nt_index = pool->map_instruction_operand_to_index(raw_index);
+
+  // first resolve the signature to a MH.invoke methodOop
+  if (!pool->cache()->entry_at(main_index)->is_resolved(bytecode)) {
+    JvmtiHideSingleStepping jhss(thread);
+    CallInfo info;
+    LinkResolver::resolve_invoke(info, Handle(), pool,
+                                 raw_index, bytecode, CHECK);
+    // The main entry corresponds to a JVM_CONSTANT_NameAndType, and serves
+    // as a common reference point for all invokedynamic call sites with
+    // that exact call descriptor.  We will link it in the CP cache exactly
+    // as if it were an invokevirtual of MethodHandle.invoke.
+    pool->cache()->entry_at(main_index)->set_method(
+      bytecode,
+      info.resolved_method(),
+      info.vtable_index());
+    assert(pool->cache()->entry_at(main_index)->is_vfinal(), "f2 must be a methodOop");
+  }
+
+  // The method (f2 entry) of the main entry is the MH.invoke for the
+  // invokedynamic target call signature.
+  intptr_t f2_value = pool->cache()->entry_at(main_index)->f2();
+  methodHandle mh_invdyn(THREAD, (methodOop) f2_value);
+  assert(mh_invdyn.not_null() && mh_invdyn->is_method() && mh_invdyn->is_method_handle_invoke(),
+         "correct result from LinkResolver::resolve_invokedynamic");
+
+  symbolHandle call_site_name(THREAD, pool->nt_name_ref_at(nt_index));
+  Handle call_site
+    = SystemDictionary::make_dynamic_call_site(caller_method->method_holder(),
+                                               caller_method->method_idnum(),
+                                               caller_method->bci_from(bcp(thread)),
+                                               call_site_name,
+                                               mh_invdyn,
+                                               CHECK);
+
+  // In the secondary entry, the f1 field is the call site, and the f2 (index)
+  // field is some data about the invoke site.
+  int extra_data = 0;
+  pool->cache()->entry_at(site_index)->set_dynamic_call(call_site(), extra_data);
+}
+IRT_END
+
+
+// Called on first time execution, and also whenever the CallSite.target is null.
+// FIXME:  Do more of this in Java code.
+IRT_ENTRY(void, InterpreterRuntime::bootstrap_invokedynamic(JavaThread* thread, oopDesc* call_site)) {
+  methodHandle   mh_invdyn(thread, (methodOop) sun_dyn_CallSiteImpl::vmmethod(call_site));
+  Handle         mh_type(thread,   mh_invdyn->method_handle_type());
+  objArrayHandle mh_ptypes(thread, java_dyn_MethodType::ptypes(mh_type()));
+
+  // squish the arguments down to a single array
+  int nargs = mh_ptypes->length();
+  objArrayHandle arg_array;
+  {
+    objArrayOop aaoop = oopFactory::new_objArray(SystemDictionary::object_klass(), nargs, CHECK);
+    arg_array = objArrayHandle(thread, aaoop);
+  }
+  frame fr = thread->last_frame();
+  assert(fr.interpreter_frame_bcp() != NULL, "sanity");
+  int tos_offset = 0;
+  for (int i = nargs; --i >= 0; ) {
+    intptr_t* slot_addr = fr.interpreter_frame_tos_at(tos_offset++);
+    oop ptype = mh_ptypes->obj_at(i);
+    oop arg = NULL;
+    if (!java_lang_Class::is_primitive(ptype)) {
+      arg = *(oop*) slot_addr;
+    } else {
+      BasicType bt = java_lang_Class::primitive_type(ptype);
+      assert(frame::interpreter_frame_expression_stack_direction() < 0, "else reconsider this code");
+      jvalue value;
+      Interpreter::get_jvalue_in_slot(slot_addr, bt, &value);
+      tos_offset += type2size[bt]-1;
+      arg = java_lang_boxing_object::create(bt, &value, CHECK);
+      // FIXME:  These boxing objects are not canonicalized under
+      // the Java autoboxing rules.  They should be...
+      // The best approach would be to push the arglist creation into Java.
+      // The JVM should use a lower-level interface to communicate argument lists.
+    }
+    arg_array->obj_at_put(i, arg);
+  }
+
+  // now find the bootstrap method
+  oop bootstrap_mh_oop = instanceKlass::cast(fr.interpreter_frame_method()->method_holder())->bootstrap_method();
+  assert(bootstrap_mh_oop != NULL, "resolve_invokedynamic ensures a BSM");
+
+  // return the bootstrap method and argument array via vm_result/_2
+  thread->set_vm_result(bootstrap_mh_oop);
+  thread->set_vm_result_2(arg_array());
+}
+IRT_END
+
+
+
 //------------------------------------------------------------------------------------------------------------------------
 // Miscellaneous
 
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
index 1c05bc9..bfc7569 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
@@ -42,8 +42,11 @@
   static bool      already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); }
   static int       one_byte_index(JavaThread *thread)   { return bcp(thread)[1]; }
   static int       two_byte_index(JavaThread *thread)   { return Bytes::get_Java_u2(bcp(thread) + 1); }
+  static int       four_byte_index(JavaThread *thread)  { return Bytes::get_native_u4(bcp(thread) + 1); }
   static int       number_of_dimensions(JavaThread *thread)  { return bcp(thread)[3]; }
-  static ConstantPoolCacheEntry* cache_entry(JavaThread *thread)  { return method(thread)->constants()->cache()->entry_at(Bytes::get_native_u2(bcp(thread) + 1)); }
+
+  static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i)  { return method(thread)->constants()->cache()->entry_at(i); }
+  static ConstantPoolCacheEntry* cache_entry(JavaThread *thread)            { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); }
   static void      note_trap(JavaThread *thread, int reason, TRAPS);
 
  public:
@@ -83,7 +86,9 @@
   static void    new_illegal_monitor_state_exception(JavaThread* thread);
 
   // Calls
-  static void    resolve_invoke     (JavaThread* thread, Bytecodes::Code bytecode);
+  static void    resolve_invoke       (JavaThread* thread, Bytecodes::Code bytecode);
+  static void    resolve_invokedynamic(JavaThread* thread);
+  static void  bootstrap_invokedynamic(JavaThread* thread, oopDesc* call_site);
 
   // Breakpoints
   static void _breakpoint(JavaThread* thread, methodOopDesc* method, address bcp);
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
index 05cd97b..c9a2c13c 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
@@ -947,6 +947,7 @@
     case Bytecodes::_invokestatic   : resolve_invokestatic   (result,       pool, index, CHECK); break;
     case Bytecodes::_invokespecial  : resolve_invokespecial  (result,       pool, index, CHECK); break;
     case Bytecodes::_invokevirtual  : resolve_invokevirtual  (result, recv, pool, index, CHECK); break;
+    case Bytecodes::_invokedynamic  : resolve_invokedynamic  (result,       pool, index, CHECK); break;
     case Bytecodes::_invokeinterface: resolve_invokeinterface(result, recv, pool, index, CHECK); break;
   }
   return;
@@ -1008,6 +1009,30 @@
   resolve_interface_call(result, recv, recvrKlass, resolved_klass, method_name, method_signature, current_klass, true, true, CHECK);
 }
 
+
+void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle pool, int raw_index, TRAPS) {
+  assert(EnableInvokeDynamic, "");
+
+  // This guy is reached from InterpreterRuntime::resolve_invokedynamic.
+
+  assert(constantPoolCacheOopDesc::is_secondary_index(raw_index), "must be secondary index");
+  int nt_index = pool->map_instruction_operand_to_index(raw_index);
+
+  // At this point, we only need the signature, and can ignore the name.
+  symbolHandle method_signature(THREAD, pool->nt_signature_ref_at(nt_index));
+  symbolHandle method_name = vmSymbolHandles::invoke_name();
+  KlassHandle resolved_klass = SystemDictionaryHandles::MethodHandle_klass();
+
+  // JSR 292:  this must be an implicitly generated method MethodHandle.invoke(*...)
+  // The extra MH receiver will be inserted into the stack on every call.
+  methodHandle resolved_method;
+  lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, CHECK);
+  if (resolved_method.is_null()) {
+    THROW(vmSymbols::java_lang_InternalError());
+  }
+  result.set_virtual(resolved_klass, KlassHandle(), resolved_method, resolved_method, resolved_method->vtable_index(), CHECK);
+}
+
 //------------------------------------------------------------------------------------------------------------------------
 #ifndef PRODUCT
 
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp
index f52197b..a95873b 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.hpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp
@@ -167,6 +167,7 @@
   static void resolve_invokespecial  (CallInfo& result,              constantPoolHandle pool, int index, TRAPS);
   static void resolve_invokevirtual  (CallInfo& result, Handle recv, constantPoolHandle pool, int index, TRAPS);
   static void resolve_invokeinterface(CallInfo& result, Handle recv, constantPoolHandle pool, int index, TRAPS);
+  static void resolve_invokedynamic  (CallInfo& result,              constantPoolHandle pool, int index, TRAPS);
 
   static void resolve_invoke         (CallInfo& result, Handle recv, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS);
 };
diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp
index 7781538..b2451cd 100644
--- a/hotspot/src/share/vm/interpreter/rewriter.cpp
+++ b/hotspot/src/share/vm/interpreter/rewriter.cpp
@@ -25,39 +25,50 @@
 # include "incls/_precompiled.incl"
 # include "incls/_rewriter.cpp.incl"
 
-
-// Computes an index_map (new_index -> original_index) for contant pool entries
+// Computes a CPC map (new_index -> original_index) for constant pool entries
 // that are referred to by the interpreter at runtime via the constant pool cache.
-void Rewriter::compute_index_maps(constantPoolHandle pool, intArray*& index_map, intStack*& inverse_index_map) {
-  const int length  = pool->length();
-  index_map         = new intArray(length, -1);
-  // Choose an initial value large enough that we don't get frequent
-  // calls to grow().
-  inverse_index_map = new intStack(length / 2);
+// Also computes a CP map (original_index -> new_index).
+// Marks entries in CP which require additional processing.
+void Rewriter::compute_index_maps() {
+  const int length  = _pool->length();
+  init_cp_map(length);
   for (int i = 0; i < length; i++) {
-    switch (pool->tag_at(i).value()) {
+    int tag = _pool->tag_at(i).value();
+    switch (tag) {
+      case JVM_CONSTANT_InterfaceMethodref:
       case JVM_CONSTANT_Fieldref          : // fall through
       case JVM_CONSTANT_Methodref         : // fall through
-      case JVM_CONSTANT_InterfaceMethodref: {
-        index_map->at_put(i, inverse_index_map->length());
-        inverse_index_map->append(i);
-      }
+        add_cp_cache_entry(i);
+        break;
     }
   }
+
+  guarantee((int)_cp_cache_map.length()-1 <= (int)((u2)-1),
+            "all cp cache indexes fit in a u2");
 }
 
 
-// Creates a constant pool cache given an inverse_index_map
+int Rewriter::add_extra_cp_cache_entry(int main_entry) {
+  // Hack: We put it on the map as an encoded value.
+  // The only place that consumes this is ConstantPoolCacheEntry::set_initial_state
+  int encoded = constantPoolCacheOopDesc::encode_secondary_index(main_entry);
+  int plain_secondary_index = _cp_cache_map.append(encoded);
+  return constantPoolCacheOopDesc::encode_secondary_index(plain_secondary_index);
+}
+
+
+
+// Creates a constant pool cache given a CPC map
 // This creates the constant pool cache initially in a state
 // that is unsafe for concurrent GC processing but sets it to
 // a safe mode before the constant pool cache is returned.
-constantPoolCacheHandle Rewriter::new_constant_pool_cache(intArray& inverse_index_map, TRAPS) {
-  const int length = inverse_index_map.length();
-  constantPoolCacheOop cache = oopFactory::new_constantPoolCache(length,
-                                             methodOopDesc::IsUnsafeConc,
-                                             CHECK_(constantPoolCacheHandle()));
-  cache->initialize(inverse_index_map);
-  return constantPoolCacheHandle(THREAD, cache);
+void Rewriter::make_constant_pool_cache(TRAPS) {
+  const int length = _cp_cache_map.length();
+  constantPoolCacheOop cache =
+      oopFactory::new_constantPoolCache(length, methodOopDesc::IsUnsafeConc, CHECK);
+  cache->initialize(_cp_cache_map);
+  _pool->set_cache(cache);
+  cache->set_constant_pool(_pool());
 }
 
 
@@ -101,8 +112,38 @@
 }
 
 
+// Rewrite a classfile-order CP index into a native-order CPC index.
+int Rewriter::rewrite_member_reference(address bcp, int offset) {
+  address p = bcp + offset;
+  int  cp_index    = Bytes::get_Java_u2(p);
+  int  cache_index = cp_entry_to_cp_cache(cp_index);
+  Bytes::put_native_u2(p, cache_index);
+  return cp_index;
+}
+
+
+void Rewriter::rewrite_invokedynamic(address bcp, int offset, int delete_me) {
+  address p = bcp + offset;
+  assert(p[-1] == Bytecodes::_invokedynamic, "");
+  int cp_index = Bytes::get_Java_u2(p);
+  int cpc  = maybe_add_cp_cache_entry(cp_index);  // add lazily
+  int cpc2 = add_extra_cp_cache_entry(cpc);
+
+  // Replace the trailing four bytes with a CPC index for the dynamic
+  // call site.  Unlike other CPC entries, there is one per bytecode,
+  // not just one per distinct CP entry.  In other words, the
+  // CPC-to-CP relation is many-to-one for invokedynamic entries.
+  // This means we must use a larger index size than u2 to address
+  // all these entries.  That is the main reason invokedynamic
+  // must have a five-byte instruction format.  (Of course, other JVM
+  // implementations can use the bytes for other purposes.)
+  Bytes::put_native_u4(p, cpc2);
+  // Note: We use native_u4 format exclusively for 4-byte indexes.
+}
+
+
 // Rewrites a method given the index_map information
-methodHandle Rewriter::rewrite_method(methodHandle method, intArray& index_map, TRAPS) {
+void Rewriter::scan_method(methodOop method) {
 
   int nof_jsrs = 0;
   bool has_monitor_bytecodes = false;
@@ -121,6 +162,7 @@
     int bc_length;
     for (int bci = 0; bci < code_length; bci += bc_length) {
       address bcp = code_base + bci;
+      int prefix_length = 0;
       c = (Bytecodes::Code)(*bcp);
 
       // Since we have the code, see if we can get the length
@@ -135,6 +177,7 @@
         // by 'wide'. We don't currently examine any of the bytecodes
         // modified by wide, but in case we do in the future...
         if (c == Bytecodes::_wide) {
+          prefix_length = 1;
           c = (Bytecodes::Code)bcp[1];
         }
       }
@@ -159,12 +202,13 @@
         case Bytecodes::_putfield       : // fall through
         case Bytecodes::_invokevirtual  : // fall through
         case Bytecodes::_invokespecial  : // fall through
-        case Bytecodes::_invokestatic   : // fall through
-        case Bytecodes::_invokeinterface: {
-          address p = bcp + 1;
-          Bytes::put_native_u2(p, index_map[Bytes::get_Java_u2(p)]);
+        case Bytecodes::_invokestatic   :
+        case Bytecodes::_invokeinterface:
+          rewrite_member_reference(bcp, prefix_length+1);
           break;
-        }
+        case Bytecodes::_invokedynamic:
+          rewrite_invokedynamic(bcp, prefix_length+1, int(sizeof"@@@@DELETE ME"));
+          break;
         case Bytecodes::_jsr            : // fall through
         case Bytecodes::_jsr_w          : nof_jsrs++;                   break;
         case Bytecodes::_monitorenter   : // fall through
@@ -182,53 +226,56 @@
   // have to be rewritten, so we run the oopMapGenerator on the method
   if (nof_jsrs > 0) {
     method->set_has_jsrs();
-    ResolveOopMapConflicts romc(method);
-    methodHandle original_method = method;
-    method = romc.do_potential_rewrite(CHECK_(methodHandle()));
-    if (method() != original_method()) {
-      // Insert invalid bytecode into original methodOop and set
-      // interpreter entrypoint, so that a executing this method
-      // will manifest itself in an easy recognizable form.
-      address bcp = original_method->bcp_from(0);
-      *bcp = (u1)Bytecodes::_shouldnotreachhere;
-      int kind = Interpreter::method_kind(original_method);
-      original_method->set_interpreter_kind(kind);
-    }
+    // Second pass will revisit this method.
+    assert(method->has_jsrs(), "");
+  }
+}
 
-    // Update monitor matching info.
-    if (romc.monitor_safe()) {
-      method->set_guaranteed_monitor_matching();
-    }
+// After constant pool is created, revisit methods containing jsrs.
+methodHandle Rewriter::rewrite_jsrs(methodHandle method, TRAPS) {
+  ResolveOopMapConflicts romc(method);
+  methodHandle original_method = method;
+  method = romc.do_potential_rewrite(CHECK_(methodHandle()));
+  if (method() != original_method()) {
+    // Insert invalid bytecode into original methodOop and set
+    // interpreter entrypoint, so that a executing this method
+    // will manifest itself in an easy recognizable form.
+    address bcp = original_method->bcp_from(0);
+    *bcp = (u1)Bytecodes::_shouldnotreachhere;
+    int kind = Interpreter::method_kind(original_method);
+    original_method->set_interpreter_kind(kind);
   }
 
-  // Setup method entrypoints for compiler and interpreter
-  method->link_method(method, CHECK_(methodHandle()));
+  // Update monitor matching info.
+  if (romc.monitor_safe()) {
+    method->set_guaranteed_monitor_matching();
+  }
 
   return method;
 }
 
 
 void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) {
-  // gather starting points
   ResourceMark rm(THREAD);
-  constantPoolHandle pool (THREAD, klass->constants());
-  objArrayHandle methods  (THREAD, klass->methods());
-  assert(pool->cache() == NULL, "constant pool cache must not be set yet");
+  Rewriter     rw(klass, CHECK);
+  // (That's all, folks.)
+}
+
+Rewriter::Rewriter(instanceKlassHandle klass, TRAPS)
+  : _klass(klass),
+    // gather starting points
+    _pool(   THREAD, klass->constants()),
+    _methods(THREAD, klass->methods())
+{
+  assert(_pool->cache() == NULL, "constant pool cache must not be set yet");
 
   // determine index maps for methodOop rewriting
-  intArray* index_map         = NULL;
-  intStack* inverse_index_map = NULL;
-  compute_index_maps(pool, index_map, inverse_index_map);
+  compute_index_maps();
 
-  // allocate constant pool cache
-  constantPoolCacheHandle cache = new_constant_pool_cache(*inverse_index_map, CHECK);
-  pool->set_cache(cache());
-  cache->set_constant_pool(pool());
-
-  if (RegisterFinalizersAtInit && klass->name() == vmSymbols::java_lang_Object()) {
-    int i = methods->length();
+  if (RegisterFinalizersAtInit && _klass->name() == vmSymbols::java_lang_Object()) {
+    int i = _methods->length();
     while (i-- > 0) {
-      methodOop method = (methodOop)methods->obj_at(i);
+      methodOop method = (methodOop)_methods->obj_at(i);
       if (method->intrinsic_id() == vmIntrinsics::_Object_init) {
         // rewrite the return bytecodes of Object.<init> to register the
         // object for finalization if needed.
@@ -239,13 +286,27 @@
     }
   }
 
-  // rewrite methods
-  { int i = methods->length();
-    while (i-- > 0) {
-      methodHandle m(THREAD, (methodOop)methods->obj_at(i));
-      m = rewrite_method(m, *index_map, CHECK);
+  // rewrite methods, in two passes
+  int i, len = _methods->length();
+
+  for (i = len; --i >= 0; ) {
+    methodOop method = (methodOop)_methods->obj_at(i);
+    scan_method(method);
+  }
+
+  // allocate constant pool cache, now that we've seen all the bytecodes
+  make_constant_pool_cache(CHECK);
+
+  for (i = len; --i >= 0; ) {
+    methodHandle m(THREAD, (methodOop)_methods->obj_at(i));
+
+    if (m->has_jsrs()) {
+      m = rewrite_jsrs(m, CHECK);
       // Method might have gotten rewritten.
-      methods->obj_at_put(i, m());
+      _methods->obj_at_put(i, m());
     }
+
+    // Set up method entry points for compiler and interpreter.
+    m->link_method(m, CHECK);
   }
 }
diff --git a/hotspot/src/share/vm/interpreter/rewriter.hpp b/hotspot/src/share/vm/interpreter/rewriter.hpp
index 847dad0..4b8ff7e 100644
--- a/hotspot/src/share/vm/interpreter/rewriter.hpp
+++ b/hotspot/src/share/vm/interpreter/rewriter.hpp
@@ -25,13 +25,44 @@
 // The Rewriter adds caches to the constant pool and rewrites bytecode indices
 // pointing into the constant pool for better interpreter performance.
 
-class Rewriter: public AllStatic {
+class Rewriter: public StackObj {
  private:
-  static void compute_index_maps(constantPoolHandle pool, intArray*& index_map, intStack*& inverse_index_map);
-  static constantPoolCacheHandle new_constant_pool_cache(intArray& inverse_index_map, TRAPS);
-  static methodHandle rewrite_method(methodHandle method, intArray& index_map, TRAPS);
-  static void rewrite_Object_init(methodHandle method, TRAPS);
+  instanceKlassHandle _klass;
+  constantPoolHandle  _pool;
+  objArrayHandle      _methods;
+  intArray            _cp_map;
+  intStack            _cp_cache_map;
+
+  void init_cp_map(int length) {
+    _cp_map.initialize(length, -1);
+    // Choose an initial value large enough that we don't get frequent
+    // calls to grow().
+    _cp_cache_map.initialize(length / 2);
+  }
+  int  cp_entry_to_cp_cache(int i) { assert(has_cp_cache(i), "oob"); return _cp_map[i]; }
+  bool has_cp_cache(int i) { return (uint)i < (uint)_cp_map.length() && _cp_map[i] >= 0; }
+  int maybe_add_cp_cache_entry(int i) { return has_cp_cache(i) ? _cp_map[i] : add_cp_cache_entry(i); }
+  int add_cp_cache_entry(int cp_index) {
+    assert(_cp_map[cp_index] == -1, "not twice on same cp_index");
+    int cache_index = _cp_cache_map.append(cp_index);
+    _cp_map.at_put(cp_index, cache_index);
+    assert(cp_entry_to_cp_cache(cp_index) == cache_index, "");
+    return cache_index;
+  }
+  int add_extra_cp_cache_entry(int main_entry);
+
+  // All the work goes in here:
+  Rewriter(instanceKlassHandle klass, TRAPS);
+
+  void compute_index_maps();
+  void make_constant_pool_cache(TRAPS);
+  void scan_method(methodOop m);
+  methodHandle rewrite_jsrs(methodHandle m, TRAPS);
+  void rewrite_Object_init(methodHandle m, TRAPS);
+  int  rewrite_member_reference(address bcp, int offset);
+  void rewrite_invokedynamic(address bcp, int offset, int cp_index);
 
  public:
+  // Driver routine:
   static void rewrite(instanceKlassHandle klass, TRAPS);
 };
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
index bdbd456..4375617 100644
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp
@@ -178,12 +178,14 @@
 #endif // !PRODUCT
 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries];
 EntryPoint TemplateInterpreter::_earlyret_entry;
+EntryPoint TemplateInterpreter::_return_unbox_entry;
 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ];
 EntryPoint TemplateInterpreter::_continuation_entry;
 EntryPoint TemplateInterpreter::_safept_entry;
 
 address    TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs];
 address    TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs];
+address    TemplateInterpreter::_return_5_unbox_addrs_by_index[TemplateInterpreter::number_of_return_addrs];
 
 DispatchTable TemplateInterpreter::_active_table;
 DispatchTable TemplateInterpreter::_normal_table;
@@ -251,6 +253,22 @@
     }
   }
 
+  if (EnableInvokeDynamic) {
+    CodeletMark cm(_masm, "unboxing return entry points");
+    Interpreter::_return_unbox_entry =
+      EntryPoint(
+        generate_return_unbox_entry_for(btos, 5),
+        generate_return_unbox_entry_for(ctos, 5),
+        generate_return_unbox_entry_for(stos, 5),
+        generate_return_unbox_entry_for(atos, 5), // cast conversion
+        generate_return_unbox_entry_for(itos, 5),
+        generate_return_unbox_entry_for(ltos, 5),
+        generate_return_unbox_entry_for(ftos, 5),
+        generate_return_unbox_entry_for(dtos, 5),
+        Interpreter::_return_entry[5].entry(vtos) // no unboxing for void
+      );
+  }
+
   { CodeletMark cm(_masm, "earlyret entry points");
     Interpreter::_earlyret_entry =
       EntryPoint(
@@ -298,8 +316,11 @@
 
   for (int j = 0; j < number_of_states; j++) {
     const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos};
-    Interpreter::_return_3_addrs_by_index[Interpreter::TosState_as_index(states[j])] = Interpreter::return_entry(states[j], 3);
-    Interpreter::_return_5_addrs_by_index[Interpreter::TosState_as_index(states[j])] = Interpreter::return_entry(states[j], 5);
+    int index = Interpreter::TosState_as_index(states[j]);
+    Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3);
+    Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5);
+    if (EnableInvokeDynamic)
+      Interpreter::_return_5_unbox_addrs_by_index[index] = Interpreter::return_unbox_entry(states[j], 5);
   }
 
   { CodeletMark cm(_masm, "continuation entry points");
@@ -526,6 +547,18 @@
 }
 
 
+address TemplateInterpreter::return_unbox_entry(TosState state, int length) {
+  assert(EnableInvokeDynamic, "");
+  if (state == vtos) {
+    // no unboxing to do, actually
+    return return_entry(state, length);
+  } else {
+    assert(length == 5, "unboxing entries generated for invokedynamic only");
+    return _return_unbox_entry.entry(state);
+  }
+}
+
+
 address TemplateInterpreter::deopt_entry(TosState state, int length) {
   guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length");
   return _deopt_entry[length].entry(state);
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
index 680ce51..2c78e31 100644
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp
@@ -83,9 +83,9 @@
  public:
 
   enum MoreConstants {
-    number_of_return_entries  = 9,                              // number of return entry points
-    number_of_deopt_entries   = 9,                              // number of deoptimization entry points
-    number_of_return_addrs    = 9                              // number of return addresses
+    number_of_return_entries  = number_of_states,               // number of return entry points
+    number_of_deopt_entries   = number_of_states,               // number of deoptimization entry points
+    number_of_return_addrs    = number_of_states                // number of return addresses
   };
 
  protected:
@@ -110,12 +110,14 @@
 #endif // !PRODUCT
   static EntryPoint _return_entry[number_of_return_entries];    // entry points to return to from a call
   static EntryPoint _earlyret_entry;                            // entry point to return early from a call
+  static EntryPoint _return_unbox_entry;                        // entry point to unbox a return value from a call
   static EntryPoint _deopt_entry[number_of_deopt_entries];      // entry points to return to from a deoptimization
   static EntryPoint _continuation_entry;
   static EntryPoint _safept_entry;
 
   static address    _return_3_addrs_by_index[number_of_return_addrs];     // for invokevirtual   return entries
   static address    _return_5_addrs_by_index[number_of_return_addrs];     // for invokeinterface return entries
+  static address    _return_5_unbox_addrs_by_index[number_of_return_addrs]; // for invokedynamic bootstrap methods
 
   static DispatchTable _active_table;                           // the active    dispatch table (used by the interpreter for dispatch)
   static DispatchTable _normal_table;                           // the normal    dispatch table (used to set the active table in normal mode)
@@ -157,10 +159,12 @@
   // Support for invokes
   static address*   return_3_addrs_by_index_table()             { return _return_3_addrs_by_index; }
   static address*   return_5_addrs_by_index_table()             { return _return_5_addrs_by_index; }
+  static address*   return_5_unbox_addrs_by_index_table()       { return _return_5_unbox_addrs_by_index; }
   static int        TosState_as_index(TosState state);          // computes index into return_3_entry_by_index table
 
   static address    return_entry  (TosState state, int length);
   static address    deopt_entry   (TosState state, int length);
+  static address    return_unbox_entry(TosState state, int length);
 
   // Safepoint support
   static void       notice_safepoints();                        // stops the thread when reaching a safepoint
diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
index 676e762..9d5b694 100644
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp
@@ -51,7 +51,10 @@
   address generate_WrongMethodType_handler();
   address generate_ArrayIndexOutOfBounds_handler(const char* name);
   address generate_continuation_for(TosState state);
-  address generate_return_entry_for(TosState state, int step);
+  address generate_return_entry_for(TosState state, int step, bool unbox = false);
+  address generate_return_unbox_entry_for(TosState state, int step) {
+    return generate_return_entry_for(state, step, true);
+  }
   address generate_earlyret_entry_for(TosState state);
   address generate_deopt_entry_for(TosState state, int step);
   address generate_safept_entry_for(TosState state, address runtime_entry);
diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp
index 756b3f6..8e116ae 100644
--- a/hotspot/src/share/vm/interpreter/templateTable.cpp
+++ b/hotspot/src/share/vm/interpreter/templateTable.cpp
@@ -442,6 +442,7 @@
   def(Bytecodes::_invokespecial       , ubcp|disp|clvm|____, vtos, vtos, invokespecial       ,  1           );
   def(Bytecodes::_invokestatic        , ubcp|disp|clvm|____, vtos, vtos, invokestatic        ,  1           );
   def(Bytecodes::_invokeinterface     , ubcp|disp|clvm|____, vtos, vtos, invokeinterface     ,  1           );
+  def(Bytecodes::_invokedynamic       , ubcp|disp|clvm|____, vtos, vtos, invokedynamic       ,  1           );
   def(Bytecodes::_new                 , ubcp|____|clvm|____, vtos, atos, _new                ,  _           );
   def(Bytecodes::_newarray            , ubcp|____|clvm|____, itos, atos, newarray            ,  _           );
   def(Bytecodes::_anewarray           , ubcp|____|clvm|____, itos, atos, anewarray           ,  _           );
@@ -503,7 +504,6 @@
 
   def(Bytecodes::_fast_invokevfinal   , ubcp|disp|clvm|____, vtos, vtos, fast_invokevfinal   ,  2           );
 
-
   def(Bytecodes::_fast_linearswitch   , ubcp|disp|____|____, itos, vtos, fast_linearswitch   ,  _           );
   def(Bytecodes::_fast_binaryswitch   , ubcp|disp|____|____, itos, vtos, fast_binaryswitch   ,  _           );
 
diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp
index af6bf87..41d82d5 100644
--- a/hotspot/src/share/vm/interpreter/templateTable.hpp
+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp
@@ -261,6 +261,7 @@
   static void invokespecial(int byte_no);
   static void invokestatic(int byte_no);
   static void invokeinterface(int byte_no);
+  static void invokedynamic(int byte_no);
   static void fast_invokevfinal(int byte_no);
 
   static void getfield_or_static(int byte_no, bool is_static);
diff --git a/hotspot/src/share/vm/oops/constantPoolKlass.cpp b/hotspot/src/share/vm/oops/constantPoolKlass.cpp
index ab2dac8..44b1643 100644
--- a/hotspot/src/share/vm/oops/constantPoolKlass.cpp
+++ b/hotspot/src/share/vm/oops/constantPoolKlass.cpp
@@ -312,6 +312,7 @@
   if (cp->flags() != 0) {
     st->print(" - flags : 0x%x", cp->flags());
     if (cp->has_pseudo_string()) st->print(" has_pseudo_string");
+    if (cp->has_invokedynamic()) st->print(" has_invokedynamic");
     st->cr();
   }
 
diff --git a/hotspot/src/share/vm/oops/constantPoolOop.cpp b/hotspot/src/share/vm/oops/constantPoolOop.cpp
index d6362e7..f899eef 100644
--- a/hotspot/src/share/vm/oops/constantPoolOop.cpp
+++ b/hotspot/src/share/vm/oops/constantPoolOop.cpp
@@ -249,32 +249,41 @@
 }
 
 
-symbolOop constantPoolOopDesc::uncached_name_ref_at(int which) {
-  jint ref_index = name_and_type_at(uncached_name_and_type_ref_index_at(which));
-  int name_index = extract_low_short_from_int(ref_index);
+symbolOop constantPoolOopDesc::impl_name_ref_at(int which, bool uncached) {
+  int name_index = name_ref_index_at(impl_name_and_type_ref_index_at(which, uncached));
   return symbol_at(name_index);
 }
 
 
-symbolOop constantPoolOopDesc::uncached_signature_ref_at(int which) {
-  jint ref_index = name_and_type_at(uncached_name_and_type_ref_index_at(which));
-  int signature_index = extract_high_short_from_int(ref_index);
+symbolOop constantPoolOopDesc::impl_signature_ref_at(int which, bool uncached) {
+  int signature_index = signature_ref_index_at(impl_name_and_type_ref_index_at(which, uncached));
   return symbol_at(signature_index);
 }
 
 
-int constantPoolOopDesc::uncached_name_and_type_ref_index_at(int which) {
-  jint ref_index = field_or_method_at(which, true);
+int constantPoolOopDesc::impl_name_and_type_ref_index_at(int which, bool uncached) {
+  jint ref_index = field_or_method_at(which, uncached);
   return extract_high_short_from_int(ref_index);
 }
 
 
-int constantPoolOopDesc::uncached_klass_ref_index_at(int which) {
-  jint ref_index = field_or_method_at(which, true);
+int constantPoolOopDesc::impl_klass_ref_index_at(int which, bool uncached) {
+  jint ref_index = field_or_method_at(which, uncached);
   return extract_low_short_from_int(ref_index);
 }
 
 
+
+int constantPoolOopDesc::map_instruction_operand_to_index(int operand) {
+  if (constantPoolCacheOopDesc::is_secondary_index(operand)) {
+    return cache()->main_entry_at(operand)->constant_pool_index();
+  }
+  assert((int)(u2)operand == operand, "clean u2");
+  int index = Bytes::swap_u2(operand);
+  return cache()->entry_at(index)->constant_pool_index();
+}
+
+
 void constantPoolOopDesc::verify_constant_pool_resolve(constantPoolHandle this_oop, KlassHandle k, TRAPS) {
  if (k->oop_is_instance() || k->oop_is_objArray()) {
     instanceKlassHandle holder (THREAD, this_oop->pool_holder());
@@ -290,26 +299,14 @@
 }
 
 
-int constantPoolOopDesc::klass_ref_index_at(int which) {
-  jint ref_index = field_or_method_at(which, false);
+int constantPoolOopDesc::name_ref_index_at(int which_nt) {
+  jint ref_index = name_and_type_at(which_nt);
   return extract_low_short_from_int(ref_index);
 }
 
 
-int constantPoolOopDesc::name_and_type_ref_index_at(int which) {
-  jint ref_index = field_or_method_at(which, false);
-  return extract_high_short_from_int(ref_index);
-}
-
-
-int constantPoolOopDesc::name_ref_index_at(int which) {
-  jint ref_index = name_and_type_at(which);
-  return extract_low_short_from_int(ref_index);
-}
-
-
-int constantPoolOopDesc::signature_ref_index_at(int which) {
-  jint ref_index = name_and_type_at(which);
+int constantPoolOopDesc::signature_ref_index_at(int which_nt) {
+  jint ref_index = name_and_type_at(which_nt);
   return extract_high_short_from_int(ref_index);
 }
 
@@ -353,20 +350,6 @@
 }
 
 
-symbolOop constantPoolOopDesc::name_ref_at(int which) {
-  jint ref_index = name_and_type_at(name_and_type_ref_index_at(which));
-  int name_index = extract_low_short_from_int(ref_index);
-  return symbol_at(name_index);
-}
-
-
-symbolOop constantPoolOopDesc::signature_ref_at(int which) {
-  jint ref_index = name_and_type_at(name_and_type_ref_index_at(which));
-  int signature_index = extract_high_short_from_int(ref_index);
-  return symbol_at(signature_index);
-}
-
-
 BasicType constantPoolOopDesc::basic_type_for_signature_at(int which) {
   return FieldType::basic_type(symbol_at(which));
 }
diff --git a/hotspot/src/share/vm/oops/constantPoolOop.hpp b/hotspot/src/share/vm/oops/constantPoolOop.hpp
index 8ccbcd2..72bec65 100644
--- a/hotspot/src/share/vm/oops/constantPoolOop.hpp
+++ b/hotspot/src/share/vm/oops/constantPoolOop.hpp
@@ -53,6 +53,7 @@
   void release_tag_at_put(int which, jbyte t)  { tags()->release_byte_at_put(which, t); }
 
   enum FlagBit {
+    FB_has_invokedynamic = 1,
     FB_has_pseudo_string = 2
   };
 
@@ -96,7 +97,9 @@
   typeArrayOop tags() const                 { return _tags; }
 
   bool has_pseudo_string() const            { return flag_at(FB_has_pseudo_string); }
+  bool has_invokedynamic() const            { return flag_at(FB_has_invokedynamic); }
   void set_pseudo_string()                  {    set_flag_at(FB_has_pseudo_string); }
+  void set_invokedynamic()                  {    set_flag_at(FB_has_invokedynamic); }
 
   // Klass holding pool
   klassOop pool_holder() const              { return _pool_holder; }
@@ -338,24 +341,28 @@
     return *int_at_addr(which);
   }
 
-  // The following methods (klass_ref_at, klass_ref_at_noresolve, name_ref_at,
-  // signature_ref_at, klass_ref_index_at, name_and_type_ref_index_at,
-  // name_ref_index_at, signature_ref_index_at) all expect constant pool indices
+  // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve,
+  // name_and_type_ref_index_at) all expect constant pool indices
   // from the bytecodes to be passed in, which are actually potentially byte-swapped
-  // contstant pool cache indices. See field_or_method_at.
+  // or rewritten constant pool cache indices.  They all call map_instruction_operand_to_index.
+  int map_instruction_operand_to_index(int operand);
+
+  // There are also "uncached" versions which do not map the operand index; see below.
 
   // Lookup for entries consisting of (klass_index, name_and_type index)
   klassOop klass_ref_at(int which, TRAPS);
   symbolOop klass_ref_at_noresolve(int which);
-  symbolOop name_ref_at(int which);
-  symbolOop signature_ref_at(int which);    // the type descriptor
+  symbolOop name_ref_at(int which)                { return impl_name_ref_at(which, false); }
+  symbolOop signature_ref_at(int which)           { return impl_signature_ref_at(which, false); }
 
-  int klass_ref_index_at(int which);
-  int name_and_type_ref_index_at(int which);
+  int klass_ref_index_at(int which)               { return impl_klass_ref_index_at(which, false); }
+  int name_and_type_ref_index_at(int which)       { return impl_name_and_type_ref_index_at(which, false); }
 
   // Lookup for entries consisting of (name_index, signature_index)
-  int name_ref_index_at(int which);
-  int signature_ref_index_at(int which);
+  int name_ref_index_at(int which_nt);            // ==  low-order jshort of name_and_type_at(which_nt)
+  int signature_ref_index_at(int which_nt);       // == high-order jshort of name_and_type_at(which_nt)
+  symbolOop nt_name_ref_at(int which_nt)          { return symbol_at(name_ref_index_at(which_nt)); }
+  symbolOop nt_signature_ref_at(int which_nt)     { return symbol_at(signature_ref_index_at(which_nt)); }
 
   BasicType basic_type_for_signature_at(int which);
 
@@ -397,10 +404,10 @@
   // Routines currently used for annotations (only called by jvm.cpp) but which might be used in the
   // future by other Java code. These take constant pool indices rather than possibly-byte-swapped
   // constant pool cache indices as do the peer methods above.
-  symbolOop uncached_name_ref_at(int which);
-  symbolOop uncached_signature_ref_at(int which);
-  int       uncached_klass_ref_index_at(int which);
-  int       uncached_name_and_type_ref_index_at(int which);
+  symbolOop uncached_name_ref_at(int which)                 { return impl_name_ref_at(which, true); }
+  symbolOop uncached_signature_ref_at(int which)            { return impl_signature_ref_at(which, true); }
+  int       uncached_klass_ref_index_at(int which)          { return impl_klass_ref_index_at(which, true); }
+  int       uncached_name_and_type_ref_index_at(int which)  { return impl_name_and_type_ref_index_at(which, true); }
 
   // Sharing
   int pre_resolve_shared_klasses(TRAPS);
@@ -413,16 +420,19 @@
 
  private:
 
+  symbolOop impl_name_ref_at(int which, bool uncached);
+  symbolOop impl_signature_ref_at(int which, bool uncached);
+  int       impl_klass_ref_index_at(int which, bool uncached);
+  int       impl_name_and_type_ref_index_at(int which, bool uncached);
+
   // Takes either a constant pool cache index in possibly byte-swapped
   // byte order (which comes from the bytecodes after rewriting) or,
   // if "uncached" is true, a vanilla constant pool index
   jint field_or_method_at(int which, bool uncached) {
-    int i = -1;
-    if (uncached || cache() == NULL) {
-      i = which;
-    } else {
+    int i = which;
+    if (!uncached && cache() != NULL) {
       // change byte-ordering and go via cache
-      i = cache()->entry_at(Bytes::swap_u2(which))->constant_pool_index();
+      i = map_instruction_operand_to_index(which);
     }
     assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
     return *int_at_addr(i);
diff --git a/hotspot/src/share/vm/oops/cpCacheKlass.cpp b/hotspot/src/share/vm/oops/cpCacheKlass.cpp
index 028a9c9..5a85e88 100644
--- a/hotspot/src/share/vm/oops/cpCacheKlass.cpp
+++ b/hotspot/src/share/vm/oops/cpCacheKlass.cpp
@@ -169,11 +169,47 @@
 void constantPoolCacheKlass::oop_copy_contents(PSPromotionManager* pm,
                                                oop obj) {
   assert(obj->is_constantPoolCache(), "should be constant pool");
+  if (EnableInvokeDynamic) {
+    constantPoolCacheOop cache = (constantPoolCacheOop)obj;
+    // during a scavenge, it is safe to inspect my pool, since it is perm
+    constantPoolOop pool = cache->constant_pool();
+    assert(pool->is_constantPool(), "should be constant pool");
+    if (pool->has_invokedynamic()) {
+      for (int i = 0; i < cache->length(); i++) {
+        ConstantPoolCacheEntry* e = cache->entry_at(i);
+        oop* p = (oop*)&e->_f1;
+        if (e->is_secondary_entry()) {
+          if (PSScavenge::should_scavenge(p))
+            pm->claim_or_forward_breadth(p);
+          assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
+                 "no live oops here");
+        }
+      }
+    }
+  }
 }
 
 void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm,
                                                oop obj) {
   assert(obj->is_constantPoolCache(), "should be constant pool");
+  if (EnableInvokeDynamic) {
+    constantPoolCacheOop cache = (constantPoolCacheOop)obj;
+    // during a scavenge, it is safe to inspect my pool, since it is perm
+    constantPoolOop pool = cache->constant_pool();
+    assert(pool->is_constantPool(), "should be constant pool");
+    if (pool->has_invokedynamic()) {
+      for (int i = 0; i < cache->length(); i++) {
+        ConstantPoolCacheEntry* e = cache->entry_at(i);
+        oop* p = (oop*)&e->_f1;
+        if (e->is_secondary_entry()) {
+          if (PSScavenge::should_scavenge(p))
+            pm->claim_or_forward_depth(p);
+          assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)),
+                 "no live oops here");
+        }
+      }
+    }
+  }
 }
 
 int
diff --git a/hotspot/src/share/vm/oops/cpCacheOop.cpp b/hotspot/src/share/vm/oops/cpCacheOop.cpp
index 1356775..55aa6d9 100644
--- a/hotspot/src/share/vm/oops/cpCacheOop.cpp
+++ b/hotspot/src/share/vm/oops/cpCacheOop.cpp
@@ -29,8 +29,18 @@
 // Implememtation of ConstantPoolCacheEntry
 
 void ConstantPoolCacheEntry::set_initial_state(int index) {
-  assert(0 <= index && index < 0x10000, "sanity check");
+  if (constantPoolCacheOopDesc::is_secondary_index(index)) {
+    // Hack:  The rewriter is trying to say that this entry itself
+    // will be a secondary entry.
+    int main_index = constantPoolCacheOopDesc::decode_secondary_index(index);
+    assert(0 <= main_index && main_index < 0x10000, "sanity check");
+    _indices = (main_index << 16);
+    assert(main_entry_index() == main_index, "");
+    return;
+  }
+  assert(0 < index && index < 0x10000, "sanity check");
   _indices = index;
+  assert(constant_pool_index() == index, "");
 }
 
 
@@ -136,6 +146,7 @@
   int byte_no = -1;
   bool needs_vfinal_flag = false;
   switch (invoke_code) {
+    case Bytecodes::_invokedynamic:
     case Bytecodes::_invokevirtual:
     case Bytecodes::_invokeinterface: {
         if (method->can_be_statically_bound()) {
@@ -211,6 +222,23 @@
 }
 
 
+void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, int extra_data) {
+  methodOop method = (methodOop) sun_dyn_CallSiteImpl::vmmethod(call_site());
+  assert(method->is_method(), "must be initialized properly");
+  int param_size = method->size_of_parameters();
+  assert(param_size > 1, "method argument size must include MH.this & initial dynamic receiver");
+  param_size -= 1;              // do not count MH.this; it is not stacked for invokedynamic
+  if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) {
+    // racing threads might be trying to install their own favorites
+    set_f1(call_site());
+  }
+  set_f2(extra_data);
+  set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | param_size);
+  // do not do set_bytecode on a secondary CP cache entry
+  //set_bytecode_1(Bytecodes::_invokedynamic);
+}
+
+
 class LocalOopClosure: public OopClosure {
  private:
   void (*_f)(oop*);
@@ -392,7 +420,11 @@
   // print separator
   if (index == 0) tty->print_cr("                 -------------");
   // print entry
-  tty->print_cr("%3d  (%08x)  [%02x|%02x|%5d]", index, this, bytecode_2(), bytecode_1(), constant_pool_index());
+  tty->print_cr("%3d  (%08x)  ", index, this);
+  if (is_secondary_entry())
+    tty->print_cr("[%5d|secondary]", main_entry_index());
+  else
+    tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
   tty->print_cr("                 [   %08x]", (address)(oop)_f1);
   tty->print_cr("                 [   %08x]", _f2);
   tty->print_cr("                 [   %08x]", _flags);
diff --git a/hotspot/src/share/vm/oops/cpCacheOop.hpp b/hotspot/src/share/vm/oops/cpCacheOop.hpp
index c09d7c4..ec25b87 100644
--- a/hotspot/src/share/vm/oops/cpCacheOop.hpp
+++ b/hotspot/src/share/vm/oops/cpCacheOop.hpp
@@ -89,6 +89,7 @@
 // _f1      = method for all but virtual calls, unused by virtual calls
 //            (note: for interface calls, which are essentially virtual,
 //             contains klassOop for the corresponding interface.
+//            for invokedynamic, f1 contains the CallSite object for the invocation
 // _f2      = method/vtable index for virtual calls only, unused by all other
 //            calls.  The vf flag indicates this is a method pointer not an
 //            index.
@@ -108,6 +109,8 @@
 
 class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
   friend class VMStructs;
+  friend class constantPoolCacheKlass;
+
  private:
   volatile intx     _indices;  // constant pool index & rewrite bytecodes
   volatile oop      _f1;       // entry specific oop field
@@ -175,6 +178,11 @@
     int index                                    // Method index into interface
   );
 
+  void set_dynamic_call(
+    Handle call_site,                            // Resolved java.dyn.CallSite (f1)
+    int extra_data                               // (f2)
+  );
+
   void set_parameter_size(int value) {
     assert(parameter_size() == 0 || parameter_size() == value,
            "size must not change");
@@ -216,7 +224,11 @@
   }
 
   // Accessors
-  int constant_pool_index() const                { return _indices & 0xFFFF; }
+  bool is_secondary_entry() const                { return (_indices & 0xFFFF) == 0; }
+  int constant_pool_index() const                { assert((_indices & 0xFFFF) != 0, "must be main entry");
+                                                   return (_indices & 0xFFFF); }
+  int main_entry_index() const                   { assert((_indices & 0xFFFF) == 0, "must be secondary entry");
+                                                   return ((uintx)_indices >> 16); }
   Bytecodes::Code bytecode_1() const             { return Bytecodes::cast((_indices >> 16) & 0xFF); }
   Bytecodes::Code bytecode_2() const             { return Bytecodes::cast((_indices >> 24) & 0xFF); }
   volatile oop  f1() const                       { return _f1; }
@@ -314,10 +326,30 @@
   // Initialization
   void initialize(intArray& inverse_index_map);
 
+  // Secondary indexes.
+  // They must look completely different from normal indexes.
+  // The main reason is that byte swapping is sometimes done on normal indexes.
+  // Also, it is helpful for debugging to tell the two apart.
+  static bool is_secondary_index(int i) { return (i < 0); }
+  static int  decode_secondary_index(int i) { assert(is_secondary_index(i),  ""); return ~i; }
+  static int  encode_secondary_index(int i) { assert(!is_secondary_index(i), ""); return ~i; }
+
   // Accessors
   void set_constant_pool(constantPoolOop pool)   { oop_store_without_check((oop*)&_constant_pool, (oop)pool); }
   constantPoolOop constant_pool() const          { return _constant_pool; }
   ConstantPoolCacheEntry* entry_at(int i) const  { assert(0 <= i && i < length(), "index out of bounds"); return base() + i; }
+  ConstantPoolCacheEntry* main_entry_at(int i) const {
+    ConstantPoolCacheEntry* e;
+    if (is_secondary_index(i)) {
+      // run through an extra level of indirection:
+      i = decode_secondary_index(i);
+      e = entry_at(i);
+      i = e->main_entry_index();
+    }
+    e = entry_at(i);
+    assert(!e->is_secondary_entry(), "only one level of indirection");
+    return e;
+  }
 
   // GC support
   // If the _length field has not been set, the size of the
diff --git a/hotspot/src/share/vm/oops/generateOopMap.cpp b/hotspot/src/share/vm/oops/generateOopMap.cpp
index 5828a6d..36e98c4 100644
--- a/hotspot/src/share/vm/oops/generateOopMap.cpp
+++ b/hotspot/src/share/vm/oops/generateOopMap.cpp
@@ -1252,8 +1252,9 @@
       case Bytecodes::_invokevirtual:
       case Bytecodes::_invokespecial:
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokeinterface:
-        int idx = currentBC->get_index_big();
+        int idx = currentBC->get_index_int();
         constantPoolOop cp    = method()->constants();
         int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
         int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
@@ -1283,8 +1284,9 @@
       case Bytecodes::_invokevirtual:
       case Bytecodes::_invokespecial:
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokeinterface:
-        int idx = currentBC->get_index_big();
+        int idx = currentBC->get_index_int();
         constantPoolOop cp    = method()->constants();
         int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
         int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
@@ -1310,6 +1312,7 @@
       case Bytecodes::_invokevirtual:
       case Bytecodes::_invokespecial:
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokeinterface:
         _itr_send = itr;
         _report_result_for_send = true;
@@ -1556,6 +1559,7 @@
     case Bytecodes::_invokevirtual:
     case Bytecodes::_invokespecial:     do_method(false, false, itr->get_index_big(), itr->bci()); break;
     case Bytecodes::_invokestatic:      do_method(true,  false, itr->get_index_big(), itr->bci()); break;
+    case Bytecodes::_invokedynamic:     do_method(false, true,  itr->get_index_int(), itr->bci()); break;
     case Bytecodes::_invokeinterface:   do_method(false, true,  itr->get_index_big(), itr->bci()); break;
     case Bytecodes::_newarray:
     case Bytecodes::_anewarray:         pp_new_ref(vCTS, itr->bci()); break;
@@ -1899,7 +1903,7 @@
   // Dig up signature for field in constant pool
   constantPoolOop cp    = _method->constants();
   int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
-  int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
+  int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);  // @@@@@
   symbolOop signature   = cp->symbol_at(signatureIdx);
 
   // Parse method signature
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index 3081c2a..c213987 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -163,6 +163,8 @@
   klassOop        _implementors[implementors_limit];
   // Generic signature, or null if none.
   symbolOop       _generic_signature;
+  // invokedynamic bootstrap method (a java.dyn.MethodHandle)
+  oop             _bootstrap_method;
   // Annotations for this class, or null if none.
   typeArrayOop    _class_annotations;
   // Annotation objects (byte arrays) for fields, or null if no annotations.
@@ -464,6 +466,10 @@
                                     u2 method_index)  { _enclosing_method_class_index  = class_index;
                                                         _enclosing_method_method_index = method_index; }
 
+  // JSR 292 support
+  oop bootstrap_method() const                        { return _bootstrap_method; }
+  void set_bootstrap_method(oop mh)                   { oop_store(&_bootstrap_method, mh); }
+
   // jmethodID support
   static jmethodID get_jmethod_id(instanceKlassHandle ik_h, size_t idnum,
                                   jmethodID new_id, jmethodID* new_jmeths);
@@ -744,6 +750,7 @@
   oop* adr_inner_classes() const     { return (oop*)&this->_inner_classes;}
   oop* adr_implementors() const      { return (oop*)&this->_implementors[0];}
   oop* adr_generic_signature() const { return (oop*)&this->_generic_signature;}
+  oop* adr_bootstrap_method() const  { return (oop*)&this->_bootstrap_method;}
   oop* adr_methods_jmethod_ids() const             { return (oop*)&this->_methods_jmethod_ids;}
   oop* adr_methods_cached_itable_indices() const   { return (oop*)&this->_methods_cached_itable_indices;}
   oop* adr_class_annotations() const   { return (oop*)&this->_class_annotations;}
diff --git a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp
index 23ebfab..aae1b1b 100644
--- a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp
@@ -84,6 +84,7 @@
   MarkSweep::mark_and_push(ik->adr_host_klass());
   MarkSweep::mark_and_push(ik->adr_signers());
   MarkSweep::mark_and_push(ik->adr_generic_signature());
+  MarkSweep::mark_and_push(ik->adr_bootstrap_method());
   MarkSweep::mark_and_push(ik->adr_class_annotations());
   MarkSweep::mark_and_push(ik->adr_fields_annotations());
   MarkSweep::mark_and_push(ik->adr_methods_annotations());
@@ -124,6 +125,7 @@
   PSParallelCompact::mark_and_push(cm, ik->adr_host_klass());
   PSParallelCompact::mark_and_push(cm, ik->adr_signers());
   PSParallelCompact::mark_and_push(cm, ik->adr_generic_signature());
+  PSParallelCompact::mark_and_push(cm, ik->adr_bootstrap_method());
   PSParallelCompact::mark_and_push(cm, ik->adr_class_annotations());
   PSParallelCompact::mark_and_push(cm, ik->adr_fields_annotations());
   PSParallelCompact::mark_and_push(cm, ik->adr_methods_annotations());
@@ -170,6 +172,7 @@
     blk->do_oop(&ik->adr_implementors()[i]);
   }
   blk->do_oop(ik->adr_generic_signature());
+  blk->do_oop(ik->adr_bootstrap_method());
   blk->do_oop(ik->adr_class_annotations());
   blk->do_oop(ik->adr_fields_annotations());
   blk->do_oop(ik->adr_methods_annotations());
@@ -230,6 +233,8 @@
   }
   adr = ik->adr_generic_signature();
   if (mr.contains(adr)) blk->do_oop(adr);
+  adr = ik->adr_bootstrap_method();
+  if (mr.contains(adr)) blk->do_oop(adr);
   adr = ik->adr_class_annotations();
   if (mr.contains(adr)) blk->do_oop(adr);
   adr = ik->adr_fields_annotations();
@@ -274,6 +279,7 @@
     MarkSweep::adjust_pointer(&ik->adr_implementors()[i]);
   }
   MarkSweep::adjust_pointer(ik->adr_generic_signature());
+  MarkSweep::adjust_pointer(ik->adr_bootstrap_method());
   MarkSweep::adjust_pointer(ik->adr_class_annotations());
   MarkSweep::adjust_pointer(ik->adr_fields_annotations());
   MarkSweep::adjust_pointer(ik->adr_methods_annotations());
@@ -454,6 +460,7 @@
     ik->set_breakpoints(NULL);
     ik->init_previous_versions();
     ik->set_generic_signature(NULL);
+    ik->set_bootstrap_method(NULL);
     ik->release_set_methods_jmethod_ids(NULL);
     ik->release_set_methods_cached_itable_indices(NULL);
     ik->set_class_annotations(NULL);
@@ -578,6 +585,11 @@
     } // pvw is cleaned up
   } // rm is cleaned up
 
+  if (ik->bootstrap_method() != NULL) {
+    st->print(BULLET"bootstrap method:  ");
+    ik->bootstrap_method()->print_value_on(st);
+    st->cr();
+  }
   if (ik->generic_signature() != NULL) {
     st->print(BULLET"generic signature: ");
     ik->generic_signature()->print_value_on(st);
diff --git a/hotspot/src/share/vm/oops/methodDataOop.cpp b/hotspot/src/share/vm/oops/methodDataOop.cpp
index e9751e5..e61dffe 100644
--- a/hotspot/src/share/vm/oops/methodDataOop.cpp
+++ b/hotspot/src/share/vm/oops/methodDataOop.cpp
@@ -442,6 +442,8 @@
   case Bytecodes::_invokevirtual:
   case Bytecodes::_invokeinterface:
     return VirtualCallData::static_cell_count();
+  case Bytecodes::_invokedynamic:
+    return CounterData::static_cell_count();
   case Bytecodes::_ret:
     return RetData::static_cell_count();
   case Bytecodes::_ifeq:
@@ -570,6 +572,11 @@
     cell_count = VirtualCallData::static_cell_count();
     tag = DataLayout::virtual_call_data_tag;
     break;
+  case Bytecodes::_invokedynamic:
+    // %%% should make a type profile for any invokedynamic that takes a ref argument
+    cell_count = CounterData::static_cell_count();
+    tag = DataLayout::counter_data_tag;
+    break;
   case Bytecodes::_ret:
     cell_count = RetData::static_cell_count();
     tag = DataLayout::ret_data_tag;
diff --git a/hotspot/src/share/vm/oops/methodOop.cpp b/hotspot/src/share/vm/oops/methodOop.cpp
index febc686..cb9cdda 100644
--- a/hotspot/src/share/vm/oops/methodOop.cpp
+++ b/hotspot/src/share/vm/oops/methodOop.cpp
@@ -161,7 +161,7 @@
 
 
 int methodOopDesc::bci_from(address bcp) const {
-  assert(is_native() && bcp == code_base() || contains(bcp), "bcp doesn't belong to this method");
+  assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(), "bcp doesn't belong to this method");
   return bcp - code_base();
 }
 
diff --git a/hotspot/src/share/vm/oops/methodOop.hpp b/hotspot/src/share/vm/oops/methodOop.hpp
index d9c419a..9a0afa8 100644
--- a/hotspot/src/share/vm/oops/methodOop.hpp
+++ b/hotspot/src/share/vm/oops/methodOop.hpp
@@ -534,7 +534,10 @@
   oop method_handle_type() const;
   static jint* method_type_offsets_chain();  // series of pointer-offsets, terminated by -1
   // presize interpreter frames for extra interpreter stack entries, if needed
-  static int extra_stack_entries() { return EnableMethodHandles ? (int)MethodHandlePushLimit : 0; }
+  // method handles want to be able to push a few extra values (e.g., a bound receiver), and
+  // invokedynamic sometimes needs to push a bootstrap method, call site, and arglist,
+  // all without checking for a stack overflow
+  static int extra_stack_entries() { return (EnableMethodHandles ? (int)MethodHandlePushLimit : 0) + (EnableInvokeDynamic ? 3 : 0); }
   static int extra_stack_words();  // = extra_stack_entries() * Interpreter::stackElementSize()
   // RedefineClasses() support:
   bool is_old() const                               { return access_flags().is_old(); }
diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp
index 4a86126..9401e02 100644
--- a/hotspot/src/share/vm/opto/buildOopMap.cpp
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp
@@ -363,6 +363,20 @@
   */
 #endif
 
+#ifdef ASSERT
+  for( OopMapStream oms1(omap, OopMapValue::derived_oop_value); !oms1.is_done(); oms1.next()) {
+    OopMapValue omv1 = oms1.current();
+    bool found = false;
+    for( OopMapStream oms2(omap,OopMapValue::oop_value); !oms2.is_done(); oms2.next()) {
+      if( omv1.content_reg() == oms2.current().reg() ) {
+        found = true;
+        break;
+      }
+    }
+    assert( found, "derived with no base in oopmap" );
+  }
+#endif
+
   return omap;
 }
 
diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp
index a66c873..20e1faf 100644
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp
@@ -321,7 +321,7 @@
     // stricter than callee_holder->is_initialized()
     ciBytecodeStream iter(caller_method);
     iter.force_bci(caller_bci);
-    int index = iter.get_index_big();
+    int index = iter.get_index_int();
     if( !caller_method->is_klass_loaded(index, true) ) {
       return false;
     }
diff --git a/hotspot/src/share/vm/opto/chaitin.cpp b/hotspot/src/share/vm/opto/chaitin.cpp
index 4ad220d..eb177c8 100644
--- a/hotspot/src/share/vm/opto/chaitin.cpp
+++ b/hotspot/src/share/vm/opto/chaitin.cpp
@@ -1423,17 +1423,33 @@
   // pointers derived from NULL!  These are always along paths that
   // can't happen at run-time but the optimizer cannot deduce it so
   // we have to handle it gracefully.
+  assert(!derived->bottom_type()->isa_narrowoop() ||
+          derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
   const TypePtr *tj = derived->bottom_type()->isa_ptr();
   // If its an OOP with a non-zero offset, then it is derived.
-  if( tj->_offset == 0 ) {
+  if( tj == NULL || tj->_offset == 0 ) {
     derived_base_map[derived->_idx] = derived;
     return derived;
   }
   // Derived is NULL+offset?  Base is NULL!
   if( derived->is_Con() ) {
-    Node *base = new (C, 1) ConPNode( TypePtr::NULL_PTR );
-    uint no_lidx = 0;  // an unmatched constant in debug info has no LRG
-    _names.extend(base->_idx, no_lidx);
+    Node *base = _matcher.mach_null();
+    assert(base != NULL, "sanity");
+    if (base->in(0) == NULL) {
+      // Initialize it once and make it shared:
+      // set control to _root and place it into Start block
+      // (where top() node is placed).
+      base->init_req(0, _cfg._root);
+      Block *startb = _cfg._bbs[C->top()->_idx];
+      startb->_nodes.insert(startb->find_node(C->top()), base );
+      _cfg._bbs.map( base->_idx, startb );
+      assert (n2lidx(base) == 0, "should not have LRG yet");
+    }
+    if (n2lidx(base) == 0) {
+      new_lrg(base, maxlrg++);
+    }
+    assert(base->in(0) == _cfg._root &&
+           _cfg._bbs[base->_idx] == _cfg._bbs[C->top()->_idx], "base NULL should be shared");
     derived_base_map[derived->_idx] = base;
     return base;
   }
@@ -1460,9 +1476,13 @@
   }
 
   // Now we see we need a base-Phi here to merge the bases
-  base = new (C, derived->req()) PhiNode( derived->in(0), base->bottom_type() );
-  for( i = 1; i < derived->req(); i++ )
+  const Type *t = base->bottom_type();
+  base = new (C, derived->req()) PhiNode( derived->in(0), t );
+  for( i = 1; i < derived->req(); i++ ) {
     base->init_req(i, find_base_for_derived(derived_base_map, derived->in(i), maxlrg));
+    t = t->meet(base->in(i)->bottom_type());
+  }
+  base->as_Phi()->set_type(t);
 
   // Search the current block for an existing base-Phi
   Block *b = _cfg._bbs[derived->_idx];
@@ -1560,6 +1580,8 @@
           // This works because we are still in SSA during this call.
           Node *derived = lrgs(neighbor)._def;
           const TypePtr *tj = derived->bottom_type()->isa_ptr();
+          assert(!derived->bottom_type()->isa_narrowoop() ||
+                  derived->bottom_type()->make_ptr()->is_ptr()->_offset == 0, "sanity");
           // If its an OOP with a non-zero offset, then it is derived.
           if( tj && tj->_offset != 0 && tj->isa_oop_ptr() ) {
             Node *base = find_base_for_derived( derived_base_map, derived, maxlrg );
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
index 66cb13b..ca53445 100644
--- a/hotspot/src/share/vm/opto/doCall.cpp
+++ b/hotspot/src/share/vm/opto/doCall.cpp
@@ -248,6 +248,14 @@
                   holder_klass);
     return true;
   }
+  if (dest_method->is_method_handle_invoke()
+      && holder_klass->name() == ciSymbol::java_dyn_Dynamic()) {
+    // FIXME: NYI
+    uncommon_trap(Deoptimization::Reason_unhandled,
+                  Deoptimization::Action_none,
+                  holder_klass);
+    return true;
+  }
 
   assert(dest_method->will_link(method()->holder(), klass, bc()), "dest_method: typeflow responsibility");
   return false;
@@ -748,6 +756,7 @@
       case Bytecodes::_invokevirtual:   increment_counter(SharedRuntime::nof_inlined_calls_addr()); break;
       case Bytecodes::_invokeinterface: increment_counter(SharedRuntime::nof_inlined_interface_calls_addr()); break;
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokespecial:   increment_counter(SharedRuntime::nof_inlined_static_calls_addr()); break;
       default: fatal("unexpected call bytecode");
       }
@@ -756,6 +765,7 @@
       case Bytecodes::_invokevirtual:   increment_counter(SharedRuntime::nof_normal_calls_addr()); break;
       case Bytecodes::_invokeinterface: increment_counter(SharedRuntime::nof_interface_calls_addr()); break;
       case Bytecodes::_invokestatic:
+      case Bytecodes::_invokedynamic:
       case Bytecodes::_invokespecial:   increment_counter(SharedRuntime::nof_static_calls_addr()); break;
       default: fatal("unexpected call bytecode");
       }
diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp
index e28730d..db27bba 100644
--- a/hotspot/src/share/vm/opto/graphKit.cpp
+++ b/hotspot/src/share/vm/opto/graphKit.cpp
@@ -947,6 +947,7 @@
   case Bytecodes::_invokevirtual:
   case Bytecodes::_invokespecial:
   case Bytecodes::_invokestatic:
+  case Bytecodes::_invokedynamic:
   case Bytecodes::_invokeinterface:
     {
       bool is_static = (depth == 0);
@@ -2979,6 +2980,7 @@
 // See comments on new_instance for the meaning of the other arguments.
 Node* GraphKit::new_array(Node* klass_node,     // array klass (maybe variable)
                           Node* length,         // number of array elements
+                          int   nargs,          // number of arguments to push back for uncommon trap
                           bool raw_mem_only,    // affect only raw memory
                           Node* *return_size_val) {
   jint  layout_con = Klass::_lh_neutral_value;
@@ -2994,6 +2996,7 @@
     Node* cmp_lh = _gvn.transform( new(C, 3) CmpINode(layout_val, intcon(layout_con)) );
     Node* bol_lh = _gvn.transform( new(C, 2) BoolNode(cmp_lh, BoolTest::eq) );
     { BuildCutout unless(this, bol_lh, PROB_MAX);
+      _sp += nargs;
       uncommon_trap(Deoptimization::Reason_class_check,
                     Deoptimization::Action_maybe_recompile);
     }
diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp
index 7445aa2..f47bc49 100644
--- a/hotspot/src/share/vm/opto/graphKit.hpp
+++ b/hotspot/src/share/vm/opto/graphKit.hpp
@@ -699,7 +699,7 @@
                      Node* slow_test = NULL,
                      bool raw_mem_only = false,
                      Node* *return_size_val = NULL);
-  Node* new_array(Node* klass_node, Node* count_val,
+  Node* new_array(Node* klass_node, Node* count_val, int nargs,
                   bool raw_mem_only = false, Node* *return_size_val = NULL);
 
   // Handy for making control flow
diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
index a57333f..c51344d 100644
--- a/hotspot/src/share/vm/opto/library_call.cpp
+++ b/hotspot/src/share/vm/opto/library_call.cpp
@@ -3055,9 +3055,7 @@
     // Normal case:  The array type has been cached in the java.lang.Class.
     // The following call works fine even if the array type is polymorphic.
     // It could be a dynamic mix of int[], boolean[], Object[], etc.
-    _sp += nargs;  // set original stack for use by uncommon_trap
-    Node* obj = new_array(klass_node, count_val);
-    _sp -= nargs;
+    Node* obj = new_array(klass_node, count_val, nargs);
     result_reg->init_req(_normal_path, control());
     result_val->init_req(_normal_path, obj);
     result_io ->init_req(_normal_path, i_o());
@@ -3179,9 +3177,7 @@
     Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) );
     Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length);
 
-    _sp += nargs;  // set original stack for use by uncommon_trap
-    Node* newcopy = new_array(klass_node, length);
-    _sp -= nargs;
+    Node* newcopy = new_array(klass_node, length, nargs);
 
     // Generate a direct call to the right arraycopy function(s).
     // We know the copy is disjoint but we might not know if the
@@ -3903,10 +3899,8 @@
     set_control(array_ctl);
     Node* obj_length = load_array_length(obj);
     Node* obj_size = NULL;
-    _sp += nargs;  // set original stack for use by uncommon_trap
-    Node* alloc_obj = new_array(obj_klass, obj_length,
+    Node* alloc_obj = new_array(obj_klass, obj_length, nargs,
                                 raw_mem_only, &obj_size);
-    _sp -= nargs;
     assert(obj_size != NULL, "");
     Node* raw_obj = alloc_obj->in(1);
     assert(raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), "");
diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp
index e230480..2723a32 100644
--- a/hotspot/src/share/vm/opto/matcher.cpp
+++ b/hotspot/src/share/vm/opto/matcher.cpp
@@ -275,6 +275,12 @@
 
   C->print_method("Before Matching");
 
+  // Create new ideal node ConP #NULL even if it does exist in old space
+  // to avoid false sharing if the corresponding mach node is not used.
+  // The corresponding mach node is only used in rare cases for derived
+  // pointers.
+  Node* new_ideal_null = ConNode::make(C, TypePtr::NULL_PTR);
+
   // Swap out to old-space; emptying new-space
   Arena *old = C->node_arena()->move_contents(C->old_arena());
 
@@ -316,7 +322,16 @@
         }
       }
 
+      // Generate new mach node for ConP #NULL
+      assert(new_ideal_null != NULL, "sanity");
+      _mach_null = match_tree(new_ideal_null);
+      // Don't set control, it will confuse GCM since there are no uses.
+      // The control will be set when this node is used first time
+      // in find_base_for_derived().
+      assert(_mach_null != NULL, "");
+
       C->set_root(xroot->is_Root() ? xroot->as_Root() : NULL);
+
 #ifdef ASSERT
       verify_new_nodes_only(xroot);
 #endif
diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp
index a042c04..9f79dc3 100644
--- a/hotspot/src/share/vm/opto/matcher.hpp
+++ b/hotspot/src/share/vm/opto/matcher.hpp
@@ -109,6 +109,9 @@
   Node* _mem_node;   // Ideal memory node consumed by mach node
 #endif
 
+  // Mach node for ConP #NULL
+  MachNode* _mach_null;
+
 public:
   int LabelRootDepth;
   static const int base2reg[];        // Map Types to machine register types
@@ -122,6 +125,8 @@
   static RegMask mreg2regmask[];
   static RegMask STACK_ONLY_mask;
 
+  MachNode* mach_null() const { return _mach_null; }
+
   bool    is_shared( Node *n ) { return _shared.test(n->_idx) != 0; }
   void   set_shared( Node *n ) {  _shared.set(n->_idx); }
   bool   is_visited( Node *n ) { return _visited.test(n->_idx) != 0; }
diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp
index e00dfca..7120c51 100644
--- a/hotspot/src/share/vm/opto/parse.hpp
+++ b/hotspot/src/share/vm/opto/parse.hpp
@@ -476,7 +476,7 @@
   void do_newarray(BasicType elemtype);
   void do_anewarray();
   void do_multianewarray();
-  Node* expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions);
+  Node* expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs);
 
   // implementation of jsr/ret
   void do_jsr();
diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp
index da9537e..a7f4007 100644
--- a/hotspot/src/share/vm/opto/parse1.cpp
+++ b/hotspot/src/share/vm/opto/parse1.cpp
@@ -828,6 +828,7 @@
     break;
 
   case Bytecodes::_invokestatic:
+  case Bytecodes::_invokedynamic:
   case Bytecodes::_invokespecial:
   case Bytecodes::_invokevirtual:
   case Bytecodes::_invokeinterface:
diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp
index 201ffad..64cd9bd 100644
--- a/hotspot/src/share/vm/opto/parse2.cpp
+++ b/hotspot/src/share/vm/opto/parse2.cpp
@@ -2156,6 +2156,7 @@
     break;
 
   case Bytecodes::_invokestatic:
+  case Bytecodes::_invokedynamic:
   case Bytecodes::_invokespecial:
   case Bytecodes::_invokevirtual:
   case Bytecodes::_invokeinterface:
diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp
index 2a603de..b3e95ad 100644
--- a/hotspot/src/share/vm/opto/parse3.cpp
+++ b/hotspot/src/share/vm/opto/parse3.cpp
@@ -335,7 +335,7 @@
 
   const TypeKlassPtr* array_klass_type = TypeKlassPtr::make(array_klass);
   Node* count_val = pop();
-  Node* obj = new_array(makecon(array_klass_type), count_val);
+  Node* obj = new_array(makecon(array_klass_type), count_val, 1);
   push(obj);
 }
 
@@ -345,17 +345,17 @@
 
   Node*   count_val = pop();
   const TypeKlassPtr* array_klass = TypeKlassPtr::make(ciTypeArrayKlass::make(elem_type));
-  Node*   obj = new_array(makecon(array_klass), count_val);
+  Node*   obj = new_array(makecon(array_klass), count_val, 1);
   // Push resultant oop onto stack
   push(obj);
 }
 
 // Expand simple expressions like new int[3][5] and new Object[2][nonConLen].
 // Also handle the degenerate 1-dimensional case of anewarray.
-Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions) {
+Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs) {
   Node* length = lengths[0];
   assert(length != NULL, "");
-  Node* array = new_array(makecon(TypeKlassPtr::make(array_klass)), length);
+  Node* array = new_array(makecon(TypeKlassPtr::make(array_klass)), length, nargs);
   if (ndimensions > 1) {
     jint length_con = find_int_con(length, -1);
     guarantee(length_con >= 0, "non-constant multianewarray");
@@ -364,7 +364,7 @@
     const Type*    elemtype = _gvn.type(array)->is_aryptr()->elem();
     const intptr_t header   = arrayOopDesc::base_offset_in_bytes(T_OBJECT);
     for (jint i = 0; i < length_con; i++) {
-      Node*    elem   = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1);
+      Node*    elem   = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs);
       intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop);
       Node*    eaddr  = basic_plus_adr(array, offset);
       store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT);
@@ -419,7 +419,7 @@
   // Can use multianewarray instead of [a]newarray if only one dimension,
   // or if all non-final dimensions are small constants.
   if (expand_count == 1 || (1 <= expand_count && expand_count <= expand_limit)) {
-    Node* obj = expand_multianewarray(array_klass, &length[0], ndimensions);
+    Node* obj = expand_multianewarray(array_klass, &length[0], ndimensions, ndimensions);
     push(obj);
     return;
   }
diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp
index b5553cb..7e87d77 100644
--- a/hotspot/src/share/vm/opto/parseHelper.cpp
+++ b/hotspot/src/share/vm/opto/parseHelper.cpp
@@ -414,6 +414,7 @@
     profile_receiver_type(receiver);
     break;
   case Bytecodes::_invokestatic:
+  case Bytecodes::_invokedynamic:
   case Bytecodes::_invokespecial:
     break;
   default: fatal("unexpected call bytecode");
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 8180a85..8333be3 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -2222,6 +2222,9 @@
     case JVM_CONSTANT_InterfaceMethodref:
     case JVM_CONSTANT_Methodref:
       return cp->uncached_name_ref_at(cp_index)->as_utf8();
+    case JVM_CONSTANT_NameAndType:
+      // for invokedynamic
+      return cp->nt_name_ref_at(cp_index)->as_utf8();
     default:
       fatal("JVM_GetCPMethodNameUTF: illegal constant");
   }
@@ -2239,6 +2242,9 @@
     case JVM_CONSTANT_InterfaceMethodref:
     case JVM_CONSTANT_Methodref:
       return cp->uncached_signature_ref_at(cp_index)->as_utf8();
+    case JVM_CONSTANT_NameAndType:
+      // for invokedynamic
+      return cp->nt_signature_ref_at(cp_index)->as_utf8();
     default:
       fatal("JVM_GetCPMethodSignatureUTF: illegal constant");
   }
diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
index 2ad6d99..447dcb2 100644
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
@@ -659,15 +659,21 @@
       case Bytecodes::_invokevirtual   :  // fall through
       case Bytecodes::_invokespecial   :  // fall through
       case Bytecodes::_invokestatic    :  // fall through
+      case Bytecodes::_invokedynamic   :  // fall through
       case Bytecodes::_invokeinterface :
         assert(len == 3 || (code == Bytecodes::_invokeinterface && len ==5),
                "sanity check");
+        int cpci = Bytes::get_native_u2(bcp+1);
+        bool is_invokedynamic = (EnableInvokeDynamic && code == Bytecodes::_invokedynamic);
+        if (is_invokedynamic)
+          cpci = Bytes::get_native_u4(bcp+1);
         // cache cannot be pre-fetched since some classes won't have it yet
         ConstantPoolCacheEntry* entry =
-          mh->constants()->cache()->entry_at(Bytes::get_native_u2(bcp+1));
+          mh->constants()->cache()->main_entry_at(cpci);
         int i = entry->constant_pool_index();
         assert(i < mh->constants()->length(), "sanity check");
         Bytes::put_Java_u2((address)(p+1), (u2)i);     // java byte ordering
+        if (is_invokedynamic)  *(p+3) = *(p+4) = 0;
         break;
       }
     }
diff --git a/hotspot/src/share/vm/prims/methodComparator.cpp b/hotspot/src/share/vm/prims/methodComparator.cpp
index ed7fc22..494f048 100644
--- a/hotspot/src/share/vm/prims/methodComparator.cpp
+++ b/hotspot/src/share/vm/prims/methodComparator.cpp
@@ -148,8 +148,8 @@
   case Bytecodes::_invokespecial   : // fall through
   case Bytecodes::_invokestatic    : // fall through
   case Bytecodes::_invokeinterface : {
-    u2 cpci_old = _s_old->get_index_big();
-    u2 cpci_new = _s_new->get_index_big();
+    u2 cpci_old = _s_old->get_index_int();
+    u2 cpci_new = _s_new->get_index_int();
     // Check if the names of classes, field/method names and signatures at these indexes
     // are the same. Indices which are really into constantpool cache (rather than constant
     // pool itself) are accepted by the constantpool query routines below.
diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp
index de9d97a..f194644 100644
--- a/hotspot/src/share/vm/prims/methodHandles.cpp
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp
@@ -2279,6 +2279,16 @@
 JVM_END
 
 
+JVM_ENTRY(void, MH_linkCallSite(JNIEnv *env, jobject igcls, jobject site_jh, jobject target_jh)) {
+  // No special action required, yet.
+  oop site_oop = JNIHandles::resolve(site_jh);
+  if (site_oop == NULL || site_oop->klass() != SystemDictionary::CallSiteImpl_klass())
+    THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "call site");
+  sun_dyn_CallSiteImpl::set_target(site_oop, JNIHandles::resolve(target_jh));
+}
+JVM_END
+
+
 /// JVM_RegisterMethodHandleMethods
 
 #define ADR "J"
@@ -2297,6 +2307,7 @@
 #define AMH   IDYN"AdapterMethodHandle;"
 #define BMH   IDYN"BoundMethodHandle;"
 #define DMH   IDYN"DirectMethodHandle;"
+#define CSTI  IDYN"CallSiteImpl;"
 
 #define CC (char*)  /*cast a literal from (const char*)*/
 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
@@ -2320,12 +2331,19 @@
   {CC"getMembers",              CC"("CLS""STRG""STRG"I"CLS"I["MEM")I",  FN_PTR(MHI_getMembers)}
 };
 
+// More entry points specifically for EnableInvokeDynamic.
+static JNINativeMethod methods2[] = {
+  {CC"linkCallSite",            CC"("CSTI MH")V",               FN_PTR(MH_linkCallSite)}
+};
+
 
 // This one function is exported, used by NativeLookup.
 
 JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) {
   assert(MethodHandles::spot_check_entry_names(), "entry enum is OK");
 
+  // note: this explicit warning-producing stuff will be replaced by auto-detection of the JSR 292 classes
+
   if (!EnableMethodHandles) {
     warning("JSR 292 method handles are disabled in this JVM.  Use -XX:+EnableMethodHandles to enable.");
     return;  // bind nothing
@@ -2343,5 +2361,23 @@
       MethodHandles::set_enabled(true);
     }
   }
+
+  if (!EnableInvokeDynamic) {
+    warning("JSR 292 invokedynamic is disabled in this JVM.  Use -XX:+EnableInvokeDynamic to enable.");
+    return;  // bind nothing
+  }
+
+  {
+    ThreadToNativeFromVM ttnfv(thread);
+
+    int status = env->RegisterNatives(MHN_class, methods2, sizeof(methods2)/sizeof(JNINativeMethod));
+    if (env->ExceptionOccurred()) {
+      MethodHandles::set_enabled(false);
+      warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
+      env->ExceptionClear();
+    } else {
+      MethodHandles::set_enabled(true);
+    }
+  }
 }
 JVM_END
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index aa2c883..a6021b1 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -2627,6 +2627,12 @@
   }
 #endif // PRODUCT
 
+  if (EnableInvokeDynamic && !EnableMethodHandles) {
+    if (!FLAG_IS_DEFAULT(EnableMethodHandles)) {
+      warning("forcing EnableMethodHandles true to allow EnableInvokeDynamic");
+    }
+    EnableMethodHandles = true;
+  }
   if (EnableMethodHandles && !AnonymousClasses) {
     if (!FLAG_IS_DEFAULT(AnonymousClasses)) {
       warning("forcing AnonymousClasses true to enable EnableMethodHandles");
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index bc4dbc1..544a43f 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -3316,6 +3316,12 @@
   diagnostic(bool, OptimizeMethodHandles, true,                             \
           "when constructing method handles, try to improve them")          \
                                                                             \
+  product(bool, EnableInvokeDynamic, false,                                 \
+          "recognize the invokedynamic instruction")                        \
+                                                                            \
+  develop(bool, TraceInvokeDynamic, false,                                  \
+          "trace internal invoke dynamic operations")                       \
+                                                                            \
   product(bool, TaggedStackInterpreter, false,                              \
           "Insert tags in interpreter execution stack for oopmap generaion")\
                                                                             \
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
index 536d1d3..32ecd64 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
@@ -572,8 +572,8 @@
 
 enum TosState {         // describes the tos cache contents
   btos = 0,             // byte, bool tos cached
-  ctos = 1,             // short, char tos cached
-  stos = 2,             // short, char tos cached
+  ctos = 1,             // char tos cached
+  stos = 2,             // short tos cached
   itos = 3,             // int tos cached
   ltos = 4,             // long tos cached
   ftos = 5,             // float tos cached
@@ -588,7 +588,7 @@
 inline TosState as_TosState(BasicType type) {
   switch (type) {
     case T_BYTE   : return btos;
-    case T_BOOLEAN: return btos;
+    case T_BOOLEAN: return btos; // FIXME: Add ztos
     case T_CHAR   : return ctos;
     case T_SHORT  : return stos;
     case T_INT    : return itos;
@@ -602,6 +602,22 @@
   return ilgl;
 }
 
+inline BasicType as_BasicType(TosState state) {
+  switch (state) {
+    //case ztos: return T_BOOLEAN;//FIXME
+    case btos : return T_BYTE;
+    case ctos : return T_CHAR;
+    case stos : return T_SHORT;
+    case itos : return T_INT;
+    case ltos : return T_LONG;
+    case ftos : return T_FLOAT;
+    case dtos : return T_DOUBLE;
+    case atos : return T_OBJECT;
+    case vtos : return T_VOID;
+  }
+  return T_ILLEGAL;
+}
+
 
 // Helper function to convert BasicType info into TosState
 // Note: Cannot define here as it uses global constant at the time being.
diff --git a/hotspot/test/compiler/6589834/Test_ia32.java b/hotspot/test/compiler/6589834/Test_ia32.java
new file mode 100644
index 0000000..55f48f0
--- /dev/null
+++ b/hotspot/test/compiler/6589834/Test_ia32.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6589834
+ * @summary deoptimization problem with -XX:+DeoptimizeALot
+ *
+ * @run main/othervm -server Test_ia32
+ */
+
+/***************************************************************************************
+NOTE: The bug shows up (with several "Bug!" message) even without the
+      flag -XX:+DeoptimizeALot. In a debug build, you may want to try
+      the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information.
+****************************************************************************************/
+import java.lang.reflect.Constructor;
+
+public class Test_ia32 {
+
+    public static int NUM_THREADS = 100;
+
+    public static int CLONE_LENGTH = 1000;
+
+    public static void main(String[] args) throws InterruptedException, ClassNotFoundException {
+
+        Reflector[] threads = new Reflector[NUM_THREADS];
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Reflector();
+            threads[i].start();
+        }
+
+        System.out.println("Give Reflector.run() some time to compile...");
+        Thread.sleep(5000);
+
+        System.out.println("Load RMISecurityException causing run() deoptimization");
+        ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException");
+
+        for (Reflector thread : threads)
+            thread.requestStop();
+
+        for (Reflector thread : threads)
+            try {
+                thread.join();
+            } catch (InterruptedException e) {
+                System.out.println(e);
+            }
+
+    }
+
+}
+
+class Reflector extends Thread {
+
+    volatile boolean _doSpin = true;
+
+    Test_ia32[] _tests;
+
+    Reflector() {
+        _tests = new Test_ia32[Test_ia32.CLONE_LENGTH];
+        for (int i = 0; i < _tests.length; i++) {
+            _tests[i] = new Test_ia32();
+        }
+    }
+
+    static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) {
+
+        if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
+            System.out.println("Bug!");
+        }
+
+        return arr.length;
+    }
+
+    static int f(Test_ia32[] arr) {
+        return g(1, 2, arr.clone(), 3, 4);
+    }
+
+    @Override
+    public void run() {
+        Constructor[] ctrs = null;
+        Class<Test_ia32> klass = Test_ia32.class;
+        try {
+            ctrs = klass.getConstructors();
+        } catch (SecurityException e) {
+            System.out.println(e);
+        }
+
+        try {
+            while (_doSpin) {
+                if (f(_tests) < 0)
+                    System.out.println("return value usage");
+            }
+        } catch (NullPointerException e) {
+            e.printStackTrace();
+        }
+
+        System.out.println(this + " - stopped.");
+    }
+
+    public void requestStop() {
+        System.out.println(this + " - stop requested.");
+        _doSpin = false;
+    }
+
+}
diff --git a/jaxp/.hgignore b/jaxp/.hgignore
index ca1b0b2..eccd39a 100644
--- a/jaxp/.hgignore
+++ b/jaxp/.hgignore
@@ -1,3 +1,4 @@
 ^build/
 ^dist/
+^webrev/
 ^nbproject/private/
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 5558c3a..40071c6 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -30,3 +30,4 @@
 e8837366d3fd72f7c7a47ebfdbd5106c16156f12 jdk7-b53
 946a9f0c493261fa6a010dc33e61b9b535ba80c1 jdk7-b54
 039945fba683ee6773a721e2bd4e449f6133769a jdk7-b55
+c197c6801271c60f9c9f5d18fcc95b59e76dcd54 jdk7-b56
diff --git a/jaxp/THIRD_PARTY_README b/jaxp/THIRD_PARTY_README
index 9f4d7e5..6908905 100644
--- a/jaxp/THIRD_PARTY_README
+++ b/jaxp/THIRD_PARTY_README
@@ -61,6 +61,28 @@
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 THE POSSIBILITY OF SUCH DAMAGE.
+
+%% This notice is provided with respect to littlecms, which may be included with this software:  
+
+Little cms
+Copyright (C) 1998-2004 Marti Maria
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 %% This notice is provided with respect to zlib 1.1.3, which may be included with this software:   
 
 Acknowledgments:
@@ -115,16 +137,6 @@
 The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
 ____________________________________
 This formulation of W3C's notice and license became active on August 14 1998 so as to improve compatibility with GPL. This version ensures that W3C software licensing terms are no more restrictive than GPL and consequently W3C software may be distributed in GPL packages. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org.

-%% This notice is provided with respect to jscheme.jar, which may be included with this software: 
-Software License Agreement
-Copyright © 1998-2002 by Peter Norvig. 
-Permission is granted to anyone to use this software, in source or object code form, on any computer system, and to modify, compile, decompile, run, and redistribute it to anyone else, subject to the following restrictions: 
-1.The author makes no warranty of any kind, either expressed or implied, about the suitability of this software for any purpose.
-2.The author accepts no liability of any kind for damages or other consequences of the use of this software, even if they arise from defects in the software.
-3.The origin of this software must not be misrepresented, either by explicit claim or by omission.
-4.Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Altered versions may be distributed in packages under other licenses (such as the GNU license). 
-If you find this software useful, it would be nice if you let me (peter@norvig.com) know about it, and nicer still if you send me modifications that you are willing to share. However, you are not required to do so.
 
 
 %% This notice is provided with respect to PC/SC Lite for Suse Linux v. 1.1.1, which may be included with this software: 
diff --git a/jaxp/TRADEMARK b/jaxp/TRADEMARK
new file mode 100644
index 0000000..6587baf
--- /dev/null
+++ b/jaxp/TRADEMARK
@@ -0,0 +1,41 @@
+OpenJDK Trademark Notice
+Version 1.1, 2008/3/10
+
+OpenJDK (the "Name") is a trademark of Sun Microsystems, Inc. (the "Owner").
+Owner permits any person obtaining a copy of this software (the "Software")
+which is based on original software retrieved from one of the following
+websites: http://download.java.net/openjdk, http://hg.openjdk.java.net/jdk6,
+or http://openjdk.java.net (each a "Website", with the original software made
+available by the Owner on a Website being known as the "Website Software") to
+use the Name in package names and version strings of the Software subject to
+the following conditions:
+
+  - The Software is a substantially complete implementation of the OpenJDK
+    development kit or runtime environment code made available by Owner on a
+    Website, and the vast majority of the Software code is identical to the
+    upstream Website Software;
+
+  - No permission is hereby granted to use the Name in any other manner,
+    unless such use constitutes "fair use."
+
+  - The Owner makes no warranties of any kind respecting the Name and all
+    representations and warranties, including any implied warranty of
+    merchantability, fitness for a particular purpose or non-infringement
+    are hereby disclaimed; and
+
+  - This notice and the following legend are included in all copies of the
+    Software or portions of it:
+
+        OpenJDK is a trademark or registered trademark of Sun Microsystems,
+        Inc. in the United States and other countries.
+
+The Name may also be used in connection with descriptions of the Software that
+constitute "fair use," such as "derived from the OpenJDK code base" or "based
+on the OpenJDK source code."
+
+Owner intends to revise this Notice as necessary in order to meet the needs of
+the OpenJDK Community.  Please send questions or comments about this Notice to
+Sun Microsystems at openjdk-tm@sun.com.  Revisions to this Notice will be
+announced on the public mailing list announce@openjdk.java.net, to which you
+may subscribe by visiting http://mail.openjdk.java.net.  The latest version of
+this Notice may be found at http://openjdk.java.net/legal.
diff --git a/jaxp/make/jprt.properties b/jaxp/make/jprt.properties
index 26ffd61..f75871d 100644
--- a/jaxp/make/jprt.properties
+++ b/jaxp/make/jprt.properties
@@ -32,13 +32,13 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
 # The different build flavors we want
-jprt.build.flavors=product
+jprt.build.flavors=product,fastdebug
 
 # Explicitly designate what the 32bit match is for the 64bit build
 jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
index b6bd82c..b2d33e9 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Import.java,v 1.2.4.1 2005/09/12 10:32:33 pvedula Exp $
+ * $Id: Import.java,v 1.8 2007/04/09 21:30:40 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
index 718e512..3d549f4 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Include.java,v 1.2.4.1 2005/09/01 15:44:18 pvedula Exp $
+ * $Id: Include.java,v 1.8 2007/04/09 21:30:41 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
index e269403..b0829dc 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Type.java,v 1.2.4.2 2005/09/15 18:34:13 jeffsuttor Exp $
+ * $Id: Type.java,v 1.8 2007/03/28 16:51:19 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
index 4d11fa8..cb1c516 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: SAX2DOM.java,v 1.7 2006/01/26 07:01:40 jeffsuttor Exp $
+ * $Id: SAX2DOM.java,v 1.8.2.1 2006/12/04 18:45:41 spericas Exp $
  */
 
 
@@ -68,7 +68,7 @@
     static final DocumentBuilderFactory _factory =
             DocumentBuilderFactory.newInstance();
 
-    public SAX2DOM() throws ParserConfigurationException {
+   public SAX2DOM() throws ParserConfigurationException {
         synchronized (SAX2DOM.class) {
           _document = _factory.newDocumentBuilder().newDocument();
         }
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
index bf31233..f31ed04 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TemplatesImpl.java,v 1.2.4.1 2005/09/06 12:19:26 pvedula Exp $
+ * $Id: TemplatesImpl.java,v 1.8 2007/03/26 20:12:27 spericas Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
index 0f11b04..aa29317 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TransformerFactoryImpl.java,v 1.2.4.1 2005/09/15 06:15:38 pvedula Exp $
+ * $Id: TransformerFactoryImpl.java,v 1.8 2007/04/09 21:30:41 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
index 0c86f32..1ad227c 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TransformerImpl.java,v 1.5 2005/09/28 13:48:46 pvedula Exp $
+ * $Id: TransformerImpl.java,v 1.10 2007/06/13 01:57:09 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java
index 265de02..51d76c4 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java
@@ -148,7 +148,6 @@
      * @exception DOMException
      *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
      */
-
     public void setPrefix(String prefix)
         throws DOMException
     {
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java
index cf68ef0..a02707d 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java
@@ -45,8 +45,8 @@
 public class PropertyManager {
 
 
-    protected static final String STAX_NOTATIONS = "javax.xml.stream.notations";
-    protected static final String STAX_ENTITIES = "javax.xml.stream.entities";
+    public static final String STAX_NOTATIONS = "javax.xml.stream.notations";
+    public static final String STAX_ENTITIES = "javax.xml.stream.entities";
 
     private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
 
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
index 1851ef8..0a8980b 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
@@ -289,6 +289,8 @@
     protected boolean fReportCdataEvent = false ;
     protected boolean fIsCoalesce = false ;
     protected String fDeclaredEncoding =  null;
+    /** Disallow doctype declaration. */
+    protected boolean fDisallowDoctype = false;
 
     // drivers
 
@@ -1852,6 +1854,11 @@
         }
         // start general entity
         if (!fEntityStore.isDeclaredEntity(name)) {
+            //SUPPORT_DTD=false && ReplaceEntityReferences should throw exception
+            if (fDisallowDoctype && fReplaceEntityReferences) {
+                reportFatalError("EntityNotDeclared", new Object[]{name});
+                return;
+            }
             //REVISIT: one more case needs to be included: external PE and standalone is no
             if ( fHasExternalDTD && !fStandalone) {
                 if (fValidation)
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
index d5180fd..0336ec1 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
@@ -62,6 +62,10 @@
  * @author Arnaud  Le Hors, IBM
  * @author Eric Ye, IBM
  * @author Sunitha Reddy, Sun Microsystems
+ *
+ * Refer to the table in unit-test javax.xml.stream.XMLStreamReaderTest.SupportDTD for changes
+ * related to property SupportDTD.
+ * @author Joe Wang, Sun Microsystems
  */
 public class XMLDocumentScannerImpl
         extends XMLDocumentFragmentScannerImpl{
@@ -185,9 +189,6 @@
     /** Load external DTD. */
     protected boolean fLoadExternalDTD = true;
 
-    /** Disallow doctype declaration. */
-    protected boolean fDisallowDoctype = false;
-
     // state
 
     /** Seen doctype declaration. */
@@ -227,8 +228,8 @@
     /** String. */
     private XMLString fString = new XMLString();
 
-    public static final char [] DOCTYPE = {'D','O','C','T','Y','P','E'};
-    public static final char [] COMMENTSTRING = {'-','-'};
+    private static final char [] DOCTYPE = {'D','O','C','T','Y','P','E'};
+    private static final char [] COMMENTSTRING = {'-','-'};
 
     //
     // Constructors
@@ -708,6 +709,12 @@
     //
     // Private methods
     //
+    /** Set the scanner state after scanning DTD */
+    protected void setEndDTDScanState() {
+        setScannerState(SCANNER_STATE_PROLOG);
+        setDriver(fPrologDriver);
+        fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
+    }
 
     /** Returns the scanner state name. */
     protected String getScannerStateName(int state) {
@@ -930,19 +937,20 @@
                             reportFatalError("AlreadySeenDoctype", null);
                         }
                         fSeenDoctypeDecl = true;
-                        if(fDTDDriver == null){
-                            fDTDDriver = new DTDDriver();
-                        }
-
                         // scanDoctypeDecl() sends XNI doctypeDecl event that
                         // in SAX is converted to startDTD() event.
                         if (scanDoctypeDecl(fDisallowDoctype)) {
+                            //allow parsing of entity decls to continue in order to stay well-formed
                             setScannerState(SCANNER_STATE_DTD_INTERNAL_DECLS);
                             fSeenInternalSubset = true;
+                            if(fDTDDriver == null){
+                                fDTDDriver = new DTDDriver();
+                            }
                             setDriver(fContentDriver);
-                            int dtdEvent = fDTDDriver.next();
+                            //always return DTD event, the event however, will not contain any entities
+                            return fDTDDriver.next();
                             // If no DTD support, ignore and continue parsing
-                            return fDisallowDoctype ? next() : dtdEvent;
+                            //return fDisallowDoctype ? next() : dtdEvent;
                         }
 
                         /** xxx:check this part again
@@ -955,17 +963,17 @@
                         }
                          */
 
-                        if (fDisallowDoctype) {
-                            setScannerState(SCANNER_STATE_PROLOG);
-                            return next();
-                        }
-
                         // handle external subset
                         if (fDoctypeSystemId != null) {
                             if (((fValidation || fLoadExternalDTD)
                                 && (fValidationManager == null || !fValidationManager.isCachedDTD()))) {
-                                setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                if (!fDisallowDoctype)
+                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                else
+                                    setScannerState(SCANNER_STATE_PROLOG);
                                 setDriver(fContentDriver);
+                                if(fDTDDriver == null)
+                                    fDTDDriver = new DTDDriver();
                                 return fDTDDriver.next();
 
                             }
@@ -976,8 +984,13 @@
                                 // This handles the case of a DOCTYPE that had neither an internal subset or an external subset.
                                 fDTDScanner.setInputSource(fExternalSubsetSource);
                                 fExternalSubsetSource = null;
-                                setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
+                                if (!fDisallowDoctype)
+                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
+                                else
+                                    setScannerState(SCANNER_STATE_PROLOG);
                                 setDriver(fContentDriver);
+                                if(fDTDDriver == null)
+                                    fDTDDriver = new DTDDriver();
                                 return fDTDDriver.next();
                             }
                         }
@@ -1117,19 +1130,21 @@
                                 }
                                 fMarkupDepth--;
 
-                                // scan external subset next
-                                if (!XMLDocumentScannerImpl.this.fDisallowDoctype &&
-                                        fDoctypeSystemId != null && (fValidation || fLoadExternalDTD)) {
-                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                if (fDisallowDoctype) {
+                                    //simply reset the entity store without having to mess around
+                                    //with the DTD Scanner code
+                                    fEntityStore = fEntityManager.getEntityStore();
+                                    fEntityStore.reset();
+                                } else {
+                                    // scan external subset next unless we are ignoring DTDs
+                                    if (fDoctypeSystemId != null && (fValidation || fLoadExternalDTD)) {
+                                        setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                        break;
+                                    }
                                 }
 
-                                // break out of here
-                                else {
-                                    setScannerState(SCANNER_STATE_PROLOG);
-                                    setDriver(fPrologDriver);
-                                    fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
-                                    return true;
-                                }
+                                setEndDTDScanState();
+                                return true;
                             }
                             break;
                         }
@@ -1160,13 +1175,16 @@
                             boolean completeDTD = true;
                             boolean moreToScan = fDTDScanner.scanDTDExternalSubset(completeDTD);
                             if (!moreToScan) {
-                                setScannerState(SCANNER_STATE_PROLOG);
-                                setDriver(fPrologDriver);
-                                fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
+                                setEndDTDScanState();
                                 return true;
                             }
                             break;
                         }
+                        case SCANNER_STATE_PROLOG : {
+                            // skip entity decls
+                            setEndDTDScanState();
+                            return true;
+                        }
                         default: {
                             throw new XNIException("DTDDriver#dispatch: scanner state="+fScannerState+" ("+getScannerStateName(fScannerState)+')');
                         }
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
index 4b721d8..4535aed 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
@@ -56,7 +56,6 @@
      * hasNext() to advance the underlining stream in order to find the next acceptable event
      */
     private boolean fStreamAdvancedByHasNext = false;
-
     /** Creates a new instance of XMLStreamFilterImpl */
 
     public XMLStreamFilterImpl(XMLStreamReader reader,StreamFilter filter){
@@ -436,7 +435,6 @@
      */
     public String getVersion() {
         return fStreamReader.getVersion();
-
     }
 
     /**
@@ -532,5 +530,4 @@
     public String getAttributeLocalName(int index){
         return fStreamReader.getAttributeLocalName(index);
     }
-
 }
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
index a05a3e5..208e44e 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
@@ -34,4 +34,3 @@
 # Messages from erroneous set-up
 IncompatibleNamespaceContext = The type of the NamespaceContext is incompatible with using XInclude; it must be an instance of XIncludeNamespaceSupport
 ExpandedSystemId = Could not expand system id of included resource
-null
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
index c98ebbf..c017b87 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
@@ -1214,19 +1214,29 @@
             int max = ((XInt)attrValues[ATTIDX_MAXOCCURS]).intValue();
             if (max != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
 
-                // The maxOccurs restriction no longer applies to elements
-                // and wildcards. These are now validated using a constant
-                // space algorithm. The restriction still applies to model
-                // groups such as xs:sequence.
+                // maxOccurLimit is only check in secure mode
+                if (fSchemaHandler.fSecureProcessing != null) {
+                    String localName = element.getLocalName();
 
-                String localName = element.getLocalName();
-                if (fSchemaHandler.fSecureProcessing != null &&
-                        !localName.equals("element") && !localName.equals("any")) {
+                // The maxOccurs restriction no longer applies to elements
+                    // and wildcards in a sequence in which they are the only
+                    // particle. These are now validated using a constant
+                    // space algorithm. The restriction still applies to all
+                    // other cases.
+
+                    // Determine if constant-space algorithm can be applied
+                    final boolean optimize =
+                            (localName.equals("element") || localName.equals("any")) &&
+                            (element.getNextSibling() == null) &&
+                            (element.getPreviousSibling() == null) &&
+                            (element.getParentNode().getLocalName().equals("sequence"));
+
+                    if (!optimize) {
                     //Revisit :: IMO this is not right place to check
                     // maxOccurNodeLimit.
                     int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getMaxOccurNodeLimit();
                     if (max > maxOccurNodeLimit) {
-                        reportSchemaError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
+                        reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
 
                         // reset max values in case processing continues on error
                         attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit);
@@ -1234,6 +1244,7 @@
                         max = maxOccurNodeLimit;
                     }
                 }
+                }
 
                 if (min > max) {
                     reportSchemaError ("p-props-correct.2.1",
@@ -1607,6 +1618,10 @@
         return retValue;
     }
 
+    void reportSchemaFatalError (String key, Object[] args, Element ele) {
+        fSchemaHandler.reportSchemaFatalError(key, args, ele);
+    }
+
     void reportSchemaError (String key, Object[] args, Element ele) {
         fSchemaHandler.reportSchemaError(key, args, ele);
     }
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
index ce40559..665db93 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
@@ -2523,25 +2523,26 @@
         return false;
     }
 
+    void reportSchemaFatalError(String key, Object[] args, Element ele) {
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_FATAL_ERROR);
+    }
+
     void reportSchemaError(String key, Object[] args, Element ele) {
-        if (element2Locator(ele, xl)) {
-            fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_ERROR);
-        }
-        else {
-            fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_ERROR);
-        }
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_ERROR);
     }
 
     void reportSchemaWarning(String key, Object[] args, Element ele) {
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_WARNING);
+    }
+
+    void reportSchemaErr(String key, Object[] args, Element ele, short type) {
         if (element2Locator(ele, xl)) {
             fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_WARNING);
+                    key, args, type);
         }
         else {
             fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_WARNING);
+                    key, args, type);
         }
     }
 
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
index f5e6300..95265b4 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
@@ -111,6 +111,10 @@
         fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
         fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
         fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
+
+        // Enable secure processing feature by default
+        fSecurityManager = new SecurityManager();
+        fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
     }
 
     /**
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
index 842d80b..08c0f4d 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
@@ -943,8 +943,7 @@
                 setState(STATE_IGNORE);
             }
             else {
-                reportFatalError("NoFallback",
-                    new Object[] { attributes.getValue(null, "href") });
+                reportFatalError("NoFallback");
             }
         }
         else if (isFallbackElement(element)) {
@@ -1002,8 +1001,7 @@
             // we check to see if the children of this include element contained a fallback
             if (getState() == STATE_EXPECT_FALLBACK
                 && !getSawFallback(fDepth + 1)) {
-                reportFatalError("NoFallback",
-                    new Object[] { "unknown" });
+                reportFatalError("NoFallback");
             }
         }
         if (isFallbackElement(element)) {
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java b/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java
index 6bcfc19..1fc66fd 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java
@@ -53,7 +53,35 @@
   {
 
     /**
-     * Will get a thread from the pool, execute the task
+      * This class was introduced as a fix for CR 6607339.
+      */
+     final class SafeThread extends Thread {
+          private volatile boolean ran = false;
+
+          public SafeThread(Runnable target) {
+              super(target);
+          }
+
+          public final void run() {
+              if (Thread.currentThread() != this) {
+                  throw new IllegalStateException("The run() method in a"
+                      + " SafeThread cannot be called from another thread.");
+              }
+              synchronized (this) {
+                 if (!ran) {
+                     ran = true;
+                 }
+                 else {
+                  throw new IllegalStateException("The run() method in a"
+                      + " SafeThread cannot be called more than once.");
+                 }
+              }
+              super.run();
+          }
+     }
+
+     /**
+     *  Will get a thread from the pool, execute the task
      *  and return the thread to the pool.
      *
      *  The return value is used only to wait for completion
@@ -68,7 +96,7 @@
     public Thread run(Runnable task, int priority)
     {
 
-      Thread t = new Thread(task);
+      Thread t = new SafeThread(task);
 
       t.start();
 
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java b/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
index 71e87c0..c9e0661 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
+++ b/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: NodeSequence.java,v 1.2.4.2 2005/09/14 19:45:19 jeffsuttor Exp $
+ * $Id: NodeSequence.java,v 1.6 2007/01/12 19:26:42 spericas Exp $
  */
 package com.sun.org.apache.xpath.internal.axes;
 
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java b/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
index 3f39341..e046f53 100644
--- a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
+++ b/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
@@ -25,6 +25,8 @@
 
 package com.sun.xml.internal.stream.events;
 
+import com.sun.org.apache.xerces.internal.impl.PropertyManager;
+import java.util.List;
 import javax.xml.stream.util.XMLEventAllocator;
 import javax.xml.stream.*;
 import javax.xml.stream.events.*;
@@ -144,7 +146,13 @@
                 break;
             }
             case XMLEvent.DTD:{
-                event = new DTDEvent(streamReader.getText());
+                DTDEvent dtdEvent = new DTDEvent(streamReader.getText());
+                dtdEvent.setLocation(streamReader.getLocation());
+                List entities = (List)streamReader.getProperty(PropertyManager.STAX_ENTITIES);
+                if (entities != null && entities.size() != 0) dtdEvent.setEntities(entities);
+                List notations = (List)streamReader.getProperty(PropertyManager.STAX_NOTATIONS);
+                if (notations != null && notations.size() != 0) dtdEvent.setNotations(notations);
+                event = dtdEvent;
                 break;
             }
             case XMLEvent.CDATA:{
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 1bf5ca1..5e8f9c6 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -30,3 +30,4 @@
 b250218eb2e534384667ec73e3713e684667fd4c jdk7-b53
 50ea00dc5f143fe00025233e704903c37f8464aa jdk7-b54
 e0eebd978b830c09e7862cff3f77a914c15651c9 jdk7-b55
+0f7fbf85f7a1d9c027a863b9955c623352ed1292 jdk7-b56
diff --git a/jaxws/THIRD_PARTY_README b/jaxws/THIRD_PARTY_README
index 9f4d7e5..6908905 100644
--- a/jaxws/THIRD_PARTY_README
+++ b/jaxws/THIRD_PARTY_README
@@ -61,6 +61,28 @@
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 THE POSSIBILITY OF SUCH DAMAGE.
+
+%% This notice is provided with respect to littlecms, which may be included with this software:  
+
+Little cms
+Copyright (C) 1998-2004 Marti Maria
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 %% This notice is provided with respect to zlib 1.1.3, which may be included with this software:   
 
 Acknowledgments:
@@ -115,16 +137,6 @@
 The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
 ____________________________________
 This formulation of W3C's notice and license became active on August 14 1998 so as to improve compatibility with GPL. This version ensures that W3C software licensing terms are no more restrictive than GPL and consequently W3C software may be distributed in GPL packages. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org.

-%% This notice is provided with respect to jscheme.jar, which may be included with this software: 
-Software License Agreement
-Copyright © 1998-2002 by Peter Norvig. 
-Permission is granted to anyone to use this software, in source or object code form, on any computer system, and to modify, compile, decompile, run, and redistribute it to anyone else, subject to the following restrictions: 
-1.The author makes no warranty of any kind, either expressed or implied, about the suitability of this software for any purpose.
-2.The author accepts no liability of any kind for damages or other consequences of the use of this software, even if they arise from defects in the software.
-3.The origin of this software must not be misrepresented, either by explicit claim or by omission.
-4.Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Altered versions may be distributed in packages under other licenses (such as the GNU license). 
-If you find this software useful, it would be nice if you let me (peter@norvig.com) know about it, and nicer still if you send me modifications that you are willing to share. However, you are not required to do so.
 
 
 %% This notice is provided with respect to PC/SC Lite for Suse Linux v. 1.1.1, which may be included with this software: 
diff --git a/jaxws/TRADEMARK b/jaxws/TRADEMARK
new file mode 100644
index 0000000..6587baf
--- /dev/null
+++ b/jaxws/TRADEMARK
@@ -0,0 +1,41 @@
+OpenJDK Trademark Notice
+Version 1.1, 2008/3/10
+
+OpenJDK (the "Name") is a trademark of Sun Microsystems, Inc. (the "Owner").
+Owner permits any person obtaining a copy of this software (the "Software")
+which is based on original software retrieved from one of the following
+websites: http://download.java.net/openjdk, http://hg.openjdk.java.net/jdk6,
+or http://openjdk.java.net (each a "Website", with the original software made
+available by the Owner on a Website being known as the "Website Software") to
+use the Name in package names and version strings of the Software subject to
+the following conditions:
+
+  - The Software is a substantially complete implementation of the OpenJDK
+    development kit or runtime environment code made available by Owner on a
+    Website, and the vast majority of the Software code is identical to the
+    upstream Website Software;
+
+  - No permission is hereby granted to use the Name in any other manner,
+    unless such use constitutes "fair use."
+
+  - The Owner makes no warranties of any kind respecting the Name and all
+    representations and warranties, including any implied warranty of
+    merchantability, fitness for a particular purpose or non-infringement
+    are hereby disclaimed; and
+
+  - This notice and the following legend are included in all copies of the
+    Software or portions of it:
+
+        OpenJDK is a trademark or registered trademark of Sun Microsystems,
+        Inc. in the United States and other countries.
+
+The Name may also be used in connection with descriptions of the Software that
+constitute "fair use," such as "derived from the OpenJDK code base" or "based
+on the OpenJDK source code."
+
+Owner intends to revise this Notice as necessary in order to meet the needs of
+the OpenJDK Community.  Please send questions or comments about this Notice to
+Sun Microsystems at openjdk-tm@sun.com.  Revisions to this Notice will be
+announced on the public mailing list announce@openjdk.java.net, to which you
+may subscribe by visiting http://mail.openjdk.java.net.  The latest version of
+this Notice may be found at http://openjdk.java.net/legal.
diff --git a/jaxws/make/Makefile b/jaxws/make/Makefile
index 5669672..3dc17bf 100644
--- a/jaxws/make/Makefile
+++ b/jaxws/make/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/make/build.xml b/jaxws/make/build.xml
index 9f013e9..5b83e55 100644
--- a/jaxws/make/build.xml
+++ b/jaxws/make/build.xml
@@ -78,6 +78,15 @@
         <mkdir dir="${build.classes.dir}/META-INF/services"/>
             <copy todir="${build.classes.dir}/META-INF/services"
                   file="${src.classes.dir}/com/sun/tools/etc/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory"/>
+            <copy todir="${build.classes.dir}/META-INF/services"
+                  file="${src.classes.dir}/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin"/>
+ 	    <!-- copy jaxb sources files required for jaxb tool time -->	
+           <mkdir dir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime"/>
+            <copy todir="${build.classes.dir}/com/sun/tools/internal/xjc/runtime">
+                 <fileset dir="${src.classes.dir}/com/sun/tools/internal/xjc/runtime"
+                     includes="**/*.java"
+                     excludes="**/*.package.html"/>
+            </copy>
     </target>
 
     <target name="-defs-pstrip">
diff --git a/jaxws/make/jprt.properties b/jaxws/make/jprt.properties
index 26ffd61..f75871d 100644
--- a/jaxws/make/jprt.properties
+++ b/jaxws/make/jprt.properties
@@ -32,13 +32,13 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
 # The different build flavors we want
-jprt.build.flavors=product
+jprt.build.flavors=product,fastdebug
 
 # Explicitly designate what the 32bit match is for the 64bit build
 jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
diff --git a/jaxws/src/share/classes/com/sun/activation/registries/MailcapFile.java b/jaxws/src/share/classes/com/sun/activation/registries/MailcapFile.java
index 6e5e6a6..5fd2686 100644
--- a/jaxws/src/share/classes/com/sun/activation/registries/MailcapFile.java
+++ b/jaxws/src/share/classes/com/sun/activation/registries/MailcapFile.java
@@ -182,7 +182,8 @@
      */
     public String[] getNativeCommands(String mime_type) {
         String[] cmds = null;
-        List v = (List)native_commands.get(mime_type.toLowerCase());
+        List v =
+            (List)native_commands.get(mime_type.toLowerCase(Locale.ENGLISH));
         if (v != null) {
             cmds = new String[v.size()];
             cmds = (String[])v.toArray(cmds);
@@ -301,7 +302,8 @@
             reportParseError(MailcapTokenizer.STRING_TOKEN, currentToken,
                                         tokenizer.getCurrentTokenValue());
         }
-        String primaryType = tokenizer.getCurrentTokenValue().toLowerCase();
+        String primaryType =
+            tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH);
         String subType = "*";
 
         //      parse the '/' between primary and sub
@@ -322,7 +324,8 @@
                 reportParseError(MailcapTokenizer.STRING_TOKEN,
                             currentToken, tokenizer.getCurrentTokenValue());
             }
-            subType = tokenizer.getCurrentTokenValue().toLowerCase();
+            subType =
+                tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH);
 
             //  get the next token to simplify the next step
             currentToken = tokenizer.nextToken();
@@ -386,8 +389,8 @@
                     reportParseError(MailcapTokenizer.STRING_TOKEN,
                             currentToken, tokenizer.getCurrentTokenValue());
                 }
-                String paramName =
-                    tokenizer.getCurrentTokenValue().toLowerCase();
+                String paramName = tokenizer.getCurrentTokenValue().
+                                                toLowerCase(Locale.ENGLISH);
 
                 //      parse the '=' which separates the name from the value
                 currentToken = tokenizer.nextToken();
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/ClassType.java b/jaxws/src/share/classes/com/sun/codemodel/internal/ClassType.java
index 7943701..845fbdb 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/ClassType.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/ClassType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 /**
  * This helps enable whether the JDefinedClass is a Class or Interface or
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/CodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/CodeWriter.java
index 9e2174d..602e8ec 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/CodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/CodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java
index 1c9e580..c42297a 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java
index 12d6828..01b766f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationStringValue.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationStringValue.java
index f7bc5ea..07cd44f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationStringValue.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationStringValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java
index df2d90c..1e9f8c6 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationValue.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationValue.java
index 77e61ce..a66be61 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationValue.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java
index 426ebd5..83fe716 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java
index 6a8727d..440d400 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JArray.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JArray.java
index a9d0efd..d10da44 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JArray.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayClass.java
index b6934c9..d86d086 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java
index 87e78dd..6a433c0 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignment.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignment.java
index d5a1934..91bfa57 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignment.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java
index 75368a3..f352498 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JAtom.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JAtom.java
index fe7bb36..e4f9560 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JAtom.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JAtom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JBlock.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JBlock.java
index c64b5e9..57d7552 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JBlock.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -220,16 +220,14 @@
      * @return Newly generated JInvocation
      */
     public JInvocation invoke(JExpression expr, JMethod method) {
-        return invoke(expr, method.name());
+        return insert(new JInvocation(expr, method));
     }
 
     /**
      * Creates a static invocation statement.
      */
     public JInvocation staticInvoke(JClass type, String method) {
-        JInvocation i = new JInvocation(type, method);
-        insert(i);
-        return i;
+        return insert(new JInvocation(type, method));
     }
 
     /**
@@ -241,9 +239,7 @@
      * @return Newly generated JInvocation
      */
     public JInvocation invoke(String method) {
-        JInvocation i = new JInvocation((JExpression)null, method);
-        insert(i);
-        return i;
+        return insert(new JInvocation((JExpression)null, method));
     }
 
     /**
@@ -255,7 +251,7 @@
      * @return Newly generated JInvocation
      */
     public JInvocation invoke(JMethod method) {
-        return invoke(method.name());
+        return insert(new JInvocation((JExpression)null, method));
     }
 
     /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java
index 6d82275..e4df8bf 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JCase.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JCase.java
index 3b41503..27a4c32 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCase.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JCast.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JCast.java
index d840b49..b427526 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCast.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCast.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JCatchBlock.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JCatchBlock.java
index 731e0b3..a7c3120 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCatchBlock.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCatchBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JClass.java
index d4b7a9d..bbfd4aa 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -321,7 +321,7 @@
 
     /** Generates a static method invocation. */
     public final JInvocation staticInvoke(JMethod method) {
-        return staticInvoke(method.name());
+        return new JInvocation(this,method);
     }
 
     /** Generates a static method invocation. */
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java
index 21b9511..850cfe8 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JClassContainer.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JClassContainer.java
index 43cf24c..6f0e76a 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JClassContainer.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JClassContainer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
@@ -146,7 +145,6 @@
      *      newly created Annotation Type Declaration
      * @exception JClassAlreadyExistsException
      *      When the specified class/interface was already created.
-
      */
     public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException;
 
@@ -158,7 +156,6 @@
      *      newly created Enum
      * @exception JClassAlreadyExistsException
      *      When the specified class/interface was already created.
-
      */
     public JDefinedClass _enum (String name) throws JClassAlreadyExistsException;
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java
index 25791e0..1f67441 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -446,13 +446,29 @@
 
             JClass clazz = ref(s.substring(start,idx));
 
+            return parseSuffix(clazz);
+        }
+
+        /**
+         * Parses additional left-associative suffixes, like type arguments
+         * and array specifiers.
+         */
+        private JClass parseSuffix(JClass clazz) throws ClassNotFoundException {
             if(idx==s.length())
                 return clazz; // hit EOL
 
             char ch = s.charAt(idx);
 
             if(ch=='<')
-                return parseArguments(clazz);
+                return parseSuffix(parseArguments(clazz));
+
+            if(ch=='[') {
+                if(s.charAt(idx+1)==']') {
+                    idx+=2;
+                    return parseSuffix(clazz.array());
+                }
+                throw new IllegalArgumentException("Expected ']' but found "+s.substring(idx+1));
+            }
 
             return clazz;
         }
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JCommentPart.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JCommentPart.java
index 3001b3c..efd7edd 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCommentPart.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCommentPart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JConditional.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JConditional.java
index 58534f4..9e01118 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JConditional.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JConditional.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -75,6 +75,13 @@
         return _else;
     }
 
+    /**
+     * Creates <tt>... else if(...) ...</tt> code.
+     */
+    public JConditional _elseif(JExpression boolExp) {
+        return _else()._if(boolExp);
+    }
+
     public void state(JFormatter f) {
         if(test==JExpr.TRUE) {
             _then.generateBody(f);
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JContinue.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JContinue.java
index bc49f81..fe89d7d 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JContinue.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JContinue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JDeclaration.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JDeclaration.java
index 79ddbe1..50eaa1e 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JDeclaration.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JDeclaration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java
index b95e415..ff22fae 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -251,6 +251,13 @@
         if (superClass == null)
             throw new NullPointerException();
 
+        for( JClass o=superClass.outer(); o!=null; o=o.outer() ){
+            if(this==o){
+                throw new IllegalArgumentException("Illegal class inheritance loop." +
+                "  Outer class " + this.name + " may not subclass from inner class: " + o.name());
+            }
+        }
+
         this.superClass = superClass;
         return this;
     }
@@ -307,8 +314,9 @@
     }
 
     /**
-     * This method generates reference to the JEnumConstant in
-     * the class
+     * If the named enum already exists, the reference to it is returned.
+     * Otherwise this method generates a new enum reference with the given
+     * name and returns it.
      *
      * @param name
      *          The name of the constant.
@@ -316,8 +324,11 @@
      *      The generated type-safe enum constant.
      */
     public JEnumConstant enumConstant(String name){
-        JEnumConstant ec = new JEnumConstant(this, name);
-        enumConstantsByName.put(name, ec);
+        JEnumConstant ec = enumConstantsByName.get(name);
+        if (null == ec) {
+            ec = new JEnumConstant(this, name);
+            enumConstantsByName.put(name, ec);
+        }
         return ec;
     }
 
@@ -417,7 +428,6 @@
      *      newly created Annotation Type Declaration
      * @exception JClassAlreadyExistsException
      *      When the specified class/interface was already created.
-
      */
     public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException {
         return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);
@@ -576,7 +586,6 @@
      *      null if not found.
      */
     public JMethod getMethod(String name, JType[] argTypes) {
-        outer :
         for (JMethod m : methods) {
             if (!m.name().equals(name))
                 continue;
@@ -740,8 +749,8 @@
             f.nl().g(jdoc);
 
         if (annotations != null){
-            for( int i=0; i<annotations.size(); i++ )
-                f.g(annotations.get(i)).nl();
+            for (JAnnotationUse annotation : annotations)
+                f.g(annotation).nl();
         }
 
         f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JDirectClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JDirectClass.java
index 0a355e4..5ae8301 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JDirectClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JDirectClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JDoLoop.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JDoLoop.java
index a7ce4a0..e76b065 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JDoLoop.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JDoLoop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JDocComment.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JDocComment.java
index 2bca54e..aadb5b1 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JDocComment.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JDocComment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java
index 63dde62..1f69c2f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpr.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpr.java
index 4ae2f99..27fe464 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpr.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpr.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,11 +57,11 @@
     }
 
     public static JInvocation invoke(JMethod method) {
-        return new JInvocation((JExpression)null,method.name());
+        return new JInvocation((JExpression)null,method);
     }
 
     public static JInvocation invoke(JExpression lhs, JMethod method) {
-        return new JInvocation(lhs, method.name());
+        return new JInvocation(lhs, method);
     }
 
     public static JInvocation invoke(JExpression lhs, String method) {
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpression.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpression.java
index e9873b5..70f4844 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpression.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpression.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpressionImpl.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpressionImpl.java
index 8cdcb06..9eb188e 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JExpressionImpl.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JExpressionImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldRef.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldRef.java
index 17737c4..fae0e82 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldRef.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldVar.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldVar.java
index f7b2b26..65023c4 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldVar.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldVar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JForEach.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JForEach.java
index d2860a2..fd7c1bd 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JForEach.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JForEach.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
@@ -34,17 +33,17 @@
  */
 public final class JForEach implements JStatement {
 
-        private final JType type;
-        private final String var;
-        private JBlock body = null; // lazily created
-        private final JExpression collection;
+    private final JType type;
+    private final String var;
+    private JBlock body = null; // lazily created
+    private final JExpression collection;
     private final JVar loopVar;
 
-        public JForEach(JType vartype, String variable, JExpression collection) {
+    public JForEach(JType vartype, String variable, JExpression collection) {
 
-                this.type = vartype;
-                this.var = variable;
-                this.collection = collection;
+        this.type = vartype;
+        this.var = variable;
+        this.collection = collection;
         loopVar = new JVar(JMods.forVar(JMod.NONE), type, var, collection);
     }
 
@@ -52,24 +51,24 @@
     /**
      * Returns a reference to the loop variable.
      */
-        public JVar var() {
-                return loopVar;
-        }
+    public JVar var() {
+        return loopVar;
+    }
 
-        public JBlock body() {
-                if (body == null)
-                        body = new JBlock();
-                return body;
-        }
+    public JBlock body() {
+        if (body == null)
+            body = new JBlock();
+        return body;
+    }
 
-        public void state(JFormatter f) {
-                f.p("for (");
-                f.g(type).id(var).p(": ").g(collection);
-                f.p(')');
-                if (body != null)
-                        f.g(body).nl();
-                else
-                        f.p(';').nl();
-        }
+    public void state(JFormatter f) {
+        f.p("for (");
+        f.g(type).id(var).p(": ").g(collection);
+        f.p(')');
+        if (body != null)
+            f.g(body).nl();
+        else
+            f.p(';').nl();
+    }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JForLoop.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JForLoop.java
index b36b07f..1674853 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JForLoop.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JForLoop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JFormatter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JFormatter.java
index d7b7777..a7a9983 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JFormatter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JFormatter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerable.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerable.java
index 00bed55..95071a0 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerable.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java
index 849b057..e8c5cf2 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java
index 0623457..8fabe70 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JInvocation.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JInvocation.java
index 1e5b87f..a941cf2 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JInvocation.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JInvocation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,10 +41,15 @@
     private JGenerable object;
 
     /**
-     * Name of the method to be invoked
+     * Name of the method to be invoked.
+     * Either this field is set, or {@link #method}, or {@link #type} (in which case it's a
+     * constructor invocation.)
+     * This allows {@link JMethod#name(String) the name of the method to be changed later}.
      */
     private String name;
 
+    private JMethod method;
+
     private boolean isConstructor = false;
 
     /**
@@ -72,6 +77,10 @@
         this( (JGenerable)object, name );
     }
 
+    JInvocation(JExpression object, JMethod method) {
+        this( (JGenerable)object, method );
+    }
+
     /**
      * Invokes a static method on a class.
      */
@@ -79,14 +88,22 @@
         this( (JGenerable)type, name );
     }
 
+    JInvocation(JClass type, JMethod method) {
+        this( (JGenerable)type, method );
+    }
+
     private JInvocation(JGenerable object, String name) {
         this.object = object;
         if (name.indexOf('.') >= 0)
-            throw new IllegalArgumentException("JClass name contains '.': "
-                                               + name);
+            throw new IllegalArgumentException("method name contains '.': " + name);
         this.name = name;
     }
 
+    private JInvocation(JGenerable object, JMethod method) {
+        this.object = object;
+        this.method =method;
+    }
+
     /**
      * Invokes a constructor of an object (i.e., creates
      * a new object.)
@@ -131,10 +148,15 @@
         } else {
             if (isConstructor)
                 f.p("new").g(type).p('(');
-            else if (object != null)
-                f.g(object).p('.').p(name).p('(');
-            else
-                f.id(name).p('(');
+            else {
+                String name = this.name;
+                if(name==null)  name=this.method.name();
+
+                if (object != null)
+                    f.g(object).p('.').p(name).p('(');
+                else
+                    f.id(name).p('(');
+            }
         }
 
         f.g(args);
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JJavaName.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JJavaName.java
index 3cf2c87..6b56e92 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JJavaName.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JJavaName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,13 @@
     }
 
     /**
+     * Checks if the given string is a valid fully qualified name.
+     */
+    public static boolean isFullyQualifiedClassName(String s) {
+        return isJavaPackageName(s);
+    }
+
+    /**
      * Checks if the given string is a valid Java package name.
      */
     public static boolean isJavaPackageName(String s) {
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JLabel.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JLabel.java
index 84a4b57..e46ba3d 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JLabel.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JLabel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JMethod.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JMethod.java
index 13c3c8b..b3d9f62 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JMethod.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JMethod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,49 +38,49 @@
  */
 public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotatable {
 
-        /**
-         * Modifiers for this method
-         */
-        private JMods mods;
+    /**
+     * Modifiers for this method
+     */
+    private JMods mods;
 
-        /**
-         * Return type for this method
-         */
-        private JType type = null;
+    /**
+     * Return type for this method
+     */
+    private JType type = null;
 
-        /**
-         * Name of this method
-         */
-        private String name = null;
+    /**
+     * Name of this method
+     */
+    private String name = null;
 
-        /**
-         * List of parameters for this method's declaration
-         */
-        private final List<JVar> params = new ArrayList<JVar>();
+    /**
+     * List of parameters for this method's declaration
+     */
+    private final List<JVar> params = new ArrayList<JVar>();
 
-        /**
-         * Set of exceptions that this method may throw.
+    /**
+     * Set of exceptions that this method may throw.
      * A set instance lazily created.
-         */
-        private Set<JClass> _throws;
+     */
+    private Set<JClass> _throws;
 
-        /**
-         * JBlock of statements that makes up the body this method
-         */
-        private JBlock body = null;
+    /**
+     * JBlock of statements that makes up the body this method
+     */
+    private JBlock body = null;
 
-        private JDefinedClass outer;
+    private JDefinedClass outer;
 
-        /**
-         * javadoc comments for this JMethod
-         */
-        private JDocComment jdoc = null;
+    /**
+     * javadoc comments for this JMethod
+     */
+    private JDocComment jdoc = null;
 
-        /**
-         * Variable parameter for this method's varargs declaration
-         * introduced in J2SE 1.5
-         */
-        private JVar varParam = null;
+    /**
+     * Variable parameter for this method's varargs declaration
+     * introduced in J2SE 1.5
+     */
+    private JVar varParam = null;
 
     /**
      * Annotations on this variable. Lazily created.
@@ -88,9 +88,9 @@
     private List<JAnnotationUse> annotations = null;
 
 
-        private boolean isConstructor() {
-                return type == null;
-        }
+    private boolean isConstructor() {
+        return type == null;
+    }
 
     /** To set the default value for the
      *  annotation member
@@ -98,40 +98,40 @@
     private JExpression defaultValue = null;
 
 
-        /**
-         * JMethod constructor
-         *
-         * @param mods
-         *        Modifiers for this method's declaration
-         *
-         * @param type
-         *        Return type for the method
-         *
-         * @param name
-         *        Name of this method
-         */
-        JMethod(JDefinedClass outer, int mods, JType type, String name) {
-                this.mods = JMods.forMethod(mods);
-                this.type = type;
-                this.name = name;
-                this.outer = outer;
-        }
+    /**
+     * JMethod constructor
+     *
+     * @param mods
+     *        Modifiers for this method's declaration
+     *
+     * @param type
+     *        Return type for the method
+     *
+     * @param name
+     *        Name of this method
+     */
+    JMethod(JDefinedClass outer, int mods, JType type, String name) {
+        this.mods = JMods.forMethod(mods);
+        this.type = type;
+        this.name = name;
+        this.outer = outer;
+    }
 
-        /**
-         * Constructor constructor
-         *
-         * @param mods
-         *        Modifiers for this constructor's declaration
-         *
-         * @param _class
-         *        JClass containing this constructor
-         */
-        JMethod(int mods, JDefinedClass _class) {
-                this.mods = JMods.forMethod(mods);
-                this.type = null;
-                this.name = _class.name();
-                this.outer = _class;
-        }
+    /**
+     * Constructor constructor
+     *
+     * @param mods
+     *        Modifiers for this constructor's declaration
+     *
+     * @param _class
+     *        JClass containing this constructor
+     */
+    JMethod(int mods, JDefinedClass _class) {
+        this.mods = JMods.forMethod(mods);
+        this.type = null;
+        this.name = _class.name();
+        this.outer = _class;
+    }
 
     private Set<JClass> getThrows() {
         if(_throws==null)
@@ -139,56 +139,56 @@
         return _throws;
     }
 
-        /**
-         * Add an exception to the list of exceptions that this
-         * method may throw.
-         *
-         * @param exception
-         *        Name of an exception that this method may throw
-         */
-        public JMethod _throws(JClass exception) {
+    /**
+     * Add an exception to the list of exceptions that this
+     * method may throw.
+     *
+     * @param exception
+     *        Name of an exception that this method may throw
+     */
+    public JMethod _throws(JClass exception) {
         getThrows().add(exception);
-                return this;
-        }
+        return this;
+    }
 
-        public JMethod _throws(Class exception) {
-                return _throws(outer.owner().ref(exception));
-        }
+    public JMethod _throws(Class exception) {
+        return _throws(outer.owner().ref(exception));
+    }
 
-        /**
-         * Add the specified variable to the list of parameters
-         * for this method signature.
-         *
-         * @param type
-         *        JType of the parameter being added
-         *
-         * @param name
-         *        Name of the parameter being added
-         *
-         * @return New parameter variable
-         */
-        public JVar param(int mods, JType type, String name) {
-                JVar v = new JVar(JMods.forVar(mods), type, name, null);
-                params.add(v);
-                return v;
-        }
+    /**
+     * Add the specified variable to the list of parameters
+     * for this method signature.
+     *
+     * @param type
+     *        JType of the parameter being added
+     *
+     * @param name
+     *        Name of the parameter being added
+     *
+     * @return New parameter variable
+     */
+    public JVar param(int mods, JType type, String name) {
+        JVar v = new JVar(JMods.forVar(mods), type, name, null);
+        params.add(v);
+        return v;
+    }
 
-        public JVar param(JType type, String name) {
-                return param(JMod.NONE, type, name);
-        }
+    public JVar param(JType type, String name) {
+        return param(JMod.NONE, type, name);
+    }
 
-        public JVar param(int mods, Class type, String name) {
-                return param(mods, outer.owner()._ref(type), name);
-        }
+    public JVar param(int mods, Class type, String name) {
+        return param(mods, outer.owner()._ref(type), name);
+    }
 
-        public JVar param(Class type, String name) {
-                return param(outer.owner()._ref(type), name);
-        }
+    public JVar param(Class type, String name) {
+        return param(outer.owner()._ref(type), name);
+    }
 
-        /**
-         * @see #varParam(JType, String)
-         */
-        public JVar varParam(Class type, String name) {
+    /**
+     * @see #varParam(JType, String)
+     */
+    public JVar varParam(Class type, String name) {
         return varParam(outer.owner()._ref(type),name);
     }
 
@@ -210,25 +210,25 @@
      *      method signature.
      */
     public JVar varParam(JType type, String name) {
-                if (!hasVarArgs()) {
+        if (!hasVarArgs()) {
 
             varParam =
-                                new JVar(
-                                        JMods.forVar(JMod.NONE),
-                                        type.array(),
-                                        name,
-                                        null);
-                        return varParam;
-                } else {
-                        throw new IllegalStateException(
-                                "Cannot have two varargs in a method,\n"
-                                        + "Check if varParam method of JMethod is"
-                                        + " invoked more than once");
-
-                }
+                new JVar(
+                    JMods.forVar(JMod.NONE),
+                    type.array(),
+                    name,
+                    null);
+            return varParam;
+        } else {
+            throw new IllegalStateException(
+                "Cannot have two varargs in a method,\n"
+                    + "Check if varParam method of JMethod is"
+                    + " invoked more than once");
 
         }
 
+    }
+
     /**
      * Adds an annotation to this variable.
      * @param clazz
@@ -256,92 +256,106 @@
         return TypedAnnotationWriter.create(clazz,this);
     }
 
-        /**
-         * Check if there are any varargs declared
-         * for this method signature.
-         */
-        public boolean hasVarArgs() {
-                return this.varParam!=null;
-        }
+    /**
+     * Check if there are any varargs declared
+     * for this method signature.
+     */
+    public boolean hasVarArgs() {
+        return this.varParam!=null;
+    }
 
-        public String name() {
-                return name;
-        }
+    public String name() {
+        return name;
+    }
 
-        /**
-         * Returns the return type.
-         */
-        public JType type() {
-                return type;
-        }
+    /**
+     * Changes the name of the method.
+     */
+    public void name(String n) {
+        this.name = n;
+    }
 
-        /**
-         * Returns all the parameter types in an array.
-         * @return
-         *      If there's no parameter, an empty array will be returned.
-         */
-        public JType[] listParamTypes() {
-                JType[] r = new JType[params.size()];
-                for (int i = 0; i < r.length; i++)
-                        r[i] = params.get(i).type();
-                return r;
-        }
+    /**
+     * Returns the return type.
+     */
+    public JType type() {
+        return type;
+    }
 
-        /**
-         * Returns  the varags parameter type.
-         * @return
-         * If there's no vararg parameter type, null will be returned.
-         */
-        public JType listVarParamType() {
-                if (varParam != null)
-                        return varParam.type();
-                else
-                        return null;
-        }
+    /**
+     * Overrides the return type.
+     */
+    public void type(JType t) {
+        this.type = t;
+    }
 
-        /**
-         * Returns all the parameters in an array.
-         * @return
-         *      If there's no parameter, an empty array will be returned.
-         */
-        public JVar[] listParams() {
-                return params.toArray(new JVar[params.size()]);
-        }
+    /**
+     * Returns all the parameter types in an array.
+     * @return
+     *      If there's no parameter, an empty array will be returned.
+     */
+    public JType[] listParamTypes() {
+        JType[] r = new JType[params.size()];
+        for (int i = 0; i < r.length; i++)
+            r[i] = params.get(i).type();
+        return r;
+    }
 
-        /**
-         * Returns the variable parameter
-         * @return
-         *      If there's no parameter, null will be returned.
-         */
-        public JVar listVarParam() {
-                return varParam;
-        }
+    /**
+     * Returns  the varags parameter type.
+     * @return
+     * If there's no vararg parameter type, null will be returned.
+     */
+    public JType listVarParamType() {
+        if (varParam != null)
+            return varParam.type();
+        else
+            return null;
+    }
 
-        /**
-         * Returns true if the method has the specified signature.
-         */
-        public boolean hasSignature(JType[] argTypes) {
-                JVar[] p = listParams();
-                if (p.length != argTypes.length)
-                        return false;
+    /**
+     * Returns all the parameters in an array.
+     * @return
+     *      If there's no parameter, an empty array will be returned.
+     */
+    public JVar[] listParams() {
+        return params.toArray(new JVar[params.size()]);
+    }
 
-                for (int i = 0; i < p.length; i++)
-                        if (!p[i].type().equals(argTypes[i]))
-                                return false;
+    /**
+     * Returns the variable parameter
+     * @return
+     *      If there's no parameter, null will be returned.
+     */
+    public JVar listVarParam() {
+        return varParam;
+    }
 
-                return true;
-        }
+    /**
+     * Returns true if the method has the specified signature.
+     */
+    public boolean hasSignature(JType[] argTypes) {
+        JVar[] p = listParams();
+        if (p.length != argTypes.length)
+            return false;
 
-        /**
-         * Get the block that makes up body of this method
-         *
-         * @return Body of method
-         */
-        public JBlock body() {
-                if (body == null)
-                        body = new JBlock();
-                return body;
-        }
+        for (int i = 0; i < p.length; i++)
+            if (!p[i].type().equals(argTypes[i]))
+                return false;
+
+        return true;
+    }
+
+    /**
+     * Get the block that makes up body of this method
+     *
+     * @return Body of method
+     */
+    public JBlock body() {
+        if (body == null)
+            body = new JBlock();
+        return body;
+    }
 
     /**
      * Specify the default value for this annotation member
@@ -353,37 +367,37 @@
         this.defaultValue = value;
     }
 
-        /**
-         * Creates, if necessary, and returns the class javadoc for this
-         * JDefinedClass
-         *
-         * @return JDocComment containing javadocs for this class
-         */
-        public JDocComment javadoc() {
-                if (jdoc == null)
-                        jdoc = new JDocComment(owner());
-                return jdoc;
-        }
+    /**
+     * Creates, if necessary, and returns the class javadoc for this
+     * JDefinedClass
+     *
+     * @return JDocComment containing javadocs for this class
+     */
+    public JDocComment javadoc() {
+        if (jdoc == null)
+            jdoc = new JDocComment(owner());
+        return jdoc;
+    }
 
-        public void declare(JFormatter f) {
-                if (jdoc != null)
-                        f.g(jdoc);
+    public void declare(JFormatter f) {
+        if (jdoc != null)
+            f.g(jdoc);
 
         if (annotations != null){
             for (JAnnotationUse a : annotations)
                 f.g(a).nl();
         }
 
-                // declare the generics parameters
-                super.declare(f);
+        // declare the generics parameters
+        super.declare(f);
 
-                f.g(mods);
-                if (!isConstructor())
-                        f.g(type);
-                f.id(name).p('(').i();
+        f.g(mods);
+        if (!isConstructor())
+            f.g(type);
+        f.id(name).p('(').i();
         // when parameters are printed in new lines, we want them to be indented.
         // there's a good chance no newlines happen, too, but just in case it does.
-                boolean first = true;
+        boolean first = true;
         for (JVar var : params) {
             if (!first)
                 f.p(',');
@@ -392,33 +406,33 @@
             f.b(var);
             first = false;
         }
-                if (hasVarArgs()) {
-                        if (!first)
-                                f.p(',');
-                        f.g(varParam.type().elementType());
-                        f.p("... ");
-                        f.id(varParam.name());
-                }
+        if (hasVarArgs()) {
+            if (!first)
+                f.p(',');
+            f.g(varParam.type().elementType());
+            f.p("... ");
+            f.id(varParam.name());
+        }
 
-                f.o().p(')');
-                if (_throws!=null && !_throws.isEmpty()) {
-                        f.nl().i().p("throws").g(_throws).nl().o();
-                }
+        f.o().p(')');
+        if (_throws!=null && !_throws.isEmpty()) {
+            f.nl().i().p("throws").g(_throws).nl().o();
+        }
 
         if (defaultValue != null) {
             f.p("default ");
             f.g(defaultValue);
         }
-                if (body != null) {
-                        f.s(body);
-                } else if (
-                        !outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) {
-                        // Print an empty body for non-native, non-abstract methods
-                        f.s(new JBlock());
-                } else {
-                        f.p(';').nl();
-                }
+        if (body != null) {
+            f.s(body);
+        } else if (
+            !outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) {
+            // Print an empty body for non-native, non-abstract methods
+            f.s(new JBlock());
+        } else {
+            f.p(';').nl();
         }
+    }
 
     /**
      * @return
@@ -433,10 +447,10 @@
      * @deprecated use {@link #mods()}
      */
     public JMods getMods() {
-                return mods;
-        }
+        return mods;
+    }
 
-        protected JCodeModel owner() {
-                return outer.owner();
-        }
+    protected JCodeModel owner() {
+        return outer.owner();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JMod.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JMod.java
index 0f32e76..64e0c93 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JMod.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JMod.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JMods.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JMods.java
index daf5b85..60aad8f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JMods.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JMods.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,17 +41,17 @@
         = JMod.FINAL;
 
     private static int FIELD
-        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
-           | JMod.STATIC | JMod.FINAL
-           | JMod.TRANSIENT | JMod.VOLATILE);
+    = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
+       | JMod.STATIC | JMod.FINAL
+       | JMod.TRANSIENT | JMod.VOLATILE);
 
     private static int METHOD
-        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL
-           | JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED);
+    = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL
+       | JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED);
 
     private static int CLASS
-        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
-           | JMod.STATIC | JMod.FINAL | JMod.ABSTRACT );
+    = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
+       | JMod.STATIC | JMod.FINAL | JMod.ABSTRACT );
 
     private static int INTERFACE = JMod.PUBLIC;
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java
index dc136f4..3320e7d 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JNullType.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JNullType.java
index 7be3c06..93ff049 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JNullType.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JNullType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JOp.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JOp.java
index cd43654..23f75d5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JOp.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JOp.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JPackage.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JPackage.java
index 76b0252..e26a961 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JPackage.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JPackage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java
index 8e6fbfe..f1c9283 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JResourceFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JResourceFile.java
index d1e0925..c88d370 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JResourceFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JResourceFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JReturn.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JReturn.java
index 7df5214..a690732 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JReturn.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JReturn.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JStatement.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JStatement.java
index 51a9492..8df7b37 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JStatement.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JStatement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java
index 6178a58..afe70124 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JSwitch.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JSwitch.java
index 1bb0bdb..44af487 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JSwitch.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JSwitch.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JThrow.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JThrow.java
index 7bf099f..050cf8a 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JThrow.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JThrow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JTryBlock.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JTryBlock.java
index 35cc1e5..1739e13 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JTryBlock.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JTryBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JType.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JType.java
index 489cc17..b208d49 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JType.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeVar.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeVar.java
index ce9c8ba..de74568 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeVar.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeVar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java
index 4bb2511..9412d3e 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JVar.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JVar.java
index 0a94f73..15b0c4f 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JVar.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JVar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/JWhileLoop.java b/jaxws/src/share/classes/com/sun/codemodel/internal/JWhileLoop.java
index 4c67388..930e2be 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/JWhileLoop.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JWhileLoop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java
index 11fa7e3..b58d1f5 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal;
 
 import java.lang.reflect.InvocationHandler;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java
index f53937f..61a22e8 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.fmt;
 
 import java.io.ByteArrayOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java
index 67c09b7..81e29f0 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.fmt;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java
index 68e8b8d..1245264 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java
index 3c5d912..450aac3 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.fmt;
 
 import java.io.DataInputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java
index 234b768..00d88e8 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.fmt;
 
 import java.io.BufferedReader;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java
index ee9b629..dbc44da 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.fmt;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/package.html b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/package.html
index c5227a2..2493ed4 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/package.html
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <HTML>
 <BODY>
 Various resource file formats (classes that implement <code>JResourceFile</code>).
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/package-info.java b/jaxws/src/share/classes/com/sun/codemodel/internal/package-info.java
index 45f2d5f..aa7a169 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/package-info.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * <h1>Library for generating Java source code</h1>.
  *
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
index 4087436..46b4270 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.util;
 
 import java.util.Comparator;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
index c4d3f07..c759b2b 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: EncoderFactory.java,v 1.3 2005/09/10 19:07:33 kohsuke Exp $
+ */
+
 
 package com.sun.codemodel.internal.util;
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
index d8947ff..6db471e 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.util;
 
 import java.io.FilterWriter;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
index 2dbcd78..4fa9979 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: MS1252Encoder.java,v 1.2 2005/09/10 19:07:33 kohsuke Exp $
+ */
+
 
 package com.sun.codemodel.internal.util;
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
index 3f0d313..3e025a7 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,10 @@
  * have any questions.
  */
 
+/*
+ * @(#)SingleByteEncoder.java       1.14 03/01/23
+ */
+
 package com.sun.codemodel.internal.util;
 
 import java.nio.ByteBuffer;
@@ -47,109 +51,109 @@
     private final Surrogate.Parser sgp = new Surrogate.Parser();
 
     protected SingleByteEncoder(Charset cs,
-                                short[] index1, String index2,
-                                int mask1, int mask2, int shift)
+                            short[] index1, String index2,
+                            int mask1, int mask2, int shift)
     {
-        super(cs, 1.0f, 1.0f);
-        this.index1 = index1;
-        this.index2 = index2;
-        this.mask1 = mask1;
-        this.mask2 = mask2;
-        this.shift = shift;
+       super(cs, 1.0f, 1.0f);
+       this.index1 = index1;
+       this.index2 = index2;
+       this.mask1 = mask1;
+       this.mask2 = mask2;
+       this.shift = shift;
     }
 
     public boolean canEncode(char c) {
-        char testEncode;
-        testEncode = index2.charAt(index1[(c & mask1) >> shift]
-                                   + (c & mask2));
-        if (testEncode == '\u0000')
-            return false;
-        else
-            return true;
+       char testEncode;
+       testEncode = index2.charAt(index1[(c & mask1) >> shift]
+                               + (c & mask2));
+       if (testEncode == '\u0000')
+           return false;
+       else
+           return true;
     }
 
     private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
-        char[] sa = src.array();
-        int sp = src.arrayOffset() + src.position();
-        int sl = src.arrayOffset() + src.limit();
-        sp = (sp <= sl ? sp : sl);
-        byte[] da = dst.array();
-        int dp = dst.arrayOffset() + dst.position();
-        int dl = dst.arrayOffset() + dst.limit();
-        dp = (dp <= dl ? dp : dl);
+       char[] sa = src.array();
+       int sp = src.arrayOffset() + src.position();
+       int sl = src.arrayOffset() + src.limit();
+       sp = (sp <= sl ? sp : sl);
+       byte[] da = dst.array();
+       int dp = dst.arrayOffset() + dst.position();
+       int dl = dst.arrayOffset() + dst.limit();
+       dp = (dp <= dl ? dp : dl);
 
-        try {
-            while (sp < sl) {
-                char c = sa[sp];
-                if (Surrogate.is(c)) {
-                    if (sgp.parse(c, sa, sp, sl) < 0)
-                        return sgp.error();
-                    return sgp.unmappableResult();
-                }
-                if (c >= '\uFFFE')
-                    return CoderResult.unmappableForLength(1);
-                if (dl - dp < 1)
-                    return CoderResult.OVERFLOW;
+       try {
+           while (sp < sl) {
+              char c = sa[sp];
+              if (Surrogate.is(c)) {
+                  if (sgp.parse(c, sa, sp, sl) < 0)
+                     return sgp.error();
+                  return sgp.unmappableResult();
+              }
+              if (c >= '\uFFFE')
+                  return CoderResult.unmappableForLength(1);
+              if (dl - dp < 1)
+                  return CoderResult.OVERFLOW;
 
-                char e = index2.charAt(index1[(c & mask1) >> shift]
-                                       + (c & mask2));
+              char e = index2.charAt(index1[(c & mask1) >> shift]
+                                   + (c & mask2));
 
-                // If output byte is zero because input char is zero
-                // then character is mappable, o.w. fail
-                if (e == '\u0000' && c != '\u0000')
-                    return CoderResult.unmappableForLength(1);
+              // If output byte is zero because input char is zero
+              // then character is mappable, o.w. fail
+              if (e == '\u0000' && c != '\u0000')
+                  return CoderResult.unmappableForLength(1);
 
-                sp++;
-                da[dp++] = (byte)e;
-            }
-            return CoderResult.UNDERFLOW;
-        } finally {
-            src.position(sp - src.arrayOffset());
-            dst.position(dp - dst.arrayOffset());
-        }
+              sp++;
+              da[dp++] = (byte)e;
+           }
+           return CoderResult.UNDERFLOW;
+       } finally {
+           src.position(sp - src.arrayOffset());
+           dst.position(dp - dst.arrayOffset());
+       }
     }
 
     private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
-        int mark = src.position();
-        try {
-            while (src.hasRemaining()) {
-                char c = src.get();
-                if (Surrogate.is(c)) {
-                    if (sgp.parse(c, src) < 0)
-                        return sgp.error();
-                    return sgp.unmappableResult();
-                }
-                if (c >= '\uFFFE')
-                    return CoderResult.unmappableForLength(1);
-                if (!dst.hasRemaining())
-                    return CoderResult.OVERFLOW;
+       int mark = src.position();
+       try {
+           while (src.hasRemaining()) {
+              char c = src.get();
+              if (Surrogate.is(c)) {
+                  if (sgp.parse(c, src) < 0)
+                     return sgp.error();
+                  return sgp.unmappableResult();
+              }
+              if (c >= '\uFFFE')
+                  return CoderResult.unmappableForLength(1);
+              if (!dst.hasRemaining())
+                  return CoderResult.OVERFLOW;
 
-                char e = index2.charAt(index1[(c & mask1) >> shift]
-                                       + (c & mask2));
+              char e = index2.charAt(index1[(c & mask1) >> shift]
+                                   + (c & mask2));
 
-                // If output byte is zero because input char is zero
-                // then character is mappable, o.w. fail
-                if (e == '\u0000' && c != '\u0000')
-                    return CoderResult.unmappableForLength(1);
+              // If output byte is zero because input char is zero
+              // then character is mappable, o.w. fail
+              if (e == '\u0000' && c != '\u0000')
+                  return CoderResult.unmappableForLength(1);
 
-                mark++;
-                dst.put((byte)e);
-            }
-            return CoderResult.UNDERFLOW;
-        } finally {
-            src.position(mark);
-        }
+              mark++;
+              dst.put((byte)e);
+           }
+           return CoderResult.UNDERFLOW;
+       } finally {
+           src.position(mark);
+       }
     }
 
     protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
-        if (true && src.hasArray() && dst.hasArray())
-            return encodeArrayLoop(src, dst);
-        else
-            return encodeBufferLoop(src, dst);
+       if (true && src.hasArray() && dst.hasArray())
+           return encodeArrayLoop(src, dst);
+       else
+           return encodeBufferLoop(src, dst);
     }
 
     public byte encode(char inputChar) {
-        return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
-                (inputChar & mask2));
+       return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
+              (inputChar & mask2));
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
index 0081f24..9cf6b21 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
  * Utility class for dealing with surrogates.
  *
  * @author Mark Reinhold
+ * @version 1.11, 03/01/23
  */
 
 class Surrogate {
@@ -111,7 +112,7 @@
 
         public Parser() { }
 
-        private int character;          // UCS-4
+        private int character;                // UCS-4
         private CoderResult error = CoderResult.UNDERFLOW;
         private boolean isPair;
 
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
index 549c89c..ad09f15 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.util;
 
 import java.io.FilterWriter;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
index 58cd9d7..5a55423 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
index cad99ce..1523d1a 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.OutputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
index 4b923ad..1bf8f845 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
index cb785a7..cbb5b20 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
index 52b9597..10740df 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.FilterOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
index 44975d9..0d34599 100644
--- a/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.codemodel.internal.writer;
 
 import java.io.FilterOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java b/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
index 7419349..b11eb1b 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ByteArrayDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import javax.activation.DataSource;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java b/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
index 357e6ff..6cc67b4 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/FinalArrayList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java b/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
index 81a71be..c9b7772 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/FragmentContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import org.xml.sax.helpers.XMLFilterImpl;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Interned.java b/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
index 17bf5c3..26e6bff 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Interned.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java b/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
index b8a103c..f31eb46 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/NotNull.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java b/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
index 2a785fe..269d249 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import java.lang.annotation.Documented;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/Pool.java b/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
index 6740521..957a336 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/Pool.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import java.util.concurrent.ConcurrentLinkedQueue;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java b/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
index 99fb663..558d8ce 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/SAXException2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java b/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
index dfd68fe..0c6095f 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/SAXParseException2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal;
 
 import org.xml.sax.SAXParseException;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java
new file mode 100644
index 0000000..c88f6ae
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.Location;
+
+/**
+ * {@link XMLStreamException} that properly handles exception chaining.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class XMLStreamException2 extends XMLStreamException {
+    public XMLStreamException2(String msg) {
+        super(msg);
+    }
+
+    public XMLStreamException2(Throwable th) {
+        super(th);
+    }
+
+    public XMLStreamException2(String msg, Throwable th) {
+        super(msg, th);
+    }
+
+    public XMLStreamException2(String msg, Location location) {
+        super(msg, location);
+    }
+
+    public XMLStreamException2(String msg, Location location, Throwable th) {
+        super(msg, location, th);
+    }
+
+    /**
+     * {@link XMLStreamException} doesn't return the correct cause.
+     */
+    public Throwable getCause() {
+        return getNestedException();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java
new file mode 100644
index 0000000..cf6c0d4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java
@@ -0,0 +1,361 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.Locator;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.AttributesImpl;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.namespace.QName;
+
+/**
+ * This is a simple utility class that adapts StAX events from an
+ * {@link XMLStreamReader} to SAX events on a
+ * {@link ContentHandler}, bridging between the two
+ * parser technologies.
+ *
+ * @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
+ */
+public class XMLStreamReaderToContentHandler {
+
+    // StAX event source
+    private final XMLStreamReader staxStreamReader;
+
+    // SAX event sink
+    private final ContentHandler saxHandler;
+
+    // if true, when the conversion is completed, leave the cursor to the last
+    // event that was fired (such as end element)
+    private boolean eagerQuit;
+
+    /**
+     * If true, not start/endDocument event.
+     */
+    private boolean fragment;
+
+    /**
+     * Construct a new StAX to SAX adapter that will convert a StAX event
+     * stream into a SAX event stream.
+     *
+     * @param staxCore
+     *                StAX event source
+     * @param saxCore
+     *                SAXevent sink
+     */
+    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit, boolean fragment) {
+        this.staxStreamReader = staxCore;
+        this.saxHandler = saxCore;
+        this.eagerQuit = eagerQuit;
+        this.fragment = fragment;
+    }
+
+    /*
+     * @see StAXReaderToContentHandler#bridge()
+     */
+    public void bridge() throws XMLStreamException {
+
+        try {
+            // remembers the nest level of elements to know when we are done.
+            int depth=0;
+
+            // if the parser is at the start tag, proceed to the first element
+            int event = staxStreamReader.getEventType();
+            if(event == XMLStreamConstants.START_DOCUMENT) {
+                // nextTag doesn't correctly handle DTDs
+                while( !staxStreamReader.isStartElement() )
+                    event = staxStreamReader.next();
+            }
+
+
+            if( event!=XMLStreamConstants.START_ELEMENT)
+                throw new IllegalStateException("The current event is not START_ELEMENT\n but " + event);
+
+            handleStartDocument();
+
+            OUTER:
+            do {
+                // These are all of the events listed in the javadoc for
+                // XMLEvent.
+                // The spec only really describes 11 of them.
+                switch (event) {
+                    case XMLStreamConstants.START_ELEMENT :
+                        depth++;
+                        handleStartElement();
+                        break;
+                    case XMLStreamConstants.END_ELEMENT :
+                        handleEndElement();
+                        depth--;
+                        if(depth==0 && eagerQuit)
+                            break OUTER;
+                        break;
+                    case XMLStreamConstants.CHARACTERS :
+                        handleCharacters();
+                        break;
+                    case XMLStreamConstants.ENTITY_REFERENCE :
+                        handleEntityReference();
+                        break;
+                    case XMLStreamConstants.PROCESSING_INSTRUCTION :
+                        handlePI();
+                        break;
+                    case XMLStreamConstants.COMMENT :
+                        handleComment();
+                        break;
+                    case XMLStreamConstants.DTD :
+                        handleDTD();
+                        break;
+                    case XMLStreamConstants.ATTRIBUTE :
+                        handleAttribute();
+                        break;
+                    case XMLStreamConstants.NAMESPACE :
+                        handleNamespace();
+                        break;
+                    case XMLStreamConstants.CDATA :
+                        handleCDATA();
+                        break;
+                    case XMLStreamConstants.ENTITY_DECLARATION :
+                        handleEntityDecl();
+                        break;
+                    case XMLStreamConstants.NOTATION_DECLARATION :
+                        handleNotationDecl();
+                        break;
+                    case XMLStreamConstants.SPACE :
+                        handleSpace();
+                        break;
+                    default :
+                        throw new InternalError("processing event: " + event);
+                }
+
+                event=staxStreamReader.next();
+            } while (depth!=0);
+
+            handleEndDocument();
+        } catch (SAXException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    private void handleEndDocument() throws SAXException {
+        if(fragment)
+            return;
+
+        saxHandler.endDocument();
+    }
+
+    private void handleStartDocument() throws SAXException {
+        if(fragment)
+            return;
+
+        saxHandler.setDocumentLocator(new Locator() {
+            public int getColumnNumber() {
+                return staxStreamReader.getLocation().getColumnNumber();
+            }
+            public int getLineNumber() {
+                return staxStreamReader.getLocation().getLineNumber();
+            }
+            public String getPublicId() {
+                return staxStreamReader.getLocation().getPublicId();
+            }
+            public String getSystemId() {
+                return staxStreamReader.getLocation().getSystemId();
+            }
+        });
+        saxHandler.startDocument();
+    }
+
+    private void handlePI() throws XMLStreamException {
+        try {
+            saxHandler.processingInstruction(
+                staxStreamReader.getPITarget(),
+                staxStreamReader.getPIData());
+        } catch (SAXException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    private void handleCharacters() throws XMLStreamException {
+        try {
+            saxHandler.characters(
+                staxStreamReader.getTextCharacters(),
+                staxStreamReader.getTextStart(),
+                staxStreamReader.getTextLength() );
+        } catch (SAXException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    private void handleEndElement() throws XMLStreamException {
+        QName qName = staxStreamReader.getName();
+
+        try {
+            String pfix = qName.getPrefix();
+            String rawname = (pfix == null || pfix.length() == 0)
+                    ? qName.getLocalPart()
+                    : pfix + ':' + qName.getLocalPart();
+            // fire endElement
+            saxHandler.endElement(
+                qName.getNamespaceURI(),
+                qName.getLocalPart(),
+                rawname);
+
+            // end namespace bindings
+            int nsCount = staxStreamReader.getNamespaceCount();
+            for (int i = nsCount - 1; i >= 0; i--) {
+                String prefix = staxStreamReader.getNamespacePrefix(i);
+                if (prefix == null) { // true for default namespace
+                    prefix = "";
+                }
+                saxHandler.endPrefixMapping(prefix);
+            }
+        } catch (SAXException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    private void handleStartElement() throws XMLStreamException {
+
+        try {
+            // start namespace bindings
+            int nsCount = staxStreamReader.getNamespaceCount();
+            for (int i = 0; i < nsCount; i++) {
+                saxHandler.startPrefixMapping(
+                    fixNull(staxStreamReader.getNamespacePrefix(i)),
+                    fixNull(staxStreamReader.getNamespaceURI(i)));
+            }
+
+            // fire startElement
+            QName qName = staxStreamReader.getName();
+            String prefix = qName.getPrefix();
+            String rawname;
+            if(prefix==null || prefix.length()==0)
+                rawname = qName.getLocalPart();
+            else
+                rawname = prefix + ':' + qName.getLocalPart();
+            Attributes attrs = getAttributes();
+            saxHandler.startElement(
+                qName.getNamespaceURI(),
+                qName.getLocalPart(),
+                rawname,
+                attrs);
+        } catch (SAXException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    private static String fixNull(String s) {
+        if(s==null)     return "";
+        else            return s;
+    }
+
+    /**
+     * Get the attributes associated with the given START_ELEMENT or ATTRIBUTE
+     * StAXevent.
+     *
+     * @return the StAX attributes converted to an org.xml.sax.Attributes
+     */
+    private Attributes getAttributes() {
+        AttributesImpl attrs = new AttributesImpl();
+
+        int eventType = staxStreamReader.getEventType();
+        if (eventType != XMLStreamConstants.ATTRIBUTE
+            && eventType != XMLStreamConstants.START_ELEMENT) {
+            throw new InternalError(
+                "getAttributes() attempting to process: " + eventType);
+        }
+
+        // in SAX, namespace declarations are not part of attributes by default.
+        // (there's a property to control that, but as far as we are concerned
+        // we don't use it.) So don't add xmlns:* to attributes.
+
+        // gather non-namespace attrs
+        for (int i = 0; i < staxStreamReader.getAttributeCount(); i++) {
+            String uri = staxStreamReader.getAttributeNamespace(i);
+            if(uri==null)   uri="";
+            String localName = staxStreamReader.getAttributeLocalName(i);
+            String prefix = staxStreamReader.getAttributePrefix(i);
+            String qName;
+            if(prefix==null || prefix.length()==0)
+                qName = localName;
+            else
+                qName = prefix + ':' + localName;
+            String type = staxStreamReader.getAttributeType(i);
+            String value = staxStreamReader.getAttributeValue(i);
+
+            attrs.addAttribute(uri, localName, qName, type, value);
+        }
+
+        return attrs;
+    }
+
+    private void handleNamespace() {
+        // no-op ???
+        // namespace events don't normally occur outside of a startElement
+        // or endElement
+    }
+
+    private void handleAttribute() {
+        // no-op ???
+        // attribute events don't normally occur outside of a startElement
+        // or endElement
+    }
+
+    private void handleDTD() {
+        // no-op ???
+        // it seems like we need to pass this info along, but how?
+    }
+
+    private void handleComment() {
+        // no-op ???
+    }
+
+    private void handleEntityReference() {
+        // no-op ???
+    }
+
+    private void handleSpace() {
+        // no-op ???
+        // this event is listed in the javadoc, but not in the spec.
+    }
+
+    private void handleNotationDecl() {
+        // no-op ???
+        // this event is listed in the javadoc, but not in the spec.
+    }
+
+    private void handleEntityDecl() {
+        // no-op ???
+        // this event is listed in the javadoc, but not in the spec.
+    }
+
+    private void handleCDATA() {
+        // no-op ???
+        // this event is listed in the javadoc, but not in the spec.
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
index a977293..60a915d 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * istack-commons runtime utilities.
  */
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
index 55dd90b..2678f14 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/APTTypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.istack.internal.tools;
 
 import com.sun.mirror.type.TypeMirror;
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java
new file mode 100644
index 0000000..8159a7e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/MaskingClassLoader.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal.tools;
+
+import java.util.Collection;
+
+/**
+ * {@link ClassLoader} that masks a specified set of classes
+ * from its parent class loader.
+ *
+ * <p>
+ * This code is used to create an isolated environment.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class MaskingClassLoader extends ClassLoader {
+
+    private final String[] masks;
+
+    public MaskingClassLoader(String... masks) {
+        this.masks = masks;
+    }
+
+    public MaskingClassLoader(Collection<String> masks) {
+        this(masks.toArray(new String[masks.size()]));
+    }
+
+    public MaskingClassLoader(ClassLoader parent, String... masks) {
+        super(parent);
+        this.masks = masks;
+    }
+
+    public MaskingClassLoader(ClassLoader parent, Collection<String> masks) {
+        this(parent, masks.toArray(new String[masks.size()]));
+    }
+
+    @Override
+    protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+        for (String mask : masks) {
+            if(name.startsWith(mask))
+                throw new ClassNotFoundException();
+        }
+
+        return super.loadClass(name, resolve);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java
new file mode 100644
index 0000000..013a0aa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/ParallelWorldClassLoader.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.istack.internal.tools;
+
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Enumeration;
+
+/**
+ * Load classes/resources from a side folder, so that
+ * classes of the same package can live in a single jar file.
+ *
+ * <p>
+ * For example, with the following jar file:
+ * <pre>
+ *  /
+ *  +- foo
+ *     +- X.class
+ *  +- bar
+ *     +- X.class
+ * </pre>
+ * <p>
+ * {@link ParallelWorldClassLoader}("foo/") would load <tt>X.class<tt> from
+ * <tt>/foo/X.class</tt> (note that X is defined in the root package, not
+ * <tt>foo.X</tt>.
+ *
+ * <p>
+ * This can be combined with  {@link MaskingClassLoader} to mask classes which are loaded by the parent
+ * class loader so that the child class loader
+ * classes living in different folders are loaded
+ * before the parent class loader loads classes living the jar file publicly
+ * visible
+ * For example, with the following jar file:
+ * <pre>
+ *  /
+ *  +- foo
+ *     +- X.class
+ *  +- bar
+ *     +-foo
+ *        +- X.class
+ * </pre>
+ * <p>
+ * {@link ParallelWorldClassLoader}(MaskingClassLoader.class.getClassLoader()) would load <tt>foo.X.class<tt> from
+ * <tt>/bar/foo.X.class</tt> not the <tt>foo.X.class<tt> in the publicly visible place in the jar file, thus
+ * masking the parent classLoader from loading the class from  <tt>foo.X.class<tt>
+ * (note that X is defined in the  package foo, not
+ * <tt>bar.foo.X</tt>.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class ParallelWorldClassLoader extends ClassLoader {
+
+    /**
+     * Strings like "prefix/", "abc/", or "" to indicate
+     * classes should be loaded normally.
+     */
+    private final String prefix;
+
+    public ParallelWorldClassLoader(ClassLoader parent,String prefix) {
+        super(parent);
+        this.prefix = prefix;
+    }
+
+    protected Class findClass(String name) throws ClassNotFoundException {
+        StringBuffer sb = new StringBuffer(name.length()+prefix.length()+6);
+        sb.append(prefix).append(name.replace('.','/')).append(".class");
+
+        InputStream is = getParent().getResourceAsStream(sb.toString());
+        if (is==null)
+            throw new ClassNotFoundException(name);
+
+        try {
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            byte[] buf = new byte[1024];
+            int len;
+            while((len=is.read(buf))>=0)
+                baos.write(buf,0,len);
+
+            buf = baos.toByteArray();
+            int packIndex = name.lastIndexOf('.');
+            if (packIndex != -1) {
+                String pkgname = name.substring(0, packIndex);
+                // Check if package already loaded.
+                Package pkg = getPackage(pkgname);
+                if (pkg == null) {
+                    definePackage(pkgname, null, null, null, null, null, null, null);
+                }
+            }
+            return defineClass(name,buf,0,buf.length);
+        } catch (IOException e) {
+            throw new ClassNotFoundException(name,e);
+        }
+    }
+
+    protected URL findResource(String name) {
+        return getParent().getResource(prefix+name);
+    }
+
+    protected Enumeration<URL> findResources(String name) throws IOException {
+        return getParent().getResources(    prefix+name);
+    }
+
+    /**
+     * Given the URL inside jar, returns the URL to the jar itself.
+     */
+    public static URL toJarUrl(URL res) throws ClassNotFoundException, MalformedURLException {
+        String url = res.toExternalForm();
+        if(!url.startsWith("jar:"))
+            throw new ClassNotFoundException("Loaded outside a jar "+url);
+        url = url.substring(4); // cut off jar:
+        url = url.substring(0,url.lastIndexOf('!'));    // cut off everything after '!'
+        return new URL(url);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
index f770483..3ce8c80 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/tools/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * istack-commons tool time utilities.
  *
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java b/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
index d976cd6..c4f8f82 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
 
         if (wsAP == null) {
             AnnotationProcessorContext context = new AnnotationProcessorContext();
-            wsAP = new WebServiceAP(null, null, null, context);
+            wsAP = new WebServiceAP(null, context, null, null);
 
         }
         wsAP.init(apEnv);
diff --git a/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java b/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
index 9cf4425..31850e0 100644
--- a/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
+++ b/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 /**
  *
  * <P>This document describes the {@link com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor}
- * included with JAX-WS 2.0.
+ * included with JAX-WS 2.0.1.
  *
  * <p>The {@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl AnnoatationnProcessorFactoryImpl} class
  * tells the <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
diff --git a/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin b/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin
new file mode 100644
index 0000000..6b19c80
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin
@@ -0,0 +1,4 @@
+com.sun.tools.internal.xjc.addon.locator.SourceLocationAddOn
+com.sun.tools.internal.xjc.addon.sync.SynchronizedMethodAddOn
+com.sun.tools.internal.xjc.addon.at_generated.PluginImpl
+com.sun.tools.internal.xjc.addon.episode.PluginImpl
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
index c9afcaa..2ec4559 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index ddc5a4a..5dec6da 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 UNEXPECTED_NGCC_TOKEN = \
     Unexpected {0} appears at line {1} column {2}
 
@@ -5,15 +30,16 @@
     Non-existent directory: {0}
 
 VERSION = \
-	schemagen version "JAXB 2.0 in JDK 1.6" \n\
-	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.0 in JDK 1.6)	
+	schemagen version "JAXB 2.1.3" \n\
+	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.3 in JDK)	
 
 USAGE = \
 Usage: schemagen [-options ...] <java files> \n\
 Options: \n\
-\ \ \ \ -d <path>         :  specify where to place processor and javac generated class files \n\
-\ \ \ \ -cp <path>        :  specify where to find user specified files  \n\
-\ \ \ \ -classpath <path> :  specify where to find user specified files  \n\
-\ \ \ \ -version          :  display version information
+\ \ \ \ -d <path>         :  specify where to place processor and javac generated class files\n\
+\ \ \ \ -cp <path>        :  specify where to find user specified files\n\
+\ \ \ \ -classpath <path> :  specify where to find user specified files\n\
+\ \ \ \ -episode <file>   :  generate episode file for separate compilation\n\
+\ \ \ \ -version          :  display version information\n\
 \ \ \ \ -help             :  display this usage message
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
index b1f22f4..8a9656f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
index 8f53807..699f478 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
index ef17830..3b268d5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc;
 
 import java.io.File;
@@ -122,7 +121,7 @@
         }
 
         Class schemagenRunner = classLoader.loadClass(Runner.class.getName());
-        Method mainMethod = schemagenRunner.getDeclaredMethod("main",String[].class);
+        Method mainMethod = schemagenRunner.getDeclaredMethod("main",String[].class,File.class);
 
         List<String> aptargs = new ArrayList<String>();
 
@@ -150,7 +149,7 @@
         aptargs.addAll(options.arguments);
 
         String[] argsarray = aptargs.toArray(new String[aptargs.size()]);
-        return (Integer)mainMethod.invoke(null,new Object[]{argsarray});
+        return (Integer)mainMethod.invoke(null,new Object[]{argsarray,options.episodeFile});
     }
 
     /**
@@ -204,11 +203,15 @@
     }
 
     public static final class Runner {
-        public static int main(String[] args) throws Exception {
+        public static int main(String[] args, File episode) throws Exception {
             ClassLoader cl = Runner.class.getClassLoader();
             Class apt = cl.loadClass("com.sun.tools.apt.Main");
             Method processMethod = apt.getMethod("process",AnnotationProcessorFactory.class, String[].class);
-            return (Integer) processMethod.invoke(null, new com.sun.tools.internal.jxc.apt.SchemaGenerator(), args);
+
+            com.sun.tools.internal.jxc.apt.SchemaGenerator r = new com.sun.tools.internal.jxc.apt.SchemaGenerator();
+            if(episode!=null)
+                r.setEpisodeFile(episode);
+            return (Integer) processMethod.invoke(null, r, args);
         }
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
index 0917523..47d1fc4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.io.File;
@@ -88,7 +87,7 @@
                 // -Aconfig=foo.config:bar.config where : is the pathSeparatorChar
                 StringTokenizer st = new StringTokenizer(value,File.pathSeparator);
                 if(!st.hasMoreTokens()) {
-                    errorListener.error(null,Messages.NO_FILE_SPECIFIED.format());
+                    errorListener.error(null,Messages.OPERAND_MISSING.format(Const.CONFIG_FILE_OPTION));
                     continue;
                 }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
index ce842f9..68aa512 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.util.Arrays;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
index 6b6008b..8ec9cdb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
index 117fec7..e9a0534 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
index 553dc68..3390a5f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,21 +22,22 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationTargetException;
-import java.util.List;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
 
+import com.sun.mirror.declaration.AnnotationMirror;
+import com.sun.mirror.declaration.Declaration;
 import com.sun.mirror.declaration.FieldDeclaration;
 import com.sun.mirror.declaration.MethodDeclaration;
 import com.sun.mirror.declaration.ParameterDeclaration;
 import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.declaration.AnnotationMirror;
-import com.sun.mirror.declaration.Declaration;
 import com.sun.mirror.type.MirroredTypeException;
+import com.sun.mirror.type.MirroredTypesException;
 import com.sun.mirror.type.TypeMirror;
 import com.sun.xml.internal.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl;
 import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
@@ -67,6 +68,10 @@
         return f.getAnnotation(annotationType)!=null;
     }
 
+    public boolean hasClassAnnotation(TypeDeclaration clazz, Class<? extends Annotation> annotationType) {
+        return clazz.getAnnotation(annotationType)!=null;
+    }
+
     public Annotation[] getAllFieldAnnotations(FieldDeclaration field, Locatable srcPos) {
         return getAllAnnotations(field,srcPos);
     }
@@ -94,7 +99,8 @@
         for( AnnotationMirror m : decl.getAnnotationMirrors() ) {
             try {
                 String fullName = m.getAnnotationType().getDeclaration().getQualifiedName();
-                Class type = getClass().getClassLoader().loadClass(fullName);
+                Class<? extends Annotation> type =
+                    getClass().getClassLoader().loadClass(fullName).asSubclass(Annotation.class);
                 Annotation annotation = decl.getAnnotation(type);
                 if(annotation!=null)
                     r.add( LocatableAnnotation.create(annotation,srcPos) );
@@ -135,6 +141,26 @@
         }
     }
 
+    public TypeMirror[] getClassArrayValue(Annotation a, String name) {
+        try {
+            a.annotationType().getMethod(name).invoke(a);
+            assert false;
+            throw new IllegalStateException("should throw a MirroredTypesException");
+        } catch (IllegalAccessException e) {
+            throw new IllegalAccessError(e.getMessage());
+        } catch (InvocationTargetException e) {
+            if( e.getCause() instanceof MirroredTypesException ) {
+                MirroredTypesException me = (MirroredTypesException)e.getCause();
+                Collection<TypeMirror> r = me.getTypeMirrors();
+                return r.toArray(new TypeMirror[r.size()]);
+            }
+            // impossible
+            throw new RuntimeException(e);
+        } catch (NoSuchMethodException e) {
+            throw new NoSuchMethodError(e.getMessage());
+        }
+    }
+
     protected String fullName(MethodDeclaration m) {
         return m.getDeclaringType().getQualifiedName()+'#'+m.getSimpleName();
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
index 9f69124..c9a4d4d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties
@@ -1,12 +1,34 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 NON_EXISTENT_FILE = \
     Directory "{0}" doesn't exist.
 
 UNRECOGNIZED_PARAMETER = \
     Unrecognized option {0} is not valid.
 
-NO_FILE_SPECIFIED = \
-    No directory was specified.
-
-NO_CLASSPATH_SPECIFIED = \
-    No classpath was specified.
+OPERAND_MISSING = \
+    Option "{0}" is missing an operand.
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
index 61fc613..13f3293 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.text.MessageFormat;
@@ -36,9 +35,8 @@
 enum Messages {
     // Accessor
     NON_EXISTENT_FILE, // 1 arg
-    NO_FILE_SPECIFIED, // 0 args
-    NO_CLASSPATH_SPECIFIED, // 0 args
     UNRECOGNIZED_PARAMETER, //1 arg
+    OPERAND_MISSING, // 1 arg
     ;
 
     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle");
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
index a63f4f9..fbeb61d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.io.File;
@@ -44,6 +43,8 @@
 
     public File targetDir = null;
 
+    public File episodeFile = null;
+
     public final List<String> arguments = new ArrayList<String>();
 
     public void parseArguments(String[] args) throws BadCommandLineException {
@@ -64,7 +65,7 @@
         if (args[i].equals("-d")) {
             if (i == args.length - 1)
                 throw new BadCommandLineException(
-                        (Messages.NO_FILE_SPECIFIED.format()));
+                        (Messages.OPERAND_MISSING.format(args[i])));
             targetDir = new File(args[++i]);
             if( !targetDir.exists() )
                 throw new BadCommandLineException(
@@ -72,10 +73,18 @@
             return 1;
         }
 
+        if (args[i].equals("-episode")) {
+            if (i == args.length - 1)
+                throw new BadCommandLineException(
+                        (Messages.OPERAND_MISSING.format(args[i])));
+            episodeFile = new File(args[++i]);
+            return 1;
+        }
+
         if (args[i].equals("-cp") || args[i].equals("-classpath")) {
             if (i == args.length - 1)
                 throw new BadCommandLineException(
-                        (Messages.NO_CLASSPATH_SPECIFIED.format()));
+                        (Messages.OPERAND_MISSING.format(args[i])));
             classpath = args[++i];
 
             return 1;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
index 63f1a50..bbadce0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.apt;
 
 import java.io.File;
@@ -67,6 +66,8 @@
      */
     private final Map<String,File> schemaLocations = new HashMap<String, File>();
 
+    private File episodeFile;
+
     public SchemaGenerator() {
     }
 
@@ -74,6 +75,10 @@
         schemaLocations.putAll(m);
     }
 
+    public void setEpisodeFile(File episodeFile) {
+        this.episodeFile = episodeFile;
+    }
+
     public Collection<String> supportedOptions() {
         return Collections.emptyList();
     }
@@ -113,14 +118,20 @@
                                     // use the default
                                     file = new File(suggestedFileName);
                                     out = env.getFiler().createBinaryFile(Filer.Location.CLASS_TREE,"",file);
+                                    file = file.getAbsoluteFile();
                                 }
 
                                 StreamResult ss = new StreamResult(out);
                                 env.getMessager().printNotice("Writing "+file);
-                                ss.setSystemId(file.getPath());
+                                ss.setSystemId(file.toURL().toExternalForm());
                                 return ss;
                             }
                         }, errorListener);
+
+                    if(episodeFile!=null) {
+                        env.getMessager().printNotice("Writing "+episodeFile);
+                        model.generateEpisodeFile(new StreamResult(episodeFile));
+                    }
                 } catch (IOException e) {
                     errorListener.error(e.getMessage(),e);
                 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
index 6042da9..c3bb171 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <heml><body>
 APT related code.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
index e6e3a92..86f8fda 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 // AttributesImpl.java - default implementation of Attributes.
 // Written by David Megginson, sax@megginson.com
 // NO WARRANTY!  This class is in the public domain.
@@ -67,6 +66,7 @@
  * @since SAX 2.0
  * @author David Megginson,
  *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
+ * @version 2.0
  */
 public class AttributesImpl implements Attributes
 {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
index ad701c2..475c831 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.tools.internal.jxc.gen.config;
 import org.xml.sax.SAXException;
@@ -76,12 +75,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         case 12:
             {
                 if(($__uri == "" && $__local == "classes")) {
@@ -93,6 +86,12 @@
                 }
             }
             break;
+        case 4:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         case 2:
             {
                 if(($__uri == "" && $__local == "excludes")) {
@@ -134,6 +133,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 3:
+            {
+                if(($__uri == "" && $__local == "excludes")) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 1;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 4:
             {
                 $_ngcc_current_state = 3;
@@ -157,11 +167,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 8:
             {
                 if(($__uri == "" && $__local == "includes")) {
@@ -173,15 +178,9 @@
                 }
             }
             break;
-        case 3:
+        case 0:
             {
-                if(($__uri == "" && $__local == "excludes")) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 1;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
+                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         default:
@@ -254,6 +253,20 @@
 
     public void text(String $value) throws SAXException {
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                include_content = $value;
+                $_ngcc_current_state = 8;
+                action2();
+            }
+            break;
+        case 3:
+            {
+                exclude_content = $value;
+                $_ngcc_current_state = 3;
+                action0();
+            }
+            break;
         case 4:
             {
                 exclude_content = $value;
@@ -261,7 +274,20 @@
                 action0();
             }
             break;
-        case 9:
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 10:
+            {
+                __text = $value;
+                $_ngcc_current_state = 9;
+                action3();
+            }
+            break;
+        case 8:
             {
                 include_content = $value;
                 $_ngcc_current_state = 8;
@@ -275,38 +301,11 @@
                 action1();
             }
             break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 0:
             {
                 revertToParentFromText(this, super._cookie, $value);
             }
             break;
-        case 8:
-            {
-                include_content = $value;
-                $_ngcc_current_state = 8;
-                action2();
-            }
-            break;
-        case 10:
-            {
-                __text = $value;
-                $_ngcc_current_state = 9;
-                action3();
-            }
-            break;
-        case 3:
-            {
-                exclude_content = $value;
-                $_ngcc_current_state = 3;
-                action0();
-            }
-            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
index 961df1c..b58719a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.tools.internal.jxc.gen.config;
 import org.xml.sax.SAXException;
@@ -79,7 +78,7 @@
         case 1:
             {
                 if(($__uri == "" && $__local == "schema")) {
-                    NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir);
+                    NGCCHandler h = new Schema(this, super._source, $runtime, 3, baseDir);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -101,7 +100,7 @@
         case 2:
             {
                 if(($__uri == "" && $__local == "schema")) {
-                    NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir);
+                    NGCCHandler h = new Schema(this, super._source, $runtime, 4, baseDir);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -124,7 +123,7 @@
         case 4:
             {
                 if(($__uri == "" && $__local == "classes")) {
-                    NGCCHandler h = new Classes(this, super._source, $runtime, 34);
+                    NGCCHandler h = new Classes(this, super._source, $runtime, 6);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -289,21 +288,21 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 31:
+        case 3:
             {
                 _schema = ((Schema)$__result__);
                 action0();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 32:
+        case 4:
             {
                 _schema = ((Schema)$__result__);
                 action0();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 34:
+        case 6:
             {
                 classes = ((Classes)$__result__);
                 $_ngcc_current_state = 2;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
index b4ee989..3c6624a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.gen.config;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
index ed59a08..6ef8d69e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.gen.config;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
index db72354..279d565 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.gen.config;
 
 import org.xml.sax.Attributes;
@@ -31,6 +30,7 @@
 /**
  *
  *
+ * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public abstract class NGCCHandler implements NGCCEventReceiver {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
index 180a830..2bd6dc4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.gen.config;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
index 6d942a3..581fef3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.gen.config;
 
 import java.text.MessageFormat;
@@ -51,6 +50,7 @@
  *
  *  <li>TODO: provide support for interleaving.
  *
+ * @version $Id: NGCCRuntime.java,v 1.16 2003/03/23 02:47:46 okajima Exp $
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public class NGCCRuntime implements ContentHandler, NGCCEventSource {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
index 4895421..1a7f41f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.tools.internal.jxc.gen.config;
 import org.xml.sax.SAXException;
@@ -66,14 +65,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 2:
+        case 6:
             {
-                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 2;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -94,14 +93,14 @@
                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 6:
+        case 2:
             {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 2;
+                    $_ngcc_current_state = 1;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -120,6 +119,23 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 6:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 2;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 if(($__uri == "" && $__local == "schema")) {
@@ -143,23 +159,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 6:
-            {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 2;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -173,13 +172,13 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 2:
+        case 6:
             {
-                if(($__uri == "" && $__local == "location")) {
-                    $_ngcc_current_state = 4;
+                if(($__uri == "" && $__local == "namespace")) {
+                    $_ngcc_current_state = 8;
                 }
                 else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 2;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -189,13 +188,13 @@
                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 6:
+        case 2:
             {
-                if(($__uri == "" && $__local == "namespace")) {
-                    $_ngcc_current_state = 8;
+                if(($__uri == "" && $__local == "location")) {
+                    $_ngcc_current_state = 4;
                 }
                 else {
-                    $_ngcc_current_state = 2;
+                    $_ngcc_current_state = 1;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -213,6 +212,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 6:
+            {
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 7:
             {
                 if(($__uri == "" && $__local == "namespace")) {
@@ -223,12 +233,6 @@
                 }
             }
             break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 3:
             {
                 if(($__uri == "" && $__local == "location")) {
@@ -239,14 +243,9 @@
                 }
             }
             break;
-        case 0:
+        case 2:
             {
-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 6:
-            {
-                $_ngcc_current_state = 2;
+                $_ngcc_current_state = 1;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -261,11 +260,27 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 4:
+        case 8:
             {
-                loc = $value;
-                $_ngcc_current_state = 3;
-                action0();
+                namespace = $value;
+                $_ngcc_current_state = 7;
+            }
+            break;
+        case 6:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 2;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromText(this, super._cookie, $value);
             }
             break;
         case 2:
@@ -280,27 +295,11 @@
                 }
             }
             break;
-        case 8:
+        case 4:
             {
-                namespace = $value;
-                $_ngcc_current_state = 7;
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromText(this, super._cookie, $value);
-            }
-            break;
-        case 6:
-            {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 2;
-                    $runtime.sendText(super._cookie, $value);
-                }
+                loc = $value;
+                $_ngcc_current_state = 3;
+                action0();
             }
             break;
         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
index 697f3ac..e3c593f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.rng
@@ -1,4 +1,28 @@
 <?xml version="1.0"?>
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <grammar
  xmlns="http://relaxng.org/ns/structure/1.0"
  xmlns:r="http://relaxng.org/ns/structure/1.0"
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd
index 7d6456c..ba213ec 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <!-- THIS IS A GENERATED FILE. DO NOT MODIFY. -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
   <xs:element name="config">
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java b/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
index 836f191..4eb70a1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.jxc.model.nav;
 
 import java.util.ArrayList;
@@ -281,24 +280,21 @@
         return method.getModifiers().contains(Modifier.VOLATILE);
     }
 
-    public boolean isOverriding(MethodDeclaration method) {
-        TypeDeclaration declaringType = method.getDeclaringType();
-        if(!(declaringType instanceof ClassDeclaration))
-            return false;   // act defensively. this might be because we are recovering from errors
-        ClassDeclaration sc = (ClassDeclaration) declaringType;
+    public boolean isOverriding(MethodDeclaration method, TypeDeclaration base) {
+        ClassDeclaration sc = (ClassDeclaration) base;
 
         Declarations declUtil = env.getDeclarationUtils();
 
-        while(sc.getSuperclass()!=null) {
-            sc = sc.getSuperclass().getDeclaration();
-
+        while(true) {
             for (MethodDeclaration m : sc.getMethods()) {
                 if(declUtil.overrides(method,m))
                     return true;
             }
-        }
 
-        return false;
+            if(sc.getSuperclass()==null)
+                return false;
+            sc = sc.getSuperclass().getDeclaration();
+        }
     }
 
     public boolean isInterface(TypeDeclaration clazz) {
@@ -309,6 +305,10 @@
         return f.getModifiers().contains(Modifier.TRANSIENT);
     }
 
+    public boolean isInnerClass(TypeDeclaration clazz) {
+        return clazz.getDeclaringType()!=null;
+    }
+
     public boolean isArray(TypeMirror t) {
         return t instanceof ArrayType;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java
deleted file mode 100644
index 9a666ee..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/AntErrorListener.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.apache.tools.ant.Project;
-import org.xml.sax.SAXParseException;
-
-import java.text.MessageFormat;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class AntErrorListener implements ErrorListener {
-    private final Project project;
-
-    public AntErrorListener(Project p) {
-        this.project = p;
-    }
-
-    public void error(SAXParseException e) {
-        print(e,Project.MSG_ERR);
-    }
-
-    public void fatalError(SAXParseException e) {
-        print(e,Project.MSG_ERR);
-    }
-
-    public void warning(SAXParseException e) {
-        print(e,Project.MSG_WARN);
-    }
-
-    private void print(SAXParseException e, int level) {
-        project.log(e.getMessage(),level);
-        project.log(getLocation(e),level);
-    }
-
-    String getLocation(SAXParseException e) {
-        return MessageFormat.format("  {0}:{1} of {2}",
-            new Object[]{
-                String.valueOf(e.getLineNumber()),
-                String.valueOf(e.getColumnNumber()),
-                e.getSystemId()});
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/ConsoleErrorReporter.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/ConsoleErrorReporter.java
deleted file mode 100644
index 6798506..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/ConsoleErrorReporter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.xml.sax.SAXParseException;
-
-import java.io.PrintStream;
-import java.text.MessageFormat;
-
-/**
- * Prints the error to a stream.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class ConsoleErrorReporter implements ErrorListener {
-    private final PrintStream out;
-
-    public ConsoleErrorReporter(PrintStream out) {
-        this.out = out;
-    }
-
-    public void error(SAXParseException exception) {
-        out.print("[ERROR]   ");
-        print(exception);
-    }
-
-    public void fatalError(SAXParseException exception) {
-        out.print("[FATAL]   ");
-        print(exception);
-    }
-
-    public void warning(SAXParseException exception) {
-        out.print("[WARNING] ");
-        print(exception);
-    }
-
-    private void print(SAXParseException e) {
-        out.println(e.getMessage());
-        out.println(MessageFormat.format("  {0}:{1} of {2}",
-            new Object[]{
-                String.valueOf(e.getLineNumber()),
-                String.valueOf(e.getColumnNumber()),
-                e.getSystemId()}));
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/ErrorListener.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/ErrorListener.java
deleted file mode 100644
index 0602a26..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/ErrorListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXParseException;
-
-/**
- * Used internally to report errors.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public interface ErrorListener extends ErrorHandler {
-    abstract void error (SAXParseException exception);
-    abstract void fatalError (SAXParseException exception);
-    abstract void warning (SAXParseException exception);
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/Main.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/Main.java
deleted file mode 100644
index 7776fee..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/Main.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.writer.FileCodeWriter;
-import com.sun.codemodel.writer.SingleStreamCodeWriter;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import org.kohsuke.args4j.CmdLineException;
-import org.kohsuke.args4j.CmdLineParser;
-import org.kohsuke.args4j.opts.BooleanOption;
-import org.kohsuke.args4j.opts.StringOption;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.kohsuke.rngom.parse.Parseable;
-import org.kohsuke.rngom.parse.compact.CompactParseable;
-import org.kohsuke.rngom.parse.xml.SAXParseable;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Properties;
-
-/**
- * Programatic entry point to the TXW compiler.
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class Main {
-    private final TxwOptions opts;
-
-    public Main(TxwOptions opts) {
-        this.opts = opts;
-    }
-
-    public static void main(String[] args) {
-        System.exit(run(args));
-    }
-
-    public static class Options {
-        public StringOption output = new StringOption("-o");
-        public StringOption pkg = new StringOption("-p");
-        public BooleanOption compact = new BooleanOption("-c");
-        public BooleanOption xml = new BooleanOption("-x");
-        public BooleanOption xsd = new BooleanOption("-xsd");
-        public BooleanOption chain = new BooleanOption("-h");
-    }
-
-    public static int run(String[] args) {
-        Options opts = new Options();
-        CmdLineParser parser = new CmdLineParser();
-        parser.addOptionClass(opts);
-
-        try {
-            parser.parse(args);
-        } catch (CmdLineException e) {
-            System.out.println(e.getMessage());
-            printUsage();
-            return 1;
-        }
-
-        TxwOptions topts = new TxwOptions();
-        topts.errorListener = new ConsoleErrorReporter(System.out);
-
-        if(opts.output.value!=null) {
-            try {
-                topts.codeWriter = new FileCodeWriter(new File(opts.output.value));
-            } catch( IOException e ) {
-                System.out.println(e.getMessage());
-                printUsage();
-                return 1;
-            }
-        } else {
-            topts.codeWriter = new SingleStreamCodeWriter(System.out);
-        }
-
-        if(opts.chain.isOn()) {
-            topts.chainMethod = true;
-        }
-
-        if(opts.pkg.value!=null) {
-            topts._package = topts.codeModel._package(opts.pkg.value);
-        } else {
-            topts._package = topts.codeModel.rootPackage();
-        }
-
-        // make sure that there's only one argument (namely the schema)
-        if(parser.getArguments().size()!=1) {
-            printUsage();
-            return 1;
-        }
-
-        try {
-            topts.source = makeSourceSchema(parser,opts,topts.errorListener);
-        } catch (MalformedURLException e) {
-            System.out.println(e.getMessage());
-            printUsage();
-            return 1;
-        }
-
-        return run(topts);
-    }
-
-    /**
-     * Parses the command line and makes a {@link Parseable} object
-     * out of the specified schema file.
-     */
-    private static SchemaBuilder makeSourceSchema(CmdLineParser parser, Options opts, ErrorHandler eh) throws MalformedURLException {
-        File f = new File((String)parser.getArguments().get(0));
-        final InputSource in = new InputSource(f.toURL().toExternalForm());
-
-        if(opts.xsd.isOff() && opts.xml.isOff() && opts.compact.isOff()) {
-            // auto detect
-            if(in.getSystemId().endsWith(".rnc"))
-                opts.compact.value=true;
-            else
-            if(in.getSystemId().endsWith(".rng"))
-                opts.xml.value=true;
-            else
-                opts.xsd.value=true;
-        }
-
-        if(opts.xsd.isOn())
-            return new XmlSchemaLoader(in);
-
-        final Parseable parseable = makeRELAXNGSource(opts, in, eh, f);
-
-        return new RELAXNGLoader(parseable);
-    }
-
-    private static Parseable makeRELAXNGSource(Options opts, final InputSource in, ErrorHandler eh, File f) {
-        if(opts.compact.isOn())
-            return new CompactParseable(in,eh);
-
-        if(opts.xml.isOn())
-            return new SAXParseable(in,eh);
-
-        // otherwise sniff from the file extension
-        if(f.getPath().toLowerCase().endsWith("rnc"))
-            return new CompactParseable(in,eh);
-        else
-            return new SAXParseable(in,eh);
-    }
-
-    private static void printUsage() {
-        System.out.println("Typed Xml Writer ver."+getVersion());
-        System.out.println(
-            "txw <schema file>\n"+
-            " -o <dir>   : Specify the directory to place generated source files\n"+
-            " -p <pkg>   : Specify the Java package to put the generated classes into\n"+
-            " -c         : The input schema is written in the RELAX NG compact syntax\n"+
-            " -x         : The input schema is written in the RELAX NG XML syntax\n"+
-            " -xsd       : The input schema is written in the XML SChema\n"+
-            " -h         : Generate code that allows method invocation chaining\n"
-        );
-    }
-
-    public static int run(TxwOptions opts) {
-        return new Main(opts).run();
-    }
-
-    private int run() {
-        try {
-            NodeSet ns = opts.source.build(opts);
-            ns.write(opts);
-            opts.codeModel.build(opts.codeWriter);
-            return 0;
-        } catch (IOException e) {
-            opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
-            return 1;
-        } catch (IllegalSchemaException e) {
-            opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
-            return 1;
-        } catch (SAXParseException e) {
-            opts.errorListener.error(e);
-            return 1;
-        } catch (SAXException e) {
-            opts.errorListener.error(new SAXParseException(e.getMessage(),null,e));
-            return 1;
-        }
-    }
-
-
-    /**
-     * Gets the version number of TXW.
-     */
-    public static String getVersion() {
-        try {
-            Properties p = new Properties();
-            p.load(Main.class.getResourceAsStream("version.properties"));
-            return p.get("version").toString();
-        } catch( Throwable _ ) {
-            return "unknown";
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java
deleted file mode 100644
index 99ac2db..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/NameUtil.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.JJavaName;
-
-import java.util.ArrayList;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class NameUtil {
-
-    protected static boolean isPunct(char c) {
-        return (c == '-' || c == '.' || c == ':' || c == '_' || c == '\u00b7'
-                || c == '\u0387' || c == '\u06dd' || c == '\u06de');
-    }
-
-    protected static boolean isDigit(char c) {
-        return ((c >= '0' && c <= '9') || Character.isDigit(c));
-    }
-
-    protected static boolean isUpper(char c) {
-        return ((c >= 'A' && c <= 'Z') || Character.isUpperCase(c));
-    }
-
-    protected static boolean isLower(char c) {
-        return ((c >= 'a' && c <= 'z') || Character.isLowerCase(c));
-    }
-
-    protected static boolean isLetter(char c) {
-        return ((c >= 'A' && c <= 'Z')
-                || (c >= 'a' && c <= 'z')
-                || Character.isLetter(c));
-    }
-
-    /**
-     * Capitalizes the first character of the specified string,
-     * and de-capitalize the rest of characters.
-     */
-    public static String capitalize(String s) {
-        if (!isLower(s.charAt(0)))
-            return s;
-        StringBuffer sb = new StringBuffer(s.length());
-        sb.append(Character.toUpperCase(s.charAt(0)));
-        sb.append(s.substring(1).toLowerCase());
-        return sb.toString();
-    }
-
-    // Precondition: s[start] is not punctuation
-    protected static int nextBreak(String s, int start) {
-        int n = s.length();
-        for (int i = start; i < n; i++) {
-            char c0 = s.charAt(i);
-            if (i < n - 1) {
-                char c1 = s.charAt(i + 1);
-                if (isPunct(c1)) return i + 1;
-                if (isDigit(c0) && !isDigit(c1)) return i + 1;
-                if (!isDigit(c0) && isDigit(c1)) return i + 1;
-                if (isLower(c0) && !isLower(c1)) return i + 1;
-                if (isLetter(c0) && !isLetter(c1)) return i + 1;
-                if (!isLetter(c0) && isLetter(c1)) return i + 1;
-                if (i < n - 2) {
-                    char c2 = s.charAt(i + 2);
-                    if (isUpper(c0) && isUpper(c1) && isLower(c2))
-                        return i + 1;
-                }
-            }
-        }
-        return -1;
-    }
-
-
-    /**
-     * Tokenizes a string into words and capitalizes the first
-     * character of each word.
-     *
-     * <p>
-     * This method uses a change in character type as a splitter
-     * of two words. For example, "abc100ghi" will be splitted into
-     * {"Abc", "100","Ghi"}.
-     */
-    public static String[] toWordList(String s) {
-        ArrayList ss = new ArrayList();
-        int n = s.length();
-        for (int i = 0; i < n;) {
-
-            // Skip punctuation
-            while (i < n) {
-                if (!isPunct(s.charAt(i)))
-                    break;
-                i++;
-            }
-            if (i >= n) break;
-
-            // Find next break and collect word
-            int b = nextBreak(s, i);
-            String w = (b == -1) ? s.substring(i) : s.substring(i, b);
-            ss.add(escape(capitalize(w)));
-            if (b == -1) break;
-            i = b;
-        }
-
-//      we can't guarantee a valid Java identifier anyway,
-//      so there's not much point in rejecting things in this way.
-//        if (ss.size() == 0)
-//            throw new IllegalArgumentException("Zero-length identifier");
-        return (String[])(ss.toArray(new String[0]));
-    }
-
-    protected static String toMixedCaseName(String[] ss, boolean startUpper) {
-        StringBuffer sb = new StringBuffer();
-        if(ss.length>0) {
-            sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
-            for (int i = 1; i < ss.length; i++)
-                sb.append(ss[i]);
-        }
-        return sb.toString();
-    }
-
-    protected static  String toMixedCaseVariableName(String[] ss,
-                                                  boolean startUpper,
-                                                  boolean cdrUpper) {
-        if (cdrUpper)
-            for (int i = 1; i < ss.length; i++)
-                ss[i] = capitalize(ss[i]);
-        StringBuffer sb = new StringBuffer();
-        if( ss.length>0 ) {
-            sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
-            for (int i = 1; i < ss.length; i++)
-                sb.append(ss[i]);
-        }
-        return sb.toString();
-    }
-
-
-    /**
-     * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
-     *
-     * @return
-     *      Always return a string but there's no guarantee that
-     *      the generated code is a valid Java identifier.
-     */
-    public static String toConstantName(String s) {
-        return toConstantName(toWordList(s));
-    }
-
-    /**
-     * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
-     *
-     * @return
-     *      Always return a string but there's no guarantee that
-     *      the generated code is a valid Java identifier.
-     */
-    public static String toConstantName(String[] ss) {
-        StringBuffer sb = new StringBuffer();
-        if( ss.length>0 ) {
-            sb.append(ss[0].toUpperCase());
-            for (int i = 1; i < ss.length; i++) {
-                sb.append('_');
-                sb.append(ss[i].toUpperCase());
-            }
-        }
-        return sb.toString();
-    }
-
-
-
-    /**
-     * Escapes characters is the given string so that they can be
-     * printed by only using US-ASCII characters.
-     *
-     * The escaped characters will be appended to the given
-     * StringBuffer.
-     *
-     * @param sb
-     *      StringBuffer that receives escaped string.
-     * @param s
-     *      String to be escaped. <code>s.substring(start)</code>
-     *      will be escaped and copied to the string buffer.
-     */
-    public static void escape(StringBuffer sb, String s, int start) {
-        int n = s.length();
-        for (int i = start; i < n; i++) {
-            char c = s.charAt(i);
-            if (Character.isJavaIdentifierPart(c))
-                sb.append(c);
-            else {
-                sb.append("_");
-                if (c <= '\u000f') sb.append("000");
-                else if (c <= '\u00ff') sb.append("00");
-                else if (c <= '\u0fff') sb.append("0");
-                sb.append(Integer.toString(c, 16));
-            }
-        }
-    }
-
-    /**
-     * Escapes characters that are unusable as Java identifiers
-     * by replacing unsafe characters with safe characters.
-     */
-    private static String escape(String s) {
-        int n = s.length();
-        for (int i = 0; i < n; i++)
-            if (!Character.isJavaIdentifierPart(s.charAt(i))) {
-                StringBuffer sb = new StringBuffer(s.substring(0, i));
-                escape(sb, s, i);
-                return sb.toString();
-            }
-        return s;
-    }
-
-    /**
-     * Escape any characters that would cause the single arg constructor
-     * of java.net.URI to complain about illegal chars.
-     *
-     * @param s source string to be escaped
-     */
-    public static String escapeURI(String s) {
-        StringBuffer sb = new StringBuffer();
-        for( int i = 0; i < s.length(); i++ ) {
-            char c = s.charAt(i);
-            if(Character.isSpaceChar(c)) {
-                sb.append("%20");
-            } else {
-                sb.append(c);
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Calculate the parent URI path of the given URI path.
-     *
-     * @param uriPath the uriPath (as returned by java.net.URI#getPath()
-     * @return the parent URI path of the given URI path
-     */
-    public static String getParentUriPath(String uriPath) {
-        int idx = uriPath.lastIndexOf('/');
-
-        if (uriPath.endsWith("/")) {
-            uriPath = uriPath.substring(0,idx); // trim trailing slash
-            idx = uriPath.lastIndexOf('/'); // move idx to parent context
-        }
-
-        return uriPath.substring(0, idx)+"/";
-    }
-
-    /**
-     * Calculate the normalized form of the given uriPath.
-     *
-     * For example:
-     *    /a/b/c/ -> /a/b/c/
-     *    /a/b/c  -> /a/b/
-     *    /a/     -> /a/
-     *    /a      -> /
-     *
-     * @param uriPath path of a URI (as returned by java.net.URI#getPath()
-     * @return the normalized uri path
-     */
-    public static String normalizeUriPath(String uriPath) {
-        if (uriPath.endsWith("/"))
-            return uriPath;
-
-        // the uri path should always have at least a leading slash,
-        // so no need to make sure that ( idx == -1 )
-        int idx = uriPath.lastIndexOf('/');
-        return uriPath.substring(0, idx+1);
-    }
-
-    /**
-     * determine if two Strings are equal ignoring case allowing null values
-     *
-     * @param s string 1
-     * @param t string 2
-     * @return true iff the given strings are equal ignoring case, false if they aren't
-     * equal or either of them are null.
-     */
-    public static boolean equalsIgnoreCase(String s, String t) {
-        if (s == t) return true;
-        if ((s != null) && (t != null)) {
-            return s.equalsIgnoreCase(t);
-        }
-        return false;
-    }
-
-    /**
-     * determine if two Strings are iqual allowing null values
-     *
-     * @param s string 1
-     * @param t string 2
-     * @return true iff the strings are equal, false if they aren't equal or either of
-     * them are null.
-     */
-    public static boolean equal(String s, String t) {
-        if (s == t) return true;
-        if ((s != null) && (t != null)) {
-            return s.equals(t);
-        }
-        return false;
-    }
-
-    public static String toClassName(String s) {
-        return toMixedCaseName(toWordList(s), true);
-    }
-    public static String toVariableName(String s) {
-        return toMixedCaseName(toWordList(s), false);
-    }
-    public static String toMethodName(String s) {
-        String m = toMixedCaseName(toWordList(s), false);
-        if(JJavaName.isJavaIdentifier(m))
-            return m;
-        else
-            return '_'+m;
-    }
-    public static String toInterfaceName( String token ) {
-        return toClassName(token);
-    }
-    public static String toPropertyName(String s) {
-        return toClassName(s);
-    }
-    public static  String toPackageName( String s ) {
-        return toMixedCaseName(toWordList(s), false );
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java
deleted file mode 100644
index 854bfb2..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/RELAXNGLoader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.kohsuke.rngom.parse.Parseable;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.kohsuke.rngom.ast.util.CheckingSchemaBuilder;
-import org.kohsuke.rngom.dt.CascadingDatatypeLibraryFactory;
-import org.kohsuke.rngom.dt.builtin.BuiltinDatatypeLibraryFactory;
-import org.relaxng.datatype.helpers.DatatypeLibraryLoader;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.builder.relaxng.SchemaBuilderImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class RELAXNGLoader implements SchemaBuilder {
-    private final Parseable parseable;
-
-    public RELAXNGLoader(Parseable parseable) {
-        this.parseable = parseable;
-    }
-
-    public NodeSet build(TxwOptions options) throws IllegalSchemaException {
-        SchemaBuilderImpl stage1 = new SchemaBuilderImpl(options.codeModel);
-        Leaf pattern = (Leaf)parseable.parse(new CheckingSchemaBuilder(stage1,options.errorListener,
-            new CascadingDatatypeLibraryFactory(
-                new BuiltinDatatypeLibraryFactory(new DatatypeLibraryLoader()),
-                new DatatypeLibraryLoader())));
-
-        return new NodeSet(options,pattern);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/SchemaBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/SchemaBuilder.java
deleted file mode 100644
index 686ca6d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/SchemaBuilder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.tools.internal.txw2.model.NodeSet;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.xml.sax.SAXException;
-
-/**
- * Encapsulation of the schema file and the builder.
- *
- * @author Kohsuke Kawaguchi
- */
-public interface SchemaBuilder {
-    NodeSet build(TxwOptions options) throws IllegalSchemaException, SAXException;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwOptions.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwOptions.java
deleted file mode 100644
index 85e616c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwOptions.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.CodeWriter;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JPackage;
-import com.sun.xml.internal.txw2.annotation.XmlNamespace;
-
-/**
- * Controls the various aspects of the TXW generation.
- *
- * But this doesn't contain options for the command-line interface
- * nor any of the driver-level configuration (such as where to place
- * the generated source code, etc.)
- *
- * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class TxwOptions {
-    public final JCodeModel codeModel = new JCodeModel();
-
-    /**
-     * The package to put the generated code into.
-     */
-    public JPackage _package;
-
-    /**
-     * Always non-null.
-     */
-    public ErrorListener errorListener;
-
-    /**
-     * The generated code will be sent to this.
-     */
-    CodeWriter codeWriter;
-
-    /**
-     * Schema file.
-     */
-    SchemaBuilder source;
-
-    /**
-     * If true, generate attribute/value methods that
-     * returns the <tt>this</tt> object for chaining.
-     */
-    public boolean chainMethod;
-
-    /**
-     * If true, the generated code will not use the package-level
-     * {@link XmlNamespace} annotation.
-     */
-    public boolean noPackageNamespace;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java
deleted file mode 100644
index e8f8d5a..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/TxwTask.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import com.sun.codemodel.writer.FileCodeWriter;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.kohsuke.rngom.parse.compact.CompactParseable;
-import org.kohsuke.rngom.parse.xml.SAXParseable;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-/**
- * Ant task interface for txw compiler.
- *
- * @author ryan_shoemaker@dev.java.net
- */
-public class TxwTask extends org.apache.tools.ant.Task {
-
-    // txw options - reuse command line options from the main driver
-    private final TxwOptions options = new TxwOptions();
-
-    // schema file
-    private File schemaFile;
-
-    // syntax style of RELAX NG source schema - "xml" or "compact"
-    private static enum Style {
-        COMPACT, XML, XMLSCHEMA, AUTO_DETECT
-    }
-    private Style style = Style.AUTO_DETECT;
-
-    public TxwTask() {
-        // default package
-        options._package = options.codeModel.rootPackage();
-
-        // default codewriter
-        try {
-            options.codeWriter = new FileCodeWriter(new File("."));
-        } catch (IOException e) {
-            throw new BuildException(e);
-        }
-    }
-
-    /**
-     * Parse @package
-     *
-     * @param pkg name of the package to generate the java classes into
-     */
-    public void setPackage( String pkg ) {
-        options._package = options.codeModel._package( pkg );
-    }
-
-    /**
-     * Parse @syntax
-     *
-     * @param style either "compact" for RELAX NG compact syntax or "XML"
-     * for RELAX NG xml syntax
-     */
-    public void setSyntax( String style ) {
-        this.style = Style.valueOf(style.toUpperCase());
-    }
-
-    /**
-     * parse @schema
-     *
-     * @param schema the schema file to be processed by txw
-     */
-    public void setSchema( File schema ) {
-        schemaFile = schema;
-    }
-
-    /**
-     * parse @destdir
-     *
-     * @param dir the directory to produce generated source code in
-     */
-    public void setDestdir( File dir ) {
-        try {
-            options.codeWriter = new FileCodeWriter(dir);
-        } catch (IOException e) {
-            throw new BuildException(e);
-        }
-    }
-
-    /**
-     * parse @methodChaining
-     *
-     * @param flg true if the txw should generate api's that allow
-     * method chaining (when possible, false otherwise
-     */
-    public void setMethodChaining( boolean flg ) {
-        options.chainMethod = flg;
-    }
-
-    /**
-     * launch txw
-     */
-    public void execute() throws BuildException {
-        options.errorListener = new AntErrorListener(getProject());
-
-        try {
-            InputSource in = new InputSource(schemaFile.toURL().toExternalForm());
-
-            String msg = "Compiling: " + in.getSystemId();
-            log( msg, Project.MSG_INFO );
-
-            if(style==Style.AUTO_DETECT) {
-                String fileName = schemaFile.getPath().toLowerCase();
-                if(fileName.endsWith("rnc"))
-                    style = Style.COMPACT;
-                else
-                if(fileName.endsWith("xsd"))
-                    style = Style.XMLSCHEMA;
-                else
-                    style = Style.XML;
-            }
-
-            switch(style) {
-            case COMPACT:
-                options.source = new RELAXNGLoader(new CompactParseable(in,options.errorListener));
-                break;
-            case XML:
-                options.source = new RELAXNGLoader(new SAXParseable(in,options.errorListener));
-                break;
-            case XMLSCHEMA:
-                options.source = new XmlSchemaLoader(in);
-                break;
-            }
-        } catch (MalformedURLException e) {
-            throw new BuildException(e);
-        }
-
-        // kick off the compiler
-        Main.run(options);
-        log( "Compilation complete.", Project.MSG_INFO );
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/XmlSchemaLoader.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/XmlSchemaLoader.java
deleted file mode 100644
index 545e4fa..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/XmlSchemaLoader.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import com.sun.tools.internal.txw2.builder.xsd.XmlSchemaBuilder;
-import com.sun.xml.xsom.parser.XSOMParser;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class XmlSchemaLoader implements SchemaBuilder {
-    private final InputSource in;
-
-    public XmlSchemaLoader(InputSource in) {
-        this.in = in;
-    }
-
-    public NodeSet build(TxwOptions options) throws SAXException {
-        XSOMParser xsom = new XSOMParser();
-        xsom.parse(in);
-        return XmlSchemaBuilder.build(xsom.getResult(),options);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/AnnotationsImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/AnnotationsImpl.java
deleted file mode 100644
index 2d78820..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/AnnotationsImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import org.kohsuke.rngom.ast.builder.Annotations;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class AnnotationsImpl implements Annotations<ParsedElementAnnotation,LocatorImpl,CommentListImpl> {
-    public void addAttribute(String ns, String localName, String prefix, String value, LocatorImpl locator) throws BuildException {
-    }
-
-    public void addElement(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
-    }
-
-    public void addComment(CommentListImpl commentList) throws BuildException {
-    }
-
-    public void addLeadingComment(CommentListImpl commentList) throws BuildException {
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/CommentListImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/CommentListImpl.java
deleted file mode 100644
index 43f8e34..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/CommentListImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import org.kohsuke.rngom.ast.builder.CommentList;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public interface CommentListImpl extends CommentList<LocatorImpl> {
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java
deleted file mode 100644
index 0c219e6..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DataPatternBuilderImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.DataPatternBuilder;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-import org.kohsuke.rngom.parse.Context;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class DataPatternBuilderImpl implements DataPatternBuilder<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> {
-    final JType type;
-
-    public DataPatternBuilderImpl(JType type) {
-        this.type = type;
-    }
-
-    public Leaf makePattern(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return new Data(locator,type);
-    }
-
-    public void addParam(String name, String value, Context context, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-    }
-
-    public void annotation(ParsedElementAnnotation parsedElementAnnotation) {
-    }
-
-    public Leaf makePattern(Leaf except, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return makePattern(locator,annotations);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java
deleted file mode 100644
index 37dd621..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DatatypeFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.codemodel.JType;
-import com.sun.codemodel.JCodeModel;
-
-import javax.xml.namespace.QName;
-
-/**
- * Builds {@link Data} from a XML Schema datatype.
- * @author Kohsuke Kawaguchi
- */
-public class DatatypeFactory {
-    private final JCodeModel codeModel;
-
-    public DatatypeFactory(JCodeModel codeModel) {
-        this.codeModel = codeModel;
-    }
-
-    /**
-     * Decides the Java datatype from XML datatype.
-     *
-     * @return null
-     *      if none is found.
-     */
-    public JType getType(String datatypeLibrary, String type) {
-        if(datatypeLibrary.equals("http://www.w3.org/2001/XMLSchema-datatypes")
-        || datatypeLibrary.equals("http://www.w3.org/2001/XMLSchema")) {
-            type = type.intern();
-
-            if(type=="boolean")
-                return codeModel.BOOLEAN;
-            if(type=="int" || type=="nonNegativeInteger" || type=="positiveInteger")
-                return codeModel.INT;
-            if(type=="QName")
-                return codeModel.ref(QName.class);
-            if(type=="float")
-                return codeModel.FLOAT;
-            if(type=="double")
-                return codeModel.DOUBLE;
-            if(type=="anySimpleType" || type=="anyType")
-                return codeModel.ref(String.class);
-        }
-
-        return null;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java
deleted file mode 100644
index 2b68817..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/DivImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.Div;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class DivImpl
-    extends GrammarSectionImpl
-    implements Div<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> {
-
-    DivImpl(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> parent, Grammar grammar) {
-        super(parent,grammar);
-    }
-
-    public void endDiv(LocatorImpl locator, AnnotationsImpl annotations) {
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/ElementAnnotationBuilderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/ElementAnnotationBuilderImpl.java
deleted file mode 100644
index 0acec82..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/ElementAnnotationBuilderImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.CommentList;
-import org.kohsuke.rngom.ast.builder.ElementAnnotationBuilder;
-import org.kohsuke.rngom.ast.om.Location;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class ElementAnnotationBuilderImpl implements ElementAnnotationBuilder {
-    public void addText(String value, Location location, CommentList commentList) throws BuildException {
-    }
-
-    public ParsedElementAnnotation makeElementAnnotation() throws BuildException {
-        return null;
-    }
-
-    public void addAttribute(String ns, String localName, String prefix, String value, Location location) throws BuildException {
-    }
-
-    public void addElement(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
-    }
-
-    public void addComment(CommentList commentList) throws BuildException {
-    }
-
-    public void addLeadingComment(CommentList commentList) throws BuildException {
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java
deleted file mode 100644
index cc49844..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.Ref;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.Grammar;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-class GrammarImpl extends GrammarSectionImpl
-    implements Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> {
-
-    GrammarImpl(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope) {
-        super(scope,new com.sun.tools.internal.txw2.model.Grammar());
-    }
-
-    public Leaf endGrammar(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return new Ref(locator,grammar,com.sun.tools.internal.txw2.model.Grammar.START);
-    }
-
-    public Leaf makeParentRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return parent.makeRef(name,locator,annotations);
-    }
-
-    public Leaf makeRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return new Ref(locator,grammar,name);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java
deleted file mode 100644
index 6350749..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/GrammarSectionImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.tools.internal.txw2.model.Define;
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.Div;
-import org.kohsuke.rngom.ast.builder.GrammarSection;
-import org.kohsuke.rngom.ast.builder.Include;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-abstract class GrammarSectionImpl implements GrammarSection<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> {
-
-    protected final Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> parent;
-
-    protected final Grammar grammar;
-
-    GrammarSectionImpl(
-        Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope,
-        Grammar grammar ) {
-        this.parent = scope;
-        this.grammar = grammar;
-    }
-
-    public void topLevelAnnotation(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
-    }
-
-    public void topLevelComment(CommentListImpl commentList) throws BuildException {
-    }
-
-    public Div<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeDiv() {
-        return new DivImpl(parent,grammar);
-    }
-
-    public Include<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeInclude() {
-        // TODO
-        throw new UnsupportedOperationException();
-    }
-
-    public void define(String name, Combine combine, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        Define def = grammar.get(name);
-        def.location = locator;
-
-        if(combine==null || def.leaf==null) {
-            def.leaf = leaf;
-        } else {
-            def.leaf.merge(leaf);
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java
deleted file mode 100644
index 921676d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/SchemaBuilderImpl.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.relaxng;
-
-import com.sun.codemodel.JClass;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.Attribute;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Element;
-import com.sun.tools.internal.txw2.model.Empty;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.List;
-import com.sun.tools.internal.txw2.model.Value;
-import org.kohsuke.rngom.ast.builder.BuildException;
-import org.kohsuke.rngom.ast.builder.DataPatternBuilder;
-import org.kohsuke.rngom.ast.builder.ElementAnnotationBuilder;
-import org.kohsuke.rngom.ast.builder.Grammar;
-import org.kohsuke.rngom.ast.builder.NameClassBuilder;
-import org.kohsuke.rngom.ast.builder.SchemaBuilder;
-import org.kohsuke.rngom.ast.builder.Scope;
-import org.kohsuke.rngom.ast.om.ParsedElementAnnotation;
-import org.kohsuke.rngom.ast.util.LocatorImpl;
-import org.kohsuke.rngom.nc.NameClass;
-import org.kohsuke.rngom.nc.NameClassBuilderImpl;
-import org.kohsuke.rngom.parse.Context;
-import org.kohsuke.rngom.parse.IllegalSchemaException;
-import org.kohsuke.rngom.parse.Parseable;
-
-import javax.xml.namespace.QName;
-
-/**
- * Builds a model from a RELAX NG grammar.
- *
- * @author Kohsuke Kawaguchi
- */
-public final class SchemaBuilderImpl implements SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> {
-    private final NameClassBuilderImpl ncb = new NameClassBuilderImpl();
-    private final JClass string;
-    private final DatatypeFactory dtf;
-
-    public SchemaBuilderImpl(JCodeModel codeModel) {
-        string = codeModel.ref(String.class);
-        dtf = new DatatypeFactory(codeModel);
-    }
-
-
-    public Leaf expandPattern(Leaf leaf) throws BuildException {
-        return leaf;
-    }
-
-
-
-    public NameClassBuilder getNameClassBuilder() throws BuildException {
-        return ncb;
-    }
-
-    private Leaf merge(java.util.List<Leaf> leaves) {
-        for( int i=1; i<leaves.size(); i++ )
-            leaves.get(0).merge(leaves.get(i));
-        return leaves.get(0);
-    }
-
-    public Leaf makeChoice(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return merge(leaves);
-    }
-
-    public Leaf makeInterleave(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return merge(leaves);
-    }
-
-    public Leaf makeGroup(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return merge(leaves);
-    }
-
-    public Leaf makeOneOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return leaf;
-    }
-
-    public Leaf makeZeroOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return leaf.merge(new Empty(locator));
-    }
-
-    public Leaf makeOptional(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return leaf.merge(new Empty(locator));
-    }
-
-    public Leaf makeList(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return new List(locator,leaf);
-    }
-
-    public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return leaf.merge(new Data(locator,string));
-    }
-
-    public Leaf makeEmpty(LocatorImpl locator, AnnotationsImpl annotations) {
-        return new Empty(locator);
-    }
-
-    public Leaf makeNotAllowed(LocatorImpl locator, AnnotationsImpl annotations) {
-        // technically this is incorrect, but we won't be
-        // able to handle <notAllowed/> correctly anyway.
-        return new Empty(locator);
-    }
-
-    public Leaf makeText(LocatorImpl locator, AnnotationsImpl annotations) {
-        return new Data(locator,string);
-    }
-
-    public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        Leaf r = null;
-        for( QName n : nameClass.listNames() ) {
-            Leaf l = new Attribute(locator,n,leaf);
-            if(r!=null)     r = r.merge(l);
-            else            r = l;
-        }
-        if(r==null)     return new Empty(locator);
-        return r;
-    }
-
-    public Leaf makeElement(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        Leaf r = null;
-        for( QName n : nameClass.listNames() ) {
-            Leaf l = new Element(locator,n,leaf);
-            if(r!=null)     r = r.merge(l);
-            else            r = l;
-        }
-        if(r==null)     return new Empty(locator);
-        return r;
-    }
-
-    public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl locator) throws BuildException {
-        return new DataPatternBuilderImpl(getType(datatypeLibrary, type));
-    }
-
-    private JType getType(String datatypeLibrary, String type) {
-        JType t = dtf.getType(datatypeLibrary,type);
-        if(t==null) t = string;
-        return t;
-    }
-
-    public Leaf makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
-        return new Value(locator,getType(datatypeLibrary, type),value);
-    }
-
-    public Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> makeGrammar(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope) {
-        return new GrammarImpl(scope);
-    }
-
-    public Leaf annotate(Leaf leaf, AnnotationsImpl annotations) throws BuildException {
-        return leaf;
-    }
-
-    public Leaf annotateAfter(Leaf leaf, ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
-        return leaf;
-    }
-
-    public Leaf makeErrorPattern() {
-        return new Empty(null);
-    }
-
-    public boolean usesComments() {
-        return false;
-    }
-
-    public Leaf makeExternalRef(Parseable current, String uri, String ns, Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException, IllegalSchemaException {
-        // I'm not too sure if this is correct
-        return current.parseExternal(uri, this, scope, ns );
-    }
-
-    public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber) {
-        return new LocatorImpl(systemId,lineNumber,columnNumber);
-    }
-
-    public AnnotationsImpl makeAnnotations(CommentListImpl commentList, Context context) {
-        return new AnnotationsImpl();
-    }
-
-    public ElementAnnotationBuilder<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl locator, CommentListImpl commentList, Context context) {
-        return new ElementAnnotationBuilderImpl();
-    }
-
-    public CommentListImpl makeCommentList() {
-        return null;
-    }
-
-    public Leaf commentAfter(Leaf leaf, CommentListImpl commentList) throws BuildException {
-        return leaf;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html
deleted file mode 100644
index 587ef12..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/relaxng/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html><body>
-  Reads RELAX NG grammar from RNGOM and builds the model for TXW.
-</body></html>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java
deleted file mode 100644
index 804a215..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/XmlSchemaBuilder.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.builder.xsd;
-
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.TxwOptions;
-import com.sun.tools.internal.txw2.builder.relaxng.DatatypeFactory;
-import com.sun.tools.internal.txw2.model.Attribute;
-import com.sun.tools.internal.txw2.model.Data;
-import com.sun.tools.internal.txw2.model.Define;
-import com.sun.tools.internal.txw2.model.Empty;
-import com.sun.tools.internal.txw2.model.Grammar;
-import com.sun.tools.internal.txw2.model.Leaf;
-import com.sun.tools.internal.txw2.model.List;
-import com.sun.tools.internal.txw2.model.NodeSet;
-import com.sun.tools.internal.txw2.model.Element;
-import com.sun.tools.internal.txw2.model.Ref;
-import com.sun.xml.xsom.XSAnnotation;
-import com.sun.xml.xsom.XSAttributeDecl;
-import com.sun.xml.xsom.XSAttributeUse;
-import com.sun.xml.xsom.XSComplexType;
-import com.sun.xml.xsom.XSContentType;
-import com.sun.xml.xsom.XSDeclaration;
-import com.sun.xml.xsom.XSFacet;
-import com.sun.xml.xsom.XSIdentityConstraint;
-import com.sun.xml.xsom.XSListSimpleType;
-import com.sun.xml.xsom.XSNotation;
-import com.sun.xml.xsom.XSParticle;
-import com.sun.xml.xsom.XSRestrictionSimpleType;
-import com.sun.xml.xsom.XSSchema;
-import com.sun.xml.xsom.XSSchemaSet;
-import com.sun.xml.xsom.XSSimpleType;
-import com.sun.xml.xsom.XSUnionSimpleType;
-import com.sun.xml.xsom.XSXPath;
-import com.sun.xml.xsom.XSWildcard;
-import com.sun.xml.xsom.XSModelGroupDecl;
-import com.sun.xml.xsom.XSModelGroup;
-import com.sun.xml.xsom.XSElementDecl;
-import com.sun.xml.xsom.XSType;
-import com.sun.xml.xsom.XSAttContainer;
-import com.sun.xml.xsom.XSAttGroupDecl;
-import com.sun.xml.xsom.visitor.XSFunction;
-import com.sun.xml.xsom.visitor.XSSimpleTypeFunction;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public final class XmlSchemaBuilder implements XSFunction<Leaf>, XSSimpleTypeFunction<Leaf> {
-    public static NodeSet build( XSSchemaSet xs, TxwOptions opts ) {
-        XmlSchemaBuilder builder = new XmlSchemaBuilder(xs,opts);
-        builder.build(xs);
-        return builder.nodeSet;
-    }
-
-    private void build(XSSchemaSet xs) {
-        // make sure that we bind all complex types
-        for( XSSchema s : xs.getSchemas() ) {
-            for( XSComplexType t : s.getComplexTypes().values() ) {
-                t.apply(this);
-            }
-        }
-
-        nodeSet.addAll(complexTypes.values());
-        nodeSet.addAll(modelGroups.values());
-        nodeSet.addAll(attGroups.values());
-    }
-
-    public Leaf simpleType(XSSimpleType simpleType) {
-        return simpleType.apply((XSSimpleTypeFunction<Leaf>)this);
-    }
-
-    public Leaf particle(XSParticle particle) {
-        return particle.getTerm().apply(this);
-    }
-
-    public Leaf empty(XSContentType empty) {
-        return new Empty(empty.getLocator());
-    }
-
-    public Attribute attributeDecl(XSAttributeDecl decl) {
-        return new Attribute(decl.getLocator(),
-                        getQName(decl),
-                        simpleType(decl.getType()));
-    }
-
-    public Attribute attributeUse(XSAttributeUse use) {
-        return attributeDecl(use.getDecl());
-    }
-
-    public Leaf wildcard(XSWildcard wc) {
-        // wildcard can be always written through the well-formedness method.
-        // no need to generate anything for this.
-        return new Empty(wc.getLocator());
-    }
-
-    public Leaf modelGroupDecl(XSModelGroupDecl mg) {
-        Define def = modelGroups.get(mg);
-        if(def==null) {
-            def = grammar.get(mg.getName()); // TODO: name collision detection and avoidance
-            modelGroups.put(mg,def);
-
-            def.addChild(mg.getModelGroup().apply(this));
-        }
-        return new Ref(mg.getLocator(),def);
-    }
-
-    public Leaf modelGroup(XSModelGroup mg) {
-        XSParticle[] children = mg.getChildren();
-        if(children.length==0)  return new Empty(mg.getLocator());
-
-        Leaf l = particle(children[0]);
-        for( int i=1; i<children.length; i++ )
-            l.merge(particle(children[i]));
-        return l;
-    }
-
-    public Leaf elementDecl(XSElementDecl e) {
-        Element el = new Element(e.getLocator(),getQName(e),e.getType().apply(this));
-        nodeSet.add(el);
-        return el;
-    }
-
-    public Leaf complexType(XSComplexType ct) {
-        Define def = complexTypes.get(ct);
-        if(def==null) {
-            // TODO: consider name collision and such
-            String name = ct.getName();
-            if(ct.isLocal()) {
-                name = ct.getScope().getName();
-            }
-            def = grammar.get(name);
-            complexTypes.put(ct,def);
-
-            XSType baseType = ct.getBaseType();
-            if(baseType.isComplexType() && !isAnyType(baseType)) {
-                // copy inheritance
-                def.addChild(baseType.apply(this));
-
-                if(ct.getDerivationMethod()==XSType.EXTENSION) {
-                    XSContentType explicitContent = ct.getExplicitContent();
-                    if(explicitContent!=null)
-                        def.addChild(explicitContent.apply(this));
-                    attHolder(ct, def);
-                }
-            } else {
-                // just start from fresh
-                def.addChild(ct.getContentType().apply(this));
-                attHolder(ct, def);
-            }
-        }
-
-        return new Ref(ct.getLocator(),def);
-    }
-
-    private void attHolder(XSAttContainer ct, Define def) {
-        for( XSAttributeUse use : ct.getDeclaredAttributeUses() ) {
-            def.addChild(attributeUse(use));
-        }
-        for (XSAttGroupDecl ag : ct.getAttGroups()) {
-            def.addChild(attGroupDecl(ag));
-        }
-    }
-
-    public Leaf attGroupDecl(XSAttGroupDecl ag) {
-        Define def = attGroups.get(ag);
-        if(def==null) {
-            def = grammar.get(ag.getName());
-            attGroups.put(ag,def);
-            attHolder(ag,def);
-        }
-        return new Ref(ag.getLocator(),def);
-    }
-
-    private boolean isAnyType(XSType t) {
-        return t.getName().equals("anyType") && t.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema");
-    }
-
-    public Leaf restrictionSimpleType(XSRestrictionSimpleType rst) {
-        JType t = dtf.getType(rst.getTargetNamespace(),rst.getName());
-        if(t!=null) return new Data(rst.getLocator(),t);
-        return simpleType(rst.getSimpleBaseType());
-    }
-
-    public Leaf unionSimpleType(XSUnionSimpleType st) {
-        Leaf l = simpleType(st.getMember(0));
-        for( int i=1; i<st.getMemberSize(); i++ )
-            l.merge(simpleType(st.getMember(i)));
-        return l;
-    }
-
-    public Leaf listSimpleType(XSListSimpleType st) {
-        return new List(st.getLocator(),simpleType(st.getItemType()));
-    }
-
-    private QName getQName(XSDeclaration decl) {
-        return new QName(decl.getTargetNamespace(),decl.getName());
-    }
-
-    protected final XSSchemaSet schemaSet;
-
-    protected final NodeSet nodeSet;
-
-    private final DatatypeFactory dtf;
-
-    /**
-     * We map model groups to interfaces.
-     */
-    private final Map<XSModelGroupDecl,Define> modelGroups = new HashMap<XSModelGroupDecl, Define>();
-
-    /**
-     * We map complex types to interfaces.
-     */
-    private final Map<XSComplexType,Define> complexTypes = new HashMap<XSComplexType,Define>();
-
-    /**
-     * ... and attribute groups
-     */
-    private final Map<XSAttGroupDecl,Define> attGroups = new HashMap<XSAttGroupDecl,Define>();
-
-    private final Grammar grammar = new Grammar();
-
-    private XmlSchemaBuilder(XSSchemaSet xs,TxwOptions opts) {
-        this.schemaSet = xs;
-        grammar.addChild(new Empty(null));
-        this.nodeSet = new NodeSet(opts,grammar);
-        this.dtf = new DatatypeFactory(opts.codeModel);
-    }
-
-
-
-// won't be used
-    public Leaf annotation(XSAnnotation xsAnnotation) {
-        throw new IllegalStateException();
-    }
-
-    public Leaf schema(XSSchema xsSchema) {
-        throw new IllegalStateException();
-    }
-
-    public Leaf facet(XSFacet xsFacet) {
-        throw new IllegalStateException();
-    }
-
-    public Leaf notation(XSNotation xsNotation) {
-        throw new IllegalStateException();
-    }
-
-    public Leaf identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
-        throw new IllegalStateException();
-    }
-
-    public Leaf xpath(XSXPath xsxPath) {
-        throw new IllegalStateException();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html b/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html
deleted file mode 100644
index 1b90dc3..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/builder/xsd/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html><body>
-  Reads XML Schema grammar from XSOM and builds the model for TXW.
-</body></html>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java
deleted file mode 100644
index 8b901d1..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Attribute.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.model.prop.AttributeProp;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.annotation.XmlAttribute;
-import org.xml.sax.Locator;
-
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Attribute declaration.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Attribute extends XmlNode {
-    public Attribute(Locator location, QName name, Leaf leaf) {
-        super(location, name, leaf);
-    }
-
-    void declare(NodeSet nset) {
-        ; // attributes won't produce a class
-    }
-
-    void generate(NodeSet nset) {
-        ; // nothing
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        Set<JType> types = new HashSet<JType>();
-
-        for( Leaf l : collectChildren() ) {
-            if (l instanceof Text) {
-                types.add(((Text)l).getDatatype(nset));
-            }
-        }
-
-        String methodName = NameUtil.toMethodName(name.getLocalPart());
-
-        for( JType t : types ) {
-            if(!props.add(new AttributeProp(name,t)))
-                continue;
-
-            JMethod m = clazz.method(JMod.PUBLIC,
-                nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
-                methodName);
-            m.param(t,"value");
-
-            JAnnotationUse a = m.annotate(XmlAttribute.class);
-            if(!methodName.equals(name.getLocalPart()))
-                a.param("value",name.getLocalPart());
-            if(!name.getNamespaceURI().equals(""))
-                a.param("ns",name.getNamespaceURI());
-
-        }
-    }
-
-    public String toString() {
-        return "Attribute "+name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/CycleIterator.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/CycleIterator.java
deleted file mode 100644
index fe9edf7..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/CycleIterator.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import java.util.Iterator;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class CycleIterator implements Iterator<Leaf> {
-    private Leaf start;
-    private Leaf current;
-    private boolean hasNext = true;
-
-    public CycleIterator(Leaf start) {
-        assert start!=null;
-        this.start = start;
-        this.current = start;
-    }
-
-    public boolean hasNext() {
-        return hasNext;
-    }
-
-    public Leaf next() {
-        Leaf last = current;
-        current = current.getNext();
-        if(current==start)
-            hasNext = false;
-
-        return last;
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Data.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Data.java
deleted file mode 100644
index 93f5acc..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Data.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import org.xml.sax.Locator;
-
-import java.util.Set;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class Data extends Leaf implements Text {
-    /**
-     * The Java representation of the datatype.
-     */
-    public final JType type;
-
-    public Data(Locator location, JType type) {
-        super(location);
-        this.type = type;
-    }
-
-    public JType getDatatype(NodeSet nset) {
-        return type;
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        createDataMethod(clazz,type,nset,props);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java
deleted file mode 100644
index c25127f..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Define.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.TypedXmlWriter;
-
-import java.util.HashSet;
-import java.util.Set;
-
-
-/**
- * A named pattern.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Define extends WriterNode {
-    public final Grammar scope;
-    public final String name;
-
-    JDefinedClass clazz;
-
-    public Define(Grammar scope, String name) {
-        super(null,null);
-        if(scope==null)     scope = (Grammar)this;  // hack for start pattern
-        this.scope = scope;
-        this.name = name;
-        assert name!=null;
-    }
-
-    /**
-     * Returns true if this define only contains
-     * one child (and thus considered inlinable.)
-     *
-     * A pattern definition is also inlineable if
-     * it's the start of the grammar (because "start" isn't a meaningful name)
-     */
-    public boolean isInline() {
-        return hasOneChild() || name==Grammar.START;
-    }
-
-    void declare(NodeSet nset) {
-        if(isInline())  return;
-
-        clazz = nset.createClass(name);
-        clazz._implements(TypedXmlWriter.class);
-    }
-
-    void generate(NodeSet nset) {
-        if(clazz==null)     return;
-
-        HashSet<Prop> props = new HashSet<Prop>();
-        for( Leaf l : this )
-            l.generate(clazz,nset,props);
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        if(isInline()) {
-            for( Leaf l : this )
-                l.generate(clazz,nset, props);
-        } else {
-            assert this.clazz!=null;
-            clazz._implements(this.clazz);
-        }
-    }
-
-    void prepare(NodeSet nset) {
-        if(isInline() && leaf instanceof WriterNode && !name.equals(Grammar.START))
-            ((WriterNode)leaf).alternativeName = name;
-    }
-
-    public String toString() {
-        return "Define "+name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java
deleted file mode 100644
index 8dad70f..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Element.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JAnnotationUse;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.model.prop.ElementProp;
-import com.sun.tools.internal.txw2.model.prop.LeafElementProp;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.xml.internal.txw2.TypedXmlWriter;
-import com.sun.xml.internal.txw2.annotation.XmlElement;
-import org.xml.sax.Locator;
-
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Element declaration.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Element extends XmlNode {
-    /**
-     * True if this element can be a root element.
-     */
-    public boolean isRoot;
-
-    private Strategy strategy;
-
-    public Element(Locator location, QName name, Leaf leaf) {
-        super(location, name, leaf);
-    }
-
-    /**
-     * Returns true if this element should generate an interface.
-     */
-    private Strategy decideStrategy() {
-        if(isRoot)
-            return new ToInterface();
-
-        if(hasOneChild() && leaf instanceof Ref && !((Ref)leaf).isInline())
-            return new HasOneRef((Ref)leaf);
-
-        Set<Leaf> children = collectChildren();
-        for( Leaf l : children ) {
-            if( l instanceof XmlNode )
-                // if it has attributes/elements in children
-                // generate an interface
-                return new ToInterface();
-        }
-
-        // otherwise this element only has data, so just generate methods for them.
-        return new DataOnly();
-    }
-
-    void declare(NodeSet nset) {
-        strategy = decideStrategy();
-        strategy.declare(nset);
-    }
-
-    void generate(NodeSet nset) {
-        strategy.generate(nset);
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        strategy.generate(clazz,nset,props);
-    }
-
-
-    private JMethod generateMethod(JDefinedClass clazz, NodeSet nset, JType retT) {
-        String methodName = NameUtil.toMethodName(name.getLocalPart());
-
-        JMethod m = clazz.method(JMod.PUBLIC, retT, methodName);
-
-        JAnnotationUse a = m.annotate(XmlElement.class);
-        if(!methodName.equals(name.getLocalPart()))
-            a.param("value",name.getLocalPart());
-        if(nset.defaultNamespace==null || !nset.defaultNamespace.equals(name.getNamespaceURI()))
-            a.param("ns",name.getNamespaceURI());
-
-        return m;
-    }
-
-    public String toString() {
-        return "Element "+name;
-    }
-
-
-    interface Strategy {
-        void declare(NodeSet nset);
-        void generate(NodeSet nset);
-        void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props);
-    }
-
-    /**
-     * Maps to an interface
-     */
-    private class ToInterface implements Strategy {
-        private JDefinedClass clazz;
-
-        public void declare(NodeSet nset) {
-            String cname;
-            if(alternativeName!=null)
-                cname = alternativeName;
-            else
-                cname = name.getLocalPart();
-            clazz = nset.createClass(cname);
-            clazz._implements(TypedXmlWriter.class);
-
-            clazz.annotate(XmlElement.class)
-                .param("value",name.getLocalPart());
-            // TODO: namespace
-        }
-
-        public void generate(NodeSet nset) {
-            HashSet<Prop> props = new HashSet<Prop>();
-            for( Leaf l : Element.this )
-                l.generate(clazz,nset, props);
-        }
-
-        public void generate(JDefinedClass outer, NodeSet nset, Set<Prop> props) {
-            if(props.add(new ElementProp(name,clazz)))
-                generateMethod(outer, nset, clazz);
-        }
-    }
-
-    /**
-     * For things like "element foo {refToAnotherPattern}"
-     */
-    private class HasOneRef implements Strategy {
-        private final Ref ref;
-
-        public HasOneRef(Ref ref) {
-            this.ref = ref;
-        }
-
-        public void declare(NodeSet nset) {
-        }
-        public void generate(NodeSet nset) {
-        }
-
-        public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-            if(props.add(new ElementProp(name,ref.def.clazz)))
-                generateMethod(clazz, nset, ref.def.clazz);
-        }
-    }
-
-    private class DataOnly implements Strategy {
-        public void declare(NodeSet nset) {
-        }
-        public void generate(NodeSet nset) {
-        }
-
-        // TODO: code share with Attribute
-        public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-            Set<JType> types = new HashSet<JType>();
-
-            for( Leaf l : collectChildren() ) {
-                if (l instanceof Text) {
-                    types.add(((Text)l).getDatatype(nset));
-                }
-            }
-
-            for( JType t : types ) {
-                if(!props.add(new LeafElementProp(name,t)))
-                    continue;
-                generateMethod(clazz,
-                        nset, nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID
-                ).param(t,"value");
-            }
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Empty.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Empty.java
deleted file mode 100644
index 4c209a4..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Empty.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import org.xml.sax.Locator;
-
-import java.util.Set;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class Empty extends Leaf {
-    public Empty(Locator location) {
-        super(location);
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        // noop
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Grammar.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Grammar.java
deleted file mode 100644
index 1a5e97c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Grammar.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import org.kohsuke.rngom.ast.builder.GrammarSection;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-
-/**
- * Represents a RELAX NG grammar.
- *
- * A {@link Grammar} extends a {@link Define} as "start"
- *
- * @author Kohsuke Kawaguchi
- */
-public class Grammar extends Define {
-    private final Map<String,Define> patterns = new HashMap<String,Define>();
-
-    public Grammar() {
-        super(null,START);
-        patterns.put(START,this);
-    }
-
-    public Define get(String name) {
-        Define def = patterns.get(name);
-        if(def==null)
-            patterns.put(name,def=new Define(this,name));
-        return def;
-    }
-
-    public Collection<Define> getDefinitions() {
-        return patterns.values();
-    }
-
-    /**
-     * The name for the start pattern
-     */
-    public static final String START = GrammarSection.START;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java
deleted file mode 100644
index 5fccf0c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Leaf.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMethod;
-import com.sun.codemodel.JMod;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import com.sun.tools.internal.txw2.model.prop.ValueProp;
-import com.sun.xml.internal.txw2.annotation.XmlValue;
-import org.kohsuke.rngom.ast.om.ParsedPattern;
-import org.xml.sax.Locator;
-
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * {@link Leaf}s form a set (by a cyclic doubly-linked list.)
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class Leaf implements ParsedPattern {
-    private Leaf next;
-    private Leaf prev;
-
-    /**
-     * Source location where this leaf was defined.
-     */
-    public Locator location;
-
-    protected Leaf(Locator location) {
-        this.location = location;
-        prev = next = this;
-    }
-
-    public final Leaf getNext() {
-        assert next!=null;
-        assert next.prev == this;
-        return next;
-    }
-
-    public final Leaf getPrev() {
-        assert prev!=null;
-        assert prev.next == this;
-        return prev;
-    }
-
-    /**
-     * Combines two sets into one set.
-     *
-     * @return this
-     */
-    public final Leaf merge(Leaf that) {
-        Leaf n1 = this.next;
-        Leaf n2 = that.next;
-
-        that.next = n1;
-        that.next.prev = that;
-        this.next = n2;
-        this.next.prev = this;
-
-        return this;
-    }
-
-    /**
-     * Returns the collection of all the siblings
-     * (including itself)
-     */
-    public final Iterable<Leaf> siblings() {
-        return new Iterable<Leaf>() {
-            public Iterator<Leaf> iterator() {
-                return new CycleIterator(Leaf.this);
-            }
-        };
-    }
-
-    /**
-     * Populate the body of the writer class.
-     *
-     * @param props
-     *      captures the generatesd {@link Prop}s to
-     */
-    abstract void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props);
-
-
-
-
-    /**
-     * Creates a prop of the data value method.
-     */
-    protected final void createDataMethod(JDefinedClass clazz, JType valueType, NodeSet nset, Set<Prop> props) {
-        if(!props.add(new ValueProp(valueType)))
-            return;
-
-        JMethod m = clazz.method(JMod.PUBLIC,
-            nset.opts.chainMethod? (JType)clazz : nset.codeModel.VOID,
-            "_text");
-        m.annotate(XmlValue.class);
-        m.param(valueType,"value");
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/List.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/List.java
deleted file mode 100644
index 543a1a7..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/List.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import org.xml.sax.Locator;
-
-import java.util.Set;
-
-/**
- * List of {@link Data} or {@link Value}.
- *
- * @author Kohsuke Kawaguchi
- */
-public class List extends Node implements Text {
-    public List(Locator location, Leaf leaf) {
-        super(location, leaf);
-    }
-
-    public JType getDatatype(NodeSet nset) {
-        if(hasOneChild() && leaf instanceof Text) {
-            return ((Text)leaf).getDatatype(nset).array();
-        } else {
-            return nset.codeModel.ref(String.class).array();
-        }
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        createDataMethod(clazz,getDatatype(nset),nset,props);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Node.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Node.java
deleted file mode 100644
index 7f90e83..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Node.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import org.xml.sax.Locator;
-
-import java.util.Iterator;
-
-/**
- * {@link Node} is a {@link Leaf} that has children.
- *
- * Children are orderless.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class Node extends Leaf implements Iterable<Leaf> {
-
-    /**
-     * Children of this node.
-     */
-    public Leaf leaf;
-
-    protected Node(Locator location, Leaf leaf) {
-        super(location);
-        this.leaf = leaf;
-    }
-
-    /**
-     * Iterates all the children.
-     */
-    public final Iterator<Leaf> iterator() {
-        return new CycleIterator(leaf);
-    }
-
-    /**
-     * Returns true if this node has only one child node.
-     */
-    public final boolean hasOneChild() {
-        return leaf==leaf.getNext();
-    }
-
-    /**
-     * Adds the given {@link Leaf} and their sibling as children of this {@link Node}.
-     */
-    public final void addChild(Leaf child) {
-        if(this.leaf==null)
-            leaf = child;
-        else
-            leaf.merge(child);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java
deleted file mode 100644
index 64c3839..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/NodeSet.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.ClassType;
-import com.sun.codemodel.JClassAlreadyExistsException;
-import com.sun.codemodel.JCodeModel;
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JMod;
-import com.sun.tools.internal.txw2.NameUtil;
-import com.sun.tools.internal.txw2.TxwOptions;
-import com.sun.xml.internal.txw2.annotation.XmlNamespace;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * Root of the model.
- *
- * @author Kohsuke Kawaguchi
- */
-public class NodeSet extends LinkedHashSet<WriterNode> {
-
-    /*package*/ final TxwOptions opts;
-    /*package*/ final JCodeModel codeModel;
-
-    /**
-     * Set of all the {@link Element}s that can be root.
-     */
-    private final Set<Element> rootElements = new HashSet<Element>();
-
-    /** The namespace URI declared in {@link XmlNamespace}. */
-    /*package*/ final String defaultNamespace;
-
-    public NodeSet(TxwOptions opts, Leaf entry) {
-        this.opts = opts;
-        this.codeModel = opts.codeModel;
-        addAll(entry.siblings());
-        markRoot(entry.siblings(),rootElements);
-
-        // decide what to put in @XmlNamespace
-        Set<String> ns = new HashSet<String>();
-        for( Element e : rootElements )
-            ns.add(e.name.getNamespaceURI());
-
-        if(ns.size()!=1 || opts.noPackageNamespace || opts._package.isUnnamed())
-            defaultNamespace = null;
-        else {
-            defaultNamespace = ns.iterator().next();
-
-            opts._package.annotate(XmlNamespace.class)
-                .param("value",defaultNamespace);
-        }
-    }
-
-    /**
-     * Marks all the element children as root.
-     */
-    private void markRoot(Iterable<Leaf> c, Set<Element> rootElements) {
-        for( Leaf l : c ) {
-            if( l instanceof Element ) {
-                Element e = (Element)l;
-                rootElements.add(e);
-                e.isRoot = true;
-            }
-            if( l instanceof Ref ) {
-                markRoot(((Ref)l).def,rootElements);
-            }
-        }
-    }
-
-    private void addAll(Iterable<Leaf> c) {
-        for( Leaf l : c ) {
-            if(l instanceof Element)
-                if(add((Element)l))
-                    addAll((Element)l);
-            if(l instanceof Grammar) {
-                Grammar g = (Grammar)l;
-                for( Define d : g.getDefinitions() )
-                    add(d);
-            }
-            if(l instanceof Ref) {
-                Ref r = (Ref)l;
-                Define def = r.def;
-//                if(def instanceof Grammar) {
-//                    for( Define d : ((Grammar)def).getDefinitions() )
-//                        if(add(d))
-//                            addAll(d);
-//                }
-                add(def);
-            }
-        }
-    }
-
-    private boolean add(Define def) {
-        boolean b = super.add(def);
-        if(b)
-            addAll(def);
-        return b;
-    }
-
-    public <T extends WriterNode> Collection<T> subset(Class<T> t) {
-        ArrayList<T> r = new ArrayList<T>(size());
-        for( WriterNode n : this )
-            if(t.isInstance(n))
-                r.add((T)n);
-        return r;
-    }
-
-    /**
-     * Generate code
-     */
-    public void write(TxwOptions opts) {
-        for( WriterNode n : this )
-            n.prepare(this);
-        for( WriterNode n : this )
-            n.declare(this);
-        for( WriterNode n : this )
-            n.generate(this);
-    }
-
-    /*package*/ final JDefinedClass createClass(String name) {
-        try {
-            return opts._package._class(
-                JMod.PUBLIC, NameUtil.toClassName(name), ClassType.INTERFACE );
-        } catch (JClassAlreadyExistsException e) {
-            for( int i=2; true; i++ ) {
-                try {
-                    return opts._package._class(
-                        JMod.PUBLIC, NameUtil.toClassName(name+String.valueOf(i)), ClassType.INTERFACE );
-                } catch (JClassAlreadyExistsException e1) {
-                    ; // continue
-                }
-            }
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Ref.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Ref.java
deleted file mode 100644
index 4c0f23c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Ref.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import org.xml.sax.Locator;
-
-import java.util.Set;
-
-/**
- * A reference to a named pattern.
- *
- * @author Kohsuke Kawaguchi
- */
-public final class Ref extends Leaf {
-    public final Define def;
-
-    public Ref(Locator location, Grammar scope, String name) {
-        super(location);
-        this.def = scope.get(name);
-    }
-
-    public Ref(Locator location, Define def) {
-        super(location);
-        this.def = def;
-    }
-
-    public boolean isInline() {
-        return def.isInline();
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        def.generate(clazz,nset,props);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Text.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Text.java
deleted file mode 100644
index 03ac075..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Text.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JType;
-
-/**
- * Implemented by {@link Leaf}s that map to PCDATA in XML.
- *
- * @author Kohsuke Kawaguchi
- */
-public interface Text {
-    /**
-     * Obtains the Java class of this {@link Text}.
-     */
-    JType getDatatype(NodeSet nset);
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Value.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Value.java
deleted file mode 100644
index 60d8bd4..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/Value.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import com.sun.codemodel.JDefinedClass;
-import com.sun.codemodel.JType;
-import com.sun.tools.internal.txw2.model.prop.Prop;
-import org.xml.sax.Locator;
-
-import java.util.Set;
-
-/**
- * A constant value.
- *
- * @author Kohsuke Kawaguchi
- */
-public class Value extends Leaf implements Text {
-    /**
-     * The underlying datatype, in case
-     * we need to revert to {@link Data}.
-     */
-    public final JType type;
-    /**
-     * Constant name.
-     */
-    public final String name;
-
-    public Value(Locator location, JType type, String name) {
-        super(location);
-        this.type = type;
-        this.name = name;
-    }
-
-    void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
-        createDataMethod(clazz,type,nset,props);
-    }
-
-    public JType getDatatype(NodeSet nset) {
-        // TODO: enum support
-        return type;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/WriterNode.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/WriterNode.java
deleted file mode 100644
index 67f1762..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/WriterNode.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import org.xml.sax.Locator;
-
-/**
- * The {@link Node} that maps to the program element.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class WriterNode extends Node {
-    /**
-     * If this node is the sole child of a pattern block,
-     * this field points to its name.
-     *
-     * <p>
-     * When the element names are in conflict, this can be used.
-     */
-    protected String alternativeName;
-
-    public WriterNode(Locator location, Leaf leaf) {
-        super(location, leaf);
-    }
-
-    /**
-     * Declares the class without its contents.
-     *
-     * The first step of the code generation.
-     */
-    abstract void declare(NodeSet nset);
-
-    /**
-     * Generates the contents.
-     */
-    abstract void generate(NodeSet nset);
-
-    /**
-     * Prepares for the code generation.
-     */
-    void prepare(NodeSet nset) {}
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/XmlNode.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/XmlNode.java
deleted file mode 100644
index d1bf961..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/XmlNode.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model;
-
-import org.xml.sax.Locator;
-
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Stack;
-
-/**
- * Either an {@link Element} or {@link Attribute}.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class XmlNode extends WriterNode {
-    /**
-     * Name of the attribute/element.
-     *
-     * In TXW, we ignore all infinite names.
-     * (finite name class will be expanded to a list of {@link XmlNode}s.
-     */
-    public final QName name;
-
-    protected XmlNode(Locator location, QName name, Leaf leaf) {
-        super(location, leaf);
-        this.name = name;
-    }
-
-    /**
-     * Expand all refs and collect all children.
-     */
-    protected final Set<Leaf> collectChildren() {
-        Set<Leaf> result = new HashSet<Leaf>();
-
-        Stack<Node> work = new Stack<Node>();
-        work.push(this);
-
-        while(!work.isEmpty()) {
-            for( Leaf l : work.pop() ) {
-                if( l instanceof Ref ) {
-                    work.push( ((Ref)l).def );
-                } else {
-                    result.add(l);
-                }
-            }
-        }
-
-        return result;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/AttributeProp.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/AttributeProp.java
deleted file mode 100644
index d8c2fe8..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/AttributeProp.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-import com.sun.codemodel.JType;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public final class AttributeProp extends XmlItemProp {
-    public AttributeProp(QName name, JType valueType) {
-        super(name, valueType);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ElementProp.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ElementProp.java
deleted file mode 100644
index f20bd34..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ElementProp.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-import com.sun.codemodel.JType;
-
-import javax.xml.namespace.QName;
-
-/**
- * Property generated from elements.
- *
- * @author Kohsuke Kawaguchi
- */
-public final class ElementProp extends XmlItemProp {
-    public ElementProp(QName name, JType valueType) {
-        super(name, valueType);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/LeafElementProp.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/LeafElementProp.java
deleted file mode 100644
index c3d2b88..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/LeafElementProp.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-import com.sun.codemodel.JType;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public final class LeafElementProp extends XmlItemProp {
-    public LeafElementProp(QName name, JType valueType) {
-        super(name, valueType);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/Prop.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/Prop.java
deleted file mode 100644
index 876ac6f..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/Prop.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-/**
- * Immutable object that captures the characterstic
- * of the generated writer method.
- *
- * <p>
- * Instances of this class implement {@link #equals(Object)}
- * and {@link #hashCode()}. By using these we avoid generating
- * the same method twice.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class Prop {
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ValueProp.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ValueProp.java
deleted file mode 100644
index 57c17c5..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/ValueProp.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-import com.sun.codemodel.JType;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class ValueProp extends Prop {
-    private final JType type;
-
-    public ValueProp(JType type) {
-        this.type = type;
-    }
-
-    public boolean equals(Object o) {
-        if (!(o instanceof ValueProp)) return false;
-
-        final ValueProp that = (ValueProp) o;
-
-        return type.equals(that.type);
-    }
-
-    public int hashCode() {
-        return type.hashCode();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/XmlItemProp.java b/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/XmlItemProp.java
deleted file mode 100644
index aad2a5e..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/txw2/model/prop/XmlItemProp.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.txw2.model.prop;
-
-import com.sun.codemodel.JType;
-
-import javax.xml.namespace.QName;
-
-/**
- * Common implementation between elements and attributes.
- *
- * @author Kohsuke Kawaguchi
- */
-abstract class XmlItemProp extends Prop {
-    private final QName name;
-    private final JType type;
-
-    public XmlItemProp(QName name, JType valueType) {
-        this.name = name;
-        this.type = valueType;
-    }
-
-    public final boolean equals(Object o) {
-        if (this.getClass()!=o.getClass()) return false;
-
-        XmlItemProp that = (XmlItemProp)o;
-
-        return this.name.equals(that.name)
-            && this.type.equals(that.type);
-    }
-
-    public final int hashCode() {
-        return name.hashCode()*29 + type.hashCode();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
index d2edca8..6f53444 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,25 @@
 
 package com.sun.tools.internal.ws;
 
-import com.sun.tools.internal.xjc.api.util.APTClassLoader;
+import com.sun.istack.internal.tools.MaskingClassLoader;
+import com.sun.istack.internal.tools.ParallelWorldClassLoader;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
 import com.sun.tools.internal.xjc.api.util.ToolsJarNotFoundException;
+import com.sun.xml.internal.bind.util.Which;
 
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+import java.io.File;
 import java.io.OutputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Invokes JAX-WS tools in a special class loader that can pick up APT classes,
@@ -39,40 +51,173 @@
  *
  * @author Kohsuke Kawaguchi
  */
-final class Invoker {
-    /**
-     * List of packages that need to be loaded in {@link APTClassLoader}.
-     */
-    private static final String[] prefixes = {
-        "com.sun.tools.internal.jxc.",
-        "com.sun.tools.internal.xjc.",
-        "com.sun.tools.apt.",
-        "com.sun.tools.internal.ws.",
-        "com.sun.tools.javac.",
-        "com.sun.tools.javadoc.",
-        "com.sun.mirror."
-    };
+public final class Invoker {
+    static int invoke(String mainClass, String[] args) throws Throwable {
+        // use the platform default proxy if available.
+        // see sun.net.spi.DefaultProxySelector for details.
+        try {
+            System.setProperty("java.net.useSystemProxies","true");
+        } catch (SecurityException e) {
+            // failing to set this property isn't fatal
+        }
 
-    static void main(String toolName, String[] args) throws Throwable {
         ClassLoader oldcc = Thread.currentThread().getContextClassLoader();
         try {
-            APTClassLoader cl = new APTClassLoader(Invoker.class.getClassLoader(),prefixes);
+            ClassLoader cl = Invoker.class.getClassLoader();
+            if(Arrays.asList(args).contains("-Xendorsed"))
+                cl = createClassLoader(cl); // perform JDK6 workaround hack
+            else {
+                if(!checkIfLoading21API()) {
+                    if(Service.class.getClassLoader()==null)
+                        System.err.println(WscompileMessages.INVOKER_NEED_ENDORSED());
+                    else
+                        System.err.println(WscompileMessages.WRAPPER_TASK_LOADING_20_API(Which.which(Service.class)));
+                    return -1;
+                }
+                //find and load tools.jar
+                List<URL> urls = new ArrayList<URL>();
+                findToolsJar(cl, urls);
+
+                if(urls.size() > 0){
+                    List<String> mask = new ArrayList<String>(Arrays.asList(maskedPackages));
+
+                    // first create a protected area so that we load JAXB/WS 2.1 API
+                    // and everything that depends on them inside
+                    cl = new MaskingClassLoader(cl,mask);
+
+                    // then this classloader loads the API and tools.jar
+                    cl = new URLClassLoader(urls.toArray(new URL[urls.size()]), cl);
+
+                    // finally load the rest of the RI. The actual class files are loaded from ancestors
+                    cl = new ParallelWorldClassLoader(cl,"");
+                }
+
+            }
+
             Thread.currentThread().setContextClassLoader(cl);
 
-            Class compileTool = cl.loadClass("com.sun.tools.internal.ws.wscompile.CompileTool");
-            Constructor ctor = compileTool.getConstructor(OutputStream.class,String.class);
-            Object tool = ctor.newInstance(System.out,toolName);
+            Class compileTool = cl.loadClass(mainClass);
+            Constructor ctor = compileTool.getConstructor(OutputStream.class);
+            Object tool = ctor.newInstance(System.out);
             Method runMethod = compileTool.getMethod("run",String[].class);
             boolean r = (Boolean)runMethod.invoke(tool,new Object[]{args});
-            System.exit(r ? 0 : 1);
+            return r ? 0 : 1;
         } catch (ToolsJarNotFoundException e) {
             System.err.println(e.getMessage());
         } catch (InvocationTargetException e) {
             throw e.getCause();
-        } finally {
+        } catch(ClassNotFoundException e){
+            throw e;
+        }finally {
             Thread.currentThread().setContextClassLoader(oldcc);
         }
 
-        System.exit(1);
+        return -1;
     }
+
+    /**
+     * Returns true if the RI appears to be loading the JAX-WS 2.1 API.
+     */
+    public static boolean checkIfLoading21API() {
+        try {
+            Service.class.getMethod("getPort",Class.class, WebServiceFeature[].class);
+            // yup. things look good.
+            return true;
+        } catch (NoSuchMethodException e) {
+        } catch (LinkageError e) {
+        }
+        // nope
+        return false;
+    }
+
+    /**
+     * Creates a classloader that can load JAXB/WS 2.1 API and tools.jar,
+     * and then return a classloader that can RI classes, which can see all those APIs and tools.jar.
+     */
+    public static ClassLoader createClassLoader(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
+
+        URL[] urls = findIstackAPIs(cl);
+        if(urls.length==0)
+            return cl;  // we seem to be able to load everything already. no need for the hack
+
+        List<String> mask = new ArrayList<String>(Arrays.asList(maskedPackages));
+        if(urls.length>1) {
+            // we need to load 2.1 API from side. so add them to the mask
+            mask.add("javax.xml.bind.");
+            mask.add("javax.xml.ws.");
+        }
+
+        // first create a protected area so that we load JAXB/WS 2.1 API
+        // and everything that depends on them inside
+        cl = new MaskingClassLoader(cl,mask);
+
+        // then this classloader loads the API and tools.jar
+        cl = new URLClassLoader(urls, cl);
+
+        // finally load the rest of the RI. The actual class files are loaded from ancestors
+        cl = new ParallelWorldClassLoader(cl,"");
+
+        return cl;
+    }
+
+    /**
+     * Creates a classloader for loading JAXB/WS 2.1 jar and tools.jar
+     */
+    private static URL[] findIstackAPIs(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
+        List<URL> urls = new ArrayList<URL>();
+
+        if(Service.class.getClassLoader()==null) {
+            // JAX-WS API is loaded from bootstrap classloader
+            URL res = cl.getResource("javax/xml/ws/EndpointReference.class");
+            if(res==null)
+                throw new ClassNotFoundException("There's no JAX-WS 2.1 API in the classpath");
+            urls.add(ParallelWorldClassLoader.toJarUrl(res));
+
+            res = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class");
+            if(res==null)
+                throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath");
+            urls.add(ParallelWorldClassLoader.toJarUrl(res));
+        }
+
+        findToolsJar(cl, urls);
+
+        return urls.toArray(new URL[urls.size()]);
+    }
+
+    private static void findToolsJar(ClassLoader cl, List<URL> urls) throws ToolsJarNotFoundException, MalformedURLException {
+        try {
+            Class.forName("com.sun.tools.javac.Main",false,cl);
+            Class.forName("com.sun.tools.apt.Main",false,cl);
+            // we can already load them in the parent class loader.
+            // so no need to look for tools.jar.
+            // this happens when we are run inside IDE/Ant, or
+            // in Mac OS.
+        } catch (ClassNotFoundException e) {
+            // otherwise try to find tools.jar
+            File jreHome = new File(System.getProperty("java.home"));
+            File toolsJar = new File( jreHome.getParent(), "lib/tools.jar" );
+
+            if (!toolsJar.exists()) {
+                throw new ToolsJarNotFoundException(toolsJar);
+            }
+            urls.add(toolsJar.toURL());
+        }
+    }
+
+    /**
+     * The list of package prefixes we want the
+     * {@link MaskingClassLoader} to prevent the parent
+     * classLoader from loading
+     */
+    public static String[] maskedPackages = new String[]{
+        "com.sun.istack.internal.tools.",
+        "com.sun.tools.internal.jxc.",
+        "com.sun.tools.internal.xjc.",
+        "com.sun.tools.internal.ws.",
+        "com.sun.codemodel.internal.",
+        "com.sun.relaxng.",
+        "com.sun.xml.internal.xsom.",
+        "com.sun.xml.internal.bind.",
+        "com.sun.xml.internal.ws."
+    };
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
index fa3c513..7d5aa32 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/ToolVersion.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
index 7f6fc1e..a4b3de5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,37 @@
  */
 package com.sun.tools.internal.ws;
 
-/**
- * @author Vivek Pandey
- */
+import com.sun.tools.internal.ws.wscompile.WsgenTool;
 
+/**
+ * WsGen tool entry point.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
 public class WsGen {
+    /**
+     * CLI entry point. Use {@link Invoker} to
+     * load tools.jar
+     */
     public static void main(String[] args) throws Throwable {
-        Invoker.main("wsgen",args);
+        System.exit(Invoker.invoke("com.sun.tools.internal.ws.wscompile.WsgenTool", args));
+    }
+
+    /**
+     * Entry point for tool integration.
+     *
+     * <p>
+     * This does the same as {@link #main(String[])} except
+     * it doesn't invoke {@link System#exit(int)}. This method
+     * also doesn't play with classloaders. It's the caller's
+     * responsibility to set up the classloader to load all jars
+     * needed to run the tool, including <tt>$JAVA_HOME/lib/tools.jar</tt>
+     *
+     * @return
+     *      0 if the tool runs successfully.
+     */
+    public static int doMain(String[] args) throws Throwable {
+        return new WsgenTool(System.out).run(args) ? 0 : 1;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
index 98be298..94fd2a8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,37 @@
  */
 package com.sun.tools.internal.ws;
 
-/**
- * @author Vivek Pandey
- */
+import com.sun.tools.internal.ws.wscompile.WsimportTool;
 
+/**
+ * WsImport tool entry point.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
 public class WsImport {
+    /**
+     * CLI entry point. Use {@link Invoker} to
+     * load tools.jar
+     */
     public static void main(String[] args) throws Throwable {
-        Invoker.main("wsimport",args);
+        System.exit(Invoker.invoke("com.sun.tools.internal.ws.wscompile.WsimportTool", args));
+    }
+
+    /**
+     * Entry point for tool integration.
+     *
+     * <p>
+     * This does the same as {@link #main(String[])} except
+     * it doesn't invoke {@link System#exit(int)}. This method
+     * also doesn't play with classloaders. It's the caller's
+     * responsibility to set up the classloader to load all jars
+     * needed to run the tool, including <tt>$JAVA_HOME/lib/tools.jar</tt>
+     *
+     * @return
+     *      0 if the tool runs successfully.
+     */
+    public static int doMain(String[] args) throws Throwable {
+        return new WsimportTool(System.out).run(args) ? 0 : 1;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java
new file mode 100644
index 0000000..c9c2ff3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api;
+
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
+import com.sun.tools.internal.ws.processor.generator.JavaGeneratorExtensionFacade;
+
+/**
+ * Provides Java SEI Code generation Extensiblity mechanism.
+ *
+ * @see JavaGeneratorExtensionFacade
+ * @author Vivek Pandey
+ */
+public abstract class TJavaGeneratorExtension {
+    /**
+     * This method should be used to write annotations on {@link JMethod}.
+     *
+     * @param wsdlOperation non-null wsdl extensiblity element -  wsdl:portType/wsdl:operation.
+     * @param jMethod non-null {@link JMethod}
+     */
+     public abstract void writeMethodAnnotations(TWSDLOperation wsdlOperation, JMethod jMethod);
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java
new file mode 100644
index 0000000..0f5be2f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+
+import javax.xml.namespace.QName;
+
+/**
+ * A WSDL element or attribute that can be extended.
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLExtensible {
+    /**
+     * Gives the wsdl extensiblity element's name attribute value. It can be null as @name on some of the wsdl
+     * extensibility elements are optinal such as wsdl:input
+     */
+    String getNameValue();
+
+    /**
+     * Gives namespace URI of a wsdl extensibility element.
+     */
+    String getNamespaceURI();
+
+    /**
+     * Gives the WSDL element or WSDL extensibility element name
+     */
+    QName getWSDLElementName();
+
+    /**
+     * An {@link TWSDLExtensionHandler} will call this method to add an {@link TWSDLExtension} object
+     *
+     * @param e non-null extension object
+     */
+    void addExtension(TWSDLExtension e);
+
+    /**
+     * Gives iterator over {@link TWSDLExtension}s
+     */
+    Iterable<? extends TWSDLExtension> extensions();
+
+    /**
+     * Gives the parent of a wsdl extensibility element.
+     * <pre>
+     * For example,
+     *
+     *     <wsdl:portType>
+     *         <wsdl:operation>
+     *     ...
+     * Here, the {@link TWSDLExtensible}representing wsdl:operation's parent would be wsdl:portType
+     *
+     * @return null if the {@link TWSDLExtensible} has no parent, root of wsdl document - wsdl:definition.
+     */
+    TWSDLExtensible getParent();
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java
new file mode 100644
index 0000000..c709b30
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+/**
+ * A WSDL extension
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLExtension {
+    /**
+     * Gives Parent {@link TWSDLExtensible} element
+     */
+    TWSDLExtensible getParent();
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java
new file mode 100644
index 0000000..5b7fe93
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+import org.w3c.dom.Element;
+
+/**
+ * JAXWS WSDL parser {@link com.sun.tools.internal.ws.wsdl.parser.WSDLParser} will call an {@link TWSDLExtensionHandler} registered
+ * with it for the WSDL extensibility elements thats not already defined in the WSDL 1.1 spec, such as SOAP or MIME.
+ *
+ * @author Vivek Pandey
+ */
+public abstract class TWSDLExtensionHandler {
+    /**
+     * Gives the namespace of an extensibility element.
+     * <p/>
+     * For example a soap 1.1 XXExtensionHandler would return <code>""http://schemas.xmlsoap.org/wsdl/soap/"</code>
+     */
+    public String getNamespaceURI() {
+        return null;
+    }
+
+    /**
+     * This interface is called during WSDL parsing on detecting any wsdl extension.
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean doHandleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
+            return handleDefinitionsExtension(context, parent, e);
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_TYPES)) {
+            return handleTypesExtension(context, parent, e);
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT_TYPE)) {
+            return handlePortTypeExtension(context, parent, e);
+        } else if (
+            parent.getWSDLElementName().equals(WSDLConstants.QNAME_BINDING)) {
+            return handleBindingExtension(context, parent, e);
+        } else if (
+            parent.getWSDLElementName().equals(WSDLConstants.QNAME_OPERATION)) {
+            return handleOperationExtension(context, parent, e);
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
+            return handleInputExtension(context, parent, e);
+        } else if (
+            parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
+            return handleOutputExtension(context, parent, e);
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_FAULT)) {
+            return handleFaultExtension(context, parent, e);
+        } else if (
+            parent.getWSDLElementName().equals(WSDLConstants.QNAME_SERVICE)) {
+            return handleServiceExtension(context, parent, e);
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_PORT)) {
+            return handlePortExtension(context, parent, e);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Callback for <code>wsdl:portType</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:definitions</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:type</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleTypesExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:binding</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:portType/wsdl:operation</code>.
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:input</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:output</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:fault</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:service</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+
+    /**
+     * Callback for <code>wsdl:port</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java
new file mode 100644
index 0000000..45d0a3a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import com.sun.codemodel.internal.JClass;
+
+import java.util.Map;
+
+/**
+ * Abstracts wsdl:portType/wsdl:operation
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLOperation extends TWSDLExtensible{
+    /**
+     * Gives a Map of fault name attribute value to the {@link JClass}
+     */
+    Map<String, JClass> getFaults();
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java
new file mode 100644
index 0000000..6f6e3e0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.api.wsdl;
+
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
+
+/**
+ * Provides WSDL parsing context. It should be used by the WSDL extension handlers to register their namespaces so that
+ * it can be latter used by other extensions to resolve the namespaces.
+ *
+ * @author Vivek Pandey
+ */
+public interface TWSDLParserContext {
+
+    /**
+     * Pushes the parsing context
+     */
+    void push();
+
+    /**
+     * pops the parsing context
+     */
+    void pop();
+
+    /**
+     * Gives the namespace URI for a given prefix
+     *
+     * @param prefix non-null prefix
+     * @return null of the prefix is not found
+     */
+    String getNamespaceURI(String prefix);
+
+    /**
+     * Gives the prefixes in the current context
+     */
+    Iterable<String> getPrefixes();
+
+    /**
+     * Gives default namespace
+     *
+     * @return null if there is no default namespace declaration found
+     */
+    String getDefaultNamespaceURI();
+
+    /**
+     * Registers naemespace declarations of a given {@link Element} found in the WSDL
+     *
+     * @param e {@link Element} whose namespace declarations need to be registered
+     */
+    void registerNamespaces(Element e);
+
+    /**
+     * gives the location information for the given Element.
+     */
+    Locator getLocation(Element e);
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
index 1889080..a3a5140 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,8 @@
  */
 
 /**
- * <h1>JAX-WS 2.0 Tools</h1>
- * This document describes the tools included with JAX-WS 2.0.
+ * <h1>JAX-WS 2.0.1 Tools</h1>
+ * This document describes the tools included with JAX-WS 2.0.1.
  *
  * {@DotDiagram
      digraph G {
@@ -53,9 +53,8 @@
        "WsImport ANT Task" -> wsimport -> CompileTool;
 
        CompileTool -> APT -> WSAP -> WebServiceAP;
-       CompileTool -> Processor;
-       CompileTool -> Modeler;
-       CompileTool -> ProcessorActions;
+       CompileTool -> Processor -> Modeler;
+       Processor -> ProcessorActions;
        CompileTool -> WebServiceAP;
 
        Modeler -> WSDLModeler;
@@ -70,11 +69,11 @@
  *  <dt>{@link com.sun.tools.internal.ws.ant.Apt Apt}
  *  <dd>An ANT task to invoke <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>.
 
- *  <dt>{@link com.sun.tools.internal.ws.ant.WsGen WsGen}
+ *  <dt>{@link com.sun.tools.internal.ws.ant.WsGen2 WsGen}
  *  <dd>
  *    An ANT task to invoke {@link com.sun.tools.internal.ws.WsGen WsGen}
 
- *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport WsImport}
+ *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport2 WsImport}
  *  <dd>
  *    An ANT task to invoke {@link com.sun.tools.internal.ws.WsImport WsImport}
  *
@@ -91,29 +90,17 @@
  *  <dd>Tool to process a compiled javax.jws.WebService annotated class and to generate the necessary classes to make
  *  it a Web service.
 
- *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport WsImport}
+ *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport2 WsImport}
  *  <dd>
  *    Tool to import a WSDL and to generate an SEI (a javax.jws.WebService) interface that can be either implemented
  *    on the server to build a web service, or can be used on the client to invoke the web service.
  *  </d1>
  * <h2>Implementation Classes</h2>
  *  <d1>
-      <dt>{@link com.sun.tools.internal.ws.wscompile.CompileTool CompileTool}
- *    <dd> This is the main implementation class for both WsGen and WsImport.
- *
- *
- * <dt>{@link com.sun.tools.internal.ws.processor.Processor Processor}
- *    <dd>This abstract class is used to process a particular {@link com.sun.tools.internal.ws.processor.config.Configuration
- *    Configuration} to build a {@link com.sun.tools.internal.ws.processor.model Model} and to run
- *   {@link com.sun.tools.internal.ws.processor.ProcessorAction ProcessorActions} on that model.
-
  *    <dt>{@link com.sun.tools.internal.ws.processor.model.Model Model}
  *    <dd>The model is used to represent the entire Web Service.  The JAX-WS ProcessorActions can process
  *    this Model to generate Java artifacts such as the service interface.
  *
-      <dt>{@link com.sun.tools.internal.ws.processor.ProcessorAction ProcessorActions}
- *    <dd>A ProcessorAction is used to perform some operation on a Model object such as
- *    generating a Java source file.
  *
  *    <dt>{@link com.sun.tools.internal.ws.processor.modeler.Modeler Modeler}
  *    <dd>A Modeler is used to create a Model of a Web Service from a particular Web
@@ -128,7 +115,7 @@
  *    javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
  *    idirectly via the {@link com.sun.istack.internal.ws.WSAP WSAP} when invoked by APT.
  *
- *    <dt>{@link com.sun.istack.internal.ws.WSAP WSAP}
+ *    <dt>{@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl WSAP}
  *    <dd>This is the entry point for the WebServiceAP when APT is invoked on a SEI
  *    annotated with the javax.jws.WebService annotation.
  *   </d1>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java
deleted file mode 100644
index 8b899c5..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/Processor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.ModelInfo;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * This abstract class contains methods for getting a Modeler and creating a model
- * from that Modeler given a particular configuration. ProcessorActions can also
- * be registered and run with instances of this class.
- *
- * @author WS Development Team
- *
- */
-public class Processor {
-
-    public Processor(Configuration configuration, Properties options, Model model) {
-        this(configuration,options);
-        _model = model;
-    }
-
-    public Processor(Configuration configuration, Properties options) {
-        _configuration = configuration;
-        _options = options;
-
-        // find the value of the "print stack traces" property
-        _printStackTrace = Boolean.valueOf(_options.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
-        _env = _configuration.getEnvironment();
-    }
-
-    public void add(ProcessorAction action) {
-        _actions.add(action);
-    }
-
-    public Model getModel() {
-        return _model;
-    }
-
-    public void run() {
-        runModeler();
-        if (_model != null) {
-            runActions();
-        }
-    }
-
-    public void runModeler() {
-        try {
-            ModelInfo modelInfo = _configuration.getModelInfo();
-            if (modelInfo == null) {
-                throw new ProcessorException("processor.missing.model");
-            }
-
-            _model = modelInfo.buildModel(_options);
-
-        } catch (JAXWSExceptionBase e) {
-            if (_printStackTrace) {
-                _env.printStackTrace(e);
-            }
-            _env.error(e);
-        }
-    }
-
-    public void runActions() {
-        try {
-            if (_model == null) {
-                // avoid reporting yet another error here
-                return;
-            }
-
-            for (ProcessorAction action : _actions) {
-                action.perform(_model, _configuration, _options);
-            }
-        } catch (JAXWSExceptionBase e) {
-            if (_printStackTrace || _env.verbose()) {
-                _env.printStackTrace(e);
-            }
-            _env.error(e);
-        }
-    }
-
-    private final Properties _options;
-    private final Configuration _configuration;
-    private final List<ProcessorAction> _actions = new ArrayList<ProcessorAction>();
-    private Model _model;
-    private final boolean _printStackTrace;
-    private final ProcessorEnvironment _env;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorAction.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorAction.java
deleted file mode 100644
index 626d73d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-
-/**
- * A ProcessorAction is used to perform some operation on a
- * {@link com.sun.tools.internal.ws.processor.model.Model Model} such as
- * generating a Java source file.
- *
- * @author WS Development Team
- */
-public interface ProcessorAction {
-    public void perform(Model model, Configuration config, Properties options);
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java
deleted file mode 100644
index 54eb4cb..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorActionVersion.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor;
-
-/**
- * @author WS Development Team
- *
- * Typesafe enum class to hold the ProcessorActionVersion
- */
-public enum ProcessorActionVersion {
-    PRE_20("1.1.2"), VERSION_20("2.0");
-
-    ProcessorActionVersion(String version) {
-        this.version = version;
-    }
-
-    public String value() {
-        return version;
-    }
-
-    private final String version;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java
deleted file mode 100644
index b334511..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorConstants.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-/**
- * Constants used by Model, Modelers, Config ProcessorActions
- *
- * @author WS Development Team
- */
-public class ProcessorConstants {
-    public final static String SOAP_VERSION_1_1 = "SOAP 1.1";
-    public final static String SOAP_VERSION_1_2 = "SOAP 1.2";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
index 6f13aff..fd998f2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.tools.internal.ws.processor;
 
 import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
 
 /**
  * ProcessorException represents an exception that occurred while processing
@@ -42,11 +41,15 @@
         super(key, args);
     }
 
+    public ProcessorException(String msg){
+        super(msg);
+    }
+
     public ProcessorException(Throwable throwable) {
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.processor";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorNotificationListener.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorNotificationListener.java
deleted file mode 100644
index 9259e1f..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorNotificationListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-/**
- * A ProcessorNotificationListener is registered with a Processor and receives
- * notifications of errors, warnings and informational messages.
- *
- * @author WS Development Team
- */
-public interface ProcessorNotificationListener {
-    public void onError(Localizable msg);
-    public void onWarning(Localizable msg);
-    public void onInfo(Localizable msg);
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java
deleted file mode 100644
index de198cd..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorOptions.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor;
-
-/**
- * Property names used by ProcessorActions
- *
- * @author WS Development Team
- */
-public class ProcessorOptions {
-
-    public final static String SOURCE_DIRECTORY_PROPERTY = "sourceDirectory";
-    public final static String DESTINATION_DIRECTORY_PROPERTY =
-        "destinationDirectory";
-    public final static String NONCLASS_DESTINATION_DIRECTORY_PROPERTY =
-        "nonclassDestinationDirectory";
-    public final static String VALIDATE_WSDL_PROPERTY = "validationWSDL";
-    public final static String EXPLICIT_SERVICE_CONTEXT_PROPERTY =
-        "explicitServiceContext";
-    public final static String PRINT_STACK_TRACE_PROPERTY = "printStackTrace";
-    public final static String DONOT_OVERWRITE_CLASSES = "doNotOverWrite";
-    public final static String NO_DATA_BINDING_PROPERTY = "noDataBinding";
-    public final static String USE_WSI_BASIC_PROFILE = "useWSIBasicProfile";
-    public final static String STRICT_COMPLIANCE = "strictCompliance";
-    public final static String JAXWS_SOURCE_VERSION = "sourceVersion";
-    public final static String UNWRAP_DOC_LITERAL_WRAPPERS =
-        "unwrapDocLitWrappers";
-    public final static String BINDING_FILES = "bindingFiles";
-    public final static String EXTENSION = "extension";
-    public final static String PROTOCOL = "protocol";
-    public final static String TRANSPORT = "transport";
-    public final static String WSDL_LOCATION = "wsdllocation";
-    public final static String DEFAULT_PACKAGE = "defaultpackage";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java
deleted file mode 100644
index eda6fa2..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ClassModelInfo.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.xml.internal.ws.util.VersionUtil;
-
-/**
- *
- * @author WS Development Team
- */
-public class ClassModelInfo extends ModelInfo {
-
-    public ClassModelInfo(String className) {
-        this.className = className;
-    }
-
-
-    public Modeler getModeler(Properties properties) {
-        return null;
-    }
-
-    public void setClassName(String className) {
-        this.className = className;
-    }
-
-    public String getClassName() {
-        return className;
-    }
-
-    private String className;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/Configuration.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/Configuration.java
deleted file mode 100644
index f82c6a9..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/Configuration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-
-/**
- *
- * @author WS Development Team
- */
-public class Configuration {
-
-    public Configuration(ProcessorEnvironment env) {
-        _env = (ProcessorEnvironment)env;
-    }
-
-    public ModelInfo getModelInfo() {
-        return _modelInfo;
-    }
-
-    public void setModelInfo(ModelInfo i) {
-        _modelInfo = (ModelInfo)i;
-        _modelInfo.setParent(this);
-    }
-
-    public ProcessorEnvironment getEnvironment() {
-        return _env;
-    }
-
-    private ProcessorEnvironment _env;
-    private ModelInfo _modelInfo;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ConfigurationException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ConfigurationException.java
deleted file mode 100644
index 8677de2..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ConfigurationException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import com.sun.tools.internal.ws.processor.ProcessorException;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-/**
- *
- * @author WS Development Team
- */
-public class ConfigurationException extends ProcessorException {
-
-    public ConfigurationException(String key, Object... args) {
-        super(key, args);
-    }
-
-    public ConfigurationException(Throwable throwable) {
-        super(throwable);
-    }
-
-    public String getResourceBundleName() {
-        return "com.sun.tools.internal.ws.resources.configuration";
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerChainInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerChainInfo.java
deleted file mode 100644
index 9ac381e..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerChainInfo.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-/**
- *
- * @author WS Development Team
- */
-public class HandlerChainInfo {
-
-    public HandlerChainInfo() {
-        handlers = new ArrayList();
-        roles = new HashSet();
-    }
-
-    public void add(HandlerInfo i) {
-        handlers.add(i);
-    }
-
-    public Iterator getHandlers() {
-        return handlers.iterator();
-    }
-
-    public int getHandlersCount() {
-        return handlers.size();
-    }
-
-    /* serialization */
-    public List getHandlersList() {
-        return handlers;
-    }
-
-    /* serialization */
-    public void setHandlersList(List l) {
-        handlers = l;
-    }
-
-    public void addRole(String s) {
-        roles.add(s);
-    }
-
-    public Set getRoles() {
-        return roles;
-    }
-
-    /* serialization */
-    public void setRoles(Set s) {
-        roles = s;
-    }
-
-    private List handlers;
-    private Set roles;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerInfo.java
deleted file mode 100644
index 332480b..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/HandlerInfo.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import javax.xml.namespace.QName;
-
-/**
- *
- * @author WS Development Team
- */
-public class HandlerInfo {
-
-    public HandlerInfo() {
-        properties = new HashMap();
-        headerNames = new HashSet();
-    }
-
-    public String getHandlerClassName() {
-        return handlerClassName;
-    }
-
-    public void setHandlerClassName(String s) {
-        handlerClassName = s;
-    }
-
-    public Map getProperties() {
-        return properties;
-    }
-
-    /* serialization */
-    public void setProperties(Map m) {
-        properties = m;
-    }
-
-    public void addHeaderName(QName name) {
-        headerNames.add(name);
-    }
-
-    public Set getHeaderNames() {
-        return headerNames;
-    }
-
-    /* serialization */
-    public void setHeaderNames(Set s) {
-        headerNames = s;
-    }
-
-    private String handlerClassName;
-    private Map properties;
-    private Set headerNames;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java
deleted file mode 100644
index ca07bc5..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/ModelInfo.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.xml.sax.EntityResolver;
-
-/**
- * This class contiains information used by {@link com.sun.tools.internal.ws.processor.modeler.Modeler
- * Modelers} to build {@link com.sun.tools.internal.ws.processor.model.Model Models}.
- *
- * @author WS Development Team
- */
-public abstract class ModelInfo {
-
-    protected ModelInfo() {}
-
-    public Configuration getParent() {
-        return _parent;
-    }
-
-    public void setParent(Configuration c) {
-        _parent = c;
-    }
-
-    public String getName() {
-        return _name;
-    }
-
-    public void setName(String s) {
-        _name = s;
-    }
-
-    public Configuration getConfiguration() {
-        return _parent;
-    }
-
-    public HandlerChainInfo getClientHandlerChainInfo() {
-        return _clientHandlerChainInfo;
-    }
-
-    public void setClientHandlerChainInfo(HandlerChainInfo i) {
-        _clientHandlerChainInfo = i;
-    }
-
-    public HandlerChainInfo getServerHandlerChainInfo() {
-        return _serverHandlerChainInfo;
-    }
-
-    public void setServerHandlerChainInfo(HandlerChainInfo i) {
-        _serverHandlerChainInfo = i;
-    }
-
-    public String getJavaPackageName() {
-        return _javaPackageName;
-    }
-
-    public void setJavaPackageName(String s) {
-        _javaPackageName = s;
-    }
-
-    public Model buildModel(Properties options){
-        return getModeler(options).buildModel();
-    }
-
-    public EntityResolver getEntityResolver() {
-        return entityResolver;
-    }
-
-    public void setEntityResolver(EntityResolver entityResolver) {
-        this.entityResolver = entityResolver;
-    }
-
-    public String getDefaultJavaPackage() {
-        return _defaultJavaPackage;
-    }
-
-    public void setDefaultJavaPackage(String _defaultJavaPackage) {
-        this._defaultJavaPackage = _defaultJavaPackage;
-    }
-
-    protected abstract Modeler getModeler(Properties options);
-
-    private Configuration _parent;
-    private String _name;
-    private String _javaPackageName;
-    private String _defaultJavaPackage;
-    private HandlerChainInfo _clientHandlerChainInfo;
-    private HandlerChainInfo _serverHandlerChainInfo;
-    private EntityResolver entityResolver;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java
deleted file mode 100644
index 12eab00..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/WSDLModelInfo.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config;
-
-
-import java.util.*;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.tools.internal.ws.util.JAXWSClassFactory;
-
-/**
- *
- * @author WS Development Team
- */
-public class WSDLModelInfo extends ModelInfo {
-
-    public WSDLModelInfo() {}
-
-    protected Modeler getModeler(Properties options) {
-        return JAXWSClassFactory.newInstance().createWSDLModeler(this, options);
-    }
-
-    public String getLocation() {
-        return _location;
-    }
-
-    public void setLocation(String s) {
-        _location = s;
-    }
-
-    public Map<String, Document> getJAXWSBindings(){
-        return _jaxwsBindings;
-    }
-
-    public void putJAXWSBindings(String systemId, Document binding){
-        _jaxwsBindings.put(systemId, binding);
-    }
-
-    public Set<InputSource> getJAXBBindings(){
-        return _jaxbBindings;
-    }
-
-    public void addJAXBBIndings(InputSource jaxbBinding){
-        _jaxbBindings.add(jaxbBinding);
-    }
-
-    public void setHandlerConfig(Element handlerConfig){
-        this.handlerConfig = handlerConfig;
-    }
-
-    public Element getHandlerConfig(){
-        return handlerConfig;
-    }
-
-    private Element handlerConfig;
-
-    private String _location;
-
-    //external jaxws:bindings elements
-    private Map<String, Document> _jaxwsBindings = new HashMap<String, Document>();
-
-    //we need an array of jaxb:binding elements, they are children of jaxws:bindings
-    //and could come from an external customization file or wsdl.
-    private Set<InputSource> _jaxbBindings = new HashSet<InputSource>();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ClassModelParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ClassModelParser.java
deleted file mode 100644
index d34ada7..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ClassModelParser.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config.parser;
-
-
-import java.io.File;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.config.ClassModelInfo;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-
-
-/**
- *
- * @author WS Development Team
- */
-public class ClassModelParser extends InputParser {
-
-    public ClassModelParser(ProcessorEnvironment env, Properties options) {
-        super(env, options);
-    }
-
-    public Configuration parse(List<String> inputClasses) {
-        return parse(new File(inputClasses.get(0)));
-    }
-
-    public Configuration parse(File file) {
-        Configuration config = new Configuration(getEnv());
-
-        config.setModelInfo(new ClassModelInfo(file.getName()));
-        return config;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java
deleted file mode 100644
index 72670bf..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/CustomizationParser.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.net.URL;
-import java.util.*;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.EntityResolver;
-
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
-
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * @author Vivek Pandey
- *
- */
-public class CustomizationParser extends InputParser {
-
-    /**
-     * @param entityResolver
-     * @param env
-     * @param options
-     */
-    public CustomizationParser(EntityResolver entityResolver, ProcessorEnvironment env, Properties options) {
-        super(env, options);
-        this.entityResolver = entityResolver;
-    }
-
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.processor.config.parser.InputParser#parse(java.io.File[], java.lang.String)
-     */
-    protected Configuration parse(List<String> inputFiles) throws Exception{
-        //File wsdlFile = inputFiles[0];
-        Configuration configuration = new Configuration(getEnv());
-        wsdlModelInfo = new WSDLModelInfo();
-        wsdlModelInfo.setLocation(inputFiles.get(0));
-        if(_options.get(ProcessorOptions.WSDL_LOCATION) == null)
-            _options.setProperty(ProcessorOptions.WSDL_LOCATION, inputFiles.get(0));
-
-        //modelInfoParser = (JAXWSBindingInfoParser)getModelInfoParsers().get(JAXWSBindingsConstants.JAXWS_BINDINGS);
-        modelInfoParser = new JAXWSBindingInfoParser(getEnv());
-
-        //get the jaxws bindingd file and add it to the modelInfo
-        Set<String> bindingFiles = (Set<String>)_options.get(ProcessorOptions.BINDING_FILES);
-        for(String bindingFile : bindingFiles){
-            addBinding(bindingFile);
-        }
-
-
-        for(InputSource jaxwsBinding : jaxwsBindings){
-            Document doc = modelInfoParser.parse(jaxwsBinding);
-            if(doc != null){
-                wsdlModelInfo.putJAXWSBindings(jaxwsBinding.getSystemId(), doc);
-            }
-        }
-
-        //copy jaxb binding sources in modelInfo
-        for(InputSource jaxbBinding : jaxbBindings){
-            wsdlModelInfo.addJAXBBIndings(jaxbBinding);
-        }
-
-        addHandlerChainInfo();
-        configuration.setModelInfo(wsdlModelInfo);
-        return configuration;
-    }
-
-    private void addBinding(String bindingLocation) throws Exception{
-        JAXWSUtils.checkAbsoluteness(bindingLocation);
-        InputSource is = null;
-        if(entityResolver != null){
-            is = entityResolver.resolveEntity(null, bindingLocation);
-        }
-        if(is == null)
-            is = new InputSource(bindingLocation);
-
-        XMLStreamReader reader =
-                XMLStreamReaderFactory.createFreshXMLStreamReader(is, true);
-        XMLStreamReaderUtil.nextElementContent(reader);
-        if(reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)){
-            jaxwsBindings.add(is);
-        }else if(reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS)){
-            jaxbBindings.add(is);
-        }else{
-            warn("configuration.notBindingFile");
-        }
-    }
-
-    private void addHandlerChainInfo() throws Exception{
-        //setup handler chain info
-        for(Map.Entry<String, Document> entry:wsdlModelInfo.getJAXWSBindings().entrySet()){
-            Element e = entry.getValue().getDocumentElement();
-            NodeList nl = e.getElementsByTagNameNS(
-                "http://java.sun.com/xml/ns/javaee", "handler-chains");
-            if(nl.getLength()== 0)
-                continue;
-            //take the first one, anyway its 1 handler-config per customization
-            Element hc = (Element)nl.item(0);
-            wsdlModelInfo.setHandlerConfig(hc);
-            return;
-        }
-    }
-
-    private WSDLModelInfo wsdlModelInfo;
-    private JAXWSBindingInfoParser modelInfoParser;
-    private Set<InputSource> jaxwsBindings = new HashSet<InputSource>();
-    private Set<InputSource> jaxbBindings = new HashSet<InputSource>();
-    private EntityResolver entityResolver;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java
deleted file mode 100644
index a2e2b08..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/InputParser.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.namespace.QName;
-
-import org.xml.sax.InputSource;
-
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-
-/**
- * @author Vivek Pandey
- *
- *
- */
-public abstract class InputParser{
-    protected LocalizableMessageFactory _messageFactory =
-        new LocalizableMessageFactory(
-            "com.sun.tools.internal.ws.resources.configuration");
-
-    public InputParser(ProcessorEnvironment env, Properties options) {
-        this._env = env;
-        this._options = options;
-        _modelInfoParsers = new HashMap<QName, Object>();
-
-//        /*
-//         * Load modelinfo parsers from the plugins which want to extend
-//         * this functionality
-//         */
-//        Iterator i = ToolPluginFactory.getInstance().getExtensions(
-//            ToolPluginConstants.WSCOMPILE_PLUGIN,
-//            ToolPluginConstants.WSCOMPILE_MODEL_INFO_EXT_POINT);
-//        while(i != null && i.hasNext()) {
-//            ModelInfoPlugin plugin = (ModelInfoPlugin)i.next();
-//            _modelInfoParsers.put(plugin.getModelInfoName(),
-//                plugin.createModelInfoParser(env));
-//        }
-    }
-
-    protected Configuration parse(InputStream is) throws Exception{
-        //TODO: Not implemented exception
-        return null;
-    }
-
-    protected Configuration parse(InputSource is) throws Exception{
-        //TODO: Not implemented exception
-        return null;
-    }
-
-    protected Configuration parse(List<String> inputSources) throws Exception{
-        //TODO: Not implemented exception
-        return null;
-    }
-
-    /**
-     * @return Returns the _env.
-     */
-    public  ProcessorEnvironment getEnv(){
-        return _env;
-    }
-
-    /**
-     * @param env The ProcessorEnvironment to set.
-     */
-    public void setEnv(ProcessorEnvironment env){
-        this._env = env;
-    }
-
-    protected void warn(String key) {
-        _env.warn(_messageFactory.getMessage(key));
-    }
-
-    protected void warn(String key, String arg) {
-        _env.warn(_messageFactory.getMessage(key, arg));
-    }
-
-    protected void warn(String key, Object[] args) {
-        _env.warn(_messageFactory.getMessage(key, args));
-    }
-
-    protected void info(String key) {
-        _env.info(_messageFactory.getMessage(key));
-    }
-
-    protected void info(String key, String arg) {
-        _env.info(_messageFactory.getMessage(key, arg));
-    }
-
-    protected ProcessorEnvironment _env;
-    protected Properties _options;
-    protected Map<QName, Object> _modelInfoParsers;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java
deleted file mode 100644
index e4e560f..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/JAXWSBindingInfoParser.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.util.xml.NullEntityResolver;
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-
-/**
- * @author Vivek Pandey
- *
- * External jaxws:bindings parser
- */
-public class JAXWSBindingInfoParser {
-
-    private ProcessorEnvironment env;
-
-    /**
-     * @param env
-     */
-    public JAXWSBindingInfoParser(ProcessorEnvironment env) {
-        this.env = env;
-    }
-
-    public Document parse(InputSource source) {
-        try {
-            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-            builderFactory.setNamespaceAware(true);
-            builderFactory.setValidating(false);
-            DocumentBuilder builder = builderFactory.newDocumentBuilder();
-            builder.setErrorHandler(new ErrorHandler() {
-                public void error(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void fatalError(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void warning(SAXParseException err)
-                    throws SAXParseException {
-                    // do nothing
-                }
-            });
-
-            builder.setEntityResolver(new NullEntityResolver());
-            return builder.parse(source);
-        } catch (ParserConfigurationException e) {
-            throw new ParseException("parsing.parserConfigException",e);
-        } catch (FactoryConfigurationError e) {
-            throw new ParseException("parsing.factoryConfigException",e);
-        }catch(SAXException e){
-            throw new ParseException("parsing.saxException",e);
-        }catch(IOException e){
-            throw new ParseException("parsing.saxException",e);
-        }
-    }
-
-    public final Set<Element> outerBindings = new HashSet<Element>();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java
deleted file mode 100644
index 84b18c8..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/ParserUtil.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.config.parser;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-
-import com.sun.tools.internal.ws.processor.config.ConfigurationException;
-import com.sun.xml.internal.ws.streaming.Attributes;
-import com.sun.xml.internal.ws.streaming.XMLReader;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-/**
- *
- * @author WS Development Team
- */
-public class ParserUtil {
-    public static void failWithFullName(String key, String file, XMLReader reader) {
-        throw new ConfigurationException(key, new Object[] { file, Integer.toString(
-            reader.getLineNumber()), reader.getName().toString() });
-    }
-
-    public static void failWithFullName(String key, String file, XMLStreamReader reader) {
-        throw new ConfigurationException(key, new Object[] { file, Integer.toString(
-            reader.getLocation().getLineNumber()), reader.getName().toString() });
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java
deleted file mode 100644
index cd9a100..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/config/parser/Reader.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.config.parser;
-
-
-import java.net.URL;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.EntityResolver;
-
-/**
- * @author Vivek Pandey
- *
- * Main entry point from CompileTool
- */
-public class Reader {
-
-    /**
-     *
-     */
-    public Reader(ProcessorEnvironment env, Properties options) {
-        this._env = env;
-        this._options = options;
-    }
-
-    public Configuration parse(EntityResolver entityResolver, List<String> inputSources)
-            throws Exception {
-        //reset the input type flags before parsing
-        isClassFile = false;
-
-        InputParser parser = null;
-        //now its just the first file. do we expect more than one input files?
-        validateInput(inputSources.get(0));
-
-        if(isClassFile){
-            parser = new ClassModelParser(_env, _options);
-        } else {
-            parser = new CustomizationParser(entityResolver, _env, _options);
-        }
-        return parser.parse(inputSources);
-    }
-
-    protected void validateInput(String file) throws Exception{
-        if(isClass(file)){
-            isClassFile = true;
-            return;
-        }
-
-//        JAXWSUtils.checkAbsoluteness(file);
-//        URL url = new URL(file);
-//
-//        XMLStreamReader reader =
-//                XMLStreamReaderFactory.createXMLStreamReader(url.openStream(), true);
-//
-//        XMLStreamReaderUtil.nextElementContent(reader);
-//        if(!reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS)){
-//            //we are here, means invalid element
-//            ParserUtil.failWithFullName("configuration.invalidElement", file, reader);
-//        }
-    }
-
-    public boolean isClass(String className) {
-        try {
-            _env.getClassLoader().loadClass(className);
-        } catch (ClassNotFoundException e) {
-            return false;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return true;
-    }
-
-    private boolean isClassFile;
-
-    protected ProcessorEnvironment _env;
-
-    protected Properties _options;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
index 4726a47..a933faa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,28 @@
 
 package com.sun.tools.internal.ws.processor.generator;
 
-import com.sun.codemodel.internal.*;
-import com.sun.tools.internal.ws.processor.config.Configuration;
+import com.sun.codemodel.internal.ClassType;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JBlock;
+import com.sun.codemodel.internal.JClass;
+import com.sun.codemodel.internal.JClassAlreadyExistsException;
+import com.sun.codemodel.internal.JDefinedClass;
+import com.sun.codemodel.internal.JDocComment;
+import com.sun.codemodel.internal.JExpr;
+import com.sun.codemodel.internal.JFieldRef;
+import com.sun.codemodel.internal.JFieldVar;
+import com.sun.codemodel.internal.JMethod;
+import com.sun.codemodel.internal.JMod;
+import com.sun.codemodel.internal.JType;
+import com.sun.codemodel.internal.JVar;
 import com.sun.tools.internal.ws.processor.model.Fault;
 import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
 
 import javax.xml.ws.WebFault;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 /**
  *
@@ -43,39 +55,25 @@
 public class CustomExceptionGenerator extends GeneratorBase {
     private Map<String, JClass> faults = new HashMap<String, JClass>();
 
-    public CustomExceptionGenerator() {
+    public static void generate(Model model,
+        WsimportOptions options,
+        ErrorReceiver receiver){
+        CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator(model, options, receiver);
+        exceptionGen.doGeneration();
     }
-
-    public GeneratorBase getGenerator(
+    private CustomExceptionGenerator(
         Model model,
-        Configuration config,
-        Properties properties) {
-        return new CustomExceptionGenerator(model, config, properties);
+        WsimportOptions options,
+        ErrorReceiver receiver) {
+        super(model, options, receiver);
     }
 
-    public GeneratorBase getGenerator(
-        Model model,
-        Configuration config,
-        Properties properties,
-        SOAPVersion ver) {
-        return new CustomExceptionGenerator(model, config, properties);
+    public GeneratorBase getGenerator(Model model, WsimportOptions options, ErrorReceiver receiver) {
+        return new CustomExceptionGenerator(model, options, receiver);
     }
 
-    protected CustomExceptionGenerator(
-        Model model,
-        Configuration config,
-        Properties properties) {
-        super(model, config, properties);
-    }
-
-    protected void preVisitModel(Model model) throws Exception {
-    }
-
-    protected void postVisitModel(Model model) throws Exception {
-        faults = null;
-    }
-
-    protected void preVisitFault(Fault fault) throws Exception {
+    @Override
+    public void visit(Fault fault) throws Exception {
         if (isRegistered(fault))
             return;
         registerFault(fault);
@@ -93,13 +91,13 @@
          try {
             write(fault);
             faults.put(fault.getJavaException().getName(), fault.getExceptionClass());
-        } catch (Exception e) {
+        } catch (JClassAlreadyExistsException e) {
             throw new GeneratorException("generator.nestedGeneratorError",e);
         }
     }
 
-    private void write(Fault fault) throws Exception{
-        String className = env.getNames().customExceptionClassName(fault);
+    private void write(Fault fault) throws JClassAlreadyExistsException {
+        String className = Names.customExceptionClassName(fault);
 
         JDefinedClass cls = cm._class(className, ClassType.CLASS);
         JDocComment comment = cls.javadoc();
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
index 49382cf..9cee479 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,12 @@
 
 package com.sun.tools.internal.ws.processor.generator;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.model.AbstractType;
+import com.sun.codemodel.internal.ClassType;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JClassAlreadyExistsException;
+import com.sun.codemodel.internal.JCodeModel;
+import com.sun.codemodel.internal.JDefinedClass;
+import com.sun.tools.internal.ws.ToolVersion;
 import com.sun.tools.internal.ws.processor.model.Block;
 import com.sun.tools.internal.ws.processor.model.Fault;
 import com.sun.tools.internal.ws.processor.model.Model;
@@ -49,27 +41,25 @@
 import com.sun.tools.internal.ws.processor.model.Request;
 import com.sun.tools.internal.ws.processor.model.Response;
 import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeVisitor;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
 import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.ToolVersion;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.tools.internal.ws.processor.util.IndentingWriter;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
 import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.codemodel.internal.*;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
 import javax.jws.HandlerChain;
-import javax.xml.transform.Transformer;
 import javax.xml.transform.OutputKeys;
-import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.Transformer;
 import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  *
@@ -78,173 +68,53 @@
 public abstract class GeneratorBase
     implements
         GeneratorConstants,
-        ProcessorAction,
-        ModelVisitor,
-        JAXBTypeVisitor {
-    protected File sourceDir;
-    protected File destDir;
-    protected File nonclassDestDir;
-    protected ProcessorEnvironment env;
-    protected Model model;
-    protected Service service;
-    protected SOAPVersion curSOAPVersion;
-    protected String targetVersion;
+        ModelVisitor{
+    private File destDir;
+    private String targetVersion;
     protected boolean donotOverride;
-    protected String servicePackage;
     protected JCodeModel cm;
-    protected boolean printStackTrace;
-    protected String wsdlLocation;
+    protected final Model model;
+    protected final String wsdlLocation;
+    protected final ErrorReceiver receiver;
+    protected final WsimportOptions options;
 
-    private LocalizableMessageFactory messageFactory;
-
-    public GeneratorBase() {
-        sourceDir = null;
-        destDir = null;
-        nonclassDestDir = null;
-        env = null;
-        model = null;
-    }
-
-    public void perform(
-        Model model,
-        Configuration config,
-        Properties properties) {
-        GeneratorBase generator = getGenerator(model, config, properties);
-
-        generator.doGeneration();
-    }
-
-    public abstract GeneratorBase getGenerator(
-        Model model,
-        Configuration config,
-        Properties properties);
-    public abstract GeneratorBase getGenerator(
-        Model model,
-        Configuration config,
-        Properties properties,
-        SOAPVersion ver);
-
-    protected GeneratorBase(
-        Model model,
-        Configuration config,
-        Properties properties) {
-
+    protected GeneratorBase(Model model, WsimportOptions options, ErrorReceiver receiver){
         this.model = model;
-
-        if(model.getJAXBModel().getS2JJAXBModel() != null)
-            cm = model.getJAXBModel().getS2JJAXBModel().generateCode(null, new JAXBTypeGenerator.JAXBErrorListener());
-        else
-            cm = new JCodeModel();
-
-        this.env = (ProcessorEnvironment) config.getEnvironment();
-        String key = ProcessorOptions.DESTINATION_DIRECTORY_PROPERTY;
-        String dirPath = properties.getProperty(key);
-        this.destDir = new File(dirPath);
-        key = ProcessorOptions.SOURCE_DIRECTORY_PROPERTY;
-        String sourcePath = properties.getProperty(key);
-        this.sourceDir = new File(sourcePath);
-        key = ProcessorOptions.NONCLASS_DESTINATION_DIRECTORY_PROPERTY;
-        String nonclassDestPath = properties.getProperty(key);
-        this.nonclassDestDir = new File(nonclassDestPath);
-        if (nonclassDestDir == null)
-            nonclassDestDir = destDir;
-        messageFactory =
-            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.generator");
-        this.targetVersion =
-            properties.getProperty(ProcessorOptions.JAXWS_SOURCE_VERSION);
-        key = ProcessorOptions.DONOT_OVERWRITE_CLASSES;
-        this.donotOverride =
-            Boolean.valueOf(properties.getProperty(key)).booleanValue();
-        this.printStackTrace = Boolean.valueOf(properties.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
-        this.wsdlLocation = properties.getProperty(ProcessorOptions.WSDL_LOCATION);
+        this.options = options;
+        this.destDir = options.destDir;
+        this.receiver = receiver;
+        this.wsdlLocation = options.wsdlLocation;
+        this.targetVersion = options.target.getVersion();
+        this.cm = options.getCodeModel();
     }
 
     protected void doGeneration() {
         try {
             model.accept(this);
         } catch (Exception e) {
-            if (env.verbose())
-                e.printStackTrace();
-            throw new GeneratorException("generator.nestedGeneratorError",e);
+            receiver.error(e);
         }
     }
 
     public void visit(Model model) throws Exception {
-        preVisitModel(model);
-        visitModel(model);
-        postVisitModel(model);
-    }
-
-    protected void preVisitModel(Model model) throws Exception {
-    }
-
-    protected void visitModel(Model model) throws Exception {
-        env.getNames().resetPrefixFactory();
         for (Service service : model.getServices()) {
             service.accept(this);
         }
     }
 
-    protected void postVisitModel(Model model) throws Exception {
-    }
-
     public void visit(Service service) throws Exception {
-        preVisitService(service);
-        visitService(service);
-        postVisitService(service);
-    }
-
-    protected void preVisitService(Service service) throws Exception {
-        servicePackage = Names.getPackageName(service);
-    }
-
-    protected void visitService(Service service) throws Exception {
-        this.service = service;
-//        Iterator ports = service.getPorts();
         for (Port port : service.getPorts()) {
             port.accept(this);
         }
-        this.service = null;
-    }
-
-    protected void postVisitService(Service service) throws Exception {
-        Iterator extraTypes = model.getExtraTypes();
-        while (extraTypes.hasNext()) {
-            AbstractType type = (AbstractType) extraTypes.next();
-        }
-        servicePackage = null;
     }
 
     public void visit(Port port) throws Exception {
-        preVisitPort(port);
-        visitPort(port);
-        postVisitPort(port);
-    }
-
-    protected void preVisitPort(Port port) throws Exception {
-        curSOAPVersion = port.getSOAPVersion();
-    }
-
-    protected void visitPort(Port port) throws Exception {
         for (Operation operation : port.getOperations()) {
             operation.accept(this);
         }
     }
 
-    protected void postVisitPort(Port port) throws Exception {
-        curSOAPVersion = null;
-    }
-
     public void visit(Operation operation) throws Exception {
-        preVisitOperation(operation);
-        visitOperation(operation);
-        postVisitOperation(operation);
-    }
-
-    protected void preVisitOperation(Operation operation) throws Exception {
-    }
-
-    protected void visitOperation(Operation operation) throws Exception {
         operation.getRequest().accept(this);
         if (operation.getResponse() != null)
             operation.getResponse().accept(this);
@@ -258,161 +128,20 @@
         }
     }
 
-    protected void postVisitOperation(Operation operation) throws Exception {
-    }
-
     public void visit(Parameter param) throws Exception {
-        preVisitParameter(param);
-        visitParameter(param);
-        postVisitParameter(param);
-    }
-
-    protected void preVisitParameter(Parameter param) throws Exception {
-    }
-
-    protected void visitParameter(Parameter param) throws Exception {
-    }
-
-    protected void postVisitParameter(Parameter param) throws Exception {
     }
 
     public void visit(Block block) throws Exception {
-        preVisitBlock(block);
-        visitBlock(block);
-        postVisitBlock(block);
-    }
-
-    protected void preVisitBlock(Block block) throws Exception {
-    }
-
-    protected void visitBlock(Block block) throws Exception {
-    }
-
-    protected void postVisitBlock(Block block) throws Exception {
     }
 
     public void visit(Response response) throws Exception {
-        preVisitResponse(response);
-        visitResponse(response);
-        postVisitResponse(response);
     }
 
-    protected void preVisitResponse(Response response) throws Exception {
-    }
-
-    protected void visitResponse(Response response) throws Exception {
-        Iterator iter = response.getParameters();
-        AbstractType type;
-        Block block;
-        while (iter.hasNext()) {
-            ((Parameter) iter.next()).accept(this);
-        }
-        iter = response.getBodyBlocks();
-        while (iter.hasNext()) {
-            block = (Block) iter.next();
-            type = block.getType();
-            if(type instanceof JAXBType)
-                ((JAXBType) type).accept(this);
-            else if(type instanceof RpcLitStructure)
-                ((RpcLitStructure) type).accept(this);
-
-            responseBodyBlock(block);
-        }
-        iter = response.getHeaderBlocks();
-        while (iter.hasNext()) {
-            block = (Block) iter.next();
-            type = block.getType();
-            if(type instanceof JAXBType)
-                ((JAXBType) type).accept(this);
-            responseHeaderBlock(block);
-        }
-
-        //attachment
-        iter = response.getAttachmentBlocks();
-        while (iter.hasNext()) {
-            block = (Block) iter.next();
-            type = block.getType();
-            if(type instanceof JAXBType)
-                ((JAXBType) type).accept(this);
-            responseAttachmentBlock(block);
-        }
-
-    }
-
-    protected void responseBodyBlock(Block block) throws Exception {
-    }
-
-    protected void responseHeaderBlock(Block block) throws Exception {
-    }
-
-    protected void responseAttachmentBlock(Block block) throws Exception {
-    }
-
-    protected void postVisitResponse(Response response) throws Exception {
-    }
 
     public void visit(Request request) throws Exception {
-        preVisitRequest(request);
-        visitRequest(request);
-        postVisitRequest(request);
-    }
-
-    protected void preVisitRequest(Request request) throws Exception {
-    }
-
-    protected void visitRequest(Request request) throws Exception {
-        Iterator iter = request.getParameters();
-        AbstractType type;
-        Block block;
-        while (iter.hasNext()) {
-            ((Parameter) iter.next()).accept(this);
-        }
-        iter = request.getBodyBlocks();
-        while (iter.hasNext()) {
-            block = (Block) iter.next();
-            type = block.getType();
-            if(type instanceof JAXBType)
-                ((JAXBType) type).accept(this);
-            else if(type instanceof RpcLitStructure)
-                ((RpcLitStructure) type).accept(this);
-            requestBodyBlock(block);
-        }
-        iter = request.getHeaderBlocks();
-        while (iter.hasNext()) {
-            block = (Block) iter.next();
-            type = block.getType();
-            if(type instanceof JAXBType)
-                ((JAXBType) type).accept(this);
-            requestHeaderBlock(block);
-        }
-    }
-
-    protected void requestBodyBlock(Block block) throws Exception {
-    }
-
-    protected void requestHeaderBlock(Block block) throws Exception {
-    }
-
-    protected void postVisitRequest(Request request) throws Exception {
     }
 
     public void visit(Fault fault) throws Exception {
-        preVisitFault(fault);
-        visitFault(fault);
-        postVisitFault(fault);
-    }
-
-    protected void preVisitFault(Fault fault) throws Exception {
-    }
-
-    protected void visitFault(Fault fault) throws Exception {
-    }
-
-    protected void postVisitFault(Fault fault) throws Exception {
-    }
-
-    protected void writeWarning(IndentingWriter p) throws IOException {
-        writeWarning(p, targetVersion);
     }
 
     public List<String> getJAXWSClassComment(){
@@ -421,52 +150,14 @@
 
     public static List<String> getJAXWSClassComment(String targetVersion) {
         List<String> comments = new ArrayList<String>();
-        comments.add("This class was generated by the JAXWS SI.\n");
+        comments.add("This class was generated by the JAX-WS RI.\n");
         comments.add(ToolVersion.VERSION.BUILD_VERSION+"\n");
         comments.add("Generated source version: " + targetVersion);
         return comments;
     }
 
-    public static void writeWarning(IndentingWriter p,
-                                    String targetVersion) throws IOException {
-        /*
-         * Write boiler plate comment.
-         */
-        p.pln("// This class was generated by the JAX SI, do not edit.");
-        p.pln("// Contents subject to change without notice.");
-        p.pln("// " + ToolVersion.VERSION.BUILD_VERSION);
-        p.pln("// Generated source version: " + targetVersion);
-        p.pln();
-    }
-
-    public void writePackage(IndentingWriter p, String classNameStr)
-        throws IOException {
-
-        writePackage(p, classNameStr, targetVersion);
-    }
-
-    public static void writePackage(
-        IndentingWriter p,
-        String classNameStr,
-        String sourceVersion)
-        throws IOException {
-
-        writeWarning(p, sourceVersion);
-        writePackageOnly(p, classNameStr);
-    }
-
-    public static void writePackageOnly(IndentingWriter p, String classNameStr)
-        throws IOException {
-        int idx = classNameStr.lastIndexOf(".");
-        if (idx > 0) {
-            p.pln("package " + classNameStr.substring(0, idx) + ";");
-            p.pln();
-        }
-    }
-
-
     protected JDefinedClass getClass(String className, ClassType type) {
-        JDefinedClass cls = null;
+        JDefinedClass cls;
         try {
             cls = cm._class(className, type);
         } catch (JClassAlreadyExistsException e){
@@ -476,7 +167,7 @@
     }
 
     protected void log(String msg) {
-        if (env.verbose()) {
+        if (options.verbose) {
             System.out.println(
                 "["
                     + Names.stripQualifier(this.getClass().getName())
@@ -486,101 +177,14 @@
         }
     }
 
-    protected void warn(String key) {
-        env.warn(messageFactory.getMessage(key));
-    }
-
-    protected void warn(String key, String arg) {
-        env.warn(messageFactory.getMessage(key, arg));
-    }
-
-    protected void warn(String key, Object[] args) {
-        env.warn(messageFactory.getMessage(key, args));
-    }
-
-    protected void info(String key) {
-        env.info(messageFactory.getMessage(key));
-    }
-
-    protected void info(String key, String arg) {
-        env.info(messageFactory.getMessage(key, arg));
-    }
-
-    protected static void fail(String key) {
-        throw new GeneratorException(key);
-    }
-
-    protected static void fail(String key, String arg) {
-        throw new GeneratorException(key, arg);
-    }
-
-    protected static void fail(String key, String arg1, String arg2) {
-        throw new GeneratorException(key, new Object[] { arg1, arg2 });
-    }
-
-    protected static void fail(Localizable arg) {
-        throw new GeneratorException("generator.nestedGeneratorError", arg);
-    }
-
-    protected static void fail(Throwable arg) {
-        throw new GeneratorException(
-            "generator.nestedGeneratorError",
-            arg);
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.processor.model.jaxb.JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.JAXBType)
-     */
-    public void visit(JAXBType type) throws Exception {
-        preVisitJAXBType(type);
-        visitJAXBType(type);
-        postVisitJAXBType(type);
-
-    }
-
-    /**
-     * @param type
-     */
-    protected void postVisitJAXBType(JAXBType type) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @param type
-     */
-    protected void visitJAXBType(JAXBType type) {
-        // TODO Auto-generated method stub
-
-    }
-
-    /**
-     * @param type
-     */
-    protected void preVisitJAXBType(JAXBType type) {
-        // TODO Auto-generated method stub
-
-    }
-
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.processor.model.jaxb.JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.RpcLitStructure)
-     */
-    public void visit(RpcLitStructure type) throws Exception {
-        // TODO Auto-generated method stub
-
-    }
-
-    protected void writeHandlerConfig(String className, JDefinedClass cls, WSDLModelInfo wsdlModelInfo) {
-        Element e = wsdlModelInfo.getHandlerConfig();
+    protected void writeHandlerConfig(String className, JDefinedClass cls, WsimportOptions options) {
+        Element e = options.getHandlerChainConfiguration();
         if(e == null)
             return;
         JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class));
-        //String fullName = env.getNames().customJavaTypeClassName(port.getJavaInterface());
         NodeList nl = e.getElementsByTagNameNS(
             "http://java.sun.com/xml/ns/javaee", "handler-chain");
         if(nl.getLength() > 0){
-            Element hn = (Element)nl.item(0);
             String fName = getHandlerConfigFileName(className);
             handlerChainAnn.param("file", fName);
             generateHandlerChainFile(e, className);
@@ -595,14 +199,10 @@
     private void generateHandlerChainFile(Element hChains, String name) {
         String hcName = getHandlerConfigFileName(name);
 
-        File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir, env);
+        File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir);
         File hcFile = new File(packageDir, hcName);
 
-        /* adding the file name and its type */
-        GeneratedFileInfo fi = new GeneratedFileInfo();
-        fi.setFile(hcFile);
-        fi.setType("HandlerConfig");
-        env.addGeneratedFile(fi);
+        options.addGeneratedFile(hcFile);
 
         try {
             IndentingWriter p =
@@ -617,6 +217,7 @@
                 "2");
             it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
             it.transform( new DOMSource(hChains), new StreamResult(p) );
+            p.close();
         } catch (Exception e) {
             throw new GeneratorException(
                     "generator.nestedGeneratorError",
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
index c8fcd51..0688b6b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,56 +31,12 @@
  * @author WS Development Team
  */
 public interface GeneratorConstants extends ModelerConstants {
-
-    /*
-     * Constants used in the generators
-     */
-    public static final String FILE_TYPE_WSDL = "Wsdl";
-    public static final String FILE_TYPE_REMOTE_INTERFACE = "RemoteInterface";
-    public static final String FILE_TYPE_SERVICE = "Service";
-    public static final String FILE_TYPE_HANDLER_CONFIG = "HandlerConfig";
-    public static final String FILE_TYPE_SERVICE_IMPL = "ServiceImpl";
-    public static final String FILE_TYPE_EXCEPTION = "Exception";
-    public static final String FILE_TYPE_WRAPPER_BEAN = "WrapperBean";
-    public static final String FILE_TYPE_EXCEPTION_BEAN = "ExceptionBean";
-    /*
-     * Identifiers potentially useful for all Generators
-     */
-
-    public static final String ID_DELEGATE_BASE = "com.sun.xml.internal.ws.soap.internal.DelegateBase";
-
-
     public static final char DOTC = '.';
     public static final String SIG_INNERCLASS = "$";
-
-    public static final String UNDERSCORE = "_";
-    public static final String STUB_SUFFIX = "_Stub";
-
-    public static final String CLIENT_DELEGATE_SUFFIX = "_Delegate";
-    public static final String CLIENT_CONTACTINFOLIST_SUFFIX = "_ContactInfoList";
-
-    public static final String CLIENT_ENCODER_DECODER_SUFFIX = "_CED";
-    public static final String SERVER_ENCODER_DECODER_SUFFIX = "_SED";
-    public static final String TIE_SUFFIX = "_Tie";
-
-    public static final String PEPT_TIE_SUFFIX = "_PTie";
-    public static final String EPTFF_SUFFIX = "_EPTFF";
     public static final String JAVA_SRC_SUFFIX = ".java";
-    public static final String IMPL_SUFFIX = "_Impl";
-    public static final String ARRAY = "Array";
-    public static final String MEMBER_PREFIX = "my";
-
-    public static final String OPCODE_SUFFIX = "_OPCODE";
     public static final String QNAME_SUFFIX = "_QNAME";
-    public static final String TYPE_QNAME_SUFFIX = "_TYPE" + QNAME_SUFFIX;
-
     public static final String GET = "get";
     public static final String IS = "is";
-    public static final String SET = "set";
     public static final String RESPONSE = "Response";
-    public static final String NS_PREFIX = "ns";
-    public static final String SERVICE_SUFFIX = "_Service";
-    public static final String JAVA_PACKAGE_PREFIX = "java.";
-    public static final String JAVAX_PACKAGE_PREFIX = "javax.";
     public static final String FAULT_CLASS_MEMBER_NAME = "faultInfo";
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
index 12c5038..36d6c6d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.tools.internal.ws.processor.generator;
 
 import com.sun.tools.internal.ws.processor.ProcessorException;
-import com.sun.xml.internal.ws.util.localization.Localizable;
 
 /**
  *
@@ -42,7 +41,7 @@
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.generator";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
index 6f55211..64dbe6f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,7 @@
 
 package com.sun.tools.internal.ws.processor.generator;
 
-import java.io.IOException;
-import java.util.Comparator;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.Block;
-import com.sun.tools.internal.ws.processor.model.Fault;
-import com.sun.tools.internal.ws.processor.model.Operation;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
+import com.sun.tools.internal.ws.wscompile.Options;
 
 
 /**
@@ -44,67 +34,19 @@
  */
 public class GeneratorUtil implements GeneratorConstants {
 
-    public static void writeNewQName(IndentingWriter p, QName name)
-        throws IOException {
-        p.p(
-            "new QName(\""
-                + name.getNamespaceURI()
-                + "\", \""
-                + name.getLocalPart()
-                + "\")");
-    }
-
-
-    public static void writeBlockQNameDeclaration(
-        IndentingWriter p,
-        Operation operation,
-        Block block,
-        Names names)
-        throws IOException {
-        String qname = names.getBlockQNameName(operation, block);
-        p.p("private static final QName ");
-        p.p(qname + " = ");
-        writeNewQName(p, block.getName());
-        p.pln(";");
-    }
-
-    public static void writeQNameDeclaration(
-        IndentingWriter p,
-        QName name,
-        Names names)
-        throws IOException {
-        String qname = names.getQNameName(name);
-        p.p("private static final QName ");
-        p.p(qname + " = ");
-        writeNewQName(p, name);
-        p.pln(";");
-    }
-
-    public static void writeQNameTypeDeclaration(
-        IndentingWriter p,
-        QName name,
-        Names names)
-        throws IOException {
-        String qname = names.getTypeQName(name);
-        p.p("private static final QName ");
-        p.p(qname + " = ");
-        writeNewQName(p, name);
-        p.pln(";");
-    }
-
     public static boolean classExists(
-        ProcessorEnvironment env,
+        Options options,
         String className) {
         try {
             // Takes care of inner classes.
-            getLoadableClassName(className, env.getClassLoader());
+            getLoadableClassName(className, options.getClassLoader());
             return true;
         } catch(ClassNotFoundException ce) {
+            return false;
         }
-        return false;
     }
 
-    public static String getLoadableClassName(
+    private static String getLoadableClassName(
         String className,
         ClassLoader classLoader)
         throws ClassNotFoundException {
@@ -122,62 +64,4 @@
         }
         return className;
     }
-
-    public static class FaultComparator implements Comparator {
-        private boolean sortName = false;
-        public FaultComparator() {
-        }
-        public FaultComparator(boolean sortName) {
-            this.sortName = sortName;
-        }
-
-        public int compare(Object o1, Object o2) {
-            if (sortName) {
-                QName name1 = ((Fault) o1).getBlock().getName();
-                QName name2 = ((Fault) o2).getBlock().getName();
-                // Faults that are processed by name first, then type
-                if (!name1.equals(name2)) {
-                    return name1.toString().compareTo(name2.toString());
-                }
-            }
-            JavaStructureType type1 = ((Fault) o1).getJavaException();
-            JavaStructureType type2 = ((Fault) o2).getJavaException();
-            int result = sort(type1, type2);
-            return result;
-        }
-
-        protected int sort(JavaStructureType type1, JavaStructureType type2) {
-            if (type1.getName().equals(type2.getName())) {
-                return 0;
-            }
-            JavaStructureType superType;
-            superType = type1.getSuperclass();
-            while (superType != null) {
-                if (superType.equals(type2)) {
-                    return -1;
-                }
-                superType = superType.getSuperclass();
-            }
-            superType = type2.getSuperclass();
-            while (superType != null) {
-                if (superType.equals(type1)) {
-                    return 1;
-                }
-                superType = superType.getSuperclass();
-            }
-            if (type1.getSubclasses() == null && type2.getSubclasses() != null)
-                return -1;
-            if (type1.getSubclasses() != null && type2.getSubclasses() == null)
-                return 1;
-            if (type1.getSuperclass() != null
-                && type2.getSuperclass() == null) {
-                return 1;
-            }
-            if (type1.getSuperclass() == null
-                && type2.getSuperclass() != null) {
-                return -1;
-            }
-            return type1.getName().compareTo(type2.getName());
-        }
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java
deleted file mode 100644
index a4c201b..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JAXBTypeGenerator.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.generator;
-
-import java.util.Properties;
-
-import org.xml.sax.SAXParseException;
-
-import com.sun.codemodel.internal.CodeWriter;
-import com.sun.codemodel.internal.JCodeModel;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-//import com.sun.tools.internal.xjc.addon.Augmenter;
-import com.sun.tools.internal.xjc.api.ErrorListener;
-import com.sun.tools.internal.xjc.api.JAXBModel;
-import com.sun.tools.internal.xjc.api.S2JJAXBModel;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
-import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
-
-/**
- * @author Vivek Pandey
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class JAXBTypeGenerator extends GeneratorBase {
-
-    /**
-     * @author Vivek Pandey
-     *
-     * To change the template for this generated type comment go to
-     * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
-     */
-    public static class JAXBErrorListener implements ErrorListener {
-
-        /**
-         *
-         */
-        public JAXBErrorListener() {
-            super();
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
-         */
-        public void error(SAXParseException arg0) {
-            // TODO Auto-generated method stub
-
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
-         */
-        public void fatalError(SAXParseException arg0) {
-            // TODO Auto-generated method stub
-
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
-         */
-        public void warning(SAXParseException arg0) {
-            // TODO Auto-generated method stub
-
-        }
-
-        /* (non-Javadoc)
-         * @see com.sun.tools.internal.xjc.api.ErrorListener#info(org.xml.sax.SAXParseException)
-         */
-        public void info(SAXParseException arg0) {
-            // TODO Auto-generated method stub
-
-        }
-
-    }
-    /**
-     *
-     */
-    public JAXBTypeGenerator() {
-        super();
-        // TODO Auto-generated constructor stub
-    }
-    /**
-     * @param model
-     * @param config
-     * @param properties
-     */
-    public JAXBTypeGenerator(Model model, Configuration config,
-            Properties properties) {
-        super(model, config, properties);
-    }
-    /* (non-Javadoc)
-     * @see GeneratorBase#getGenerator(com.sun.xml.internal.ws.processor.model.Model, com.sun.xml.internal.ws.processor.config.Configuration, java.util.Properties)
-     */
-    public GeneratorBase getGenerator(Model model, Configuration config,
-            Properties properties) {
-        return new JAXBTypeGenerator(model, config, properties);
-    }
-    /* (non-Javadoc)
-     * @see cGeneratorBase#getGenerator(com.sun.xml.internal.ws.processor.model.Model, com.sun.xml.internal.ws.processor.config.Configuration, java.util.Properties, com.sun.xml.internal.ws.soap.SOAPVersion)
-     */
-    public GeneratorBase getGenerator(Model model, Configuration config,
-            Properties properties, SOAPVersion ver) {
-        return new JAXBTypeGenerator(model, config, properties);
-    }
-
-    /* (non-Javadoc)
-     * @see JAXBTypeVisitor#visit(JAXBType)
-     */
-    public void visit(JAXBType type) throws Exception {
-        //this is a raw type, probably from rpclit
-        if(type.getJaxbModel() == null)
-            return;
-        S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
-        if (model != null)
-            generateJAXBClasses(model);
-    }
-
-
-    /* (non-Javadoc)
-     * @see JAXBTypeVisitor#visit(com.sun.xml.internal.ws.processor.model.jaxb.RpcLitStructure)
-     */
-    public void visit(RpcLitStructure type) throws Exception {
-        S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
-        generateJAXBClasses(model);
-    }
-
-    private static boolean doneGeneration = true;
-    private void generateJAXBClasses(S2JJAXBModel model) throws Exception{
-        if(doneGeneration)
-            return;
-        JCodeModel cm = null;
-
-        // get the list of jaxb source files
-        CodeWriter cw = new WSCodeWriter(sourceDir,env);
-
-        if(env.verbose())
-            cw = new ProgressCodeWriter(cw, System.out); // TODO this should not be System.out, should be
-                                                         // something from ProcessorEnvironment
-        //TODO:set package level javadoc in JPackage
-        cm = model.generateCode(null, new ConsoleErrorReporter(env, printStackTrace));
-        cm.build(cw);
-        doneGeneration = true;
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java
new file mode 100644
index 0000000..2936437
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/JavaGeneratorExtensionFacade.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.processor.generator;
+
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
+
+/**
+ * @author Arun Gupta
+ */
+public final class JavaGeneratorExtensionFacade extends TJavaGeneratorExtension {
+    private final TJavaGeneratorExtension[] extensions;
+
+    JavaGeneratorExtensionFacade(TJavaGeneratorExtension... extensions) {
+        assert extensions != null;
+        this.extensions = extensions;
+    }
+
+    public void writeMethodAnnotations(TWSDLOperation wsdlOperation, JMethod jMethod) {
+        for (TJavaGeneratorExtension e : extensions) {
+            e.writeMethodAnnotations(wsdlOperation, jMethod);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
index a768205..0d77a45 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/Names.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,18 @@
 
 package com.sun.tools.internal.ws.processor.generator;
 
-import com.sun.tools.internal.ws.processor.model.*;
+import com.sun.tools.internal.ws.processor.model.Fault;
+import com.sun.tools.internal.ws.processor.model.ModelProperties;
+import com.sun.tools.internal.ws.processor.model.Port;
+import com.sun.tools.internal.ws.processor.model.Service;
 import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
 import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBProperty;
-import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
 import com.sun.tools.internal.ws.util.ClassNameInfo;
-import com.sun.xml.internal.ws.streaming.PrefixFactory;
-import com.sun.xml.internal.ws.streaming.PrefixFactoryImpl;
 import com.sun.xml.internal.ws.util.StringUtils;
-import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
 
 import javax.xml.namespace.QName;
-import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -50,45 +48,6 @@
  */
 public class Names implements GeneratorConstants{
 
-    public Names() {
-    }
-
-    public String stubFor(Port port, String infix) {
-        String result =
-            (String) port.getProperty(ModelProperties.PROPERTY_STUB_CLASS_NAME);
-        if (result == null) {
-            result =
-                makeDerivedClassName(
-                    port.getJavaInterface(),
-                    STUB_SUFFIX,
-                    infix);
-        }
-        return result;
-    }
-
-    public String tieFor(Port port, String infix) {
-        String result =
-            (String) port.getProperty(ModelProperties.PROPERTY_TIE_CLASS_NAME);
-        if (result == null) {
-            result =
-                makeDerivedClassName(
-                    port.getJavaInterface(),
-                    TIE_SUFFIX,
-                    infix);
-        }
-        return result;
-    }
-
-    public String makeDerivedClassName(
-        JavaInterface javaInterface,
-        String suffix,
-        String infix) {
-
-        String name =
-            ClassNameInfo.replaceInnerClassSym(javaInterface.getRealName());
-        return name + (infix == null ? "" : UNDERSCORE + infix) + suffix;
-    }
-
     public static String getPortName(Port port) {
         String javaPortName =
             (String) port.getProperty(ModelProperties.PROPERTY_JAVA_PORT_NAME);
@@ -107,10 +66,6 @@
         }
     }
 
-    public static String stripQualifier(Class classObj) {
-        String name = classObj.getName();
-        return stripQualifier(name);
-    }
 
     public static String stripQualifier(String name) {
         return ClassNameInfo.getName(name);
@@ -121,147 +76,37 @@
         return packageName != null ? packageName : "";
     }
 
-    public static String getUnqualifiedClassName(String className) {
-        return ClassNameInfo.getName(className).replace('$', '.');
+
+    public static String customJavaTypeClassName(JavaInterface intf) {
+        return intf.getName();
     }
 
-    /**
-     * Return the File object that should be used as the source file
-     * for the given Java class, using the supplied destination
-     * directory for the top of the package hierarchy.
-     */
-    public File sourceFileForClass(
-        String className,
-        String outputClassName,
-        File destDir,
-        ProcessorEnvironment env)
-        throws GeneratorException {
-        File packageDir =
-            DirectoryUtil.getOutputDirectoryFor(className, destDir, env);
-        String outputName = stripQualifier(outputClassName);
-
-        String outputFileName = outputName + JAVA_SRC_SUFFIX;
-        return new File(packageDir, outputFileName);
+    public static String customExceptionClassName(Fault fault) {
+        return fault.getJavaException().getName();
     }
 
-    public static String getPackageName(Service service) {
-        String portPackage =
-            getPackageName(service.getJavaInterface().getName());
-        return portPackage;
-    }
-
-    public String customJavaTypeClassName(JavaInterface intf) {
-        String intName = intf.getName();
-        return intName;
-    }
-
-    public String customExceptionClassName(Fault fault) {
-        String typeName = fault.getJavaException().getName();
-        return typeName;
-    }
-
-    public String getExceptionClassMemberName(){
+    public static String getExceptionClassMemberName(){
         return FAULT_CLASS_MEMBER_NAME;
     }
 
-    public String getQNameName(QName name) {
-        String qname =
-            getPrefix(name) + UNDERSCORE + name.getLocalPart() + QNAME_SUFFIX;
-        return validInternalJavaIdentifier(qname);
-    }
-
-    public String getBlockQNameName(Operation operation, Block block) {
-        QName blockName = block.getName();
-        String qname = getPrefix(blockName);
-        if (operation != null)
-            qname += UNDERSCORE + operation.getUniqueName();
-        qname += UNDERSCORE + blockName.getLocalPart() + QNAME_SUFFIX;
-        return validInternalJavaIdentifier(qname);
-    }
-
-    public String getTypeQName(QName name) {
-        String qname =
-            getPrefix(name)
-                + UNDERSCORE
-                + name.getLocalPart()
-                + TYPE_QNAME_SUFFIX;
-        return validInternalJavaIdentifier(qname);
-    }
-
-    /* (non-Javadoc)
-     * @see Names#validJavaClassName(String)
-     */
-    public String validJavaClassName(String name) {
-        return JAXBRIContext.mangleNameToClassName(name);
-    }
-
-    /* (non-Javadoc)
-     * @see Names#validJavaMemberName(String)
-     */
-    public String validJavaMemberName(String name) {
-        return JAXBRIContext.mangleNameToVariableName(name);
-    }
-
-    public String validInternalJavaIdentifier(String name) {
-        // return a valid java identifier without dropping characters (i.e. do not apply
-        // the mapping of XML names to Java identifiers in the spec); it's only meant
-        // to be used to generate internal identifiers (e.g. variable names in generated code)
-
-        StringBuffer sb = new StringBuffer();
-        for (int i = 0; i < name.length(); ++i) {
-            char ch = name.charAt(i);
-            if (i == 0) {
-                if (Character.isJavaIdentifierStart(ch)) {
-                    sb.append(ch);
-                } else {
-                    sb.append("_$");
-                    sb.append(Integer.toHexString((int) ch));
-                    sb.append("$");
-                }
-            } else {
-                if (Character.isJavaIdentifierPart(ch)) {
-                    sb.append(ch);
-                } else {
-                    sb.append("$");
-                    sb.append(Integer.toHexString((int) ch));
-                    sb.append("$");
-                }
-            }
-        }
-
-        String id = sb.toString();
-
-        String tmp = (String) reservedWords.get(id);
-        if (tmp != null)
-            id = tmp;
-        return id;
-    }
-
-    public String validExternalJavaIdentifier(String name) {
-        return validInternalJavaIdentifier(name).replace('$', '_');
-    }
-
-    public String validJavaName(String name) {
-        name = wordBreakString(name);
-        name = removeWhiteSpace(name);
-
-        String tmp = (String) reservedWords.get(name);
-        if (tmp != null)
-            name = tmp;
-        return name;
-    }
-
-    public boolean isJavaReservedWord(String name) {
+    public static boolean isJavaReservedWord(String name) {
         return reservedWords.get(name) != null;
     }
 
+    /**
+     * See if its a java keyword name, if so then mangle the name
+     */
+    public static @NotNull String getJavaReserverVarialbeName(@NotNull String name){
+        return (reservedWords.get(name) == null)?name:reservedWords.get(name);
+    }
+
     /* here we check on wether return values datatype is
        boolean. If its boolean, instead of a get method
        its set a is<MethodName> to comply with JavaBeans
        Pattern spec */
-    public String getJavaMemberReadMethod(JavaStructureMember member) {
-        String return_value = null;
-        if ((member.getType().getRealName()) == "boolean") {
+    public static String getJavaMemberReadMethod(JavaStructureMember member) {
+        String return_value;
+        if (member.getType().getRealName().equals("boolean")) {
             return_value = IS + StringUtils.capitalize(member.getName());
         } else {
             return_value = GET + StringUtils.capitalize(member.getName());
@@ -269,104 +114,14 @@
         return (return_value);
     }
 
-    public String getJavaMemberWriteMethod(JavaStructureMember member) {
-        return SET + StringUtils.capitalize(member.getName());
-    }
-
     public static String getResponseName(String messageName) {
         return messageName + RESPONSE;
     }
 
-
-    public String getJavaReadMethod(JAXBProperty prop){
-        if(prop.getType().getName().equals("boolean"))
-            return IS + StringUtils.capitalize(prop.getName());
-        return getJavaReadMethod(prop.getName());
-    }
-
-    public String getJavaWriteMethod(JAXBProperty prop){
-        return getJavaWriteMethod(prop.getName());
-    }
-
-    public String getJavaReadMethod(String prop){
-        return GET + StringUtils.capitalize(prop);
-    }
-
-    public String getJavaWriteMethod(String prop){
-        return SET + StringUtils.capitalize(prop);
-    }
-
-    public String removeWhiteSpace(String str) {
-        String tmp = removeCharacter(' ', str);
-        return tmp;
-    }
-
-    public String wordBreakString(String str) {
-        StringBuffer buf = new StringBuffer(str);
-        char ch;
-        for (int i = 0; i < buf.length(); i++) {
-            ch = buf.charAt(i);
-            if (Character.isDigit(ch)) {
-                if (i + 1 < buf.length()
-                    && !Character.isDigit(buf.charAt(i + 1))) {
-                    buf.insert(1 + i++, ' ');
-                }
-            } else if (Character.isSpaceChar(ch) || ch == '_') {
-                continue;
-            } else if (!Character.isJavaIdentifierPart(ch)) {
-                buf.setCharAt(i, ' ');
-            } else if (!Character.isLetter(ch)) {
-                buf.setCharAt(i, ' ');
-            }
-        }
-        return buf.toString();
-    }
-
-    public String removeCharacter(int ch, String str) {
-        String tmp;
-        int idx = str.indexOf(ch);
-        while (idx >= 0) {
-            str =
-                str.substring(0, idx)
-                    + StringUtils.capitalize(str.substring(idx + 1).trim());
-            idx = str.indexOf(' ');
-        }
-
-        return str;
-    }
-
-    public String getPrefix(QName name) {
-        return getPrefix(name.getNamespaceURI());
-    }
-
-    public String getPrefix(String uri) {
-        return prefixFactory.getPrefix(uri);
-    }
-
-    public void resetPrefixFactory() {
-        prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
-    }
-
-    public void setSerializerNameInfix(String serNameInfix) {
-        if (serNameInfix != null && serNameInfix.length() > 0)
-            serializerNameInfix = UNDERSCORE + serNameInfix;
-    }
-
-    public String getSerializerNameInfix() {
-        // Fix for bug 4811625 and 4778136, undoing what setter does (remove beginning underscore)
-        String str = serializerNameInfix;
-        if ((serializerNameInfix != null)
-            && (serializerNameInfix.charAt(0) == '_'))
-            str = serializerNameInfix.substring(1);
-        return str;
-    }
-
-    protected String serializerNameInfix = null;
-    protected PrefixFactory prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
-    protected static Map reservedWords;
+    private static final Map<String, String> reservedWords;
 
     static {
-        reservedWords = new HashMap();
+        reservedWords = new HashMap<String, String>();
         reservedWords.put("abstract", "_abstract");
         reservedWords.put("assert", "_assert");
         reservedWords.put("boolean", "_boolean");
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
index 542f161..79334ed 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,87 +26,58 @@
 package com.sun.tools.internal.ws.processor.generator;
 
 import com.sun.codemodel.internal.*;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
 import com.sun.tools.internal.ws.processor.model.*;
 import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
 import com.sun.tools.internal.ws.processor.model.java.JavaMethod;
 import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.processor.util.IndentingWriter;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.Options;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.PortType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
 
-import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebService;
 import javax.jws.soap.SOAPBinding;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.Holder;
+import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.namespace.QName;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
 import java.util.List;
-import java.util.Properties;
-import java.util.Iterator;
 
-public class SeiGenerator extends GeneratorBase implements ProcessorAction {
-    private WSDLModelInfo wsdlModelInfo;
+public class SeiGenerator extends GeneratorBase{
     private String serviceNS;
+    private TJavaGeneratorExtension extension;
+    private List<TJavaGeneratorExtension> extensionHandlers;
 
-    public SeiGenerator() {
+    public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions){
+        SeiGenerator seiGenerator = new SeiGenerator(model, options, receiver, extensions);
+        seiGenerator.doGeneration();
     }
 
-    protected void doGeneration() {
-        try {
-            model.accept(this);
-        } catch (Exception e) {
-            if (env.verbose())
-                e.printStackTrace();
-            throw new GeneratorException(
-                "generator.nestedGeneratorError",
-                e);
-        }
+    private SeiGenerator(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
+        super(model, options, receiver);
+        extensionHandlers = new ArrayList<TJavaGeneratorExtension>();
+
+        // register handlers for default extensions
+        //spec does not require generation of these annotations
+        // and we can infer from wsdl anyway, so lets disable it
+        //register(new W3CAddressingJavaGeneratorExtension());
+
+        for (TJavaGeneratorExtension j : extensions)
+            register(j);
+
+        this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[0]));
     }
 
-    public GeneratorBase getGenerator(Model model, Configuration config, Properties properties) {
-        return new SeiGenerator(model, config, properties);
-    }
-
-    public SeiGenerator(Model model, Configuration config, Properties properties) {
-        super(model, config, properties);
-        this.model = model;
-        this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
-    }
-
-    public GeneratorBase getGenerator(Model model, Configuration config, Properties properties, SOAPVersion ver) {
-        return new SeiGenerator(model, config, properties);
-    }
-
-
-    private void write(Service service, Port port) throws Exception{
+    private void write(Port port) {
         JavaInterface intf = port.getJavaInterface();
-        String className = env.getNames().customJavaTypeClassName(intf);
+        String className = Names.customJavaTypeClassName(intf);
 
-        if (donotOverride && GeneratorUtil.classExists(env, className)) {
+        if (donotOverride && GeneratorUtil.classExists(options, className)) {
             log("Class " + className + " exists. Not overriding.");
             return;
         }
@@ -137,20 +108,24 @@
 
         //@WebService
         JAnnotationUse webServiceAnn = cls.annotate(cm.ref(WebService.class));
-        writeWebServiceAnnotation(service, port, webServiceAnn);
+        writeWebServiceAnnotation(port, webServiceAnn);
 
         //@HandlerChain
-        writeHandlerConfig(env.getNames().customJavaTypeClassName(port.getJavaInterface()), cls, wsdlModelInfo);
+        writeHandlerConfig(Names.customJavaTypeClassName(port.getJavaInterface()), cls, options);
 
         //@SOAPBinding
         writeSOAPBinding(port, cls);
 
+        //@XmlSeeAlso
+        if(options.target.isLaterThan(Options.Target.V2_1))
+            writeXmlSeeAlso(cls);
+
         for (Operation operation: port.getOperations()) {
             JavaMethod method = operation.getJavaMethod();
 
             //@WebMethod
-            JMethod m = null;
-            JDocComment methodDoc = null;
+            JMethod m;
+            JDocComment methodDoc;
             String methodJavaDoc = operation.getJavaDoc();
             if(method.getReturnType().getName().equals("void")){
                 m = cls.method(JMod.PUBLIC, void.class, method.getName());
@@ -169,7 +144,7 @@
             writeWebMethod(operation, m);
             JClass holder = cm.ref(Holder.class);
             for (JavaParameter parameter: method.getParametersList()) {
-                JVar var = null;
+                JVar var;
                 JAXBTypeAndAnnotation paramType = parameter.getType().getType();
                 if (parameter.isHolder()) {
                     var = m.param(holder.narrow(paramType.getType().boxify()), parameter.getName());
@@ -183,21 +158,38 @@
                 JAnnotationUse paramAnn = var.annotate(cm.ref(WebParam.class));
                 writeWebParam(operation, parameter, paramAnn);
             }
+            com.sun.tools.internal.ws.wsdl.document.Operation wsdlOp = operation.getWSDLPortTypeOperation();
             for(Fault fault:operation.getFaultsSet()){
                 m._throws(fault.getExceptionClass());
                 methodDoc.addThrows(fault.getExceptionClass());
+                wsdlOp.putFault(fault.getWsdlFaultName(), fault.getExceptionClass());
+            }
+
+            //It should be the last thing to invoke after JMethod is built completely
+            extension.writeMethodAnnotations(wsdlOp, m);
+        }
+    }
+
+    private void writeXmlSeeAlso(JDefinedClass cls) {
+        if (model.getJAXBModel().getS2JJAXBModel() != null) {
+            List<JClass> objectFactories = model.getJAXBModel().getS2JJAXBModel().getAllObjectFactories();
+
+            //if there are no object facotires, dont generate @XmlSeeAlso
+            if(objectFactories.size() == 0)
+                return;
+
+            JAnnotationUse xmlSeeAlso = cls.annotate(cm.ref(XmlSeeAlso.class));
+            JAnnotationArrayMember paramArray = xmlSeeAlso.paramArray("value");
+            for (JClass of : objectFactories) {
+                paramArray = paramArray.param(of);
             }
         }
-        CodeWriter cw = new WSCodeWriter(sourceDir,env);
 
-        if(env.verbose())
-            cw = new ProgressCodeWriter(cw, System.out);
-        cm.build(cw);
     }
 
     private void writeWebMethod(Operation operation, JMethod m) {
         Response response = operation.getResponse();
-        JAnnotationUse webMethodAnn = m.annotate(cm.ref(WebMethod.class));;
+        JAnnotationUse webMethodAnn = m.annotate(cm.ref(WebMethod.class));
         String operationName = (operation instanceof AsyncOperation)?
                 ((AsyncOperation)operation).getNormalOperation().getName().getLocalPart():
                 operation.getName().getLocalPart();
@@ -214,7 +206,7 @@
             m.annotate(javax.jws.Oneway.class);
         }else if (!operation.getJavaMethod().getReturnType().getName().equals("void") &&
                  operation.getResponse().getParametersList().size() > 0){
-            Block block = null;
+            Block block;
             String resultName = null;
             String nsURI = null;
             if (operation.getResponse().getBodyBlocks().hasNext()) {
@@ -245,11 +237,9 @@
                         JAnnotationUse wr = null;
 
                         if(!resultName.equals("return")){
-                            if(wr == null)
-                                wr = m.annotate(javax.jws.WebResult.class);
+                            wr = m.annotate(javax.jws.WebResult.class);
                             wr.param("name", resultName);
                         }
-                        //if (operation.getStyle().equals(SOAPStyle.DOCUMENT) && !(nsURI.equals(serviceNS))) {
                         if((nsURI != null) && (!nsURI.equals(serviceNS) || (isDocStyle && operation.isWrapped()))){
                             if(wr == null)
                                 wr = m.annotate(javax.jws.WebResult.class);
@@ -298,18 +288,6 @@
         }
     }
 
-    //TODO: JAXB should expose the annotations so that it can be added to JAnnotationUse
-    protected void writeJAXBTypeAnnotations(JAnnotationUse annUse, Parameter param) throws IOException{
-        List<String> annotations = param.getAnnotations();
-        if(annotations == null)
-            return;
-
-        for(String annotation:param.getAnnotations()){
-            //p.pln(annotation);
-            //annUse.
-        }
-    }
-
     private boolean isMessageParam(Parameter param, Message message) {
         Block block = param.getBlock();
 
@@ -357,7 +335,7 @@
         Response res = operation.getResponse();
 
         boolean header = isHeaderParam(param, req) ||
-            (res != null ? isHeaderParam(param, res) : false);
+            (res != null && isHeaderParam(param, res));
 
         String name;
         boolean isWrapped = operation.isWrapped();
@@ -374,9 +352,9 @@
         if (isDocStyle) {
             ns = param.getBlock().getName().getNamespaceURI(); // its bare nsuri
             if(isWrapped){
-                ns = ((JAXBType)param.getType()).getName().getNamespaceURI();
+                ns = param.getType().getName().getNamespaceURI();
             }
-        }else if(!isDocStyle && header){
+        }else if(header){
             ns = param.getBlock().getName().getNamespaceURI();
         }
 
@@ -390,7 +368,7 @@
         if (param.isINOUT()){
             paramAnno.param("mode", javax.jws.WebParam.Mode.INOUT);
         }else if ((res != null) && (isMessageParam(param, res) || isHeaderParam(param, res) || isAttachmentParam(param, res) ||
-                isUnboundParam(param,res))){
+                isUnboundParam(param,res) || param.isOUT())){
             paramAnno.param("mode", javax.jws.WebParam.Mode.OUT);
         }
 
@@ -399,14 +377,13 @@
             paramAnno.param("partName", javaParameter.getParameter().getName());
     }
 
-    boolean isDocStyle = true;
-    boolean sameParamStyle = true;
+    private boolean isDocStyle = true;
+    private boolean sameParamStyle = true;
     private void writeSOAPBinding(Port port, JDefinedClass cls) {
         JAnnotationUse soapBindingAnn = null;
-        isDocStyle = port.getStyle() != null ? port.getStyle().equals(SOAPStyle.DOCUMENT) : true;
+        isDocStyle = port.getStyle() == null || port.getStyle().equals(SOAPStyle.DOCUMENT);
         if(!isDocStyle){
-            if(soapBindingAnn == null)
-                soapBindingAnn = cls.annotate(SOAPBinding.class);
+            soapBindingAnn = cls.annotate(SOAPBinding.class);
             soapBindingAnn.param("style", SOAPBinding.Style.RPC);
             port.setWrapped(true);
         }
@@ -433,7 +410,7 @@
         }
     }
 
-    private void writeWebServiceAnnotation(Service service, Port port, JAnnotationUse wsa) {
+    private void writeWebServiceAnnotation(Port port, JAnnotationUse wsa) {
         QName name = (QName) port.getProperty(ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
         wsa.param("name", name.getLocalPart());
         wsa.param("targetNamespace", name.getNamespaceURI());
@@ -451,7 +428,7 @@
     public void visit(Service service) throws Exception {
         String jd = model.getJavaDoc();
         if(jd != null){
-            JPackage pkg = cm._package(wsdlModelInfo.getJavaPackageName());
+            JPackage pkg = cm._package(options.defaultPackage);
             pkg.javadoc().add(jd);
         }
 
@@ -467,11 +444,15 @@
 
 
         try {
-            write(service, port);
+            write(port);
         } catch (Exception e) {
             throw new GeneratorException(
                 "generator.nestedGeneratorError",
                 e);
         }
     }
+
+    private void register(TJavaGeneratorExtension h) {
+        extensionHandlers.add(h);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
index 1e2eadb..2cea118 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,97 +25,51 @@
 
 package com.sun.tools.internal.ws.processor.generator;
 
-import com.sun.codemodel.internal.JClassAlreadyExistsException;
-import com.sun.codemodel.internal.ClassType;
-import com.sun.codemodel.internal.CodeWriter;
-import com.sun.codemodel.internal.JAnnotationUse;
-import com.sun.codemodel.internal.JClass;
-import com.sun.codemodel.internal.JCommentPart;
-import com.sun.codemodel.internal.JDefinedClass;
-import com.sun.codemodel.internal.JDocComment;
-import com.sun.codemodel.internal.JExpression;
-import com.sun.codemodel.internal.JFieldVar;
-import com.sun.codemodel.internal.JMethod;
-import com.sun.codemodel.internal.JMod;
-import com.sun.codemodel.internal.JType;
 import com.sun.codemodel.internal.*;
-import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-import java.util.Properties;
-
-import com.sun.tools.internal.xjc.api.XJC;
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
 import com.sun.tools.internal.ws.processor.model.Model;
 import com.sun.tools.internal.ws.processor.model.Port;
 import com.sun.tools.internal.ws.processor.model.Service;
 import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.wscompile.WSCodeWriter;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.util.StringUtils;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.Options;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.resources.GeneratorMessages;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.ws.util.JAXWSUtils;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.MalformedURLException;
+import javax.xml.namespace.QName;
 import javax.xml.ws.WebEndpoint;
 import javax.xml.ws.WebServiceClient;
-import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceFeature;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 
 /**
  *
  * @author WS Development Team
  */
-public class ServiceGenerator extends GeneratorBase implements ProcessorAction {
-    private String serviceNS;
-    private WSDLModelInfo wsdlModelInfo;
+public class ServiceGenerator extends GeneratorBase{
 
-    public ServiceGenerator() {
-        super();
+    public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver){
+        ServiceGenerator serviceGenerator = new ServiceGenerator(model, options, receiver);
+        serviceGenerator.doGeneration();
     }
-
-    private ServiceGenerator(
-        Model model,
-        Configuration config,
-        Properties properties) {
-        super(model, config, properties);
-        this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
-    }
-
-    public GeneratorBase getGenerator(
-        Model model,
-        Configuration config,
-        Properties properties) {
-        return new ServiceGenerator(model, config, properties);
-    }
-
-    public GeneratorBase getGenerator(
-        Model model,
-        Configuration config,
-        Properties properties,
-        SOAPVersion ver) {
-        return new ServiceGenerator(model, config, properties);
-    }
-
-    /**
-     * Generates an expression that evaluates to "new QName(...)"
-     */
-    private JInvocation createQName(QName name) {
-        return JExpr._new(cm.ref(QName.class)).arg(name.getNamespaceURI()).arg(name.getLocalPart());
+    private ServiceGenerator(Model model, WsimportOptions options, ErrorReceiver receiver) {
+        super(model, options, receiver);
     }
 
     private JInvocation createURL(URL url) {
         return JExpr._new(cm.ref(URL.class)).arg(url.toExternalForm());
     }
 
-    protected void visitService(Service service) {
+    @Override
+    public void visit(Service service) {
         try {
-            JavaInterface intf = (JavaInterface) service.getJavaInterface();
-            String className = env.getNames().customJavaTypeClassName(intf);
-            if (donotOverride && GeneratorUtil.classExists(env, className)) {
+            JavaInterface intf = service.getJavaInterface();
+            String className = Names.customJavaTypeClassName(intf);
+            if (donotOverride && GeneratorUtil.classExists(options, className)) {
                 log("Class " + className + " exists. Not overriding.");
                 return;
             }
@@ -168,46 +122,70 @@
             writeWebServiceClientAnnotation(service, webServiceClientAnn);
 
             //@HandlerChain
-            writeHandlerConfig(env.getNames().customJavaTypeClassName(service.getJavaInterface()), cls, wsdlModelInfo);
+            writeHandlerConfig(Names.customJavaTypeClassName(service.getJavaInterface()), cls, options);
 
             for (Port port: service.getPorts()) {
                 if (port.isProvider()) {
                     continue;  // No getXYZPort() for porvider based endpoint
                 }
-                //@WebEndpoint
-                JMethod m = null;
-                JDocComment methodDoc = null;
-                JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
-                m = cls.method(JMod.PUBLIC, retType, port.getPortGetter());
-                methodDoc = m.javadoc();
-                if(port.getJavaDoc() != null)
-                    methodDoc.add(port.getJavaDoc());
-                JCommentPart ret = methodDoc.addReturn();
-                ret.add("returns "+retType.name());
-                JBlock body = m.body();
-                StringBuffer statement = new StringBuffer("return (");
-                statement.append(retType.name());
-                statement.append(")super.getPort(new QName(\""+port.getName().getNamespaceURI()+"\", \""+ port.getName().getLocalPart()+"\"), ");
-                statement.append(retType.name());
-                statement.append(".class);");
-                body.directStatement(statement.toString());
-                writeWebEndpoint(port, m);
+
+                //write getXyzPort()
+                writeDefaultGetPort(port, cls);
+
+                //write getXyzPort(WebServicesFeature...)
+                if(options.target.isLaterThan(Options.Target.V2_1))
+                    writeGetPort(port, cls);
             }
-            CodeWriter cw = new WSCodeWriter(sourceDir,env);
-
-            if(env.verbose())
-                cw = new ProgressCodeWriter(cw, System.out);
-            cm.build(cw);
-
         } catch (IOException e) {
-            throw new GeneratorException(
-                "generator.nestedGeneratorError",
-                e);
+            receiver.error(e);
         }
     }
 
+    private void writeGetPort(Port port, JDefinedClass cls) {
+        JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
+        JMethod m = cls.method(JMod.PUBLIC, retType, port.getPortGetter());
+        JDocComment methodDoc = m.javadoc();
+        if(port.getJavaDoc() != null)
+            methodDoc.add(port.getJavaDoc());
+        JCommentPart ret = methodDoc.addReturn();
+        JCommentPart paramDoc = methodDoc.addParam("features");
+        paramDoc.append("A list of ");
+        paramDoc.append("{@link "+WebServiceFeature.class.getName()+"}");
+        paramDoc.append("to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.");
+        ret.add("returns "+retType.name());
+        m.varParam(WebServiceFeature.class, "features");
+        JBlock body = m.body();
+        StringBuffer statement = new StringBuffer("return (");
+        statement.append(retType.name());
+        statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+        statement.append(retType.name());
+        statement.append(".class, features);");
+        body.directStatement(statement.toString());
+        writeWebEndpoint(port, m);
+    }
+
+    private void writeDefaultGetPort(Port port, JDefinedClass cls) {
+        JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
+        String portGetter = port.getPortGetter();
+        JMethod m = cls.method(JMod.PUBLIC, retType, portGetter);
+        JDocComment methodDoc = m.javadoc();
+        if(port.getJavaDoc() != null)
+            methodDoc.add(port.getJavaDoc());
+        JCommentPart ret = methodDoc.addReturn();
+        ret.add("returns "+retType.name());
+        JBlock body = m.body();
+        StringBuffer statement = new StringBuffer("return (");
+        statement.append(retType.name());
+        statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+        statement.append(retType.name());
+        statement.append(".class);");
+        body.directStatement(statement.toString());
+        writeWebEndpoint(port, m);
+    }
+
+
     protected JDefinedClass getClass(String className, ClassType type) {
-        JDefinedClass cls = null;
+        JDefinedClass cls;
         try {
             cls = cm._class(className, type);
         } catch (JClassAlreadyExistsException e){
@@ -218,7 +196,7 @@
 
     private void writeWebServiceClientAnnotation(Service service, JAnnotationUse wsa) {
         String serviceName = service.getName().getLocalPart();
-        serviceNS = service.getName().getNamespaceURI();
+        String serviceNS= service.getName().getNamespaceURI();
         wsa.param("name", serviceName);
         wsa.param("targetNamespace", serviceNS);
         wsa.param("wsdlLocation", wsdlLocation);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java
deleted file mode 100644
index 20ba880..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SimpleToBoxedUtil.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.generator;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- *
- * @author WS Development Team
- */
-public final class SimpleToBoxedUtil {
-
-    public static String getBoxedExpressionOfType(String s, String c) {
-        if (isPrimitive(c)) {
-            StringBuffer sb = new StringBuffer();
-            sb.append("new ");
-            sb.append(getBoxedClassName(c));
-            sb.append('(');
-            sb.append(s);
-            sb.append(')');
-            return sb.toString();
-        } else
-            return s;
-    }
-
-    public static String getUnboxedExpressionOfType(String s, String c) {
-        if (isPrimitive(c)) {
-            StringBuffer sb = new StringBuffer();
-            sb.append('(');
-            sb.append(s);
-            sb.append(").");
-            sb.append(c);
-            sb.append("Value()");
-            return sb.toString();
-        } else
-            return s;
-    }
-
-    public static String convertExpressionFromTypeToType(
-        String s,
-        String from,
-        String to)
-        throws Exception {
-        if (from.equals(to))
-            return s;
-        else {
-            if (!isPrimitive(to) && isPrimitive(from))
-                return getBoxedExpressionOfType(s, from);
-            else if (isPrimitive(to) && isPrimitive(from))
-                return getUnboxedExpressionOfType(s, to);
-            else
-                return s;
-        }
-    }
-
-    public static String getBoxedClassName(String className) {
-        if (isPrimitive(className)) {
-            StringBuffer sb = new StringBuffer();
-            sb.append("java.lang.");
-            if (className.equals(int.class.getName()))
-                sb.append("Integer");
-            else if (className.equals(char.class.getName()))
-                sb.append("Character");
-            else {
-                sb.append(Character.toUpperCase(className.charAt(0)));
-                sb.append(className.substring(1));
-            }
-            return sb.toString();
-        } else
-            return className;
-    }
-
-    public static boolean isPrimitive(String className) {
-        return primitiveSet.contains(className);
-    }
-
-    static Set primitiveSet = null;
-
-    static {
-        primitiveSet = new HashSet();
-        primitiveSet.add("boolean");
-        primitiveSet.add("byte");
-        primitiveSet.add("double");
-        primitiveSet.add("float");
-        primitiveSet.add("int");
-        primitiveSet.add("long");
-        primitiveSet.add("short");
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java
new file mode 100644
index 0000000..dbc10dd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: W3CAddressingJavaGeneratorExtension.java,v 1.1.2.4 2006/10/31 19:57:28 vivekp Exp $
+ */
+
+package com.sun.tools.internal.ws.processor.generator;
+
+import com.sun.codemodel.internal.JAnnotationArrayMember;
+import com.sun.codemodel.internal.JAnnotationUse;
+import com.sun.codemodel.internal.JClass;
+import com.sun.codemodel.internal.JMethod;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
+import com.sun.tools.internal.ws.wsdl.document.Fault;
+import com.sun.tools.internal.ws.wsdl.document.Operation;
+
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+import java.util.Map;
+
+/**
+ * @author Arun Gupta
+ */
+public class W3CAddressingJavaGeneratorExtension extends TJavaGeneratorExtension {
+    @Override
+    public void writeMethodAnnotations(TWSDLOperation two, JMethod jMethod) {
+        JAnnotationUse actionAnn = null;
+
+        if (!(two instanceof Operation))
+            return;
+
+        Operation o = ((Operation)two);
+
+        // explicit input action
+        if (o.getInput().getAction() != null && !o.getInput().getAction().equals("")) {
+            // explicitly specified
+            actionAnn = jMethod.annotate(Action.class);
+            actionAnn.param("input", o.getInput().getAction());
+        }
+
+        // explicit output action
+        if (o.getOutput() != null && o.getOutput().getAction() != null && !o.getOutput().getAction().equals("")) {
+            // explicitly specified
+            if (actionAnn == null)
+                actionAnn = jMethod.annotate(Action.class);
+
+            actionAnn.param("output", o.getOutput().getAction());
+        }
+
+        // explicit fault action
+        if (o.getFaults() != null && o.getFaults().size() > 0) {
+            Map<String, JClass> map = o.getFaults();
+            JAnnotationArrayMember jam = null;
+
+            for (Fault f : o.faults()) {
+                if (f.getAction() == null)
+                    continue;
+
+                if (f.getAction().equals(""))
+                    continue;
+
+                if (actionAnn == null) {
+                    actionAnn = jMethod.annotate(Action.class);
+                }
+                if (jam == null) {
+                    jam = actionAnn.paramArray("fault");
+                }
+                final JAnnotationUse faAnn = jam.annotate(FaultAction.class);
+                faAnn.param("className", map.get(f.getName()));
+                faAnn.param("value", f.getAction());
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
index 56aadfb..b84bbe0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AbstractType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,14 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.processor.model.java.JavaType;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.xml.internal.ws.util.NullIterator;
-
 /**
  *
  * @author WS Development Team
@@ -123,7 +122,7 @@
 
     public Iterator getProperties() {
         if (properties == null) {
-            return NullIterator.getInstance();
+            return Collections.emptyList().iterator();
         } else {
             return properties.keySet().iterator();
         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
index 282c3ea..9aa2642 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,14 @@
  */
 package com.sun.tools.internal.ws.processor.model;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
 import com.sun.codemodel.internal.JClass;
 import com.sun.codemodel.internal.JCodeModel;
+import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
+import com.sun.tools.internal.ws.processor.model.java.JavaType;
+import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
 
 
 /**
@@ -44,24 +44,24 @@
     /**
      *
      */
-    public AsyncOperation() {
-        super();
+    public AsyncOperation(Entity entity) {
+        super(entity);
         // TODO Auto-generated constructor stub
     }
 
     /**
      * @param operation
      */
-    public AsyncOperation(Operation operation) {
-        super(operation);
+    public AsyncOperation(Operation operation, Entity entity) {
+        super(operation, entity);
         this.operation = operation;
     }
 
     /**
      * @param name
      */
-    public AsyncOperation(QName name) {
-        super(name);
+    public AsyncOperation(QName name, Entity entity) {
+        super(name, entity);
         // TODO Auto-generated constructor stub
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
index 2875899..786281d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperationType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 /**
  * @author Vivek Pandey
  *
- * Async Operation type
+ * Async WSDLOperation type
  */
 public final class AsyncOperationType {
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
index 5732853..690eb5d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Block.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,10 @@
  */
 package com.sun.tools.internal.ws.processor.model;
 
+
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wsdl.document.*;
+
 import javax.xml.namespace.QName;
 
 /**
@@ -37,13 +41,8 @@
     public static final int HEADER = 2;
     public static final int ATTACHMENT = 3;
 
-    public Block() {}
-
-    public Block(QName name) {
-        this.name = name;
-    }
-
-    public Block(QName name, AbstractType type) {
+    public Block(QName name, AbstractType type, Entity entity) {
+        super(entity);
         this.name = name;
         this.type = type;
     }
@@ -52,10 +51,6 @@
         return name;
     }
 
-    public void setName(QName n) {
-        name = n;
-    }
-
     public AbstractType getType() {
         return type;
     }
@@ -76,16 +71,7 @@
         visitor.visit(this);
     }
 
-    private QName name;
+    private final QName name;
     private AbstractType type;
     private int location;
-
-    /**
-     * @return true if the block is unbound
-     */
-    public boolean isUnbound() {
-        if(location == UNBOUND)
-            return true;
-        return false;
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
index 4897843..e2d63de 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
index 4b62705..e5c1f09 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Fault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,26 +24,29 @@
  */
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.codemodel.internal.JClass;
+import com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
+import com.sun.tools.internal.ws.processor.model.java.JavaException;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.TreeSet;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
-import com.sun.tools.internal.ws.processor.model.java.JavaException;
-import com.sun.codemodel.internal.JClass;
-
 /**
  *
  * @author WS Development Team
  */
 public class Fault extends ModelObject {
 
-    public Fault() {}
+    public Fault(Entity entity) {
+        super(entity);
+    }
 
-    public Fault(String name) {
+    public Fault(String name, Entity entity) {
+        super(entity);
         this.name = name;
         parentFault = null;
     }
@@ -80,26 +83,6 @@
         return parentFault;
     }
 
-    public void setParentFault(Fault parentFault) {
-        if (this.parentFault != null &&
-            parentFault != null &&
-            !this.parentFault.equals(parentFault)) {
-
-            throw new ModelException("model.parent.fault.already.set",
-                new Object[] {
-                    getName(),
-                    this.parentFault.getName(),
-                    parentFault.getName()
-            });
-        }
-        this.parentFault = parentFault;
-    }
-
-    public void addSubfault(Fault fault) {
-        subfaults.add(fault);
-        fault.setParentFault(this);
-    }
-
     public Iterator getSubfaults() {
         if (subfaults.size() == 0) {
             return null;
@@ -107,12 +90,6 @@
         return subfaults.iterator();
     }
 
-    public Iterator getSortedSubfaults() {
-        Set sortedFaults = new TreeSet(new GeneratorUtil.FaultComparator());
-        sortedFaults.addAll(subfaults);
-        return sortedFaults.iterator();
-    }
-
     /* serialization */
     public Set getSubfaultsSet() {
         return subfaults;
@@ -187,4 +164,14 @@
     private QName elementName = null;
     private String javaMemberName = null;
     private JClass exceptionClass;
+
+    public String getWsdlFaultName() {
+        return wsdlFaultName;
+    }
+
+    public void setWsdlFaultName(String wsdlFaultName) {
+        this.wsdlFaultName = wsdlFaultName;
+    }
+
+    private String wsdlFaultName;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
index bf9ad8f..397c964 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,18 @@
  */
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
 import javax.xml.namespace.QName;
 
 public class HeaderFault extends Fault {
 
-    public HeaderFault() {}
+    public HeaderFault(Entity entity) {
+        super(entity);
+    }
 
-    public HeaderFault(String name) {
-        super(name);
+    public HeaderFault(String name, Entity entity) {
+        super(name, entity);
     }
 
     public QName getMessage() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
index ed807ca..117aeb3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,28 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.ModelMessages;
 
 import javax.xml.namespace.QName;
+import java.util.*;
 
 /**
  *
  * @author WS Development Team
  */
 public abstract class Message extends ModelObject {
+    protected Message(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+        super(entity);
+        setErrorReceiver(receiver);
+    }
 
     public void addBodyBlock(Block b) {
         if (_bodyBlocks.containsKey(b.getName())) {
-            throw new ModelException("model.uniqueness");
+            errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+            throw new AbortException();
         }
         _bodyBlocks.put(b.getName(), b);
         b.setLocation(Block.BODY);
@@ -85,7 +87,8 @@
 
     public void addHeaderBlock(Block b) {
         if (_headerBlocks.containsKey(b.getName())) {
-            throw new ModelException("model.uniqueness");
+            errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+            throw new AbortException();
         }
         _headerBlocks.put(b.getName(), b);
         b.setLocation(Block.HEADER);
@@ -116,7 +119,8 @@
     /** attachment block */
     public void addAttachmentBlock(Block b) {
         if (_attachmentBlocks.containsKey(b.getName())) {
-            throw new ModelException("model.uniqueness");
+            errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
+            throw new AbortException();
         }
         _attachmentBlocks.put(b.getName(), b);
         b.setLocation(Block.ATTACHMENT);
@@ -169,7 +173,8 @@
 
     public void addParameter(Parameter p) {
         if (_parametersByName.containsKey(p.getName())) {
-            throw new ModelException("model.uniqueness");
+            errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
+            throw new AbortException();
         }
         _parameters.add(p);
         _parametersByName.put(p.getName(), p);
@@ -179,7 +184,7 @@
         if (_parametersByName.size() != _parameters.size()) {
             initializeParametersByName();
         }
-        return (Parameter) _parametersByName.get(name);
+        return _parametersByName.get(name);
     }
 
     public Iterator<Parameter> getParameters() {
@@ -203,8 +208,8 @@
                 Parameter param = (Parameter) iter.next();
                 if (param.getName() != null &&
                     _parametersByName.containsKey(param.getName())) {
-
-                    throw new ModelException("model.uniqueness");
+                    errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getName()));
+                    throw new AbortException();
                 }
                 _parametersByName.put(param.getName(), param);
             }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
index 59ae490..ef68703 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Model.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,11 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.EnumSet;
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
-import com.sun.tools.internal.ws.processor.ProcessorActionVersion;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
+import java.util.*;
 
 /**
  * The model is used to represent the entire Web Service.  The JAX-WS ProcessorActions can process
@@ -46,10 +39,12 @@
  */
 public class Model extends ModelObject {
 
-    public Model() {
+    public Model(Entity entity) {
+        super(entity);
     }
 
-    public Model(QName name) {
+    public Model(QName name, Entity entity) {
+        super(entity);
         this.name = name;
     }
 
@@ -145,31 +140,6 @@
         source = string;
     }
 
-    public ProcessorActionVersion getProcessorActionVersion(){
-        return processorActionVersion;
-    }
-
-    public void setProcessorActionVersion(ProcessorActionVersion version){
-        this.processorActionVersion = version;
-    }
-
-    public void setProcessorActionVersion(String version){
-        for(ProcessorActionVersion paVersion : EnumSet.allOf(ProcessorActionVersion.class)){
-            switch(paVersion){
-                case PRE_20:
-                    if(version.equals(ProcessorActionVersion.PRE_20.toString()))
-                        processorActionVersion = ProcessorActionVersion.PRE_20;
-                    break;
-                case VERSION_20:
-                    if(version.equals(ProcessorActionVersion.VERSION_20.toString()))
-                        processorActionVersion = ProcessorActionVersion.VERSION_20;
-                    break;
-                default:
-                    throw new ModelException("model.invalid.processorActionVersion", new Object[]{version});
-            }
-        }
-    }
-
     public void setJAXBModel(JAXBModel jaxBModel) {
         this.jaxBModel = jaxBModel;
     }
@@ -185,5 +155,4 @@
     private Set<AbstractType> extraTypes = new HashSet<AbstractType>();
     private String source;
     private JAXBModel jaxBModel = null;
-    private ProcessorActionVersion processorActionVersion = ProcessorActionVersion.VERSION_20;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
index 11b49a7..4b14db9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("model.nestedModelError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.model";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
index c0c47ea..1f2faeb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelObject.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,38 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import com.sun.xml.internal.ws.util.NullIterator;
+import org.xml.sax.Locator;
 
 /**
  *
  * @author WS Development Team
  */
 public abstract class ModelObject {
-
     public abstract void accept(ModelVisitor visitor) throws Exception;
 
+    private final Entity entity;
+    protected ErrorReceiver errorReceiver;
+
+    protected ModelObject(Entity entity) {
+        this.entity = entity;
+    }
+
+    public void setErrorReceiver(ErrorReceiver errorReceiver) {
+        this.errorReceiver = errorReceiver;
+    }
+
+    public Entity getEntity() {
+        return entity;
+    }
+
     public Object getProperty(String key) {
         if (_properties == null) {
             return null;
@@ -66,18 +84,20 @@
 
     public Iterator getProperties() {
         if (_properties == null) {
-            return NullIterator.getInstance();
+            return Collections.emptyList().iterator();
         } else {
             return _properties.keySet().iterator();
         }
     }
 
-    /* serialization */
+    public Locator getLocator(){
+        return entity.getLocator();
+    }
+
     public Map getPropertiesMap() {
         return _properties;
     }
 
-    /* serialization */
     public void setPropertiesMap(Map m) {
         _properties = m;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
index abea8d6..9885f4b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelProperties.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
index b28755e..448cb66 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ModelVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
index 6b482ee..48c0453 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Operation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 import com.sun.tools.internal.ws.processor.model.java.JavaMethod;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
 
 import javax.xml.namespace.QName;
@@ -41,15 +42,18 @@
  */
 public class Operation extends ModelObject {
 
-    public Operation() {}
+    public Operation(Entity entity) {
+        super(entity);
+    }
 
-    public Operation(Operation operation){
-        this(operation._name);
+    public Operation(Operation operation, Entity entity){
+        this(operation._name, entity);
         this._style = operation._style;
         this._use = operation._use;
         this.customizedName = operation.customizedName;
     }
-    public Operation(QName name) {
+    public Operation(QName name, Entity entity) {
+        super(entity);
         _name = name;
         _uniqueName = name.getLocalPart();
         _faultNames = new HashSet<String>();
@@ -226,6 +230,16 @@
         return JAXBRIContext.mangleNameToVariableName(_name.getLocalPart());
     }
 
+    public com.sun.tools.internal.ws.wsdl.document.Operation getWSDLPortTypeOperation(){
+        return wsdlOperation;
+    }
+
+    public void setWSDLPortTypeOperation(com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation){
+        this.wsdlOperation = wsdlOperation;
+    }
+
+
+
     private String customizedName;
     private boolean _isWrapped = true;
     private QName _name;
@@ -238,5 +252,6 @@
     private SOAPUse _use = SOAPUse.LITERAL;
     private Set<String> _faultNames;
     private Set<Fault> _faults;
+    private com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation;
 
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
index 4f220ac..1299de4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Parameter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,37 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wsdl.document.MessagePart;
+
+import javax.jws.WebParam.Mode;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
-import com.sun.xml.internal.ws.model.Mode;
-
 /**
  *
  * @author WS Development Team
  */
 public class Parameter extends ModelObject {
+    private final String entityName;
 
-    public Parameter() {}
-
-    public Parameter(String name) {
+    public Parameter(String name, Entity entity) {
+        super(entity);
         this.name = name;
+        if(entity instanceof com.sun.tools.internal.ws.wsdl.document.Message){
+            this.entityName = ((com.sun.tools.internal.ws.wsdl.document.Message)entity).getName();
+        }else if(entity instanceof MessagePart){
+            this.entityName = ((MessagePart)entity).getName();
+        }else{
+            this.entityName = name;
+        }
+
+    }
+
+
+    public String getEntityName() {
+        return entityName;
     }
 
     public String getName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
index a5680b6..419d4d1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,29 +25,27 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
+import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.config.HandlerChainInfo;
-import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-
 /**
- *
  * @author WS Development Team
  */
 public class Port extends ModelObject {
 
-    public Port() {}
+    public Port(Entity entity) {
+        super(entity);
+    }
 
-    public Port(QName name) {
+    public Port(QName name, Entity entity) {
+        super(entity);
         _name = name;
     }
 
@@ -68,15 +66,15 @@
         if (operationsByName.size() != _operations.size()) {
             initializeOperationsByName();
         }
-        return (Operation)operationsByName.get(name);
+        return operationsByName.get(name);
     }
 
     private void initializeOperationsByName() {
-        operationsByName = new HashMap();
+        operationsByName = new HashMap<String, Operation>();
         if (_operations != null) {
             for (Operation operation : _operations) {
                 if (operation.getUniqueName() != null &&
-                    operationsByName.containsKey(operation.getUniqueName())) {
+                        operationsByName.containsKey(operation.getUniqueName())) {
 
                     throw new ModelException("model.uniqueness");
                 }
@@ -111,36 +109,6 @@
         _address = s;
     }
 
-    public HandlerChainInfo getClientHandlerChainInfo() {
-        if (_clientHandlerChainInfo == null) {
-            _clientHandlerChainInfo  = new HandlerChainInfo();
-        }
-        return _clientHandlerChainInfo;
-    }
-
-    public void setClientHandlerChainInfo(HandlerChainInfo i) {
-        _clientHandlerChainInfo = i;
-    }
-
-    public HandlerChainInfo getServerHandlerChainInfo() {
-        if (_serverHandlerChainInfo == null) {
-            _serverHandlerChainInfo  = new HandlerChainInfo();
-        }
-        return _serverHandlerChainInfo;
-    }
-
-    public void setServerHandlerChainInfo(HandlerChainInfo i) {
-        _serverHandlerChainInfo = i;
-    }
-
-    public SOAPVersion getSOAPVersion() {
-        return _soapVersion;
-    }
-
-    public void setSOAPVersion(SOAPVersion soapVersion) {
-        _soapVersion = soapVersion;
-    }
-
     public String getServiceImplName() {
         return _serviceImplName;
     }
@@ -165,16 +133,17 @@
     }
 
     /**
-    * XYZ_Service.getABC() method name
-    * @return Returns the portGetterName.
-    */
+     * XYZ_Service.getABC() method name
+     *
+     * @return Returns the portGetterName.
+     */
     public String getPortGetter() {
         return portGetter;
     }
 
     /**
-    * @param portGetterName The portGetterName to set.
-    */
+     * @param portGetterName The portGetterName to set.
+     */
     public void setPortGetter(String portGetterName) {
         this.portGetter = portGetterName;
     }
@@ -200,12 +169,9 @@
 
     private String portGetter;
     private QName _name;
-    private List<Operation> _operations = new ArrayList();
+    private List<Operation> _operations = new ArrayList<Operation>();
     private JavaInterface _javaInterface;
     private String _address;
     private String _serviceImplName;
-    private Map operationsByName = new HashMap();
-    private HandlerChainInfo _clientHandlerChainInfo;
-    private HandlerChainInfo _serverHandlerChainInfo;
-    private SOAPVersion _soapVersion = SOAPVersion.SOAP_11;
+    private Map<String, Operation> operationsByName = new HashMap<String, Operation>();
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
index 172704d..1c50dee 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Request.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,18 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
 /**
  *
  * @author WS Development Team
  */
 public class Request extends Message {
 
-    public Request() {}
+    public Request(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+        super(entity, receiver);
+    }
 
     public void accept(ModelVisitor visitor) throws Exception {
         visitor.visit(this);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
index a5199b3..19349c0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Response.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
 
 package com.sun.tools.internal.ws.processor.model;
 
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -35,7 +38,9 @@
  */
 public class Response extends Message {
 
-    public Response() {}
+    public Response(com.sun.tools.internal.ws.wsdl.document.Message entity, ErrorReceiver receiver) {
+        super(entity, receiver);
+    }
 
     public void addFaultBlock(Block b) {
         if (_faultBlocks.containsKey(b.getName())) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
index d3678ce..4f2c062 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Service.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,14 +26,10 @@
 package com.sun.tools.internal.ws.processor.model;
 
 import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
 
 import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  *
@@ -41,9 +37,12 @@
  */
 public class Service extends ModelObject {
 
-    public Service() {}
+    public Service(Entity entity) {
+        super(entity);
+    }
 
-    public Service(QName name, JavaInterface javaInterface) {
+    public Service(QName name, JavaInterface javaInterface, Entity entity) {
+        super(entity);
         this.name = name;
         this.javaInterface = javaInterface;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
index 224c60d..281ba64 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/exporter/ExternalObject.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
index 7d8cbd2..1c172f5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaArrayType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
index 019aedc..343d47b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
index 9bf221f..11f98f8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,13 @@
 
 package com.sun.tools.internal.ws.processor.model.java;
 
+import com.sun.tools.internal.ws.processor.model.ModelException;
+import com.sun.tools.internal.ws.util.ClassNameInfo;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import com.sun.tools.internal.ws.util.ClassNameInfo;
-
-import com.sun.tools.internal.ws.processor.model.ModelException;
-
 /**
  *
  * @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
index 6999e5c..e0797fd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,35 @@
 
 package com.sun.tools.internal.ws.processor.model.java;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import com.sun.tools.internal.ws.resources.ModelMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.processor.model.Parameter;
 
-import com.sun.tools.internal.ws.processor.model.ModelException;
-import com.sun.codemodel.internal.JClass;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
 
 /**
- *
  * @author WS Development Team
  */
 public class JavaMethod {
 
-    public JavaMethod() {}
+    private final ErrorReceiver errorReceiver;
+    private final String name;
+    private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
+    private final List<String> exceptions = new ArrayList<String>();
+    private JavaType returnType;
 
-    public JavaMethod(String name) {
+    public JavaMethod(String name, ErrorReceiver receiver) {
         this.name = name;
         this.returnType = null;
+        this.errorReceiver = receiver;
     }
 
     public String getName() {
         return name;
     }
 
-    public void setName(String name) {
-        this.name = name;
-    }
-
     public JavaType getReturnType() {
         return returnType;
     }
@@ -61,109 +62,48 @@
         this.returnType = returnType;
     }
 
-    public boolean hasParameter(String paramName) {
-        for (int i=0; i<parameters.size();i++) {
-            if (paramName.equals(
-                ((JavaParameter)parameters.get(i)).getName())) {
-
+    private boolean hasParameter(String paramName) {
+        for (JavaParameter parameter : parameters) {
+            if (paramName.equals(parameter.getName())) {
                 return true;
             }
         }
         return false;
     }
 
-    public void addParameter(JavaParameter param) {
-        // verify that this member does not already exist
-        if (hasParameter(param.getName())) {
-            throw new ModelException("model.uniqueness");
-        }
-        parameters.add(param);
-    }
-
-    public JavaParameter getParameter(String paramName){
-        for (int i=0; i<parameters.size();i++) {
-            JavaParameter jParam = parameters.get(i);
-            if (paramName.equals(jParam.getParameter().getName())) {
-                return jParam;
+    private Parameter getParameter(String paramName){
+        for (JavaParameter parameter : parameters) {
+            if (paramName.equals(parameter.getName())) {
+                return parameter.getParameter();
             }
         }
         return null;
     }
 
-    public Iterator<JavaParameter> getParameters() {
-        return parameters.iterator();
+    public void addParameter(JavaParameter param) {
+        // verify that this member does not already exist
+        if (hasParameter(param.getName())) {
+            errorReceiver.error(param.getParameter().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getParameter().getEntityName()));
+            Parameter duplicParam = getParameter(param.getName());
+            errorReceiver.error(duplicParam.getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), duplicParam.getEntityName()));
+            return;
+        }
+        parameters.add(param);
     }
 
-    public int getParameterCount() {
-        return parameters.size();
-    }
-
-    /* serialization */
     public List<JavaParameter> getParametersList() {
         return parameters;
     }
 
-    /* serialization */
-    public void setParametersList(List<JavaParameter> l) {
-        parameters = l;
-    }
-
-    public boolean hasException(String exception) {
-        return exceptions.contains(exception);
-    }
-
     public void addException(String exception) {
-
         // verify that this exception does not already exist
-        if (hasException(exception)) {
-            throw new ModelException("model.uniqueness");
+        if (!exceptions.contains(exception)) {
+            exceptions.add(exception);
         }
-        exceptions.add(exception);
     }
 
-    public Iterator getExceptions() {
+    /** TODO: NB uses it, remove it once we expose it thru some API **/
+    public Iterator<String> getExceptions() {
         return exceptions.iterator();
     }
-
-    /* serialization */
-    public List getExceptionsList() {
-        return exceptions;
-    }
-
-    /* serialization */
-    public void setExceptionsList(List l) {
-        exceptions = l;
-    }
-
-    public String getDeclaringClass() {
-        return declaringClass;
-    }
-    public void setDeclaringClass(String declaringClass) {
-        this.declaringClass = declaringClass;
-    }
-
-    // TODO fix model importer/exporter to handle this
-    public boolean getThrowsRemoteException() {
-        return throwsRemoteException;
-    }
-    public void setThrowsRemoteException(boolean throwsRemoteException) {
-        this.throwsRemoteException = throwsRemoteException;
-    }
-
-    public void addExceptionClass(JClass ex){
-        exceptionClasses.add(ex);
-    }
-
-    public List<JClass> getExceptionClasses(){
-        return exceptionClasses;
-    }
-
-    private String name;
-    private List<JavaParameter> parameters = new ArrayList<JavaParameter>();
-    private List<String> exceptions = new ArrayList<String>();
-    private List<JClass> exceptionClasses = new ArrayList<JClass>();
-
-    private JavaType returnType;
-    private String declaringClass;
-    private boolean throwsRemoteException = true;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
index e341b82..cebe536 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaParameter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
index 678a234..7206914 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaSimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
 
 package com.sun.tools.internal.ws.processor.model.java;
 
-import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
index c0b08d3..f2c92de 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureMember.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
index 907a526..c2df0d5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaStructureType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,10 @@
 
 package com.sun.tools.internal.ws.processor.model.java;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import com.sun.tools.internal.ws.processor.model.ModelException;
 
+import java.util.*;
+
 /**
  *
  * @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
index 8722088..89721ea 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,6 @@
 
 package com.sun.tools.internal.ws.processor.model.java;
 
-import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
index ef242eb..6a93252 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,10 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
+import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
+
 import javax.xml.namespace.QName;
 
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
 /**
  * @author Kathy Walsh, Vivek Pandey
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
index 6964389..17e7d2e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBMapping.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,13 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import java.util.List;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.xjc.api.Mapping;
 import com.sun.tools.internal.xjc.api.Property;
 import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Kohsuke Kawaguchi, Vivek Pandey
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
index 6fb25cf..0a16d49 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,12 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import com.sun.tools.internal.xjc.api.*;
+import com.sun.tools.internal.xjc.api.J2SJAXBModel;
+import com.sun.tools.internal.xjc.api.Mapping;
+import com.sun.tools.internal.xjc.api.S2JJAXBModel;
 
 import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import com.sun.codemodel.internal.JType;
+import java.util.*;
 
 /**
  * Root of the JAXB Model.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
index 7e7a7c3..3fe9ed7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,10 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.xjc.api.Property;
 
-import com.sun.codemodel.internal.JType;
+import javax.xml.namespace.QName;
+
 /**
  * @author Kohsuke Kawaguchi
  */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
index bd5940b..a9dbdf3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBStructuredType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,12 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.processor.model.ModelException;
 import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
 
+import javax.xml.namespace.QName;
+import java.util.*;
+
 /**
  * Top-level binding between JAXB generated Java type
  * and XML Schema element declaration.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
index ad34628..665ce7a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,6 @@
 
 import com.sun.tools.internal.ws.processor.model.AbstractType;
 import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
index cfa340c..07be64e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,9 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.codemodel.internal.JType;
 import com.sun.codemodel.internal.JAnnotatable;
+import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
 
 /**
  * Holds JAXB JType and TypeAndAnnotation. This provides abstration over
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
index 94fba8b..e192658 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBTypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
index 0e4d6fb..70fb918 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitMember.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.processor.model.AbstractType;
 
+import javax.xml.namespace.QName;
+
 /**
  * @author Vivek Pandey
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
index 17d58c7..095eb68 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/RpcLitStructure.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,11 @@
  */
 package com.sun.tools.internal.ws.processor.model.jaxb;
 
-import java.util.ArrayList;
-import java.util.List;
+import com.sun.tools.internal.ws.processor.model.AbstractType;
 
 import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.AbstractType;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Vivek Pandey
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
index 5fb77a7..c96e2c4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/Util.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
index 44243e7..71df3cc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/JavaSimpleTypeCreator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
 
 package com.sun.tools.internal.ws.processor.modeler;
 
+import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
-import com.sun.xml.internal.ws.util.VersionUtil;
-
 /**
  *
  * @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
index 88091d0..539de36 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
index 1362f84..ec280f4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
index 2f85349..b0953aa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("modeler.nestedModelError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.modeler";
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerUtils.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerUtils.java
deleted file mode 100644
index 4fd476c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/ModelerUtils.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.modeler;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.xjc.api.S2JJAXBModel;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.model.AbstractType;
-import com.sun.tools.internal.ws.processor.model.Block;
-import com.sun.tools.internal.ws.processor.model.ModelProperties;
-import com.sun.tools.internal.ws.processor.model.Parameter;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.ws.processor.model.jaxb.*;
-import com.sun.tools.internal.ws.util.ClassNameInfo;
-import com.sun.tools.internal.ws.wsdl.document.Message;
-import com.sun.tools.internal.ws.wsdl.document.MessagePart;
-
-/**
- * Utilities to be used by modelers such as WSDLModeler and Rmimodeler
- *
- * @author Vivek Pandey
- *
- */
-public class ModelerUtils {
-
-    /**
-     * This method should be called incase of wrapper style operations. This is
-     * equivalent to wrapper style schema component or JAXB Mapping object.
-     *
-     * @param jaxbType JAXBType from which a JAXBStructured type will be created.
-     * @return returns JAXBStructured type
-     */
-    public static JAXBStructuredType createJAXBStructureType(JAXBType jaxbType) {
-        JAXBStructuredType type = new JAXBStructuredType(jaxbType);
-        type.setName(jaxbType.getName());
-        type.setJavaType(jaxbType.getJavaType());
-        return type;
-    }
-
-    /**
-     * This method uses JAXBStructured type (wrapper style operations) and
-     * unwraps it to create list of parameters.
-     *
-     *
-     * @param jaxbType instance of JAXBType, could be JAXBStructured type.
-     * @param block The Block (body/Header/Attachment) to which the created Parameter belong.
-     * @return list of Parameters
-     */
-    public static List<Parameter> createUnwrappedParameters(JAXBType jaxbType,
-            Block block) {
-        List<Parameter> paramList = new ArrayList<Parameter>();
-        JAXBStructuredType type = null;
-        if (!(jaxbType instanceof JAXBStructuredType))
-            type = createJAXBStructureType(jaxbType);
-        else
-            type = (JAXBStructuredType) jaxbType;
-
-        JavaStructureType jst = new JavaStructureType(jaxbType.getJavaType()
-                .getRealName(), true, type);
-        type.setJavaType(jst);
-        block.setType(type);
-        List memberList = jaxbType.getWrapperChildren();
-        Iterator props = memberList.iterator();
-        while (props.hasNext()) {
-            JAXBProperty prop = (JAXBProperty) props.next();
-            paramList.add(createUnwrappedParameter(prop, jaxbType, block, type,
-                    jst));
-        }
-
-        return paramList;
-    }
-
-    /**
-     * @param prop
-     * @param jaxbType
-     * @param block
-     * @return
-     */
-    private static Parameter createUnwrappedParameter(JAXBProperty prop,
-            JAXBType jaxbType, Block block, JAXBStructuredType type,
-            JavaStructureType jst) {
-        QName elementName = prop.getElementName();
-        JavaType javaType = new JavaSimpleType(prop.getType());
-        JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
-        JavaStructureMember jsm = new JavaStructureMember(elementName
-                .getLocalPart(), javaType, eType);
-        eType.setJavaStructureMember(jsm);
-        jst.add(jsm);
-        eType.setProperty(prop);
-        type.add(eType);
-        JAXBType t = new JAXBType(elementName, javaType, jaxbType
-                .getJaxbMapping(), jaxbType.getJaxbModel());
-        t.setUnwrapped(true);
-        Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
-        parameter.setEmbedded(true);
-        return parameter;
-    }
-
-    public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel){
-        RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();
-
-        List<Parameter> parameters = new ArrayList<Parameter>();
-        for(MessagePart part : message.getParts()){
-            if(!ModelerUtils.isBoundToSOAPBody(part))
-                continue;
-            QName name = part.getDescriptor();
-            TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
-            if(typeAndAnn == null){
-                String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
-                throw new ModelerException("wsdlmodeler.rpclit.unkownschematype", name.toString(),
-                        part.getName(), msgQName);
-            }
-            String type = typeAndAnn.getTypeClass().fullName();
-            type = ClassNameInfo.getGenericClass(type);
-            RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
-            JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
-            param.setJavaType(javaType);
-            rpcStruct.addRpcLitMember(param);
-            Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
-            parameter.setEmbedded(true);
-            parameters.add(parameter);
-        }
-        return parameters;
-    }
-
-    /**
-     * Called for non-wrapper style operations. It returns a Parameter constructed
-     * using the JAXBType and the Block.
-     *
-     * @param partName typically wsdl:part or any name to be given to the parameter
-     * @param jaxbType type of Parameter
-     * @param block Block to which the parameter belongs to
-     * @return Parameter created.
-     */
-    public static Parameter createParameter(String partName, AbstractType jaxbType,
-            Block block) {
-        Parameter parameter = new Parameter(partName);
-        parameter.setProperty(ModelProperties.PROPERTY_PARAM_MESSAGE_PART_NAME,
-                partName);
-        parameter.setEmbedded(false);
-        parameter.setType(jaxbType);
-        parameter.setTypeName(jaxbType.getJavaType().getType().getName());
-        parameter.setBlock(block);
-        return parameter;
-    }
-
-    /**
-     * Get Parameter from the list of parameters.
-     *
-     * @param paramName
-     * @param parameters
-     * @return the Parameter with name paramName from parameters
-     */
-    public static Parameter getParameter(String paramName, List<Parameter> parameters){
-        if(parameters == null)
-            return null;
-        for(Parameter param: parameters){
-            //if(param.getName().equals("_return") && paramName.equals("return") || param.getName().equals(paramName)) {
-            if(param.getName().equals(paramName)){
-                return param;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Compares two JAXBStructures.
-     *
-     * @param struct1
-     * @param struct2
-     * @return true if struct1 and struct2 are equivalent.
-     */
-    public static boolean isEquivalentLiteralStructures(
-        JAXBStructuredType struct1,
-        JAXBStructuredType struct2) {
-        if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
-            return false;
-        Iterator members = struct1.getElementMembers();
-        JAXBElementMember member1;
-        JavaStructureMember javaMember1, javaMember2;
-        for (int i = 0; members.hasNext(); i++) {
-            member1 = (JAXBElementMember)members.next();
-            javaMember1 = member1.getJavaStructureMember();
-            javaMember2 =
-                ((JavaStructureType)struct2.getJavaType()).getMemberByName(
-                    member1.getJavaStructureMember().getName());
-            if (javaMember2.getConstructorPos() != i
-                || !javaMember1.getType().equals(javaMember2.getType())) {
-                return false;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param part
-     * @return true if part is bound to Mime content
-     */
-    public static boolean isBoundToMimeContent(MessagePart part) {
-        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.WSDL_MIME_BINDING)
-            return true;
-        return false;
-    }
-
-    /**
-     * @param part
-     * @return true if part is bound to SOAPBody
-     */
-    public static boolean isBoundToSOAPBody(MessagePart part) {
-        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING)
-            return true;
-        return false;
-    }
-
-    /**
-     * @param part
-     * @return true if part is bound to SOAPHeader
-     */
-    public static boolean isBoundToSOAPHeader(MessagePart part) {
-        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_HEADER_BINDING)
-            return true;
-        return false;
-    }
-
-    public static boolean isUnbound(MessagePart part) {
-        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.PART_NOT_BOUNDED)
-            return true;
-        return false;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
index eaeb814..c6c3750 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,28 +24,18 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import com.sun.mirror.declaration.MethodDeclaration;
 import com.sun.mirror.declaration.ParameterDeclaration;
 import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.TypeMirror;
 import com.sun.tools.internal.ws.processor.model.Model;
 import com.sun.tools.internal.ws.processor.model.Operation;
 import com.sun.tools.internal.ws.processor.model.Port;
 import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
 
-import com.sun.tools.internal.xjc.api.Reference;
-
-import javax.xml.namespace.QName;
-
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
 
 
 /**
@@ -85,14 +75,6 @@
         return seiContextMap.values();
     }
 
-    public boolean allEncoded() {
-        for (SEIContext seiContext : seiContextMap.values()) {
-            if (!isEncoded(seiContext.getModel()))
-                return false;
-        }
-        return true;
-    }
-
     public int getRound() {
         return round;
     }
@@ -128,23 +110,15 @@
         private Map<String, WrapperInfo> resOperationWrapperMap;
         private Map<String, FaultInfo> exceptionBeanMap;
 
-        private Model model;
-        private Map<Object, Reference> schemaReferences;
-        private Map<QName, Reference> schemaElements;
-
-        private boolean modelCompiled = false;
         private String seiName;
         private String seiImplName;
         private boolean implementsSEI = false;
-        private JAXBModel jaxBModel;
         private String namespaceURI = null;
 
         public SEIContext(String seiName) {
             reqOperationWrapperMap = new HashMap<String, WrapperInfo>();
             resOperationWrapperMap = new HashMap<String, WrapperInfo>();
             exceptionBeanMap = new HashMap<String,FaultInfo>();
-            schemaReferences = new HashMap<Object, Reference>();
-            schemaElements = new HashMap<QName, Reference>();
             this.seiName = seiName;
         }
 
@@ -164,20 +138,6 @@
             return namespaceURI;
         }
 
-        public void setJAXBModel(JAXBModel model) {
-            this.jaxBModel = model;
-            if (this.model != null)
-                this.model.setJAXBModel(model);
-        }
-
-        public JAXBModel getJAXBModel() {
-            return jaxBModel;
-        }
-
-        public String getSEIName() {
-            return seiName;
-        }
-
         public String getSEIImplName() {
             return seiImplName;
         }
@@ -209,35 +169,6 @@
             return buf.toString();
         }
 
-        public void setModel(Model model) {
-            this.model = model;
-            model.setJAXBModel(jaxBModel);
-        }
-
-        public Model getModel() {
-            return model;
-        }
-
-        public boolean getModelCompiled() {
-            return modelCompiled;
-        }
-
-        public void setModelCompiled(boolean compiled) {
-            modelCompiled = compiled;
-        }
-
-        public Collection<Reference> getSchemaReferences(ModelBuilder builder) {
-            return schemaReferences.values();
-        }
-
-        public Map<QName, Reference> getSchemaElementMap(ModelBuilder builder) {
-            return schemaElements;
-        }
-
-        public Collection<Reference> getSchemaReferences() {
-            return schemaReferences.values();
-        }
-
         public void clearExceptionMap() {
             exceptionBeanMap.clear();
         }
@@ -249,51 +180,5 @@
         public FaultInfo getExceptionBeanName(String exception) {
             return exceptionBeanMap.get(exception);
         }
-
-        public Reference addReference(MethodDeclaration method) {
-            Reference ref = schemaReferences.get(method);
-            if (ref == null)
-                ref = new Reference(method);
-            addReference(method, ref);
-            return ref;
-        }
-
-        public Reference addReference(ParameterDeclaration param) {
-            Reference ref = schemaReferences.get(param);
-            if (ref == null)
-                ref = new Reference(param);
-            addReference(param, ref);
-            return ref;
-        }
-
-        public Reference addReference(TypeMirror type, ParameterDeclaration param) {
-            Reference ref = schemaReferences.get(param);
-            if (ref == null)
-                ref = new Reference(type, param);
-            addReference(param, ref);
-            return ref;
-        }
-
-        public Reference addReference(TypeDeclaration type, AnnotationProcessorEnvironment apEnv) {
-            Reference ref = schemaReferences.get(type);
-            if (ref == null)
-                ref = new Reference(type, apEnv);
-            addReference(type, ref);
-            return ref;
-        }
-
-        private void addReference(Object key, Reference reference) {
-            schemaReferences.put(key, reference);
-        }
-
-        public Reference getReference(Object key) {
-            return schemaReferences.get(key);
-        }
-
-        public void addSchemaElement(QName elemName, Reference reference) {
-            if (elemName == null)
-                throw new RuntimeException();
-            schemaElements.put(elemName, reference);
-        }
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java
index e14c647..bad0e69 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/FaultInfo.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.List;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
index 1666e50..5651dd2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,28 +25,13 @@
 
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-
-
 import com.sun.istack.internal.tools.APTTypeVisitor;
-
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.ArrayType;
-import com.sun.mirror.type.ClassType;
-import com.sun.mirror.type.DeclaredType;
-import com.sun.mirror.type.InterfaceType;
-import com.sun.mirror.type.PrimitiveType;
-import com.sun.mirror.type.ReferenceType;
-import com.sun.mirror.type.TypeMirror;
-import com.sun.mirror.type.TypeVariable;
-import com.sun.mirror.type.VoidType;
-import com.sun.mirror.type.WildcardType;
+import com.sun.mirror.type.*;
 import com.sun.mirror.util.Types;
 
-import java.lang.reflect.Array;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java
index e3aa05e..ea4f7d3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MemberInfo.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,30 +24,38 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import javax.xml.namespace.QName;
-
+import com.sun.istack.internal.NotNull;
+import com.sun.mirror.declaration.Declaration;
 import com.sun.mirror.type.TypeMirror;
 
+import javax.xml.namespace.QName;
+import java.lang.annotation.Annotation;
+
 /**
  *
  * @author  WS Development Team
  */
-public class MemberInfo implements Comparable<MemberInfo> {
-    int paramIndex;
-    TypeMirror paramType;
-    String paramName;
-    QName elementName;
+public final class MemberInfo implements Comparable<MemberInfo> {
+    private final TypeMirror paramType;
+    private final String paramName;
+    private final QName elementName;
+    private final Annotation[] jaxbAnnotations;
+    /**
+     * Use this to look up annotations on this parameter/return type.
+     */
+    private final Declaration decl;
 
-    public MemberInfo(int paramIndex, TypeMirror paramType, String paramName,
-        QName elementName) {
-        this.paramIndex = paramIndex;
+    public MemberInfo(TypeMirror paramType, String paramName, QName elementName, @NotNull Declaration decl, Annotation... jaxbAnnotations) {
         this.paramType = paramType;
         this.paramName = paramName;
         this.elementName = elementName;
+        this.decl = decl;
+        this.jaxbAnnotations = jaxbAnnotations;
     }
 
-    public int getParamIndex() {
-        return paramIndex;
+
+    public Annotation[] getJaxbAnnotations() {
+        return jaxbAnnotations;
     }
 
     public TypeMirror getParamType() {
@@ -62,6 +70,10 @@
         return elementName;
     }
 
+    public @NotNull Declaration getDecl() {
+        return decl;
+    }
+
     public int compareTo(MemberInfo member) {
         return paramName.compareTo(member.paramName);
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java
index 13b26c5..ef0f522 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/ModelBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,24 +24,17 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import java.io.File;
-
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.util.SourcePosition;
 import com.sun.tools.internal.ws.processor.model.Port;
 import com.sun.tools.internal.ws.processor.model.Service;
 import com.sun.tools.internal.ws.processor.modeler.ModelerException;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
+import com.sun.tools.internal.ws.wscompile.WsgenOptions;
 import com.sun.xml.internal.ws.util.localization.Localizable;
 
-import java.net.URL;
-import java.util.Properties;
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import javax.xml.namespace.QName;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
+import java.io.File;
 
 /**
  *
@@ -49,7 +42,6 @@
  */
 public interface ModelBuilder {
     public AnnotationProcessorEnvironment getAPEnv();
-    public void createModel(TypeDeclaration d, QName modelName, String targetNamespace, String modelerClassName);
     public void setService(Service service);
     public void setPort(Port port);
     public String getOperationName(String methodName);
@@ -62,14 +54,11 @@
     public void setWrapperGenerated(boolean wrapperGenerated);
     public TypeDeclaration getTypeDeclaration(String typeName);
     public String getSourceVersion();
-    public ProcessorEnvironment getProcessorEnvironment();
+    public WsgenOptions getOptions();
     public File getSourceDir();
     public String getXMLName(String javaName);
-    public void onError(String key);
-    public void onError(String key, Object[] args) throws ModelerException;
-    public void onError(SourcePosition srcPos, String key, Object[] args) throws ModelerException;
-    public void onError(Localizable msg) throws ModelerException;
-    public void onWarning(Localizable msg);
-    public void onInfo(Localizable msg);
     public void log(String msg);
+
+    public void onError(String s);
+    public void onError(SourcePosition pos, Localizable msg) throws ModelerException;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java
index 959acba..6cad883 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeModeler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,20 +24,13 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.sun.mirror.apt.*;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import com.sun.mirror.declaration.*;
 import com.sun.mirror.type.*;
-import com.sun.mirror.util.*;
-
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
 import com.sun.xml.internal.ws.util.StringUtils;
 
+import java.util.*;
+
 
 /**
  *
@@ -46,39 +39,11 @@
 public class TypeModeler implements WebServiceConstants {
 
     public static TypeDeclaration getDeclaration(TypeMirror typeMirror) {
-        TypeDeclaration retDecl = null;
         if (typeMirror instanceof DeclaredType)
             return ((DeclaredType)typeMirror).getDeclaration();
         return null;
     }
 
-    public static TypeDeclaration getTypeDeclaration(TypeMirror type) {
-        TypeDeclaration typeDecl = null;
-        if (type instanceof ClassType)
-            typeDecl = ((ClassType)type).getDeclaration();
-        else
-            typeDecl = ((InterfaceType)type).getDeclaration();
-        return typeDecl;
-    }
-
-    public static Collection<InterfaceType> getSuperinterfaces(TypeMirror type) {
-        Collection<InterfaceType> interfaces = null;
-        if (type instanceof ClassType)
-            interfaces = ((ClassType)type).getSuperinterfaces();
-        else
-            interfaces = ((InterfaceType)type).getSuperinterfaces();
-        return interfaces;
-    }
-
-    public static Collection<InterfaceType> getSuperinterfaces(TypeDeclaration type) {
-        Collection<InterfaceType> interfaces = null;
-        if (type instanceof ClassDeclaration)
-            interfaces = ((ClassDeclaration)type).getSuperinterfaces();
-        else
-            interfaces = ((InterfaceDeclaration)type).getSuperinterfaces();
-        return interfaces;
-    }
-
     public static TypeDeclaration getDeclaringClassMethod(
         TypeMirror theClass,
         String methodName,
@@ -99,7 +64,7 @@
                 retClass = getDeclaringClassMethod(superClass, methodName, args);
         }
         if (retClass == null) {
-            for (InterfaceType interfaceType : getSuperinterfaces(theClass))
+            for (InterfaceType interfaceType : theClass.getSuperinterfaces())
                 retClass =
                     getDeclaringClassMethod(interfaceType, methodName, args);
         }
@@ -143,8 +108,8 @@
 
     public static TypeMirror getHolderValueType(
         TypeMirror type,
-        TypeDeclaration defHolder,
-        AnnotationProcessorEnvironment env) {
+        TypeDeclaration defHolder
+    ) {
 
         TypeDeclaration typeDecl = getDeclaration(type);
         if (typeDecl == null)
@@ -216,21 +181,21 @@
         return false;
     }
 
-    public static Map<String,TypeMirror> getExceptionProperties(TypeMirror type) {
+    public static Map<String,MethodDeclaration> getExceptionProperties(TypeMirror type) {
         return getExceptionProperties(getDeclaration(type));
     }
 
-    public static Map<String,TypeMirror> getExceptionProperties(TypeDeclaration type) {
-        Map<String, TypeMirror> members = new HashMap<String, TypeMirror>();
+    public static Map<String,MethodDeclaration> getExceptionProperties(TypeDeclaration type) {
+        Map<String,MethodDeclaration> members = new HashMap<String,MethodDeclaration>();
         collectExceptionProperties(type, members);
         return members;
     }
 
-    public static void collectExceptionProperties(TypeMirror type, Map<String,TypeMirror> members) {
+    public static void collectExceptionProperties(TypeMirror type, Map<String,MethodDeclaration> members) {
         collectExceptionProperties(getDeclaration(type), members);
     }
 
-    public static void collectExceptionProperties(TypeDeclaration type, Map<String,TypeMirror> members) {
+    public static void collectExceptionProperties(TypeDeclaration type, Map<String,MethodDeclaration> members) {
 //        System.out.println("type: "+type.toString());
         Collection<? extends MethodDeclaration> methods;
         methods = type.getMethods();
@@ -256,13 +221,13 @@
                            ((PrimitiveType)resultType).getKind() == PrimitiveType.Kind.BOOLEAN)) {
                     // Simple getter
 //                    System.out.println("exception property: "+ StringUtils.decapitalize(name.substring(3)));
-                members.put(StringUtils.decapitalize(name.substring(3)), resultType);
+                members.put(StringUtils.decapitalize(name.substring(3)), method);
             } else if (resultType instanceof PrimitiveType &&
                            ((PrimitiveType)resultType).getKind() == PrimitiveType.Kind.BOOLEAN &&
                            name.startsWith(IS_PREFIX)) {
                     // Boolean getter
 //                    System.out.println("exception property: "+ StringUtils.decapitalize(name.substring(2)));
-                    members.put(StringUtils.decapitalize(name.substring(2)), resultType);
+                    members.put(StringUtils.decapitalize(name.substring(2)), method);
                 }
             }
         }
@@ -270,7 +235,7 @@
         if (type instanceof ClassDeclaration && ((ClassDeclaration)type).getSuperclass() != null)  {
             collectExceptionProperties(((ClassDeclaration)type).getSuperclass(), members);
         }
-        for (InterfaceType intfType : getSuperinterfaces(type)) {
+        for (InterfaceType intfType : type.getSuperinterfaces()) {
             collectExceptionProperties(intfType, members);
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java
index 41934cb..4a75f2d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMoniker.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,8 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import com.sun.mirror.type.TypeMirror;
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
+import com.sun.mirror.type.TypeMirror;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java
index c4dba54..aa93759 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/TypeMonikerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,15 @@
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
 
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.*;
-import com.sun.mirror.util.Types;
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.ArrayType;
+import com.sun.mirror.type.DeclaredType;
+import com.sun.mirror.type.PrimitiveType;
+import com.sun.mirror.type.TypeMirror;
 
-import java.util.Collection;
 import java.util.ArrayList;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
+import java.util.Collection;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java
index db23b74..9e2e1d0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,70 +27,49 @@
 import com.sun.mirror.apt.AnnotationProcessor;
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
 import com.sun.mirror.apt.Messager;
-import com.sun.mirror.declaration.ClassDeclaration;
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.declaration.TypeParameterDeclaration;
+import com.sun.mirror.declaration.*;
 import com.sun.mirror.type.ClassType;
 import com.sun.mirror.type.InterfaceType;
 import com.sun.mirror.type.TypeMirror;
 import com.sun.mirror.util.SourcePosition;
-import com.sun.tools.internal.ws.processor.ProcessorNotificationListener;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
+import com.sun.tools.internal.ws.ToolVersion;
 import com.sun.tools.internal.ws.processor.generator.GeneratorUtil;
 import com.sun.tools.internal.ws.processor.generator.Names;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.ModelProperties;
 import com.sun.tools.internal.ws.processor.model.Operation;
 import com.sun.tools.internal.ws.processor.model.Port;
 import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
 import com.sun.tools.internal.ws.processor.modeler.ModelerException;
-import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext.SEIContext;
-import com.sun.tools.internal.ws.processor.util.ClientProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.util.ToolBase;
-import com.sun.tools.internal.ws.ToolVersion;
-import com.sun.tools.internal.xjc.api.JavaCompiler;
-import com.sun.tools.internal.xjc.api.Reference;
-import com.sun.tools.internal.xjc.api.XJC;
+import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
+import com.sun.tools.internal.ws.resources.WebserviceapMessages;
+import com.sun.tools.internal.ws.wscompile.*;
 import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessage;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+import org.xml.sax.SAXParseException;
 
 import javax.jws.WebService;
-import javax.xml.namespace.QName;
 import javax.xml.ws.WebServiceProvider;
-
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.util.Collection;
+import java.io.PrintStream;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 
-
 /**
  * WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and
  * javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
- *    idirectly via the {@link com.sun.istack.internal.ws.WSAP WSAP} when invoked by APT.
+ *    idirectly via the {@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl} when invoked by APT.
  *
  * @author WS Development Team
  */
-public class WebServiceAP extends ToolBase implements AnnotationProcessor, ModelBuilder, WebServiceConstants,
-    ProcessorNotificationListener {
+public class WebServiceAP implements AnnotationProcessor, ModelBuilder, WebServiceConstants{
 
     protected AnnotationProcessorEnvironment apEnv;
-    protected ProcessorEnvironment env;
 
     private File sourceDir;
 
-    // the model being build
-    private Model model;
-
     private TypeDeclaration remoteDecl;
     private TypeDeclaration remoteExceptionDecl;
     private TypeDeclaration exceptionDecl;
@@ -100,13 +79,14 @@
     protected AnnotationProcessorContext context;
     private Set<TypeDeclaration> processedTypeDecls = new HashSet<TypeDeclaration>();
     protected Messager messager;
-    private ByteArrayOutputStream output;
-    private ToolBase tool;
     private boolean doNotOverWrite = false;
-    private boolean wrapperGenerated = false;
+    private WsgenOptions options;
+    private ErrorReceiver receiver;
+    private PrintStream out;
+
     /*
-     * Is this invocation from APT or JavaC?
-     */
+    * Is this invocation from APT or JavaC?
+    */
     private boolean isAPTInvocation = false;
 
 
@@ -117,17 +97,14 @@
        return true;
     }
 
-    public WebServiceAP(ToolBase tool, ProcessorEnvironment env, Properties options,  AnnotationProcessorContext context) {
-        super(System.out, "WebServiceAP");
+
+    public WebServiceAP(WsgenOptions options, AnnotationProcessorContext context, ErrorReceiver receiver, PrintStream out) {
+        this.options = options;
+        this.sourceDir = (options != null)?options.sourceDir:null;
+        this.doNotOverWrite = (options != null) && options.doNotOverWrite;
+        this.receiver = receiver;
+        this.out = out;
         this.context = context;
-        this.tool = tool;
-        this.env = env;
-        if (options != null) {
-            sourceDir = new File(options.getProperty(ProcessorOptions.SOURCE_DIRECTORY_PROPERTY));
-            String key = ProcessorOptions.DONOT_OVERWRITE_CLASSES;
-            this.doNotOverWrite =
-                Boolean.valueOf(options.getProperty(key));
-        }
     }
 
     public void init(AnnotationProcessorEnvironment apEnv) {
@@ -136,10 +113,62 @@
         remoteExceptionDecl = this.apEnv.getTypeDeclaration(REMOTE_EXCEPTION_CLASSNAME);
         exceptionDecl = this.apEnv.getTypeDeclaration(EXCEPTION_CLASSNAME);
         defHolderDecl = this.apEnv.getTypeDeclaration(HOLDER_CLASSNAME);
+        if (options == null) {
+            options = new WsgenOptions();
+            out = new PrintStream(new ByteArrayOutputStream());
+            class Listener extends WsimportListener {
+                ConsoleErrorReporter cer = new ConsoleErrorReporter(out);
 
-        if (env == null) {
+                @Override
+                public void generatedFile(String fileName) {
+                    message(fileName);
+                }
+
+                @Override
+                public void message(String msg) {
+                    out.println(msg);
+                }
+
+                @Override
+                public void error(SAXParseException exception) {
+                    cer.error(exception);
+                }
+
+                @Override
+                public void fatalError(SAXParseException exception) {
+                    cer.fatalError(exception);
+                }
+
+                @Override
+                public void warning(SAXParseException exception) {
+                    cer.warning(exception);
+                }
+
+                @Override
+                public void info(SAXParseException exception) {
+                    cer.info(exception);
+                }
+            }
+
+            final Listener listener = new Listener();
+            receiver = new ErrorReceiverFilter(new Listener()) {
+                public void info(SAXParseException exception) {
+                    if (options.verbose)
+                        super.info(exception);
+                }
+
+                public void warning(SAXParseException exception) {
+                    if (!options.quiet)
+                        super.warning(exception);
+                }
+
+                @Override
+                public void pollAbort() throws AbortException {
+                    if (listener.isCanceled())
+                        throw new AbortException();
+                }
+            };
             Map<String, String> apOptions = apEnv.getOptions();
-            output = new ByteArrayOutputStream();
             String classDir = apOptions.get("-d");
             if (classDir == null)
                 classDir = ".";
@@ -152,53 +181,41 @@
                     File.pathSeparator +
                     cp + File.pathSeparator +
                     System.getProperty("java.class.path");
-            env = new ClientProcessorEnvironment(output, cpath, this);
-            ((ClientProcessorEnvironment) env).setNames(new Names());
+            options.classpath = cpath;
             boolean setVerbose = false;
             for (String key : apOptions.keySet()) {
                 if (key.equals("-verbose"))
-                    setVerbose=true;
+                    setVerbose = true;
             }
-            if (setVerbose) {
-                env.setFlags(ProcessorEnvironment.F_VERBOSE);
-            }
+            options.verbose = setVerbose;
             messager = apEnv.getMessager();
             isAPTInvocation = true;
         }
-        env.setFiler(apEnv.getFiler());
+        options.filer = apEnv.getFiler();
+//        env.setFiler(apEnv.getFiler());
     }
 
     public AnnotationProcessorEnvironment getAPEnv() {
         return apEnv;
     }
 
-    public ProcessorEnvironment getEnvironment() {
-        return env;
-    }
-
-    public ProcessorEnvironment getProcessorEnvironment() {
-        return env;
+    public WsgenOptions getOptions() {
+        return options;
     }
 
     public File getSourceDir() {
         return sourceDir;
     }
 
-    public void onError(String key) {
-        onError(new LocalizableMessage(getResourceBundleName(), key));
+    public void onError(String message) {
+        if (messager != null) {
+            messager.printError(message);
+        } else {
+            throw new ModelerException(message);
+        }
     }
 
-    public void onError(String key, Object[] args) throws ModelerException {
-        onError(null, key, args);
-    }
-
-    public void onError(SourcePosition pos, String key, Object[] args) throws ModelerException {
-        onError(pos, new LocalizableMessage(getResourceBundleName(), key, args));
-    }
-
-    public void onError(Localizable msg) throws ModelerException {
-        onError(null, msg);
-    }
+    private final static Localizer localizer = new Localizer();
 
     public void onError(SourcePosition pos, Localizable msg) throws ModelerException {
         if (messager != null) {
@@ -208,54 +225,35 @@
         }
     }
 
-    public void onWarning(String key) {
-        onWarning(new LocalizableMessage(getResourceBundleName(), key));
-    }
 
-    public void onWarning(Localizable msg) {
-        String message = localizer.localize(getMessage("webserviceap.warning", localizer.localize(msg)));
+    public void onWarning(String message) {
         if (messager != null) {
             messager.printWarning(message);
         } else {
             report(message);
         }
     }
-    public void onInfo(Localizable msg) {
+    public void onInfo(String message) {
         if (messager != null) {
-            String message = localizer.localize(msg);
             messager.printNotice(message);
         } else {
-            String message = localizer.localize(getMessage("webserviceap.info", localizer.localize(msg)));
             report(message);
         }
     }
 
+    protected void report(String msg) {
+        PrintStream outstream =
+                out instanceof PrintStream
+                        ? out
+                        : new PrintStream(out, true);
+        outstream.println(msg);
+        outstream.flush();
+    }
+
     public void process() {
         if (context.getRound() == 1) {
             buildModel();
         }
-        if (!wrapperGenerated  || // the wrappers already exist
-            context.getRound() == 2 ||
-            context.allEncoded()) {
-            if ((context.getRound() == 2 || !wrapperGenerated) && !context.isModelCompleted()) {
-                completeModel();
-                context.setModelCompleted(true);
-            }
-            try {
-                for (SEIContext seiContext : context.getSEIContexts()) {
-                    if (!seiContext.getModelCompiled()) {
-                        runProcessorActions(seiContext.getModel());
-                        seiContext.setModelCompiled(true);
-                    }
-                }
-            } catch(Exception e) {
-                e.printStackTrace();
-            } finally {
-                if (messager != null && output != null && output.size() > 0) {
-                    messager.printNotice(output.toString());
-                }
-            }
-        }
         context.incrementRound();
     }
 
@@ -271,40 +269,8 @@
         processedTypeDecls.clear();
     }
 
-    protected void runProcessorActions(Model model) throws Exception {
-        if (tool != null)
-            tool.runProcessorActions();
-    }
-
-
-    protected String getGenericErrorMessage() {
-        return "webserviceap.error";
-    }
-
-    protected String getResourceBundleName() {
-        return "com.sun.tools.internal.ws.resources.webserviceap";
-    }
-
-    public void createModel(TypeDeclaration d, QName modelName, String targetNamespace,
-        String modelerClassName){
-
-        SEIContext seiContext = context.getSEIContext(d);
-        if (seiContext.getModel() != null) {
-            onError("webserviceap.model.already.exists");
-            return;
-        }
-        log("creating model: " + modelName);
-        model = new Model(modelName);
-        model.setTargetNamespaceURI(targetNamespace);
-        model.setProperty(
-            ModelProperties.PROPERTY_MODELER_NAME,
-            modelerClassName);
-        seiContext.setModel(model);
-    }
-
     public void setService(Service service) {
         this.service = service;
-        model.addService(service);
     }
 
     public void setPort(Port port) {
@@ -317,7 +283,6 @@
     }
 
     public void setWrapperGenerated(boolean wrapperGenerated) {
-        this.wrapperGenerated = wrapperGenerated;
     }
 
     public TypeDeclaration getTypeDeclaration(String typeName) {
@@ -330,7 +295,7 @@
 
     private void buildModel() {
         WebService webService;
-        WebServiceProvider webServiceProvider = null;
+        WebServiceProvider webServiceProvider;
         WebServiceVisitor wrapperGenerator = createWrapperGenerator();
         boolean processedEndpoint = false;
         for (TypeDeclaration typedecl: apEnv.getTypeDeclarations()) {
@@ -340,8 +305,7 @@
             webService = typedecl.getAnnotation(WebService.class);
             if (webServiceProvider != null) {
                 if (webService != null) {
-                    onError("webserviceap.webservice.and.webserviceprovider",
-                            new Object[] {typedecl.getQualifiedName()});
+                    onError(WebserviceapMessages.WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(typedecl.getQualifiedName()));
                 }
                 processedEndpoint = true;
             }
@@ -352,9 +316,9 @@
         }
         if (!processedEndpoint) {
             if (isAPTInvocation)
-                onWarning("webserviceap.no.webservice.endpoint.found");
+                onWarning(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
             else
-                onError("webserviceap.no.webservice.endpoint.found");
+                onError(WebserviceapMessages.WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
         }
     }
 
@@ -362,48 +326,11 @@
         return new WebServiceWrapperGenerator(this, context);
     }
 
-    protected WebServiceVisitor createReferenceCollector() {
-        return new WebServiceReferenceCollector(this, context);
-    }
-
     protected boolean shouldProcessWebService(WebService webService) {
         return webService != null;
     }
 
 
-    private void completeModel() {
-        clearProcessed();
-        JavaCompiler javaC = XJC.createJavaCompiler();
-        JAXBModel jaxBModel;
-        WebServiceVisitor referenceCollector = createReferenceCollector();
-        for (SEIContext seiContext : context.getSEIContexts()) {
-            log("completing model for endpoint: "+seiContext.getSEIImplName());
-            TypeDeclaration decl = apEnv.getTypeDeclaration(seiContext.getSEIImplName());
-            if (decl == null)
-                onError("webserviceap.could.not.find.typedecl",
-                         new Object[] {seiContext.getSEIImplName(), context.getRound()});
-            decl.accept(referenceCollector);
-        }
-        clearProcessed();
-        for (SEIContext seiContext : context.getSEIContexts()) {
-            TypeDeclaration decl = apEnv.getTypeDeclaration(seiContext.getSEIName());
-            Collection<Reference> schemaMirrors = seiContext.getSchemaReferences(this);
-
-//            System.out.println("schemaMirrors count: " + schemaMirrors.size());
-//            for (Reference reference : schemaMirrors) {System.out.println("reference: "+reference.type);}
-//        System.out.println("schemaElementMap count: "+ seiContext.getSchemaElementMap(this).entrySet().size());
-//            for (Map.Entry<QName, ? extends Reference> entry : seiContext.getSchemaElementMap(this).entrySet()) {
-//               System.out.println("name: " + entry.getKey()+" value: "+entry.getValue().type);
-//            }
-
-//            System.out.println("setting default namespaceURI: "+seiContext.getNamespaceURI());
-            jaxBModel = new JAXBModel(javaC.bind(schemaMirrors, seiContext.getSchemaElementMap(this),
-                seiContext.getNamespaceURI(), apEnv));
-//            for (JAXBMapping map : jaxBModel.getMappings()) {System.out.println("map.getClazz: "+map.getClazz());}
-            seiContext.setJAXBModel(jaxBModel);
-        }
-    }
-
     public boolean isException(TypeDeclaration typeDecl) {
         return isSubtype(typeDecl, exceptionDecl);
     }
@@ -468,15 +395,15 @@
 
 
     public TypeMirror getHolderValueType(TypeMirror type) {
-        return TypeModeler.getHolderValueType(type, defHolderDecl, apEnv);
+        return TypeModeler.getHolderValueType(type, defHolderDecl);
     }
 
     public boolean canOverWriteClass(String className) {
-        return !((doNotOverWrite && GeneratorUtil.classExists(env, className)));
+        return !((doNotOverWrite && GeneratorUtil.classExists(options, className)));
     }
 
     public void log(String msg) {
-        if (env != null && env.verbose()) {
+        if (options != null && options.verbose) {
             String message = "[" + msg + "]";
             if (messager != null) {
                 messager.printNotice(message);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java
index 9ff20b7..94ffafb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
 
-import javax.xml.ws.Holder;
 /**
  *
  * @author  dkohlert
@@ -54,7 +53,7 @@
     public static final char SIGC_UNDERSCORE  = '_';
 
     public static final String DOT = ".";
-    public static final String PORT = "Port";
+    public static final String PORT = "WSDLPort";
     public static final String BINDING = "Binding";
     public static final String RESPONSE = "Response";
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceReferenceCollector.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceReferenceCollector.java
deleted file mode 100644
index 5d53ce3..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceReferenceCollector.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.processor.modeler.annotation;
-
-import com.sun.mirror.apt.*;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.*;
-
-import com.sun.tools.internal.xjc.api.*;
-
-import javax.jws.*;
-
-/**
- *
- * @author  WS Development Team
- */
-public class WebServiceReferenceCollector extends WebServiceVisitor {
-
-    public WebServiceReferenceCollector(ModelBuilder builder, AnnotationProcessorContext context) {
-        super(builder, context);
-    }
-
-
-    protected void processWebService(WebService webService, TypeDeclaration d) {
-    }
-
-    protected void processMethod(MethodDeclaration method, WebMethod webMethod) {
-        boolean isOneway = method.getAnnotation(Oneway.class) != null;
-        boolean generatedWrapper = false;
-        builder.log("WebServiceReferenceCollector - method: "+method);
-        collectTypes(method, webMethod, seiContext.getReqOperationWrapper(method) != null);
-        if (seiContext.getReqOperationWrapper(method) != null) {
-            AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
-            TypeDeclaration typeDecl;
-            typeDecl = builder.getTypeDeclaration(seiContext.getReqOperationWrapper(method).getWrapperName());
-            seiContext.addReference(typeDecl, apEnv);
-            if (!isOneway) {
-                typeDecl = builder.getTypeDeclaration(seiContext.getResOperationWrapper(method).getWrapperName());
-                seiContext.addReference(typeDecl, apEnv);
-            }
-        }
-        collectExceptionBeans(method);
-    }
-
-    private void collectTypes(MethodDeclaration method, WebMethod webMethod, boolean isDocLitWrapped) {
-        addSchemaElements(method, isDocLitWrapped);
-    }
-
-
-    private void collectExceptionBeans(MethodDeclaration method) {
-        AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
-        for (ReferenceType thrownType : method.getThrownTypes()) {
-            FaultInfo faultInfo = seiContext.getExceptionBeanName(thrownType.toString());
-            if (faultInfo != null) {
-                if (!faultInfo.isWSDLException()) {
-                    seiContext.addReference(builder.getTypeDeclaration(faultInfo.getBeanName()), apEnv);
-                } else {
-                    TypeMirror bean = faultInfo.beanTypeMoniker.create(apEnv);
-                    Reference ref = seiContext.addReference(((DeclaredType)bean).getDeclaration(), apEnv);
-                    seiContext.addSchemaElement(faultInfo.getElementName(), ref);
-                }
-            }
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java
index 6c78b15..9efa006 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,63 +25,28 @@
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
 
-import com.sun.mirror.declaration.ClassDeclaration;
-import com.sun.mirror.declaration.ConstructorDeclaration;
-import com.sun.mirror.declaration.Declaration;
-import com.sun.mirror.declaration.FieldDeclaration;
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.declaration.Modifier;
-import com.sun.mirror.declaration.PackageDeclaration;
-import com.sun.mirror.declaration.ParameterDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-import com.sun.mirror.type.ClassType;
-import com.sun.mirror.type.DeclaredType;
-import com.sun.mirror.type.InterfaceType;
-import com.sun.mirror.type.ReferenceType;
-import com.sun.mirror.type.TypeMirror;
-import com.sun.mirror.type.VoidType;
-import com.sun.mirror.util.DeclarationVisitor;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
 import com.sun.mirror.util.SimpleDeclarationVisitor;
 import com.sun.mirror.util.SourcePosition;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-import com.sun.xml.internal.ws.modeler.RuntimeModeler;
-import com.sun.tools.internal.ws.processor.model.Parameter;
 import com.sun.tools.internal.ws.processor.model.Port;
-import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
 import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
 import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext.SEIContext;
+import com.sun.tools.internal.ws.resources.WebserviceapMessages;
 import com.sun.tools.internal.ws.util.ClassNameInfo;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
+import com.sun.xml.internal.ws.developer.Stateful;
+import com.sun.xml.internal.ws.model.RuntimeModeler;
+import com.sun.xml.internal.ws.util.localization.Localizable;
 
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
+import javax.jws.*;
 import javax.jws.soap.SOAPBinding;
 import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.xjc.api.Reference;
-import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext;
-import com.sun.tools.internal.ws.processor.modeler.annotation.ModelBuilder;
-import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceConstants;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Stack;
 
 /**
  *
@@ -125,15 +90,14 @@
     }
 
     public void visitInterfaceDeclaration(InterfaceDeclaration d) {
-        WebService webService = (WebService)d.getAnnotation(WebService.class);
+        WebService webService = d.getAnnotation(WebService.class);
         if (!shouldProcessWebService(webService, d))
             return;
         if (builder.checkAndSetProcessed(d))
             return;
         typeDecl = d;
         if (endpointInterfaceName != null && !endpointInterfaceName.equals(d.getQualifiedName())) {
-            builder.onError(d.getPosition(), "webserviceap.endpointinterfaces.do.not.match", new Object[]
-            {endpointInterfaceName, d.getQualifiedName()});
+            builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(endpointInterfaceName, d.getQualifiedName()));
         }
         verifySEIAnnotations(webService, d);
         endpointInterfaceName = d.getQualifiedName();
@@ -158,7 +122,7 @@
             SourcePosition pos = pos = d.getPosition();
             checkForInvalidImplAnnotation(d, SOAPBinding.class);
             if (webService.name().length() > 0)
-                annotationError(pos, ANNOTATION_ELEMENT_ERROR,"name");
+                annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT("name"));
             endpointReferencesInterface = true;
             verifyImplAnnotations(d);
             inspectEndpointInterface(endpointInterfaceName, d);
@@ -175,16 +139,13 @@
 
     protected void verifySEIAnnotations(WebService webService, InterfaceDeclaration d) {
         if (webService.endpointInterface().length() > 0) {
-            builder.onError(d.getPosition(), "webservicefactory.endpointinterface.on.interface",
-                    new Object[] {d.getQualifiedName(), webService.endpointInterface()});
+            builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(d.getQualifiedName(), webService.endpointInterface()));
         }
         if (webService.serviceName().length() > 0) {
-            builder.onError(d.getPosition(), "webserviceap.invalid.sei.annotation.element",
-                    new Object[] {"serviceName", d.getQualifiedName()});
+            builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT("serviceName", d.getQualifiedName()));
         }
         if (webService.portName().length() > 0) {
-            builder.onError(d.getPosition(), "webserviceap.invalid.sei.annotation.element",
-                    new Object[] {"portName", d.getQualifiedName()});
+            builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT("portName", d.getQualifiedName()));
         }
     }
 
@@ -203,8 +164,7 @@
         Object annotation = d.getAnnotation(annotationClass);
         if (annotation != null) {
             SourcePosition pos = d.getPosition();
-            annotationError(pos, "webserviceap.invalid.sei.annotation",
-                    new Object[] {annotationClass.getName(), d.getQualifiedName()});
+            annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(annotationClass.getName(), d.getQualifiedName()));
         }
     }
 
@@ -212,21 +172,17 @@
         Object annotation = d.getAnnotation(annotationClass);
         if (annotation != null) {
             SourcePosition pos = d.getPosition();
-            annotationError(pos, "webserviceap.endpointinteface.plus.annotation",
-                    annotationClass.getName());
+            annotationError(pos, WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(annotationClass.getName()));
         }
     }
 
-    protected void annotationError(SourcePosition pos, String key, String element) {
-        annotationError(pos, key, new Object[] {element});
-    }
-
-    protected void annotationError(SourcePosition pos, String key, Object[] args) {
-        builder.onError(pos, key, args);
+    protected void annotationError(SourcePosition pos, Localizable message) {
+        builder.onError(pos, message);
     }
 
 
     protected void preProcessWebService(WebService webService, TypeDeclaration d) {
+        processedMethods = new HashSet<String>();
         seiContext = context.getSEIContext(d);
         String targetNamespace = null;
         if (webService != null)
@@ -234,8 +190,7 @@
         if (targetNamespace == null || targetNamespace.length() == 0) {
             String packageName = d.getPackage().getQualifiedName();
             if (packageName == null || packageName.length() == 0) {
-                builder.onError(d.getPosition(), "webserviceap.no.package.class.must.have.targetnamespace",
-                        new Object[] {d.getQualifiedName()});
+                builder.onError(d.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(d.getQualifiedName()));
             }
             targetNamespace = getNamespace(d.getPackage());
         }
@@ -284,15 +239,13 @@
         if (!sameStyle(soapBinding.style(), soapStyle)) {
             changed = true;
             if (pushedSOAPBinding)
-                builder.onError(bindingDecl.getPosition(), "webserviceap.mixed.binding.style",
-                        new Object[] {classDecl.getQualifiedName()});
+                builder.onError(bindingDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_MIXED_BINDING_STYLE(classDecl.getQualifiedName()));
         }
         if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
             soapStyle = SOAPStyle.RPC;
             wrapped = true;
             if (soapBinding.parameterStyle().equals(ParameterStyle.BARE)) {
-                builder.onError(bindingDecl.getPosition(), "webserviceap.rpc.literal.must.not.be.bare",
-                        new Object[] {classDecl.getQualifiedName()});
+                builder.onError(bindingDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(classDecl.getQualifiedName()));
             }
 
         } else {
@@ -303,8 +256,10 @@
             }
         }
         if (soapBinding.use().equals(SOAPBinding.Use.ENCODED)) {
-            builder.onError(bindingDecl.getPosition(), "webserviceap.rpc.encoded.not.supported",
-                    new Object[] {classDecl.getQualifiedName()});
+            String style = "rpc";
+            if(soapBinding.style().equals(SOAPBinding.Style.DOCUMENT))
+                style = "document";
+            builder.onError(bindingDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(classDecl.getQualifiedName(), style));
         }
         if (changed || soapBindingStack.empty()) {
             soapBindingStack.push(soapBinding);
@@ -341,8 +296,7 @@
     protected boolean shouldProcessWebService(WebService webService, InterfaceDeclaration intf) {
         hasWebMethods = false;
         if (webService == null)
-            builder.onError(intf.getPosition(), "webserviceap.endpointinterface.has.no.webservice.annotation",
-                    new Object[] {intf.getQualifiedName()});
+            builder.onError(intf.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(intf.getQualifiedName()));
         if (isLegalSEI(intf))
             return true;
         return false;
@@ -377,11 +331,9 @@
             if (webMethod != null) {
                 if (webMethod.exclude()) {
                     if (webMethod.operationName().length() > 0)
-                        builder.onError(method.getPosition(), "webserviceap.invalid.webmethod.element.with.exclude",
-                                new Object[] {"operationName", d.getQualifiedName(), method.toString()});
+                        builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE("operationName", d.getQualifiedName(), method.toString()));
                                 if (webMethod.action().length() > 0)
-                                    builder.onError(method.getPosition(), "webserviceap.invalid.webmethod.element.with.exclude",
-                                            new Object[] {"action", d.getQualifiedName(), method.toString()});
+                                    builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE("action", d.getQualifiedName(), method.toString()));
                 } else {
                     return true;
                 }
@@ -394,7 +346,7 @@
         builder.log("ProcessedMethods Interface: "+d);
         hasWebMethods = false;
         for (MethodDeclaration methodDecl : d.getMethods()) {
-            methodDecl.accept((DeclarationVisitor)this);
+            methodDecl.accept(this);
         }
         for (InterfaceType superType : d.getSuperinterfaces())
             processMethods(superType.getDeclaration());
@@ -408,7 +360,7 @@
         if (d.getAnnotation(WebService.class) != null) {
             // Super classes must have @WebService annotations to pick up their methods
             for (MethodDeclaration methodDecl : d.getMethods()) {
-                methodDecl.accept((DeclarationVisitor)this);
+                methodDecl.accept(this);
             }
         }
         if (d.getSuperclass() != null) {
@@ -432,16 +384,15 @@
             intTypeDecl = (InterfaceDeclaration)builder.getTypeDeclaration(endpointInterfaceName);
         }
         if (intTypeDecl == null)
-            builder.onError("webserviceap.endpointinterface.class.not.found",
-                    new Object[] {endpointInterfaceName});
-                    return intTypeDecl;
+            builder.onError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(endpointInterfaceName));
+        return intTypeDecl;
     }
 
 
     private void inspectEndpointInterface(String endpointInterfaceName, ClassDeclaration d) {
         TypeDeclaration intTypeDecl = getEndpointInterfaceDecl(endpointInterfaceName, d);
         if (intTypeDecl != null)
-            intTypeDecl.accept((DeclarationVisitor)this);
+            intTypeDecl.accept(this);
     }
 
     public void visitMethodDeclaration(MethodDeclaration method) {
@@ -507,26 +458,25 @@
 
 
     protected boolean isLegalImplementation(WebService webService, ClassDeclaration classDecl) {
+
+        boolean isStateful = isStateful(classDecl);
+
         Collection<Modifier> modifiers = classDecl.getModifiers();
         if (!modifiers.contains(Modifier.PUBLIC)){
-            builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.not.public",
-                    new Object[] {classDecl.getQualifiedName()});
+            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(classDecl.getQualifiedName()));
                     return false;
         }
-        if (modifiers.contains(Modifier.FINAL)) {
-            builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.final",
-                    new Object[] {classDecl.getQualifiedName()});
-                    return false;
+        if (modifiers.contains(Modifier.FINAL) && !isStateful) {
+            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(classDecl.getQualifiedName()));
+            return false;
         }
-        if (modifiers.contains(Modifier.ABSTRACT)) {
-            builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.abstract",
-                    new Object[] {classDecl.getQualifiedName()});
-                    return false;
+        if (modifiers.contains(Modifier.ABSTRACT) && !isStateful) {
+            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(classDecl.getQualifiedName()));
+            return false;
         }
-        if (classDecl.getDeclaringType() != null && !modifiers.contains(Modifier.STATIC)) {
-            builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.innerclass.not.static",
-                    new Object[] {classDecl.getQualifiedName()});
-                    return false;
+        if (classDecl.getDeclaringType() != null && !modifiers.contains(Modifier.STATIC) && !isStateful) {
+            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(classDecl.getQualifiedName()));
+            return false;
         }
         boolean hasDefaultConstructor = false;
         for (ConstructorDeclaration constructor : classDecl.getConstructors()) {
@@ -536,10 +486,9 @@
                 break;
             }
         }
-        if (!hasDefaultConstructor) {
-            builder.onError(classDecl.getPosition(), "webserviceap.webservice.no.default.constructor",
-                    new Object[] {classDecl.getQualifiedName()});
-                    return false;
+        if (!hasDefaultConstructor && !isStateful) {
+            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(classDecl.getQualifiedName()));
+            return false;
         }
         if (webService.endpointInterface().length() == 0) {
             if (!methodsAreLegal(classDecl))
@@ -553,6 +502,10 @@
         return true;
     }
 
+    private boolean isStateful(ClassDeclaration classDecl) {
+        return classDecl.getAnnotation(Stateful.class)!=null;
+    }
+
     protected boolean classImplementsSEI(ClassDeclaration classDecl,
             InterfaceDeclaration intfDecl) {
         for (InterfaceType interfaceType : classDecl.getSuperinterfaces()) {
@@ -569,10 +522,8 @@
                 }
             }
             if (!implementsMethod) {
-                builder.onError(method.getPosition(), "webserviceap.method.not.implemented",
-                        new Object[] {intfDecl.getSimpleName(), classDecl.getSimpleName(),
-                                method});
-                                return false;
+                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(intfDecl.getSimpleName(), classDecl.getSimpleName(), method));
+                return false;
             }
         }
         return true;
@@ -596,13 +547,11 @@
     }
 
     protected boolean isLegalSEI(InterfaceDeclaration intf) {
-        for (FieldDeclaration field : intf.getFields()) {
+        for (FieldDeclaration field : intf.getFields())
             if (field.getConstantValue() != null) {
-                builder.onError("webserviceap.sei.cannot.contain.constant.values",
-                        new Object[] {intf.getQualifiedName(), field.getSimpleName()});
-                        return false;
+                builder.onError(WebserviceapMessages.WEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(intf.getQualifiedName(), field.getSimpleName()));
+                return false;
             }
-        }
         if (!methodsAreLegal(intf))
             return false;
         return true;
@@ -628,7 +577,8 @@
                 return false;
         }
         ClassType superClass = classDecl.getSuperclass();
-        if (superClass != null && !methodsAreLegal(superClass.getDeclaration())) {
+
+        if (!superClass.getDeclaration().getQualifiedName().equals(JAVA_LANG_OBJECT) && superClass != null && !methodsAreLegal(superClass.getDeclaration())) {
             return false;
         }
         return true;
@@ -636,19 +586,25 @@
 
 
     protected boolean isLegalMethod(MethodDeclaration method, TypeDeclaration typeDecl) {
-        if (hasWebMethods && method.getAnnotation(WebMethod.class) == null)
+        WebMethod webMethod = method.getAnnotation(WebMethod.class);
+        //SEI cannot have methods with @WebMethod(exclude=true)
+        if (typeDecl instanceof InterfaceDeclaration && webMethod != null && webMethod.exclude())
+            builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeDecl.getQualifiedName(), method.toString()));
+
+        if (hasWebMethods && (webMethod == null))
             return true;
+        if (!hasWebMethods && (webMethod !=null) && webMethod.exclude()) {
+            return true;
+        }
         if (typeDecl instanceof ClassDeclaration && method.getModifiers().contains(Modifier.ABSTRACT)) {
-            builder.onError(method.getPosition(), "webserviceap.webservice.method.is.abstract",
-                    new Object[] {typeDecl.getQualifiedName(), method.getSimpleName()});
-                    return false;
+            builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(typeDecl.getQualifiedName(), method.getSimpleName()));
+            return false;
         }
 
         if (!isLegalType(method.getReturnType())) {
-            builder.onError(method.getPosition(), "webserviceap.method.return.type.cannot.implement.remote",
-                    new Object[] {typeDecl.getQualifiedName(),
-                            method.getSimpleName(),
-                            method.getReturnType()});
+            builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeDecl.getQualifiedName(),
+                method.getSimpleName(),
+                method.getReturnType()));
         }
         boolean isOneway = method.getAnnotation(Oneway.class) != null;
         if (isOneway && !isValidOnewayMethod(method, typeDecl))
@@ -658,8 +614,7 @@
         SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
         if (soapBinding != null) {
             if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
-                builder.onError(method.getPosition(),"webserviceap.rpc.soapbinding.not.allowed.on.method",
-                        new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(typeDecl.getQualifiedName(), method.toString()));
             }
         }
 
@@ -675,27 +630,19 @@
             int inParams = getModeParameterCount(method, WebParam.Mode.IN);
             int outParams = getModeParameterCount(method, WebParam.Mode.OUT);
             if (inParams != 1) {
-                builder.onError(method.getPosition(),
-                        "webserviceap.doc.bare.and.no.one.in",
-                        new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(typeDecl.getQualifiedName(), method.toString()));
             }
             if (method.getReturnType() instanceof VoidType) {
                 if (outParam == null && !isOneway) {
-                    builder.onError(method.getPosition(),
-                            "webserviceap.doc.bare.no.out",
-                            new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                    builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_DOC_BARE_NO_OUT(typeDecl.getQualifiedName(), method.toString()));
                 }
                 if (outParams != 1) {
                     if (!isOneway && outParams != 0)
-                        builder.onError(method.getPosition(),
-                                "webserviceap.doc.bare.no.return.and.no.out",
-                                new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                        builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(typeDecl.getQualifiedName(), method.toString()));
                 }
             } else {
                 if (outParams > 0) {
-                    builder.onError(outParam.getPosition(),
-                            "webserviceap.doc.bare.return.and.out",
-                            new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                    builder.onError(outParam.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(typeDecl.getQualifiedName(), method.toString()));
                 }
             }
         }
@@ -707,12 +654,11 @@
             TypeDeclaration typeDecl,
             int paramIndex) {
         if (!isLegalType(param.getType())) {
-            builder.onError(param.getPosition(), "webserviceap.method.parameter.types.cannot.implement.remote",
-                    new Object[] {typeDecl.getQualifiedName(),
-                            method.getSimpleName(),
-                            param.getSimpleName(),
-                            param.getType().toString()});
-                            return false;
+            builder.onError(param.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(typeDecl.getQualifiedName(),
+                method.getSimpleName(),
+                param.getSimpleName(),
+                param.getType().toString()));
+            return false;
         }
         TypeMirror holderType;
         holderType = builder.getHolderValueType(param.getType());
@@ -722,14 +668,14 @@
             mode = webParam.mode();
 
         if (holderType != null) {
-            if (mode != null &&  mode.equals(WebParam.Mode.IN))
-                builder.onError(param.getPosition(), "webserviceap.holder.parameters.must.not.be.in.only",
-                        new Object[] {typeDecl.getQualifiedName(), method.toString(), paramIndex});
-        } else if (mode != null && !mode.equals(WebParam.Mode.IN)) {
-            builder.onError(param.getPosition(), "webserviceap.non.in.parameters.must.be.holder",
-                    new Object[] {typeDecl.getQualifiedName(), method.toString(), paramIndex});
+            if (mode != null &&  mode==WebParam.Mode.IN)
+                builder.onError(param.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(typeDecl.getQualifiedName(), method.toString(), paramIndex));
+        } else if (mode != null && mode!=WebParam.Mode.IN) {
+            builder.onError(param.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(typeDecl.getQualifiedName(), method.toString(), paramIndex));
         }
 
+
+
         return true;
     }
 
@@ -741,23 +687,18 @@
         boolean valid = true;
         if (!(method.getReturnType() instanceof VoidType)) {
             // this is an error, cannot be Oneway and have a return type
-            builder.onError(method.getPosition(), "webserviceap.oneway.operation.cannot.have.return.type",
-                    new Object[] {typeDecl.getQualifiedName(), method.toString()});
+            builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(typeDecl.getQualifiedName(), method.toString()));
             valid = false;
         }
         ParameterDeclaration outParam = getOutParameter(method);
         if (outParam != null) {
-            builder.onError(outParam.getPosition(),
-                    "webserviceap.oneway.and.out",
-                    new Object[] {typeDecl.getQualifiedName(), method.toString()});
+            builder.onError(outParam.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ONEWAY_AND_OUT(typeDecl.getQualifiedName(), method.toString()));
             valid = false;
         }
         if (!isDocLitWrapped() && soapStyle.equals(SOAPStyle.DOCUMENT)) {
             int inCnt = getModeParameterCount(method, WebParam.Mode.IN);
             if (inCnt != 1) {
-                builder.onError(method.getPosition(),
-                        "webserviceap.oneway.and.not.one.in",
-                        new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(typeDecl.getQualifiedName(), method.toString()));
                 valid = false;
             }
         }
@@ -765,8 +706,7 @@
         for (ReferenceType thrownType : method.getThrownTypes()) {
             exDecl = ((ClassType)thrownType).getDeclaration();
             if (!builder.isRemoteException(exDecl)) {
-                builder.onError(method.getPosition(), "webserviceap.oneway.operation.cannot.declare.exceptions",
-                        new Object[] {typeDecl.getQualifiedName(), method.toString(), exDecl.getQualifiedName()});
+                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(typeDecl.getQualifiedName(), method.toString(), exDecl.getQualifiedName()));
                 valid = false;
             }
         }
@@ -795,13 +735,10 @@
     protected boolean isEquivalentModes(WebParam.Mode mode1, WebParam.Mode mode2) {
         if (mode1.equals(mode2))
             return true;
-        assert(mode1.equals(WebParam.Mode.IN) ||
-                mode1.equals(WebParam.Mode.OUT));
-        if (mode1.equals(WebParam.Mode.IN) &&
-                !(mode2.equals(WebParam.Mode.OUT)))
+        assert mode1==WebParam.Mode.IN || mode1==WebParam.Mode.OUT;
+        if (mode1==WebParam.Mode.IN && mode2!=WebParam.Mode.OUT)
             return true;
-        if (mode1.equals(WebParam.Mode.OUT) &&
-                !(mode2.equals(WebParam.Mode.IN)))
+        if (mode1==WebParam.Mode.OUT && mode2!=WebParam.Mode.IN)
             return true;
         return false;
     }
@@ -816,78 +753,11 @@
         return !builder.isRemote(((DeclaredType)type).getDeclaration());
     }
 
-    public void addSchemaElements(MethodDeclaration method, boolean isDocLitWrapped) {
-        addReturnSchemaElement(method, isDocLitWrapped);
-        boolean hasInParam = false;
-        for (ParameterDeclaration param : method.getParameters()) {
-            hasInParam |= addParamSchemaElement(param, method, isDocLitWrapped);
-        }
-        if (!hasInParam && soapStyle.equals(SOAPStyle.DOCUMENT) && !isDocLitWrapped) {
-            QName paramQName = new QName(wsdlNamespace, method.getSimpleName());
-            seiContext.addSchemaElement(paramQName, null);
-        }
-    }
-
-    public void addReturnSchemaElement(MethodDeclaration method, boolean isDocLitWrapped) {
-        TypeMirror returnType = method.getReturnType();
-        WebResult webResult = method.getAnnotation(WebResult.class);
-        String responseName = builder.getResponseName(method.getSimpleName());
-        String responseNamespace = wsdlNamespace;
-        boolean isResultHeader = false;
-        if (webResult != null) {
-            responseName = webResult.name().length() > 0 ? webResult.name() : responseName;
-            responseNamespace = webResult.targetNamespace().length() > 0 ? webResult.targetNamespace() : responseNamespace;
-            isResultHeader = webResult.header();
-        }
-        QName typeName = new QName(responseNamespace, responseName);
-        if (!(returnType instanceof VoidType) &&
-                (!isDocLitWrapped || isResultHeader)) {
-            Reference ref = seiContext.addReference(method);
-            if (!soapStyle.equals(SOAPStyle.RPC))
-                seiContext.addSchemaElement(typeName, ref);
-        }
-    }
-
-    public boolean addParamSchemaElement(ParameterDeclaration param, MethodDeclaration method, boolean isDocLitWrappped) {
-        boolean isInParam = false;
-        WebParam webParam = param.getAnnotation(WebParam.class);
-        String paramName = param.getSimpleName();
-        String paramNamespace = wsdlNamespace;
-        TypeMirror paramType = param.getType();
-        TypeMirror holderType = builder.getHolderValueType(paramType);
-        boolean isHeader = false;
-        if (soapStyle.equals(SOAPStyle.DOCUMENT) && !wrapped) {
-            paramName = method.getSimpleName();
-        }
-        if (webParam != null) {
-            paramName = webParam.name() != null && webParam.name().length() > 0 ? webParam.name() : paramName;
-            isHeader = webParam.header();
-            paramNamespace = webParam.targetNamespace().length() > 0 ? webParam.targetNamespace() : paramNamespace;
-        }
-        if (holderType != null) {
-            paramType = holderType;
-        }
-        if (isHeader || soapStyle.equals(SOAPStyle.DOCUMENT)) {
-            if (isHeader || !isDocLitWrappped) {
-                QName paramQName = new QName(paramNamespace, paramName);
-                Reference ref = seiContext.addReference(paramType, param);
-                seiContext.addSchemaElement(paramQName, ref);
-            }
-        } else
-            seiContext.addReference(paramType, param);
-        if (!isHeader && (holderType == null ||
-                (webParam == null || !webParam.mode().equals(WebParam.Mode.OUT)))) {
-            isInParam = true;
-        }
-        return isInParam;
-    }
-
     protected ParameterDeclaration getOutParameter(MethodDeclaration method) {
         WebParam webParam;
         for (ParameterDeclaration param : method.getParameters()) {
-            webParam = (WebParam)param.getAnnotation(WebParam.class);
-            if (webParam != null &&
-                    !webParam.mode().equals(WebParam.Mode.IN)) {
+            webParam = param.getAnnotation(WebParam.class);
+            if (webParam != null && webParam.mode()!=WebParam.Mode.IN) {
                 return param;
             }
         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
index dffd689..5ffd4dd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,71 +22,39 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
 import static com.sun.codemodel.internal.ClassType.CLASS;
-import com.sun.codemodel.internal.CodeWriter;
-import com.sun.codemodel.internal.JAnnotationArrayMember;
-import com.sun.codemodel.internal.JAnnotationUse;
-import com.sun.codemodel.internal.JBlock;
-import com.sun.codemodel.internal.JCodeModel;
-import com.sun.codemodel.internal.JCommentPart;
-import com.sun.codemodel.internal.JDefinedClass;
-import com.sun.codemodel.internal.JDocComment;
-import com.sun.codemodel.internal.JExpr;
-import com.sun.codemodel.internal.JFieldVar;
-import com.sun.codemodel.internal.JMethod;
-import com.sun.codemodel.internal.JMod;
-import com.sun.codemodel.internal.JType;
-import com.sun.codemodel.internal.JVar;
+import com.sun.codemodel.internal.*;
 import com.sun.codemodel.internal.writer.ProgressCodeWriter;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.declaration.ClassDeclaration;
-import com.sun.mirror.declaration.FieldDeclaration;
-import com.sun.mirror.declaration.InterfaceDeclaration;
-import com.sun.mirror.declaration.MethodDeclaration;
-import com.sun.mirror.declaration.ParameterDeclaration;
-import com.sun.mirror.declaration.TypeDeclaration;
-
+import com.sun.mirror.declaration.*;
 import com.sun.mirror.type.ClassType;
-import com.sun.mirror.type.ReferenceType;
-import com.sun.mirror.type.TypeMirror;
-import com.sun.mirror.type.VoidType;
-
+import com.sun.mirror.type.*;
 import com.sun.tools.internal.ws.processor.generator.GeneratorBase;
+import com.sun.tools.internal.ws.processor.generator.GeneratorConstants;
+import com.sun.tools.internal.ws.processor.generator.Names;
 import com.sun.tools.internal.ws.processor.modeler.ModelerException;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
+import com.sun.tools.internal.ws.processor.util.DirectoryUtil;
+import com.sun.tools.internal.ws.resources.WebserviceapMessages;
 import com.sun.tools.internal.ws.util.ClassNameInfo;
 import com.sun.tools.internal.ws.wscompile.FilerCodeWriter;
+import com.sun.tools.internal.ws.wscompile.WsgenOptions;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.ToolVersion;
 import com.sun.xml.internal.ws.util.StringUtils;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.api.impl.NameConverter;
 
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
+import javax.jws.*;
+import javax.xml.bind.annotation.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebFault;
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
+import java.lang.annotation.Annotation;
 
 
 /**
@@ -126,11 +94,10 @@
         if (cm != null) {
             File sourceDir = builder.getSourceDir();
             assert(sourceDir != null);
-            ProcessorEnvironment env = builder.getProcessorEnvironment();
+            WsgenOptions options = builder.getOptions();
             try {
-                CodeWriter cw = new FilerCodeWriter(sourceDir, env);
-
-                if(env.verbose())
+                CodeWriter cw = new FilerCodeWriter(sourceDir, options);
+                if(options.verbose)
                     cw = new ProgressCodeWriter(cw, System.out);
                 cm.build(cw);
             } catch (IOException e) {
@@ -158,17 +125,12 @@
         if (packageName.length() == 0)
             beanPackage = JAXWS_PACKAGE_PD;
         boolean beanGenerated = false;
-        try {
-            for (ReferenceType thrownType : method.getThrownTypes()) {
-                ClassDeclaration typeDecl = ((ClassType)thrownType).getDeclaration();
-                if (typeDecl == null)
-                    builder.onError("webserviceap.could.not.find.typedecl",
-                         new Object[] {thrownType.toString(), context.getRound()});
-                boolean tmp = generateExceptionBean(typeDecl, beanPackage);
-                beanGenerated = beanGenerated || tmp;
-            }
-        } catch (Exception e) {
-            throw new ModelerException("modeler.nestedGeneratorError",e);
+        for (ReferenceType thrownType : method.getThrownTypes()) {
+            ClassDeclaration typeDecl = ((ClassType)thrownType).getDeclaration();
+            if (typeDecl == null)
+                builder.onError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(thrownType.toString(), context.getRound()));
+            boolean tmp = generateExceptionBean(typeDecl, beanPackage);
+            beanGenerated = beanGenerated || tmp;
         }
         return beanGenerated;
     }
@@ -176,10 +138,10 @@
     private boolean duplicateName(String name) {
         for (String str : wrapperNames) {
             if (str.equalsIgnoreCase(name))
-                return true;
+        return true;
         }
         wrapperNames.add(name);
-        return false;
+    return false;
     }
 
     private boolean generateWrappers(MethodDeclaration method, WebMethod webMethod) {
@@ -207,13 +169,17 @@
                 reqNamespace = reqWrapper.targetNamespace();
         }
         builder.log("requestWrapper: "+requestClassName);
+///// fix for wsgen CR 6442344
+        File file = new File(DirectoryUtil.getOutputDirectoryFor(requestClassName, builder.getSourceDir()),
+                             Names.stripQualifier(requestClassName) + GeneratorConstants.JAVA_SRC_SUFFIX);
+        builder.getOptions().addGeneratedFile(file);
+//////////
         boolean canOverwriteRequest = builder.canOverWriteClass(requestClassName);
         if (!canOverwriteRequest) {
             builder.log("Class " + requestClassName + " exists. Not overwriting.");
         }
         if (duplicateName(requestClassName) && canOverwriteRequest) {
-            builder.onError("webserviceap.method.request.wrapper.bean.name.not.unique",
-                             new Object[] {typeDecl.getQualifiedName(), method.toString()});
+            builder.onError(WebserviceapMessages.WEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(typeDecl.getQualifiedName(), method.toString()));
         }
 
         String responseClassName = null;
@@ -234,9 +200,11 @@
                 builder.log("Class " + responseClassName + " exists. Not overwriting.");
             }
             if (duplicateName(responseClassName) && canOverwriteResponse) {
-                builder.onError("webserviceap.method.response.wrapper.bean.name.not.unique",
-                                 new Object[] {typeDecl.getQualifiedName(), method.toString()});
+                builder.onError(WebserviceapMessages.WEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(typeDecl.getQualifiedName(), method.toString()));
             }
+            file = new File(DirectoryUtil.getOutputDirectoryFor(responseClassName, builder.getSourceDir()),
+                                 Names.stripQualifier(responseClassName) + GeneratorConstants.JAVA_SRC_SUFFIX);
+            builder.getOptions().addGeneratedFile(file);
         }
         ArrayList<MemberInfo> reqMembers = new ArrayList<MemberInfo>();
         ArrayList<MemberInfo> resMembers = new ArrayList<MemberInfo>();
@@ -252,8 +220,6 @@
             seiContext.setResWrapperOperation(method, resWrapperInfo);
         try {
             if (!canOverwriteRequest && !canOverwriteResponse) {
-//                getWrapperMembers(reqWrapperInfo);
-//                getWrapperMembers(resWrapperInfo);
                 return false;
             }
 
@@ -271,7 +237,7 @@
             writeXmlElementDeclaration(reqCls, reqName,reqNamespace);
             writeXmlElementDeclaration(resCls, resName, resNamespace);
 
-            collectMembers(method, operationName, typeNamespace, reqMembers, resMembers);
+            collectMembers(method, reqMembers, resMembers);
 
             // XmlType
             writeXmlTypeDeclaration(reqCls, reqName, reqNamespace, reqMembers);
@@ -280,56 +246,31 @@
             // class members
             writeMembers(reqCls, reqMembers);
             writeMembers(resCls, resMembers);
+
         } catch (Exception e) {
             throw new ModelerException("modeler.nestedGeneratorError",e);
         }
         return true;
     }
 
-/*    private void getWrapperMembers(WrapperInfo wrapperInfo) throws Exception {
-        if (wrapperInfo == null)
-            return;
-        TypeDeclaration type = builder.getTypeDeclaration(wrapperInfo.getWrapperName());
-        Collection<FieldDeclaration> fields = type.getFields();
-        ArrayList<MemberInfo> members = new ArrayList<MemberInfo>();
-        MemberInfo member;
-        int i=0;
-        for (FieldDeclaration field : fields) {
-            XmlElement xmlElement = field.getAnnotation(XmlElement.class);
-            String fieldName = field.getSimpleName();
-//            String typeName = field.getType().toString();
-            String elementName = xmlElement != null ? xmlElement.name() : fieldName;
-            String namespace =  xmlElement != null ? xmlElement.namespace() : "";
+    private void collectMembers(MethodDeclaration method,
+                                ArrayList<MemberInfo> requestMembers,
+                                ArrayList<MemberInfo> responseMembers) {
 
-            String idxStr = fieldName.substring(3);
-            int index = Integer.parseInt(idxStr);
-            member = new MemberInfo(index, field.getType(),
-                                    field.getSimpleName(),
-                                    new QName(namespace, elementName));
-            int j=0;
-            while (j<members.size() && members.get(j++).getParamIndex() < index) {
-                break;
-            }
-            members.add(j, member);
-            i++;
-        }
-        for (MemberInfo member2 : members) {
-            wrapperInfo.addMember(member2);
-        }
-    }*/
-
-    private void collectMembers(MethodDeclaration method, String operationName, String namespace,
-                               ArrayList<MemberInfo> requestMembers,
-                               ArrayList<MemberInfo> responseMembers) {
-
-        AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
         WebResult webResult = method.getAnnotation(WebResult.class);
+        List<Annotation> jaxbRespAnnotations = collectJAXBAnnotations(method);
         String responseElementName = RETURN;
+        String responseName = RETURN_VALUE;
         String responseNamespace = wrapped ? EMTPY_NAMESPACE_ID : typeNamespace;
         boolean isResultHeader = false;
         if (webResult != null) {
             if (webResult.name().length() > 0) {
                 responseElementName = webResult.name();
+                responseName = JAXBRIContext.mangleNameToVariableName(webResult.name());
+
+                //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
+                //care of mangling java identifiers
+                responseName = Names.getJavaReserverVarialbeName(responseName);
             }
             responseNamespace = webResult.targetNamespace().length() > 1 ?
                 webResult.targetNamespace() :
@@ -341,27 +282,23 @@
         WebParam webParam;
         TypeMirror paramType;
         String paramName;
+
         String paramNamespace;
         TypeMirror holderType;
         int paramIndex = -1;
-//        System.out.println("method: "+method.toString());
-//        System.out.println("returnType: "+ method.getReturnType());
-
-//        TypeMirror typeMirror = apEnv.getTypeUtils().getErasure(method.getReturnType());
         TypeMirror typeMirror = getSafeType(method.getReturnType());
-        String retType = typeMirror.toString();
+
         if (!(method.getReturnType() instanceof VoidType) && !isResultHeader) {
-            responseMembers.add(new MemberInfo(-1, typeMirror, RETURN_VALUE,
-                new QName(responseNamespace, responseElementName)));
+            responseMembers.add(new MemberInfo(typeMirror, responseName,
+                new QName(responseNamespace, responseElementName), method, jaxbRespAnnotations.toArray(new Annotation[jaxbRespAnnotations.size()])));
         }
 
         for (ParameterDeclaration param : method.getParameters()) {
+            List<Annotation> jaxbAnnotation = collectJAXBAnnotations(param);
             WebParam.Mode mode = null;
             paramIndex++;
-//            System.out.println("param.getType(): "+param.getType());
             holderType = builder.getHolderValueType(param.getType());
             webParam = param.getAnnotation(WebParam.class);
-//            typeMirror = apEnv.getTypeUtils().getErasure(param.getType());
             typeMirror =  getSafeType(param.getType());
             paramType = typeMirror;
             paramNamespace = wrapped ? EMTPY_NAMESPACE_ID : typeNamespace;
@@ -379,8 +316,14 @@
                 if (webParam.targetNamespace().length() > 0)
                     paramNamespace = webParam.targetNamespace();
             }
-            MemberInfo memInfo = new MemberInfo(paramIndex, paramType, paramName,
-                new QName(paramNamespace, paramName));
+
+            String propertyName = JAXBRIContext.mangleNameToVariableName(paramName);
+            //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
+            //care of mangling java identifiers
+            propertyName = Names.getJavaReserverVarialbeName(propertyName);
+
+            MemberInfo memInfo = new MemberInfo(paramType, propertyName,
+                new QName(paramNamespace, paramName), param, jaxbAnnotation.toArray(new Annotation[jaxbAnnotation.size()]));
             if (holderType != null) {
                 if (mode == null || mode.equals(WebParam.Mode.INOUT)) {
                     requestMembers.add(memInfo);
@@ -392,25 +335,59 @@
         }
     }
 
-    private TypeMirror getSafeType(TypeMirror type) {
-//        System.out.println("type: "+type+" type.getClass(): "+type.getClass());
-        TypeMirror retType = makeSafeVisitor.apply(type, builder.getAPEnv().getTypeUtils());
-//        System.out.println("retType: "+retType+" retType.getClass(): "+retType.getClass());
-        return retType;
+    private List<Annotation> collectJAXBAnnotations(ParameterDeclaration param) {
+        List<Annotation> jaxbAnnotation = new ArrayList<Annotation>();
+        Annotation ann = param.getAnnotation(XmlAttachmentRef.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = param.getAnnotation(XmlMimeType.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = param.getAnnotation(XmlJavaTypeAdapter.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = param.getAnnotation(XmlList.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+        return jaxbAnnotation;
     }
 
-    private JType getType(TypeMirror typeMirror) throws IOException {
+    private List<Annotation> collectJAXBAnnotations(MethodDeclaration method) {
+        List<Annotation> jaxbAnnotation = new ArrayList<Annotation>();
+        Annotation ann = method.getAnnotation(XmlAttachmentRef.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = method.getAnnotation(XmlMimeType.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = method.getAnnotation(XmlJavaTypeAdapter.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+
+        ann = method.getAnnotation(XmlList.class);
+        if(ann != null)
+            jaxbAnnotation.add(ann);
+        return jaxbAnnotation;
+    }
+
+    private TypeMirror getSafeType(TypeMirror type) {
+        return makeSafeVisitor.apply(type, builder.getAPEnv().getTypeUtils());
+    }
+
+    private JType getType(TypeMirror typeMirror) {
         String type = typeMirror.toString();
-        JType jType = null;
         try {
 //            System.out.println("typeName: "+typeName);
-            jType = cm.parseType(type);
+            return cm.parseType(type);
 //            System.out.println("type: "+type);
-            return jType;
         } catch (ClassNotFoundException e) {
-            jType = cm.ref(type);
+            return cm.ref(type);
         }
-        return jType;
     }
 
     private ArrayList<MemberInfo> sortMembers(ArrayList<MemberInfo> members) {
@@ -423,7 +400,7 @@
         return sortedMembers;
     }
 
-    private void writeMembers(JDefinedClass cls, ArrayList<MemberInfo> members) throws IOException {
+    private void writeMembers(JDefinedClass cls, ArrayList<MemberInfo> members) {
         if (cls == null)
             return;
         for (MemberInfo memInfo : members) {
@@ -435,19 +412,54 @@
                     JAnnotationUse xmlElementAnn = field.annotate(XmlElement.class);
                     xmlElementAnn.param("name", elementName.getLocalPart());
                     xmlElementAnn.param("namespace", elementName.getNamespaceURI());
+                    if(memInfo.getParamType() instanceof ArrayType){
+                        xmlElementAnn.param("nillable", true);
+                    }
                 } else {
-                    JAnnotationUse xmlValueAnnn = field.annotate(XmlValue.class);
+                    field.annotate(XmlValue.class);
                 }
+                annotateParameterWithJAXBAnnotations(field, memInfo.getJaxbAnnotations());
+            }
+
+            // copy adapter if needed
+            XmlJavaTypeAdapter xjta = memInfo.getDecl().getAnnotation(XmlJavaTypeAdapter.class);
+            if(xjta!=null) {
+                JAnnotationUse xjtaA = field.annotate(XmlJavaTypeAdapter.class);
+                try {
+                    xjta.value();
+                    throw new AssertionError();
+                } catch (MirroredTypeException e) {
+                    xjtaA.param("value",getType(e.getTypeMirror()));
+                }
+                // XmlJavaTypeAdapter.type() is for package only. No need to copy.
             }
         }
         for (MemberInfo memInfo : members) {
-            writeMember(cls, memInfo.getParamIndex(), memInfo.getParamType(),
-                        memInfo.getParamName(), memInfo.getElementName());
+            writeMember(cls, memInfo.getParamType(),
+                        memInfo.getParamName());
+        }
+    }
+
+    private void annotateParameterWithJAXBAnnotations(JFieldVar field, Annotation[] jaxbAnnotations) {
+        for(Annotation ann : jaxbAnnotations){
+            if(ann instanceof XmlMimeType){
+                JAnnotationUse jaxbAnn = field.annotate(XmlMimeType.class);
+                jaxbAnn.param("value", ((XmlMimeType)ann).value());
+            }else if(ann instanceof XmlJavaTypeAdapter){
+                JAnnotationUse jaxbAnn = field.annotate(XmlJavaTypeAdapter.class);
+                XmlJavaTypeAdapter ja = (XmlJavaTypeAdapter) ann;
+                jaxbAnn.param("value", ja.value());
+                jaxbAnn.param("type", ja.type());
+            }else if(ann instanceof XmlAttachmentRef){
+                field.annotate(XmlAttachmentRef.class);
+            }else if(ann instanceof XmlList){
+                field.annotate(XmlList.class);
+            }
         }
     }
 
     protected JDefinedClass getCMClass(String className, com.sun.codemodel.internal.ClassType type) {
-        JDefinedClass cls = null;
+        JDefinedClass cls;
         try {
             cls = cm._class(className, type);
         } catch (com.sun.codemodel.internal.JClassAlreadyExistsException e){
@@ -456,10 +468,10 @@
         return cls;
     }
 
-    private boolean generateExceptionBean(ClassDeclaration thrownDecl, String beanPackage) throws IOException {
+    private boolean generateExceptionBean(ClassDeclaration thrownDecl, String beanPackage) {
         if (builder.isRemoteException(thrownDecl))
             return false;
-        AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
+
         String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName());
         if (processedExceptions.contains(exceptionName))
             return false;
@@ -467,14 +479,16 @@
         WebFault webFault = thrownDecl.getAnnotation(WebFault.class);
         String className = beanPackage+ exceptionName + BEAN;
 
-        Map<String, TypeMirror> propertyToTypeMap;
-        propertyToTypeMap = TypeModeler.getExceptionProperties(thrownDecl);
+        TreeMap<String,MethodDeclaration> propertyToTypeMap = new TreeMap<String,MethodDeclaration>();
+
+        TypeModeler.collectExceptionProperties(thrownDecl,propertyToTypeMap);
+
         boolean isWSDLException = isWSDLException(propertyToTypeMap, thrownDecl);
         String namespace = typeNamespace;
         String name = exceptionName;
         FaultInfo faultInfo;
         if (isWSDLException) {
-            TypeMirror beanType =  getSafeType(propertyToTypeMap.get(FAULT_INFO));
+            TypeMirror beanType =  getSafeType(propertyToTypeMap.get(FAULT_INFO).getReturnType());
             faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true);
             namespace = webFault.targetNamespace().length()>0 ?
                                webFault.targetNamespace() : namespace;
@@ -497,19 +511,14 @@
         faultInfo = new FaultInfo(className, false);
 
         if (duplicateName(className)) {
-            builder.onError("webserviceap.method.exception.bean.name.not.unique",
-                             new Object[] {typeDecl.getQualifiedName(), thrownDecl.getQualifiedName()});
+            builder.onError(WebserviceapMessages.WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(typeDecl.getQualifiedName(), thrownDecl.getQualifiedName()));
         }
 
         ArrayList<MemberInfo> members = new ArrayList<MemberInfo>();
-        MemberInfo member;
-        String typeString;
-        TypeMirror erasureType;
-        TreeSet<String> keys = new TreeSet<String>(propertyToTypeMap.keySet());
-        for (String key : keys) {
-            TypeMirror type = propertyToTypeMap.get(key);
-            erasureType =  getSafeType(type);
-            member = new MemberInfo(-10, erasureType, key, null);
+        for (String key : propertyToTypeMap.keySet()) {
+            MethodDeclaration method = propertyToTypeMap.get(key);
+            TypeMirror erasureType =  getSafeType(method.getReturnType());
+            MemberInfo member = new MemberInfo(erasureType, key, null, method);
             members.add(member);
         }
         faultInfo.setMembers(members);
@@ -542,17 +551,14 @@
         return true;
     }
 
-    protected boolean isWSDLException(Map<String, TypeMirror>map, ClassDeclaration thrownDecl) {
+    protected boolean isWSDLException(Map<String,MethodDeclaration> map, ClassDeclaration thrownDecl) {
         WebFault webFault = thrownDecl.getAnnotation(WebFault.class);
         if (webFault == null)
             return false;
-        if (map.size() != 2 || map.get(FAULT_INFO) == null)
-            return false;
-        return true;
+        return !(map.size() != 2 || map.get(FAULT_INFO) == null);
     }
 
-    private void writeXmlElementDeclaration(JDefinedClass cls, String elementName, String namespaceUri)
-        throws IOException {
+    private void writeXmlElementDeclaration(JDefinedClass cls, String elementName, String namespaceUri) {
 
        if (cls == null)
             return;
@@ -566,7 +572,7 @@
     }
 
     private void writeXmlTypeDeclaration(JDefinedClass cls, String typeName, String namespaceUri,
-                                         ArrayList<MemberInfo> members) throws IOException {
+                                         ArrayList<MemberInfo> members) {
         if (cls == null)
             return;
         JAnnotationUse xmlTypeAnn = cls.annotate(cm.ref(XmlType.class));
@@ -580,24 +586,23 @@
         }
     }
 
-    private void writeMember(JDefinedClass cls, int paramIndex, TypeMirror paramType,
-        String paramName, QName elementName) throws IOException {
+    private void writeMember(JDefinedClass cls, TypeMirror paramType,
+                             String paramName) {
 
         if (cls == null)
             return;
-        String capPropName = StringUtils.capitalize(paramName);
+
+        String accessorName =JAXBRIContext.mangleNameToPropertyName(paramName);
         String getterPrefix = paramType.equals("boolean") || paramType.equals("java.lang.Boolean") ? "is" : "get";
-        JMethod m = null;
-        JDocComment methodDoc = null;
         JType propType = getType(paramType);
-        m = cls.method(JMod.PUBLIC, propType, getterPrefix+capPropName);
-        methodDoc = m.javadoc();
+        JMethod m = cls.method(JMod.PUBLIC, propType, getterPrefix+ accessorName);
+        JDocComment methodDoc = m.javadoc();
         JCommentPart ret = methodDoc.addReturn();
         ret.add("returns "+propType.name());
         JBlock body = m.body();
         body._return( JExpr._this().ref(paramName) );
 
-        m = cls.method(JMod.PUBLIC, cm.VOID, "set"+capPropName);
+        m = cls.method(JMod.PUBLIC, cm.VOID, "set"+accessorName);
         JVar param = m.param(propType, paramName);
         methodDoc = m.javadoc();
         JCommentPart part = methodDoc.addParam(paramName);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java
index 43ce925..635f53b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WrapperInfo.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,8 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.annotation;
 
-import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.List;
-import com.sun.tools.internal.ws.processor.modeler.annotation.*;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java
index 19eb4e2..aef8f22 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/AccessorElement.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
index f3ab1e2..4f6c6ce 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,11 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import com.sun.tools.internal.xjc.api.ClassNameAllocator;
 import com.sun.tools.internal.ws.processor.util.ClassNameCollector;
+import com.sun.tools.internal.xjc.api.ClassNameAllocator;
 
-import java.util.Set;
 import java.util.HashSet;
-import java.util.Map;
-import java.util.HashMap;
+import java.util.Set;
 
 /**
  * @author Vivek Pandey
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
index 240a6e9..a94a0e2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,61 +25,47 @@
 
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import com.sun.tools.internal.xjc.api.ErrorListener;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
 import org.xml.sax.SAXParseException;
 
-import java.util.ResourceBundle;
-import java.text.MessageFormat;
+import java.io.OutputStream;
+import java.io.PrintStream;
 
-public class ConsoleErrorReporter implements ErrorListener{
+public class ConsoleErrorReporter extends ErrorReceiver {
 
-    private LocalizableMessageFactory messageFactory;
-    private ProcessorEnvironment env;
-    private boolean printStackTrace;
     private boolean hasError;
+    private PrintStream output;
+    private boolean debug;
 
-    public ConsoleErrorReporter(ProcessorEnvironment env, boolean printStackTrace) {
-        this.env = env;
-        this.printStackTrace = printStackTrace;
-        messageFactory =
-            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.model");
+    public ConsoleErrorReporter(PrintStream stream) {
+        this.output = stream;
+    }
+
+    public ConsoleErrorReporter(OutputStream outputStream) {
+        this.output = new PrintStream(outputStream);
     }
 
     public boolean hasError() {
         return hasError;
     }
 
-    // will be null unless set in #error or #fatalError
-    //TODO: remove it after error handling is straightened
-    private Exception e;
-    Exception getException(){
-        return e;
-    }
-
     public void error(SAXParseException e) {
-        hasError = true;
-        this.e = e;
-        if(printStackTrace)
+        if(debug)
             e.printStackTrace();
-        env.error(messageFactory.getMessage("model.saxparser.exception",
-                new Object[]{e.getMessage(), getLocationString(e)}));
+        hasError = true;
+        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
     }
 
     public void fatalError(SAXParseException e) {
-        hasError = true;
-        this.e = e;
-        if(printStackTrace)
+        if(debug)
             e.printStackTrace();
-
-        env.error(messageFactory.getMessage("model.saxparser.exception",
-                new Object[]{e.getMessage(), getLocationString(e)}));
+        hasError = true;
+        print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
     }
 
     public void warning(SAXParseException e) {
-        env.warn(messageFactory.getMessage("model.saxparser.exception",
-                new Object[]{e.getMessage(), getLocationString(e)}));
+        print(WscompileMessages.WSIMPORT_WARNING_MESSAGE(e.getMessage()), e);
     }
 
     /**
@@ -87,37 +73,17 @@
      * can be safely ignored.
      */
     public void info(SAXParseException e) {
-        env.info(messageFactory.getMessage("model.saxparser.exception",
-                new Object[]{e.getMessage(), getLocationString(e)}));
+        print(WscompileMessages.WSIMPORT_INFO_MESSAGE(e.getMessage()), e);
     }
 
-     /**
-    * Returns the human readable string representation of the
-    * {@link org.xml.sax.Locator} part of the specified
-    * {@link SAXParseException}.
-    *
-    * @return  non-null valid object.
-    */
-    protected final String getLocationString( SAXParseException e ) {
-      if(e.getLineNumber()!=-1 || e.getSystemId()!=null) {
-          int line = e.getLineNumber();
-          return format("ConsoleErrorReporter.LineXOfY", line==-1?"?":Integer.toString( line ),
-              getShortName( e.getSystemId() ) );
-      } else {
-          return format("ConsoleErrorReporter.UnknownLocation");
-      }
+    private void print(String message, SAXParseException e) {
+        output.println(message);
+        output.println(getLocationString(e));
+        output.println();
     }
 
-    /** Computes a short name of a given URL for display. */
-    private String getShortName( String url ) {
-        if(url==null)
-            return format("ConsoleErrorReporter.UnknownLocation");
-        return url;
-    }
-
-    private String format( String property, Object... args ) {
-        String text = ResourceBundle.getBundle("com.sun.tools.internal.ws.resources.model").getString(property);
-        return MessageFormat.format(text,args);
+    public void enableDebugging(){
+        this.debug = true;
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java
index b85e021..880d63d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/JAXBModelBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,53 +24,45 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-
-import com.sun.tools.internal.xjc.api.ErrorListener;
-import com.sun.tools.internal.xjc.api.SchemaCompiler;
-import com.sun.tools.internal.xjc.api.XJC;
-import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.ModelInfo;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
 import com.sun.tools.internal.ws.processor.model.ModelException;
 import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
 import com.sun.tools.internal.ws.processor.model.java.JavaType;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBMapping;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBModel;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
 import com.sun.tools.internal.ws.processor.util.ClassNameCollector;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.parser.DOMForestScanner;
+import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder;
+import com.sun.tools.internal.xjc.api.S2JJAXBModel;
+import com.sun.tools.internal.xjc.api.SchemaCompiler;
+import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.namespace.QName;
 
 /**
- * @author Kathy Walsh, Vivek Pandey
+ * @author  Vivek Pandey
  *
  * Uses JAXB XJC apis to build JAXBModel and resolves xml to java type mapping from JAXBModel
  */
 public class JAXBModelBuilder {
-    public JAXBModelBuilder(ModelInfo modelInfo,
-                            Properties options, ClassNameCollector classNameCollector, List elements) {
-        _messageFactory =
-            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.model");
-        _modelInfo = modelInfo;
-        _env = (ProcessorEnvironment) modelInfo.getParent().getEnvironment();
-        _classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
 
-        printstacktrace = Boolean.valueOf(options.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
-        consoleErrorReporter = new ConsoleErrorReporter(_env, false);
-        internalBuildJAXBModel(elements);
+    private final ErrorReceiver errReceiver;
+    private final WsimportOptions options;
+    private final MetadataFinder forest;
+
+    public JAXBModelBuilder(WsimportOptions options, ClassNameCollector classNameCollector, MetadataFinder finder, ErrorReceiver errReceiver) {
+        this._classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
+        this.errReceiver = errReceiver;
+        this.options = options;
+        this.forest = finder;
+
+        internalBuildJAXBModel();
     }
 
     /**
@@ -80,22 +72,26 @@
      * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
      */
 
-    private void internalBuildJAXBModel(List elements){
+    private void internalBuildJAXBModel(){
         try {
-            schemaCompiler = XJC.createSchemaCompiler();
+            schemaCompiler =  options.getSchemaCompiler();
+            schemaCompiler.resetSchema();
+            schemaCompiler.setEntityResolver(options.entityResolver);
             schemaCompiler.setClassNameAllocator(_classNameAllocator);
-            schemaCompiler.setErrorListener(consoleErrorReporter);
-            schemaCompiler.setEntityResolver(_modelInfo.getEntityResolver());
+            schemaCompiler.setErrorListener(errReceiver);
             int schemaElementCount = 1;
-            for(Iterator iter = elements.iterator(); iter.hasNext();){
-                Element schemaElement = (Element)iter.next();
-                String location = schemaElement.getOwnerDocument().getDocumentURI();
-                String systemId = new String(location + "#types?schema"+schemaElementCount++);
-                schemaCompiler.parseSchema(systemId,schemaElement);
+
+            for (Element element : forest.getInlinedSchemaElement()) {
+                String location = element.getOwnerDocument().getDocumentURI();
+                String systemId = location + "#types?schema" + schemaElementCount++;
+                if(forest.isMexMetadata)
+                    schemaCompiler.parseSchema(systemId,element);
+                else
+                    new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
             }
 
             //feed external jaxb:bindings file
-            Set<InputSource> externalBindings = ((WSDLModelInfo)_modelInfo).getJAXBBindings();
+            InputSource[] externalBindings = options.getSchemaBindings();
             if(externalBindings != null){
                 for(InputSource jaxbBinding : externalBindings){
                     schemaCompiler.parseSchema(jaxbBinding);
@@ -109,27 +105,25 @@
     public JAXBType  getJAXBType(QName qname){
         JAXBMapping mapping = jaxbModel.get(qname);
         if (mapping == null){
-            fail("model.schema.elementNotFound", new Object[]{qname});
+            return null;
         }
-
         JavaType javaType = new JavaSimpleType(mapping.getType());
-        JAXBType type =  new JAXBType(qname, javaType, mapping, jaxbModel);
-        return type;
+        return new JAXBType(qname, javaType, mapping, jaxbModel);
     }
 
     public TypeAndAnnotation getElementTypeAndAnn(QName qname){
         JAXBMapping mapping = jaxbModel.get(qname);
         if (mapping == null){
-            fail("model.schema.elementNotFound", new Object[]{qname});
+            return null;
         }
         return mapping.getType().getTypeAnn();
     }
 
     protected void bind(){
-        com.sun.tools.internal.xjc.api.JAXBModel rawJaxbModel = schemaCompiler.bind();
-        if(consoleErrorReporter.hasError()){
-            throw new ModelException(consoleErrorReporter.getException());
-        }
+        S2JJAXBModel rawJaxbModel = schemaCompiler.bind();
+        if(rawJaxbModel == null)
+            throw new AbortException();
+        options.setCodeModel(rawJaxbModel.generateCode(null, errReceiver));
         jaxbModel = new JAXBModel(rawJaxbModel);
         jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
     }
@@ -138,32 +132,13 @@
         return schemaCompiler;
     }
 
-    protected void fail(String key, Object[] arg) {
-        throw new ModelException(key, arg);
-    }
-
-    protected void error(String key, Object[] args){
-        _env.error(_messageFactory.getMessage(key, args));
-    }
-
-    protected void warn(String key, Object[] args) {
-        _env.warn(_messageFactory.getMessage(key, args));
-    }
-
-    protected void inform(String key, Object[] args) {
-        _env.info(_messageFactory.getMessage(key, args));
-    }
-
     public JAXBModel getJAXBModel(){
         return jaxbModel;
     }
 
     private JAXBModel jaxbModel;
     private SchemaCompiler schemaCompiler;
-    private final LocalizableMessageFactory _messageFactory;
-    private final ModelInfo _modelInfo;
-    private final ProcessorEnvironment _env;
-    private final boolean printstacktrace;
     private final ClassNameAllocatorImpl _classNameAllocator;
-    private final ConsoleErrorReporter consoleErrorReporter;
+    protected static final LocatorImpl NULL_LOCATOR = new LocatorImpl();
+
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/MimeHelper.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/MimeHelper.java
index 80a17dc..bd66100 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/MimeHelper.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/MimeHelper.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,11 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
+import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
-
 /**
  * @author Vivek Pandey
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java
new file mode 100644
index 0000000..729dfb0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java
@@ -0,0 +1,263 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.processor.modeler.wsdl;
+
+import com.sun.tools.internal.ws.processor.model.AbstractType;
+import com.sun.tools.internal.ws.processor.model.Block;
+import com.sun.tools.internal.ws.processor.model.ModelProperties;
+import com.sun.tools.internal.ws.processor.model.Parameter;
+import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
+import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
+import com.sun.tools.internal.ws.processor.model.java.JavaStructureType;
+import com.sun.tools.internal.ws.processor.model.java.JavaType;
+import com.sun.tools.internal.ws.processor.model.jaxb.*;
+import com.sun.tools.internal.ws.resources.ModelerMessages;
+import com.sun.tools.internal.ws.util.ClassNameInfo;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiverFilter;
+import com.sun.tools.internal.ws.wsdl.document.Message;
+import com.sun.tools.internal.ws.wsdl.document.MessagePart;
+import com.sun.tools.internal.xjc.api.S2JJAXBModel;
+import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Utilities to be used by WSDLModeler
+ *
+ * @author Vivek Pandey
+ *
+ */
+class ModelerUtils {
+
+    /**
+     * This method should be called incase of wrapper style operations. This is
+     * equivalent to wrapper style schema component or JAXB Mapping object.
+     *
+     * @param jaxbType JAXBType from which a JAXBStructured type will be created.
+     * @return returns JAXBStructured type
+     */
+    public static JAXBStructuredType createJAXBStructureType(JAXBType jaxbType) {
+        JAXBStructuredType type = new JAXBStructuredType(jaxbType);
+        type.setName(jaxbType.getName());
+        type.setJavaType(jaxbType.getJavaType());
+        return type;
+    }
+
+    /**
+     * This method uses JAXBStructured type (wrapper style operations) and
+     * unwraps it to create list of parameters.
+     *
+     *
+     * @param jaxbType instance of JAXBType, could be JAXBStructured type.
+     * @param block The Block (body/Header/Attachment) to which the created Parameter belong.
+     * @return list of Parameters
+     */
+    public static List<Parameter> createUnwrappedParameters(JAXBType jaxbType,
+            Block block) {
+        List<Parameter> paramList = new ArrayList<Parameter>();
+        JAXBStructuredType type = null;
+        if (!(jaxbType instanceof JAXBStructuredType))
+            type = createJAXBStructureType(jaxbType);
+        else
+            type = (JAXBStructuredType) jaxbType;
+
+        JavaStructureType jst = new JavaStructureType(jaxbType.getJavaType()
+                .getRealName(), true, type);
+        type.setJavaType(jst);
+        block.setType(type);
+        List memberList = jaxbType.getWrapperChildren();
+        Iterator props = memberList.iterator();
+        while (props.hasNext()) {
+            JAXBProperty prop = (JAXBProperty) props.next();
+            paramList.add(createUnwrappedParameter(prop, jaxbType, block, type,
+                    jst));
+        }
+
+        return paramList;
+    }
+
+    /**
+     * @param prop
+     * @param jaxbType
+     * @param block
+     * @return
+     */
+    private static Parameter createUnwrappedParameter(JAXBProperty prop,
+            JAXBType jaxbType, Block block, JAXBStructuredType type,
+            JavaStructureType jst) {
+        QName elementName = prop.getElementName();
+        JavaType javaType = new JavaSimpleType(prop.getType());
+        JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
+        JavaStructureMember jsm = new JavaStructureMember(elementName
+                .getLocalPart(), javaType, eType);
+        eType.setJavaStructureMember(jsm);
+        jst.add(jsm);
+        eType.setProperty(prop);
+        type.add(eType);
+        JAXBType t = new JAXBType(elementName, javaType, jaxbType
+                .getJaxbMapping(), jaxbType.getJaxbModel());
+        t.setUnwrapped(true);
+        Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
+        parameter.setEmbedded(true);
+        return parameter;
+    }
+
+    public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver){
+        RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();
+
+        List<Parameter> parameters = new ArrayList<Parameter>();
+        for(MessagePart part : message.getParts()){
+            if(!ModelerUtils.isBoundToSOAPBody(part))
+                continue;
+            QName name = part.getDescriptor();
+            TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
+            if(typeAndAnn == null){
+                String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
+                errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(),
+                        part.getName(), msgQName));
+                throw new AbortException();
+            }
+            String type = typeAndAnn.getTypeClass().fullName();
+            type = ClassNameInfo.getGenericClass(type);
+            RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
+            JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
+            param.setJavaType(javaType);
+            rpcStruct.addRpcLitMember(param);
+            Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
+            parameter.setEmbedded(true);
+            parameters.add(parameter);
+        }
+        return parameters;
+    }
+
+    /**
+     * Called for non-wrapper style operations. It returns a Parameter constructed
+     * using the JAXBType and the Block.
+     *
+     * @param partName typically wsdl:part or any name to be given to the parameter
+     * @param jaxbType type of Parameter
+     * @param block Block to which the parameter belongs to
+     * @return Parameter created.
+     */
+    public static Parameter createParameter(String partName, AbstractType jaxbType,
+            Block block) {
+        Parameter parameter = new Parameter(partName, block.getEntity());
+        parameter.setProperty(ModelProperties.PROPERTY_PARAM_MESSAGE_PART_NAME,
+                partName);
+        parameter.setEmbedded(false);
+        parameter.setType(jaxbType);
+        parameter.setTypeName(jaxbType.getJavaType().getType().getName());
+        parameter.setBlock(block);
+        return parameter;
+    }
+
+    /**
+     * Get Parameter from the list of parameters.
+     *
+     * @param paramName
+     * @param parameters
+     * @return the Parameter with name paramName from parameters
+     */
+    public static Parameter getParameter(String paramName, List<Parameter> parameters){
+        if(parameters == null)
+            return null;
+        for(Parameter param: parameters){
+            //if(param.getName().equals("_return") && paramName.equals("return") || param.getName().equals(paramName)) {
+            if(param.getName().equals(paramName)){
+                return param;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Compares two JAXBStructures.
+     *
+     * @param struct1
+     * @param struct2
+     * @return true if struct1 and struct2 are equivalent.
+     */
+    public static boolean isEquivalentLiteralStructures(
+        JAXBStructuredType struct1,
+        JAXBStructuredType struct2) {
+        if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
+            return false;
+        Iterator members = struct1.getElementMembers();
+        JAXBElementMember member1;
+        JavaStructureMember javaMember1, javaMember2;
+        for (int i = 0; members.hasNext(); i++) {
+            member1 = (JAXBElementMember)members.next();
+            javaMember1 = member1.getJavaStructureMember();
+            javaMember2 =
+                ((JavaStructureType)struct2.getJavaType()).getMemberByName(
+                    member1.getJavaStructureMember().getName());
+            if (javaMember2.getConstructorPos() != i
+                || !javaMember1.getType().equals(javaMember2.getType())) {
+                return false;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @param part
+     * @return true if part is bound to Mime content
+     */
+    public static boolean isBoundToMimeContent(MessagePart part) {
+        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.WSDL_MIME_BINDING)
+            return true;
+        return false;
+    }
+
+    /**
+     * @param part
+     * @return true if part is bound to SOAPBody
+     */
+    public static boolean isBoundToSOAPBody(MessagePart part) {
+        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING)
+            return true;
+        return false;
+    }
+
+    /**
+     * @param part
+     * @return true if part is bound to SOAPHeader
+     */
+    public static boolean isBoundToSOAPHeader(MessagePart part) {
+        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_HEADER_BINDING)
+            return true;
+        return false;
+    }
+
+    public static boolean isUnbound(MessagePart part) {
+        if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.PART_NOT_BOUNDED)
+            return true;
+        return false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
index 33ab8c2..d095c7e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,70 +24,102 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import static com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModelerBase.*;
-import com.sun.tools.internal.ws.processor.config.ModelInfo;
-import com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModelerBase.ProcessSOAPOperationInfo;
+import com.sun.tools.internal.ws.processor.generator.Names;
+import static com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModelerBase.getExtensionOfType;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.*;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException;
-
+import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Binding;
+import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
 import org.xml.sax.InputSource;
 
 import javax.xml.namespace.QName;
+import java.io.ByteArrayInputStream;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import com.sun.tools.internal.ws.wsdl.document.MessagePart;
-import com.sun.tools.internal.ws.wsdl.document.Operation;
-import com.sun.tools.internal.ws.wsdl.document.Kinds;
-import com.sun.tools.internal.ws.wsdl.document.Message;
-import com.sun.tools.internal.ws.wsdl.document.PortType;
-import com.sun.tools.internal.ws.wsdl.document.Port;
-import com.sun.tools.internal.ws.wsdl.document.Service;
-import com.sun.tools.internal.ws.wsdl.document.WSDLDocument;
-import com.sun.tools.internal.ws.wsdl.document.Binding;
-import com.sun.tools.internal.ws.wsdl.document.BindingOperation;
-import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
-import com.sun.tools.internal.ws.wsdl.document.soap.*;
-
+import java.util.*;
 
 
 /**
- * @author Vivek Pandey
- *
  * Builds all possible pseudo schemas for async operation ResponseBean to feed to XJC.
+ *
+ * @author Vivek Pandey
  */
 public class PseudoSchemaBuilder {
 
     private final StringWriter buf = new StringWriter();
     private final WSDLDocument wsdlDocument;
-    private final ModelInfo modelInfo;
     private WSDLModeler wsdlModeler;
     private final List<InputSource> schemas = new ArrayList<InputSource>();
     private final HashMap<QName, Port> bindingNameToPortMap = new HashMap<QName, Port>();
+    private static final String w3ceprSchemaBinding = "<bindings\n" +
+            "  xmlns=\"http://java.sun.com/xml/ns/jaxb\"\n" +
+            "  xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"\n" +
+            "  version=\"2.1\">\n" +
+            "  \n" +
+            "  <bindings scd=\"x-schema::wsa\" if-exists=\"true\">\n" +
+            "    <schemaBindings map=\"false\" />\n" +
+            "    <bindings scd=\"wsa:EndpointReference\">\n" +
+            "      <class ref=\"javax.xml.ws.wsaddressing.W3CEndpointReference\"/>\n" +
+            "    </bindings>\n" +
+            "    <bindings scd=\"~wsa:EndpointReferenceType\">\n" +
+            "      <class ref=\"javax.xml.ws.wsaddressing.W3CEndpointReference\"/>\n" +
+            "    </bindings>\n" +
+            "  </bindings>\n" +
+            "</bindings>";
 
-    public static List<InputSource> build(WSDLModeler wsdlModeler, ModelInfo modelInfo) {
-        PseudoSchemaBuilder b = new PseudoSchemaBuilder(wsdlModeler.document, modelInfo);
+    private static final String memberSubmissionEPR = "<bindings\n" +
+            "  xmlns=\"http://java.sun.com/xml/ns/jaxb\"\n" +
+            "  xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"\n" +
+            "  version=\"2.1\">\n" +
+            "  \n" +
+            "  <bindings scd=\"x-schema::wsa\" if-exists=\"true\">\n" +
+            "    <schemaBindings map=\"false\" />\n" +
+            "    <bindings scd=\"wsa:EndpointReference\">\n" +
+            "      <class ref=\"com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference\"/>\n" +
+            "    </bindings>\n" +
+            "    <bindings scd=\"~wsa:EndpointReferenceType\">\n" +
+            "      <class ref=\"com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference\"/>\n" +
+            "    </bindings>\n" +
+            "  </bindings>\n" +
+            "</bindings>";
+
+    private final static String sysId = "http://dummy.pseudo-schema#schema";
+
+    private WsimportOptions options;
+    public static List<InputSource> build(WSDLModeler wsdlModeler, WsimportOptions options, ErrorReceiver errReceiver) {
+        PseudoSchemaBuilder b = new PseudoSchemaBuilder(wsdlModeler.document);
         b.wsdlModeler = wsdlModeler;
-        JAXBModelBuilder analyzer = wsdlModeler.getJAXBModelBuilder();
+        b.options = options;
         b.build();
-        for(int i = 0; i < b.schemas.size(); i++){
+        int i;
+        for(i = 0; i < b.schemas.size(); i++){
             InputSource is = b.schemas.get(i);
-            is.setSystemId("http://dummy.pseudo-schema#schema"+(i+1));
+            is.setSystemId(sysId+(i + 1));
         }
+        //add w3c EPR binding
+        if(!(options.noAddressingBbinding && options.isExtensionMode())){
+            InputSource is = new InputSource(new ByteArrayInputStream(w3ceprSchemaBinding.getBytes()));
+            is.setSystemId(sysId+(++i +1));
+            b.schemas.add(is);
+        }
+
+
+        //TODO: uncomment after JAXB fixes the issue related to passing multiples of such bindings
+        //add member submission EPR binding
+//        InputSource is1 = new InputSource(new ByteArrayInputStream(memberSubmissionEPR.getBytes()));
+//        is1.setSystemId(sysId+(++i + 1));
+//        b.schemas.add(is1);
+
         return b.schemas;
     }
 
-    private PseudoSchemaBuilder(WSDLDocument _wsdl, ModelInfo _modelInfo) {
+
+    private PseudoSchemaBuilder(WSDLDocument _wsdl) {
         this.wsdlDocument = _wsdl;
-        this.modelInfo = _modelInfo;
     }
 
     private void build() {
@@ -128,9 +160,6 @@
 
         for(Iterator itr=binding.operations(); itr.hasNext();){
             BindingOperation bindingOperation = (BindingOperation)itr.next();
-            SOAPOperation soapOperation =
-            (SOAPOperation)getExtensionOfType(bindingOperation,
-                SOAPOperation.class);
 
             // get only the bounded operations
             Set boundedOps = portType.getOperationsNamed(bindingOperation.getName());
@@ -139,8 +168,6 @@
             Operation operation = (Operation)boundedOps.iterator().next();
 
             // No pseudo schema required for doc/lit
-            SOAPStyle bindingStyle = soapBinding.getStyle();
-            SOAPStyle operationStyle = (soapOperation != null) ? soapOperation.getStyle() : bindingStyle;
             if(wsdlModeler.isAsync(portType, operation)){
                 buildAsync(portType, operation, bindingOperation);
             }
@@ -162,7 +189,7 @@
         if(outputMessage != null){
             List<MessagePart> allParts = new ArrayList<MessagePart>(outputMessage.getParts());
             if(allParts.size() > 1)
-                build(getOperationName(portType, operationName, bindingOperation.getOutput()), allParts);
+                build(getOperationName(operationName), allParts);
         }
 
     }
@@ -171,7 +198,7 @@
         JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(operation, JAXWSBinding.class);
         String operationName = (jaxwsCustomization != null)?((jaxwsCustomization.getMethodName() != null)?jaxwsCustomization.getMethodName().getName():null):null;
         if(operationName != null){
-            if(wsdlModeler.getEnvironment().getNames().isJavaReservedWord(operationName)){
+            if(Names.isJavaReservedWord(operationName)){
                 return null;
             }
 
@@ -199,12 +226,9 @@
                 "           xmlns:jaxb=''http://java.sun.com/xml/ns/jaxb''" +
                 "           xmlns:xjc=''http://java.sun.com/xml/ns/jaxb/xjc''" +
                 "           jaxb:extensionBindingPrefixes=''xjc''" +
-                "           jaxb:version=''1.0''");
-        if((elementName != null) && elementName.getNamespaceURI().length() > 0){
-            print("           targetNamespace=''{0}''>", elementName.getNamespaceURI());
-        }else{
-            print("           >");
-        }
+                "           jaxb:version=''1.0''" +
+                "           targetNamespace=''{0}''>",
+                elementName.getNamespaceURI());
 
         writeImports(elementName, allParts);
 
@@ -243,14 +267,14 @@
 
         // reset the StringWriter, so that next operation element could be written
         if(buf.toString().length() > 0){
-//            System.out.println("Response bean Schema for operation========> "+ elementName+"\n\n"+buf);
+            //System.out.println("Response bean Schema for operation========> "+ elementName+"\n\n"+buf);
             InputSource is = new InputSource(new StringReader(buf.toString()));
             schemas.add(is);
             buf.getBuffer().setLength(0);
         }
     }
 
-    private QName getOperationName(PortType portType, String operationName, Extensible binding){
+    private QName getOperationName(String operationName){
         if(operationName == null)
             return null;
 //        String namespaceURI = wsdlDocument.getDefinitions().getTargetNamespaceURI()+"?"+portType.getName()+"?" + operationName;
@@ -275,6 +299,4 @@
         buf.write('\n');
     }
 
-    private static final Set<QName> nspaceToPackageSchema = new HashSet<QName>();
-    private static int  schemaCounter;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java
index 1070438..15ea18e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,96 +24,46 @@
  */
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.generator.GeneratorConstants;
-import com.sun.tools.internal.ws.processor.model.AsyncOperation;
-import com.sun.tools.internal.ws.processor.model.AsyncOperationType;
-import com.sun.tools.internal.ws.processor.model.Block;
+import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.processor.generator.Names;
+import com.sun.tools.internal.ws.processor.model.*;
 import com.sun.tools.internal.ws.processor.model.Fault;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.ModelException;
-import com.sun.tools.internal.ws.processor.model.ModelObject;
-import com.sun.tools.internal.ws.processor.model.ModelProperties;
 import com.sun.tools.internal.ws.processor.model.Operation;
-import com.sun.tools.internal.ws.processor.model.Parameter;
 import com.sun.tools.internal.ws.processor.model.Port;
-import com.sun.tools.internal.ws.processor.model.Request;
-import com.sun.tools.internal.ws.processor.model.Response;
 import com.sun.tools.internal.ws.processor.model.Service;
-import com.sun.tools.internal.ws.processor.model.java.JavaException;
-import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.tools.internal.ws.processor.model.java.JavaMethod;
-import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
-import com.sun.tools.internal.ws.processor.model.java.JavaSimpleType;
-import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
-import com.sun.tools.internal.ws.processor.model.java.JavaType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBElementMember;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBProperty;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBStructuredType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
-import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitMember;
-import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
+import com.sun.tools.internal.ws.processor.model.java.*;
+import com.sun.tools.internal.ws.processor.model.jaxb.*;
 import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
-import com.sun.tools.internal.ws.processor.modeler.ModelerException;
-import com.sun.tools.internal.ws.processor.modeler.ModelerUtils;
 import com.sun.tools.internal.ws.processor.util.ClassNameCollector;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.wsdl.document.Binding;
-import com.sun.tools.internal.ws.wsdl.document.BindingFault;
-import com.sun.tools.internal.ws.wsdl.document.BindingOperation;
-import com.sun.tools.internal.ws.wsdl.document.Documentation;
-import com.sun.tools.internal.ws.wsdl.document.Kinds;
+import com.sun.tools.internal.ws.resources.ModelerMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.*;
 import com.sun.tools.internal.ws.wsdl.document.Message;
-import com.sun.tools.internal.ws.wsdl.document.MessagePart;
-import com.sun.tools.internal.ws.wsdl.document.OperationStyle;
-import com.sun.tools.internal.ws.wsdl.document.PortType;
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.tools.internal.ws.wsdl.document.WSDLDocument;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.CustomName;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
 import com.sun.tools.internal.ws.wsdl.document.mime.MIMEContent;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Binding;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Constants;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPAddress;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBody;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPConstants;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPFault;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPHeader;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPOperation;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException;
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-import com.sun.tools.internal.ws.wsdl.framework.ParserListener;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-import com.sun.tools.internal.ws.wsdl.parser.SOAPEntityReferenceValidator;
+import com.sun.tools.internal.ws.wsdl.document.soap.*;
+import com.sun.tools.internal.ws.wsdl.framework.*;
 import com.sun.tools.internal.ws.wsdl.parser.WSDLParser;
 import com.sun.tools.internal.xjc.api.S2JJAXBModel;
 import com.sun.tools.internal.xjc.api.TypeAndAnnotation;
 import com.sun.tools.internal.xjc.api.XJC;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
-import com.sun.xml.internal.ws.model.Mode;
 import com.sun.xml.internal.ws.util.xml.XmlUtil;
 import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.LocatorImpl;
 
+import javax.jws.WebParam.Mode;
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
+import java.util.*;
+import java.io.IOException;
 
 
 /**
@@ -127,111 +77,111 @@
     private final Map<QName, QName> uniqueBodyBlocks = new HashMap<QName, QName>();
     private final QName VOID_BODYBLOCK = new QName("");
     private ClassNameCollector classNameCollector;
-    private boolean extensions = false;
-    protected enum StyleAndUse  {RPC_LITERAL, DOC_LITERAL};
-    private ModelerUtils modelerUtils;
-    private JAXBModelBuilder jaxbModelBuilder;
+    private final String explicitDefaultPackage;
 
-    /**
-     * @param modelInfo
-     * @param options
-     */
-    public WSDLModeler(WSDLModelInfo modelInfo, Properties options) {
-        super(modelInfo, options);
-        classNameCollector = new ClassNameCollector();
+    public WSDLModeler(WsimportOptions options, ErrorReceiver receiver) {
+        super(options, receiver);
+        this.classNameCollector = new ClassNameCollector();
+        this.explicitDefaultPackage = options.defaultPackage;
     }
 
+
+    protected enum StyleAndUse {
+        RPC_LITERAL, DOC_LITERAL
+    }
+
+    private JAXBModelBuilder jaxbModelBuilder;
+
     public Model buildModel() {
         try {
 
-            parser = new WSDLParser(_modelInfo);
+            parser = new WSDLParser(options, errReceiver);
             parser.addParserListener(new ParserListener() {
-                public void ignoringExtension(QName name, QName parent) {
+                public void ignoringExtension(Entity entity, QName name, QName parent) {
                     if (parent.equals(WSDLConstants.QNAME_TYPES)) {
                         // check for a schema element with the wrong namespace URI
                         if (name.getLocalPart().equals("schema")
-                            && !name.getNamespaceURI().equals("")) {
-                            warn(
-                                "wsdlmodeler.warning.ignoringUnrecognizedSchemaExtension",
-                                name.getNamespaceURI());
+                                && !name.getNamespaceURI().equals("")) {
+                            warning(entity, ModelerMessages.WSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(name.getNamespaceURI()));
                         }
                     }
+
                 }
+
                 public void doneParsingEntity(QName element, Entity entity) {
                 }
             });
-            hSet = parser.getUse();
 
-            extensions = Boolean.valueOf(_options.getProperty(ProcessorOptions.EXTENSION));
+            document = parser.parse();
+            if (document == null || document.getDefinitions() == null)
+                return null;
 
-            useWSIBasicProfile = !extensions;
-            document =
-                parser.parse();
             document.validateLocally();
-
-            boolean validateWSDL =
-                Boolean
-                    .valueOf(
-                        _options.getProperty(
-                            ProcessorOptions.VALIDATE_WSDL_PROPERTY))
-                    .booleanValue();
-            if (validateWSDL) {
-                document.validate(new SOAPEntityReferenceValidator());
-            }
-
+            forest = parser.getDOMForest();
 
             Model model = internalBuildModel(document);
+            if(model == null || errReceiver.hadError())
+                return null;
             //ClassNameCollector classNameCollector = new ClassNameCollector();
             classNameCollector.process(model);
             if (classNameCollector.getConflictingClassNames().isEmpty()) {
+                if(errReceiver.hadError())
+                    return null;
                 return model;
             }
             // do another pass, this time with conflict resolution enabled
             model = internalBuildModel(document);
+
             classNameCollector.process(model);
             if (classNameCollector.getConflictingClassNames().isEmpty()) {
                 // we're done
+                if(errReceiver.hadError())
+                    return null;
                 return model;
             }
             // give up
             StringBuffer conflictList = new StringBuffer();
             boolean first = true;
             for (Iterator iter =
-                classNameCollector.getConflictingClassNames().iterator();
-                iter.hasNext();
-                ) {
+                    classNameCollector.getConflictingClassNames().iterator();
+                 iter.hasNext();
+                    ) {
                 if (!first) {
                     conflictList.append(", ");
                 } else {
                     first = false;
                 }
-                conflictList.append((String)iter.next());
+                conflictList.append((String) iter.next());
             }
-            throw new ModelerException(
-                "wsdlmodeler.unsolvableNamingConflicts",
-                conflictList.toString());
-
+            error(document.getDefinitions(), ModelerMessages.WSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(conflictList.toString()));
         } catch (ModelException e) {
-            throw new ModelerException((Exception)e);
+            reportError(document.getDefinitions(), e.getMessage(), e);
         } catch (ParseException e) {
-            throw new ModelerException((Exception)e);
+            errReceiver.error(e);
         } catch (ValidationException e) {
-            throw new ModelerException((Exception)e);
+            errReceiver.error(e.getMessage(), e);
+        } catch (SAXException e) {
+            errReceiver.error(e);
+        } catch (IOException e) {
+            errReceiver.error(e);
         }
+        //should never reach here
+        return null;
     }
 
     private Model internalBuildModel(WSDLDocument document) {
+        numPasses++;
 
         //build the jaxbModel to be used latter
-        buildJAXBModel(document, _modelInfo, classNameCollector);
+        buildJAXBModel(document);
 
         QName modelName =
-            new QName(
-                document.getDefinitions().getTargetNamespaceURI(),
-                document.getDefinitions().getName() == null
-                    ? "model"
-                    : document.getDefinitions().getName());
-        Model model = new Model(modelName);
+                new QName(
+                        document.getDefinitions().getTargetNamespaceURI(),
+                        document.getDefinitions().getName() == null
+                                ? "model"
+                                : document.getDefinitions().getName());
+        Model model = new Model(modelName, document.getDefinitions());
         model.setJAXBModel(getJAXBModelBuilder().getJAXBModel());
 
         // This fails with the changed classname (WSDLModeler to WSDLModeler11 etc.)
@@ -239,37 +189,36 @@
         // modeler class name to the same one being checked in WSDLGenerator.
 
         model.setProperty(
-            ModelProperties.PROPERTY_MODELER_NAME,
-            ModelProperties.WSDL_MODELER_NAME);
+                ModelProperties.PROPERTY_MODELER_NAME,
+                ModelProperties.WSDL_MODELER_NAME);
 
         _javaTypes = new JavaSimpleTypeCreator();
-        _javaExceptions = new HashMap();
-        _bindingNameToPortMap = new HashMap();
+        _javaExceptions = new HashMap<String, JavaException>();
+        _bindingNameToPortMap = new HashMap<QName, Port>();
 
         // grab target namespace
         model.setTargetNamespaceURI(document.getDefinitions().getTargetNamespaceURI());
 
         setDocumentationIfPresent(model,
-            document.getDefinitions().getDocumentation());
+                document.getDefinitions().getDocumentation());
 
         boolean hasServices = document.getDefinitions().services().hasNext();
         if (hasServices) {
             for (Iterator iter = document.getDefinitions().services();
-                iter.hasNext();
-                ) {
-                processService((com.sun.tools.internal.ws.wsdl.document.Service)iter.next(),
-                                model, document);
+                 iter.hasNext();
+                    ) {
+                processService((com.sun.tools.internal.ws.wsdl.document.Service) iter.next(),
+                        model, document);
                 hasServices = true;
             }
         } else {
             // emit a warning if there are no service definitions
-            warn("wsdlmodeler.warning.noServiceDefinitionsFound");
+            warning(model.getEntity(), ModelerMessages.WSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND());
         }
 
         return model;
     }
 
-
     /* (non-Javadoc)
      * @see WSDLModelerBase#processService(Service, Model, WSDLDocument)
      */
@@ -281,71 +230,75 @@
             serviceInterface += "_Service";
         }
         Service service =
-            new Service(
-                serviceQName,
-                new JavaInterface(serviceInterface, serviceInterface + "Impl"));
+                new Service(
+                        serviceQName,
+                        new JavaInterface(serviceInterface, serviceInterface + "Impl"), wsdlService);
 
         setDocumentationIfPresent(service, wsdlService.getDocumentation());
         boolean hasPorts = false;
         for (Iterator iter = wsdlService.ports(); iter.hasNext();) {
             boolean processed =
-                processPort(
-                    (com.sun.tools.internal.ws.wsdl.document.Port)iter.next(),
-                    service,
-                    document);
+                    processPort(
+                            (com.sun.tools.internal.ws.wsdl.document.Port) iter.next(),
+                            service,
+                            document);
             hasPorts = hasPorts || processed;
         }
         if (!hasPorts) {
             // emit a warning if there are no ports
-            warn("wsdlmodeler.warning.noPortsInService", wsdlService.getName());
-        }else{
+            warning(wsdlService, ModelerMessages.WSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(wsdlService.getName()));
+        } else {
             model.addService(service);
         }
     }
 
     /* (non-Javadoc)
-     * @see WSDLModelerBase#processPort(Port, Service, WSDLDocument)
+     * @see WSDLModelerBase#processPort(WSDLPort, Service, WSDLDocument)
      */
     protected boolean processPort(com.sun.tools.internal.ws.wsdl.document.Port wsdlPort,
-            Service service, WSDLDocument document) {
+                                  Service service, WSDLDocument document) {
         try {
 
             //clear the  unique block map
             uniqueBodyBlocks.clear();
 
             QName portQName = getQNameOf(wsdlPort);
-            Port port = new Port(portQName);
+            Port port = new Port(portQName, wsdlPort);
 
             setDocumentationIfPresent(port, wsdlPort.getDocumentation());
 
             SOAPAddress soapAddress =
-                (SOAPAddress)getExtensionOfType(wsdlPort, SOAPAddress.class);
+                    (SOAPAddress) getExtensionOfType(wsdlPort, SOAPAddress.class);
             if (soapAddress == null) {
-                // not a SOAP port, ignore it
-                warn("wsdlmodeler.warning.ignoringNonSOAPPort.noAddress", wsdlPort.getName());
-                return false;
+                if(options.isExtensionMode()){
+                    warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_NO_SOAP_ADDRESS(wsdlPort.getName()));
+                }else{
+                    // not a SOAP port, ignore it
+                    warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(wsdlPort.getName()));
+                    return false;
+                }
             }
-
-            port.setAddress(soapAddress.getLocation());
+            if(soapAddress != null)
+                port.setAddress(soapAddress.getLocation());
             Binding binding = wsdlPort.resolveBinding(document);
             QName bindingName = getQNameOf(binding);
             PortType portType = binding.resolvePortType(document);
 
             port.setProperty(
-                ModelProperties.PROPERTY_WSDL_PORT_NAME,
-                getQNameOf(wsdlPort));
+                    ModelProperties.PROPERTY_WSDL_PORT_NAME,
+                    getQNameOf(wsdlPort));
             port.setProperty(
-                ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME,
-                getQNameOf(portType));
+                    ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME,
+                    getQNameOf(portType));
             port.setProperty(
-                ModelProperties.PROPERTY_WSDL_BINDING_NAME,
-                bindingName);
+                    ModelProperties.PROPERTY_WSDL_BINDING_NAME,
+                    bindingName);
 
             boolean isProvider = isProvider(wsdlPort);
             if (_bindingNameToPortMap.containsKey(bindingName) && !isProvider) {
                 // this binding has been processed before
                 Port existingPort =
-                    _bindingNameToPortMap.get(bindingName);
+                        _bindingNameToPortMap.get(bindingName);
                 port.setOperations(existingPort.getOperations());
                 port.setJavaInterface(existingPort.getJavaInterface());
                 port.setStyle(existingPort.getStyle());
@@ -353,59 +306,62 @@
             } else {
                 // find out the SOAP binding extension, if any
                 SOAPBinding soapBinding =
-                    (SOAPBinding)getExtensionOfType(binding, SOAPBinding.class);
+                        (SOAPBinding) getExtensionOfType(binding, SOAPBinding.class);
 
                 if (soapBinding == null) {
                     soapBinding =
-                            (SOAPBinding)getExtensionOfType(binding, SOAP12Binding.class);
+                            (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class);
                     if (soapBinding == null) {
-                        // cannot deal with non-SOAP ports
-                        warn(
-                            "wsdlmodeler.warning.ignoringNonSOAPPort",
-                            wsdlPort.getName());
-                        return false;
-                    }
-                    // we can only do soap1.2 if extensions are on
-                    if (extensions) {
-                        warn("wsdlmodeler.warning.port.SOAPBinding12", wsdlPort.getName());
-                    } else {
-                        warn("wsdlmodeler.warning.ignoringSOAPBinding12",
-                                wsdlPort.getName());
-                        return false;
+                        if(!options.isExtensionMode()){
+                            // cannot deal with non-SOAP ports
+                            warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(wsdlPort.getName()));
+                            return false;
+                        }else{
+                            warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_NON_SOAP_PORT(wsdlPort.getName()));
+                        }
+                    }else{
+                        // we can only do soap1.2 if extensions are on
+                        if (options.isExtensionMode()) {
+                            warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_PORT_SOAP_BINDING_12(wsdlPort.getName()));
+                        } else {
+                            warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(wsdlPort.getName()));
+                            return false;
+                        }
                     }
                 }
 
-                if (soapBinding.getTransport() == null
-                    || (!soapBinding.getTransport().equals(
+                if (soapBinding != null  && (soapBinding.getTransport() == null
+                        || (!soapBinding.getTransport().equals(
                         SOAPConstants.URI_SOAP_TRANSPORT_HTTP) && !soapBinding.getTransport().equals(
-                        SOAP12Constants.URI_SOAP_TRANSPORT_HTTP))) {
-                    // cannot deal with non-HTTP ports
-                    warn(
-                        "wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport",
-                        wsdlPort.getName());
-                    return false;
+                        SOAP12Constants.URI_SOAP_TRANSPORT_HTTP)))) {
+                    warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(wsdlPort.getName()));
+                    if (!options.isExtensionMode()) {
+                        // cannot deal with non-HTTP ports
+                        return false;
+                    }
                 }
 
                 /**
                  * validate wsdl:binding uniqueness in style, e.g. rpclit or doclit
                  * ref: WSI BP 1.1 R 2705
                  */
-                if(!validateWSDLBindingStyle(binding)){
-                    if(extensions){
-                        warn("wsdlmodeler.warning.port.SOAPBinding.mixedStyle", wsdlPort.getName());
-                    }else{
-                        fail("wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle",
-                                wsdlPort.getName());
-                        return false;
+                if (soapBinding != null && !validateWSDLBindingStyle(binding)) {
+                    if (options.isExtensionMode()) {
+                        warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(wsdlPort.getName()));
+                    } else {
+                        error(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(wsdlPort.getName()));
                     }
                 }
 
-                port.setStyle(soapBinding.getStyle());
+                if(soapBinding != null){
+                    port.setStyle(soapBinding.getStyle());
+                }
+
                 boolean hasOverloadedOperations = false;
                 Set<String> operationNames = new HashSet<String>();
                 for (Iterator iter = portType.operations(); iter.hasNext();) {
                     com.sun.tools.internal.ws.wsdl.document.Operation operation =
-                        (com.sun.tools.internal.ws.wsdl.document.Operation)iter.next();
+                            (com.sun.tools.internal.ws.wsdl.document.Operation) iter.next();
 
                     if (operationNames.contains(operation.getName())) {
                         hasOverloadedOperations = true;
@@ -414,20 +370,16 @@
                     operationNames.add(operation.getName());
 
                     for (Iterator itr = binding.operations();
-                        iter.hasNext();
-                        ) {
+                         iter.hasNext();
+                            ) {
                         BindingOperation bindingOperation =
-                            (BindingOperation)itr.next();
+                                (BindingOperation) itr.next();
                         if (operation
-                            .getName()
-                            .equals(bindingOperation.getName())) {
+                                .getName()
+                                .equals(bindingOperation.getName())) {
                             break;
                         } else if (!itr.hasNext()) {
-                            throw new ModelerException(
-                                "wsdlmodeler.invalid.bindingOperation.notFound",
-                                new Object[] {
-                                    operation.getName(),
-                                    binding.getName()});
+                            error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(operation.getName(), bindingOperation.getName()));
                         }
                     }
                 }
@@ -436,65 +388,49 @@
                 boolean hasOperations = false;
                 for (Iterator iter = binding.operations(); iter.hasNext();) {
                     BindingOperation bindingOperation =
-                        (BindingOperation)iter.next();
+                            (BindingOperation) iter.next();
 
                     com.sun.tools.internal.ws.wsdl.document.Operation portTypeOperation =
-                        null;
+                            null;
                     Set operations =
-                        portType.getOperationsNamed(bindingOperation.getName());
+                            portType.getOperationsNamed(bindingOperation.getName());
                     if (operations.size() == 0) {
                         // the WSDL document is invalid
-                        throw new ModelerException(
-                            "wsdlmodeler.invalid.bindingOperation.notInPortType",
-                            new Object[] {
-                                bindingOperation.getName(),
-                                binding.getName()});
+                        error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(bindingOperation.getName(), binding.getName()));
                     } else if (operations.size() == 1) {
                         portTypeOperation =
-                            (com.sun.tools.internal.ws.wsdl.document.Operation)operations
-                                .iterator()
-                                .next();
+                                (com.sun.tools.internal.ws.wsdl.document.Operation) operations
+                                        .iterator()
+                                        .next();
                     } else {
                         boolean found = false;
                         String expectedInputName =
-                            bindingOperation.getInput().getName();
+                                bindingOperation.getInput().getName();
                         String expectedOutputName =
-                            bindingOperation.getOutput().getName();
+                                bindingOperation.getOutput().getName();
 
-                        for (Iterator iter2 = operations.iterator();iter2.hasNext();) {
+                        for (Iterator iter2 = operations.iterator(); iter2.hasNext();) {
                             com.sun.tools.internal.ws.wsdl.document.Operation candidateOperation =
-                                (com.sun.tools.internal.ws.wsdl.document.Operation)iter2
-                                    .next();
+                                    (com.sun.tools.internal.ws.wsdl.document.Operation) iter2
+                                            .next();
 
                             if (expectedInputName == null) {
                                 // the WSDL document is invalid
-                                throw new ModelerException(
-                                    "wsdlmodeler.invalid.bindingOperation.missingInputName",
-                                    new Object[] {
-                                        bindingOperation.getName(),
-                                        binding.getName()});
+                                error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(bindingOperation.getName()));
                             }
                             if (expectedOutputName == null) {
                                 // the WSDL document is invalid
-                                throw new ModelerException(
-                                    "wsdlmodeler.invalid.bindingOperation.missingOutputName",
-                                    new Object[] {
-                                        bindingOperation.getName(),
-                                        binding.getName()});
+                                error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(bindingOperation.getName()));
                             }
                             if (expectedInputName
-                                .equals(candidateOperation.getInput().getName())
-                                && expectedOutputName.equals(
+                                    .equals(candidateOperation.getInput().getName())
+                                    && expectedOutputName.equals(
                                     candidateOperation
-                                        .getOutput()
-                                        .getName())) {
+                                            .getOutput()
+                                            .getName())) {
                                 if (found) {
                                     // the WSDL document is invalid
-                                    throw new ModelerException(
-                                        "wsdlmodeler.invalid.bindingOperation.multipleMatchingOperations",
-                                        new Object[] {
-                                            bindingOperation.getName(),
-                                            binding.getName()});
+                                    error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(bindingOperation.getName(), bindingOperation.getName()));
                                 }
                                 // got it!
                                 found = true;
@@ -503,26 +439,28 @@
                         }
                         if (!found) {
                             // the WSDL document is invalid
-                            throw new ModelerException(
-                                "wsdlmodeler.invalid.bindingOperation.notFound",
-                                new Object[] {
-                                    bindingOperation.getName(),
-                                    binding.getName()});
+                            error(bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(bindingOperation.getName(), binding.getName()));
                         }
                     }
-                    if(!isProvider){
+                    if (!isProvider) {
                         this.info =
-                            new ProcessSOAPOperationInfo(
-                                port,
-                                wsdlPort,
-                                portTypeOperation,
-                                bindingOperation,
-                                soapBinding,
-                                document,
-                                hasOverloadedOperations,
-                                headers);
+                                new ProcessSOAPOperationInfo(
+                                        port,
+                                        wsdlPort,
+                                        portTypeOperation,
+                                        bindingOperation,
+                                        soapBinding,
+                                        document,
+                                        hasOverloadedOperations,
+                                        headers);
 
-                        Operation operation = processSOAPOperation();
+
+                        Operation operation;
+                        if(soapBinding != null)
+                            operation = processSOAPOperation();
+                        else{
+                            operation = processNonSOAPOperation();
+                        }
                         if (operation != null) {
                             port.addOperation(operation);
                             hasOperations = true;
@@ -531,23 +469,16 @@
                 }
                 if (!isProvider && !hasOperations) {
                     // emit a warning if there are no operations, except when its a provider port
-                    warn("wsdlmodeler.warning.noOperationsInPort",
-                        wsdlPort.getName());
+                    warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(wsdlPort.getName()));
                     return false;
                 }
                 createJavaInterfaceForPort(port, isProvider);
                 PortType pt = binding.resolvePortType(document);
-                String jd = (pt.getDocumentation() != null)?pt.getDocumentation().getContent():null;
+                String jd = (pt.getDocumentation() != null) ? pt.getDocumentation().getContent() : null;
                 port.getJavaInterface().setJavaDoc(jd);
                 _bindingNameToPortMap.put(bindingName, port);
             }
 
-            // now deal with the configured handlers
-            port.setClientHandlerChainInfo(
-                _modelInfo.getClientHandlerChainInfo());
-            port.setServerHandlerChainInfo(
-                _modelInfo.getServerHandlerChainInfo());
-
             service.addPort(port);
             applyPortMethodCustomization(port, wsdlPort);
             applyWrapperStyleCustomization(port, binding.resolvePortType(document));
@@ -555,43 +486,169 @@
             return true;
 
         } catch (NoSuchEntityException e) {
-            warn(e);
+            warning(document.getDefinitions(), e.getMessage());
             // should not happen
             return false;
         }
     }
 
+    /**
+     * Returns an operation purely from abstract operation
+     */
+    private Operation processNonSOAPOperation() {
+        Operation operation =
+                new Operation(new QName(null, info.bindingOperation.getName()), info.bindingOperation);
+
+        setDocumentationIfPresent(
+                operation,
+                info.portTypeOperation.getDocumentation());
+
+        if (info.portTypeOperation.getStyle()
+                != OperationStyle.REQUEST_RESPONSE
+                && info.portTypeOperation.getStyle() != OperationStyle.ONE_WAY) {
+            if (options.isExtensionMode()) {
+                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName()));
+                return null;
+            } else {
+                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName(),
+                        info.port.resolveBinding(document).resolvePortType(document).getName()));
+            }
+        }
+
+        boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
+        Message inputMessage = getInputMessage();
+        Request request = new Request(inputMessage, errReceiver);
+        request.setErrorReceiver(errReceiver);
+        info.operation = operation;
+        info.operation.setWSDLPortTypeOperation(info.portTypeOperation);
+
+        Response response = null;
+
+        Message outputMessage = null;
+        if (isRequestResponse) {
+            outputMessage = getOutputMessage();
+            response = new Response(outputMessage, errReceiver);
+        }else{
+            response = new Response(null, errReceiver);
+        }
+
+        //set the style based on heuristic that message has either all parts defined
+        // using type(RPC) or element(DOCUMENT)
+        setNonSoapStyle(inputMessage, outputMessage);
+
+        // Process parameterOrder and get the parameterList
+        List<MessagePart> parameterList = getParameterOrder();
+
+        List<Parameter> params = null;
+        boolean unwrappable = isUnwrappable();
+        info.operation.setWrapped(unwrappable);
+            params = getDoclitParameters(request, response, parameterList);
+        if (!validateParameterName(params)) {
+            return null;
+        }
+
+        // create a definitive list of parameters to match what we'd like to get
+        // in the java interface (which is generated much later), parameterOrder
+        List<Parameter> definitiveParameterList = new ArrayList<Parameter>();
+        for (Parameter param : params) {
+            if (param.isReturn()) {
+                info.operation.setProperty(WSDL_RESULT_PARAMETER, param);
+                response.addParameter(param);
+                continue;
+            }
+            if (param.isIN()) {
+                request.addParameter(param);
+            } else if (param.isOUT()) {
+                response.addParameter(param);
+            } else if (param.isINOUT()) {
+                request.addParameter(param);
+                response.addParameter(param);
+            }
+            definitiveParameterList.add(param);
+        }
+
+        info.operation.setRequest(request);
+
+        if (isRequestResponse) {
+            info.operation.setResponse(response);
+        }
+
+        // faults with duplicate names
+        Set duplicateNames = getDuplicateFaultNames();
+
+        // handle soap:fault
+        handleLiteralSOAPFault(response, duplicateNames);
+        info.operation.setProperty(
+                WSDL_PARAMETER_ORDER,
+                definitiveParameterList);
+
+        Binding binding = info.port.resolveBinding(document);
+        PortType portType = binding.resolvePortType(document);
+        if (isAsync(portType, info.portTypeOperation)) {
+            warning(portType, "Can not generate Async methods for non-soap binding!");
+        }
+        return info.operation;
+    }
+
+    /**
+     * This method is added to fix one of the use case for j2ee se folks, so that we determine
+     * for non_soap wsdl what could be the style - rpc or document based on parts in the message.
+     *
+     * We assume that the message parts could have either all of them with type attribute (RPC)
+     * or element (DOCUMENT)
+     *
+     * Shall this check if parts are mixed and throw error message?
+     */
+    private void setNonSoapStyle(Message inputMessage, Message outputMessage) {
+        SOAPStyle style = SOAPStyle.DOCUMENT;
+        for(MessagePart part:inputMessage.getParts()){
+            if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE)
+                style = SOAPStyle.RPC;
+            else
+                style = SOAPStyle.DOCUMENT;
+        }
+
+        //check the outputMessage parts
+        if(outputMessage != null){
+            for(MessagePart part:outputMessage.getParts()){
+                if(part.getDescriptorKind() == SchemaKinds.XSD_TYPE)
+                    style = SOAPStyle.RPC;
+                else
+                    style = SOAPStyle.DOCUMENT;
+            }
+        }
+        info.modelPort.setStyle(style);
+    }
+
     /* (non-Javadoc)
      * @see WSDLModelerBase#processSOAPOperation()
      */
     protected Operation processSOAPOperation() {
         Operation operation =
-            new Operation(new QName(null, info.bindingOperation.getName()));
+                new Operation(new QName(null, info.bindingOperation.getName()), info.bindingOperation);
 
         setDocumentationIfPresent(
-            operation,
-            info.portTypeOperation.getDocumentation());
+                operation,
+                info.portTypeOperation.getDocumentation());
 
         if (info.portTypeOperation.getStyle()
-            != OperationStyle.REQUEST_RESPONSE
-            && info.portTypeOperation.getStyle() != OperationStyle.ONE_WAY) {
-            if(extensions){
-                warn(
-                    "wsdlmodeler.warning.ignoringOperation.notSupportedStyle",
-                    info.portTypeOperation.getName());
+                != OperationStyle.REQUEST_RESPONSE
+                && info.portTypeOperation.getStyle() != OperationStyle.ONE_WAY) {
+            if (options.isExtensionMode()) {
+                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName()));
                 return null;
+            } else {
+                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(info.portTypeOperation.getName(),
+                        info.port.resolveBinding(document).resolvePortType(document).getName()));
             }
-            fail("wsdlmodeler.invalid.operation.notSupportedStyle",
-                    new Object[]{info.portTypeOperation.getName(),
-                    info.port.resolveBinding(document).resolvePortType(document).getName()});
         }
 
         SOAPStyle soapStyle = info.soapBinding.getStyle();
 
         // find out the SOAP operation extension, if any
         SOAPOperation soapOperation =
-            (SOAPOperation)getExtensionOfType(info.bindingOperation,
-                SOAPOperation.class);
+                (SOAPOperation) getExtensionOfType(info.bindingOperation,
+                        SOAPOperation.class);
 
         if (soapOperation != null) {
             if (soapOperation.getStyle() != null) {
@@ -605,7 +662,7 @@
         operation.setStyle(soapStyle);
 
         String uniqueOperationName =
-            getUniqueName(info.portTypeOperation, info.hasOverloadedOperations);
+                getUniqueName(info.portTypeOperation, info.hasOverloadedOperations);
         if (info.hasOverloadedOperations) {
             operation.setUniqueName(uniqueOperationName);
         }
@@ -617,14 +674,12 @@
         SOAPBody soapRequestBody = getSOAPRequestBody();
         if (soapRequestBody == null) {
             // the WSDL document is invalid
-            throw new ModelerException(
-                "wsdlmodeler.invalid.bindingOperation.inputMissingSoapBody",
-                new Object[] { info.bindingOperation.getName()});
+            error(info.bindingOperation, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName()));
         }
 
         if (soapStyle == SOAPStyle.RPC) {
             if (soapRequestBody.isEncoded()) {
-                throw new ModelerException("wsdlmodeler20.rpcenc.not.supported");
+                error(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED());
             }
             return processLiteralSOAPOperation(StyleAndUse.RPC_LITERAL);
         }
@@ -632,55 +687,61 @@
         return processLiteralSOAPOperation(StyleAndUse.DOC_LITERAL);
     }
 
-    protected Operation processLiteralSOAPOperation(StyleAndUse styleAndUse){
+    protected Operation processLiteralSOAPOperation(StyleAndUse styleAndUse) {
         //returns false if the operation name is not acceptable
-        if(!applyOperationNameCustomization())
+        if (!applyOperationNameCustomization())
             return null;
 
         boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
-        Request request = new Request();
-        Response response = new Response();
+        Message inputMessage = getInputMessage();
+        Request request = new Request(inputMessage, errReceiver);
+        request.setErrorReceiver(errReceiver);
         info.operation.setUse(SOAPUse.LITERAL);
+        info.operation.setWSDLPortTypeOperation(info.portTypeOperation);
         SOAPBody soapRequestBody = getSOAPRequestBody();
-        if((StyleAndUse.DOC_LITERAL == styleAndUse) && (soapRequestBody.getNamespace() != null)){
-            warn("wsdlmodeler.warning.r2716", new Object[]{"soapbind:body", info.bindingOperation.getName()});
+        if ((StyleAndUse.DOC_LITERAL == styleAndUse) && (soapRequestBody.getNamespace() != null)) {
+            warning(soapRequestBody, ModelerMessages.WSDLMODELER_WARNING_R_2716("soapbind:body", info.bindingOperation.getName()));
         }
 
-        Message inputMessage = getInputMessage();
+
+        Response response = null;
 
         SOAPBody soapResponseBody = null;
         Message outputMessage = null;
         if (isRequestResponse) {
             soapResponseBody = getSOAPResponseBody();
             if (isOperationDocumentLiteral(styleAndUse) && (soapResponseBody.getNamespace() != null)) {
-                warn("wsdlmodeler.warning.r2716", new Object[]{"soapbind:body", info.bindingOperation.getName()});
+                warning(soapResponseBody, ModelerMessages.WSDLMODELER_WARNING_R_2716("soapbind:body", info.bindingOperation.getName()));
             }
             outputMessage = getOutputMessage();
+            response = new Response(outputMessage, errReceiver);
+        }else{
+            response = new Response(null, errReceiver);
         }
 
         //ignore operation if there are more than one root part
-        if(!validateMimeParts(getMimeParts(info.bindingOperation.getInput())) ||
+        if (!validateMimeParts(getMimeParts(info.bindingOperation.getInput())) ||
                 !validateMimeParts(getMimeParts(info.bindingOperation.getOutput())))
             return null;
 
 
-        if(!validateBodyParts(info.bindingOperation)){
+        if (!validateBodyParts(info.bindingOperation)) {
             // BP 1.1
             // R2204   A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s),
             // only to wsdl:part element(s) that have been defined using the element attribute.
 
             // R2203   An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s),
             // only to wsdNl:part element(s) that have been defined using the type attribute.
-            if(isOperationDocumentLiteral(styleAndUse))
-                if(extensions)
-                    warn("wsdlmodeler.warning.ignoringOperation.cannotHandleTypeMessagePart", info.portTypeOperation.getName());
+            if (isOperationDocumentLiteral(styleAndUse))
+                if (options.isExtensionMode())
+                    warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(info.portTypeOperation.getName()));
                 else
-                    fail("wsdlmodeler.invalid.doclitoperation", info.portTypeOperation.getName());
-            else if(isOperationRpcLiteral(styleAndUse)) {
-                if(extensions)
-                    warn("wsdlmodeler.warning.ignoringOperation.cannotHandleElementMessagePart", info.portTypeOperation.getName());
+                    error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_DOCLITOPERATION(info.portTypeOperation.getName()));
+            else if (isOperationRpcLiteral(styleAndUse)) {
+                if (options.isExtensionMode())
+                    warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(info.portTypeOperation.getName()));
                 else
-                    fail("wsdlmodeler.invalid.rpclitoperation", info.portTypeOperation.getName());
+                    error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_RPCLITOPERATION(info.portTypeOperation.getName()));
             }
             return null;
         }
@@ -689,22 +750,22 @@
         List<MessagePart> parameterList = getParameterOrder();
 
         //binding is invalid in the wsdl, ignore the operation.
-        if(!setMessagePartsBinding(styleAndUse))
+        if (!setMessagePartsBinding(styleAndUse))
             return null;
 
         List<Parameter> params = null;
         boolean unwrappable = isUnwrappable();
         info.operation.setWrapped(unwrappable);
-        if(isOperationDocumentLiteral(styleAndUse)){
+        if (isOperationDocumentLiteral(styleAndUse)) {
             params = getDoclitParameters(request, response, parameterList);
-        }else if(isOperationRpcLiteral(styleAndUse)){
+        } else if (isOperationRpcLiteral(styleAndUse)) {
             String operationName = info.bindingOperation.getName();
             Block reqBlock = null;
             if (inputMessage != null) {
                 QName name = new QName(getRequestNamespaceURI(soapRequestBody), operationName);
                 RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
                 rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
-                reqBlock = new Block(name, rpcStruct);
+                reqBlock = new Block(name, rpcStruct, inputMessage);
                 request.addBodyBlock(reqBlock);
             }
 
@@ -713,31 +774,31 @@
                 QName name = new QName(getResponseNamespaceURI(soapResponseBody), operationName + "Response");
                 RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
                 rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
-                resBlock = new Block(name, rpcStruct);
+                resBlock = new Block(name, rpcStruct, outputMessage);
                 response.addBodyBlock(resBlock);
             }
             params = getRpcLitParameters(request, response, reqBlock, resBlock, parameterList);
         }
 
 
-        if(!validateParameterName(params)) {
+        if (!validateParameterName(params)) {
             return null;
         }
 
         // create a definitive list of parameters to match what we'd like to get
         // in the java interface (which is generated much later), parameterOrder
         List<Parameter> definitiveParameterList = new ArrayList<Parameter>();
-        for (Parameter param: params) {
-            if(param.isReturn()){
+        for (Parameter param : params) {
+            if (param.isReturn()) {
                 info.operation.setProperty(WSDL_RESULT_PARAMETER, param);
                 response.addParameter(param);
                 continue;
             }
-            if(param.isIN()){
+            if (param.isIN()) {
                 request.addParameter(param);
-            }else if(param.isOUT()){
+            } else if (param.isOUT()) {
                 response.addParameter(param);
-            }else if(param.isINOUT()){
+            } else if (param.isINOUT()) {
                 request.addParameter(param);
                 response.addParameter(param);
             }
@@ -754,17 +815,17 @@
         QName body = VOID_BODYBLOCK;
         QName opName = null;
 
-        if(bb.hasNext()){
+        if (bb.hasNext()) {
             body = bb.next().getName();
             opName = uniqueBodyBlocks.get(body);
-        }else{
+        } else {
             //there is no body block
             body = VOID_BODYBLOCK;
             opName = uniqueBodyBlocks.get(VOID_BODYBLOCK);
         }
-        if(opName != null){
-            fail("wsdlmodeler.nonUnique.body", new Object[]{info.port.getName(), info.operation.getName(), opName, body});
-        }else{
+        if (opName != null) {
+            error(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY(info.port.getName(), info.operation.getName(), opName, body));
+        } else {
             uniqueBodyBlocks.put(body, info.operation.getName());
         }
 
@@ -780,98 +841,71 @@
         //set Async property
         Binding binding = info.port.resolveBinding(document);
         PortType portType = binding.resolvePortType(document);
-        if(isAsync(portType, info.portTypeOperation)){
+        if (isAsync(portType, info.portTypeOperation)) {
             addAsyncOperations(info.operation, styleAndUse);
         }
 
         return info.operation;
     }
 
-    /**
-     *
-     * @param params
-     * @return
-     */
     private boolean validateParameterName(List<Parameter> params) {
+        if (options.isExtensionMode())
+            return true;
+
         Message msg = getInputMessage();
-        for(Parameter param : params){
-            if(param.isOUT())
+        for (Parameter param : params) {
+            if (param.isOUT())
                 continue;
-            if(param.getCustomName() != null){
-                if(getEnvironment().getNames().isJavaReservedWord(param.getCustomName())){
-                    if(extensions)
-                        warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customName",
-                                new Object[]{info.operation.getName(), param.getCustomName()});
-                    else
-                        fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customName",
-                                new Object[]{info.operation.getName(), param.getCustomName()});
+            if (param.getCustomName() != null) {
+                if (Names.isJavaReservedWord(param.getCustomName())) {
+                    error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName()));
                     return false;
                 }
                 return true;
             }
             //process doclit wrapper style
-            if(param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)){
-                if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
-                    if(extensions)
-                        warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.wrapperStyle", new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
-                    else
-                        fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle", new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+            if (param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)) {
+                if (Names.isJavaReservedWord(param.getName())) {
+                    error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName()));
                     return false;
                 }
-            }else{
+            } else {
                 //non-wrapper style and rpclit
-                if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
-                    if(extensions)
-                        warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
-                    else
-                        fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+                if (Names.isJavaReservedWord(param.getName())) {
+                    error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(info.operation.getName(), msg.getName(), param.getName()));
                     return false;
                 }
             }
         }
 
         boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
-        if(isRequestResponse){
+        if (isRequestResponse) {
             msg = getOutputMessage();
-            for(Parameter param : params){
-                if(param.isIN())
+            for (Parameter param : params) {
+                if (param.isIN())
                     continue;
-                if(param.getCustomName() != null){
-                    if(getEnvironment().getNames().isJavaReservedWord(param.getCustomName())){
-                        if(extensions)
-                            warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customName",
-                                    new Object[]{info.operation.getName(), param.getCustomName()});
-                        else
-                            fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customName",
-                                    new Object[]{info.operation.getName(), param.getCustomName()});
+                if (param.getCustomName() != null) {
+                    if (Names.isJavaReservedWord(param.getCustomName())) {
+                        error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(info.operation.getName(), param.getCustomName()));
                         return false;
                     }
                     return true;
                 }
                 //process doclit wrapper style
-                if(param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)){
-                    if(param.isReturn())
+                if (param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)) {
+                    if (param.isReturn())
                         continue;
-                    if(!param.getName().equals("return") && getEnvironment().getNames().isJavaReservedWord(param.getName())){
-                        if(extensions)
-                            warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.wrapperStyle",
-                                    new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
-                        else
-                            fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle",
-                                    new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+                    if (!param.getName().equals("return") && Names.isJavaReservedWord(param.getName())) {
+                        error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(info.operation.getName(), param.getName(), param.getBlock().getName()));
                         return false;
                     }
-                }else{
-                    if(param.isReturn())
+                } else {
+                    if (param.isReturn())
                         continue;
 
                     //non-wrapper style and rpclit
-                    if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
-                        if(extensions)
-                            warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
-                        else
-                            fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.nonWrapperStyle",
-                                    new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+                    if (Names.isJavaReservedWord(param.getName())) {
+                        error(param.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(info.operation.getName(), msg.getName(), param.getName()));
                         return false;
                     }
                 }
@@ -881,62 +915,56 @@
         return true;
     }
 
-    /**
-     * @return
-     */
     private boolean enableMimeContent() {
         //first we look at binding operation
-        JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.bindingOperation, JAXWSBinding.class);
-        Boolean mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
-        if(mimeContentMapping != null)
+        JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.bindingOperation, JAXWSBinding.class);
+        Boolean mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
+        if (mimeContentMapping != null)
             return mimeContentMapping;
 
         //then in wsdl:binding
         Binding binding = info.port.resolveBinding(info.document);
-        jaxwsCustomization = (JAXWSBinding)getExtensionOfType(binding, JAXWSBinding.class);
-        mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
-        if(mimeContentMapping != null)
+        jaxwsCustomization = (JAXWSBinding) getExtensionOfType(binding, JAXWSBinding.class);
+        mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
+        if (mimeContentMapping != null)
             return mimeContentMapping;
 
         //at last look in wsdl:definitions
-        jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class);
-        mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
-        if(mimeContentMapping != null)
+        jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class);
+        mimeContentMapping = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableMimeContentMapping() : null;
+        if (mimeContentMapping != null)
             return mimeContentMapping;
         return false;
     }
 
-    /**
-     *
-     */
     private boolean applyOperationNameCustomization() {
-        JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
-        String operationName = (jaxwsCustomization != null)?((jaxwsCustomization.getMethodName() != null)?jaxwsCustomization.getMethodName().getName():null):null;
-        if(operationName != null){
-            if(getEnvironment().getNames().isJavaReservedWord(operationName)){
-                if(extensions)
-                    warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customizedOperationName", new Object[]{info.operation.getName(), operationName});
+        JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
+        String operationName = (jaxwsCustomization != null) ? ((jaxwsCustomization.getMethodName() != null) ? jaxwsCustomization.getMethodName().getName() : null) : null;
+        if (operationName != null) {
+            if (Names.isJavaReservedWord(operationName)) {
+                if (options.isExtensionMode())
+                    warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
                 else
-                    fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customizedOperationName", new Object[]{info.operation.getName(), operationName});
+                    error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(info.operation.getName(), operationName));
                 return false;
             }
 
             info.operation.setCustomizedName(operationName);
         }
 
-        if(getEnvironment().getNames().isJavaReservedWord(info.operation.getJavaMethodName())){
-            if(extensions)
-                warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.operationName", new Object[]{info.operation.getName()});
+        if (Names.isJavaReservedWord(info.operation.getJavaMethodName())) {
+            if (options.isExtensionMode())
+                warning(info.portTypeOperation, ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
             else
-                fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.operationName", new Object[]{info.operation.getName()});
+                error(info.portTypeOperation, ModelerMessages.WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(info.operation.getName()));
             return false;
         }
         return true;
     }
 
-    protected String getAsyncOperationName(Operation operation){
+    protected String getAsyncOperationName(Operation operation) {
         String name = operation.getCustomizedName();
-        if(name == null)
+        if (name == null)
             name = operation.getUniqueName();
         return name;
     }
@@ -946,41 +974,32 @@
      */
     private void addAsyncOperations(Operation syncOperation, StyleAndUse styleAndUse) {
         Operation operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.POLLING);
-        if(operation != null)
+        if (operation != null)
             info.modelPort.addOperation(operation);
 
         operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.CALLBACK);
-        if(operation != null)
+        if (operation != null)
             info.modelPort.addOperation(operation);
     }
 
-    /**
-     *
-     * @param syncOperation
-     * @param styleAndUse
-     * @param asyncType
-     * @return
-     */
     private Operation createAsyncOperation(Operation syncOperation, StyleAndUse styleAndUse, AsyncOperationType asyncType) {
         boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
-        if(!isRequestResponse)
+        if (!isRequestResponse)
             return null;
-        Request request = new Request();
-        Response response = new Response();
 
         //create async operations
-        AsyncOperation operation = new AsyncOperation(info.operation);
+        AsyncOperation operation = new AsyncOperation(info.operation, info.bindingOperation);
 
         //creation the async operation name: operationName+Async or customized name
         //operation.setName(new QName(operation.getName().getNamespaceURI(), getAsyncOperationName(info.portTypeOperation, operation)));
-        if(asyncType.equals(AsyncOperationType.CALLBACK))
-            operation.setUniqueName(info.operation.getUniqueName()+"_async_callback");
-        else if(asyncType.equals(AsyncOperationType.POLLING))
-            operation.setUniqueName(info.operation.getUniqueName()+"_async_polling");
+        if (asyncType.equals(AsyncOperationType.CALLBACK))
+            operation.setUniqueName(info.operation.getUniqueName() + "_async_callback");
+        else if (asyncType.equals(AsyncOperationType.POLLING))
+            operation.setUniqueName(info.operation.getUniqueName() + "_async_polling");
 
         setDocumentationIfPresent(
-            operation,
-            info.portTypeOperation.getDocumentation());
+                operation,
+                info.portTypeOperation.getDocumentation());
 
         operation.setAsyncType(asyncType);
         operation.setSOAPAction(info.operation.getSOAPAction());
@@ -989,32 +1008,35 @@
         SOAPBody soapRequestBody = getSOAPRequestBody();
 
         Message inputMessage = getInputMessage();
+        Request request = new Request(inputMessage, errReceiver);
+        Response response = new Response(null, errReceiver);
 
         SOAPBody soapResponseBody = null;
         Message outputMessage = null;
         if (isRequestResponse) {
             soapResponseBody = getSOAPResponseBody();
             outputMessage = getOutputMessage();
+            response = new Response(outputMessage, errReceiver);
         }
 
         // Process parameterOrder and get the parameterList
         java.util.List<String> parameterList = getAsynParameterOrder();
 
         List<Parameter> inParameters = null;
-        if(isOperationDocumentLiteral(styleAndUse)){
+        if (isOperationDocumentLiteral(styleAndUse)) {
             inParameters = getRequestParameters(request, parameterList);
             // outParameters = getResponseParameters(response);
             // re-create parameterList with unwrapped parameters
-            if(unwrappable){
+            if (unwrappable) {
                 List<String> unwrappedParameterList = new ArrayList<String>();
-                if(inputMessage != null){
+                if (inputMessage != null) {
                     Iterator<MessagePart> parts = inputMessage.parts();
-                    if(parts.hasNext()){
+                    if (parts.hasNext()) {
                         MessagePart part = parts.next();
-                        JAXBType jaxbType = getJAXBType(part.getDescriptor());
+                        JAXBType jaxbType = getJAXBType(part);
                         List<JAXBProperty> memberList = jaxbType.getWrapperChildren();
                         Iterator<JAXBProperty> props = memberList.iterator();
-                        while(props.hasNext()){
+                        while (props.hasNext()) {
                             JAXBProperty prop = props.next();
                             unwrappedParameterList.add(prop.getElementName().getLocalPart());
                         }
@@ -1024,14 +1046,14 @@
                 parameterList.clear();
                 parameterList.addAll(unwrappedParameterList);
             }
-        }else if(isOperationRpcLiteral(styleAndUse)){
+        } else if (isOperationRpcLiteral(styleAndUse)) {
             String operationName = info.bindingOperation.getName();
             Block reqBlock = null;
             if (inputMessage != null) {
                 QName name = new QName(getRequestNamespaceURI(soapRequestBody), operationName);
                 RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
                 rpcStruct.setJavaType(new JavaSimpleType("com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload", null));
-                reqBlock = new Block(name, rpcStruct);
+                reqBlock = new Block(name, rpcStruct, inputMessage);
                 request.addBodyBlock(reqBlock);
             }
             inParameters = createRpcLitRequestParameters(request, parameterList, reqBlock);
@@ -1042,17 +1064,17 @@
         //copy the response blocks from the sync operation
         Iterator<Block> blocks = info.operation.getResponse().getBodyBlocks();
 
-        while(blocks.hasNext()){
+        while (blocks.hasNext()) {
             response.addBodyBlock(blocks.next());
         }
 
         blocks = info.operation.getResponse().getHeaderBlocks();
-        while(blocks.hasNext()){
+        while (blocks.hasNext()) {
             response.addHeaderBlock(blocks.next());
         }
 
         blocks = info.operation.getResponse().getAttachmentBlocks();
-        while(blocks.hasNext()){
+        while (blocks.hasNext()) {
             response.addAttachmentBlock(blocks.next());
         }
 
@@ -1061,37 +1083,40 @@
         // handle headers
         int numOfOutMsgParts = outputParts.size();
 
-        if(isRequestResponse){
-            if(numOfOutMsgParts == 1){
+        if (isRequestResponse) {
+            if (numOfOutMsgParts == 1) {
                 MessagePart part = outputParts.get(0);
-                if(isOperationDocumentLiteral(styleAndUse)){
-                    JAXBType type = getJAXBType(part.getDescriptor());
+                if (isOperationDocumentLiteral(styleAndUse)) {
+                    JAXBType type = getJAXBType(part);
                     operation.setResponseBean(type);
-                }else if(isOperationRpcLiteral(styleAndUse)){
+                } else if (isOperationRpcLiteral(styleAndUse)) {
                     String operationName = info.bindingOperation.getName();
                     Block resBlock = null;
                     if (isRequestResponse && outputMessage != null) {
                         resBlock = info.operation.getResponse().getBodyBlocksMap().get(new QName(getResponseNamespaceURI(soapResponseBody),
                                 operationName + "Response"));
                     }
-                    RpcLitStructure resBean = (resBlock == null) ? null : (RpcLitStructure)resBlock.getType();
+                    RpcLitStructure resBean = (resBlock == null) ? null : (RpcLitStructure) resBlock.getType();
                     List<RpcLitMember> members = resBean.getRpcLitMembers();
 
                     operation.setResponseBean(members.get(0));
                 }
-            }else{
+            } else {
                 //create response bean
                 String nspace = "";
-                QName responseBeanName = new QName(nspace,getAsyncOperationName(info.operation) +"Response");
-                JAXBType responseBeanType = getJAXBType(responseBeanName);
+                QName responseBeanName = new QName(nspace, getAsyncOperationName(info.operation) + "Response");
+                JAXBType responseBeanType = jaxbModelBuilder.getJAXBType(responseBeanName);
+                if(responseBeanType == null){
+                    error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_RESPONSEBEAN_NOTFOUND(info.operation.getName()));
+                }
                 operation.setResponseBean(responseBeanType);
             }
         }
-        QName respBeanName = new QName(soapResponseBody.getNamespace(),getAsyncOperationName(info.operation)+"Response");
-        Block block = new Block(respBeanName, operation.getResponseBeanType());
+        QName respBeanName = new QName(soapResponseBody.getNamespace(), getAsyncOperationName(info.operation) + "Response");
+        Block block = new Block(respBeanName, operation.getResponseBeanType(), outputMessage);
         JavaType respJavaType = operation.getResponseBeanJavaType();
         JAXBType respType = new JAXBType(respBeanName, respJavaType);
-        Parameter respParam = ModelerUtils.createParameter(info.operation.getName()+"Response", respType, block);
+        Parameter respParam = ModelerUtils.createParameter(info.operation.getName() + "Response", respType, block);
         respParam.setParameterIndex(-1);
         response.addParameter(respParam);
         operation.setProperty(WSDL_RESULT_PARAMETER, respParam.getName());
@@ -1099,15 +1124,15 @@
 
         List<String> definitiveParameterList = new ArrayList<String>();
         int parameterOrderPosition = 0;
-        for (String name: parameterList) {
+        for (String name : parameterList) {
             Parameter inParameter = null;
 
             inParameter = ModelerUtils.getParameter(name, inParameters);
-            if(inParameter == null){
-                if(extensions)
-                    warn("wsdlmodeler.warning.ignoringOperation.partNotFound", new Object[]{info.operation.getName().getLocalPart(), name});
+            if (inParameter == null) {
+                if (options.isExtensionMode())
+                    warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name));
                 else
-                    fail("wsdlmodeler.error.partNotFound", new Object[]{info.operation.getName().getLocalPart(), name});
+                    error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_ERROR_PART_NOT_FOUND(info.operation.getName().getLocalPart(), name));
                 return null;
             }
             request.addParameter(inParameter);
@@ -1121,7 +1146,7 @@
         }
 
         //  add callback handlerb Parameter to request
-        if(operation.getAsyncType().equals(AsyncOperationType.CALLBACK)){
+        if (operation.getAsyncType().equals(AsyncOperationType.CALLBACK)) {
             JavaType cbJavaType = operation.getCallBackType();
             JAXBType callbackType = new JAXBType(respBeanName, cbJavaType);
             Parameter cbParam = ModelerUtils.createParameter("asyncHandler", callbackType, block);
@@ -1133,52 +1158,52 @@
         return operation;
     }
 
-    protected boolean isAsync(com.sun.tools.internal.ws.wsdl.document.PortType portType, com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation){
+    protected boolean isAsync(com.sun.tools.internal.ws.wsdl.document.PortType portType, com.sun.tools.internal.ws.wsdl.document.Operation wsdlOperation) {
         //First look into wsdl:operation
-        JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(wsdlOperation, JAXWSBinding.class);
-        Boolean isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
+        JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class);
+        Boolean isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
 
-        if(isAsync != null)
+        if (isAsync != null)
             return isAsync;
 
         // then into wsdl:portType
         QName portTypeName = new QName(portType.getDefining().getTargetNamespaceURI(), portType.getName());
-        if(portTypeName != null){
-            jaxwsCustomization = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
-            isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
-            if(isAsync != null)
+        if (portTypeName != null) {
+            jaxwsCustomization = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
+            isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
+            if (isAsync != null)
                 return isAsync;
         }
 
         //then wsdl:definitions
-        jaxwsCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
-        isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
-        if(isAsync != null)
+        jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+        isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
+        if (isAsync != null)
             return isAsync;
         return false;
     }
 
-    protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List definitiveParameterList, boolean processRequest) {
+    protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List<String> definitiveParameterList, boolean processRequest) {
         QName headerName = null;
         Block headerBlock = null;
         JAXBType jaxbType = null;
         int parameterOrderPosition = definitiveParameterList.size();
-        while(headerParts.hasNext()){
-            MessagePart part = (MessagePart)headerParts.next();
+        while (headerParts.hasNext()) {
+            MessagePart part = (MessagePart) headerParts.next();
             headerName = part.getDescriptor();
-            jaxbType = getJAXBType(headerName);
-            headerBlock = new Block(headerName, jaxbType);
-            Extensible ext;
-            if(processRequest){
+            jaxbType = getJAXBType(part);
+            headerBlock = new Block(headerName, jaxbType, part);
+            TWSDLExtensible ext;
+            if (processRequest) {
                 ext = info.bindingOperation.getInput();
-            }else{
+            } else {
                 ext = info.bindingOperation.getOutput();
             }
             Message headerMessage = getHeaderMessage(part, ext);
 
-            if(processRequest){
+            if (processRequest) {
                 request.addHeaderBlock(headerBlock);
-            }else{
+            } else {
                 response.addHeaderBlock(headerBlock);
             }
 
@@ -1192,7 +1217,7 @@
                 if (definitiveParameterList != null) {
                     for (Iterator iterInParams = definitiveParameterList.iterator(); iterInParams.hasNext();) {
                         String inParamName =
-                            (String)iterInParams.next();
+                                (String) iterInParams.next();
                         if (inParamName.equals(parameter.getName())) {
                             Parameter inParam = request.getParameterByName(inParamName);
                             parameter.setLinkedParameter(inParam);
@@ -1212,142 +1237,127 @@
 
     }
 
-    protected void handleLiteralSOAPFault(Response response, Set duplicateNames){
-        for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();){
-            BindingFault bindingFault = (BindingFault)iter.next();
+    protected void handleLiteralSOAPFault(Response response, Set duplicateNames) {
+        for (BindingFault bindingFault : info.bindingOperation.faults()) {
             com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault = null;
-            for(Iterator iter2 = info.portTypeOperation.faults(); iter2.hasNext();){
-                com.sun.tools.internal.ws.wsdl.document.Fault aFault =
-                    (com.sun.tools.internal.ws.wsdl.document.Fault)iter2.next();
-                if(aFault.getName().equals(bindingFault.getName())){
-                    if(portTypeFault != null){
+            for (com.sun.tools.internal.ws.wsdl.document.Fault aFault : info.portTypeOperation.faults()) {
+                if (aFault.getName().equals(bindingFault.getName())) {
+                    if (portTypeFault != null) {
                         // the WSDL document is invalid, a wsld:fault in a wsdl:operation of a portType can be bound only once
-                        throw new ModelerException("wsdlmodeler.invalid.bindingFault.notUnique",
-                                new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+                        error(portTypeFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(bindingFault.getName(), info.bindingOperation.getName()));
                     }
                     portTypeFault = aFault;
                 }
             }
 
             // The WSDL document is invalid, the wsdl:fault in abstract operation is does not have any binding
-            if(portTypeFault == null){
-                throw new ModelerException("wsdlmodeler.invalid.bindingFault.notFound",
-                        new Object[] {bindingFault.getName(), info.bindingOperation.getName()});
+            if (portTypeFault == null) {
+                error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(bindingFault.getName(), info.bindingOperation.getName()));
 
             }
 
             // wsdl:fault message name is used to create the java exception name later on
             String faultName = getFaultClassName(portTypeFault);
-            Fault fault = new Fault(faultName);
+            Fault fault = new Fault(faultName, portTypeFault);
+            fault.setWsdlFaultName(portTypeFault.getName());
             setDocumentationIfPresent(fault, portTypeFault.getDocumentation());
 
             //get the soapbind:fault from wsdl:fault in the binding
-            SOAPFault soapFault = (SOAPFault)getExtensionOfType(bindingFault, SOAPFault.class);
+            SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class);
 
             // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
-            if(soapFault == null){
-                throw new ModelerException("wsdlmodeler.invalid.bindingFault.outputMissingSoapFault",
-                    new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+            if (soapFault == null) {
+                if(options.isExtensionMode()){
+                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
+                    soapFault = new SOAPFault(new LocatorImpl());
+                }else{
+                    error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
+                }
             }
 
             //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
-            if(!soapFault.isLiteral()){
-                if(extensions)
-                warn("wsdlmodeler.warning.ignoringFault.notLiteral",
-                    new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+            if (!soapFault.isLiteral()) {
+                if (options.isExtensionMode())
+                    warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                 else
-                    fail("wsdlmodeler.invalid.operation.fault.notLiteral",
-                            new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+                    error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                 continue;
             }
 
             // the soapFault name must be present
-            if(soapFault.getName() == null){
-                warn("wsdlmodeler.invalid.bindingFault.noSoapFaultName",
-                    new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
-            }else if (!soapFault.getName().equals(bindingFault.getName())) {
-                // the soapFault name must match bindingFault name
-                warn("wsdlmodeler.invalid.bindingFault.wrongSoapFaultName",
-                    new Object[]{soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()});
-            }else if(soapFault.getNamespace() != null){
-                // bug fix: 4852729
-                warn("wsdlmodeler.warning.r2716r2726",
-                    new Object[] { "soapbind:fault", soapFault.getName()});
+            if (soapFault.getName() == null) {
+                warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
+            } else if (!soapFault.getName().equals(bindingFault.getName())) {
+                warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
+            } else if (soapFault.getNamespace() != null) {
+                warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
             }
 
             String faultNamespaceURI = soapFault.getNamespace();
-            if(faultNamespaceURI == null){
+            if (faultNamespaceURI == null) {
                 faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI();
             }
 
             com.sun.tools.internal.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
             Iterator iter2 = faultMessage.parts();
-            if(!iter2.hasNext()){
+            if (!iter2.hasNext()) {
                 // the WSDL document is invalid
-                throw new ModelerException("wsdlmodeler.invalid.bindingFault.emptyMessage",
-                    new Object[]{bindingFault.getName(), faultMessage.getName()});
+                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(bindingFault.getName(), faultMessage.getName()));
             }
-            MessagePart faultPart = (MessagePart)iter2.next();
+            MessagePart faultPart = (MessagePart) iter2.next();
             QName faultQName = faultPart.getDescriptor();
 
             // Don't include fault messages with non-unique soap:fault names
             if (duplicateNames.contains(faultQName)) {
-                warn("wsdlmodeler.duplicate.fault.soap.name",
-                    new Object[] {bindingFault.getName(), info.portTypeOperation.getName(), faultPart.getName()});
+                warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(bindingFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
                 continue;
             }
 
             if (iter2.hasNext()) {
                 // the WSDL document is invalid
-                throw new ModelerException("wsdlmodeler.invalid.bindingFault.messageHasMoreThanOnePart",
-                    new Object[]{bindingFault.getName(), faultMessage.getName()});
+                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(bindingFault.getName(), faultMessage.getName()));
             }
 
             if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
-                throw new ModelerException("wsdlmodeler.invalid.message.partMustHaveElementDescriptor",
-                    new Object[]{faultMessage.getName(), faultPart.getName()});
+                error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
             }
 
-            JAXBType jaxbType = getJAXBType(faultPart.getDescriptor());
+            JAXBType jaxbType = getJAXBType(faultPart);
 
             fault.setElementName(faultPart.getDescriptor());
-            fault.setJavaMemberName(getEnvironment().getNames().getExceptionClassMemberName());
+            fault.setJavaMemberName(Names.getExceptionClassMemberName());
 
-            Block faultBlock = new Block(faultQName, jaxbType);
+            Block faultBlock = new Block(faultQName, jaxbType, faultPart);
             fault.setBlock(faultBlock);
-            createParentFault(fault);
-            createSubfaults(fault);
-            if(!response.getFaultBlocksMap().containsKey(faultBlock.getName()))
+            //createParentFault(fault);
+            //createSubfaults(fault);
+            if (!response.getFaultBlocksMap().containsKey(faultBlock.getName()))
                 response.addFaultBlock(faultBlock);
             info.operation.addFault(fault);
         }
     }
 
-    /**
-     * @param portTypeFault
-     * @return
-     */
     private String getFaultClassName(com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault) {
-        JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portTypeFault, JAXWSBinding.class);
-        if(jaxwsBinding != null){
+        JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeFault, JAXWSBinding.class);
+        if (jaxwsBinding != null) {
             CustomName className = jaxwsBinding.getClassName();
-            if(className != null){
+            if (className != null) {
                 return className.getName();
             }
         }
         return portTypeFault.getMessage().getLocalPart();
     }
 
-    protected  boolean setMessagePartsBinding(StyleAndUse styleAndUse){
+    protected boolean setMessagePartsBinding(StyleAndUse styleAndUse) {
         SOAPBody inBody = getSOAPRequestBody();
         Message inMessage = getInputMessage();
-        if(!setMessagePartsBinding(inBody, inMessage, styleAndUse, true))
+        if (!setMessagePartsBinding(inBody, inMessage, styleAndUse, true))
             return false;
 
-        if(isRequestResponse()){
+        if (isRequestResponse()) {
             SOAPBody outBody = getSOAPResponseBody();
             Message outMessage = getOutputMessage();
-            if(!setMessagePartsBinding(outBody, outMessage, styleAndUse, false))
+            if (!setMessagePartsBinding(outBody, outMessage, styleAndUse, false))
                 return false;
         }
         return true;
@@ -1362,10 +1372,10 @@
         List<MessagePart> headerParts = null;
         List<MessagePart> bodyParts = getBodyParts(body, message);
 
-        if(isInput){
+        if (isInput) {
             headerParts = getHeaderPartsFromMessage(message, isInput);
             mimeParts = getMimeContentParts(message, info.bindingOperation.getInput());
-        }else{
+        } else {
             headerParts = getHeaderPartsFromMessage(message, isInput);
             mimeParts = getMimeContentParts(message, info.bindingOperation.getOutput());
         }
@@ -1377,65 +1387,61 @@
 
         //if soap:body parts attribute not there, then all unbounded message parts will
         // belong to the soap body
-        if(bodyParts == null){
+        if (bodyParts == null) {
             bodyParts = new ArrayList<MessagePart>();
-            for(Iterator<MessagePart> iter = message.parts();iter.hasNext();) {
+            for (Iterator<MessagePart> iter = message.parts(); iter.hasNext();) {
                 MessagePart mPart = iter.next();
                 //Its a safe assumption that the parts in the message not belonging to header or mime will
                 // belong to the body?
-                if(mimeParts.contains(mPart) || headerParts.contains(mPart) || boundToFault(mPart.getName())){
+                if (mimeParts.contains(mPart) || headerParts.contains(mPart) || boundToFault(mPart.getName())) {
                     //throw error that a part cant be bound multiple times, not ignoring operation, if there
                     //is conflict it will fail latter
-                    if(extensions)
-                        warn("wsdlmodeler.warning.bindingOperation.multiplePartBinding",
-                                new Object[]{info.bindingOperation.getName(), mPart.getName()});
+                    if (options.isExtensionMode())
+                        warning(mPart, ModelerMessages.WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName()));
                     else
-                        fail("wsdlmodeler.invalid.bindingOperation.multiplePartBinding",
-                                new Object[]{info.bindingOperation.getName(), mPart.getName()});
+                        error(mPart, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(info.bindingOperation.getName(), mPart.getName()));
                 }
                 bodyParts.add(mPart);
             }
         }
 
         //now build the final parts list with header, mime parts and body parts
-        for(Iterator iter = message.parts();iter.hasNext();) {
-            MessagePart mPart = (MessagePart)iter.next();
-            if(mimeParts.contains(mPart)) {
+        for (Iterator iter = message.parts(); iter.hasNext();) {
+            MessagePart mPart = (MessagePart) iter.next();
+            if (mimeParts.contains(mPart)) {
                 mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
                 parts.add(mPart);
-            }else if(headerParts.contains(mPart)) {
+            } else if (headerParts.contains(mPart)) {
                 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
                 parts.add(mPart);
-            }else if(bodyParts.contains(mPart)) {
+            } else if (bodyParts.contains(mPart)) {
                 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
                 parts.add(mPart);
-            }else{
+            } else {
                 mPart.setBindingExtensibilityElementKind(MessagePart.PART_NOT_BOUNDED);
             }
         }
 
-        if(isOperationDocumentLiteral(styleAndUse) && bodyParts.size() > 1){
-            if(extensions)
-                warn("wsdlmodeler.warning.operation.MoreThanOnePartInMessage",
-                            info.portTypeOperation.getName());
+        if (isOperationDocumentLiteral(styleAndUse) && bodyParts.size() > 1) {
+            if (options.isExtensionMode())
+                warning(message, ModelerMessages.WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName()));
             else
-                fail("wsdlmodeler.invalid.operation.MoreThanOnePartInMessage", info.portTypeOperation.getName());
+                error(message, ModelerMessages.WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(info.portTypeOperation.getName()));
             return false;
         }
         return true;
     }
 
-    private boolean boundToFault(String partName){
-        for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();){
-            BindingFault bindingFault = (BindingFault)iter.next();
-            if(partName.equals(bindingFault.getName()))
+    private boolean boundToFault(String partName) {
+        for (BindingFault bindingFault : info.bindingOperation.faults()) {
+            if (partName.equals(bindingFault.getName()))
                 return true;
         }
         return false;
     }
 
     //get MessagePart(s) referenced by parts attribute of soap:body element
-    private List<MessagePart> getBodyParts(SOAPBody body, Message message){
+    private List<MessagePart> getBodyParts(SOAPBody body, Message message) {
         String bodyParts = body.getParts();
         if (bodyParts != null) {
             List<MessagePart> partsList = new ArrayList<MessagePart>();
@@ -1444,9 +1450,7 @@
                 String part = in.nextToken();
                 MessagePart mPart = message.getPart(part);
                 if (null == mPart) {
-                    throw new ModelerException(
-                        "wsdlmodeler.error.partsNotFound",
-                        new Object[] { part, message.getName()});
+                    error(message, ModelerMessages.WSDLMODELER_ERROR_PARTS_NOT_FOUND(part, message.getName()));
                 }
                 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
                 partsList.add(mPart);
@@ -1456,22 +1460,22 @@
         return null;
     }
 
-    private List<MessagePart> getHeaderPartsFromMessage(Message message, boolean isInput){
+    private List<MessagePart> getHeaderPartsFromMessage(Message message, boolean isInput) {
         List<MessagePart> headerParts = new ArrayList<MessagePart>();
         Iterator<MessagePart> parts = message.parts();
         List<MessagePart> headers = getHeaderParts(isInput);
-        while(parts.hasNext()){
+        while (parts.hasNext()) {
             MessagePart part = parts.next();
-            if(headers.contains(part)){
+            if (headers.contains(part)) {
                 headerParts.add(part);
             }
         }
         return headerParts;
     }
 
-    private Message getHeaderMessage(MessagePart part, Extensible ext) {
-        Iterator<SOAPHeader> headers =  getHeaderExtensions(ext).iterator();
-        while(headers.hasNext()){
+    private Message getHeaderMessage(MessagePart part, TWSDLExtensible ext) {
+        Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
+        while (headers.hasNext()) {
             SOAPHeader header = headers.next();
             if (!header.isLiteral())
                 continue;
@@ -1480,19 +1484,19 @@
                 continue;
 
             MessagePart headerPart = headerMessage.getPart(header.getPart());
-            if(headerPart == part)
+            if (headerPart == part)
                 return headerMessage;
         }
         return null;
     }
 
-    private List<MessagePart> getHeaderPartsNotFromMessage(Message message, boolean isInput){
+    private List<MessagePart> getHeaderPartsNotFromMessage(Message message, boolean isInput) {
         List<MessagePart> headerParts = new ArrayList<MessagePart>();
         List<MessagePart> parts = message.getParts();
         Iterator<MessagePart> headers = getHeaderParts(isInput).iterator();
-        while(headers.hasNext()){
+        while (headers.hasNext()) {
             MessagePart part = headers.next();
-            if(!parts.contains(part)){
+            if (!parts.contains(part)) {
                 headerParts.add(part);
             }
         }
@@ -1500,40 +1504,35 @@
     }
 
     private List<MessagePart> getHeaderParts(boolean isInput) {
-        Extensible ext;
-        if(isInput){
+        TWSDLExtensible ext;
+        if (isInput) {
             ext = info.bindingOperation.getInput();
-        }else{
+        } else {
             ext = info.bindingOperation.getOutput();
         }
 
         List<MessagePart> parts = new ArrayList<MessagePart>();
-        Iterator<SOAPHeader> headers =  getHeaderExtensions(ext).iterator();
-        while(headers.hasNext()){
+        Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
+        while (headers.hasNext()) {
             SOAPHeader header = headers.next();
-            if (!header.isLiteral()){
-                fail("wsdlmodeler.invalid.header.notLiteral",
-                        new Object[] {header.getPart(), info.bindingOperation.getName()});
+            if (!header.isLiteral()) {
+                error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_LITERAL(header.getPart(), info.bindingOperation.getName()));
             }
 
-            if (header.getNamespace() != null){
-                warn("wsdlmodeler.warning.r2716r2726",
-                        new Object[]{"soapbind:header", info.bindingOperation.getName()});
+            if (header.getNamespace() != null) {
+                warning(header, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:header", info.bindingOperation.getName()));
             }
             com.sun.tools.internal.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), info);
-            if (headerMessage == null){
-                fail("wsdlmodeler.invalid.header.cant.resolve.message",
-                        new Object[]{header.getMessage(), info.bindingOperation.getName()});
+            if (headerMessage == null) {
+                error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(header.getMessage(), info.bindingOperation.getName()));
             }
 
             MessagePart part = headerMessage.getPart(header.getPart());
-            if (part == null){
-                fail("wsdlmodeler.invalid.header.notFound",
-                        new Object[]{header.getPart(), info.bindingOperation.getName()});
+            if (part == null) {
+                error(header, ModelerMessages.WSDLMODELER_INVALID_HEADER_NOT_FOUND(header.getPart(), info.bindingOperation.getName()));
             }
             if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
-                fail("wsdlmodeler.invalid.header.message.partMustHaveElementDescriptor",
-                        new Object[]{part.getName(), info.bindingOperation.getName()});
+                error(part, ModelerMessages.WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(part.getName(), info.bindingOperation.getName()));
             }
             part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
             parts.add(part);
@@ -1541,11 +1540,11 @@
         return parts;
     }
 
-    private boolean isOperationDocumentLiteral(StyleAndUse styleAndUse){
+    private boolean isOperationDocumentLiteral(StyleAndUse styleAndUse) {
         return StyleAndUse.DOC_LITERAL == styleAndUse;
     }
 
-    private boolean isOperationRpcLiteral(StyleAndUse styleAndUse){
+    private boolean isOperationRpcLiteral(StyleAndUse styleAndUse) {
         return StyleAndUse.RPC_LITERAL == styleAndUse;
     }
 
@@ -1553,120 +1552,123 @@
      * @param part
      * @return Returns a JAXBType object
      */
-    private JAXBType getJAXBType(MessagePart part){
-        JAXBType type=null;
+    private JAXBType getJAXBType(MessagePart part) {
+        JAXBType type = null;
         QName name = part.getDescriptor();
-        if(part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)){
-            type = getJAXBType(name);
-        }else {
+        if (part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)) {
+            type = jaxbModelBuilder.getJAXBType(name);
+            if(type == null){
+                error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
+            }
+        } else {
             S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
             TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
-            if(typeAnno == null){
-                fail("wsdlmodeler.jaxb.javatype.notfound", new Object[]{name, part.getName()});
+            if (typeAnno == null) {
+                error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(name, part.getName()));
             }
-            JavaType javaType = new  JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
+            JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
             type = new JAXBType(new QName("", part.getName()), javaType);
         }
         return type;
     }
 
-    private List<Parameter> getDoclitParameters(Request req, Response res, List<MessagePart> parameterList){
-        if(parameterList.size() == 0)
+    private List<Parameter> getDoclitParameters(Request req, Response res, List<MessagePart> parameterList) {
+        if (parameterList.size() == 0)
             return new ArrayList<Parameter>();
-        List<Parameter> params = null;
+        List<Parameter> params = new ArrayList<Parameter>();
         Message inMsg = getInputMessage();
         Message outMsg = getOutputMessage();
         boolean unwrappable = isUnwrappable();
         List<Parameter> outParams = null;
         int pIndex = 0;
-        for(MessagePart part:parameterList){
+        for (MessagePart part : parameterList) {
             QName reqBodyName = part.getDescriptor();
             JAXBType jaxbType = getJAXBType(part);
-            Block block = new Block(reqBodyName, jaxbType);
-            if(unwrappable){
+            Block block = new Block(reqBodyName, jaxbType, part);
+            if (unwrappable) {
                 //So build body and header blocks and set to request and response
                 JAXBStructuredType jaxbStructType = ModelerUtils.createJAXBStructureType(jaxbType);
-                block = new Block(reqBodyName, jaxbStructType);
-                if(ModelerUtils.isBoundToSOAPBody(part)){
-                    if(part.isIN()){
+                block = new Block(reqBodyName, jaxbStructType, part);
+                if (ModelerUtils.isBoundToSOAPBody(part)) {
+                    if (part.isIN()) {
                         req.addBodyBlock(block);
-                    }else if(part.isOUT()){
+                    } else if (part.isOUT()) {
                         res.addBodyBlock(block);
-                    }else if(part.isINOUT()){
+                    } else if (part.isINOUT()) {
                         req.addBodyBlock(block);
                         res.addBodyBlock(block);
                     }
-                }else if(ModelerUtils.isUnbound(part)){
-                    if(part.isIN())
+                } else if (ModelerUtils.isUnbound(part)) {
+                    if (part.isIN())
                         req.addUnboundBlock(block);
-                    else if(part.isOUT())
+                    else if (part.isOUT())
                         res.addUnboundBlock(block);
-                    else if(part.isINOUT()){
+                    else if (part.isINOUT()) {
                         req.addUnboundBlock(block);
                         res.addUnboundBlock(block);
                     }
 
                 }
-                if(part.isIN() || part.isINOUT()){
+                if (part.isIN() || part.isINOUT()) {
                     params = ModelerUtils.createUnwrappedParameters(jaxbStructType, block);
                     int index = 0;
-                    Mode mode = (part.isINOUT())?Mode.INOUT:Mode.IN;
-                    for(Parameter param: params){
+                    Mode mode = part.isINOUT() ? Mode.INOUT : Mode.IN;
+                    for (Parameter param : params) {
                         param.setParameterIndex(index++);
                         param.setMode(mode);
                         setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, unwrappable);
                     }
-                }else if(part.isOUT()){
+                } else if (part.isOUT()) {
                     outParams = ModelerUtils.createUnwrappedParameters(jaxbStructType, block);
-                    for(Parameter param: outParams){
+                    for (Parameter param : outParams) {
                         param.setMode(Mode.OUT);
                         setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, unwrappable);
                     }
                 }
-            }else{
-                if(ModelerUtils.isBoundToSOAPBody(part)){
-                    if(part.isIN()){
+            } else {
+                if (ModelerUtils.isBoundToSOAPBody(part)) {
+                    if (part.isIN()) {
                         req.addBodyBlock(block);
-                    }else if(part.isOUT()){
+                    } else if (part.isOUT()) {
                         res.addBodyBlock(block);
-                    }else if(part.isINOUT()){
+                    } else if (part.isINOUT()) {
                         req.addBodyBlock(block);
                         res.addBodyBlock(block);
                     }
-                }else if(ModelerUtils.isBoundToSOAPHeader(part)){
-                    if(part.isIN()){
+                } else if (ModelerUtils.isBoundToSOAPHeader(part)) {
+                    if (part.isIN()) {
                         req.addHeaderBlock(block);
-                    }else if(part.isOUT()){
+                    } else if (part.isOUT()) {
                         res.addHeaderBlock(block);
-                    }else if(part.isINOUT()){
+                    } else if (part.isINOUT()) {
                         req.addHeaderBlock(block);
                         res.addHeaderBlock(block);
                     }
-                }else if(ModelerUtils.isBoundToMimeContent(part)){
+                } else if (ModelerUtils.isBoundToMimeContent(part)) {
                     List<MIMEContent> mimeContents = null;
 
-                    if(part.isIN()){
+                    if (part.isIN()) {
                         mimeContents = getMimeContents(info.bindingOperation.getInput(),
-                                        getInputMessage(), part.getName());
+                                getInputMessage(), part.getName());
                         jaxbType = getAttachmentType(mimeContents, part);
-                        block = new Block(jaxbType.getName(), jaxbType);
+                        block = new Block(jaxbType.getName(), jaxbType, part);
                         req.addAttachmentBlock(block);
-                    }else if(part.isOUT()){
+                    } else if (part.isOUT()) {
                         mimeContents = getMimeContents(info.bindingOperation.getOutput(),
-                                        getOutputMessage(), part.getName());
+                                getOutputMessage(), part.getName());
                         jaxbType = getAttachmentType(mimeContents, part);
-                        block = new Block(jaxbType.getName(), jaxbType);
+                        block = new Block(jaxbType.getName(), jaxbType, part);
                         res.addAttachmentBlock(block);
-                    }else if(part.isINOUT()){
+                    } else if (part.isINOUT()) {
                         mimeContents = getMimeContents(info.bindingOperation.getInput(),
-                                        getInputMessage(), part.getName());
+                                getInputMessage(), part.getName());
                         jaxbType = getAttachmentType(mimeContents, part);
-                        block = new Block(jaxbType.getName(), jaxbType);
+                        block = new Block(jaxbType.getName(), jaxbType, part);
                         req.addAttachmentBlock(block);
                         res.addAttachmentBlock(block);
 
                         mimeContents = getMimeContents(info.bindingOperation.getOutput(),
-                                        getOutputMessage(), part.getName());
+                                getOutputMessage(), part.getName());
                         JAXBType outJaxbType = getAttachmentType(mimeContents, part);
 
                         String inType = jaxbType.getJavaType().getType().getName();
@@ -1674,70 +1676,66 @@
 
                         TypeAndAnnotation inTa = jaxbType.getJavaType().getType().getTypeAnn();
                         TypeAndAnnotation outTa = outJaxbType.getJavaType().getType().getTypeAnn();
-                        if((((inTa != null) && (outTa != null) && inTa.equals(outTa))) && !inType.equals(outType)){
+                        if ((((inTa != null) && (outTa != null) && inTa.equals(outTa))) && !inType.equals(outType)) {
                             String javaType = "javax.activation.DataHandler";
 
                             S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
-                            JCodeModel cm = jaxbModel.generateCode(null,
-                                        new ConsoleErrorReporter(getEnvironment(), false));
-                            JType jt= null;
-                            jt = cm.ref(javaType);
+                            //JCodeModel cm = jaxbModel.generateCode(null, errReceiver);
+                            JType jt = null;
+                            jt = options.getCodeModel().ref(javaType);
                             JAXBTypeAndAnnotation jaxbTa = jaxbType.getJavaType().getType();
                             jaxbTa.setType(jt);
                         }
                     }
-                }else if(ModelerUtils.isUnbound(part)){
-                    if(part.isIN()){
+                } else if (ModelerUtils.isUnbound(part)) {
+                    if (part.isIN()) {
                         req.addUnboundBlock(block);
-                    }else if(part.isOUT()){
+                    } else if (part.isOUT()) {
                         res.addUnboundBlock(block);
-                    }else if(part.isINOUT()){
+                    } else if (part.isINOUT()) {
                         req.addUnboundBlock(block);
                         res.addUnboundBlock(block);
                     }
                 }
-                if(params == null)
-                    params = new ArrayList<Parameter>();
                 Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, block);
                 param.setMode(part.getMode());
-                if(part.isReturn()){
+                if (part.isReturn()) {
                     param.setParameterIndex(-1);
-                }else{
+                } else {
                     param.setParameterIndex(pIndex++);
                 }
 
-                if(part.isIN())
+                if (part.isIN())
                     setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, false);
-                else if(outMsg != null)
+                else if (outMsg != null)
                     setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, false);
 
                 params.add(param);
             }
         }
-        if(unwrappable && (outParams != null)){
+        if (unwrappable && (outParams != null)) {
             int index = params.size();
-            for(Parameter param:outParams){
-                if(param.getName().equals("return")){
+            for (Parameter param : outParams) {
+                if (JAXBRIContext.mangleNameToVariableName(param.getName()).equals("return")) {
                     param.setParameterIndex(-1);
-                }else{
+                } else {
                     Parameter inParam = ModelerUtils.getParameter(param.getName(), params);
-                    if((inParam != null) && inParam.isIN()){
-                        QName inElementName = ((JAXBType)inParam.getType()).getName();
-                        QName outElementName = ((JAXBType)param.getType()).getName();
+                    if ((inParam != null) && inParam.isIN()) {
+                        QName inElementName = inParam.getType().getName();
+                        QName outElementName = param.getType().getName();
                         String inJavaType = inParam.getTypeName();
                         String outJavaType = param.getTypeName();
                         TypeAndAnnotation inTa = inParam.getType().getJavaType().getType().getTypeAnn();
                         TypeAndAnnotation outTa = param.getType().getJavaType().getType().getTypeAnn();
-                        if(inElementName.getLocalPart().equals(outElementName.getLocalPart()) &&
-                                inJavaType.equals(outJavaType) &&
-                                ((inTa == null || outTa == null)||
-                                ((inTa != null) && (outTa != null) && inTa.equals(outTa)))) {
+                        if (inElementName.getLocalPart().equals(outElementName.getLocalPart()) && inJavaType.equals(outJavaType) &&
+                                (inTa == null || outTa == null || inTa.equals(outTa))) {
                             inParam.setMode(Mode.INOUT);
                             continue;
                         }
-                    }else if(outParams.size() == 1){
+                    }
+                    if (outParams.size() == 1) {
                         param.setParameterIndex(-1);
-                    }else{
+                    } else {
                         param.setParameterIndex(index++);
                     }
                 }
@@ -1747,42 +1745,42 @@
         return params;
     }
 
-    private List<Parameter> getRpcLitParameters(Request req, Response res, Block reqBlock, Block resBlock, List<MessagePart> paramList){
+    private List<Parameter> getRpcLitParameters(Request req, Response res, Block reqBlock, Block resBlock, List<MessagePart> paramList) {
         List<Parameter> params = new ArrayList<Parameter>();
         Message inMsg = getInputMessage();
         Message outMsg = getOutputMessage();
-        S2JJAXBModel jaxbModel = ((RpcLitStructure)reqBlock.getType()).getJaxbModel().getS2JJAXBModel();
-        List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel);
+        S2JJAXBModel jaxbModel = ((RpcLitStructure) reqBlock.getType()).getJaxbModel().getS2JJAXBModel();
+        List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel, errReceiver);
         List<Parameter> outParams = null;
-        if(outMsg != null)
-            outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel);
+        if (outMsg != null)
+            outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel, errReceiver);
 
         //create parameters for header and mime parts
         int index = 0;
-        for(MessagePart part: paramList){
-             Parameter param = null;
-            if(ModelerUtils.isBoundToSOAPBody(part)){
-                if(part.isIN()){
+        for (MessagePart part : paramList) {
+            Parameter param = null;
+            if (ModelerUtils.isBoundToSOAPBody(part)) {
+                if (part.isIN()) {
                     param = ModelerUtils.getParameter(part.getName(), inParams);
-                }else if(outParams != null){
+                } else if (outParams != null) {
                     param = ModelerUtils.getParameter(part.getName(), outParams);
                 }
-            }else if(ModelerUtils.isBoundToSOAPHeader(part)){
+            } else if (ModelerUtils.isBoundToSOAPHeader(part)) {
                 QName headerName = part.getDescriptor();
-                JAXBType jaxbType = getJAXBType(headerName);
-                Block headerBlock = new Block(headerName, jaxbType);
+                JAXBType jaxbType = getJAXBType(part);
+                Block headerBlock = new Block(headerName, jaxbType, part);
                 param = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
-                if(part.isIN()){
+                if (part.isIN()) {
                     req.addHeaderBlock(headerBlock);
-                }else if(part.isOUT()){
+                } else if (part.isOUT()) {
                     res.addHeaderBlock(headerBlock);
-                }else if(part.isINOUT()){
+                } else if (part.isINOUT()) {
                     req.addHeaderBlock(headerBlock);
                     res.addHeaderBlock(headerBlock);
                 }
-            }else if(ModelerUtils.isBoundToMimeContent(part)){
+            } else if (ModelerUtils.isBoundToMimeContent(part)) {
                 List<MIMEContent> mimeContents = null;
-                if(part.isIN() || part.isINOUT())
+                if (part.isIN() || part.isINOUT())
                     mimeContents = getMimeContents(info.bindingOperation.getInput(),
                             getInputMessage(), part.getName());
                 else
@@ -1792,59 +1790,57 @@
                 JAXBType type = getAttachmentType(mimeContents, part);
                 //create Parameters in request or response
                 //Block mimeBlock = new Block(new QName(part.getName()), type);
-                Block mimeBlock = new Block(type.getName(), type);
+                Block mimeBlock = new Block(type.getName(), type, part);
                 param = ModelerUtils.createParameter(part.getName(), type, mimeBlock);
-                if(part.isIN()){
+                if (part.isIN()) {
                     req.addAttachmentBlock(mimeBlock);
-                }else if(part.isOUT()){
+                } else if (part.isOUT()) {
                     res.addAttachmentBlock(mimeBlock);
-                }else if(part.isINOUT()){
+                } else if (part.isINOUT()) {
                     mimeContents = getMimeContents(info.bindingOperation.getOutput(),
-                                    getOutputMessage(), part.getName());
+                            getOutputMessage(), part.getName());
                     JAXBType outJaxbType = getAttachmentType(mimeContents, part);
 
                     String inType = type.getJavaType().getType().getName();
                     String outType = outJaxbType.getJavaType().getType().getName();
-                    if(!inType.equals(outType)){
+                    if (!inType.equals(outType)) {
                         String javaType = "javax.activation.DataHandler";
-                        JCodeModel cm = jaxbModel.generateCode(null,
-                                    new ConsoleErrorReporter(getEnvironment(), false));
-                        JType jt= null;
-                        jt = cm.ref(javaType);
+                        JType jt = null;
+                        jt = options.getCodeModel().ref(javaType);
                         JAXBTypeAndAnnotation jaxbTa = type.getJavaType().getType();
                         jaxbTa.setType(jt);
                     }
                     req.addAttachmentBlock(mimeBlock);
                     res.addAttachmentBlock(mimeBlock);
                 }
-            }else if(ModelerUtils.isUnbound(part)){
+            } else if (ModelerUtils.isUnbound(part)) {
                 QName name = part.getDescriptor();
                 JAXBType type = getJAXBType(part);
-                Block unboundBlock = new Block(name, type);
-                if(part.isIN()){
+                Block unboundBlock = new Block(name, type, part);
+                if (part.isIN()) {
                     req.addUnboundBlock(unboundBlock);
-                }else if(part.isOUT()){
+                } else if (part.isOUT()) {
                     res.addUnboundBlock(unboundBlock);
-                }else if(part.isINOUT()){
+                } else if (part.isINOUT()) {
                     req.addUnboundBlock(unboundBlock);
                     res.addUnboundBlock(unboundBlock);
                 }
                 param = ModelerUtils.createParameter(part.getName(), type, unboundBlock);
             }
-            if(param != null){
-                if(part.isReturn()){
+            if (param != null) {
+                if (part.isReturn()) {
                     param.setParameterIndex(-1);
-                }else{
+                } else {
                     param.setParameterIndex(index++);
                 }
                 param.setMode(part.getMode());
                 params.add(param);
             }
         }
-        for(Parameter param : params){
-            if(param.isIN())
+        for (Parameter param : params) {
+            if (param.isIN())
                 setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false);
-            else if(outMsg != null)
+            else if (outMsg != null)
                 setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false);
         }
         return params;
@@ -1853,7 +1849,7 @@
     private List<Parameter> getRequestParameters(Request request, List<String> parameterList) {
         Message inputMessage = getInputMessage();
         //there is no input message, return zero parameters
-        if(inputMessage != null && !inputMessage.parts().hasNext())
+        if (inputMessage != null && !inputMessage.parts().hasNext())
             return new ArrayList<Parameter>();
 
         List<Parameter> inParameters = null;
@@ -1863,43 +1859,43 @@
         boolean unwrappable = isUnwrappable();
         boolean doneSOAPBody = false;
         //setup request parameters
-        for(String inParamName: parameterList){
+        for (String inParamName : parameterList) {
             MessagePart part = inputMessage.getPart(inParamName);
-            if(part == null)
+            if (part == null)
                 continue;
             reqBodyName = part.getDescriptor();
             jaxbReqType = getJAXBType(part);
-            if(unwrappable){
+            if (unwrappable) {
                 //So build body and header blocks and set to request and response
                 JAXBStructuredType jaxbRequestType = ModelerUtils.createJAXBStructureType(jaxbReqType);
-                reqBlock = new Block(reqBodyName, jaxbRequestType);
-                if(ModelerUtils.isBoundToSOAPBody(part)){
+                reqBlock = new Block(reqBodyName, jaxbRequestType, part);
+                if (ModelerUtils.isBoundToSOAPBody(part)) {
                     request.addBodyBlock(reqBlock);
-                }else if(ModelerUtils.isUnbound(part)){
+                } else if (ModelerUtils.isUnbound(part)) {
                     request.addUnboundBlock(reqBlock);
                 }
                 inParameters = ModelerUtils.createUnwrappedParameters(jaxbRequestType, reqBlock);
-                for(Parameter param: inParameters){
+                for (Parameter param : inParameters) {
                     setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, unwrappable);
                 }
-            }else{
-                reqBlock = new Block(reqBodyName, jaxbReqType);
-                if(ModelerUtils.isBoundToSOAPBody(part) && !doneSOAPBody){
+            } else {
+                reqBlock = new Block(reqBodyName, jaxbReqType, part);
+                if (ModelerUtils.isBoundToSOAPBody(part) && !doneSOAPBody) {
                     doneSOAPBody = true;
                     request.addBodyBlock(reqBlock);
-                }else if(ModelerUtils.isBoundToSOAPHeader(part)){
+                } else if (ModelerUtils.isBoundToSOAPHeader(part)) {
                     request.addHeaderBlock(reqBlock);
-                }else if(ModelerUtils.isBoundToMimeContent(part)){
+                } else if (ModelerUtils.isBoundToMimeContent(part)) {
                     List<MIMEContent> mimeContents = getMimeContents(info.bindingOperation.getInput(),
-                        getInputMessage(), part.getName());
+                            getInputMessage(), part.getName());
                     jaxbReqType = getAttachmentType(mimeContents, part);
                     //reqBlock = new Block(new QName(part.getName()), jaxbReqType);
-                    reqBlock = new Block(jaxbReqType.getName(), jaxbReqType);
+                    reqBlock = new Block(jaxbReqType.getName(), jaxbReqType, part);
                     request.addAttachmentBlock(reqBlock);
-                }else if(ModelerUtils.isUnbound(part)){
+                } else if (ModelerUtils.isUnbound(part)) {
                     request.addUnboundBlock(reqBlock);
                 }
-                if(inParameters == null)
+                if (inParameters == null)
                     inParameters = new ArrayList<Parameter>();
                 Parameter param = ModelerUtils.createParameter(part.getName(), jaxbReqType, reqBlock);
                 setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, false);
@@ -1914,46 +1910,26 @@
      * @param param
      * @param wrapperStyle TODO
      */
-    private void setCustomizedParameterName(Extensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
-        JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(extension, JAXWSBinding.class);
-        if(jaxwsBinding == null)
+    private void setCustomizedParameterName(TWSDLExtensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
+        JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(extension, JAXWSBinding.class);
+        if (jaxwsBinding == null)
             return;
         String paramName = part.getName();
         QName elementName = part.getDescriptor();
-        if(wrapperStyle)
+        if (wrapperStyle)
             elementName = param.getType().getName();
         String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
-        if(customName != null && !customName.equals("")){
+        if (customName != null && !customName.equals("")) {
             param.setCustomName(customName);
         }
     }
 
-    /**
-     * @param name
-     * @return
-     */
-    private JAXBType getJAXBType(QName name) {
-        return jaxbModelBuilder.getJAXBType(name);
-    }
-
     protected boolean isConflictingPortClassName(String name) {
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see WSDLModelerBase#getJAXBSchemaAnalyzerInstnace(WSDLModelInfo, Properties, org.w3c.dom.Element)
-     */
-    protected JAXBModelBuilder getJAXBSchemaAnalyzerInstnace(WSDLModelInfo info,
-                                                             Properties options,
-                                                             ClassNameCollector classNameCollector, List elements) {
-        return new JAXBModelBuilder(info, options, classNameCollector, elements);
-    }
-
-    /* (non-Javadoc)
-     * @see WSDLModelerBase#isUnwrappable()
-     */
     protected boolean isUnwrappable() {
-        if(!getWrapperStyleCustomization())
+        if (!getWrapperStyleCustomization())
             return false;
 
         com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage();
@@ -1962,27 +1938,27 @@
         // Wrapper style if the operation's input and output messages each contain
         // only a single part
         if ((inputMessage != null && inputMessage.numParts() != 1)
-            || (outputMessage != null && outputMessage.numParts() != 1)) {
+                || (outputMessage != null && outputMessage.numParts() != 1)) {
             return false;
         }
 
         MessagePart inputPart = inputMessage != null
-                ? (MessagePart)inputMessage.parts().next() : null;
+                ? inputMessage.parts().next() : null;
         MessagePart outputPart = outputMessage != null
-                ? (MessagePart)outputMessage.parts().next() : null;
+                ? outputMessage.parts().next() : null;
         String operationName = info.portTypeOperation.getName();
 
         // Wrapper style if the input message part refers to a global element declaration whose localname
         // is equal to the operation name
         // Wrapper style if the output message part refers to a global element declaration
         if ((inputPart != null && !inputPart.getDescriptor().getLocalPart().equals(operationName)) ||
-            (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
+                (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
             return false;
 
         //check to see if either input or output message part not bound to soapbing:body
         //in that case the operation is not wrapper style
-        if(((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) ||
-                ((outputPart != null) &&(outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)))
+        if (((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) ||
+                ((outputPart != null) && (outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)))
             return false;
 
         // Wrapper style if the elements referred to by the input and output message parts
@@ -1993,52 +1969,49 @@
         //These checkins are done by jaxb, we just check if jaxb has wrapper children. If there
         // are then its wrapper style
         //if(inputPart != null && outputPart != null){
-        if(inputPart != null){
+        if (inputPart != null) {
             boolean inputWrappable = false;
-            JAXBType inputType = getJAXBType(inputPart.getDescriptor());
-            if(inputType != null){
+            JAXBType inputType = getJAXBType(inputPart);
+            if (inputType != null) {
                 inputWrappable = inputType.isUnwrappable();
             }
             //if there are no output part (oneway), the operation can still be wrapper style
-            if(outputPart == null){
-               return inputWrappable;
+            if (outputPart == null) {
+                return inputWrappable;
             }
-            JAXBType outputType = getJAXBType(outputPart.getDescriptor());
-            if((inputType != null) && (outputType != null))
+            JAXBType outputType = getJAXBType(outputPart);
+            if ((inputType != null) && (outputType != null))
                 return inputType.isUnwrappable() && outputType.isUnwrappable();
         }
 
         return false;
     }
 
-    /**
-     * @return
-     */
     private boolean getWrapperStyleCustomization() {
         //first we look into wsdl:portType/wsdl:operation
         com.sun.tools.internal.ws.wsdl.document.Operation portTypeOperation = info.portTypeOperation;
-        JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portTypeOperation, JAXWSBinding.class);
-        if(jaxwsBinding != null){
-             Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
-             if(isWrappable != null)
-                 return isWrappable;
+        JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portTypeOperation, JAXWSBinding.class);
+        if (jaxwsBinding != null) {
+            Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+            if (isWrappable != null)
+                return isWrappable;
         }
 
         //then into wsdl:portType
         PortType portType = info.port.resolveBinding(document).resolvePortType(document);
-        jaxwsBinding = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
-        if(jaxwsBinding != null){
-             Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
-             if(isWrappable != null)
-                 return isWrappable;
+        jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
+        if (jaxwsBinding != null) {
+            Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+            if (isWrappable != null)
+                return isWrappable;
         }
 
         //then wsdl:definitions
-        jaxwsBinding = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
-        if(jaxwsBinding != null){
-             Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
-             if(isWrappable != null)
-                 return isWrappable;
+        jaxwsBinding = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+        if (jaxwsBinding != null) {
+            Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+            if (isWrappable != null)
+                return isWrappable;
         }
         return true;
     }
@@ -2047,21 +2020,21 @@
      * @see WSDLModelerBase#isSingleInOutPart(Set, MessagePart)
      */
     protected boolean isSingleInOutPart(Set inputParameterNames,
-            MessagePart outputPart) {
+                                        MessagePart outputPart) {
         // As of now, we dont have support for in/out in doc-lit. So return false.
         SOAPOperation soapOperation =
-            (SOAPOperation) getExtensionOfType(info.bindingOperation,
-                    SOAPOperation.class);
-        if((soapOperation != null) && (soapOperation.isDocument() || info.soapBinding.isDocument())) {
+                (SOAPOperation) getExtensionOfType(info.bindingOperation,
+                        SOAPOperation.class);
+        if ((soapOperation != null) && (soapOperation.isDocument() || info.soapBinding.isDocument())) {
             Iterator iter = getInputMessage().parts();
-            while(iter.hasNext()){
-                MessagePart part = (MessagePart)iter.next();
-                if(outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor()))
+            while (iter.hasNext()) {
+                MessagePart part = (MessagePart) iter.next();
+                if (outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor()))
                     return true;
             }
-        }else if(soapOperation != null && soapOperation.isRPC()|| info.soapBinding.isRPC()){
+        } else if (soapOperation != null && soapOperation.isRPC() || info.soapBinding.isRPC()) {
             com.sun.tools.internal.ws.wsdl.document.Message inputMessage = getInputMessage();
-            if(inputParameterNames.contains(outputPart.getName())) {
+            if (inputParameterNames.contains(outputPart.getName())) {
                 if (inputMessage.getPart(outputPart.getName()).getDescriptor().equals(outputPart.getDescriptor())) {
                     return true;
                 }
@@ -2072,27 +2045,27 @@
 
     private List<Parameter> createRpcLitRequestParameters(Request request, List<String> parameterList, Block block) {
         Message message = getInputMessage();
-        S2JJAXBModel jaxbModel = ((RpcLitStructure)block.getType()).getJaxbModel().getS2JJAXBModel();
-        List<Parameter> parameters = ModelerUtils.createRpcLitParameters(message, block, jaxbModel);
+        S2JJAXBModel jaxbModel = ((RpcLitStructure) block.getType()).getJaxbModel().getS2JJAXBModel();
+        List<Parameter> parameters = ModelerUtils.createRpcLitParameters(message, block, jaxbModel, errReceiver);
 
         //create parameters for header and mime parts
-        for(String paramName: parameterList){
+        for (String paramName : parameterList) {
             MessagePart part = message.getPart(paramName);
-            if(part == null)
+            if (part == null)
                 continue;
-            if(ModelerUtils.isBoundToSOAPHeader(part)){
-                if(parameters == null)
+            if (ModelerUtils.isBoundToSOAPHeader(part)) {
+                if (parameters == null)
                     parameters = new ArrayList<Parameter>();
                 QName headerName = part.getDescriptor();
-                JAXBType jaxbType = getJAXBType(headerName);
-                Block headerBlock = new Block(headerName, jaxbType);
+                JAXBType jaxbType = getJAXBType(part);
+                Block headerBlock = new Block(headerName, jaxbType, part);
                 request.addHeaderBlock(headerBlock);
                 Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
-                if(param != null){
+                if (param != null) {
                     parameters.add(param);
                 }
-            }else if(ModelerUtils.isBoundToMimeContent(part)){
-                if(parameters == null)
+            } else if (ModelerUtils.isBoundToMimeContent(part)) {
+                if (parameters == null)
                     parameters = new ArrayList<Parameter>();
                 List<MIMEContent> mimeContents = getMimeContents(info.bindingOperation.getInput(),
                         getInputMessage(), paramName);
@@ -2100,73 +2073,70 @@
                 JAXBType type = getAttachmentType(mimeContents, part);
                 //create Parameters in request or response
                 //Block mimeBlock = new Block(new QName(part.getName()), type);
-                Block mimeBlock = new Block(type.getName(), type);
+                Block mimeBlock = new Block(type.getName(), type, part);
                 request.addAttachmentBlock(mimeBlock);
                 Parameter param = ModelerUtils.createParameter(part.getName(), type, mimeBlock);
-                if(param != null){
+                if (param != null) {
                     parameters.add(param);
                 }
-            }else if(ModelerUtils.isUnbound(part)){
-                if(parameters == null)
+            } else if (ModelerUtils.isUnbound(part)) {
+                if (parameters == null)
                     parameters = new ArrayList<Parameter>();
                 QName name = part.getDescriptor();
                 JAXBType type = getJAXBType(part);
-                Block unboundBlock = new Block(name, type);
+                Block unboundBlock = new Block(name, type, part);
                 request.addUnboundBlock(unboundBlock);
                 Parameter param = ModelerUtils.createParameter(part.getName(), type, unboundBlock);
-                if(param != null){
+                if (param != null) {
                     parameters.add(param);
                 }
             }
         }
-        for(Parameter param : parameters){
+        for (Parameter param : parameters) {
             setCustomizedParameterName(info.portTypeOperation, message, message.getPart(param.getName()), param, false);
         }
         return parameters;
     }
 
-    private String getJavaTypeForMimeType(String mimeType){
-        if(mimeType.equals("image/jpeg") || mimeType.equals("image/gif")){
+    private String getJavaTypeForMimeType(String mimeType) {
+        if (mimeType.equals("image/jpeg") || mimeType.equals("image/gif")) {
             return "java.awt.Image";
-        }else if(mimeType.equals("text/xml") || mimeType.equals("application/xml")){
+        } else if (mimeType.equals("text/xml") || mimeType.equals("application/xml")) {
             return "javax.xml.transform.Source";
         }
         return "javax.activation.DataHandler";
     }
 
-    /**
-     * @param mimeContents
-     * @return
-     */
     private JAXBType getAttachmentType(List<MIMEContent> mimeContents, MessagePart part) {
-        if(!enableMimeContent()){
+        if (!enableMimeContent()) {
             return getJAXBType(part);
         }
         String javaType = null;
         List<String> mimeTypes = getAlternateMimeTypes(mimeContents);
-        if(mimeTypes.size() > 1) {
+        if (mimeTypes.size() > 1) {
             javaType = "javax.activation.DataHandler";
-        }else{
-           javaType = getJavaTypeForMimeType(mimeTypes.get(0));
+        } else {
+            javaType = getJavaTypeForMimeType(mimeTypes.get(0));
         }
 
         S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
-        JCodeModel cm = jaxbModel.generateCode(null,
-                    new ConsoleErrorReporter(getEnvironment(), false));
-        JType jt= null;
-        jt = cm.ref(javaType);
+        JType jt = null;
+        jt = options.getCodeModel().ref(javaType);
         QName desc = part.getDescriptor();
         TypeAndAnnotation typeAnno = null;
 
         if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) {
             typeAnno = jaxbModel.getJavaType(desc);
             desc = new QName("", part.getName());
-        } else if (part.getDescriptorKind()== SchemaKinds.XSD_ELEMENT) {
+        } else if (part.getDescriptorKind() == SchemaKinds.XSD_ELEMENT) {
             typeAnno = getJAXBModelBuilder().getElementTypeAndAnn(desc);
-            for(Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) {
-                String mimeType = (String)mimeTypeIter.next();
-                if((!mimeType.equals("text/xml") &&
-                        !mimeType.equals("application/xml"))){
+            if(typeAnno == null){
+                error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(part.getDescriptor(), part.getName()));
+            }
+            for (Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) {
+                String mimeType = (String) mimeTypeIter.next();
+                if ((!mimeType.equals("text/xml") &&
+                        !mimeType.equals("application/xml"))) {
                     //According to AP 1.0,
                     //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a
                     //global element declaration (via the element attribute of the wsdl:part
@@ -2175,48 +2145,45 @@
                     //XML serialization.
                     //should we throw warning?
                     //type = MimeHelper.javaType.DATA_HANDLER_JAVATYPE;
-                    warn("mimemodeler.elementPart.invalidElementMimeType",
-                            new Object[] {
-                            part.getName(), mimeType});
+                    warning(part, ModelerMessages.MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(part.getName(), mimeType));
                 }
             }
         }
-        if(typeAnno == null){
-            fail("wsdlmodeler.jaxb.javatype.notfound", new Object[]{desc, part.getName()});
+        if (typeAnno == null) {
+            error(part, ModelerMessages.WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(desc, part.getName()));
         }
         return new JAXBType(desc, new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno, jt)),
                 null, getJAXBModelBuilder().getJAXBModel());
     }
 
-    protected void buildJAXBModel(WSDLDocument wsdlDocument, WSDLModelInfo modelInfo, ClassNameCollector classNameCollector) {
-        JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(getWSDLModelInfo(), _options, classNameCollector, parser.getSchemaElements());
+    protected void buildJAXBModel(WSDLDocument wsdlDocument) {
+        JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(options, classNameCollector, forest, errReceiver);
         //set the java package where wsdl artifacts will be generated
         //if user provided package name  using -p switch (or package property on wsimport ant task)
         //ignore the package customization in the wsdl and schema bidnings
-        if(getWSDLModelInfo().getDefaultJavaPackage() != null){
-            getWSDLModelInfo().setJavaPackageName(getWSDLModelInfo().getDefaultJavaPackage());
-            jaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(getWSDLModelInfo().getJavaPackageName());
-        }else{
-            String jaxwsPackage = getJavaPackage();
-            getWSDLModelInfo().setJavaPackageName(jaxwsPackage);
+        //formce the -p option only in the first pass
+        if (explicitDefaultPackage != null) {
+            jaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(options.defaultPackage);
+        } else {
+            options.defaultPackage = getJavaPackage();
         }
 
         //create pseudo schema for async operations(if any) response bean
-        List<InputSource> schemas = PseudoSchemaBuilder.build(this, _modelInfo);
-        for(InputSource schema : schemas){
+        List<InputSource> schemas = PseudoSchemaBuilder.build(this, options, errReceiver);
+        for (InputSource schema : schemas) {
             jaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema);
         }
         jaxbModelBuilder.bind();
         this.jaxbModelBuilder = jaxbModelBuilder;
     }
 
-    protected String getJavaPackage(){
+    protected String getJavaPackage() {
         String jaxwsPackage = null;
-        JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
-        if(jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null){
+        JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+        if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
             jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
         }
-        if(jaxwsPackage != null){
+        if (jaxwsPackage != null) {
             return jaxwsPackage;
         }
         String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
@@ -2231,7 +2198,7 @@
     }
 
     protected void createJavaInterfaceForPort(Port port, boolean isProvider) {
-        if(isProvider){
+        if (isProvider) {
             createJavaInterfaceForProviderPort(port);
             return;
         }
@@ -2244,13 +2211,13 @@
         JavaInterface intf = new JavaInterface(interfaceName);
         for (Operation operation : port.getOperations()) {
             createJavaMethodForOperation(
-                port,
-                operation,
-                intf);
+                    port,
+                    operation,
+                    intf);
 
-            for(JavaParameter jParam : operation.getJavaMethod().getParametersList()){
+            for (JavaParameter jParam : operation.getJavaMethod().getParametersList()) {
                 Parameter param = jParam.getParameter();
-                if(param.getCustomName() != null)
+                if (param.getCustomName() != null)
                     jParam.setName(param.getCustomName());
             }
         }
@@ -2260,39 +2227,31 @@
 
     protected String getServiceInterfaceName(QName serviceQName, com.sun.tools.internal.ws.wsdl.document.Service wsdlService) {
         String serviceName = wsdlService.getName();
-        JAXWSBinding jaxwsCust = (JAXWSBinding)getExtensionOfType(wsdlService, JAXWSBinding.class);
-        if(jaxwsCust != null && jaxwsCust.getClassName() != null){
+        JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(wsdlService, JAXWSBinding.class);
+        if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
             CustomName name = jaxwsCust.getClassName();
-            if(name != null && !name.equals(""))
+            if (name != null && !name.equals(""))
                 serviceName = name.getName();
         }
         String serviceInterface = "";
-        String javaPackageName = null;
-        if (_modelInfo.getJavaPackageName() != null
-            && !_modelInfo.getJavaPackageName().equals("")) {
-            javaPackageName = _modelInfo.getJavaPackageName();
-        }
-        if (javaPackageName != null) {
-            serviceInterface = javaPackageName + ".";
-        }
+        String javaPackageName = options.defaultPackage;
+        serviceInterface = javaPackageName + ".";
+
         serviceInterface
-            += getEnvironment().getNames().validJavaClassName(serviceName);
+                += JAXBRIContext.mangleNameToClassName(serviceName);
         return serviceInterface;
     }
 
     protected String getJavaNameOfSEI(Port port) {
         QName portTypeName =
-            (QName)port.getProperty(
-                ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
-        PortType pt = (PortType)document.find(Kinds.PORT_TYPE, portTypeName);
-        JAXWSBinding jaxwsCust = (JAXWSBinding)getExtensionOfType(pt, JAXWSBinding.class);
-        if(jaxwsCust != null && jaxwsCust.getClassName() != null){
+                (QName) port.getProperty(
+                        ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
+        PortType pt = (PortType) document.find(Kinds.PORT_TYPE, portTypeName);
+        JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(pt, JAXWSBinding.class);
+        if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
             CustomName name = jaxwsCust.getClassName();
-            if(name != null && !name.equals("")){
-                return makePackageQualified(
-                        name.getName(),
-                        portTypeName,
-                        false);
+            if (name != null && !name.equals("")) {
+                return makePackageQualified(name.getName());
             }
         }
 
@@ -2300,62 +2259,54 @@
         if (portTypeName != null) {
             // got portType information from WSDL, use it to name the interface
             interfaceName =
-                makePackageQualified(JAXBRIContext.mangleNameToClassName(portTypeName.getLocalPart()),
-                                        portTypeName,
-                                        false);
+                    makePackageQualified(JAXBRIContext.mangleNameToClassName(portTypeName.getLocalPart()));
         } else {
             // somehow we only got the port name, so we use that
             interfaceName =
-                makePackageQualified(
-                    JAXBRIContext.mangleNameToClassName(port.getName().getLocalPart()),
-                    port.getName(),
-                    false);
+                    makePackageQualified(JAXBRIContext.mangleNameToClassName(port.getName().getLocalPart()));
         }
         return interfaceName;
     }
 
     private void createJavaMethodForAsyncOperation(Port port, Operation operation,
-            JavaInterface intf){
+                                                   JavaInterface intf) {
         String candidateName = getJavaNameForOperation(operation);
-        JavaMethod method = new JavaMethod(candidateName);
-        method.setThrowsRemoteException(false);
+        JavaMethod method = new JavaMethod(candidateName, errReceiver);
         Request request = operation.getRequest();
         Iterator requestBodyBlocks = request.getBodyBlocks();
         Block requestBlock =
-            (requestBodyBlocks.hasNext()
-                ? (Block)request.getBodyBlocks().next()
-                : null);
+                (requestBodyBlocks.hasNext()
+                        ? (Block) request.getBodyBlocks().next()
+                        : null);
 
         Response response = operation.getResponse();
         Iterator responseBodyBlocks = null;
-        Block responseBlock = null;
+        Block responseBlock;
         if (response != null) {
             responseBodyBlocks = response.getBodyBlocks();
             responseBlock =
-                responseBodyBlocks.hasNext()
-                    ? (Block)response.getBodyBlocks().next()
-                    : null;
+                    responseBodyBlocks.hasNext()
+                            ? (Block) response.getBodyBlocks().next()
+                            : null;
         }
 
         // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
         // detect overloading conflicts in the generated java interface/classes
         String signature = candidateName;
         for (Iterator iter = request.getParameters(); iter.hasNext();) {
-            Parameter parameter = (Parameter)iter.next();
+            Parameter parameter = (Parameter) iter.next();
 
             if (parameter.getJavaParameter() != null) {
-                throw new ModelerException(
-                    "wsdlmodeler.invalidOperation",
-                    operation.getName().getLocalPart());
+                error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
             }
 
             JavaType parameterType = parameter.getType().getJavaType();
             JavaParameter javaParameter =
-                new JavaParameter(
-                    JAXBRIContext.mangleNameToVariableName(parameter.getName()),
-                    parameterType,
-                    parameter,
-                    parameter.getLinkedParameter() != null);
+                    new JavaParameter(
+                            JAXBRIContext.mangleNameToVariableName(parameter.getName()),
+                            parameterType,
+                            parameter,
+                            parameter.getLinkedParameter() != null);
             if (javaParameter.isHolder()) {
                 javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
             }
@@ -2367,9 +2318,9 @@
 
         if (response != null) {
             String resultParameterName =
-                (String)operation.getProperty(WSDL_RESULT_PARAMETER);
+                    (String) operation.getProperty(WSDL_RESULT_PARAMETER);
             Parameter resultParameter =
-                response.getParameterByName(resultParameterName);
+                    response.getParameterByName(resultParameterName);
             JavaType returnType = resultParameter.getType().getJavaType();
             method.setReturnType(returnType);
 
@@ -2379,34 +2330,40 @@
     }
 
     /* (non-Javadoc)
-     * @see WSDLModelerBase#createJavaMethodForOperation(Port, Operation, JavaInterface, Set, Set)
+     * @see WSDLModelerBase#createJavaMethodForOperation(WSDLPort, WSDLOperation, JavaInterface, Set, Set)
      */
     protected void createJavaMethodForOperation(Port port, Operation operation, JavaInterface intf) {
-        if((operation instanceof AsyncOperation)){
+        if ((operation instanceof AsyncOperation)) {
             createJavaMethodForAsyncOperation(port, operation, intf);
             return;
         }
         String candidateName = getJavaNameForOperation(operation);
-        JavaMethod method = new JavaMethod(candidateName);
+        JavaMethod method = new JavaMethod(candidateName, errReceiver);
         Request request = operation.getRequest();
-        Parameter returnParam = (Parameter)operation.getProperty(WSDL_RESULT_PARAMETER);
-        if(returnParam != null){
+        Parameter returnParam = (Parameter) operation.getProperty(WSDL_RESULT_PARAMETER);
+        if (returnParam != null) {
             JavaType parameterType = returnParam.getType().getJavaType();
             method.setReturnType(parameterType);
-        }else{
+        } else {
             JavaType ret = new JavaSimpleTypeCreator().VOID_JAVATYPE;
             method.setReturnType(ret);
         }
-        List<Parameter> parameterOrder = (List<Parameter>)operation.getProperty(WSDL_PARAMETER_ORDER);
-        for(Parameter param:parameterOrder){
+        List<Parameter> parameterOrder = (List<Parameter>) operation.getProperty(WSDL_PARAMETER_ORDER);
+        for (Parameter param : parameterOrder) {
             JavaType parameterType = param.getType().getJavaType();
-            String name = (param.getCustomName() != null)?param.getCustomName():param.getName();
+            String name = (param.getCustomName() != null) ? param.getCustomName() : param.getName();
+            name = JAXBRIContext.mangleNameToVariableName(name);
+            //if its a java keyword after name mangling, then we simply put underscore as there is no
+            //need to ask user to customize the parameter name if its java keyword
+            if(Names.isJavaReservedWord(name)){
+                name = "_"+name;
+            }
             JavaParameter javaParameter =
-                new JavaParameter(
-                    JAXBRIContext.mangleNameToVariableName(name),
-                    parameterType,
-                    param,
-                    param.isINOUT()||param.isOUT());
+                    new JavaParameter(
+                            name,
+                            parameterType,
+                            param,
+                            param.isINOUT() || param.isOUT());
             if (javaParameter.isHolder()) {
                 javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
             }
@@ -2418,15 +2375,15 @@
 
         String opName = JAXBRIContext.mangleNameToVariableName(operation.getName().getLocalPart());
         for (Iterator iter = operation.getFaults();
-            iter != null && iter.hasNext();
-            ) {
-            Fault fault = (Fault)iter.next();
+             iter != null && iter.hasNext();
+                ) {
+            Fault fault = (Fault) iter.next();
             createJavaExceptionFromLiteralType(fault, port, opName);
         }
         JavaException javaException;
         Fault fault;
         for (Iterator iter = operation.getFaults(); iter.hasNext();) {
-            fault = (Fault)iter.next();
+            fault = (Fault) iter.next();
             javaException = fault.getJavaException();
             method.addException(javaException.getName());
         }
@@ -2434,32 +2391,28 @@
     }
 
     protected boolean createJavaExceptionFromLiteralType(Fault fault, com.sun.tools.internal.ws.processor.model.Port port, String operationName) {
-        ProcessorEnvironment _env = getProcessorEnvironment();
-
-        JAXBType faultType = (JAXBType)fault.getBlock().getType();
+        JAXBType faultType = (JAXBType) fault.getBlock().getType();
 
         String exceptionName =
-            makePackageQualified(
-                _env.getNames().validJavaClassName(fault.getName()),
-                port.getName());
+                makePackageQualified(JAXBRIContext.mangleNameToClassName(fault.getName()));
 
         // use fault namespace attribute
         JAXBStructuredType jaxbStruct = new JAXBStructuredType(new QName(
-                                            fault.getBlock().getName().getNamespaceURI(),
-                                            fault.getName()));
+                fault.getBlock().getName().getNamespaceURI(),
+                fault.getName()));
 
         QName memberName = fault.getElementName();
         JAXBElementMember jaxbMember =
-            new JAXBElementMember(memberName, faultType);
+                new JAXBElementMember(memberName, faultType);
         //jaxbMember.setNillable(faultType.isNillable());
 
         String javaMemberName = getLiteralJavaMemberName(fault);
         JavaStructureMember javaMember = new JavaStructureMember(
-                                            javaMemberName,
-                                            faultType.getJavaType(),
-                                            jaxbMember);
+                javaMemberName,
+                faultType.getJavaType(),
+                jaxbMember);
         jaxbMember.setJavaStructureMember(javaMember);
-        javaMember.setReadMethod(_env.getNames().getJavaMemberReadMethod(javaMember));
+        javaMember.setReadMethod(Names.getJavaMemberReadMethod(javaMember));
         javaMember.setInherited(false);
         jaxbMember.setJavaStructureMember(javaMember);
         jaxbStruct.add(jaxbMember);
@@ -2468,11 +2421,11 @@
             exceptionName += "_Exception";
         }
 
-        JavaException existingJavaException = (JavaException)_javaExceptions.get(exceptionName);
+        JavaException existingJavaException = (JavaException) _javaExceptions.get(exceptionName);
         if (existingJavaException != null) {
             if (existingJavaException.getName().equals(exceptionName)) {
-                if (((JAXBType)existingJavaException.getOwner()).getName().equals(jaxbStruct.getName())
-                    || ModelerUtils.isEquivalentLiteralStructures(jaxbStruct, (JAXBStructuredType) existingJavaException.getOwner())) {
+                if (((JAXBType) existingJavaException.getOwner()).getName().equals(jaxbStruct.getName())
+                        || ModelerUtils.isEquivalentLiteralStructures(jaxbStruct, (JAXBStructuredType) existingJavaException.getOwner())) {
                     // we have mapped this fault already
                     if (faultType instanceof JAXBStructuredType) {
                         fault.getBlock().setType((JAXBType) existingJavaException.getOwner());
@@ -2493,23 +2446,23 @@
         return true;
     }
 
-    protected boolean isRequestResponse(){
+    protected boolean isRequestResponse() {
         return info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
     }
 
-    protected java.util.List<String> getAsynParameterOrder(){
+    protected java.util.List<String> getAsynParameterOrder() {
         //for async operation ignore the parameterOrder
         java.util.List<String> parameterList = new ArrayList<String>();
         Message inputMessage = getInputMessage();
         List<MessagePart> inputParts = inputMessage.getParts();
-        for(MessagePart part: inputParts){
+        for (MessagePart part : inputParts) {
             parameterList.add(part.getName());
         }
         return parameterList;
     }
 
 
-    protected List<MessagePart> getParameterOrder(){
+    protected List<MessagePart> getParameterOrder() {
         List<MessagePart> params = new ArrayList<MessagePart>();
         String parameterOrder = info.portTypeOperation.getParameterOrder();
         java.util.List<String> parameterList = new ArrayList<String>();
@@ -2525,44 +2478,43 @@
         List<MessagePart> outputParts = null;
         List<MessagePart> inputParts = inputMessage.getParts();
         //reset the mode and ret flag, as MEssagePArts aer shared across ports
-        for(MessagePart part:inputParts){
+        for (MessagePart part : inputParts) {
             part.setMode(Mode.IN);
             part.setReturn(false);
         }
-        if(isRequestResponse()){
+        if (isRequestResponse()) {
             outputParts = outputMessage.getParts();
-            for(MessagePart part:outputParts){
+            for (MessagePart part : outputParts) {
                 part.setMode(Mode.OUT);
                 part.setReturn(false);
             }
         }
 
-        if(parameterOrderPresent){
+        if (parameterOrderPresent) {
             boolean validParameterOrder = true;
             Iterator<String> paramOrders = parameterList.iterator();
             // If any part in the parameterOrder is not present in the request or
             // response message, we completely ignore the parameterOrder hint
-            while(paramOrders.hasNext()){
+            while (paramOrders.hasNext()) {
                 String param = paramOrders.next();
                 boolean partFound = false;
-                for(MessagePart part : inputParts){
-                    if(param.equals(part.getName())){
+                for (MessagePart part : inputParts) {
+                    if (param.equals(part.getName())) {
                         partFound = true;
                         break;
                     }
                 }
                 // if not found, check in output parts
-                if(!partFound){
-                    for(MessagePart part : outputParts){
-                        if(param.equals(part.getName())){
+                if (!partFound) {
+                    for (MessagePart part : outputParts) {
+                        if (param.equals(part.getName())) {
                             partFound = true;
                             break;
                         }
                     }
                 }
-                if(!partFound){
-                    warn("wsdlmodeler.invalid.parameterorder.parameter",
-                            new Object[] {param, info.operation.getName().getLocalPart()});
+                if (!partFound) {
+                    warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(param, info.operation.getName().getLocalPart()));
                     validParameterOrder = false;
                 }
             }
@@ -2571,51 +2523,51 @@
             List<MessagePart> outputUnlistedParts = new ArrayList<MessagePart>();
 
             //gather input Parts
-            if(validParameterOrder){
-                for(String param:parameterList){
+            if (validParameterOrder) {
+                for (String param : parameterList) {
                     MessagePart part = inputMessage.getPart(param);
-                    if(part != null){
+                    if (part != null) {
                         params.add(part);
                         continue;
                     }
-                    if(isRequestResponse()){
+                    if (isRequestResponse()) {
                         MessagePart outPart = outputMessage.getPart(param);
-                        if(outPart != null){
+                        if (outPart != null) {
                             params.add(outPart);
                             continue;
                         }
                     }
                 }
 
-                for(MessagePart part: inputParts){
-                    if(!parameterList.contains(part.getName())) {
+                for (MessagePart part : inputParts) {
+                    if (!parameterList.contains(part.getName())) {
                         inputUnlistedParts.add(part);
                     }
                 }
 
-                if(isRequestResponse()){
+                if (isRequestResponse()) {
                     // at most one output part should be unlisted
-                    for(MessagePart part: outputParts){
-                        if(!parameterList.contains(part.getName())) {
+                    for (MessagePart part : outputParts) {
+                        if (!parameterList.contains(part.getName())) {
                             MessagePart inPart = inputMessage.getPart(part.getName());
                             //dont add inout as unlisted part
-                            if((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())){
+                            if ((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())) {
                                 inPart.setMode(Mode.INOUT);
-                            }else{
+                            } else {
                                 outputUnlistedParts.add(part);
                             }
-                        }else{
+                        } else {
                             //param list may contain it, check if its INOUT
                             MessagePart inPart = inputMessage.getPart(part.getName());
                             //dont add inout as unlisted part
-                            if((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())){
+                            if ((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())) {
                                 inPart.setMode(Mode.INOUT);
-                            }else if(!params.contains(part)){
+                            } else if (!params.contains(part)) {
                                 params.add(part);
                             }
                         }
                     }
-                    if(outputUnlistedParts.size() == 1){
+                    if (outputUnlistedParts.size() == 1) {
                         MessagePart resultPart = outputUnlistedParts.get(0);
                         resultPart.setReturn(true);
                         params.add(resultPart);
@@ -2624,19 +2576,18 @@
                 }
 
                 //add the input and output unlisted parts
-                for(MessagePart part : inputUnlistedParts){
+                for (MessagePart part : inputUnlistedParts) {
                     params.add(part);
                 }
 
-                for(MessagePart part : outputUnlistedParts){
+                for (MessagePart part : outputUnlistedParts) {
                     params.add(part);
                 }
                 return params;
 
             }
             //parameterOrder attribute is not valid, we ignore it
-            warn("wsdlmodeler.invalid.parameterOrder.invalidParameterOrder",
-                    new Object[] {info.operation.getName().getLocalPart()});
+            warning(info.operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(info.operation.getName().getLocalPart()));
             parameterOrderPresent = false;
             parameterList.clear();
         }
@@ -2644,15 +2595,15 @@
         List<MessagePart> outParts = new ArrayList<MessagePart>();
 
         //construct input parameter list with the same order as in input message
-        for(MessagePart part: inputParts){
+        for (MessagePart part : inputParts) {
             params.add(part);
         }
 
-        if(isRequestResponse()){
-            for(MessagePart part:outputParts){
+        if (isRequestResponse()) {
+            for (MessagePart part : outputParts) {
                 MessagePart inPart = inputMessage.getPart(part.getName());
-                if(inPart != null && part.getDescriptorKind() == inPart.getDescriptorKind() &&
-                        part.getDescriptor().equals(inPart.getDescriptor())){
+                if (inPart != null && part.getDescriptorKind() == inPart.getDescriptorKind() &&
+                        part.getDescriptor().equals(inPart.getDescriptor())) {
                     inPart.setMode(Mode.INOUT);
                     continue;
                 }
@@ -2660,8 +2611,8 @@
             }
 
             //append the out parts to the parameterList
-            for(MessagePart part : outParts){
-                if(outParts.size() == 1)
+            for (MessagePart part : outParts) {
+                if (outParts.size() == 1)
                     part.setReturn(true);
                 params.add(part);
             }
@@ -2670,56 +2621,36 @@
     }
 
     /**
-     *
      * @param port
      * @param suffix
      * @return the Java ClassName for a port
      */
     protected String getClassName(Port port, String suffix) {
-        String name = "";
-        String javaPackageName = "";
-        if (_modelInfo.getJavaPackageName() != null
-            && !_modelInfo.getJavaPackageName().equals("")) {
-            javaPackageName = _modelInfo.getJavaPackageName();
-        }
-        String prefix = getEnvironment().getNames().validJavaClassName(port.getName().getLocalPart());
-        name = javaPackageName+"."+prefix+suffix;
-        return name;
+        String prefix = JAXBRIContext.mangleNameToClassName((port.getName().getLocalPart()));
+        return options.defaultPackage + "." + prefix + suffix;
     }
 
     protected boolean isConflictingServiceClassName(String name) {
-       if(conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) ||conflictsWithExceptionClass(name)){
-            return true;
-        }
-        return false;
+        return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) || conflictsWithExceptionClass(name);
     }
 
-    private boolean conflictsWithSEIClass(String name){
+    private boolean conflictsWithSEIClass(String name) {
         Set<String> seiNames = classNameCollector.getSeiClassNames();
-        if(seiNames != null && seiNames.contains(name))
-            return true;
-        return false;
+        return seiNames != null && seiNames.contains(name);
     }
 
-    private boolean conflictsWithJAXBClass(String name){
+    private boolean conflictsWithJAXBClass(String name) {
         Set<String> jaxbNames = classNameCollector.getJaxbGeneratedClassNames();
-        if(jaxbNames != null && jaxbNames.contains(name))
-            return true;
-        return false;
+        return jaxbNames != null && jaxbNames.contains(name);
     }
 
-    private boolean conflictsWithExceptionClass(String name){
+    private boolean conflictsWithExceptionClass(String name) {
         Set<String> exceptionNames = classNameCollector.getExceptionClassNames();
-        if(exceptionNames != null && exceptionNames.contains(name))
-            return true;
-        return false;
+        return exceptionNames != null && exceptionNames.contains(name);
     }
 
     protected boolean isConflictingExceptionClassName(String name) {
-        if(conflictsWithSEIClass(name) || conflictsWithJAXBClass(name)){
-            return true;
-        }
-        return false;
+        return conflictsWithSEIClass(name) || conflictsWithJAXBClass(name);
     }
 
     protected JAXBModelBuilder getJAXBModelBuilder() {
@@ -2727,32 +2658,31 @@
     }
 
     protected boolean validateWSDLBindingStyle(Binding binding) {
-        boolean mixedStyle = false;
         SOAPBinding soapBinding =
-            (SOAPBinding)getExtensionOfType(binding, SOAPBinding.class);
+                (SOAPBinding) getExtensionOfType(binding, SOAPBinding.class);
 
         //dont process the binding
-        if(soapBinding == null)
+        if (soapBinding == null)
             soapBinding =
-                (SOAPBinding)getExtensionOfType(binding, SOAP12Binding.class);
-        if(soapBinding == null)
+                    (SOAPBinding) getExtensionOfType(binding, SOAP12Binding.class);
+        if (soapBinding == null)
             return false;
 
         //if soapbind:binding has no style attribute, the default is DOCUMENT
-        if(soapBinding.getStyle() == null)
+        if (soapBinding.getStyle() == null)
             soapBinding.setStyle(SOAPStyle.DOCUMENT);
 
         SOAPStyle opStyle = soapBinding.getStyle();
         for (Iterator iter = binding.operations(); iter.hasNext();) {
             BindingOperation bindingOperation =
-                (BindingOperation)iter.next();
+                    (BindingOperation) iter.next();
             SOAPOperation soapOperation =
-                (SOAPOperation) getExtensionOfType(bindingOperation,
-                    SOAPOperation.class);
-            if(soapOperation != null){
-                SOAPStyle currOpStyle = (soapOperation.getStyle() != null)?soapOperation.getStyle():soapBinding.getStyle();
+                    (SOAPOperation) getExtensionOfType(bindingOperation,
+                            SOAPOperation.class);
+            if (soapOperation != null) {
+                SOAPStyle currOpStyle = (soapOperation.getStyle() != null) ? soapOperation.getStyle() : soapBinding.getStyle();
                 //dont check for the first operation
-                if(!currOpStyle.equals(opStyle))
+                if (!currOpStyle.equals(opStyle))
                     return false;
             }
         }
@@ -2763,16 +2693,16 @@
      * @param port
      */
     private void applyWrapperStyleCustomization(Port port, PortType portType) {
-        JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
-        Boolean wrapperStyle = (jaxwsBinding != null)?jaxwsBinding.isEnableWrapperStyle():null;
-        if(wrapperStyle != null){
+        JAXWSBinding jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
+        Boolean wrapperStyle = (jaxwsBinding != null) ? jaxwsBinding.isEnableWrapperStyle() : null;
+        if (wrapperStyle != null) {
             port.setWrapped(wrapperStyle);
         }
     }
 
     protected static void setDocumentationIfPresent(
-        ModelObject obj,
-        Documentation documentation) {
+            ModelObject obj,
+            Documentation documentation) {
         if (documentation != null && documentation.getContent() != null) {
             obj.setJavaDoc(documentation.getContent());
         }
@@ -2780,16 +2710,20 @@
 
     protected String getJavaNameForOperation(Operation operation) {
         String name = operation.getJavaMethodName();
-        if(getEnvironment().getNames().isJavaReservedWord(name)){
-            name = "_"+name;
+        if (Names.isJavaReservedWord(name)) {
+            name = "_" + name;
         }
         return name;
     }
 
-    protected void fail(String key, String arg){
-        throw new ModelerException(key, arg);
+    private void reportError(Entity entity,
+        String formattedMsg, Exception nestedException ) {
+        Locator locator = (entity == null)?NULL_LOCATOR:entity.getLocator();
+
+        SAXParseException e = new SAXParseException2( formattedMsg,
+            locator,
+            nestedException );
+        errReceiver.error(e);
     }
-    protected void fail(String key, Object[] args){
-        throw new ModelerException(key, args);
-    }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java
index fc5f028..89eab91 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java
@@ -1,6 +1,5 @@
-
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,64 +23,41 @@
  * have any questions.
  */
 
+
 package com.sun.tools.internal.ws.processor.modeler.wsdl;
 
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.processor.generator.Names;
-import com.sun.tools.internal.ws.processor.model.AbstractType;
-import com.sun.tools.internal.ws.processor.model.Block;
 import com.sun.tools.internal.ws.processor.model.Fault;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.ModelObject;
-import com.sun.tools.internal.ws.processor.model.ModelProperties;
 import com.sun.tools.internal.ws.processor.model.Operation;
-import com.sun.tools.internal.ws.processor.model.Parameter;
 import com.sun.tools.internal.ws.processor.model.Port;
+import com.sun.tools.internal.ws.processor.model.java.JavaException;
 import com.sun.tools.internal.ws.processor.modeler.JavaSimpleTypeCreator;
 import com.sun.tools.internal.ws.processor.modeler.Modeler;
-import com.sun.tools.internal.ws.processor.modeler.ModelerException;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.wsdl.document.Binding;
-import com.sun.tools.internal.ws.wsdl.document.BindingFault;
-import com.sun.tools.internal.ws.wsdl.document.BindingOperation;
-import com.sun.tools.internal.ws.wsdl.document.Documentation;
-import com.sun.tools.internal.ws.wsdl.document.Kinds;
-import com.sun.tools.internal.ws.wsdl.document.Message;
-import com.sun.tools.internal.ws.wsdl.document.MessagePart;
-import com.sun.tools.internal.ws.wsdl.document.OperationStyle;
-import com.sun.tools.internal.ws.wsdl.document.WSDLDocument;
+import com.sun.tools.internal.ws.resources.ModelerMessages;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiverFilter;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.*;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
 import com.sun.tools.internal.ws.wsdl.document.mime.MIMEContent;
 import com.sun.tools.internal.ws.wsdl.document.mime.MIMEMultipartRelated;
 import com.sun.tools.internal.ws.wsdl.document.mime.MIMEPart;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBody;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPFault;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPHeader;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPOperation;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import com.sun.tools.internal.ws.wsdl.document.soap.*;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.GloballyKnown;
 import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException;
-import com.sun.tools.internal.ws.wsdl.parser.Constants;
-import com.sun.tools.internal.ws.wsdl.parser.Util;
+import com.sun.tools.internal.ws.wsdl.parser.DOMForest;
 import com.sun.tools.internal.ws.wsdl.parser.WSDLParser;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.w3c.dom.Element;
+import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import org.xml.sax.helpers.LocatorImpl;
 
 import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
+import java.util.*;
 
 /**
  *
@@ -90,53 +66,18 @@
  * Base class for WSDL->Model classes.
  */
 public abstract class WSDLModelerBase implements Modeler {
-    public WSDLModelerBase(WSDLModelInfo modelInfo, Properties options) {
-        //init();
-        _modelInfo = modelInfo;
-        _options = options;
-        _messageFactory =
-            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.modeler");
-        _conflictingClassNames = null;
-        _env = (ProcessorEnvironment)modelInfo.getParent().getEnvironment();
-        hSet = null;
-        reqResNames = new HashSet();
-    }
+    protected final ErrorReceiverFilter errReceiver;
+    protected final WsimportOptions options;
+    protected MetadataFinder forest;
 
 
-    protected WSDLParser createWSDLParser(){
-        return new WSDLParser(_modelInfo);
+    public WSDLModelerBase(WsimportOptions options, ErrorReceiver receiver) {
+        this.options = options;
+        this.errReceiver = new ErrorReceiverFilter(receiver);;
     }
 
     /**
-     * Builds model from WSDL document. Model contains abstraction which is used by the
-     * generators to generate the stub/tie/serializers etc. code.
      *
-     * @see Modeler#buildModel()
-     */
-    public Model buildModel() {
-        return null;
-    }
-
-    protected WSDLModelInfo getWSDLModelInfo(){
-        return _modelInfo;
-    }
-
-    protected Documentation getDocumentationFor(Element e) {
-        String s = XmlUtil.getTextForNode(e);
-        if (s == null) {
-            return null;
-        } else {
-            return new Documentation(s);
-        }
-    }
-
-    protected void checkNotWsdlElement(Element e) {
-        // possible extensibility element -- must live outside the WSDL namespace
-        if (e.getNamespaceURI().equals(Constants.NS_WSDL))
-            Util.fail("parsing.invalidWsdlElement", e.getTagName());
-    }
-
-    /**
      * @param port
      * @param wsdlPort
      */
@@ -150,7 +91,7 @@
             port.setPortGetter(portMethodName);
         }else{
             portMethodName = Names.getPortName(port);
-            portMethodName = getEnvironment().getNames().validJavaClassName(portMethodName);
+            portMethodName = JAXBRIContext.mangleNameToClassName(portMethodName);
             port.setPortGetter("get"+portMethodName);
         }
 
@@ -170,78 +111,19 @@
         return false;
     }
 
-    protected void createParentFault(Fault fault) {
-        AbstractType faultType = fault.getBlock().getType();
-        AbstractType parentType = null;
-
-
-        if (parentType == null) {
-            return;
-        }
-
-        if (fault.getParentFault() != null) {
-            return;
-        }
-        Fault parentFault =
-            new Fault(((AbstractType)parentType).getName().getLocalPart());
-        /* this is what it really should be but for interop with JAXRPC 1.0.1 we are not doing
-         * this at this time.
-         *
-         * TODO - we should double-check this; the above statement might not be true anymore.
-         */
-        QName faultQName =
-            new QName(
-                fault.getBlock().getName().getNamespaceURI(),
-                parentFault.getName());
-        Block block = new Block(faultQName);
-        block.setType((AbstractType)parentType);
-        parentFault.setBlock(block);
-        parentFault.addSubfault(fault);
-        createParentFault(parentFault);
-    }
-
-    protected void createSubfaults(Fault fault) {
-        AbstractType faultType = fault.getBlock().getType();
-        Iterator subtypes = null;
-        if (subtypes != null) {
-            AbstractType subtype;
-            while (subtypes.hasNext()) {
-                subtype = (AbstractType)subtypes.next();
-                Fault subFault = new Fault(subtype.getName().getLocalPart());
-                /* this is what it really is but for interop with JAXRPC 1.0.1 we are not doing
-                 * this at this time
-                 *
-                 * TODO - we should double-check this; the above statement might not be true anymore.
-                 */
-                QName faultQName =
-                    new QName(
-                        fault.getBlock().getName().getNamespaceURI(),
-                        subFault.getName());
-                Block block = new Block(faultQName);
-                block.setType(subtype);
-                subFault.setBlock(block);
-                fault.addSubfault(subFault);
-                createSubfaults(subFault);
-            }
-        }
-    }
-
     protected SOAPBody getSOAPRequestBody() {
         SOAPBody requestBody =
             (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getInput(),
                 SOAPBody.class);
         if (requestBody == null) {
             // the WSDL document is invalid
-            throw new ModelerException(
-                "wsdlmodeler.invalid.bindingOperation.inputMissingSoapBody",
-                new Object[] { info.bindingOperation.getName()});
+            error(info.bindingOperation.getInput(), ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(info.bindingOperation.getName()));
         }
         return requestBody;
     }
 
     protected boolean isRequestMimeMultipart() {
-        for (Iterator iter = info.bindingOperation.getInput().extensions(); iter.hasNext();) {
-            Extension extension = (Extension)iter.next();
+        for (TWSDLExtension extension: info.bindingOperation.getInput().extensions()) {
             if (extension.getClass().equals(MIMEMultipartRelated.class)) {
                 return true;
             }
@@ -250,8 +132,7 @@
     }
 
     protected boolean isResponseMimeMultipart() {
-        for (Iterator iter = info.bindingOperation.getOutput().extensions(); iter.hasNext();) {
-            Extension extension = (Extension)iter.next();
+        for (TWSDLExtension extension: info.bindingOperation.getOutput().extensions()) {
             if (extension.getClass().equals(MIMEMultipartRelated.class)) {
                 return true;
             }
@@ -268,9 +149,7 @@
                 SOAPBody.class);
         if (responseBody == null) {
             // the WSDL document is invalid
-            throw new ModelerException(
-                "wsdlmodeler.invalid.bindingOperation.outputMissingSoapBody",
-                new Object[] { info.bindingOperation.getName()});
+            error(info.bindingOperation.getOutput(),  ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(info.bindingOperation.getName()));
         }
         return responseBody;
     }
@@ -290,15 +169,15 @@
      * @param message Input or output message, equivalent to wsdl:message
      * @return iterator over MessagePart
      */
-    protected List getMessageParts(
+    protected List<MessagePart> getMessageParts(
         SOAPBody body,
         com.sun.tools.internal.ws.wsdl.document.Message message, boolean isInput) {
         String bodyParts = body.getParts();
-        ArrayList partsList = new ArrayList();
-        List parts = new ArrayList();
+        ArrayList<MessagePart> partsList = new ArrayList<MessagePart>();
+        List<MessagePart> parts = new ArrayList<MessagePart>();
 
         //get Mime parts
-        List mimeParts = null;
+        List mimeParts;
         if(isInput)
             mimeParts = getMimeContentParts(message, info.bindingOperation.getInput());
         else
@@ -308,26 +187,22 @@
             StringTokenizer in = new StringTokenizer(bodyParts.trim(), " ");
             while (in.hasMoreTokens()) {
                 String part = in.nextToken();
-                MessagePart mPart = (MessagePart)message.getPart(part);
+                MessagePart mPart = message.getPart(part);
                 if (null == mPart) {
-                    throw new ModelerException(
-                        "wsdlmodeler.error.partsNotFound",
-                        new Object[] { part, message.getName()});
+                    error(message,  ModelerMessages.WSDLMODELER_ERROR_PARTS_NOT_FOUND(part, message.getName()));
                 }
                 mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
                 partsList.add(mPart);
             }
         } else {
-            for(Iterator iter = message.parts();iter.hasNext();) {
-                MessagePart mPart = (MessagePart)iter.next();
-                if(!mimeParts.contains(mPart))
+            for (MessagePart mPart : message.getParts()) {
+                if (!mimeParts.contains(mPart))
                     mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
                 partsList.add(mPart);
             }
         }
 
-        for(Iterator iter = message.parts();iter.hasNext();) {
-            MessagePart mPart = (MessagePart)iter.next();
+        for (MessagePart mPart : message.getParts()) {
             if(mimeParts.contains(mPart)) {
                 mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
                 parts.add(mPart);
@@ -344,14 +219,12 @@
      * @param message
      * @return MessageParts referenced by the mime:content
      */
-    protected List getMimeContentParts(Message message, Extensible ext) {
-        ArrayList mimeContentParts = new ArrayList();
-        String mimeContentPartName = null;
-        Iterator mimeParts = getMimeParts(ext);
+    protected List<MessagePart> getMimeContentParts(Message message, TWSDLExtensible ext) {
+        ArrayList<MessagePart> mimeContentParts = new ArrayList<MessagePart>();
 
-        while(mimeParts.hasNext()) {
-            MessagePart part = getMimeContentPart(message, (MIMEPart)mimeParts.next());
-            if(part != null)
+        for (MIMEPart mimePart : getMimeParts(ext)) {
+            MessagePart part = getMimeContentPart(message, mimePart);
+            if (part != null)
                 mimeContentParts.add(part);
         }
         return mimeContentParts;
@@ -360,32 +233,25 @@
     /**
      * @param mimeParts
      */
-    protected boolean validateMimeParts(Iterator mimeParts) {
+    protected boolean validateMimeParts(Iterable<MIMEPart> mimeParts) {
         boolean gotRootPart = false;
-        List mimeContents = new ArrayList();
-        while(mimeParts.hasNext()) {
-            MIMEPart mPart = (MIMEPart)mimeParts.next();
-            Iterator extns = mPart.extensions();
-            while(extns.hasNext()){
-                Object obj = extns.next();
-                if(obj instanceof SOAPBody){
-                    if(gotRootPart) {
-                        //bug fix: 5024020
-                        warn("mimemodeler.invalidMimePart.moreThanOneSOAPBody",
-                                new Object[] {info.operation.getName().getLocalPart()});
+        List<MIMEContent> mimeContents = new ArrayList<MIMEContent>();
+        for (MIMEPart mPart : mimeParts) {
+            for (TWSDLExtension obj : mPart.extensions()) {
+                if (obj instanceof SOAPBody) {
+                    if (gotRootPart) {
+                        warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(info.operation.getName().getLocalPart()));
                         return false;
                     }
                     gotRootPart = true;
-                }else if (obj instanceof MIMEContent) {
-                    mimeContents.add((MIMEContent)obj);
+                } else if (obj instanceof MIMEContent) {
+                    mimeContents.add((MIMEContent) obj);
                 }
             }
-            if(!validateMimeContentPartNames(mimeContents.iterator()))
+            if(!validateMimeContentPartNames(mimeContents))
                 return false;
             if(mPart.getName() != null) {
-                //bug fix: 5024018
-                warn("mimemodeler.invalidMimePart.nameNotAllowed",
-                        info.portTypeOperation.getName());
+                warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(info.portTypeOperation.getName()));
             }
         }
         return true;
@@ -393,15 +259,12 @@
     }
 
     private MessagePart getMimeContentPart(Message message, MIMEPart part) {
-        String mimeContentPartName = null;
-        Iterator mimeContents = getMimeContents(part).iterator();
-        if(mimeContents.hasNext()) {
-            mimeContentPartName = ((MIMEContent)mimeContents.next()).getPart();
-            MessagePart mPart = (MessagePart)message.getPart(mimeContentPartName);
+        for( MIMEContent mimeContent : getMimeContents(part) ) {
+            String mimeContentPartName = mimeContent.getPart();
+            MessagePart mPart = message.getPart(mimeContentPartName);
             //RXXXX mime:content MUST have part attribute
             if(null == mPart) {
-                throw new ModelerException("wsdlmodeler.error.partsNotFound",
-                        new Object[] {mimeContentPartName, message.getName()});
+                error(mimeContent,  ModelerMessages.WSDLMODELER_ERROR_PARTS_NOT_FOUND(mimeContentPartName, message.getName()));
             }
             mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
             return mPart;
@@ -422,29 +285,24 @@
         return mimeTypes;
     }
 
-    /**
-     * @param iterator
-     */
-    private boolean validateMimeContentPartNames(Iterator mimeContents) {
+    private boolean validateMimeContentPartNames(List<MIMEContent> mimeContents) {
         //validate mime:content(s) in the mime:part as per R2909
-        while(mimeContents.hasNext()){
+        for (MIMEContent mimeContent : mimeContents) {
             String mimeContnetPart = null;
             if(mimeContnetPart == null) {
-                mimeContnetPart = getMimeContentPartName((MIMEContent)mimeContents.next());
+                mimeContnetPart = getMimeContentPartName(mimeContent);
                 if(mimeContnetPart == null) {
-                    warn("mimemodeler.invalidMimeContent.missingPartAttribute",
-                            new Object[] {info.operation.getName().getLocalPart()});
+                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(info.operation.getName().getLocalPart()));
                     return false;
                 }
             }else {
-                String newMimeContnetPart = getMimeContentPartName((MIMEContent)mimeContents.next());
+                String newMimeContnetPart = getMimeContentPartName(mimeContent);
                 if(newMimeContnetPart == null) {
-                    warn("mimemodeler.invalidMimeContent.missingPartAttribute",
-                            new Object[] {info.operation.getName().getLocalPart()});
+                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(info.operation.getName().getLocalPart()));
                     return false;
                 }else if(!newMimeContnetPart.equals(mimeContnetPart)) {
                     //throw new ModelerException("mimemodeler.invalidMimeContent.differentPart");
-                    warn("mimemodeler.invalidMimeContent.differentPart");
+                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART());
                     return false;
                 }
             }
@@ -452,13 +310,12 @@
         return true;
     }
 
-    protected Iterator<MIMEPart> getMimeParts(Extensible ext) {
+    protected Iterable<MIMEPart> getMimeParts(TWSDLExtensible ext) {
         MIMEMultipartRelated multiPartRelated =
             (MIMEMultipartRelated) getAnyExtensionOfType(ext,
                     MIMEMultipartRelated.class);
         if(multiPartRelated == null) {
-            List<MIMEPart> parts = new ArrayList<MIMEPart>();
-            return parts.iterator();
+            return Collections.emptyList();
         }
         return multiPartRelated.getParts();
     }
@@ -466,11 +323,9 @@
     //returns MIMEContents
     protected List<MIMEContent> getMimeContents(MIMEPart part) {
         List<MIMEContent> mimeContents = new ArrayList<MIMEContent>();
-        Iterator parts = part.extensions();
-        while(parts.hasNext()) {
-            Extension mimeContent = (Extension) parts.next();
+        for (TWSDLExtension mimeContent : part.extensions()) {
             if (mimeContent instanceof MIMEContent) {
-                mimeContents.add((MIMEContent)mimeContent);
+                mimeContents.add((MIMEContent) mimeContent);
             }
         }
         //validateMimeContentPartNames(mimeContents.iterator());
@@ -490,8 +345,7 @@
     private String getMimeContentType(MIMEContent mimeContent){
         String mimeType = mimeContent.getType();
         if(mimeType == null){
-            throw new ModelerException("mimemodeler.invalidMimeContent.missingTypeAttribute",
-                    new Object[] {info.operation.getName().getLocalPart()});
+            error(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(info.operation.getName().getLocalPart()));
         }
         return mimeType;
     }
@@ -534,9 +388,7 @@
         if (namespaceURI == null) {
             // the WSDL document is invalid
             // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
-            throw new ModelerException(
-                "wsdlmodeler.invalid.bindingOperation.inputSoapBody.missingNamespace",
-                new Object[] { info.bindingOperation.getName()});
+            error(body, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(info.bindingOperation.getName()));
         }
         return namespaceURI;
     }
@@ -546,9 +398,7 @@
         if (namespaceURI == null) {
             // the WSDL document is invalid
             // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
-            throw new ModelerException(
-                "wsdlmodeler.invalid.bindingOperation.outputSoapBody.missingNamespace",
-                new Object[] { info.bindingOperation.getName()});
+            error(body, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(info.bindingOperation.getName()));
         }
         return namespaceURI;
     }
@@ -556,39 +406,27 @@
     /**
      * @return List of SOAPHeader extensions
      */
-    protected List<SOAPHeader> getHeaderExtensions(Extensible extensible) {
+    protected List<SOAPHeader> getHeaderExtensions(TWSDLExtensible extensible) {
         List<SOAPHeader> headerList = new ArrayList<SOAPHeader>();
-        Iterator bindingIter = extensible.extensions();
-        while (bindingIter.hasNext()) {
-            Extension extension = (Extension) bindingIter.next();
-            if (extension.getClass().equals(MIMEMultipartRelated.class)) {
-                for (Iterator parts = ((MIMEMultipartRelated) extension).getParts();
-                parts.hasNext();) {
-                    Extension part = (Extension) parts.next();
-                    if (part.getClass().equals(MIMEPart.class)) {
-                        boolean isRootPart = isRootPart((MIMEPart)part);
-                        Iterator iter = ((MIMEPart)part).extensions();
-                        while(iter.hasNext()) {
-                            Object obj = iter.next();
-                            if(obj instanceof SOAPHeader){
-                                //bug fix: 5024015
-                                if(!isRootPart) {
-                                    warn(
-                                            "mimemodeler.warning.IgnoringinvalidHeaderPart.notDeclaredInRootPart",
-                                            new Object[] {
-                                                    info.bindingOperation.getName()});
-                                    return new ArrayList<SOAPHeader>();
-                                }
-                                headerList.add((SOAPHeader)obj);
+        for (TWSDLExtension extension : extensible.extensions()) {
+            if (extension.getClass()==MIMEMultipartRelated.class) {
+                for( MIMEPart part : ((MIMEMultipartRelated) extension).getParts() ) {
+                    boolean isRootPart = isRootPart(part);
+                    for (TWSDLExtension obj : part.extensions()) {
+                        if (obj instanceof SOAPHeader) {
+                            //bug fix: 5024015
+                            if (!isRootPart) {
+                                warning((Entity) obj, ModelerMessages.MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(info.bindingOperation.getName()));
+                                return new ArrayList<SOAPHeader>();
                             }
+                            headerList.add((SOAPHeader) obj);
                         }
                     }
-
                 }
-            }else if(extension instanceof SOAPHeader) {
-                headerList.add((SOAPHeader)extension);
+            } else if (extension instanceof SOAPHeader) {
+                headerList.add((SOAPHeader) extension);
             }
-         }
+        }
          return headerList;
     }
 
@@ -597,9 +435,8 @@
      * @return true if part is the Root part
      */
     private boolean isRootPart(MIMEPart part) {
-        Iterator iter = part.extensions();
-        while(iter.hasNext()){
-            if(iter.next() instanceof SOAPBody)
+        for (TWSDLExtension twsdlExtension : part.extensions()) {
+            if (twsdlExtension instanceof SOAPBody)
                 return true;
         }
         return false;
@@ -607,25 +444,16 @@
 
     protected Set getDuplicateFaultNames() {
         // look for fault messages with the same soap:fault name
-        Set faultNames = new HashSet();
-        Set duplicateNames = new HashSet();
-        for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();) {
-            BindingFault bindingFault = (BindingFault)iter.next();
+        Set<QName> faultNames = new HashSet<QName>();
+        Set<QName> duplicateNames = new HashSet<QName>();
+        for( BindingFault bindingFault : info.bindingOperation.faults() ) {
             com.sun.tools.internal.ws.wsdl.document.Fault portTypeFault = null;
-            for (Iterator iter2 = info.portTypeOperation.faults();
-                iter2.hasNext();
-                ) {
-                com.sun.tools.internal.ws.wsdl.document.Fault aFault =
-                    (com.sun.tools.internal.ws.wsdl.document.Fault)iter2.next();
-
+            for (com.sun.tools.internal.ws.wsdl.document.Fault aFault : info.portTypeOperation.faults()) {
                 if (aFault.getName().equals(bindingFault.getName())) {
                     if (portTypeFault != null) {
                         // the WSDL document is invalid
-                        throw new ModelerException(
-                            "wsdlmodeler.invalid.bindingFault.notUnique",
-                            new Object[] {
-                                bindingFault.getName(),
-                                info.bindingOperation.getName()});
+                        error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(bindingFault.getName(),
+                            info.bindingOperation.getName()));
                     } else {
                         portTypeFault = aFault;
                     }
@@ -633,46 +461,34 @@
             }
             if (portTypeFault == null) {
                 // the WSDL document is invalid
-                throw new ModelerException(
-                    "wsdlmodeler.invalid.bindingFault.notFound",
-                    new Object[] {
-                        bindingFault.getName(),
-                        info.bindingOperation.getName()});
-
+                error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(bindingFault.getName(),
+                    info.bindingOperation.getName()));
             }
             SOAPFault soapFault =
                 (SOAPFault)getExtensionOfType(bindingFault, SOAPFault.class);
             if (soapFault == null) {
                 // the WSDL document is invalid
-                throw new ModelerException(
-                    "wsdlmodeler.invalid.bindingFault.outputMissingSoapFault",
-                    new Object[] {
-                        bindingFault.getName(),
-                        info.bindingOperation.getName()});
+                if(options.isExtensionMode()){
+                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(),
+                    info.bindingOperation.getName()));
+                }else {
+                    error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(),
+                        info.bindingOperation.getName()));
+                }
             }
 
             com.sun.tools.internal.ws.wsdl.document.Message faultMessage =
                 portTypeFault.resolveMessage(info.document);
-            Iterator iter2 = faultMessage.parts();
-            if (!iter2.hasNext()) {
+            if(faultMessage.getParts().isEmpty()) {
                 // the WSDL document is invalid
-                throw new ModelerException(
-                    "wsdlmodeler.invalid.bindingFault.emptyMessage",
-                    new Object[] {
-                        bindingFault.getName(),
-                        faultMessage.getName()});
+                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(bindingFault.getName(),
+                    faultMessage.getName()));
             }
             //  bug fix: 4852729
-            if (useWSIBasicProfile && (soapFault.getNamespace() != null)) {
-                warn(
-                    "wsdlmodeler.warning.r2716r2726",
-                    new Object[] { "soapbind:fault", soapFault.getName()});
+            if (!options.isExtensionMode() && (soapFault != null && soapFault.getNamespace() != null)) {
+                warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
             }
-            String faultNamespaceURI = soapFault.getNamespace();
-            if (faultNamespaceURI == null) {
-                faultNamespaceURI =
-                    portTypeFault.getMessage().getNamespaceURI();
-            }
+            String faultNamespaceURI = (soapFault != null && soapFault.getNamespace() != null)?soapFault.getNamespace():portTypeFault.getMessage().getNamespaceURI();
             String faultName = faultMessage.getName();
             QName faultQName = new QName(faultNamespaceURI, faultName);
             if (faultNames.contains(faultQName)) {
@@ -693,12 +509,12 @@
         boolean isRequestResponse =
             info.portTypeOperation.getStyle()
             == OperationStyle.REQUEST_RESPONSE;
-        List inputParts = getMessageParts(getSOAPRequestBody(), getInputMessage(), true);
+        List<MessagePart> inputParts = getMessageParts(getSOAPRequestBody(), getInputMessage(), true);
         if(!validateStyleAndPart(operation, inputParts))
             return false;
 
         if(isRequestResponse){
-            List outputParts = getMessageParts(getSOAPResponseBody(), getOutputMessage(), false);
+            List<MessagePart> outputParts = getMessageParts(getSOAPResponseBody(), getOutputMessage(), false);
             if(!validateStyleAndPart(operation, outputParts))
                 return false;
         }
@@ -709,13 +525,12 @@
      * @param operation
      * @return true if operation has valid style and part
      */
-    private boolean validateStyleAndPart(BindingOperation operation, List parts) {
+    private boolean validateStyleAndPart(BindingOperation operation, List<MessagePart> parts) {
         SOAPOperation soapOperation =
             (SOAPOperation) getExtensionOfType(operation, SOAPOperation.class);
-        for(Iterator iter = parts.iterator(); iter.hasNext();){
-            MessagePart part = (MessagePart)iter.next();
-            if(part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING){
-                if(!isStyleAndPartMatch(soapOperation, part))
+        for (MessagePart part : parts) {
+            if (part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING) {
+                if (!isStyleAndPartMatch(soapOperation, part))
                     return false;
             }
         }
@@ -738,94 +553,26 @@
      * @param name
      * @return List of MimeContents from ext
      */
-    protected List<MIMEContent> getMimeContents(Extensible ext, Message message, String name) {
-        Iterator mimeParts = getMimeParts(ext);
-        while(mimeParts.hasNext()){
-            MIMEPart mimePart = (MIMEPart)mimeParts.next();
+    protected List<MIMEContent> getMimeContents(TWSDLExtensible ext, Message message, String name) {
+        for (MIMEPart mimePart : getMimeParts(ext)) {
             List<MIMEContent> mimeContents = getMimeContents(mimePart);
-            for(MIMEContent mimeContent:mimeContents){
-                if(mimeContent.getPart().equals(name))
+            for (MIMEContent mimeContent : mimeContents) {
+                if (mimeContent.getPart().equals(name))
                     return mimeContents;
             }
         }
         return null;
     }
 
-    protected ProcessorEnvironment getEnvironment() {
-        return _env;
-    }
-
-    protected void warn(Localizable msg) {
-        getEnvironment().warn(msg);
-    }
-
-    protected void warn(String key) {
-        getEnvironment().warn(_messageFactory.getMessage(key));
-    }
-
-    protected void warn(String key, String arg) {
-        getEnvironment().warn(_messageFactory.getMessage(key, arg));
-    }
-
-    protected void error(String key, String arg) {
-        getEnvironment().error(_messageFactory.getMessage(key, arg));
-    }
-
-    protected void warn(String key, Object[] args) {
-        getEnvironment().warn(_messageFactory.getMessage(key, args));
-    }
-
-    protected void info(String key) {
-        getEnvironment().info(_messageFactory.getMessage(key));
-    }
-
-    protected void info(String key, String arg) {
-        getEnvironment().info(_messageFactory.getMessage(key, arg));
-    }
-
-    protected String makePackageQualified(String s, QName name) {
-        return makePackageQualified(s, name, true);
-    }
-
-    protected String makePackageQualified(
-        String s,
-        QName name,
-        boolean useNamespaceMapping) {
-        String javaPackageName = null;
-        if (useNamespaceMapping) {
-            javaPackageName = getJavaPackageName(name);
-        }
-        if (javaPackageName != null) {
-            return javaPackageName + "." + s;
-        } else if (
-            _modelInfo.getJavaPackageName() != null
-                && !_modelInfo.getJavaPackageName().equals("")) {
-            return _modelInfo.getJavaPackageName() + "." + s;
+    protected String makePackageQualified(String s) {
+        if (options.defaultPackage != null
+            && !options.defaultPackage.equals("")) {
+            return options.defaultPackage + "." + s;
         } else {
             return s;
         }
     }
 
-    protected QName makePackageQualified(QName name) {
-        return makePackageQualified(name, true);
-    }
-
-    protected QName makePackageQualified(
-        QName name,
-        boolean useNamespaceMapping) {
-        return new QName(
-            name.getNamespaceURI(),
-            makePackageQualified(name.getLocalPart(), name));
-    }
-
-    protected String makeNameUniqueInSet(String candidateName, Set names) {
-        String baseName = candidateName;
-        String name = baseName;
-        for (int i = 2; names.contains(name); ++i) {
-            name = baseName + Integer.toString(i);
-        }
-        return name;
-    }
 
     protected String getUniqueName(
         com.sun.tools.internal.ws.wsdl.document.Operation operation,
@@ -837,52 +584,16 @@
         }
     }
 
-    protected String getUniqueParameterName(
-        Operation operation,
-        String baseName) {
-        Set names = new HashSet();
-        for (Iterator iter = operation.getRequest().getParameters();
-            iter.hasNext();
-            ) {
-            Parameter p = (Parameter)iter.next();
-            names.add(p.getName());
-        }
-        for (Iterator iter = operation.getResponse().getParameters();
-            iter.hasNext();
-            ) {
-            Parameter p = (Parameter)iter.next();
-            names.add(p.getName());
-        }
-        String candidateName = baseName;
-        while (names.contains(candidateName)) {
-            candidateName += "_prime";
-        }
-        return candidateName;
-    }
-
-    protected String getNonQualifiedNameFor(QName name) {
-        return _env.getNames().validJavaClassName(name.getLocalPart());
-    }
-
-    protected static void setDocumentationIfPresent(
-        ModelObject obj,
-        Documentation documentation) {
-        if (documentation != null && documentation.getContent() != null) {
-            obj.setProperty(WSDL_DOCUMENTATION, documentation.getContent());
-        }
-    }
-
     protected static QName getQNameOf(GloballyKnown entity) {
         return new QName(
             entity.getDefining().getTargetNamespaceURI(),
             entity.getName());
     }
 
-    protected static Extension getExtensionOfType(
-            Extensible extensible,
+    protected static TWSDLExtension getExtensionOfType(
+            TWSDLExtensible extensible,
             Class type) {
-        for (Iterator iter = extensible.extensions(); iter.hasNext();) {
-            Extension extension = (Extension)iter.next();
+        for (TWSDLExtension extension:extensible.extensions()) {
             if (extension.getClass().equals(type)) {
                 return extension;
             }
@@ -891,30 +602,22 @@
         return null;
     }
 
-    protected Extension getAnyExtensionOfType(
-        Extensible extensible,
+    protected TWSDLExtension getAnyExtensionOfType(
+        TWSDLExtensible extensible,
         Class type) {
         if(extensible == null)
             return null;
-        for (Iterator iter = extensible.extensions(); iter.hasNext();) {
-            Extension extension = (Extension)iter.next();
+        for (TWSDLExtension extension:extensible.extensions()) {
             if(extension.getClass().equals(type)) {
                 return extension;
             }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                     (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                             || type.equals(MIMEPart.class))) {
-                for (Iterator parts =
-                    ((MIMEMultipartRelated) extension).getParts();
-                parts.hasNext();
-                ) {
-                    Extension part = (Extension) parts.next();
-                    if (part.getClass().equals(MIMEPart.class)) {
-                        MIMEPart mPart = (MIMEPart)part;
-                        //bug fix: 5024001
-                        Extension extn =  getExtensionOfType((Extensible) part, type);
-                        if(extn != null)
-                            return extn;
-                    }
+                for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
+                    //bug fix: 5024001
+                    TWSDLExtension extn = getExtensionOfType(part, type);
+                    if (extn != null)
+                        return extn;
                 }
             }
         }
@@ -965,20 +668,6 @@
         return uniqueName;
     }
 
-    private String getJavaPackageName(QName name) {
-        String packageName = null;
-/*        if (_modelInfo.getNamespaceMappingRegistry() != null) {
-            NamespaceMappingInfo i =
-                _modelInfo
-                    .getNamespaceMappingRegistry()
-                    .getNamespaceMappingInfo(
-                    name);
-            if (i != null)
-                return i.getJavaPackageName();
-        }*/
-        return packageName;
-    }
-
     protected boolean isConflictingClassName(String name) {
         if (_conflictingClassNames == null) {
             return false;
@@ -1007,10 +696,28 @@
         return isConflictingClassName(name);
     }
 
+    int numPasses = 0;
+
+    protected void warning(Entity entity, String message){
+        //avoid duplicate warning for the second pass
+        if(numPasses > 1)
+            return;
+        if(entity == null)
+            errReceiver.warning(NULL_LOCATOR, message);
+        else
+            errReceiver.warning(entity.getLocator(), message);
+    }
+
+    protected void error(Entity entity, String message){
+        if(entity == null)
+            errReceiver.error(NULL_LOCATOR, message);
+        else
+            errReceiver.error(entity.getLocator(), message);
+        throw new AbortException();
+    }
+
     protected static final String OPERATION_HAS_VOID_RETURN_TYPE =
         "com.sun.xml.internal.ws.processor.modeler.wsdl.operationHasVoidReturnType";
-    private static final String WSDL_DOCUMENTATION =
-        "com.sun.xml.internal.ws.processor.modeler.wsdl.documentation";
     protected static final String WSDL_PARAMETER_ORDER =
         "com.sun.xml.internal.ws.processor.modeler.wsdl.parameterOrder";
     public static final String WSDL_RESULT_PARAMETER =
@@ -1019,23 +726,17 @@
         "com.sun.xml.internal.ws.processor.modeler.wsdl.mimeMultipartRelatedBinding";
 
 
-    public ProcessorEnvironment getProcessorEnvironment(){
-        return _env;
-    }
     protected ProcessSOAPOperationInfo info;
 
-    protected WSDLModelInfo _modelInfo;
-    protected Properties _options;
-    protected LocalizableMessageFactory _messageFactory;
     private Set _conflictingClassNames;
-    protected Map _javaExceptions;
+    protected Map<String,JavaException> _javaExceptions;
     protected Map _faultTypeToStructureMap;
-    private ProcessorEnvironment _env;
     protected JavaSimpleTypeCreator _javaTypes;
     protected Map<QName, Port> _bindingNameToPortMap;
     protected boolean useWSIBasicProfile = true;
 
-    private Set reqResNames;
+    private final Set<String> reqResNames = new HashSet<String>();
+
     public class ProcessSOAPOperationInfo {
 
         public ProcessSOAPOperationInfo(
@@ -1077,10 +778,10 @@
         public String wsdlMessagePartName;
         public HashMap constructorOrder; // mapping of element name to
                                              // constructor order (of type Integer)
-    };
+    }
 
 
     protected WSDLParser parser;
     protected WSDLDocument document;
-    protected HashSet hSet;
+    protected static final LocatorImpl NULL_LOCATOR = new LocatorImpl();
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java
index 9c75e79..4708b06 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,16 @@
 
 package com.sun.tools.internal.ws.processor.util;
 
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.processor.model.AbstractType;
-import com.sun.tools.internal.ws.processor.model.Block;
-import com.sun.tools.internal.ws.processor.model.ExtendedModelVisitor;
-import com.sun.tools.internal.ws.processor.model.Fault;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.model.ModelProperties;
-import com.sun.tools.internal.ws.processor.model.Parameter;
-import com.sun.tools.internal.ws.processor.model.Port;
-import com.sun.tools.internal.ws.processor.model.Service;
+import com.sun.tools.internal.ws.processor.model.*;
+import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBType;
 import com.sun.tools.internal.ws.processor.model.jaxb.JAXBTypeVisitor;
 import com.sun.tools.internal.ws.processor.model.jaxb.RpcLitStructure;
-import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
-import com.sun.xml.internal.ws.util.VersionUtil;
+
+import javax.xml.namespace.QName;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
 
 /**
  * This class writes out a Model as an XML document.
@@ -238,7 +228,7 @@
     private Set<String> _exceptionClassNames;
     boolean doneVisitingJAXBModel = false;
     public void visit(JAXBType type) throws Exception {
-        if(!doneVisitingJAXBModel){
+        if(!doneVisitingJAXBModel && type.getJaxbModel() != null){
             Set<String> classNames = type.getJaxbModel().getGeneratedClassNames();
             for(String className : classNames){
                 addJAXBGeneratedClassName(className);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClientProcessorEnvironment.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClientProcessorEnvironment.java
deleted file mode 100644
index 5dad023..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClientProcessorEnvironment.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.util;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import com.sun.tools.internal.ws.processor.ProcessorNotificationListener;
-import com.sun.tools.internal.ws.processor.generator.Names;
-import com.sun.tools.internal.ws.util.JAXWSClassFactory;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-/**
- *
- * @author WS Development Team
- */
-public class ClientProcessorEnvironment extends ProcessorEnvironmentBase
-    implements ProcessorEnvironment {
-
-    /**
-     * The stream where error message are printed.
-     */
-    private OutputStream out;
-
-    /**
-     * A printwriter created lazily in case there are exceptions to report.
-     */
-    private PrintStream outprintstream;
-
-    /**
-     * listener for error/warning/info notifications
-     */
-    private ProcessorNotificationListener listener;
-
-    /**
-     * The classpath to use
-     */
-    private String classPath;
-
-    /**
-     * list of generated source files created in this environment and
-     * its type
-     */
-    private List generatedFiles = new ArrayList();
-
-    /**
-     * The number of errors and warnings
-     */
-    private int nwarnings;
-    private int nerrors;
-
-    /**
-     * flags
-     */
-    private int flags;
-
-    private Names names;
-
-    /**
-     * Create a ClientProcessorEnvironment with the given class path,
-     * stream for messages and ProcessorNotificationListener.
-     */
-    public ClientProcessorEnvironment(
-        OutputStream out,
-        String classPath,
-        ProcessorNotificationListener listener) {
-
-        this.out = out;
-        this.classPath = classPath;
-        this.listener = listener;
-        flags = 0;
-
-        //bug fix:4904604
-        names = JAXWSClassFactory.newInstance().createNames();
-    }
-
-    /**
-     * Set the environment flags
-     */
-    public void setFlags(int flags) {
-        this.flags = flags;
-    }
-
-    /**
-     * Get the environment flags
-     */
-    public int getFlags() {
-        return flags;
-    }
-
-    /**
-     * Get the ClassPath.
-     */
-    public String getClassPath() {
-        return classPath;
-    }
-
-    /**
-     * Is verbose turned on
-     */
-    public boolean verbose() {
-        return (flags & F_VERBOSE) != 0;
-    }
-
-    /**
-     * Remember info on  generated source file generated so that it
-     * can be removed later, if appropriate.
-     */
-    public void addGeneratedFile(GeneratedFileInfo file) {
-        generatedFiles.add(file);
-    }
-
-    /**
-     * Return all the generated files and its types.
-     */
-    public Iterator getGeneratedFiles() {
-        return generatedFiles.iterator();
-    }
-
-    /**
-     * Delete all the generated source files made during the execution
-     * of this environment (those that have been registered with the
-     * "addGeneratedFile" method).
-     */
-    public void deleteGeneratedFiles() {
-        synchronized (generatedFiles) {
-            Iterator iter = generatedFiles.iterator();
-            while (iter.hasNext()) {
-                File file = ((GeneratedFileInfo)iter.next()).getFile();
-                if (file.getName().endsWith(".java")) {
-                    file.delete();
-                }
-            }
-            generatedFiles.clear();
-        }
-    }
-
-    /**
-     * Release resources, if any.
-     */
-    public void shutdown() {
-        listener = null;
-        generatedFiles = null;
-    }
-
-    public void error(Localizable msg) {
-        if (listener != null) {
-            listener.onError(msg);
-        }
-        nerrors++;
-    }
-
-    public void warn(Localizable msg) {
-        if (warnings()) {
-            nwarnings++;
-            if (listener != null) {
-                listener.onWarning(msg);
-            }
-        }
-    }
-
-    public void info(Localizable msg) {
-        if (listener != null) {
-            listener.onInfo(msg);
-        }
-    }
-
-    public void printStackTrace(Throwable t) {
-        if (outprintstream == null) {
-            outprintstream = new PrintStream(out);
-        }
-        t.printStackTrace(outprintstream);
-    }
-
-    public Names getNames() {
-        return names;
-    }
-
-    public int getErrorCount() {
-        return nerrors;
-    }
-
-    public int getWarningCount() {
-        return nwarnings;
-    }
-
-    private boolean warnings() {
-        return (flags & F_WARNINGS) != 0;
-    }
-
-    //bug fix:4904604
-    //to called in compileTool after env is
-    public void setNames(Names names) {
-        this.names = names;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java
index 3a9e079..4d5f21c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,11 @@
 
 package com.sun.tools.internal.ws.processor.util;
 
-import java.io.File;
-
 import com.sun.tools.internal.ws.processor.generator.GeneratorException;
 import com.sun.tools.internal.ws.util.ClassNameInfo;
 
+import java.io.File;
+
 /**
  * Util provides static utility methods used by other wscompile classes.
  *
@@ -37,8 +37,7 @@
  */
 public class DirectoryUtil  {
 
-    public static File getOutputDirectoryFor(String theClass,
-        File rootDir, ProcessorEnvironment env) throws GeneratorException {
+    public static File getOutputDirectoryFor(String theClass, File rootDir) throws GeneratorException {
 
         File outputDir = null;
         String qualifiedClassName = theClass;
@@ -58,7 +57,7 @@
                 outputDir = new File(rootDir, packagePath);
 
                 // Make sure the directory exists...
-                ensureDirectory(outputDir,env);
+                ensureDirectory(outputDir);
             } else {
 
                 // Default package, so use root as output dir...
@@ -81,7 +80,7 @@
                 outputDir = new File(workingDir, packagePath);
 
                 // Make sure the directory exists...
-                ensureDirectory(outputDir,env);
+                ensureDirectory(outputDir);
             }
         }
 
@@ -89,7 +88,7 @@
         return outputDir;
     }
 
-    private static void ensureDirectory(File dir, ProcessorEnvironment env)
+    private static void ensureDirectory(File dir)
         throws GeneratorException {
 
         if (!dir.exists()) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/GeneratedFileInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/GeneratedFileInfo.java
deleted file mode 100644
index b56cc96..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/GeneratedFileInfo.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.util;
-
-import java.io.File;
-
-/**
- * A container to hold info on the files that get
- * generated.
- *
- * @author WS Development Team
- */
-public class GeneratedFileInfo {
-
-    /**
-     * local variables
-     */
-    private File file = null;
-    private String type = null;
-
-    /* constructor */
-    public GeneratedFileInfo() {}
-
-    /**
-     * Adds the file object to the container
-     *
-     * @param file instance of the file to be added
-     */
-    public void setFile( File file ) {
-        this.file = file;
-    }
-
-    /**
-     * Adds the type of file it is the container
-     *
-     * @param type string which specifices the type
-     */
-    public void setType( String type ) {
-        this.type = type;
-    }
-
-    /**
-     * Gets the file that got added
-     *
-     * @return File that got added
-     */
-    public File getFile() {
-        return( file );
-    }
-
-    /**
-     * Get the file type that got added
-     *
-     * @return File type of datatype String
-     */
-    public String getType() {
-        return ( type );
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java
index 9953023..4acc469 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/IndentingWriter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,14 @@
 
 package com.sun.tools.internal.ws.processor.util;
 
+import com.sun.tools.internal.ws.processor.generator.GeneratorException;
+
 import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.Writer;
-
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.text.MessageFormat;
-import com.sun.tools.internal.ws.processor.generator.GeneratorException;
 
 /**
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironment.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironment.java
deleted file mode 100644
index 10d704d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironment.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.util;
-
-import java.net.URLClassLoader;
-import java.util.Iterator;
-
-import com.sun.tools.internal.ws.processor.generator.Names;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-import com.sun.mirror.apt.Filer;
-
-/**
- *
- * @author WS Development Team
- */
-public interface ProcessorEnvironment {
-
-    /*
-     * Flags
-     */
-    int F_VERBOSE       = 1 << 0;
-    int F_WARNINGS      = 1 << 1;
-
-    /**
-     * Set the environment flags
-     */
-    public void setFlags(int flags);
-
-    /**
-     * Get the environment flags
-     */
-    public int getFlags();
-
-    /**
-     * Get the ClassPath.
-     */
-    public String getClassPath();
-
-    /**
-     * Is verbose turned on
-     */
-    public boolean verbose();
-
-    /**
-     * Remember a generated file and its type so that it
-     * can be removed later, if appropriate.
-     */
-    public void addGeneratedFile(GeneratedFileInfo file);
-
-    public Filer getFiler();
-    public void setFiler(Filer filer);
-
-    /**
-     * Delete all the generated files made during the execution of this
-     * environment (those that have been registered with the "addGeneratedFile"
-     * method)
-     */
-    public void deleteGeneratedFiles();
-
-    /**
-     * Get a URLClassLoader from using the classpath
-     */
-    public URLClassLoader getClassLoader();
-
-    public Iterator getGeneratedFiles();
-
-    /**
-     * Release resources, if any.
-     */
-    public void shutdown();
-
-    public void error(Localizable msg);
-
-    public void warn(Localizable msg);
-
-    public void info(Localizable msg);
-
-    public void printStackTrace(Throwable t);
-
-    public Names getNames();
-
-    public int getErrorCount();
-    public int getWarningCount();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironmentBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironmentBase.java
deleted file mode 100644
index 815d923..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ProcessorEnvironmentBase.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.processor.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.StringTokenizer;
-import com.sun.mirror.apt.Filer;
-
-/**
- *
- * @author WS Development Team
- */
-public abstract class ProcessorEnvironmentBase implements ProcessorEnvironment {
-
-    protected URLClassLoader classLoader = null;
-    protected Filer filer = null;
-
-    /**
-     * Get a URLClassLoader from using the classpath
-     */
-    public URLClassLoader getClassLoader() {
-        if (classLoader == null) {
-            classLoader =
-                new URLClassLoader(pathToURLs(getClassPath()),
-                    this.getClass().getClassLoader());
-        }
-        return classLoader;
-    }
-
-    /**
-     * Utility method for converting a search path string to an array
-     * of directory and JAR file URLs.
-     *
-     * @param path the search path string
-     * @return the resulting array of directory and JAR file URLs
-     */
-    public static URL[] pathToURLs(String path) {
-        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
-        URL[] urls = new URL[st.countTokens()];
-        int count = 0;
-        while (st.hasMoreTokens()) {
-            URL url = fileToURL(new File(st.nextToken()));
-            if (url != null) {
-                urls[count++] = url;
-            }
-        }
-        if (urls.length != count) {
-            URL[] tmp = new URL[count];
-            System.arraycopy(urls, 0, tmp, 0, count);
-            urls = tmp;
-        }
-        return urls;
-    }
-
-    /**
-     * Returns the directory or JAR file URL corresponding to the specified
-     * local file name.
-     *
-     * @param file the File object
-     * @return the resulting directory or JAR file URL, or null if unknown
-     */
-    public static URL fileToURL(File file) {
-        String name;
-        try {
-            name = file.getCanonicalPath();
-        } catch (IOException e) {
-            name = file.getAbsolutePath();
-        }
-        name = name.replace(File.separatorChar, '/');
-        if (!name.startsWith("/")) {
-            name = "/" + name;
-        }
-
-        // If the file does not exist, then assume that it's a directory
-        if (!file.isFile()) {
-            name = name + "/";
-        }
-        try {
-            return new URL("file", "", name);
-        } catch (MalformedURLException e) {
-            throw new IllegalArgumentException("file");
-        }
-    }
-
-    public Filer getFiler() {
-        return filer;
-    }
-
-    public void setFiler(Filer filer) {
-        this.filer = filer;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java
new file mode 100644
index 0000000..dc7d75c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ConfigurationMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.configuration");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableCONFIGURATION_INVALID_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("configuration.invalidElement", arg0, arg1, arg2);
+    }
+
+    /**
+     * invalid element "{2}" in file "{0}" (line {1})
+     *
+     */
+    public static String CONFIGURATION_INVALID_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableCONFIGURATION_INVALID_ELEMENT(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableCONFIGURATION_NOT_BINDING_FILE(Object arg0) {
+        return messageFactory.getMessage("configuration.notBindingFile", arg0);
+    }
+
+    /**
+     * Ignoring: binding file ""{0}". It is not a jaxws or a jaxb binding file.
+     *
+     */
+    public static String CONFIGURATION_NOT_BINDING_FILE(Object arg0) {
+        return localizer.localize(localizableCONFIGURATION_NOT_BINDING_FILE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java
new file mode 100644
index 0000000..eb8fde0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class GeneratorMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.generator");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableGENERATOR_NESTED_GENERATOR_ERROR(Object arg0) {
+        return messageFactory.getMessage("generator.nestedGeneratorError", arg0);
+    }
+
+    /**
+     * generator error: {0}
+     *
+     */
+    public static String GENERATOR_NESTED_GENERATOR_ERROR(Object arg0) {
+        return localizer.localize(localizableGENERATOR_NESTED_GENERATOR_ERROR(arg0));
+    }
+
+    public static Localizable localizableGENERATOR_INTERNAL_ERROR_SHOULD_NOT_HAPPEN(Object arg0) {
+        return messageFactory.getMessage("generator.internal.error.should.not.happen", arg0);
+    }
+
+    /**
+     * internal error (should not happen): {0}
+     *
+     */
+    public static String GENERATOR_INTERNAL_ERROR_SHOULD_NOT_HAPPEN(Object arg0) {
+        return localizer.localize(localizableGENERATOR_INTERNAL_ERROR_SHOULD_NOT_HAPPEN(arg0));
+    }
+
+    public static Localizable localizableGENERATOR_INDENTINGWRITER_CHARSET_CANTENCODE(Object arg0) {
+        return messageFactory.getMessage("generator.indentingwriter.charset.cantencode", arg0);
+    }
+
+    /**
+     * WSDL has some characters which native java encoder can''t encode: "{0}"
+     *
+     */
+    public static String GENERATOR_INDENTINGWRITER_CHARSET_CANTENCODE(Object arg0) {
+        return localizer.localize(localizableGENERATOR_INDENTINGWRITER_CHARSET_CANTENCODE(arg0));
+    }
+
+    public static Localizable localizableGENERATOR_CANNOT_CREATE_DIR(Object arg0) {
+        return messageFactory.getMessage("generator.cannot.create.dir", arg0);
+    }
+
+    /**
+     * can''t create directory: {0}
+     *
+     */
+    public static String GENERATOR_CANNOT_CREATE_DIR(Object arg0) {
+        return localizer.localize(localizableGENERATOR_CANNOT_CREATE_DIR(arg0));
+    }
+
+    public static Localizable localizableGENERATOR_CANT_WRITE(Object arg0) {
+        return messageFactory.getMessage("generator.cant.write", arg0);
+    }
+
+    /**
+     * can''t write file: {0}
+     *
+     */
+    public static String GENERATOR_CANT_WRITE(Object arg0) {
+        return localizer.localize(localizableGENERATOR_CANT_WRITE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java
new file mode 100644
index 0000000..c252d19
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class JavacompilerMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.javacompiler");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableJAVACOMPILER_CLASSPATH_ERROR(Object arg0) {
+        return messageFactory.getMessage("javacompiler.classpath.error", arg0);
+    }
+
+    /**
+     * {0} is not available in the classpath, requires Sun's JDK version 5.0 or latter.
+     *
+     */
+    public static String JAVACOMPILER_CLASSPATH_ERROR(Object arg0) {
+        return localizer.localize(localizableJAVACOMPILER_CLASSPATH_ERROR(arg0));
+    }
+
+    public static Localizable localizableJAVACOMPILER_NOSUCHMETHOD_ERROR(Object arg0) {
+        return messageFactory.getMessage("javacompiler.nosuchmethod.error", arg0);
+    }
+
+    /**
+     * There is no such method {0} available, requires Sun's JDK version 5.0 or latter.
+     *
+     */
+    public static String JAVACOMPILER_NOSUCHMETHOD_ERROR(Object arg0) {
+        return localizer.localize(localizableJAVACOMPILER_NOSUCHMETHOD_ERROR(arg0));
+    }
+
+    public static Localizable localizableJAVACOMPILER_ERROR(Object arg0) {
+        return messageFactory.getMessage("javacompiler.error", arg0);
+    }
+
+    /**
+     * error : {0}.
+     *
+     */
+    public static String JAVACOMPILER_ERROR(Object arg0) {
+        return localizer.localize(localizableJAVACOMPILER_ERROR(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelMessages.java
new file mode 100644
index 0000000..c8e2153
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelMessages.java
@@ -0,0 +1,702 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ModelMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.model");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableMODEL_DUPLICATE_SERVICE(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.service", arg0);
+    }
+
+    /**
+     * duplicate service added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_SERVICE(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_SERVICE(arg0));
+    }
+
+    public static Localizable localizableMODEL_NESTED_MODEL_ERROR(Object arg0) {
+        return messageFactory.getMessage("model.nestedModelError", arg0);
+    }
+
+    /**
+     * model error: {0}
+     *
+     */
+    public static String MODEL_NESTED_MODEL_ERROR(Object arg0) {
+        return localizer.localize(localizableMODEL_NESTED_MODEL_ERROR(arg0));
+    }
+
+    public static Localizable localizableMODEL_DUPLICATE_PORTTYPE(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.porttype", arg0);
+    }
+
+    /**
+     * duplicate PortType added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_PORTTYPE(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_PORTTYPE(arg0));
+    }
+
+    public static Localizable localizableMODEL_EXCEPTION_NOTUNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.exception.notunique", arg0, arg1);
+    }
+
+    /**
+     * Failed to generate Java signature: duplicate exception names {0}. Use JAXWS binding customization to rename the wsdl:part "{1}"
+     *
+     */
+    public static String MODEL_EXCEPTION_NOTUNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_EXCEPTION_NOTUNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_WILDCARD_ALL_COMPOSITOR(Object arg0) {
+        return messageFactory.getMessage("model.schema.invalidWildcard.allCompositor", arg0);
+    }
+
+    /**
+     * xsd:all compositor not supported for the wildcard in schema type: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_WILDCARD_ALL_COMPOSITOR(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_WILDCARD_ALL_COMPOSITOR(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_SIMPLE_TYPE_WITH_FACETS(Object arg0) {
+        return messageFactory.getMessage("model.schema.simpleTypeWithFacets", arg0);
+    }
+
+    /**
+     * facet "{0}" not supported on simple type: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_SIMPLE_TYPE_WITH_FACETS(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_SIMPLE_TYPE_WITH_FACETS(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_UNSUPPORTED_TYPE_ANONYMOUS(Object arg0) {
+        return messageFactory.getMessage("model.schema.unsupportedType.anonymous", arg0);
+    }
+
+    /**
+     * unsupported anonymous type ({0})
+     *
+     */
+    public static String MODEL_SCHEMA_UNSUPPORTED_TYPE_ANONYMOUS(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_TYPE_ANONYMOUS(arg0));
+    }
+
+    public static Localizable localizableMODEL_COMPLEX_TYPE_SIMPLE_CONTENT_RESERVED_NAME(Object arg0) {
+        return messageFactory.getMessage("model.complexType.simpleContent.reservedName", arg0);
+    }
+
+    /**
+     * invalid attribute name: "_value" in complexType: "{0}", _value is JAXWS reserved name, this name is generated in the generated javabean class to hold content value in the generated javabean class for complexType/simpleContent.
+     *
+     */
+    public static String MODEL_COMPLEX_TYPE_SIMPLE_CONTENT_RESERVED_NAME(Object arg0) {
+        return localizer.localize(localizableMODEL_COMPLEX_TYPE_SIMPLE_CONTENT_RESERVED_NAME(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_UNION_NOT_SUPPORTED(Object arg0) {
+        return messageFactory.getMessage("model.schema.unionNotSupported", arg0);
+    }
+
+    /**
+     * simpleType: "{0}" derivation by xsd:union not supported
+     *
+     */
+    public static String MODEL_SCHEMA_UNION_NOT_SUPPORTED(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_UNION_NOT_SUPPORTED(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_JAXB_EXCEPTION_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("model.schema.jaxbException.message", arg0);
+    }
+
+    /**
+     * "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_JAXB_EXCEPTION_MESSAGE(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_JAXB_EXCEPTION_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_ID(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.importer.invalidId", arg0, arg1);
+    }
+
+    /**
+     * invalid id "{1} in model document (line {0})
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_ID(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_ID(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_INVALID_MESSAGE_TYPE(Object arg0) {
+        return messageFactory.getMessage("model.invalid.message.type", arg0);
+    }
+
+    /**
+     * invalid message type: {0}
+     *
+     */
+    public static String MODEL_INVALID_MESSAGE_TYPE(Object arg0) {
+        return localizer.localize(localizableMODEL_INVALID_MESSAGE_TYPE(arg0));
+    }
+
+    public static Localizable localizableCONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION() {
+        return messageFactory.getMessage("ConsoleErrorReporter.UnknownLocation");
+    }
+
+    /**
+     * unknown location
+     *
+     */
+    public static String CONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION() {
+        return localizer.localize(localizableCONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION());
+    }
+
+    public static Localizable localizableMODEL_EXPORTER_UNSUPPORTED_CLASS(Object arg0) {
+        return messageFactory.getMessage("model.exporter.unsupportedClass", arg0);
+    }
+
+    /**
+     * model exporter: unsupported class: {0}
+     *
+     */
+    public static String MODEL_EXPORTER_UNSUPPORTED_CLASS(Object arg0) {
+        return localizer.localize(localizableMODEL_EXPORTER_UNSUPPORTED_CLASS(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_ENCODER_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("model.schema.encoderNotFound", arg0);
+    }
+
+    /**
+     * no encoder found for simpleType: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_ENCODER_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_ENCODER_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_ELEMENT_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("model.schema.elementNotFound", arg0);
+    }
+
+    /**
+     * Element "{0}" not found.
+     *
+     */
+    public static String MODEL_SCHEMA_ELEMENT_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_ELEMENT_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableMODEL_UNIQUENESS_JAVASTRUCTURETYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.uniqueness.javastructuretype", arg0, arg1);
+    }
+
+    /**
+     * uniqueness constraint violation, duplicate member "{0}" added to JavaStructureType "{1}"
+     *
+     */
+    public static String MODEL_UNIQUENESS_JAVASTRUCTURETYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_UNIQUENESS_JAVASTRUCTURETYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.saxparser.exception", arg0, arg1);
+    }
+
+    /**
+     * {0}
+     * {1}
+     *
+     */
+    public static String MODEL_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_SAXPARSER_EXCEPTION(arg0, arg1));
+    }
+
+    public static Localizable localizable_002F_002F_JAXWS() {
+        return messageFactory.getMessage("//JAXWS");
+    }
+
+    /**
+     *  2.0
+     *
+     */
+    public static String _002F_002F_JAXWS() {
+        return localizer.localize(localizable_002F_002F_JAXWS());
+    }
+
+    public static Localizable localizableMODEL_DUPLICATE_FAULTMESSAGE(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.faultmessage", arg0);
+    }
+
+    /**
+     * duplicate fault message added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_FAULTMESSAGE(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_FAULTMESSAGE(arg0));
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_PROPERTY(Object arg0) {
+        return messageFactory.getMessage("model.importer.invalidProperty", arg0);
+    }
+
+    /**
+     * invalid property in model document (line {0}
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_PROPERTY(Object arg0) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_PROPERTY(arg0));
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_SYNTAX_ERROR(Object arg0) {
+        return messageFactory.getMessage("model.importer.syntaxError", arg0);
+    }
+
+    /**
+     * syntax error in model document (line {0})
+     *
+     */
+    public static String MODEL_IMPORTER_SYNTAX_ERROR(Object arg0) {
+        return localizer.localize(localizableMODEL_IMPORTER_SYNTAX_ERROR(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_UNSUPPORTED_TYPE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("model.schema.unsupportedType", arg0, arg1, arg2);
+    }
+
+    /**
+     * unsupported type ({0}): "{1}" (namespace: {2})
+     *
+     */
+    public static String MODEL_SCHEMA_UNSUPPORTED_TYPE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_TYPE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_JAVA_TYPE(Object arg0) {
+        return messageFactory.getMessage("model.schema.invalidSimpleType.noJavaType", arg0);
+    }
+
+    /**
+     * no java mapping for simpleType: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_JAVA_TYPE(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_JAVA_TYPE(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_LIST_NOT_SUPPORTED(Object arg0) {
+        return messageFactory.getMessage("model.schema.listNotSupported", arg0);
+    }
+
+    /**
+     * simpleType: "{0}" derivation by xsd:list not supported
+     *
+     */
+    public static String MODEL_SCHEMA_LIST_NOT_SUPPORTED(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_LIST_NOT_SUPPORTED(arg0));
+    }
+
+    public static Localizable localizableMODEL_ARRAYWRAPPER_NO_PARENT() {
+        return messageFactory.getMessage("model.arraywrapper.no.parent");
+    }
+
+    /**
+     * LiteralArrayWrapper cannot have a parent type
+     *
+     */
+    public static String MODEL_ARRAYWRAPPER_NO_PARENT() {
+        return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_PARENT());
+    }
+
+    public static Localizable localizableMODEL_DUPLICATE_PART(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.part", arg0);
+    }
+
+    /**
+     * duplicate part added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_PART(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_PART(arg0));
+    }
+
+    public static Localizable localizableMODEL_DUPLICATE_OPERATION(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.operation", arg0);
+    }
+
+    /**
+     * duplicate Operation added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_OPERATION(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_OPERATION(arg0));
+    }
+
+    public static Localizable localizableMODEL_PARENT_TYPE_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("model.parent.type.already.set", arg0, arg1, arg2);
+    }
+
+    /**
+     * parent of type "{0}" already set to "{1}", new value = "{2}"
+     *
+     */
+    public static String MODEL_PARENT_TYPE_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableMODEL_PARENT_TYPE_ALREADY_SET(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableMODEL_ARRAYWRAPPER_NO_SUBTYPES() {
+        return messageFactory.getMessage("model.arraywrapper.no.subtypes");
+    }
+
+    /**
+     * LiteralArrayWrapper cannot have subtypes
+     *
+     */
+    public static String MODEL_ARRAYWRAPPER_NO_SUBTYPES() {
+        return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_SUBTYPES());
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("model.schema.invalidLiteralInEnumeration", arg0, arg1, arg2);
+    }
+
+    /**
+     * invalid literal "{0}" in enumeration "{1}" (namespace: {2})
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_UNSUPPORTED_SCHEMA_TYPE(Object arg0) {
+        return messageFactory.getMessage("model.schema.unsupportedSchemaType", arg0);
+    }
+
+    /**
+     * unsupported schema type: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_UNSUPPORTED_SCHEMA_TYPE(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_SCHEMA_TYPE(arg0));
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_MINOR_MINOR_OR_PATCH_VERSION(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("model.importer.invalidMinorMinorOrPatchVersion", arg0, arg1, arg2);
+    }
+
+    /**
+     * model version "{1}" newer than runtime version "{2}" (line {0}): need to upgrade to a newer runtime
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_MINOR_MINOR_OR_PATCH_VERSION(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_MINOR_MINOR_OR_PATCH_VERSION(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_CIRCULARITY(Object arg0) {
+        return messageFactory.getMessage("model.schema.circularity", arg0);
+    }
+
+    /**
+     * circularity detected in schema: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_CIRCULARITY(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_CIRCULARITY(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_NOT_IMPLEMENTED_GENERATING_SOAP_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.schema.notImplemented.generatingSOAPElement", arg0, arg1);
+    }
+
+    /**
+     * unsupported XML Schema feature: "{0}" in component {1}, mapping it to javax.xml.soap.SOAPElement
+     *
+     */
+    public static String MODEL_SCHEMA_NOT_IMPLEMENTED_GENERATING_SOAP_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_SCHEMA_NOT_IMPLEMENTED_GENERATING_SOAP_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_ARRAYWRAPPER_MEMBER_ALREADY_SET() {
+        return messageFactory.getMessage("model.arraywrapper.member.already.set");
+    }
+
+    /**
+     * LiteralArrayWrapper element member already set.
+     *
+     */
+    public static String MODEL_ARRAYWRAPPER_MEMBER_ALREADY_SET() {
+        return localizer.localize(localizableMODEL_ARRAYWRAPPER_MEMBER_ALREADY_SET());
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_CLASS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.importer.invalidClass", arg0, arg1);
+    }
+
+    /**
+     * invalid class name "{1}" in model document (line {0})
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_CLASS(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_CLASS(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_NON_MODEL() {
+        return messageFactory.getMessage("model.importer.nonModel");
+    }
+
+    /**
+     * not a valid model document
+     *
+     */
+    public static String MODEL_IMPORTER_NON_MODEL() {
+        return localizer.localize(localizableMODEL_IMPORTER_NON_MODEL());
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_VERSION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.importer.invalidVersion", arg0, arg1);
+    }
+
+    /**
+     * invalid version "{1}" in model document (line {0})
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_VERSION(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_VERSION(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_NAMESPACE_URI(Object arg0) {
+        return messageFactory.getMessage("model.schema.invalidSimpleType.noNamespaceURI", arg0);
+    }
+
+    /**
+     * invalid simpleType: "{0}", had null namespaceURI
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_NAMESPACE_URI(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_NAMESPACE_URI(arg0));
+    }
+
+    public static Localizable localizableCONSOLE_ERROR_REPORTER_LINE_X_OF_Y(Object arg0, Object arg1) {
+        return messageFactory.getMessage("ConsoleErrorReporter.LineXOfY", arg0, arg1);
+    }
+
+    /**
+     *   line {0} of {1}
+     *
+     */
+    public static String CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(Object arg0, Object arg1) {
+        return localizer.localize(localizableCONSOLE_ERROR_REPORTER_LINE_X_OF_Y(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_PARAMETER_NOTUNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.parameter.notunique", arg0, arg1);
+    }
+
+    /**
+     * Failed to generate Java signature: duplicate parameter names {0}. Use JAXWS binding customization to rename the wsdl:part "{1}"
+     *
+     */
+    public static String MODEL_PARAMETER_NOTUNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_PARAMETER_NOTUNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_INVALID_ITEM_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.schema.invalidSimpleType.invalidItemType", arg0, arg1);
+    }
+
+    /**
+     * in simpleType: "{0}", itemType "{1}" can not be derived by list
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_INVALID_ITEM_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_INVALID_ITEM_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_DUPLICATE_PROPERTY(Object arg0) {
+        return messageFactory.getMessage("model.duplicate.property", arg0);
+    }
+
+    /**
+     * duplicate property added to model: {0}
+     *
+     */
+    public static String MODEL_DUPLICATE_PROPERTY(Object arg0) {
+        return localizer.localize(localizableMODEL_DUPLICATE_PROPERTY(arg0));
+    }
+
+    public static Localizable localizableMODEL_UNIQUENESS() {
+        return messageFactory.getMessage("model.uniqueness");
+    }
+
+    /**
+     * uniqueness constraint violation
+     *
+     */
+    public static String MODEL_UNIQUENESS() {
+        return localizer.localize(localizableMODEL_UNIQUENESS());
+    }
+
+    public static Localizable localizable_002F_002F_REPLACEMENT() {
+        return messageFactory.getMessage("//replacement");
+    }
+
+    /**
+     * for Uxxx codes
+     *
+     */
+    public static String _002F_002F_REPLACEMENT() {
+        return localizer.localize(localizable_002F_002F_REPLACEMENT());
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_ITEM_LITERAL_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.schema.invalidSimpleType.noItemLiteralType", arg0, arg1);
+    }
+
+    /**
+     * in simpleType: "{0}", xsd:list itemType "{1}" is invalid
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_ITEM_LITERAL_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_ITEM_LITERAL_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE(Object arg0) {
+        return messageFactory.getMessage("model.schema.invalidSimpleType", arg0);
+    }
+
+    /**
+     * invalid simpleType: "{0}"
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE(arg0));
+    }
+
+    public static Localizable localizableMODEL_ARRAYWRAPPER_ONLY_ONE_MEMBER() {
+        return messageFactory.getMessage("model.arraywrapper.only.one.member");
+    }
+
+    /**
+     * LiteralArrayWrapper may only have one element member.
+     *
+     */
+    public static String MODEL_ARRAYWRAPPER_ONLY_ONE_MEMBER() {
+        return localizer.localize(localizableMODEL_ARRAYWRAPPER_ONLY_ONE_MEMBER());
+    }
+
+    public static Localizable localizableMODEL_IMPORTER_INVALID_LITERAL(Object arg0) {
+        return messageFactory.getMessage("model.importer.invalidLiteral", arg0);
+    }
+
+    /**
+     * invalid literal value in model document (line {0})
+     *
+     */
+    public static String MODEL_IMPORTER_INVALID_LITERAL(Object arg0) {
+        return localizer.localize(localizableMODEL_IMPORTER_INVALID_LITERAL(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_NOT_IMPLEMENTED(Object arg0) {
+        return messageFactory.getMessage("model.schema.notImplemented", arg0);
+    }
+
+    /**
+     * unsupported XML Schema feature ({0})
+     *
+     */
+    public static String MODEL_SCHEMA_NOT_IMPLEMENTED(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_NOT_IMPLEMENTED(arg0));
+    }
+
+    public static Localizable localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION_ANONYMOUS(Object arg0) {
+        return messageFactory.getMessage("model.schema.invalidLiteralInEnumeration.anonymous", arg0);
+    }
+
+    /**
+     * invalid literal "{0}" in anonymous enumeration
+     *
+     */
+    public static String MODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION_ANONYMOUS(Object arg0) {
+        return localizer.localize(localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION_ANONYMOUS(arg0));
+    }
+
+    public static Localizable localizableMODEL_ARRAYWRAPPER_NO_CONTENT_MEMBER() {
+        return messageFactory.getMessage("model.arraywrapper.no.content.member");
+    }
+
+    /**
+     * LiteralArrayWrapper cannot have a content member
+     *
+     */
+    public static String MODEL_ARRAYWRAPPER_NO_CONTENT_MEMBER() {
+        return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_CONTENT_MEMBER());
+    }
+
+    public static Localizable localizableMODEL_PART_NOT_UNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("model.part.notUnique", arg0, arg1);
+    }
+
+    /**
+     * parts in wsdl:message "{0}", reference "{1}", they must reference unique global elements.
+     *
+     */
+    public static String MODEL_PART_NOT_UNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMODEL_PART_NOT_UNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableMODEL_PARENT_FAULT_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("model.parent.fault.already.set", arg0, arg1, arg2);
+    }
+
+    /**
+     * parent of fault "{0}" already set to "{1}", new value = "{2}"
+     *
+     */
+    public static String MODEL_PARENT_FAULT_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableMODEL_PARENT_FAULT_ALREADY_SET(arg0, arg1, arg2));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelerMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelerMessages.java
new file mode 100644
index 0000000..05c0486
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelerMessages.java
@@ -0,0 +1,1602 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ModelerMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.modeler");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_INVALID_SCHEMA_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.invalidSchemaType", arg0, arg1);
+    }
+
+    /**
+     * Ignoring the mime:part. mime part: {0} can not be mapped to schema type: {1}
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_INVALID_SCHEMA_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_INVALID_SCHEMA_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.parameterorder.parameter", arg0, arg1);
+    }
+
+    /**
+     * "{0}" specified in the parameterOrder attribute of operation "{1}" is not a valid part of the message.
+     *
+     */
+    public static String WSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.noSoapFaultName", arg0, arg1);
+    }
+
+    /**
+     * soap:fault name not specified, wsdl:fault "{0}" in operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_IMPORT() {
+        return messageFactory.getMessage("wsdlmodeler.warning.nonconforming.wsdl.import");
+    }
+
+    /**
+     * Non conforming WS-I WSDL used for wsdl:import
+     *
+     */
+    public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_IMPORT() {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_IMPORT());
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.outputSoapBody.missingNamespace", arg0);
+    }
+
+    /**
+     * output message of binding operation "{0}" must specify a value for the "namespace" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.fault.notLiteral", arg0, arg1);
+    }
+
+    /**
+     * ignoring encoded fault "{0}" in literal binding operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.inputMissingSoapBody", arg0);
+    }
+
+    /**
+     * input message of binding operation "{0}" does not have a SOAP body extension
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport", arg0);
+    }
+
+    /**
+     * ignoring SOAP port "{0}": unrecognized transport. try running wsimport with -extension switch.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.notFound", arg0, arg1);
+    }
+
+    /**
+     * in binding "{1}", operation "{0}" does not match any operation in the corresponding port type
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_UNSUPPORTED_BINDING_MIME() {
+        return messageFactory.getMessage("wsdlmodeler.unsupportedBinding.mime");
+    }
+
+    /**
+     * WSDL MIME binding is not currently supported!
+     *
+     */
+    public static String WSDLMODELER_UNSUPPORTED_BINDING_MIME() {
+        return localizer.localize(localizableWSDLMODELER_UNSUPPORTED_BINDING_MIME());
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NO_ELEMENT_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeaderFault.noElementAttribute", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring header fault part="{0}" message="{1}" of operation {2}
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NO_ELEMENT_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NO_ELEMENT_ATTRIBUTE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.nonWrapperStyle", arg0, arg1, arg2);
+    }
+
+    /**
+     * Invalid operation "{0}", can''t generate java method. Parameter: part "{2}" in wsdl:message "{1}", is a java keyword. Use customization to change the parameter name or change the wsdl:part name.
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADERFAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.headerfault.notLiteral", arg0, arg1);
+    }
+
+    /**
+     * Invalid headerfault "{0}" of binding operation "{1}": not literal
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADERFAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADERFAULT_NOT_LITERAL(arg0, arg1));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART() {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.differentPart");
+    }
+
+    /**
+     * Ignoring the mime:part. Invalid mime:part, the mime:content has different part attribute.
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART() {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART());
+    }
+
+    public static Localizable localizableWSDLMODELER_ERROR_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.error.partNotFound", arg0, arg1);
+    }
+
+    /**
+     * part "{1}" of operation "{0}" could not be resolved!
+     *
+     */
+    public static String WSDLMODELER_ERROR_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_ERROR_PART_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.header.message.partMustHaveElementDescriptor", arg0, arg1);
+    }
+
+    /**
+     * Invalid header "{0}" in operation {1}: part must specify a "element" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.operationName", arg0);
+    }
+
+    /**
+     * Invalid operation "{0}", it''s java reserved word, can''t generate java method. Use customization to change the operation name.
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.outputMissingSoapFault", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" in operation "{1}" does not have a SOAP fault extension
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleElementMessagePart", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": message part does not refer to a schema type declaration
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(arg0));
+    }
+
+    public static Localizable localizableWSDLMODLER_WARNING_OPERATION_USE() {
+        return messageFactory.getMessage("wsdlmodler.warning.operation.use");
+    }
+
+    /**
+     * The WSDL used has operations with literal and encoded use. -f:searchschema is not supported for this scenario.
+     *
+     */
+    public static String WSDLMODLER_WARNING_OPERATION_USE() {
+        return localizer.localize(localizableWSDLMODLER_WARNING_OPERATION_USE());
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringNonSOAPPort", arg0);
+    }
+
+    /**
+     * ignoring port "{0}": not a standard SOAP port. try running wsimport with -extension switch.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.messageHasMoreThanOnePart", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" refers to message "{1}", but the message has more than one parts
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND() {
+        return messageFactory.getMessage("wsdlmodeler.warning.noServiceDefinitionsFound");
+    }
+
+    /**
+     * WSDL document does not define any services
+     *
+     */
+    public static String WSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND() {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND());
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringFault.cant.resolve.message", arg0, arg1);
+    }
+
+    /**
+     * ignoring fault "{0}" of binding operation "{1}": cannot resolve message
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_CANT_RESOLVE_MESSAGE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_JAXB_JAVATYPE_NOTFOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.jaxb.javatype.notfound", arg0, arg1);
+    }
+
+    /**
+     * Schema descriptor {0} in message part "{1}" could not be bound to Java!
+     *
+     */
+    public static String WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_JAXB_JAVATYPE_NOTFOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.port.SOAPBinding.mixedStyle", arg0);
+    }
+
+    /**
+     * not a WS-I BP1.1 compliant SOAP port "{0}": the wsdl binding has mixed style, it must be rpc-literal or document-literal operation!
+     *
+     */
+    public static String WSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_DOCLITOPERATION(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.doclitoperation", arg0);
+    }
+
+    /**
+     * Invalid wsdl:operation "{0}": its a document-literal operation,  message part must refer to a schema element declaration
+     *
+     */
+    public static String WSDLMODELER_INVALID_DOCLITOPERATION(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_DOCLITOPERATION(arg0));
+    }
+
+    public static Localizable localizableMODELER_NESTED_MODEL_ERROR(Object arg0) {
+        return messageFactory.getMessage("modeler.nestedModelError", arg0);
+    }
+
+    /**
+     * modeler error: {0}
+     *
+     */
+    public static String MODELER_NESTED_MODEL_ERROR(Object arg0) {
+        return localizer.localize(localizableMODELER_NESTED_MODEL_ERROR(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.duplicate.fault.soap.name", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring fault "{0}" of operation "{1}", soap:fault name "{2}" is not unique
+     *
+     */
+    public static String WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.wrongSoapFaultName", arg0, arg1, arg2);
+    }
+
+    /**
+     * name of soap:fault "{0}" doesn''t match the name of wsdl:fault "{1}" in operation "{2}"
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_LITERAL(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.notLiteral", arg0);
+    }
+
+    /**
+     * ignoring document-style operation "{0}": parameters are not literal
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_LITERAL(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_LITERAL(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_DOCUMENT_STYLE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleDocumentStyle", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": cannot handle document-style operations
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_DOCUMENT_STYLE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_DOCUMENT_STYLE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringFault.notLiteral", arg0, arg1);
+    }
+
+    /**
+     * ignoring encoded fault "{0}" of binding operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_RPCLITOPERATION(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.rpclitoperation", arg0);
+    }
+
+    /**
+     * Invalid wsdl:operation "{0}": its a rpc-literal operation,  message part must refer to a schema type declaration
+     *
+     */
+    public static String WSDLMODELER_INVALID_RPCLITOPERATION(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_RPCLITOPERATION(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customName", arg0, arg1);
+    }
+
+    /**
+     * Invalid operation "{0}", can''t generate java method. Parameter,customized name "{1}"  is a java keyword.
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.bindingOperation.multiplePartBinding", arg0, arg1);
+    }
+
+    /**
+     * Check the abstract operation "{0}" binding, part "{1}" has multiple binding. Will try to generated artiffacts anyway...
+     *
+     */
+    public static String WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_12(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.port.SOAPBinding12", arg0);
+    }
+
+    /**
+     * SOAP port "{0}": uses a non-standard SOAP 1.2 binding.
+     *
+     */
+    public static String WSDLMODELER_WARNING_PORT_SOAP_BINDING_12(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_12(arg0));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.invalidMimePart.nameNotAllowed", arg0);
+    }
+
+    /**
+     * name attribute on wsdl:part in Operation "{0}" is ignored. Its not allowed as per WS-I AP 1.0.
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_MIME_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringMimePart.notFound", arg0, arg1);
+    }
+
+    /**
+     * ignoring mime:part, cannot find part "{0}" referenced by the mime:content in the wsdl:operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_MIME_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_MIME_PART_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.operation.MoreThanOnePartInMessage", arg0);
+    }
+
+    /**
+     * Ingoring operation "{0}": more than one part bound to body
+     *
+     */
+    public static String WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle", arg0, arg1, arg2);
+    }
+
+    /**
+     * Ignoring operation "{0}", can''t generate java method. Parameter: part "{2}" in wsdl:message "{1}", is a java keyword. Use customization to change the parameter name or change the wsdl:part name.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.fault.cant.resolve.message", arg0, arg1);
+    }
+
+    /**
+     * fault message "{0}" in binding operation "{1}" could not be resolved
+     *
+     */
+    public static String WSDLMODELER_INVALID_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_FAULT_CANT_RESOLVE_MESSAGE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.emptyMessage", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" refers to message "{1}", but the message has no parts
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.rpclit.unkownschematype", arg0, arg1, arg2);
+    }
+
+    /**
+     * XML type "{0}" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "{1}" in the wsdl:message "{2}".
+     *
+     */
+    public static String WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_HEADERFAULT_PART_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.headerfault.part.notFound", arg0, arg1, arg2);
+    }
+
+    /**
+     * part "{1}" not found for the header fault "{0}", in binding "{2}"
+     *
+     */
+    public static String WSDLMODELER_HEADERFAULT_PART_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_HEADERFAULT_PART_NOT_FOUND(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_BODY_PARTS_ATTRIBUTE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleBodyPartsAttribute", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": cannot handle "parts" attribute of "soap:body" element
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_BODY_PARTS_ATTRIBUTE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_BODY_PARTS_ATTRIBUTE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle", arg0);
+    }
+
+    /**
+     * ignoring port "{0}", its not WS-I BP 1.1 compliant: the wsdl binding has mixed style, it must be rpc-literal or document-literal operation. try running wsimport with -extension switch.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(arg0));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.missingTypeAttribute", arg0);
+    }
+
+    /**
+     * Missing type attribute in mime:content in operation "{0}". part attribute must be present in mime:content declaration.
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_INPUT_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleEmptyInputMessage", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": input message is empty
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_INPUT_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_INPUT_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.noPortsInService", arg0);
+    }
+
+    /**
+     * Service "{0}" does not contain any usable ports. try running wsimport with -extension switch.
+     *
+     */
+    public static String WSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_PARAMETER_ORDER_TOO_MANY_UNMENTIONED_PARTS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.parameterOrder.tooManyUnmentionedParts", arg0);
+    }
+
+    /**
+     * more than one part left out in the parameterOrder attribute of operation "{0}"
+     *
+     */
+    public static String WSDLMODELER_INVALID_PARAMETER_ORDER_TOO_MANY_UNMENTIONED_PARTS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_ORDER_TOO_MANY_UNMENTIONED_PARTS(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.inputSoapBody.missingNamespace", arg0);
+    }
+
+    /**
+     * input message of binding operation "{0}" must specify a value for the "namespace" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of binding operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_RESPONSEBEAN_NOTFOUND(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.responsebean.notfound", arg0);
+    }
+
+    /**
+     * wsimport failed to generate async response bean for operation: {0}
+     *
+     */
+    public static String WSDLMODELER_RESPONSEBEAN_NOTFOUND(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_RESPONSEBEAN_NOTFOUND(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_20_RPCENC_NOT_SUPPORTED() {
+        return messageFactory.getMessage("wsdlmodeler20.rpcenc.not.supported");
+    }
+
+    /**
+     * rpc/encoded wsdl's are not supported in JAXWS 2.0.
+     *
+     */
+    public static String WSDLMODELER_20_RPCENC_NOT_SUPPORTED() {
+        return localizer.localize(localizableWSDLMODELER_20_RPCENC_NOT_SUPPORTED());
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.partNotFound", arg0, arg1);
+    }
+
+    /**
+     * ignoring operation "{0}": part "{1}" not found
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.message.partMustHaveElementDescriptor", arg0, arg1);
+    }
+
+    /**
+     * in message "{0}", part "{1}" must specify a "element" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_ERROR_PARTS_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.error.partsNotFound", arg0, arg1);
+    }
+
+    /**
+     * parts "{0}" not found in the message "{1}", wrong WSDL
+     *
+     */
+    public static String WSDLMODELER_ERROR_PARTS_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_ERROR_PARTS_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_ENCODED(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringFault.notEncoded", arg0, arg1);
+    }
+
+    /**
+     * ignoring literal fault "{0}" of binding operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_FAULT_NOT_ENCODED(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_ENCODED(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.notSupportedStyle", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": not request-response or one-way
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_TYPE_DESCRIPTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.message.partMustHaveTypeDescriptor", arg0, arg1);
+    }
+
+    /**
+     * in message "{0}", part "{1}" must specify a "type" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_TYPE_DESCRIPTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_TYPE_DESCRIPTOR(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_MULTIPLE_OUTPUT_PARAMETERS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.multipleOutputParameters", arg0);
+    }
+
+    /**
+     * multiple "out" parameters in operation: {0}
+     *
+     */
+    public static String WSDLMODELER_MULTIPLE_OUTPUT_PARAMETERS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_MULTIPLE_OUTPUT_PARAMETERS(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.multiplePartBinding", arg0, arg1);
+    }
+
+    /**
+     * abstract operation "{0}" binding, part "{1}" has multiple binding.
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID() {
+        return messageFactory.getMessage("wsdlmodeler.invalid");
+    }
+
+    /**
+     * invalid WSDL document
+     *
+     */
+    public static String WSDLMODELER_INVALID() {
+        return localizer.localize(localizableWSDLMODELER_INVALID());
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.multipleMatchingOperations", arg0, arg1);
+    }
+
+    /**
+     * in binding "{1}", operation "{0}" does not reference a unique operation in the corresponding port type
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_NON_UNIQUE_BODY(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return messageFactory.getMessage("wsdlmodeler.nonUnique.body", arg0, arg1, arg2, arg3);
+    }
+
+    /**
+     * Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations "{1}" and "{2}" have the same request body block {3}
+     *
+     */
+    public static String WSDLMODELER_NON_UNIQUE_BODY(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return localizer.localize(localizableWSDLMODELER_NON_UNIQUE_BODY(arg0, arg1, arg2, arg3));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.cant.resolve.message", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of binding operation "{1}": cannot resolve message
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customizedOperationName", arg0, arg1);
+    }
+
+    /**
+     * Ignoring operation "{0}", can''t generate java method ,customized name "{1}" of the wsdl:operation is a java keyword.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.notLiteral", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of binding operation "{1}": not literal
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_LITERAL(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.inputHeader.missingNamespace", arg0, arg1);
+    }
+
+    /**
+     * input header "{1}" of binding operation "{0}" must specify a value for the "namespace" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_HEADER_MISSING_NAMESPACE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.missingInputName", arg0);
+    }
+
+    /**
+     * binding operation "{0}" must specify a name for its input message
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringNonSOAPPort.noAddress", arg0);
+    }
+
+    /**
+     * ignoring port "{0}": no SOAP address specified. try running wsimport with -extension switch.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_RESULT_IS_IN_OUT_PARAMETER(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.resultIsInOutParameter", arg0);
+    }
+
+    /**
+     * result is "inout" parameter in operation: {0}
+     *
+     */
+    public static String WSDLMODELER_RESULT_IS_IN_OUT_PARAMETER(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_RESULT_IS_IN_OUT_PARAMETER(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.header.notFound", arg0, arg1);
+    }
+
+    /**
+     * header "{0}" of binding operation "{1}": not found
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableMIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("mimemodeler.elementPart.invalidElementMimeType", arg0, arg1);
+    }
+
+    /**
+     * The mime:content part refers to wsdl:part "{0}", defined using element attribute. Please make sure the mime type: "{1}" is appropriate to serialize XML.
+     *
+     */
+    public static String MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.header.notLiteral", arg0, arg1);
+    }
+
+    /**
+     * Invalid header "{0}" of binding operation "{1}": not literal
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_NOT_LITERAL(arg0, arg1));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_MESAGE_PART_ELEMENT_KIND(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.mesagePartElementKind", arg0);
+    }
+
+    /**
+     * wsdl:part element referenced by mime:content part attribute: {0} must be defined using type attribute!
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_MESAGE_PART_ELEMENT_KIND(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MESAGE_PART_ELEMENT_KIND(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_ENCODED(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.notEncoded", arg0);
+    }
+
+    /**
+     * ignoring RPC-style operation "{0}": parameters are not encoded
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_ENCODED(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_ENCODED(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_TYPES() {
+        return messageFactory.getMessage("wsdlmodeler.warning.nonconforming.wsdl.types");
+    }
+
+    /**
+     * Non conforming WS-I WSDL used for wsdl:types
+     *
+     */
+    public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_TYPES() {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_TYPES());
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_INPUT_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleMoreThanOnePartInInputMessage", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": more than one part in input message
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_INPUT_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_INPUT_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_OUTPUT_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleEmptyOutputMessage", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": output message is empty
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_OUTPUT_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_OUTPUT_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_R_2716_R_2726(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.r2716r2726", arg0, arg1);
+    }
+
+    /**
+     * R2716/R2726 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit or rpc/lit for {0}: "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_R_2716_R_2726(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_R_2716_R_2726(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NO_SOAP_ADDRESS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.noSOAPAddress", arg0);
+    }
+
+    /**
+     * port "{0}" is not a SOAP port, it has no soap:address
+     *
+     */
+    public static String WSDLMODELER_WARNING_NO_SOAP_ADDRESS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NO_SOAP_ADDRESS(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_FAULTS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringFaults", arg0);
+    }
+
+    /**
+     * ignoring faults declared by operation "{0}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_FAULTS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULTS(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.missingName", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" in operation "{1}" must specify a value for the "name" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableMIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.warning.IgnoringinvalidHeaderPart.notDeclaredInRootPart", arg0);
+    }
+
+    /**
+     * Headers not in root mime:part with soap:body, ignoring headers in operation "{0}"
+     *
+     */
+    public static String MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(arg0));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_ERROR_LOADING_JAVA_CLASS() {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.errorLoadingJavaClass");
+    }
+
+    /**
+     * Couldn't find class "{0}" for mime type "{1}"
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_ERROR_LOADING_JAVA_CLASS() {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_ERROR_LOADING_JAVA_CLASS());
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.notInPortType", arg0, arg1);
+    }
+
+    /**
+     * in binding "{1}", operation "{0}" does not appear in the corresponding port type
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CONFLICT_STYLE_IN_WSI_MODE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.conflictStyleInWSIMode", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": binding style and operation style are conflicting
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CONFLICT_STYLE_IN_WSI_MODE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CONFLICT_STYLE_IN_WSI_MODE(arg0));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.missingPartAttribute", arg0);
+    }
+
+    /**
+     * Ignoring operation "{0}", missing part attribute in mime:content. part attribute must be present in mime:content declaration.
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_SEARCH_SCHEMA_UNRECOGNIZED_TYPES(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.searchSchema.unrecognizedTypes", arg0);
+    }
+
+    /**
+     * encountered {0} unrecognized type(s)
+     *
+     */
+    public static String WSDLMODELER_WARNING_SEARCH_SCHEMA_UNRECOGNIZED_TYPES(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_SEARCH_SCHEMA_UNRECOGNIZED_TYPES(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customizedOperationName", arg0, arg1);
+    }
+
+    /**
+     * Invalid operation "{0}", can''t generate java method ,customized name "{1}" of the wsdl:operation is a java keyword.
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.header.cant.resolve.message", arg0, arg1);
+    }
+
+    /**
+     * header "{0}" of binding operation "{1}": cannot resolve message
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.missingNamespace", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" in operation "{1}" must specify a value for the "namespace" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAMESPACE(arg0, arg1));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(Object arg0) {
+        return messageFactory.getMessage("mimemodeler.invalidMimePart.moreThanOneSOAPBody", arg0);
+    }
+
+    /**
+     * Ignoring operation "{0}". The Multipart/Related structure has invalid root part: more than one soap:body parts found
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(Object arg0) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_INCONSISTENT_DEFINITION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.inconsistentDefinition", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of operation "{1}": part not found
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_INCONSISTENT_DEFINITION(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_INCONSISTENT_DEFINITION(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.notFound", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" in operation "{1}" does not match any fault in the corresponding port type operation
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customName", arg0, arg1);
+    }
+
+    /**
+     * Ignoring operation "{0}", can''t generate java method. Parameter,customized name "{1}" is a java keyword.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringUnrecognizedSchemaExtension", arg0);
+    }
+
+    /**
+     * ignoring schema element (unsupported version): {0}
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeaderFault.notFound", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring header fault "{0}", cannot find part "{1}" in binding "{2}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_FOUND(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle", arg0, arg1, arg2);
+    }
+
+    /**
+     * Invalid operation "{0}", can''t generate java method parameter. Local name of the wrapper child "{1}" in the global element "{2}" is a java keyword. Use customization to change the parameter name.
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableMIMEMODELER_INVALID_MIME_CONTENT_UNKNOWN_SCHEMA_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("mimemodeler.invalidMimeContent.unknownSchemaType", arg0, arg1);
+    }
+
+    /**
+     * Unknown schema type: {1} for mime:content part: {0}
+     *
+     */
+    public static String MIMEMODELER_INVALID_MIME_CONTENT_UNKNOWN_SCHEMA_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_UNKNOWN_SCHEMA_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_R_2716(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.r2716", arg0, arg1);
+    }
+
+    /**
+     * R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for {0}: "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_R_2716(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_R_2716(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.notFound", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of binding operation "{1}": not found
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleTypeMessagePart", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": message part does not refer to a schema element declaration
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.parameterOrder.invalidParameterOrder", arg0);
+    }
+
+    /**
+     * parameterOrder attribute on operation "{0}" is invalid, ignoring parameterOrder hint
+     *
+     */
+    public static String WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.missingOutputName", arg0);
+    }
+
+    /**
+     * binding operation "{0}" must specify a name for its output message
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalidOperation", arg0);
+    }
+
+    /**
+     * invalid operation: {0}
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.outputHeader.missingNamespace", arg0, arg1);
+    }
+
+    /**
+     * output header "{1}" of binding operation "{0}" must specify a value for the "namespace" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_HEADER_MISSING_NAMESPACE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_PART_FROM_BODY(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.partFromBody", arg0);
+    }
+
+    /**
+     * header part: "{0}" already bound by soapbind:body, illegal to bind the part twice
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_PART_FROM_BODY(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_PART_FROM_BODY(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.notSupportedStyle", arg0, arg1);
+    }
+
+    /**
+     * Invalid WSDL, wsdl:operation "{0}" in wsdl:portType "{1}": not request-response or one-way
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_NC_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.notNCName", arg0, arg1);
+    }
+
+    /**
+     * Ignoring operation "{0}", it has illegal character ''{1}'' in its name. Its rpc-literal operation - jaxws won't be able to serialize it!
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_NC_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_NC_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_PARAMETER_DIFFERENT_TYPES(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.parameter.differentTypes", arg0, arg1);
+    }
+
+    /**
+     * parameter "{0}" of operation "{1}" appears with different types in the input and output messages
+     *
+     */
+    public static String WSDLMODELER_INVALID_PARAMETER_DIFFERENT_TYPES(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_DIFFERENT_TYPES(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_FAULT_DOCUMENT_OPERATION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringFault.documentOperation", arg0, arg1);
+    }
+
+    /**
+     * ignoring fault "{0}" of document-style operation "{1}"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_FAULT_DOCUMENT_OPERATION(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_DOCUMENT_OPERATION(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_USE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.nonconforming.wsdl.use", arg0);
+    }
+
+    /**
+     * Processing WS-I non conforming operation "{0}" with RPC-Style and SOAP-encoded
+     *
+     */
+    public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_USE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_USE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NON_SOAP_PORT(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.nonSOAPPort", arg0);
+    }
+
+    /**
+     * port "{0}": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
+     *
+     */
+    public static String WSDLMODELER_WARNING_NON_SOAP_PORT(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NON_SOAP_PORT(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_HEADERFAULT_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.headerfault.message.partMustHaveElementDescriptor", arg0, arg1, arg2);
+    }
+
+    /**
+     * Invalid headerfault "{0}" for header {1} in operation {2}: part must specify a "element" attribute
+     *
+     */
+    public static String WSDLMODELER_INVALID_HEADERFAULT_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_HEADERFAULT_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_STATE_MODELING_OPERATION(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalidState.modelingOperation", arg0);
+    }
+
+    /**
+     * invalid state while modeling operation: {0}
+     *
+     */
+    public static String WSDLMODELER_INVALID_STATE_MODELING_OPERATION(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_STATE_MODELING_OPERATION(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.operationName", arg0);
+    }
+
+    /**
+     * Ignoring operation "{0}", it''s java reserved word, can''t generate java method. Use customization to change the operation name.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_ENCODED(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.notEncoded", arg0, arg1);
+    }
+
+    /**
+     * ignoring header "{0}" of binding operation "{1}": not SOAP-encoded
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_ENCODED(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_ENCODED(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_DUPLICATE_FAULT_PART_NAME(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.duplicate.fault.part.name", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring fault "{0}" of operation "{1}", part name "{2}" is not unique
+     *
+     */
+    public static String WSDLMODELER_DUPLICATE_FAULT_PART_NAME(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_DUPLICATE_FAULT_PART_NAME(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.operation.MoreThanOnePartInMessage", arg0);
+    }
+
+    /**
+     * operation "{0}": more than one part bound to body
+     *
+     */
+    public static String WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringSOAPBinding12", arg0);
+    }
+
+    /**
+     * Ignoring SOAP port "{0}": it uses non-standard SOAP 1.2 binding.
+     * You must specify the "-extension" option to use this binding.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingFault.notUnique", arg0, arg1);
+    }
+
+    /**
+     * fault "{0}" in operation "{1}" matches more than one fault in the corresponding port type operation
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.invalid.bindingOperation.outputMissingSoapBody", arg0);
+    }
+
+    /**
+     * output message of binding operation "{0}" does not have a SOAP body extension
+     *
+     */
+    public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_LITERAL(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeaderFault.notLiteral", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring header fault part="{0}" message="{1}" of operation {2}, use attribute MUST be "literal"
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_LITERAL(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_LITERAL(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_OUTPUT_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.cannotHandleMoreThanOnePartInOutputMessage", arg0);
+    }
+
+    /**
+     * ignoring operation "{0}": more than one part in output message
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_OUTPUT_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_OUTPUT_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.warning.noOperationsInPort", arg0);
+    }
+
+    /**
+     * Port "{0}" does not contain any usable operations
+     *
+     */
+    public static String WSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(arg0));
+    }
+
+    public static Localizable localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.wrapperStyle", arg0, arg1, arg2);
+    }
+
+    /**
+     * Ignoring operation "{0}", can''t generate java method parameter. Local name of the wrapper child "{1}" in the global element "{2}" is a java keyword. Use customization to change the parameter name.
+     *
+     */
+    public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(Object arg0) {
+        return messageFactory.getMessage("wsdlmodeler.unsolvableNamingConflicts", arg0);
+    }
+
+    /**
+     * the following naming conflicts occurred: {0}
+     *
+     */
+    public static String WSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(Object arg0) {
+        return localizer.localize(localizableWSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java
new file mode 100644
index 0000000..c0d6bb1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ProcessorMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.processor");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizablePROCESSOR_MISSING_MODEL() {
+        return messageFactory.getMessage("processor.missing.model");
+    }
+
+    /**
+     * model is missing
+     *
+     */
+    public static String PROCESSOR_MISSING_MODEL() {
+        return localizer.localize(localizablePROCESSOR_MISSING_MODEL());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/UtilMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/UtilMessages.java
new file mode 100644
index 0000000..2be9eef
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/UtilMessages.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class UtilMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.util");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableSAX_2_DOM_NOTSUPPORTED_CREATEELEMENT(Object arg0) {
+        return messageFactory.getMessage("sax2dom.notsupported.createelement", arg0);
+    }
+
+    /**
+     * SAX2DOMEx.DomImplDoesntSupportCreateElementNs: {0}
+     *
+     */
+    public static String SAX_2_DOM_NOTSUPPORTED_CREATEELEMENT(Object arg0) {
+        return localizer.localize(localizableSAX_2_DOM_NOTSUPPORTED_CREATEELEMENT(arg0));
+    }
+
+    public static Localizable localizableNULL_NAMESPACE_FOUND(Object arg0) {
+        return messageFactory.getMessage("null.namespace.found", arg0);
+    }
+
+    /**
+     * Encountered error in wsdl. Check namespace of element <{0}>
+     *
+     */
+    public static String NULL_NAMESPACE_FOUND(Object arg0) {
+        return localizer.localize(localizableNULL_NAMESPACE_FOUND(arg0));
+    }
+
+    public static Localizable localizableHOLDER_VALUEFIELD_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("holder.valuefield.not.found", arg0);
+    }
+
+    /**
+     * Could not find the field in the Holder that contains the Holder''s value: {0}
+     *
+     */
+    public static String HOLDER_VALUEFIELD_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableHOLDER_VALUEFIELD_NOT_FOUND(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java
new file mode 100644
index 0000000..05b617f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java
@@ -0,0 +1,893 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class WebserviceapMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.webserviceap");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
+        return messageFactory.getMessage("webserviceap.rpc.literal.must.not.be.bare", arg0);
+    }
+
+    /**
+     * RPC literal SOAPBindings must have parameterStyle WRAPPPED. Class: {0}.
+     *
+     */
+    public static String WEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element.exclude", arg0, arg1, arg2);
+    }
+
+    /**
+     * The @javax.jws.WebMethod({0}) cannot be used on a service endpoint interface. Class: {1} method: {2}
+     *
+     */
+    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.class.is.innerclass.not.static", arg0);
+    }
+
+    /**
+     * Inner classes annotated with @javax.jws.WebService must be static. Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.webservice.method.is.abstract", arg0, arg1);
+    }
+
+    /**
+     * Classes annotated with @javax.jws.WebService must not have abstract methods. Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.return.type", arg0, arg1);
+    }
+
+    /**
+     * The method {1} of class {0} is annotated @Oneway but has a return type.
+     *
+     */
+    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WARNING(Object arg0) {
+        return messageFactory.getMessage("webserviceap.warning", arg0);
+    }
+
+    /**
+     * warning: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WARNING(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WARNING(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.rpc.soapbinding.not.allowed.on.method", arg0, arg1);
+    }
+
+    /**
+     * SOAPBinding.Style.RPC binding annotations are not allowed on methods.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.could.not.find.handlerchain", arg0, arg1);
+    }
+
+    /**
+     * Could not find the handlerchain {0} in the handler file {1}
+     *
+     */
+    public static String WEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
+        return messageFactory.getMessage("webserviceap.no.package.class.must.have.targetnamespace", arg0);
+    }
+
+    /**
+     * @javax.jws.Webservice annotated classes that do not belong to a package must have the @javax.jws.Webservice.targetNamespace element.  Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("webserviceap.class.not.found", arg0);
+    }
+
+    /**
+     * Class Not Found: {0}
+     *
+     */
+    public static String WEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.doc.bare.no.return.and.no.out", arg0, arg1);
+    }
+
+    /**
+     * Document literal bare methods that do not have a return value must have a single OUT/INOUT parameter.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return messageFactory.getMessage("webserviceap.document.literal.bare.method.return.not.unique", arg0, arg1, arg2, arg3);
+    }
+
+    /**
+     * Document literal bare methods must have a unique result name return type combination.  Class {0} method: {1}, result name: {2} return type: {3}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(arg0, arg1, arg2, arg3));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.doc.bare.no.out", arg0, arg1);
+    }
+
+    /**
+     * Document/literal bare methods with no return type or OUT/INOUT parameters must be annotated as @Oneway. Class: {0}, method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.rpc.literal.parameters.must.have.webparam", arg0, arg1, arg2);
+    }
+
+    /**
+     * All rpc literal parameters must have a WebParam annotation.  Class: {0} method: {1} parameter {2}
+     *
+     */
+    public static String WEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS() {
+        return messageFactory.getMessage("webserviceap.model.already.exists");
+    }
+
+    /**
+     * model already exists
+     *
+     */
+    public static String WEBSERVICEAP_MODEL_ALREADY_EXISTS() {
+        return localizer.localize(localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS());
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.endpointinterface.on.interface", arg0, arg1);
+    }
+
+    /**
+     * Service endpointpoint interface: {0} has cannot have a WebService.endpointInterface annotation: {1}
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.method.not.annotated", arg0, arg1);
+    }
+
+    /**
+     * The method {0} on class {1} is not annotated.
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.non.in.parameters.must.be.holder", arg0, arg1, arg2);
+    }
+
+    /**
+     * Class: {0}, method: {1}, parameter: {2} is not WebParam.Mode.IN and is not of type javax.xml.ws.Holder.
+     *
+     */
+    public static String WEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.failed.to.find.handlerchain.file", arg0, arg1);
+    }
+
+    /**
+     * Cannot find HandlerChain file. class: {0}, file: {1}
+     *
+     */
+    public static String WEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.operation.name.not.unique", arg0, arg1, arg2);
+    }
+
+    /**
+     * Operation names must be unique.  Class: {0} method: {1} operation name: {2}
+     *
+     */
+    public static String WEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.method.not.implemented", arg0, arg1, arg2);
+    }
+
+    /**
+     * Methods in an endpointInterface must be implemented in the implementation class.  Interface Class:{0} Implementation Class:{1} Method: {2}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.header.parameters.must.have.webparam.name", arg0, arg1, arg2);
+    }
+
+    /**
+     * All WebParam annotations on header parameters must specify a name.  Class: {0} method {1} paramter {2}
+     *
+     */
+    public static String WEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
+        return messageFactory.getMessage("webserviceap.invalid.handlerchain.file.nohandler-config", arg0);
+    }
+
+    /**
+     * The handlerchain file {0} is invalid, it does not contain a handler-config element
+     *
+     */
+    public static String WEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.declare.exceptions", arg0, arg1, arg2);
+    }
+
+    /**
+     * The method {1} of class {0} is annotated @Oneway but declares the exception {2}
+     *
+     */
+    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.holders", arg0, arg1);
+    }
+
+    /**
+     * The method {1} of class {0} is annotated @Oneway but contains inout or out paramerters (javax.xml.ws.Holder)
+     *
+     */
+    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.oneway.and.not.one.in", arg0, arg1);
+    }
+
+    /**
+     * Document literal bare methods annotated with @javax.jws.Oneway must have one non-header IN parameter.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
+        return messageFactory.getMessage("webserviceap.rpc.encoded.not.supported", arg0);
+    }
+
+    /**
+     * The {0} class has a rpc/encoded SOAPBinding.  Rpc/encoded SOAPBindings are not supported in JAXWS 2.0.
+     *
+     */
+    public static String WEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("webserviceap.java.typeNotFound", arg0);
+    }
+
+    /**
+     * The type: {0} was not found in the mapping
+     *
+     */
+    public static String WEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.invalid.sei.annotation", arg0, arg1);
+    }
+
+    /**
+     * The @{0} annotation cannot be used on a service endpoint interface. Class: {1}
+     *
+     */
+    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
+        return messageFactory.getMessage("webserviceap.no.webservice.endpoint.found");
+    }
+
+    /**
+     * A web service endpoint could not be found
+     *
+     */
+    public static String WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
+        return localizer.localize(localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.invalid.webmethod.element.with.exclude", arg0, arg1, arg2);
+    }
+
+    /**
+     * The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class: {1} method: {2}
+     *
+     */
+    public static String WEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.could.not.find.typedecl", arg0, arg1);
+    }
+
+    /**
+     * Could not get TypeDeclaration for: {0} in apt round: {1}
+     *
+     */
+    public static String WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.document.literal.bare.cannot.have.more.than.one.out", arg0, arg1);
+    }
+
+    /**
+     * Document literal bare methods must have a return value or one out parameter.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webservice.encoded.not.supported", arg0, arg1);
+    }
+
+    /**
+     * The {0} class has invalid SOAPBinding annotation. {1}/encoded SOAPBinding is not supported
+     *
+     */
+    public static String WEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.class.is.final", arg0);
+    }
+
+    /**
+     * Classes annotated with @javax.jws.WebService must not be final. Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.no.default.constructor", arg0);
+    }
+
+    /**
+     * Classes annotated with @javax.jws.WebService must have a public default constructor. Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.sei.cannot.contain.constant.values", arg0, arg1);
+    }
+
+    /**
+     * An service endpoint interface cannot contain constant declaration: Interface: {0} field: {1}.
+     *
+     */
+    public static String WEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("webserviceap.endpointinterface.class.not.found", arg0);
+    }
+
+    /**
+     * The endpointInterface class {0} could not be found
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.only.one.in.parameter", arg0, arg1, arg2);
+    }
+
+    /**
+     * Document literal bare methods must have no more than 1 non-header in parameter. Class: {0} method: {1} number of non-header parameters: {2}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INFO(Object arg0) {
+        return messageFactory.getMessage("webserviceap.info", arg0);
+    }
+
+    /**
+     * info: {0}
+     *
+     */
+    public static String WEBSERVICEAP_INFO(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_INFO(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
+        return messageFactory.getMessage("webserviceap.handlerclass.notspecified", arg0);
+    }
+
+    /**
+     * A handler in the HandlerChain file: {0} does not specify a handler-class
+     *
+     */
+    public static String WEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element", arg0, arg1);
+    }
+
+    /**
+     * The @javax.jws.WebService.{0} element cannot be specified on a service endpoint interface. Class: {1}
+     *
+     */
+    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.document.literal.bare.method.not.unique", arg0, arg1, arg2);
+    }
+
+    /**
+     * Document literal bare methods must have unique parameter names.  Class: {0} method: {1} parameter name: {2}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.method.exception.bean.name.not.unique", arg0, arg1);
+    }
+
+    /**
+     * Exception bean names must be unique and must not clash with other generated classes.  Class: {0} exception {1}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.holder.parameters.must.not.be.in.only", arg0, arg1, arg2);
+    }
+
+    /**
+     * javax.xml.ws.Holder parameters must not be annotated with the WebParam.Mode.IN property.  Class: {0} method: {1} parameter: {2}
+     *
+     */
+    public static String WEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.doc.bare.and.no.one.in", arg0, arg1);
+    }
+
+    /**
+     * Document literal bare methods must have one non-header, IN/INOUT parameter.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.rpc.literal.webparams.must.specify.name", arg0, arg1, arg2);
+    }
+
+    /**
+     * All rpc literal WebParams must specify a name.  Class: {0} method {1} paramter {2}
+     *
+     */
+    public static String WEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return messageFactory.getMessage("webserviceap.endpointinterface.has.no.webservice.annotation", arg0);
+    }
+
+    /**
+     * The endpoint interface {0} must have a WebService annotation
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
+        return messageFactory.getMessage("webserviceap.cannot.combine.handlerchain.soapmessagehandlers");
+    }
+
+    /**
+     * You cannot specify both HanlderChain and SOAPMessageHandlers annotations
+     *
+     */
+    public static String WEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
+        return localizer.localize(localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS());
+    }
+
+    public static Localizable localizableWEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
+        return messageFactory.getMessage("webserviceap.nestedModelError", arg0);
+    }
+
+    /**
+     * modeler error: {0}
+     *
+     */
+    public static String WEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_NESTED_MODEL_ERROR(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.method.request.wrapper.bean.name.not.unique", arg0, arg1);
+    }
+
+    /**
+     * Request wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.class.not.public", arg0);
+    }
+
+    /**
+     * Classes annotated with @javax.jws.WebService must be public. Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
+        return messageFactory.getMessage("webserviceap.mixed.binding.style", arg0);
+    }
+
+    /**
+     * Class: {0} contains mixed bindings.  SOAPBinding.Style.RPC and SOAPBinding.Style.DOCUMENT cannot be mixed.
+     *
+     */
+    public static String WEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_MIXED_BINDING_STYLE(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("webserviceap.fileNotFound", arg0);
+    }
+
+    /**
+     * error: file not found: {0}
+     *
+     */
+    public static String WEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_FILE_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.oneway.and.out", arg0, arg1);
+    }
+
+    /**
+     * @Oneway methods cannot have out parameters. Class: {0} method {1}
+     *
+     */
+    public static String WEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.method.response.wrapper.bean.name.not.unique", arg0, arg1);
+    }
+
+    /**
+     * Response wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_COMPILATION_FAILED() {
+        return messageFactory.getMessage("webserviceap.compilationFailed");
+    }
+
+    /**
+     * compilation failed, errors should have been reported
+     *
+     */
+    public static String WEBSERVICEAP_COMPILATION_FAILED() {
+        return localizer.localize(localizableWEBSERVICEAP_COMPILATION_FAILED());
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.one.in.or.out", arg0, arg1);
+    }
+
+    /**
+     * Document literal bare methods must have at least one of: a return, an in parameter or an out parameter.  Class: {0} Method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
+        return messageFactory.getMessage("webserviceap.endpointinteface.plus.element", arg0);
+    }
+
+    /**
+     * The @javax.jws.WebService.{0} element cannot be used in with @javax.jws.WebService.endpointInterface element.
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.doc.bare.return.and.out", arg0, arg1);
+    }
+
+    /**
+     * Document/literal bare methods cannot have a return type and out parameters. Class: {0}, method: {1}
+     *
+     */
+    public static String WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_SUCCEEDED() {
+        return messageFactory.getMessage("webserviceap.succeeded");
+    }
+
+    /**
+     * Success
+     *
+     */
+    public static String WEBSERVICEAP_SUCCEEDED() {
+        return localizer.localize(localizableWEBSERVICEAP_SUCCEEDED());
+    }
+
+    public static Localizable localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.document.bare.holder.parameters.must.not.be.inout", arg0, arg1, arg2);
+    }
+
+    /**
+     * javax.xml.ws.Holder parameters in document bare operations must be WebParam.Mode.INOUT;  Class: {0} method: {1} parameter: {2}
+     *
+     */
+    public static String WEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.and.webserviceprovider", arg0);
+    }
+
+    /**
+     * Classes cannot be annotated with both @javax.jws.WebService and @javax.xml.ws.WebServiceProvider.  Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.endpointinterfaces.do.not.match", arg0, arg1);
+    }
+
+    /**
+     * The endpoint interface {0} does not match the interface {1}.
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
+        return messageFactory.getMessage("webserviceap.endpointinteface.plus.annotation", arg0);
+    }
+
+    /**
+     * The @{0} annotation cannot be used in with @javax.jws.WebService.endpointInterface element.
+     *
+     */
+    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("webserviceap.failed.to.parse.handlerchain.file", arg0, arg1);
+    }
+
+    /**
+     * Failed to parse HandlerChain file. Class: {0}, file: {1}
+     *
+     */
+    public static String WEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(arg0, arg1));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return messageFactory.getMessage("webserviceap.method.parameter.types.cannot.implement.remote", arg0, arg1, arg2, arg3);
+    }
+
+    /**
+     * Method parameter types cannot implement java.rmi.Remote.  Class: {0} method: {1} parameter: {2} type: {3}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2, arg3));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("webserviceap.method.return.type.cannot.implement.remote", arg0, arg1, arg2);
+    }
+
+    /**
+     * Method return types cannot implement java.rmi.Remote.  Class: {0} method: {1} return type: {2}
+     *
+     */
+    public static String WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_ERROR(Object arg0) {
+        return messageFactory.getMessage("webserviceap.error", arg0);
+    }
+
+    /**
+     * error: {0}
+     *
+     */
+    public static String WEBSERVICEAP_ERROR(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_ERROR(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
+        return messageFactory.getMessage("webserviceap.webservice.class.is.abstract", arg0);
+    }
+
+    /**
+     * Classes annotated with @javax.jws.WebService must not be abstract. Class: {0}
+     *
+     */
+    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
+        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(arg0));
+    }
+
+    public static Localizable localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
+        return messageFactory.getMessage("webserviceap.init_param.format.error");
+    }
+
+    /**
+     * a <init-param> element must have exactly 1 <param-name> and 1 <param-value>
+     *
+     */
+    public static String WEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
+        return localizer.localize(localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java
new file mode 100644
index 0000000..e1fe691
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java
@@ -0,0 +1,648 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class WscompileMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.wscompile");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableWSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(Object arg0) {
+        return messageFactory.getMessage("wsgen.class.must.be.implementation.class", arg0);
+    }
+
+    /**
+     * The class "{0}" is not an endpoint implementation class.
+     *
+     */
+    public static String WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(Object arg0) {
+        return localizer.localize(localizableWSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(arg0));
+    }
+
+    public static Localizable localizableWSGEN_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("wsgen.class.not.found", arg0);
+    }
+
+    /**
+     * Class not found: "{0}"
+     *
+     */
+    public static String WSGEN_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWSGEN_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWSGEN_USAGE_EXAMPLES() {
+        return messageFactory.getMessage("wsgen.usage.examples");
+    }
+
+    /**
+     *
+     * Examples:
+     *   wsgen -cp . example.Stock
+     *   wsgen -cp . example.Stock -wsdl -servicename '{http://mynamespace}MyService'
+     *
+     *
+     */
+    public static String WSGEN_USAGE_EXAMPLES() {
+        return localizer.localize(localizableWSGEN_USAGE_EXAMPLES());
+    }
+
+    public static Localizable localizableWRAPPER_TASK_LOADING_20_API(Object arg0) {
+        return messageFactory.getMessage("wrapperTask.loading20Api", arg0);
+    }
+
+    /**
+     * You are loading JAX-WS 2.0 API from {0} but this tool requires JAX-WS 2.1 API.
+     *
+     */
+    public static String WRAPPER_TASK_LOADING_20_API(Object arg0) {
+        return localizer.localize(localizableWRAPPER_TASK_LOADING_20_API(arg0));
+    }
+
+    public static Localizable localizableWSGEN_INVALID_PROTOCOL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsgen.invalid.protocol", arg0, arg1);
+    }
+
+    /**
+     * "{0}" is not a supported protocol.  Supported protocols include: {1}.
+     *
+     */
+    public static String WSGEN_INVALID_PROTOCOL(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSGEN_INVALID_PROTOCOL(arg0, arg1));
+    }
+
+    public static Localizable localizableWSIMPORT_USAGE_EXAMPLES() {
+        return messageFactory.getMessage("wsimport.usage.examples");
+    }
+
+    /**
+     *
+     * Examples:
+     *   wsimport stock.wsdl -b stock.xml -b stock.xjb
+     *   wsimport -d generated http://example.org/stock?wsdl
+     *
+     *
+     */
+    public static String WSIMPORT_USAGE_EXAMPLES() {
+        return localizer.localize(localizableWSIMPORT_USAGE_EXAMPLES());
+    }
+
+    public static Localizable localizableINVOKER_NEED_ENDORSED() {
+        return messageFactory.getMessage("invoker.needEndorsed");
+    }
+
+    /**
+     * You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or use -Xendorsed option.
+     *
+     */
+    public static String INVOKER_NEED_ENDORSED() {
+        return localizer.localize(localizableINVOKER_NEED_ENDORSED());
+    }
+
+    public static Localizable localizableWSIMPORT_MISSING_FILE() {
+        return messageFactory.getMessage("wsimport.missingFile");
+    }
+
+    /**
+     * Missing WSDL_URI
+     *
+     */
+    public static String WSIMPORT_MISSING_FILE() {
+        return localizer.localize(localizableWSIMPORT_MISSING_FILE());
+    }
+
+    public static Localizable localizableWSIMPORT_USAGE(Object arg0) {
+        return messageFactory.getMessage("wsimport.usage", arg0);
+    }
+
+    /**
+     * Usage: {0} [options] <WSDL_URI>
+     *
+     * Use "wsimport -help" for a detailed description of options.
+     *
+     */
+    public static String WSIMPORT_USAGE(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_USAGE(arg0));
+    }
+
+    public static Localizable localizablePLEASE() {
+        return messageFactory.getMessage("Please");
+    }
+
+    /**
+     * specify "-extension" and "-wsdl:protocol XSoap1.2" switches. For example:
+     *
+     *
+     *
+     */
+    public static String PLEASE() {
+        return localizer.localize(localizablePLEASE());
+    }
+
+    public static Localizable localizableWSIMPORT_PARSING_WSDL() {
+        return messageFactory.getMessage("wsimport.ParsingWSDL");
+    }
+
+    /**
+     * parsing WSDL...
+     *
+     *
+     *
+     */
+    public static String WSIMPORT_PARSING_WSDL() {
+        return localizer.localize(localizableWSIMPORT_PARSING_WSDL());
+    }
+
+    public static Localizable localizableWSGEN_MISSING_FILE() {
+        return messageFactory.getMessage("wsgen.missingFile");
+    }
+
+    /**
+     * Missing SEI
+     *
+     */
+    public static String WSGEN_MISSING_FILE() {
+        return localizer.localize(localizableWSGEN_MISSING_FILE());
+    }
+
+    public static Localizable localizableWSIMPORT_HELP(Object arg0) {
+        return messageFactory.getMessage("wsimport.help", arg0);
+    }
+
+    /**
+     *
+     * Usage: {0} [options] <WSDL_URI>
+     *
+     * where [options] include:
+     *   -b <path>                 specify jaxws/jaxb binding files or additional schemas
+     *                             (Each <path> must have its own -b)
+     *   -B<jaxbOption>            Pass this option to JAXB schema compiler
+     *   -catalog <file>           specify catalog file to resolve external entity references
+     *                             supports TR9401, XCatalog, and OASIS XML Catalog format.
+     *   -d <directory>            specify where to place generated output files
+     *   -extension                allow vendor extensions - functionality not specified
+     *                             by the specification.  Use of extensions may
+     *                             result in applications that are not portable or
+     *                             may not interoperate with other implementations
+     *   -help                     display help
+     *   -httpproxy:<host>:<port>  specify a HTTP proxy server (port defaults to 8080)
+     *   -keep                     keep generated files
+     *   -p <pkg>                  specifies the target package
+     *   -quiet                    suppress wsimport output
+     *   -s <directory>            specify where to place generated source files
+     *   -target <version>         generate code as per the given JAXWS specification version.
+     *                             version 2.0 will generate compliant code for JAXWS 2.0 spec.
+     *   -verbose                  output messages about what the compiler is doing
+     *   -version                  print version information
+     *   -wsdllocation <location>  @WebServiceClient.wsdlLocation value
+     *
+     *
+     */
+    public static String WSIMPORT_HELP(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_HELP(arg0));
+    }
+
+    public static Localizable localizableWSCOMPILE_ERROR(Object arg0) {
+        return messageFactory.getMessage("wscompile.error", arg0);
+    }
+
+    /**
+     * error: {0}
+     *
+     */
+    public static String WSCOMPILE_ERROR(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_ERROR(arg0));
+    }
+
+    public static Localizable localizableWSGEN_NO_WEBSERVICES_CLASS(Object arg0) {
+        return messageFactory.getMessage("wsgen.no.webservices.class", arg0);
+    }
+
+    /**
+     * wsgen did not find any class with @WebService annotation. Please specify @WebService annotation on {0}.
+     *
+     */
+    public static String WSGEN_NO_WEBSERVICES_CLASS(Object arg0) {
+        return localizer.localize(localizableWSGEN_NO_WEBSERVICES_CLASS(arg0));
+    }
+
+    public static Localizable localizableWSCOMPILE_NO_SUCH_DIRECTORY(Object arg0) {
+        return messageFactory.getMessage("wscompile.noSuchDirectory", arg0);
+    }
+
+    /**
+     * directory not found: {0}
+     *
+     */
+    public static String WSCOMPILE_NO_SUCH_DIRECTORY(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_NO_SUCH_DIRECTORY(arg0));
+    }
+
+    public static Localizable localizableWSCOMPILE_INFO(Object arg0) {
+        return messageFactory.getMessage("wscompile.info", arg0);
+    }
+
+    /**
+     * info: {0}
+     *
+     */
+    public static String WSCOMPILE_INFO(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_INFO(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_WARNING_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsimport.WarningMessage", arg0);
+    }
+
+    /**
+     * [WARNING] {0}
+     *
+     */
+    public static String WSIMPORT_WARNING_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_WARNING_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSCOMPILE_INVALID_OPTION(Object arg0) {
+        return messageFactory.getMessage("wscompile.invalidOption", arg0);
+    }
+
+    /**
+     * unrecognized parameter {0}
+     *
+     */
+    public static String WSCOMPILE_INVALID_OPTION(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_INVALID_OPTION(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_ERROR_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsimport.ErrorMessage", arg0);
+    }
+
+    /**
+     * [ERROR] {0}
+     *
+     */
+    public static String WSIMPORT_ERROR_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_ERROR_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_GENERATING_CODE() {
+        return messageFactory.getMessage("wsimport.GeneratingCode");
+    }
+
+    /**
+     * generating code...
+     *
+     */
+    public static String WSIMPORT_GENERATING_CODE() {
+        return localizer.localize(localizableWSIMPORT_GENERATING_CODE());
+    }
+
+    public static Localizable localizableWSGEN() {
+        return messageFactory.getMessage("wsgen");
+    }
+
+    /**
+     * -wsdl:protocol XSoap1.2 -extenson {1}
+     *
+     */
+    public static String WSGEN() {
+        return localizer.localize(localizableWSGEN());
+    }
+
+    public static Localizable localizableWSIMPORT_NOT_A_FILE_NOR_URL(Object arg0) {
+        return messageFactory.getMessage("wsimport.NotAFileNorURL", arg0);
+    }
+
+    /**
+     * "{0}" is neither a file name nor an URL
+     *
+     */
+    public static String WSIMPORT_NOT_A_FILE_NOR_URL(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_NOT_A_FILE_NOR_URL(arg0));
+    }
+
+    public static Localizable localizableWSCOMPILE_WARNING(Object arg0) {
+        return messageFactory.getMessage("wscompile.warning", arg0);
+    }
+
+    /**
+     * warning: {0}
+     *
+     */
+    public static String WSCOMPILE_WARNING(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_WARNING(arg0));
+    }
+
+    public static Localizable localizableWRAPPER_TASK_NEED_ENDORSED(Object arg0) {
+        return messageFactory.getMessage("wrapperTask.needEndorsed", arg0);
+    }
+
+    /**
+     * You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on <{0}>.
+     *
+     */
+    public static String WRAPPER_TASK_NEED_ENDORSED(Object arg0) {
+        return localizer.localize(localizableWRAPPER_TASK_NEED_ENDORSED(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_NO_SUCH_JAXB_OPTION(Object arg0) {
+        return messageFactory.getMessage("wsimport.noSuchJaxbOption", arg0);
+    }
+
+    /**
+     * no such JAXB option: {0}
+     *
+     */
+    public static String WSIMPORT_NO_SUCH_JAXB_OPTION(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_NO_SUCH_JAXB_OPTION(arg0));
+    }
+
+    public static Localizable localizableWSGEN_COULD_NOT_CREATE_FILE(Object arg0) {
+        return messageFactory.getMessage("wsgen.could.not.create.file", arg0);
+    }
+
+    /**
+     * "Could not create file: "{0}"
+     *
+     */
+    public static String WSGEN_COULD_NOT_CREATE_FILE(Object arg0) {
+        return localizer.localize(localizableWSGEN_COULD_NOT_CREATE_FILE(arg0));
+    }
+
+    public static Localizable localizableWSGEN_WSDL_ARG_NO_GENWSDL(Object arg0) {
+        return messageFactory.getMessage("wsgen.wsdl.arg.no.genwsdl", arg0);
+    }
+
+    /**
+     * The "{0}" option can only be in conjunction with the "-wsdl" option.
+     *
+     */
+    public static String WSGEN_WSDL_ARG_NO_GENWSDL(Object arg0) {
+        return localizer.localize(localizableWSGEN_WSDL_ARG_NO_GENWSDL(arg0));
+    }
+
+    public static Localizable localizableWSGEN_HELP(Object arg0) {
+        return messageFactory.getMessage("wsgen.help", arg0);
+    }
+
+    /**
+     *
+     * Usage: {0} [options] <SEI>
+     *
+     * where [options] include:
+     *   -classpath <path>          specify where to find input class files
+     *   -cp <path>                 same as -classpath <path>
+     *   -d <directory>             specify where to place generated output files
+     *   -extension                 allow vendor extensions - functionality not specified
+     *                              by the specification.  Use of extensions may
+     *                              result in applications that are not portable or
+     *                              may not interoperate with other implementations
+     *   -help                      display help
+     *   -keep                      keep generated files
+     *   -r <directory>             resource destination directory, specify where to
+     *                              place resouce files such as WSDLs
+     *   -s <directory>             specify where to place generated source files
+     *   -verbose                   output messages about what the compiler is doing
+     *   -version                   print version information
+     *   -wsdl[:protocol]           generate a WSDL file.  The protocol is optional.
+     *                              Valid protocols are soap1.1 and Xsoap1.2, the default
+     *                              is soap1.1.  Xsoap1.2 is not standard and can only be
+     *                              used in conjunction with the -extension option
+     *   -servicename <name>        specify the Service name to use in the generated WSDL
+     *                              Used in conjunction with the -wsdl option.
+     *   -portname <name>           specify the Port name to use in the generated WSDL
+     *                              Used in conjunction with the -wsdl option.
+     *
+     */
+    public static String WSGEN_HELP(Object arg0) {
+        return localizer.localize(localizableWSGEN_HELP(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_INFO_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("wsimport.InfoMessage", arg0);
+    }
+
+    /**
+     * [INFO] {0}
+     *
+     */
+    public static String WSIMPORT_INFO_MESSAGE(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_INFO_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableWSGEN_SOAP_12_WITHOUT_EXTENSION() {
+        return messageFactory.getMessage("wsgen.soap12.without.extension");
+    }
+
+    /**
+     * The optional protocol "Xsoap1.2" must be used in conjunction with the "-extension" option.
+     *
+     */
+    public static String WSGEN_SOAP_12_WITHOUT_EXTENSION() {
+        return localizer.localize(localizableWSGEN_SOAP_12_WITHOUT_EXTENSION());
+    }
+
+    public static Localizable localizableWSCOMPILE_COMPILATION_FAILED() {
+        return messageFactory.getMessage("wscompile.compilationFailed");
+    }
+
+    /**
+     * compilation failed, errors should have been reported
+     *
+     */
+    public static String WSCOMPILE_COMPILATION_FAILED() {
+        return localizer.localize(localizableWSCOMPILE_COMPILATION_FAILED());
+    }
+
+    public static Localizable localizableWSCOMPILE_MISSING_OPTION_ARGUMENT(Object arg0) {
+        return messageFactory.getMessage("wscompile.missingOptionArgument", arg0);
+    }
+
+    /**
+     * option "{0}" requires an argument
+     *
+     */
+    public static String WSCOMPILE_MISSING_OPTION_ARGUMENT(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_MISSING_OPTION_ARGUMENT(arg0));
+    }
+
+    public static Localizable localizableWSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsgen.cannot.gen.wsdl.for.non.soap.binding", arg0, arg1);
+    }
+
+    /**
+     * wsgen can not generate WSDL for non-SOAP binding: {0} on Class {1}
+     *
+     */
+    public static String WSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableWSCOMPILE_DUPLICATE_OPTION(Object arg0) {
+        return messageFactory.getMessage("wscompile.duplicateOption", arg0);
+    }
+
+    /**
+     * duplicate option: {0}
+     *
+     */
+    public static String WSCOMPILE_DUPLICATE_OPTION(Object arg0) {
+        return localizer.localize(localizableWSCOMPILE_DUPLICATE_OPTION(arg0));
+    }
+
+    public static Localizable localizableWSIMPORT_FAILED_TO_PARSE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsimport.FailedToParse", arg0, arg1);
+    }
+
+    /**
+     * Failed to parse "{0}": {1}
+     *
+     */
+    public static String WSIMPORT_FAILED_TO_PARSE(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSIMPORT_FAILED_TO_PARSE(arg0, arg1));
+    }
+
+    public static Localizable localizableWSIMPORT_NO_WSDL(Object arg0) {
+        return messageFactory.getMessage("wsimport.no.wsdl", arg0);
+    }
+
+    /**
+     * Failed to read the WSDL document: {0}, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
+     *
+     */
+    public static String WSIMPORT_NO_WSDL(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_NO_WSDL(arg0));
+    }
+
+    public static Localizable localizableWSGEN_USAGE(Object arg0) {
+        return messageFactory.getMessage("wsgen.usage", arg0);
+    }
+
+    /**
+     * Usage: {0} [options] <SEI>
+     *
+     * Use "wsgen -help" for a detailed description of options.
+     *
+     */
+    public static String WSGEN_USAGE(Object arg0) {
+        return localizer.localize(localizableWSGEN_USAGE(arg0));
+    }
+
+    public static Localizable localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
+        return messageFactory.getMessage("wsgen.servicename.missing.localname", arg0);
+    }
+
+    /**
+     * The service name "{0}" is missing a localname.
+     *
+     */
+    public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
+        return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0));
+    }
+
+    public static Localizable localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("wsgen.servicename.missing.namespace", arg0);
+    }
+
+    /**
+     * The service name "{0}" is missing a namespace.
+     *
+     */
+    public static String WSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) {
+        return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(arg0));
+    }
+
+    public static Localizable localizableWSGEN_INVALID_TRANSPORT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsgen.invalid.transport", arg0, arg1);
+    }
+
+    /**
+     * "{0}" is not a supported transport.  Supported transport include: {1}.
+     *
+     */
+    public static String WSGEN_INVALID_TRANSPORT(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSGEN_INVALID_TRANSPORT(arg0, arg1));
+    }
+
+    public static Localizable localizableWSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wsgen.cannot.gen.wsdl.for.soap12.binding", arg0, arg1);
+    }
+
+    /**
+     * wsgen can not generate WSDL for SOAP 1.2 binding: {0} on class: {1}.
+     *
+     *
+     */
+    public static String WSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableWSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableWSIMPORT_ILLEGAL_TARGET_VERSION(Object arg0) {
+        return messageFactory.getMessage("wsimport.ILLEGAL_TARGET_VERSION", arg0);
+    }
+
+    /**
+     * "{0}" is not a valid target version. "2.0" and "2.1" are supported.
+     *
+     */
+    public static String WSIMPORT_ILLEGAL_TARGET_VERSION(Object arg0) {
+        return localizer.localize(localizableWSIMPORT_ILLEGAL_TARGET_VERSION(arg0));
+    }
+
+    public static Localizable localizableWSGEN_PORTNAME_MISSING_LOCALNAME(Object arg0) {
+        return messageFactory.getMessage("wsgen.portname.missing.localname", arg0);
+    }
+
+    /**
+     * The port name "{0}" is missing a localname.
+     *
+     */
+    public static String WSGEN_PORTNAME_MISSING_LOCALNAME(Object arg0) {
+        return localizer.localize(localizableWSGEN_PORTNAME_MISSING_LOCALNAME(arg0));
+    }
+
+    public static Localizable localizableWSGEN_PORTNAME_MISSING_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("wsgen.portname.missing.namespace", arg0);
+    }
+
+    /**
+     * The port name "{0}" is missing a namespace.
+     *
+     */
+    public static String WSGEN_PORTNAME_MISSING_NAMESPACE(Object arg0) {
+        return localizer.localize(localizableWSGEN_PORTNAME_MISSING_NAMESPACE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WsdlMessages.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WsdlMessages.java
new file mode 100644
index 0000000..d334908
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WsdlMessages.java
@@ -0,0 +1,978 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class WsdlMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.wsdl");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizablePARSING_ELEMENT_EXPECTED() {
+        return messageFactory.getMessage("parsing.elementExpected");
+    }
+
+    /**
+     * unexpected non-element found
+     *
+     */
+    public static String PARSING_ELEMENT_EXPECTED() {
+        return localizer.localize(localizablePARSING_ELEMENT_EXPECTED());
+    }
+
+    public static Localizable localizableENTITY_NOT_FOUND_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("entity.notFound.binding", arg0, arg1);
+    }
+
+    /**
+     * wsdl:binding "{0}" referenced by wsdl:port "{1}", but its not found in the wsdl
+     *
+     */
+    public static String ENTITY_NOT_FOUND_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableENTITY_NOT_FOUND_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_PARSE_FAILED() {
+        return messageFactory.getMessage("Parsing.ParseFailed");
+    }
+
+    /**
+     * Failed to parse the WSDL.
+     *
+     */
+    public static String PARSING_PARSE_FAILED() {
+        return localizer.localize(localizablePARSING_PARSE_FAILED());
+    }
+
+    public static Localizable localizablePARSING_UNABLE_TO_GET_METADATA(Object arg0) {
+        return messageFactory.getMessage("parsing.unableToGetMetadata", arg0);
+    }
+
+    /**
+     * Unable to get Metadata from: {0}
+     *
+     */
+    public static String PARSING_UNABLE_TO_GET_METADATA(Object arg0) {
+        return localizer.localize(localizablePARSING_UNABLE_TO_GET_METADATA(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_PREFIX(Object arg0) {
+        return messageFactory.getMessage("validation.invalidPrefix", arg0);
+    }
+
+    /**
+     * undeclared namespace prefix: "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_PREFIX(Object arg0) {
+        return localizer.localize(localizableVALIDATION_INVALID_PREFIX(arg0));
+    }
+
+    public static Localizable localizablePARSING_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.invalidAttributeValue", arg0, arg1);
+    }
+
+    /**
+     * invalid value "{1}" for attribute "{0}"
+     *
+     */
+    public static String PARSING_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidAttributeValue", arg0, arg1);
+    }
+
+    /**
+     * invalid value "{1}" for attribute "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_RANGE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidRange", arg0, arg1);
+    }
+
+    /**
+     * invalid range found (min: {0}, max: {1})
+     *
+     */
+    public static String VALIDATION_INVALID_RANGE(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_RANGE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_INVALID_TAG(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.invalidTag", arg0, arg1);
+    }
+
+    /**
+     * expected element "{1}", found "{0}"
+     *
+     */
+    public static String PARSING_INVALID_TAG(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_INVALID_TAG(arg0, arg1));
+    }
+
+    public static Localizable localizableENTITY_NOT_FOUND_PORT_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("entity.notFound.portType", arg0, arg1);
+    }
+
+    /**
+     * wsdl:portType "{0}" referenced by wsdl:binding "{1}", but its not found in the wsdl
+     *
+     */
+    public static String ENTITY_NOT_FOUND_PORT_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableENTITY_NOT_FOUND_PORT_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.missingRequiredAttribute", arg0, arg1);
+    }
+
+    /**
+     * missing required attribute "{1}" of element "{0}"
+     *
+     */
+    public static String PARSING_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_MISSING_REQUIRED_ATTRIBUTE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_INVALID_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.invalidElement", arg0, arg1);
+    }
+
+    /**
+     * invalid element: "{0}" (in namespace "{1}")
+     *
+     */
+    public static String PARSING_INVALID_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_INVALID_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_ELEMENT(Object arg0) {
+        return messageFactory.getMessage("validation.invalidElement", arg0);
+    }
+
+    /**
+     * invalid element: "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_ELEMENT(Object arg0) {
+        return localizer.localize(localizableVALIDATION_INVALID_ELEMENT(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_TWO_VERSION_ATTRIBUTES() {
+        return messageFactory.getMessage("Internalizer.TwoVersionAttributes");
+    }
+
+    /**
+     * Both jaxws:version and version are present
+     *
+     */
+    public static String INTERNALIZER_TWO_VERSION_ATTRIBUTES() {
+        return localizer.localize(localizableINTERNALIZER_TWO_VERSION_ATTRIBUTES());
+    }
+
+    public static Localizable localizableVALIDATION_DUPLICATE_PART_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.duplicatePartName", arg0, arg1);
+    }
+
+    /**
+     * Invalid WSDL, duplicate parts in a wsdl:message is not allowed.
+     * wsdl:message {0} has duplicated part name: "{1}"
+     *
+     */
+    public static String VALIDATION_DUPLICATE_PART_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_DUPLICATE_PART_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_INVALID_WSDL_ELEMENT(Object arg0) {
+        return messageFactory.getMessage("parsing.invalidWsdlElement", arg0);
+    }
+
+    /**
+     * invalid WSDL element: "{0}"
+     *
+     */
+    public static String PARSING_INVALID_WSDL_ELEMENT(Object arg0) {
+        return localizer.localize(localizablePARSING_INVALID_WSDL_ELEMENT(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_COMPLEX_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidComplexTypeInElement", arg0, arg1);
+    }
+
+    /**
+     * invalid element: "{1}", has named complexType: "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_COMPLEX_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_COMPLEX_TYPE_IN_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_NON_WHITESPACE_TEXT_FOUND(Object arg0) {
+        return messageFactory.getMessage("parsing.nonWhitespaceTextFound", arg0);
+    }
+
+    /**
+     * found unexpected non whitespace text: "{0}"
+     *
+     */
+    public static String PARSING_NON_WHITESPACE_TEXT_FOUND(Object arg0) {
+        return localizer.localize(localizablePARSING_NON_WHITESPACE_TEXT_FOUND(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_TARGET_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("internalizer.targetNotFound", arg0);
+    }
+
+    /**
+     * No target found for the wsdlLocation: {0}
+     *
+     */
+    public static String INTERNALIZER_TARGET_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableINTERNALIZER_TARGET_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_NOT_SIMPLE_TYPE(Object arg0) {
+        return messageFactory.getMessage("validation.notSimpleType", arg0);
+    }
+
+    /**
+     * not a simple type: "{0}"
+     *
+     */
+    public static String VALIDATION_NOT_SIMPLE_TYPE(Object arg0) {
+        return localizer.localize(localizableVALIDATION_NOT_SIMPLE_TYPE(arg0));
+    }
+
+    public static Localizable localizablePARSING_SAX_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+        return messageFactory.getMessage("parsing.saxExceptionWithSystemId", arg0);
+    }
+
+    /**
+     * invalid WSDL file! failed to parse document at "{0}"
+     *
+     */
+    public static String PARSING_SAX_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+        return localizer.localize(localizablePARSING_SAX_EXCEPTION_WITH_SYSTEM_ID(arg0));
+    }
+
+    public static Localizable localizablePARSING_REQUIRED_EXTENSIBILITY_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.requiredExtensibilityElement", arg0, arg1);
+    }
+
+    /**
+     * unknown required extensibility element "{0}" (in namespace "{1}")
+     *
+     */
+    public static String PARSING_REQUIRED_EXTENSIBILITY_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_REQUIRED_EXTENSIBILITY_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableENTITY_NOT_FOUND_BY_ID(Object arg0) {
+        return messageFactory.getMessage("entity.notFoundByID", arg0);
+    }
+
+    /**
+     * invalid entity id: "{0}"
+     *
+     */
+    public static String ENTITY_NOT_FOUND_BY_ID(Object arg0) {
+        return localizer.localize(localizableENTITY_NOT_FOUND_BY_ID(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_EXCLUSIVE_ATTRIBUTES(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.exclusiveAttributes", arg0, arg1);
+    }
+
+    /**
+     * exclusive attributes: "{0}", "{1}"
+     *
+     */
+    public static String VALIDATION_EXCLUSIVE_ATTRIBUTES(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_EXCLUSIVE_ATTRIBUTES(arg0, arg1));
+    }
+
+    public static Localizable localizableVALIDATION_MISSING_REQUIRED_SUB_ENTITY(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.missingRequiredSubEntity", arg0, arg1);
+    }
+
+    /**
+     * missing required sub-entity "{0}" of element "{1}"
+     *
+     */
+    public static String VALIDATION_MISSING_REQUIRED_SUB_ENTITY(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_SUB_ENTITY(arg0, arg1));
+    }
+
+    public static Localizable localizableINTERNALIZER_INCORRECT_VERSION() {
+        return messageFactory.getMessage("Internalizer.IncorrectVersion");
+    }
+
+    /**
+     * JAXWS version attribute must be "2.0"
+     *
+     */
+    public static String INTERNALIZER_INCORRECT_VERSION() {
+        return localizer.localize(localizableINTERNALIZER_INCORRECT_VERSION());
+    }
+
+    public static Localizable localizableLOCALIZED_ERROR(Object arg0) {
+        return messageFactory.getMessage("localized.error", arg0);
+    }
+
+    /**
+     * {0}
+     *
+     */
+    public static String LOCALIZED_ERROR(Object arg0) {
+        return localizer.localize(localizableLOCALIZED_ERROR(arg0));
+    }
+
+    public static Localizable localizableENTITY_DUPLICATE_WITH_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("entity.duplicateWithType", arg0, arg1);
+    }
+
+    /**
+     * duplicate "{0}" entity: "{1}"
+     *
+     */
+    public static String ENTITY_DUPLICATE_WITH_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableENTITY_DUPLICATE_WITH_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+        return messageFactory.getMessage("parsing.onlyOneOfElementOrTypeRequired", arg0);
+    }
+
+    /**
+     * only one of the "element" or "type" attributes is allowed in part "{0}"
+     *
+     */
+    public static String PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+        return localizer.localize(localizablePARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(arg0));
+    }
+
+    public static Localizable localizablePARSING_INCORRECT_ROOT_ELEMENT(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return messageFactory.getMessage("parsing.incorrectRootElement", arg0, arg1, arg2, arg3);
+    }
+
+    /**
+     * expected root element "{2}" (in namespace "{3}"), found element "{0}" (in namespace "{1}")
+     *
+     */
+    public static String PARSING_INCORRECT_ROOT_ELEMENT(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return localizer.localize(localizablePARSING_INCORRECT_ROOT_ELEMENT(arg0, arg1, arg2, arg3));
+    }
+
+    public static Localizable localizableVALIDATION_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.missingRequiredAttribute", arg0, arg1);
+    }
+
+    /**
+     * missing required attribute "{0}" of element "{1}"
+     *
+     */
+    public static String VALIDATION_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_ATTRIBUTE(arg0, arg1));
+    }
+
+    public static Localizable localizableINTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("internalizer.XPathEvaulatesToTooManyTargets", arg0, arg1);
+    }
+
+    /**
+     * XPath evaluation of "{0}" results in too many ({1}) target nodes
+     *
+     */
+    public static String INTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(Object arg0, Object arg1) {
+        return localizer.localize(localizableINTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_IO_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("parsing.ioException", arg0);
+    }
+
+    /**
+     * parsing failed: {0}
+     *
+     */
+    public static String PARSING_IO_EXCEPTION(Object arg0) {
+        return localizer.localize(localizablePARSING_IO_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizablePARSER_NOT_A_BINDING_FILE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("Parser.NotABindingFile", arg0, arg1);
+    }
+
+    /**
+     * not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
+     *
+     */
+    public static String PARSER_NOT_A_BINDING_FILE(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSER_NOT_A_BINDING_FILE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_UNKNOWN_NAMESPACE_PREFIX(Object arg0) {
+        return messageFactory.getMessage("parsing.unknownNamespacePrefix", arg0);
+    }
+
+    /**
+     * undeclared namespace prefix: "{0}"
+     *
+     */
+    public static String PARSING_UNKNOWN_NAMESPACE_PREFIX(Object arg0) {
+        return localizer.localize(localizablePARSING_UNKNOWN_NAMESPACE_PREFIX(arg0));
+    }
+
+    public static Localizable localizablePARSING_FACTORY_CONFIG_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("parsing.factoryConfigException", arg0);
+    }
+
+    /**
+     * invalid WSDL file! parsing failed: {0}
+     *
+     */
+    public static String PARSING_FACTORY_CONFIG_EXCEPTION(Object arg0) {
+        return localizer.localize(localizablePARSING_FACTORY_CONFIG_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_MISSING_REQUIRED_PROPERTY(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.missingRequiredProperty", arg0, arg1);
+    }
+
+    /**
+     * missing required property "{0}" of element "{1}"
+     *
+     */
+    public static String VALIDATION_MISSING_REQUIRED_PROPERTY(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_PROPERTY(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_INVALID_OPERATION_STYLE(Object arg0) {
+        return messageFactory.getMessage("parsing.invalidOperationStyle", arg0);
+    }
+
+    /**
+     * operation "{0}" has an invalid style
+     *
+     */
+    public static String PARSING_INVALID_OPERATION_STYLE(Object arg0) {
+        return localizer.localize(localizablePARSING_INVALID_OPERATION_STYLE(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_X_PATH_EVALUATION_ERROR(Object arg0) {
+        return messageFactory.getMessage("internalizer.XPathEvaluationError", arg0);
+    }
+
+    /**
+     * XPath error: {0}
+     *
+     */
+    public static String INTERNALIZER_X_PATH_EVALUATION_ERROR(Object arg0) {
+        return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATION_ERROR(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_TOKEN(Object arg0) {
+        return messageFactory.getMessage("validation.invalidToken", arg0);
+    }
+
+    /**
+     * invalid token "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_TOKEN(Object arg0) {
+        return localizer.localize(localizableVALIDATION_INVALID_TOKEN(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_SUB_ENTITY(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidSubEntity", arg0, arg1);
+    }
+
+    /**
+     * invalid sub-element "{0}" of element "{1}"
+     *
+     */
+    public static String VALIDATION_INVALID_SUB_ENTITY(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_SUB_ENTITY(arg0, arg1));
+    }
+
+    public static Localizable localizableVALIDATION_SHOULD_NOT_HAPPEN(Object arg0) {
+        return messageFactory.getMessage("validation.shouldNotHappen", arg0);
+    }
+
+    /**
+     * internal error ("{0}")
+     *
+     */
+    public static String VALIDATION_SHOULD_NOT_HAPPEN(Object arg0) {
+        return localizer.localize(localizableVALIDATION_SHOULD_NOT_HAPPEN(arg0));
+    }
+
+    public static Localizable localizableABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("AbstractReferenceFinderImpl.UnableToParse", arg0, arg1);
+    }
+
+    /**
+     * Unable to parse "{0}" : {1}
+     *
+     */
+    public static String ABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(Object arg0, Object arg1) {
+        return localizer.localize(localizableABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(arg0, arg1));
+    }
+
+    public static Localizable localizableWARNING_FAULT_EMPTY_ACTION(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("warning.faultEmptyAction", arg0, arg1, arg2);
+    }
+
+    /**
+     * ignoring empty Action in "{0}" {1} element of "{2}" operation, using default instead
+     *
+     */
+    public static String WARNING_FAULT_EMPTY_ACTION(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWARNING_FAULT_EMPTY_ACTION(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizablePARSING_INVALID_EXTENSION_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("parsing.invalidExtensionElement", arg0, arg1);
+    }
+
+    /**
+     * invalid extension element: "{0}" (in namespace "{1}")
+     *
+     */
+    public static String PARSING_INVALID_EXTENSION_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizablePARSING_INVALID_EXTENSION_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableINTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(Object arg0) {
+        return messageFactory.getMessage("internalizer.XPathEvaluatesToNonElement", arg0);
+    }
+
+    /**
+     * XPath evaluation of "{0}" needs to result in an element.
+     *
+     */
+    public static String INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(Object arg0) {
+        return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(Object arg0) {
+        return messageFactory.getMessage("internalizer.XPathEvaluatesToNoTarget", arg0);
+    }
+
+    /**
+     * XPath evaluation of "{0}" results in empty target node
+     *
+     */
+    public static String INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(Object arg0) {
+        return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(arg0));
+    }
+
+    public static Localizable localizablePARSING_SAX_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("parsing.saxException", arg0);
+    }
+
+    /**
+     * invalid WSDL file! parsing failed: {0}
+     *
+     */
+    public static String PARSING_SAX_EXCEPTION(Object arg0) {
+        return localizer.localize(localizablePARSING_SAX_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableINVALID_CUSTOMIZATION_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("invalid.customization.namespace", arg0);
+    }
+
+    /**
+     * Ignoring customization: "{0}", it has no namespace. It must belong to the customization namespace.
+     *
+     */
+    public static String INVALID_CUSTOMIZATION_NAMESPACE(Object arg0) {
+        return localizer.localize(localizableINVALID_CUSTOMIZATION_NAMESPACE(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_ATTRIBUTE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidAttribute", arg0, arg1);
+    }
+
+    /**
+     * invalid attribute "{0}" of element "{1}"
+     *
+     */
+    public static String VALIDATION_INVALID_ATTRIBUTE(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_ATTRIBUTE(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_PARSER_CONFIG_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("parsing.parserConfigException", arg0);
+    }
+
+    /**
+     * invalid WSDL file! parsing failed: {0}
+     *
+     */
+    public static String PARSING_PARSER_CONFIG_EXCEPTION(Object arg0) {
+        return localizer.localize(localizablePARSING_PARSER_CONFIG_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizablePARSING_ONLY_ONE_TYPES_ALLOWED(Object arg0) {
+        return messageFactory.getMessage("parsing.onlyOneTypesAllowed", arg0);
+    }
+
+    /**
+     * only one "types" element allowed in "{0}"
+     *
+     */
+    public static String PARSING_ONLY_ONE_TYPES_ALLOWED(Object arg0) {
+        return localizer.localize(localizablePARSING_ONLY_ONE_TYPES_ALLOWED(arg0));
+    }
+
+    public static Localizable localizablePARSING_INVALID_URI(Object arg0) {
+        return messageFactory.getMessage("parsing.invalidURI", arg0);
+    }
+
+    /**
+     * invalid URI: {0}
+     *
+     */
+    public static String PARSING_INVALID_URI(Object arg0) {
+        return localizer.localize(localizablePARSING_INVALID_URI(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INCORRECT_TARGET_NAMESPACE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.incorrectTargetNamespace", arg0, arg1);
+    }
+
+    /**
+     * target namespace is incorrect (expected: {1}, found: {0})
+     *
+     */
+    public static String VALIDATION_INCORRECT_TARGET_NAMESPACE(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INCORRECT_TARGET_NAMESPACE(arg0, arg1));
+    }
+
+    public static Localizable localizableENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("entity.notFoundByQName", arg0, arg1);
+    }
+
+    /**
+     * invalid entity name: "{0}" (in namespace: "{1}")
+     *
+     */
+    public static String ENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableENTITY_NOT_FOUND_BY_Q_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_WSDL(Object arg0) {
+        return messageFactory.getMessage("invalid.wsdl", arg0);
+    }
+
+    /**
+     * "{0} does not look like a WSDL document, retrying with MEX..."
+     *
+     */
+    public static String INVALID_WSDL(Object arg0) {
+        return localizer.localize(localizableINVALID_WSDL(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_UNSUPPORTED_SCHEMA_FEATURE(Object arg0) {
+        return messageFactory.getMessage("validation.unsupportedSchemaFeature", arg0);
+    }
+
+    /**
+     * unsupported XML Schema feature: "{0}"
+     *
+     */
+    public static String VALIDATION_UNSUPPORTED_SCHEMA_FEATURE(Object arg0) {
+        return localizer.localize(localizableVALIDATION_UNSUPPORTED_SCHEMA_FEATURE(arg0));
+    }
+
+    public static Localizable localizablePARSING_UNKNOWN_IMPORTED_DOCUMENT_TYPE(Object arg0) {
+        return messageFactory.getMessage("parsing.unknownImportedDocumentType", arg0);
+    }
+
+    /**
+     * imported document is of unknown type: {0}
+     *
+     */
+    public static String PARSING_UNKNOWN_IMPORTED_DOCUMENT_TYPE(Object arg0) {
+        return localizer.localize(localizablePARSING_UNKNOWN_IMPORTED_DOCUMENT_TYPE(arg0));
+    }
+
+    public static Localizable localizablePARSING_IO_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+        return messageFactory.getMessage("parsing.ioExceptionWithSystemId", arg0);
+    }
+
+    /**
+     * failed to parse document at "{0}"
+     *
+     */
+    public static String PARSING_IO_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+        return localizer.localize(localizablePARSING_IO_EXCEPTION_WITH_SYSTEM_ID(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_AMBIGUOUS_NAME(Object arg0) {
+        return messageFactory.getMessage("validation.ambiguousName", arg0);
+    }
+
+    /**
+     * ambiguous operation name: "{0}"
+     *
+     */
+    public static String VALIDATION_AMBIGUOUS_NAME(Object arg0) {
+        return localizer.localize(localizableVALIDATION_AMBIGUOUS_NAME(arg0));
+    }
+
+    public static Localizable localizablePARSING_WSDL_NOT_DEFAULT_NAMESPACE(Object arg0) {
+        return messageFactory.getMessage("parsing.wsdlNotDefaultNamespace", arg0);
+    }
+
+    /**
+     * default namespace must be "{0}"
+     *
+     */
+    public static String PARSING_WSDL_NOT_DEFAULT_NAMESPACE(Object arg0) {
+        return localizer.localize(localizablePARSING_WSDL_NOT_DEFAULT_NAMESPACE(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_DUPLICATED_ELEMENT(Object arg0) {
+        return messageFactory.getMessage("validation.duplicatedElement", arg0);
+    }
+
+    /**
+     * duplicated element: "{0}"
+     *
+     */
+    public static String VALIDATION_DUPLICATED_ELEMENT(Object arg0) {
+        return localizer.localize(localizableVALIDATION_DUPLICATED_ELEMENT(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_TARGET_NOT_AN_ELEMENT() {
+        return messageFactory.getMessage("internalizer.targetNotAnElement");
+    }
+
+    /**
+     * Target node is not an element
+     *
+     */
+    public static String INTERNALIZER_TARGET_NOT_AN_ELEMENT() {
+        return localizer.localize(localizableINTERNALIZER_TARGET_NOT_AN_ELEMENT());
+    }
+
+    public static Localizable localizableWARNING_INPUT_OUTPUT_EMPTY_ACTION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("warning.inputOutputEmptyAction", arg0, arg1);
+    }
+
+    /**
+     * ignoring empty Action in {0} element of "{1}" operation, using default instead
+     *
+     */
+    public static String WARNING_INPUT_OUTPUT_EMPTY_ACTION(Object arg0, Object arg1) {
+        return localizer.localize(localizableWARNING_INPUT_OUTPUT_EMPTY_ACTION(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_INVALID_TAG_NS(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) {
+        return messageFactory.getMessage("parsing.invalidTagNS", arg0, arg1, arg2, arg3, arg4);
+    }
+
+    /**
+     * Invalid WSDL at {4}: expected element "{2}" (in namespace "{3}"), found element "{0}" (in namespace "{1}")
+     *
+     */
+    public static String PARSING_INVALID_TAG_NS(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) {
+        return localizer.localize(localizablePARSING_INVALID_TAG_NS(arg0, arg1, arg2, arg3, arg4));
+    }
+
+    public static Localizable localizableINVALID_WSDL_WITH_DOOC(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.wsdl.with.dooc", arg0, arg1);
+    }
+
+    /**
+     * "Not a WSDL document: {0}, it gives "{1}", retrying with MEX..."
+     *
+     */
+    public static String INVALID_WSDL_WITH_DOOC(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_WSDL_WITH_DOOC(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_NOT_AWSDL(Object arg0) {
+        return messageFactory.getMessage("Parsing.NotAWSDL", arg0);
+    }
+
+    /**
+     * Failed to get WSDL components, probably {0} is not a valid WSDL file.
+     *
+     */
+    public static String PARSING_NOT_AWSDL(Object arg0) {
+        return localizer.localize(localizablePARSING_NOT_AWSDL(arg0));
+    }
+
+    public static Localizable localizableENTITY_DUPLICATE(Object arg0) {
+        return messageFactory.getMessage("entity.duplicate", arg0);
+    }
+
+    /**
+     * duplicate entity: "{0}"
+     *
+     */
+    public static String ENTITY_DUPLICATE(Object arg0) {
+        return localizer.localize(localizableENTITY_DUPLICATE(arg0));
+    }
+
+    public static Localizable localizableWARNING_WSI_R_2004() {
+        return messageFactory.getMessage("warning.wsi.r2004");
+    }
+
+    /**
+     * Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definition emmbedded inline within WSDLDocument.
+     *
+     */
+    public static String WARNING_WSI_R_2004() {
+        return localizer.localize(localizableWARNING_WSI_R_2004());
+    }
+
+    public static Localizable localizableWARNING_WSI_R_2003() {
+        return messageFactory.getMessage("warning.wsi.r2003");
+    }
+
+    /**
+     * Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema element.
+     *
+     */
+    public static String WARNING_WSI_R_2003() {
+        return localizer.localize(localizableWARNING_WSI_R_2003());
+    }
+
+    public static Localizable localizableWARNING_WSI_R_2002(Object arg0, Object arg1) {
+        return messageFactory.getMessage("warning.wsi.r2002", arg0, arg1);
+    }
+
+    /**
+     * Not a WSI-BP compliant WSDL (R2002). wsdl:import must not be used to import XML Schema embedded in the WSDL document. Expected wsdl namesapce: {0}, found: {1}
+     *
+     */
+    public static String WARNING_WSI_R_2002(Object arg0, Object arg1) {
+        return localizer.localize(localizableWARNING_WSI_R_2002(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+        return messageFactory.getMessage("parsing.elementOrTypeRequired", arg0);
+    }
+
+    /**
+     * warning: part {0} is ignored, either the "element" or the "type" attribute is required in part "{0}"
+     *
+     */
+    public static String PARSING_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+        return localizer.localize(localizablePARSING_ELEMENT_OR_TYPE_REQUIRED(arg0));
+    }
+
+    public static Localizable localizableWARNING_WSI_R_2001(Object arg0) {
+        return messageFactory.getMessage("warning.wsi.r2001", arg0);
+    }
+
+    /**
+     * Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must only import WSDL document. Its trying to import: "{0}"
+     *
+     */
+    public static String WARNING_WSI_R_2001(Object arg0) {
+        return localizer.localize(localizableWARNING_WSI_R_2001(arg0));
+    }
+
+    public static Localizable localizableVALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("validation.invalidSimpleTypeInElement", arg0, arg1);
+    }
+
+    /**
+     * invalid element: "{1}", has named simpleType: "{0}"
+     *
+     */
+    public static String VALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizableVALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizablePARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(Object arg0) {
+        return messageFactory.getMessage("parsing.onlyOneDocumentationAllowed", arg0);
+    }
+
+    /**
+     * only one "documentation" element allowed in "{0}"
+     *
+     */
+    public static String PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(Object arg0) {
+        return localizer.localize(localizablePARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(arg0));
+    }
+
+    public static Localizable localizableINTERNALIZER_VERSION_NOT_PRESENT() {
+        return messageFactory.getMessage("Internalizer.VersionNotPresent");
+    }
+
+    /**
+     * JAXWS version attribute must be present
+     *
+     */
+    public static String INTERNALIZER_VERSION_NOT_PRESENT() {
+        return localizer.localize(localizableINTERNALIZER_VERSION_NOT_PRESENT());
+    }
+
+    public static Localizable localizablePARSING_TOO_MANY_ELEMENTS(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("parsing.tooManyElements", arg0, arg1, arg2);
+    }
+
+    /**
+     * too many "{0}" elements under "{1}" element "{2}"
+     *
+     */
+    public static String PARSING_TOO_MANY_ELEMENTS(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizablePARSING_TOO_MANY_ELEMENTS(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableINTERNALIZER_INCORRECT_SCHEMA_REFERENCE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("Internalizer.IncorrectSchemaReference", arg0, arg1);
+    }
+
+    /**
+     * "{0}" is not a part of this compilation. Is this a mistake for "{1}"?
+     *
+     */
+    public static String INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(Object arg0, Object arg1) {
+        return localizer.localize(localizableINTERNALIZER_INCORRECT_SCHEMA_REFERENCE(arg0, arg1));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties
index 7c81f48..56adeb3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 configuration.invalidElement=invalid element \"{2}\" in file \"{0}\" (line {1})
 configuration.notBindingFile=Ignoring: binding file "\"{0}\". It is not a jaxws or a jaxb binding file.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties
index 1c96d86..35e5ee4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 # Generator
 generator.nestedGeneratorError=generator error: {0}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties
index 281ecf8..604da5f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,12 +21,12 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 #
 # Generic Messages
 #
-javacompiler.classpath.error={0} is not available in the classpath.
-javacompiler.nosuchmethod.error=There is no such method {0} available.
+javacompiler.classpath.error={0} is not available in the classpath, requires Sun's JDK version 5.0 or latter.
+javacompiler.nosuchmethod.error=There is no such method {0} available, requires Sun's JDK version 5.0 or latter.
 javacompiler.error=error : {0}.
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/model.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/model.properties
index 2cdeb7d..17076cf 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/model.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/model.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,8 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
+
 
 model.nestedModelError=model error: {0}
 model.duplicate.porttype=duplicate PortType added to model: {0}
@@ -31,7 +32,6 @@
 model.duplicate.property=duplicate property added to model: {0}
 model.duplicate.service=duplicate service added to model: {0}
 model.invalid.message.type=invalid message type: {0}
-model.invalid.processorActionVersion=invalid ProcessorActionVersion: {0}
 
 model.schema.notImplemented=unsupported XML Schema feature ({0})
 model.schema.circularity=circularity detected in schema: \"{0}\"
@@ -57,6 +57,9 @@
 model.schema.invalidWildcard.allCompositor=xsd:all compositor not supported for the wildcard in schema type: \"{0}\"
 
 model.uniqueness=uniqueness constraint violation
+model.part.notUnique=parts in wsdl:message \"{0}\", reference \"{1}\", they must reference unique global elements.
+model.parameter.notunique=Failed to generate Java signature: duplicate parameter names {0}. Use JAXWS binding customization to rename the wsdl:part \"{1}\"
+model.exception.notunique=Failed to generate Java signature: duplicate exception names {0}. Use JAXWS binding customization to rename the wsdl:part \"{1}\"
 model.uniqueness.javastructuretype=uniqueness constraint violation, duplicate member \"{0}\" added to JavaStructureType \"{1}\"
 model.parent.type.already.set=parent of type \"{0}\" already set to \"{1}\", new value = \"{2}\"
 model.parent.fault.already.set=parent of fault \"{0}\" already set to \"{1}\", new value = \"{2}\"
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties
index 906ddc4..b422860 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 # general
 modeler.nestedModelError=modeler error: {0}
@@ -62,14 +62,16 @@
 wsdlmodeler.warning.ignoringUnrecognizedSchemaExtension=ignoring schema element (unsupported version): {0}
 wsdlmodeler.warning.searchSchema.unrecognizedTypes=encountered {0} unrecognized type(s)
 wsdlmodeler.warning.noServiceDefinitionsFound=WSDL document does not define any services
-wsdlmodeler.warning.noPortsInService=Service \"{0}\" does not contain any usable ports
+wsdlmodeler.warning.noPortsInService=Service \"{0}\" does not contain any usable ports. try running wsimport with -extension switch.
 wsdlmodeler.warning.noOperationsInPort=Port \"{0}\" does not contain any usable operations
-wsdlmodeler.warning.ignoringNonSOAPPort=ignoring port \"{0}\": not a SOAP port
-wsdlmodeler.warning.ignoringNonSOAPPort.noAddress=ignoring port \"{0}\": no SOAP address specified
-wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport:ignoring SOAP port \"{0}\": unrecognized transport
+wsdlmodeler.warning.ignoringNonSOAPPort=ignoring port \"{0}\": not a standard SOAP port. try running wsimport with -extension switch.
+wsdlmodeler.warning.nonSOAPPort=port \"{0}\": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime. 
+wsdlmodeler.warning.ignoringNonSOAPPort.noAddress=ignoring port \"{0}\": no SOAP address specified. try running wsimport with -extension switch.
+wsdlmodeler.warning.noSOAPAddress=port \"{0}\" is not a SOAP port, it has no soap:address 
+wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport:ignoring SOAP port \"{0}\": unrecognized transport. try running wsimport with -extension switch.
 
 #BP1.1 R2705
-wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle=ignoring SOAP port \"{0}\", its not WS-I BP 1.1 compliant: the wsdl binding has mixed style, it must be rpc-literal or document-literal operation!
+wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle=ignoring port \"{0}\", its not WS-I BP 1.1 compliant: the wsdl binding has mixed style, it must be rpc-literal or document-literal operation. try running wsimport with -extension switch.
 wsdlmodeler.warning.port.SOAPBinding.mixedStyle=not a WS-I BP1.1 compliant SOAP port \"{0}\": the wsdl binding has mixed style, it must be rpc-literal or document-literal operation!
 
 wsdlmodeler.warning.ignoringOperation.notSupportedStyle=ignoring operation \"{0}\": not request-response or one-way
@@ -155,35 +157,35 @@
 wsdlmodeler.warning.r2716r2726=R2716/R2726 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit or rpc/lit for {0}: \"{1}\"
 
 #WSI-BP 1.1 Warning/Errors
-//R2911
+# R2911
 mimemodeler.invalidMimePart.moreThanOneSOAPBody=Ignoring operation \"{0}\". The Multipart/Related structure has invalid root part: more than one soap:body parts found
 
-//R2906
+# R2906
 mimemodeler.warning.IgnoringinvalidHeaderPart.notDeclaredInRootPart=Headers not in root mime:part with soap:body, ignoring headers in operation \"{0}\"
 
-//R2909
+# R2909
 mimemodeler.invalidMimeContent.differentPart=Ignoring the mime:part. Invalid mime:part, the mime:content has different part attribute.
 
 mimemodeler.invalidMimeContent.invalidSchemaType=Ignoring the mime:part. mime part: {0} can not be mapped to schema type: {1}
 
-//Rxxxx A mime:content in a DESCRIPTION MUST refer to a wsdl:part element defined using the type attribute.
+# Rxxxx A mime:content in a DESCRIPTION MUST refer to a wsdl:part element defined using the type attribute.
 mimemodeler.invalidMimeContent.mesagePartElementKind=wsdl:part element referenced by mime:content part attribute: {0} must be defined using type attribute!
 
-//RXXXX RYYYY: In a description, a mime:content element MUST include the part attribute.
+# RXXXX RYYYY: In a description, a mime:content element MUST include the part attribute.
 mimemodeler.invalidMimeContent.missingPartAttribute=Ignoring operation \"{0}\", missing part attribute in mime:content. part attribute must be present in mime:content declaration.
 
 mimemodeler.invalidMimeContent.missingTypeAttribute=Missing type attribute in mime:content in operation \"{0}\". part attribute must be present in mime:content declaration.
 
-//unknown schematype
+# unknown schematype
 mimemodeler.invalidMimeContent.unknownSchemaType=Unknown schema type: {1} for mime:content part: {0}
 mimemodeler.invalidMimeContent.errorLoadingJavaClass=Couldn't find class \"{0}\" for mime type \"{1}\"
 
-//missing wsdl:part referenced by the mime:content
+# missing wsdl:part referenced by the mime:content
 wsdlmodeler.warning.ignoringMimePart.notFound=ignoring mime:part, cannot find part \"{0}\" referenced by the mime:content in the wsdl:operation \"{1}\"
 
 mimemodeler.elementPart.invalidElementMimeType=The mime:content part refers to wsdl:part \"{0}\", defined using element attribute. Please make sure the mime type: \"{1}\" is appropriate to serialize XML.
 
-//R2708 The mime:part element in a DESCRIPTION MUST NOT have a name attribute.
+# R2708 The mime:part element in a DESCRIPTION MUST NOT have a name attribute.
 mimemodeler.invalidMimePart.nameNotAllowed=name attribute on wsdl:part in Operation \"{0}\" is ignored. Its not allowed as per WS-I AP 1.0.
 
 
@@ -205,9 +207,11 @@
 wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customizedOperationName=Ignoring operation \"{0}\", can''t generate java method ,customized name \"{1}\" of the wsdl:operation is a java keyword.
 wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customizedOperationName=Invalid operation \"{0}\", can''t generate java method ,customized name \"{1}\" of the wsdl:operation is a java keyword.
 
-wsdlmodeler.jaxb.javatype.notfound=Schema descriptor {0} in message part {1} could not be bound to Java!
+wsdlmodeler.jaxb.javatype.notfound=Schema descriptor {0} in message part \"{1}\" could not be bound to Java!
 wsdlmodeler.unsupportedBinding.mime=WSDL MIME binding is not currently supported!
 
 wsdlmodeler.nonUnique.body=Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}
 wsdlmodeler.rpclit.unkownschematype=XML type \"{0}\" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part \"{1}\" in the wsdl:message \"{2}\".    
+
+wsdlmodeler.responsebean.notfound=wsimport failed to generate async response bean for operation: {0}
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties
index 48cc23a..65e33bc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 processor.missing.model=model is missing
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/util.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/util.properties
index 799bafd..03064e3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/util.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/util.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 holder.valuefield.not.found=Could not find the field in the Holder that contains the Holder''s value: {0}
 null.namespace.found=Encountered error in wsdl. Check namespace of element <{0}>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties
index eb73597..f37386b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 webserviceap.nestedModelError=modeler error: {0}
 webserviceap.fileNotFound=error: file not found: {0}
@@ -32,7 +32,8 @@
 webserviceap.succeeded: Success
 
 webserviceap.method.not.annotated=The method {0} on class {1} is not annotated.
-webserviceap.rpc.encoded.not.supported=The {0} class has a rpc/encoded SOAPBinding.  Rpc/encoded SOAPBindings are not supported in JAXWS 2.0. 
+webserviceap.rpc.encoded.not.supported=The {0} class has a rpc/encoded SOAPBinding.  Rpc/encoded SOAPBindings are not supported in JAXWS 2.0.
+webservice.encoded.not.supported=The {0} class has invalid SOAPBinding annotation. {1}/encoded SOAPBinding is not supported
 webserviceap.model.already.exists=model already exists
 webserviceap.endpointinterface.on.interface=Service endpointpoint interface\: {0} has cannot have a WebService.endpointInterface annotation\: {1}
 webserviceap.java.typeNotFound=The type: {0} was not found in the mapping
@@ -118,7 +119,9 @@
 
 webserviceap.invalid.sei.annotation=The @{0} annotation cannot be used on a service endpoint interface. Class\: {1} 
 
-webserviceap.invalid.webmethod.element.with.exclude=The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class\: {1} method\: {0} 
+webserviceap.invalid.sei.annotation.element.exclude=The @javax.jws.WebMethod({0}) cannot be used on a service endpoint interface. Class\: {1} method\: {2}
+
+webserviceap.invalid.webmethod.element.with.exclude=The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class\: {1} method\: {2} 
 
 webserviceap.doc.bare.no.out=Document/literal bare methods with no return type or OUT/INOUT parameters must be annotated as @Oneway. Class\: {0}, method: {1}
 webserviceap.doc.bare.return.and.out=Document/literal bare methods cannot have a return type and out parameters. Class\: {0}, method: {1}
@@ -134,7 +137,7 @@
 
 webserviceap.webservice.method.is.abstract=Classes annotated with @javax.jws.WebService must not have abstract methods. Class\: {0} Method: {1}
 
-webserviceap.doc.bare.return.and.out=Document literal bare methods must not have a return value and an OUT/INOUT parameter.  Class\: {0} Method\: {1} 
+#webserviceap.doc.bare.return.and.out=Document literal bare methods must not have a return value and an OUT/INOUT parameter.  Class\: {0} Method\: {1} 
 
 webserviceap.webservice.no.default.constructor=Classes annotated with @javax.jws.WebService must have a public default constructor. Class\: {0}
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties
index f3a6cb1..6dac165 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,15 +21,16 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 wsimport.usage=Usage: {0} [options] <WSDL_URI>\n\n\
 Use "wsimport -help" for a detailed description of options.
 
 wsimport.help=\nUsage: {0} [options] <WSDL_URI>\n\n\
 \where [options] include:\n\
-\  -b <path>                 specify external jaxws or jaxb binding files\n\
-\                            (Each <file> must have its own -b)\n\
+\  -b <path>                 specify jaxws/jaxb binding files or additional schemas\n\
+\                            (Each <path> must have its own -b)\n\
+\  -B<jaxbOption>            Pass this option to JAXB schema compiler\n\
 \  -catalog <file>           specify catalog file to resolve external entity references\n\
 \                            supports TR9401, XCatalog, and OASIS XML Catalog format.\n\
 \  -d <directory>            specify where to place generated output files\n\
@@ -41,10 +42,14 @@
 \  -httpproxy:<host>:<port>  specify a HTTP proxy server (port defaults to 8080)\n\
 \  -keep                     keep generated files\n\
 \  -p <pkg>                  specifies the target package\n\
+\  -quiet                    suppress wsimport output\n\
 \  -s <directory>            specify where to place generated source files\n\
+\  -target <version>         generate code as per the given JAXWS specification version.\n\
+\                            version 2.0 will generate compliant code for JAXWS 2.0 spec.\n\
 \  -verbose                  output messages about what the compiler is doing\n\
 \  -version                  print version information\n\
-\  -wsdllocation <location>  @WebService.wsdlLocation and @WebServiceClient.wsdlLocation value
+\  -wsdllocation <location>  @WebServiceClient.wsdlLocation value\n\
+
 
 wsimport.usage.examples=\n\
 \Examples:\n\
@@ -85,12 +90,26 @@
 \  wsgen -cp . example.Stock\n\
 \  wsgen -cp . example.Stock -wsdl -servicename '{http://mynamespace}MyService'\n\
 
+wrapperTask.needEndorsed=\
+You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. \
+Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), \
+or set xendorsed="true" on <{0}>. 
+
+wrapperTask.loading20Api=\
+You are loading JAX-WS 2.0 API from {0} but this tool requires JAX-WS 2.1 API.
+
+invoker.needEndorsed=\
+You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. \
+Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), \
+or use -Xendorsed option.
 
 
 #
 # Generic Messages
 #
-wscompile.invalidOption={0} is an invalid option or argument
+wscompile.invalidOption=unrecognized parameter {0}
+wsimport.noSuchJaxbOption=no such JAXB option: {0}
+
 wscompile.error=error: {0}
 wscompile.warning=warning: {0}
 wscompile.info=info: {0}
@@ -98,7 +117,6 @@
 wscompile.noSuchDirectory=directory not found: {0}
 wscompile.missingOptionArgument=option \"{0}\" requires an argument
 wscompile.compilationFailed=compilation failed, errors should have been reported
-wscompile.classmodelinfo.expected=Expected a ClassModelInfo but got a {0}.
 
 wsimport.missingFile=Missing WSDL_URI
 
@@ -114,10 +132,36 @@
 wsgen.portname.missing.namespace=The port name \"{0}\" is missing a namespace.
 wsgen.portname.missing.localname=The port name \"{0}\" is missing a localname.
 wsgen.class.must.be.implementation.class=The class \"{0}\" is not an endpoint implementation class.
-wsgen.cannot.gen.wsdl.for.non.soap.binding=The -wsdl option cannot be used with non-SOAP bindings. Class \"{0}\" binding: \"{1}\".
-wsgen.cannot.gen.wsdl.for.soap12.binding=The -wsdl option cannot be used with SOAP1.2 bindings.\n\
-Try using \"-wsdl:Xsoap1.2 -extension\".\n\
-Class \"{0}\" binding: \"{1}\".
-wsgen.cannot.gen.wsdl.for.xsoap12.binding.wo.extention=The -wsdl option cannot be used with the SOAP1.2 extension binding without the \"-extension\" option.\n\
-Class \"{0}\" binding: \"{1}\".
+wsimport.NotAFileNorURL = \
+    "{0}" is neither a file name nor an URL
+
+wsgen.cannot.gen.wsdl.for.non.soap.binding=wsgen can not generate WSDL for non-SOAP binding: {0} on Class {1}
+
+wsgen.cannot.gen.wsdl.for.soap12.binding=wsgen can not generate WSDL for SOAP 1.2 binding: {0} on class: {1}.\n
+Please specify \"-extension\" and \"-wsdl:protocol XSoap1.2\" switches. For example:\n\n
+wsgen -wsdl:protocol XSoap1.2 -extenson {1}
+
+wsgen.no.webservices.class=wsgen did not find any class with @WebService annotation. Please specify @WebService annotation on {0}.
+
+wsimport.no.wsdl=Failed to read the WSDL document: {0}, because 1) could not find the document; /\
+  2) the document could not be read; \
+  3) the root element of the document is not <wsdl:definitions>.
+
+wsimport.FailedToParse = \
+    Failed to parse "{0}": {1}
+
+wsimport.ParsingWSDL=parsing WSDL...\n\n
+wsimport.GeneratingCode=generating code...
+
+wsimport.ILLEGAL_TARGET_VERSION = \
+    "{0}" is not a valid target version. "2.0" and "2.1" are supported.
+
+wsimport.ErrorMessage = \
+	[ERROR] {0}
+
+wsimport.WarningMessage = \
+	[WARNING] {0}
+
+wsimport.InfoMessage = \
+	[INFO] {0}
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties
index f84184f..779d908 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,11 +21,12 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
+localized.error={0}
 parsing.wsdlNotDefaultNamespace=default namespace must be \"{0}\"
 parsing.onlyOneOfElementOrTypeRequired=only one of the \"element\" or \"type\" attributes is allowed in part \"{0}\"
-parsing.elementOrTypeRequired=either the \"element\" or the \"type\" attribute is required in part \"{0}\"
+parsing.elementOrTypeRequired=warning: part {0} is ignored, either the \"element\" or the \"type\" attribute is required in part \"{0}\"
 parsing.invalidElement=invalid element: \"{0}\" (in namespace \"{1}\")
 parsing.invalidAttributeValue=invalid value \"{1}\" for attribute \"{0}\"
 parsing.invalidExtensionElement=invalid extension element: \"{0}\" (in namespace \"{1}\")
@@ -39,9 +40,10 @@
 parsing.unknownImportedDocumentType=imported document is of unknown type: {0}
 parsing.unknownNamespacePrefix=undeclared namespace prefix: \"{0}\"
 parsing.invalidURI=invalid URI: {0}
-parsing.ioExceptionWithSystemId=failed to parse document at \"{0}\": {1}
+parsing.ioExceptionWithSystemId=failed to parse document at \"{0}\"
+parsing.unableToGetMetadata= Unable to get Metadata from: {0}
 parsing.ioException=parsing failed: {0}
-parsing.saxExceptionWithSystemId=invalid WSDL file! failed to parse document at \"{0}\": {1}
+parsing.saxExceptionWithSystemId=invalid WSDL file! failed to parse document at \"{0}\"
 parsing.saxException=invalid WSDL file! parsing failed: {0}
 parsing.parserConfigException=invalid WSDL file! parsing failed: {0}
 parsing.factoryConfigException=invalid WSDL file! parsing failed: {0}
@@ -49,14 +51,18 @@
 #
 parsing.missingRequiredAttribute=missing required attribute \"{1}\" of element \"{0}\"
 parsing.invalidTag=expected element \"{1}\", found \"{0}\"
-parsing.invalidTagNS=expected element \"{2}\" (in namespace \"{3}\"), found element \"{0}\" (in namespace \"{1}\")
+parsing.invalidTagNS=Invalid WSDL at {4}: expected element \"{2}\" (in namespace \"{3}\"), found element \"{0}\" (in namespace \"{1}\")
 parsing.nonWhitespaceTextFound=found unexpected non whitespace text: \"{0}\"
 parsing.elementExpected=unexpected non-element found
 #
 entity.duplicate=duplicate entity: \"{0}\"
 entity.duplicateWithType=duplicate \"{0}\" entity: \"{1}\"
-entity.notFoundByQName=invalid entity name: \"{0}\" (in namespace: \"{1}\")
+
 entity.notFoundByID=invalid entity id: \"{0}\"
+entity.notFoundByQName=invalid entity name: \"{0}\" (in namespace: \"{1}\")
+entity.notFound.portType=wsdl:portType \"{0}\" referenced by wsdl:binding \"{1}\", but its not found in the wsdl
+entity.notFound.binding=wsdl:binding \"{0}" referenced by wsdl:port \"{1}\", but its not found in the wsdl
+
 #
 validation.missingRequiredAttribute=missing required attribute \"{0}\" of element \"{1}\"
 validation.missingRequiredProperty=missing required property \"{0}\" of element \"{1}\"
@@ -65,7 +71,7 @@
 validation.invalidComplexTypeInElement=invalid element: \"{1}\", has named complexType: \"{0}\"
 validation.invalidSimpleTypeInElement=invalid element: \"{1}\", has named simpleType: \"{0}\"
 validation.duplicatedElement=duplicated element: \"{0}\"
-validation.duplicateName=duplicated part name: \"{0}\"
+validation.duplicatePartName=Invalid WSDL, duplicate parts in a wsdl:message is not allowed. \nwsdl:message {0} has duplicated part name: \"{1}\"
 validation.invalidSubEntity=invalid sub-element \"{0}\" of element \"{1}\"
 validation.invalidAttribute=invalid attribute \"{0}\" of element \"{1}\"
 validation.invalidAttributeValue=invalid value \"{1}\" for attribute \"{0}\"
@@ -78,6 +84,8 @@
 validation.notSimpleType=not a simple type: \"{0}\"
 validation.ambiguousName=ambiguous operation name: \"{0}\"
 validation.invalidPrefix=undeclared namespace prefix: \"{0}\"
+warning.faultEmptyAction=ignoring empty Action in \"{0}\" {1} element of \"{2}\" operation, using default instead
+warning.inputOutputEmptyAction=ignoring empty Action in {0} element of \"{1}\" operation, using default instead
 
 #wsi compliant WSDL warnings
 warning.wsi.r2001=Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must only import WSDL document. Its trying to import: \"{0}\"
@@ -85,11 +93,36 @@
 warning.wsi.r2003=Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema element.
 warning.wsi.r2004=Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definition emmbedded inline within WSDLDocument.
 
+#Parser
+Parsing.ParseFailed = \
+	Failed to parse the WSDL.
+
+Parsing.NotAWSDL=Failed to get WSDL components, probably {0} is not a valid WSDL file.
+
+AbstractReferenceFinderImpl.UnableToParse = \
+	Unable to parse "{0}" : {1}
+
+Parser.NotABindingFile = \
+	not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
+
+
 #Internalizer
+Internalizer.TwoVersionAttributes = \
+	Both jaxws:version and version are present
+Internalizer.IncorrectVersion = \
+	JAXWS version attribute must be "2.0"
+
+Internalizer.VersionNotPresent = \
+	JAXWS version attribute must be present
+
 internalizer.targetNotAnElement= \
     Target node is not an element
 internalizer.targetNotFound= \
     No target found for the wsdlLocation: {0}
+
+Internalizer.IncorrectSchemaReference= \
+	"{0}" is not a part of this compilation. Is this a mistake for "{1}"?
+
 internalizer.XPathEvaluationError = \
     XPath error: {0}
 internalizer.XPathEvaluatesToNoTarget = \
@@ -99,4 +132,7 @@
 internalizer.XPathEvaluatesToNonElement = \
     XPath evaluation of "{0}" needs to result in an element.
 invalid.customization.namespace=Ignoring customization: \"{0}\", it has no namespace. It must belong to the customization namespace.    
+
+invalid.wsdl.with.dooc="Not a WSDL document: {0}, it gives \"{1}\", retrying with MEX..."
+invalid.wsdl="{0} does not look like a WSDL document, retrying with MEX..."
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java
index 73282cd..deae606 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 package com.sun.tools.internal.ws.spi;
 
 import com.sun.tools.internal.ws.util.WSToolsObjectFactoryImpl;
+import com.sun.xml.internal.ws.api.server.Container;
+
 import java.io.OutputStream;
 
 
@@ -35,16 +37,13 @@
  */
 public abstract class WSToolsObjectFactory {
 
-    private static WSToolsObjectFactory factory;
+    private static final WSToolsObjectFactory factory = new WSToolsObjectFactoryImpl();
 
     /**
      * Obtain an instance of a factory. Don't worry about synchronization(at the
      * most, one more factory is created).
      */
     public static WSToolsObjectFactory newInstance() {
-        if (factory == null) {
-            factory = new WSToolsObjectFactoryImpl();
-        }
         return factory;
     }
 
@@ -52,16 +51,49 @@
      * Invokes wsimport on the wsdl URL argument, and generates the necessary
      * portable artifacts like SEI, Service, Bean classes etc.
      *
+     * @param logStream Stream used for reporting log messages like errors, warnings etc
+     * @param container gives an environment for tool if it is run during appserver
+     *                  deployment
+     * @param args arguments with various options and wsdl url
+     *
      * @return true if there is no error, otherwise false
      */
-    public abstract boolean wsimport(OutputStream logStream, String[] args);
+    public abstract boolean wsimport(OutputStream logStream, Container container, String[] args);
+
+    /**
+     * Invokes wsimport on the wsdl URL argument, and generates the necessary
+     * portable artifacts like SEI, Service, Bean classes etc.
+     *
+     * @return true if there is no error, otherwise false
+     *
+     * @see {@link #wsimport(OutputStream, Container, String[])}
+     */
+    public boolean wsimport(OutputStream logStream, String[] args) {
+        return wsimport(logStream, Container.NONE, args);
+    }
+
+    /**
+     * Invokes wsgen on the endpoint implementation, and generates the necessary
+     * artifacts like wrapper, exception bean classes etc.
+     *
+     * @param logStream Stream used for reporting log messages like errors, warnings etc
+     * @param container gives an environment for tool if it is run during appserver
+     *                  deployment
+     * @param args arguments with various options and endpoint class
+     *
+     * @return true if there is no error, otherwise false
+     */
+    public abstract boolean wsgen(OutputStream logStream, Container container, String[] args);
 
     /**
      * Invokes wsgen on the endpoint implementation, and generates the necessary
      * artifacts like wrapper, exception bean classes etc.
      *
      * @return true if there is no error, otherwise false
+     * @see {@link #wsgen(OutputStream, Container, String[])}
      */
-    public abstract boolean wsgen(OutputStream logStream, String[] args);
+    public boolean wsgen(OutputStream logStream, String[] args) {
+        return wsgen(logStream, Container.NONE, args);
+    }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java
index 6d95579..a081fd1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 
 /**
  *
- * <P>This document describes the SPI for the JAX-WS 2.0 tools.
+ * <P>This document describes the SPI for the JAX-WS 2.0.1 tools.
  *  The WSToolsObjectFactory is used to create instances of WsGen
  *  and WsImport that other applications can use.
 */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ClassNameInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ClassNameInfo.java
index 86b1e48..f1a7be2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ClassNameInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ClassNameInfo.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java
index f79d2de..6ea6a02 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ForkEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,12 @@
 
 package com.sun.tools.internal.ws.util;
 
-import java.io.IOException;
-
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
+import java.io.IOException;
+
 /**
  * {@link EntityResolver} that delegates to two {@link EntityResolver}s.
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JAXWSClassFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JAXWSClassFactory.java
deleted file mode 100644
index fc0209c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JAXWSClassFactory.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util;
-
-import java.util.Properties;
-
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.generator.Names;
-import com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler;
-import com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModelerBase;
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.xml.internal.ws.util.VersionUtil;
-
-/**
- * Singleton factory class to instantiate concrete classes based on the jaxws version
- * to be used to generate the code.
- *
- * @author WS Development Team
- */
-public class JAXWSClassFactory {
-    private static final JAXWSClassFactory factory = new JAXWSClassFactory();
-
-    private static String classVersion = VersionUtil.JAXWS_VERSION_DEFAULT;
-
-    private JAXWSClassFactory() {
-    }
-
-    /**
-     * Get the factory instance for the default version.
-     * @return        JAXWSClassFactory instance
-     */
-    public static JAXWSClassFactory newInstance() {
-        return factory;
-    }
-
-    /**
-     * Sets the version to a static classVersion
-     * @param version
-     */
-    public void setSourceVersion(String version) {
-        if (version == null)
-            version = VersionUtil.JAXWS_VERSION_DEFAULT;
-
-        if (!VersionUtil.isValidVersion(version)) {
-            // TODO: throw exception
-        } else
-            classVersion = version;
-    }
-
-    /**
-     * Returns the WSDLModeler for specific target version.
-     *
-     * @param modelInfo
-     * @param options
-     * @return the WSDLModeler for specific target version.
-     */
-    public WSDLModelerBase createWSDLModeler(
-        WSDLModelInfo modelInfo,
-        Properties options) {
-        WSDLModelerBase wsdlModeler = null;
-        if (classVersion.equals(VersionUtil.JAXWS_VERSION_20))
-            wsdlModeler = new WSDLModeler(modelInfo, options);
-        else {
-            // TODO: throw exception
-        }
-        return wsdlModeler;
-    }
-
-    /**
-     * Returns the Names for specific target version.
-     * //bug fix:4904604
-     * @return instance of Names
-     */
-    public Names createNames() {
-        Names names = new Names();
-        return names;
-    }
-
-    public String getVersion() {
-        return classVersion;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JavaCompilerHelper.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JavaCompilerHelper.java
deleted file mode 100644
index b252e7d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/JavaCompilerHelper.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util;
-
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-/**
- * A helper class to invoke javac.
- *
- * @author WS Development Team
- */
-public class JavaCompilerHelper extends ToolBase {
-
-    public JavaCompilerHelper(OutputStream out) {
-        super(out, " ");
-        this.out = out;
-    }
-
-    public boolean compile(String[] args) {
-        return internalCompile(args);
-    }
-
-    protected String getResourceBundleName() {
-        return "com.sun.tools.internal.ws.resources.javacompiler";
-    }
-
-    protected boolean internalCompile(String[] args) {
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        Class comSunToolsJavacMainClass = null;
-        try {
-            /* try to use the new compiler */
-            comSunToolsJavacMainClass =
-                    cl.loadClass("com.sun.tools.javac.Main");
-            try {
-                Method compileMethod =
-                        comSunToolsJavacMainClass.getMethod(
-                                "compile",
-                                compile141MethodSignature);
-                try {
-                    Object result =
-                            compileMethod.invoke(
-                                    null,
-                                    new Object[] { args, new PrintWriter(out)});
-                    if (!(result instanceof Integer)) {
-                        return false;
-                    }
-                    return ((Integer) result).intValue() == 0;
-                } catch (IllegalAccessException e3) {
-                    return false;
-                } catch (IllegalArgumentException e3) {
-                    return false;
-                } catch (InvocationTargetException e3) {
-                    return false;
-                }
-            } catch (NoSuchMethodException e2) {
-                //tryout 1.3.1 signature
-                return internalCompilePre141(args);
-                //onError(getMessage("javacompiler.nosuchmethod.error", "getMethod(\"compile\", compile141MethodSignature)"));
-                //return false;
-            }
-        } catch (ClassNotFoundException e) {
-            onError(
-                    getMessage(
-                            "javacompiler.classpath.error",
-                            "com.sun.tools.javac.Main"));
-            return false;
-        } catch (SecurityException e) {
-            return false;
-        }
-    }
-
-    protected boolean internalCompilePre141(String[] args) {
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            try {
-                    Class sunToolsJavacMainClass = cl.loadClass("sun.tools.javac.Main");
-                    try {
-                            Constructor constructor =
-                                    sunToolsJavacMainClass.getConstructor(constructorSignature);
-                            try {
-                                    Object javacMain =
-                                            constructor.newInstance(new Object[] { out, "javac" });
-                                    Method compileMethod =
-                                            sunToolsJavacMainClass.getMethod(
-                                                    "compile",
-                                                    compileMethodSignature);
-                                    Object result =
-                                            compileMethod.invoke(javacMain, new Object[] { args });
-                                    if (!(result instanceof Boolean)) {
-                                            return false;
-                                    }
-                                    return ((Boolean) result).booleanValue();
-                            } catch (InstantiationException e4) {
-                                    return false;
-                            } catch (IllegalAccessException e4) {
-                                    return false;
-                            } catch (IllegalArgumentException e4) {
-                                    return false;
-                            } catch (InvocationTargetException e4) {
-                                    return false;
-                            }
-
-                    } catch (NoSuchMethodException e3) {
-                            onError(
-                                    getMessage(
-                                            "javacompiler.nosuchmethod.error",
-                                            "getMethod(\"compile\", compileMethodSignature)"));
-                            return false;
-                    }
-            } catch (ClassNotFoundException e2) {
-                    return false;
-            }
-    }
-
-    protected String getGenericErrorMessage() {
-            return "javacompiler.error";
-    }
-
-    protected void run() {
-    }
-
-    protected boolean parseArguments(String[] args) {
-            return false;
-    }
-
-    public void onError(Localizable msg) {
-            report(getMessage("javacompiler.error", localizer.localize(msg)));
-    }
-
-    protected OutputStream out;
-
-    protected static final Class[] compile141MethodSignature;
-    protected static final Class[] constructorSignature;
-    protected static final Class[] compileMethodSignature;
-
-    static {
-            compile141MethodSignature = new Class[2];
-            compile141MethodSignature[0] = (new String[0]).getClass();
-            compile141MethodSignature[1] = PrintWriter.class;
-            //jdk version < 1.4.1 signature
-            constructorSignature = new Class[2];
-            constructorSignature[0] = OutputStream.class;
-            constructorSignature[1] = String.class;
-            compileMethodSignature = new Class[1];
-            compileMethodSignature[0] = compile141MethodSignature[0]; // String[]
-
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/MapBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/MapBase.java
deleted file mode 100644
index 99debcf..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/MapBase.java
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util;
-
-import java.util.AbstractCollection;
-import java.util.AbstractSet;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/*
- * This class was lifted from JDK 1.4 (where it's called java.util.AbstractMap)
- * so that we can use it on 1.3.1.
- *
- * @author WS Development Team
- */
-
-/**
- * This class provides a skeletal implementation of the <tt>Map</tt>
- * interface, to minimize the effort required to implement this interface. <p>
- *
- * To implement an unmodifiable map, the programmer needs only to extend this
- * class and provide an implementation for the <tt>entrySet</tt> method, which
- * returns a set-view of the map's mappings.  Typically, the returned set
- * will, in turn, be implemented atop <tt>AbstractSet</tt>.  This set should
- * not support the <tt>add</tt> or <tt>remove</tt> methods, and its iterator
- * should not support the <tt>remove</tt> method.<p>
- *
- * To implement a modifiable map, the programmer must additionally override
- * this class's <tt>put</tt> method (which otherwise throws an
- * <tt>UnsupportedOperationException</tt>), and the iterator returned by
- * <tt>entrySet().iterator()</tt> must additionally implement its
- * <tt>remove</tt> method.<p>
- *
- * The programmer should generally provide a void (no argument) and map
- * constructor, as per the recommendation in the <tt>Map</tt> interface
- * specification.<p>
- *
- * The documentation for each non-abstract methods in this class describes its
- * implementation in detail.  Each of these methods may be overridden if the
- * map being implemented admits a more efficient implementation.
- *
- * @author  Josh Bloch
- * @see Map
- * @see Collection
- * @since 1.2
- */
-
-public abstract class MapBase implements Map {
-    /**
-     * Sole constructor.  (For invocation by subclass constructors, typically
-     * implicit.)
-     */
-    protected MapBase() {
-    }
-
-    // Query Operations
-
-    /**
-     * Returns the number of key-value mappings in this map.  If the map
-     * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.<p>
-     *
-     * This implementation returns <tt>entrySet().size()</tt>.
-     *
-     * @return the number of key-value mappings in this map.
-     */
-    public int size() {
-        return entrySet().size();
-    }
-
-    /**
-     * Returns <tt>true</tt> if this map contains no key-value mappings. <p>
-     *
-     * This implementation returns <tt>size() == 0</tt>.
-     *
-     * @return <tt>true</tt> if this map contains no key-value mappings.
-     */
-    public boolean isEmpty() {
-        return size() == 0;
-    }
-
-    /**
-     * Returns <tt>true</tt> if this map maps one or more keys to this value.
-     * More formally, returns <tt>true</tt> if and only if this map contains
-     * at least one mapping to a value <tt>v</tt> such that <tt>(value==null ?
-     * v==null : value.equals(v))</tt>.  This operation will probably require
-     * time linear in the map size for most implementations of map.<p>
-     *
-     * This implementation iterates over entrySet() searching for an entry
-     * with the specified value.  If such an entry is found, <tt>true</tt> is
-     * returned.  If the iteration terminates without finding such an entry,
-     * <tt>false</tt> is returned.  Note that this implementation requires
-     * linear time in the size of the map.
-     *
-     * @param value value whose presence in this map is to be tested.
-     *
-     * @return <tt>true</tt> if this map maps one or more keys to this value.
-     */
-    public boolean containsValue(Object value) {
-        Iterator i = entrySet().iterator();
-        if (value == null) {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (e.getValue() == null)
-                    return true;
-            }
-        } else {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (value.equals(e.getValue()))
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns <tt>true</tt> if this map contains a mapping for the specified
-     * key. <p>
-     *
-     * This implementation iterates over <tt>entrySet()</tt> searching for an
-     * entry with the specified key.  If such an entry is found, <tt>true</tt>
-     * is returned.  If the iteration terminates without finding such an
-     * entry, <tt>false</tt> is returned.  Note that this implementation
-     * requires linear time in the size of the map; many implementations will
-     * override this method.
-     *
-     * @param key key whose presence in this map is to be tested.
-     * @return <tt>true</tt> if this map contains a mapping for the specified
-     *            key.
-     *
-     * @throws NullPointerException key is <tt>null</tt> and this map does not
-     *            not permit <tt>null</tt> keys.
-     */
-    public boolean containsKey(Object key) {
-        Iterator i = entrySet().iterator();
-        if (key == null) {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (e.getKey() == null)
-                    return true;
-            }
-        } else {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (key.equals(e.getKey()))
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns the value to which this map maps the specified key.  Returns
-     * <tt>null</tt> if the map contains no mapping for this key.  A return
-     * value of <tt>null</tt> does not <i>necessarily</i> indicate that the
-     * map contains no mapping for the key; it's also possible that the map
-     * explicitly maps the key to <tt>null</tt>.  The containsKey operation
-     * may be used to distinguish these two cases. <p>
-     *
-     * This implementation iterates over <tt>entrySet()</tt> searching for an
-     * entry with the specified key.  If such an entry is found, the entry's
-     * value is returned.  If the iteration terminates without finding such an
-     * entry, <tt>null</tt> is returned.  Note that this implementation
-     * requires linear time in the size of the map; many implementations will
-     * override this method.
-     *
-     * @param key key whose associated value is to be returned.
-     * @return the value to which this map maps the specified key.
-     *
-     * @throws NullPointerException if the key is <tt>null</tt> and this map
-     *        does not not permit <tt>null</tt> keys.
-     *
-     * @see #containsKey(Object)
-     */
-    public Object get(Object key) {
-        Iterator i = entrySet().iterator();
-        if (key == null) {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (e.getKey() == null)
-                    return e.getValue();
-            }
-        } else {
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (key.equals(e.getKey()))
-                    return e.getValue();
-            }
-        }
-        return null;
-    }
-
-    // Modification Operations
-
-    /**
-     * Associates the specified value with the specified key in this map
-     * (optional operation).  If the map previously contained a mapping for
-     * this key, the old value is replaced.<p>
-     *
-     * This implementation always throws an
-     * <tt>UnsupportedOperationException</tt>.
-     *
-     * @param key key with which the specified value is to be associated.
-     * @param value value to be associated with the specified key.
-     *
-     * @return previous value associated with specified key, or <tt>null</tt>
-     *         if there was no mapping for key.  (A <tt>null</tt> return can
-     *         also indicate that the map previously associated <tt>null</tt>
-     *         with the specified key, if the implementation supports
-     *         <tt>null</tt> values.)
-     *
-     * @throws UnsupportedOperationException if the <tt>put</tt> operation is
-     *            not supported by this map.
-     *
-     * @throws ClassCastException if the class of the specified key or value
-     *            prevents it from being stored in this map.
-     *
-     * @throws IllegalArgumentException if some aspect of this key or value *
-     *            prevents it from being stored in this map.
-     *
-     * @throws NullPointerException this map does not permit <tt>null</tt>
-     *            keys or values, and the specified key or value is
-     *            <tt>null</tt>.
-     */
-    public Object put(Object key, Object value) {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Removes the mapping for this key from this map if present (optional
-     * operation). <p>
-     *
-     * This implementation iterates over <tt>entrySet()</tt> searching for an
-     * entry with the specified key.  If such an entry is found, its value is
-     * obtained with its <tt>getValue</tt> operation, the entry is is removed
-     * from the Collection (and the backing map) with the iterator's
-     * <tt>remove</tt> operation, and the saved value is returned.  If the
-     * iteration terminates without finding such an entry, <tt>null</tt> is
-     * returned.  Note that this implementation requires linear time in the
-     * size of the map; many implementations will override this method.<p>
-     *
-     * Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if the <tt>entrySet</tt> iterator
-     * does not support the <tt>remove</tt> method and this map contains a
-     * mapping for the specified key.
-     *
-     * @param key key whose mapping is to be removed from the map.
-     * @return previous value associated with specified key, or <tt>null</tt>
-     *         if there was no entry for key.  (A <tt>null</tt> return can
-     *         also indicate that the map previously associated <tt>null</tt>
-     *         with the specified key, if the implementation supports
-     *         <tt>null</tt> values.)
-     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
-     *        is not supported by this map.
-     */
-    public Object remove(Object key) {
-        Iterator i = entrySet().iterator();
-        Entry correctEntry = null;
-        if (key == null) {
-            while (correctEntry == null && i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (e.getKey() == null)
-                    correctEntry = e;
-            }
-        } else {
-            while (correctEntry == null && i.hasNext()) {
-                Entry e = (Entry) i.next();
-                if (key.equals(e.getKey()))
-                    correctEntry = e;
-            }
-        }
-
-        Object oldValue = null;
-        if (correctEntry != null) {
-            oldValue = correctEntry.getValue();
-            i.remove();
-        }
-        return oldValue;
-    }
-
-    // Bulk Operations
-
-    /**
-     * Copies all of the mappings from the specified map to this map
-     * (optional operation).  These mappings will replace any mappings that
-     * this map had for any of the keys currently in the specified map.<p>
-     *
-     * This implementation iterates over the specified map's
-     * <tt>entrySet()</tt> collection, and calls this map's <tt>put</tt>
-     * operation once for each entry returned by the iteration.<p>
-     *
-     * Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if this map does not support
-     * the <tt>put</tt> operation and the specified map is nonempty.
-     *
-     * @param t mappings to be stored in this map.
-     *
-     * @throws UnsupportedOperationException if the <tt>putAll</tt> operation
-     *        is not supported by this map.
-     *
-     * @throws ClassCastException if the class of a key or value in the
-     *            specified map prevents it from being stored in this map.
-     *
-     * @throws IllegalArgumentException if some aspect of a key or value in
-     *            the specified map prevents it from being stored in this map.
-     * @throws NullPointerException the specified map is <tt>null</tt>, or if
-     *         this map does not permit <tt>null</tt> keys or values, and the
-     *         specified map contains <tt>null</tt> keys or values.
-     */
-    public void putAll(Map t) {
-        Iterator i = t.entrySet().iterator();
-        while (i.hasNext()) {
-            Entry e = (Entry) i.next();
-            put(e.getKey(), e.getValue());
-        }
-    }
-
-    /**
-     * Removes all mappings from this map (optional operation). <p>
-     *
-     * This implementation calls <tt>entrySet().clear()</tt>.
-     *
-     * Note that this implementation throws an
-     * <tt>UnsupportedOperationException</tt> if the <tt>entrySet</tt>
-     * does not support the <tt>clear</tt> operation.
-     *
-     * @throws    UnsupportedOperationException clear is not supported
-     *        by this map.
-     */
-    public void clear() {
-        entrySet().clear();
-    }
-
-    // Views
-
-    /**
-     * Each of these fields are initialized to contain an instance of the
-     * appropriate view the first time this view is requested.  The views are
-     * stateless, so there's no reason to create more than one of each.
-     */
-    transient volatile Set keySet = null;
-    transient volatile Collection values = null;
-
-    /**
-     * Returns a Set view of the keys contained in this map.  The Set is
-     * backed by the map, so changes to the map are reflected in the Set,
-     * and vice-versa.  (If the map is modified while an iteration over
-     * the Set is in progress, the results of the iteration are undefined.)
-     * The Set supports element removal, which removes the corresponding entry
-     * from the map, via the Iterator.remove, Set.remove,  removeAll
-     * retainAll, and clear operations.  It does not support the add or
-     * addAll operations.<p>
-     *
-     * This implementation returns a Set that subclasses
-     * AbstractSet.  The subclass's iterator method returns a "wrapper
-     * object" over this map's entrySet() iterator.  The size method delegates
-     * to this map's size method and the contains method delegates to this
-     * map's containsKey method.<p>
-     *
-     * The Set is created the first time this method is called,
-     * and returned in response to all subsequent calls.  No synchronization
-     * is performed, so there is a slight chance that multiple calls to this
-     * method will not all return the same Set.
-     *
-     * @return a Set view of the keys contained in this map.
-     */
-    public Set keySet() {
-        if (keySet == null) {
-            keySet = new AbstractSet() {
-                public Iterator iterator() {
-                    return new Iterator() {
-                        private Iterator i = entrySet().iterator();
-
-                        public boolean hasNext() {
-                            return i.hasNext();
-                        }
-
-                        public Object next() {
-                            return ((Entry) i.next()).getKey();
-                        }
-
-                        public void remove() {
-                            i.remove();
-                        }
-                    };
-                }
-
-                public int size() {
-                    return MapBase.this.size();
-                }
-
-                public boolean contains(Object k) {
-                    return MapBase.this.containsKey(k);
-                }
-            };
-        }
-        return keySet;
-    }
-
-    /**
-     * Returns a collection view of the values contained in this map.  The
-     * collection is backed by the map, so changes to the map are reflected in
-     * the collection, and vice-versa.  (If the map is modified while an
-     * iteration over the collection is in progress, the results of the
-     * iteration are undefined.)  The collection supports element removal,
-     * which removes the corresponding entry from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt> and <tt>clear</tt> operations.
-     * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.<p>
-     *
-     * This implementation returns a collection that subclasses abstract
-     * collection.  The subclass's iterator method returns a "wrapper object"
-     * over this map's <tt>entrySet()</tt> iterator.  The size method
-     * delegates to this map's size method and the contains method delegates
-     * to this map's containsValue method.<p>
-     *
-     * The collection is created the first time this method is called, and
-     * returned in response to all subsequent calls.  No synchronization is
-     * performed, so there is a slight chance that multiple calls to this
-     * method will not all return the same Collection.
-     *
-     * @return a collection view of the values contained in this map.
-     */
-    public Collection values() {
-        if (values == null) {
-            values = new AbstractCollection() {
-                public Iterator iterator() {
-                    return new Iterator() {
-                        private Iterator i = entrySet().iterator();
-
-                        public boolean hasNext() {
-                            return i.hasNext();
-                        }
-
-                        public Object next() {
-                            return ((Entry) i.next()).getValue();
-                        }
-
-                        public void remove() {
-                            i.remove();
-                        }
-                    };
-                }
-
-                public int size() {
-                    return MapBase.this.size();
-                }
-
-                public boolean contains(Object v) {
-                    return MapBase.this.containsValue(v);
-                }
-            };
-        }
-        return values;
-    }
-
-    /**
-     * Returns a set view of the mappings contained in this map.  Each element
-     * in this set is a Map.Entry.  The set is backed by the map, so changes
-     * to the map are reflected in the set, and vice-versa.  (If the map is
-     * modified while an iteration over the set is in progress, the results of
-     * the iteration are undefined.)  The set supports element removal, which
-     * removes the corresponding entry from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support
-     * the <tt>add</tt> or <tt>addAll</tt> operations.
-     *
-     * @return a set view of the mappings contained in this map.
-     */
-    public abstract Set entrySet();
-
-    // Comparison and hashing
-
-    /**
-     * Compares the specified object with this map for equality.  Returns
-     * <tt>true</tt> if the given object is also a map and the two maps
-     * represent the same mappings.  More formally, two maps <tt>t1</tt> and
-     * <tt>t2</tt> represent the same mappings if
-     * <tt>t1.keySet().equals(t2.keySet())</tt> and for every key <tt>k</tt>
-     * in <tt>t1.keySet()</tt>, <tt> (t1.get(k)==null ? t2.get(k)==null :
-     * t1.get(k).equals(t2.get(k))) </tt>.  This ensures that the
-     * <tt>equals</tt> method works properly across different implementations
-     * of the map interface.<p>
-     *
-     * This implementation first checks if the specified object is this map;
-     * if so it returns <tt>true</tt>.  Then, it checks if the specified
-     * object is a map whose size is identical to the size of this set; if
-     * not, it it returns <tt>false</tt>.  If so, it iterates over this map's
-     * <tt>entrySet</tt> collection, and checks that the specified map
-     * contains each mapping that this map contains.  If the specified map
-     * fails to contain such a mapping, <tt>false</tt> is returned.  If the
-     * iteration completes, <tt>true</tt> is returned.
-     *
-     * @param o object to be compared for equality with this map.
-     * @return <tt>true</tt> if the specified object is equal to this map.
-     */
-    public boolean equals(Object o) {
-        if (o == this)
-            return true;
-
-        if (!(o instanceof Map))
-            return false;
-        Map t = (Map) o;
-        if (t.size() != size())
-            return false;
-
-        try {
-            Iterator i = entrySet().iterator();
-            while (i.hasNext()) {
-                Entry e = (Entry) i.next();
-                Object key = e.getKey();
-                Object value = e.getValue();
-                if (value == null) {
-                    if (!(t.get(key) == null && t.containsKey(key)))
-                        return false;
-                } else {
-                    if (!value.equals(t.get(key)))
-                        return false;
-                }
-            }
-        } catch (ClassCastException unused) {
-            return false;
-        } catch (NullPointerException unused) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the hash code value for this map.  The hash code of a map is
-     * defined to be the sum of the hash codes of each entry in the map's
-     * <tt>entrySet()</tt> view.  This ensures that <tt>t1.equals(t2)</tt>
-     * implies that <tt>t1.hashCode()==t2.hashCode()</tt> for any two maps
-     * <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of
-     * Object.hashCode.<p>
-     *
-     * This implementation iterates over <tt>entrySet()</tt>, calling
-     * <tt>hashCode</tt> on each element (entry) in the Collection, and adding
-     * up the results.
-     *
-     * @return the hash code value for this map.
-     * @see java.util.Map.Entry#hashCode()
-     * @see Object#hashCode()
-     * @see Object#equals(Object)
-     * @see Set#equals(Object)
-     */
-    public int hashCode() {
-        int h = 0;
-        Iterator i = entrySet().iterator();
-        while (i.hasNext())
-            h += i.next().hashCode();
-        return h;
-    }
-
-    /**
-     * Returns a string representation of this map.  The string representation
-     * consists of a list of key-value mappings in the order returned by the
-     * map's <tt>entrySet</tt> view's iterator, enclosed in braces
-     * (<tt>"{}"</tt>).  Adjacent mappings are separated by the characters
-     * <tt>", "</tt> (comma and space).  Each key-value mapping is rendered as
-     * the key followed by an equals sign (<tt>"="</tt>) followed by the
-     * associated value.  Keys and values are converted to strings as by
-     * <tt>String.valueOf(Object)</tt>.<p>
-     *
-     * This implementation creates an empty string buffer, appends a left
-     * brace, and iterates over the map's <tt>entrySet</tt> view, appending
-     * the string representation of each <tt>map.entry</tt> in turn.  After
-     * appending each entry except the last, the string <tt>", "</tt> is
-     * appended.  Finally a right brace is appended.  A string is obtained
-     * from the stringbuffer, and returned.
-     *
-     * @return a String representation of this map.
-     */
-    public String toString() {
-        StringBuffer buf = new StringBuffer();
-        buf.append("{");
-
-        Iterator i = entrySet().iterator();
-        boolean hasNext = i.hasNext();
-        while (hasNext) {
-            Entry e = (Entry) (i.next());
-            Object key = e.getKey();
-            Object value = e.getValue();
-            buf.append(
-                (key == this ? "(this Map)" : key)
-                    + "="
-                    + (value == this ? "(this Map)" : value));
-
-            hasNext = i.hasNext();
-            if (hasNext)
-                buf.append(", ");
-        }
-
-        buf.append("}");
-        return buf.toString();
-    }
-
-    /**
-     * Returns a shallow copy of this <tt>MapBase</tt> instance: the keys
-     * and values themselves are not cloned.
-     *
-     * @return a shallow copy of this map.
-     */
-    protected Object clone() throws CloneNotSupportedException {
-        MapBase result = (MapBase) super.clone();
-        result.keySet = null;
-        result.values = null;
-        return result;
-    }
-
-    /**
-     * This should be made public as soon as possible.  It greately simplifies
-     * the task of implementing Map.
-     */
-    static class SimpleEntry implements Entry {
-        Object key;
-        Object value;
-
-        public SimpleEntry(Object key, Object value) {
-            this.key = key;
-            this.value = value;
-        }
-
-        public SimpleEntry(Map.Entry e) {
-            this.key = e.getKey();
-            this.value = e.getValue();
-        }
-
-        public Object getKey() {
-            return key;
-        }
-
-        public Object getValue() {
-            return value;
-        }
-
-        public Object setValue(Object value) {
-            Object oldValue = this.value;
-            this.value = value;
-            return oldValue;
-        }
-
-        public boolean equals(Object o) {
-            if (!(o instanceof Map.Entry))
-                return false;
-            Map.Entry e = (Map.Entry) o;
-            return eq(key, e.getKey()) && eq(value, e.getValue());
-        }
-
-        public int hashCode() {
-            Object v;
-            return ((key == null) ? 0 : key.hashCode())
-                ^ ((value == null) ? 0 : value.hashCode());
-        }
-
-        public String toString() {
-            return key + "=" + value;
-        }
-
-        private static boolean eq(Object o1, Object o2) {
-            return (o1 == null ? o2 == null : o1.equals(o2));
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ToolBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ToolBase.java
deleted file mode 100644
index 4d11c85..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/ToolBase.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util;
-
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
-
-/**
- * A base class for command-line tools.
- *
- * @author WS Development Team
- */
-public abstract class ToolBase {
-
-    public ToolBase(OutputStream out, String program) {
-        this.out = out;
-        this.program = program;
-        initialize();
-    }
-
-    protected void initialize() {
-        messageFactory = new LocalizableMessageFactory(getResourceBundleName());
-        localizer = new Localizer();
-    }
-
-    public boolean run(String[] args) {
-        if (!parseArguments(args)) {
-            return false;
-        }
-
-        try {
-            run();
-            return wasSuccessful();
-        } catch (Exception e) {
-            if (e instanceof Localizable) {
-                report((Localizable) e);
-            } else {
-                report(getMessage(getGenericErrorMessage(), e.toString()));
-            }
-            printStackTrace(e);
-            return false;
-        }
-    }
-
-    public boolean wasSuccessful() {
-        return true;
-    }
-
-    protected abstract boolean parseArguments(String[] args);
-    protected abstract void run() throws Exception;
-    public void runProcessorActions() {}
-    protected abstract String getGenericErrorMessage();
-    protected abstract String getResourceBundleName();
-
-    public void printStackTrace(Throwable t) {
-        PrintStream outstream =
-                out instanceof PrintStream
-                        ? (PrintStream) out
-                        : new PrintStream(out, true);
-        t.printStackTrace(outstream);
-        outstream.flush();
-    }
-
-    protected void report(String msg) {
-        PrintStream outstream =
-                out instanceof PrintStream
-                        ? (PrintStream) out
-                        : new PrintStream(out, true);
-        outstream.println(msg);
-        outstream.flush();
-    }
-
-    protected void report(Localizable msg) {
-        report(localizer.localize(msg));
-    }
-
-    public Localizable getMessage(String key) {
-        return getMessage(key, (Object[]) null);
-    }
-
-    public Localizable getMessage(String key, String arg) {
-        return messageFactory.getMessage(key, new Object[] { arg });
-    }
-
-    public Localizable getMessage(String key, String arg1, String arg2) {
-        return messageFactory.getMessage(key, new Object[] { arg1, arg2 });
-    }
-
-    public Localizable getMessage(
-        String key,
-        String arg1,
-        String arg2,
-        String arg3) {
-        return messageFactory.getMessage(
-                key,
-                new Object[] { arg1, arg2, arg3 });
-    }
-
-    public Localizable getMessage(String key, Localizable localizable) {
-        return messageFactory.getMessage(key, new Object[] { localizable });
-    }
-
-    public Localizable getMessage(String key, Object[] args) {
-        return messageFactory.getMessage(key, args);
-    }
-
-    protected OutputStream out;
-    protected String program;
-    protected Localizer localizer;
-    protected LocalizableMessageFactory messageFactory;
-
-    protected final static String TRUE = "true";
-    protected final static String FALSE = "false";
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSDLParseException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSDLParseException.java
index 059f746..2cc8c92 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSDLParseException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSDLParseException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.tools.internal.ws.util;
 
 import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
 
 /**
   * @author WS Development Team
@@ -41,7 +40,7 @@
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.util";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java
index 42c8bc45..7f3ff8e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
 package com.sun.tools.internal.ws.util;
 
 import com.sun.tools.internal.ws.spi.WSToolsObjectFactory;
-import com.sun.tools.internal.ws.wscompile.CompileTool;
+import com.sun.tools.internal.ws.wscompile.WsgenTool;
+import com.sun.tools.internal.ws.wscompile.WsimportTool;
+import com.sun.xml.internal.ws.api.server.Container;
+
 import java.io.OutputStream;
 
 /**
@@ -36,14 +39,14 @@
 public class WSToolsObjectFactoryImpl extends WSToolsObjectFactory {
 
     @Override
-    public boolean wsimport(OutputStream logStream, String[] args) {
-        CompileTool tool = new CompileTool(logStream, "wsimport");
+    public boolean wsimport(OutputStream logStream, Container container, String[] args) {
+        WsimportTool tool = new WsimportTool(logStream, container);
         return tool.run(args);
     }
 
     @Override
-    public boolean wsgen(OutputStream logStream, String[] args) {
-        CompileTool tool = new CompileTool(logStream, "wsgen");
+    public boolean wsgen(OutputStream logStream, Container container, String[] args) {
+        WsgenTool tool = new WsgenTool(logStream, container);
         return tool.run(args);
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NodeListIterator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NodeListIterator.java
deleted file mode 100644
index d7f504e..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NodeListIterator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util.xml;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.w3c.dom.NodeList;
-
-/**
- * @author WS Development Team
- */
-public class NodeListIterator implements Iterator {
-
-    protected NodeList _list;
-    protected int _index;
-
-    public NodeListIterator(NodeList list) {
-        _list = list;
-        _index = 0;
-    }
-
-    public boolean hasNext() {
-        if (_list == null)
-            return false;
-        return _index < _list.getLength();
-    }
-
-    public Object next() throws NoSuchElementException {
-        if (_list.getLength() == 0)
-            throw new NoSuchElementException();
-        Object obj = _list.item(_index);
-        if (obj != null)
-            ++_index;
-        return obj;
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NullEntityResolver.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NullEntityResolver.java
deleted file mode 100644
index 6378e64..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/NullEntityResolver.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util.xml;
-
-import java.io.StringReader;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/**
- * @author WS Development Team
- */
-public class NullEntityResolver implements EntityResolver {
-
-    public NullEntityResolver() {
-    }
-
-    public InputSource resolveEntity(String publicId, String systemId) {
-        // always resolve to an empty document
-        return new InputSource(new StringReader(""));
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/PrettyPrintingXmlWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/PrettyPrintingXmlWriter.java
deleted file mode 100644
index d128876..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/PrettyPrintingXmlWriter.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util.xml;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-import com.sun.xml.internal.ws.util.xml.CDATA;
-
-// ## Delay IOExceptions until flush or close
-// ## Need DOM, SAX output
-
-/**
- * A writer of XML output streams.
- *
- * <p> An XML writer knows hardly anything about XML document well-formedness,
- * to say nothing of validity.  It relies upon the invoker to ensure that the
- * generated document is well-formed and, if required, valid.
- *
- *
- * @author WS Development Team
- */
-
-public class PrettyPrintingXmlWriter {
-
-    private static final boolean shouldPrettyprint = true;
-
-    private BufferedWriter out;
-
-    private PrettyPrintingXmlWriter(OutputStreamWriter w, boolean declare)
-        throws IOException {
-        // XXX-NOTE - set the buffer size to 1024 here
-        this.out = new BufferedWriter(w, 1024);
-        String enc = w.getEncoding();
-
-        /* Work around bogus canonical encoding names */
-        if (enc.equals("UTF8"))
-            enc = "UTF-8";
-        else if (enc.equals("ASCII"))
-            enc = "US-ASCII";
-
-        if (declare) {
-            out.write("<?xml version=\"1.0\" encoding=\"" + enc + "\"?>");
-            out.newLine();
-            needNewline = true;
-        }
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the given encoding.  An initial XML declaration will optionally be
-     * written to the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @param  enc
-     *         The character encoding to be used
-     *
-     * @param  declare
-     *         If <tt>true</tt>, write the XML declaration to the output stream
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     *
-     * @throws  UnsupportedEncodingException
-     *          If the named encoding is not supported
-     */
-    public PrettyPrintingXmlWriter(
-        OutputStream out,
-        String enc,
-        boolean declare)
-        throws UnsupportedEncodingException, IOException {
-        this(new OutputStreamWriter(out, enc), declare);
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the given encoding.  An initial XML declaration will be written to
-     * the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @param  enc
-     *         The character encoding to be used
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     *
-     * @throws  UnsupportedEncodingException
-     *          If the named encoding is not supported
-     */
-    public PrettyPrintingXmlWriter(OutputStream out, String enc)
-        throws UnsupportedEncodingException, IOException {
-        this(new OutputStreamWriter(out, enc), true);
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the UTF-8 encoding.  An initial XML declaration will be written to
-     * the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public PrettyPrintingXmlWriter(OutputStream out) throws IOException {
-        this(new OutputStreamWriter(out, "UTF-8"), true);
-    }
-
-    private char quoteChar = '"';
-
-    /**
-     * Sets the quote character to be used by this writer when writing
-     * attribute values.  </p>
-     *
-     * @param  quote  The new quote character, either a
-     *                <small>QUOTATION MARK</small> (<tt>'&#92;u0022'</tt>),
-     *                or an <small>APOSTROPHE-QUOTE</small>
-     *                (<tt>'&#92;u0027'</tt>)
-     *
-     * @throws  IllegalArgumentException
-     *          If the argument is neither of the above characters
-     */
-    public void setQuote(char quote) {
-        if (quote != '"' && quote != '\'')
-            throw new IllegalArgumentException(
-                "Illegal quote character: " + quote);
-        quoteChar = quote;
-    }
-
-    // Quote a character
-    private void quote(char c) throws IOException {
-        switch (c) {
-            case '&' :
-                out.write("&amp;");
-                break;
-            case '<' :
-                out.write("&lt;");
-                break;
-            case '>' :
-                out.write("&gt;");
-                break;
-            default :
-                out.write(c);
-                break;
-        }
-    }
-
-    // Quote a character in an attribute value
-    private void aquote(char c) throws IOException {
-        switch (c) {
-            case '\'' :
-                if (quoteChar == c)
-                    out.write("&apos;");
-                else
-                    out.write(c);
-                break;
-            case '"' :
-                if (quoteChar == c)
-                    out.write("&quot;");
-                else
-                    out.write(c);
-                break;
-            default :
-                quote(c);
-                break;
-        }
-    }
-
-    //
-    private void nonQuote(char c) throws IOException {
-        out.write(c);
-    }
-
-    // Quote a string containing character data
-    private void quote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            quote(s.charAt(i));
-    }
-
-    /* Allowing support for CDATA */
-    private void nonQuote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            nonQuote(s.charAt(i));
-    }
-
-    // Quote a string containing an attribute value
-    private void aquote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            aquote(s.charAt(i));
-    }
-
-    private void indent(int depth) throws IOException {
-        for (int i = 0; i < depth; i++)
-            out.write("  ");
-    }
-
-    // Formatting state
-    private int depth = 0;
-    private boolean inStart = false;
-    private boolean needNewline = false;
-    private boolean writtenChars = false;
-    private boolean inAttribute = false;
-    private boolean inAttributeValue = false;
-
-    /**
-     * Writes a DOCTYPE declaration.  </p>
-     *
-     * @param  root  The name of the root element
-     *
-     * @param  dtd   The URI of the document-type definition
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void doctype(String root, String dtd) throws IOException {
-        if (shouldPrettyprint && needNewline)
-            out.newLine();
-        needNewline = true;
-        out.write("<!DOCTYPE " + root + " SYSTEM " + quoteChar);
-        quote(dtd);
-        out.write(quoteChar + ">");
-        if (shouldPrettyprint)
-            out.newLine();
-    }
-
-    private void start0(String name) throws IOException {
-        finishStart();
-        if (shouldPrettyprint && !writtenChars) {
-            needNewline = true;
-            indent(depth);
-        }
-        out.write('<');
-        out.write(name);
-        inStart = true;
-        writtenChars = false;
-        depth++;
-    }
-
-    private void start1(String name) throws IOException {
-        finishStart();
-        if (shouldPrettyprint && !writtenChars) {
-            if (needNewline)
-                out.newLine();
-            needNewline = true;
-            indent(depth);
-        }
-        out.write('<');
-        out.write(name);
-        inStart = true;
-        writtenChars = false;
-        depth++;
-    }
-
-    private void finishStart() throws IOException {
-        if (inStart) {
-            if (inAttribute)
-                out.write(quoteChar);
-            out.write('>');
-            inStart = false;
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-    }
-
-    /**
-     * Writes a start tag for the named element.  </p>
-     *
-     * @param  name  The name to be used in the start tag
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void start(String name) throws IOException {
-        start1(name);
-    }
-
-    /**
-     * Writes an attribute for the current element.  </p>
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attribute(String name, String value) throws IOException {
-        attributeName(name);
-        attributeValue(value);
-    }
-
-    /**
-     * Writes an attribute (unquoted) for the current element.  </p>
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attributeUnquoted(String name, String value)
-        throws IOException {
-        attributeName(name);
-        attributeValueUnquoted(value);
-    }
-
-    /**
-     * Writes an attribute for the current element.  </p>
-     *
-     * @param  prefix  The attribute's prefix
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attribute(String prefix, String name, String value)
-        throws IOException {
-        attributeName(prefix, name);
-        attributeValue(value);
-    }
-
-    /**
-     * Writes an attribute (unquoted) for the current element.  </p>
-     *
-     * @param  prefix  The attribute's prefix
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attributeUnquoted(String prefix, String name, String value)
-        throws IOException {
-        attributeName(prefix, name);
-        attributeValueUnquoted(value);
-    }
-
-    /**
-     * Writes an attribute name for the current element.  After invoking this
-     * method, invoke the {@link #attributeValue attributeValue} method to
-     * write the attribute value, or invoke the {@link #attributeValueToken
-     * attributeValueToken} method to write one or more space-separated value
-     * tokens.  </p>
-     *
-     * @param   name  The attribute's name
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     */
-    public void attributeName(String name) throws IOException {
-        if (!inStart)
-            throw new IllegalStateException();
-        if (inAttribute) {
-            out.write(quoteChar);
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-        out.write(' ');
-        out.write(name);
-        out.write('=');
-        out.write(quoteChar);
-        inAttribute = true;
-    }
-
-    /**
-     * Writes an attribute name for the current element.  After invoking this
-     * method, invoke the {@link #attributeValue attributeValue} method to
-     * write the attribute value, or invoke the {@link #attributeValueToken
-     * attributeValueToken} method to write one or more space-separated value
-     * tokens.  </p>
-     *
-     * @param   prefix The attribute's prefix
-     * @param   name  The attribute's name
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     */
-    public void attributeName(String prefix, String name) throws IOException {
-        if (!inStart)
-            throw new IllegalStateException();
-        if (inAttribute) {
-            out.write(quoteChar);
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-        out.write(' ');
-        out.write(prefix);
-        out.write(':');
-        out.write(name);
-        out.write('=');
-        out.write(quoteChar);
-        inAttribute = true;
-    }
-
-    /**
-     * Writes a value for the current attribute.  </p>
-     *
-     * @param   value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was not
-     *          {@link #attributeName attributeName}
-     */
-    public void attributeValue(String value) throws IOException {
-        if (!inAttribute || inAttributeValue)
-            throw new IllegalStateException();
-        aquote(value);
-        out.write(quoteChar);
-        inAttribute = false;
-    }
-
-    /**
-     * Writes a value (unquoted) for the current attribute.  </p>
-     *
-     * @param   value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was not
-     *          {@link #attributeName attributeName}
-     */
-    public void attributeValueUnquoted(String value) throws IOException {
-        if (!inAttribute || inAttributeValue)
-            throw new IllegalStateException();
-        out.write(value, 0, value.length());
-        out.write(quoteChar);
-        inAttribute = false;
-    }
-
-    /**
-     * Writes one token of the current attribute's value.  Adjacent tokens will
-     * be separated by single space characters.  </p>
-     *
-     * @param   token  The token to be written
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #attributeName attributeName} nor
-     *          {@link #attributeValueToken attributeValueToken}
-     */
-    public void attributeValueToken(String token) throws IOException {
-        if (!inAttribute)
-            throw new IllegalStateException();
-        if (inAttributeValue)
-            out.write(' ');
-        aquote(token);
-        inAttributeValue = true;
-    }
-
-    /**
-     * Writes an end tag for the named element.  </p>
-     *
-     * @param  name  The name to be used in the end tag
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void end(String name) throws IOException {
-        if (inStart) {
-            if (inAttribute)
-                out.write(quoteChar);
-            out.write("/>");
-            inStart = false;
-            inAttribute = false;
-            inAttributeValue = false;
-        } else {
-            out.write("</");
-            out.write(name);
-            out.write('>');
-        }
-        depth--;
-        writtenChars = false;
-    }
-
-    /**
-     * Writes some character data.  </p>
-     *
-     * @param  chars  The character data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void chars(String chars) throws IOException {
-        finishStart();
-        quote(chars);
-        writtenChars = true;
-    }
-
-    public void chars(CDATA chars) throws IOException {
-        finishStart();
-        nonQuote(chars.getText());
-        writtenChars = true;
-    }
-
-    /**
-     * Writes some character data, skipping quoting.  </p>
-     *
-     * @param  chars  The character data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void charsUnquoted(String chars) throws IOException {
-        finishStart();
-        out.write(chars, 0, chars.length());
-        writtenChars = true;
-    }
-
-    /**
-     * Writes some character data, skipping quoting.  </p>
-     *
-     * @param  buf   Buffer containing the character data to be written
-     * @param  off    The offset of the data to be written
-     * @param  len    The length of the data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void charsUnquoted(char[] buf, int off, int len)
-        throws IOException {
-        finishStart();
-        out.write(buf, off, len);
-        writtenChars = true;
-    }
-
-    /**
-     * Writes a leaf element with the given character content.  </p>
-     *
-     * @param name  ame to be used in the start and end tags
-     *
-     * @param chars  character data to be written
-     *
-     * <p> This method writes a start tag with the given name, followed by the
-     * given character data, followed by an end tag.  If the <tt>chars</tt>
-     * parameter is <tt>null</tt> or the empty string then an empty tag is
-     * written.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void leaf(String name, String chars) throws IOException {
-        start1(name);
-        if ((chars != null) && (chars.length() != 0))
-            chars(chars);
-        end(name);
-    }
-
-    public void inlineLeaf(String name, String chars) throws IOException {
-        start0(name);
-        if ((chars != null) && (chars.length() != 0))
-            chars(chars);
-        end(name);
-    }
-
-    /**
-     * Writes an empty leaf element.  </p>
-     *
-     * @param  name name to be used in the empty-element tag
-     */
-    public void leaf(String name) throws IOException {
-        leaf(name, null);
-    }
-
-    public void inlineLeaf(String name) throws IOException {
-        inlineLeaf(name, null);
-    }
-
-    /**
-     * Flushes the writer.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void flush() throws IOException {
-        if (depth != 0)
-            throw new IllegalStateException("Nonzero depth");
-        // if (shouldPrettyprint)
-        out.newLine();
-        out.flush();
-    }
-
-    /**
-     * Flushes the writer and closes the underlying byte-output stream.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void close() throws IOException {
-        flush();
-        out.close();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java
index b1e40e7..c4d4ae0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,32 +25,8 @@
 
 package com.sun.tools.internal.ws.util.xml;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
 import com.sun.tools.internal.ws.util.WSDLParseException;
-import com.sun.xml.internal.ws.util.xml.NamedNodeMapIterator;
-import com.sun.xml.internal.ws.util.xml.NodeListIterator;
+import org.w3c.dom.Element;
 
 /**
  * @author WS Development Team
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlWriter.java
deleted file mode 100644
index e846f04..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/util/xml/XmlWriter.java
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.util.xml;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-
-import com.sun.xml.internal.ws.util.xml.CDATA;
-
-// ## Delay IOExceptions until flush or close
-// ## Need DOM, SAX output
-
-/**
- * A writer of XML output streams.
- *
- * <p> An XML writer knows hardly anything about XML document well-formedness,
- * to say nothing of validity.  It relies upon the invoker to ensure that the
- * generated document is well-formed and, if required, valid.
- *
- *
- * @author WS Development Team
- */
-
-public class XmlWriter {
-
-    private static final boolean shouldPrettyprint = false;
-
-    private BufferedWriter out;
-
-    private XmlWriter(OutputStreamWriter w, boolean declare)
-        throws IOException {
-        // XXX-NOTE - set the buffer size to 1024 here
-        this.out = new BufferedWriter(w, 1024);
-        String enc = w.getEncoding();
-
-        /* Work around bogus canonical encoding names */
-        if (enc.equals("UTF8"))
-            enc = "UTF-8";
-        else if (enc.equals("ASCII"))
-            enc = "US-ASCII";
-
-        if (declare) {
-            out.write("<?xml version=\"1.0\" encoding=\"" + enc + "\"?>");
-            out.newLine();
-            needNewline = true;
-        }
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the given encoding.  An initial XML declaration will optionally be
-     * written to the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @param  enc
-     *         The character encoding to be used
-     *
-     * @param  declare
-     *         If <tt>true</tt>, write the XML declaration to the output stream
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     *
-     * @throws  UnsupportedEncodingException
-     *          If the named encoding is not supported
-     */
-    public XmlWriter(OutputStream out, String enc, boolean declare)
-        throws UnsupportedEncodingException, IOException {
-        this(new OutputStreamWriter(out, enc), declare);
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the given encoding.  An initial XML declaration will be written to
-     * the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @param  enc
-     *         The character encoding to be used
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     *
-     * @throws  UnsupportedEncodingException
-     *          If the named encoding is not supported
-     */
-    public XmlWriter(OutputStream out, String enc)
-        throws UnsupportedEncodingException, IOException {
-        this(new OutputStreamWriter(out, enc), true);
-    }
-
-    /**
-     * Creates a new writer that will write to the given byte-output stream
-     * using the UTF-8 encoding.  An initial XML declaration will be written to
-     * the stream.  </p>
-     *
-     * @param  out
-     *         The target byte-output stream
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public XmlWriter(OutputStream out) throws IOException {
-        this(new OutputStreamWriter(out, "UTF-8"), true);
-    }
-
-    private char quoteChar = '"';
-
-    /**
-     * Sets the quote character to be used by this writer when writing
-     * attribute values.  </p>
-     *
-     * @param  quote  The new quote character, either a
-     *                <small>QUOTATION MARK</small> (<tt>'&#92;u0022'</tt>),
-     *                or an <small>APOSTROPHE-QUOTE</small>
-     *                (<tt>'&#92;u0027'</tt>)
-     *
-     * @throws  IllegalArgumentException
-     *          If the argument is neither of the above characters
-     */
-    public void setQuote(char quote) {
-        if (quote != '"' && quote != '\'')
-            throw new IllegalArgumentException(
-                "Illegal quote character: " + quote);
-        quoteChar = quote;
-    }
-
-    // Quote a character
-    private void quote(char c) throws IOException {
-        switch (c) {
-            case '&' :
-                out.write("&amp;");
-                break;
-            case '<' :
-                out.write("&lt;");
-                break;
-            case '>' :
-                out.write("&gt;");
-                break;
-            default :
-                out.write(c);
-                break;
-        }
-    }
-
-    //
-    private void nonQuote(char c) throws IOException {
-        out.write(c);
-    }
-
-    // Quote a character in an attribute value
-    private void aquote(char c) throws IOException {
-        switch (c) {
-            case '\'' :
-                if (quoteChar == c)
-                    out.write("&apos;");
-                else
-                    out.write(c);
-                break;
-            case '"' :
-                if (quoteChar == c)
-                    out.write("&quot;");
-                else
-                    out.write(c);
-                break;
-            default :
-                quote(c);
-                break;
-        }
-    }
-
-    // Quote a string containing character data
-    private void quote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            quote(s.charAt(i));
-    }
-
-    /* Allowing support for CDATA */
-    private void nonQuote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            nonQuote(s.charAt(i));
-    }
-
-    // Quote a string containing an attribute value
-    private void aquote(String s) throws IOException {
-        for (int i = 0; i < s.length(); i++)
-            aquote(s.charAt(i));
-    }
-
-    private void indent(int depth) throws IOException {
-        for (int i = 0; i < depth; i++)
-            out.write("  ");
-    }
-
-    // Formatting state
-    private int depth = 0;
-    private boolean inStart = false;
-    private boolean needNewline = false;
-    private boolean writtenChars = false;
-    private boolean inAttribute = false;
-    private boolean inAttributeValue = false;
-
-    /**
-     * Writes a DOCTYPE declaration.  </p>
-     *
-     * @param  root  The name of the root element
-     *
-     * @param  dtd   The URI of the document-type definition
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void doctype(String root, String dtd) throws IOException {
-        if (shouldPrettyprint && needNewline)
-            out.newLine();
-        needNewline = true;
-        out.write("<!DOCTYPE " + root + " SYSTEM " + quoteChar);
-        quote(dtd);
-        out.write(quoteChar + ">");
-        if (shouldPrettyprint)
-            out.newLine();
-    }
-
-    private void start0(String name) throws IOException {
-        finishStart();
-        if (shouldPrettyprint && !writtenChars) {
-            needNewline = true;
-            indent(depth);
-        }
-        out.write('<');
-        out.write(name);
-        inStart = true;
-        writtenChars = false;
-        depth++;
-    }
-
-    private void start1(String name) throws IOException {
-        finishStart();
-        if (shouldPrettyprint && !writtenChars) {
-            if (needNewline)
-                out.newLine();
-            needNewline = true;
-            indent(depth);
-        }
-        out.write('<');
-        out.write(name);
-        inStart = true;
-        writtenChars = false;
-        depth++;
-    }
-
-    private void finishStart() throws IOException {
-        if (inStart) {
-            if (inAttribute)
-                out.write(quoteChar);
-            out.write('>');
-            inStart = false;
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-    }
-
-    /**
-     * Writes a start tag for the named element.  </p>
-     *
-     * @param  name  The name to be used in the start tag
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void start(String name) throws IOException {
-        start1(name);
-    }
-
-    /**
-     * Writes an attribute for the current element.  </p>
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attribute(String name, String value) throws IOException {
-        attributeName(name);
-        attributeValue(value);
-    }
-
-    /**
-     * Writes an attribute (unquoted) for the current element.  </p>
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attributeUnquoted(String name, String value)
-        throws IOException {
-        attributeName(name);
-        attributeValueUnquoted(value);
-    }
-
-    /**
-     * Writes an attribute for the current element.  </p>
-     *
-     * @param  prefix  The attribute's prefix
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attribute(String prefix, String name, String value)
-        throws IOException {
-        attributeName(prefix, name);
-        attributeValue(value);
-    }
-
-    /**
-     * Writes an attribute (unquoted) for the current element.  </p>
-     *
-     * @param  prefix  The attribute's prefix
-     *
-     * @param  name  The attribute's name
-     *
-     * @param  value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void attributeUnquoted(String prefix, String name, String value)
-        throws IOException {
-        attributeName(prefix, name);
-        attributeValueUnquoted(value);
-    }
-
-    /**
-     * Writes an attribute name for the current element.  After invoking this
-     * method, invoke the {@link #attributeValue attributeValue} method to
-     * write the attribute value, or invoke the {@link #attributeValueToken
-     * attributeValueToken} method to write one or more space-separated value
-     * tokens.  </p>
-     *
-     * @param   name  The attribute's name
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     */
-    public void attributeName(String name) throws IOException {
-        if (!inStart)
-            throw new IllegalStateException();
-        if (inAttribute) {
-            out.write(quoteChar);
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-        out.write(' ');
-        out.write(name);
-        out.write('=');
-        out.write(quoteChar);
-        inAttribute = true;
-    }
-
-    /**
-     * Writes an attribute name for the current element.  After invoking this
-     * method, invoke the {@link #attributeValue attributeValue} method to
-     * write the attribute value, or invoke the {@link #attributeValueToken
-     * attributeValueToken} method to write one or more space-separated value
-     * tokens.  </p>
-     *
-     * @param   prefix The attribute's prefix
-     * @param   name  The attribute's name
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #start start} nor {@link #attribute attribute}
-     */
-    public void attributeName(String prefix, String name) throws IOException {
-        if (!inStart)
-            throw new IllegalStateException();
-        if (inAttribute) {
-            out.write(quoteChar);
-            inAttribute = false;
-            inAttributeValue = false;
-        }
-        out.write(' ');
-        out.write(prefix);
-        out.write(':');
-        out.write(name);
-        out.write('=');
-        out.write(quoteChar);
-        inAttribute = true;
-    }
-
-    /**
-     * Writes a value for the current attribute.  </p>
-     *
-     * @param   value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was not
-     *          {@link #attributeName attributeName}
-     */
-    public void attributeValue(String value) throws IOException {
-        if (!inAttribute || inAttributeValue)
-            throw new IllegalStateException();
-        aquote(value);
-        out.write(quoteChar);
-        inAttribute = false;
-    }
-
-    /**
-     * Writes a value (unquoted) for the current attribute.  </p>
-     *
-     * @param   value  The attribute's value
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was not
-     *          {@link #attributeName attributeName}
-     */
-    public void attributeValueUnquoted(String value) throws IOException {
-        if (!inAttribute || inAttributeValue)
-            throw new IllegalStateException();
-        out.write(value, 0, value.length());
-        out.write(quoteChar);
-        inAttribute = false;
-    }
-
-    /**
-     * Writes one token of the current attribute's value.  Adjacent tokens will
-     * be separated by single space characters.  </p>
-     *
-     * @param   token  The token to be written
-     *
-     * @throws  IllegalStateException
-     *          If the previous method invoked upon this object was neither
-     *          {@link #attributeName attributeName} nor
-     *          {@link #attributeValueToken attributeValueToken}
-     */
-    public void attributeValueToken(String token) throws IOException {
-        if (!inAttribute)
-            throw new IllegalStateException();
-        if (inAttributeValue)
-            out.write(' ');
-        aquote(token);
-        inAttributeValue = true;
-    }
-
-    /**
-     * Writes an end tag for the named element.  </p>
-     *
-     * @param  name  The name to be used in the end tag
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void end(String name) throws IOException {
-        if (inStart) {
-            if (inAttribute)
-                out.write(quoteChar);
-            out.write("/>");
-            inStart = false;
-            inAttribute = false;
-            inAttributeValue = false;
-        } else {
-            out.write("</");
-            out.write(name);
-            out.write('>');
-        }
-        depth--;
-        writtenChars = false;
-    }
-
-    /**
-     * Writes some character data.  </p>
-     *
-     * @param  chars  The character data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void chars(String chars) throws IOException {
-        finishStart();
-        quote(chars);
-        writtenChars = true;
-    }
-
-    public void chars(CDATA chars) throws IOException {
-        finishStart();
-        nonQuote(chars.getText());
-        writtenChars = true;
-    }
-
-    /**
-     * Writes some character data, skipping quoting.  </p>
-     *
-     * @param  chars  The character data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void charsUnquoted(String chars) throws IOException {
-        finishStart();
-        out.write(chars, 0, chars.length());
-        writtenChars = true;
-    }
-
-    /**
-     * Writes some character data, skipping quoting.  </p>
-     *
-     * @param  buf   Buffer containing the character data to be written
-     * @param  off    The offset of the data to be written
-     * @param  len    The length of the data to be written
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void charsUnquoted(char[] buf, int off, int len)
-        throws IOException {
-        finishStart();
-        out.write(buf, off, len);
-        writtenChars = true;
-    }
-
-    /**
-     * Writes a leaf element with the given character content.  </p>
-     *
-     * @param  name  The name to be used in the start and end tags
-     *
-     * @param  chars  The character data to be written
-     *
-     * <p> This method writes a start tag with the given name, followed by the
-     * given character data, followed by an end tag.  If the <tt>chars</tt>
-     * parameter is <tt>null</tt> or the empty string then an empty tag is
-     * written.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void leaf(String name, String chars) throws IOException {
-        start1(name);
-        if ((chars != null) && (chars.length() != 0))
-            chars(chars);
-        end(name);
-    }
-
-    public void inlineLeaf(String name, String chars) throws IOException {
-        start0(name);
-        if ((chars != null) && (chars.length() != 0))
-            chars(chars);
-        end(name);
-    }
-
-    /**
-     * Writes an empty leaf element.  </p>
-     *
-     * @param name name to be used in the empty-element tag
-     */
-    public void leaf(String name) throws IOException {
-        leaf(name, null);
-    }
-
-    public void inlineLeaf(String name) throws IOException {
-        inlineLeaf(name, null);
-    }
-
-    /**
-     * Flushes the writer.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void flush() throws IOException {
-        if (depth != 0)
-            // throw new IllegalStateException("Nonzero depth");
-            // if (shouldPrettyprint)
-            out.newLine();
-        out.flush();
-    }
-
-    /**
-     * Flushes the writer and closes the underlying byte-output stream.  </p>
-     *
-     * @throws  IOException
-     *          If an I/O error occurs
-     */
-    public void close() throws IOException {
-        flush();
-        out.close();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/share/classes/com/sun/tools/internal/ws/version.properties
index b269810..27f0f70 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/version.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/version.properties
@@ -1,3 +1,29 @@
-build-id=b08
-build-version=JAX-WS RI 2.0_02-b08-fcs
-major-version=2.0_02
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+build-id=JAX-WS RI 2.1.1
+build-version=JAX-WS RI 2.1.1
+major-version=2.1.1
+ 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/AbortException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/AbortException.java
new file mode 100644
index 0000000..bc0f896
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/AbortException.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+/**
+ * @author Vivek Pandey
+ */
+/**
+ * Signals the abortion of the compilation.
+ * <p>
+ * This exception should be only thrown from {@link ErrorReceiver}
+ * for the consistent error handling.
+ *
+ * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ */
+public class AbortException extends RuntimeException {
+    public AbortException() {
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ActionConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ActionConstants.java
deleted file mode 100644
index a91f6f7..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ActionConstants.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.wscompile;
-
-/**
- * @author WS Development Team
- */
-public interface ActionConstants {
-//    public static final String ACTION_SERVICE_INTERFACE_GENERATOR =
-//        "service.interface.generator";
-    public static final String ACTION_SERVICE_GENERATOR =
-        "service.generator";
-    public static final String ACTION_REMOTE_INTERFACE_GENERATOR  =
-        "remote.interface.impl.generator";
-    public static final String ACTION_REMOTE_INTERFACE_IMPL_GENERATOR  =
-        "remote.interface.impl.generator";
-    public static final String ACTION_JAXB_TYPE_GENERATOR =
-        "jaxb.type.generator";
-    public static final String ACTION_CUSTOM_EXCEPTION_GENERATOR =
-        "custom.exception.generator";
-    public static final String ACTION_WSDL_GENERATOR =
-        "wsdl.generator";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java
new file mode 100644
index 0000000..2380ef0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.istack.internal.Nullable;
+
+/**
+ * @author Vivek Pandey
+ */
+public class BadCommandLineException extends Exception {
+    private Options options;
+
+    public BadCommandLineException(String msg) {
+        super(msg);
+    }
+
+    public BadCommandLineException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public BadCommandLineException() {
+        this(null);
+    }
+
+    public void initOptions(Options opt) {
+        assert this.options==null;
+        this.options = opt;
+    }
+
+    /**
+     * Gets the partly parsed option object, if any.
+     */
+    public @Nullable
+    Options getOptions() {
+        return options;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/CompileTool.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/CompileTool.java
deleted file mode 100644
index 9110e85..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/CompileTool.java
+++ /dev/null
@@ -1,967 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.tools.internal.ws.wscompile;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.mirror.declaration.AnnotationTypeDeclaration;
-import com.sun.tools.internal.ws.processor.Processor;
-import com.sun.tools.internal.ws.processor.ProcessorAction;
-import com.sun.tools.internal.ws.processor.ProcessorConstants;
-import com.sun.tools.internal.ws.processor.ProcessorNotificationListener;
-import com.sun.tools.internal.ws.processor.ProcessorOptions;
-import com.sun.tools.internal.ws.processor.config.ClassModelInfo;
-import com.sun.tools.internal.ws.processor.config.Configuration;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
-import com.sun.tools.internal.ws.processor.config.parser.Reader;
-import com.sun.tools.internal.ws.processor.generator.CustomExceptionGenerator;
-import com.sun.tools.internal.ws.processor.generator.SeiGenerator;
-import com.sun.tools.internal.ws.processor.model.Model;
-import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext;
-import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP;
-import com.sun.tools.internal.ws.processor.util.ClientProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironmentBase;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.util.JavaCompilerHelper;
-import com.sun.tools.internal.ws.util.ToolBase;
-import com.sun.tools.internal.ws.util.ForkEntityResolver;
-import com.sun.tools.internal.ws.ToolVersion;
-import com.sun.xml.internal.ws.util.VersionUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.Holder;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.xml.sax.EntityResolver;
-
-/**
- *    This is the real implementation class for both WsGen and WsImport.
- *
- *    <P>If the program being executed is WsGen, the CompileTool acts as an
- *    {@link com.sun.mirror.apt.AnnotationProcessorFactory AnnotationProcessorFactory}
- *    and uses {@link com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP
- *    WebServiceAP} as the {@link com.sun.mirror.apt.AnnotationProcessor
- *    AnnotationProcessor} for the APT framework.  In this case APT takes control
- *    while processing the SEI passed to WsGen.  The APT framework then invokes the
- *    WebServiceAP to process classes that contain javax.jws.* annotations.
- *    WsGen uses the APT reflection library to process the SEI and to generate any
- *    JAX-WS spec mandated Java beans.
- *
- *    <p>If the program being executed is WsImport, the CompileTool creates a
- *    {@link com.sun.tools.internal.ws.processor.Processor  Processor} to help with the
- *    processing.  First the {@link com.sun.tools.internal.ws.processor.Processor#runModeler()
- *    Processor.runModeler()} method is called to create an instance of the
- *    {@link com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler WSDLModeler} to
- *    process the WSDL being imported, which intern processes the WSDL and creates
- *    a {@link com.sun.tools.internal.ws.processor.model.Model Model} that is returned to the
- *    Processor.  The CompileTool then registers a number of
- *    {@link com.sun.tools.internal.ws.processor.ProcessorAction ProcessorActions} with the
- *    Processor.  Some of these ProcessorActions include
- *    the {@link com.sun.tools.internal.ws.processor.generator.CustomExceptionGenerator
- *    CustomExceptionGenerator} to generate Exception classes,
- *    the {@link com.sun.tools.internal.ws.processor.generator.JAXBTypeGenerator
- *    JAXBTypeGenerator} to generate JAXB types,
- *    the {@link com.sun.tools.internal.ws.processor.generator.ServiceGenerator
- *    ServiceGenerator} to generate the Service interface, and
- *    the {@link com.sun.tools.internal.ws.processor.generator.SeiGenerator
- *    RemoteInterfaceGenerator} to generate the service endpoint interface.
- *    The CompileTool then invokes the {@link com.sun.tools.internal.ws.processor.Processor#runActions()
- *    Processor.runActions()} method to cause these ProcessorActions to run.
- *    Once the ProcessorActions have been run, the CompileTool will invoke javac
- *    to compile any classes generated by the  ProcessorActions.
- *
- * @author WS Development Team
- *
- */
-public class CompileTool extends ToolBase implements ProcessorNotificationListener,
-        AnnotationProcessorFactory {
-
-    public CompileTool(OutputStream out, String program) {
-        super(out, program);
-        listener = this;
-    }
-
-    protected boolean parseArguments(String[] args) {
-        for (int i = 0; i < args.length; i++) {
-            if (args[i].equals("")) {
-                args[i] = null;
-            } else if (args[i].equals("-g")) {
-                compilerDebug = true;
-                args[i] = null;
-            } /*else if (args[i].equals("-O")) {
-                compilerOptimize = true;
-                args[i] = null;
-            }*/ else if (args[i].equals("-verbose")) {
-                verbose = true;
-                args[i] = null;
-            } else if (args[i].equals("-b")) {
-                if(program.equals(WSGEN)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i] = null;
-                    String file = args[++i];
-                    args[i] = null;
-                    bindingFiles.add(JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(file)));
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", "-b"));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals("-version")) {
-                report(ToolVersion.VERSION.BUILD_VERSION);
-                doNothing = true;
-                args[i] = null;
-                return true;
-            } else if (args[i].equals("-keep")) {
-                keepGenerated = true;
-                args[i] = null;
-            } else if(args[i].equals("-wsdllocation")){
-                if(program.equals(WSGEN)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i]=null;
-                    wsdlLocation = args[++i];
-                    args[i]=null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-            } else if(args[i].equals("-p")){
-                if(program.equals(WSGEN)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i]=null;
-                    defaultPackage = args[++i];
-                    args[i]=null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-            }else if(args[i].equals("-catalog")){
-                if(program.equals(WSGEN)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i]=null;
-                    catalog = args[++i];
-                    args[i]=null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-            }else if (args[i].equals(SERVICENAME_OPTION)) {
-                if(program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i] = null;
-                    serviceName = QName.valueOf(args[++i]);
-                    if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) {
-                        onError(getMessage("wsgen.servicename.missing.namespace", args[i]));
-                        usage();
-                        return false;
-                    }
-                    if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) {
-                        onError(getMessage("wsgen.servicename.missing.localname", args[i]));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals(PORTNAME_OPTION)) {
-                if(program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    args[i] = null;
-                    portName = QName.valueOf(args[++i]);
-                    if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) {
-                        onError(getMessage("wsgen.portname.missing.namespace", args[i]));
-                        usage();
-                        return false;
-                    }
-                    if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) {
-                        onError(getMessage("wsgen.portname.missing.localname", args[i]));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals("-d")) {
-                if ((i + 1) < args.length) {
-                    if (destDir != null) {
-                        onError(getMessage("wscompile.duplicateOption", "-d"));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                    destDir = new File(args[++i]);
-                    args[i] = null;
-                    if (!destDir.exists()) {
-                        onError(getMessage("wscompile.noSuchDirectory", destDir.getPath()));
-                        usage();
-                        return false;
-                    }
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", "-d"));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals("-r")) {
-                if (program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    if (nonclassDestDir != null) {
-                        onError(getMessage("wscompile.duplicateOption", "-r"));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                    nonclassDestDir = new File(args[++i]);
-                    args[i] = null;
-                    if (!nonclassDestDir.exists()) {
-                        onError(getMessage("wscompile.noSuchDirectory", nonclassDestDir.getPath()));
-                        usage();
-                        return false;
-                    }
-                } else {
-                onError(getMessage("wscompile.missingOptionArgument", "-r"));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals("-s")) {
-                if ((i + 1) < args.length) {
-                    if (sourceDir != null) {
-                        onError(getMessage("wscompile.duplicateOption", "-s"));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                    sourceDir = new File(args[++i]);
-                    args[i] = null;
-                    if (!sourceDir.exists()) {
-                        onError(getMessage("wscompile.noSuchDirectory", sourceDir.getPath()));
-                        usage();
-                        return false;
-                    }
-                    keepGenerated = true;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", "-s"));
-                    usage();
-                    return false;
-                }
-            } else if (args[i].equals("-classpath") || args[i].equals("-cp")) {
-                if (program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                if ((i + 1) < args.length) {
-                    if (userClasspath != null) {
-                        onError(getMessage("wscompile.duplicateOption", args[i]));
-                        usage();
-                        return false;
-                    }
-                    args[i] = null;
-                    userClasspath = args[++i];
-                    args[i] = null;
-                } else {
-                    onError(getMessage("wscompile.missingOptionArgument", args[i]));
-                    usage();
-                    return false;
-                }
-
-            } else if (args[i].startsWith("-httpproxy:")) {
-                if(program.equals(WSGEN)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                String value = args[i].substring(11);
-                if (value.length() == 0) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                int index = value.indexOf(':');
-                if (index == -1) {
-                    System.setProperty("proxySet", TRUE);
-                    System.setProperty("proxyHost", value);
-                    System.setProperty("proxyPort", "8080");
-                } else {
-                    System.setProperty("proxySet", TRUE);
-                    System.setProperty("proxyHost", value.substring(0, index));
-                    System.setProperty("proxyPort", value.substring(index + 1));
-                }
-                args[i] = null;
-            } else if (args[i].startsWith("-wsdl")) {
-                if (program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                genWsdl = true;
-                String value = args[i].substring(5);
-                int index = value.indexOf(':');
-                if (index == 0) {
-                    value = value.substring(1);
-                    index = value.indexOf('/');
-                    if (index == -1) {
-                        protocol = value;
-                        transport = HTTP;
-                    } else {
-                        protocol = value.substring(0, index);
-                        transport = value.substring(index + 1);
-                    }
-                    if (!isValidProtocol(protocol)) {
-                        onError(getMessage("wsgen.invalid.protocol", protocol, VALID_PROTOCOLS));
-                    }
-                    protocolSet = true;
-                    if (!isValidTransport(transport)) {
-                        onError(getMessage("wsgen.invalid.transport", transport, VALID_TRANSPORTS));
-                    }
-                }
-                args[i] = null;
-            } else if (args[i].equals("-extension")) {
-                extensions = true;
-                args[i] = null;
-            } else if (args[i].startsWith("-help")) {
-                help();
-                return false;
-            } else if (args[i].equals("-Xdonotoverwrite")) {
-                if(program.equals(WSIMPORT)) {
-                    onError(getMessage("wscompile.invalidOption", args[i]));
-                    usage();
-                    return false;
-                }
-                doNotOverWrite = true;
-                args[i] = null;
-            }
-        }
-
-        for (String arg : args) {
-            if (arg != null) {
-                if (arg.startsWith("-")) {
-                    onError(getMessage("wscompile.invalidOption", arg));
-                    usage();
-                    return false;
-                }
-
-                // the input source could be a local file or a URL,get the
-                // abolutized URL string
-                String fileName = arg;
-                if (program.equals(WSGEN)) {
-                    if (!isValidWSGenClass(fileName))
-                        return false;
-                }
-                inputFiles.add(fileName);
-            }
-        }
-
-        if (inputFiles.isEmpty()) {
-            onError(getMessage(program+".missingFile"));
-            usage();
-            return false;
-        }
-        if (!extensions && hasExtensions())
-            return false;
-
-        // put jaxws and jaxb binding files
-        properties.put(ProcessorOptions.BINDING_FILES, bindingFiles);
-        if (!validateArguments()) {
-            usage();
-            return false;
-        }
-        return true;
-    }
-
-    protected boolean isValidWSGenClass(String className) {
-        Class clazz = getClass(className);
-        if (clazz == null) {
-            onError(getMessage("wsgen.class.not.found", className));
-            return false;
-        }
-        if (clazz.isEnum() || clazz.isInterface() ||
-            clazz.isPrimitive()) {
-            onError(getMessage("wsgen.class.must.be.implementation.class", className));
-            return false;
-        }
-        if (genWsdl) {
-            BindingImpl binding = (BindingImpl)BindingImpl.getBinding(null, clazz, null, false);
-            if (!(binding instanceof SOAPBinding)) {
-                onError(getMessage("wsgen.cannot.gen.wsdl.for.non.soap.binding",
-                        new Object[] {className, binding.getBindingId()}));
-                return false;
-            }
-            SOAPBindingImpl soapBinding = (SOAPBindingImpl)binding;
-            if ((soapBinding.getActualBindingId().equals(SOAPBinding.SOAP12HTTP_BINDING) ||
-                soapBinding.getActualBindingId().equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) &&
-                    !(protocol.equals(X_SOAP12) && extensions)) {
-                onError(getMessage("wsgen.cannot.gen.wsdl.for.soap12.binding",
-                        new Object[] {className, binding.getBindingId()}));
-                return false;
-            }
-            if (soapBinding.getActualBindingId().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING) &&
-                !extensions) {
-                onError(getMessage("wsgen.cannot.gen.wsdl.for.xsoap12.binding.wo.extention",
-                        new Object[] {className, binding.getBindingId()}));
-                return false;
-            }
-        }
-        return true;
-    }
-
-    protected boolean validateArguments() {
-        if (!genWsdl) {
-            if (serviceName != null) {
-                onError(getMessage("wsgen.wsdl.arg.no.genwsdl", SERVICENAME_OPTION));
-                return false;
-            }
-            if (portName != null) {
-                onError(getMessage("wsgen.wsdl.arg.no.genwsdl", PORTNAME_OPTION));
-                return false;
-            }
-        }
-        return true;
-    }
-
-    protected boolean hasExtensions() {
-        if (protocol.equalsIgnoreCase(X_SOAP12)) {
-            onError(getMessage("wsgen.soap12.without.extension"));
-            return true;
-        }
-        return false;
-    }
-
-
-    static public boolean isValidProtocol(String protocol) {
-        return (protocol.equalsIgnoreCase(SOAP11) ||
-                protocol.equalsIgnoreCase(X_SOAP12));
-    }
-
-    static public boolean isValidTransport(String transport) {
-        return (transport.equalsIgnoreCase(HTTP));
-    }
-
-    protected void run() throws Exception {
-        if (doNothing) {
-            return;
-        }
-        try {
-            beforeHook();
-            if(entityResolver == null){
-                if(catalog != null && catalog.length() > 0)
-                    entityResolver = XmlUtil.createEntityResolver(JAXWSUtils.getFileOrURL(catalog));
-            }else if(catalog != null && catalog.length() > 0){
-                EntityResolver er = XmlUtil.createEntityResolver(JAXWSUtils.getFileOrURL(catalog));
-                entityResolver =  new ForkEntityResolver(er, entityResolver);
-            }
-            environment = createEnvironment();
-            configuration = createConfiguration();
-            setEnvironmentValues(environment);
-            if (configuration.getModelInfo() instanceof ClassModelInfo) {
-                buildModel(((ClassModelInfo) configuration.getModelInfo()).getClassName());
-            } else {
-                processor = new Processor(configuration, properties);
-                configuration.getModelInfo().setEntityResolver(entityResolver);
-                configuration.getModelInfo().setDefaultJavaPackage(defaultPackage);
-                processor.runModeler();
-                withModelHook();
-                registerProcessorActions(processor);
-                processor.runActions();
-                if (environment.getErrorCount() == 0) {
-                    compileGeneratedClasses();
-                }
-            }
-            afterHook();
-        } finally {
-            if (!keepGenerated) {
-                removeGeneratedFiles();
-            }
-            if (environment != null) {
-                environment.shutdown();
-            }
-        }
-    }
-
-    protected void setEnvironmentValues(ProcessorEnvironment env) {
-        int envFlags = env.getFlags();
-        envFlags |= ProcessorEnvironment.F_WARNINGS;
-        if (verbose) {
-            envFlags |= ProcessorEnvironment.F_VERBOSE;
-        }
-        env.setFlags(envFlags);
-    }
-
-    protected void initialize() {
-        super.initialize();
-        properties = new Properties();
-        actions = new HashMap<String,ProcessorAction>();
-        actions.put(ActionConstants.ACTION_SERVICE_GENERATOR,
-                new com.sun.tools.internal.ws.processor.generator.ServiceGenerator());
-        actions.put(ActionConstants.ACTION_REMOTE_INTERFACE_GENERATOR,
-                new SeiGenerator());
-        actions.put(ActionConstants.ACTION_CUSTOM_EXCEPTION_GENERATOR,
-                new CustomExceptionGenerator());
-        actions.put(ActionConstants.ACTION_JAXB_TYPE_GENERATOR,
-                new com.sun.tools.internal.ws.processor.generator.JAXBTypeGenerator());
-    }
-
-    public void removeGeneratedFiles() {
-        environment.deleteGeneratedFiles();
-    }
-
-    public void buildModel(String endpoint) {
-        context = new AnnotationProcessorContext();
-        webServiceAP = new WebServiceAP(this, environment, properties, context);
-
-        String classpath = environment.getClassPath();
-
-        String[] args = new String[8];
-        args[0] = "-d";
-        args[1] = destDir.getAbsolutePath();
-        args[2] = "-classpath";
-        args[3] = classpath;
-        args[4] = "-s";
-        args[5] = sourceDir.getAbsolutePath();
-        args[6] = "-XclassesAsDecls";
-        args[7] = endpoint;
-
-        int result = com.sun.tools.apt.Main.process(this, args);
-        if (result != 0) {
-            environment.error(getMessage("wscompile.compilationFailed"));
-            return;
-        }
-        if (genWsdl) {
-            String tmpPath = destDir.getAbsolutePath()+File.pathSeparator+classpath;
-            ClassLoader classLoader = new URLClassLoader(ProcessorEnvironmentBase.pathToURLs(tmpPath),
-                    this.getClass().getClassLoader());
-            Class<?> endpointClass = null;
-
-            try {
-                endpointClass = classLoader.loadClass(endpoint);
-            } catch (ClassNotFoundException e) {
-                // this should never happen
-                environment.error(getMessage("wsgen.class.not.found", endpoint));
-            }
-            String bindingID = getBindingID(protocol);
-            if (!protocolSet) {
-                BindingImpl binding = (BindingImpl)BindingImpl.getBinding(null,
-                                                    endpointClass, null, false);
-                bindingID = binding.getBindingId();
-            }
-            com.sun.xml.internal.ws.modeler.RuntimeModeler rtModeler =
-                    new com.sun.xml.internal.ws.modeler.RuntimeModeler(endpointClass, serviceName, bindingID);
-            rtModeler.setClassLoader(classLoader);
-            if (portName != null)
-                rtModeler.setPortName(portName);
-            com.sun.xml.internal.ws.model.RuntimeModel rtModel = rtModeler.buildRuntimeModel();
-            WSDLGenerator wsdlGenerator = new WSDLGenerator(rtModel,
-                    new com.sun.xml.internal.ws.wsdl.writer.WSDLOutputResolver() {
-                        public Result getWSDLOutput(String suggestedFilename) {
-                            File wsdlFile =
-                                new File(nonclassDestDir, suggestedFilename);
-
-                            Result result = new StreamResult();
-                            try {
-                                result = new StreamResult(new FileOutputStream(wsdlFile));
-                                result.setSystemId(wsdlFile.toString().replace('\\', '/'));
-                            } catch (FileNotFoundException e) {
-                                environment.error(getMessage("wsgen.could.not.create.file", wsdlFile.toString()));
-                            }
-                            return result;
-                        }
-                        public Result getSchemaOutput(String namespace, String suggestedFilename) {
-                            if (namespace.equals(""))
-                                return null;
-                            return getWSDLOutput(suggestedFilename);
-                        }
-                        public Result getAbstractWSDLOutput(Holder<String> filename) {
-                            return getWSDLOutput(filename.value);
-                        }
-                        public Result getSchemaOutput(String namespace, Holder<String> filename) {
-                            return getSchemaOutput(namespace, filename.value);
-                        }
-                    }, bindingID);
-            wsdlGenerator.doGeneration();
-        }
-    }
-
-    static public String getBindingID(String protocol) {
-        if (protocol.equals(SOAP11))
-            return SOAP11_ID;
-        if (protocol.equals(X_SOAP12))
-            return SOAP12_ID;
-        return null;
-    }
-
-    public void runProcessorActions() {
-        if (!(configuration.getModelInfo() instanceof ClassModelInfo)) {
-            onError(getMessage("wscompile.classmodelinfo.expected", new Object[] { configuration
-                    .getModelInfo() }));
-            return;
-        }
-        Model model = context.getSEIContext(
-                ((ClassModelInfo) configuration.getModelInfo()).getClassName()).getModel();
-        processor = new Processor(configuration, properties, model);
-        withModelHook();
-        registerProcessorActions(processor);
-        processor.runActions();
-       // TODO throw an error
-//        if (environment.getErrorCount() != 0) {
-//        }
-
-    }
-    /**
-     * @return the SourceVersion string
-     */
-    protected String getSourceVersion() {
-        if (targetVersion == null) {
-
-            /* no target specified, defaulting to the default version,
-             * which is the latest version
-             */
-            return VersionUtil.JAXWS_VERSION_DEFAULT;
-        }
-        return targetVersion;
-    }
-
-    protected void withModelHook() {
-    }
-
-    protected void afterHook() {
-    }
-
-    protected void compileGeneratedClasses() {
-        List<String> sourceFiles = new ArrayList<String>();
-
-        for (Iterator iter = environment.getGeneratedFiles(); iter.hasNext();) {
-            GeneratedFileInfo fileInfo = (GeneratedFileInfo) iter.next();
-            File f = fileInfo.getFile();
-            if (f.exists() && f.getName().endsWith(".java")) {
-                sourceFiles.add(f.getAbsolutePath());
-            }
-        }
-
-        if (sourceFiles.size() > 0) {
-            String classDir = destDir.getAbsolutePath();
-            String classpathString = createClasspathString();
-            String[] args = new String[4 + (compilerDebug ? 1 : 0)
-                    + (compilerOptimize ? 1 : 0) + sourceFiles.size()];
-            args[0] = "-d";
-            args[1] = classDir;
-            args[2] = "-classpath";
-            args[3] = classpathString;
-            int baseIndex = 4;
-            if (compilerDebug) {
-                args[baseIndex++] = "-g";
-            }
-            if (compilerOptimize) {
-                args[baseIndex++] = "-O";
-            }
-            for (int i = 0; i < sourceFiles.size(); ++i) {
-                args[baseIndex + i] = sourceFiles.get(i);
-            }
-
-            // ByteArrayOutputStream javacOutput = new ByteArrayOutputStream();
-            JavaCompilerHelper compilerHelper = new JavaCompilerHelper(out);
-            boolean result = compilerHelper.compile(args);
-            if (!result) {
-                environment.error(getMessage("wscompile.compilationFailed"));
-            }
-        }
-    }
-
-    protected ProcessorAction getAction(String name) {
-        return actions.get(name);
-    }
-
-    protected String createClasspathString() {
-        if (userClasspath == null) {
-            userClasspath = "";
-        }
-        return userClasspath + File.pathSeparator + System.getProperty("java.class.path");
-    }
-
-    protected void registerProcessorActions(Processor processor) {
-        register(processor);
-    }
-
-    protected void register(Processor processor) {
-        boolean genServiceInterface = false;
-        boolean genInterface = false;
-        boolean genCustomClasses = false;
-
-        if (configuration.getModelInfo() instanceof WSDLModelInfo) {
-            genInterface = true;
-            //genInterfaceTemplate = true;
-            genServiceInterface = true;
-            genCustomClasses = true;
-        }
-
-        if (genServiceInterface) {
-            processor.add(getAction(ActionConstants.ACTION_SERVICE_GENERATOR));
-        }
-
-        if (genCustomClasses) {
-            processor.add(getAction(ActionConstants.ACTION_JAXB_TYPE_GENERATOR));
-        }
-
-        if (genInterface) {
-            processor.add(getAction(ActionConstants.ACTION_CUSTOM_EXCEPTION_GENERATOR));
-            processor.add(getAction(ActionConstants.ACTION_REMOTE_INTERFACE_GENERATOR));
-        }
-    }
-
-    protected Configuration createConfiguration() throws Exception {
-        if (environment == null)
-            environment = createEnvironment();
-        Reader reader = new Reader(environment, properties);
-        return reader.parse(entityResolver, inputFiles);
-    }
-
-    protected void beforeHook() {
-        if (destDir == null) {
-            destDir = new File(".");
-        }
-        if (sourceDir == null) {
-            sourceDir = destDir;
-        }
-        if (nonclassDestDir == null) {
-            nonclassDestDir = destDir;
-        }
-
-        properties.setProperty(ProcessorOptions.SOURCE_DIRECTORY_PROPERTY, sourceDir
-                .getAbsolutePath());
-        properties.setProperty(ProcessorOptions.DESTINATION_DIRECTORY_PROPERTY, destDir
-                .getAbsolutePath());
-        properties.setProperty(ProcessorOptions.NONCLASS_DESTINATION_DIRECTORY_PROPERTY,
-                nonclassDestDir.getAbsolutePath());
-        properties.setProperty(ProcessorOptions.EXTENSION, (extensions ? "true" : "false"));
-        properties.setProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY,
-                (verbose ? TRUE : FALSE));
-        properties.setProperty(ProcessorOptions.PROTOCOL, protocol);
-        properties.setProperty(ProcessorOptions.TRANSPORT, transport);
-        properties.setProperty(ProcessorOptions.JAXWS_SOURCE_VERSION, getSourceVersion());
-        if(wsdlLocation != null)
-            properties.setProperty(ProcessorOptions.WSDL_LOCATION, wsdlLocation);
-        if(defaultPackage != null)
-            properties.setProperty(ProcessorOptions.DEFAULT_PACKAGE, defaultPackage);
-        properties.setProperty(ProcessorOptions.DONOT_OVERWRITE_CLASSES, (doNotOverWrite ? TRUE : FALSE));
-    }
-
-    protected String getGenericErrorMessage() {
-        return "wscompile.error";
-    }
-
-    protected String getResourceBundleName() {
-        return "com.sun.tools.internal.ws.resources.wscompile";
-    }
-
-    public Collection<String> supportedOptions() {
-        return supportedOptions;
-    }
-
-    public Collection<String> supportedAnnotationTypes() {
-        return supportedAnnotations;
-    }
-
-    public void onError(Localizable msg) {
-        report(getMessage("wscompile.error", localizer.localize(msg)));
-    }
-
-    public void onWarning(Localizable msg) {
-        report(getMessage("wscompile.warning", localizer.localize(msg)));
-    }
-
-    public void onInfo(Localizable msg) {
-        report(getMessage("wscompile.info", localizer.localize(msg)));
-    }
-
-    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
-            AnnotationProcessorEnvironment apEnv) {
-        if (verbose)
-            apEnv.getMessager().printNotice("\tap round: " + ++round);
-        webServiceAP.init(apEnv);
-        return webServiceAP;
-    }
-
-    private Class getClass(String className) {
-        try {
-            ProcessorEnvironment env = createEnvironment();
-            return env.getClassLoader().loadClass(className);
-        } catch (ClassNotFoundException e) {
-            return null;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    private ProcessorEnvironment createEnvironment() throws Exception {
-        String cpath = userClasspath + File.pathSeparator + System.getProperty("java.class.path");
-        ProcessorEnvironment env = new ClientProcessorEnvironment(System.out, cpath, listener);
-        return env;
-    }
-
-    protected void usage() {
-        help();
-        //report(getMessage(program+".usage", program));
-    }
-
-    protected void help() {
-        report(getMessage(program+".help", program));
-        report(getMessage(program+".usage.examples"));
-    }
-
-    public void setEntityResolver(EntityResolver entityResolver) {
-        this.entityResolver = entityResolver;
-    }
-
-    /*
-     * Processor doesn't examine any options.
-     */
-    static final Collection<String> supportedOptions = Collections
-            .unmodifiableSet(new HashSet<String>());
-
-    /*
-     * All annotation types are supported.
-     */
-    static Collection<String> supportedAnnotations;
-    static {
-        Collection<String> types = new HashSet<String>();
-        types.add("*");
-        types.add("javax.jws.*");
-        types.add("javax.jws.soap.*");
-        supportedAnnotations = Collections.unmodifiableCollection(types);
-    }
-
-    private AnnotationProcessorContext context;
-
-    private WebServiceAP webServiceAP;
-
-    private int round = 0;
-
-    // End AnnotationProcessorFactory stuff
-    // -----------------------------------------------------------------------------
-
-    protected Properties properties;
-    protected ProcessorEnvironment environment;
-    protected Configuration configuration;
-    protected ProcessorNotificationListener listener;
-    protected Processor processor;
-    protected Map<String,ProcessorAction> actions;
-    protected List<String> inputFiles = new ArrayList<String>();
-    protected File sourceDir;
-    protected File destDir;
-    protected File nonclassDestDir;
-    protected boolean doNothing = false;
-    protected boolean compilerDebug = false;
-    protected boolean compilerOptimize = false;
-    protected boolean verbose = false;
-    protected boolean keepGenerated = false;
-    protected boolean doNotOverWrite = false;
-    protected boolean extensions = false;
-    protected String userClasspath = null;
-    protected Set<String> bindingFiles = new HashSet<String>();
-    protected boolean genWsdl = false;
-    protected String protocol = SOAP11;
-    protected boolean protocolSet = false;
-    protected String transport = HTTP;
-    protected static final String SOAP11 = "soap1.1";
-    protected static final String X_SOAP12 = "Xsoap1.2";
-    protected static final String HTTP   = "http";
-    protected static final String WSIMPORT = "wsimport";
-    protected static final String WSGEN    = "wsgen";
-    protected static final String SOAP11_ID = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING;
-    protected static final String SOAP12_ID = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING;
-    protected static final String VALID_PROTOCOLS = SOAP11 +", "+X_SOAP12;
-    protected static final String VALID_TRANSPORTS = "http";
-    protected String  targetVersion = null;
-    protected String wsdlLocation;
-    protected String defaultPackage;
-    protected String catalog;
-    protected QName serviceName;
-    protected QName portName;
-    protected static final String PORTNAME_OPTION = "-portname";
-    protected static final String SERVICENAME_OPTION = "-servicename";
-    protected EntityResolver entityResolver;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java
new file mode 100644
index 0000000..5798f95
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.ws.resources.ModelMessages;
+import com.sun.tools.internal.xjc.api.ErrorListener;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Implemented by the driver of the compiler engine to handle
+ * errors found during the compiliation.
+ *
+ * <p>
+ * This class implements {@link org.xml.sax.ErrorHandler} so it can be
+ * passed to anywhere where {@link org.xml.sax.ErrorHandler} is expected.
+ *
+ * <p>
+ * However, to make the error handling easy (and make it work
+ * with visitor patterns nicely),
+ * none of the methods on thi class throws {@link org.xml.sax.SAXException}.
+ * Instead, when the compilation needs to be aborted,
+ * it throws {@link AbortException}, which is unchecked.
+ *
+ * <p>
+ * This also implements the externally visible {@link com.sun.tools.internal.xjc.api.ErrorListener}
+ * so that we can reuse our internal implementation for testing and such.
+ *
+ * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @author Vivek Pandey
+ */
+public abstract class ErrorReceiver  implements ErrorHandler, ErrorListener {
+
+//
+//
+// convenience methods for callers
+//
+//
+    /**
+     * @param loc
+     *      can be null if the location is unknown
+     */
+    public final void error( Locator loc, String msg ) {
+        error( new SAXParseException2(msg,loc) );
+    }
+
+    public final void error( Locator loc, String msg, Exception e ) {
+        error( new SAXParseException2(msg,loc,e) );
+    }
+
+    public final void error( String msg, Exception e ) {
+        error( new SAXParseException2(msg,null,e) );
+    }
+
+    public void error(Exception e) {
+        error(e.getMessage(),e);
+    }
+
+    /**
+     * Reports a warning.
+     */
+    public final void warning( @Nullable Locator loc, String msg ) {
+        warning( new SAXParseException(msg,loc) );
+    }
+
+//
+//
+// ErrorHandler implementation, but can't throw SAXException
+//
+//
+    public abstract void error(SAXParseException exception) throws AbortException;
+    public abstract void fatalError(SAXParseException exception) throws AbortException;
+    public abstract void warning(SAXParseException exception) throws AbortException;
+
+    /**
+     * This method will be invoked periodically to allow {@link com.sun.tools.internal.xjc.AbortException}
+     * to be thrown, especially when this is driven by some kind of GUI.
+     */
+    public void pollAbort() throws AbortException {
+    }
+
+
+    /**
+     * Reports verbose messages to users.
+     *
+     * This method can be used to report additional non-essential
+     * messages. The implementation usually discards them
+     * unless some specific debug option is turned on.
+     */
+    public abstract void info(SAXParseException exception) /*REVISIT:throws AbortException*/;
+
+    /**
+     * Reports a debug message to users.
+     *
+     * @see #info(SAXParseException)
+     */
+    public final void debug( String msg ) {
+        info( new SAXParseException(msg,null) );
+    }
+
+//
+//
+// convenience methods for derived classes
+//
+//
+
+  /**
+   * Returns the human readable string representation of the
+   * {@link org.xml.sax.Locator} part of the specified
+   * {@link SAXParseException}.
+   *
+   * @return  non-null valid object.
+   */
+  protected final String getLocationString( SAXParseException e ) {
+      if(e.getLineNumber()!=-1 || e.getSystemId()!=null) {
+          int line = e.getLineNumber();
+          return ModelMessages.CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(line==-1?"?":Integer.toString( line ),
+              getShortName( e.getSystemId()));
+      } else {
+          return ModelMessages.CONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION();
+      }
+  }
+
+  /** Computes a short name of a given URL for display. */
+  private String getShortName( String url ) {
+      if(url==null)
+          return ModelMessages.CONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION();
+      return url;
+  }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java
new file mode 100644
index 0000000..e5516e1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.tools.internal.xjc.api.ErrorListener;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Filter implementation of the ErrorReceiver.
+ *
+ * If an error is encountered, this filter sets a flag.
+ *
+ * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @author Vivek Pandey
+ */
+public class ErrorReceiverFilter extends ErrorReceiver {
+
+    public ErrorReceiverFilter() {}
+
+    public ErrorReceiverFilter( ErrorListener h ) {
+        setErrorReceiver(h);
+    }
+
+    private ErrorListener core;
+    public void setErrorReceiver( ErrorListener handler ) {
+        core = handler;
+    }
+
+    private boolean hadError = false;
+    public final boolean hadError() { return hadError; }
+
+    /**
+     * Resets the error state its currently in. It allows to ignore the error reported by
+     * any sub-system.
+     */
+    public void reset(){
+        hadError = false;
+    }
+
+    public void info(SAXParseException exception) {
+        if(core!=null)  core.info(exception);
+    }
+
+    public void warning(SAXParseException exception) {
+        if(core!=null)  core.warning(exception);
+    }
+
+    public void error(SAXParseException exception) {
+        hadError = true;
+        if(core!=null)  core.error(exception);
+    }
+
+    public void fatalError(SAXParseException exception) {
+        hadError = true;
+        if(core!=null)  core.fatalError(exception);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java
index c6bbcca..de57d82 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,19 +24,13 @@
  */
 package com.sun.tools.internal.ws.wscompile;
 
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-import com.sun.codemodel.internal.CodeWriter;
 import com.sun.codemodel.internal.JPackage;
-import java.io.BufferedOutputStream;
-
 import com.sun.mirror.apt.Filer;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
 /**
  * Writes all the source files using the specified Filer.
  *
@@ -49,9 +43,9 @@
 
     private Writer w;
 
-    public FilerCodeWriter(File outDir, ProcessorEnvironment env ) throws IOException {
-        super(outDir, env);
-        this.filer = env.getFiler();
+    public FilerCodeWriter(File outDir, WsgenOptions options) throws IOException {
+        super(outDir, options);
+        this.filer = options.filer;
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java
new file mode 100644
index 0000000..ea7a3dc
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.istack.internal.tools.ParallelWorldClassLoader;
+import com.sun.tools.internal.ws.resources.JavacompilerMessages;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * A helper class to invoke javac.
+ *
+ * @author WS Development Team
+ */
+class JavaCompilerHelper{
+    static File getJarFile(Class clazz) {
+        try {
+            URL url = ParallelWorldClassLoader.toJarUrl(clazz.getResource('/'+clazz.getName().replace('.','/')+".class"));
+            return new File(url.getPath());   // this code is assuming that url is a file URL
+        } catch (ClassNotFoundException e) {
+            // if we can't figure out where JAXB/JAX-WS API are, we couldn't have been executing this code.
+            throw new Error(e);
+        } catch (MalformedURLException e) {
+            // if we can't figure out where JAXB/JAX-WS API are, we couldn't have been executing this code.
+            throw new Error(e);
+        }
+    }
+
+    static boolean compile(String[] args, OutputStream out, ErrorReceiver receiver){
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        try {
+            /* try to use the new compiler */
+            Class comSunToolsJavacMainClass =
+                    cl.loadClass("com.sun.tools.javac.Main");
+            try {
+                Method compileMethod =
+                        comSunToolsJavacMainClass.getMethod(
+                                "compile",
+                                compileMethodSignature);
+                    Object result =
+                            compileMethod.invoke(
+                                    null, args, new PrintWriter(out));
+                    return result instanceof Integer && (Integer) result == 0;
+            } catch (NoSuchMethodException e2) {
+                receiver.error(JavacompilerMessages.JAVACOMPILER_NOSUCHMETHOD_ERROR("getMethod(\"compile\", Class[])"), e2);
+            } catch (IllegalAccessException e) {
+                receiver.error(e);
+            } catch (InvocationTargetException e) {
+                receiver.error(e);
+            }
+        } catch (ClassNotFoundException e) {
+            receiver.error(JavacompilerMessages.JAVACOMPILER_CLASSPATH_ERROR("com.sun.tools.javac.Main"), e);
+        } catch (SecurityException e) {
+            receiver.error(e);
+        }
+        return false;
+    }
+
+    private static final Class[] compileMethodSignature = {String[].class, PrintWriter.class};
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/Options.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/Options.java
new file mode 100644
index 0000000..6cf0549
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/Options.java
@@ -0,0 +1,385 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * Provide common jaxws tool options.
+ *
+ * @author Vivek Pandey
+ */
+public class Options {
+    /**
+     * -verbose
+     */
+    public boolean verbose;
+
+    /**
+     * - quite
+     */
+    public boolean quiet;
+
+    /**
+     * -keep
+     */
+    public boolean keep;
+
+
+
+    /**
+     * -d
+     */
+    public File destDir = new File(".");
+
+
+    /**
+     * -s
+     */
+    public File sourceDir;
+
+    public String classpath = System.getProperty("java.class.path");
+
+
+    /**
+     * -Xnocompile
+     */
+    public boolean nocompile;
+
+    public enum Target {
+        V2_0, V2_1;
+
+        /**
+         * Returns true if this version is equal or later than the given one.
+         */
+        public boolean isLaterThan(Target t) {
+            return this.ordinal() >= t.ordinal();
+        }
+
+        /**
+         * Parses "2.0" and "2.1" into the {@link Target} object.
+         *
+         * @return null for parsing failure.
+         */
+        public static Target parse(String token) {
+            if (token.equals("2.0"))
+                return Target.V2_0;
+            else if (token.equals("2.1"))
+                return Target.V2_1;
+            return null;
+        }
+
+        /**
+         * Gives the String representation of the {@link Target}
+         */
+        public String getVersion(){
+            switch(this){
+            case V2_0:
+                return "2.0";
+            case V2_1:
+                return "2.1";
+            default:
+                return null;
+            }
+        }
+    }
+
+    public Target target = Target.V2_1;
+
+    /**
+     * strictly follow the compatibility rules specified in JAXWS spec
+     */
+    public static final int STRICT = 1;
+
+    /**
+     * loosely follow the compatibility rules and allow the use of vendor
+     * binding extensions
+     */
+    public static final int EXTENSION = 2;
+
+    /**
+     * this switch determines how carefully the compiler will follow
+     * the compatibility rules in the spec. Either <code>STRICT</code>
+     * or <code>EXTENSION</code>.
+     */
+    public int compatibilityMode = STRICT;
+
+    public boolean isExtensionMode() {
+        return compatibilityMode == EXTENSION;
+    }
+
+    /**
+     * Target direcoty when producing files.
+     */
+    public File targetDir = new File(".");
+
+
+
+    public boolean debug = false;
+    public boolean debugMode = false;
+
+
+    private final List<File> generatedFiles = new ArrayList<File>();
+    private ClassLoader classLoader;
+
+
+    /**
+     * Remember info on  generated source file generated so that it
+     * can be removed later, if appropriate.
+     */
+    public void addGeneratedFile(File file) {
+        generatedFiles.add(file);
+    }
+
+    /**
+     * Remove generated files
+     */
+    public void removeGeneratedFiles(){
+        for(File file : generatedFiles){
+            if (file.getName().endsWith(".java")) {
+                file.delete();
+            }
+        }
+        generatedFiles.clear();
+    }
+
+    /**
+     * Return all the generated files and its types.
+     */
+    public Iterable<File> getGeneratedFiles() {
+        return generatedFiles;
+    }
+
+    /**
+     * Delete all the generated source files made during the execution
+     * of this environment (those that have been registered with the
+     * "addGeneratedFile" method).
+     */
+    public void deleteGeneratedFiles() {
+        synchronized (generatedFiles) {
+            for (File file : generatedFiles) {
+                if (file.getName().endsWith(".java")) {
+                    file.delete();
+                }
+            }
+            generatedFiles.clear();
+        }
+    }
+
+    /**
+     * Parses arguments and fill fields of this object.
+     *
+     * @exception BadCommandLineException
+     *      thrown when there's a problem in the command-line arguments
+     */
+    public final void parseArguments( String[] args ) throws BadCommandLineException {
+
+        for (int i = 0; i < args.length; i++) {
+            if(args[i].length()==0)
+                throw new BadCommandLineException();
+            if (args[i].charAt(0) == '-') {
+                int j = parseArguments(args,i);
+                if(j==0)
+                    throw new BadCommandLineException(WscompileMessages.WSCOMPILE_INVALID_OPTION(args[i]));
+                i += (j-1);
+            } else {
+                addFile(args[i]);
+            }
+        }
+        if(destDir == null)
+            destDir = new File(".");
+        if(sourceDir == null)
+            sourceDir = destDir;
+    }
+
+
+    /**
+     * Adds a file from the argume
+     *
+     * @param arg a file, could be a wsdl or xsd or a Class
+     */
+    protected void addFile(String arg) throws BadCommandLineException {}
+
+    /**
+     * Parses an option <code>args[i]</code> and return
+     * the number of tokens consumed.
+     *
+     * @return
+     *      0 if the argument is not understood. Returning 0
+     *      will let the caller report an error.
+     * @exception BadCommandLineException
+     *      If the callee wants to provide a custom message for an error.
+     */
+    protected int parseArguments(String[] args, int i) throws BadCommandLineException {
+        if (args[i].equals("-g")) {
+            debug = true;
+            return 1;
+        } else if (args[i].equals("-Xdebug")) {
+            debugMode = true;
+            return 1;
+        } else if (args[i].equals("-Xendorsed")) {
+            // this option is processed much earlier, so just ignore.
+            return 1;
+        } else if (args[i].equals("-verbose")) {
+            verbose = true;
+            return 1;
+        } else if (args[i].equals("-quiet")) {
+            quiet = true;
+            return 1;
+        } else if (args[i].equals("-keep")) {
+            keep = true;
+            return 1;
+        }  else if (args[i].equals("-target")) {
+            String token = requireArgument("-target", args, ++i);
+            target = Target.parse(token);
+            if(target == null)
+                throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token));
+            return 2;
+        }else if (args[i].equals("-d")) {
+            destDir = new File(requireArgument("-d", args, ++i));
+            if (!destDir.exists())
+                throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath()));
+            return 2;
+        } else if (args[i].equals("-s")) {
+            sourceDir = new File(requireArgument("-s", args, ++i));
+            keep = true;
+            if (!sourceDir.exists()) {
+                throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath()));
+            }
+            return 2;
+        } else if (args[i].equals("-extension")) {
+            compatibilityMode = EXTENSION;
+            return 1;
+        } else if (args[i].startsWith("-help")) {
+            WeAreDone done = new WeAreDone();
+            done.initOptions(this);
+            throw done;
+        } else if (args[i].equals("-Xnocompile")) {
+            // -nocompile implies -keep. this is undocumented switch.
+            nocompile = true;
+            keep = true;
+            return 1;
+        }
+        return 0;
+    }
+
+    /**
+     * Obtains an operand and reports an error if it's not there.
+     */
+    public String requireArgument(String optionName, String[] args, int i) throws BadCommandLineException {
+        //if (i == args.length || args[i].startsWith("-")) {
+        if (args[i].startsWith("-")) {
+            throw new BadCommandLineException(WscompileMessages.WSCOMPILE_MISSING_OPTION_ARGUMENT(optionName));
+        }
+        return args[i];
+    }
+
+
+
+    /**
+     * Used to signal that we've finished processing.
+     */
+    public static final class WeAreDone extends BadCommandLineException {}
+
+    /**
+     * Get a URLClassLoader from using the classpath
+     */
+    public ClassLoader getClassLoader() {
+        if (classLoader == null) {
+            classLoader =
+                new URLClassLoader(pathToURLs(classpath),
+                    this.getClass().getClassLoader());
+        }
+        return classLoader;
+    }
+
+    /**
+     * Utility method for converting a search path string to an array
+     * of directory and JAR file URLs.
+     *
+     * @param path the search path string
+     * @return the resulting array of directory and JAR file URLs
+     */
+    public static URL[] pathToURLs(String path) {
+        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
+        URL[] urls = new URL[st.countTokens()];
+        int count = 0;
+        while (st.hasMoreTokens()) {
+            URL url = fileToURL(new File(st.nextToken()));
+            if (url != null) {
+                urls[count++] = url;
+            }
+        }
+        if (urls.length != count) {
+            URL[] tmp = new URL[count];
+            System.arraycopy(urls, 0, tmp, 0, count);
+            urls = tmp;
+        }
+        return urls;
+    }
+
+    /**
+     * Returns the directory or JAR file URL corresponding to the specified
+     * local file name.
+     *
+     * @param file the File object
+     * @return the resulting directory or JAR file URL, or null if unknown
+     */
+    public static URL fileToURL(File file) {
+        String name;
+        try {
+            name = file.getCanonicalPath();
+        } catch (IOException e) {
+            name = file.getAbsolutePath();
+        }
+        name = name.replace(File.separatorChar, '/');
+        if (!name.startsWith("/")) {
+            name = "/" + name;
+        }
+
+        // If the file does not exist, then assume that it's a directory
+        if (!file.isFile()) {
+            name = name + "/";
+        }
+        try {
+            return new URL("file", "", name);
+        } catch (MalformedURLException e) {
+            throw new IllegalArgumentException("file");
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java
index 0a116a3..68ccb94 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,11 @@
  */
 package com.sun.tools.internal.ws.wscompile;
 
-import java.io.File;
-import java.io.IOException;
-
 import com.sun.codemodel.internal.JPackage;
 import com.sun.codemodel.internal.writer.FileCodeWriter;
-import com.sun.tools.internal.ws.processor.util.GeneratedFileInfo;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
+
+import java.io.File;
+import java.io.IOException;
 
 /**
  * {@link FileCodeWriter} implementation that notifies
@@ -40,21 +38,17 @@
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
 public class WSCodeWriter extends FileCodeWriter {
-    private final ProcessorEnvironment env;
+    private final Options options;
 
-    public WSCodeWriter( File outDir, ProcessorEnvironment _env ) throws IOException {
+    public WSCodeWriter( File outDir, Options options) throws IOException {
         super(outDir);
-        this.env = _env;
+        this.options = options;
     }
 
     protected File getFile(JPackage pkg, String fileName ) throws IOException {
         File f = super.getFile(pkg, fileName);
 
-        // notify JAX-WS RI
-        GeneratedFileInfo fi = new GeneratedFileInfo();
-        fi.setType("JAXB"/*GeneratorConstants.FILE_TYPE_VALUETYPE*/);
-        fi.setFile(f);
-        env.addGeneratedFile(fi);
+        options.addGeneratedFile(f);
         // we can't really tell the file type, for we don't know
         // what this file is used for. Fortunately,
         // FILE_TYPE doesn't seem to be used, so it doesn't really
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java
new file mode 100644
index 0000000..820688b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.mirror.apt.Filer;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.xml.internal.ws.api.BindingID;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WsgenOptions extends Options {
+    /**
+     * -servicename
+     */
+    public QName serviceName;
+
+    /**
+     * -portname
+     */
+    public QName portName;
+
+    /**
+     * -r
+     */
+    public File nonclassDestDir;
+
+
+    /**
+     * -wsdl
+     */
+    public boolean genWsdl;
+
+    /**
+     * protocol value
+     */
+    public String protocol = "soap1.1";
+    public String transport;
+
+    /**
+     * -XwsgenReport
+     */
+    public File wsgenReport;
+
+    /**
+     * -Xdonotoverwrite
+     */
+    public boolean doNotOverWrite;
+
+    public Filer filer;
+
+
+    /**
+     * Tells if user specified a specific protocol
+     */
+    public boolean protocolSet = false;
+
+    private static final String SERVICENAME_OPTION = "-servicename";
+    private static final String PORTNAME_OPTION = "-portname";
+    private static final String HTTP   = "http";
+    private static final String SOAP11 = "soap1.1";
+    public static final String X_SOAP12 = "Xsoap1.2";
+
+    @Override
+    protected int parseArguments(String[] args, int i) throws BadCommandLineException {
+        int j = super.parseArguments(args, i);
+        if (args[i].equals(SERVICENAME_OPTION)) {
+            serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i));
+            if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i]));
+            }
+            if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i]));
+            }
+            return 2;
+        } else if (args[i].equals(PORTNAME_OPTION)) {
+            portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i));
+            if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i]));
+            }
+            if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i]));
+            }
+            return 2;
+        } else if (args[i].equals("-r")) {
+            nonclassDestDir = new File(requireArgument("-r", args, ++i));
+            if (!nonclassDestDir.exists()) {
+                throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath()));
+            }
+            return 2;
+        } else if (args[i].equals("-classpath") || args[i].equals("-cp")) {
+            classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path");
+            return 2;
+        } else if (args[i].startsWith("-wsdl")) {
+            genWsdl = true;
+            //String value = requireArgument("-wsdl", args, ++i).substring(5);
+            String value = args[i].substring(5);
+            int index = value.indexOf(':');
+            if (index == 0) {
+                value = value.substring(1);
+                index = value.indexOf('/');
+                if (index == -1) {
+                    protocol = value;
+                    transport = HTTP;
+                } else {
+                    protocol = value.substring(0, index);
+                    transport = value.substring(index + 1);
+                }
+                protocolSet = true;
+            }
+            return 1;
+        } else if (args[i].equals("-XwsgenReport")) {
+            // undocumented switch for the test harness
+            wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i));
+            return 2;
+        } else if (args[i].equals("-Xdonotoverwrite")) {
+            doNotOverWrite = true;
+            return 1;
+        }
+        return j;
+    }
+
+
+    @Override
+    protected void addFile(String arg) {
+        endpoints.add(arg);
+    }
+
+    List<String> endpoints = new ArrayList<String>();
+
+    public Class endpoint;
+
+
+    private boolean isImplClass;
+    private boolean noWebServiceEndpoint;
+
+    public void validate() throws BadCommandLineException {
+        if(nonclassDestDir == null)
+            nonclassDestDir = destDir;
+        if (!protocol.equalsIgnoreCase(SOAP11) &&
+                !protocol.equalsIgnoreCase(X_SOAP12)) {
+            throw new BadCommandLineException(WscompileMessages.WSGEN_INVALID_PROTOCOL(protocol, SOAP11 + ", " + X_SOAP12));
+        }
+
+        if (transport != null && !transport.equalsIgnoreCase(HTTP)) {
+            throw new BadCommandLineException(WscompileMessages.WSGEN_INVALID_TRANSPORT(transport, HTTP));
+        }
+
+        if (endpoints.isEmpty()) {
+            throw new BadCommandLineException(WscompileMessages.WSGEN_MISSING_FILE());
+        }
+        if (protocol == null || protocol.equalsIgnoreCase(X_SOAP12) && !isExtensionMode()) {
+            throw new BadCommandLineException(WscompileMessages.WSGEN_SOAP_12_WITHOUT_EXTENSION());
+        }
+
+        validateEndpointClass();
+        validateArguments();
+    }
+    /**
+     * Get an implementation class annotated with @WebService annotation.
+     */
+    private void validateEndpointClass() throws BadCommandLineException {
+        Class clazz = null;
+        for(String cls : endpoints){
+            clazz = getClass(cls);
+            if (clazz == null)
+                continue;
+
+            if (clazz.isEnum() || clazz.isInterface() ||
+                clazz.isPrimitive()) {
+                continue;
+            }
+            isImplClass = true;
+            WebService webService = (WebService) clazz.getAnnotation(WebService.class);
+            if(webService == null)
+                continue;
+            break;
+        }
+        if(clazz == null){
+            throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoints.get(0)));
+        }
+        if(!isImplClass){
+            throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(clazz.getName()));
+        }
+        if(noWebServiceEndpoint){
+            throw new BadCommandLineException(WscompileMessages.WSGEN_NO_WEBSERVICES_CLASS(clazz.getName()));
+        }
+        endpoint = clazz;
+        validateBinding();
+    }
+
+    private void validateBinding() throws BadCommandLineException {
+        if (genWsdl) {
+            BindingID binding = BindingID.parse(endpoint);
+            if ((binding.equals(BindingID.SOAP12_HTTP) ||
+                 binding.equals(BindingID.SOAP12_HTTP_MTOM)) &&
+                    !(protocol.equals(X_SOAP12) && isExtensionMode())) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(binding.toString(), endpoint.getName()));
+            }
+            if (binding.equals(BindingID.XML_HTTP)) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(binding.toString(), endpoint.getName()));
+            }
+        }
+    }
+
+    private void validateArguments() throws BadCommandLineException {
+        if (!genWsdl) {
+            if (serviceName != null) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_WSDL_ARG_NO_GENWSDL(SERVICENAME_OPTION));
+            }
+            if (portName != null) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_WSDL_ARG_NO_GENWSDL(PORTNAME_OPTION));
+            }
+        }
+    }
+
+    public static BindingID getBindingID(String protocol) {
+        if (protocol.equals(SOAP11))
+            return BindingID.SOAP11_HTTP;
+        if (protocol.equals(X_SOAP12))
+            return BindingID.SOAP12_HTTP;
+        return null;
+    }
+
+
+    private Class getClass(String className) {
+        try {
+            return getClassLoader().loadClass(className);
+        } catch (ClassNotFoundException e) {
+            return null;
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
new file mode 100644
index 0000000..a7372a6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
@@ -0,0 +1,401 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.tools.internal.ws.ToolVersion;
+import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext;
+import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP;
+import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.tools.internal.xjc.util.NullStream;
+import com.sun.xml.internal.txw2.TXW;
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlAttribute;
+import com.sun.xml.internal.txw2.annotation.XmlElement;
+import com.sun.xml.internal.txw2.output.StreamSerializer;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.RuntimeModeler;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
+import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.Holder;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WsgenTool implements AnnotationProcessorFactory {
+    private final PrintStream out;
+    private final WsgenOptions options = new WsgenOptions();
+
+
+    public WsgenTool(OutputStream out, Container container) {
+        this.out = (out instanceof PrintStream)?(PrintStream)out:new PrintStream(out);
+        this.container = container;
+    }
+
+
+    public WsgenTool(OutputStream out) {
+        this(out, null);
+    }
+
+    public boolean run(String[] args){
+        final Listener listener = new Listener();
+        for (String arg : args) {
+            if (arg.equals("-version")) {
+                listener.message(ToolVersion.VERSION.BUILD_VERSION);
+                return true;
+            }
+        }
+        try {
+            options.parseArguments(args);
+            options.validate();
+            if(!buildModel(options.endpoint.getName(), listener)){
+                return false;
+            }
+        }catch (Options.WeAreDone done){
+            usage(done.getOptions());
+        }catch (BadCommandLineException e) {
+            if(e.getMessage()!=null) {
+                System.out.println(e.getMessage());
+                System.out.println();
+            }
+            usage(e.getOptions());
+            return false;
+        }finally{
+            if(!options.keep){
+                options.removeGeneratedFiles();
+            }
+        }
+        return true;
+    }
+
+    private AnnotationProcessorContext context;
+    private final Container container;
+
+    private WebServiceAP webServiceAP;
+
+    private int round = 0;
+
+    // Workaround for bug 6499165 on jax-ws,
+    // Original bug with JDK 6500594 , 6500594 when compiled with debug option,
+    private void workAroundJavacDebug() {
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        try {
+            final Class aptMain = cl.loadClass("com.sun.tools.apt.main.Main");
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
+                    try {
+                        Field forcedOpts = aptMain.getDeclaredField("forcedOpts");
+                        forcedOpts.setAccessible(true);
+                        forcedOpts.set(null, new String[]{});
+                    } catch (NoSuchFieldException e) {
+                        if(options.verbose)
+                            e.printStackTrace();
+                    } catch (IllegalAccessException e) {
+                        if(options.verbose)
+                            e.printStackTrace();
+                    }
+                    return null;
+                }
+            });
+        } catch (ClassNotFoundException e) {
+            if(options.verbose)
+                e.printStackTrace();
+        }
+    }
+
+    public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
+        final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
+        context = new AnnotationProcessorContext();
+        webServiceAP = new WebServiceAP(options, context, errReceiver, out);
+
+        String[] args = new String[9];
+        args[0] = "-d";
+        args[1] = options.destDir.getAbsolutePath();
+        args[2] = "-classpath";
+        args[3] = options.classpath;
+        args[4] = "-s";
+        args[5] = options.sourceDir.getAbsolutePath();
+        args[6] = "-XclassesAsDecls";
+        args[7] = endpoint;
+        args[8] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
+
+        // Workaround for bug 6499165: issue with javac debug option
+        workAroundJavacDebug();
+        int result = com.sun.tools.apt.Main.process(this, args);
+        if (result != 0) {
+            out.println(WscompileMessages.WSCOMPILE_ERROR(WscompileMessages.WSCOMPILE_COMPILATION_FAILED()));
+            return false;
+        }
+        if (options.genWsdl) {
+            String tmpPath = options.destDir.getAbsolutePath()+ File.pathSeparator+options.classpath;
+            ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath),
+                    this.getClass().getClassLoader());
+            Class<?> endpointClass;
+            try {
+                endpointClass = classLoader.loadClass(endpoint);
+            } catch (ClassNotFoundException e) {
+                throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoint));
+            }
+
+            BindingID bindingID = WsgenOptions.getBindingID(options.protocol);
+            if (!options.protocolSet) {
+                bindingID = BindingID.parse(endpointClass);
+            }
+            RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID);
+            rtModeler.setClassLoader(classLoader);
+            if (options.portName != null)
+                rtModeler.setPortName(options.portName);
+            AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel();
+
+            final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
+            final Map<String,File> schemaFiles = new HashMap<String,File>();
+            WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
+            WSDLGenerator wsdlGenerator = new WSDLGenerator(rtModel,
+                    new WSDLResolver() {
+                        private File toFile(String suggestedFilename) {
+                            return new File(options.nonclassDestDir, suggestedFilename);
+                        }
+                        private Result toResult(File file) {
+                            Result result;
+                            try {
+                                result = new StreamResult(new FileOutputStream(file));
+                                result.setSystemId(file.getPath().replace('\\', '/'));
+                            } catch (FileNotFoundException e) {
+                                errReceiver.error(e);
+                                return null;
+                            }
+                            return result;
+                        }
+
+                        public Result getWSDL(String suggestedFilename) {
+                            File f = toFile(suggestedFilename);
+                            wsdlFileName[0] = f;
+                            return toResult(f);
+                        }
+                        public Result getSchemaOutput(String namespace, String suggestedFilename) {
+                            if (namespace.equals(""))
+                                return null;
+                            File f = toFile(suggestedFilename);
+                            schemaFiles.put(namespace,f);
+                            return toResult(f);
+                        }
+                        public Result getAbstractWSDL(Holder<String> filename) {
+                            return toResult(toFile(filename.value));
+                        }
+                        public Result getSchemaOutput(String namespace, Holder<String> filename) {
+                            return getSchemaOutput(namespace, filename.value);
+                        }
+                        // TODO pass correct impl's class name
+                    }, bindingID.createBinding(wsfeatures.toArray()), container, endpointClass, ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
+            wsdlGenerator.doGeneration();
+
+            if(options.wsgenReport!=null)
+                generateWsgenReport(endpointClass,rtModel,wsdlFileName[0],schemaFiles);
+        }
+        return true;
+    }
+
+    /**
+     * Generates a small XML file that captures the key activity of wsgen,
+     * so that test harness can pick up artifacts.
+     */
+    private void generateWsgenReport(Class<?> endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map<String,File> schemaFiles) {
+        try {
+            ReportOutput.Report report = TXW.create(ReportOutput.Report.class,
+                new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport))));
+
+            report.wsdl(wsdlFile.getAbsolutePath());
+            ReportOutput.writeQName(rtModel.getServiceQName(), report.service());
+            ReportOutput.writeQName(rtModel.getPortName(), report.port());
+            ReportOutput.writeQName(rtModel.getPortTypeName(), report.portType());
+
+            report.implClass(endpointClass.getName());
+
+            for (Map.Entry<String,File> e : schemaFiles.entrySet()) {
+                ReportOutput.Schema s = report.schema();
+                s.ns(e.getKey());
+                s.location(e.getValue().getAbsolutePath());
+            }
+
+            report.commit();
+        } catch (IOException e) {
+            // this is code for the test, so we can be lousy in the error handling
+            throw new Error(e);
+        }
+    }
+
+    /**
+     * "Namespace" for code needed to generate the report file.
+     */
+    static class ReportOutput {
+        @XmlElement("report")
+        interface Report extends TypedXmlWriter {
+            @XmlElement
+            void wsdl(String file); // location of WSDL
+            @XmlElement
+            QualifiedName portType();
+            @XmlElement
+            QualifiedName service();
+            @XmlElement
+            QualifiedName port();
+
+            /**
+             * Name of the class that has {@link javax.jws.WebService}.
+             */
+            @XmlElement
+            void implClass(String name);
+
+            @XmlElement
+            Schema schema();
+        }
+
+        interface QualifiedName extends TypedXmlWriter {
+            @XmlAttribute
+            void uri(String ns);
+            @XmlAttribute
+            void localName(String localName);
+        }
+
+        interface Schema extends TypedXmlWriter {
+            @XmlAttribute
+            void ns(String ns);
+            @XmlAttribute
+            void location(String filePath);
+        }
+
+        private static void writeQName( QName n, QualifiedName w ) {
+            w.uri(n.getNamespaceURI());
+            w.localName(n.getLocalPart());
+        }
+    }
+
+    protected void usage(Options options) {
+        System.out.println(WscompileMessages.WSGEN_HELP("WSGEN"));
+        System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES());
+    }
+
+    public Collection<String> supportedOptions() {
+        return supportedOptions;
+    }
+
+    public Collection<String> supportedAnnotationTypes() {
+        return supportedAnnotations;
+    }
+
+    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> set, AnnotationProcessorEnvironment apEnv) {
+        if (options.verbose)
+            apEnv.getMessager().printNotice("\tap round: " + ++round);
+        webServiceAP.init(apEnv);
+        return webServiceAP;
+    }
+
+    class Listener extends WsimportListener {
+        ConsoleErrorReporter cer = new ConsoleErrorReporter(out == null ? new PrintStream(new NullStream()) : out);
+
+        @Override
+        public void generatedFile(String fileName) {
+            message(fileName);
+        }
+
+        @Override
+        public void message(String msg) {
+            out.println(msg);
+        }
+
+        @Override
+        public void error(SAXParseException exception) {
+            cer.error(exception);
+        }
+
+        @Override
+        public void fatalError(SAXParseException exception) {
+            cer.fatalError(exception);
+        }
+
+        @Override
+        public void warning(SAXParseException exception) {
+            cer.warning(exception);
+        }
+
+        @Override
+        public void info(SAXParseException exception) {
+            cer.info(exception);
+        }
+    }
+
+    /*
+     * Processor doesn't examine any options.
+     */
+    static final Collection<String> supportedOptions = Collections
+            .unmodifiableSet(new HashSet<String>());
+
+    /*
+     * All annotation types are supported.
+     */
+    static final Collection<String> supportedAnnotations;
+    static {
+        Collection<String> types = new HashSet<String>();
+        types.add("*");
+        types.add("javax.jws.*");
+        types.add("javax.jws.soap.*");
+        supportedAnnotations = Collections.unmodifiableCollection(types);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java
new file mode 100644
index 0000000..fcb8c8f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.tools.internal.xjc.api.ErrorListener;
+import org.xml.sax.SAXParseException;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WsimportListener implements ErrorListener {
+    /**
+     * Called for each file generated by wsimport or wsgen.
+     *
+     * <p>
+     * The file name includes the path portions that correspond with the package name.
+     *
+     * <p>
+     * When generating files into a directory, file names will be relative to the
+     * output directory.
+     *
+     * @param fileName
+     *      file names like "org/acme/foo/Foo.java"
+     *
+     */
+    public void generatedFile(String fileName) {}
+
+    /**
+     * Other miscellenous messages that do not have structures
+     * will be reported through this method.
+     *
+     * This method is used like {@link java.io.PrintStream#println(String)}.
+     * The callee is expected to add '\n'.
+     */
+    public void message(String msg) {}
+
+    public void error(SAXParseException exception) {
+
+    }
+
+    public void fatalError(SAXParseException exception) {
+
+    }
+
+    public void warning(SAXParseException exception) {
+
+    }
+
+    public void info(SAXParseException exception) {
+
+    }
+
+    /**
+     * wsimport will periodically invoke this method to see if it should cancel a compilation.
+     *
+     * @return
+     *      true if the {@link com.sun.tools.internal.ws.wscompile.WsimportListener} wants to abort the processing.
+     * @since 2.1
+     */
+    public boolean isCanceled() {
+        return false;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java
new file mode 100644
index 0000000..477bf92
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java
@@ -0,0 +1,364 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.codemodel.internal.JCodeModel;
+import com.sun.tools.internal.ws.resources.ConfigurationMessages;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.tools.internal.ws.util.ForkEntityResolver;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
+import com.sun.tools.internal.xjc.api.SchemaCompiler;
+import com.sun.tools.internal.xjc.api.SpecVersion;
+import com.sun.tools.internal.xjc.api.XJC;
+import com.sun.tools.internal.xjc.reader.Util;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.JAXWSUtils;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WsimportOptions extends Options {
+    /**
+     * -wsdlLocation
+     */
+    public String wsdlLocation;
+
+    /**
+     * Actually stores {@link com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver}, but the field
+     * type is made to {@link org.xml.sax.EntityResolver} so that XJC can be
+     * used even if resolver.jar is not available in the classpath.
+     */
+    public EntityResolver entityResolver = null;
+
+    /**
+     * The -p option that should control the default Java package that
+     * will contain the generated code. Null if unspecified.
+     */
+    public String defaultPackage = null;
+
+    /**
+     * JAXB's {@link SchemaCompiler} to be used for handling the schema portion.
+     * This object is also configured through options.
+     */
+    private SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
+
+    public JCodeModel getCodeModel() {
+        if(codeModel == null)
+            codeModel = new JCodeModel();
+        return codeModel;
+    }
+
+    public SchemaCompiler getSchemaCompiler() {
+        schemaCompiler.setTargetVersion(SpecVersion.parse(target.getVersion()));
+        schemaCompiler.setEntityResolver(entityResolver);
+        return schemaCompiler;
+    }
+
+    public void setCodeModel(JCodeModel codeModel) {
+        this.codeModel = codeModel;
+    }
+
+    private JCodeModel codeModel;
+
+    /** -Xno-addressing-databinding option to disable addressing namespace data binding. This is
+     * experimental switch and will be working as a temporary workaround till
+     * jaxb can provide a better way to selelctively disable compiling of an
+     * schema component.
+     * **/
+    public boolean noAddressingBbinding;
+
+    @Override
+    public int parseArguments(String[] args, int i) throws BadCommandLineException {
+        int j = super.parseArguments(args ,i);
+        if(j>0) return j;   // understood by the super class
+
+        if (args[i].equals("-b")) {
+            addBindings(requireArgument("-b", args, ++i));
+            return 2;
+        } else if (args[i].equals("-wsdllocation")) {
+            wsdlLocation = requireArgument("-wsdllocation", args, ++i);
+            return 2;
+        } else if (args[i].equals("-p")) {
+            defaultPackage = requireArgument("-p", args, ++i);
+            return 2;
+        } else if (args[i].equals("-catalog")) {
+            String catalog = requireArgument("-catalog", args, ++i);
+            try {
+                if (entityResolver == null) {
+                    if (catalog != null && catalog.length() > 0)
+                        entityResolver = XmlUtil.createEntityResolver(JAXWSUtils.getFileOrURL(JAXWSUtils.absolutize(Util.escapeSpace(catalog))));
+                } else if (catalog != null && catalog.length() > 0) {
+                    EntityResolver er = XmlUtil.createEntityResolver(JAXWSUtils.getFileOrURL(JAXWSUtils.absolutize(Util.escapeSpace(catalog))));
+                    entityResolver = new ForkEntityResolver(er, entityResolver);
+                }
+            } catch (IOException e) {
+                throw new BadCommandLineException(WscompileMessages.WSIMPORT_FAILED_TO_PARSE(catalog, e.getMessage()));
+            }
+            return 2;
+        } else if (args[i].startsWith("-httpproxy:")) {
+            String value = args[i].substring(11);
+            if (value.length() == 0) {
+                throw new BadCommandLineException(WscompileMessages.WSCOMPILE_INVALID_OPTION(args[i]));
+            }
+            int index = value.indexOf(':');
+            if (index == -1) {
+                System.setProperty("proxySet", "true");
+                System.setProperty("proxyHost", value);
+                System.setProperty("proxyPort", "8080");
+            } else {
+                System.setProperty("proxySet", "true");
+                System.setProperty("proxyHost", value.substring(0, index));
+                System.setProperty("proxyPort", value.substring(index + 1));
+            }
+            return 1;
+        } else if (args[i].equals("-Xno-addressing-databinding")) {
+            noAddressingBbinding = true;
+            return 1;
+        } else if (args[i].startsWith("-B")) {
+            // JAXB option pass through.
+            String[] subCmd = new String[args.length-i];
+            System.arraycopy(args,i,subCmd,0,subCmd.length);
+            subCmd[0] = subCmd[0].substring(2); // trim off the first "-B"
+
+            com.sun.tools.internal.xjc.Options jaxbOptions = schemaCompiler.getOptions();
+            try {
+                int r = jaxbOptions.parseArgument(subCmd, 0);
+                if(r==0) {
+                    //Driver.usage(jaxbOptions,false);
+                    throw new BadCommandLineException(WscompileMessages.WSIMPORT_NO_SUCH_JAXB_OPTION(subCmd[0]));
+                }
+                return r;
+            } catch (com.sun.tools.internal.xjc.BadCommandLineException e) {
+                //Driver.usage(jaxbOptions,false);
+                throw new BadCommandLineException(e.getMessage(),e);
+            }
+        }
+
+        return 0; // what's this option?
+    }
+
+    public void validate() throws BadCommandLineException {
+        if (wsdls.isEmpty()) {
+            throw new BadCommandLineException(WscompileMessages.WSIMPORT_MISSING_FILE());
+        }
+        if(wsdlLocation == null){
+            wsdlLocation = wsdls.get(0).getSystemId();
+        }
+    }
+
+
+    @Override
+    protected void addFile(String arg) throws BadCommandLineException {
+        addFile(arg, wsdls, "*.wsdl");
+    }
+
+    private final List<InputSource> wsdls = new ArrayList<InputSource>();
+    private final List<InputSource> schemas = new ArrayList<InputSource>();
+    private final List<InputSource> bindingFiles = new ArrayList<InputSource>();
+    private final List<InputSource> jaxwsCustomBindings = new ArrayList<InputSource>();
+    private final List<InputSource> jaxbCustomBindings = new ArrayList<InputSource>();
+    private final List<Element> handlerConfigs = new ArrayList<Element>();
+
+    /**
+     * There is supposed to be one handler chain per generated SEI.
+     * TODO: There is possible bug, how to associate a @HandlerChain
+     * with each port on the generated SEI. For now lets preserve the JAXWS 2.0 FCS
+     * behaviour and generate only one @HandlerChain on the SEI
+     */
+    public Element getHandlerChainConfiguration(){
+        if(handlerConfigs.size() > 0)
+            return handlerConfigs.get(0);
+        return null;
+    }
+
+    public void addHandlerChainConfiguration(Element config){
+        handlerConfigs.add(config);
+    }
+
+    public InputSource[] getWSDLs() {
+        return wsdls.toArray(new InputSource[wsdls.size()]);
+    }
+
+    public InputSource[] getSchemas() {
+        return schemas.toArray(new InputSource[schemas.size()]);
+    }
+
+    public InputSource[] getWSDLBindings() {
+        return jaxwsCustomBindings.toArray(new InputSource[jaxwsCustomBindings.size()]);
+    }
+
+    public InputSource[] getSchemaBindings() {
+        return jaxbCustomBindings.toArray(new InputSource[jaxbCustomBindings.size()]);
+    }
+
+    public void addWSDL(File source) {
+        addWSDL(fileToInputSource(source));
+    }
+
+    public void addWSDL(InputSource is) {
+        wsdls.add(absolutize(is));
+    }
+
+    public void addSchema(File source) {
+        addSchema(fileToInputSource(source));
+    }
+
+    public void addSchema(InputSource is) {
+        schemas.add(is);
+    }
+
+    private InputSource fileToInputSource(File source) {
+        try {
+            String url = source.toURL().toExternalForm();
+            return new InputSource(Util.escapeSpace(url));
+        } catch (MalformedURLException e) {
+            return new InputSource(source.getPath());
+        }
+    }
+
+    /**
+     * Recursively scan directories and add all XSD files in it.
+     */
+    public void addGrammarRecursive(File dir) {
+        addRecursive(dir, ".wsdl", wsdls);
+        addRecursive(dir, ".xsd", schemas);
+    }
+
+    /**
+     * Adds a new input schema.
+     */
+    public void addWSDLBindFile(InputSource is) {
+        jaxwsCustomBindings.add(absolutize(is));
+    }
+
+    public void addSchemmaBindFile(InputSource is) {
+        jaxbCustomBindings.add(absolutize(is));
+    }
+
+    private void addRecursive(File dir, String suffix, List<InputSource> result) {
+        File[] files = dir.listFiles();
+        if (files == null) return; // work defensively
+
+        for (File f : files) {
+            if (f.isDirectory())
+                addRecursive(f, suffix, result);
+            else if (f.getPath().endsWith(suffix))
+                result.add(absolutize(fileToInputSource(f)));
+        }
+    }
+
+    private InputSource absolutize(InputSource is) {
+        // absolutize all the system IDs in the input,
+        // so that we can map system IDs to DOM trees.
+        try {
+            URL baseURL = new File(".").getCanonicalFile().toURL();
+            is.setSystemId(new URL(baseURL, is.getSystemId()).toExternalForm());
+        } catch (IOException e) {
+            // ignore
+        }
+        return is;
+    }
+
+    public void addBindings(String name) throws BadCommandLineException {
+        addFile(name, bindingFiles, null);
+    }
+
+    /**
+     * Parses a token to a file (or a set of files)
+     * and add them as {@link InputSource} to the specified list.
+     *
+     * @param suffix If the given token is a directory name, we do a recusive search
+     *               and find all files that have the given suffix.
+     */
+    private void addFile(String name, List<InputSource> target, String suffix) throws BadCommandLineException {
+        Object src;
+        try {
+            src = Util.getFileOrURL(name);
+        } catch (IOException e) {
+            throw new BadCommandLineException(WscompileMessages.WSIMPORT_NOT_A_FILE_NOR_URL(name));
+        }
+        if (src instanceof URL) {
+            target.add(absolutize(new InputSource(Util.escapeSpace(((URL) src).toExternalForm()))));
+        } else {
+            File fsrc = (File) src;
+            if (fsrc.isDirectory()) {
+                addRecursive(fsrc, suffix, target);
+            } else {
+                target.add(absolutize(fileToInputSource(fsrc)));
+            }
+        }
+    }
+
+
+    /**
+     * Exposing it as a public method to allow external tools such as NB to read from wsdl model and work on it.
+     * TODO: WSDL model needs to be exposed - basically at tool time we need to use the runtimw wsdl model
+     *
+     * Binding files could be jaxws or jaxb. This method identifies jaxws and jaxb binding files and keeps them separately. jaxb binding files are given separately
+     * to JAXB in {@link com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder}
+     *
+     * @param receiver {@link ErrorReceiver}
+     */
+    public final void parseBindings(ErrorReceiver receiver){
+        for (InputSource is : bindingFiles) {
+            XMLStreamReader reader =
+                    XMLStreamReaderFactory.create(is,true);
+            XMLStreamReaderUtil.nextElementContent(reader);
+            if (reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)) {
+                jaxwsCustomBindings.add(is);
+            } else if (reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS) ||
+                    reader.getName().equals(new QName(SchemaConstants.NS_XSD, "schema"))) {
+                jaxbCustomBindings.add(is);
+            } else {
+                LocatorImpl locator = new LocatorImpl();
+                locator.setSystemId(reader.getLocation().getSystemId());
+                locator.setPublicId(reader.getLocation().getPublicId());
+                locator.setLineNumber(reader.getLocation().getLineNumber());
+                locator.setColumnNumber(reader.getLocation().getColumnNumber());
+                receiver.warning(locator, ConfigurationMessages.CONFIGURATION_NOT_BINDING_FILE(is.getSystemId()));
+            }
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
new file mode 100644
index 0000000..602bb94
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wscompile;
+
+import com.sun.codemodel.internal.CodeWriter;
+import com.sun.codemodel.internal.writer.ProgressCodeWriter;
+import com.sun.tools.internal.ws.ToolVersion;
+import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
+import com.sun.tools.internal.ws.processor.generator.CustomExceptionGenerator;
+import com.sun.tools.internal.ws.processor.generator.SeiGenerator;
+import com.sun.tools.internal.ws.processor.generator.ServiceGenerator;
+import com.sun.tools.internal.ws.processor.model.Model;
+import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
+import com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.xjc.util.NullStream;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.EndpointReference;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WsimportTool {
+    private static final String WSIMPORT = "wsimport";
+    private final PrintStream out;
+    private final Container container;
+
+    /**
+     * Wsimport specific options
+     */
+    private final WsimportOptions options = new WsimportOptions();
+
+    public WsimportTool(OutputStream out) {
+        this(out, null);
+    }
+
+    public WsimportTool(OutputStream logStream, Container container) {
+        this.out = (logStream instanceof PrintStream)?(PrintStream)logStream:new PrintStream(logStream);
+        this.container = container;
+    }
+
+
+    public boolean run(String[] args) {
+        class Listener extends WsimportListener {
+            ConsoleErrorReporter cer = new ConsoleErrorReporter(out == null ? new PrintStream(new NullStream()) : out);
+
+            @Override
+            public void generatedFile(String fileName) {
+                message(fileName);
+            }
+
+            @Override
+            public void message(String msg) {
+                out.println(msg);
+            }
+
+            @Override
+            public void error(SAXParseException exception) {
+                cer.error(exception);
+            }
+
+            @Override
+            public void fatalError(SAXParseException exception) {
+                cer.fatalError(exception);
+            }
+
+            @Override
+            public void warning(SAXParseException exception) {
+                cer.warning(exception);
+            }
+
+            @Override
+            public void info(SAXParseException exception) {
+                cer.info(exception);
+            }
+
+            public void enableDebugging(){
+                cer.enableDebugging();
+            }
+        }
+        final Listener listener = new Listener();
+        ErrorReceiverFilter receiver = new ErrorReceiverFilter(listener) {
+            public void info(SAXParseException exception) {
+                if (options.verbose)
+                    super.info(exception);
+            }
+
+            public void warning(SAXParseException exception) {
+                if (!options.quiet)
+                    super.warning(exception);
+            }
+
+            @Override
+            public void pollAbort() throws AbortException {
+                if (listener.isCanceled())
+                    throw new AbortException();
+            }
+        };
+
+        for (String arg : args) {
+            if (arg.equals("-version")) {
+                listener.message(ToolVersion.VERSION.BUILD_VERSION);
+                return true;
+            }
+        }
+        try {
+            options.parseArguments(args);
+            options.validate();
+            if(options.debugMode)
+                listener.enableDebugging();
+            options.parseBindings(receiver);
+
+            try {
+                if( !options.quiet )
+                    listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL());
+
+                WSDLModeler wsdlModeler = new WSDLModeler(options, receiver);
+                Model wsdlModel = wsdlModeler.buildModel();
+                if (wsdlModel == null) {
+                    listener.message(WsdlMessages.PARSING_PARSE_FAILED());
+                    return false;
+                }
+
+                //generated code
+                if( !options.quiet )
+                    listener.message(WscompileMessages.WSIMPORT_GENERATING_CODE());
+
+                TJavaGeneratorExtension[] genExtn = ServiceFinder.find(TJavaGeneratorExtension.class).toArray();
+                CustomExceptionGenerator.generate(wsdlModel,  options, receiver);
+                SeiGenerator.generate(wsdlModel, options, receiver, genExtn);
+                ServiceGenerator.generate(wsdlModel, options, receiver);
+                CodeWriter cw = new WSCodeWriter(options.sourceDir, options);
+                if (options.verbose)
+                    cw = new ProgressCodeWriter(cw, System.out);
+                options.getCodeModel().build(cw);
+            } catch(AbortException e){
+                //error might have been reported
+            }catch (IOException e) {
+                receiver.error(e);
+            }
+
+            if (!options.nocompile){
+                if(!compileGeneratedClasses(receiver)){
+                    listener.message(WscompileMessages.WSCOMPILE_COMPILATION_FAILED());
+                    return false;
+                }
+            }
+
+        } catch (Options.WeAreDone done) {
+            usage(done.getOptions());
+        } catch (BadCommandLineException e) {
+            if (e.getMessage() != null) {
+                System.out.println(e.getMessage());
+                System.out.println();
+            }
+            usage(e.getOptions());
+            return false;
+        } finally{
+            if(!options.keep){
+                options.removeGeneratedFiles();
+            }
+        }
+        return true;
+    }
+
+    public void setEntityResolver(EntityResolver resolver){
+        this.options.entityResolver = resolver;
+    }
+
+    protected boolean compileGeneratedClasses(ErrorReceiver receiver){
+        List<String> sourceFiles = new ArrayList<String>();
+
+        for (File f : options.getGeneratedFiles()) {
+            if (f.exists() && f.getName().endsWith(".java")) {
+                sourceFiles.add(f.getAbsolutePath());
+            }
+        }
+
+        if (sourceFiles.size() > 0) {
+            String classDir = options.destDir.getAbsolutePath();
+            String classpathString = createClasspathString();
+            String[] args = new String[5 + (options.debug ? 1 : 0)
+                    + sourceFiles.size()];
+            args[0] = "-d";
+            args[1] = classDir;
+            args[2] = "-classpath";
+            args[3] = classpathString;
+            args[4] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
+            int baseIndex = 5;
+            if (options.debug) {
+                args[baseIndex++] = "-g";
+            }
+            for (int i = 0; i < sourceFiles.size(); ++i) {
+                args[baseIndex + i] = sourceFiles.get(i);
+            }
+
+            return JavaCompilerHelper.compile(args, out, receiver);
+        }
+        //there are no files to compile, so return true?
+        return true;
+    }
+
+    private String createClasspathString() {
+        return System.getProperty("java.class.path");
+    }
+
+    protected void usage(Options options) {
+        System.out.println(WscompileMessages.WSIMPORT_HELP(WSIMPORT));
+        System.out.println(WscompileMessages.WSIMPORT_USAGE_EXAMPLES());
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Binding.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Binding.java
index 28b2f3b..acecc1a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Binding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Binding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,28 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.GlobalEntity;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
-
 /**
  * Entity corresponding to the "binding" WSDL element.
  *
  * @author WS Development Team
  */
-public class Binding extends GlobalEntity implements Extensible {
+public class Binding extends GlobalEntity implements TWSDLExtensible {
 
-    public Binding(Defining defining) {
-        super(defining);
+    public Binding(Defining defining, Locator locator, ErrorReceiver receiver) {
+        super(defining, locator, receiver);
         _operations = new ArrayList();
         _helper = new ExtensibilityHelper();
     }
@@ -73,7 +68,12 @@
     }
 
     public PortType resolvePortType(AbstractDocument document) {
-        return (PortType) document.find(Kinds.PORT_TYPE, _portType);
+        try {
+            return (PortType) document.find(Kinds.PORT_TYPE, _portType);
+        } catch (NoSuchEntityException e) {
+            errorReceiver.error(getLocator(), WsdlMessages.ENTITY_NOT_FOUND_PORT_TYPE(_portType, new QName(getNamespaceURI(), getName())));
+            throw new AbortException();
+        }
     }
 
     public Kind getKind() {
@@ -133,16 +133,38 @@
         }
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getDefining().getTargetNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
     private QName _portType;
     private List _operations;
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java
index 65c1ba9..d8aaaf8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,24 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "fault" child element of a binding operation.
  *
  * @author WS Development Team
  */
-public class BindingFault extends Entity implements Extensible {
+public class BindingFault extends Entity implements TWSDLExtensible {
 
-    public BindingFault() {
+    public BindingFault(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -66,14 +66,30 @@
         _documentation = d;
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getParent().getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         _helper.withAllSubEntitiesDo(action);
     }
@@ -93,4 +109,10 @@
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
     private String _name;
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java
index 5aca957..175e491 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,24 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "input" child element of a binding operation.
  *
  * @author WS Development Team
  */
-public class BindingInput extends Entity implements Extensible {
+public class BindingInput extends Entity implements TWSDLExtensible {
 
-    public BindingInput() {
+    public BindingInput(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -64,14 +66,30 @@
         _documentation = d;
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getParent().getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         _helper.withAllSubEntitiesDo(action);
     }
@@ -88,4 +106,10 @@
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
     private String _name;
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java
index 272784b..2de0684 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,27 +25,27 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Entity corresponding to the "operation" child element of a WSDL "binding" element.
  *
  * @author WS Development Team
  */
-public class BindingOperation extends Entity implements Extensible {
+public class BindingOperation extends Entity implements TWSDLExtensible {
 
-    public BindingOperation() {
-        _faults = new ArrayList();
+    public BindingOperation(Locator locator) {
+        super(locator);
+        _faults = new ArrayList<BindingFault>();
         _helper = new ExtensibilityHelper();
     }
 
@@ -117,8 +117,8 @@
         _faults.add(f);
     }
 
-    public Iterator faults() {
-        return _faults.iterator();
+    public Iterable<BindingFault> faults() {
+        return _faults;
     }
 
     public QName getElementName() {
@@ -133,14 +133,30 @@
         _documentation = d;
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return parent.getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         if (_input != null) {
             action.perform(_input);
@@ -148,8 +164,8 @@
         if (_output != null) {
             action.perform(_output);
         }
-        for (Iterator iter = _faults.iterator(); iter.hasNext();) {
-            action.perform((Entity) iter.next());
+        for (BindingFault _fault : _faults) {
+            action.perform(_fault);
         }
         _helper.withAllSubEntitiesDo(action);
     }
@@ -164,8 +180,8 @@
         if (_output != null) {
             _output.accept(visitor);
         }
-        for (Iterator iter = _faults.iterator(); iter.hasNext();) {
-            ((BindingFault) iter.next()).accept(visitor);
+        for (BindingFault _fault : _faults) {
+            _fault.accept(visitor);
         }
         visitor.postVisit(this);
     }
@@ -197,7 +213,13 @@
     private String _name;
     private BindingInput _input;
     private BindingOutput _output;
-    private List _faults;
+    private List<BindingFault> _faults;
     private OperationStyle _style;
     private String _uniqueKey;
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java
index 2bf4757..70482a7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,24 +25,24 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "output" child element of a binding operation.
  *
  * @author WS Development Team
  */
-public class BindingOutput extends Entity implements Extensible {
+public class BindingOutput extends Entity implements TWSDLExtensible {
 
-    public BindingOutput() {
+    public BindingOutput(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -66,14 +66,30 @@
         _documentation = d;
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         _helper.withAllSubEntitiesDo(action);
     }
@@ -87,6 +103,12 @@
     public void validateThis() {
     }
 
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
     private String _name;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java
index 64d19df..8fd7078 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,31 +25,23 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.DuplicateEntityException;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import java.util.*;
 
 /**
  * Entity corresponding to the "definitions" WSDL element.
  *
  * @author WS Development Team
  */
-public class Definitions extends Entity implements Defining, Extensible {
+public class Definitions extends Entity implements Defining, TWSDLExtensible {
 
-    public Definitions(AbstractDocument document) {
+    public Definitions(AbstractDocument document, Locator locator) {
+        super(locator);
         _document = document;
         _bindings = new ArrayList();
         _imports = new ArrayList();
@@ -133,7 +125,15 @@
         return _services.iterator();
     }
 
-    public QName getElementName() {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getTargetNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
         return WSDLConstants.QNAME_DEFINITIONS;
     }
 
@@ -145,14 +145,21 @@
         _documentation = d;
     }
 
-    public void addExtension(Extension e) {
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    /**
+     * wsdl:definition is the root hence no parent so return null.
+     */
+    public TWSDLExtensible getParent() {
+        return null;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         if (_types != null) {
             action.perform(_types);
@@ -218,4 +225,8 @@
     private List<Service> _services;
     private List _imports;
     private Set _importedNamespaces;
+
+    public QName getElementName() {
+        return getWSDLElementName();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java
index b49779f..820a8b9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Fault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Fault.java
index d280d89..a6d1a3d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Fault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Fault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,22 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
 
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
-
 /**
  * Entity corresponding to the "fault" child element of a port type operation.
  *
  * @author WS Development Team
  */
-public class Fault extends Entity implements Extensible{
+public class Fault extends Entity implements TWSDLExtensible {
 
-    public Fault() {
+    public Fault(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -110,20 +106,52 @@
     private Documentation _documentation;
     private String _name;
     private QName _message;
+    private String _action;
     private ExtensibilityHelper _helper;
 
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return parent.getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
     /* (non-Javadoc)
-     * @see Extensible#addExtension(Extension)
-     */
-    public void addExtension(Extension e) {
+    * @see TWSDLExtensible#addExtension(ExtensionImpl)
+    */
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
 
     }
 
     /* (non-Javadoc)
-     * @see Extensible#extensions()
+     * @see TWSDLExtensible#extensions()
      */
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
+
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
+
+    public String getAction() {
+        return _action;
+    }
+
+    public void setAction(String _action) {
+        this._action = _action;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Import.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Import.java
index 349dd3f..c5b862e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Import.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Import.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,10 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "import" WSDL element.
@@ -36,7 +37,8 @@
  */
 public class Import extends Entity{
 
-    public Import() {
+    public Import(Locator locator) {
+        super(locator);
     }
 
     public String getNamespace() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java
index ff98b99..5e3324b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,27 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "input" child element of a port type operation.
  *
  * @author WS Development Team
  */
-public class Input extends Entity {
+public class Input extends Entity implements TWSDLExtensible {
 
-    public Input() {
+    public Input(Locator locator, ErrorReceiver errReceiver) {
+        super(locator);
+        this.errorReceiver = errReceiver;
+        _helper = new ExtensibilityHelper();
     }
 
     public String getName() {
@@ -94,11 +100,51 @@
 
     public void validateThis() {
         if (_message == null) {
-            failValidation("validation.missingRequiredAttribute", "message");
+            errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
+            throw new AbortException();
         }
     }
 
     private Documentation _documentation;
     private String _name;
     private QName _message;
+    private String _action;
+    private ExtensibilityHelper _helper;
+    private TWSDLExtensible parent;
+
+    public void addExtension(TWSDLExtension e) {
+        _helper.addExtension(e);
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    public String getNamespaceURI() {
+        return getElementName().getNamespaceURI();
+    }
+
+    public String getNameValue() {
+        return null;
+    }
+
+    public Iterable<? extends TWSDLExtension> extensions() {
+        return _helper.extensions();
+    }
+
+    public String getAction() {
+        return _action;
+    }
+
+    public void setAction(String _action) {
+        this._action = _action;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java
index 8a4435a..78ec56f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java
index 0033122..3edea39 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,14 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.GlobalEntity;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
+import java.util.*;
 
 /**
  * Entity corresponding to the "message" WSDL element.
@@ -47,17 +41,18 @@
  */
 public class Message extends GlobalEntity {
 
-    public Message(Defining defining) {
-        super(defining);
+    public Message(Defining defining, Locator locator, ErrorReceiver errReceiver) {
+        super(defining, locator, errReceiver);
         _parts = new ArrayList<MessagePart>();
         _partsByName = new HashMap<String, MessagePart>();
     }
 
     public void add(MessagePart part) {
-        if (_partsByName.get(part.getName()) != null)
-            throw new ValidationException(
-                "validation.duplicateName",
-                part.getName());
+        if (_partsByName.get(part.getName()) != null){
+            errorReceiver.error(part.getLocator(), WsdlMessages.VALIDATION_DUPLICATE_PART_NAME(getName(), part.getName()));
+            throw new AbortException();
+        }
+
         _partsByName.put(part.getName(), part);
         _parts.add(part);
     }
@@ -112,7 +107,8 @@
 
     public void validateThis() {
         if (getName() == null) {
-            failValidation("validation.missingRequiredAttribute", "name");
+            errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
+            throw new AbortException();
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java
index 665be32..f790051 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,14 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
 import com.sun.tools.internal.ws.wsdl.framework.Kind;
 import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
-import com.sun.xml.internal.ws.model.Mode;
+import org.xml.sax.Locator;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to a WSDL message part.
@@ -47,7 +48,8 @@
     public static final int WSDL_MIME_BINDING = 5;
     public static final int PART_NOT_BOUNDED = -1;
 
-    public MessagePart() {
+    public MessagePart(Locator locator) {
+        super(locator);
     }
 
     public String getName() {
@@ -104,9 +106,7 @@
     }
 
     public void validateThis() {
-        if (_descriptorKind == null || _descriptor == null) {
-            failValidation("validation.missingRequiredProperty", "descriptor");
-        }else if(_descriptor.getLocalPart().equals("")){
+        if(_descriptor != null && _descriptor.getLocalPart().equals("")){
             failValidation("validation.invalidElement", _descriptor.toString());
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java
index 5219efa..51e1cd1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,27 +25,28 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
+import com.sun.codemodel.internal.JClass;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.*;
 
 /**
  * Entity corresponding to the "operation" child element of a "portType" WSDL element.
  *
  * @author WS Development Team
  */
-public class Operation extends Entity implements Extensible{
+public class Operation extends Entity implements TWSDLOperation {
 
-    public Operation() {
-        _faults = new ArrayList();
+    public Operation(Locator locator) {
+        super(locator);
+        _faults = new ArrayList<Fault>();
         _helper = new ExtensibilityHelper();
     }
 
@@ -117,8 +118,8 @@
         _faults.add(f);
     }
 
-    public Iterator faults() {
-        return _faults.iterator();
+    public Iterable<Fault> faults() {
+        return _faults;
     }
 
     public String getParameterOrder() {
@@ -150,8 +151,8 @@
         if (_output != null) {
             action.perform(_output);
         }
-        for (Iterator iter = _faults.iterator(); iter.hasNext();) {
-            action.perform((Entity) iter.next());
+        for (Fault _fault : _faults) {
+            action.perform(_fault);
         }
         _helper.withAllSubEntitiesDo(action);
     }
@@ -164,8 +165,8 @@
         if (_output != null) {
             _output.accept(visitor);
         }
-        for (Iterator iter = _faults.iterator(); iter.hasNext();) {
-            ((Fault) iter.next()).accept(visitor);
+        for (Fault _fault : _faults) {
+            _fault.accept(visitor);
         }
         visitor.postVisit(this);
     }
@@ -189,9 +190,6 @@
             if (_faults != null && _faults.size() != 0) {
                 failValidation("validation.invalidSubEntity", "fault");
             }
-            if (_parameterOrder != null) {
-                failValidation("validation.invalidAttribute", "parameterOrder");
-            }
         } else if (_style == OperationStyle.NOTIFICATION) {
             if (_parameterOrder != null) {
                 failValidation("validation.invalidAttribute", "parameterOrder");
@@ -199,29 +197,59 @@
         }
     }
 
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return parent.getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
     /* (non-Javadoc)
-     * @see Extensible#addExtension(Extension)
-     */
-    public void addExtension(Extension e) {
+    * @see TWSDLExtensible#addExtension(ExtensionImpl)
+    */
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
 
     }
 
     /* (non-Javadoc)
-     * @see Extensible#extensions()
+     * @see TWSDLExtensible#extensions()
      */
-    public Iterator extensions() {
+    public Iterable<? extends TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
 
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    public Map<String, JClass> getFaults() {
+        return unmodifiableFaultClassMap;
+    }
+
+    public void putFault(String faultName, JClass exception){
+        faultClassMap.put(faultName, exception);
+    }
+
+    private TWSDLExtensible parent;
     private Documentation _documentation;
     private String _name;
     private Input _input;
     private Output _output;
-    private List _faults;
+    private List<Fault> _faults;
     private OperationStyle _style;
     private String _parameterOrder;
     private String _uniqueKey;
     private ExtensibilityHelper _helper;
+    private final Map<String, JClass> faultClassMap = new HashMap<String, JClass>();
+    private final Map<String, JClass> unmodifiableFaultClassMap = Collections.unmodifiableMap(faultClassMap);
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java
index 00cdab3..897c152 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java
index 8842227..22f09cb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,21 +25,26 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "output" child element of a port type operation.
  *
  * @author WS Development Team
  */
-public class Output extends Entity {
+public class Output extends Entity implements TWSDLExtensible {
 
-    public Output() {
+    public Output(Locator locator, ErrorReceiver errReceiver) {
+        super(locator);
+        this.errorReceiver = errReceiver;
     }
 
     public String getName() {
@@ -94,11 +99,51 @@
 
     public void validateThis() {
         if (_message == null) {
-            failValidation("validation.missingRequiredAttribute", "message");
+            errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
+            throw new AbortException();
         }
     }
 
     private Documentation _documentation;
     private String _name;
     private QName _message;
+    private String _action;
+    private ExtensibilityHelper _helper;
+    private TWSDLExtensible parent;
+
+    public void addExtension(TWSDLExtension e) {
+        _helper.addExtension(e);
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    public String getNamespaceURI() {
+        return getElementName().getNamespaceURI();
+    }
+
+    public String getNameValue() {
+        return null;
+    }
+
+    public Iterable<? extends TWSDLExtension> extensions() {
+        return _helper.extensions();
+    }
+
+    public String getAction() {
+        return _action;
+    }
+
+    public void setAction(String _action) {
+        this._action = _action;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Port.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Port.java
index b37a666..ee6e52d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Port.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Port.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,30 +25,25 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
 
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.GlobalEntity;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
-
 /**
  * Entity corresponding to the "port" WSDL element.
  *
  * @author WS Development Team
  */
-public class Port extends GlobalEntity implements Extensible {
+public class Port extends GlobalEntity implements TWSDLExtensible {
 
-    public Port(Defining defining) {
-        super(defining);
+    public Port(Defining defining, Locator locator, ErrorReceiver errReceiver) {
+        super(defining, locator, errReceiver);
         _helper = new ExtensibilityHelper();
     }
 
@@ -69,14 +64,27 @@
     }
 
     public Binding resolveBinding(AbstractDocument document) {
-        return (Binding) document.find(Kinds.BINDING, _binding);
+        try{
+            return (Binding) document.find(Kinds.BINDING, _binding);
+        } catch (NoSuchEntityException e) {
+            errorReceiver.error(getLocator(), WsdlMessages.ENTITY_NOT_FOUND_BINDING(_binding, new QName(getNamespaceURI(), getName())));
+            throw new AbortException();
+        }
     }
 
     public Kind getKind() {
         return Kinds.PORT;
     }
 
-    public QName getElementName() {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getDefining().getTargetNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
         return WSDLConstants.QNAME_PORT;
     }
 
@@ -118,14 +126,22 @@
         }
     }
 
-    public void addExtension(Extension e) {
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         _helper.withAllSubEntitiesDo(action);
     }
@@ -134,4 +150,10 @@
     private Documentation _documentation;
     private Service _service;
     private QName _binding;
+
+    public QName getElementName() {
+        return getWSDLElementName();
+    }
+
+    private TWSDLExtensible parent;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/PortType.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/PortType.java
index 8d6deeb..31c46fc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/PortType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/PortType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,24 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.GlobalEntity;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
+import java.util.*;
 
 /**
  * Entity corresponding to the "portType" WSDL element.
  *
  * @author WS Development Team
  */
-public class PortType extends GlobalEntity implements Extensible{
+public class PortType extends GlobalEntity implements TWSDLExtensible {
 
-    public PortType(Defining defining) {
-        super(defining);
+    public PortType(Defining defining, Locator locator, ErrorReceiver errReceiver) {
+        super(defining, locator, errReceiver);
         _operations = new ArrayList();
         _operationKeys = new HashSet();
         _helper = new ExtensibilityHelper();
@@ -122,21 +113,42 @@
         }
     }
 
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getDefining().getTargetNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
     /* (non-Javadoc)
-     * @see Extensible#addExtension(Extension)
-     */
-    public void addExtension(Extension e) {
+    * @see TWSDLExtensible#addExtension(ExtensionImpl)
+    */
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
 
     }
 
     /* (non-Javadoc)
-     * @see Extensible#extensions()
+     * @see TWSDLExtensible#extensions()
      */
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
+    private TWSDLExtensible parent;
     private Documentation _documentation;
     private List _operations;
     private Set _operationKeys;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Service.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Service.java
index 87925c3..c866328 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Service.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Service.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,30 +25,26 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.GlobalEntity;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-
 /**
  * Entity corresponding to the "service" WSDL element.
  *
  * @author WS Development Team
  */
-public class Service extends GlobalEntity implements Extensible {
+public class Service extends GlobalEntity implements TWSDLExtensible {
 
-    public Service(Defining defining) {
-        super(defining);
+    public Service(Defining defining, Locator locator, ErrorReceiver errReceiver) {
+        super(defining, locator, errReceiver);
         _ports = new ArrayList();
         _helper = new ExtensibilityHelper();
     }
@@ -100,14 +96,30 @@
         }
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getDefining().getTargetNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
     private List <Port> _ports;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Types.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Types.java
index 98762e0..142ba1a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Types.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Types.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,25 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * Entity corresponding to the "types" WSDL element.
  *
  * @author WS Development Team
  */
-public class Types extends Entity implements Extensible {
+public class Types extends Entity implements TWSDLExtensible {
 
-    public Types() {
+    public Types(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -68,14 +68,37 @@
     public void validateThis() {
     }
 
-    public void addExtension(Extension e) {
+    /**
+     * wsdl:type does not have any name attribute
+     */
+    public String getNameValue() {
+        return null;
+    }
+
+    public String getNamespaceURI() {
+        return parent.getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
+    public TWSDLExtensible getParent() {
+        return parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        this.parent = parent;
+    }
+
     public void withAllSubEntitiesDo(EntityAction action) {
         _helper.withAllSubEntitiesDo(action);
     }
@@ -84,6 +107,7 @@
         _helper.accept(visitor);
     }
 
+    private TWSDLExtensible parent;
     private ExtensibilityHelper _helper;
     private Documentation _documentation;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java
index 660933e..3974f2d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java
index 251cc3e..4db0b5e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,22 +25,15 @@
 
 package com.sun.tools.internal.ws.wsdl.document;
 
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Set;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceValidator;
-import com.sun.tools.internal.ws.wsdl.framework.GloballyKnown;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-
 /**
  * A WSDL document.
  *
@@ -48,7 +41,8 @@
  */
 public class WSDLDocument extends AbstractDocument{
 
-    public WSDLDocument() {
+    public WSDLDocument(MetadataFinder forest, ErrorReceiver errReceiver) {
+        super(forest, errReceiver);
     }
 
     public Definitions getDefinitions() {
@@ -59,14 +53,6 @@
         _definitions = d;
     }
 
-    public Set collectAllNamespaces() {
-        Set result = super.collectAllNamespaces();
-        if (_definitions.getTargetNamespaceURI() != null) {
-            result.add(_definitions.getTargetNamespaceURI());
-        }
-        return result;
-    }
-
     public QName[] getAllServiceQNames() {
 
         ArrayList serviceQNames = new ArrayList();
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java
index 99d7d9a..b5ebdb3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java
index f8cf2e5..b7e3d8a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java
index 693c53a..3c072e7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.http;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A HTTP address extension.
  *
  * @author WS Development Team
  */
-public class HTTPAddress extends Extension {
+public class HTTPAddress extends ExtensionImpl {
 
-    public HTTPAddress() {
+    public HTTPAddress(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java
index a81fad3..38aaae8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.http;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A HTTP binding extension.
  *
  * @author WS Development Team
  */
-public class HTTPBinding extends Extension {
+public class HTTPBinding extends ExtensionImpl {
 
-    public HTTPBinding() {
+    public HTTPBinding(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java
index 1ec64a2..a1c0753 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java
index a56297e..076415a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.http;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A HTTP operation extension.
  *
  * @author WS Development Team
  */
-public class HTTPOperation extends Extension {
+public class HTTPOperation extends ExtensionImpl {
 
-    public HTTPOperation() {
+    public HTTPOperation(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java
index 3e7e847..6f5226f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,21 @@
 
 package com.sun.tools.internal.ws.wsdl.document.http;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A HTTP urlEncoded extension.
  *
  * @author WS Development Team
  */
-public class HTTPUrlEncoded extends Extension {
+public class HTTPUrlEncoded extends ExtensionImpl {
 
-    public HTTPUrlEncoded() {}
+    public HTTPUrlEncoded(Locator locator) {
+        super(locator);
+    }
 
     public QName getElementName() {
         return HTTPConstants.QNAME_URL_ENCODED;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java
index 876a4e5..e32541a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.http;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A HTTP urlReplacement extension.
  *
  * @author WS Development Team
  */
-public class HTTPUrlReplacement extends Extension {
+public class HTTPUrlReplacement extends ExtensionImpl {
 
-    public HTTPUrlReplacement() {
+    public HTTPUrlReplacement(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java
index f5fa013..e4fcca0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java
index b741788..797e419 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java
index a8f48f9..6930f30 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,18 +24,12 @@
  */
 package com.sun.tools.internal.ws.wsdl.document.jaxws;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import java.util.*;
 
 
 /**
@@ -44,13 +38,13 @@
  * To change the template for this generated type comment go to
  * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
  */
-public class JAXWSBinding extends Extension implements Extensible {
+public class JAXWSBinding extends ExtensionImpl {
 
     /**
      *
      */
-    public JAXWSBinding(){
-        super();
+    public JAXWSBinding(Locator locator){
+        super(locator);
         jaxbBindings = new HashSet<Element>();
         // TODO Auto-generated constructor stub
     }
@@ -72,18 +66,22 @@
         return JAXWSBindingsConstants.JAXWS_BINDINGS;
     }
 
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
     /* (non-Javadoc)
-     * @see Extensible#addExtension(Extension)
-     */
-    public void addExtension(Extension e) {
+    * @see TWSDLExtensible#addExtension(ExtensionImpl)
+    */
+    public void addExtension(ExtensionImpl e) {
         // TODO Auto-generated method stub
 
     }
 
     /* (non-Javadoc)
-     * @see Extensible#extensions()
+     * @see TWSDLExtensible#extensions()
      */
-    public Iterator extensions() {
+    public Iterable<ExtensionImpl> extensions() {
         // TODO Auto-generated method stub
         return null;
     }
@@ -333,6 +331,6 @@
     // portType className
     private CustomName className;
 
-    //portType Operation
+    //portType WSDLOperation
     private CustomName methodName;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java
index 4ada7db..efcdd70 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.tools.internal.ws.wsdl.document.jaxws;
 
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.wsdl.parser.Constants;
 
+import javax.xml.namespace.QName;
+
 /**
  * @author Vivek Pandey
  *
@@ -37,6 +37,7 @@
 
     public static String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws";
     public static String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb";
+    public static String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc";
 
     /**
      * jaxws:bindings schema component
@@ -120,7 +121,7 @@
     public static QName CLASS = new QName(NS_JAXWS_BINDINGS, "class");
 
     /*
-     * PortType Operation
+     * PortType WSDLOperation
      *
      * <jaxws:method name="xs:string">?
      *   <jaxws:javadoc>xs:string</jaxws:javadoc>?
@@ -159,7 +160,7 @@
      */
 
     /*
-     * BindingOperation
+     * WSDLBoundOperation
      *
      * <jaxws:enableAdditionalSOAPHeaderMapping>
      *  xs:boolean
@@ -187,7 +188,7 @@
      * jaxb:bindgs QName
      */
     public static QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings");
-    public static String JAXB_BINDING_VERSION = "1.0";
+    public static String JAXB_BINDING_VERSION = "2.0";
     public static QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo");
     public static QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation");
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java
index 74588ea..02a7b22 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java
index 401dd80..77d7607 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java
index 24e6fcf..c13ba57 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.mime;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A MIME content extension.
  *
  * @author WS Development Team
  */
-public class MIMEContent extends Extension {
+public class MIMEContent extends ExtensionImpl {
 
-    public MIMEContent() {
+    public MIMEContent(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java
index 4d08777..5e1246b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,26 @@
 
 package com.sun.tools.internal.ws.wsdl.document.mime;
 
+import com.sun.tools.internal.ws.wsdl.framework.Entity;
+import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
-
 /**
  * A MIME multipartRelated extension.
  *
  * @author WS Development Team
  */
-public class MIMEMultipartRelated extends Extension {
+public class MIMEMultipartRelated extends ExtensionImpl {
 
-    public MIMEMultipartRelated() {
+    public MIMEMultipartRelated(Locator locator) {
+        super(locator);
         _parts = new ArrayList<MIMEPart>();
     }
 
@@ -55,8 +56,8 @@
         _parts.add(part);
     }
 
-    public Iterator<MIMEPart> getParts() {
-        return _parts.iterator();
+    public Iterable<MIMEPart> getParts() {
+        return _parts;
     }
 
     public void withAllSubEntitiesDo(EntityAction action) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java
index 7eecfe0e..a8bd08c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,23 +25,24 @@
 
 package com.sun.tools.internal.ws.wsdl.document.mime;
 
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
 import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
 import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * A MIME part extension.
  *
  * @author WS Development Team
  */
-public class MIMEPart extends Extension implements Extensible {
+public class MIMEPart extends ExtensionImpl implements TWSDLExtensible {
 
-    public MIMEPart() {
+    public MIMEPart(Locator locator) {
+        super(locator);
         _helper = new ExtensibilityHelper();
     }
 
@@ -57,11 +58,23 @@
         _name = s;
     }
 
-    public void addExtension(Extension e) {
+    public String getNameValue() {
+        return getName();
+    }
+
+    public String getNamespaceURI() {
+        return getParent().getNamespaceURI();
+    }
+
+    public QName getWSDLElementName() {
+        return getElementName();
+    }
+
+    public void addExtension(TWSDLExtension e) {
         _helper.addExtension(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         return _helper.extensions();
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java
index 439597d..7a444ba 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.mime;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A MIME mimeXml extension.
  *
  * @author WS Development Team
  */
-public class MIMEXml extends Extension {
+public class MIMEXml extends ExtensionImpl {
 
-    public MIMEXml() {
+    public MIMEXml(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/BuiltInTypes.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/BuiltInTypes.java
deleted file mode 100644
index 56f97ed..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/BuiltInTypes.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import javax.xml.namespace.QName;
-
-/**
- *
- * @author WS Development Team
- */
-public interface BuiltInTypes {
-    public QName STRING = SchemaConstants.QNAME_TYPE_STRING;
-    public QName NORMALIZED_STRING =
-        SchemaConstants.QNAME_TYPE_NORMALIZED_STRING;
-    public QName TOKEN = SchemaConstants.QNAME_TYPE_TOKEN;
-    public QName BYTE = SchemaConstants.QNAME_TYPE_BYTE;
-    public QName UNSIGNED_BYTE = SchemaConstants.QNAME_TYPE_UNSIGNED_BYTE;
-    public QName BASE64_BINARY = SchemaConstants.QNAME_TYPE_BASE64_BINARY;
-    public QName HEX_BINARY = SchemaConstants.QNAME_TYPE_HEX_BINARY;
-    public QName INTEGER = SchemaConstants.QNAME_TYPE_INTEGER;
-    public QName POSITIVE_INTEGER = SchemaConstants.QNAME_TYPE_POSITIVE_INTEGER;
-    public QName NEGATIVE_INTEGER = SchemaConstants.QNAME_TYPE_NEGATIVE_INTEGER;
-    public QName NON_NEGATIVE_INTEGER =
-        SchemaConstants.QNAME_TYPE_NON_NEGATIVE_INTEGER;
-    public QName NON_POSITIVE_INTEGER =
-        SchemaConstants.QNAME_TYPE_NON_POSITIVE_INTEGER;
-    public QName INT = SchemaConstants.QNAME_TYPE_INT;
-    public QName UNSIGNED_INT = SchemaConstants.QNAME_TYPE_UNSIGNED_INT;
-    public QName LONG = SchemaConstants.QNAME_TYPE_LONG;
-    public QName UNSIGNED_LONG = SchemaConstants.QNAME_TYPE_UNSIGNED_LONG;
-    public QName SHORT = SchemaConstants.QNAME_TYPE_SHORT;
-    public QName UNSIGNED_SHORT = SchemaConstants.QNAME_TYPE_UNSIGNED_SHORT;
-    public QName DECIMAL = SchemaConstants.QNAME_TYPE_DECIMAL;
-    public QName FLOAT = SchemaConstants.QNAME_TYPE_FLOAT;
-    public QName DOUBLE = SchemaConstants.QNAME_TYPE_DOUBLE;
-    public QName BOOLEAN = SchemaConstants.QNAME_TYPE_BOOLEAN;
-    public QName TIME = SchemaConstants.QNAME_TYPE_TIME;
-    public QName DATE_TIME = SchemaConstants.QNAME_TYPE_DATE_TIME;
-    public QName DURATION = SchemaConstants.QNAME_TYPE_DURATION;
-    public QName DATE = SchemaConstants.QNAME_TYPE_DATE;
-    public QName G_MONTH = SchemaConstants.QNAME_TYPE_G_MONTH;
-    public QName G_YEAR = SchemaConstants.QNAME_TYPE_G_YEAR;
-    public QName G_YEAR_MONTH = SchemaConstants.QNAME_TYPE_G_YEAR_MONTH;
-    public QName G_DAY = SchemaConstants.QNAME_TYPE_G_DAY;
-    public QName G_MONTH_DAY = SchemaConstants.QNAME_TYPE_G_MONTH_DAY;
-    public QName NAME = SchemaConstants.QNAME_TYPE_NAME;
-    public QName QNAME = SchemaConstants.QNAME_TYPE_QNAME;
-    public QName NCNAME = SchemaConstants.QNAME_TYPE_NCNAME;
-    public QName ANY_URI = SchemaConstants.QNAME_TYPE_ANY_URI;
-    public QName ID = SchemaConstants.QNAME_TYPE_ID;
-    public QName IDREF = SchemaConstants.QNAME_TYPE_IDREF;
-    public QName IDREFS = SchemaConstants.QNAME_TYPE_IDREFS;
-    public QName ENTITY = SchemaConstants.QNAME_TYPE_ENTITY;
-    public QName ENTITIES = SchemaConstants.QNAME_TYPE_ENTITIES;
-    public QName NOTATION = SchemaConstants.QNAME_TYPE_NOTATION;
-    public QName NMTOKEN = SchemaConstants.QNAME_TYPE_NMTOKEN;
-    public QName NMTOKENS = SchemaConstants.QNAME_TYPE_NMTOKENS;
-    public QName LANGUAGE = SchemaConstants.QNAME_TYPE_LANGUAGE;
-    public QName ANY_SIMPLE_URTYPE = SchemaConstants.QNAME_TYPE_SIMPLE_URTYPE;
-
-    //xsd:list
-    public QName LIST = SchemaConstants.QNAME_LIST;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/Schema.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/Schema.java
deleted file mode 100644
index 8f302bd..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/Schema.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-import com.sun.tools.internal.ws.wsdl.parser.Constants;
-
-/**
- *
- * @author WS Development Team
- */
-public class Schema extends Extension implements Defining {
-
-    public Schema(AbstractDocument document) {
-        _document = document;
-        _nsPrefixes = new HashMap();
-        _definedEntities = new ArrayList();
-    }
-
-    public QName getElementName() {
-        return SchemaConstants.QNAME_SCHEMA;
-    }
-
-    public SchemaElement getContent() {
-        return _content;
-    }
-
-    public void setContent(SchemaElement entity) {
-        _content = entity;
-        _content.setSchema(this);
-    }
-
-    public void setTargetNamespaceURI(String uri) {
-        _targetNamespaceURI = uri;
-    }
-
-    public String getTargetNamespaceURI() {
-        return _targetNamespaceURI;
-    }
-
-    public void addPrefix(String prefix, String uri) {
-        _nsPrefixes.put(prefix, uri);
-    }
-
-    public String getURIForPrefix(String prefix) {
-        return (String) _nsPrefixes.get(prefix);
-    }
-
-    public Iterator prefixes() {
-        return _nsPrefixes.keySet().iterator();
-    }
-
-    public void defineAllEntities() {
-        if (_content == null) {
-            throw new ValidationException(
-                "validation.shouldNotHappen",
-                "missing schema content");
-        }
-
-        for (Iterator iter = _content.children(); iter.hasNext();) {
-            SchemaElement child = (SchemaElement) iter.next();
-            if (child.getQName().equals(SchemaConstants.QNAME_ATTRIBUTE)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_ATTRIBUTE, name);
-            } else if (
-                child.getQName().equals(
-                    SchemaConstants.QNAME_ATTRIBUTE_GROUP)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_ATTRIBUTE_GROUP, name);
-            } else if (
-                child.getQName().equals(SchemaConstants.QNAME_ELEMENT)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_ELEMENT, name);
-            } else if (child.getQName().equals(SchemaConstants.QNAME_GROUP)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_GROUP, name);
-            } else if (
-                child.getQName().equals(SchemaConstants.QNAME_COMPLEX_TYPE)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_TYPE, name);
-            } else if (
-                child.getQName().equals(SchemaConstants.QNAME_SIMPLE_TYPE)) {
-                QName name =
-                    new QName(
-                        _targetNamespaceURI,
-                        child.getValueOfMandatoryAttribute(
-                            Constants.ATTR_NAME));
-                defineEntity(child, SchemaKinds.XSD_TYPE, name);
-            }
-        }
-    }
-
-    public void defineEntity(SchemaElement element, Kind kind, QName name) {
-        SchemaEntity entity = new SchemaEntity(this, element, kind, name);
-        _document.define(entity);
-        _definedEntities.add(entity);
-    }
-
-    public Iterator definedEntities() {
-        return _definedEntities.iterator();
-    }
-
-    public void validateThis() {
-        if (_content == null) {
-            throw new ValidationException(
-                "validation.shouldNotHappen",
-                "missing schema content");
-        }
-    }
-
-    public String asString(QName name) {
-        if (name.getNamespaceURI().equals("")) {
-            return name.getLocalPart();
-        } else {
-            // look for a prefix
-            for (Iterator iter = prefixes(); iter.hasNext();) {
-                String prefix = (String) iter.next();
-                if (prefix.equals(name.getNamespaceURI())) {
-                    return prefix + ":" + name.getLocalPart();
-                }
-            }
-
-            // not found
-            return null;
-        }
-    }
-
-    private AbstractDocument _document;
-    private String _targetNamespaceURI;
-    private SchemaElement _content;
-    private List _definedEntities;
-    private Map _nsPrefixes;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaAttribute.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaAttribute.java
deleted file mode 100644
index 5da73a6..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaAttribute.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-
-/**
- *
- * @author WS Development Team
- */
-public class SchemaAttribute {
-
-    public SchemaAttribute() {
-    }
-
-    public SchemaAttribute(String localName) {
-        _localName = localName;
-    }
-
-    public String getNamespaceURI() {
-        return _nsURI;
-    }
-
-    public void setNamespaceURI(String s) {
-        _nsURI = s;
-    }
-
-    public String getLocalName() {
-        return _localName;
-    }
-
-    public void setLocalName(String s) {
-        _localName = s;
-    }
-
-    public QName getQName() {
-        return new QName(_nsURI, _localName);
-    }
-
-    public String getValue() {
-        if (_qnameValue != null) {
-            if (_parent == null) {
-                throw new IllegalStateException();
-            } else {
-                return _parent.asString(_qnameValue);
-            }
-        } else {
-            return _value;
-        }
-    }
-
-    public String getValue(WriterContext context) {
-        if (_qnameValue != null) {
-            return context.getQNameString(_qnameValue);
-        } else {
-            return _value;
-        }
-    }
-
-    public void setValue(String s) {
-        _value = s;
-    }
-
-    public void setValue(QName name) {
-        _qnameValue = name;
-    }
-
-    public SchemaElement getParent() {
-        return _parent;
-    }
-
-    public void setParent(SchemaElement e) {
-        _parent = e;
-    }
-
-    private String _nsURI;
-    private String _localName;
-    private String _value;
-    private QName _qnameValue;
-    private SchemaElement _parent;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java
index 381ae62..3d51906 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaDocument.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaDocument.java
deleted file mode 100644
index 25d002e..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaDocument.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.AbstractDocument;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
-import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceValidator;
-import com.sun.tools.internal.ws.wsdl.framework.GloballyKnown;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.NoSuchEntityException;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-
-/**
- * A XML Schema document.
- *
- * @author WS Development Team
- */
-public class SchemaDocument extends AbstractDocument {
-
-    public SchemaDocument() {
-    }
-
-    public Schema getSchema() {
-        return _schema;
-    }
-
-    public void setSchema(Schema s) {
-        _schema = s;
-    }
-
-    public Set collectAllNamespaces() {
-        Set result = super.collectAllNamespaces();
-        if (_schema.getTargetNamespaceURI() != null) {
-            result.add(_schema.getTargetNamespaceURI());
-        }
-        return result;
-    }
-
-    public void validate(EntityReferenceValidator validator) {
-        GloballyValidatingAction action =
-            new GloballyValidatingAction(this, validator);
-        withAllSubEntitiesDo(action);
-        if (action.getException() != null) {
-            throw action.getException();
-        }
-    }
-
-    protected Entity getRoot() {
-        return _schema;
-    }
-
-    private Schema _schema;
-
-    private class GloballyValidatingAction
-        implements EntityAction, EntityReferenceAction {
-        public GloballyValidatingAction(
-            AbstractDocument document,
-            EntityReferenceValidator validator) {
-            _document = document;
-            _validator = validator;
-        }
-
-        public void perform(Entity entity) {
-            try {
-                entity.validateThis();
-                entity.withAllEntityReferencesDo(this);
-                entity.withAllSubEntitiesDo(this);
-            } catch (ValidationException e) {
-                if (_exception == null) {
-                    _exception = e;
-                }
-            }
-        }
-
-        public void perform(Kind kind, QName name) {
-            try {
-                GloballyKnown entity = _document.find(kind, name);
-            } catch (NoSuchEntityException e) {
-                // failed to resolve, check with the validator
-                if (_exception == null) {
-                    if (_validator == null
-                        || !_validator.isValid(kind, name)) {
-                        _exception = e;
-                    }
-                }
-            }
-        }
-
-        public ValidationException getException() {
-            return _exception;
-        }
-
-        private ValidationException _exception;
-        private AbstractDocument _document;
-        private EntityReferenceValidator _validator;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaElement.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaElement.java
deleted file mode 100644
index 1193405..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaElement.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-import com.sun.xml.internal.ws.util.NullIterator;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-/**
- *
- * @author WS Development Team
- */
-public class SchemaElement {
-
-    public SchemaElement() {
-    }
-
-    public SchemaElement(String localName) {
-        _localName = localName;
-    }
-
-    public SchemaElement(QName name) {
-        _qname = name;
-        _localName = name.getLocalPart();
-        _nsURI = name.getNamespaceURI();
-    }
-
-    public String getNamespaceURI() {
-        return _nsURI;
-    }
-
-    public void setNamespaceURI(String s) {
-        _nsURI = s;
-    }
-
-    public String getLocalName() {
-        return _localName;
-    }
-
-    public void setLocalName(String s) {
-        _localName = s;
-    }
-
-    public QName getQName() {
-        if (_qname == null) {
-            _qname = new QName(_nsURI, _localName);
-        }
-        return _qname;
-    }
-
-    public SchemaElement getParent() {
-        return _parent;
-    }
-
-    public void setParent(SchemaElement e) {
-        _parent = e;
-    }
-
-    public SchemaElement getRoot() {
-        return _parent == null ? this : _parent.getRoot();
-    }
-
-    public Schema getSchema() {
-        return _parent == null ? _schema : _parent.getSchema();
-    }
-
-    public void setSchema(Schema s) {
-        _schema = s;
-    }
-
-    public void addChild(SchemaElement e) {
-        if (_children == null) {
-            _children = new ArrayList();
-        }
-
-        _children.add(e);
-        e.setParent(this);
-    }
-
-    public void insertChildAtTop(SchemaElement e) {
-        if (_children == null) {
-            _children = new ArrayList();
-        }
-
-        _children.add(0, e);
-        e.setParent(this);
-    }
-
-    public Iterator children() {
-        if (_children == null) {
-            return NullIterator.getInstance();
-        } else {
-            return _children.iterator();
-        }
-    }
-
-    public void addAttribute(SchemaAttribute a) {
-        if (_attributes == null) {
-            _attributes = new ArrayList();
-        }
-
-        _attributes.add(a);
-        a.setParent(this);
-        a.getValue();
-        // this is a hack to force namespace declarations to be added, if needed
-    }
-
-    public void addAttribute(String name, String value) {
-        SchemaAttribute attr = new SchemaAttribute();
-        attr.setLocalName(name);
-        attr.setValue(value);
-        addAttribute(attr);
-    }
-
-    public void addAttribute(String name, QName value) {
-        SchemaAttribute attr = new SchemaAttribute();
-        attr.setLocalName(name);
-        attr.setValue(value);
-        addAttribute(attr);
-    }
-
-    public Iterator attributes() {
-        if (_attributes == null) {
-            return NullIterator.getInstance();
-        } else {
-            return _attributes.iterator();
-        }
-    }
-
-    public SchemaAttribute getAttribute(String localName) {
-        if (_attributes != null) {
-            for (Iterator iter = _attributes.iterator(); iter.hasNext();) {
-                SchemaAttribute attr = (SchemaAttribute) iter.next();
-                if (localName.equals(attr.getLocalName())) {
-                    return attr;
-                }
-            }
-        }
-        return null;
-    }
-
-    public String getValueOfMandatoryAttribute(String localName) {
-        SchemaAttribute attr = getAttribute(localName);
-        if (attr == null) {
-            throw new ValidationException(
-                "validation.missingRequiredAttribute",
-                new Object[] { localName, _localName });
-        }
-        return attr.getValue();
-    }
-
-    public String getValueOfAttributeOrNull(String localName) {
-        SchemaAttribute attr = getAttribute(localName);
-        if (attr == null) {
-            return null;
-        } else {
-            return attr.getValue();
-        }
-    }
-
-    public boolean getValueOfBooleanAttributeOrDefault(
-        String localName,
-        boolean defaultValue) {
-        String stringValue = getValueOfAttributeOrNull(localName);
-        if (stringValue == null) {
-            return defaultValue;
-        }
-        if (stringValue.equals("true") || stringValue.equals("1")) {
-            return true;
-        } else if (stringValue.equals("false") || stringValue.equals("0")) {
-            return false;
-        } else {
-            throw new ValidationException(
-                "validation.invalidAttributeValue",
-                new Object[] { localName, stringValue });
-        }
-    }
-
-    public int getValueOfIntegerAttributeOrDefault(
-        String localName,
-        int defaultValue) {
-        String stringValue = getValueOfAttributeOrNull(localName);
-        if (stringValue == null) {
-            return defaultValue;
-        }
-        try {
-            return Integer.parseInt(stringValue);
-        } catch (NumberFormatException e) {
-            throw new ValidationException(
-                "validation.invalidAttributeValue",
-                new Object[] { localName, stringValue });
-        }
-    }
-
-    public QName getValueOfQNameAttributeOrNull(String localName) {
-        String stringValue = getValueOfAttributeOrNull(localName);
-        if (stringValue == null)
-            return null;
-
-        String prefix = XmlUtil.getPrefix(stringValue);
-        String uri =
-            (prefix == null ? getURIForPrefix("") : getURIForPrefix(prefix));
-        if (uri == null) {
-            throw new ValidationException(
-                "validation.invalidAttributeValue",
-                new Object[] { localName, stringValue });
-        }
-        return new QName(uri, XmlUtil.getLocalPart(stringValue));
-    }
-
-    public void addPrefix(String prefix, String uri) {
-        if (_nsPrefixes == null) {
-            _nsPrefixes = new HashMap();
-        }
-
-        _nsPrefixes.put(prefix, uri);
-    }
-
-    public String getURIForPrefix(String prefix) {
-        if (_nsPrefixes != null) {
-            String result = (String) _nsPrefixes.get(prefix);
-            if (result != null)
-                return result;
-        }
-        if (_parent != null) {
-            return _parent.getURIForPrefix(prefix);
-        }
-        if (_schema != null) {
-            return _schema.getURIForPrefix(prefix);
-        }
-        // give up
-        return null;
-    }
-
-    public boolean declaresPrefixes() {
-        return _nsPrefixes != null;
-    }
-
-    public Iterator prefixes() {
-        if (_nsPrefixes == null) {
-            return NullIterator.getInstance();
-        } else {
-            return _nsPrefixes.keySet().iterator();
-        }
-    }
-
-    public QName asQName(String s) {
-        String prefix = XmlUtil.getPrefix(s);
-        if (prefix == null) {
-            prefix = "";
-        }
-        String uri = getURIForPrefix(prefix);
-        if (uri == null) {
-            throw new ValidationException("validation.invalidPrefix", prefix);
-        }
-        String localPart = XmlUtil.getLocalPart(s);
-        return new QName(uri, localPart);
-    }
-
-    public String asString(QName name) {
-        if (name.getNamespaceURI().equals("")) {
-            return name.getLocalPart();
-        } else {
-            // look for a prefix
-            for (Iterator iter = prefixes(); iter.hasNext();) {
-                String prefix = (String) iter.next();
-                String uri = getURIForPrefix(prefix);
-                if (uri.equals(name.getNamespaceURI())) {
-                    if (prefix.equals("")) {
-                        return name.getLocalPart();
-                    } else {
-                        return prefix + ":" + name.getLocalPart();
-                    }
-                }
-            }
-
-            // not found
-            if (_parent != null) {
-                return _parent.asString(name);
-            }
-            if (_schema != null) {
-                String result = _schema.asString(name);
-                if (result != null) {
-                    return result;
-                }
-            }
-
-            // not found and no parent
-            String prefix = getNewPrefix();
-            addPrefix(prefix, name.getNamespaceURI());
-            return asString(name);
-        }
-    }
-
-    protected String getNewPrefix() {
-        String base = NEW_NS_PREFIX_BASE;
-        int count = 2;
-        String prefix = null;
-        for (boolean needNewOne = true; needNewOne; ++count) {
-            prefix = base + Integer.toString(count);
-            needNewOne = getURIForPrefix(prefix) != null;
-        }
-        return prefix;
-    }
-
-    private String _nsURI;
-    private String _localName;
-    private List _children;
-    private List _attributes;
-    private Map _nsPrefixes;
-    private SchemaElement _parent;
-    private QName _qname;
-    private Schema _schema;
-
-    private static final String NEW_NS_PREFIX_BASE = "ns";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaEntity.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaEntity.java
deleted file mode 100644
index acfcb8a..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaEntity.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.document.schema;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Defining;
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.GloballyKnown;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-
-/**
- *
- * @author WS Development Team
- */
-public class SchemaEntity extends Entity implements GloballyKnown {
-
-    public SchemaEntity(
-        Schema parent,
-        SchemaElement element,
-        Kind kind,
-        QName name) {
-        _parent = parent;
-        _element = element;
-        _kind = kind;
-        _name = name;
-    }
-
-    public SchemaElement getElement() {
-        return _element;
-    }
-
-    public QName getElementName() {
-        return _element.getQName();
-    }
-
-    public String getName() {
-        return _name.getLocalPart();
-    }
-
-    public Kind getKind() {
-        return _kind;
-    }
-
-    public Schema getSchema() {
-        return _parent;
-    }
-
-    public Defining getDefining() {
-        return _parent;
-    }
-
-    public void validateThis() {
-        // do nothing
-    }
-
-    private Schema _parent;
-    private SchemaElement _element;
-    private Kind _kind;
-    private QName _name;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java
index e43a577..131aa26 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java
index 0cae486..36c982f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,15 @@
  */
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
+import org.xml.sax.Locator;
+
 import javax.xml.namespace.QName;
 
 public class SOAP12Binding extends SOAPBinding{
+    public SOAP12Binding(Locator locator) {
+        super(locator);
+    }
+
     @Override public QName getElementName() {
         return SOAP12Constants.QNAME_BINDING;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java
index e8738d4..a5ba97f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java
index 95a2bfa..89808a8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP address extension.
  *
  * @author WS Development Team
  */
-public class SOAPAddress extends Extension {
+public class SOAPAddress extends ExtensionImpl {
 
-    public SOAPAddress() {
+    public SOAPAddress(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java
index be2fe89..41ee6a2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP binding extension.
  *
  * @author WS Development Team
  */
-public class SOAPBinding extends Extension {
+public class SOAPBinding extends ExtensionImpl {
 
-    public SOAPBinding() {
+    public SOAPBinding(Locator locator) {
+        super(locator);
         _style = SOAPStyle.DOCUMENT;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java
index 0bae750..6f78fa4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP body extension.
  *
  * @author WS Development Team
  */
-public class SOAPBody extends Extension {
+public class SOAPBody extends ExtensionImpl {
 
-    public SOAPBody() {
+    public SOAPBody(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java
index d8ac0cf..11a179a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
-
 import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
 
+import javax.xml.namespace.QName;
+
 /**
  * Interface defining SOAP-related constants.
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java
index b12cf35..452e005 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,20 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP fault extension.
  *
  * @author WS Development Team
  */
-public class SOAPFault extends Extension {
+public class SOAPFault extends ExtensionImpl {
 
-    public SOAPFault() {
+    public SOAPFault(Locator locator) {
+        super(locator);
         _use = SOAPUse.LITERAL;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java
index c75e758..d8e586b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,26 +25,23 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
+import com.sun.tools.internal.ws.wsdl.framework.*;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
-import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
-
 /**
  * A SOAP header extension.
  *
  * @author WS Development Team
  */
-public class SOAPHeader extends Extension {
+public class SOAPHeader extends ExtensionImpl {
 
-    public SOAPHeader() {
+    public SOAPHeader(Locator locator) {
+        super(locator);
         _faults = new ArrayList();
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java
index fa0e1fc..f30e94f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,21 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
 import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP header fault extension.
  *
  * @author WS Development Team
  */
-public class SOAPHeaderFault extends Extension {
+public class SOAPHeaderFault extends ExtensionImpl {
 
-    public SOAPHeaderFault() {
+    public SOAPHeaderFault(Locator locator) {
+        super(locator);
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java
index c519deb..f056317 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,18 +25,21 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import javax.xml.namespace.QName;
+import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
+import org.xml.sax.Locator;
 
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
+import javax.xml.namespace.QName;
 
 /**
  * A SOAP operation extension.
  *
  * @author WS Development Team
  */
-public class SOAPOperation extends Extension {
+public class SOAPOperation extends ExtensionImpl {
 
-    public SOAPOperation() {
+    public SOAPOperation(Locator locator) {
+        super(locator);
+
     }
 
     public QName getElementName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java
index cd5d407..4dc852e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java
index b07e038..793a0d4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java
index 334aa00..a483808 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,15 +25,16 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder;
+import com.sun.tools.internal.ws.wsdl.parser.DOMForest;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.AbortException;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
 
 import javax.xml.namespace.QName;
+import java.util.*;
+
+import org.xml.sax.helpers.LocatorImpl;
 
 /**
  * An abstract class for documents containing entities.
@@ -42,13 +43,17 @@
  */
 public abstract class AbstractDocument {
 
-    protected AbstractDocument() {
-        _kinds = new HashMap();
-        _identifiables = new HashMap();
-        _importedEntities = new ArrayList();
-        _importedDocuments = new HashSet();
-        _includedEntities = new ArrayList();
-        _includedDocuments = new HashSet();
+    protected final DOMForest forest;
+    protected final ErrorReceiver errReceiver;
+
+    protected AbstractDocument(MetadataFinder forest, ErrorReceiver errReceiver) {
+        this.forest = forest;
+        this.errReceiver = errReceiver;
+        kinds = new HashMap();
+        importedEntities = new ArrayList();
+        importedDocuments = new HashSet();
+        includedEntities = new ArrayList();
+        includedDocuments = new HashSet();
     }
 
     public String getSystemId() {
@@ -63,32 +68,32 @@
 
         _systemId = s;
         if (s != null) {
-            _importedDocuments.add(s);
+            importedDocuments.add(s);
         }
     }
 
     public void addIncludedDocument(String systemId) {
-        _includedDocuments.add(systemId);
+        includedDocuments.add(systemId);
     }
 
     public boolean isIncludedDocument(String systemId) {
-        return _includedDocuments.contains(systemId);
+        return includedDocuments.contains(systemId);
     }
 
     public void addIncludedEntity(Entity entity) {
-        _includedEntities.add(entity);
+        includedEntities.add(entity);
     }
 
     public void addImportedDocument(String systemId) {
-        _importedDocuments.add(systemId);
+        importedDocuments.add(systemId);
     }
 
     public boolean isImportedDocument(String systemId) {
-        return _importedDocuments.contains(systemId);
+        return importedDocuments.contains(systemId);
     }
 
     public void addImportedEntity(Entity entity) {
-        _importedEntities.add(entity);
+        importedEntities.add(entity);
     }
 
     public void withAllSubEntitiesDo(EntityAction action) {
@@ -96,20 +101,20 @@
             action.perform(getRoot());
         }
 
-        for (Iterator iter = _importedEntities.iterator(); iter.hasNext();) {
+        for (Iterator iter = importedEntities.iterator(); iter.hasNext();) {
             action.perform((Entity) iter.next());
         }
 
-        for (Iterator iter = _includedEntities.iterator(); iter.hasNext();) {
+        for (Iterator iter = includedEntities.iterator(); iter.hasNext();) {
             action.perform((Entity) iter.next());
         }
     }
 
     public Map getMap(Kind k) {
-        Map m = (Map) _kinds.get(k.getName());
+        Map m = (Map) kinds.get(k.getName());
         if (m == null) {
             m = new HashMap();
-            _kinds.put(k.getName(), m);
+            kinds.put(k.getName(), m);
         }
         return m;
     }
@@ -121,10 +126,12 @@
         QName name =
             new QName(e.getDefining().getTargetNamespaceURI(), e.getName());
 
-        if (map.containsKey(name))
-            throw new DuplicateEntityException(e);
-        else
+        if (map.containsKey(name)){
+            errReceiver.error(e.getLocator(), WsdlMessages.ENTITY_DUPLICATE_WITH_TYPE(e.getElementName().getLocalPart(), e.getName()));
+            throw new AbortException();
+        }else{
             map.put(name, e);
+        }
     }
 
     public void undefine(GloballyKnown e) {
@@ -134,84 +141,24 @@
         QName name =
             new QName(e.getDefining().getTargetNamespaceURI(), e.getName());
 
-        if (map.containsKey(name))
-            throw new NoSuchEntityException(name);
-        else
+        if (map.containsKey(name)){
+            errReceiver.error(e.getLocator(), WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(e.getElementName().getLocalPart(), e.getElementName().getNamespaceURI()));
+            throw new AbortException();
+        } else{
             map.remove(name);
+        }
     }
 
     public GloballyKnown find(Kind k, QName name) {
         Map map = getMap(k);
         Object result = map.get(name);
-        if (result == null)
-            throw new NoSuchEntityException(name);
+        if (result == null){
+            errReceiver.error(new LocatorImpl(), WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(name.getLocalPart(), name.getNamespaceURI()));
+            throw new AbortException();
+        }
         return (GloballyKnown) result;
     }
 
-    public void defineID(Identifiable e) {
-        String id = e.getID();
-        if (id == null)
-            return;
-
-        if (_identifiables.containsKey(id))
-            throw new DuplicateEntityException(e);
-        else
-            _identifiables.put(id, e);
-    }
-
-    public void undefineID(Identifiable e) {
-        String id = e.getID();
-
-        if (id == null)
-            return;
-
-        if (_identifiables.containsKey(id))
-            throw new NoSuchEntityException(id);
-        else
-            _identifiables.remove(id);
-    }
-
-    public Identifiable findByID(String id) {
-        Object result = _identifiables.get(id);
-        if (result == null)
-            throw new NoSuchEntityException(id);
-        return (Identifiable) result;
-    }
-
-    public Set collectAllQNames() {
-        final Set result = new HashSet();
-        EntityAction action = new EntityAction() {
-            public void perform(Entity entity) {
-                entity.withAllQNamesDo(new QNameAction() {
-                    public void perform(QName name) {
-                        result.add(name);
-                    }
-                });
-                entity.withAllSubEntitiesDo(this);
-            }
-        };
-        withAllSubEntitiesDo(action);
-        return result;
-    }
-
-    public Set collectAllNamespaces() {
-        final Set result = new HashSet();
-
-        EntityAction action = new EntityAction() {
-            public void perform(Entity entity) {
-                entity.withAllQNamesDo(new QNameAction() {
-                    public void perform(QName name) {
-                        result.add(name.getNamespaceURI());
-                    }
-                });
-
-                entity.withAllSubEntitiesDo(this);
-            }
-        };
-        withAllSubEntitiesDo(action);
-        return result;
-    }
-
     public void validateLocally() {
         LocallyValidatingAction action = new LocallyValidatingAction();
         withAllSubEntitiesDo(action);
@@ -220,21 +167,16 @@
         }
     }
 
-    public void validate() {
-        validate(null);
-    }
-
     public abstract void validate(EntityReferenceValidator validator);
 
     protected abstract Entity getRoot();
 
-    private Map _kinds;
-    private Map _identifiables;
+    private final Map kinds;
     private String _systemId;
-    private Set _importedDocuments;
-    private List _importedEntities;
-    private Set _includedDocuments;
-    private List _includedEntities;
+    private final Set importedDocuments;
+    private final List importedEntities;
+    private final Set includedDocuments;
+    private final List includedEntities;
 
     private class LocallyValidatingAction implements EntityAction {
         public LocallyValidatingAction() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java
index b61ad7c..11a9b9f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java
index b2da2b7..e9516a7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
                 entity.getElementName().getLocalPart(), name);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.wsdl";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java
index 1ba0653..8dfe14c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import org.xml.sax.Locator;
+
 import javax.xml.namespace.QName;
 
 /**
@@ -34,4 +36,5 @@
  */
 public interface Elemental {
     public QName getElementName();
+    public Locator getLocator();
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java
index c568122..dd3752a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,13 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import org.xml.sax.Locator;
+
 import java.util.HashMap;
 import java.util.Map;
 
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
 /**
  * An entity, typically corresponding to an XML element.
  *
@@ -35,7 +39,18 @@
  */
 public abstract class Entity implements Elemental {
 
-    public Entity() {
+    private final Locator locator;
+    protected ErrorReceiver errorReceiver;
+    public Entity(Locator locator) {
+        this.locator = locator;
+    }
+
+    public void setErrorReceiver(ErrorReceiver errorReceiver) {
+        this.errorReceiver = errorReceiver;
+    }
+
+    public Locator getLocator() {
+        return locator;
     }
 
     public Object getProperty(String key) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java
index 0b1f948..f81991d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java
index 715eaa1..43d5bd6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java
index a09ce94..cf1fbce 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java
index 71452cb..98c481d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,11 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.NoSuchElementException;
 
 /**
  * A helper class for extensible entities.
@@ -40,48 +41,36 @@
     public ExtensibilityHelper() {
     }
 
-    public void addExtension(Extension e) {
+    public void addExtension(TWSDLExtension e) {
         if (_extensions == null) {
             _extensions = new ArrayList();
         }
         _extensions.add(e);
     }
 
-    public Iterator extensions() {
+    public Iterable<TWSDLExtension> extensions() {
         if (_extensions == null) {
-            return new Iterator() {
-                public boolean hasNext() {
-                    return false;
-                }
-
-                public Object next() {
-                    throw new NoSuchElementException();
-                }
-
-                public void remove() {
-                    throw new UnsupportedOperationException();
-                }
-            };
+            return new ArrayList<TWSDLExtension>();
         } else {
-            return _extensions.iterator();
+            return _extensions;
         }
     }
 
     public void withAllSubEntitiesDo(EntityAction action) {
-        if (_extensions != null) {
-            for (Iterator iter = _extensions.iterator(); iter.hasNext();) {
-                action.perform((Entity) iter.next());
-            }
-        }
+//        if (_extensions != null) {
+//            for (Iterator iter = _extensions.iterator(); iter.hasNext();) {
+//                action.perform((Entity) iter.next());
+//            }
+//        }
     }
 
     public void accept(ExtensionVisitor visitor) throws Exception {
         if (_extensions != null) {
             for (Iterator iter = _extensions.iterator(); iter.hasNext();) {
-                ((Extension) iter.next()).accept(visitor);
+                ((ExtensionImpl) iter.next()).accept(visitor);
             }
         }
     }
 
-    private List _extensions;
+    private List<TWSDLExtension> _extensions;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extensible.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extensible.java
deleted file mode 100644
index 1a0a6bec4..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extensible.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.framework;
-
-import java.util.Iterator;
-
-/**
- * An entity that can be extended.
- *
- * @author WS Development Team
- */
-public interface Extensible extends Elemental {
-    public void addExtension(Extension e);
-    public Iterator extensions();
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extension.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extension.java
deleted file mode 100644
index 2d3d643..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Extension.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.framework;
-
-/**
- * An entity extending another entity.
- *
- * @author WS Development Team
- */
-public abstract class Extension extends Entity {
-
-    public Extension() {
-    }
-
-    public Extensible getParent() {
-        return _parent;
-    }
-
-    public void setParent(Extensible parent) {
-        _parent = parent;
-    }
-
-    public void accept(ExtensionVisitor visitor) throws Exception {
-        visitor.preVisit(this);
-        visitor.postVisit(this);
-    }
-
-    private Extensible _parent;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java
new file mode 100644
index 0000000..68447c7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.wsdl.framework;
+
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import org.xml.sax.Locator;
+
+/**
+ * An entity extending another entity.
+ *
+ * @author WS Development Team
+ */
+public abstract class ExtensionImpl extends Entity implements TWSDLExtension {
+
+    public ExtensionImpl(Locator locator) {
+        super(locator);
+    }
+
+    public TWSDLExtensible getParent() {
+        return _parent;
+    }
+
+    public void setParent(TWSDLExtensible parent) {
+        _parent = parent;
+    }
+
+    public void accept(ExtensionVisitor visitor) throws Exception {
+        visitor.preVisit(this);
+        visitor.postVisit(this);
+    }
+
+    private TWSDLExtensible _parent;
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java
index 7676a78..1663cc5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,14 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+
 /**
  * A visitor working on extension entities.
  *
  * @author WS Development Team
  */
 public interface ExtensionVisitor {
-    public void preVisit(Extension extension) throws Exception;
-    public void postVisit(Extension extension) throws Exception;
+    public void preVisit(TWSDLExtension extension) throws Exception;
+    public void postVisit(TWSDLExtension extension) throws Exception;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java
index e570b71..6a2f210 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+
 /**
  * A base class for extension visitors.
  *
@@ -34,8 +36,8 @@
     public ExtensionVisitorBase() {
     }
 
-    public void preVisit(Extension extension) throws Exception {
+    public void preVisit(TWSDLExtension extension) throws Exception {
     }
-    public void postVisit(Extension extension) throws Exception {
+    public void postVisit(TWSDLExtension extension) throws Exception {
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java
index e4370a3..a77e371 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java
index fda7291..952c3a7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,9 @@
 
 package com.sun.tools.internal.ws.wsdl.framework;
 
+import org.xml.sax.Locator;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+
 /**
  * An entity that can be defined in a target namespace.
  *
@@ -32,8 +35,10 @@
  */
 public abstract class GlobalEntity extends Entity implements GloballyKnown {
 
-    public GlobalEntity(Defining defining) {
+    public GlobalEntity(Defining defining, Locator locator, ErrorReceiver errorReceiver) {
+        super(locator);
         _defining = defining;
+        this.errorReceiver = errorReceiver;
     }
 
     public String getName() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java
index b59dc23..925d5fd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java
index 0f70935..b46f368 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java
index f20d0df..501b04c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java
index 87ac0a0..6ef81fa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
         super("entity.notFoundByID", id);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.wsdl";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java
index 5841e2c..2aefe27 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,11 +39,15 @@
         super(key, args);
     }
 
+    public ParseException(Localizable message){
+        super("localized.error", message);
+    }
+
     public ParseException(Throwable throwable) {
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.wsdl";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserContext.java
deleted file mode 100644
index 2781c08..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserContext.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.framework;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import com.sun.xml.internal.ws.util.NamespaceSupport;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-/**
- * The context used by parser classes.
- *
- * @author WS Development Team
- */
-public class ParserContext {
-
-    private final static String PREFIX_XMLNS = "xmlns";
-
-    public ParserContext(AbstractDocument doc, ArrayList listeners) {
-        _document = doc;
-        _listeners = listeners;
-        _nsSupport = new NamespaceSupport();
-        _wsdlLocation = new WSDLLocation();
-    }
-
-    public AbstractDocument getDocument() {
-        return _document;
-    }
-
-    public boolean getFollowImports() {
-        return _followImports;
-    }
-
-    public void setFollowImports(boolean b) {
-        _followImports = b;
-    }
-
-    public void push() {
-        _nsSupport.pushContext();
-    }
-
-    public void pop() {
-        _nsSupport.popContext();
-    }
-
-    public String getNamespaceURI(String prefix) {
-        return _nsSupport.getURI(prefix);
-    }
-
-    public Iterator getPrefixes() {
-        return _nsSupport.getPrefixes();
-    }
-
-    public String getDefaultNamespaceURI() {
-        return getNamespaceURI("");
-    }
-
-    public void registerNamespaces(Element e) {
-        for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
-            Attr a = (Attr) iter.next();
-            if (a.getName().equals(PREFIX_XMLNS)) {
-                // default namespace declaration
-                _nsSupport.declarePrefix("", a.getValue());
-            } else {
-                String prefix = XmlUtil.getPrefix(a.getName());
-                if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
-                    String nsPrefix = XmlUtil.getLocalPart(a.getName());
-                    String uri = a.getValue();
-                    _nsSupport.declarePrefix(nsPrefix, uri);
-                }
-            }
-        }
-    }
-
-    public QName translateQualifiedName(String s) {
-        if (s == null)
-            return null;
-
-        String prefix = XmlUtil.getPrefix(s);
-        String uri = null;
-
-        if (prefix == null) {
-            uri = getDefaultNamespaceURI();
-        } else {
-            uri = getNamespaceURI(prefix);
-            if (uri == null) {
-                throw new ParseException(
-                    "parsing.unknownNamespacePrefix",
-                    prefix);
-            }
-        }
-
-        return new QName(uri, XmlUtil.getLocalPart(s));
-    }
-
-    public void fireIgnoringExtension(QName name, QName parent) {
-        List _targets = null;
-
-        synchronized (this) {
-            if (_listeners != null) {
-                _targets = (List) _listeners.clone();
-            }
-        }
-
-        if (_targets != null) {
-            for (Iterator iter = _targets.iterator(); iter.hasNext();) {
-                ParserListener l = (ParserListener) iter.next();
-                l.ignoringExtension(name, parent);
-            }
-        }
-    }
-
-    public void fireDoneParsingEntity(QName element, Entity entity) {
-        List _targets = null;
-
-        synchronized (this) {
-            if (_listeners != null) {
-                _targets = (List) _listeners.clone();
-            }
-        }
-
-        if (_targets != null) {
-            for (Iterator iter = _targets.iterator(); iter.hasNext();) {
-                ParserListener l = (ParserListener) iter.next();
-                l.doneParsingEntity(element, entity);
-            }
-        }
-    }
-
-    //bug fix: 4856674, WSDLLocation context maintainence
-    //and utility funcitons
-    public void pushWSDLLocation() {
-        _wsdlLocation.push();
-    }
-
-    public void popWSDLLocation() {
-        _wsdlLocation.pop();
-    }
-
-    public void setWSDLLocation(String loc) {
-        _wsdlLocation.setLocation(loc);
-    }
-
-    public String getWSDLLocation() {
-        return _wsdlLocation.getLocation();
-    }
-
-    private boolean _followImports;
-    private AbstractDocument _document;
-    private NamespaceSupport _nsSupport;
-    private ArrayList _listeners;
-    //bug fix:4856674
-    private WSDLLocation _wsdlLocation;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java
index b857bf0..87a1148 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,6 @@
  * @author WS Development Team
  */
 public interface ParserListener {
-    public void ignoringExtension(QName name, QName parent);
+    public void ignoringExtension(Entity entity, QName name, QName parent);
     public void doneParsingEntity(QName element, Entity entity);
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java
index 1588cdef..988cdab 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java
new file mode 100644
index 0000000..87bbfee
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.wsdl.framework;
+
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.wsdl.parser.DOMForest;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.xml.internal.ws.util.NamespaceSupport;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * The context used by parser classes.
+ *
+ * @author WS Development Team
+ */
+public class TWSDLParserContextImpl implements TWSDLParserContext {
+
+    private final static String PREFIX_XMLNS = "xmlns";
+    private boolean _followImports;
+    private final AbstractDocument _document;
+    private final NamespaceSupport _nsSupport;
+    private final ArrayList<ParserListener> _listeners;
+    private final WSDLLocation _wsdlLocation;
+    private final DOMForest forest;
+    private final ErrorReceiver errorReceiver;
+
+    public TWSDLParserContextImpl(DOMForest forest, AbstractDocument doc, ArrayList<ParserListener> listeners, ErrorReceiver errReceiver) {
+        this._document = doc;
+        this._listeners = listeners;
+        this._nsSupport = new NamespaceSupport();
+        this._wsdlLocation = new WSDLLocation();
+        this.forest = forest;
+        this.errorReceiver = errReceiver;
+    }
+
+    public AbstractDocument getDocument() {
+        return _document;
+    }
+
+    public boolean getFollowImports() {
+        return _followImports;
+    }
+
+    public void setFollowImports(boolean b) {
+        _followImports = b;
+    }
+
+    public void push() {
+        _nsSupport.pushContext();
+    }
+
+    public void pop() {
+        _nsSupport.popContext();
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return _nsSupport.getURI(prefix);
+    }
+
+    public Iterable<String> getPrefixes() {
+        return _nsSupport.getPrefixes();
+    }
+
+    public String getDefaultNamespaceURI() {
+        return getNamespaceURI("");
+    }
+
+    public void registerNamespaces(Element e) {
+        for (Iterator iter = XmlUtil.getAllAttributes(e); iter.hasNext();) {
+            Attr a = (Attr) iter.next();
+            if (a.getName().equals(PREFIX_XMLNS)) {
+                // default namespace declaration
+                _nsSupport.declarePrefix("", a.getValue());
+            } else {
+                String prefix = XmlUtil.getPrefix(a.getName());
+                if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
+                    String nsPrefix = XmlUtil.getLocalPart(a.getName());
+                    String uri = a.getValue();
+                    _nsSupport.declarePrefix(nsPrefix, uri);
+                }
+            }
+        }
+    }
+
+    public Locator getLocation(Element e) {
+        return forest.locatorTable.getStartLocation(e);
+    }
+
+    public QName translateQualifiedName(Locator locator, String s) {
+        if (s == null)
+            return null;
+
+        String prefix = XmlUtil.getPrefix(s);
+        String uri = null;
+
+        if (prefix == null) {
+            uri = getDefaultNamespaceURI();
+        } else {
+            uri = getNamespaceURI(prefix);
+            if (uri == null) {
+                errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
+            }
+        }
+
+        return new QName(uri, XmlUtil.getLocalPart(s));
+    }
+
+    public void fireIgnoringExtension(Element e, Entity entity) {
+        QName name = new QName(e.getNamespaceURI(), e.getLocalName());
+        QName parent = entity.getElementName();
+        List _targets = null;
+
+        synchronized (this) {
+            if (_listeners != null) {
+                _targets = (List) _listeners.clone();
+            }
+        }
+
+        if (_targets != null) {
+            for (Iterator iter = _targets.iterator(); iter.hasNext();) {
+                ParserListener l = (ParserListener) iter.next();
+                l.ignoringExtension(entity, name, parent);
+            }
+        }
+    }
+
+    public void fireDoneParsingEntity(QName element, Entity entity) {
+        List _targets = null;
+
+        synchronized (this) {
+            if (_listeners != null) {
+                _targets = (List) _listeners.clone();
+            }
+        }
+
+        if (_targets != null) {
+            for (Iterator iter = _targets.iterator(); iter.hasNext();) {
+                ParserListener l = (ParserListener) iter.next();
+                l.doneParsingEntity(element, entity);
+            }
+        }
+    }
+
+    //bug fix: 4856674, WSDLLocation context maintainence
+    //and utility funcitons
+    public void pushWSDLLocation() {
+        _wsdlLocation.push();
+    }
+
+    public void popWSDLLocation() {
+        _wsdlLocation.pop();
+    }
+
+    public void setWSDLLocation(String loc) {
+        _wsdlLocation.setLocation(loc);
+    }
+
+    public String getWSDLLocation() {
+        return _wsdlLocation.getLocation();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java
index 8b2d51f..d4cd8fb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.tools.internal.ws.wsdl.framework;
 
 import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
 
 /**
  * An exception signalling that validation of an entity failed.
@@ -43,7 +42,7 @@
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.tools.internal.ws.resources.wsdl";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java
index 3e4c03e..800a2a4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,7 @@
 /**
  *
  * Maintains wsdl:location context. This is used with
- * ParserContext, where one each WSDL being imported its location is pushed, this will be used
- * latter to resolve relative imports of schema in SchemaParser.
+ * TWSDLParserContextImpl, where one each WSDL being imported its location is pushed.
  *
  * @author WS Development Team
  */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WriterContext.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WriterContext.java
deleted file mode 100644
index cb5217d..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/WriterContext.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.framework;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import com.sun.xml.internal.ws.util.NamespaceSupport;
-import com.sun.tools.internal.ws.util.xml.PrettyPrintingXmlWriter;
-
-/**
- * The context used by writer classes.
- *
- * @author WS Development Team
- */
-public class WriterContext {
-
-    public WriterContext(OutputStream os) throws IOException {
-        _writer = new PrettyPrintingXmlWriter(os);
-        _nsSupport = new NamespaceSupport();
-        _newPrefixCount = 2;
-    }
-
-    public void flush() throws IOException {
-        _writer.flush();
-    }
-
-    public void close() throws IOException {
-        _writer.close();
-    }
-
-    public void push() {
-        if (_pendingNamespaceDeclarations != null) {
-            throw new IllegalStateException("prefix declarations are pending");
-        }
-        _nsSupport.pushContext();
-    }
-
-    public void pop() {
-        _nsSupport.popContext();
-        _pendingNamespaceDeclarations = null;
-    }
-
-    public String getNamespaceURI(String prefix) {
-        return _nsSupport.getURI(prefix);
-    }
-
-    public Iterator getPrefixes() {
-        return _nsSupport.getPrefixes();
-    }
-
-    public String getDefaultNamespaceURI() {
-        return getNamespaceURI("");
-    }
-
-    public void declarePrefix(String prefix, String uri) {
-        _nsSupport.declarePrefix(prefix, uri);
-        if (_pendingNamespaceDeclarations == null) {
-            _pendingNamespaceDeclarations = new ArrayList();
-        }
-        _pendingNamespaceDeclarations.add(new String[] { prefix, uri });
-    }
-
-    public String getPrefixFor(String uri) {
-        if ((getDefaultNamespaceURI() != null && getDefaultNamespaceURI().equals(uri))
-            || uri.equals("")) {
-            return "";
-        } else {
-            return _nsSupport.getPrefix(uri);
-        }
-    }
-
-    public String findNewPrefix(String base) {
-        return base + Integer.toString(_newPrefixCount++);
-    }
-
-    public String getTargetNamespaceURI() {
-        return _targetNamespaceURI;
-    }
-
-    public void setTargetNamespaceURI(String uri) {
-        _targetNamespaceURI = uri;
-    }
-
-    public void writeStartTag(QName name) throws IOException {
-        _writer.start(getQNameString(name));
-    }
-
-    public void writeEndTag(QName name) throws IOException {
-        _writer.end(getQNameString(name));
-    }
-
-    public void writeAttribute(String name, String value) throws IOException {
-        if (value != null) {
-            _writer.attribute(name, value);
-        }
-    }
-
-    public void writeAttribute(String name, QName value) throws IOException {
-        if (value != null) {
-            _writer.attribute(name, getQNameString(value));
-        }
-    }
-
-    public void writeAttribute(String name, boolean value) throws IOException {
-        writeAttribute(name, value ? "true" : "false");
-    }
-
-    public void writeAttribute(String name, Boolean value) throws IOException {
-        if (value != null) {
-            writeAttribute(name, value.booleanValue());
-        }
-    }
-
-    public void writeAttribute(String name, int value) throws IOException {
-        writeAttribute(name, Integer.toString(value));
-    }
-
-    public void writeAttribute(String name, Object value, Map valueToXmlMap)
-        throws IOException {
-        String actualValue = (String) valueToXmlMap.get(value);
-        writeAttribute(name, actualValue);
-    }
-
-    public void writeNamespaceDeclaration(String prefix, String uri)
-        throws IOException {
-        _writer.attribute(getNamespaceDeclarationAttributeName(prefix), uri);
-    }
-
-    public void writeAllPendingNamespaceDeclarations() throws IOException {
-        if (_pendingNamespaceDeclarations != null) {
-            for (Iterator iter = _pendingNamespaceDeclarations.iterator();
-                iter.hasNext();
-                ) {
-                String[] pair = (String[]) iter.next();
-                writeNamespaceDeclaration(pair[0], pair[1]);
-            }
-        }
-        _pendingNamespaceDeclarations = null;
-    }
-
-    private String getNamespaceDeclarationAttributeName(String prefix) {
-        if (prefix.equals("")) {
-            return "xmlns";
-        } else {
-            return "xmlns:" + prefix;
-        }
-    }
-
-    public void writeTag(QName name, String value) throws IOException {
-        _writer.leaf(getQNameString(name), value);
-    }
-
-    public String getQNameString(QName name) {
-        String nsURI = name.getNamespaceURI();
-        String prefix = getPrefixFor(nsURI);
-        if (prefix == null) {
-            throw new IllegalArgumentException();
-        } else if (prefix.equals("")) {
-            return name.getLocalPart();
-        } else {
-            return prefix + ":" + name.getLocalPart();
-        }
-    }
-
-    public String getQNameStringWithTargetNamespaceCheck(QName name) {
-        if (name.getNamespaceURI().equals(_targetNamespaceURI)) {
-            return name.getLocalPart();
-        } else {
-            return getQNameString(name);
-        }
-    }
-
-    public void writeChars(String chars) throws IOException {
-        _writer.chars(chars);
-    }
-
-    private PrettyPrintingXmlWriter _writer;
-    private NamespaceSupport _nsSupport;
-    private String _targetNamespaceURI;
-    private int _newPrefixCount;
-    private List _pendingNamespaceDeclarations;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java
new file mode 100644
index 0000000..e7956d4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensionHandler;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.wsdl.document.mime.MIMEConstants;
+import org.w3c.dom.Element;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * An abstract implementation class of {@link TWSDLExtensionHandler}
+ *
+ * @author Vivek Pandey
+ */
+public abstract class AbstractExtensionHandler extends TWSDLExtensionHandler {
+    private final Map<String, AbstractExtensionHandler> extensionHandlers;
+    private final Map<String, AbstractExtensionHandler> unmodExtenHandlers;
+
+    public AbstractExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        this.extensionHandlers = extensionHandlerMap;
+        this.unmodExtenHandlers = Collections.unmodifiableMap(extensionHandlers);
+    }
+
+    public Map<String, AbstractExtensionHandler> getExtensionHandlers(){
+        return unmodExtenHandlers;
+    }
+
+    /**
+     * Callback that gets called by the WSDL parser or any other extension handler on finding an extensibility element
+     * that it can't understand.
+     *
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    public boolean doHandleExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        if (parent.getWSDLElementName().equals(MIMEConstants.QNAME_PART)) {
+            return handleMIMEPartExtension(context, parent, e);
+        } else {
+            return super.doHandleExtension(context, parent, e);
+        }
+    }
+
+    /**
+     * Callback for <code>wsdl:mime</code>
+     *
+     * @param context Parser context that will be passed on by the wsdl parser
+     * @param parent  The Parent element within which the extensibility element is defined
+     * @param e       The extensibility elemenet
+     * @return false if there was some error during the extension handling otherwise returns true. If returned false
+     *         then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
+     */
+    protected boolean handleMIMEPartExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e){
+        return false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java
new file mode 100644
index 0000000..83da2aa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * XMLFilter that finds references to other schema files from
+ * SAX events.
+ *
+ * This implementation is a base implementation for typical case
+ * where we just need to look for a particular attribute which
+ * contains an URL to another schema file.
+ *
+ * @author
+ *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *  Vivek Pandey
+ */
+public abstract class AbstractReferenceFinderImpl extends XMLFilterImpl {
+    protected final DOMForest parent;
+
+    protected AbstractReferenceFinderImpl( DOMForest _parent ) {
+        this.parent = _parent;
+    }
+
+    /**
+     * IF the given element contains a reference to an external resource,
+     * return its URL.
+     *
+     * @param nsURI
+     *      Namespace URI of the current element
+     * @param localName
+     *      Local name of the current element
+     * @return
+     *      It's OK to return a relative URL.
+     */
+    protected abstract String findExternalResource( String nsURI, String localName, Attributes atts);
+
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+        throws SAXException {
+        super.startElement(namespaceURI, localName, qName, atts);
+
+        String relativeRef = findExternalResource(namespaceURI,localName,atts);
+        if(relativeRef==null)   return; // non found
+
+        try {
+            // absolutize URL.
+            String ref = new URI(locator.getSystemId()).resolve(new URI(relativeRef)).toString();
+
+            // then parse this schema as well,
+            // but don't mark this document as a root.
+            parent.parse(ref,false);
+        } catch( URISyntaxException e ) {
+            SAXParseException spe = new SAXParseException2(
+                    WsdlMessages.ABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(relativeRef,e.getMessage()),
+                locator, e );
+
+            fatalError(spe);
+            throw spe;
+        } catch( IOException e ) {
+            SAXParseException spe = new SAXParseException2(
+                WsdlMessages.ABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(relativeRef,e.getMessage()),
+                locator, e );
+
+            fatalError(spe);
+            throw spe;
+        }
+    }
+
+    private Locator locator;
+
+    public void setDocumentLocator(Locator locator) {
+        super.setDocumentLocator(locator);
+        this.locator = locator;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java
index a59d0ab..8cc8c58 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java
new file mode 100644
index 0000000..8814ec6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import com.sun.tools.internal.xjc.reader.internalizer.LocatorTable;
+import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import java.util.Set;
+
+/**
+ * Builds DOM while keeping the location information.
+ *
+ * <p>
+ * This class also looks for outer most &lt;jaxws:bindings>
+ * customizations.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *     Vivek Pandey
+ */
+class DOMBuilder extends SAX2DOMEx {
+    /**
+     * Grows a DOM tree under the given document, and
+     * stores location information to the given table.
+     *
+     * @param outerMostBindings
+     *      This set will receive newly found outermost
+     *      jaxb:bindings customizations.
+     */
+    public DOMBuilder( Document dom, LocatorTable ltable, Set outerMostBindings ) {
+        super( dom );
+        this.locatorTable = ltable;
+        this.outerMostBindings = outerMostBindings;
+    }
+
+    /** Location information will be stored into this object. */
+    private final LocatorTable locatorTable;
+
+    private final Set outerMostBindings;
+
+    private Locator locator;
+
+    public void setDocumentLocator(Locator locator) {
+        this.locator = locator;
+        super.setDocumentLocator(locator);
+    }
+
+
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
+        super.startElement(namespaceURI, localName, qName, atts);
+
+        Element e = getCurrentElement();
+        locatorTable.storeStartLocation( e, locator );
+
+        // check if this element is an outer-most <jaxb:bindings>
+        if( JAXWSBindingsConstants.JAXWS_BINDINGS.getNamespaceURI().equals(e.getNamespaceURI())
+        &&  "bindings".equals(e.getLocalName()) ) {
+
+            // if this is the root node (meaning that this file is an
+            // external binding file) or if the parent is XML Schema element
+            // (meaning that this is an "inlined" external binding)
+            Node p = e.getParentNode();
+            if( p instanceof Document) {
+                outerMostBindings.add(e);   // remember this value
+            }
+        }
+    }
+
+    public void endElement(String namespaceURI, String localName, String qName) {
+        locatorTable.storeEndLocation( getCurrentElement(), locator );
+        super.endElement(namespaceURI, localName, qName);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java
new file mode 100644
index 0000000..9659de4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
+import com.sun.tools.internal.xjc.reader.internalizer.LocatorTable;
+import com.sun.xml.internal.bind.marshaller.DataWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Vivek Pandey
+ */
+public class DOMForest {
+    /**
+     * To correctly feed documents to a schema parser, we need to remember
+     * which documents (of the forest) were given as the root
+     * documents, and which of them are read as included/imported
+     * documents.
+     * <p/>
+     * <p/>
+     * Set of system ids as strings.
+     */
+    protected final Set<String> rootDocuments = new HashSet<String>();
+
+    /**
+     * Contains wsdl:import(s)
+     */
+    protected final Set<String> externalReferences = new HashSet<String>();
+
+    /**
+     * actual data storage map&lt;SystemId,Document>.
+     */
+    protected final Map<String, Document> core = new HashMap<String, Document>();
+    protected final WsimportOptions options;
+    protected final ErrorReceiver errorReceiver;
+
+    private final DocumentBuilder documentBuilder;
+    private final SAXParserFactory parserFactory;
+
+    /**
+     * inlined schema elements inside wsdl:type section
+     */
+    protected final List<Element> inlinedSchemaElements = new ArrayList<Element>();
+
+
+    /**
+     * Stores location information for all the trees in this forest.
+     */
+    public final LocatorTable locatorTable = new LocatorTable();
+
+    /**
+     * Stores all the outer-most &lt;jaxb:bindings> customizations.
+     */
+    public final Set<Element> outerMostBindings = new HashSet<Element>();
+
+    /**
+     * Schema language dependent part of the processing.
+     */
+    protected final InternalizationLogic logic;
+
+    public DOMForest(InternalizationLogic logic, WsimportOptions options, ErrorReceiver errReceiver) {
+        this.options = options;
+        this.errorReceiver = errReceiver;
+        this.logic = logic;
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            this.documentBuilder = dbf.newDocumentBuilder();
+
+            this.parserFactory = SAXParserFactory.newInstance();
+            this.parserFactory.setNamespaceAware(true);
+        } catch (ParserConfigurationException e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    public List<Element> getInlinedSchemaElement() {
+        return inlinedSchemaElements;
+    }
+
+    public Document parse(InputSource source, boolean root) throws SAXException {
+        if (source.getSystemId() == null)
+            throw new IllegalArgumentException();
+
+        return parse(source.getSystemId(), source, root);
+    }
+
+    /**
+     * Parses an XML at the given location (
+     * and XMLs referenced by it) into DOM trees
+     * and stores them to this forest.
+     *
+     * @return the parsed DOM document object.
+     */
+    public Document parse(String systemId, boolean root) throws SAXException, IOException {
+
+        systemId = normalizeSystemId(systemId);
+
+        InputSource is = null;
+
+        // allow entity resolver to find the actual byte stream.
+        if (options.entityResolver != null)
+            is = options.entityResolver.resolveEntity(null, systemId);
+        if (is == null)
+            is = new InputSource(systemId);
+        else
+            systemId=is.getSystemId();
+
+        if (core.containsKey(systemId)) {
+            // this document has already been parsed. Just ignore.
+            return core.get(systemId);
+        }
+
+        if(!root)
+            addExternalReferences(systemId);
+
+        // but we still use the original system Id as the key.
+        return parse(systemId, is, root);
+    }
+
+    /**
+     * Parses the given document and add it to the DOM forest.
+     *
+     * @return null if there was a parse error. otherwise non-null.
+     */
+    public Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException {
+        Document dom = documentBuilder.newDocument();
+
+        systemId = normalizeSystemId(systemId);
+
+        boolean retryMex = false;
+        Exception exception = null;
+        // put into the map before growing a tree, to
+        // prevent recursive reference from causing infinite loop.
+        core.put(systemId, dom);
+
+        dom.setDocumentURI(systemId);
+        if (root)
+            rootDocuments.add(systemId);
+
+        try {
+            XMLReader reader = parserFactory.newSAXParser().getXMLReader();
+            reader.setContentHandler(getParserHandler(dom));
+            if (errorReceiver != null)
+                reader.setErrorHandler(errorReceiver);
+            if (options.entityResolver != null)
+                reader.setEntityResolver(options.entityResolver);
+            reader.parse(inputSource);
+             Element doc = dom.getDocumentElement();
+            if (doc == null) {
+                return null;
+            }
+            NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
+            for (int i = 0; i < schemas.getLength(); i++) {
+                inlinedSchemaElements.add((Element) schemas.item(i));
+            }
+        } catch (ParserConfigurationException e) {
+            exception = e;
+        } catch (IOException e) {
+            exception = e;
+        } catch (SAXException e) {
+            exception = e;
+        }
+
+        if (exception != null) {
+            errorReceiver.error(WscompileMessages.WSIMPORT_NO_WSDL(systemId), exception);
+            core.remove(systemId);
+            rootDocuments.remove(systemId);
+        }
+        return dom;
+    }
+
+    public void addExternalReferences(String ref) {
+        if (!externalReferences.contains(ref))
+            externalReferences.add(ref);
+    }
+
+
+    public Set<String> getExternalReferences() {
+        return externalReferences;
+    }
+
+    public interface Handler extends ContentHandler {
+        /**
+         * Gets the DOM that was built.
+         */
+        public Document getDocument();
+    }
+
+    private static abstract class HandlerImpl extends XMLFilterImpl implements Handler {
+    }
+
+    /**
+     * Returns a {@link ContentHandler} to feed SAX events into.
+     * <p/>
+     * The client of this class can feed SAX events into the handler
+     * to parse a document into this DOM forest.
+     */
+    public Handler getParserHandler(String systemId, boolean root) {
+        final Document dom = documentBuilder.newDocument();
+        core.put(systemId, dom);
+        if (root)
+            rootDocuments.add(systemId);
+
+        ContentHandler handler = getParserHandler(dom);
+
+        // we will register the DOM to the map once the system ID becomes available.
+        // but the SAX allows the event source to not to provide that information,
+        // so be prepared for such case.
+        HandlerImpl x = new HandlerImpl() {
+            public Document getDocument() {
+                return dom;
+            }
+        };
+        x.setContentHandler(handler);
+
+        return x;
+    }
+
+    /**
+     * Returns a {@link org.xml.sax.ContentHandler} to feed SAX events into.
+     * <p/>
+     * <p/>
+     * The client of this class can feed SAX events into the handler
+     * to parse a document into this DOM forest.
+     * <p/>
+     * This version requires that the DOM object to be created and registered
+     * to the map beforehand.
+     */
+    private ContentHandler getParserHandler(Document dom) {
+        ContentHandler handler = new DOMBuilder(dom, locatorTable, outerMostBindings);
+        handler = new WhitespaceStripper(handler, errorReceiver, options.entityResolver);
+        handler = new VersionChecker(handler, errorReceiver, options.entityResolver);
+
+        // insert the reference finder so that
+        // included/imported schemas will be also parsed
+        XMLFilterImpl f = logic.createExternalReferenceFinder(this);
+        f.setContentHandler(handler);
+
+        if (errorReceiver != null)
+            f.setErrorHandler(errorReceiver);
+        if (options.entityResolver != null)
+            f.setEntityResolver(options.entityResolver);
+
+        return f;
+    }
+
+    private String normalizeSystemId(String systemId) {
+        try {
+            systemId = new URI(systemId).normalize().toString();
+        } catch (URISyntaxException e) {
+            // leave the system ID untouched. In my experience URI is often too strict
+        }
+        return systemId;
+    }
+
+    boolean isExtensionMode() {
+        return options.isExtensionMode();
+    }
+
+
+    /**
+     * Gets the DOM tree associated with the specified system ID,
+     * or null if none is found.
+     */
+    public Document get(String systemId) {
+        Document doc = core.get(systemId);
+
+        if (doc == null && systemId.startsWith("file:/") && !systemId.startsWith("file://")) {
+            // As of JDK1.4, java.net.URL.toExternal method returns URLs like
+            // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738.
+            // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"),
+            // and this descripancy breaks DOM look up by system ID.
+
+            // this extra check solves this problem.
+            doc = core.get("file://" + systemId.substring(5));
+        }
+
+        if (doc == null && systemId.startsWith("file:")) {
+            // on Windows, filenames are case insensitive.
+            // perform case-insensitive search for improved user experience
+            String systemPath = getPath(systemId);
+            for (String key : core.keySet()) {
+                if (key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) {
+                    doc = core.get(key);
+                    break;
+                }
+            }
+        }
+
+        return doc;
+    }
+
+    /**
+     * Strips off the leading 'file:///' portion from an URL.
+     */
+    private String getPath(String key) {
+        key = key.substring(5); // skip 'file:'
+        while (key.length() > 0 && key.charAt(0) == '/')
+            key = key.substring(1);
+        return key;
+    }
+
+    /**
+     * Gets all the system IDs of the documents.
+     */
+    public String[] listSystemIDs() {
+        return core.keySet().toArray(new String[core.keySet().size()]);
+    }
+
+    /**
+     * Gets the system ID from which the given DOM is parsed.
+     * <p/>
+     * Poor-man's base URI.
+     */
+    public String getSystemId(Document dom) {
+        for (Map.Entry<String, Document> e : core.entrySet()) {
+            if (e.getValue() == dom)
+                return e.getKey();
+        }
+        return null;
+    }
+
+    /**
+     * Gets the first one (which is more or less random) in {@link #rootDocuments}.
+     */
+    public String getFirstRootDocument() {
+        if(rootDocuments.isEmpty()) return null;
+        return rootDocuments.iterator().next();
+    }
+
+    public Set<String> getRootDocuments() {
+        return rootDocuments;
+    }
+
+    /**
+     * Dumps the contents of the forest to the specified stream.
+     * <p/>
+     * This is a debug method. As such, error handling is sloppy.
+     */
+    public void dump(OutputStream out) throws IOException {
+        try {
+            // create identity transformer
+            Transformer it = TransformerFactory.newInstance().newTransformer();
+
+            for (Map.Entry<String, Document> e : core.entrySet()) {
+                out.write(("---<< " + e.getKey() + '\n').getBytes());
+
+                DataWriter dw = new DataWriter(new OutputStreamWriter(out), null);
+                dw.setIndentStep("  ");
+                it.transform(new DOMSource(e.getValue()),
+                        new SAXResult(dw));
+
+                out.write("\n\n\n".getBytes());
+            }
+        } catch (TransformerException e) {
+            e.printStackTrace();
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java
new file mode 100644
index 0000000..4638163
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/**
+ * Produces a complete series of SAX events from any DOM node
+ * in the DOMForest.
+ *
+ * <p>
+ * This class hides a logic of re-associating {@link org.xml.sax.Locator}
+ * to the generated SAX event stream.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ */
+public class DOMForestScanner {
+
+    private final DOMForest forest;
+
+    /**
+     * Scans DOM nodes of the given forest.
+     *
+     * DOM node parameters to the scan method must be a part of
+     * this forest.
+     */
+    public DOMForestScanner( DOMForest _forest ) {
+        this.forest = _forest;
+    }
+
+    /**
+     * Generates the whole set of SAX events by treating
+     * element e as if it's a root element.
+     */
+    public void scan( Element e, ContentHandler contentHandler ) throws SAXException {
+        DOMScanner scanner = new DOMScanner();
+
+        // insert the location resolver into the pipe line
+        LocationResolver resolver = new LocationResolver(scanner);
+        resolver.setContentHandler(contentHandler);
+
+        // parse this DOM.
+        scanner.setContentHandler(resolver);
+        scanner.scan(e);
+    }
+
+    /**
+     * Generates the whole set of SAX events from the given Document
+     * in the DOMForest.
+     */
+    public void scan( Document d, ContentHandler contentHandler ) throws SAXException {
+        scan( d.getDocumentElement(), contentHandler );
+    }
+
+    /**
+     * Intercepts the invocation of the setDocumentLocator method
+     * and passes itself as the locator.
+     *
+     * If the client calls one of the methods on the Locator interface,
+     * use the LocatorTable to resolve the source location.
+     */
+    private class LocationResolver extends XMLFilterImpl implements Locator {
+        LocationResolver( DOMScanner _parent ) {
+            this.parent = _parent;
+        }
+
+        private final DOMScanner parent;
+
+        /**
+         * Flag that tells us whether we are processing a start element event
+         * or an end element event.
+         *
+         * DOMScanner's getCurrentLocation method doesn't tell us which, but
+         * this information is necessary to return the correct source line information.
+         *
+         * Thus we set this flag appropriately before we pass an event to
+         * the next ContentHandler, thereby making it possible to figure
+         * out which location to return.
+         */
+        private boolean inStart = false;
+
+        public void setDocumentLocator(Locator locator) {
+            // ignore one set by the parent.
+
+            super.setDocumentLocator(this);
+        }
+
+        public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+            inStart = false;
+            super.endElement(namespaceURI, localName, qName);
+        }
+
+        public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+            throws SAXException {
+            inStart = true;
+            super.startElement(namespaceURI, localName, qName, atts);
+        }
+
+
+
+
+        private Locator findLocator() {
+            Node n = parent.getCurrentLocation();
+            if( n instanceof Element ) {
+                Element e = (Element)n;
+                if( inStart )
+                    return forest.locatorTable.getStartLocation( e );
+                else
+                    return forest.locatorTable.getEndLocation( e );
+            }
+            return null;
+        }
+
+        //
+        //
+        // Locator methods
+        //
+        //
+        public int getColumnNumber() {
+            Locator l = findLocator();
+            if(l!=null)     return l.getColumnNumber();
+            return          -1;
+        }
+
+        public int getLineNumber() {
+            Locator l = findLocator();
+            if(l!=null)     return l.getLineNumber();
+            return          -1;
+        }
+
+        public String getPublicId() {
+            Locator l = findLocator();
+            if(l!=null)     return l.getPublicId();
+            return          null;
+        }
+
+        public String getSystemId() {
+            Locator l = findLocator();
+            if(l!=null)     return l.getSystemId();
+            return          null;
+        }
+
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandler.java
deleted file mode 100644
index 971940e..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.w3c.dom.Element;
-
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-
-/**
- * A handler for extensions elements definined in one namespace.
- *
- * @author WS Development Team
- */
-public abstract class ExtensionHandler {
-
-    protected ExtensionHandler() {
-    }
-
-    public abstract String getNamespaceURI();
-
-    public void setExtensionHandlers(Map m) {
-        _extensionHandlers = m;
-    }
-
-    public boolean doHandleExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e) {
-        return false;
-    }
-
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-    }
-
-    protected Map _extensionHandlers;
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandlerBase.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandlerBase.java
deleted file mode 100644
index 0e2ffa5..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/ExtensionHandlerBase.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import org.w3c.dom.Element;
-
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEConstants;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-/**
- * A base class for WSDL extension handlers.
- *
- * @author WS Development Team
- */
-public abstract class ExtensionHandlerBase extends ExtensionHandler {
-
-    protected ExtensionHandlerBase() {
-    }
-
-    public boolean doHandleExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e) {
-        if (parent.getElementName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
-            return handleDefinitionsExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_TYPES)) {
-            return handleTypesExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_PORT_TYPE)) {
-            return handlePortTypeExtension(context, parent, e);
-        } else if (
-            parent.getElementName().equals(WSDLConstants.QNAME_BINDING)) {
-            return handleBindingExtension(context, parent, e);
-        } else if (
-            parent.getElementName().equals(WSDLConstants.QNAME_OPERATION)) {
-            return handleOperationExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_INPUT)) {
-            return handleInputExtension(context, parent, e);
-        } else if (
-            parent.getElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
-            return handleOutputExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_FAULT)) {
-            return handleFaultExtension(context, parent, e);
-        } else if (
-            parent.getElementName().equals(WSDLConstants.QNAME_SERVICE)) {
-            return handleServiceExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_PORT)) {
-            return handlePortExtension(context, parent, e);
-        } else if (parent.getElementName().equals(MIMEConstants.QNAME_PART)) {
-            return handleMIMEPartExtension(context, parent, e);
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * @param context
-     * @param parent
-     * @param e
-     * @return true if the PortTypeExtension should be handled
-     */
-    protected abstract boolean handlePortTypeExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-
-    protected abstract boolean handleDefinitionsExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleTypesExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleBindingExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleOperationExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleInputExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleOutputExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleFaultExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleServiceExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handlePortExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-    protected abstract boolean handleMIMEPartExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e);
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java
index bce6c4c..2bfa370 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,93 +25,87 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.io.IOException;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import com.sun.tools.internal.ws.wsdl.document.http.*;
 import org.w3c.dom.Element;
 
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPAddress;
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPBinding;
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPConstants;
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPOperation;
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPUrlEncoded;
-import com.sun.tools.internal.ws.wsdl.document.http.HTTPUrlReplacement;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import java.util.Map;
 
 /**
  * The HTTP extension handler for WSDL.
  *
  * @author WS Development Team
  */
-public class HTTPExtensionHandler extends ExtensionHandlerBase {
+public class HTTPExtensionHandler extends AbstractExtensionHandler {
 
-    public HTTPExtensionHandler() {
+
+    public HTTPExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
     }
 
     public String getNamespaceURI() {
         return Constants.NS_WSDL_HTTP;
     }
 
-    protected boolean handleDefinitionsExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleDefinitionsExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 
-    protected boolean handleTypesExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleTypesExtension(
+        com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 
-    protected boolean handleBindingExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleBindingExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_BINDING)) {
             context.push();
             context.registerNamespaces(e);
 
-            HTTPBinding binding = new HTTPBinding();
+            HTTPBinding binding = new HTTPBinding(context.getLocation(e));
 
             String verb = Util.getRequiredAttribute(e, Constants.ATTR_VERB);
             binding.setVerb(verb);
 
             parent.addExtension(binding);
             context.pop();
-            context.fireDoneParsingEntity(HTTPConstants.QNAME_BINDING, binding);
+//            context.fireDoneParsingEntity(HTTPConstants.QNAME_BINDING, binding);
             return true;
         } else {
             Util.fail(
                 "parsing.invalidExtensionElement",
                 e.getTagName(),
                 e.getNamespaceURI());
-            return false; // keep compiler happy
+            return false;
         }
     }
 
-    protected boolean handleOperationExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleOperationExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_OPERATION)) {
             context.push();
             context.registerNamespaces(e);
 
-            HTTPOperation operation = new HTTPOperation();
+            HTTPOperation operation = new HTTPOperation(context.getLocation(e));
 
             String location =
                 Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
@@ -119,81 +113,81 @@
 
             parent.addExtension(operation);
             context.pop();
-            context.fireDoneParsingEntity(
-                HTTPConstants.QNAME_OPERATION,
-                operation);
+//            context.fireDoneParsingEntity(
+//                HTTPConstants.QNAME_OPERATION,
+//                operation);
             return true;
         } else {
             Util.fail(
                 "parsing.invalidExtensionElement",
                 e.getTagName(),
                 e.getNamespaceURI());
-            return false; // keep compiler happy
+            return false;
         }
     }
 
-    protected boolean handleInputExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleInputExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_URL_ENCODED)) {
-            parent.addExtension(new HTTPUrlEncoded());
+            parent.addExtension(new HTTPUrlEncoded(context.getLocation(e)));
             return true;
         } else if (
             XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_URL_REPLACEMENT)) {
-            parent.addExtension(new HTTPUrlReplacement());
+            parent.addExtension(new HTTPUrlReplacement(context.getLocation(e)));
             return true;
         } else {
             Util.fail(
                 "parsing.invalidExtensionElement",
                 e.getTagName(),
                 e.getNamespaceURI());
-            return false; // keep compiler happy
+            return false;
         }
     }
 
-    protected boolean handleOutputExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleOutputExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 
-    protected boolean handleFaultExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleFaultExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 
-    protected boolean handleServiceExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleServiceExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 
-    protected boolean handlePortExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handlePortExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_ADDRESS)) {
             context.push();
             context.registerNamespaces(e);
 
-            HTTPAddress address = new HTTPAddress();
+            HTTPAddress address = new HTTPAddress(context.getLocation(e));
 
             String location =
                 Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
@@ -201,68 +195,22 @@
 
             parent.addExtension(address);
             context.pop();
-            context.fireDoneParsingEntity(HTTPConstants.QNAME_ADDRESS, address);
+//            context.fireDoneParsingEntity(HTTPConstants.QNAME_ADDRESS, address);
             return true;
         } else {
             Util.fail(
                 "parsing.invalidExtensionElement",
                 e.getTagName(),
                 e.getNamespaceURI());
-            return false; // keep compiler happy
+            return false;
         }
     }
 
-    protected boolean handleMIMEPartExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e) {
+    public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
-        return false; // keep compiler happy
-    }
-
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-        if (extension instanceof HTTPAddress) {
-            HTTPAddress address = (HTTPAddress) extension;
-            context.writeStartTag(address.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_LOCATION,
-                address.getLocation());
-            context.writeEndTag(address.getElementName());
-        } else if (extension instanceof HTTPBinding) {
-            HTTPBinding binding = (HTTPBinding) extension;
-            context.writeStartTag(binding.getElementName());
-            context.writeAttribute(Constants.ATTR_VERB, binding.getVerb());
-            context.writeEndTag(binding.getElementName());
-        } else if (extension instanceof HTTPOperation) {
-            HTTPOperation operation = (HTTPOperation) extension;
-            context.writeStartTag(operation.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_LOCATION,
-                operation.getLocation());
-            context.writeEndTag(operation.getElementName());
-        } else if (extension instanceof HTTPUrlEncoded) {
-            context.writeStartTag(extension.getElementName());
-            context.writeEndTag(extension.getElementName());
-        } else if (extension instanceof HTTPUrlReplacement) {
-            context.writeStartTag(extension.getElementName());
-            context.writeEndTag(extension.getElementName());
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handlePortTypeExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handlePortTypeExtension(ParserContext context, Extensible parent, Element e) {
-        Util.fail(
-            "parsing.invalidExtensionElement",
-            e.getTagName(),
-            e.getNamespaceURI());
-        return false; // keep compiler happy
+        return false;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java
new file mode 100644
index 0000000..f3d5c75
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import org.w3c.dom.Element;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/**
+ * Encapsulates schema-language dependent internalization logic.
+ *
+ * {@link com.sun.tools.internal.xjc.reader.internalizer.Internalizer} and {@link DOMForest} are responsible for
+ * doing schema language independent part, and this object is responsible
+ * for schema language dependent part.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *     Vivek Pandey
+ */
+public interface InternalizationLogic {
+    /**
+     * Creates a new instance of XMLFilter that can be used to
+     * find references to external schemas.
+     *
+     * <p>
+     * Schemas that are included/imported need to be a part of
+     * {@link DOMForest}, and this filter will be expected to
+     * find such references.
+     *
+     * <p>
+     * Once such a reference is found, the filter is expected to
+     * call the parse method of DOMForest.
+     *
+     * <p>
+     * {@link DOMForest} will register ErrorHandler to the returned
+     * object, so any error should be sent to that error handler.
+     *
+     * @return
+     *      This method returns {@link org.xml.sax.helpers.XMLFilterImpl} because
+     *      the filter has to be usable for two directions
+     *      (wrapping a reader and wrapping a ContentHandler)
+     */
+    XMLFilterImpl createExternalReferenceFinder( DOMForest parent );
+
+    /**
+     * Checks if the specified element is a valid target node
+     * to attach a customization.
+     *
+     * @param parent
+     *      The owner DOMForest object. Probably useful only
+     *      to obtain context information, such as error handler.
+     * @param bindings
+     *      &lt;jaxb:bindings> element or a customization element.
+     * @return
+     *      true if it's OK, false if not.
+     */
+    boolean checkIfValidTargetNode( DOMForest parent, Element bindings, Element target );
+
+    /**
+     * Prepares an element that actually receives customizations.
+     *
+     * <p>
+     * For example, in XML Schema, target nodes can be any schema
+     * element but it is always the &lt;xsd:appinfo> element that
+     * receives customization.
+     *
+     * @param target
+     *      The target node designated by the customization.
+     * @return
+     *      Always return non-null valid object
+     */
+    Element refineSchemaTarget( Element target );
+
+    /**
+     * Prepares a WSDL element that actually receives customizations.
+     *
+     *
+     * @param target
+     *      The target node designated by the customization.
+     * @return
+     *      Always return non-null valid object
+     */
+    Element refineWSDLTarget( Element target );
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java
index bf85b29..ec65482 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,39 +24,28 @@
  */
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.io.UnsupportedEncodingException;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import com.sun.tools.internal.xjc.util.DOMUtils;
+import com.sun.xml.internal.bind.v2.util.EditDistance;
+import com.sun.xml.internal.ws.util.JAXWSUtils;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.*;
+import org.xml.sax.SAXParseException;
 
-import javax.xml.namespace.QName;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.sun.tools.internal.xjc.util.DOMUtils;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
 
 
 /**
@@ -64,33 +53,27 @@
  * @author Vivek Pandey
  */
 public class Internalizer {
-    private Map<String, Document> wsdlDocuments;
-    private Map<String, Document> jaxwsBindings;
     private static final XPathFactory xpf = XPathFactory.newInstance();
     private final XPath xpath = xpf.newXPath();
-    private final  LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.wsdl");;
-    private ProcessorEnvironment env;
-    public  void transform(Map<String, Document> jaxwsBindings, Map<String, Document> wsdlDocuments, ProcessorEnvironment env) {
-        if(jaxwsBindings == null)
-            return;
-        this.env = env;
-        this.wsdlDocuments = wsdlDocuments;
-        this.jaxwsBindings = jaxwsBindings;
-        Map targetNodes = new HashMap<Element, Node>();
+    private final WsimportOptions options;
+    private final DOMForest forest;
+    private final ErrorReceiver errorReceiver;
 
-        // identify target nodes for all <JAXWS:bindings>
-        for(Map.Entry<String, Document> jaxwsBinding : jaxwsBindings.entrySet()) {
-            Element e = jaxwsBinding.getValue().getDocumentElement();
-            // initially, the inherited context is itself
-            buildTargetNodeMap( e, e, targetNodes );
+
+    public Internalizer(DOMForest forest, WsimportOptions options, ErrorReceiver errorReceiver) {
+        this.forest = forest;
+        this.options = options;
+        this.errorReceiver = errorReceiver;
+    }
+
+    public void transform(){
+        Map<Element,Node> targetNodes = new HashMap<Element,Node>();
+        for(Element jaxwsBinding : forest.outerMostBindings){
+            buildTargetNodeMap(jaxwsBinding, jaxwsBinding, targetNodes );
         }
-
-        // then move them to their respective positions.
-        for(Map.Entry<String, Document> jaxwsBinding : jaxwsBindings.entrySet()) {
-            Element e = jaxwsBinding.getValue().getDocumentElement();
-            move( e, targetNodes );
+        for(Element jaxwsBinding : forest.outerMostBindings){
+            move(jaxwsBinding, targetNodes );
         }
-
     }
 
     /**
@@ -112,47 +95,6 @@
     }
 
     /**
-     * Gets the DOM tree associated with the specified system ID,
-     * or null if none is found.
-     */
-    public Document get( String systemId ) {
-        Document doc = wsdlDocuments.get(systemId);
-
-        if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) {
-            // As of JDK1.4, java.net.URL.toExternal method returns URLs like
-            // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738.
-            // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"),
-            // and this descripancy breaks DOM look up by system ID.
-
-            // this extra check solves this problem.
-            doc = wsdlDocuments.get( "file://"+systemId.substring(5) );
-        }
-
-        if( doc==null && systemId.startsWith("file:") ) {
-            // on Windows, filenames are case insensitive.
-            // perform case-insensitive search for improved user experience
-            String systemPath = getPath(systemId);
-            for (String key : wsdlDocuments.keySet()) {
-                if(key.startsWith("file:") && getPath(key).equalsIgnoreCase(systemPath)) {
-                    doc = wsdlDocuments.get(key);
-                    break;
-                }
-            }
-        }
-        return doc;
-    }
-
-    /**
-     * Strips off the leading 'file:///' portion from an URL.
-     */
-    private String getPath(String key) {
-        key = key.substring(5); // skip 'file:'
-        while(key.length()>0 && key.charAt(0)=='/')
-            key = key.substring(1);
-        return key;
-    }
-
-    /**
      * Determines the target node of the "bindings" element
      * by using the inherited target node, then put
      * the result into the "result" map.
@@ -171,26 +113,49 @@
                 // absolutize this URI.
                 // TODO: use the URI class
                 // TODO: honor xml:base
-                wsdlLocation = new URL(new URL(getSystemId(bindings.getOwnerDocument())),
+                wsdlLocation = new URL(new URL(forest.getSystemId(bindings.getOwnerDocument())),
                         wsdlLocation ).toExternalForm();
             } catch( MalformedURLException e ) {
                 wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
             }
 
-            target = get(wsdlLocation);
+            //target = wsdlDocuments.get(wsdlLocation);
+            target = forest.get(wsdlLocation);
             if(target==null) {
-                error("internalizer.targetNotFound", new Object[]{wsdlLocation});
+                reportError(bindings, WsdlMessages.INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(wsdlLocation, EditDistance.findNearest(wsdlLocation, forest.listSystemIDs())));
                 return; // abort processing this <JAXWS:bindings>
             }
         }
 
+        //if the target node is xs:schema, declare the jaxb version on it as latter on it will be
+        //required by the inlined schema bindings
+
+        Element element = DOMUtil.getFirstElementChild(target);
+        if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) {
+            //get all schema elements
+            Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types");
+            if(type != null){
+                for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) {
+                    if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) {
+                        schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
+                    }
+
+                    //add jaxb:bindings version info. Lets put it to 1.0, may need to change latter
+                    if (!schemaElement.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "version")) {
+                        schemaElement.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:version", JAXWSBindingsConstants.JAXB_BINDING_VERSION);
+                    }
+                }
+            }
+        }
+
+
         boolean hasNode = true;
-        if(isJAXWSBindings(bindings) && bindings.getAttributeNode("node")!=null ) {
-            target = evaluateXPathNode(target, bindings.getAttribute("node"), new NamespaceContextImpl(bindings));
+        if((isJAXWSBindings(bindings) || isJAXBBindings(bindings)) && bindings.getAttributeNode("node")!=null ) {
+            target = evaluateXPathNode(bindings, target, bindings.getAttribute("node"), new NamespaceContextImpl(bindings));
         }else if(isJAXWSBindings(bindings) && (bindings.getAttributeNode("node")==null) && !isTopLevelBinding(bindings)) {
             hasNode = false;
         }else if(isGlobalBinding(bindings) && !isWSDLDefinition(target) && isTopLevelBinding(bindings.getParentNode())){
-            target = getWSDLDefintionNode(target);
+            target = getWSDLDefintionNode(bindings, target);
         }
 
         //if target is null it means the xpath evaluation has some problem,
@@ -203,14 +168,14 @@
             result.put( bindings, target );
 
         // look for child <JAXWS:bindings> and process them recursively
-        Element[] children = getChildElements( bindings, JAXWSBindingsConstants.NS_JAXWS_BINDINGS);
-        for( int i=0; i<children.length; i++ )
-            buildTargetNodeMap( children[i], target, result );
+        Element[] children = getChildElements( bindings);
+        for (Element child : children)
+            buildTargetNodeMap(child, target, result);
     }
 
-    private Node getWSDLDefintionNode(Node target){
-        return evaluateXPathNode(target, "wsdl:definitions",
-            new javax.xml.namespace.NamespaceContext(){
+    private Node getWSDLDefintionNode(Node bindings, Node target){
+        return evaluateXPathNode(bindings, target, "wsdl:definitions",
+            new NamespaceContext(){
                 public String getNamespaceURI(String prefix){
                     return "http://schemas.xmlsoap.org/wsdl/";
                 }
@@ -227,11 +192,7 @@
             return false;
         String localName = target.getLocalName();
         String nsURI = target.getNamespaceURI();
-        if(((localName != null) && localName.equals("definitions")) &&
-            (nsURI != null && nsURI.equals("http://schemas.xmlsoap.org/wsdl/")))
-            return true;
-        return false;
-
+        return fixNull(localName).equals("definitions") && fixNull(nsURI).equals("http://schemas.xmlsoap.org/wsdl/");
     }
 
     private boolean isTopLevelBinding(Node node){
@@ -244,9 +205,13 @@
         return (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) && bindings.getLocalName().equals("bindings"));
     }
 
+    private boolean isJAXBBindings(Node bindings){
+        return (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS) && bindings.getLocalName().equals("bindings"));
+    }
+
     private boolean isGlobalBinding(Node bindings){
-        if((bindings.getNamespaceURI() == null)){
-            warn("invalid.customization.namespace", new Object[]{bindings.getLocalName()});
+        if(bindings.getNamespaceURI() == null){
+            errorReceiver.warning(forest.locatorTable.getStartLocation((Element) bindings), WsdlMessages.INVALID_CUSTOMIZATION_NAMESPACE(bindings.getLocalName()));
             return false;
         }
         return  (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) &&
@@ -257,47 +222,46 @@
                 bindings.getLocalName().equals("enableMIMEContent")));
     }
 
-    private static Element[] getChildElements(Element parent, String nsUri) {
-        ArrayList a = new ArrayList();
+    private static Element[] getChildElements(Element parent) {
+        ArrayList<Element> a = new ArrayList<Element>();
         NodeList children = parent.getChildNodes();
         for( int i=0; i<children.getLength(); i++ ) {
             Node item = children.item(i);
             if(!(item instanceof Element ))     continue;
 
-            if(nsUri.equals(item.getNamespaceURI()))
-                a.add(item);
+            if(JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(item.getNamespaceURI()) ||
+                    JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI()))
+                a.add((Element)item);
         }
-        return (Element[]) a.toArray(new Element[a.size()]);
+        return a.toArray(new Element[a.size()]);
     }
 
-    private Node evaluateXPathNode(Node target, String expression, NamespaceContext namespaceContext) {
+    private Node evaluateXPathNode(Node bindings, Node target, String expression, NamespaceContext namespaceContext) {
         NodeList nlst;
         try {
             xpath.setNamespaceContext(namespaceContext);
             nlst = (NodeList)xpath.evaluate(expression, target, XPathConstants.NODESET);
         } catch (XPathExpressionException e) {
-            error("internalizer.XPathEvaluationError", new Object[]{e.getMessage()});
-            if(env.verbose())
-                e.printStackTrace();
+            reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATION_ERROR(e.getMessage()), e);
             return null; // abort processing this <jaxb:bindings>
         }
 
         if( nlst.getLength()==0 ) {
-            error("internalizer.XPathEvaluatesToNoTarget", new Object[]{expression});
+            reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(expression));
             return null; // abort
         }
 
         if( nlst.getLength()!=1 ) {
-            error("internalizer.XPathEvaulatesToTooManyTargets", new Object[]{expression, nlst.getLength()});
+            reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(expression, nlst.getLength()));
             return null; // abort
         }
 
         Node rnode = nlst.item(0);
         if(!(rnode instanceof Element )) {
-            error("internalizer.XPathEvaluatesToNonElement", new Object[]{expression});
+            reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(expression));
             return null; // abort
         }
-        return (Element)rnode;
+        return rnode;
     }
 
     /**
@@ -330,15 +294,11 @@
     }
 
     private boolean isJAXBBindingElement(Element e){
-        if((e.getNamespaceURI() != null ) && e.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS))
-            return true;
-        return false;
+        return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS);
     }
 
     private boolean isJAXWSBindingElement(Element e){
-        if((e.getNamespaceURI() != null ) && e.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS))
-            return true;
-        return false;
+        return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS);
     }
 
     /**
@@ -366,6 +326,19 @@
                 target.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:version", JAXWSBindingsConstants.JAXB_BINDING_VERSION);
             }
 
+            // HACK: allow XJC extension all the time. This allows people to specify
+            // the <xjc:someExtension> in the external bindings. Otherwise users lack the ability
+            // to specify jaxb:extensionBindingPrefixes, so it won't work.
+            //
+            // the current workaround is still problematic in the sense that
+            // it can't support user-defined extensions. This needs more careful thought.
+
+            //JAXB doesn't allow writing jaxb:extensionbindingPrefix anywhere other than root element so lets write only on <xs:schema>
+            if(target.getLocalName().equals("schema") && target.getNamespaceURI().equals(Constants.NS_XSD)&& !target.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "extensionBindingPrefixes")){
+                target.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:extensionBindingPrefixes", "xjc");
+                target.setAttributeNS(Constants.NS_XMLNS, "xmlns:xjc", JAXWSBindingsConstants.NS_XJC_BINDINGS);
+            }
+
             //insert xs:annotation/xs:appinfo where in jaxb:binding will be put
             target = refineSchemaTarget(target);
             copyInscopeNSAttributes(decl);
@@ -385,7 +358,6 @@
         // finally move the declaration to the target node.
         if( target.getOwnerDocument()!=decl.getOwnerDocument() ) {
             // if they belong to different DOM documents, we need to clone them
-            Element original = decl;
             decl = (Element)target.getOwnerDocument().importNode(decl,true);
 
         }
@@ -400,7 +372,7 @@
      */
     private void copyInscopeNSAttributes(Element e){
         Element p = e;
-        Set inscopes = new HashSet();
+        Set<String> inscopes = new HashSet<String>();
         while(true) {
             NamedNodeMap atts = p.getAttributes();
             for( int i=0; i<atts.getLength(); i++ ) {
@@ -502,37 +474,25 @@
         return child;
     }
 
-    private String getSystemId(Document doc){
-        for(Map.Entry<String, Document> e:jaxwsBindings.entrySet()){
-            if (e.getValue() == doc)
-                return e.getKey();
-        }
-        return null;
-    }
-
-    protected void warn(Localizable msg) {
-        env.warn(msg);
+    private static @NotNull String fixNull(@Nullable String s) {
+        if(s==null) return "";
+        else        return s;
     }
 
 
-    protected void error(String key, Object[] args) {
-        env.error(messageFactory.getMessage(key, args));
+    private void reportError( Element errorSource, String formattedMsg ) {
+        reportError( errorSource, formattedMsg, null );
     }
 
-    protected void warn(String key) {
-        env.warn(messageFactory.getMessage(key));
+    private void reportError( Element errorSource,
+        String formattedMsg, Exception nestedException ) {
+
+        SAXParseException e = new SAXParseException2( formattedMsg,
+            forest.locatorTable.getStartLocation(errorSource),
+            nestedException );
+        errorReceiver.error(e);
     }
 
-    protected void warn(String key, Object[] args) {
-        env.warn(messageFactory.getMessage(key, args));
-    }
 
-    protected void info(String key) {
-        env.info(messageFactory.getMessage(key));
-    }
-
-    protected void info(String key, String arg) {
-        env.info(messageFactory.getMessage(key, arg));
-    }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java
index 775a2e8..58c605b7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,31 +24,27 @@
  */
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.util.Iterator;
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPathFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
 import com.sun.tools.internal.ws.wsdl.document.*;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.CustomName;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
 import com.sun.tools.internal.ws.wsdl.document.jaxws.Parameter;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.util.Iterator;
+import java.util.Map;
 
 
 /**
@@ -57,19 +53,17 @@
  * jaxws:bindings exension handler.
  *
  */
-public class JAXWSBindingExtensionHandler extends ExtensionHandlerBase {
+public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler {
 
     private static final XPathFactory xpf = XPathFactory.newInstance();
     private final XPath xpath = xpf.newXPath();
 
-    /**
-     *
-     */
-    public JAXWSBindingExtensionHandler() {
+    public JAXWSBindingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
     }
 
     /* (non-Javadoc)
-     * @see ExtensionHandler#getNamespaceURI()
+     * @see AbstractExtensionHandler#getNamespaceURI()
      */
     public String getNamespaceURI() {
         return JAXWSBindingsConstants.NS_JAXWS_BINDINGS;
@@ -80,13 +74,13 @@
      * @param parent
      * @param e
      */
-    private boolean parseGlobalJAXWSBindings(ParserContext context, Extensible parent, Element e) {
+    private boolean parseGlobalJAXWSBindings(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         context.push();
         context.registerNamespaces(e);
 
         JAXWSBinding jaxwsBinding =  getJAXWSExtension(parent);
         if(jaxwsBinding == null)
-            jaxwsBinding = new JAXWSBinding();
+            jaxwsBinding = new JAXWSBinding(context.getLocation(e));
         String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR);
         if (attr != null) {
             jaxwsBinding.setWsdlLocation(attr);
@@ -132,15 +126,14 @@
         }
         parent.addExtension(jaxwsBinding);
         context.pop();
-        context.fireDoneParsingEntity(
-                JAXWSBindingsConstants.JAXWS_BINDINGS,
-                jaxwsBinding);
+//        context.fireDoneParsingEntity(
+//                JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                jaxwsBinding);
         return true;
     }
 
-    private static JAXWSBinding getJAXWSExtension(Extensible extensible) {
-        for (Iterator iter = extensible.extensions(); iter.hasNext();) {
-            Extension extension = (Extension)iter.next();
+    private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
+        for (TWSDLExtension extension:extensible.extensions()) {
             if (extension.getClass().equals(JAXWSBinding.class)) {
                 return (JAXWSBinding)extension;
             }
@@ -154,7 +147,7 @@
      * @param parent
      * @param e
      */
-    private void parseProvider(ParserContext context, Extensible parent, Element e) {
+    private void parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
         String val = e.getTextContent();
         if(val == null)
             return;
@@ -172,7 +165,7 @@
      * @param parent
      * @param e
      */
-    private void parseJAXBBindings(ParserContext context, Extensible parent, Element e) {
+    private void parseJAXBBindings(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         JAXWSBinding binding = (JAXWSBinding)parent;
         binding.addJaxbBindings(e);
     }
@@ -182,7 +175,7 @@
      * @param parent
      * @param e
      */
-    private void parsePackage(ParserContext context, Extensible parent, Element e) {
+    private void parsePackage(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
         //System.out.println("In handlePackageExtension: " + e.getNodeName());
         String packageName = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
         JAXWSBinding binding = (JAXWSBinding)parent;
@@ -194,7 +187,7 @@
      * @param parent
      * @param e
      */
-    private void parseWrapperStyle(ParserContext context, Extensible parent, Element e) {
+    private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
         //System.out.println("In handleWrapperStyleExtension: " + e.getNodeName());
         String val = e.getTextContent();
         if(val == null)
@@ -211,7 +204,7 @@
      * @param parent
      * @param e
      */
-//    private void parseAdditionalSOAPHeaderMapping(ParserContext context, Extensible parent, Element e) {
+//    private void parseAdditionalSOAPHeaderMapping(TWSDLParserContextImpl context, TWSDLExtensible parent, Element e) {
 //        //System.out.println("In handleAdditionalSOAPHeaderExtension: " + e.getNodeName());
 //        String val = e.getTextContent();
 //        if(val == null)
@@ -228,7 +221,7 @@
      * @param parent
      * @param e
      */
-    private void parseAsynMapping(ParserContext context, Extensible parent, Element e) {
+    private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
         //System.out.println("In handleAsynMappingExtension: " + e.getNodeName());
         String val = e.getTextContent();
         if(val == null)
@@ -245,7 +238,7 @@
      * @param parent
      * @param e
      */
-    private void parseMimeContent(ParserContext context, Extensible parent, Element e) {
+    private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
         //System.out.println("In handleMimeContentExtension: " + e.getNodeName());
         String val = e.getTextContent();
         if(val == null)
@@ -262,7 +255,7 @@
      * @param jaxwsBinding
      * @param e
      */
-    private void parseMethod(ParserContext context, JAXWSBinding jaxwsBinding, Element e) {
+    private void parseMethod(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
         String methodName = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
         String javaDoc = getJavaDoc(e);
         CustomName name = new CustomName(methodName, javaDoc);
@@ -274,7 +267,7 @@
      * @param jaxwsBinding
      * @param e
      */
-    private void parseParameter(ParserContext context, JAXWSBinding jaxwsBinding, Element e) {
+    private void parseParameter(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
         String part = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.PART_ATTR);
         Element msgPartElm = evaluateXPathNode(e.getOwnerDocument(), part, new NamespaceContextImpl(e));
         Node msgElm = msgPartElm.getParentNode();
@@ -332,7 +325,7 @@
      * @param jaxwsBinding
      * @param e
      */
-    private void parseClass(ParserContext context, JAXWSBinding jaxwsBinding, Element e) {
+    private void parseClass(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
         String className = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
         String javaDoc = getJavaDoc(e);
         jaxwsBinding.setClassName(new CustomName(className, javaDoc));
@@ -344,7 +337,7 @@
      * @param jaxwsBinding
      * @param e
      */
-    private void parseException(ParserContext context, JAXWSBinding jaxwsBinding, Element e) {
+    private void parseException(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
         for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
             Element e2 = Util.nextElement(iter);
             if (e2 == null)
@@ -357,29 +350,15 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleDefinitionsExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleDefinitionsExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         return parseGlobalJAXWSBindings(context, parent, e);
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleTypesExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleTypesExtension(ParserContext context, Extensible parent, Element e) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handlePortTypeExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handlePortTypeExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -405,9 +384,9 @@
             }
             parent.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -418,12 +397,7 @@
         }
     }
 
-
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleOperationExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleOperationExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             if(parent instanceof Operation){
                 return handlePortTypeOperation(context, (Operation)parent, e);
@@ -440,17 +414,11 @@
         return false;
     }
 
-    /**
-     * @param context
-     * @param operation
-     * @param e
-     * @return
-     */
-    private boolean handleBindingOperation(ParserContext context, BindingOperation operation, Element e) {
+    private boolean handleBindingOperation(TWSDLParserContext context, BindingOperation operation, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -474,9 +442,9 @@
             }
             operation.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -487,16 +455,10 @@
         }
     }
 
-    /**
-     * @param context
-     * @param parent
-     * @param e
-     * @return
-     */
-    private boolean handlePortTypeOperation(ParserContext context, Operation parent, Element e) {
+    private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) {
         context.push();
         context.registerNamespaces(e);
-        JAXWSBinding jaxwsBinding = new JAXWSBinding();
+        JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
         for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
             Element e2 = Util.nextElement(iter);
@@ -524,20 +486,17 @@
         }
         parent.addExtension(jaxwsBinding);
         context.pop();
-        context.fireDoneParsingEntity(
-                JAXWSBindingsConstants.JAXWS_BINDINGS,
-                jaxwsBinding);
+//        context.fireDoneParsingEntity(
+//                JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                jaxwsBinding);
         return true;
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleBindingExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleBindingExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -559,9 +518,9 @@
             }
             parent.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -573,29 +532,13 @@
     }
 
     /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleInputExtension(ParserContext, Extensible, org.w3c.dom.Element)
+     * @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element)
      */
-    protected boolean handleInputExtension(ParserContext context, Extensible parent, Element e) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleOutputExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleOutputExtension(ParserContext context, Extensible parent, Element e) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleFaultExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleFaultExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -616,9 +559,9 @@
             }
             parent.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -629,14 +572,11 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleServiceExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleServiceExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -657,9 +597,9 @@
             }
             parent.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -670,14 +610,11 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handlePortExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handlePortExtension(ParserContext context, Extensible parent, Element e) {
+    public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
         if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
             context.push();
             context.registerNamespaces(e);
-            JAXWSBinding jaxwsBinding = new JAXWSBinding();
+            JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
 
             for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
                 Element e2 = Util.nextElement(iter);
@@ -701,9 +638,9 @@
             }
             parent.addExtension(jaxwsBinding);
             context.pop();
-            context.fireDoneParsingEntity(
-                    JAXWSBindingsConstants.JAXWS_BINDINGS,
-                    jaxwsBinding);
+//            context.fireDoneParsingEntity(
+//                    JAXWSBindingsConstants.JAXWS_BINDINGS,
+//                    jaxwsBinding);
             return true;
         }else {
             Util.fail(
@@ -714,14 +651,6 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handleMIMEPartExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handleMIMEPartExtension(ParserContext context, Extensible parent, Element e) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
     private String getJavaDoc(Element e){
         for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
             Element e2 = Util.nextElement(iter);
@@ -733,23 +662,4 @@
         }
         return null;
     }
-
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-        //System.out.println("JAXWSBindingExtensionHandler doHandleExtension: "+extension);
-        // NOTE - this ugliness can be avoided by moving all the XML parsing/writing code
-        // into the document classes themselves
-        if (extension instanceof JAXWSBinding) {
-            JAXWSBinding binding = (JAXWSBinding) extension;
-            System.out.println("binding.getElementName: "+binding.getElementName());
-            context.writeStartTag(binding.getElementName());
-            context.writeStartTag(JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE);
-            context.writeChars(binding.isEnableWrapperStyle().toString());
-            context.writeEndTag(JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE);
-            context.writeEndTag(binding.getElementName());
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java
index fb8ea75..438e743 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,66 +25,59 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+import com.sun.tools.internal.ws.wsdl.document.mime.*;
 import org.w3c.dom.Element;
 
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEConstants;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEContent;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEMultipartRelated;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEPart;
-import com.sun.tools.internal.ws.wsdl.document.mime.MIMEXml;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * The MIME extension handler for WSDL.
  *
  * @author WS Development Team
  */
-public class MIMEExtensionHandler extends ExtensionHandler {
+public class MIMEExtensionHandler extends AbstractExtensionHandler {
 
-    public MIMEExtensionHandler() {
+    public MIMEExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
     }
 
     public String getNamespaceURI() {
         return Constants.NS_WSDL_MIME;
     }
 
+    @Override
     public boolean doHandleExtension(
-        ParserContext context,
-        Extensible parent,
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
-        if (parent.getElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
+        if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_OUTPUT)) {
             return handleInputOutputExtension(context, parent, e);
-        } else if (parent.getElementName().equals(WSDLConstants.QNAME_INPUT)) {
+        } else if (parent.getWSDLElementName().equals(WSDLConstants.QNAME_INPUT)) {
             return handleInputOutputExtension(context, parent, e);
-        } else if (parent.getElementName().equals(MIMEConstants.QNAME_PART)) {
+        } else if (parent.getWSDLElementName().equals(MIMEConstants.QNAME_PART)) {
             return handleMIMEPartExtension(context, parent, e);
         } else {
-            context.fireIgnoringExtension(
-                new QName(e.getNamespaceURI(), e.getLocalName()),
-                parent.getElementName());
+//            context.fireIgnoringExtension(
+//                new QName(e.getNamespaceURI(), e.getLocalName()),
+//                parent.getWSDLElementName());
             return false;
         }
     }
 
     protected boolean handleInputOutputExtension(
-        ParserContext context,
-        Extensible parent,
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_MULTIPART_RELATED)) {
             context.push();
             context.registerNamespaces(e);
 
-            MIMEMultipartRelated mpr = new MIMEMultipartRelated();
+            MIMEMultipartRelated mpr = new MIMEMultipartRelated(context.getLocation(e));
 
             for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
                 Element e2 = Util.nextElement(iter);
@@ -95,7 +88,7 @@
                     context.push();
                     context.registerNamespaces(e2);
 
-                    MIMEPart part = new MIMEPart();
+                    MIMEPart part = new MIMEPart(context.getLocation(e2));
 
                     String name =
                         XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
@@ -104,15 +97,13 @@
                     }
 
                     for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                        iter2.hasNext();
+                         iter2.hasNext();
                         ) {
                         Element e3 = Util.nextElement(iter2);
                         if (e3 == null)
                             break;
 
-                        ExtensionHandler h =
-                            (ExtensionHandler) _extensionHandlers.get(
-                                e3.getNamespaceURI());
+                        AbstractExtensionHandler h = getExtensionHandlers().get(e3.getNamespaceURI());
                         boolean handled = false;
                         if (h != null) {
                             handled = h.doHandleExtension(context, part, e3);
@@ -131,20 +122,20 @@
                                     e3.getTagName(),
                                     e3.getNamespaceURI());
                             } else {
-                                context.fireIgnoringExtension(
-                                    new QName(
-                                        e3.getNamespaceURI(),
-                                        e3.getLocalName()),
-                                    part.getElementName());
+//                                context.fireIgnoringExtension(
+//                                    new QName(
+//                                        e3.getNamespaceURI(),
+//                                        e3.getLocalName()),
+//                                    part.getElementName());
                             }
                         }
                     }
 
                     mpr.add(part);
                     context.pop();
-                    context.fireDoneParsingEntity(
-                        MIMEConstants.QNAME_PART,
-                        part);
+//                    context.fireDoneParsingEntity(
+//                        MIMEConstants.QNAME_PART,
+//                        part);
                 } else {
                     Util.fail(
                         "parsing.invalidElement",
@@ -155,9 +146,9 @@
 
             parent.addExtension(mpr);
             context.pop();
-            context.fireDoneParsingEntity(
-                MIMEConstants.QNAME_MULTIPART_RELATED,
-                mpr);
+//            context.fireDoneParsingEntity(
+//                MIMEConstants.QNAME_MULTIPART_RELATED,
+//                mpr);
             return true;
         } else if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_CONTENT)) {
             MIMEContent content = parseMIMEContent(context, e);
@@ -176,9 +167,10 @@
         }
     }
 
+    @Override
     protected boolean handleMIMEPartExtension(
-        ParserContext context,
-        Extensible parent,
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_CONTENT)) {
             MIMEContent content = parseMIMEContent(context, e);
@@ -197,11 +189,11 @@
         }
     }
 
-    protected MIMEContent parseMIMEContent(ParserContext context, Element e) {
+    protected MIMEContent parseMIMEContent(TWSDLParserContext context, Element e) {
         context.push();
         context.registerNamespaces(e);
 
-        MIMEContent content = new MIMEContent();
+        MIMEContent content = new MIMEContent(context.getLocation(e));
 
         String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
         if (part != null) {
@@ -214,15 +206,15 @@
         }
 
         context.pop();
-        context.fireDoneParsingEntity(MIMEConstants.QNAME_CONTENT, content);
+//        context.fireDoneParsingEntity(MIMEConstants.QNAME_CONTENT, content);
         return content;
     }
 
-    protected MIMEXml parseMIMEXml(ParserContext context, Element e) {
+    protected MIMEXml parseMIMEXml(TWSDLParserContext context, Element e) {
         context.push();
         context.registerNamespaces(e);
 
-        MIMEXml mimeXml = new MIMEXml();
+        MIMEXml mimeXml = new MIMEXml(context.getLocation(e));
 
         String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
         if (part != null) {
@@ -230,45 +222,7 @@
         }
 
         context.pop();
-        context.fireDoneParsingEntity(MIMEConstants.QNAME_MIME_XML, mimeXml);
+//        context.fireDoneParsingEntity(MIMEConstants.QNAME_MIME_XML, mimeXml);
         return mimeXml;
     }
-
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-        // NOTE - this ugliness can be avoided by moving all the XML parsing/writing code
-        // into the document classes themselves
-        if (extension instanceof MIMEContent) {
-            MIMEContent content = (MIMEContent) extension;
-            context.writeStartTag(content.getElementName());
-            context.writeAttribute(Constants.ATTR_PART, content.getPart());
-            context.writeAttribute(Constants.ATTR_TYPE, content.getType());
-            context.writeEndTag(content.getElementName());
-        } else if (extension instanceof MIMEXml) {
-            MIMEXml mimeXml = (MIMEXml) extension;
-            context.writeStartTag(mimeXml.getElementName());
-            context.writeAttribute(Constants.ATTR_PART, mimeXml.getPart());
-            context.writeEndTag(mimeXml.getElementName());
-        } else if (extension instanceof MIMEMultipartRelated) {
-            MIMEMultipartRelated mpr = (MIMEMultipartRelated) extension;
-            context.writeStartTag(mpr.getElementName());
-            for (Iterator iter = mpr.getParts(); iter.hasNext();) {
-                MIMEPart part = (MIMEPart) iter.next();
-                context.writeStartTag(part.getElementName());
-                for (Iterator iter2 = part.extensions(); iter2.hasNext();) {
-                    Extension e = (Extension) iter2.next();
-                    ExtensionHandler h =
-                        (ExtensionHandler) _extensionHandlers.get(
-                            e.getElementName().getNamespaceURI());
-                    if (h != null) {
-                        h.doHandleExtension(context, e);
-                    }
-                }
-                context.writeEndTag(part.getElementName());
-            }
-            context.writeEndTag(mpr.getElementName());
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java
new file mode 100644
index 0000000..7f5d0fa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: MemberSubmissionAddressingExtensionHandler.java,v 1.1.2.6 2006/10/31 19:52:07 vivekp Exp $
+ */
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * @author Arun Gupta
+ */
+public class MemberSubmissionAddressingExtensionHandler extends W3CAddressingExtensionHandler {
+    public MemberSubmissionAddressingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
+    }
+
+    public MemberSubmissionAddressingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap, ErrorReceiver env) {
+        super(extensionHandlerMap, env);
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return AddressingVersion.MEMBER.wsdlNsUri;
+    }
+
+    protected QName getActionQName() {
+        return AddressingVersion.MEMBER.wsdlActionTag;
+    }
+
+    protected QName getWSDLExtensionQName() {
+        return AddressingVersion.MEMBER.wsdlExtensionTag;
+    }
+
+    @Override
+    public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        // ignore any extension elements
+        return false;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java
new file mode 100644
index 0000000..b08905c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
+import com.sun.tools.internal.ws.wsdl.framework.ParseException;
+import com.sun.xml.internal.ws.api.wsdl.parser.MetaDataResolver;
+import com.sun.xml.internal.ws.api.wsdl.parser.MetadataResolverFactory;
+import com.sun.xml.internal.ws.api.wsdl.parser.ServiceDescriptor;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class MetadataFinder extends DOMForest{
+
+    public boolean isMexMetadata;
+    private String rootWSDL;
+    private Set<String> rootWsdls = new HashSet<String>();
+
+
+    public MetadataFinder(InternalizationLogic logic, WsimportOptions options, ErrorReceiver errReceiver) {
+        super(logic, options, errReceiver);
+
+    }
+
+    public void parseWSDL() throws SAXException, IOException {
+        // parse source grammars
+        for (InputSource value : options.getWSDLs()) {
+            String systemID = value.getSystemId();
+            errorReceiver.pollAbort();
+
+            //if there is entity resolver use it
+            if (options.entityResolver != null)
+                value = options.entityResolver.resolveEntity(null, systemID);
+            if (value == null)
+                value = new InputSource(systemID);
+
+
+            Document dom = parse(value, true);
+            if (dom == null)
+                continue;
+            Element doc = dom.getDocumentElement();
+            if (doc == null) {
+                continue;
+            }
+            //if its not a WSDL document, retry with MEX
+            if (doc.getNamespaceURI() == null || !doc.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !doc.getLocalName().equals("definitions")) {
+                core.remove(systemID);
+                rootDocuments.remove(systemID);
+                errorReceiver.warning(locatorTable.getStartLocation(doc), WsdlMessages.INVALID_WSDL_WITH_DOOC(systemID, "{" + fixNull(doc.getNamespaceURI()) + "}" + doc.getLocalName()));
+                dom = getFromMetadataResolver(systemID);
+                if(dom == null)
+                    continue;
+                doc = dom.getDocumentElement();
+            }
+            NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
+            for (int i = 0; i < schemas.getLength(); i++) {
+                if(!inlinedSchemaElements.contains(schemas.item(i)))
+                    inlinedSchemaElements.add((Element) schemas.item(i));
+            }
+        }
+        identifyRootWslds();
+    }
+
+    /**
+     * Gives the root wsdl document systemId. A root wsdl document is the one which has wsdl:service.
+     * @return null if there is no root wsdl
+     */
+    public @Nullable
+    String getRootWSDL(){
+        return rootWSDL;
+    }
+
+    /**
+     * Gives all the WSDL documents.
+     */
+    public @NotNull
+    Set<String> getRootWSDLs(){
+        return rootWsdls;
+    }
+
+
+    /**
+     * Identifies WSDL documents from the {@link DOMForest}. Also identifies the root wsdl document.
+     */
+    private void identifyRootWslds(){
+        for(String location: rootDocuments){
+            Document doc = get(location);
+            if(doc!=null){
+                Element definition = doc.getDocumentElement();
+                if(definition == null)
+                    continue;
+                if(definition.getNamespaceURI().equals(WSDLConstants.NS_WSDL) && definition.getLocalName().equals("definitions")){
+                    rootWsdls.add(location);
+                    //set the root wsdl at this point. Root wsdl is one which has wsdl:service in it
+                    NodeList nl = definition.getElementsByTagNameNS(WSDLConstants.NS_WSDL, "service");
+
+                    //TODO:what if there are more than one wsdl with wsdl:service element. Probably such cases
+                    //are rare and we will take any one of them, this logic should still work
+                    if(nl.getLength() > 0)
+                        rootWSDL = location;
+                }
+            }
+        }
+    }
+
+
+
+
+    private String fixNull(String s) {
+        if (s == null) return "";
+        else return s;
+    }
+
+
+    /*
+    * If source and target namespace are also passed in,
+    * then if the mex resolver is found and it cannot get
+    * the data, wsimport attempts to add ?wsdl to the
+    * address and retrieve the data with a normal http get.
+    * This behavior should only happen when trying a
+    * mex request first.
+    */
+    private Document getFromMetadataResolver(String systemId) {
+
+        //try MEX
+        MetaDataResolver resolver = null;
+        ServiceDescriptor serviceDescriptor = null;
+        for (MetadataResolverFactory resolverFactory : ServiceFinder.find(MetadataResolverFactory.class)) {
+            resolver = resolverFactory.metadataResolver(options.entityResolver);
+            try {
+                serviceDescriptor = resolver.resolve(new URI(systemId));
+                //we got the ServiceDescriptor, now break
+                if (serviceDescriptor != null)
+                    break;
+            } catch (URISyntaxException e) {
+                throw new ParseException(e);
+            }
+        }
+
+        if (serviceDescriptor != null) {
+            return parseMetadata(systemId, serviceDescriptor);
+        } else {
+            errorReceiver.error(new LocatorImpl(), WsdlMessages.PARSING_UNABLE_TO_GET_METADATA(systemId));
+        }
+        return null;
+    }
+
+    private Document parseMetadata(String systemId, ServiceDescriptor serviceDescriptor) {
+        List<? extends Source> mexWsdls = serviceDescriptor.getWSDLs();
+        List<? extends Source> mexSchemas = serviceDescriptor.getSchemas();
+        Document root = null;
+        for (Source src : mexWsdls) {
+            if (src instanceof DOMSource) {
+                Node n = ((DOMSource) src).getNode();
+                Document doc;
+                if (n.getNodeType() == Node.ELEMENT_NODE && n.getOwnerDocument() == null) {
+                    doc = DOMUtil.createDom();
+                    doc.importNode(n, true);
+                } else {
+                    doc = n.getOwnerDocument();
+                }
+
+//                Element e = (n.getNodeType() == Node.ELEMENT_NODE)?(Element)n: DOMUtil.getFirstElementChild(n);
+                if (root == null) {
+                    //check if its main wsdl, then set it to root
+                    NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(WSDLConstants.NS_WSDL, "service");
+                    if (nl.getLength() > 0) {
+                        root = doc;
+                        rootWSDL = src.getSystemId();
+                    }
+                }
+                NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(WSDLConstants.NS_WSDL, "import");
+                if (nl.getLength() > 0) {
+                    Element imp = (Element) nl.item(0);
+                    String loc = imp.getAttribute("location");
+                    if (loc != null) {
+                        if (!externalReferences.contains(loc))
+                            externalReferences.add(loc);
+                    }
+                }
+                if (core.keySet().contains(systemId))
+                    core.remove(systemId);
+                core.put(src.getSystemId(), doc);
+                isMexMetadata = true;
+            }
+
+            //TODO:handle SAXSource
+            //TODO:handler StreamSource
+        }
+
+        for (Source src : mexSchemas) {
+            if (src instanceof DOMSource) {
+                Node n = ((DOMSource) src).getNode();
+                Element e = (n.getNodeType() == Node.ELEMENT_NODE) ? (Element) n : DOMUtil.getFirstElementChild(n);
+                inlinedSchemaElements.add(e);
+            }
+            //TODO:handle SAXSource
+            //TODO:handler StreamSource
+        }
+        return root;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java
index e6f2485..b0010ff 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java
@@ -1,5 +1,9 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,17 +28,16 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
+
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.util.Iterator;
-
-import javax.xml.namespace.NamespaceContext;
-
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+import javax.xml.namespace.NamespaceContext;
+import java.util.Iterator;
 
 public class NamespaceContextImpl implements NamespaceContext {
 
@@ -46,7 +49,19 @@
 
     /*
      * Copyright 1999-2004 The Apache Software Foundation.
-     *     */
+     *
+     * Licensed under the Apache License, Version 2.0 (the "License");
+     * you may not use this file except in compliance with the License.
+     * You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
     public String getNamespaceURI(String prefix) {
         Node parent = e;
         String namespace = null;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java
index f86bd41..63e2068 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,19 @@
  */
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Binding;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Constants;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAP12Binding;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
 
 
 public class SOAP12ExtensionHandler extends SOAPExtensionHandler {
+    public SOAP12ExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
+    }
 
     /*
      * @see SOAPExtensionHandler#getNamespaceURI()
@@ -57,8 +62,8 @@
         return SOAP12Constants.QNAME_BINDING;
     }
 
-    @Override protected SOAPBinding getSOAPBinding() {
-        return new SOAP12Binding();
+    @Override protected SOAPBinding getSOAPBinding(Locator location) {
+        return new SOAP12Binding(location);
     }
 
     /*
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java
index 0482002..1b81894 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,17 +25,16 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
 import com.sun.tools.internal.ws.wsdl.document.soap.SOAPConstants;
 import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceValidator;
 import com.sun.tools.internal.ws.wsdl.framework.Kind;
 
+import javax.xml.namespace.QName;
+import java.util.HashSet;
+import java.util.Set;
+
 /**
  * An interface implemented by a class that is capable of validating
  * a QName/Kind pair referring to an external entity.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java
index de19bb1..2f39729 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,46 +25,36 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.io.IOException;
-import java.util.Iterator;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import com.sun.tools.internal.ws.wsdl.document.soap.*;
+import com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl;
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
 
 import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPAddress;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBody;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPConstants;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPFault;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPHeader;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPHeaderFault;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPOperation;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
-import com.sun.tools.internal.ws.wsdl.document.soap.SOAPUse;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * The SOAP extension handler for WSDL.
  *
  * @author WS Development Team
  */
-public class SOAPExtensionHandler extends ExtensionHandlerBase {
+public class SOAPExtensionHandler extends AbstractExtensionHandler {
 
-    public SOAPExtensionHandler() {
+    public SOAPExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        super(extensionHandlerMap);
     }
 
     public String getNamespaceURI() {
         return Constants.NS_WSDL_SOAP;
     }
 
-    protected boolean handleDefinitionsExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleDefinitionsExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
@@ -73,9 +63,9 @@
         return false; // keep compiler happy
     }
 
-    protected boolean handleTypesExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleTypesExtension(
+        com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
@@ -84,19 +74,19 @@
         return false; // keep compiler happy
     }
 
-    protected SOAPBinding getSOAPBinding(){
-        return new SOAPBinding();
+    protected SOAPBinding getSOAPBinding(Locator location){
+        return new SOAPBinding(location);
     }
 
-    protected boolean handleBindingExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleBindingExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, getBindingQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPBinding binding = getSOAPBinding();
+            SOAPBinding binding = getSOAPBinding(context.getLocation(e));
 
             // NOTE - the "transport" attribute is required according to section 3.3 of the WSDL 1.1 spec,
             // but optional according to the schema in appendix A 4.2 of the same document!
@@ -119,7 +109,7 @@
             }
             parent.addExtension(binding);
             context.pop();
-            context.fireDoneParsingEntity(getBindingQName(), binding);
+//            context.fireDoneParsingEntity(getBindingQName(), binding);
             return true;
         } else {
             Util.fail(
@@ -130,15 +120,15 @@
         }
     }
 
-    protected boolean handleOperationExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleOperationExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, getOperationQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPOperation operation = new SOAPOperation();
+            SOAPOperation operation = new SOAPOperation(context.getLocation(e));
 
             String soapAction =
                 XmlUtil.getAttributeOrNull(e, Constants.ATTR_SOAP_ACTION);
@@ -161,9 +151,9 @@
             }
             parent.addExtension(operation);
             context.pop();
-            context.fireDoneParsingEntity(
-                getOperationQName(),
-                operation);
+//            context.fireDoneParsingEntity(
+//                getOperationQName(),
+//                operation);
             return true;
         } else {
             Util.fail(
@@ -174,35 +164,37 @@
         }
     }
 
-    protected boolean handleInputExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleInputExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         return handleInputOutputExtension(context, parent, e);
     }
-    protected boolean handleOutputExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleOutputExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         return handleInputOutputExtension(context, parent, e);
     }
 
+    @Override
     protected boolean handleMIMEPartExtension(
-        ParserContext context,
-        Extensible parent,
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         return handleInputOutputExtension(context, parent, e);
     }
 
     protected boolean handleInputOutputExtension(
-        ParserContext context,
-        Extensible parent,
+        TWSDLParserContext contextif,
+        TWSDLExtensible parent,
         Element e) {
+        TWSDLParserContextImpl context = (TWSDLParserContextImpl)contextif;
         if (XmlUtil.matchesTagNS(e, getBodyQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPBody body = new SOAPBody();
+            SOAPBody body = new SOAPBody(context.getLocation(e));
 
             String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
             if (use != null) {
@@ -237,13 +229,13 @@
 
             parent.addExtension(body);
             context.pop();
-            context.fireDoneParsingEntity(getBodyQName(), body);
+//            context.fireDoneParsingEntity(getBodyQName(), body);
             return true;
         } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPHeader header = new SOAPHeader();
+            SOAPHeader header = new SOAPHeader(context.getLocation(e));
 
             String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
             if (use != null) {
@@ -279,7 +271,7 @@
             String messageAttr =
                 XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
             if (messageAttr != null) {
-                header.setMessage(context.translateQualifiedName(messageAttr));
+                header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
             }
 
             for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
@@ -292,7 +284,7 @@
                     context.push();
                     context.registerNamespaces(e);
 
-                    SOAPHeaderFault headerfault = new SOAPHeaderFault();
+                    SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));
 
                     String use2 =
                         XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
@@ -335,7 +327,7 @@
                         XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
                     if (messageAttr2 != null) {
                         headerfault.setMessage(
-                            context.translateQualifiedName(messageAttr2));
+                            context.translateQualifiedName(context.getLocation(e2), messageAttr2));
                     }
 
                     header.add(headerfault);
@@ -361,15 +353,15 @@
         }
     }
 
-    protected boolean handleFaultExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleFaultExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, getFaultQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPFault fault = new SOAPFault();
+            SOAPFault fault = new SOAPFault(context.getLocation(e));
 
             String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME);
             if (name != null) {
@@ -404,7 +396,7 @@
 
             parent.addExtension(fault);
             context.pop();
-            context.fireDoneParsingEntity(getFaultQName(), fault);
+//            context.fireDoneParsingEntity(getFaultQName(), fault);
             return true;
         } else {
             Util.fail(
@@ -415,9 +407,9 @@
         }
     }
 
-    protected boolean handleServiceExtension(
-        ParserContext context,
-        Extensible parent,
+    public boolean handleServiceExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         Util.fail(
             "parsing.invalidExtensionElement",
@@ -426,15 +418,16 @@
         return false; // keep compiler happy
     }
 
-    protected boolean handlePortExtension(
-        ParserContext context,
-        Extensible parent,
+    @Override
+    public boolean handlePortExtension(
+        TWSDLParserContext context,
+        TWSDLExtensible parent,
         Element e) {
         if (XmlUtil.matchesTagNS(e, getAddressQName())) {
             context.push();
             context.registerNamespaces(e);
 
-            SOAPAddress address = new SOAPAddress();
+            SOAPAddress address = new SOAPAddress(context.getLocation(e));
 
             String location =
                 Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
@@ -442,7 +435,7 @@
 
             parent.addExtension(address);
             context.pop();
-            context.fireDoneParsingEntity(getAddressQName(), address);
+//            context.fireDoneParsingEntity(getAddressQName(), address);
             return true;
         } else {
             Util.fail(
@@ -453,131 +446,8 @@
         }
     }
 
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-        // NOTE - this ugliness can be avoided by moving all the XML parsing/writing code
-        // into the document classes themselves
-        if (extension instanceof SOAPAddress) {
-            SOAPAddress address = (SOAPAddress) extension;
-            context.writeStartTag(address.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_LOCATION,
-                address.getLocation());
-            context.writeEndTag(address.getElementName());
-        } else if (extension instanceof SOAPBinding) {
-            SOAPBinding binding = (SOAPBinding) extension;
-            context.writeStartTag(binding.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_TRANSPORT,
-                binding.getTransport());
-            String style =
-                (binding.getStyle() == null
-                    ? null
-                    : (binding.getStyle() == SOAPStyle.DOCUMENT
-                        ? Constants.ATTRVALUE_DOCUMENT
-                        : Constants.ATTRVALUE_RPC));
-            context.writeAttribute(Constants.ATTR_STYLE, style);
-            context.writeEndTag(binding.getElementName());
-        } else if (extension instanceof SOAPBody) {
-            SOAPBody body = (SOAPBody) extension;
-            context.writeStartTag(body.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_ENCODING_STYLE,
-                body.getEncodingStyle());
-            context.writeAttribute(Constants.ATTR_PARTS, body.getParts());
-            String use =
-                (body.getUse() == null
-                    ? null
-                    : (body.getUse() == SOAPUse.LITERAL
-                        ? Constants.ATTRVALUE_LITERAL
-                        : Constants.ATTRVALUE_ENCODED));
-            context.writeAttribute(Constants.ATTR_USE, use);
-            context.writeAttribute(
-                Constants.ATTR_NAMESPACE,
-                body.getNamespace());
-            context.writeEndTag(body.getElementName());
-        } else if (extension instanceof SOAPFault) {
-            SOAPFault fault = (SOAPFault) extension;
-            context.writeStartTag(fault.getElementName());
-            context.writeAttribute(Constants.ATTR_NAME, fault.getName());
-            context.writeAttribute(
-                Constants.ATTR_ENCODING_STYLE,
-                fault.getEncodingStyle());
-            String use =
-                (fault.getUse() == null
-                    ? null
-                    : (fault.getUse() == SOAPUse.LITERAL
-                        ? Constants.ATTRVALUE_LITERAL
-                        : Constants.ATTRVALUE_ENCODED));
-            context.writeAttribute(Constants.ATTR_USE, use);
-            context.writeAttribute(
-                Constants.ATTR_NAMESPACE,
-                fault.getNamespace());
-            context.writeEndTag(fault.getElementName());
-        } else if (extension instanceof SOAPHeader) {
-            SOAPHeader header = (SOAPHeader) extension;
-            context.writeStartTag(header.getElementName());
-            context.writeAttribute(Constants.ATTR_MESSAGE, header.getMessage());
-            context.writeAttribute(Constants.ATTR_PART, header.getPart());
-            context.writeAttribute(
-                Constants.ATTR_ENCODING_STYLE,
-                header.getEncodingStyle());
-            String use =
-                (header.getUse() == null
-                    ? null
-                    : (header.getUse() == SOAPUse.LITERAL
-                        ? Constants.ATTRVALUE_LITERAL
-                        : Constants.ATTRVALUE_ENCODED));
-            context.writeAttribute(Constants.ATTR_USE, use);
-            context.writeAttribute(
-                Constants.ATTR_NAMESPACE,
-                header.getNamespace());
-            context.writeEndTag(header.getElementName());
-        } else if (extension instanceof SOAPHeaderFault) {
-            SOAPHeaderFault headerfault = (SOAPHeaderFault) extension;
-            context.writeStartTag(headerfault.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_MESSAGE,
-                headerfault.getMessage());
-            context.writeAttribute(Constants.ATTR_PART, headerfault.getPart());
-            context.writeAttribute(
-                Constants.ATTR_ENCODING_STYLE,
-                headerfault.getEncodingStyle());
-            String use =
-                (headerfault.getUse() == null
-                    ? null
-                    : (headerfault.getUse() == SOAPUse.LITERAL
-                        ? Constants.ATTRVALUE_LITERAL
-                        : Constants.ATTRVALUE_ENCODED));
-            context.writeAttribute(Constants.ATTR_USE, use);
-            context.writeAttribute(
-                Constants.ATTR_NAMESPACE,
-                headerfault.getNamespace());
-            context.writeEndTag(headerfault.getElementName());
-        } else if (extension instanceof SOAPOperation) {
-            SOAPOperation operation = (SOAPOperation) extension;
-            context.writeStartTag(operation.getElementName());
-            context.writeAttribute(
-                Constants.ATTR_SOAP_ACTION,
-                operation.getSOAPAction());
-            String style =
-                (operation.getStyle() == null
-                    ? null
-                    : (operation.isDocument()
-                        ? Constants.ATTRVALUE_DOCUMENT
-                        : Constants.ATTRVALUE_RPC));
-            context.writeAttribute(Constants.ATTR_STYLE, style);
-            context.writeEndTag(operation.getElementName());
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see ExtensionHandlerBase#handlePortTypeExtension(ParserContext, Extensible, org.w3c.dom.Element)
-     */
-    protected boolean handlePortTypeExtension(ParserContext context, Extensible parent, Element e) {
-        Util.fail(
+    public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+       Util.fail(
             "parsing.invalidExtensionElement",
             e.getTagName(),
             e.getNamespaceURI());
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaExtensionHandler.java
deleted file mode 100644
index 6edcb67..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaExtensionHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import java.io.IOException;
-
-import org.w3c.dom.Element;
-
-import com.sun.tools.internal.ws.wsdl.document.schema.Schema;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
-
-/**
- * The XML Schema extension handler for WSDL.
- *
- * @author WS Development Team
- */
-public class SchemaExtensionHandler extends ExtensionHandler {
-
-    public SchemaExtensionHandler() {
-    }
-
-    public String getNamespaceURI() {
-        return Constants.NS_XSD;
-    }
-
-    public boolean doHandleExtension(
-        ParserContext context,
-        Extensible parent,
-        Element e) {
-        if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
-            SchemaParser parser = new SchemaParser();
-            parent.addExtension(parser.parseSchema(context, e, null));
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public void doHandleExtension(WriterContext context, Extension extension)
-        throws IOException {
-        if (extension instanceof Schema) {
-            SchemaWriter writer = new SchemaWriter();
-            writer.writeSchema(context, (Schema) extension);
-        } else {
-            // unknown extension
-            throw new IllegalArgumentException();
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaParser.java
deleted file mode 100644
index cbf991bc..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaParser.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import com.sun.xml.internal.ws.util.xml.NamedNodeMapIterator;
-import com.sun.tools.internal.ws.util.xml.NullEntityResolver;
-import com.sun.tools.internal.ws.wsdl.document.schema.Schema;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaAttribute;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaDocument;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaElement;
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
-import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-/**
- * A parser for XML Schema, including the fragments found inside a WSDL document.
- *
- * @author WS Development Team
- */
-public class SchemaParser {
-
-    public SchemaParser() {
-    }
-
-    public boolean getFollowImports() {
-        return _followImports;
-    }
-
-    public void setFollowImports(boolean b) {
-        _followImports = b;
-    }
-
-    public SchemaDocument parse(InputSource source) {
-        SchemaDocument schemaDocument = new SchemaDocument();
-        schemaDocument.setSystemId(source.getSystemId());
-        ParserContext context = new ParserContext(schemaDocument, null);
-        context.setFollowImports(_followImports);
-        schemaDocument.setSchema(parseSchema(context, source, null));
-        return schemaDocument;
-    }
-
-    public Schema parseSchema(
-        ParserContext context,
-        InputSource source,
-        String expectedTargetNamespaceURI) {
-        Schema schema =
-            parseSchemaNoImport(context, source, expectedTargetNamespaceURI);
-        schema.defineAllEntities();
-        processImports(context, source, schema);
-        return schema;
-    }
-
-    public Schema parseSchema(
-        ParserContext context,
-        Element e,
-        String expectedTargetNamespaceURI) {
-        Schema schema =
-            parseSchemaNoImport(context, e, expectedTargetNamespaceURI);
-        schema.defineAllEntities();
-        processImports(context, null, schema);
-        return schema;
-    }
-
-    protected void processImports(
-        ParserContext context,
-        InputSource source,
-        Schema schema) {
-        for (Iterator iter = schema.getContent().children(); iter.hasNext();) {
-            SchemaElement child = (SchemaElement) iter.next();
-            if (child.getQName().equals(SchemaConstants.QNAME_IMPORT)) {
-                String location =
-                    child.getValueOfAttributeOrNull(
-                        Constants.ATTR_SCHEMA_LOCATION);
-                String namespace =
-                    child.getValueOfAttributeOrNull(Constants.ATTR_NAMESPACE);
-                //bug fix: 4857762, add adjustedLocation to teh importDocuments and ignore if it
-                //exists, to avoid duplicates
-                if (location != null) {
-                    String adjustedLocation = null;
-                    if (source != null && source.getSystemId() != null) {
-                        adjustedLocation =
-                            Util.processSystemIdWithBase(
-                                source.getSystemId(),
-                                location);
-                    }
-                    //bug fix: 4856674
-                    if (adjustedLocation == null) {
-                        adjustedLocation =
-                            context.getWSDLLocation() == null
-                                ? location
-                                : Util.processSystemIdWithBase(
-                                    context.getWSDLLocation(),
-                                    location);
-                    }
-                    if (!context
-                        .getDocument()
-                        .isImportedDocument(adjustedLocation)) {
-                        context.getDocument().addImportedEntity(
-                            parseSchema(
-                                context,
-                                new InputSource(adjustedLocation),
-                                namespace));
-                        context.getDocument().addImportedDocument(
-                            adjustedLocation);
-                    }
-                }
-            } else if (
-                child.getQName().equals(SchemaConstants.QNAME_INCLUDE)
-                    && (schema.getTargetNamespaceURI() != null)) {
-                String location =
-                    child.getValueOfAttributeOrNull(
-                        Constants.ATTR_SCHEMA_LOCATION);
-                if (location != null
-                    && !context.getDocument().isIncludedDocument(location)) {
-                    context.getDocument().addIncludedDocument(location);
-                    String adjustedLocation = null;
-                    if (source != null && source.getSystemId() != null) {
-                        adjustedLocation =
-                            Util.processSystemIdWithBase(
-                                source.getSystemId(),
-                                location);
-                    }
-                    if (adjustedLocation == null) {
-                        adjustedLocation =
-                            context.getDocument().getSystemId() == null
-                                ? location
-                                : Util.processSystemIdWithBase(
-                                    context.getDocument().getSystemId(),
-                                    location);
-                    }
-                    context.getDocument().addIncludedEntity(
-                        parseSchema(
-                            context,
-                            new InputSource(adjustedLocation),
-                            schema.getTargetNamespaceURI()));
-                }
-            } else if (
-                child.getQName().equals(SchemaConstants.QNAME_REDEFINE)) {
-                // not supported
-                Util.fail("validation.unsupportedSchemaFeature", "redefine");
-            }
-        }
-    }
-
-    protected Schema parseSchemaNoImport(
-        ParserContext context,
-        InputSource source,
-        String expectedTargetNamespaceURI) {
-        try {
-            DocumentBuilderFactory builderFactory =
-                DocumentBuilderFactory.newInstance();
-            builderFactory.setNamespaceAware(true);
-            builderFactory.setValidating(false);
-            DocumentBuilder builder = builderFactory.newDocumentBuilder();
-            builder.setErrorHandler(new ErrorHandler() {
-                public void error(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-                public void fatalError(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-                public void warning(SAXParseException err)
-                    throws SAXParseException {
-                    // do nothing
-                }
-            });
-            builder.setEntityResolver(new NullEntityResolver());
-
-            try {
-                Document document = builder.parse(source);
-                return parseSchemaNoImport(
-                    context,
-                    document,
-                    expectedTargetNamespaceURI);
-            } catch (IOException e) {
-                throw new ParseException(
-                    "parsing.ioException",e);
-            } catch (SAXException e) {
-                throw new ParseException(
-                    "parsing.saxException",e);
-            }
-        } catch (ParserConfigurationException e) {
-            throw new ParseException(
-                "parsing.parserConfigException",e);
-        } catch (FactoryConfigurationError e) {
-            throw new ParseException(
-                "parsing.factoryConfigException",e);
-        }
-    }
-
-    protected Schema parseSchemaNoImport(
-        ParserContext context,
-        Document doc,
-        String expectedTargetNamespaceURI) {
-        Element root = doc.getDocumentElement();
-        Util.verifyTagNSRootElement(root, SchemaConstants.QNAME_SCHEMA);
-        return parseSchemaNoImport(context, root, expectedTargetNamespaceURI);
-    }
-
-    protected Schema parseSchemaNoImport(
-        ParserContext context,
-        Element e,
-        String expectedTargetNamespaceURI) {
-        Schema schema = new Schema(context.getDocument());
-        String targetNamespaceURI =
-            XmlUtil.getAttributeOrNull(e, Constants.ATTR_TARGET_NAMESPACE);
-        //bug 4849754 fix, in both the case of xsd:include and xsd:import this should work
-        if (targetNamespaceURI != null
-            && expectedTargetNamespaceURI != null
-            && !expectedTargetNamespaceURI.equals(targetNamespaceURI)) {
-            throw new ValidationException(
-                "validation.incorrectTargetNamespace",
-                new Object[] {
-                    targetNamespaceURI,
-                    expectedTargetNamespaceURI });
-        }
-        if (targetNamespaceURI == null)
-            schema.setTargetNamespaceURI(expectedTargetNamespaceURI);
-        else
-            schema.setTargetNamespaceURI(targetNamespaceURI);
-
-        // snapshot the current prefixes
-        for (Iterator iter = context.getPrefixes(); iter.hasNext();) {
-            String prefix = (String) iter.next();
-            String nsURI = context.getNamespaceURI(prefix);
-            if (nsURI == null) {
-                // should not happen
-                throw new ParseException("parsing.shouldNotHappen");
-            }
-            schema.addPrefix(prefix, nsURI);
-        }
-
-        context.push();
-        context.registerNamespaces(e);
-
-        // just internalize the XML fragment
-        SchemaElement schemaElement =
-            new SchemaElement(SchemaConstants.QNAME_SCHEMA);
-
-        copyNamespaceDeclarations(schemaElement, e);
-        copyAttributesNoNs(schemaElement, e);
-        copyElementContent(schemaElement, e);
-
-        schema.setContent(schemaElement);
-        schemaElement.setSchema(schema);
-
-        context.pop();
-        context.fireDoneParsingEntity(SchemaConstants.QNAME_SCHEMA, schema);
-        return schema;
-    }
-
-    protected void copyAttributesNoNs(SchemaElement target, Element source) {
-        for (Iterator iter = new NamedNodeMapIterator(source.getAttributes());
-            iter.hasNext();
-            ) {
-            Attr attr = (Attr) iter.next();
-            if (attr.getName().equals(PREFIX_XMLNS)
-                || attr.getName().startsWith(PREFIX_XMLNS_COLON)) {
-                continue;
-            }
-
-            SchemaAttribute attribute =
-                new SchemaAttribute(attr.getLocalName());
-            attribute.setNamespaceURI(attr.getNamespaceURI());
-            attribute.setValue(attr.getValue());
-            target.addAttribute(attribute);
-        }
-    }
-
-    protected void copyNamespaceDeclarations(
-        SchemaElement target,
-        Element source) {
-        for (Iterator iter = new NamedNodeMapIterator(source.getAttributes());
-            iter.hasNext();
-            ) {
-            Attr attr = (Attr) iter.next();
-            if (attr.getName().equals(PREFIX_XMLNS)) {
-                // default namespace declaration
-                target.addPrefix("", attr.getValue());
-            } else {
-                String prefix = XmlUtil.getPrefix(attr.getName());
-                if (prefix != null && prefix.equals(PREFIX_XMLNS)) {
-                    String nsPrefix = XmlUtil.getLocalPart(attr.getName());
-                    String uri = attr.getValue();
-                    target.addPrefix(nsPrefix, uri);
-                }
-            }
-        }
-    }
-
-    protected void copyElementContent(SchemaElement target, Element source) {
-        for (Iterator iter = XmlUtil.getAllChildren(source); iter.hasNext();) {
-            Element e2 = Util.nextElementIgnoringCharacterContent(iter);
-            if (e2 == null)
-                break;
-            SchemaElement newElement = new SchemaElement(e2.getLocalName());
-            newElement.setNamespaceURI(e2.getNamespaceURI());
-            copyNamespaceDeclarations(newElement, e2);
-            copyAttributesNoNs(newElement, e2);
-            copyElementContent(newElement, e2);
-            target.addChild(newElement);
-            newElement.setParent(target);
-        }
-    }
-
-    private boolean _followImports;
-
-    private final static String PREFIX_XMLNS = "xmlns";
-    private final static String PREFIX_XMLNS_COLON = "xmlns:";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaWriter.java
deleted file mode 100644
index 0bd91bd..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SchemaWriter.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.document.schema.Schema;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaAttribute;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaDocument;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaElement;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-
-/**
- * A writer for XML Schema fragments within a WSDL document.
- *
- * @author WS Development Team
- */
-public class SchemaWriter {
-
-    public SchemaWriter() {
-    }
-
-    public void write(SchemaDocument document, OutputStream os)
-        throws IOException {
-        WriterContext context = new WriterContext(os);
-        writeSchema(context, document.getSchema());
-        context.flush();
-    }
-
-    public void writeSchema(WriterContext context, Schema schema)
-        throws IOException {
-        context.push();
-        try {
-            writeTopSchemaElement(context, schema);
-        } catch (Exception e) {
-        } finally {
-            context.pop();
-        }
-    }
-
-    protected void writeTopSchemaElement(WriterContext context, Schema schema)
-        throws IOException {
-        SchemaElement schemaElement = schema.getContent();
-        QName name = schemaElement.getQName();
-
-        // make sure that all namespaces we expect are actually declared
-        for (Iterator iter = schema.prefixes(); iter.hasNext();) {
-            String prefix = (String) iter.next();
-            String expectedURI = schema.getURIForPrefix(prefix);
-            if (!expectedURI.equals(context.getNamespaceURI(prefix))) {
-                context.declarePrefix(prefix, expectedURI);
-            }
-        }
-
-        for (Iterator iter = schemaElement.prefixes(); iter.hasNext();) {
-            String prefix = (String) iter.next();
-            String uri = schemaElement.getURIForPrefix(prefix);
-            context.declarePrefix(prefix, uri);
-        }
-
-        context.writeStartTag(name);
-
-        for (Iterator iter = schemaElement.attributes(); iter.hasNext();) {
-            SchemaAttribute attribute = (SchemaAttribute) iter.next();
-            if (attribute.getNamespaceURI() == null) {
-                context.writeAttribute(
-                    attribute.getLocalName(),
-                    attribute.getValue(context));
-            } else {
-                context.writeAttribute(
-                    context.getQNameString(attribute.getQName()),
-                    attribute.getValue(context));
-            }
-        }
-
-        context.writeAllPendingNamespaceDeclarations();
-
-        for (Iterator iter = schemaElement.children(); iter.hasNext();) {
-            SchemaElement child = (SchemaElement) iter.next();
-            writeSchemaElement(context, child);
-        }
-
-        context.writeEndTag(name);
-    }
-
-    protected void writeSchemaElement(
-        WriterContext context,
-        SchemaElement schemaElement)
-        throws IOException {
-        QName name = schemaElement.getQName();
-
-        if (schemaElement.declaresPrefixes()) {
-            context.push();
-        }
-
-        context.writeStartTag(name);
-
-        if (schemaElement.declaresPrefixes()) {
-            for (Iterator iter = schemaElement.prefixes(); iter.hasNext();) {
-                String prefix = (String) iter.next();
-                String uri = schemaElement.getURIForPrefix(prefix);
-                context.writeNamespaceDeclaration(prefix, uri);
-                context.declarePrefix(prefix, uri);
-            }
-        }
-
-        for (Iterator iter = schemaElement.attributes(); iter.hasNext();) {
-            SchemaAttribute attribute = (SchemaAttribute) iter.next();
-            if (attribute.getNamespaceURI() == null) {
-                context.writeAttribute(
-                    attribute.getLocalName(),
-                    attribute.getValue(context));
-            } else {
-                context.writeAttribute(
-                    context.getQNameString(attribute.getQName()),
-                    attribute.getValue(context));
-            }
-        }
-
-        for (Iterator iter = schemaElement.children(); iter.hasNext();) {
-            SchemaElement child = (SchemaElement) iter.next();
-            writeSchemaElement(context, child);
-        }
-
-        context.writeEndTag(name);
-
-        if (schemaElement.declaresPrefixes()) {
-            context.pop();
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Util.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Util.java
index 448eb34..879cfbf 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Util.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Util.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,18 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
+import com.sun.tools.internal.ws.wsdl.framework.ParseException;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
 import org.w3c.dom.Comment;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
 
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
 
 /**2
  * Defines various utility methods.
@@ -76,9 +74,7 @@
     }
 
     public static void verifyTagNS(Element element, QName name) {
-        if (!element.getLocalName().equals(name.getLocalPart())
-            || (element.getNamespaceURI() != null
-                && !element.getNamespaceURI().equals(name.getNamespaceURI())))
+        if (!isTagName(element, name))
             fail(
                 "parsing.invalidTagNS",
                 new Object[] {
@@ -88,6 +84,13 @@
                     name.getNamespaceURI()});
     }
 
+    public static boolean isTagName(Element element, QName name){
+        return (element.getLocalName().equals(name.getLocalPart())
+            && (element.getNamespaceURI() != null
+                && element.getNamespaceURI().equals(name.getNamespaceURI())));
+
+    }
+
     public static void verifyTagNSRootElement(Element element, QName name) {
         if (!element.getLocalName().equals(name.getLocalPart())
             || (element.getNamespaceURI() != null
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java
new file mode 100644
index 0000000..ce752e3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import org.xml.sax.*;
+import org.xml.sax.helpers.LocatorImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Checks the jaxb:version attribute on a XML Schema document.
+ *
+ * jaxws:version is optional, if absent its value is assumed to be "2.0" and if present its value must be
+ * "2.0" or more.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *     Vivek Pandey
+ */
+public class VersionChecker extends XMLFilterImpl {
+
+    /**
+     * We store the value of the version attribute in this variable
+     * when we hit the root element.
+     */
+    private String version = null ;
+
+    /** Will be set to true once we hit the root element. */
+    private boolean seenRoot = false;
+
+    /** Will be set to true once we hit a binding declaration. */
+    private boolean seenBindings = false;
+
+    private Locator locator;
+
+    /**
+     * Stores the location of the start tag of the root tag.
+     */
+    private Locator rootTagStart;
+
+    public VersionChecker( XMLReader parent ) {
+        setParent(parent);
+    }
+
+    public VersionChecker( ContentHandler handler, ErrorHandler eh, EntityResolver er ) {
+        setContentHandler(handler);
+        if(eh!=null)    setErrorHandler(eh);
+        if(er!=null)    setEntityResolver(er);
+    }
+
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+        throws SAXException {
+
+        super.startElement(namespaceURI, localName, qName, atts);
+
+        if(!seenRoot) {
+            // if this is the root element
+            seenRoot = true;
+            rootTagStart = new LocatorImpl(locator);
+
+            version = atts.getValue(JAXWSBindingsConstants.NS_JAXWS_BINDINGS,"version");
+            if( namespaceURI.equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) ) {
+                String version2 = atts.getValue("","version");
+                if( version!=null && version2!=null ) {
+                    // we have both @version and @jaxb:version. error.
+                    SAXParseException e = new SAXParseException(
+                        WsdlMessages.INTERNALIZER_TWO_VERSION_ATTRIBUTES(), locator);
+                    getErrorHandler().error(e);
+                }
+                //According to JAXWS 2.0 spec, if version attribute is missing its assumed to be "2.0"
+                if( version==null)
+                    version = (version2!=null)?version2:"2.0";
+            }
+
+        }
+
+        if( JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(namespaceURI)){
+            seenBindings = true;
+            if(version == null)
+                version = "2.0";
+        }
+
+    }
+
+    public void endDocument() throws SAXException {
+        super.endDocument();
+
+        if( seenBindings && version==null ) {
+            // if we see a binding declaration but not version attribute
+            SAXParseException e = new SAXParseException(WsdlMessages.INTERNALIZER_VERSION_NOT_PRESENT(), rootTagStart);
+            getErrorHandler().error(e);
+        }
+
+        // if present, the value must be >= 2.0
+        if( version!=null && !VERSIONS.contains(version) ) {
+            SAXParseException e = new SAXParseException(WsdlMessages.INTERNALIZER_INCORRECT_VERSION(), rootTagStart);
+            getErrorHandler().error(e);
+        }
+    }
+
+    public void setDocumentLocator(Locator locator) {
+        super.setDocumentLocator(locator);
+        this.locator = locator;
+    }
+
+    private static final Set<String> VERSIONS = new HashSet<String>(Arrays.asList("2.0","2.1"));
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java
new file mode 100644
index 0000000..b948a88
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: W3CAddressingExtensionHandler.java,v 1.1.2.9 2007/02/06 00:33:38 kohsuke Exp $
+ */
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wsdl.document.Fault;
+import com.sun.tools.internal.ws.wsdl.document.Input;
+import com.sun.tools.internal.ws.wsdl.document.Output;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * @author Arun Gupta
+ */
+public class W3CAddressingExtensionHandler extends AbstractExtensionHandler {
+    private ErrorReceiver errReceiver;
+
+    public W3CAddressingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) {
+        this(extensionHandlerMap, null);
+    }
+
+    public W3CAddressingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap, ErrorReceiver errReceiver) {
+        super(extensionHandlerMap);
+        this.errReceiver = errReceiver;
+    }
+
+    @Override
+    public String getNamespaceURI() {
+        return AddressingVersion.W3C.wsdlNsUri;
+    }
+
+    protected QName getActionQName() {
+        return AddressingVersion.W3C.wsdlActionTag;
+    }
+
+    protected QName getWSDLExtensionQName() {
+        return AddressingVersion.W3C.wsdlExtensionTag;
+    }
+
+    @Override
+    public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        if (XmlUtil.matchesTagNS(e, getWSDLExtensionQName())) {
+            context.push();
+            context.registerNamespaces(e);
+
+            // TODO: read UsingAddressing extensibility element and store
+            // TODO: it as extension in "parent". It may be used to generate
+            // TODO: @Action/@FaultAction later.
+
+            context.pop();
+            return true;
+        }
+        return false; // keep compiler happy
+    }
+
+    @Override
+    public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        String actionValue = XmlUtil.getAttributeNSOrNull(e, getActionQName());
+        if (actionValue == null || actionValue.equals("")) {
+            return warnEmptyAction(parent, context.getLocation(e));
+        }
+
+        context.push();
+        ((Input)parent).setAction(actionValue);
+        context.pop();
+
+        return true;
+    }
+
+    @Override
+    public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        String actionValue = XmlUtil.getAttributeNSOrNull(e, getActionQName());
+        if (actionValue == null || actionValue.equals("")) {
+            return warnEmptyAction(parent,context.getLocation(e));
+        }
+
+        context.push();
+        ((Output)parent).setAction(actionValue);
+        context.pop();
+
+        return true;
+    }
+
+    @Override
+    public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        String actionValue = XmlUtil.getAttributeNSOrNull(e, getActionQName());
+        if (actionValue == null || actionValue.equals("")) {
+            errReceiver.warning(context.getLocation(e), WsdlMessages.WARNING_FAULT_EMPTY_ACTION(parent.getNameValue(), parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
+            return false; // keep compiler happy
+        }
+
+        context.push();
+        ((Fault)parent).setAction(actionValue);
+        context.pop();
+
+        return true;
+    }
+
+    @Override
+    public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+        return handleBindingExtension(context, parent, e);
+    }
+
+    private boolean warnEmptyAction(TWSDLExtensible parent, Locator pos) {
+        errReceiver.warning(pos, WsdlMessages.WARNING_INPUT_OUTPUT_EMPTY_ACTION(parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
+        return false; // keep compiler happy
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java
new file mode 100644
index 0000000..885f821
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
+import com.sun.tools.internal.xjc.util.DOMUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/**
+ * @author Vivek Pandey
+ */
+public class WSDLInternalizationLogic implements InternalizationLogic{
+
+    /**
+     * This filter looks for &lt;xs:import> and &lt;xs:include>
+     * and parses those documents referenced by them.
+     */
+    private static final class ReferenceFinder extends AbstractReferenceFinderImpl {
+        ReferenceFinder( DOMForest parent ) {
+            super(parent);
+        }
+
+        protected String findExternalResource( String nsURI, String localName, Attributes atts) {
+            if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
+                if(parent.isExtensionMode()){
+                    //TODO: add support for importing schema using wsdl:import
+                }
+                return atts.getValue("location");
+            }else if(SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)){
+                return atts.getValue("schemaLocation");
+            }
+            return null;
+        }
+    }
+    public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
+        return new ReferenceFinder(parent);
+    }
+
+    public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
+        return false;
+    }
+
+    public Element refineSchemaTarget(Element target) {
+        // look for existing xs:annotation
+        Element annotation = DOMUtils.getFirstChildElement(target, Constants.NS_XSD, "annotation");
+        if(annotation==null)
+            // none exists. need to make one
+            annotation = insertXMLSchemaElement( target, "annotation" );
+
+        // then look for appinfo
+        Element appinfo = DOMUtils.getFirstChildElement(annotation, Constants.NS_XSD, "appinfo" );
+        if(appinfo==null)
+            // none exists. need to make one
+            appinfo = insertXMLSchemaElement( annotation, "appinfo" );
+
+        return appinfo;
+
+    }
+
+    public Element refineWSDLTarget(Element target){
+        // look for existing xs:annotation
+        Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings");
+        if(JAXWSBindings==null)
+            // none exists. need to make one
+            JAXWSBindings = insertJAXWSBindingsElement(target, "bindings" );
+        return JAXWSBindings;
+    }
+
+    private Element insertJAXWSBindingsElement( Element parent, String localName ) {
+        String qname = "JAXWS:"+localName;
+
+        Element child = parent.getOwnerDocument().createElementNS(JAXWSBindingsConstants.NS_JAXWS_BINDINGS, qname );
+
+        NodeList children = parent.getChildNodes();
+
+        if( children.getLength()==0 )
+            parent.appendChild(child);
+        else
+            parent.insertBefore( child, children.item(0) );
+
+        return child;
+    }
+
+
+    /**
+     * Creates a new XML Schema element of the given local name
+     * and insert it as the first child of the given parent node.
+     *
+     * @return
+     *      Newly create element.
+     */
+    private Element insertXMLSchemaElement( Element parent, String localName ) {
+        // use the same prefix as the parent node to avoid modifying
+        // the namespace binding.
+        String qname = parent.getTagName();
+        int idx = qname.indexOf(':');
+        if(idx==-1)     qname = localName;
+        else            qname = qname.substring(0,idx+1)+localName;
+
+        Element child = parent.getOwnerDocument().createElementNS( Constants.NS_XSD, qname );
+
+        NodeList children = parent.getChildNodes();
+
+        if( children.getLength()==0 )
+            parent.appendChild(child);
+        else
+            parent.insertBefore( child, children.item(0) );
+
+        return child;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java
index 93d3cf9..c3bf8af 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,13 @@
 
 package com.sun.tools.internal.ws.wsdl.parser;
 
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.dom.DOMSource;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.EntityResolver;
-
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.tools.internal.ws.util.xml.NullEntityResolver;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
+import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensionHandler;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+import com.sun.tools.internal.ws.wscompile.ErrorReceiverFilter;
 import com.sun.tools.internal.ws.wsdl.document.Binding;
 import com.sun.tools.internal.ws.wsdl.document.BindingFault;
 import com.sun.tools.internal.ws.wsdl.document.BindingInput;
@@ -79,309 +50,192 @@
 import com.sun.tools.internal.ws.wsdl.document.Port;
 import com.sun.tools.internal.ws.wsdl.document.PortType;
 import com.sun.tools.internal.ws.wsdl.document.Service;
-import com.sun.tools.internal.ws.wsdl.document.Types;
 import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
 import com.sun.tools.internal.ws.wsdl.document.WSDLDocument;
+import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
 import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
 import com.sun.tools.internal.ws.wsdl.framework.Entity;
-import com.sun.tools.internal.ws.wsdl.framework.Extensible;
-import com.sun.tools.internal.ws.wsdl.framework.ParseException;
-import com.sun.tools.internal.ws.wsdl.framework.ParserContext;
 import com.sun.tools.internal.ws.wsdl.framework.ParserListener;
-import com.sun.tools.internal.ws.util.xml.XmlUtil;
-import com.sun.tools.internal.ws.processor.util.ProcessorEnvironment;
-import com.sun.tools.internal.ws.processor.config.WSDLModelInfo;
+import com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.io.IOException;
 
 /**
- * A parser for WSDL documents.
+ * A parser for WSDL documents. This parser is used only at the tool time.
+ * Extensions should extend TWSDLExtensionHandler, so that it will be called during
+ * parsing wsdl to handle wsdl extenisbility elements. Generally these extensions
+ * will effect the artifacts generated during WSDL processing.
+ *
+ * @see com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser which will be used for WSDL parsing
+ * at runtime.
  *
  * @author WS Development Team
  */
 public class WSDLParser {
-    private WSDLModelInfo modelInfo;
-    private EntityResolver entityResolver;
-    //all the wsdl:import system Ids
-    private final Set<String> imports = new HashSet<String>();
-    //Map which holds wsdl Document(s) for a given SystemId
-    private final Map<String, Document> wsdlDocuments = new HashMap<String, Document>();
+    private final ErrorReceiverFilter errReceiver;
+    private WsimportOptions options;
+    private MetadataFinder forest;
 
-    private WSDLParser() {
-        _extensionHandlers = new HashMap();
-        hSet = new HashSet();
+    //wsdl extension handlers
+    private final Map extensionHandlers;
+
+    private ArrayList<ParserListener> listeners;
+
+    public WSDLParser(WsimportOptions options, ErrorReceiverFilter errReceiver) {
+        this.extensionHandlers = new HashMap();
+        this.options = options;
+        this.errReceiver = errReceiver;
 
         // register handlers for default extensions
-        register(new SOAPExtensionHandler());
-        register(new HTTPExtensionHandler());
-        register(new MIMEExtensionHandler());
-        register(new SchemaExtensionHandler());
-        register(new JAXWSBindingExtensionHandler());
-        register(new SOAP12ExtensionHandler());
+        register(new SOAPExtensionHandler(extensionHandlers));
+        register(new HTTPExtensionHandler(extensionHandlers));
+        register(new MIMEExtensionHandler(extensionHandlers));
+        register(new JAXWSBindingExtensionHandler(extensionHandlers));
+        register(new SOAP12ExtensionHandler(extensionHandlers));
+        register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver));
+        register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
+
+        for (TWSDLExtensionHandler te : ServiceFinder.find(TWSDLExtensionHandler.class)) {
+            register(te);
+        }
+
     }
 
-    public WSDLParser(WSDLModelInfo modelInfo) {
-        this();
-        assert(modelInfo != null);
-        this.modelInfo = modelInfo;
-        this.entityResolver = modelInfo.getEntityResolver();
-    }
-
-    public void register(ExtensionHandler h) {
-        _extensionHandlers.put(h.getNamespaceURI(), h);
-        h.setExtensionHandlers(_extensionHandlers);
-    }
-
-    public void unregister(ExtensionHandler h) {
-        _extensionHandlers.put(h.getNamespaceURI(), null);
-        h.setExtensionHandlers(null);
-    }
-
-    public void unregister(String uri) {
-        _extensionHandlers.put(uri, null);
-    }
-
-    public boolean getFollowImports() {
-        return _followImports;
-    }
-
-    public void setFollowImports(boolean b) {
-        _followImports = b;
+    private void register(TWSDLExtensionHandler h) {
+        extensionHandlers.put(h.getNamespaceURI(), h);
     }
 
     public void addParserListener(ParserListener l) {
-        if (_listeners == null) {
-            _listeners = new ArrayList();
+        if (listeners == null) {
+            listeners = new ArrayList<ParserListener>();
         }
-        _listeners.add(l);
+        listeners.add(l);
     }
 
-    public void removeParserListener(ParserListener l) {
-        if (_listeners == null) {
-            return;
-        }
-        _listeners.remove(l);
-    }
+    public WSDLDocument parse() throws SAXException, IOException {
+        forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
+        forest.parseWSDL();
+        if(forest.isMexMetadata)
+            errReceiver.reset();
 
-//    public WSDLDocument parse(InputSource source) {
-//        _messageFactory =
-//            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.wsdl");
-//        _localizer = new Localizer();
-//
-//        WSDLDocument document = new WSDLDocument();
-//        document.setSystemId(source.getSystemId());
-//        ParserContext context = new ParserContext(document, _listeners);
-//        context.setFollowImports(_followImports);
-//        document.setDefinitions(parseDefinitions(context, source, null));
-//        return document;
-//    }
-
-    public WSDLDocument parse(){
-        String location = modelInfo.getLocation();
-        assert(location != null);
-        _messageFactory =
-            new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.wsdl");
-        _localizer = new Localizer();
-
-        WSDLDocument document = new WSDLDocument();
-        InputSource source = null;
-        String wsdlLoc = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(location));
-        if(entityResolver != null){
-            try {
-                source = entityResolver.resolveEntity(null, wsdlLoc);
-            } catch (SAXException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.saxExceptionWithSystemId",
-                        source.getSystemId(),e);
-                } else {
-                    throw new ParseException("parsing.saxException",e);
-                }
-            } catch (IOException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.ioExceptionWithSystemId",
-                        source.getSystemId(),e);
-                } else {
-                    throw new ParseException("parsing.ioException",e);
-                }
+        // parse external binding files
+        for (InputSource value : options.getWSDLBindings()) {
+            errReceiver.pollAbort();
+            Document root = forest.parse(value, true); // TODO: I think this should be false - KK
+            if(root==null)       continue;   // error must have been reported
+            Element binding = root.getDocumentElement();
+            if (!fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS)
+                    || !binding.getLocalName().equals("bindings")){
+                    errReceiver.error(forest.locatorTable.getStartLocation(binding), WsdlMessages.PARSER_NOT_A_BINDING_FILE(
+                        binding.getNamespaceURI(),
+                        binding.getLocalName()));
+                continue;
             }
+
+            NodeList nl = binding.getElementsByTagNameNS(
+                "http://java.sun.com/xml/ns/javaee", "handler-chains");
+            for(int i = 0; i < nl.getLength(); i++){
+                options.addHandlerChainConfiguration((Element) nl.item(i));
+            }
+
         }
-        if(source == null){
-            //default resolution
-            source = new InputSource(wsdlLoc);
-        }
-        document.setSystemId(wsdlLoc);
-        ParserContext context = new ParserContext(document, _listeners);
-        context.setFollowImports(_followImports);
-        document.setDefinitions(parseDefinitions(context, source, null));
+        return buildWSDLDocument();
+    }
+
+    private String fixNull(String s) {
+        if(s==null) return "";
+        else        return s;
+    }
+
+    public MetadataFinder getDOMForest() {
+        return forest;
+    }
+
+    private WSDLDocument buildWSDLDocument(){
+        /**
+         * Currently we are working off first WSDL document
+         * TODO: add support of creating WSDLDocument from collection of WSDL documents
+         */
+
+        String location = forest.getRootWSDL();
+
+        //It means that WSDL is not found, an error might have been reported, lets try to recover
+        if(location == null)
+            return null;
+
+        Document root = forest.get(location);
+
+        if(root == null)
+            return null;
+
+        WSDLDocument document = new WSDLDocument(forest, errReceiver);
+        document.setSystemId(location);
+        TWSDLParserContextImpl context = new TWSDLParserContextImpl(forest, document, listeners, errReceiver);
+
+        Definitions definitions = parseDefinitions(context, root);
+        document.setDefinitions(definitions);
         return document;
     }
 
-    protected Definitions parseDefinitions(ParserContext context,
-            InputSource source, String expectedTargetNamespaceURI) {
+    private Definitions parseDefinitions(TWSDLParserContextImpl context, Document root) {
         context.pushWSDLLocation();
         context.setWSDLLocation(context.getDocument().getSystemId());
-        String sysId = context.getDocument().getSystemId();
-        buildDocumentFromWSDL(sysId, source, expectedTargetNamespaceURI);
-        Document root = wsdlDocuments.get(sysId);
 
-        //Internalizer.transform takes Set of jaxws:bindings elements, this is to allow multiple external
-        //bindings to be transformed.
-        new Internalizer().transform(modelInfo.getJAXWSBindings(), wsdlDocuments,
-                (ProcessorEnvironment)modelInfo.getParent().getEnvironment());
+        new Internalizer(forest, options, errReceiver).transform();
 
         //print the wsdl
 //        try{
-//            dump(System.out);
+//            forest.dump(System.out);
 //        }catch(IOException e){
 //            e.printStackTrace();
 //        }
 
-        Definitions definitions = parseDefinitionsNoImport(context, root, expectedTargetNamespaceURI);
-        processImports(context, source, definitions);
+        Definitions definitions = parseDefinitionsNoImport(context, root);
+        if(definitions == null){
+            Locator locator = forest.locatorTable.getStartLocation(root.getDocumentElement());
+            errReceiver.error(locator, WsdlMessages.PARSING_NOT_AWSDL(locator.getSystemId()));
+
+        }
+        processImports(context);
         context.popWSDLLocation();
         return definitions;
     }
 
-    /**
-     * @param systemId
-     * @param source
-     * @param expectedTargetNamespaceURI
-     */
-    private void buildDocumentFromWSDL(String systemId, InputSource source, String expectedTargetNamespaceURI) {
-        try {
-            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-            builderFactory.setNamespaceAware(true);
-            builderFactory.setValidating(false);
-            DocumentBuilder builder = builderFactory.newDocumentBuilder();
-            builder.setErrorHandler(new ErrorHandler() {
-                public void error(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void fatalError(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void warning(SAXParseException err)
-                    throws SAXParseException {
-                    // do nothing
-                }
-            });
-            if(entityResolver != null)
-                builder.setEntityResolver(entityResolver);
-            else
-                builder.setEntityResolver(new NullEntityResolver());
-
-            try {
-                Document document = builder.parse(source);
-                wsdlDocuments.put(systemId, document);
-                Element e = document.getDocumentElement();
-                Util.verifyTagNSRootElement(e, WSDLConstants.QNAME_DEFINITIONS);
-                String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME);
-
-                String _targetNamespaceURI =
-                    XmlUtil.getAttributeOrNull(e, Constants.ATTR_TARGET_NAMESPACE);
-
-                if (expectedTargetNamespaceURI != null
-                    && !expectedTargetNamespaceURI.equals(_targetNamespaceURI)){
-                    //TODO: throw an exception???
-                }
-
-                for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
-                    Element e2 = Util.nextElement(iter);
-                    if (e2 == null)
-                        break;
-
-                    //check to see if it has imports
-                    if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_IMPORT)){
-                        String namespace = Util.getRequiredAttribute(e2, Constants.ATTR_NAMESPACE);
-                        String location = Util.getRequiredAttribute(e2, Constants.ATTR_LOCATION);
-                        location = getAdjustedLocation(source, location);
-                        if(location != null && !location.equals("")){
-                            if(!imports.contains(location)){
-                                imports.add(location);
-                                InputSource impSource = null;
-                                if(entityResolver != null){
-                                    impSource = entityResolver.resolveEntity(null, location);
-                                }
-
-                                if(impSource==null)
-                                    impSource = new InputSource(location);  // default resolution{
-
-                                buildDocumentFromWSDL(location, impSource, namespace);
-                            }
-                        }
-                    }
-                }
-            } catch (IOException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.ioExceptionWithSystemId",
-                        source.getSystemId(),e);
-                } else {
-                    throw new ParseException("parsing.ioException",e);
-                }
-            } catch (SAXException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.saxExceptionWithSystemId",
-                        source.getSystemId(),e);
-                } else {
-                    throw new ParseException("parsing.saxException",e);
-                }
-            }
-        } catch (ParserConfigurationException e) {
-            throw new ParseException(
-                "parsing.parserConfigException",e);
-        } catch (FactoryConfigurationError e) {
-            throw new ParseException(
-                "parsing.factoryConfigException",e);
-        }
-    }
-
-    private String getAdjustedLocation(InputSource source, String location) {
-        return source.getSystemId() == null
-            ? location
-            : Util.processSystemIdWithBase(
-                source.getSystemId(),
-                location);
-    }
-
-    /**
-     * Dumps the contents of the forest to the specified stream.
-     *
-     * This is a debug method. As such, error handling is sloppy.
-     */
-    public void dump( OutputStream out ) throws IOException {
-        try {
-            // create identity transformer
-            Transformer it = XmlUtil.newTransformer();
-
-            for( Iterator itr=wsdlDocuments.entrySet().iterator(); itr.hasNext(); ) {
-                Map.Entry e = (Map.Entry)itr.next();
-
-                out.write( ("---<< "+e.getKey()+"\n").getBytes() );
-
-                it.transform( new DOMSource((Document)e.getValue()), new StreamResult(out) );
-
-                out.write( "\n\n\n".getBytes() );
-            }
-        } catch( TransformerException e ) {
-            e.printStackTrace();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see WSDLParser#processImports(ParserContext, org.xml.sax.InputSource, Definitions)
-     */
-    protected void processImports(ParserContext context, InputSource source, Definitions definitions) {
-        for(String location : imports){
+    private void processMexDocs(TWSDLParserContextImpl context){
+        for(String location : forest.listSystemIDs()){
             if (!context.getDocument().isImportedDocument(location)){
-                Definitions importedDefinitions = parseDefinitionsNoImport(context,
-                        wsdlDocuments.get(location), location);
+                Document doc = forest.get(location);
+                if(doc == null)
+                    continue;
+                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
+                if(importedDefinitions == null)
+                    continue;
+                context.getDocument().addImportedEntity(importedDefinitions);
+                context.getDocument().addImportedDocument(location);
+            }
+        }
+    }
+    private void processImports(TWSDLParserContextImpl context) {
+        for(String location : forest.getExternalReferences()){
+            if (!context.getDocument().isImportedDocument(location)){
+                Document doc = forest.get(location);
+                if(doc == null)
+                    continue;
+                Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
                 if(importedDefinitions == null)
                     continue;
                 context.getDocument().addImportedEntity(importedDefinitions);
@@ -390,93 +244,25 @@
         }
     }
 
-    protected Definitions parseDefinitionsNoImport(
-        ParserContext context,
-        InputSource source,
-        String expectedTargetNamespaceURI) {
-        try {
-            DocumentBuilderFactory builderFactory =
-                DocumentBuilderFactory.newInstance();
-            builderFactory.setNamespaceAware(true);
-            builderFactory.setValidating(false);
-            DocumentBuilder builder = builderFactory.newDocumentBuilder();
-            builder.setErrorHandler(new ErrorHandler() {
-                public void error(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void fatalError(SAXParseException e)
-                    throws SAXParseException {
-                    throw e;
-                }
-
-                public void warning(SAXParseException err)
-                    throws SAXParseException {
-                    // do nothing
-                }
-            });
-            builder.setEntityResolver(new NullEntityResolver());
-
-            try {
-                Document document = builder.parse(source);
-                return parseDefinitionsNoImport(
-                    context,
-                    document,
-                    expectedTargetNamespaceURI);
-            } catch (IOException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.ioExceptionWithSystemId",
-                        source.getSystemId(),e);
-                } else {
-                    throw new ParseException("parsing.ioException",e);
-                }
-            } catch (SAXException e) {
-                if (source.getSystemId() != null) {
-                    throw new ParseException(
-                        "parsing.saxExceptionWithSystemId",
-                        source.getSystemId(),
-                        e);
-                } else {
-                    throw new ParseException("parsing.saxException",e);
-                }
-            }
-        } catch (ParserConfigurationException e) {
-            throw new ParseException("parsing.parserConfigException",e);
-        } catch (FactoryConfigurationError e) {
-            throw new ParseException("parsing.factoryConfigException",e);
+    private Definitions parseDefinitionsNoImport(
+        TWSDLParserContextImpl context,
+        Document doc) {
+        Element e = doc.getDocumentElement();
+        //at this poinjt we expect a wsdl or schema document to be fully qualified
+        if(e.getNamespaceURI() == null || (!e.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !e.getLocalName().equals("definitions"))){
+            return null;
         }
-    }
-
-    protected Definitions parseDefinitionsNoImport(
-        ParserContext context,
-        Document doc,
-        String expectedTargetNamespaceURI) {
-        _targetNamespaceURI = null;
-        Element root = doc.getDocumentElement();
-        Util.verifyTagNSRootElement(root, WSDLConstants.QNAME_DEFINITIONS);
-        return parseDefinitionsNoImport(
-            context,
-            root,
-            expectedTargetNamespaceURI);
-    }
-
-    protected Definitions parseDefinitionsNoImport(
-        ParserContext context,
-        Element e,
-        String expectedTargetNamespaceURI) {
         context.push();
         context.registerNamespaces(e);
 
-        Definitions definitions = new Definitions(context.getDocument());
+        Definitions definitions = new Definitions(context.getDocument(), forest.locatorTable.getStartLocation(e));
         String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME);
         definitions.setName(name);
 
-        _targetNamespaceURI =
+        String targetNamespaceURI =
             XmlUtil.getAttributeOrNull(e, Constants.ATTR_TARGET_NAMESPACE);
 
-        definitions.setTargetNamespaceURI(_targetNamespaceURI);
+        definitions.setTargetNamespaceURI(targetNamespaceURI);
 
         boolean gotDocumentation = false;
         boolean gotTypes = false;
@@ -488,24 +274,22 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
+                    return null;
                 }
                 gotDocumentation = true;
                 if(definitions.getDocumentation() == null)
                     definitions.setDocumentation(getDocumentationFor(e2));
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_TYPES)) {
-                if (gotTypes) {
-                    Util.fail(
-                        "parsing.onlyOneTypesAllowed",
-                        Constants.TAG_DEFINITIONS);
+                if (gotTypes && !options.isExtensionMode()) {
+                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_TYPES_ALLOWED(Constants.TAG_DEFINITIONS));
+                    return null;
                 }
+                gotTypes = true;
                 //add all the wsdl:type elements to latter make a list of all the schema elements
                 // that will be needed to create jaxb model
-                addSchemaElements(e2);
-
-                //definitions.setTypes(parseTypes(context, definitions, e2));
+                if(!options.isExtensionMode())
+                    validateSchemaImports(e2);
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_MESSAGE)) {
                 Message message = parseMessage(context, definitions, e2);
                 definitions.add(message);
@@ -521,10 +305,8 @@
                 definitions.add(service);
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_IMPORT)) {
                 definitions.add(parseImport(context, definitions, e2));
-            } else if (
-                (_useWSIBasicProfile)
-                    && (XmlUtil.matchesTagNS(e2, SchemaConstants.QNAME_IMPORT))) {
-                warn("warning.wsi.r2003");
+            } else if (XmlUtil.matchesTagNS(e2, SchemaConstants.QNAME_IMPORT)) {
+                errReceiver.warning(forest.locatorTable.getStartLocation(e2), WsdlMessages.WARNING_WSI_R_2003());
             } else {
                 // possible extensibility element -- must live outside the WSDL namespace
                 checkNotWsdlElement(e2);
@@ -541,13 +323,13 @@
         return definitions;
     }
 
-    protected Message parseMessage(
-        ParserContext context,
+    private Message parseMessage(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        Message message = new Message(definitions);
+        Message message = new Message(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         message.setName(name);
 
@@ -582,10 +364,10 @@
         return message;
     }
 
-    protected MessagePart parseMessagePart(ParserContext context, Element e) {
+    private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
         context.push();
         context.registerNamespaces(e);
-        MessagePart part = new MessagePart();
+        MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
         String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         part.setName(partName);
 
@@ -595,19 +377,20 @@
 
         if (elementAttr != null) {
             if (typeAttr != null) {
-                Util.fail("parsing.onlyOneOfElementOrTypeRequired", partName);
+                errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));
+
             }
 
-            part.setDescriptor(context.translateQualifiedName(elementAttr));
+            part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
             part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
         } else if (typeAttr != null) {
-            part.setDescriptor(context.translateQualifiedName(typeAttr));
+            part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
             part.setDescriptorKind(SchemaKinds.XSD_TYPE);
         } else {
             // XXX-NOTE - this is wrong; for extensibility purposes,
             // any attribute can be specified on a <part> element, so
             // we need to put an extensibility hook here
-            Util.fail("parsing.elementOrTypeRequired", partName);
+            errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));
         }
 
         context.pop();
@@ -615,13 +398,13 @@
         return part;
     }
 
-    protected PortType parsePortType(
-        ParserContext context,
+    private PortType parsePortType(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        PortType portType = new PortType(definitions);
+        PortType portType = new PortType(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         portType.setName(name);
 
@@ -634,9 +417,7 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 if(portType.getDocumentation() == null)
@@ -644,6 +425,7 @@
             } else if (
                 XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_OPERATION)) {
                 Operation op = parsePortTypeOperation(context, e2);
+                op.setParent(portType);
                 portType.add(op);
             } else {
                 // possible extensibility element -- must live outside the WSDL namespace
@@ -664,13 +446,13 @@
         return portType;
     }
 
-    protected Operation parsePortTypeOperation(
-        ParserContext context,
+    private Operation parsePortTypeOperation(
+        TWSDLParserContextImpl context,
         Element e) {
         context.push();
         context.registerNamespaces(e);
 
-        Operation operation = new Operation();
+        Operation operation = new Operation(forest.locatorTable.getStartLocation(e));
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         operation.setName(name);
         String parameterOrderAttr =
@@ -691,29 +473,25 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e2.getLocalName()));
                 }
                 gotDocumentation = true;
                 if(operation.getDocumentation() == null)
                     operation.setDocumentation(getDocumentationFor(e2));
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_INPUT)) {
                 if (gotInput) {
-                    Util.fail(
-                        "parsing.tooManyElements",
-                        new Object[] {
-                            Constants.TAG_INPUT,
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_TOO_MANY_ELEMENTS(Constants.TAG_INPUT,
                             Constants.TAG_OPERATION,
-                            name });
+                            name));
                 }
 
                 context.push();
                 context.registerNamespaces(e2);
-                Input input = new Input();
+                Input input = new Input(forest.locatorTable.getStartLocation(e2), errReceiver);
+                input.setParent(operation);
                 String messageAttr =
                     Util.getRequiredAttribute(e2, Constants.ATTR_MESSAGE);
-                input.setMessage(context.translateQualifiedName(messageAttr));
+                input.setMessage(context.translateQualifiedName(context.getLocation(e2), messageAttr));
                 String nameAttr =
                     XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
                 input.setName(nameAttr);
@@ -723,10 +501,27 @@
                     inputBeforeOutput = false;
                 }
 
+                // check for extensiblity attributes
+                for (Iterator iter2 = XmlUtil.getAllAttributes(e2);
+                     iter2.hasNext();
+                ) {
+                    Attr e3 = (Attr)iter2.next();
+                    if (e3.getLocalName().equals(Constants.ATTR_MESSAGE) ||
+                        e3.getLocalName().equals(Constants.ATTR_NAME))
+                        continue;
+
+                    // possible extensibility element -- must live outside the WSDL namespace
+                    checkNotWsdlAttribute(e3);
+                    if (!handleExtension(context, input, e3, e2)) {
+                        // ignore the extensiblity attribute
+                        // TODO throw a WARNING
+                    }
+                }
+
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
                     Element e3 = Util.nextElement(iter2);
                     if (e3 == null)
@@ -735,36 +530,30 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         input.setDocumentation(getDocumentationFor(e3));
                     } else {
-                        Util.fail(
-                            "parsing.invalidElement",
-                            e3.getTagName(),
-                            e3.getNamespaceURI());
+                        errReceiver.error(forest.locatorTable.getStartLocation(e3), WsdlMessages.PARSING_INVALID_ELEMENT(e3.getTagName(),
+                            e3.getNamespaceURI()));
                     }
                 }
                 context.pop();
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_OUTPUT)) {
                 if (gotOutput) {
-                    Util.fail(
-                        "parsing.tooManyElements",
-                        new Object[] {
-                            Constants.TAG_OUTPUT,
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_TOO_MANY_ELEMENTS(Constants.TAG_INPUT,
                             Constants.TAG_OPERATION,
-                            name });
+                            name));
                 }
 
                 context.push();
                 context.registerNamespaces(e2);
-                Output output = new Output();
+                Output output = new Output(forest.locatorTable.getStartLocation(e2), errReceiver);
+                output.setParent(operation);
                 String messageAttr =
                     Util.getRequiredAttribute(e2, Constants.ATTR_MESSAGE);
-                output.setMessage(context.translateQualifiedName(messageAttr));
+                output.setMessage(context.translateQualifiedName(context.getLocation(e2), messageAttr));
                 String nameAttr =
                     XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
                 output.setName(nameAttr);
@@ -774,10 +563,27 @@
                     inputBeforeOutput = true;
                 }
 
+                // check for extensiblity attributes
+                for (Iterator iter2 = XmlUtil.getAllAttributes(e2);
+                     iter2.hasNext();
+                ) {
+                    Attr e3 = (Attr)iter2.next();
+                    if (e3.getLocalName().equals(Constants.ATTR_MESSAGE) ||
+                        e3.getLocalName().equals(Constants.ATTR_NAME))
+                        continue;
+
+                    // possible extensibility element -- must live outside the WSDL namespace
+                    checkNotWsdlAttribute(e3);
+                    if (!handleExtension(context, output, e3, e2)) {
+                        // ignore the extensiblity attribute
+                        // TODO throw a WARNING
+                    }
+                }
+
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
                     Element e3 = Util.nextElement(iter2);
                     if (e3 == null)
@@ -786,37 +592,51 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         output.setDocumentation(getDocumentationFor(e3));
                     } else {
-                        Util.fail(
-                            "parsing.invalidElement",
-                            e3.getTagName(),
-                            e3.getNamespaceURI());
+                        errReceiver.error(forest.locatorTable.getStartLocation(e3), WsdlMessages.PARSING_INVALID_ELEMENT(e3.getTagName(),
+                            e3.getNamespaceURI()));
                     }
                 }
                 context.pop();
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_FAULT)) {
                 context.push();
                 context.registerNamespaces(e2);
-                Fault fault = new Fault();
+                Fault fault = new Fault(forest.locatorTable.getStartLocation(e2));
+                fault.setParent(operation);
                 String messageAttr =
                     Util.getRequiredAttribute(e2, Constants.ATTR_MESSAGE);
-                fault.setMessage(context.translateQualifiedName(messageAttr));
+                fault.setMessage(context.translateQualifiedName(context.getLocation(e2), messageAttr));
                 String nameAttr =
                     XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
                 fault.setName(nameAttr);
                 operation.addFault(fault);
                 gotFault = true;
 
+                // check for extensiblity attributes
+                for (Iterator iter2 = XmlUtil.getAllAttributes(e2);
+                     iter2.hasNext();
+                ) {
+                    Attr e3 = (Attr)iter2.next();
+                    if (e3.getLocalName().equals(Constants.ATTR_MESSAGE) ||
+                        e3.getLocalName().equals(Constants.ATTR_NAME))
+                        continue;
+
+                    // possible extensibility element -- must live outside the WSDL namespace
+                    checkNotWsdlAttribute(e3);
+                    if (!handleExtension(context, fault, e3, e2)) {
+                        // ignore the extensiblity attribute
+                        // TODO throw a WARNING
+                    }
+                }
+
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
                     Element e3 = Util.nextElement(iter2);
                     if (e3 == null)
@@ -825,9 +645,7 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         if(fault.getDocumentation() == null)
@@ -869,7 +687,7 @@
         } else if (gotOutput && !gotInput && !gotFault) {
             operation.setStyle(OperationStyle.NOTIFICATION);
         } else {
-            Util.fail("parsing.invalidOperationStyle", name);
+            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_INVALID_OPERATION_STYLE(name));
         }
 
         context.pop();
@@ -877,17 +695,17 @@
         return operation;
     }
 
-    protected Binding parseBinding(
-        ParserContext context,
+    private Binding parseBinding(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        Binding binding = new Binding(definitions);
+        Binding binding = new Binding(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         binding.setName(name);
         String typeAttr = Util.getRequiredAttribute(e, Constants.ATTR_TYPE);
-        binding.setPortType(context.translateQualifiedName(typeAttr));
+        binding.setPortType(context.translateQualifiedName(context.getLocation(e), typeAttr));
 
         boolean gotDocumentation = false;
 
@@ -898,9 +716,7 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 binding.setDocumentation(getDocumentationFor(e2));
@@ -922,12 +738,12 @@
         return binding;
     }
 
-    protected BindingOperation parseBindingOperation(
-        ParserContext context,
+    private BindingOperation parseBindingOperation(
+        TWSDLParserContextImpl context,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        BindingOperation operation = new BindingOperation();
+        BindingOperation operation = new BindingOperation(forest.locatorTable.getStartLocation(e));
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         operation.setName(name);
 
@@ -944,39 +760,22 @@
                 break;
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 operation.setDocumentation(getDocumentationFor(e2));
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_INPUT)) {
                 if (gotInput) {
-                    Util.fail(
-                        "parsing.tooManyElements",
-                        new Object[] {
-                            Constants.TAG_INPUT,
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_TOO_MANY_ELEMENTS(Constants.TAG_INPUT,
                             Constants.TAG_OPERATION,
-                            name });
+                            name));
                 }
 
                 /* Here we check for the use scenario */
                 Iterator itere2 = XmlUtil.getAllChildren(e2);
-                Element ee = Util.nextElement(itere2);
-                if (hSet.isEmpty()) {
-                    hSet.add(ee.getAttribute("use"));
-                } else {
-                    /* this codition will happen when the wsdl used has a mixture of
-                       literal and encoded style */
-                    if (!hSet.contains(ee.getAttribute("use"))
-                        && (ee.getAttribute("use") != "")) {
-                        hSet.add(ee.getAttribute("use"));
-                    }
-                }
-
                 context.push();
                 context.registerNamespaces(e2);
-                BindingInput input = new BindingInput();
+                BindingInput input = new BindingInput(forest.locatorTable.getStartLocation(e2));
                 String nameAttr =
                     XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
                 input.setName(nameAttr);
@@ -989,7 +788,7 @@
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
                     Element e3 = Util.nextElement(iter2);
                     if (e3 == null)
@@ -998,9 +797,7 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         input.setDocumentation(getDocumentationFor(e3));
@@ -1015,17 +812,14 @@
                 context.pop();
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_OUTPUT)) {
                 if (gotOutput) {
-                    Util.fail(
-                        "parsing.tooManyElements",
-                        new Object[] {
-                            Constants.TAG_OUTPUT,
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_TOO_MANY_ELEMENTS(Constants.TAG_INPUT,
                             Constants.TAG_OPERATION,
-                            name });
+                            name));
                 }
 
                 context.push();
                 context.registerNamespaces(e2);
-                BindingOutput output = new BindingOutput();
+                BindingOutput output = new BindingOutput(forest.locatorTable.getStartLocation(e2));
                 String nameAttr =
                     XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME);
                 output.setName(nameAttr);
@@ -1038,7 +832,7 @@
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
 
                     Element e3 = Util.nextElement(iter2);
@@ -1048,9 +842,7 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         output.setDocumentation(getDocumentationFor(e3));
@@ -1066,7 +858,7 @@
             } else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_FAULT)) {
                 context.push();
                 context.registerNamespaces(e2);
-                BindingFault fault = new BindingFault();
+                BindingFault fault = new BindingFault(forest.locatorTable.getStartLocation(e2));
                 String nameAttr =
                     Util.getRequiredAttribute(e2, Constants.ATTR_NAME);
                 fault.setName(nameAttr);
@@ -1076,7 +868,7 @@
                 // verify that there is at most one child element and it is a documentation element
                 boolean gotDocumentation2 = false;
                 for (Iterator iter2 = XmlUtil.getAllChildren(e2);
-                    iter2.hasNext();
+                     iter2.hasNext();
                     ) {
                     Element e3 = Util.nextElement(iter2);
                     if (e3 == null)
@@ -1085,9 +877,7 @@
                     if (XmlUtil
                         .matchesTagNS(e3, WSDLConstants.QNAME_DOCUMENTATION)) {
                         if (gotDocumentation2) {
-                            Util.fail(
-                                "parsing.onlyOneDocumentationAllowed",
-                                e.getLocalName());
+                            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                         }
                         gotDocumentation2 = true;
                         if(fault.getDocumentation() == null)
@@ -1119,7 +909,7 @@
         } else if (gotOutput && !gotInput && !gotFault) {
             operation.setStyle(OperationStyle.NOTIFICATION);
         } else {
-            Util.fail("parsing.invalidOperationStyle", name);
+            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_INVALID_OPERATION_STYLE(name));
         }
 
         context.pop();
@@ -1127,13 +917,13 @@
         return operation;
     }
 
-    protected Import parseImport(
-        ParserContext context,
+    private Import parseImport(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        Import anImport = new Import();
+        Import anImport = new Import(forest.locatorTable.getStartLocation(e));
         String namespace =
             Util.getRequiredAttribute(e, Constants.ATTR_NAMESPACE);
         anImport.setNamespace(namespace);
@@ -1150,17 +940,13 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 anImport.setDocumentation(getDocumentationFor(e2));
             } else {
-                Util.fail(
-                    "parsing.invalidElement",
-                    e2.getTagName(),
-                    e2.getNamespaceURI());
+                errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_INVALID_ELEMENT(e2.getTagName(),
+                    e2.getNamespaceURI()));
             }
         }
         context.pop();
@@ -1168,13 +954,13 @@
         return anImport;
     }
 
-    protected Service parseService(
-        ParserContext context,
+    private Service parseService(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
-        Service service = new Service(definitions);
+        Service service = new Service(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         service.setName(name);
 
@@ -1187,9 +973,7 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 if(service.getDocumentation() == null)
@@ -1211,20 +995,20 @@
         return service;
     }
 
-    protected Port parsePort(
-        ParserContext context,
+    private Port parsePort(
+        TWSDLParserContextImpl context,
         Definitions definitions,
         Element e) {
         context.push();
         context.registerNamespaces(e);
 
-        Port port = new Port(definitions);
+        Port port = new Port(definitions, forest.locatorTable.getStartLocation(e), errReceiver);
         String name = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
         port.setName(name);
 
         String bindingAttr =
             Util.getRequiredAttribute(e, Constants.ATTR_BINDING);
-        port.setBinding(context.translateQualifiedName(bindingAttr));
+        port.setBinding(context.translateQualifiedName(context.getLocation(e), bindingAttr));
 
         boolean gotDocumentation = false;
 
@@ -1235,9 +1019,7 @@
 
             if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
                 if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
+                    errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
                 }
                 gotDocumentation = true;
                 if(port.getDocumentation() == null)
@@ -1256,116 +1038,79 @@
         return port;
     }
 
-    protected Types parseTypes(
-        ParserContext context,
-        Definitions definitions,
-        Element e) {
-        context.push();
-        context.registerNamespaces(e);
-        Types types = new Types();
-
-        boolean gotDocumentation = false;
-
-        for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
-            Element e2 = Util.nextElement(iter);
-            if (e2 == null)
-                break;
-
-            if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
-                if (gotDocumentation) {
-                    Util.fail(
-                        "parsing.onlyOneDocumentationAllowed",
-                        e.getLocalName());
-                }
-                gotDocumentation = true;
-                types.setDocumentation(getDocumentationFor(e2));
-            } //bug fix 4854004
-            else if (
-                (_useWSIBasicProfile)
-                    && (XmlUtil.matchesTagNS(e2, SchemaConstants.QNAME_IMPORT))) {
-                warn("warning.wsi.r2003");
-            } else {
-                // possible extensibility element -- must live outside the WSDL namespace
-                checkNotWsdlElement(e2);
-                try {
-                    if (!handleExtension(context, types, e2)) {
-                        checkNotWsdlRequired(e2);
-                    }
-                } catch (ParseException pe) {
-                    if (pe.getKey().equals("parsing.incorrectRootElement")) {
-                        if (_useWSIBasicProfile) {
-                            warn("warning.wsi.r2004");
-                        }
-                        throw pe;
-                    }
-                }
-            }
-        }
-
-        context.pop();
-        context.fireDoneParsingEntity(WSDLConstants.QNAME_TYPES, types);
-        return types;
-    }
-
-    private List _elements = new ArrayList();
-
-    public void addSchemaElements(Element typesElement){
+    private void validateSchemaImports(Element typesElement){
         for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
             Element e = Util.nextElement(iter);
             if (e == null)
                 break;
-
-            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
-                _elements.add(e);
-            } else {
-                // possible extensibility element -- must live outside the WSDL namespace
+            if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
+                errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
+            }else{
                 checkNotWsdlElement(e);
+//                if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_SCHEMA)) {
+//                    forest.getInlinedSchemaElement().add(e);
+//                }
+
             }
         }
     }
 
-    public List getSchemaElements(){
-        return _elements;
-    }
 
-    protected boolean handleExtension(
-        ParserContext context,
-        Extensible entity,
+    private boolean handleExtension(
+        TWSDLParserContextImpl context,
+        TWSDLExtensible entity,
         Element e) {
-        ExtensionHandler h =
-            (ExtensionHandler) _extensionHandlers.get(e.getNamespaceURI());
+        TWSDLExtensionHandler h =
+             (TWSDLExtensionHandler) extensionHandlers.get(e.getNamespaceURI());
         if (h == null) {
-            context.fireIgnoringExtension(
-                new QName(e.getNamespaceURI(), e.getLocalName()),
-                ((Entity) entity).getElementName());
+            context.fireIgnoringExtension(e, (Entity) entity);
             return false;
         } else {
             return h.doHandleExtension(context, entity, e);
         }
     }
 
-    protected void checkNotWsdlElement(Element e) {
-        // possible extensibility element -- must live outside the WSDL namespace
-        if (e.getNamespaceURI().equals(Constants.NS_WSDL))
-            Util.fail("parsing.invalidWsdlElement", e.getTagName());
+    private boolean handleExtension(
+        TWSDLParserContextImpl context,
+        TWSDLExtensible entity,
+        Node n,
+        Element e) {
+        TWSDLExtensionHandler h =
+            (TWSDLExtensionHandler) extensionHandlers.get(n.getNamespaceURI());
+        if (h == null) {
+            context.fireIgnoringExtension(e, (Entity) entity);
+            return false;
+        } else {
+            return h.doHandleExtension(context, entity, e);
+        }
     }
 
-    protected void checkNotWsdlRequired(Element e) {
+    private void checkNotWsdlElement(Element e) {
+        // possible extensibility element -- must live outside the WSDL namespace
+        if (e.getNamespaceURI() != null && e.getNamespaceURI().equals(Constants.NS_WSDL))
+            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(e.getTagName()));
+    }
+
+    private void checkNotWsdlAttribute(Attr a) {
+        // possible extensibility element -- must live outside the WSDL namespace
+        if (a.getNamespaceURI().equals(Constants.NS_WSDL))
+            errReceiver.error(forest.locatorTable.getStartLocation(a.getOwnerElement()), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(a.getLocalName()));
+    }
+
+    private void checkNotWsdlRequired(Element e) {
         // check the wsdl:required attribute, fail if set to "true"
         String required =
             XmlUtil.getAttributeNSOrNull(
                 e,
                 Constants.ATTR_REQUIRED,
                 Constants.NS_WSDL);
-        if (required != null && required.equals(Constants.TRUE)) {
-            Util.fail(
-                "parsing.requiredExtensibilityElement",
-                e.getTagName(),
-                e.getNamespaceURI());
+        if (required != null && required.equals(Constants.TRUE) && !options.isExtensionMode()) {
+            errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_REQUIRED_EXTENSIBILITY_ELEMENT(e.getTagName(),
+                e.getNamespaceURI()));
         }
     }
 
-    protected Documentation getDocumentationFor(Element e) {
+    private Documentation getDocumentationFor(Element e) {
         String s = XmlUtil.getTextForNode(e);
         if (s == null) {
             return null;
@@ -1373,37 +1118,4 @@
             return new Documentation(s);
         }
     }
-
-    protected void error(String key) {
-        System.err.println(
-            _localizer.localize(_messageFactory.getMessage(key)));
-    }
-
-    public HashSet getUse() {
-        return hSet;
-    }
-
-    protected void warn(String key) {
-        System.err.println(
-            _localizer.localize(_messageFactory.getMessage(key)));
-    }
-
-    protected void warn(String key, String arg) {
-        System.err.println(
-            _localizer.localize(_messageFactory.getMessage(key, arg)));
-    }
-
-    protected void warn(String key, Object[] args) {
-        System.err.println(
-            _localizer.localize(_messageFactory.getMessage(key, args)));
-    }
-
-    private boolean _followImports;
-    private String _targetNamespaceURI;
-    private Map _extensionHandlers;
-    private ArrayList _listeners;
-    private boolean _useWSIBasicProfile = true;
-    private LocalizableMessageFactory _messageFactory = null;
-    private Localizer _localizer;
-    private HashSet hSet = null;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLWriter.java
deleted file mode 100644
index e169c88..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLWriter.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.ws.wsdl.parser;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import com.sun.tools.internal.ws.wsdl.document.Binding;
-import com.sun.tools.internal.ws.wsdl.document.BindingFault;
-import com.sun.tools.internal.ws.wsdl.document.BindingInput;
-import com.sun.tools.internal.ws.wsdl.document.BindingOperation;
-import com.sun.tools.internal.ws.wsdl.document.BindingOutput;
-import com.sun.tools.internal.ws.wsdl.document.Definitions;
-import com.sun.tools.internal.ws.wsdl.document.Documentation;
-import com.sun.tools.internal.ws.wsdl.document.Fault;
-import com.sun.tools.internal.ws.wsdl.document.Import;
-import com.sun.tools.internal.ws.wsdl.document.Input;
-import com.sun.tools.internal.ws.wsdl.document.Message;
-import com.sun.tools.internal.ws.wsdl.document.MessagePart;
-import com.sun.tools.internal.ws.wsdl.document.Operation;
-import com.sun.tools.internal.ws.wsdl.document.Output;
-import com.sun.tools.internal.ws.wsdl.document.Port;
-import com.sun.tools.internal.ws.wsdl.document.PortType;
-import com.sun.tools.internal.ws.wsdl.document.Service;
-import com.sun.tools.internal.ws.wsdl.document.Types;
-import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
-import com.sun.tools.internal.ws.wsdl.document.WSDLDocument;
-import com.sun.tools.internal.ws.wsdl.document.WSDLDocumentVisitor;
-import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
-import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
-import com.sun.tools.internal.ws.wsdl.framework.Extension;
-import com.sun.tools.internal.ws.wsdl.framework.Kind;
-import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
-
-/**
- * A writer for WSDL documents.
- *
- * @author WS Development Team
- */
-public class WSDLWriter {
-
-    public WSDLWriter() throws IOException {
-        _extensionHandlers = new HashMap();
-
-        // register handlers for default extensions
-        register(new SOAPExtensionHandler());
-        register(new HTTPExtensionHandler());
-        register(new MIMEExtensionHandler());
-        register(new SchemaExtensionHandler());
-        register(new JAXWSBindingExtensionHandler());
-    }
-
-    public void register(ExtensionHandler h) {
-        _extensionHandlers.put(h.getNamespaceURI(), h);
-        h.setExtensionHandlers(_extensionHandlers);
-    }
-
-    public void unregister(ExtensionHandler h) {
-        _extensionHandlers.put(h.getNamespaceURI(), null);
-        h.setExtensionHandlers(null);
-    }
-
-    public void unregister(String uri) {
-        _extensionHandlers.put(uri, null);
-    }
-
-    public void write(final WSDLDocument document, OutputStream os)
-        throws IOException {
-        final WriterContext context = new WriterContext(os);
-        try {
-            document.accept(new WSDLDocumentVisitor() {
-                public void preVisit(Definitions definitions)
-                    throws Exception {
-                    context.push();
-                    initializePrefixes(context, document);
-                    context.writeStartTag(definitions.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        definitions.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_TARGET_NAMESPACE,
-                        definitions.getTargetNamespaceURI());
-                    context.writeAllPendingNamespaceDeclarations();
-                }
-                public void postVisit(Definitions definitions)
-                    throws Exception {
-                    context.writeEndTag(definitions.getElementName());
-                    context.pop();
-                }
-                public void visit(Import i) throws Exception {
-                    context.writeStartTag(i.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAMESPACE,
-                        i.getNamespace());
-                    context.writeAttribute(
-                        Constants.ATTR_LOCATION,
-                        i.getLocation());
-                    context.writeEndTag(i.getElementName());
-                }
-                public void preVisit(Types types) throws Exception {
-                    context.writeStartTag(types.getElementName());
-                }
-                public void postVisit(Types types) throws Exception {
-                    context.writeEndTag(types.getElementName());
-                }
-                public void preVisit(Message message) throws Exception {
-                    context.writeStartTag(message.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        message.getName());
-                }
-                public void postVisit(Message message) throws Exception {
-                    context.writeEndTag(message.getElementName());
-                }
-                public void visit(MessagePart part) throws Exception {
-                    context.writeStartTag(part.getElementName());
-                    context.writeAttribute(Constants.ATTR_NAME, part.getName());
-
-                    QName dname = part.getDescriptor();
-                    Kind dkind = part.getDescriptorKind();
-                    if (dname != null && dkind != null) {
-                        if (dkind.equals(SchemaKinds.XSD_ELEMENT)) {
-                            context.writeAttribute(
-                                Constants.ATTR_ELEMENT,
-                                dname);
-                        } else if (dkind.equals(SchemaKinds.XSD_TYPE)) {
-                            context.writeAttribute(Constants.ATTR_TYPE, dname);
-                        } else {
-                            // TODO - add support for attribute extensions here
-                        }
-                    }
-                    context.writeEndTag(part.getElementName());
-                }
-                public void preVisit(PortType portType) throws Exception {
-                    context.writeStartTag(portType.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        portType.getName());
-                }
-                public void postVisit(PortType portType) throws Exception {
-                    context.writeEndTag(portType.getElementName());
-                }
-                public void preVisit(Operation operation) throws Exception {
-                    context.writeStartTag(operation.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        operation.getName());
-                    //bug fix: 4947340, parameterOder="" should not be generated
-                    if(operation.getParameterOrder() != null &&
-                        operation.getParameterOrder().length() > 0) {
-                        context.writeAttribute(
-                            Constants.ATTR_PARAMETER_ORDER,
-                            operation.getParameterOrder());
-                    }
-                }
-                public void postVisit(Operation operation) throws Exception {
-                    context.writeEndTag(operation.getElementName());
-                }
-                public void preVisit(Input input) throws Exception {
-                    context.writeStartTag(input.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        input.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_MESSAGE,
-                        input.getMessage());
-                }
-                public void postVisit(Input input) throws Exception {
-                    context.writeEndTag(input.getElementName());
-                }
-                public void preVisit(Output output) throws Exception {
-                    context.writeStartTag(output.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        output.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_MESSAGE,
-                        output.getMessage());
-                }
-                public void postVisit(Output output) throws Exception {
-                    context.writeEndTag(output.getElementName());
-                }
-                public void preVisit(Fault fault) throws Exception {
-                    context.writeStartTag(fault.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        fault.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_MESSAGE,
-                        fault.getMessage());
-                }
-                public void postVisit(Fault fault) throws Exception {
-                    context.writeEndTag(fault.getElementName());
-                }
-                public void preVisit(Binding binding) throws Exception {
-                    context.writeStartTag(binding.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        binding.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_TYPE,
-                        binding.getPortType());
-                }
-                public void postVisit(Binding binding) throws Exception {
-                    context.writeEndTag(binding.getElementName());
-                }
-
-                public void preVisit(BindingOperation operation)
-                    throws Exception {
-                    context.writeStartTag(operation.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        operation.getName());
-                }
-                public void postVisit(BindingOperation operation)
-                    throws Exception {
-                    context.writeEndTag(operation.getElementName());
-                }
-                public void preVisit(BindingInput input) throws Exception {
-                    context.writeStartTag(input.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        input.getName());
-                }
-                public void postVisit(BindingInput input) throws Exception {
-                    context.writeEndTag(input.getElementName());
-                }
-                public void preVisit(BindingOutput output) throws Exception {
-                    context.writeStartTag(output.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        output.getName());
-                }
-                public void postVisit(BindingOutput output) throws Exception {
-                    context.writeEndTag(output.getElementName());
-                }
-                public void preVisit(BindingFault fault) throws Exception {
-                    context.writeStartTag(fault.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        fault.getName());
-                }
-                public void postVisit(BindingFault fault) throws Exception {
-                    context.writeEndTag(fault.getElementName());
-                }
-
-                public void preVisit(Service service) throws Exception {
-                    context.writeStartTag(service.getElementName());
-                    context.writeAttribute(
-                        Constants.ATTR_NAME,
-                        service.getName());
-                }
-                public void postVisit(Service service) throws Exception {
-                    context.writeEndTag(service.getElementName());
-                }
-                public void preVisit(Port port) throws Exception {
-                    context.writeStartTag(port.getElementName());
-                    context.writeAttribute(Constants.ATTR_NAME, port.getName());
-                    context.writeAttribute(
-                        Constants.ATTR_BINDING,
-                        port.getBinding());
-                }
-                public void postVisit(Port port) throws Exception {
-                    context.writeEndTag(port.getElementName());
-                }
-                public void preVisit(Extension extension) throws Exception {
-                    ExtensionHandler h =
-                        (ExtensionHandler) _extensionHandlers.get(
-                            extension.getElementName().getNamespaceURI());
-                    h.doHandleExtension(context, extension);
-                }
-                public void postVisit(Extension extension) throws Exception {
-                }
-                public void visit(Documentation documentation)
-                    throws Exception {
-                    context.writeTag(WSDLConstants.QNAME_DOCUMENTATION, null);
-                }
-            });
-            context.flush();
-        } catch (Exception e) {
-            if (e instanceof IOException) {
-                throw (IOException) e;
-            } else if (e instanceof RuntimeException) {
-                throw (RuntimeException) e;
-            } else {
-                // entirely unexpected exception
-                throw new IllegalStateException();
-            }
-        }
-    }
-
-    private void initializePrefixes(
-        WriterContext context,
-        WSDLDocument document)
-        throws IOException {
-        // deal with the target namespace first
-        String tnsURI = document.getDefinitions().getTargetNamespaceURI();
-        if (tnsURI != null) {
-            context.setTargetNamespaceURI(tnsURI);
-            context.declarePrefix(TARGET_NAMESPACE_PREFIX, tnsURI);
-        }
-
-        // then with the WSDL namespace
-//        context.declarePrefix(_commonPrefixes.get(Constants.NS_WSDL), Constants.NS_WSDL);
-        context.declarePrefix("", Constants.NS_WSDL);
-
-        // then with all other namespaces
-        Set namespaces = document.collectAllNamespaces();
-        for (Iterator iter = namespaces.iterator(); iter.hasNext();) {
-            String nsURI = (String) iter.next();
-            if (context.getPrefixFor(nsURI) != null)
-                continue;
-
-            String prefix = (String) _commonPrefixes.get(nsURI);
-            if (prefix == null) {
-                // create a new prefix for it
-                prefix = context.findNewPrefix(NEW_NAMESPACE_PREFIX_BASE);
-            }
-            context.declarePrefix(prefix, nsURI);
-        }
-    }
-
-    private Map _extensionHandlers;
-
-    ////////
-
-    private static Map<String, String> _commonPrefixes;
-
-    static {
-        _commonPrefixes = new HashMap<String, String>();
-        _commonPrefixes.put(Constants.NS_WSDL, "wsdl");
-        _commonPrefixes.put(Constants.NS_WSDL_SOAP, "soap");
-        _commonPrefixes.put(Constants.NS_WSDL_HTTP, "http");
-        _commonPrefixes.put(Constants.NS_WSDL_MIME, "mime");
-        _commonPrefixes.put(Constants.NS_XSD, "xsd");
-        _commonPrefixes.put(Constants.NS_XSI, "xsi");
-        _commonPrefixes.put(JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "jaxws");
-    }
-
-    private final static String TARGET_NAMESPACE_PREFIX = "tns";
-    private final static String NEW_NAMESPACE_PREFIX_BASE = "ns";
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java
new file mode 100644
index 0000000..8a6c054
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.tools.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+import org.xml.sax.*;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/**
+ * Strips ignorable whitespace from SAX event stream.
+ *
+ * <p>
+ * This filter works only when the event stream doesn't
+ * contain any mixed content.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *     Vivek Pandey
+ */
+class WhitespaceStripper extends XMLFilterImpl {
+
+    private int state = 0;
+
+    private char[] buf = new char[1024];
+    private int bufLen = 0;
+
+    private static final int AFTER_START_ELEMENT = 1;
+    private static final int AFTER_END_ELEMENT = 2;
+
+    public WhitespaceStripper(XMLReader reader) {
+        setParent(reader);
+    }
+
+    public WhitespaceStripper(ContentHandler handler, ErrorHandler eh, EntityResolver er) {
+        setContentHandler(handler);
+        if(eh!=null)    setErrorHandler(eh);
+        if(er!=null)    setEntityResolver(er);
+    }
+
+    public void characters(char[] ch, int start, int length) throws SAXException {
+        switch(state) {
+        case AFTER_START_ELEMENT:
+            // we have to store the characters here, even if it consists entirely
+            // of whitespaces. This is because successive characters event might
+            // include non-whitespace char, in which case all the whitespaces in
+            // this event may suddenly become significant.
+            if( bufLen+length>buf.length ) {
+                // reallocate buffer
+                char[] newBuf = new char[Math.max(bufLen+length,buf.length*2)];
+                System.arraycopy(buf,0,newBuf,0,bufLen);
+                buf = newBuf;
+            }
+            System.arraycopy(ch,start,buf,bufLen,length);
+            bufLen += length;
+            break;
+        case AFTER_END_ELEMENT:
+            // check if this is ignorable.
+            int len = start+length;
+            for( int i=start; i<len; i++ )
+                if( !WhiteSpaceProcessor.isWhiteSpace(ch[i]) ) {
+                    super.characters(ch, start, length);
+                    return;
+                }
+            // if it's entirely whitespace, ignore it.
+            break;
+        }
+    }
+
+    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+        processPendingText();
+        super.startElement(uri, localName, qName, atts);
+        state = AFTER_START_ELEMENT;
+        bufLen = 0;
+    }
+
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+        processPendingText();
+        super.endElement(uri, localName, qName);
+        state = AFTER_END_ELEMENT;
+    }
+
+    /**
+     * Forwars the buffered characters if it contains any non-whitespace
+     * character.
+     */
+    private void processPendingText() throws SAXException {
+        if(state==AFTER_START_ELEMENT) {
+            for( int i=bufLen-1; i>=0; i-- )
+                if( !WhiteSpaceProcessor.isWhiteSpace(buf[i]) ) {
+                    super.characters(buf, 0, bufLen);
+                    return;
+               }
+        }
+    }
+
+    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+        // ignore completely.
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/AbortException.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/AbortException.java
index 97acb1f..e95f5b4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/AbortException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/AbortException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/BadCommandLineException.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/BadCommandLineException.java
index 8ff4cae..4be6b4f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/BadCommandLineException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/BadCommandLineException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import com.sun.istack.internal.Nullable;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java
index c204f2c..a65f69c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.OutputStream;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Driver.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Driver.java
index fb5a342..75a302f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Driver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Driver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.FileOutputStream;
@@ -35,6 +34,7 @@
 import com.sun.codemodel.internal.CodeWriter;
 import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.writer.ZipCodeWriter;
+import com.sun.istack.internal.NotNull;
 import com.sun.istack.internal.Nullable;
 import com.sun.tools.internal.xjc.generator.bean.BeanGenerator;
 import com.sun.tools.internal.xjc.model.Model;
@@ -199,7 +199,7 @@
      *      All non-zero values indicate an error. The error message
      *      will be sent to the specified PrintStream.
      */
-    public static int run(String[] args, XJCListener listener) throws BadCommandLineException {
+    public static int run(String[] args, @NotNull final XJCListener listener) throws BadCommandLineException {
 
         // recognize those special options before we start parsing options.
         for (String arg : args) {
@@ -249,6 +249,11 @@
                     if(!opt.quiet)
                         super.warning(exception);
                 }
+                @Override
+                public void pollAbort() throws AbortException {
+                    if(listener.isCanceled())
+                        throw new AbortException();
+                }
             };
 
             if( opt.mode==Mode.FOREST ) {
@@ -422,7 +427,7 @@
         public boolean noNS = false;
 
         /** Parse XJC-specific options. */
-        protected int parseArgument(String[] args, int i) throws BadCommandLineException {
+        public int parseArgument(String[] args, int i) throws BadCommandLineException {
             if (args[i].equals("-noNS")) {
                 noNS = true;
                 return 1;
@@ -471,7 +476,7 @@
      *      If the parsing of options have started, set a partly populated
      *      {@link Options} object.
      */
-    protected static void usage( @Nullable Options opts, boolean privateUsage ) {
+    public static void usage( @Nullable Options opts, boolean privateUsage ) {
         if( privateUsage ) {
             System.out.println(Messages.format(Messages.DRIVER_PRIVATE_USAGE));
         } else {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java
index b602829..5310050 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,8 @@
  */
 package com.sun.tools.internal.xjc;
 
-import com.sun.tools.internal.xjc.api.ErrorListener;
 import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.xjc.api.ErrorListener;
 
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.Locator;
@@ -101,6 +101,13 @@
     public abstract void warning(SAXParseException exception) throws AbortException;
 
     /**
+     * This method will be invoked periodically to allow {@link AbortException}
+     * to be thrown, especially when this is driven by some kind of GUI.
+     */
+    public void pollAbort() throws AbortException {
+    }
+
+    /**
      * Reports verbose messages to users.
      *
      * This method can be used to report additional non-essential
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Language.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Language.java
index 36444ee..be45728 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Language.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Language.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
index 37f55bd..243323e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 ConsoleErrorReporter.UnknownLocation = \
 	unknown location
 	
@@ -8,7 +33,9 @@
 	unknown file
 	
 Driver.Private.Usage = \
-Usage: xjc [-options ...] <schema file/URL/dir> ... [-b <bindinfo>] ...\n\
+Usage: xjc [-options ...] <schema file/URL/dir/jar> ... [-b <bindinfo>] ...\n\
+If dir is specified, all schema files in it will be compiled.\n\
+If jar is specified, /META-INF/sun-jaxb.episode binding file will be compiled.\n\
 Options:\n\
 \ \ -debug             :  run in the debug mode\n\
 \ \ -nv                :  do not perform strict validation of the input schema(s)\n\
@@ -26,6 +53,7 @@
 \ \ -readOnly          :  generated files will be in read-only mode\n\
 \ \ -npa               :  suppress generation of package level annotations (**/package-info.java)\n\
 \ \ -no-header         :  suppress generation of a file header with timestamp\n\
+\ \ -target 2.0        :  behave like XJC 2.0 and generate code that doesn't use any 2.1 features.\n\
 \ \ -private           :  display this help message\n\
 \ \ -xmlschema         :  treat input as W3C XML Schema (default)\n\
 \ \ -relaxng           :  treat input as RELAX NG (experimental,unsupported)\n\
@@ -45,7 +73,9 @@
 \ \ -p <pkg>     :  specifies the target package\n
 
 Driver.Public.Usage = \
-Usage: xjc [-options ...] <schema file/URL/dir> ... [-b <bindinfo>] ...\n\
+Usage: xjc [-options ...] <schema file/URL/dir/jar> ... [-b <bindinfo>] ...\n\
+If dir is specified, all schema files in it will be compiled.\n\
+If jar is specified, /META-INF/sun-jaxb.episode binding file will be compiled.\n\
 Options:\n\
 \ \ -nv                :  do not perform strict validation of the input schema(s)\n\
 \ \ -extension         :  allow vendor extensions - do not strictly follow the\n\
@@ -62,6 +92,7 @@
 \ \ -readOnly          :  generated files will be in read-only mode\n\
 \ \ -npa               :  suppress generation of package level annotations (**/package-info.java)\n\
 \ \ -no-header         :  suppress generation of a file header with timestamp\n\
+\ \ -target 2.0        :  behave like XJC 2.0 and generate code that doesn't use any 2.1 features.\n\
 \ \ -xmlschema         :  treat input as W3C XML Schema (default)\n\
 \ \ -relaxng           :  treat input as RELAX NG (experimental,unsupported)\n\
 \ \ -relaxng-compact   :  treat input as RELAX NG compact syntax (experimental,unsupported)\n\
@@ -78,24 +109,9 @@
 	Are you trying to compile {0}? Support for {0} is experimental. \
 	You may enable it by using the {1} option.
 
-Driver.MissingCatalog = \
-	the -catalog option is missing a file name
-
-Driver.MissingClassPath = \
-	the -classpath option is missing a directory/jarfile name
-
-Driver.MissingDir = \
-	the -d option is missing a directory name
-
 Driver.NonExistentDir = \
     cowardly refuses to write to a non-existent directory "{0}"
 	
-Driver.MissingFileName = \
-	the -b option is missing a file name
-	
-Driver.MissingPackageName = \
-	the -p option is missing a package name
-	
 Driver.MissingRuntimePackageName = \
 	the -use-runtime option is missing a package name
 	
@@ -113,8 +129,11 @@
 	either the -port option is missing an operand \n\
         or -host was specified but not -port
 
-Driver.MISSING_PROXY = \
-    the -httpproxy option is missing an operand
+Driver.ILLEGAL_PROXY = \
+    "{0}" is not a valid proxy format. The format is [user[:password]@]proxyHost[:proxyPort]
+
+Driver.ILLEGAL_TARGET_VERSION = \
+    "{0}" is not a valid target version. "2.0" and "2.1" are supported.
 
 Driver.MISSING_PROXYFILE = \
     the -httpproxyfile option is missing an operand
@@ -155,18 +174,18 @@
 Driver.FailedToGenerateCode = \
 	Failed to produce code.
 
-# DO NOT localize the JAXB 2.0 in JDK 1.6 string - it is a token for an ant <replaceFilter>	
+# DO NOT localize the JAXB 2.1.3 in JDK string - it is a token for an ant <replaceFilter>	
 Driver.FilePrologComment = \
-	This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 \n\
+	This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK \n\
 	See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\
 	Any modifications to this file will be lost upon recompilation of the source schema. \n\
 	Generated on: {0} \n
 
 Driver.Version = \
-	xjc version "JAXB 2.0 in JDK 1.6" \n\
-	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.0 in JDK 1.6)	
+	xjc version "JAXB 2.1.3" \n\
+	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.3 in JDK)	
 
-Driver.BuildID = JAXB 2.0 in JDK 1.6
+Driver.BuildID = JAXB 2.1.3 in JDK
 	
 # see java.text.SimpleDateFormat for format syntax
 Driver.DateFormat = \
@@ -195,9 +214,6 @@
 ModelLoader.BindingFileNotSupportedForRNC = \
     External binding files are not supported for the RELAX NG compact syntax.
 
-Driver.MissingVersion = \
-	the -source option is missing the version value
-
 Driver.DefaultVersion = \
 	Defaulting the version to JAXB 2.0
 
@@ -216,6 +232,13 @@
 FIELD_RENDERER_CONFLICT = \
     "-{0}" and "-{1}" are mutually exclusive since both affect the code generation 
 
-NAME_CONVERTER_CONFLICT - \
+NAME_CONVERTER_CONFLICT = \
     "-{0}" and "-{1}" are mutually exclusive since both affect the code generation
+
+FAILED_TO_LOAD = \
+    Failed to load "{0}": {1}
+
+PLUGIN_LOAD_FAILURE = \
+    Failure to load a plugin: "{0}". Use the system property ''-Dcom.sun.tools.internal.xjc.Options.findServices=true'' to \
+    diagnose it further
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Messages.java
index ea3268f..ac06d6b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -65,30 +65,15 @@
     static final String EXPERIMENTAL_LANGUAGE_WARNING = // 2 arg
         "Driver.ExperimentalLanguageWarning";
 
-    static final String MISSING_CLASSPATH = // 0 args
-        "Driver.MissingClassPath";
-
-    static final String MISSING_DIR = // 0 args
-        "Driver.MissingDir";
-
     static final String NON_EXISTENT_DIR = // 1 arg
         "Driver.NonExistentDir";
 
-    static final String MISSING_FILENAME = // 0 args
-        "Driver.MissingFileName";
-
-    static final String MISSING_PACKAGENAME = // 0 args
-        "Driver.MissingPackageName";
-
     static final String MISSING_RUNTIME_PACKAGENAME = // 0 args
         "Driver.MissingRuntimePackageName";
 
     static final String MISSING_MODE_OPERAND = // 0 args
         "Driver.MissingModeOperand";
 
-    static final String MISSING_CATALOG = // 0 args
-        "Driver.MissingCatalog";
-
     static final String MISSING_COMPATIBILITY_OPERAND = // 0 args
         "Driver.MissingCompatibilityOperand";
 
@@ -104,6 +89,12 @@
     static final String ILLEGAL_PROXY = // 1 arg
         "Driver.ILLEGAL_PROXY";
 
+    static final String ILLEGAL_TARGET_VERSION = // 1 arg
+        "Driver.ILLEGAL_TARGET_VERSION";
+
+    static final String MISSING_OPERAND = // 1 arg
+        "Driver.MissingOperand";
+
     static final String MISSING_PROXYHOST = // 0 args
         "Driver.MissingProxyHost";
 
@@ -170,9 +161,6 @@
     static final String ERR_BINDING_FILE_NOT_SUPPORTED_FOR_RNC = // 0 args
         "ModelLoader.BindingFileNotSupportedForRNC";
 
-     static final String MISSING_VERSION = // 0 args
-        "Driver.MissingVersion";
-
     static final String DEFAULT_VERSION = // 0 args
         "Driver.DefaultVersion";
 
@@ -190,5 +178,10 @@
         "FIELD_RENDERER_CONFLICT";
 
     static final String NAME_CONVERTER_CONFLICT = // 2 args
-            "NAME_CONVERTER_CONFLICT";
+        "NAME_CONVERTER_CONFLICT";
+    static final String FAILED_TO_LOAD = // 2 args
+        "FAILED_TO_LOAD";
+
+    static final String PLUGIN_LOAD_FAILURE = // 1 arg
+        "PLUGIN_LOAD_FAILURE";
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java
index 5c84f6a..12dd6f1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.IOException;
@@ -37,6 +36,7 @@
 import com.sun.tools.internal.xjc.reader.internalizer.DOMForestScanner;
 import com.sun.tools.internal.xjc.reader.internalizer.InternalizationLogic;
 import com.sun.tools.internal.xjc.reader.internalizer.VersionChecker;
+import com.sun.tools.internal.xjc.reader.internalizer.SCDBasedBindingSet;
 import com.sun.tools.internal.xjc.reader.relaxng.RELAXNGCompiler;
 import com.sun.tools.internal.xjc.reader.relaxng.RELAXNGInternalizationLogic;
 import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
@@ -89,6 +89,11 @@
     private final Options opt;
     private final ErrorReceiverFilter errorReceiver;
     private final JCodeModel codeModel;
+    /**
+     * {@link DOMForest#transform(boolean)} creates this on the side.
+     */
+    private SCDBasedBindingSet scdBasedBindingSet;
+
 
     /**
      * A convenience method to load schemas into a {@link Model}.
@@ -177,6 +182,9 @@
                     e.printStackTrace();
             }
             return null;
+        } catch (AbortException e) {
+            // error should have been reported already, since this is requested by the error receiver
+            return null;
         }
     }
 
@@ -297,11 +305,14 @@
         forest.setEntityResolver(opt.entityResolver);
 
         // parse source grammars
-        for (InputSource value : opt.getGrammars())
+        for (InputSource value : opt.getGrammars()) {
+            errorReceiver.pollAbort();
             forest.parse(value, true);
+        }
 
         // parse external binding files
         for (InputSource value : opt.getBindFiles()) {
+            errorReceiver.pollAbort();
             Document dom = forest.parse(value, true);
             if(dom==null)       continue;   // error must have been reported
             Element root = dom.getDocumentElement();
@@ -317,7 +328,7 @@
                         -1, -1));
         }
 
-        forest.transform();
+        scdBasedBindingSet = forest.transform(opt.isExtensionMode());
 
         return forest;
     }
@@ -350,7 +361,7 @@
         // the default slower way is to parse everything into DOM first.
         // so that we can take external annotations into account.
         DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
-        return createXSOM(forest);
+        return createXSOM(forest, scdBasedBindingSet);
     }
 
     /**
@@ -479,18 +490,23 @@
     /**
      * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
      */
-    public XSSchemaSet createXSOM(DOMForest forest) throws SAXException {
+    public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
         // set up other parameters to XSOMParser
         XSOMParser reader = createXSOMParser(forest);
 
         // re-parse the transformed schemas
         for (String systemId : forest.getRootDocuments()) {
+            errorReceiver.pollAbort();
             Document dom = forest.get(systemId);
             if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
                 reader.parse(systemId);
         }
 
-        return reader.getResult();
+        XSSchemaSet result = reader.getResult();
+
+        scdBasedBindingSet.apply(result,errorReceiver);
+
+        return result;
     }
 
     /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Options.java
index b741be4..b81e4aa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Options.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Options.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,8 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.lang.reflect.Array;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -50,6 +52,7 @@
 import com.sun.org.apache.xml.internal.resolver.CatalogManager;
 import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver;
 import com.sun.tools.internal.xjc.api.ClassNameAllocator;
+import com.sun.tools.internal.xjc.api.SpecVersion;
 import com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.reader.Util;
@@ -97,6 +100,11 @@
     public boolean runtime14 = false;
 
     /**
+     * If true, try to resolve name conflicts automatically by assigning mechanical numbers.
+     */
+    public boolean automaticNameConflictResolution = false;
+
+    /**
      * strictly follow the compatibility rules and reject schemas that
      * contain features from App. E.2, use vendor binding extensions
      */
@@ -114,6 +122,16 @@
      */
     public int compatibilityMode = STRICT;
 
+    public boolean isExtensionMode() {
+        return compatibilityMode==EXTENSION;
+    }
+
+    /**
+     * Generates output for the specified version of the runtime.
+     */
+    public SpecVersion target = SpecVersion.V2_1;
+
+
     /** Target direcoty when producing files. */
     public File targetDir = new File(".");
 
@@ -376,13 +394,20 @@
     }
 
     /**
-     * Adds a new input schema.
+     * Adds a new binding file.
      */
     public void addBindFile( InputSource is ) {
         bindFiles.add(absolutize(is));
     }
 
     /**
+     * Adds a new binding file.
+     */
+    public void addBindFile( File bindFile ) {
+        bindFiles.add(fileToInputSource(bindFile));
+    }
+
+    /**
      * Recursively scan directories and add all ".xjb" files in it.
      */
     public void addBindFileRecursive( File dir ) {
@@ -410,12 +435,9 @@
      * @exception BadCommandLineException
      *      If the callee wants to provide a custom message for an error.
      */
-    protected int parseArgument( String[] args, int i ) throws BadCommandLineException {
+    public int parseArgument( String[] args, int i ) throws BadCommandLineException {
         if (args[i].equals("-classpath") || args[i].equals("-cp")) {
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_CLASSPATH));
-            File file = new File(args[++i]);
+            File file = new File(requireArgument(args[i],args,++i));
             try {
                 classpaths.add(file.toURL());
             } catch (MalformedURLException e) {
@@ -425,10 +447,7 @@
             return 2;
         }
         if (args[i].equals("-d")) {
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_DIR));
-            targetDir = new File(args[++i]);
+            targetDir = new File(requireArgument("-d",args,++i));
             if( !targetDir.exists() )
                 throw new BadCommandLineException(
                     Messages.format(Messages.NON_EXISTENT_DIR,targetDir));
@@ -439,10 +458,7 @@
             return 1;
         }
         if (args[i].equals("-p")) {
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_PACKAGENAME));
-            defaultPackage = args[++i];
+            defaultPackage = requireArgument("-p",args,++i);
             if(defaultPackage.length()==0) { // user specified default package
                 // there won't be any package to annotate, so disable them
                 // automatically as a usability feature
@@ -479,12 +495,12 @@
             runtime14 = true;
             return 1;
         }
+        if (args[i].equals("-XautoNameResolution")) {
+            automaticNameConflictResolution = true;
+            return 1;
+        }
         if (args[i].equals("-b")) {
-            if (i==args.length-1 || args[i + 1].startsWith("-"))
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_FILENAME));
-
-            addFile(args[i + 1],bindFiles,".xjb");
+            addFile(requireArgument("-b",args,++i),bindFiles,".xjb");
             return 2;
         }
         if (args[i].equals("-dtd")) {
@@ -511,6 +527,13 @@
             compatibilityMode = EXTENSION;
             return 1;
         }
+        if (args[i].equals("-target")) {
+            String token = requireArgument("-target",args,++i);
+            target = SpecVersion.parse(token);
+            if(target==null)
+                throw new BadCommandLineException(Messages.format(Messages.ILLEGAL_TARGET_VERSION,token));
+            return 2;
+        }
         if (args[i].equals("-httpproxyfile")) {
             if (i == args.length - 1 || args[i + 1].startsWith("-")) {
                 throw new BadCommandLineException(
@@ -544,32 +567,19 @@
             return 2;
         }
         if (args[i].equals("-host")) {
-            // legacy option. we use -httpproxy for more control
-            if (i == args.length - 1 || args[i + 1].startsWith("-")) {
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_PROXYHOST));
-            }
-            proxyHost = args[++i];
+            proxyHost = requireArgument("-host",args,++i);
             return 2;
         }
         if (args[i].equals("-port")) {
-            // legacy option. we use -httpproxy for more control
-            if (i == args.length - 1 || args[i + 1].startsWith("-")) {
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_PROXYPORT));
-            }
-            proxyPort = args[++i];
+            proxyPort = requireArgument("-port",args,++i);
             return 2;
         }
         if( args[i].equals("-catalog") ) {
             // use Sun's "XML Entity and URI Resolvers" by Norman Walsh
             // to resolve external entities.
             // http://www.sun.com/xml/developers/resolver/
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_CATALOG));
 
-            File catalogFile = new File(args[++i]);
+            File catalogFile = new File(requireArgument("-catalog",args,++i));
             try {
                 addCatalog(catalogFile);
             } catch (IOException e) {
@@ -579,14 +589,11 @@
             return 2;
         }
         if (args[i].equals("-source")) {
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                    Messages.format(Messages.MISSING_VERSION));
-            String version = args[++i];
+            String version = requireArgument("-source",args,++i);
             //For source 1.0 the 1.0 Driver is loaded
             //Hence anything other than 2.0 is defaulted to
             //2.0
-            if( !version.equals("2.0") )
+            if( !version.equals("2.0") && !version.equals("2.1") )
                 throw new BadCommandLineException(
                     Messages.format(Messages.DEFAULT_VERSION));
             return 2;
@@ -603,14 +610,23 @@
 
         // see if this is one of the extensions
         for( Plugin plugin : getAllPlugins() ) {
-            if( ('-'+plugin.getOptionName()).equals(args[i]) ) {
-                activePlugins.add(plugin);
-                plugin.onActivated(this);
-                pluginURIs.addAll(plugin.getCustomizationURIs());
-                return 1;
-            }
-
             try {
+                if( ('-'+plugin.getOptionName()).equals(args[i]) ) {
+                    activePlugins.add(plugin);
+                    plugin.onActivated(this);
+                    pluginURIs.addAll(plugin.getCustomizationURIs());
+
+                    // give the plugin a chance to parse arguments to this option.
+                    // this is new in 2.1, and due to the backward compatibility reason,
+                    // if plugin didn't understand it, we still return 1 to indicate
+                    // that this option is consumed.
+                    int r = plugin.parseArgument(this,args,i);
+                    if(r!=0)
+                        return r;
+                    else
+                        return 1;
+                }
+
                 int r = plugin.parseArgument(this,args,i);
                 if(r!=0)    return r;
             } catch (IOException e) {
@@ -642,6 +658,17 @@
     }
 
     /**
+     * Obtains an operand and reports an error if it's not there.
+     */
+    public String requireArgument(String optionName, String[] args, int i) throws BadCommandLineException {
+        if (i == args.length || args[i].startsWith("-")) {
+            throw new BadCommandLineException(
+                Messages.format(Messages.MISSING_OPERAND,optionName));
+        }
+        return args[i];
+    }
+
+    /**
      * Parses a token to a file (or a set of files)
      * and add them as {@link InputSource} to the specified list.
      *
@@ -698,7 +725,10 @@
                         Messages.format(Messages.UNRECOGNIZED_PARAMETER, args[i]));
                 i += (j-1);
             } else {
-                addFile(args[i],grammars,".xsd");
+                if(args[i].endsWith(".jar"))
+                    scanEpisodeFile(new File(args[i]));
+                else
+                    addFile(args[i],grammars,".xsd");
             }
         }
 
@@ -729,6 +759,27 @@
 
         if( schemaLanguage==null )
             schemaLanguage = guessSchemaLanguage();
+
+        if(pluginLoadFailure!=null)
+            throw new BadCommandLineException(
+                Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
+    }
+
+    /**
+     * Finds the <tt>META-INF/sun-jaxb.episode</tt> file to add as a binding customization.
+     */
+    private void scanEpisodeFile(File jar) throws BadCommandLineException {
+        try {
+            URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURL()});
+            Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode");
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                addBindFile(new InputSource(url.toExternalForm()));
+            }
+        } catch (IOException e) {
+            throw new BadCommandLineException(
+                    Messages.format(Messages.FAILED_TO_LOAD,jar,e.getMessage()), e);
+        }
     }
 
 
@@ -767,6 +818,14 @@
         if(noFileHeader)
             return core;
 
+        return new PrologCodeWriter( core,getPrologComment() );
+    }
+
+    /**
+     * Gets the string suitable to be used as the prolog comment baked into artifacts.
+     * This is the string like "This file was generated by the JAXB RI on YYYY/mm/dd..."
+     */
+    public String getPrologComment() {
         // generate format syntax: <date> 'at' <time>
         String format =
             Messages.format(Messages.DATE_FORMAT)
@@ -776,14 +835,15 @@
                 + Messages.format(Messages.TIME_FORMAT);
         SimpleDateFormat dateFormat = new SimpleDateFormat(format);
 
-        return new PrologCodeWriter( core,
-                Messages.format(
-                    Messages.FILE_PROLOG_COMMENT,
-                    dateFormat.format(new Date())) );
+        return Messages.format(
+            Messages.FILE_PROLOG_COMMENT,
+            dateFormat.format(new Date()));
     }
 
-
-
+    /**
+     * If a plugin failed to load, report.
+     */
+    private static String pluginLoadFailure;
 
     /**
      * Looks for all "META-INF/services/[className]" files and
@@ -825,9 +885,9 @@
                         if(classNames.add(impl)) {
                             Class implClass = classLoader.loadClass(impl);
                             if(!clazz.isAssignableFrom(implClass)) {
-                                if(debug) {
-                                    System.out.println(impl+" is not a subclass of "+clazz+". Skipping");
-                                }
+                                pluginLoadFailure = impl+" is not a subclass of "+clazz+". Skipping";
+                                if(debug)
+                                    System.out.println(pluginLoadFailure);
                                 continue;
                             }
                             if(debug) {
@@ -839,8 +899,11 @@
                     reader.close();
                 } catch( Exception ex ) {
                     // let it go.
+                    StringWriter w = new StringWriter();
+                    ex.printStackTrace(new PrintWriter(w));
+                    pluginLoadFailure = w.toString();
                     if(debug) {
-                        ex.printStackTrace(System.out);
+                        System.out.println(pluginLoadFailure);
                     }
                     if( reader!=null ) {
                         try {
@@ -855,8 +918,11 @@
             return a.toArray((T[])Array.newInstance(clazz,a.size()));
         } catch( Throwable e ) {
             // ignore any error
+            StringWriter w = new StringWriter();
+            e.printStackTrace(new PrintWriter(w));
+            pluginLoadFailure = w.toString();
             if(debug) {
-                e.printStackTrace(System.out);
+                System.out.println(pluginLoadFailure);
             }
             return (T[])Array.newInstance(clazz,0);
         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Plugin.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Plugin.java
index 82d21d3..4080e9a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/Plugin.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/Plugin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.IOException;
@@ -35,6 +34,7 @@
 import com.sun.tools.internal.xjc.outline.Outline;
 
 import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
 
 /**
  * Add-on that works on the generated source code.
@@ -59,6 +59,11 @@
      * turn on this plugin. A plugin needs to be turned
      * on explicitly, or else no other methods of {@link Plugin}
      * will be invoked.
+     *
+     * <p>
+     * Starting 2.1, when an option matches the name returned
+     * from this method, XJC will then invoke {@link #parseArgument(Options, String[], int)},
+     * allowing plugins to handle arguments to this option.
      */
     public abstract String getOptionName();
 
@@ -227,7 +232,13 @@
      *      If the add-on executes successfully, return true.
      *      If it detects some errors but those are reported and
      *      recovered gracefully, return false.
+     *
+     * @throws SAXException
+     *      After an error is reported to {@link ErrorHandler}, the
+     *      same exception can be thrown to indicate a fatal irrecoverable
+     *      error. {@link ErrorHandler} itself may throw it, if it chooses
+     *      not to recover from the error.
      */
     public abstract boolean run(
-        Outline outline, Options opt, ErrorHandler errorHandler );
+        Outline outline, Options opt, ErrorHandler errorHandler ) throws SAXException ;
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java
index b0dc87c..d5c715d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.File;
@@ -67,6 +66,8 @@
         if(name.length()!=0)    name +=     File.separatorChar;
         name += fileName;
 
+        if(progress.isCanceled())
+            throw new AbortException();
         progress.generatedFile(name,current++,totalFileCount);
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
index c419344..2ed1b6c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java
index 9df0cd3..8f644ca 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc;
 
 import java.io.PrintStream;
@@ -93,4 +92,27 @@
      *      never null. this is the root object that represents the code generation strategy.
      */
     public void compiled(Outline outline) {}
+
+    /**
+     * XJC will periodically invoke this method to see if it should cancel a compilation.
+     *
+     * <p>
+     * As long as this method returns false, XJC will keep going. If this method ever returns
+     * true, XJC will abort the processing right away and
+     * returns non-zero from {@link Driver#run(String[], XJCListener)}.
+     * Note that XJC will not report an abortion through the {@link #message(String)} method.
+     *
+     * <p>
+     * Note that despite all the efforts to check this method frequently, XJC may still fail to
+     * invoke this method for a long time. Such scenario would include network related problems
+     * or other I/O block (you can't even interrupt the thread while I/O is blocking.)
+     * So just beware that this is not a cure-all.
+     *
+     * @return
+     *      true if the {@link XJCListener} wants to abort the processing.
+     * @since 2.1
+     */
+    public boolean isCanceled() {
+        return false;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java
index 6b72ddc..8ffd942 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.addon.at_generated;
 
 import java.text.SimpleDateFormat;
@@ -91,7 +90,7 @@
         m.annotate(annotation)
                 .param("value",Driver.class.getName())
                 .param("date", getISO8601Date())
-                .param("comment", "JAXB RI v" + Options.getBuildID());
+                .param("comments", "JAXB RI v" + Options.getBuildID());
     }
 
     // cache the timestamp so that all the @Generated annotations match
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java
index f7ec985..324d137 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.addon.code_injector;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java
index 999c190..1c31b0b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.addon.code_injector;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/PluginImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/PluginImpl.java
new file mode 100644
index 0000000..6adfe73
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/PluginImpl.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.addon.episode;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.sun.tools.internal.xjc.BadCommandLineException;
+import com.sun.tools.internal.xjc.Options;
+import com.sun.tools.internal.xjc.Plugin;
+import com.sun.tools.internal.xjc.outline.ClassOutline;
+import com.sun.tools.internal.xjc.outline.Outline;
+import com.sun.tools.internal.xjc.reader.Const;
+import com.sun.xml.internal.txw2.TXW;
+import com.sun.xml.internal.txw2.output.StreamSerializer;
+import com.sun.xml.internal.xsom.XSAnnotation;
+import com.sun.xml.internal.xsom.XSAttGroupDecl;
+import com.sun.xml.internal.xsom.XSAttributeDecl;
+import com.sun.xml.internal.xsom.XSAttributeUse;
+import com.sun.xml.internal.xsom.XSComplexType;
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSContentType;
+import com.sun.xml.internal.xsom.XSDeclaration;
+import com.sun.xml.internal.xsom.XSElementDecl;
+import com.sun.xml.internal.xsom.XSFacet;
+import com.sun.xml.internal.xsom.XSIdentityConstraint;
+import com.sun.xml.internal.xsom.XSModelGroup;
+import com.sun.xml.internal.xsom.XSModelGroupDecl;
+import com.sun.xml.internal.xsom.XSNotation;
+import com.sun.xml.internal.xsom.XSParticle;
+import com.sun.xml.internal.xsom.XSSchema;
+import com.sun.xml.internal.xsom.XSSimpleType;
+import com.sun.xml.internal.xsom.XSWildcard;
+import com.sun.xml.internal.xsom.XSXPath;
+import com.sun.xml.internal.xsom.visitor.XSFunction;
+import com.sun.xml.internal.bind.v2.schemagen.episode.Bindings;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Creates the episode file,
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class PluginImpl extends Plugin {
+
+    private File episodeFile;
+
+    public String getOptionName() {
+        return "episode";
+    }
+
+    public String getUsage() {
+        return "  -episode <FILE>    :  generate the episode file for separate compilation";
+    }
+
+    public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException {
+        if(args[i].equals("-episode")) {
+            episodeFile = new File(opt.requireArgument("-episode",args,++i));
+            return 2;
+        }
+        return 0;
+    }
+
+    /**
+     * Capture all the generated classes from global schema components
+     * and generate them in an episode file.
+     */
+    public boolean run(Outline model, Options opt, ErrorHandler errorHandler) throws SAXException {
+        try {
+            // reorganize qualifying components by their namespaces to
+            // generate the list nicely
+            Map<XSSchema, List<ClassOutline>> perSchema = new HashMap<XSSchema,List<ClassOutline>>();
+            boolean hasComponentInNoNamespace = false;
+
+            for( ClassOutline co : model.getClasses() ) {
+                XSComponent sc = co.target.getSchemaComponent();
+                if(sc==null)        continue;
+                if (!(sc instanceof XSDeclaration))
+                    continue;
+                XSDeclaration decl = (XSDeclaration) sc;
+                if(decl.isLocal())
+                    continue;   // local components cannot be referenced from outside, so no need to list.
+
+                List<ClassOutline> list = perSchema.get(decl.getOwnerSchema());
+                if(list==null) {
+                    list = new ArrayList<ClassOutline>();
+                    perSchema.put(decl.getOwnerSchema(),list);
+                }
+
+                list.add(co);
+
+                if(decl.getTargetNamespace().equals(""))
+                    hasComponentInNoNamespace = true;
+            }
+
+            OutputStream os = new FileOutputStream(episodeFile);
+            Bindings bindings = TXW.create(Bindings.class, new StreamSerializer(os, "UTF-8"));
+            if(hasComponentInNoNamespace) // otherwise jaxb binding NS should be the default namespace
+                bindings._namespace(Const.JAXB_NSURI,"jaxb");
+            else
+                bindings._namespace(Const.JAXB_NSURI,"");
+            bindings.version("2.1");
+            bindings._comment("\n\n"+opt.getPrologComment()+"\n  ");
+
+            // generate listing per schema
+            for (Map.Entry<XSSchema,List<ClassOutline>> e : perSchema.entrySet()) {
+                Bindings group = bindings.bindings();
+                String tns = e.getKey().getTargetNamespace();
+                if(!tns.equals(""))
+                    group._namespace(tns,"tns");
+
+                group.scd("x-schema::"+(tns.equals("")?"":"tns"));
+                group.schemaBindings().map(false);
+
+                for (ClassOutline co : e.getValue()) {
+                    Bindings child = group.bindings();
+                    child.scd(co.target.getSchemaComponent().apply(SCD));
+                    child.klass().ref(co.implClass.fullName());
+                }
+                group.commit(true);
+            }
+
+            bindings.commit();
+
+            return true;
+        } catch (IOException e) {
+            errorHandler.error(new SAXParseException("Failed to write to "+episodeFile,null,e));
+            return false;
+        }
+    }
+
+    /**
+     * Computes SCD.
+     * This is fairly limited as JAXB can only map a certain kind of components to classes.
+     */
+    private static final XSFunction<String> SCD = new XSFunction<String>() {
+        private String name(XSDeclaration decl) {
+            if(decl.getTargetNamespace().equals(""))
+                return decl.getName();
+            else
+                return "tns:"+decl.getName();
+        }
+
+        public String complexType(XSComplexType type) {
+            return "~"+name(type);
+        }
+
+        public String simpleType(XSSimpleType simpleType) {
+            return "~"+name(simpleType);
+        }
+
+        public String elementDecl(XSElementDecl decl) {
+            return name(decl);
+        }
+
+        // the rest is doing nothing
+        public String annotation(XSAnnotation ann) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String attGroupDecl(XSAttGroupDecl decl) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String attributeDecl(XSAttributeDecl decl) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String attributeUse(XSAttributeUse use) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String schema(XSSchema schema) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String facet(XSFacet facet) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String notation(XSNotation notation) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String identityConstraint(XSIdentityConstraint decl) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String xpath(XSXPath xpath) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String particle(XSParticle particle) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String empty(XSContentType empty) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String wildcard(XSWildcard wc) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String modelGroupDecl(XSModelGroupDecl decl) {
+            throw new UnsupportedOperationException();
+        }
+
+        public String modelGroup(XSModelGroup group) {
+            throw new UnsupportedOperationException();
+        }
+    };
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/package-info.java
new file mode 100644
index 0000000..f8943dd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+@XmlNamespace(Const.JAXB_NSURI)
+package com.sun.tools.internal.xjc.addon.episode;
+
+import com.sun.xml.internal.txw2.annotation.XmlNamespace;
+import com.sun.tools.internal.xjc.reader.Const;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java
index b352284..8917dde 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.addon.locator;
 
 import java.io.IOException;
@@ -32,6 +31,7 @@
 import com.sun.codemodel.internal.JDefinedClass;
 import com.sun.codemodel.internal.JMod;
 import com.sun.codemodel.internal.JVar;
+import com.sun.codemodel.internal.JMethod;
 import com.sun.tools.internal.xjc.BadCommandLineException;
 import com.sun.tools.internal.xjc.Options;
 import com.sun.tools.internal.xjc.Plugin;
@@ -80,6 +80,10 @@
                 impl._implements(Locatable.class);
 
                 impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc);
+
+                JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation");
+                JVar $newLoc = setter.param(Locator.class, "newLocator");
+                setter.body().assign($loc, $newLoc);
             }
         }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java
index 100ccb0..ef79081 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.addon.sync;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java
index cad2d41..9b26d09 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java
index a83d313..8638aad 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import org.xml.sax.ErrorHandler;
@@ -43,7 +42,7 @@
  *
  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
-public interface ErrorListener extends ErrorHandler {
+public interface ErrorListener extends com.sun.xml.internal.bind.api.ErrorListener {
     void error(SAXParseException exception);
     void fatalError(SAXParseException exception);
     void warning(SAXParseException exception);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java
index 2fa0154..f8b7967 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import java.io.IOException;
 
 import javax.xml.bind.SchemaOutputResolver;
 import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
 
 /**
  * {@link JAXBModel} that exposes additional information available
@@ -56,20 +56,6 @@
     /**
      * Generates the schema documents from the model.
      *
-     * <p>
-     * The caller can use the additionalElementDecls parameter to
-     * add element declarations to the generate schema.
-     * For example, if the JAX-RPC passes in the following entry:
-     *
-     * {foo}bar -> DeclaredType for java.lang.String
-     *
-     * then JAXB generates the following element declaration (in the schema
-     * document for the namespace "foo")"
-     *
-     * &lt;xs:element name="bar" type="xs:string" />
-     *
-     * This can be used for generating schema components necessary for WSDL.
-     *
      * @param outputResolver
      *      this object controls the output to which schemas
      *      will be sent.
@@ -78,4 +64,18 @@
      *      if {@link SchemaOutputResolver} throws an {@link IOException}.
      */
     void generateSchema(SchemaOutputResolver outputResolver, ErrorListener errorListener) throws IOException;
+
+    /**
+     * Generates the episode file from the model.
+     *
+     * <p>
+     * The "episode file" is really just a JAXB customization file (but with vendor extensions,
+     * at this point), that can be used later with a schema compilation to support separate
+     * compilation.
+     *
+     * @param output
+     *      This receives the generated episode file.
+     * @since 2.1
+     */
+    void generateEpisodeFile(Result output);
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java
index c586246..55d72fa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java
index a5840c2..eea0047 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Mapping.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Mapping.java
index 14db890..af03a58 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Mapping.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Mapping.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Property.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Property.java
index 23d2512..e29fc25 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Property.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Property.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java
index b5e6325..41ff0a6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java
index b84f89b..a5c4c29 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,15 +22,17 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import java.util.Collection;
+import java.util.List;
 
 import javax.xml.namespace.QName;
+import javax.xml.bind.annotation.XmlSeeAlso;
 
 import com.sun.codemodel.internal.CodeWriter;
 import com.sun.codemodel.internal.JCodeModel;
+import com.sun.codemodel.internal.JClass;
 import com.sun.tools.internal.xjc.Options;
 import com.sun.tools.internal.xjc.Plugin;
 
@@ -51,6 +53,15 @@
     Mapping get( QName elementName );
 
     /**
+     * Gets all the <tt>ObjectFactory</tt> classes generated by the compilation.
+     *
+     * <p>
+     * This should be used for generating {@link XmlSeeAlso} on the SEI.
+     */
+    List<JClass> getAllObjectFactories();
+
+
+    /**
      * Gets a read-only view of all the {@link Mapping}s.
      */
     Collection<? extends Mapping> getMappings();
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java
index 53b8b8f..36adf48 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import javax.xml.stream.XMLStreamException;
@@ -98,6 +97,16 @@
     void parseSchema( InputSource source );
 
     /**
+     * Specifies the target spec version for this compilaion.
+     *
+     * @param version
+     *      If null, XJC will generate the source code that
+     *      takes advantage of the latest JAXB spec that it understands.
+     * @since 2.1 EA2
+     */
+    void setTargetVersion( SpecVersion version );
+
+    /**
      * Parses a schema or an external binding file
      * from the specified DOM element.
      *
@@ -203,6 +212,13 @@
     void setClassNameAllocator( ClassNameAllocator allocator );
 
     /**
+     * Clears all the schema files parsed so far.
+     *
+     * @since 2.1.1
+     */
+    void resetSchema();
+
+    /**
      * Obtains the compiled schema object model.
      *
      * Once this method is called, no other method should be
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SpecVersion.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SpecVersion.java
new file mode 100644
index 0000000..de2081b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SpecVersion.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.api;
+
+/**
+ * Represents the spec version constant.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public enum SpecVersion {
+    V2_0, V2_1;
+
+    /**
+     * Returns true if this version is equal or later than the given one.
+     */
+    public boolean isLaterThan(SpecVersion t) {
+        return this.ordinal()>=t.ordinal();
+    }
+
+    /**
+     * Parses "2.0" and "2.1" into the {@link SpecVersion} object.
+     *
+     * @return null for parsing failure.
+     */
+    public static SpecVersion parse(String token) {
+        if(token.equals("2.0"))
+            return V2_0;
+        else
+        if(token.equals("2.1"))
+            return V2_1;
+        return null;
+    }
+
+    public static final SpecVersion LATEST = V2_1;
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java
index 660f610..48ff3c4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import com.sun.codemodel.internal.JAnnotatable;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java
index 2f9e5b9..734dd41 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api;
 
 import com.sun.tools.internal.xjc.api.impl.j2s.JavaCompilerImpl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java
index 93be90b..fcc3654 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.j2s;
 
 import java.io.IOException;
@@ -37,6 +36,7 @@
 import javax.xml.bind.annotation.XmlList;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
 
 import com.sun.mirror.declaration.FieldDeclaration;
 import com.sun.mirror.declaration.MethodDeclaration;
@@ -57,6 +57,7 @@
 import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
 import com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator;
+import com.sun.xml.internal.txw2.output.ResultFactory;
 
 /**
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
@@ -72,6 +73,11 @@
     private final AnnotationReader<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> reader;
 
     /**
+     * Lazily created schema generator.
+     */
+    private XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> xsdgen;
+
+    /**
      * Look up table from an externally visible {@link Reference} object
      * to our internal format.
      */
@@ -160,21 +166,29 @@
     }
 
     public void generateSchema(SchemaOutputResolver outputResolver, ErrorListener errorListener) throws IOException {
-        XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration> xsdgen
-            = new XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>( types.getNavigator(), types );
+        getSchemaGenerator().write(outputResolver,errorListener);
+    }
 
-        for (Map.Entry<QName,Reference> e : additionalElementDecls.entrySet()) {
-            Reference value = e.getValue();
-            if(value!=null) {
-                NonElement<TypeMirror, TypeDeclaration> typeInfo = refMap.get(value);
-                if(typeInfo==null)
-                    throw new IllegalArgumentException(e.getValue()+" was not specified to JavaCompiler.bind");
-                xsdgen.add(e.getKey(),!(value.type instanceof PrimitiveType),typeInfo);
-            } else {
-                xsdgen.add(e.getKey(),false,null);
+    public void generateEpisodeFile(Result output) {
+        getSchemaGenerator().writeEpisodeFile(ResultFactory.createSerializer(output));
+    }
+
+    private synchronized XmlSchemaGenerator<TypeMirror, TypeDeclaration, FieldDeclaration, MethodDeclaration> getSchemaGenerator() {
+        if(xsdgen==null) {
+            xsdgen = new XmlSchemaGenerator<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>( types.getNavigator(), types );
+
+            for (Map.Entry<QName, Reference> e : additionalElementDecls.entrySet()) {
+                Reference value = e.getValue();
+                if(value!=null) {
+                    NonElement<TypeMirror, TypeDeclaration> typeInfo = refMap.get(value);
+                    if(typeInfo==null)
+                        throw new IllegalArgumentException(e.getValue()+" was not specified to JavaCompiler.bind");
+                    xsdgen.add(e.getKey(),!(value.type instanceof PrimitiveType),typeInfo);
+                } else {
+                    xsdgen.add(e.getKey(),false,null);
+                }
             }
         }
-
-        xsdgen.write(outputResolver);
+        return xsdgen;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java
index 4c91985..9f8fe42 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.j2s;
 
 import java.util.Collection;
@@ -65,8 +64,8 @@
             new ModelBuilder<TypeMirror,TypeDeclaration,FieldDeclaration,MethodDeclaration>(
                 InlineAnnotationReaderImpl.theInstance,
                 new APTNavigator(env),
-                defaultNamespaceRemap
-            );
+                Collections.<TypeDeclaration,TypeDeclaration>emptyMap(),
+                defaultNamespaceRemap );
 
         builder.setErrorHandler(new ErrorHandlerImpl(env.getMessager()));
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.java
index 9bcad5e..f20ae00 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.j2s;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.properties
index 8d1c8b6..a36f239 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.properties
@@ -1 +1,26 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java
index 33dd373..7e59811 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java
index 78fe662..dbd22d0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java
index 2b5424e..0cefde9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import org.xml.sax.ErrorHandler;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java
index b06930c..5ae047d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import javax.xml.bind.JAXBElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
index 73ad223..9b5130b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java
index 27d6f37..d6bd007 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
index f1c5844..9b0914c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import javax.xml.bind.JAXBElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java
index db33507..8b84218 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.util.ArrayList;
@@ -34,6 +33,7 @@
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.internal.JCodeModel;
+import com.sun.codemodel.internal.JClass;
 import com.sun.tools.internal.xjc.Plugin;
 import com.sun.tools.internal.xjc.api.ErrorListener;
 import com.sun.tools.internal.xjc.api.JAXBModel;
@@ -82,6 +82,13 @@
         return outline.getCodeModel();
     }
 
+    public List<JClass> getAllObjectFactories() {
+        List<JClass> r = new ArrayList<JClass>();
+        for (PackageOutline pkg : outline.getAllPackageContexts()) {
+            r.add(pkg.objectFactory());
+        }
+        return r;
+    }
 
     public final Mapping get(QName elementName) {
         return byXmlName.get(elementName);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java
index d4da9e6..24a7cd0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java
index 76cd416..c45c55a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import java.net.MalformedURLException;
@@ -44,9 +43,11 @@
 import com.sun.tools.internal.xjc.api.ClassNameAllocator;
 import com.sun.tools.internal.xjc.api.ErrorListener;
 import com.sun.tools.internal.xjc.api.SchemaCompiler;
+import com.sun.tools.internal.xjc.api.SpecVersion;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.tools.internal.xjc.reader.internalizer.DOMForest;
+import com.sun.tools.internal.xjc.reader.internalizer.SCDBasedBindingSet;
 import com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic;
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
 import com.sun.xml.internal.xsom.XSSchemaSet;
@@ -80,7 +81,7 @@
 
     protected final Options opts = new Options();
 
-    protected final DOMForest forest;
+    protected @NotNull DOMForest forest;
 
     /**
      * Set to true once an error is found.
@@ -88,9 +89,8 @@
     private boolean hadError;
 
     public SchemaCompilerImpl() {
-        forest = new DOMForest(new XMLSchemaInternalizationLogic());
         opts.compatibilityMode = Options.EXTENSION;
-        forest.setErrorHandler(this);
+        resetSchema();
 
         if(System.getProperty("xjc-api.test")!=null) {
             opts.debugMode = true;
@@ -142,6 +142,12 @@
         }
     }
 
+    public void setTargetVersion(SpecVersion version) {
+        if(version==null)
+            version = SpecVersion.LATEST;
+        opts.target = version;
+    }
+
     public void parseSchema(String systemId, XMLStreamReader reader) throws XMLStreamException {
         checkAbsoluteness(systemId);
         forest.parse(systemId,reader,true);
@@ -183,6 +189,12 @@
         opts.classNameAllocator = allocator;
     }
 
+    public void resetSchema() {
+        forest = new DOMForest(new XMLSchemaInternalizationLogic());
+        forest.setErrorHandler(this);
+        forest.setEntityResolver(opts.entityResolver);
+    }
+
 
     public JAXBModelImpl bind() {
         // this has been problematic. turn it off.
@@ -190,7 +202,7 @@
 //            return null;
 
         // internalization
-        forest.transform();
+        SCDBasedBindingSet scdBasedBindingSet = forest.transform(opts.isExtensionMode());
 
         if(!NO_CORRECTNESS_CHECK) {
             // correctness check
@@ -206,7 +218,7 @@
         ModelLoader gl = new ModelLoader(opts,codeModel,this);
 
         try {
-            XSSchemaSet result = gl.createXSOM(forest);
+            XSSchemaSet result = gl.createXSOM(forest, scdBasedBindingSet);
             if(result==null)
                 return null;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
index f1baf82..d5b8e5d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.impl.s2j;
 
 import javax.xml.bind.annotation.XmlAttachmentRef;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html
index 1b17d19..8bdd2e2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 implementation of the XJC API for schema to java.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/package.html
index 4ffeb74..69fe373 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 API for programatic invocation of XJC and schemagen.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java
index 4ddff33..f945cac 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.util;
 
 import java.io.ByteArrayOutputStream;
@@ -33,6 +32,8 @@
 import java.net.URLClassLoader;
 import java.net.MalformedURLException;
 
+import com.sun.istack.internal.Nullable;
+
 /**
  * {@link ClassLoader} that loads APT and specified classes
  * both into the same classloader, so that they can reference each other.
@@ -52,9 +53,9 @@
      * @param packagePrefixes
      *      The package prefixes that are forced to resolve within this class loader.
      * @param parent
-     *      The parent class loader to delegate to.
+     *      The parent class loader to delegate to. Null to indicate bootstrap classloader.
      */
-    public APTClassLoader(ClassLoader parent, String[] packagePrefixes) throws ToolsJarNotFoundException {
+    public APTClassLoader(@Nullable ClassLoader parent, String[] packagePrefixes) throws ToolsJarNotFoundException {
         super(getToolsJar(parent),parent);
         if(getURLs().length==0)
             // if tools.jar was found in our classloader, no need to create
@@ -114,11 +115,11 @@
      * Returns a class loader that can load classes from JDK tools.jar.
      * @param parent
      */
-    private static URL[] getToolsJar(ClassLoader parent) throws ToolsJarNotFoundException {
+    private static URL[] getToolsJar(@Nullable ClassLoader parent) throws ToolsJarNotFoundException {
 
         try {
-            parent.loadClass("com.sun.tools.javac.Main");
-            parent.loadClass("com.sun.tools.apt.Main");
+            Class.forName("com.sun.tools.javac.Main",false,parent);
+            Class.forName("com.sun.tools.apt.Main",false,parent);
             return new URL[0];
             // we can already load them in the parent class loader.
             // so no need to look for tools.jar.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java
index 0c9268b..f4cea0f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.util;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.java
index ecedc62..a943935 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.util;
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties
index ed10953..c7ce9e6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 TOOLS_JAR_NOT_FOUND = \
     JDK''s tools.jar was not found in {0}. Usually this means you are running JRE, not JDK. Please use the java command in JDK 5.0 or later (not JRE.)
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java
index c48a69d..3158dec 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.api.util;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/package.html
index 3bd340f..2b3c194 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Utility code shared between JAXB and JAX-WS
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlIsSetWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlIsSetWriter.java
index 1f6e652..b661809 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlIsSetWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlIsSetWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.ri;
 
 import com.sun.codemodel.internal.JAnnotationWriter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlLocationWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlLocationWriter.java
index 6cbcd87..620fd3b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlLocationWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/XmlLocationWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.ri;
 
 import com.sun.codemodel.internal.JAnnotationWriter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java
index bc234d0..49482e6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAccessOrder;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java
index e35e2b5..aa55e1f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAccessType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java
index dbdba1a..918e658 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAnyAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java
index c6c39f7..c469715 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAnyElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java
index fb91383..3feae20 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAttachmentRef;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java
index 31a18cd..567bb6b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java
index dc68744..a03fe81 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java
index 0cf5ace..fc8acb1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElementRef;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java
index 1ad6aee..47e9457 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElementRefs;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java
index c2341ff..77bc793 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElementWrapper;
@@ -38,6 +36,8 @@
 
     XmlElementWrapperWriter namespace(String value);
 
+    XmlElementWrapperWriter required(boolean value);
+
     XmlElementWrapperWriter nillable(boolean value);
 
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java
index 714f807..314871a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java
index 0707c54..7383791 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlElements;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java
index 8025105..80c1dfa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlEnumValue;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java
index 60422ec..23c197e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlEnum;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java
index b768d9f..4d04be3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlIDREF;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java
index 367633b..e04c6c8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlID;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java
index 7f5cb4a..abcf5b8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlInlineBinaryData;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java
index 3fa1c9f..850db87 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java
index 9427b61..eee0a59 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java
index 8cc20db..ecb5455 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlMimeType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java
index ec2f889..becdb29 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlMixed;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java
index a034b11..14c14b1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlNs;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java
index 3751af0..aee953c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlRegistry;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java
index c2e123b..8197ca1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlRootElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java
index 04a2bd9..b4b2a4d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlSchemaType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java
index 2d6fbd7..8137b66 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlSchemaTypes;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java
index f52b536..596ed15 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlNsForm;
@@ -35,6 +33,8 @@
 {
 
 
+    XmlSchemaWriter location(String value);
+
     XmlSchemaWriter namespace(String value);
 
     XmlNsWriter xmlns();
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java
new file mode 100644
index 0000000..f99907e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.generator.annotation.spec;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+import com.sun.codemodel.internal.JAnnotationWriter;
+import com.sun.codemodel.internal.JType;
+
+public interface XmlSeeAlsoWriter
+    extends JAnnotationWriter<XmlSeeAlso>
+{
+
+
+    XmlSeeAlsoWriter value(Class value);
+
+    XmlSeeAlsoWriter value(JType value);
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java
index 1f2c67a..89f41d0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlTransient;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java
index 2f04dbc..9ca700b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java
index 9aaf50e..d475f86 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.tools.internal.xjc.generator.annotation.spec;
 
 import javax.xml.bind.annotation.XmlValue;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
index 297063b..4227e80 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,14 @@
 
 package com.sun.tools.internal.xjc.generator.bean;
 
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
+
 import java.io.Serializable;
 import java.net.URL;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -65,12 +68,14 @@
 import com.sun.codemodel.internal.fmt.JStaticJavaFile;
 import com.sun.tools.internal.xjc.AbortException;
 import com.sun.tools.internal.xjc.ErrorReceiver;
+import com.sun.tools.internal.xjc.api.SpecVersion;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlAnyAttributeWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlEnumValueWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlEnumWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlJavaTypeAdapterWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlMimeTypeWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlRootElementWriter;
+import com.sun.tools.internal.xjc.generator.annotation.spec.XmlSeeAlsoWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlTypeWriter;
 import com.sun.tools.internal.xjc.generator.bean.field.FieldRenderer;
 import com.sun.tools.internal.xjc.model.CAdapter;
@@ -83,6 +88,7 @@
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.CTypeRef;
 import com.sun.tools.internal.xjc.model.Model;
+import com.sun.tools.internal.xjc.model.CClassRef;
 import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.ClassOutline;
 import com.sun.tools.internal.xjc.outline.EnumConstantOutline;
@@ -94,6 +100,7 @@
 import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
 import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
 import com.sun.xml.internal.xsom.XmlString;
+import com.sun.istack.internal.NotNull;
 
 /**
  * Generates fields and accessors.
@@ -169,9 +176,9 @@
 
         // build enum classes
         for( CEnumLeafInfo p : model.enums().values() )
-            enums.put( p, generateEnum(p) );
+            enums.put( p, generateEnumDef(p) );
 
-        JPackage[] packages = getUsedPackages(Aspect.EXPOSED);
+        JPackage[] packages = getUsedPackages(EXPOSED);
 
         // generates per-package code and remember the results as contexts.
         for( JPackage pkg : packages )
@@ -198,11 +205,16 @@
                 // use the specified super class
                 model.strategy._extends(cc,getClazz(superClass));
             } else {
-                // use the default one, if any
-                if( model.rootClass!=null && cc.implClass._extends().equals(OBJECT) )
-                    cc.implClass._extends(model.rootClass);
-                if( model.rootInterface!=null)
-                    cc.ref._implements(model.rootInterface);
+                CClassRef refSuperClass = cc.target.getRefBaseClass();
+                if(refSuperClass!=null) {
+                    cc.implClass._extends(refSuperClass.toType(this,EXPOSED));
+                } else {
+                    // use the default one, if any
+                    if( model.rootClass!=null && cc.implClass._extends().equals(OBJECT) )
+                        cc.implClass._extends(model.rootClass);
+                    if( model.rootInterface!=null)
+                        cc.ref._implements(model.rootInterface);
+                }
             }
         }
 
@@ -210,6 +222,9 @@
         for( ClassOutlineImpl co : getClasses() )
             generateClassBody(co);
 
+        for( EnumOutline eo : enums.values() )
+            generateEnumBody(eo);
+
         // create factories for the impl-less elements
         for( CElementInfo ei : model.getAllElements())
             getPackageContext(ei._package()).objectFactoryGenerator().populate(ei);
@@ -302,7 +317,7 @@
         }
 
         public JClassContainer onPackage(JPackage pkg) {
-            return model.strategy.getPackage(pkg,Aspect.EXPOSED);
+            return model.strategy.getPackage(pkg, EXPOSED);
         }
     };
 
@@ -465,16 +480,19 @@
         // [RESULT]
         // @XmlType(name="foo", targetNamespace="bar://baz")
         XmlTypeWriter xtw = cc.implClass.annotate2(XmlTypeWriter.class);
-        QName typeName = cc.target.getTypeName();
-        if(typeName==null) {
-            xtw.name("");
-        } else {
-            xtw.name(typeName.getLocalPart());
-            final String typeNameURI = typeName.getNamespaceURI();
-            if(!typeNameURI.equals(mostUsedNamespaceURI)) // only generate if necessary
-                xtw.namespace(typeNameURI);
-        }
+        writeTypeName(cc.target.getTypeName(), xtw, mostUsedNamespaceURI);
 
+        if(model.options.target.isLaterThan(SpecVersion.V2_1)) {
+            // @XmlSeeAlso
+            Iterator<CClassInfo> subclasses = cc.target.listSubclasses();
+            if(subclasses.hasNext()) {
+                XmlSeeAlsoWriter saw = cc.implClass.annotate2(XmlSeeAlsoWriter.class);
+                while (subclasses.hasNext()) {
+                    CClassInfo s = subclasses.next();
+                    saw.value(getClazz(s).implRef);
+                }
+            }
+        }
 
         if(target.isElement()) {
             String namespaceURI = target.getElementName().getNamespaceURI();
@@ -513,6 +531,17 @@
         cc._package().objectFactoryGenerator().populate(cc);
     }
 
+    private void writeTypeName(QName typeName, XmlTypeWriter xtw, String mostUsedNamespaceURI) {
+        if(typeName ==null) {
+            xtw.name("");
+        } else {
+            xtw.name(typeName.getLocalPart());
+            final String typeNameURI = typeName.getNamespaceURI();
+            if(!typeNameURI.equals(mostUsedNamespaceURI)) // only generate if necessary
+                xtw.namespace(typeNameURI);
+        }
+    }
+
     /**
      * Generates an attribute wildcard property on a class.
      */
@@ -547,24 +576,43 @@
 
 
 
-    private EnumOutline generateEnum(CEnumLeafInfo e) {
+    /**
+     * Generates the minimum {@link JDefinedClass} skeleton
+     * without filling in its body.
+     */
+    private EnumOutline generateEnumDef(CEnumLeafInfo e) {
         JDefinedClass type;
 
+        type = getClassFactory().createClass(
+            getContainer(e.parent, EXPOSED),e.shortName,e.getLocator(), ClassType.ENUM);
+        type.javadoc().append(e.javadoc);
+
+        return new EnumOutline(e, type) {
+            @Override
+            public @NotNull Outline parent() {
+                return BeanGenerator.this;
+            }
+        };
+    }
+
+    private void generateEnumBody(EnumOutline eo) {
+        JDefinedClass type = eo.clazz;
+        CEnumLeafInfo e = eo.target;
+
+        XmlTypeWriter xtw = type.annotate2(XmlTypeWriter.class);
+        writeTypeName(e.getTypeName(), xtw,
+                eo._package().getMostUsedNamespaceURI());
+
+        JCodeModel codeModel = model.codeModel;
+
         // since constant values are never null, no point in using the boxed types.
-        JType baseExposedType = e.base.toType(this,Aspect.EXPOSED).unboxify();
+        JType baseExposedType = e.base.toType(this, EXPOSED).unboxify();
         JType baseImplType = e.base.toType(this,Aspect.IMPLEMENTATION).unboxify();
 
 
-        type = getClassFactory().createClass(
-            getContainer(e.parent,Aspect.EXPOSED),e.shortName,e.getLocator(), ClassType.ENUM);
-        type.javadoc().append(e.javadoc);
-
         XmlEnumWriter xew = type.annotate2(XmlEnumWriter.class);
         xew.value(baseExposedType);
 
-        JCodeModel codeModel = model.codeModel;
-
-        EnumOutline enumOutline = new EnumOutline(e, type) {};
 
         boolean needsValue = e.needsValueField();
 
@@ -600,7 +648,7 @@
             if( mem.javadoc!=null )
                 constRef.javadoc().append(mem.javadoc);
 
-            enumOutline.constants.add(new EnumConstantOutline(mem,constRef){});
+            eo.constants.add(new EnumConstantOutline(mem,constRef){});
         }
 
 
@@ -644,11 +692,16 @@
 
                 JInvocation ex = JExpr._new(codeModel.ref(IllegalArgumentException.class));
 
+                JExpression strForm;
                 if(baseExposedType.isPrimitive()) {
-                    m.body()._throw(ex.arg(codeModel.ref(String.class).staticInvoke("valueOf").arg($v)));
+                    strForm = codeModel.ref(String.class).staticInvoke("valueOf").arg($v);
+                } else
+                if(baseExposedType==codeModel.ref(String.class)){
+                    strForm = $v;
                 } else {
-                    m.body()._throw(ex.arg($v.invoke("toString")));
+                    strForm = $v.invoke("toString");
                 }
+                m.body()._throw(ex.arg(strForm));
             }
         } else {
             // [RESULT]
@@ -660,13 +713,10 @@
             JMethod m = type.method(JMod.PUBLIC|JMod.STATIC, type, "fromValue" );
             m.body()._return( JExpr.invoke("valueOf").arg(m.param(String.class,"v")));
         }
-
-        return enumOutline;
     }
 
 
 
-
     /**
      * Determines the FieldRenderer used for the given FieldUse,
      * then generates the field declaration and accessor methods.
@@ -701,7 +751,7 @@
                 // [RESULT]
                 // @XmlJavaTypeAdapter( Foo.class )
                 XmlJavaTypeAdapterWriter xjtw = field.annotate2(XmlJavaTypeAdapterWriter.class);
-                xjtw.value(adapter.adapterType.toType(this,Aspect.EXPOSED));
+                xjtw.value(adapter.adapterType.toType(this, EXPOSED));
             }
         }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java
index b839331..f9b272e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import com.sun.codemodel.internal.JClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java
index bd5d54e..23f6f18 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import com.sun.codemodel.internal.JDefinedClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
index c664535..710a00c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import javax.xml.bind.JAXBElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
index 32562e4..662842e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /*
  * Use is subject to the license terms.
  */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties
index 1faab35..74557b4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 METHOD_COLLISION = \
 	The "{0}" method is defined on both "{1}" and "{2}" and is causing a collision.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/Messages.java
index e0ebad2..770de6f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java
index 20f2947..3f632dd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /*
  * Use is subject to the license terms.
  */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGenerator.java
index 670e456..421538c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import com.sun.codemodel.internal.JDefinedClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
index fed8992..3018be0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
index 6c2cc76..cb93c0c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import java.util.Collections;
@@ -49,6 +48,7 @@
 import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.outline.PackageOutline;
+import com.sun.tools.internal.xjc.outline.Aspect;
 
 /**
  * {@link PackageOutline} enhanced with schema2java specific
@@ -178,7 +178,7 @@
         // generate package-info.java
         // we won't get this far if the user specified -npa
         if(!mostUsedNamespaceURI.equals("") || elementFormDefault==XmlNsForm.QUALIFIED) {
-            XmlSchemaWriter w = _package.annotate2(XmlSchemaWriter.class);
+            XmlSchemaWriter w = _model.strategy.getPackage(_package, Aspect.IMPLEMENTATION).annotate2(XmlSchemaWriter.class);
             if(!mostUsedNamespaceURI.equals(""))
                 w.namespace(mostUsedNamespaceURI);
             if(elementFormDefault==XmlNsForm.QUALIFIED)
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
index 6f0584c..216c2d6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import javax.xml.bind.JAXBContext;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
index 2f75af8..3cdc3c0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean;
 
 import com.sun.codemodel.internal.JPackage;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
index 21c8e50..a1c7b51 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.ArrayList;
@@ -50,6 +49,7 @@
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlElementRefsWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlElementWriter;
 import com.sun.tools.internal.xjc.generator.annotation.spec.XmlElementsWriter;
+import com.sun.tools.internal.xjc.generator.annotation.spec.XmlSchemaTypeWriter;
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
 import com.sun.tools.internal.xjc.model.CAttributePropertyInfo;
 import com.sun.tools.internal.xjc.model.CElement;
@@ -142,6 +142,12 @@
         }
 
         outline.parent().generateAdapterIfNecessary(prop,field);
+
+        QName st = prop.getSchemaType();
+        if(st!=null)
+            field.annotate2(XmlSchemaTypeWriter.class)
+                .name(st.getLocalPart())
+                .namespace(st.getNamespaceURI());
     }
 
     private void annotateReference(JAnnotatable field) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java
index 0e16b82..917f3e3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java
index 086eb42..a34af24 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java
index 095040b..bc26400 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java
index 8cc1892..7cebce9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java
index 1a4aa02..17786f8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java
index c756faf..42fc0b3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java
index 7f13459..5b5e8b6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java
index cd7423d..6d5eea6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.tools.internal.xjc.Options;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java
index 1888eb8..e89acb2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.lang.reflect.Constructor;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java
index 1630594..baf5c47 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java
index 8cd0d4c..7ab6dd9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties
index a77b6a3..77f6328 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 DEFAULT_SETTER_JAVADOC = \
         Sets the value of the {0} property.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java
index e654ef6..61fa6ea 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java
index 99b7c91..a2b3ab4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java
index ef470b3..ebd640e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
index 8fa55da..a50638e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java
index 0c8c856..bf3fddd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java
index bf2a24d..b393538 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.bean.field;
 
 import com.sun.codemodel.internal.JClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html
index d8eed5a..7810671 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <body><p>
 FieldRenderer and its implementation classes.
 Unless you are deriving from these classes to define your own custom renderer,
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java
index a3d1e56..5025c1a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * <h1>Code Generator</h1>.
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java
index ec192b5..0b7706d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.util;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java
index 73c2fcd..7ad5d31 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.util;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java
index a71fd23..dd7487f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.util;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java
index aab57e8..c96b669 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.generator.util;
 
 import com.sun.codemodel.internal.JCodeModel;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCElement.java
new file mode 100644
index 0000000..46ef108
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCElement.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.model;
+
+import javax.xml.bind.annotation.XmlTransient;
+
+import com.sun.xml.internal.xsom.XSComponent;
+
+import org.xml.sax.Locator;
+
+/**
+ * Partial default implementation of {@link CElement}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractCElement extends AbstractCTypeInfoImpl implements CElement {
+
+    /**
+     * The location in the source file where this class was declared.
+     */
+    @XmlTransient
+    private final Locator locator;
+
+    private boolean isAbstract;
+
+    protected AbstractCElement(Model model, XSComponent source, Locator locator, CCustomizations customizations) {
+        super(model, source, customizations);
+        this.locator = locator;
+    }
+
+    public Locator getLocator() {
+        return locator;
+    }
+
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+    public void setAbstract() {
+        isAbstract = true;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java
index baa2db4..c3df0c3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,19 +22,17 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.activation.MimeType;
 
-import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.JExpression;
+import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
 import com.sun.xml.internal.bind.v2.model.core.ID;
 import com.sun.xml.internal.bind.v2.runtime.Location;
 import com.sun.xml.internal.xsom.XSComponent;
 import com.sun.xml.internal.xsom.XmlString;
-import com.sun.tools.internal.xjc.outline.Outline;
 
 /**
  * Partial implementation of {@link CTypeInfo}.
@@ -69,10 +67,6 @@
         return null;
     }
 
-    public final CTypeInfo getInfo() {
-        return this;
-    }
-
     public final ID idUse() {
         return ID.NONE;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AutoClassNameAllocator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AutoClassNameAllocator.java
new file mode 100644
index 0000000..b94cf85
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AutoClassNameAllocator.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.model;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import com.sun.tools.internal.xjc.api.ClassNameAllocator;
+
+/**
+ * {@link ClassNameAllocator} filter that performs automatic name conflict resolution.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class AutoClassNameAllocator implements ClassNameAllocator {
+    private final ClassNameAllocator core;
+
+    private final Map<String,Set<String>> names = new HashMap<String,Set<String>>();
+
+    public AutoClassNameAllocator(ClassNameAllocator core) {
+        this.core = core;
+    }
+
+    public String assignClassName(String packageName, String className) {
+        className = determineName(packageName, className);
+        if(core!=null)
+            className = core.assignClassName(packageName,className);
+        return className;
+    }
+
+    private String determineName(String packageName, String className) {
+        Set<String> s = names.get(packageName);
+        if(s==null) {
+            s = new HashSet<String>();
+            names.put(packageName,s);
+        }
+
+        if(s.add(className))
+            return className;
+
+        for(int i=2;true;i++) {
+            if(s.add(className+i))
+                return className+i;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
index 21639e0..6b5a820 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
index f3b26fa..7e66732 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.xml.namespace.QName;
@@ -67,6 +66,11 @@
         return false;
     }
 
+    @Deprecated // guaranteed to return this
+    public CNonElement getInfo() {
+        return this;
+    }
+
     public JType toType(Outline o, Aspect aspect) {
         return itemType.toType(o,aspect).array();
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java
index 814002d..3024044 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.xml.namespace.QName;
@@ -32,6 +31,7 @@
 import com.sun.xml.internal.bind.v2.model.core.AttributePropertyInfo;
 import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
 import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.istack.internal.Nullable;
 
 import org.xml.sax.Locator;
 
@@ -45,9 +45,16 @@
     private final QName attName;
     private final boolean isRequired;
 
+    /**
+     * @param type
+     *      Represents the bound type of this attribute.
+     * @param typeName
+     *      XML Schema type name of this attribute. Optional for other schema languages.
+     */
     public CAttributePropertyInfo(String name, XSComponent source, CCustomizations customizations,
-                                  Locator locator, QName attName, TypeUse type, boolean required ) {
-        super(name, type, source, customizations, locator);
+                                  Locator locator, QName attName, TypeUse type, @Nullable QName typeName,
+                                  boolean required ) {
+        super(name, type, typeName, source, customizations, locator);
         isRequired = required;
         this.attName = attName;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
index f10ae64..86bf607 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.awt.*;
@@ -113,10 +112,19 @@
      * Since {@link CBuiltinLeafInfo} represents a default binding,
      * it is never a collection.
      */
+    @Deprecated
     public final boolean isCollection() {
         return false;
     }
 
+    /**
+     * Guaranteed to return this.
+     */
+    @Deprecated
+    public CNonElement getInfo() {
+        return this;
+    }
+
     public ID idUse() {
         return id;
     }
@@ -128,17 +136,11 @@
         return null;
     }
 
-    /**
-     * By definition, a default handling doesn't need any adapter.
-     */
+    @Deprecated
     public final CAdapter getAdapterUse() {
         return null;
     }
 
-    public final CBuiltinLeafInfo getInfo() {
-        return this;
-    }
-
     public Locator getLocator() {
         return Model.EMPTY_LOCATOR;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClass.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClass.java
new file mode 100644
index 0000000..2d53b72
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClass.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.model;
+
+/**
+ * Either {@link CClassInfo} or {@link CClassRef}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface CClass extends CNonElement, CElement {
+    // how can anything be CNonElement and CElement at the same time, you may ask.
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
index 73b1e56..a1ca008 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,24 +22,25 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlID;
 import javax.xml.bind.annotation.XmlIDREF;
-import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.internal.JClass;
 import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.JPackage;
+import com.sun.istack.internal.Nullable;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.outline.Aspect;
@@ -58,19 +59,34 @@
  *
  * @author Kohsuke Kawaguchi
  */
-public final class CClassInfo extends AbstractCTypeInfoImpl implements ClassInfo<NType,NClass>, CClassInfoParent, CElement, CNonElement, NClass, CTypeInfo {
+public final class CClassInfo extends AbstractCElement implements ClassInfo<NType,NClass>, CClassInfoParent, CClass, NClass {
 
     @XmlIDREF
-    private CClassInfo baseClass;
+    private CClass baseClass;
+
+    /**
+     * List of all subclasses, together with {@link #nextSibling}.
+     *
+     * If this class has no sub-class, this field is null. Otherwise,
+     * this field points to a sub-class of this class. From there you can enumerate
+     * all the sub-classes by using {@link #nextSibling}.
+     */
+    private CClassInfo firstSubclass;
+
+    /**
+     * @see #firstSubclass
+     */
+    private CClassInfo nextSibling = null;
 
     /**
      * @see #getTypeName()
      */
     private final QName typeName;
+
     /**
-     * Can be null.
+     * If this class also gets {@link XmlRootElement}, the class name.
      */
-    private final QName elementName;
+    private final @Nullable QName elementName;
 
     private boolean isOrdered = true;
 
@@ -93,17 +109,9 @@
     public final String shortName;
 
     /**
-     * The location in the source file where this class was declared.
-     */
-    @XmlTransient
-    private final Locator location;
-
-    private boolean isAbstract;
-
-    /**
      * Optional user-specified implementation override class.
      */
-    private String implClass;
+    private @Nullable String implClass;
 
     /**
      * The {@link Model} object to which this bean belongs.
@@ -121,11 +129,10 @@
     }
 
     public CClassInfo(Model model,CClassInfoParent p, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) {
-        super(model,source,customizations);
+        super(model,source,location,customizations);
         this.model = model;
         this.parent = p;
         this.shortName = model.allocator.assignClassName(parent,shortName);
-        this.location = location;
         this.typeName = typeName;
         this.elementName = elementName;
 
@@ -133,7 +140,7 @@
     }
 
     public CClassInfo(Model model,JCodeModel cm, String fullName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) {
-        super(model,source,customizations);
+        super(model,source,location,customizations);
         this.model = model;
         int idx = fullName.indexOf('.');
         if(idx<0) {
@@ -143,17 +150,12 @@
             this.parent = model.getPackage(cm._package(fullName.substring(0,idx)));
             this.shortName = model.allocator.assignClassName(parent,fullName.substring(idx+1));
         }
-        this.location = location;
         this.typeName = typeName;
         this.elementName = elementName;
 
         model.add(this);
     }
 
-    public Locator getLocator() {
-        return location;
-    }
-
     public boolean hasAttributeWildcard() {
         return hasAttributeWildcard;
     }
@@ -163,7 +165,7 @@
     }
 
     public boolean hasSubClasses() {
-        throw new UnsupportedOperationException();
+        return firstSubclass!=null;
     }
 
     /**
@@ -237,10 +239,12 @@
         return properties;
     }
 
+    public boolean hasValueProperty() {
+        throw new UnsupportedOperationException();
+    }
+
     /**
      * Gets a propery by name.
-     *
-     * TODO: consider moving this up to {@link ClassInfo}
      */
     public CPropertyInfo getProperty(String name) {
         // TODO: does this method need to be fast?
@@ -258,6 +262,14 @@
         return elementName!=null;
     }
 
+    /**
+     * Guaranteed to return this.
+     */
+    @Deprecated
+    public CNonElement getInfo() {
+        return this;
+    }
+
     public Element<NType,NClass> asElement() {
         if(isElement())
             return this;
@@ -329,20 +341,75 @@
         properties.add(prop);
     }
 
-    public void setBaseClass(CClassInfo base) {
+    /**
+     * This method accepts both {@link CClassInfo} (which means the base class
+     * is also generated), or {@link CClassRef} (which means the base class is
+     * already generated and simply referenced.)
+     *
+     * The latter is treated somewhat special --- from the rest of the model
+     * this external base class is invisible. This modeling might need more
+     * thoughts to get right.
+     */
+    public void setBaseClass(CClass base) {
         assert baseClass==null;
         assert base!=null;
         baseClass = base;
+
+        assert nextSibling==null;
+        if (base instanceof CClassInfo) {
+            CClassInfo realBase = (CClassInfo) base;
+            this.nextSibling = realBase.firstSubclass;
+            realBase.firstSubclass = this;
+        }
     }
 
+    /**
+     * This inherited version returns null if this class extends from {@link CClassRef}.
+     *
+     * @see #getRefBaseClass()
+     */
     public CClassInfo getBaseClass() {
-        return baseClass;
+        if (baseClass instanceof CClassInfo) {
+            return (CClassInfo) baseClass;
+        } else {
+            return null;
+        }
+    }
+
+    public CClassRef getRefBaseClass() {
+        if (baseClass instanceof CClassRef) {
+            return (CClassRef) baseClass;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Enumerates all the sub-classes of this class.
+     */
+    public Iterator<CClassInfo> listSubclasses() {
+        return new Iterator<CClassInfo>() {
+            CClassInfo cur = firstSubclass;
+            public boolean hasNext() {
+                return cur!=null;
+            }
+
+            public CClassInfo next() {
+                CClassInfo r = cur;
+                cur = cur.nextSibling;
+                return r;
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
     }
 
     public CClassInfo getSubstitutionHead() {
-        CClassInfo c=baseClass;
+        CClassInfo c=getBaseClass();
         while(c!=null && !c.isElement())
-            c=c.baseClass;
+            c=c.getBaseClass();
         return c;
     }
 
@@ -403,12 +470,4 @@
     public String toString() {
         return fullName();
     }
-
-    public void setAbstract() {
-        isAbstract = true;
-    }
-
-    public boolean isAbstract() {
-        return isAbstract;
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java
index 72093e6..63b3138 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JPackage;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
new file mode 100644
index 0000000..7dfc6c4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.model;
+
+import javax.xml.namespace.QName;
+
+import com.sun.codemodel.internal.JClass;
+import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
+import com.sun.tools.internal.xjc.outline.Outline;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIClass;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
+import com.sun.xml.internal.xsom.XSComponent;
+
+/**
+ * Refernece to an existing class.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class CClassRef extends AbstractCElement implements NClass, CClass {
+
+    private final String fullyQualifiedClassName;
+
+    /**
+     *
+     * @param decl
+     *      The {@link BIClass} declaration that has {@link BIClass#getExistingClassRef()}
+     */
+    public CClassRef(Model model, XSComponent source, BIClass decl, CCustomizations customizations) {
+        super(model, source, decl.getLocation(), customizations);
+        fullyQualifiedClassName = decl.getExistingClassRef();
+        assert fullyQualifiedClassName!=null;
+    }
+
+    /**
+     *
+     * @param decl
+     *      The {@link BIClass} declaration that has {@link BIEnum#ref}
+     */
+    public CClassRef(Model model, XSComponent source, BIEnum decl, CCustomizations customizations) {
+        super(model, source, decl.getLocation(), customizations);
+        fullyQualifiedClassName = decl.ref;
+        assert fullyQualifiedClassName!=null;
+    }
+
+    public void setAbstract() {
+        // assume that the referenced class is marked as abstract to begin with.
+    }
+
+    public boolean isAbstract() {
+        // no way to find out for sure
+        return false;
+    }
+
+    public NType getType() {
+        return this;
+    }
+
+    /**
+     * Cached for both performance and single identity.
+     */
+    private JClass clazz;
+
+    public JClass toType(Outline o, Aspect aspect) {
+        if(clazz==null)
+            clazz = o.getCodeModel().ref(fullyQualifiedClassName);
+        return clazz;
+    }
+
+    public String fullName() {
+        return fullyQualifiedClassName;
+    }
+
+    public QName getTypeName() {
+        return null;
+    }
+
+    /**
+     * Guaranteed to return this.
+     */
+    @Deprecated
+    public CNonElement getInfo() {
+        return this;
+    }
+
+// are these going to bite us?
+//    we can compute some of them, but not all.
+
+    public CElement getSubstitutionHead() {
+        return null;
+    }
+
+    public CClassInfo getScope() {
+        return null;
+    }
+
+    public QName getElementName() {
+        return null;
+    }
+
+    public boolean isBoxedType() {
+        return false;
+    }
+
+    public boolean isSimpleType() {
+        return false;
+    }
+
+
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java
index 3e6160d..0a33748 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.Plugin;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java
index 83c255f..429b340 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java
index 6a3b077..fe1c30a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JExpression;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java
index 8d9a30a..496cba4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.model.nav.NClass;
@@ -30,11 +29,11 @@
 import com.sun.xml.internal.bind.v2.model.core.Element;
 
 /**
- * Either {@link CElementInfo} or {@link CClassInfo}.
+ * Either {@link CElementInfo}, {@link CClassInfo}, or {@link CClassRef}.
  *
  * @author Kohsuke Kawaguchi
  */
-public interface CElement extends CTypeInfo, Element<NType,NClass>, CClassInfoParent {
+public interface CElement extends CTypeInfo, Element<NType,NClass> {
     /**
      * Marks this element as an abstract element.
      */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
index 9b346fe..91de79c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collection;
@@ -33,25 +32,24 @@
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.namespace.QName;
 
 import com.sun.codemodel.internal.JPackage;
 import com.sun.codemodel.internal.JType;
+import com.sun.istack.internal.Nullable;
+import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.NOT_REPEATED;
+import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.REPEATED_VALUE;
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
 import com.sun.tools.internal.xjc.outline.Aspect;
 import com.sun.tools.internal.xjc.outline.Outline;
 import com.sun.xml.internal.bind.v2.model.core.ElementInfo;
-import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSElementDecl;
 import com.sun.xml.internal.xsom.XmlString;
 
 import org.xml.sax.Locator;
 
-import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.REPEATED_VALUE;
-import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.NOT_REPEATED;
-
 /**
  * {@link ElementInfo} implementation for the compile-time model.
  *
@@ -61,8 +59,8 @@
  *
  * @author Kohsuke Kawaguchi
  */
-public final class CElementInfo extends AbstractCTypeInfoImpl
-    implements ElementInfo<NType,NClass>, CElement, CTypeInfo, NType, CClassInfoParent {
+public final class CElementInfo extends AbstractCElement
+    implements ElementInfo<NType,NClass>, NType, CClassInfoParent {
 
     private final QName tagName;
 
@@ -87,14 +85,6 @@
      */
     public final CClassInfoParent parent;
 
-    /**
-     * The location in the source file where this class was declared.
-     */
-    @XmlTransient
-    private final Locator location;
-
-    private boolean isAbstract;
-
     private CElementInfo substitutionHead;
 
     /**
@@ -113,15 +103,14 @@
      * Creates an element in the given parent.
      *
      * <p>
-     * When using this construction, {@link #initContentType(TypeUse, XSComponent, XmlString)}
+     * When using this construction, {@link #initContentType(TypeUse, XSElementDecl, XmlString)}
      * must not be invoked.
      */
-    public CElementInfo(Model model,QName tagName, CClassInfoParent parent, TypeUse contentType, XmlString defaultValue, XSComponent source, CCustomizations customizations, Locator location ) {
-        super(model,source,customizations);
+    public CElementInfo(Model model,QName tagName, CClassInfoParent parent, TypeUse contentType, XmlString defaultValue, XSElementDecl source, CCustomizations customizations, Locator location ) {
+        super(model,source,location,customizations);
         this.tagName = tagName;
         this.model = model;
         this.parent = parent;
-        this.location = location;
         if(contentType!=null)
             initContentType(contentType, source, defaultValue);
 
@@ -133,7 +122,7 @@
      *
      * <p>
      * When using this construction, the caller must use
-     * {@link #initContentType(TypeUse, XSComponent, XmlString)} to fill in the content type
+     * {@link #initContentType(TypeUse, XSElementDecl, XmlString)} to fill in the content type
      * later.
      *
      * This is to avoid a circular model construction dependency between buidling a type
@@ -145,16 +134,16 @@
         this.className = className;
     }
 
-    public void initContentType(TypeUse contentType, XSComponent source, XmlString defaultValue) {
+    public void initContentType(TypeUse contentType, @Nullable XSElementDecl source, XmlString defaultValue) {
         assert this.property==null; // must not be called twice
 
         this.property = new CElementPropertyInfo("Value",
                 contentType.isCollection()?REPEATED_VALUE:NOT_REPEATED,
                 contentType.idUse(),
                 contentType.getExpectedMimeType(),
-                source,null,location,true);
+                source,null,getLocator(),true);
         this.property.setAdapter(contentType.getAdapterUse());
-        property.getTypes().add(new CTypeRef((CNonElement)contentType.getInfo(),tagName,true,defaultValue));
+        property.getTypes().add(new CTypeRef(contentType.getInfo(),tagName,CTypeRef.getSimpleTypeName(source), true,defaultValue));
         this.type = NavigatorImpl.createParameterizedType(
             NavigatorImpl.theInstance.ref(JAXBElement.class),
             getContentInMemoryType() );
@@ -230,14 +219,6 @@
         return b.toString();
     }
 
-    public void setAbstract() {
-        isAbstract = true;
-    }
-
-    public boolean isAbstract() {
-        return isAbstract;
-    }
-
     public CElementInfo getSubstitutionHead() {
         return substitutionHead;
     }
@@ -293,8 +274,4 @@
     public boolean hasClass() {
         return className!=null;
     }
-
-    public Locator getLocator() {
-        return location;
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java
index a9dd6df..fe2f3a2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.AbstractList;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.activation.MimeType;
 import javax.xml.namespace.QName;
@@ -103,6 +103,19 @@
         return ref;
     }
 
+    public QName getSchemaType() {
+        if(types.size()!=1)
+            // if more than one kind is here, can't produce @XmlSchemaType.
+            // TODO: is it allowed to have one generated if types
+            return null;
+
+        CTypeRef t = types.get(0);
+        if(needsExplicitTypeName(t.getTarget(),t.typeName))
+            return t.typeName;
+        else
+            return null;
+    }
+
     /**
      * XJC never uses the wrapper element. Always return null.
      */
@@ -111,6 +124,11 @@
         return null;
     }
 
+    public boolean isCollectionRequired() {
+        // in XJC, we never recognize a nillable collection pattern, so this is always false.
+        return false;
+    }
+
     public boolean isCollectionNillable() {
         // in XJC, we never recognize a nillable collection pattern, so this is always false.
         return false;
@@ -181,4 +199,14 @@
 
         public boolean isRepeated() { return col; }
     }
+
+    @Override
+    public QName collectElementNames(Map<QName, CPropertyInfo> table) {
+        for (CTypeRef t : types) {
+            QName n = t.getTagName();
+            if(table.containsKey(n))    return n;
+            table.put(n, this);
+        }
+        return null;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java
index ea788cd..fb16c02 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.model.nav.NClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
index 0a8d010..5d0ff49 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collection;
@@ -118,7 +117,7 @@
                          Locator _sourceLocator) {
         this.model = model;
         this.parent = container;
-        this.shortName = shortName;
+        this.shortName = model.allocator.assignClassName(parent,shortName);
         this.base = base;
         this.members = _members;
         this.source = source;
@@ -232,15 +231,18 @@
         return null;
     }
 
+    @Deprecated
     public boolean isCollection() {
         return false;
     }
 
+    @Deprecated
     public CAdapter getAdapterUse() {
         return null;
     }
 
-    public CTypeInfo getInfo() {
+    @Deprecated
+    public CNonElement getInfo() {
         return this;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java
index a8856ab..a6471ca 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.model.nav.NClass;
@@ -30,7 +29,30 @@
 import com.sun.xml.internal.bind.v2.model.core.NonElement;
 
 /**
+ * {@link NonElement} at compile-time.
+ *
+ * <p>
+ * This interface implements {@link TypeUse} so that a {@link CNonElement}
+ * instance can be used as a {@link TypeUse} instance.
+ *
  * @author Kohsuke Kawaguchi
  */
-public interface CNonElement extends NonElement<NType,NClass>, CTypeInfo {
+public interface CNonElement extends NonElement<NType,NClass>, TypeUse, CTypeInfo {
+    /**
+     * Guaranteed to return this.
+     */
+    @Deprecated
+    CNonElement getInfo();
+
+    /**
+     * Guaranteed to return false.
+     */
+    @Deprecated
+    boolean isCollection();
+
+    /**
+     * Guaranteed to return null.
+     */
+    @Deprecated
+    CAdapter getAdapterUse();
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java
index 6858f69..b1c505f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.Plugin;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java
index 5577dae..ec2b75f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,14 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collection;
+import java.util.Map;
+import java.lang.annotation.Annotation;
 
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlSchemaType;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
 
@@ -41,12 +43,15 @@
 import com.sun.xml.internal.bind.api.impl.NameConverter;
 import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
 import com.sun.xml.internal.bind.v2.runtime.RuntimeUtil;
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.xsom.XSComponent;
 
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.Locator;
 
 /**
+ * Model of a property to be generated.
+ *
  * @author Kohsuke Kawaguchi
  */
 public abstract class CPropertyInfo implements PropertyInfo<NType,NClass>, CCustomizable {
@@ -91,10 +96,6 @@
     public CDefaultValue defaultValue;
 
     private final CCustomizations customizations;
-    /**
-     * @see #getSchemaType()
-     */
-    public QName schemaType;
 
     protected CPropertyInfo(String name, boolean collection, XSComponent source,
                             CCustomizations customizations, Locator locator) {
@@ -270,10 +271,6 @@
         return customizations;
     }
 
-    public QName getSchemaType() {
-        return schemaType;
-    }
-
     /**
      * @deprecated if you are calling this method directly, there's something wrong.
      */
@@ -282,4 +279,54 @@
     }
 
     public abstract <V> V accept( CPropertyVisitor<V> visitor );
+
+    /**
+     * Checks if the given {@link TypeUse} would need an explicit {@link XmlSchemaType}
+     * annotation with the given type name.
+     */
+    protected static boolean needsExplicitTypeName(TypeUse type, QName typeName) {
+        if(typeName==null)
+            // this is anonymous type. can't have @XmlSchemaType
+            return false;
+
+        if(!typeName.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA))
+            // if we put application-defined type name, it will be undefined
+            // by the time we generate a schema.
+            return false;
+
+        if(type.isCollection())
+            // there's no built-in binding for a list simple type,
+            // so any collection type always need @XmlSchemaType
+            return true;
+
+        QName itemType = type.getInfo().getTypeName();
+        if(itemType==null)
+            // this is somewhat strange case, as it means the bound type is anonymous
+            // but it's eventually derived by a named type and used.
+            // but we can certainly use typeName as @XmlSchemaType value here
+            return true;
+
+        // if it's the default type name for this item, then no need
+        return !itemType.equals(typeName);
+    }
+
+    /**
+     * Puts the element names that this property possesses to the map,
+     * so that we can find two properties that own the same element name,
+     * which is an error.
+     *
+     * @return
+     *      null if no conflict was found. Otherwise return the QName that has the collision.
+     */
+    public QName collectElementNames(Map<QName,CPropertyInfo> table) {
+        return null;
+    }
+
+    public final <A extends Annotation> A readAnnotation(Class<A> annotationType) {
+        throw new UnsupportedOperationException();
+    }
+
+    public final boolean hasAnnotation(Class<? extends Annotation> annotationType) {
+        throw new UnsupportedOperationException();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java
index 8e5c9d6..49b0bb9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
index ae686bc..38973b1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.Map;
 
 import javax.activation.MimeType;
 import javax.xml.bind.annotation.W3CDomHandler;
@@ -187,4 +187,25 @@
         // in XJC, we never recognize a nillable collection pattern, so this is always false.
         return false;
     }
+
+    public boolean isCollectionRequired() {
+        // in XJC, we never recognize a nillable collection pattern, so this is always false.
+        return false;
+    }
+
+    // reference property cannot have a type.
+    public QName getSchemaType() {
+        return null;
+    }
+
+    @Override
+    public QName collectElementNames(Map<QName, CPropertyInfo> table) {
+        for (CElement e : elements) {
+            QName n = e.getElementName();
+            if(table.containsKey(n))
+                return n;
+            table.put(n,this);
+        }
+        return null;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java
index e8bf710..25936bd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,28 +22,49 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collections;
 import java.util.List;
 
 import javax.activation.MimeType;
+import javax.xml.namespace.QName;
 
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.bind.v2.model.core.ID;
 import com.sun.xml.internal.xsom.XSComponent;
 
 import org.xml.sax.Locator;
 
 /**
+ * {@link CPropertyInfo} backed by a single {@link TypeUse}.
+ *
  * @author Kohsuke Kawaguchi
  */
 abstract class CSingleTypePropertyInfo extends CPropertyInfo {
     protected final TypeUse type;
 
-    protected CSingleTypePropertyInfo(String name, TypeUse type, XSComponent source, CCustomizations customizations, Locator locator) {
+    private final QName schemaType;
+
+    /**
+     *
+     * @param typeName
+     *      XML Schema type name of this property's single value. Optional
+     *      for other schema languages. This is used to determine if we should
+     *      generate {@link @XmlSchemaType} annotation to improve the roundtrip.
+     */
+    protected CSingleTypePropertyInfo(String name, TypeUse type, QName typeName, XSComponent source, CCustomizations customizations, Locator locator) {
         super(name, type.isCollection(), source, customizations, locator);
         this.type = type;
+
+        if(needsExplicitTypeName(type,typeName))
+            schemaType = typeName;
+        else
+            schemaType = null;
+    }
+
+    public QName getSchemaType() {
+        return schemaType;
     }
 
     public final ID id() {
@@ -59,7 +80,7 @@
     }
 
     public final CNonElement getTarget() {
-        CNonElement r = (CNonElement)type.getInfo();
+        CNonElement r = type.getInfo();
         assert r!=null;
         return r;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
index ba9dc24..66a1dac 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JClass;
@@ -40,13 +39,9 @@
  * {@link TypeInfo} at the compile-time.
  * Either {@link CClassInfo}, {@link CBuiltinLeafInfo}, or {@link CElementInfo}.
  *
- * <p>
- * This interface implements {@link TypeUse} so that a {@link CTypeInfo}
- * instance can be used as a {@link TypeUse} instance.
- *
  * @author Kohsuke Kawaguchi
  */
-public interface CTypeInfo extends TypeInfo<NType,NClass>, TypeUse, CCustomizable {
+public interface CTypeInfo extends TypeInfo<NType,NClass>, CCustomizable {
 
     /**
      * Returns the {@link JClass} that represents the class being bound,
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java
index a9e7c66..a4e183f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -30,10 +29,13 @@
 
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
 import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
 import com.sun.xml.internal.bind.v2.model.core.TypeRef;
 import com.sun.xml.internal.bind.v2.runtime.RuntimeUtil;
 import com.sun.xml.internal.xsom.XmlString;
+import com.sun.xml.internal.xsom.XSElementDecl;
+import com.sun.istack.internal.Nullable;
 
 /**
  * {@link TypeRef} for XJC.
@@ -53,15 +55,34 @@
 
     private final QName elementName;
 
+    /**
+     * XML Schema type name of {@link #type}, if available.
+     */
+    /*package*/ final @Nullable QName typeName;
+
     private final boolean nillable;
     public final XmlString defaultValue;
 
-    public CTypeRef(CNonElement type, QName elementName, boolean nillable, XmlString defaultValue) {
+    public CTypeRef(CNonElement type, XSElementDecl decl) {
+        this(type, BGMBuilder.getName(decl),getSimpleTypeName(decl), decl.isNillable(), decl.getDefaultValue() );
+
+    }
+
+    public static QName getSimpleTypeName(XSElementDecl decl) {
+        if(decl==null)  return null;
+        QName typeName = null;
+        if(decl.getType().isSimpleType())
+            typeName = BGMBuilder.getName(decl.getType());
+        return typeName;
+    }
+
+    public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue) {
         assert type!=null;
         assert elementName!=null;
 
         this.type = type;
         this.elementName = elementName;
+        this.typeName = typeName;
         this.nillable = nillable;
         this.defaultValue = defaultValue;
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java
index 316225d..105ce65 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
+import javax.xml.namespace.QName;
+
 import com.sun.tools.internal.xjc.model.nav.NClass;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
@@ -39,8 +40,8 @@
  * @author Kohsuke Kawaguchi
  */
 public final class CValuePropertyInfo extends CSingleTypePropertyInfo implements ValuePropertyInfo<NType,NClass> {
-    public CValuePropertyInfo(String name, XSComponent source, CCustomizations customizations, Locator locator, TypeUse type) {
-        super(name, type, source, customizations, locator);
+    public CValuePropertyInfo(String name, XSComponent source, CCustomizations customizations, Locator locator, TypeUse type, QName typeName) {
+        super(name, type, typeName, source, customizations, locator);
     }
 
     public final PropertyKind kind() {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
index 793797f..f5cbf4b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java
index 4fc6936..bf7188a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JPackage;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java
index 1b139a0..a1752d2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Model.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Model.java
index f9d3062..d53d797 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Model.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Model.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import java.util.Collections;
@@ -59,8 +58,11 @@
 import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
 import com.sun.xml.internal.bind.v2.util.FlattenIterator;
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSSchemaSet;
 
 import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
 import org.xml.sax.helpers.LocatorImpl;
 
 /**
@@ -73,7 +75,7 @@
  *
  * @author Kohsuke Kawaguchi
  */
-public final class Model implements TypeInfoSet<NType,NClass,Void,Void> {
+public final class Model implements TypeInfoSet<NType,NClass,Void,Void>, CCustomizable {
 
     /**
      * Generated beans.
@@ -125,11 +127,24 @@
     private boolean packageLevelAnnotations = true;
 
     /**
+     * If this model was built from XML Schema, this field
+     * stores the root object of the parse schema model.
+     * Otherwise null.
+     *
+     * @sine 2.1.1
+     */
+    public final XSSchemaSet schemaComponent;
+
+    private CCustomizations gloablCustomizations = new CCustomizations();
+
+    /**
      * @param nc
      *      Usually this should be set in the constructor, but we do allow this parameter
      *      to be initially null, and then set later.
+     * @param schemaComponent
+     *      The source schema model, if this is built from XSD.
      */
-    public Model( Options opts, JCodeModel cm, NameConverter nc, ClassNameAllocator allocator ) {
+    public Model( Options opts, JCodeModel cm, NameConverter nc, ClassNameAllocator allocator, XSSchemaSet schemaComponent ) {
         this.options = opts;
         this.codeModel = cm;
         this.nameConverter = nc;
@@ -138,7 +153,11 @@
 
         elementMappings.put(null,new HashMap<QName,CElementInfo>());
 
+        if(opts.automaticNameConflictResolution)
+            allocator = new AutoClassNameAllocator(allocator);
         this.allocator = new ClassNameAllocatorWrapper(allocator);
+        this.schemaComponent = schemaComponent;
+        this.gloablCustomizations.setParent(this,this);
     }
 
     public void setNameConverter(NameConverter nameConverter) {
@@ -254,9 +273,13 @@
 
         Outline o = BeanGenerator.generate(this, ehf);
 
-        // run extensions
-        for( Plugin ma : opt.activePlugins )
-            ma.run(o,opt,ehf);
+        try {// run extensions
+            for( Plugin ma : opt.activePlugins )
+                ma.run(o,opt,ehf);
+        } catch (SAXException e) {
+            // fatal error. error should have been reported
+            return null;
+        }
 
         // check for unused plug-in customizations.
         // these can be only checked after the plug-ins run, so it's here.
@@ -378,12 +401,42 @@
     }
 
     /**
+     * @deprecated
+     *      Always return null. Perhaps you are interested in {@link #schemaComponent}?
+     */
+    public XSComponent getSchemaComponent() {
+        return null;
+    }
+
+    /**
+     * @deprecated
+     *      No line number available for the "root" component.
+     */
+    public Locator getLocator() {
+        LocatorImpl r = new LocatorImpl();
+        r.setLineNumber(-1);
+        r.setColumnNumber(-1);
+        return r;
+    }
+
+    /**
+     * Gets the global customizations.
+     */
+    public CCustomizations getCustomizations() {
+        return gloablCustomizations;
+    }
+
+    /**
      * Not implemented in the compile-time model.
      */
     public Map<String, String> getXmlNs(String namespaceUri) {
         return Collections.emptyMap();
     }
 
+    public Map<String, String> getSchemaLocations() {
+        return Collections.emptyMap();
+    }
+
     public XmlNsForm getElementFormDefault(String nsUri) {
         throw new UnsupportedOperationException();
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java
index 4cdbd4b..f106881 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java
index 16a3572..62b8a14 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.tools.internal.xjc.outline.Outline;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java
index 40f41c2..b5eb7f8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import com.sun.codemodel.internal.JCodeModel;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java
index 9fae4ac..fa224d4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.activation.MimeType;
 
-import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.JExpression;
 import com.sun.tools.internal.xjc.model.nav.NType;
 import com.sun.tools.internal.xjc.outline.Outline;
@@ -59,7 +57,7 @@
     /**
      * Individual item type.
      */
-    CTypeInfo getInfo();
+    CNonElement getInfo();
 
     /**
      * Whether the referenced type (individual item type in case of collection)
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java
index 72b1c02..4f414bb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.activation.MimeType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java
index 6e95644..9b034b3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model;
 
 import javax.activation.MimeType;
@@ -43,14 +42,14 @@
  * @author Kohsuke Kawaguchi
  */
 final class TypeUseImpl implements TypeUse {
-    private final CTypeInfo coreType;
+    private final CNonElement coreType;
     private final boolean collection;
     private final CAdapter adapter;
     private final ID id;
     private final MimeType expectedMimeType;
 
 
-    public TypeUseImpl(CTypeInfo itemType, boolean collection, ID id, MimeType expectedMimeType, CAdapter adapter) {
+    public TypeUseImpl(CNonElement itemType, boolean collection, ID id, MimeType expectedMimeType, CAdapter adapter) {
         this.coreType = itemType;
         this.collection = collection;
         this.id = id;
@@ -62,7 +61,7 @@
         return collection;
     }
 
-    public CTypeInfo getInfo() {
+    public CNonElement getInfo() {
         return coreType;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
index 0603f4e..8ccdba7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import java.lang.reflect.Modifier;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
index 2ad35ea..40f5ac1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
index 30cfff6..e8076ce 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
index 65cb951..88f41e6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
index 1ba875c..798b9a4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
index 095d242..8f5d459 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import com.sun.codemodel.internal.JType;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java
index b968b7d..2361d12 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.model.nav;
 
 import java.lang.reflect.Type;
@@ -308,7 +307,7 @@
         throw new UnsupportedOperationException();
     }
 
-    public boolean isOverriding(Void method) {
+    public boolean isOverriding(Void method,NClass clazz) {
         throw new UnsupportedOperationException();
     }
 
@@ -319,4 +318,8 @@
     public boolean isTransient(Void f) {
         throw new UnsupportedOperationException();
     }
+
+    public boolean isInnerClass(NClass clazz) {
+        throw new UnsupportedOperationException();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/package.html
index 8812e8e..fff7cc5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   <p>
     Compile-time representation of Java type system.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java
index 87be018..ba5a17b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * Implementation of the {@link com.sun.xml.internal.bind.v2.model.core} package for XJC.
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
index a257a3a..533cb0c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java
index ac93ebf..48dafb4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /*
  * Use is subject to the license terms.
  */
@@ -34,6 +33,7 @@
 import com.sun.codemodel.internal.JDefinedClass;
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
+import com.sun.istack.internal.NotNull;
 
 /**
  * Outline object that provides per-{@link CClassInfo} information
@@ -48,19 +48,19 @@
     /**
      * A {@link Outline} that encloses all the class outlines.
      */
-    public abstract Outline parent();
+    public abstract @NotNull Outline parent();
 
     /**
      * {@link PackageOutline} that contains this class.
      */
-    public PackageOutline _package() {
+    public @NotNull PackageOutline _package() {
         return parent().getPackageContext(ref._package());
     }
 
     /**
      * This {@link ClassOutline} holds information about this {@link CClassInfo}.
      */
-    public final CClassInfo target;
+    public final @NotNull CClassInfo target;
 
     /**
      * The exposed aspect of the a bean.
@@ -70,13 +70,13 @@
      * Usually this is the public content interface, but
      * it could be the same as the implClass.
      */
-    public final JDefinedClass ref;
+    public final @NotNull JDefinedClass ref;
 
     /**
      * The implementation aspect of a bean.
      * The actual place where fields/methods should be generated into.
      */
-    public final JDefinedClass implClass;
+    public final @NotNull JDefinedClass implClass;
 
     /**
      * The implementation class that shall be used for reference.
@@ -87,7 +87,7 @@
      * <p>
      * This is the type that needs to be used for generating fields.
      */
-    public final JClass implRef;
+    public final @NotNull JClass implRef;
 
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java
index c2c95d3..c0e489f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import com.sun.codemodel.internal.JDefinedClass;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java
index bdc52c4..4bc3df8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import com.sun.codemodel.internal.JEnumConstant;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java
index 4224294..76e0221 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import java.util.ArrayList;
@@ -30,6 +29,7 @@
 
 import com.sun.codemodel.internal.JDefinedClass;
 import com.sun.tools.internal.xjc.model.CEnumLeafInfo;
+import com.sun.istack.internal.NotNull;
 
 /**
  * Outline object that provides per-{@link CEnumLeafInfo} information
@@ -56,6 +56,19 @@
      */
     public final List<EnumConstantOutline> constants = new ArrayList<EnumConstantOutline>();
 
+    /**
+     * {@link PackageOutline} that contains this class.
+     */
+    public @NotNull
+    PackageOutline _package() {
+        return parent().getPackageContext(clazz._package());
+    }
+
+    /**
+     * A {@link Outline} that encloses all the class outlines.
+     */
+    public abstract @NotNull Outline parent();
+
     protected EnumOutline(CEnumLeafInfo target, JDefinedClass clazz) {
         this.target = target;
         this.clazz = clazz;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java
index db24049..76528e5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import com.sun.codemodel.internal.JBlock;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java
index d326d96..8f2db6d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import com.sun.codemodel.internal.JExpression;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
index 7145bb6..eeda0ab 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java
index 1dfd4d3..78ae6d6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.outline;
 
 import java.util.Set;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/package.html
index 0f20e33..c0df678 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Provides the outline of the generated Java source code so that
   additional processings (such as adding more annotations) can be
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/package-info.java
index 04dbd8b..8812988 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * <h1>Schema to Java compiler</h1>.
  *
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/AbstractExtensionBindingChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/AbstractExtensionBindingChecker.java
new file mode 100644
index 0000000..4fd4a8a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/AbstractExtensionBindingChecker.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.reader;
+
+import java.util.Set;
+import java.util.HashSet;
+
+import com.sun.tools.internal.xjc.util.SubtreeCutter;
+import com.sun.tools.internal.xjc.Options;
+import com.sun.tools.internal.xjc.Plugin;
+import com.sun.xml.internal.bind.v2.util.EditDistance;
+
+import org.xml.sax.helpers.NamespaceSupport;
+import org.xml.sax.Locator;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.SAXException;
+
+/**
+ * Common code between {@code DTDExtensionBindingChecker} and {@link ExtensionBindingChecker}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractExtensionBindingChecker extends SubtreeCutter {
+    /** Remembers in-scope namespace bindings. */
+    protected final NamespaceSupport nsSupport = new NamespaceSupport();
+
+    /**
+     * Set of namespace URIs that designates enabled extensions.
+     */
+    protected final Set<String> enabledExtensions = new HashSet<String>();
+
+    private final Set<String> recognizableExtensions = new HashSet<String>();
+
+    private Locator locator;
+
+    /**
+     * Namespace URI of the target schema language. Elements in this
+     * namespace are always allowed.
+     */
+    protected final String schemaLanguage;
+
+    /**
+     * If false, any use of extensions is reported as an error.
+     */
+    protected final boolean allowExtensions;
+
+    private final Options options;
+
+    /**
+     * @param handler
+     *      This error handler will receive detected errors.
+     */
+    public AbstractExtensionBindingChecker( String schemaLanguage, Options options, ErrorHandler handler ) {
+        this.schemaLanguage = schemaLanguage;
+        this.allowExtensions = options.compatibilityMode!=Options.STRICT;
+        this.options = options;
+        setErrorHandler(handler);
+
+        for (Plugin plugin : options.getAllPlugins())
+            recognizableExtensions.addAll(plugin.getCustomizationURIs());
+        recognizableExtensions.add(Const.XJC_EXTENSION_URI);
+    }
+
+    /**
+     * Verify that the given URI is indeed a valid extension namespace URI,
+     * and if so enable it.
+     * <p>
+     * This method does all the error handling.
+     */
+    protected final void checkAndEnable(String uri) throws SAXException {
+        if( !isRecognizableExtension(uri) ) {
+            String nearest = EditDistance.findNearest(uri, recognizableExtensions);
+            // not the namespace URI we know of
+            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri,nearest) );
+        } else
+        if( !isSupportedExtension(uri) ) {
+            // recognizable but not not supported, meaning
+            // the plug-in isn't enabled
+
+            // look for plug-in that handles this URI
+            Plugin owner = null;
+            for( Plugin p : options.getAllPlugins() ) {
+                if(p.getCustomizationURIs().contains(uri)) {
+                    owner = p;
+                    break;
+                }
+            }
+            if(owner!=null)
+                // we know the plug-in that supports this namespace, but it's not enabled
+                error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
+            else {
+                // this shouldn't happen, but be defensive...
+                error( Messages.ERR_UNSUPPORTED_EXTENSION.format(uri) );
+            }
+        }
+
+        // as an error recovery enable this namespace URI anyway.
+        enabledExtensions.add(uri);
+    }
+
+    /**
+     * If the tag name belongs to a plugin namespace-wise, check its local name
+     * to make sure it's correct.
+     */
+    protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException {
+        if(options.pluginURIs.contains(namespaceURI)) {
+            // make sure that this is a valid tag name
+            boolean correct = false;
+            for( Plugin p : options.activePlugins ) {
+                if(p.isCustomizationTagName(namespaceURI,localName)) {
+                    correct = true;
+                    break;
+                }
+            }
+            if(!correct) {
+                error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) );
+                startCutting();
+            }
+        }
+    }
+
+    /**
+     * Checks if the given namespace URI is supported as the extension
+     * bindings.
+     */
+    protected final boolean isSupportedExtension( String namespaceUri ) {
+        return namespaceUri.equals(Const.XJC_EXTENSION_URI) || options.pluginURIs.contains(namespaceUri);
+    }
+
+    /**
+     * Checks if the given namespace URI can be potentially recognized
+     * by this XJC.
+     */
+    protected final boolean isRecognizableExtension( String namespaceUri ) {
+        return recognizableExtensions.contains(namespaceUri);
+    }
+
+
+    public void setDocumentLocator(Locator locator) {
+        super.setDocumentLocator(locator);
+        this.locator = locator;
+    }
+
+    public void startDocument() throws SAXException {
+        super.startDocument();
+
+        nsSupport.reset();
+        enabledExtensions.clear();
+    }
+
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        super.startPrefixMapping(prefix, uri);
+        nsSupport.pushContext();
+        nsSupport.declarePrefix(prefix,uri);
+    }
+
+    public void endPrefixMapping(String prefix) throws SAXException {
+        super.endPrefixMapping(prefix);
+        nsSupport.popContext();
+    }
+
+
+    /**
+     * Reports an error and returns the created SAXParseException
+     */
+    protected final SAXParseException error( String msg ) throws SAXException {
+        SAXParseException spe = new SAXParseException( msg, locator );
+        getErrorHandler().error(spe);
+        return spe;
+    }
+
+    /**
+     * Reports a warning.
+     */
+    protected final void warning( String msg ) throws SAXException {
+        SAXParseException spe = new SAXParseException( msg, locator );
+        getErrorHandler().warning(spe);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java
index dc0e83f..ed934cf 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java
index 1cbaac4..4a9eccb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,25 +22,16 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
-import java.util.HashSet;
-import java.util.Set;
 import java.util.StringTokenizer;
 
 import com.sun.tools.internal.xjc.Options;
 import com.sun.tools.internal.xjc.Plugin;
 
 import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
 import org.xml.sax.ErrorHandler;
-import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.NamespaceSupport;
-import org.xml.sax.helpers.XMLFilterImpl;
 
 /**
  * This filter checks jaxb:extensionBindingPrefix and
@@ -61,93 +52,18 @@
  * that the RI recognizes.
  * To add new URI, modify the isSupportedExtension method.
  *
-
  * @author
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
-public final class ExtensionBindingChecker extends XMLFilterImpl {
-
-    /** Remembers in-scope namespace bindings. */
-    private final NamespaceSupport nsSupport = new NamespaceSupport();
+public final class ExtensionBindingChecker extends AbstractExtensionBindingChecker {
 
     /**
      * Number of the elements encountered. Used to detect the root element.
      */
     private int count=0;
 
-    /**
-     * Set of namespace URIs that designates enabled extensions.
-     */
-    private final Set<String> enabledExtensions = new HashSet<String>();
-
-    private final Set<String> recognizableExtensions = new HashSet<String>();
-
-    private Locator locator;
-
-    /**
-     * When we are pruning a sub tree, this field holds the depth of
-     * elements that are being cut. Used to resume event forwarding.
-     *
-     * As long as this value is 0, we will pass through data.
-     */
-    private int cutDepth=0;
-
-    /**
-     * This object will receive SAX events while a sub tree is being
-     * pruned.
-     */
-    private static final ContentHandler stub = new DefaultHandler();
-
-    /**
-     * This field remembers the user-specified ContentHandler.
-     * So that we can restore it once the sub tree is completely pruned.
-     */
-    private ContentHandler next;
-
-    /**
-     * Namespace URI of the target schema language. Elements in this
-     * namespace are always allowed.
-     */
-    private final String schemaLanguage;
-
-    /**
-     * If false, any use of extensions is reported as an error.
-     */
-    private final boolean allowExtensions;
-
-    private final Options options;
-
-    /**
-     * @param handler
-     *      This error handler will receive detected errors.
-     */
-    public ExtensionBindingChecker( String schemaLanguage, Options options, ErrorHandler handler ) {
-        this.schemaLanguage = schemaLanguage;
-        this.allowExtensions = options.compatibilityMode!=Options.STRICT;
-        this.options = options;
-        setErrorHandler(handler);
-
-        for (Plugin plugin : options.getAllPlugins())
-            recognizableExtensions.addAll(plugin.getCustomizationURIs());
-        recognizableExtensions.add(Const.XJC_EXTENSION_URI);
-    }
-
-    /**
-     * Checks if the given namespace URI is supported as the extension
-     * bindings.
-     */
-    private boolean isSupportedExtension( String namespaceUri ) {
-        if(namespaceUri.equals(Const.XJC_EXTENSION_URI))
-            return true;
-        return options.pluginURIs.contains(namespaceUri);
-    }
-
-    /**
-     * Checks if the given namespace URI can be potentially recognized
-     * by this XJC.
-     */
-    private boolean isRecognizableExtension( String namespaceUri ) {
-        return recognizableExtensions.contains(namespaceUri);
+    public ExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler) {
+        super(schemaLanguage, options, handler);
     }
 
     /**
@@ -170,31 +86,15 @@
     }
 
 
-
     public void startDocument() throws SAXException {
         super.startDocument();
-
         count=0;
-        cutDepth=0;
-        nsSupport.reset();
-        enabledExtensions.clear();
-    }
-
-    public void startPrefixMapping(String prefix, String uri) throws SAXException {
-        super.startPrefixMapping(prefix, uri);
-        nsSupport.pushContext();
-        nsSupport.declarePrefix(prefix,uri);
-    }
-
-    public void endPrefixMapping(String prefix) throws SAXException {
-        super.endPrefixMapping(prefix);
-        nsSupport.popContext();
     }
 
     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
         throws SAXException {
 
-        if( cutDepth==0 ) {
+        if(!isCutting()) {
             String v = atts.getValue(Const.JAXB_NSURI,"extensionBindingPrefixes");
             if(v!=null) {
                 if(count!=0)
@@ -209,38 +109,11 @@
                 while(tokens.hasMoreTokens()) {
                     String prefix = tokens.nextToken();
                     String uri = nsSupport.getURI(prefix);
-                    if( uri==null ) {
+                    if( uri==null )
                         // undeclared prefix
                         error( Messages.ERR_UNDECLARED_PREFIX.format(prefix) );
-                    } else {
-                        if( !isRecognizableExtension(uri) )
-                            // not the namespace URI we know of
-                            error( Messages.ERR_UNSUPPORTED_EXTENSION.format(prefix) );
-                        else
-                        if( !isSupportedExtension(uri) ) {
-                            // recognizable but not not supported, meaning
-                            // the plug-in isn't enabled
-
-                            // look for plug-in that handles this URI
-                            Plugin owner = null;
-                            for( Plugin p : options.getAllPlugins() ) {
-                                if(p.getCustomizationURIs().contains(uri)) {
-                                    owner = p;
-                                    break;
-                                }
-                            }
-                            if(owner!=null)
-                                // we know the plug-in that supports this namespace, but it's not enabled
-                                error( Messages.ERR_PLUGIN_NOT_ENABLED.format(owner.getOptionName(),uri));
-                            else {
-                                // this shouldn't happen, but be defensive...
-                                error( Messages.ERR_UNSUPPORTED_EXTENSION.format(prefix) );
-                            }
-                        }
-
-                        // as an error recovery enable this namespace URI anyway.
-                        enabledExtensions.add(uri);
-                    }
+                    else
+                        checkAndEnable(uri);
                 }
             }
 
@@ -251,71 +124,12 @@
                     // isn't the user forgetting @jaxb:extensionBindingPrefixes?
                     warning( Messages.ERR_SUPPORTED_EXTENSION_IGNORED.format(namespaceURI) );
                 }
-                super.setContentHandler(stub);
-                cutDepth=1;
-            }
-            else
-            if(options.pluginURIs.contains(namespaceURI)) {
-                // make sure that this is a valid tag name
-                boolean correct = false;
-                for( Plugin p : options.activePlugins ) {
-                    if(p.isCustomizationTagName(namespaceURI,localName)) {
-                        correct = true;
-                        break;
-                    }
-                }
-                if(!correct) {
-                    error( Messages.ERR_ILLEGAL_CUSTOMIZATION_TAGNAME.format(qName) );
-                    super.setContentHandler(stub);
-                    cutDepth=1;
-                }
-            }
-        } else
-            cutDepth++;
+                startCutting();
+            } else
+                verifyTagName(namespaceURI, localName, qName);
+        }
 
         count++;
         super.startElement(namespaceURI, localName, qName, atts);
     }
-
-    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
-        super.endElement(namespaceURI, localName, qName);
-
-        if( cutDepth!=0 ) {
-            cutDepth--;
-            if( cutDepth == 0 )
-                // pruning completed. restore the user handler
-                super.setContentHandler(next);
-        }
-    }
-
-    public void setDocumentLocator(Locator locator) {
-        super.setDocumentLocator(locator);
-        this.locator = locator;
-    }
-
-    public void setContentHandler(ContentHandler handler) {
-        next = handler;
-        // changes take effect immediately unless the sub-tree is being pruned
-        if(getContentHandler()!=stub)
-            super.setContentHandler(handler);
-    }
-
-
-    /**
-     * Reports an error and returns the created SAXParseException
-     */
-    private SAXParseException error( String msg ) throws SAXException {
-        SAXParseException spe = new SAXParseException( msg, locator );
-        getErrorHandler().error(spe);
-        return spe;
-    }
-
-    /**
-     * Reports a warning.
-     */
-    private void warning( String msg ) throws SAXException {
-        SAXParseException spe = new SAXParseException( msg, locator );
-        getErrorHandler().warning(spe);
-    }
-
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties
index 97907cf..33f28c4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
@@ -14,7 +39,7 @@
     vendor extension bindings (jaxb:extensionBindingPrefixes) are not allowed in the strict mode. Use -extension.
 
 ERR_UNSUPPORTED_EXTENSION = \
-	Unsupported binding namespace "{0}"
+	Unsupported binding namespace "{0}". Perhaps you meant "{1}"?
 
 ERR_SUPPORTED_EXTENSION_IGNORED = \
 	Binding declaration namespace "{0}" will be ignored because it is \
@@ -30,7 +55,10 @@
 	Make this class available via the -classpath option.
 	
 DUPLICATE_PROPERTY = \
-    Property "{0}" is already defined.
+    Property "{0}" is already defined. Use &lt;jaxb:property> to resolve this conflict.
+
+DUPLICATE_ELEMENT = \
+    Element "{0}" shows up in more than one properties.
 
 DUPLICATE_PROPERTY_LOC = \
     (related to above error) another definition is given here.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Messages.java
index a79954f..6242882 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
  * have any questions.
  */
 
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.text.MessageFormat;
@@ -32,8 +31,9 @@
 /**
  * Formats error messages.
  */
-enum Messages {
+public enum Messages {
     DUPLICATE_PROPERTY, // 1 arg
+    DUPLICATE_ELEMENT, // 1 arg
 
     ERR_UNDECLARED_PREFIX,
     ERR_UNEXPECTED_EXTENSION_BINDING_PREFIXES,
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java
index fafd9c5..be36dde 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
 
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.model.CClassInfo;
@@ -54,6 +57,7 @@
 
     private void check( CClassInfo ci ) {
         List<CPropertyInfo> props = ci.getProperties();
+        Map<QName,CPropertyInfo> collisionTable = new HashMap<QName,CPropertyInfo>();
 
         OUTER:
         for( int i=0; i<props.size(); i++ ) {
@@ -64,6 +68,13 @@
                 continue;
             }
 
+            QName n = p1.collectElementNames(collisionTable);
+            if(n!=null) {
+                CPropertyInfo p2 = collisionTable.get(n);
+                errorReceiver.error(p1.locator,Messages.DUPLICATE_ELEMENT.format(n));
+                errorReceiver.error(p2.locator,Messages.ERR_RELEVANT_LOCATION.format());
+            }
+
             for( int j=i+1; j<props.size(); j++ ) {
                 if(checkPropertyCollision(p1,props.get(j)))
                     continue OUTER;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java
index a0a8154..6e7e4c1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.util.HashSet;
@@ -30,32 +29,15 @@
 import java.util.Set;
 
 import javax.activation.MimeType;
-import javax.xml.namespace.QName;
 
-import com.sun.tools.internal.xjc.model.CClassInfo;
-import com.sun.tools.internal.xjc.model.CCustomizations;
-import com.sun.tools.internal.xjc.model.CElementInfo;
 import com.sun.tools.internal.xjc.model.CElementPropertyInfo;
 import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.*;
-import com.sun.tools.internal.xjc.model.CNonElement;
 import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
 import com.sun.tools.internal.xjc.model.CTypeRef;
-import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.model.Multiplicity;
-import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.model.nav.NType;
-import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
-import com.sun.tools.internal.xjc.reader.xmlschema.ClassSelector;
-import com.sun.tools.internal.xjc.reader.xmlschema.SimpleTypeBuilder;
-import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
 import com.sun.xml.internal.bind.v2.model.core.Element;
 import com.sun.xml.internal.bind.v2.model.core.ID;
-import com.sun.xml.internal.xsom.XSComponent;
-import com.sun.xml.internal.xsom.XSElementDecl;
-import com.sun.xml.internal.xsom.XSType;
-import com.sun.xml.internal.xsom.XmlString;
-
-import org.xml.sax.Locator;
 
 /**
  * Set of {@link Ref}.
@@ -240,109 +222,4 @@
          */
         protected MimeType getExpectedMimeType() { return null; }
     }
-
-    /**
-     * References to a type. Could be global or local.
-     */
-    public static final class XmlTypeRef extends Ref {
-        public final QName elementName;
-        public final TypeUse target;
-        public final Locator locator;
-        public final XSComponent source;
-        public final CCustomizations custs;
-        public final boolean nillable;
-        public final XmlString defaultValue;
-
-        public XmlTypeRef(QName elementName, TypeUse target, boolean nillable, XmlString defaultValue, XSComponent source, CCustomizations custs, Locator loc) {
-            assert elementName!=null;
-            assert target!=null;
-
-            this.elementName = elementName;
-            this.target = target;
-            this.source = source;
-            this.custs = custs;
-            this.nillable = nillable;
-            this.defaultValue = defaultValue;
-            this.locator = loc;
-        }
-
-        public XmlTypeRef(QName elementName, XSType target, boolean nillable, XmlString defaultValue) {
-            this(elementName,Ring.get(ClassSelector.class).bindToType(target), nillable, defaultValue, target,
-                    Ring.get(BGMBuilder.class).getBindInfo(target).toCustomizationList(),
-                    target.getLocator());
-        }
-
-        public XmlTypeRef(XSElementDecl decl) {
-            this(new QName(decl.getTargetNamespace(),decl.getName()),bindToType(decl),
-                    decl.isNillable(), decl.getDefaultValue(), decl,
-                    Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(),
-                    decl.getLocator());
-        }
-
-        protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
-            if(ep!=null && target.getAdapterUse()!=null)
-                ep.setAdapter(target.getAdapterUse());
-            return new CTypeRef((CNonElement)target.getInfo(),elementName,nillable,defaultValue);
-        }
-
-        /**
-         * The whole type set can be later bound to a reference property,
-         * in which case we need to generate additional code to wrap this
-         * type reference into an element class.
-         *
-         * This method generates such an element class and returns it.
-         */
-        protected void toElementRef(CReferencePropertyInfo prop) {
-            CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
-            Model model = Ring.get(Model.class);
-
-            if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) {
-                CClassInfo bean = new CClassInfo(model,scope,
-                                model.getNameConverter().toClassName(elementName.getLocalPart()),
-                                locator,null,elementName,source,custs);
-                bean.setBaseClass((CClassInfo)target);
-                prop.getElements().add(bean);
-            } else {
-                CElementInfo e = new CElementInfo(model,elementName,scope,target,defaultValue,source,custs,locator);
-                prop.getElements().add(e);
-            }
-        }
-
-        protected Mode canBeType(RawTypeSet parent) {
-            // if we have an adapter or IDness, which requires special
-            // annotation, and there's more than one element,
-            // we have no place to put the special annotation, so we need JAXBElement.
-            if(parent.refs.size()>1 || !parent.mul.isAtMostOnce()) {
-                if(target.getAdapterUse()!=null || target.idUse()!=ID.NONE)
-                    return Mode.MUST_BE_REFERENCE;
-            }
-
-            // nillable and optional at the same time. needs an element wrapper to distinguish those
-            // two states. But this is not a hard requirement.
-            if(nillable && parent.mul.isOptional())
-                return Mode.CAN_BE_TYPEREF;
-
-            return Mode.SHOULD_BE_TYPEREF;
-        }
-
-        protected boolean isListOfValues() {
-            return target.isCollection();
-        }
-
-        protected ID id() {
-            return target.idUse();
-        }
-
-        protected MimeType getExpectedMimeType() {
-            return target.getExpectedMimeType();
-        }
-    }
-
-    private static TypeUse bindToType(XSElementDecl decl) {
-        SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
-        stb.refererStack.push(decl);
-        TypeUse r = Ring.get(ClassSelector.class).bindToType(decl.getType());
-        stb.refererStack.pop();
-        return r;
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java
index cdeedee..faff888 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.lang.reflect.Constructor;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java
index 5643aa4..e1cc9da 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Util.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Util.java
index cb4b814..82ef7b1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Util.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java
index e4c66f1..68ae2e5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.util.LinkedHashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java
index 676549a..d4b631e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.util.ArrayList;
@@ -35,7 +34,7 @@
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CElementPropertyInfo;
-import com.sun.tools.internal.xjc.model.CNonElement;
+import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.*;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
 import com.sun.tools.internal.xjc.model.CTypeRef;
@@ -49,10 +48,6 @@
 
 import org.xml.sax.Locator;
 
-import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.NOT_REPEATED;
-import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.REPEATED_VALUE;
-import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMode.REPEATED_ELEMENT;
-
 /**
  * DTD Element.
  *
@@ -238,7 +233,7 @@
 
             if(ci!=null) {
                 // if this element is mapped to a class, just put one property
-                CValuePropertyInfo p = new CValuePropertyInfo("value", null,null/*TODO*/,locator,getConversion());
+                CValuePropertyInfo p = new CValuePropertyInfo("value", null,null/*TODO*/,locator,getConversion(),null);
                 ci.addProperty(p);
             }
             return;
@@ -288,7 +283,7 @@
                 for( Element e : b.elements ) {
                     CClassInfo child = owner.getOrCreateElement(e.name).getClassInfo();
                     assert child!=null; // we are requiring them to be classes.
-                    p.getTypes().add(new CTypeRef(child,new QName("",e.name),false,null));
+                    p.getTypes().add(new CTypeRef(child,new QName("",e.name),null,false,null));
                 }
             } else {
                 // single property
@@ -306,7 +301,7 @@
                 p = new CElementPropertyInfo(propName,
                     refType.isCollection()?REPEATED_VALUE:NOT_REPEATED, ID.NONE, null, null,null/*TODO*/, locator, !b.isOptional );
 
-                p.getTypes().add(new CTypeRef((CNonElement)refType.getInfo(),new QName("",name),false,null));
+                p.getTypes().add(new CTypeRef(refType.getInfo(),new QName("",name),null,false,null));
             }
             ci.addProperty(p);
         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties
index f0e9960..237fb9f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 TDTDReader.NoRootElement = \
 	No root element was specified.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java
index 93aae3c..8410a43 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java
index 1f83d88..587eeb0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java
index 41924a3..72a37c11 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java
index 0829ba3..57b1825 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.io.IOException;
@@ -101,14 +100,13 @@
                 ErrorReceiverFilter ef = new ErrorReceiverFilter(errorReceiver);
 
                 JCodeModel cm = new JCodeModel();
-                Model model = new Model(opts,cm,NameConverter.standard,opts.classNameAllocator);
+                Model model = new Model(opts,cm,NameConverter.standard,opts.classNameAllocator,null);
 
                 Ring.add(cm);
                 Ring.add(model);
                 Ring.add(ErrorReceiver.class,ef);
 
-                TDTDReader reader = new TDTDReader( ef, opts.entityResolver,
-                    opts, bindingInfo);
+                TDTDReader reader = new TDTDReader( ef, opts, bindingInfo);
 
                 DTDParser parser = new DTDParser();
                 parser.setDtdHandler(reader);
@@ -139,19 +137,16 @@
             return null;
         }
     }
-    protected TDTDReader(ErrorReceiver errorReceiver, EntityResolver entityResolver, Options opts, InputSource _bindInfo)
+    protected TDTDReader(ErrorReceiver errorReceiver, Options opts, InputSource _bindInfo)
         throws AbortException {
-        this.entityResolver = entityResolver;
+        this.entityResolver = opts.entityResolver;
         this.errorReceiver = new ErrorReceiverFilter(errorReceiver);
-        this.opts = opts;
         bindInfo = new BindInfo(model,_bindInfo, this.errorReceiver);
         classFactory = new CodeModelClassFactory(errorReceiver);
     }
 
     private final EntityResolver entityResolver;
 
-    private final Options opts;
-
     /**
      * binding information.
      *
@@ -161,8 +156,6 @@
      */
     final BindInfo bindInfo;
 
-    private final JCodeModel codeModel = Ring.get(JCodeModel.class);
-
     final Model model = Ring.get(Model.class);
 
     private final CodeModelClassFactory classFactory;
@@ -194,6 +187,8 @@
 
         // check XJC extensions and realize them
         model.serialVersionUID = bindInfo.getSerialVersionUID();
+        if(model.serialVersionUID!=null)
+            model.serializable=true;
         model.rootClass = bindInfo.getSuperClass();
         model.rootInterface = bindInfo.getSuperInterface();
 
@@ -217,7 +212,7 @@
 
         for( BIInterface decl : bindInfo.interfaces() ) {
             final JDefinedClass intf = classFactory.createInterface(
-                                getTargetPackage(), decl.name(), copyLocator() );
+                                bindInfo.getTargetPackage(), decl.name(), copyLocator() );
             decls.put(decl,intf);
             fromName.put(decl.name(),new InterfaceAcceptor() {
                 public void implement(JClass c) {
@@ -264,11 +259,7 @@
 
 
     JPackage getTargetPackage() {
-        // "-p" takes precedence over everything else
-        if(opts.defaultPackage!=null)
-            return codeModel._package(opts.defaultPackage);
-        else
-            return bindInfo.getTargetPackage();
+        return bindInfo.getTargetPackage();
     }
 
 
@@ -331,7 +322,7 @@
             use = builtinConversions.get(attributeType);
 
         CPropertyInfo r = new CAttributePropertyInfo(
-            propName, null,null/*TODO*/, copyLocator(), qname, use, required );
+            propName, null,null/*TODO*/, copyLocator(), qname, use, null, required );
 
         if(defaultValue!=null)
             r.defaultValue = CDefaultValue.create( use, new XmlString(defaultValue) );
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java
index 975a9f5..8f114f4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java
index a47c727..22fe1cc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java
index a04d707..60a0f5a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
@@ -83,7 +82,7 @@
 
     /** Gets the location where this declaration is declared. */
     public Locator getSourceLocation() {
-        return DOM4JLocator.getLocationInfo(dom);
+        return DOMLocator.getLocationInfo(dom);
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java
index f1529a0..87d0db8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java
index a66e71a..0106757 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import com.sun.tools.internal.xjc.model.TypeUse;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java
index ea695d9..231526b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
@@ -115,7 +114,7 @@
      * Gets the source location where this element is declared.
      */
     public Locator getLocation() {
-        return DOM4JLocator.getLocationInfo(e);
+        return DOMLocator.getLocationInfo(e);
     }
 
 
@@ -268,6 +267,6 @@
 
     /** Gets the location where this declaration is declared. */
     public Locator getSourceLocation() {
-        return DOM4JLocator.getLocationInfo(e);
+        return DOMLocator.getLocationInfo(e);
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java
index 3b9382a..37b1af5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
@@ -75,7 +74,7 @@
                 CBuiltinLeafInfo.STRING,
                 buildMemberList(parent.model,dom),
                 null, null/*TODO*/,
-                DOM4JLocator.getLocationInfo(dom)));
+                DOMLocator.getLocationInfo(dom)));
     }
 
     /** Creates an element-local enumeration declaration. */
@@ -91,7 +90,7 @@
                 CBuiltinLeafInfo.STRING,
                 buildMemberList(parent.parent.model,dom),
                 null, null/*TODO*/,
-                DOM4JLocator.getLocationInfo(dom) ));
+                DOMLocator.getLocationInfo(dom) ));
     }
 
     private static List<CEnumConstant> buildMemberList( Model model, Element dom ) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java
index 5cc68f8..268f830 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.StringTokenizer;
@@ -77,7 +76,7 @@
 
     /** Gets the location where this declaration is declared. */
     public Locator getSourceLocation() {
-        return DOM4JLocator.getLocationInfo(dom);
+        return DOMLocator.getLocationInfo(dom);
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java
index 35edd57..2afc54e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.io.IOException;
@@ -49,8 +48,6 @@
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
 import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.model.TypeUseFactory;
-import com.sun.tools.internal.xjc.reader.Ring;
-import com.sun.tools.internal.xjc.reader.xmlschema.ClassSelector;
 
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
@@ -112,7 +109,7 @@
 
     /** Gets the location where this declaration is declared. */
     public Locator getSourceLocation() {
-        return DOM4JLocator.getLocationInfo(e);
+        return DOMLocator.getLocationInfo(e);
     }
 
     /** Gets the conversion name. */
@@ -153,7 +150,7 @@
         if(parse==null)  parse="new";
 
         String print = DOMUtil.getAttribute(e,"print");
-        if(print==null)  parse="toString";
+        if(print==null)  print="toString";
 
         JDefinedClass adapter = generateAdapter(owner.codeModel, parse, print, t.boxify());
 
@@ -168,7 +165,7 @@
         int id = 1;
         while(adapter==null) {
             try {
-                JPackage pkg = Ring.get(ClassSelector.class).getClassScope().getOwnerPackage();
+                JPackage pkg = owner.getTargetPackage();
                 adapter = pkg._class("Adapter"+id);
             } catch (JClassAlreadyExistsException e) {
                 // try another name in search for an unique name.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java
index 1a0d97fd..41fb612 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.io.IOException;
@@ -44,6 +43,8 @@
 import com.sun.tools.internal.xjc.AbortException;
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.SchemaCache;
+import com.sun.tools.internal.xjc.model.CCustomizations;
+import com.sun.tools.internal.xjc.model.CPluginCustomization;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.reader.Const;
 import com.sun.tools.internal.xjc.util.CodeModelClassFactory;
@@ -74,8 +75,7 @@
     private final String defaultPackage;
 
     public BindInfo(Model model, InputSource source, ErrorReceiver _errorReceiver) throws AbortException {
-
-        this( model, parse(source,_errorReceiver), _errorReceiver);
+        this( model, parse(model,source,_errorReceiver), _errorReceiver);
     }
 
     public BindInfo(Model model, Document _dom, ErrorReceiver _errorReceiver) {
@@ -88,6 +88,9 @@
 
         this.defaultPackage = model.options.defaultPackage;
 
+        // copy global customizations to the model
+        model.getCustomizations().addAll(getGlobalCustomizations());
+
         // process element declarations
         for( Element ele : DOMUtil.getChildElements(dom,"element")) {
             BIElement e = new BIElement(this,ele);
@@ -193,8 +196,14 @@
         return c;
     }
 
-    /** Gets the specified package name (options/@package). */
+    /**
+     * Gets the specified package name (options/@package).
+     */
     public JPackage getTargetPackage() {
+        if(model.options.defaultPackage!=null)
+            // "-p" takes precedence over everything else
+            return codeModel._package(model.options.defaultPackage);
+
         String p;
         if( defaultPackage!=null )
             p = defaultPackage;
@@ -236,6 +245,24 @@
         return interfaces.values();
     }
 
+    /**
+     * Gets the list of top-level {@link CPluginCustomization}s.
+     */
+    private CCustomizations getGlobalCustomizations() {
+        CCustomizations r=null;
+        for( Element e : DOMUtil.getChildElements(dom) ) {
+            if(!model.options.pluginURIs.contains(e.getNamespaceURI()))
+                continue;   // this isn't a plugin customization
+            if(r==null)
+                r = new CCustomizations();
+            r.add(new CPluginCustomization(e, DOMLocator.getLocationInfo(e)));
+        }
+
+        if(r==null)     r = CCustomizations.EMPTY;
+        return new CCustomizations(r);
+    }
+
+
 
 
 //
@@ -265,12 +292,14 @@
      * Parses an InputSource into dom4j Document.
      * Returns null in case of an exception.
      */
-    private static Document parse( InputSource is, ErrorReceiver receiver ) throws AbortException {
+    private static Document parse( Model model, InputSource is, ErrorReceiver receiver ) throws AbortException {
         try {
             ValidatorHandler validator = bindingFileSchema.newValidator();
 
             // set up the pipe line as :
-            //   parser->validator->factory
+            //              /-> extensionChecker -> validator
+            //   parser-> -<
+            //              \-> DOM builder
             SAXParserFactory pf = SAXParserFactory.newInstance();
             pf.setNamespaceAware(true);
             DOMBuilder builder = new DOMBuilder();
@@ -279,7 +308,11 @@
             validator.setErrorHandler(controller);
             XMLReader reader = pf.newSAXParser().getXMLReader();
             reader.setErrorHandler(controller);
-            reader.setContentHandler(new ForkContentHandler(validator,builder));
+
+            DTDExtensionBindingChecker checker = new DTDExtensionBindingChecker("", model.options, controller);
+            checker.setContentHandler(validator);
+
+            reader.setContentHandler(new ForkContentHandler(checker,builder));
 
             reader.parse(is);
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOM4JLocator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOM4JLocator.java
deleted file mode 100644
index 9f04a1c..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOM4JLocator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
-
-import org.w3c.dom.Element;
-import org.xml.sax.Locator;
-
-class DOM4JLocator
-{
-    private static final String locationNamespace =
-        "http://www.sun.com/xmlns/jaxb/dom4j-location";
-    private static final String systemId    = "systemid";
-    private static final String column      = "column";
-    private static final String line        = "line";
-
-    /** Sets the location information to a specified element. */
-    public static void setLocationInfo( Element e, Locator loc ) {
-        e.setAttributeNS(locationNamespace,"loc:"+systemId,loc.getSystemId());
-        e.setAttributeNS(locationNamespace,"loc:"+column,Integer.toString(loc.getLineNumber()));
-        e.setAttributeNS(locationNamespace,"loc:"+line,Integer.toString(loc.getColumnNumber()));
-    }
-
-    /**
-     * Gets the location information from an element.
-     *
-     * <p>
-     * For this method to work, the setLocationInfo method has to be
-     * called before.
-     */
-    public static Locator getLocationInfo( final Element e ) {
-        if(DOMUtil.getAttribute(e,locationNamespace,systemId)==null)
-            return null;    // no location information
-
-        return new Locator(){
-            public int getLineNumber() {
-                return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,line));
-            }
-            public int getColumnNumber() {
-                return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,column));
-            }
-            public String getSystemId() {
-                return DOMUtil.getAttribute(e,locationNamespace,systemId);
-            }
-            // we are not interested in PUBLIC ID.
-            public String getPublicId() { return null; }
-        };
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java
index 7ae8e69..9829568 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import javax.xml.parsers.ParserConfigurationException;
@@ -48,6 +47,6 @@
 
     public void startElement(String namespace, String localName, String qName, Attributes attrs) {
         super.startElement(namespace, localName, qName, attrs);
-        DOM4JLocator.setLocationInfo(getCurrentElement(),locator);
+        DOMLocator.setLocationInfo(getCurrentElement(),locator);
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMLocator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMLocator.java
new file mode 100644
index 0000000..53eb5fa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMLocator.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
+
+import org.w3c.dom.Element;
+import org.xml.sax.Locator;
+
+class DOMLocator {
+    private static final String locationNamespace =
+        "http://www.sun.com/xmlns/jaxb/dom-location";
+    private static final String systemId    = "systemid";
+    private static final String column      = "column";
+    private static final String line        = "line";
+
+    /** Sets the location information to a specified element. */
+    public static void setLocationInfo( Element e, Locator loc ) {
+        e.setAttributeNS(locationNamespace,"loc:"+systemId,loc.getSystemId());
+        e.setAttributeNS(locationNamespace,"loc:"+column,Integer.toString(loc.getLineNumber()));
+        e.setAttributeNS(locationNamespace,"loc:"+line,Integer.toString(loc.getColumnNumber()));
+    }
+
+    /**
+     * Gets the location information from an element.
+     *
+     * <p>
+     * For this method to work, the setLocationInfo method has to be
+     * called before.
+     */
+    public static Locator getLocationInfo( final Element e ) {
+        if(DOMUtil.getAttribute(e,locationNamespace,systemId)==null)
+            return null;    // no location information
+
+        return new Locator(){
+            public int getLineNumber() {
+                return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,line));
+            }
+            public int getColumnNumber() {
+                return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,column));
+            }
+            public String getSystemId() {
+                return DOMUtil.getAttribute(e,locationNamespace,systemId);
+            }
+            // we are not interested in PUBLIC ID.
+            public String getPublicId() { return null; }
+        };
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java
index a5ffd3f..dc121ac 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java
new file mode 100644
index 0000000..cd0822f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
+
+import com.sun.tools.internal.xjc.Options;
+import com.sun.tools.internal.xjc.reader.AbstractExtensionBindingChecker;
+import com.sun.tools.internal.xjc.reader.Const;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+
+/**
+ * {@link XMLFilter} that checks the use of extension namespace URIs
+ * (to see if they have corresponding plugins), and otherwise report an error.
+ *
+ * <p>
+ * This code also masks the recognized extensions from the validator that
+ * will be plugged as the next component to this.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class DTDExtensionBindingChecker extends AbstractExtensionBindingChecker {
+    public DTDExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler) {
+        super(schemaLanguage, options, handler);
+    }
+
+    /**
+     * Returns true if the elements with the given namespace URI
+     * should be blocked by this filter.
+     */
+    private boolean needsToBePruned( String uri ) {
+        if( uri.equals(schemaLanguage) )
+            return false;
+        if( uri.equals(Const.JAXB_NSURI) )
+            return false;
+        if( uri.equals(Const.XJC_EXTENSION_URI) )
+            return false;
+        // we don't want validator to see extensions that we understand ,
+        // because they will complain.
+        // OTOH, if  this is an extension that we didn't understand,
+        // we want the validator to report an error
+        return enabledExtensions.contains(uri);
+    }
+
+
+
+    public void startElement(String uri, String localName, String qName, Attributes atts)
+        throws SAXException {
+
+        if( !isCutting() ) {
+            if(!uri.equals("")) {
+                // "" is the standard namespace
+                checkAndEnable(uri);
+
+                verifyTagName(uri, localName, qName);
+
+                if(needsToBePruned(uri))
+                    startCutting();
+            }
+        }
+
+        super.startElement(uri, localName, qName, atts);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties
index a6343d1..dc662e6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties
@@ -1,3 +1,27 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
 
 BIConstructor.UndefinedField = \
 	Property "{0}" is declared in the <constructor> declaration \
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java
index 6536bc7..9fcd10f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng
index 2e639f5..a71e45b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng
@@ -1,5 +1,29 @@
 <?xml version="1.0"?>
 <!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+<!--
 DTD binding information file which is supported by this version of XJC.
 $Id: bindingfile.rng,v 1.1 2005/04/15 20:09:43 kohsuke Exp $
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd
index 825f3a8..4581ab9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <!--
   DTD binding information file which is supported by this version of XJC.
   $Id: bindingfile.xsd,v 1.1 2005/04/29 18:11:05 kohsuke Exp $
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html
index ab4988a..4e2c7ba 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html
@@ -1 +1,25 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <body><p>Object Model that represents DTD binding information.</p></body>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd
index 2fceabd..e80bb2a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
   <xs:import schemaLocation="bindingfile.xsd"/>
   <xs:element name="serializable">
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java
index e583222..91be85a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java
index 0061dba..29759c9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java
index c07ed08..4e64739 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -51,8 +50,8 @@
      * we represent an edge e1 -> e2 by {@code e1.foreEdges.contains(e2)}
      * and {@code e2.backEdges.contains(e1)}.
      */
-    final Set<Element> foreEdges = new HashSet<Element>();
-    final Set<Element> backEdges = new HashSet<Element>();
+    final Set<Element> foreEdges = new LinkedHashSet<Element>();
+    final Set<Element> backEdges = new LinkedHashSet<Element>();
 
     /**
      * Previous element in the DFS post-order traveral
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java
index 08cdfc6..6e73c92 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java
index bbce4a9..4711260 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,9 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 
 /**
  * Factory methods for {@link ElementSet}.
@@ -53,7 +52,7 @@
      *
      * This isn't particularly efficient or anything, but it will do for now.
      */
-    private static final class MultiValueSet extends HashSet<Element> implements ElementSet {
+    private static final class MultiValueSet extends LinkedHashSet<Element> implements ElementSet {
         public MultiValueSet(ElementSet lhs, ElementSet rhs) {
             addAll(lhs);
             addAll(rhs);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java
index efd6bb0..9583157 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 import java.util.Set;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java
index c3d0bce..c612fdd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java
index 5a5e2ab..4be3892 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java
index 1a7888c..aa628cb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java
index a58803b..ded5a78 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java
index 96584b2..c96d78a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.gbind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html
index ab9a91b..a8676fb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
     Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C))
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java
index 55b57d2..1fc6f40 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.io.IOException;
+import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
 
@@ -83,8 +83,13 @@
             // but don't mark this document as a root.
             parent.parse(ref,false);
         } catch( URISyntaxException e ) {
+            String msg = e.getMessage();
+            if(new File(relativeRef).exists()) {
+                msg = Messages.format(Messages.ERR_FILENAME_IS_NOT_URI)+' '+msg;
+            }
+
             SAXParseException spe = new SAXParseException2(
-                Messages.format(Messages.ERR_UNABLE_TO_PARSE,relativeRef,e.getMessage()),
+                Messages.format(Messages.ERR_UNABLE_TO_PARSE,relativeRef, msg),
                 locator, e );
 
             fatalError(spe);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java
index aa9c9914..0cc0003 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import javax.xml.XMLConstants;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java
index 96bb428..d88c157 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.util.Set;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java
index 03fe2e2..81803a2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.io.IOException;
@@ -55,11 +54,11 @@
 import javax.xml.validation.SchemaFactory;
 
 import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.XMLStreamReaderToContentHandler;
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.reader.Const;
 import com.sun.tools.internal.xjc.reader.xmlschema.parser.SchemaConstraintChecker;
 import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
-import com.sun.tools.internal.xjc.util.XMLStreamReaderToContentHandler;
 import com.sun.xml.internal.bind.marshaller.DataWriter;
 import com.sun.xml.internal.xsom.parser.JAXPParser;
 import com.sun.xml.internal.xsom.parser.XMLParser;
@@ -203,6 +202,18 @@
     }
 
     /**
+     * Picks one document at random and returns it.
+     */
+    public Document getOneDocument() {
+        for (Document dom : core.values()) {
+            if (!dom.getDocumentElement().getNamespaceURI().equals(Const.JAXB_NSURI))
+                return dom;
+        }
+        // we should have caught this error very early on
+        throw new AssertionError();
+    }
+
+    /**
      * Checks the correctness of the XML Schema documents and return true
      * if it's OK.
      *
@@ -407,7 +418,7 @@
             throw new IllegalArgumentException("system id cannot be null");
         core.put( systemId, dom );
 
-        new XMLStreamReaderToContentHandler(parser,getParserHandler(dom)).bridge();
+        new XMLStreamReaderToContentHandler(parser,getParserHandler(dom),false,false).bridge();
 
         return dom;
     }
@@ -417,9 +428,13 @@
      *
      * This method should be called only once, only after all the
      * schemas are parsed.
+     *
+     * @return
+     *      the returned bindings need to be applied after schema
+     *      components are built.
      */
-    public void transform() {
-        Internalizer.transform(this);
+    public SCDBasedBindingSet transform(boolean enableSCD) {
+        return Internalizer.transform(this,enableSCD);
     }
 
     /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java
index 4182938..d5c25c5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java
index 3f9b639..af3c4231 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java
index 3028300..efe192b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import org.w3c.dom.Element;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java
index b2d71ef..bee1dc8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.net.MalformedURLException;
@@ -31,6 +30,7 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.text.ParseException;
 
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
@@ -38,10 +38,13 @@
 import javax.xml.xpath.XPathFactory;
 
 import com.sun.istack.internal.SAXParseException2;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.reader.Const;
 import com.sun.tools.internal.xjc.util.DOMUtils;
 import com.sun.xml.internal.bind.v2.util.EditDistance;
+import com.sun.xml.internal.xsom.SCD;
 
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -55,8 +58,9 @@
 
 /**
  * Internalizes external binding declarations.
+ *
  * <p>
- * The static "transform" method is the entry point.
+ * The {@link #transform(DOMForest,boolean)} method is the entry point.
  *
  * @author
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
@@ -69,15 +73,23 @@
 
     /**
      * Internalize all &lt;jaxb:bindings> customizations in the given forest.
+     *
+     * @return
+     *      if the SCD support is enabled, the return bindings need to be applied
+     *      after schema components are parsed.
+     *      If disabled, the returned binding set will be empty.
+     *      SCDs are only for XML Schema, and doesn't make any sense for other
+     *      schema languages.
      */
-    static void transform( DOMForest forest ) {
-        new Internalizer( forest ).transform();
+    static SCDBasedBindingSet transform( DOMForest forest, boolean enableSCD ) {
+        return new Internalizer( forest, enableSCD ).transform();
     }
 
 
-    private Internalizer( DOMForest forest ) {
+    private Internalizer( DOMForest forest, boolean enableSCD ) {
         this.errorHandler = forest.getErrorHandler();
         this.forest = forest;
+        this.enableSCD = enableSCD;
     }
 
     /**
@@ -90,18 +102,25 @@
      */
     private ErrorReceiver errorHandler;
 
+    /**
+     * If true, the SCD-based target selection is supported.
+     */
+    private boolean enableSCD;
 
 
-    private void transform() {
+    private SCDBasedBindingSet transform() {
 
+        // either target nodes are conventional DOM nodes (as per spec),
         Map<Element,Node> targetNodes = new HashMap<Element,Node>();
+        // ... or it will be schema components by means of SCD (RI extension)
+        SCDBasedBindingSet scd = new SCDBasedBindingSet(forest);
 
         //
         // identify target nodes for all <jaxb:bindings>
         //
         for (Element jaxbBindings : forest.outerMostBindings) {
             // initially, the inherited context is itself
-            buildTargetNodeMap(jaxbBindings, jaxbBindings, targetNodes);
+            buildTargetNodeMap(jaxbBindings, jaxbBindings, null, targetNodes, scd);
         }
 
         //
@@ -110,6 +129,8 @@
         for (Element jaxbBindings : forest.outerMostBindings) {
             move(jaxbBindings, targetNodes);
         }
+
+        return scd;
     }
 
     /**
@@ -125,6 +146,8 @@
                 continue;
             if( a.getLocalName().equals("schemaLocation"))
                 continue;
+            if( a.getLocalName().equals("scd") )
+                continue;
 
             // TODO: flag error for this undefined attribute
         }
@@ -133,9 +156,19 @@
     /**
      * Determines the target node of the "bindings" element
      * by using the inherited target node, then put
-     * the result into the "result" map.
+     * the result into the "result" map and the "scd" map.
+     *
+     * @param inheritedTarget
+     *      The current target node. This always exists, even if
+     *      the user starts specifying targets via SCD (in that case
+     *      this inherited target is just not going to be used.)
+     * @param inheritedSCD
+     *      If the ancestor &lt;bindings> node specifies @scd to
+     *      specify the target via SCD, then this parameter represents that context.
      */
-    private void buildTargetNodeMap( Element bindings, Node inheritedTarget, Map<Element,Node> result ) {
+    private void buildTargetNodeMap( Element bindings, @NotNull Node inheritedTarget,
+                                     @Nullable SCDBasedBindingSet.Target inheritedSCD,
+                                     Map<Element,Node> result, SCDBasedBindingSet scdResult ) {
         // start by the inherited target
         Node target = inheritedTarget;
 
@@ -153,7 +186,7 @@
                     new URL( forest.getSystemId(bindings.getOwnerDocument()) ),
                     schemaLocation ).toExternalForm();
             } catch( MalformedURLException e ) {
-                ;   // continue with the original schemaLocation value
+                // continue with the original schemaLocation value
             }
 
             target = forest.get(schemaLocation);
@@ -165,6 +198,8 @@
 
                 return; // abort processing this <jaxb:bindings>
             }
+
+            target = ((Document)target).getDocumentElement();
         }
 
         // look for @node
@@ -178,51 +213,69 @@
                 nlst = (NodeList)xpath.evaluate(nodeXPath,target,XPathConstants.NODESET);
             } catch (XPathExpressionException e) {
                 reportError( bindings,
-                    Messages.format(Messages.ERR_XPATH_EVAL,e.getMessage()),
-                    e );
+                    Messages.format(Messages.ERR_XPATH_EVAL,e.getMessage()), e );
                 return; // abort processing this <jaxb:bindings>
             }
 
             if( nlst.getLength()==0 ) {
                 reportError( bindings,
-                    Messages.format(Messages.NO_XPATH_EVAL_TO_NO_TARGET,
-                        nodeXPath) );
+                    Messages.format(Messages.NO_XPATH_EVAL_TO_NO_TARGET, nodeXPath) );
                 return; // abort
             }
 
             if( nlst.getLength()!=1 ) {
                 reportError( bindings,
-                    Messages.format(Messages.NO_XPATH_EVAL_TOO_MANY_TARGETS,
-                        nodeXPath,nlst.getLength()) );
+                    Messages.format(Messages.NO_XPATH_EVAL_TOO_MANY_TARGETS, nodeXPath,nlst.getLength()) );
                 return; // abort
             }
 
             Node rnode = nlst.item(0);
             if(!(rnode instanceof Element )) {
                 reportError( bindings,
-                    Messages.format(Messages.NO_XPATH_EVAL_TO_NON_ELEMENT,
-                        nodeXPath) );
+                    Messages.format(Messages.NO_XPATH_EVAL_TO_NON_ELEMENT, nodeXPath) );
                 return; // abort
             }
 
             if( !forest.logic.checkIfValidTargetNode(forest,bindings,(Element)rnode) ) {
                 reportError( bindings,
                     Messages.format(Messages.XPATH_EVAL_TO_NON_SCHEMA_ELEMENT,
-                        nodeXPath,
-                        rnode.getNodeName() ) );
+                        nodeXPath, rnode.getNodeName() ) );
                 return; // abort
             }
 
             target = rnode;
         }
 
+        // look for @scd
+        if( bindings.getAttributeNode("scd")!=null ) {
+            String scdPath = bindings.getAttribute("scd");
+            if(!enableSCD) {
+                // SCD selector was found, but it's not activated. report an error
+                // but recover by handling it anyway. this also avoids repeated error messages.
+                reportError(bindings,
+                    Messages.format(Messages.SCD_NOT_ENABLED));
+                enableSCD = true;
+            }
+
+            try {
+                inheritedSCD = scdResult.createNewTarget( inheritedSCD, bindings,
+                        SCD.create(scdPath, new NamespaceContextImpl(bindings)) );
+            } catch (ParseException e) {
+                reportError( bindings, Messages.format(Messages.ERR_SCD_EVAL,e.getMessage()),e );
+                return; // abort processing this bindings
+            }
+        }
+
         // update the result map
-        result.put( bindings, target );
+        if(inheritedSCD!=null)
+            inheritedSCD.addBinidng(bindings);
+        else
+            result.put( bindings, target );
 
         // look for child <jaxb:bindings> and process them recursively
         Element[] children = DOMUtils.getChildElements( bindings, Const.JAXB_NSURI, "bindings" );
         for (Element value : children)
-            buildTargetNodeMap(value, target, result);
+            buildTargetNodeMap(value, target, inheritedSCD, result, scdResult);
     }
 
     /**
@@ -235,21 +288,20 @@
             // recover from the error by ignoring this node
             return;
 
-        Element[] children = DOMUtils.getChildElements(bindings);
-        for (Element item : children) {
-            if ("bindings".equals(item.getLocalName()))
-            // process child <jaxb:bindings> recursively
+        for (Element item : DOMUtils.getChildElements(bindings)) {
+            String localName = item.getLocalName();
+
+            if ("bindings".equals(localName)) {
+                // process child <jaxb:bindings> recursively
                 move(item, targetNodes);
-            else {
+            } else
+            if ("globalBindings".equals(localName)) {
+                // <jaxb:globalBindings> always go to the root of document.
+                moveUnder(item,forest.getOneDocument().getDocumentElement());
+            } else {
                 if (!(target instanceof Element)) {
-                    if(target instanceof Document) {
-                        // we set the context node to the document when @schemaLocation is used.
-                        reportError(item,
-                                Messages.format(Messages.NO_CONTEXT_NODE_SPECIFIED));
-                    } else {
-                        reportError(item,
-                                Messages.format(Messages.CONTEXT_NODE_IS_NOT_ELEMENT));
-                    }
+                    reportError(item,
+                            Messages.format(Messages.CONTEXT_NODE_IS_NOT_ELEMENT));
                     return; // abort
                 }
 
@@ -258,6 +310,7 @@
                             Messages.format(Messages.ORPHANED_CUSTOMIZATION, item.getNodeName()));
                     return; // abort
                 }
+
                 // move this node under the target
                 moveUnder(item,(Element)target);
             }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java
index dedf9ec..1bab8f9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties
index 95bf780..5dd998a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
@@ -31,9 +56,6 @@
 Internalizer.ContextNodeIsNotElement = \
 	Context node is not an element.
 
-Internalizer.NoContextNodeSpecified = \
-	A schema document is selected but @node is not specified. Maybe you meant node="/xs:schema"? 
-
 Internalizer.OrphanedCustomization = \
 	The "{0}" customization is not associated with any schema element.
 
@@ -48,4 +70,25 @@
 
 ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR = \
     We were unable to ensure the correctness of the schema: {0}
+
+SCD_NOT_ENABLED = \
+    Schema component designator support is disabled by default. Use the -extension switch to enable this vendor extension.
+
+ERR_SCD_EVAL = \
+    Invalid SCD: {0}
+
+ERR_SCD_EVALUATED_EMPTY = \
+    SCD "{0}" didn't match any schema component
+
+ERR_SCD_MATCHED_MULTIPLE_NODES = \
+    SCD "{0}" matched {1} schema components whereas only 1 is expected
+
+ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST = \
+    (related to above) one of the matched schema components is defined here
+
+ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND = \
+    (related to above) another matched schema component is defined here
+
+ERR_FILENAME_IS_NOT_URI = \
+    File name is not an URI.
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java
index 270d3fc..e9b5025 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,10 +51,20 @@
         "Internalizer.XPathEvaluatesToNonElement";
     static final String XPATH_EVAL_TO_NON_SCHEMA_ELEMENT = // arg:2
         "Internalizer.XPathEvaluatesToNonSchemaElement";
+    static final String SCD_NOT_ENABLED = // arg:0
+        "SCD_NOT_ENABLED";
+    static final String ERR_SCD_EVAL = // arg: 1
+        "ERR_SCD_EVAL";
+    static final String ERR_SCD_EVALUATED_EMPTY = // arg:1
+        "ERR_SCD_EVALUATED_EMPTY";
+    static final String ERR_SCD_MATCHED_MULTIPLE_NODES = // arg:2
+        "ERR_SCD_MATCHED_MULTIPLE_NODES";
+    static final String ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST = // arg:1
+        "ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST";
+    static final String ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND = // arg:1
+        "ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND";
     static final String CONTEXT_NODE_IS_NOT_ELEMENT = // arg:0
         "Internalizer.ContextNodeIsNotElement";
-    static final String NO_CONTEXT_NODE_SPECIFIED = // arg:0
-            "Internalizer.NoContextNodeSpecified";
     static final String ERR_INCORRECT_VERSION = // arg:0
         "Internalizer.IncorrectVersion";
     static final String ERR_VERSION_NOT_FOUND = // arg:0
@@ -65,6 +75,8 @@
         "Internalizer.OrphanedCustomization";
     static final String ERR_UNABLE_TO_PARSE = // arg:2
         "AbstractReferenceFinderImpl.UnableToParse";
+    static final String ERR_FILENAME_IS_NOT_URI = // arg:0
+        "ERR_FILENAME_IS_NOT_URI";
     static final String ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR = // arg:1
         "ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR";
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java
index f30a550..bc6d512 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java
@@ -2,6 +2,32 @@
  * reserved comment block
  * DO NOT REMOVE OR ALTER!
  */
+/*
+ * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
 package com.sun.tools.internal.xjc.reader.internalizer;
 
 import java.util.Iterator;
@@ -45,6 +71,7 @@
     public String getNamespaceURI(String prefix) {
         Node parent = e;
         String namespace = null;
+        final String prefixColon = prefix + ':';
 
         if (prefix.equals("xml")) {
             namespace = WellKnownNamespace.XML_NAMESPACE_URI;
@@ -55,7 +82,7 @@
                     && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
                     || (type == Node.ENTITY_REFERENCE_NODE))) {
                 if (type == Node.ELEMENT_NODE) {
-                    if (parent.getNodeName().indexOf(prefix + ':') == 0)
+                    if (parent.getNodeName().startsWith(prefixColon))
                         return parent.getNamespaceURI();
                     NamedNodeMap nnm = parent.getAttributes();
 
@@ -81,6 +108,8 @@
             }
         }
 
+        if(prefix.equals(""))
+            return "";  // default namespace
         return namespace;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java
new file mode 100644
index 0000000..a4d87cf
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java
@@ -0,0 +1,245 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.reader.internalizer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.validation.ValidatorHandler;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.SAXParseException2;
+import com.sun.tools.internal.xjc.ErrorReceiver;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIDeclaration;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BindInfo;
+import com.sun.tools.internal.xjc.util.ForkContentHandler;
+import com.sun.tools.internal.xjc.util.DOMUtils;
+import com.sun.xml.internal.xsom.SCD;
+import com.sun.xml.internal.xsom.XSAnnotation;
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSSchemaSet;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl;
+
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Set of binding nodes that have target nodes specified via SCD.
+ *
+ * This is parsed during {@link Internalizer} works on the tree,
+ * but applying this has to wait for {@link XSSchemaSet} to be parsed.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see SCD
+ */
+public final class SCDBasedBindingSet {
+
+    /**
+     * Represents the target schema component of the
+     * customization identified by SCD.
+     *
+     * @author Kohsuke Kawaguchi
+     */
+    final class Target {
+        /**
+         * SCDs can be specified via multiple steps, like:
+         *
+         * <xmp>
+         * <bindings scd="foo/bar">
+         *   <bindings scd="zot/xyz">
+         * </xmp>
+         *
+         * This field and {@link #nextSibling} form a single-linked list that
+         * represent the children that shall be evaluated within this target.
+         * Think of it as {@code List<Target>}.
+         */
+        private Target firstChild;
+        private final Target nextSibling;
+
+        /**
+         * Compiled SCD.
+         */
+        private final @NotNull SCD scd;
+
+        /**
+         * The element on which SCD was found.
+         */
+        private final @NotNull Element src;
+
+        /**
+         * Bindings that apply to this SCD.
+         */
+        private final List<Element> bindings = new ArrayList<Element>();
+
+        private Target(Target parent, Element src, SCD scd) {
+            if(parent==null) {
+                this.nextSibling = topLevel;
+                topLevel = this;
+            } else {
+                this.nextSibling = parent.firstChild;
+                parent.firstChild = this;
+            }
+            this.src = src;
+            this.scd = scd;
+        }
+
+        /**
+         * Adds a new binding declaration to be associated to the schema component
+         * identified by {@link #scd}.
+         */
+        void addBinidng(Element binding) {
+            bindings.add(binding);
+        }
+
+        /**
+         * Applies bindings to the schema component for this and its siblings.
+         */
+        private void applyAll(Collection<? extends XSComponent> contextNode) {
+            for( Target self=this; self!=null; self=self.nextSibling )
+                self.apply(contextNode);
+        }
+
+        /**
+         * Applies bindings to the schema component for just this node.
+         */
+        private void apply(Collection<? extends XSComponent> contextNode) {
+            // apply the SCD...
+            Collection<XSComponent> childNodes = scd.select(contextNode);
+            if(childNodes.isEmpty()) {
+                // no node matched
+                if(src.getAttributeNode("if-exists")!=null) {
+                    // if this attribute exists, it's not an error if SCD didn't match.
+                    return;
+                }
+
+                reportError( src, Messages.format(Messages.ERR_SCD_EVALUATED_EMPTY,scd) );
+                return;
+            }
+
+            if(firstChild!=null)
+                    firstChild.applyAll(childNodes);
+
+            if(!bindings.isEmpty()) {
+                // error to match more than one components
+                Iterator<XSComponent> itr = childNodes.iterator();
+                XSComponent target = itr.next();
+                if(itr.hasNext()) {
+                    reportError( src, Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES,scd,childNodes.size()) );
+                    errorReceiver.error( target.getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_FIRST) );
+                    errorReceiver.error( itr.next().getLocator(), Messages.format(Messages.ERR_SCD_MATCHED_MULTIPLE_NODES_SECOND) );
+                }
+
+                // apply bindings to the target
+                for (Element binding : bindings) {
+                    for (Element item : DOMUtils.getChildElements(binding)) {
+                        String localName = item.getLocalName();
+
+                        if ("bindings".equals(localName))
+                            continue;   // this should be already in Target.bindings of some SpecVersion.
+
+                        try {
+                            new DOMForestScanner(forest).scan(item,loader);
+                            BIDeclaration decl = (BIDeclaration)unmarshaller.getResult();
+
+                            // add this binding to the target
+                            XSAnnotation ann = target.getAnnotation(true);
+                            BindInfo bi = (BindInfo)ann.getAnnotation();
+                            if(bi==null) {
+                                bi = new BindInfo();
+                                ann.setAnnotation(bi);
+                            }
+                            bi.addDecl(decl);
+                        } catch (SAXException e) {
+                            // the error should have already been reported.
+                        } catch (JAXBException e) {
+                            // if validation didn't fail, then unmarshalling can't go wrong
+                            throw new AssertionError(e);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private Target topLevel;
+
+    /**
+     * The forest where binding elements came from. Needed to report line numbers for errors.
+     */
+    private final DOMForest forest;
+
+
+    // variables used only during the apply method
+    //
+    private ErrorReceiver errorReceiver;
+    private UnmarshallerHandler unmarshaller;
+    private ForkContentHandler loader; // unmarshaller+validator
+
+    SCDBasedBindingSet(DOMForest forest) {
+        this.forest = forest;
+    }
+
+    Target createNewTarget(Target parent, Element src, SCD scd) {
+        return new Target(parent,src,scd);
+    }
+
+    /**
+     * Applies the additional binding customizations.
+     */
+    public void apply(XSSchemaSet schema, ErrorReceiver errorReceiver) {
+        if(topLevel!=null) {
+            this.errorReceiver = errorReceiver;
+            UnmarshallerImpl u = BindInfo.getJAXBContext().createUnmarshaller();
+            this.unmarshaller = u.getUnmarshallerHandler();
+            ValidatorHandler v = BindInfo.bindingFileSchema.newValidator();
+            v.setErrorHandler(errorReceiver);
+            loader = new ForkContentHandler(v,unmarshaller);
+
+            topLevel.applyAll(schema.getSchemas());
+
+            this.loader = null;
+            this.unmarshaller = null;
+            this.errorReceiver = null;
+        }
+    }
+
+    private void reportError( Element errorSource, String formattedMsg ) {
+        reportError( errorSource, formattedMsg, null );
+    }
+
+    private void reportError( Element errorSource,
+                              String formattedMsg, Exception nestedException ) {
+
+        SAXParseException e = new SAXParseException2( formattedMsg,
+            forest.locatorTable.getStartLocation(errorSource),
+            nestedException );
+        errorReceiver.error(e);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java
index 1170d47..f022451 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.internalizer;
 
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Arrays;
+
 import com.sun.tools.internal.xjc.reader.Const;
 
 import org.xml.sax.Attributes;
@@ -118,7 +121,7 @@
         }
 
         // if present, the value must be either 1.0 or 2.0
-        if( version!=null && !version.equals("1.0") && !version.equals("2.0") ) {
+        if( version!=null && !VERSIONS.contains(version) ) {
             SAXParseException e = new SAXParseException(
                 Messages.format(Messages.ERR_INCORRECT_VERSION),rootTagStart);
             getErrorHandler().error(e);
@@ -130,4 +133,6 @@
         this.locator = locator;
     }
 
+    private static final Set<String> VERSIONS = new HashSet<String>(Arrays.asList("1.0","2.0","2.1"));
+
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java
index c55813d..f8fe96c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: WhitespaceStripper.java,v 1.2 2005/04/29 19:56:57 kohsuke Exp $
+ */
+
 
 package com.sun.tools.internal.xjc.reader.internalizer;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html
index 259b4ff..5b9d665 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html
@@ -1 +1,25 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <body><p>internalization of external binding files and &lt;jaxb:bindings> customizations.</p></body>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/package.html
index d355bc8..d0da4ff 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/package.html
@@ -1 +1,25 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <body><p>Front-end that reads schema(s) and produce BGM.</p></body>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java
index 63f23b7..9d5a3df 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java
index 53fd3f8..887b127 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import javax.xml.namespace.QName;
@@ -116,7 +115,7 @@
 
         CAttributePropertyInfo ap = new CAttributePropertyInfo(
            calcName(p), null,null/*TODO*/, p.getLocation(), name,
-                p.getChild().accept(compiler.typeUseBinder),
+                p.getChild().accept(compiler.typeUseBinder), null,
                 !insideOptional);
         clazz.addProperty(ap);
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java
index 8aabe55..3633252 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java
index 32f2861..f5823dd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java
index e45fecf..807ba2a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import com.sun.xml.internal.rngom.digested.DPatternWalker;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java
index c532e37..7a7e0c8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import java.util.ArrayList;
@@ -112,7 +111,7 @@
     public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
         this.grammar = grammar;
         this.opts = opts;
-        this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator);
+        this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);
 
         datatypes.put("",DatatypeLib.BUILTIN);
         datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGInternalizationLogic.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
index 18e7ee8..5291df7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGInternalizationLogic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import com.sun.tools.internal.xjc.reader.Const;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java
index 04a7076..056b541 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import java.util.HashSet;
@@ -131,7 +130,7 @@
         }
 
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
-            return new CTypeRef(ci,ci.getElementName(),false,null);
+            return new CTypeRef(ci,ci.getElementName(),ci.getTypeName(),false,null);
         }
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java
index 18d6da4..8e58565 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java
index 8ab880d..3dfc3e0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.relaxng;
 
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java
index 89511e5..946d739 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,8 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
-import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CElement;
 import com.sun.xml.internal.xsom.XSComplexType;
 import com.sun.xml.internal.xsom.XSElementDecl;
@@ -40,8 +38,8 @@
         super(core);
     }
 
-    public CClassInfo complexType(XSComplexType xs) {
-        CClassInfo ci = (CClassInfo)super.complexType(xs);
+    public CElement complexType(XSComplexType xs) {
+        CElement ci = super.complexType(xs);
         if(ci!=null && xs.isAbstract())
             ci.setAbstract();
         return ci;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java
index f3c2f3f..b6e5040 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.ArrayList;
@@ -39,6 +38,7 @@
 import com.sun.codemodel.internal.JCodeModel;
 import com.sun.codemodel.internal.fmt.JTextFile;
 import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.Options;
 import com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory;
@@ -56,10 +56,10 @@
 import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.xsom.XSAnnotation;
 import com.sun.xml.internal.xsom.XSAttributeUse;
 import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSDeclaration;
 import com.sun.xml.internal.xsom.XSParticle;
 import com.sun.xml.internal.xsom.XSSchema;
 import com.sun.xml.internal.xsom.XSSchemaSet;
@@ -92,13 +92,13 @@
 
             Ring.add(XSSchemaSet.class,_schemas);
             Ring.add(codeModel);
-            Model model = new Model(opts, codeModel, null/*set later*/, opts.classNameAllocator);
+            Model model = new Model(opts, codeModel, null/*set later*/, opts.classNameAllocator, _schemas);
             Ring.add(model);
             Ring.add(ErrorReceiver.class,ef);
             Ring.add(CodeModelClassFactory.class,new CodeModelClassFactory(ef));
 
             BGMBuilder builder = new BGMBuilder(opts.defaultPackage,opts.defaultPackage2,
-                opts.compatibilityMode==Options.EXTENSION,opts.getFieldRendererFactory());
+                opts.isExtensionMode(),opts.getFieldRendererFactory());
             builder._build();
 
             if(ef.hadError())   return null;
@@ -179,6 +179,9 @@
         for( XSSchema s : schemas.getSchemas() ) {
             BindInfo bi = getBindInfo(s);
 
+            // collect all global customizations
+            model.getCustomizations().addAll(bi.toCustomizationList());
+
             BIGlobalBinding gb = bi.get(BIGlobalBinding.class);
             if(gb==null)
                 continue;
@@ -276,22 +279,27 @@
         SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
 
         for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
+            BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);
+
+            if(sb!=null && !sb.map) {
+                sb.markAsAcknowledged();
+                continue;       // no mapping for this package
+            }
+
             getClassSelector().pushClassScope( new CClassInfoParent.Package(
                 getClassSelector().getPackage(s.getTargetNamespace())) );
 
-            if(!s.getTargetNamespace().equals(WellKnownNamespace.XML_SCHEMA)) {
-                checkMultipleSchemaBindings(s);
-                processPackageJavadoc(s);
-                populate(s.getAttGroupDecls());
-                populate(s.getAttributeDecls());
-                populate(s.getElementDecls());
-                populate(s.getModelGroupDecls());
-            }
+            checkMultipleSchemaBindings(s);
+            processPackageJavadoc(s);
+            populate(s.getAttGroupDecls(),s);
+            populate(s.getAttributeDecls(),s);
+            populate(s.getElementDecls(),s);
+            populate(s.getModelGroupDecls(),s);
 
             // fill in typeUses
             for (XSType t : s.getTypes().values()) {
                 stb.refererStack.push(t);
-                model.typeUses().put( new QName(t.getTargetNamespace(),t.getName()), cs.bindToType(t) );
+                model.typeUses().put( getName(t), cs.bindToType(t,s) );
                 stb.refererStack.pop();
             }
 
@@ -323,10 +331,10 @@
      * Calls {@link ClassSelector} for each item in the iterator
      * to populate class items if there is any.
      */
-    private void populate( Map<String,? extends XSComponent> col ) {
+    private void populate( Map<String,? extends XSComponent> col, XSSchema schema ) {
         ClassSelector cs = getClassSelector();
         for( XSComponent sc : col.values() )
-            cs.bindToType(sc);
+            cs.bindToType(sc,schema);
     }
 
     /**
@@ -471,8 +479,8 @@
      * If the component is mapped to a type, this method needs to return true.
      * See the chart at the class javadoc.
      */
-    public void ying( XSComponent sc ) {
-        if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc)!=null)
+    public void ying( XSComponent sc, @Nullable XSComponent referer ) {
+        if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
             sc.visit(purple);
         else
             sc.visit(green);
@@ -503,4 +511,42 @@
         }
         return refFinder.getReferer(c);
     }
+
+    /**
+     * Returns the QName of the declaration.
+     * @return null
+     *      if the declaration is anonymous.
+     */
+    public static QName getName(XSDeclaration decl) {
+        String local = decl.getName();
+        if(local==null) return null;
+        return new QName(decl.getTargetNamespace(),local);
+    }
+
+    /**
+     * Derives a name from a schema component.
+     *
+     * This method handles prefix/suffix modification and
+     * XML-to-Java name conversion.
+     *
+     * @param name
+     *      The base name. This should be things like element names
+     *      or type names.
+     * @param comp
+     *      The component from which the base name was taken.
+     *      Used to determine how names are modified.
+     */
+    public String deriveName( String name, XSComponent comp ) {
+        XSSchema owner = comp.getOwnerSchema();
+
+        name = getNameConverter().toClassName(name);
+
+        if( owner!=null ) {
+            BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);
+
+            if(sb!=null)    name = sb.mangleClassName(name,comp);
+        }
+
+        return name;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java
index 67792a9..8ce5151 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java
index 1cc5f14..6955f04 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.Iterator;
@@ -57,14 +56,14 @@
         // inline
         Iterator itr = cont.iterateDeclaredAttributeUses();
         while(itr.hasNext())
-            builder.ying((XSAttributeUse)itr.next());
+            builder.ying((XSAttributeUse)itr.next(),cont);
         itr = cont.iterateAttGroups();
         while(itr.hasNext())
-            builder.ying((XSAttGroupDecl)itr.next());
+            builder.ying((XSAttGroupDecl)itr.next(),cont);
 
         XSWildcard w = cont.getAttributeWildcard();
         if(w!=null)
-            builder.ying(w);
+            builder.ying(w,cont);
     }
 
     public void complexType(XSComplexType ct) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java
index 4ad103f..34d83c8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CDefaultValue;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.TypeUse;
+import com.sun.tools.internal.xjc.model.CClass;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
@@ -103,7 +103,7 @@
 
 
     public void complexType(XSComplexType ct) {
-        CClassInfo ctBean = selector.bindToType(ct, false);
+        CClass ctBean = selector.bindToType(ct,null,false);
         if(getCurrentBean()!=ctBean)
             // in some case complex type and element binds to the same class
             // don't make it has-a. Just make it is-a.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java
index fc92e31..f2c86a8 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.reader.Ring;
@@ -75,7 +74,7 @@
     public void elementDecl(XSElementDecl e) {
         SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
         stb.refererStack.push(e);    // referer is element
-        builder.ying(e.getType());
+        builder.ying(e.getType(),e);
         stb.refererStack.pop();
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java
index 9fc9a75..af35fc5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java
index a884527..2338c97 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.reader.Ring;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinder.java
index 391d191..1683145 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.model.CClassInfo;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java
index abe2ac3..4bfcc20 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.model.CElement;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassSelector.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassSelector.java
index de268d6..49be164 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassSelector.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassSelector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.io.StringWriter;
@@ -44,6 +43,8 @@
 import com.sun.tools.internal.xjc.model.CElementInfo;
 import com.sun.tools.internal.xjc.model.CTypeInfo;
 import com.sun.tools.internal.xjc.model.TypeUse;
+import com.sun.tools.internal.xjc.model.CClass;
+import com.sun.tools.internal.xjc.model.CNonElement;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BISchemaBinding;
@@ -63,12 +64,12 @@
 import org.xml.sax.Locator;
 
 /**
- * Manages association between XSComponents and generated
- * content interfaces.
+ * Manages association between {@link XSComponent}s and generated
+ * {@link CTypeInfo}s.
  *
  * <p>
- * All the content interfaces are created, registered, and
- * maintained in this class.
+ * This class determines which component is mapped to (or is not mapped to)
+ * what types.
  *
  * @author
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
@@ -229,11 +230,11 @@
     /**
      * Checks if the given component is bound to a class.
      */
-    public final CElement isBound( XSElementDecl x ) {
+    public final CElement isBound( XSElementDecl x, XSComponent referer ) {
         CElementInfo r = boundElements.get(x);
         if(r!=null)
             return r;
-        return bindToType(x);
+        return bindToType(x,referer);
     }
 
     /**
@@ -241,11 +242,8 @@
      * If so, build that type and return that object.
      * If it is not being mapped to a type item, return null.
      */
-    public CTypeInfo bindToType( XSComponent sc ) {
-//        TypeToken t = domBinder.bind(sc);
-//        if(t!=null)     return t;
-//        else            return _bindToClass(sc,false);
-        return _bindToClass(sc,false);
+    public CTypeInfo bindToType( XSComponent sc, XSComponent referer ) {
+        return _bindToClass(sc,referer,false);
     }
 
     //
@@ -254,38 +252,40 @@
     // and making the bindToType invocation more type safe.
     //
 
-    public CElement bindToType( XSElementDecl e ) {
-        return (CElement)_bindToClass(e,false);
+    public CElement bindToType( XSElementDecl e, XSComponent referer ) {
+        return (CElement)_bindToClass(e,referer,false);
     }
 
-    public CClassInfo bindToType( XSComplexType t ) {
-        return bindToType(t,false);
-    }
-
-    public CClassInfo bindToType( XSComplexType t, boolean cannotBeDelayed ) {
+    public CClass bindToType( XSComplexType t, XSComponent referer, boolean cannotBeDelayed ) {
         // this assumption that a complex type always binds to a ClassInfo
         // does not hold for xs:anyType --- our current approach of handling
         // this idiosynchracy is to make sure that xs:anyType doesn't use
         // this codepath.
-        return (CClassInfo)_bindToClass(t,cannotBeDelayed);
+        return (CClass)_bindToClass(t,referer,cannotBeDelayed);
     }
 
-    public TypeUse bindToType( XSType t ) {
+    public TypeUse bindToType( XSType t, XSComponent referer ) {
         if(t instanceof XSSimpleType) {
             return Ring.get(SimpleTypeBuilder.class).build((XSSimpleType)t);
         } else
-            return _bindToClass(t,false);
+            return (CNonElement)_bindToClass(t,referer,false);
     }
 
     /**
+     * The real meat of the "bindToType" code.
+     *
      * @param cannotBeDelayed
      *      if the binding of the body of the class cannot be defered
      *      and needs to be done immediately. If the flag is false,
      *      the binding of the body will be done later, to avoid
      *      cyclic binding problem.
+     * @param referer
+     *      The component that refers to <tt>sc</tt>. This can be null,
+     *      if figuring out the referer is too hard, in which case
+     *      the error message might be less user friendly.
      */
     // TODO: consider getting rid of "cannotBeDelayed"
-    CTypeInfo _bindToClass( @NotNull XSComponent sc, boolean cannotBeDelayed ) {
+    CTypeInfo _bindToClass( @NotNull XSComponent sc, XSComponent referer, boolean cannotBeDelayed ) {
         // check if this class is already built.
         if(!bindMap.containsKey(sc)) {
             // craete a bind task
@@ -309,6 +309,23 @@
             if(bean==null)
                 return null;
 
+            // can this namespace generate a class?
+            if (bean instanceof CClassInfo) {
+                XSSchema os = sc.getOwnerSchema();
+                BISchemaBinding sb = builder.getBindInfo(os).get(BISchemaBinding.class);
+                if(sb!=null && !sb.map) {
+                    // nope
+                    getErrorReporter().error(sc.getLocator(),
+                        Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS, sc.apply( new ComponentNameFunction() ) );
+                    getErrorReporter().error(sb.getLocation(),
+                        Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE, os.getTargetNamespace() );
+                    if(referer!=null)
+                        getErrorReporter().error(referer.getLocator(),
+                            Messages.ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER, referer.apply( new ComponentNameFunction() ) );
+                }
+            }
+
+
             queueBuild( sc, bean );
         }
 
@@ -425,6 +442,7 @@
 
         BISchemaBinding sb =
             builder.getBindInfo(s).get(BISchemaBinding.class);
+        if(sb!=null)    sb.markAsAcknowledged();
 
         String name = null;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java
index 958267b..ccd1c85 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: CollisionInfo.java,v 1.1 2005/04/15 20:09:53 kohsuke Exp $
+ */
+
 
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java
index efed1df..bfd0d61 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.CTypeInfo;
-import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
 import com.sun.xml.internal.xsom.XSAnnotation;
@@ -55,20 +52,13 @@
         return selector.getCurrentRoot();
     }
 
-    protected CTypeInfo boundToType(XSComponent sc) {
-        if(sc==selector.getCurrentRoot())    return null;
-        return selector.bindToType(sc);
-    }
-
-
-
 
     protected final void createSimpleTypeProperty(XSSimpleType type,String propName) {
         BIProperty prop = BIProperty.getCustomization(type);
 
         SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
         // since we are building the simple type here, use buildDef
-        CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type));
+        CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type));
         getCurrentBean().addProperty(p);
     }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultClassBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultClassBinder.java
index e4c722b..8cf50cb 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultClassBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultClassBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,9 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
+import static com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder.getName;
+
 import java.util.Set;
 
 import javax.xml.namespace.QName;
@@ -35,6 +36,7 @@
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CClassInfoParent;
+import com.sun.tools.internal.xjc.model.CClassRef;
 import com.sun.tools.internal.xjc.model.CCustomizations;
 import com.sun.tools.internal.xjc.model.CElement;
 import com.sun.tools.internal.xjc.model.CElementInfo;
@@ -44,7 +46,9 @@
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BISchemaBinding;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BindInfo;
-import com.sun.xml.internal.bind.v2.TODO;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIXSubstitutable;
+import com.sun.tools.internal.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder;
+import com.sun.tools.internal.xjc.reader.xmlschema.ct.ComplexTypeBindingMode;
 import com.sun.xml.internal.xsom.XSAnnotation;
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
 import com.sun.xml.internal.xsom.XSAttributeDecl;
@@ -66,6 +70,8 @@
 import com.sun.xml.internal.xsom.XSWildcard;
 import com.sun.xml.internal.xsom.XSXPath;
 
+import org.xml.sax.Locator;
+
 /**
  * Default classBinder implementation. Honors &lt;jaxb:class> customizations
  * and default bindings.
@@ -107,6 +113,8 @@
         if(type.isGlobal()) {
             QName tagName = null;
             String className = deriveName(type);
+            Locator loc = type.getLocator();
+
             if(getGlobalBinding().isSimpleMode()) {
                 // in the simple mode, we may optimize it away
                 XSElementDecl referer = getSoleElementReferer(type);
@@ -114,8 +122,9 @@
                     // if a global element contains
                     // a collpsable complex type, we bind this element to a named one
                     // and collapses element and complex type.
-                    tagName = new QName(referer.getTargetNamespace(),referer.getName());
+                    tagName = getName(referer);
                     className = deriveName(referer);
+                    loc = referer.getLocator();
                 }
             }
 
@@ -123,7 +132,7 @@
 
             JPackage pkg = selector.getPackage(type.getTargetNamespace());
 
-            return new CClassInfo(model,pkg,className,type.getLocator(),getTypeName(type),tagName,type,bi.toCustomizationList());
+            return new CClassInfo(model,pkg,className, loc,getTypeName(type),tagName,type,bi.toCustomizationList());
         } else {
             XSElementDecl element = type.getScope();
 
@@ -140,11 +149,11 @@
                 // which creates unnecessary classes
                 return new CClassInfo( model, selector.getClassScope(),
                     deriveName(element), element.getLocator(), null,
-                    new QName(element.getTargetNamespace(),element.getName()), element, bi.toCustomizationList() );
+                    getName(element), element, bi.toCustomizationList() );
             }
 
 
-            CElement parentType = selector.isBound(element);
+            CElement parentType = selector.isBound(element,type);
 
             String className;
             CClassInfoParent scope;
@@ -154,7 +163,7 @@
              && parentType instanceof CElementInfo
              && ((CElementInfo)parentType).hasClass() ) {
                 // special case where we put a nested 'Type' element
-                scope = parentType;
+                scope = (CElementInfo)parentType;
                 className = "Type";
             } else {
                 // since the parent element isn't bound to a type, merge the customizations associated to it, too.
@@ -171,15 +180,11 @@
         }
     }
 
-    private QName getTypeName(XSType type) {
-        return new QName(type.getTargetNamespace(),type.getName());
-    }
-
     private QName getTypeName(XSComplexType type) {
         if(type.getRedefinedBy()!=null)
             return null;
         else
-            return getTypeName((XSType)type);
+            return getName(type);
     }
 
     /**
@@ -200,6 +205,14 @@
             // because nillable needs JAXBElement to represent correctly
             return false;
 
+        BIXSubstitutable bixSubstitutable = builder.getBindInfo(decl).get(BIXSubstitutable.class);
+        if(bixSubstitutable !=null) {
+            // see https://jaxb.dev.java.net/issues/show_bug.cgi?id=289
+            // this customization forces non-collapsing behavior.
+            bixSubstitutable.markAsAcknowledged();
+            return false;
+        }
+
         if( getGlobalBinding().isSimpleMode() && decl.isGlobal()) {
             // in the simple mode, we do more aggressive optimization, and get rid of
             // a complex type class if it's only used once from a global element
@@ -247,14 +260,14 @@
         CElement r = allow(decl,decl.getName());
 
         if(r==null) {
-            QName tagName = new QName(decl.getTargetNamespace(),decl.getName());
+            QName tagName = getName(decl);
             CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();
 
             if(decl.isGlobal()) {
                 if(isCollapsable(decl)) {
                     // we want the returned type to be built as a complex type,
                     // so the binding cannot be delayed.
-                    return selector.bindToType(decl.getType().asComplexType(),true);
+                    return selector.bindToType(decl.getType().asComplexType(),decl,true);
                 } else {
                     String className = null;
                     if(getGlobalBinding().isGenerateElementClass())
@@ -266,7 +279,7 @@
                     selector.boundElements.put(decl,cei);
 
                     stb.refererStack.push(decl);    // referer is element
-                    cei.initContentType( selector.bindToType(decl.getType()), decl, decl.getDefaultValue() );
+                    cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                     stb.refererStack.pop();
                     r = cei;
                 }
@@ -276,7 +289,7 @@
         // have the substitution member derive from the substitution head
         XSElementDecl top = decl.getSubstAffiliation();
         if(top!=null) {
-            CElement topci = selector.bindToType(top);
+            CElement topci = selector.bindToType(top,decl);
 
             if(r instanceof CClassInfo && topci instanceof CClassInfo)
                 ((CClassInfo)r).setBaseClass((CClassInfo)topci);
@@ -284,8 +297,6 @@
                 ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
         }
 
-        TODO.checkSpec();
-
         return r;
     }
 
@@ -309,7 +320,7 @@
 
         if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
             return new CClassInfo(model,selector.getClassScope(),
-                    deriveName(type), type.getLocator(), getTypeName(type), null, type, null );
+                    deriveName(type), type.getLocator(), getName(type), null, type, null );
         }
 
         return never();
@@ -394,7 +405,30 @@
 
         decl.markAsAcknowledged();
 
-        // determine the package to put this class in.
+        // first consider binding to the class reference.
+        String ref = decl.getExistingClassRef();
+        if(ref!=null) {
+            if(!JJavaName.isFullyQualifiedClassName(ref)) {
+                Ring.get(ErrorReceiver.class).error( decl.getLocation(),
+                    Messages.format(Messages.ERR_INCORRECT_CLASS_NAME,ref) );
+                // recover by ignoring @ref
+            } else {
+                if(component instanceof XSComplexType) {
+                    // UGLY UGLY UGLY
+                    // since we are not going to bind this complex type, we need to figure out
+                    // its binding mode without actually binding it (and also expose this otherwise
+                    // hidden mechanism into this part of the code.)
+                    //
+                    // this code is potentially dangerous as the base class might have been bound
+                    // in different ways. To be correct, we need to figure out how the content type
+                    // would have been bound, from the schema.
+                    Ring.get(ComplexTypeFieldBuilder.class).recordBindingMode(
+                        (XSComplexType)component, ComplexTypeBindingMode.NORMAL
+                    );
+                }
+                return new CClassRef(model, component, decl, bindInfo.toCustomizationList() );
+            }
+        }
 
         String clsName = decl.getClassName();
         if(clsName==null) {
@@ -407,7 +441,7 @@
                 // recover by generating a pseudo-random name
                 defaultBaseName = "undefined"+component.hashCode();
             }
-            clsName = deriveName( defaultBaseName, component );
+            clsName = builder.deriveName( defaultBaseName, component );
         } else {
             if( !JJavaName.isJavaIdentifier(clsName) ) {
                 // not a valid Java class name
@@ -423,13 +457,12 @@
 
         if(component instanceof XSType) {
             XSType t = (XSType) component;
-            if(t.isGlobal())
-                typeName = new QName(t.getTargetNamespace(),t.getName());
+            typeName = getName(t);
         }
 
         if (component instanceof XSElementDecl) {
             XSElementDecl e = (XSElementDecl) component;
-            elementName = new QName(e.getTargetNamespace(),e.getName());
+            elementName = getName(e);
         }
 
         if (component instanceof XSElementDecl && !isCollapsable((XSElementDecl)component)) {
@@ -442,7 +475,7 @@
 
             stb.refererStack.push(component);    // referer is element
             cei.initContentType(
-                selector.bindToType(e.getType()),
+                selector.bindToType(e.getType(),e),
                 e,e.getDefaultValue());
             stb.refererStack.pop();
             return cei;
@@ -476,7 +509,7 @@
      * Use the name of the schema component as the default name.
      */
     private String deriveName( XSDeclaration comp ) {
-        return deriveName( comp.getName(), comp );
+        return builder.deriveName( comp.getName(), comp );
     }
 
     /**
@@ -485,38 +518,11 @@
      * deriving a default name.
      */
     private String deriveName( XSComplexType comp ) {
-        String seed = deriveName( comp.getName(), comp );
+        String seed = builder.deriveName( comp.getName(), comp );
         int cnt = comp.getRedefinedCount();
         for( ; cnt>0; cnt-- )
             seed = "Original"+seed;
         return seed;
     }
 
-    /**
-     * Derives a name from a schema component.
-     *
-     * This method handles prefix/suffix modification and
-     * XML-to-Java name conversion.
-     *
-     * @param name
-     *      The base name. This should be things like element names
-     *      or type names.
-     * @param comp
-     *      The component from which the base name was taken.
-     *      Used to determine how names are modified.
-     */
-    private String deriveName( String name, XSComponent comp ) {
-        XSSchema owner = comp.getOwnerSchema();
-
-        name = builder.getNameConverter().toClassName(name);
-
-        if( owner!=null ) {
-            BISchemaBinding sb = builder.getBindInfo(
-                owner).get(BISchemaBinding.class);
-
-            if(sb!=null)    name = sb.mangleClassName(name,comp);
-        }
-
-        return name;
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java
index c174d74..6558c12 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ErrorReporter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ErrorReporter.java
index c5ffb55..e982dd7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ErrorReporter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ErrorReporter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.ErrorReceiver;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java
index 4e25af6..80cbfc9 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.HashMap;
@@ -72,6 +71,7 @@
     public Expression wildcard(XSWildcard wc) {
         if(wildcard==null)
             wildcard = new GWildcardElement();
+        wildcard.merge(wc);
         wildcard.particles.add(current);
         return wildcard;
     }
@@ -104,7 +104,7 @@
     }
 
     public Element elementDecl(XSElementDecl decl) {
-        QName n = new QName(decl.getTargetNamespace(),decl.getName());
+        QName n = BGMBuilder.getName(decl);
 
         GElementImpl e = decls.get(n);
         if(e==null)
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java
index cdabcec..50ffbd3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.Collection;
@@ -83,7 +82,9 @@
                 continue;
             }
             if(e instanceof GWildcardElement) {
-                rtsb.getRefs().add(new RawTypeSetBuilder.WildcardRef(WildcardMode.SKIP));
+                GWildcardElement w = (GWildcardElement)e;
+                rtsb.getRefs().add(new RawTypeSetBuilder.WildcardRef(
+                    w.isStrict() ? WildcardMode.STRICT : WildcardMode.SKIP));
                 continue;
             }
             assert false : e;   // no other kind should be here
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java
index 076ee51..871e408 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java
index 6d21fbf..2d151fa 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java
index a1c18b3..e2bb5e2 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.reader.gbind.Element;
+import com.sun.xml.internal.xsom.XSWildcard;
 
 /**
  * {@link Element} that represents a wildcard,
@@ -33,6 +33,14 @@
  * @author Kohsuke Kawaguchi
  */
 final class GWildcardElement extends GElement {
+
+    /**
+     * If true, bind to <tt>Object</tt> for eager JAXB unmarshalling.
+     * Otherwise bind to DOM (I hate "you can put both" semantics,
+     * so I'm not going to do that in this binding mode.)
+     */
+    private boolean strict = true;
+
     public String toString() {
         return "#any";
     }
@@ -40,4 +48,16 @@
     String getPropertyNameSeed() {
         return "any";
     }
+
+    public void merge(XSWildcard wc) {
+        switch(wc.getMode()) {
+        case XSWildcard.LAX:
+        case XSWildcard.SKIP:
+            strict = false;
+        }
+    }
+
+    public boolean isStrict() {
+        return strict;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties
index 4b5d824..2eccd9b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
@@ -142,4 +167,15 @@
 
 ERR_MULTIPLE_GLOBAL_BINDINGS_OTHER = \
     (related to above) but one is already given at this location
+
+ERR_REFERENCE_TO_NONEXPORTED_CLASS = \
+    {0} is in a referenced schema and do not have the corresponding Java class specified by \
+    <jaxb:class ref="..."/> customization. Therefore it cannot be referenced from outside.
+
+ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE = \
+    (related to above) The schema for namespace "{0}" (which includes the above component) is \
+    designated for reference only by this customization.
+
+ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER = \
+    (related to above) The problematic schema component is referenced from this component: {0}
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java
index 59f9a35..e0db712 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
  * have any questions.
  */
 
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.text.MessageFormat;
@@ -137,4 +136,11 @@
         "ERR_MULTIPLE_GLOBAL_BINDINGS";
     public static final String ERR_MULTIPLE_GLOBAL_BINDINGS_OTHER =
         "ERR_MULTIPLE_GLOBAL_BINDINGS_OTHER";
+
+    public static final String ERR_REFERENCE_TO_NONEXPORTED_CLASS =
+        "ERR_REFERENCE_TO_NONEXPORTED_CLASS";
+    public static final String ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE =
+        "ERR_REFERENCE_TO_NONEXPORTED_CLASS_MAP_FALSE";
+    public static final String ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER =
+        "ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER";
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java
index 9b53ac1..898dba6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import com.sun.tools.internal.xjc.model.Multiplicity;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ParticleBinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ParticleBinder.java
index 4783215..f345ab1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ParticleBinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ParticleBinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.text.ParseException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java
index 4862e9a..55d6a24 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.HashSet;
@@ -32,16 +31,22 @@
 import javax.xml.namespace.QName;
 
 import com.sun.tools.internal.xjc.model.CAdapter;
+import com.sun.tools.internal.xjc.model.CClass;
 import com.sun.tools.internal.xjc.model.CClassInfo;
+import com.sun.tools.internal.xjc.model.CCustomizations;
 import com.sun.tools.internal.xjc.model.CElement;
 import com.sun.tools.internal.xjc.model.CElementInfo;
 import com.sun.tools.internal.xjc.model.CElementPropertyInfo;
 import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
 import com.sun.tools.internal.xjc.model.CTypeRef;
+import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.model.Multiplicity;
+import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.reader.RawTypeSet;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIDom;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
+import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIXSubstitutable;
 import com.sun.xml.internal.bind.v2.model.core.ID;
 import com.sun.xml.internal.bind.v2.model.core.WildcardMode;
 import com.sun.xml.internal.xsom.XSElementDecl;
@@ -125,14 +130,15 @@
 
     public void elementDecl(XSElementDecl decl) {
 
-        QName n = new QName(decl.getTargetNamespace(),decl.getName());
+        QName n = BGMBuilder.getName(decl);
         if(elementNames.add(n)) {
-            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl);
+            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl,null);
             if(elementBean==null)
-                refs.add(new RawTypeSet.XmlTypeRef(decl));
+                refs.add(new XmlTypeRef(decl));
             else {
-                if(elementBean instanceof CClassInfo)
-                    refs.add(new CClassInfoRef(decl,(CClassInfo)elementBean));
+                // yikes!
+                if(elementBean instanceof CClass)
+                    refs.add(new CClassRef(decl,(CClass)elementBean));
                 else
                     refs.add(new CElementInfoRef(decl,(CElementInfo)elementBean));
             }
@@ -187,21 +193,20 @@
         }
     }
 
-
     /**
      * Reference to a class that maps from an element.
      */
-    public static final class CClassInfoRef extends RawTypeSet.Ref {
-        public final CClassInfo target;
+    public static final class CClassRef extends RawTypeSet.Ref {
+        public final CClass target;
         public final XSElementDecl decl;
 
-        CClassInfoRef(XSElementDecl decl, CClassInfo target) {
+        CClassRef(XSElementDecl decl, CClass target) {
             this.decl = decl;
             this.target = target;
         }
 
         protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
-            return new CTypeRef(target,target.getElementName(),decl.isNillable(),decl.getDefaultValue());
+            return new CTypeRef(target,decl);
         }
 
         protected void toElementRef(CReferencePropertyInfo prop) {
@@ -228,7 +233,7 @@
     /**
      * Reference to a class that maps from an element.
      */
-    public static final class CElementInfoRef extends RawTypeSet.Ref {
+    public final class CElementInfoRef extends RawTypeSet.Ref {
         public final CElementInfo target;
         public final XSElementDecl decl;
 
@@ -242,8 +247,7 @@
             CAdapter a = target.getProperty().getAdapter();
             if(a!=null && ep!=null) ep.setAdapter(a);
 
-            return new CTypeRef(target.getContentType(),target.getElementName(),
-                decl.isNillable(),decl.getDefaultValue());
+            return new CTypeRef(target.getContentType(),decl);
         }
 
         protected void toElementRef(CReferencePropertyInfo prop) {
@@ -254,16 +258,22 @@
             // if element substitution can occur, no way it can be mapped to a list of types
             if(decl.getSubstitutables().size()>1)
                 return RawTypeSet.Mode.MUST_BE_REFERENCE;
+            // BIXSubstitutable also simulates this effect. Useful for separate compilation
+            BIXSubstitutable subst = builder.getBindInfo(decl).get(BIXSubstitutable.class);
+            if(subst!=null) {
+                subst.markAsAcknowledged();
+                return RawTypeSet.Mode.MUST_BE_REFERENCE;
+            }
 
             // we have no place to put an adater if this thing maps to a type
             CElementPropertyInfo p = target.getProperty();
             // if we have an adapter or IDness, which requires special
             // annotation, and there's more than one element,
             // we have no place to put the special annotation, so we need JAXBElement.
-            if(parent.refs.size()>1 || !parent.mul.isAtMostOnce()) {
-                if(p.getAdapter()!=null || p.id()!=ID.NONE)
-                    return RawTypeSet.Mode.MUST_BE_REFERENCE;
-            }
+            if((parent.refs.size()>1 || !parent.mul.isAtMostOnce()) && p.id()!=ID.NONE)
+                return RawTypeSet.Mode.MUST_BE_REFERENCE;
+            if(parent.refs.size() > 1 && p.getAdapter() != null)
+                return RawTypeSet.Mode.MUST_BE_REFERENCE;
 
             return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
         }
@@ -280,4 +290,83 @@
             return target.getProperty().getExpectedMimeType();
         }
     }
+
+    /**
+     * References to a type. Could be global or local.
+     */
+    public static final class XmlTypeRef extends RawTypeSet.Ref {
+        private final XSElementDecl decl;
+        private final TypeUse target;
+
+        public XmlTypeRef(XSElementDecl decl) {
+            this.decl = decl;
+            SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
+            stb.refererStack.push(decl);
+            TypeUse r = Ring.get(ClassSelector.class).bindToType(decl.getType(),decl);
+            stb.refererStack.pop();
+            target = r;
+        }
+
+        protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
+            if(ep!=null && target.getAdapterUse()!=null)
+                ep.setAdapter(target.getAdapterUse());
+            return new CTypeRef(target.getInfo(),decl);
+        }
+
+        /**
+         * The whole type set can be later bound to a reference property,
+         * in which case we need to generate additional code to wrap this
+         * type reference into an element class.
+         *
+         * This method generates such an element class and returns it.
+         */
+        protected void toElementRef(CReferencePropertyInfo prop) {
+            CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
+            Model model = Ring.get(Model.class);
+
+            CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList();
+
+            if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) {
+                CClassInfo bean = new CClassInfo(model,scope,
+                                model.getNameConverter().toClassName(decl.getName()),
+                                decl.getLocator(), null, BGMBuilder.getName(decl), decl,
+                                custs);
+                bean.setBaseClass((CClassInfo)target);
+                prop.getElements().add(bean);
+            } else {
+                CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target,
+                        decl.getDefaultValue(), decl, custs, decl.getLocator());
+                prop.getElements().add(e);
+            }
+        }
+
+        protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
+            // if we have an adapter or IDness, which requires special
+            // annotation, and there's more than one element,
+            // we have no place to put the special annotation, so we need JAXBElement.
+            if((parent.refs.size()>1 || !parent.mul.isAtMostOnce()) && target.idUse()!=ID.NONE)
+                return RawTypeSet.Mode.MUST_BE_REFERENCE;
+            if(parent.refs.size() > 1 && target.getAdapterUse() != null)
+                return RawTypeSet.Mode.MUST_BE_REFERENCE;
+
+            // nillable and optional at the same time. needs an element wrapper to distinguish those
+            // two states. But this is not a hard requirement.
+            if(decl.isNillable() && parent.mul.isOptional())
+                return RawTypeSet.Mode.CAN_BE_TYPEREF;
+
+            return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
+        }
+
+        protected boolean isListOfValues() {
+            return target.isCollection();
+        }
+
+        protected ID id() {
+            return target.idUse();
+        }
+
+        protected MimeType getExpectedMimeType() {
+            return target.getExpectedMimeType();
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java
index 6538872..fbbe569 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java
index 39fc39d..b72a03b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.io.StringWriter;
@@ -38,13 +37,14 @@
 import java.util.Stack;
 
 import javax.activation.MimeTypeParseException;
-import javax.xml.namespace.QName;
 
 import com.sun.codemodel.internal.JJavaName;
 import com.sun.codemodel.internal.util.JavadocEscapeWriter;
+import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
 import com.sun.tools.internal.xjc.model.CClassInfo;
 import com.sun.tools.internal.xjc.model.CClassInfoParent;
+import com.sun.tools.internal.xjc.model.CClassRef;
 import com.sun.tools.internal.xjc.model.CEnumConstant;
 import com.sun.tools.internal.xjc.model.CEnumLeafInfo;
 import com.sun.tools.internal.xjc.model.CNonElement;
@@ -328,7 +328,7 @@
             return conv.getTypeUse(type);
         }
 
-        // look for enum customization, which is noather user specified conversion
+        // look for enum customization, which is another user specified conversion
         BIEnum en = info.get(BIEnum.class);
         if( en!=null ) {
             en.markAsAcknowledged();
@@ -346,6 +346,19 @@
                     // recover by ignoring this customization
                     return null;
                 }
+
+                // reference?
+                if(en.ref!=null) {
+                    if(!JJavaName.isFullyQualifiedClassName(en.ref)) {
+                        Ring.get(ErrorReceiver.class).error( en.getLocation(),
+                            Messages.format(Messages.ERR_INCORRECT_CLASS_NAME, en.ref) );
+                        // recover by ignoring @ref
+                        return null;
+                    }
+
+                    return new CClassRef(model, type, en, info.toCustomizationList() );
+                }
+
                 // list and union cannot be mapped to a type-safe enum,
                 // so in this stage we can safely cast it to XSRestrictionSimpleType
                 return bindToTypeSafeEnum( (XSRestrictionSimpleType)type,
@@ -386,7 +399,7 @@
             }
         }
 
-        return getClassSelector()._bindToClass(type,false);
+        return (CNonElement)getClassSelector()._bindToClass(type,null,false);
     }
 
     /**
@@ -512,8 +525,9 @@
             }
             className = type.getName();
         }
+
         // we apply name conversion in any case
-        className = builder.getNameConverter().toClassName(className);
+        className = builder.deriveName(className,type);
 
         {// compute Javadoc
             StringWriter out = new StringWriter();
@@ -536,7 +550,7 @@
         if(use.isCollection())
             return null;    // can't bind a list to enum constant
 
-        CNonElement baseDt = (CNonElement)use.getInfo();   // for now just ignore that case
+        CNonElement baseDt = use.getInfo();   // for now just ignore that case
 
         if(baseDt instanceof CClassInfo)
             return null;    // can't bind to an enum if the base is a class, since we don't have the value constrctor
@@ -571,18 +585,13 @@
             }
         }
 
-        QName typeName = null;
-        if(type.isGlobal())
-            typeName = new QName(type.getTargetNamespace(),type.getName());
-
-
         // use the name of the simple type as the name of the class.
         CClassInfoParent scope;
         if(type.isGlobal())
             scope = new CClassInfoParent.Package(getClassSelector().getPackage(type.getTargetNamespace()));
         else
             scope = getClassSelector().getClassScope();
-        CEnumLeafInfo xducer = new CEnumLeafInfo( model, typeName, scope,
+        CEnumLeafInfo xducer = new CEnumLeafInfo( model, BGMBuilder.getName(type), scope,
             className, baseDt, memberList, type,
             builder.getBindInfo(type).toCustomizationList(), loc );
         xducer.javadoc = javadoc;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java
index 9a424a1..e425d27 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/WildcardNameClassBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/WildcardNameClassBuilder.java
index 2710125..774ab96 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/WildcardNameClassBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/WildcardNameClassBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
index f45c12c..e72dec4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
index 210738c..c5de503 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,8 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
-import java.util.Collections;
-
-import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.UnmarshallerHandler;
@@ -37,8 +33,6 @@
 import com.sun.tools.internal.xjc.Options;
 import com.sun.tools.internal.xjc.SchemaCache;
 import com.sun.tools.internal.xjc.reader.Const;
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.xsom.parser.AnnotationContext;
 import com.sun.xml.internal.xsom.parser.AnnotationParser;
 import com.sun.xml.internal.xsom.parser.AnnotationParserFactory;
@@ -69,44 +63,9 @@
      */
     private ValidatorHandler validator;
 
-    /**
-     * Lazily parsed schema for the binding file.
-     */
-    private static final SchemaCache bindingFileSchema = new SchemaCache(AnnotationParserFactoryImpl.class.getResource("binding.xsd"));
-
-    /**
-     * Lazily prepared {@link JAXBContext}.
-     */
-    private static JAXBContextImpl customizationContext;
-
-    private static JAXBContextImpl getJAXBContext() {
-        synchronized(AnnotationParserFactoryImpl.class) {
-            try {
-                if(customizationContext==null)
-                    customizationContext = new JAXBContextImpl(
-                        new Class[] {
-                            BindInfo.class, // for xs:annotation
-                            BIClass.class,
-                            BIConversion.User.class,
-                            BIConversion.UserAdapter.class,
-                            BIDom.class,
-                            BIXDom.class,
-                            BIEnum.class,
-                            BIEnumMember.class,
-                            BIGlobalBinding.class,
-                            BIProperty.class,
-                            BISchemaBinding.class
-                        }, Collections.<TypeReference>emptyList(), null, false);
-                return customizationContext;
-            } catch (JAXBException e) {
-                throw new AssertionError(e);
-            }
-        }
-    }
-
     public AnnotationParser create() {
         return new AnnotationParser() {
-            private Unmarshaller u = getJAXBContext().createUnmarshaller();
+            private Unmarshaller u = BindInfo.getJAXBContext().createUnmarshaller();
 
             private UnmarshallerHandler handler;
 
@@ -139,7 +98,7 @@
                         && getSideHandler()==null) {
                             // set up validator
                             if(validator==null)
-                                validator = bindingFileSchema.newValidator();
+                                validator = BindInfo.bindingFileSchema.newValidator();
                             validator.setErrorHandler(errorHandler);
                             startForking(uri,localName,qName,atts,new ValidatorProtecter(validator));
                         }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java
index 4e32c91..fc80bf4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
@@ -32,8 +31,7 @@
 
 import com.sun.tools.internal.xjc.reader.Const;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
-
-import org.xml.sax.Locator;
+import com.sun.istack.internal.Nullable;
 
 /**
  * Class declaration.
@@ -49,14 +47,6 @@
  */
 @XmlRootElement(name="class")
 public final class BIClass extends AbstractDeclarationImpl {
-
-    public BIClass( Locator loc, String _className, String _implClass, String _javadoc ) {
-        super(loc);
-        this.className = _className;
-        this.javadoc = _javadoc;
-        this.userSpecifiedImplClass = _implClass;
-    }
-
     protected BIClass() {
     }
 
@@ -65,13 +55,14 @@
 
     /**
      * Gets the specified class name, or null if not specified.
+     * (Not a fully qualified name.)
      *
      * @return
      *      Returns a class name. The caller should <em>NOT</em>
      *      apply XML-to-Java name conversion to the name
      *      returned from this method.
      */
-    public String getClassName() {
+    public @Nullable String getClassName() {
         if( className==null )   return null;
 
         BIGlobalBinding gb = getBuilder().getGlobalBinding();
@@ -95,6 +86,20 @@
         return userSpecifiedImplClass;
     }
 
+    @XmlAttribute(name="ref")
+    private String ref;
+
+    /**
+     * Reference to the existing class, or null.
+     * Fully qualified name.
+     *
+     * <p>
+     * Caller needs to perform error check on this.
+     */
+    public String getExistingClassRef() {
+        return ref;
+    }
+
     @XmlElement
     private String javadoc;
     /**
@@ -105,7 +110,14 @@
 
     public QName getName() { return NAME; }
 
+    public void setParent(BindInfo p) {
+        super.setParent(p);
+        // if this specifies a reference to external class,
+        // then it's OK even if noone actually refers this class.
+        if(ref!=null)
+            markAsAcknowledged();
+    }
+
     /** Name of this declaration. */
-    public static final QName NAME = new QName(
-        Const.JAXB_NSURI, "class" );
+    public static final QName NAME = new QName( Const.JAXB_NSURI, "class" );
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java
index 265ffe1..42d82d5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.DatatypeConverter;
@@ -42,6 +41,7 @@
 import com.sun.codemodel.internal.JPackage;
 import com.sun.codemodel.internal.JType;
 import com.sun.codemodel.internal.JVar;
+import com.sun.codemodel.internal.JConditional;
 import com.sun.tools.internal.xjc.ErrorReceiver;
 import com.sun.tools.internal.xjc.model.CAdapter;
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
@@ -233,6 +233,10 @@
 
                 // RESULT: <value>.<method>()
                 inv = $value.invoke(printMethod);
+
+                // check value is not null ... if(value == null) return null;
+                JConditional jcon = marshal.body()._if($value.eq(JExpr._null()));
+                jcon._then()._return(JExpr._null());
             } else {
                 // RESULT: <className>.<method>(<value>)
                 if(this.printMethod==null) {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java
index 77fab0f..4a13c20 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.Collection;
@@ -52,7 +51,9 @@
      *
      * <p>
      * This method can be only called from {@link BindInfo},
-     * and only once.
+     * and only once. This is a good opportunity to do some
+     * follow-up initialization after JAXB unmarshalling
+     * populated {@link BIDeclaration}.
      */
     void setParent( BindInfo parent );
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java
index 553cbd9..ae45fb1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java
index 643e8b9..2ede136 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.HashMap;
@@ -62,7 +61,13 @@
 
     /** Gets the specified class name, or null if not specified. */
     @XmlAttribute(name="name")
-    public final String className = null;
+    public String className = null;
+
+    /**
+     * @see BIClass#getExistingClassRef()
+     */
+    @XmlAttribute(name="ref")
+    public String ref;
 
     /**
      * Gets the javadoc comment specified in the customization.
@@ -90,6 +95,11 @@
         super.setParent(p);
         for( BIEnumMember mem : members.values() )
             mem.setParent(p);
+
+        // if this specifies a reference to external class,
+        // then it's OK even if noone actually refers this class.
+        if(ref!=null)
+            markAsAcknowledged();
     }
 
     /** Name of this declaration. */
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
index 1696771..0a3a657 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
index 062516e..4695474 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.Collections;
@@ -133,6 +132,10 @@
         return simpleMode!=null;
     }
 
+    public boolean isRestrictionFreshType() {
+        return treatRestrictionLikeNewType !=null;
+    }
+
     public EnumMemberMode getEnumMemberMode() {
         return generateEnumMemberName;
     }
@@ -271,6 +274,12 @@
     String simpleMode = null;
 
     /**
+     * Handles complex type restriction as if it were a new type.
+     */
+    @XmlElement(name="treatRestrictionLikeNewType",namespace=Const.XJC_EXTENSION_URI)
+    String treatRestrictionLikeNewType = null;
+
+    /**
      * True to generate a class for elements by default.
      */
     @XmlAttribute
@@ -279,6 +288,11 @@
     @XmlElement(namespace=Const.XJC_EXTENSION_URI)
     Boolean generateElementProperty = null;
 
+    @XmlAttribute(name="generateElementProperty")     // for JAXB unmarshaller
+    private void setGenerateElementPropertyStd(boolean value) {
+        generateElementProperty = value;
+    }
+
     @XmlAttribute
     boolean choiceContentProperty = false;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java
index 8026848..d2b3b43 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.Collection;
@@ -280,7 +279,7 @@
     }
 
     public CValuePropertyInfo createValueProperty(String defaultName,boolean forConstant,
-        XSComponent source,TypeUse tu) {
+        XSComponent source,TypeUse tu, QName typeName) {
 
         markAsAcknowledged();
         constantPropertyErrorCheck();
@@ -292,7 +291,7 @@
                 name = JJavaName.getPluralForm(name);
         }
 
-        return wrapUp(new CValuePropertyInfo(name, source,getCustomizations(source),source.getLocator(), tu ),source);
+        return wrapUp(new CValuePropertyInfo(name, source,getCustomizations(source),source.getLocator(), tu, typeName ),source);
     }
 
     public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) {
@@ -312,12 +311,12 @@
                 name = JJavaName.getPluralForm(name);
         }
 
-        QName n = new QName(use.getDecl().getTargetNamespace(),use.getDecl().getName());
-
         markAsAcknowledged();
         constantPropertyErrorCheck();
 
-        return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(), n, tu, use.isRequired() ),use);
+        return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(),
+                BGMBuilder.getName(use.getDecl()), tu,
+                BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use);
     }
 
     /**
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
index 210ea4e..f0ab6e0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
@@ -79,6 +78,14 @@
     private PackageInfo packageInfo = new PackageInfo();
 
     /**
+     * If false, it means not to generate any classes from this namespace.
+     * No ObjectFactory, no classes (the only way to bind them is by using
+     * &lt;jaxb:class ref="..."/>)
+     */
+    @XmlAttribute(name="map")
+    public boolean map = true;
+
+    /**
      * Default naming rule, that doesn't change the name.
      */
     private static final NamingRule defaultNamingRule = new NamingRule("","");
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java
index 954878c..5c641df 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java
index 5e70e34..c7ad95c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
index e9808c3..9e3a547 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java
new file mode 100644
index 0000000..d163751
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+
+import com.sun.tools.internal.xjc.reader.Const;
+
+/**
+ * Forces a non-collapsing behavior to allow extension schemas
+ * to perform element substitutions.
+ *
+ * See https://jaxb.dev.java.net/issues/show_bug.cgi?id=289
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1.1
+ */
+@XmlRootElement(name="substitutable",namespace= Const.XJC_EXTENSION_URI)
+public final class BIXSubstitutable extends AbstractDeclarationImpl {
+    public final QName getName() { return NAME; }
+
+    /** Name of the conversion declaration. */
+    public static final QName NAME = new QName(Const.XJC_EXTENSION_URI,"substitutable");
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java
index 09f889e..cfc7d75 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.io.FilterWriter;
@@ -30,9 +29,12 @@
 import java.io.StringWriter;
 import java.io.Writer;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
 import javax.xml.bind.annotation.XmlAnyElement;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlMixed;
@@ -44,14 +46,17 @@
 import javax.xml.transform.stream.StreamResult;
 
 import com.sun.codemodel.internal.JDocComment;
+import com.sun.tools.internal.xjc.SchemaCache;
 import com.sun.tools.internal.xjc.model.CCustomizations;
 import com.sun.tools.internal.xjc.model.CPluginCustomization;
 import com.sun.tools.internal.xjc.model.Model;
 import com.sun.tools.internal.xjc.reader.Ring;
 import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
 import com.sun.xml.internal.bind.annotation.XmlLocation;
+import com.sun.xml.internal.bind.api.TypeReference;
 import com.sun.xml.internal.bind.marshaller.MinimumEscapeHandler;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.xsom.XSComponent;
 
 import org.w3c.dom.Element;
@@ -304,4 +309,40 @@
     /** An instance with the empty contents. */
     public final static BindInfo empty = new BindInfo();
 
+    /**
+     * Lazily prepared {@link JAXBContext}.
+     */
+    private static JAXBContextImpl customizationContext;
+
+    public static JAXBContextImpl getJAXBContext() {
+        synchronized(AnnotationParserFactoryImpl.class) {
+            try {
+                if(customizationContext==null)
+                    customizationContext = new JAXBContextImpl(
+                        new Class[] {
+                            BindInfo.class, // for xs:annotation
+                            BIClass.class,
+                            BIConversion.User.class,
+                            BIConversion.UserAdapter.class,
+                            BIDom.class,
+                            BIXDom.class,
+                            BIXSubstitutable.class,
+                            BIEnum.class,
+                            BIEnumMember.class,
+                            BIGlobalBinding.class,
+                            BIProperty.class,
+                            BISchemaBinding.class
+                        }, Collections.<TypeReference>emptyList(),
+                            Collections.<Class,Class>emptyMap(), null, false, null, false, false);
+                return customizationContext;
+            } catch (JAXBException e) {
+                throw new AssertionError(e);
+            }
+        }
+    }
+
+    /**
+     * Lazily parsed schema for the binding file.
+     */
+    public static final SchemaCache bindingFileSchema = new SchemaCache(BindInfo.class.getResource("binding.xsd"));
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java
index c61e323..3e98bda 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlTransient;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
index 8a65a4c..0315424 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.ValidationEventHandler;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java
index c48a8ac..812ebc6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlEnum;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
index 34308f8..f2b747b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java
index 7ab528a..1644ddc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlEnumValue;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties
index 0c9db62..d1029bf 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/Messages.java
index 7dc8549..fa1a186 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java
index dfccd35..d94459e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
 import javax.xml.bind.annotation.XmlEnumValue;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng
index d8de4ab..3386af6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng
@@ -1,4 +1,28 @@
 <?xml version="1.0"?>
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE grammar [
 
 <!ENTITY XJCURI "http://java.sun.com/xml/ns/jaxb/xjc">
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd
index 77b8cd1..f746a88 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,11 +23,19 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <!-- THIS IS A GENERATED FILE. DO NOT MODIFY. -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
   <xs:import namespace="http://java.sun.com/xml/ns/jaxb/xjc" schemaLocation="xjc.xsd"/>
   <xs:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="xs.xsd"/>
+  <xs:element name="bindings">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="schemaLocation" type="xs:string" />
+      <xs:attribute name="node" type="xs:string" /> 
+    </xs:complexType>
+  </xs:element>
   <xs:element name="declaration" abstract="true"/>
   <xs:element name="globalBindings" substitutionGroup="jaxb:declaration">
     <xs:complexType>
@@ -46,6 +53,7 @@
         <xs:element ref="xjc:typeSubstitution"/>
         <xs:element ref="xjc:smartWildcardDefaultBinding"/>
         <xs:element ref="xjc:simple"/>
+        <xs:element ref="xjc:treatRestrictionLikeNewType"/>
         <xs:group   ref="xjc:globalJavaType" />
         <xs:element ref="xjc:generateElementProperty"/>
         <xs:element ref="xjc:noMarshaller"/>
@@ -114,6 +122,7 @@
       <xs:attribute name="choiceContentProperty" type="xs:boolean"/>
       <xs:attribute name="generateValueClass" type="xs:boolean"/>
       <xs:attribute name="generateElementClass" type="xs:boolean"/>
+      <xs:attribute name="generateElementProperty" type="xs:boolean"/>
       <xs:attribute name="enableValidation" type="xs:boolean"/>
       <xs:attribute name="enableFailFastCheck" type="xs:boolean"/>
     </xs:complexType>
@@ -129,6 +138,7 @@
         <xs:element minOccurs="0" ref="jaxb:package"/>
         <xs:element minOccurs="0" ref="jaxb:nameXmlTransform"/>
       </xs:sequence>
+      <xs:attribute name="map" type="xs:boolean" />
     </xs:complexType>
   </xs:element>
   <xs:element name="package">
@@ -141,13 +151,13 @@
   </xs:element>
   <xs:element name="nameXmlTransform">
     <xs:complexType>
-      <xs:choice minOccurs="0" maxOccurs="unbounded">
-        <xs:element ref="jaxb:typeName"/>
-        <xs:element ref="jaxb:elementName"/>
-        <xs:element ref="jaxb:attributeName"/>
-        <xs:element ref="jaxb:modelGroupName"/>
-        <xs:element ref="jaxb:anonymousTypeName"/>
-      </xs:choice>
+      <xs:all>
+        <xs:element ref="jaxb:typeName" minOccurs='0'/>
+        <xs:element ref="jaxb:elementName" minOccurs='0'/>
+        <xs:element ref="jaxb:attributeName" minOccurs='0'/>
+        <xs:element ref="jaxb:modelGroupName" minOccurs='0'/>
+        <xs:element ref="jaxb:anonymousTypeName" minOccurs='0'/>
+      </xs:all>
     </xs:complexType>
   </xs:element>
   <xs:element name="typeName">
@@ -190,6 +200,7 @@
       </xs:sequence>
       <xs:attribute name="name" type="xs:string"/>
       <xs:attribute name="implClass"/>
+      <xs:attribute name="ref"/>
     </xs:complexType>
   </xs:element>
   <xs:element name="property" substitutionGroup="jaxb:declaration">
@@ -250,6 +261,7 @@
         </xs:simpleType>
       </xs:attribute>
       <xs:attribute name="name"/>
+      <xs:attribute name="ref"/>
     </xs:complexType>
   </xs:element>
   <xs:element name="typesafeEnumMember" substitutionGroup="jaxb:declaration">
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
index 2a4c6cf..3facd39 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 @XmlSchema(elementFormDefault = QUALIFIED, namespace=Const.JAXB_NSURI)
 package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html
index 4e0c1cb..af2b0a5 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <body>
 Object Model that represents customization declarations.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd
index 585b480..4536da0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
   <xs:import namespace="http://java.sun.com/xml/ns/jaxb" schemaLocation="binding.xsd"/>
   <xs:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="xs.xsd"/>
@@ -34,6 +32,9 @@
   <xs:element name="simple">
     <xs:complexType/>
   </xs:element>
+  <xs:element name="treatRestrictionLikeNewType">
+    <xs:complexType/>
+  </xs:element>
   <xs:element name="noMarshaller">
     <xs:complexType/>
   </xs:element>
@@ -43,6 +44,9 @@
   <xs:element name="noValidator">
     <xs:complexType/>
   </xs:element>
+  <xs:element name="substitutable">
+    <xs:complexType/>
+  </xs:element>
   <xs:element name="noValidatingUnmarshaller">
     <xs:complexType/>
   </xs:element>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd
index 2796ebd..379174c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
   <xs:import namespace="http://java.sun.com/xml/ns/jaxb" schemaLocation="binding.xsd"/>
   <xs:import namespace="http://java.sun.com/xml/ns/jaxb/xjc" schemaLocation="xjc.xsd"/>
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/CTBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/CTBuilder.java
index b96d1a7..dedf737 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/CTBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/CTBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import com.sun.tools.internal.xjc.ErrorReceiver;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
index 1cfbaac..24317a3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java
index 2880fce..dc9e40c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 /**
@@ -31,7 +30,7 @@
  * @author
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
-enum ComplexTypeBindingMode {
+public enum ComplexTypeBindingMode {
 
     /**
      * Neither FALLBACK nor NOMOREEXTENSION.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
index 6117554..ddf7f38 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import java.util.HashMap;
@@ -87,7 +86,7 @@
      * For this reason, we have to record how each complex type is being
      * bound.
      */
-    protected void recordBindingMode( XSComplexType type, ComplexTypeBindingMode flag ) {
+    public void recordBindingMode( XSComplexType type, ComplexTypeBindingMode flag ) {
         // it is an error to override the flag.
         Object o = complexTypeBindingModes.put(type,flag);
         assert o==null;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
index 1341a84..3b851cd 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import java.util.HashMap;
@@ -30,6 +29,7 @@
 import java.util.Map;
 
 import com.sun.tools.internal.xjc.model.CClassInfo;
+import com.sun.tools.internal.xjc.model.CClass;
 import com.sun.tools.internal.xjc.reader.xmlschema.WildcardNameClassBuilder;
 import com.sun.xml.internal.xsom.XSAttributeUse;
 import com.sun.xml.internal.xsom.XSComplexType;
@@ -73,7 +73,7 @@
         XSComplexType baseType = ct.getBaseType().asComplexType();
 
         // build the base class
-        CClassInfo baseClass = selector.bindToType(baseType,true);
+        CClass baseClass = selector.bindToType(baseType,ct,true);
         assert baseClass!=null;   // global complex type must map to a class
 
         selector.getCurrentBean().setBaseClass(baseClass);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
index 9e11068..6863b81 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
@@ -30,6 +29,7 @@
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
 import static com.sun.tools.internal.xjc.reader.xmlschema.ct.ComplexTypeBindingMode.FALLBACK_CONTENT;
 import static com.sun.tools.internal.xjc.reader.xmlschema.ct.ComplexTypeBindingMode.NORMAL;
+import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
 import com.sun.xml.internal.xsom.XSComplexType;
 import com.sun.xml.internal.xsom.XSContentType;
 import com.sun.xml.internal.xsom.XSModelGroup;
@@ -63,7 +63,7 @@
                 simpleTypeBuilder.refererStack.pop();
 
                 BIProperty prop = BIProperty.getCustomization(ct);
-                CPropertyInfo p = prop.createValueProperty("Value",false,ct,use);
+                CPropertyInfo p = prop.createValueProperty("Value",false,ct,use, BGMBuilder.getName(st));
                 selector.getCurrentBean().addProperty(p);
             }
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties
index cdbb96d..3f46f17 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 ERR_NO_FURTHER_EXTENSION = \
     Base complex type "{0}" is derived by restriction, while this complex type "{1}" \
     is derived by extension. This is not currently handled by XJC, but we are \
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java
index 49b2bfc..a0369dc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
index 96f5a8b..963350e 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
@@ -66,7 +65,7 @@
         CPropertyInfo p;
 
         if(contentType.asEmpty()!=null) {
-            p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING);
+            p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
         } else {
             RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false);
             p = prop.createReferenceProperty("Content",false,ct,ts, true);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
index 3b00a77..35fce94 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,9 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
-import com.sun.tools.internal.xjc.model.CClassInfo;
+import com.sun.tools.internal.xjc.model.CClass;
 import com.sun.xml.internal.xsom.XSComplexType;
 import com.sun.xml.internal.xsom.XSType;
 
@@ -46,10 +45,17 @@
     }
 
     public void build(XSComplexType ct) {
+        if(bgmBuilder.getGlobalBinding().isRestrictionFreshType()) {
+            // handle derivation-by-restriction like a whole new type
+            new FreshComplexTypeBuilder().build(ct);
+            return;
+        }
+
+
         XSComplexType baseType = ct.getBaseType().asComplexType();
 
         // build the base class
-        CClassInfo baseClass = selector.bindToType(baseType,true);
+        CClass baseClass = selector.bindToType(baseType,ct,true);
         assert baseClass!=null;   // global complex type must map to a class
 
         selector.getCurrentBean().setBaseClass(baseClass);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
index d53fb2e..9679f1c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/STDerivedComplexTypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.ct;
 
 import com.sun.tools.internal.xjc.model.CPropertyInfo;
 import com.sun.tools.internal.xjc.model.TypeUse;
 import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
+import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
 import com.sun.xml.internal.xsom.XSComplexType;
 import com.sun.xml.internal.xsom.XSSimpleType;
 import com.sun.xml.internal.xsom.XSType;
@@ -60,7 +60,7 @@
         simpleTypeBuilder.refererStack.pop();
 
         BIProperty prop = BIProperty.getCustomization(ct);
-        CPropertyInfo p = prop.createValueProperty("Value",false,baseType,use);
+        CPropertyInfo p = prop.createValueProperty("Value",false,baseType,use, BGMBuilder.getName(baseType));
         selector.getCurrentBean().addProperty(p);
 
         // adds attributes and we are through.
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
index efe86a6..4c431ea 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.parser;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
index 4677fa9..2446d96 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.parser;
 
 import com.sun.tools.internal.xjc.reader.Const;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
index da990ac..457c78b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.parser;
 
 import java.io.InputStream;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties
index a620ea1..258adfc 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java
index 981adf2..6c3fd1c 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
index a12967c..c6afff0 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.parser;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
index 1ab176a..16eb864 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.reader.xmlschema.parser;
 
 import com.sun.tools.internal.xjc.reader.internalizer.AbstractReferenceFinderImpl;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java
index e71064f..31f0430 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.runtime;
 
 import java.util.ArrayList;
@@ -93,7 +92,7 @@
 
                 // if we find one, tell the real JAXB provider to
                 // load foo.bar.impl.ObjectFactory
-                name = name.substring(name.length()-DOT_OBJECT_FACTORY.length())+IMPL_DOT_OBJECT_FACTORY;
+                name = name.substring(0,name.length()-DOT_OBJECT_FACTORY.length())+IMPL_DOT_OBJECT_FACTORY;
 
                 try {
                     c = c.getClassLoader().loadClass(name);
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java
index 899b454..42e4f2d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.runtime;
 
 import javax.xml.bind.DatatypeConverter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/package.html b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/package.html
index 9b87fa7..2182eb6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/package.html
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Code generated into the user's packages in certain compilation mode.
 
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java
index e5e8a14..a20f5ea 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import com.sun.codemodel.internal.ClassType;
@@ -117,6 +116,12 @@
                         name, cls.name() ), null ) );
             }
 
+            if(Util.equals((Locator)cls.metadata,source)) {
+                errorReceiver.error( new SAXParseException(
+                    Messages.format( Messages.ERR_CHAMELEON_SCHEMA_GONE_WILD ),
+                    source ));
+            }
+
             return createDummyClass(parent);
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java
index f5f94b5..0999bea 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
  * have any questions.
  */
 
-
 /*
  * DOMUtils.java
  *
@@ -46,6 +45,7 @@
 /**
  *
  * @author  Vivek Pandey
+ * @version 1.0
  *
  */
 public class DOMUtils {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java
index df7b0c4..52d9689 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import com.sun.tools.internal.xjc.ErrorReceiver;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java
index 60f2ab5..35872f3 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import org.xml.sax.Attributes;
@@ -35,6 +34,7 @@
  * two ContentHandlers.
  *
  *
+ * @version     $Id: ForkContentHandler.java,v 1.1 2005/05/23 17:04:58 kohsuke Exp $
  * @author  <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
  */
 public class ForkContentHandler implements ContentHandler {
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java
index becf369..4fbe5c1 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties
index df19627..5b80e3f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # Message resource file
 #
 
@@ -19,4 +44,10 @@
 CodeModelClassFactory.CaseSensitivityCollision = \
 	This error is caused because on Windows you cannot have both "{0}.java" and "{1}.java" \
 	in the same directory.
+
+ERR_CHAMELEON_SCHEMA_GONE_WILD = \
+    (Relevant to above error) This confusing error happened most likely because the schema uses a technique called \
+    "chameleon schema", which causes a single definition to be loaded multiple times into \
+    different namespaces. See http://forums.java.net/jive/thread.jspa?threadID=18631 for \
+    more about this.
  
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java
index b00af65..d8fe2c7 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,4 +51,7 @@
 
     static final String ERR_CASE_SENSITIVITY_COLLISION = // 2 args
         "CodeModelClassFactory.CaseSensitivityCollision";
+
+    static final String ERR_CHAMELEON_SCHEMA_GONE_WILD = // no argts
+        "ERR_CHAMELEON_SCHEMA_GONE_WILD";
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java
index 5f814aa..2bc02c6 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import java.text.ParseException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java
index 3c62253..c15163d 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java
index 03f50e8..88d15c4 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java
index db32e24..e7dec2b 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import javax.xml.bind.annotation.adapters.XmlAdapter;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java
index 414344f..5fe7122 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
 import java.text.ParseException;
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/SubtreeCutter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/SubtreeCutter.java
new file mode 100644
index 0000000..6139ec9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/SubtreeCutter.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.internal.xjc.util;
+
+import org.xml.sax.helpers.XMLFilterImpl;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.Attributes;
+
+/**
+ * {@link XMLFilter} that can cut sub-trees.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class SubtreeCutter extends XMLFilterImpl {
+    /**
+     * When we are pruning a sub tree, this field holds the depth of
+     * elements that are being cut. Used to resume event forwarding.
+     *
+     * As long as this value is 0, we will pass through data.
+     */
+    private int cutDepth=0;
+
+
+    /**
+     * This object will receive SAX events while a sub tree is being
+     * pruned.
+     */
+    private static final ContentHandler stub = new DefaultHandler();
+
+    /**
+     * This field remembers the user-specified ContentHandler.
+     * So that we can restore it once the sub tree is completely pruned.
+     */
+    private ContentHandler next;
+
+
+    public void startDocument() throws SAXException {
+        cutDepth=0;
+        super.startDocument();
+    }
+
+    public boolean isCutting() {
+        return cutDepth>0;
+    }
+
+    /**
+     * Starts cutting a sub-tree. Should be called from within the
+     * {@link #startElement(String, String, String, Attributes)} implementation
+     * before the execution is passed to {@link SubtreeCutter#startElement(String, String, String, Attributes)} .
+     * The current element will be cut.
+     */
+    public void startCutting() {
+        super.setContentHandler(stub);
+        cutDepth=1;
+    }
+
+    public void setContentHandler(ContentHandler handler) {
+        next = handler;
+        // changes take effect immediately unless the sub-tree is being pruned
+        if(getContentHandler()!=stub)
+            super.setContentHandler(handler);
+    }
+
+    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+        if(cutDepth>0)
+            cutDepth++;
+        super.startElement(uri, localName, qName, atts);
+    }
+
+    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+        super.endElement(namespaceURI, localName, qName);
+
+        if( cutDepth!=0 ) {
+            cutDepth--;
+            if( cutDepth == 1 ) {
+                // pruning completed. restore the user handler
+                super.setContentHandler(next);
+                cutDepth=0;
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Util.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Util.java
index 0b8d77f..9ee724f 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Util.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.util;
 
+import org.xml.sax.Locator;
+
 
 /**
  * Other miscellaneous utility methods.
@@ -40,7 +41,7 @@
      * that doesn't throw an exception even if a property cannot be
      * read.
      */
-    public static final String getSystemProperty( String name ) {
+    public static String getSystemProperty( String name ) {
         try {
             return System.getProperty(name);
         } catch( SecurityException e ) {
@@ -49,10 +50,26 @@
     }
 
     /**
+     * Compares if two {@link Locator}s point to the exact same position.
+     */
+    public static boolean equals(Locator lhs, Locator rhs) {
+        return lhs.getLineNumber()==rhs.getLineNumber()
+        && lhs.getColumnNumber()==rhs.getColumnNumber()
+        && equals(lhs.getSystemId(),rhs.getSystemId())
+        && equals(lhs.getPublicId(),rhs.getPublicId());
+    }
+
+    private static boolean equals(String lhs, String rhs) {
+        if(lhs==null && rhs==null)  return true;
+        if(lhs==null || rhs==null)  return false;
+        return lhs.equals(rhs);
+    }
+
+    /**
      * Calls the other getSystemProperty method with
      * "[clazz]&#x2E;[name].
      */
-    public static final String getSystemProperty( Class clazz, String name ) {
+    public static String getSystemProperty( Class clazz, String name ) {
         return getSystemProperty( clazz.getName()+'.'+name );
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/XMLStreamReaderToContentHandler.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/XMLStreamReaderToContentHandler.java
deleted file mode 100644
index 33b49f0..0000000
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/XMLStreamReaderToContentHandler.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.internal.xjc.util;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * This is a simple utility class that adapts StAX events from an
- * {@link javax.xml.stream.XMLStreamReader} to SAX events on a
- * {@link org.xml.sax.ContentHandler}, bridging between the two
- * parser technologies.
- *
- * @author Ryan.Shoemaker@Sun.COM
- */
-public class XMLStreamReaderToContentHandler {
-
-    // StAX event source
-    private final XMLStreamReader staxStreamReader;
-
-    // SAX event sink
-    private final ContentHandler saxHandler;
-
-    /**
-     * Construct a new StAX to SAX adapter that will convert a StAX event
-     * stream into a SAX event stream.
-     *
-     * @param staxCore
-     *                StAX event source
-     * @param saxCore
-     *                SAXevent sink
-     */
-    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore) {
-        staxStreamReader = staxCore;
-        saxHandler = saxCore;
-    }
-
-    /*
-     * @see StAXReaderToContentHandler#bridge()
-     */
-    public void bridge() throws XMLStreamException {
-
-        try {
-            // remembers the nest level of elements to know when we are done.
-            int depth=0;
-
-            // if the parser is at the start tag, proceed to the first element
-            int event = staxStreamReader.getEventType();
-            if(event == XMLStreamConstants.START_DOCUMENT) {
-                // nextTag doesn't correctly handle DTDs
-                while( !staxStreamReader.isStartElement() )
-                    event = staxStreamReader.next();
-            }
-
-
-            if( event!=XMLStreamConstants.START_ELEMENT)
-                throw new IllegalStateException("The current event is not START_ELEMENT\n but " + event);
-
-            handleStartDocument();
-
-            do {
-                // These are all of the events listed in the javadoc for
-                // XMLEvent.
-                // The spec only really describes 11 of them.
-                switch (event) {
-                    case XMLStreamConstants.START_ELEMENT :
-                        depth++;
-                        handleStartElement();
-                        break;
-                    case XMLStreamConstants.END_ELEMENT :
-                        handleEndElement();
-                        depth--;
-                        break;
-                    case XMLStreamConstants.CHARACTERS :
-                        handleCharacters();
-                        break;
-                    case XMLStreamConstants.ENTITY_REFERENCE :
-                        handleEntityReference();
-                        break;
-                    case XMLStreamConstants.PROCESSING_INSTRUCTION :
-                        handlePI();
-                        break;
-                    case XMLStreamConstants.COMMENT :
-                        handleComment();
-                        break;
-                    case XMLStreamConstants.DTD :
-                        handleDTD();
-                        break;
-                    case XMLStreamConstants.ATTRIBUTE :
-                        handleAttribute();
-                        break;
-                    case XMLStreamConstants.NAMESPACE :
-                        handleNamespace();
-                        break;
-                    case XMLStreamConstants.CDATA :
-                        handleCDATA();
-                        break;
-                    case XMLStreamConstants.ENTITY_DECLARATION :
-                        handleEntityDecl();
-                        break;
-                    case XMLStreamConstants.NOTATION_DECLARATION :
-                        handleNotationDecl();
-                        break;
-                    case XMLStreamConstants.SPACE :
-                        handleSpace();
-                        break;
-                    default :
-                        throw new InternalError("processing event: " + event);
-                }
-
-                event=staxStreamReader.next();
-            } while (depth!=0);
-
-            handleEndDocument();
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleEndDocument() throws SAXException {
-        saxHandler.endDocument();
-    }
-
-    private void handleStartDocument() throws SAXException {
-        saxHandler.setDocumentLocator(new Locator() {
-            public int getColumnNumber() {
-                return staxStreamReader.getLocation().getColumnNumber();
-            }
-            public int getLineNumber() {
-                return staxStreamReader.getLocation().getLineNumber();
-            }
-            public String getPublicId() {
-                return staxStreamReader.getLocation().getPublicId();
-            }
-            public String getSystemId() {
-                return staxStreamReader.getLocation().getSystemId();
-            }
-        });
-        saxHandler.startDocument();
-    }
-
-    private void handlePI() throws XMLStreamException {
-        try {
-            saxHandler.processingInstruction(
-                staxStreamReader.getPITarget(),
-                staxStreamReader.getPIData());
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleCharacters() throws XMLStreamException {
-        try {
-            saxHandler.characters(
-                staxStreamReader.getTextCharacters(),
-                staxStreamReader.getTextStart(),
-                staxStreamReader.getTextLength() );
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleEndElement() throws XMLStreamException {
-        QName qName = staxStreamReader.getName();
-
-        try {
-            // fire endElement
-            saxHandler.endElement(
-                qName.getNamespaceURI(),
-                qName.getLocalPart(),
-                qName.toString());
-
-            // end namespace bindings
-            int nsCount = staxStreamReader.getNamespaceCount();
-            for (int i = nsCount - 1; i >= 0; i--) {
-                String prefix = staxStreamReader.getNamespacePrefix(i);
-                if (prefix == null) { // true for default namespace
-                    prefix = "";
-                }
-                saxHandler.endPrefixMapping(prefix);
-            }
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleStartElement() throws XMLStreamException {
-
-        try {
-            // start namespace bindings
-            int nsCount = staxStreamReader.getNamespaceCount();
-            for (int i = 0; i < nsCount; i++) {
-                saxHandler.startPrefixMapping(
-                    fixNull(staxStreamReader.getNamespacePrefix(i)),
-                    fixNull(staxStreamReader.getNamespaceURI(i)));
-            }
-
-            // fire startElement
-            QName qName = staxStreamReader.getName();
-            String prefix = qName.getPrefix();
-            String rawname;
-            if(prefix==null || prefix.length()==0)
-                rawname = qName.getLocalPart();
-            else
-                rawname = prefix + ':' + qName.getLocalPart();
-            Attributes attrs = getAttributes();
-            saxHandler.startElement(
-                qName.getNamespaceURI(),
-                qName.getLocalPart(),
-                rawname,
-                attrs);
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private static String fixNull(String s) {
-        if(s==null)     return "";
-        else            return s;
-    }
-
-    /**
-     * Get the attributes associated with the given START_ELEMENT or ATTRIBUTE
-     * StAXevent.
-     *
-     * @return the StAX attributes converted to an org.xml.sax.Attributes
-     */
-    private Attributes getAttributes() {
-        AttributesImpl attrs = new AttributesImpl();
-
-        int eventType = staxStreamReader.getEventType();
-        if (eventType != XMLStreamConstants.ATTRIBUTE
-            && eventType != XMLStreamConstants.START_ELEMENT) {
-            throw new InternalError(
-                "getAttributes() attempting to process: " + eventType);
-        }
-
-        // in SAX, namespace declarations are not part of attributes by default.
-        // (there's a property to control that, but as far as we are concerned
-        // we don't use it.) So don't add xmlns:* to attributes.
-
-        // gather non-namespace attrs
-        for (int i = 0; i < staxStreamReader.getAttributeCount(); i++) {
-            String uri = staxStreamReader.getAttributeNamespace(i);
-            if(uri==null)   uri="";
-            String localName = staxStreamReader.getAttributeLocalName(i);
-            String prefix = staxStreamReader.getAttributePrefix(i);
-            String qName;
-            if(prefix==null || prefix.length()==0)
-                qName = localName;
-            else
-                qName = prefix + ':' + localName;
-            String type = staxStreamReader.getAttributeType(i);
-            String value = staxStreamReader.getAttributeValue(i);
-
-            attrs.addAttribute(uri, localName, qName, type, value);
-        }
-
-        return attrs;
-    }
-
-    private void handleNamespace() {
-        // no-op ???
-        // namespace events don't normally occur outside of a startElement
-        // or endElement
-    }
-
-    private void handleAttribute() {
-        // no-op ???
-        // attribute events don't normally occur outside of a startElement
-        // or endElement
-    }
-
-    private void handleDTD() {
-        // no-op ???
-        // it seems like we need to pass this info along, but how?
-    }
-
-    private void handleComment() {
-        // no-op ???
-    }
-
-    private void handleEntityReference() {
-        // no-op ???
-    }
-
-    private void handleSpace() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleNotationDecl() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleEntityDecl() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleCDATA() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java b/jaxws/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java
index fcd5f88..e1e441a 100644
--- a/jaxws/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java
+++ b/jaxws/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.tools.internal.xjc.writer;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactory.java
new file mode 100644
index 0000000..fa600a8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactory.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.bind;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import javax.xml.bind.JAXBException;
+
+/**
+ * A means to allow the user to provide customized Accessor
+ * to be used by JAXB.
+ */
+public interface AccessorFactory {
+    /**
+     * Access a field of the class.
+     *
+     * @param bean the class to be processed.
+     * @param f the field within the class to be accessed.
+     * @param readOnly  the isStatic value of the field's modifier.
+     * @return Accessor the accessor for this field
+     *
+     * @throws JAXBException reports failures of the method.
+     */
+    Accessor createFieldAccessor(Class bean, Field f, boolean readOnly) throws JAXBException;
+
+    /**
+     * Access a property of the class.
+     *
+     * @param bean the class to be processed
+     * @param getter the getter method to be accessed. The value can be null.
+     * @param setter the setter method to be accessed. The value can be null.
+     * @return Accessor the accessor for these methods
+     *
+     * @throws JAXBException reports failures of the method.
+     */
+    Accessor createPropertyAccessor(Class bean, Method getter, Method setter) throws JAXBException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactoryImpl.java
new file mode 100644
index 0000000..8569e14
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactoryImpl.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.bind;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import com.sun.xml.internal.bind.api.AccessorException;
+
+public class AccessorFactoryImpl implements AccessorFactory {
+
+    private static AccessorFactoryImpl instance = null;
+    private AccessorFactoryImpl(){}
+    public static synchronized AccessorFactoryImpl getInstance(){
+        if (instance == null)
+            instance = new AccessorFactoryImpl();
+        return instance;
+    }
+
+    /**
+     * Access a field of the class.
+     *
+     * @param bean the class to be processed.
+     * @param f the field within the class to be accessed.
+     * @param readOnly  the isStatic value of the field's modifier.
+     * @return Accessor the accessor for this field
+     *
+     * @throws JAXBException reports failures of the method.
+     */
+    public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly) {
+        return readOnly
+                ? new Accessor.ReadOnlyFieldReflection(field)
+                : new Accessor.FieldReflection(field);
+    }
+
+    /**
+     * Access a property of the class.
+     *
+     * @param bean the class to be processed
+     * @param getter the getter method to be accessed. The value can be null.
+     * @param setter the setter method to be accessed. The value can be null.
+     * @return Accessor the accessor for these methods
+     *
+     * @throws JAXBException reports failures of the method.
+     */
+    public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) {
+        if (getter == null) {
+            return new Accessor.SetterOnlyReflection(setter);
+        }
+        if (setter == null) {
+            return new Accessor.GetterOnlyReflection(getter);
+        }
+        return new Accessor.GetterSetterReflection(getter, setter);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java
new file mode 100644
index 0000000..08659a9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * {@link XmlAdapter} useful for mapping interfaces.
+ *
+ * See <a href="https://jaxb.dev.java.net/guide/Mapping_interfaces.html">The JAXB user's guide</a>
+ * for more about this adapter class.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.1
+ */
+public final class AnyTypeAdapter extends XmlAdapter<Object,Object> {
+    /**
+     * Noop. Just returns the object given as the argument.
+     */
+    public Object unmarshal(Object v) {
+        return v;
+    }
+
+    /**
+     * Noop. Just returns the object given as the argument.
+     */
+    public Object marshal(Object v) {
+        return v;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java
new file mode 100644
index 0000000..11bec2e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind;
+
+import javax.xml.bind.Marshaller;
+
+/**
+ * Optional interface that can be implemented by JAXB-bound objects
+ * to handle cycles in the object graph.
+ *
+ * <p>
+ * As discussed in <a href="https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html">
+ * the users' guide</a>, normally a cycle in the object graph causes the marshaller to report an error,
+ * and when an error is found, the JAXB RI recovers by cutting the cycle arbitrarily.
+ * This is not always a desired behavior.
+ *
+ * <p>
+ * Implementing this interface allows user application to change this behavior.
+ * Also see <a href="http://forums.java.net/jive/thread.jspa?threadID=13670">this related discussion</a>.
+ *
+ * @since JAXB 2.1 EA2
+ * @author Kohsuke Kawaguchi
+ */
+public interface CycleRecoverable {
+    /**
+     * Called when a cycle is detected by the JAXB RI marshaller
+     * to nominate a new object to be marshalled instead.
+     *
+     * @param context
+     *      This object is provided by the JAXB RI to inform
+     *      the object about the marshalling process that's going on.
+     *
+     *
+     * @return
+     *      the object to be marshalled instead of <tt>this</tt> object.
+     *      Or return null to indicate that the JAXB RI should behave
+     *      just like when your object does not implement {@link CycleRecoverable}
+     *      (IOW, cut the cycle arbitrarily and try to go on.)
+     */
+    Object onCycleDetected(Context context);
+
+    /**
+     * This interface is implemented by the JAXB RI to provide
+     * information about the on-going marshalling process.
+     *
+     * <p>
+     * We may add more methods in the future, so please do not
+     * implement this interface in your application.
+     */
+    public interface Context {
+        /**
+         * Returns the marshaller object that's doing the marshalling.
+         *
+         * @return
+         *      always non-null.
+         */
+        Marshaller getMarshaller();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java
index 6bc55f8..826d986 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind;
 
 import java.math.BigDecimal;
@@ -53,6 +52,7 @@
  * This class is responsible for whitespace normalization.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.9 $
  * @since JAXB1.0
  */
 public final class DatatypeConverterImpl implements DatatypeConverterInterface {
@@ -535,28 +535,48 @@
     }
 
     /**
-     * computes the length of binary data.
+     * computes the length of binary data speculatively.
      *
-     * This function also performs format check.
-     * @return    -1        if format is illegal.
+     * <p>
+     * Our requirement is to create byte[] of the exact length to store the binary data.
+     * If we do this in a straight-forward way, it takes two passes over the data.
+     * Experiments show that this is a non-trivial overhead (35% or so is spent on
+     * the first pass in calculating the length.)
      *
+     * <p>
+     * So the approach here is that we compute the length speculatively, without looking
+     * at the whole contents. The obtained speculative value is never less than the
+     * actual length of the binary data, but it may be bigger. So if the speculation
+     * goes wrong, we'll pay the cost of reallocation and buffer copying.
+     *
+     * <p>
+     * If the base64 text is tightly packed with no indentation nor illegal char
+     * (like what most web services produce), then the speculation of this method
+     * will be correct, so we get the performance benefit.
      */
-    private static int calcLength( String text ) {
+    private static int guessLength( String text ) {
         final int len = text.length();
-        int base64count=0;
-        int i;
 
-        for( i=0; i<len; i++ ) {
-            char ch = text.charAt(i);
-            if( ch=='=' )    // decodeMap['=']!=-1, so we have to check this first.
-                break;
-            if( ch>=128 )
-                return -1;      // incorrect character
-            if( decodeMap[ch]!=-1 )
-                base64count++;
+        // compute the tail '=' chars
+        int j=len-1;
+        for(; j>=0; j-- ) {
+            byte code = decodeMap[text.charAt(j)];
+            if(code==PADDING)
+                continue;
+            if(code==-1)
+                // most likely this base64 text is indented. go with the upper bound
+                return text.length()/4*3;
+            break;
         }
 
-        return (base64count/4)*3+Math.max(0,(base64count%4)-1);
+        j++;    // text.charAt(j) is now at some base64 char, so +1 to make it the size
+        int padSize = len-j;
+        if(padSize >2) // something is wrong with base64. be safe and go with the upper bound
+            return text.length()/4*3;
+
+        // so far this base64 looks like it's unindented tightly packed base64.
+        // take a chance and create an array with the expected size
+        return text.length()/4*3-padSize;
     }
 
     /**
@@ -569,9 +589,8 @@
      *      because JIT can inline a lot of string access (with data of 1K chars, it was twice as fast)
      */
     public static byte[] _parseBase64Binary(String text) {
-        final int outlen = calcLength(text);
-        if( outlen==-1 )    return null;
-        final byte[] out = new byte[outlen];
+        final int buflen = guessLength(text);
+        final byte[] out = new byte[buflen];
         int o=0;
 
         final int len = text.length();
@@ -584,6 +603,7 @@
         for( i=0; i<len; i++ ) {
             char ch = text.charAt(i);
             byte v = decodeMap[ch];
+
             if( v!=-1 )
                 quadruplet[q++] = v;
 
@@ -598,7 +618,13 @@
             }
         }
 
-        return out;
+        if(buflen==o) // speculation worked out to be OK
+            return out;
+
+        // we overestimated, so need to create a new buffer
+        byte[] nb = new byte[o];
+        System.arraycopy(out,0,nb,0,o);
+        return nb;
     }
 
     private static final char[] encodeMap = initEncodeMap();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/IDResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/IDResolver.java
index 5f95208..c012025 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/IDResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/IDResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,16 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind;
 
-import java.util.concurrent.Future;
 import java.util.concurrent.Callable;
-import java.util.concurrent.Executors;
 
-import javax.xml.bind.annotation.XmlIDREF;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.XmlIDREF;
 
 import org.xml.sax.SAXException;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/Locatable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/Locatable.java
index 7bbb351..11f4d76 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/Locatable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/Locatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: Locatable.java,v 1.1 2005/04/15 20:03:41 kohsuke Exp $
+ */
+
 
 package com.sun.xml.internal.bind;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/Util.java
index 7be5a87..877f5d7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/Util.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java
index 6cc3897..213b9ee 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: ValidationEventLocatorEx.java,v 1.1 2005/04/15 20:03:42 kohsuke Exp $
+ */
+
 
 package com.sun.xml.internal.bind;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java
index 90c4565..487164e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/XmlAccessorFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/XmlAccessorFactory.java
new file mode 100644
index 0000000..c94af0c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/XmlAccessorFactory.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.bind;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Identifies a user provided customized Accessor
+ * to be used.
+ */
+
+@Retention(RUNTIME)
+@Target({TYPE,PACKAGE})
+public @interface XmlAccessorFactory {
+    Class<? extends AccessorFactory> value();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java
index 996e6ea..7280ffe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.annotation;
 
 import java.lang.annotation.Retention;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java
index bc0a78d..c091c3b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.annotation;
 
 import java.lang.annotation.Retention;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java
index ef66bfa..cd1b80a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java
index 049b054..acd89c3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 import java.io.InputStream;
@@ -72,6 +71,15 @@
     protected final JAXBContextImpl context;
 
     /**
+     * Gets the {@link JAXBRIContext} to which this object belongs.
+     *
+     * @since 2.1
+     */
+    public @NotNull JAXBRIContext getContext() {
+        return context;
+    }
+
+    /**
      *
      * @throws JAXBException
      *      if there was an error while marshalling.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java
index 60fc478..112f8f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 import javax.xml.bind.ValidationEventHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ClassResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ClassResolver.java
new file mode 100644
index 0000000..211ef89
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ClassResolver.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.api;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.XmlAnyElement;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+/**
+ * Dynamically locates classes to represent elements discovered during the unmarshalling.
+ *
+ * <p>
+ * <b>THIS INTERFACE IS SUBJECT TO CHANGE WITHOUT NOTICE.</b>
+ *
+ * <h2>Background</h2>
+ * <p>
+ * {@link JAXBContext#newInstance(Class...)} requires that application informs JAXB
+ * about all the classes that it may see in the instance document. While this allows
+ * JAXB to take time to optimize the unmarshalling, it is sometimes inconvenient
+ * for applications.
+ *
+ * <p>
+ * This is where {@link ClassResolver} comes to resucue.
+ *
+ * <p>
+ * A {@link ClassResolver} instance can be specified on {@link Unmarshaller} via
+ * {@link Unmarshaller#setProperty(String, Object)} as follows:
+ *
+ * <pre>
+ * unmarshaller.setProperty( ClassResolver.class.getName(), new MyClassResolverImpl() );
+ * </pre>
+ *
+ * <p>
+ * When an {@link Unmarshaller} encounters (i) an unknown root element or (ii) unknown
+ * elements where unmarshaller is trying to unmarshal into {@link XmlAnyElement} with
+ * <tt>lax=true</tt>, unmarshaller calls {@link #resolveElementName(String, String)}
+ * method to see if the application may be able to supply a class that corresponds
+ * to that class.
+ *
+ * <p>
+ * When a {@link Class} is returned, a new {@link JAXBContext} is created with
+ * all the classes known to it so far, plus a new class returned. This operation
+ * may fail (for example because of some conflicting annotations.) This failure
+ * is handled just like {@link Exception}s thrown from
+ * {@link ClassResolver#resolveElementName(String, String)}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1
+ */
+public abstract class ClassResolver {
+    /**
+     * JAXB calls this method when it sees an unknown element.
+     *
+     * <p>
+     * See the class javadoc for details.
+     *
+     * @param nsUri
+     *      Namespace URI of the unknown element. Can be empty but never null.
+     * @param localName
+     *      Local name of the unknown element. Never be empty nor null.
+     *
+     * @return
+     *      If a non-null class is returned, it will be used to unmarshal this element.
+     *      If null is returned, the resolution is assumed to be failed, and
+     *      the unmarshaller will behave as if there was no {@link ClassResolver}
+     *      to begin with (that is, to report it to {@link ValidationEventHandler},
+     *      then move on.)
+     *
+     * @throws Exception
+     *      Throwing any {@link RuntimeException} causes the unmarshaller to stop
+     *      immediately. The exception will be propagated up the call stack.
+     *      Throwing any other checked {@link Exception} results in the error
+     *      reproted to {@link ValidationEventHandler} (just like any other error
+     *      during the unmarshalling.)
+     */
+    public abstract @Nullable Class<?> resolveElementName(@NotNull String nsUri, @NotNull String localName) throws Exception;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java
index e49b4ab..acb2b87 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ErrorListener.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ErrorListener.java
new file mode 100644
index 0000000..586f737
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ErrorListener.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.api;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Implemented by the driver of the compiler engine to handle
+ * errors found during the compiliation.
+ *
+ * <p>
+ * This class implements {@link ErrorHandler} so it can be
+ * passed to anywhere where {@link ErrorHandler} is expected.
+ *
+ * <p>
+ * However, to make the error handling easy (and make it work
+ * with visitor patterns nicely), this interface is not allowed
+ * to abort the processing. It merely receives errors.
+ *
+ * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 2.1 EA2
+ */
+public interface ErrorListener extends ErrorHandler {
+    void error(SAXParseException exception);
+    void fatalError(SAXParseException exception);
+    void warning(SAXParseException exception);
+    /**
+     * Used to report possibly verbose information that
+     * can be safely ignored.
+     */
+    void info(SAXParseException exception);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
index 6d6064b..a759940 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,25 +22,28 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.SchemaOutputResolver;
+import javax.xml.bind.annotation.XmlAttachmentRef;
 import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
 
 import com.sun.istack.internal.NotNull;
 import com.sun.istack.internal.Nullable;
 import com.sun.xml.internal.bind.api.impl.NameConverter;
+import com.sun.xml.internal.bind.v2.ContextFactory;
+import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
 
 /**
@@ -54,6 +57,7 @@
  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
  */
 public abstract class JAXBRIContext extends JAXBContext {
+
     protected JAXBRIContext() {}
 
     /**
@@ -69,37 +73,48 @@
      * @param typeRefs
      *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
      *      Can be null.
+     * @param subclassReplacements
+     *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
+     *      Can be null.
      * @param defaultNamespaceRemap
      *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
      *      Can be null (and should be null for ordinary use of JAXB.)
      * @param c14nSupport
      *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
+     * @param ar
+     *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
+     *      Can be null.
+     * @since JAXB 2.1 EA2
      */
-    public static JAXBRIContext newInstance(@NotNull Class[] classes, @Nullable Collection<TypeReference> typeRefs, @Nullable String defaultNamespaceRemap, boolean c14nSupport ) throws JAXBException {
-        try {
-            Class c = Class.forName("com.sun.xml.internal.bind.v2.ContextFactory");
-            Method method = c.getMethod("createContext",Class[].class,Collection.class,String.class,boolean.class);
-            Object o = method.invoke(null,classes,typeRefs,defaultNamespaceRemap,c14nSupport);
-            return (JAXBRIContext)o;
-        } catch (ClassNotFoundException e) {
-            throw new JAXBException(e);
-        } catch (NoSuchMethodException e) {
-            throw new JAXBException(e);
-        } catch (IllegalAccessException e) {
-            throw new JAXBException(e);
-        } catch (InvocationTargetException e) {
-            Throwable te = e.getTargetException();
-            if(te instanceof JAXBException)
-                throw (JAXBException)te;
-            if(te instanceof RuntimeException)
-                throw (RuntimeException)te;
-            if(te instanceof Error)
-                throw (Error)te;
-            throw new JAXBException(e);
-        }
+    public static JAXBRIContext newInstance(@NotNull Class[] classes,
+       @Nullable Collection<TypeReference> typeRefs,
+       @Nullable Map<Class,Class> subclassReplacements,
+       @Nullable String defaultNamespaceRemap, boolean c14nSupport,
+       @Nullable RuntimeAnnotationReader ar) throws JAXBException {
+        return ContextFactory.createContext(classes, typeRefs, subclassReplacements,
+                defaultNamespaceRemap, c14nSupport, ar, false, false);
     }
 
     /**
+     * @deprecated
+     *      Compatibility with older versions.
+     */
+    public static JAXBRIContext newInstance(@NotNull Class[] classes,
+        @Nullable Collection<TypeReference> typeRefs,
+        @Nullable String defaultNamespaceRemap, boolean c14nSupport ) throws JAXBException {
+        return newInstance(classes,typeRefs, Collections.<Class,Class>emptyMap(),
+                defaultNamespaceRemap,c14nSupport,null);
+    }
+
+    /**
+     * Returns true if this context includes a class
+     * that has {@link XmlAttachmentRef}.
+     *
+     * @since 2.1
+     */
+    public abstract boolean hasSwaRef();
+
+    /**
      * If the given object is bound to an element in XML by JAXB,
      * returns the element name.
      *
@@ -234,6 +249,21 @@
     public abstract @NotNull String getBuildId();
 
     /**
+     * Generates the episode file that represents the binding known to this {@link JAXBContext},
+     * so that XJC can later do separate compilation.
+     *
+     * <p>
+     * Episode file is really just a JAXB customization file, except that currently
+     * we use the RI-specific SCD to refer to schema components.
+     *
+     * @param output
+     *      This receives the generated episode file.
+     *
+     * @since 2.1
+     */
+    public abstract void generateEpisode(Result output);
+
+    /**
      * Computes a Java identifier from a local name.
      *
      * <p>
@@ -244,12 +274,10 @@
      * Accordingly, this method may return an identifier that collides with reserved words.
      *
      * <p>
-     * Use {@link JJavaName#isJavaIdentifier(String)} to check for such collision.
+     * Use <tt>JJavaName.isJavaIdentifier(String)</tt> to check for such collision.
      *
      * @return
      *      Typically, this method returns "nameLikeThis".
-     *
-     * @see JJavaName#isJavaIdentifier(String)
      */
     public static @NotNull String mangleNameToVariableName(@NotNull String localName) {
         return NameConverter.standard.toVariableName(localName);
@@ -269,6 +297,21 @@
     }
 
     /**
+     * Computes a Java class name from a local name.
+     *
+     * <p>
+     * This method faithfully implements the name mangling rule as specified in the JAXB spec.
+     * This method works like {@link #mangleNameToClassName(String)} except that it looks
+     * for "getClass" and returns something else.
+     *
+     * @return
+     *      Typically, this method returns "NameLikeThis".
+     */
+    public static @NotNull String mangleNameToPropertyName(@NotNull String localName) {
+        return NameConverter.standard.toPropertyName(localName);
+    }
+
+    /**
      * Gets the parameterization of the given base type.
      *
      * <p>
@@ -338,9 +381,46 @@
     public static final String CANONICALIZATION_SUPPORT = "com.sun.xml.internal.bind.c14n";
 
     /**
+     * The property that you can specify to {@link JAXBContext#newInstance}
+     * to allow unmarshaller to honor <tt>xsi:nil</tt> anywhere, even if they are
+     * not specifically allowed by the schema.
+     *
+     * @since 2.1.3
+     */
+    public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable";
+
+    /**
+     * The property that you can specify to {@link JAXBContext#newInstance}
+     * to use alternative {@link RuntimeAnnotationReader} implementation.
+     *
+     * @since 2.1 EA2
+     */
+    public static final String ANNOTATION_READER = RuntimeAnnotationReader.class.getName();
+
+    /**
      * Marshaller/Unmarshaller property to enable XOP processing.
      *
      * @since 2.0 EA2
      */
     public static final String ENABLE_XOP = "com.sun.xml.internal.bind.XOP";
+
+    /**
+     * The property that you can specify to {@link JAXBContext#newInstance}
+     * to specify specific classes that replace the reference to generic classes.
+     *
+     * <p>
+     * See the release notes for more details about this feature.
+     *
+     * @since 2.1 EA2
+     */
+    public static final String SUBCLASS_REPLACEMENTS = "com.sun.xml.internal.bind.subclassReplacements";
+
+    /**
+     * The property that you can specify to {@link JAXBContext#newInstance}
+     * enable support of XmlAccessorFactory annotation in the {@link JAXBContext}.
+     *
+     * @since 2.1 EA2
+     */
+    public static final String XMLACCESSORFACTORY_SUPPORT = "com.sun.xml.internal.bind.XmlAccessorFactory";
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java
index ad6ae5f..a662270 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java
index 480694c..6c439ea 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java
index 3cce7e1..59f6e53 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api.impl;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java
index 619204a..39103f2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.api.impl;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/package-info.java
index 3992e0e..6aee4d4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/api/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/api/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * <h1>Runtime API for the JAX-WS RI</h1>.
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java
index bab4534..3c0bc14 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.marshaller;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java
index a74cde4..17e7600 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 //@@3RD PARTY CODE@@
 
 // DataWriter.java - XML writer for data-oriented files.
@@ -93,6 +92,7 @@
  *
  * @since 1.0
  * @author David Megginson, david@megginson.com
+ * @version 0.2
  * @see XMLWriter
  */
 public class DataWriter extends XMLWriter
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java
index a696ff3..0048bdb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.marshaller;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java
index 21dfe8b..a0ff82b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties
index 4c15aa0..783d617 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # don't modify nor delete anything for backward compatibility
 #
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java
index b0bf37e..ee3517d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: MinimumEscapeHandler.java,v 1.1 2005/04/15 20:03:47 kohsuke Exp $
+ */
+
 
 package com.sun.xml.internal.bind.marshaller;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java
index d7dc75e..095faec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.marshaller;
 
 import java.io.OutputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java
index e9d787a..0a5d3ca 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.marshaller;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java
index 24dc2bf..73e019e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java
index d0089a0..8bf89aa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 // @@3RD PARTY CODE@@
 
 // XMLWriter.java - serialize an XML document.
@@ -248,6 +247,7 @@
  * character data.</p>
  *
  * @author David Megginson, david@megginson.com
+ * @version 0.2
  * @since JAXB1.0
  * @see org.xml.sax.XMLFilter
  * @see org.xml.sax.ContentHandler
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java
index 51c5bd6..85a95df 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.unmarshaller;
 
 import java.util.Enumeration;
@@ -55,6 +54,7 @@
  * classes like this.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.6 $ $Date: 2006/04/24 15:27:52 $
  * @since JAXB1.0
  */
 public class DOMScanner implements LocatorEx,InfosetScanner/*<Node> --- but can't do this to protect 1.0 clients, or can I? */
@@ -97,9 +97,9 @@
 
     public void scan( Element e) throws SAXException {
         setCurrentLocation( e );
-        receiver.startDocument();
 
         receiver.setDocumentLocator(locator);
+        receiver.startDocument();
 
         NamespaceSupport nss = new NamespaceSupport();
         buildNamespaceSupport( nss, e.getParentNode() );
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java
index 8523893..b3069ad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.unmarshaller;
 
 import javax.xml.bind.Binder;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java
index 8df8e1a..99009a7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties
index 39c705a..4044794 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties
@@ -1,4 +1,29 @@
 #
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
 # don't modify nor delete anything for backward compatibility
 #
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java
index 97ed179..b1f1fe8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java
index 2b1ab19..939042f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,6 +66,7 @@
  * @since JAXB1.0
  * @since SAX 2.0
  * @author David Megginson
+ * @version 2.0.1 (sax2r2)
  */
 public class AttributesImpl implements Attributes
 {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java
index a0aa0b6..ac3d365 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: ValidationEventLocatorExImpl.java,v 1.1 2005/04/15 20:03:50 kohsuke Exp $
+ */
+
 
 package com.sun.xml.internal.bind.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/Which.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/Which.java
index 7699edf..8e2217d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/util/Which.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/util/Which.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id: Which.java,v 1.1 2005/04/15 20:03:51 kohsuke Exp $
+ */
+
 
 package com.sun.xml.internal.bind.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java
index 98c4427..1320dd6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2;
 
 import java.lang.reflect.Constructor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
index 597672a..0ef92f5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2;
 
 import java.io.BufferedReader;
@@ -35,14 +34,18 @@
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.logging.Level;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 
 import com.sun.istack.internal.FinalArrayList;
+import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
 import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+import com.sun.xml.internal.bind.v2.util.TypeCast;
 
 /**
  * This class is responsible for producing RI JAXBContext objects.  In
@@ -72,12 +75,35 @@
         if(c14nSupport==null)
             c14nSupport = false;
 
+        Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class);
+        if(allNillable==null)
+            allNillable = false;
+
+        Boolean xmlAccessorFactorySupport = getPropertyValue(properties,
+           JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class);
+        if(xmlAccessorFactorySupport==null){
+            xmlAccessorFactorySupport = false;
+            Util.getClassLogger().log(Level.FINE, "Property " +
+                JAXBRIContext.XMLACCESSORFACTORY_SUPPORT +
+                "is not active.  Using JAXB's implementation");
+        }
+
+        RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class);
+
+        Map<Class,Class> subclassReplacements;
+        try {
+            subclassReplacements = TypeCast.checkedCast(
+                getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class);
+        } catch (ClassCastException e) {
+            throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e);
+        }
 
         if(!properties.isEmpty()) {
             throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next()));
         }
 
-        return createContext(classes,Collections.<TypeReference>emptyList(),defaultNsUri,c14nSupport);
+        return createContext(classes,Collections.<TypeReference>emptyList(),
+                subclassReplacements,defaultNsUri,c14nSupport,ar,xmlAccessorFactorySupport,allNillable);
     }
 
     /**
@@ -94,11 +120,12 @@
             return type.cast(o);
     }
 
-    /**
-     * Used from the JAXB RI runtime API, invoked via reflection.
-     */
-    public static JAXBContext createContext( Class[] classes, Collection<TypeReference> typeRefs, String defaultNsUri, boolean c14nSupport ) throws JAXBException {
-        return new JAXBContextImpl(classes,typeRefs,defaultNsUri,c14nSupport);
+    public static JAXBRIContext createContext( Class[] classes,
+            Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements,
+            String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar,
+            boolean xmlAccessorFactorySupport, boolean allNillable) throws JAXBException {
+        return new JAXBContextImpl(classes,typeRefs,subclassReplacements,defaultNsUri,
+                c14nSupport,ar, xmlAccessorFactorySupport,allNillable);
     }
 
     /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.java
index a598a9e..0f9e6d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
     UNSUPPORTED_PROPERTY,   // 1 arg
     BROKEN_CONTEXTPATH,     // 1 arg
     NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS, // 1 arg
+    INVALID_TYPE_IN_MAP, // 0args
     ;
 
     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties
index 1909248..5cb7d62 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties
@@ -1,3 +1,27 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
 
 ILLEGAL_ENTRY = \
     illegal entry: "{0}", entries should be of the form "ClassName" or "OuterClass.InnerClass", not "ClassName.class" or "fully.qualified.ClassName"
@@ -16,4 +40,7 @@
 
 NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS = \
     "{0}" is an inner class, and therefore it can never have a default no-argument constructor. Add 'static'.
+
+INVALID_TYPE_IN_MAP = \
+    Map contains a wrong type
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java
index 6b353d3..2d24ec9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java
index 1c0007c..781c825 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2;
 
 /**
@@ -55,6 +54,7 @@
 
     public static final String XML_MIME_URI = "http://www.w3.org/2005/05/xmlmime";
 
+    public static final String JAXB = "http://java.sun.com/xml/ns/jaxb";
 
 //    public static final QName XSI_NIL = new QName(XML_SCHEMA_INSTANCE,"nil");
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java
index a8015f7..f0d7902 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.bytecode;
 
 import java.io.ByteArrayOutputStream;
@@ -49,7 +48,7 @@
     /**
      * Returns the class name in the JVM format (such as "java/lang/String")
      */
-    public static final String toVMClassName( Class c ) {
+    public static String toVMClassName( Class c ) {
         assert !c.isPrimitive();
         if(c.isArray())
             // I have no idea why it is designed like this, but javap says so.
@@ -57,7 +56,7 @@
         return c.getName().replace('.','/');
     }
 
-    public static final String toVMTypeName( Class c ) {
+    public static String toVMTypeName( Class c ) {
         if(c.isArray()) {
             // TODO: study how an array type is encoded.
             return '['+toVMTypeName(c.getComponentType());
@@ -79,7 +78,7 @@
 
 
 
-    public static final byte[] tailor( Class templateClass, String newClassName, String... replacements ) {
+    public static byte[] tailor( Class templateClass, String newClassName, String... replacements ) {
         String vmname = toVMClassName(templateClass);
         return tailor(
             templateClass.getClassLoader().getResourceAsStream(vmname+".class"),
@@ -99,7 +98,7 @@
      *      The search strings found in the constant pool will be replaced by the corresponding
      *      replacement string.
      */
-    public static final byte[] tailor( InputStream image, String templateClassName, String newClassName, String... replacements ) {
+    public static byte[] tailor( InputStream image, String templateClassName, String newClassName, String... replacements ) {
         DataInputStream in = new DataInputStream(image);
 
         try {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
index 3f5f97d..2b066b0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
   Code that deals with low level byte code manipulation.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.png b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.png
deleted file mode 100644
index 366fe5b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.png
+++ /dev/null
Binary files differ
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.vsd b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.vsd
deleted file mode 100644
index db3bef4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/packages.vsd
+++ /dev/null
Binary files differ
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/readme.txt b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/readme.txt
deleted file mode 100644
index 14720ba..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/doc-files/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-The sxd/vsd files are the master, and the gif file should be created from it.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java
index ec6b246..1a4d8b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java
index 8626e50..da93afe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,15 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
+import javax.xml.bind.annotation.XmlTransient;
+
+import com.sun.istack.internal.Nullable;
 import com.sun.xml.internal.bind.v2.model.core.ErrorHandler;
 
 /**
@@ -83,6 +85,11 @@
     boolean hasFieldAnnotation(Class<? extends Annotation> annotationType, F field);
 
     /**
+     * Checks if a class has the annotation.
+     */
+    boolean hasClassAnnotation(C clazz, Class<? extends Annotation> annotationType);
+
+    /**
      * Gets all the annotations on a field.
      */
     Annotation[] getAllFieldAnnotations(F field, Locatable srcPos);
@@ -119,17 +126,20 @@
      * @return null
      *      if the annotation was not found.
      */
+    @Nullable
     <A extends Annotation> A getMethodParameterAnnotation(
             Class<A> annotation, M method, int paramIndex, Locatable srcPos );
 
     /**
      * Reads an annotation on a class.
      */
+    @Nullable
     <A extends Annotation> A getClassAnnotation(Class<A> annotation, C clazz, Locatable srcpos) ;
 
     /**
      * Reads an annotation on the package that the given class belongs to.
      */
+    @Nullable
     <A extends Annotation> A getPackageAnnotation(Class<A> annotation, C clazz, Locatable srcpos);
 
     /**
@@ -144,4 +154,10 @@
      *      The name of the annotation parameter to be read.
      */
     T getClassValue( Annotation a, String name );
+
+    /**
+     * Similar to {@link #getClassValue(Annotation, String)} method but
+     * obtains an array parameter.
+     */
+    T[] getClassArrayValue( Annotation a, String name );
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java
index c4c5e59..ffc75d2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java
index 24087f6..0b3d420 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java
index ca30ab2..87697d0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java
index 48a1a78..fa000cc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 
@@ -31,7 +29,7 @@
 
 
     static Quick[] getAll() {
-        return new Quick[] {new XmlAttributeQuick(null, null), new XmlElementRefQuick(null, null), new XmlElementQuick(null, null), new XmlElementRefsQuick(null, null), new XmlElementDeclQuick(null, null), new XmlRootElementQuick(null, null), new XmlTransientQuick(null, null), new XmlEnumQuick(null, null), new XmlSchemaQuick(null, null), new XmlValueQuick(null, null), new XmlTypeQuick(null, null)};
+        return new Quick[] {new XmlTypeQuick(null, null), new XmlSchemaQuick(null, null), new XmlElementRefsQuick(null, null), new XmlValueQuick(null, null), new XmlElementDeclQuick(null, null), new XmlElementRefQuick(null, null), new XmlTransientQuick(null, null), new XmlElementQuick(null, null), new XmlAttributeQuick(null, null), new XmlRootElementQuick(null, null), new XmlEnumQuick(null, null)};
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java
index d895bf4..7c0c660 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import com.sun.xml.internal.bind.v2.runtime.Location;
@@ -33,7 +32,7 @@
  * <p>
  * {@link Locatable} forms a tree structure, where each {@link Locatable}
  * points back to the upstream {@link Locatable}.
- * For example, image {@link Locatable} X that points to a particular annotation,
+ * For example, imagine {@link Locatable} X that points to a particular annotation,
  * whose upstream is {@link Locatable} Y, which points to a particular method
  * (on which the annotation is put), whose upstream is {@link Locatable} Z,
  * which points to a particular class (in which the method is defined),
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java
index 405e098..ad1a98e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
@@ -72,6 +71,10 @@
         } catch (ClassNotFoundException e) {
             // annotation not loadable
             return annotation;
+        } catch (IllegalArgumentException e) {
+            // Proxy.newProxyInstance throws this if it cannot resolve this annotation
+            // in this classloader
+            return annotation;
         }
 
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java
index 05f1a2d..c663d3a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties
index 319a34f..77a9996 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 DUPLICATE_ANNOTATIONS = \
     Annotation "{0}" is present on both "{1}" and "{2}"
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java
index 2c44c46..ef6a2e6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import com.sun.xml.internal.bind.v2.model.nav.Navigator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java
index 2fd0ea4..13a4b41 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java
index 961ff0b..4a7e983 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java
index 12b356c..2fdf0bd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
@@ -50,6 +49,10 @@
         return field.isAnnotationPresent(annotationType);
     }
 
+    public boolean hasClassAnnotation(Class clazz, Class<? extends Annotation> annotationType) {
+        return clazz.isAnnotationPresent(annotationType);
+    }
+
     public Annotation[] getAllFieldAnnotations(Field field, Locatable srcPos) {
         Annotation[] r = field.getAnnotations();
         for( int i=0; i<r.length; i++ ) {
@@ -127,6 +130,20 @@
         }
     }
 
+    public Class[] getClassArrayValue(Annotation a, String name) {
+        try {
+            return (Class[])a.annotationType().getMethod(name).invoke(a);
+        } catch (IllegalAccessException e) {
+            // impossible
+            throw new IllegalAccessError(e.getMessage());
+        } catch (InvocationTargetException e) {
+            // impossible
+            throw new InternalError(e.getMessage());
+        } catch (NoSuchMethodException e) {
+            throw new NoSuchMethodError(e.getMessage());
+        }
+    }
+
     protected String fullName(Method m) {
         return m.getDeclaringClass().getName()+'#'+m.getName();
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java
index 437750f..c024c98 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java
index 59134c9..f0eb01e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java
index a2ac960..1daaf11 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java
index 5faa75a..fe09ca1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java
index fa3de58..81077be 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java
index 1bb7706..fb17f0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java
index 0aaa98f..b5da0e0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java
index dac134f..6b0bbf9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
@@ -55,6 +53,10 @@
         return XmlSchema.class;
     }
 
+    public String location() {
+        return core.location();
+    }
+
     public String namespace() {
         return core.namespace();
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java
index ebca8e5..02ed147 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java
index f2458d3..6234fb3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java
index 034b9ce..c9c1112 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.model.annotation;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
index 0f980ca..38ca73c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Abstraction around reading annotations, to support internal/external annotations.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java
index 3512c81..a908f60 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.bind.annotation.adapters.XmlAdapter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java
index 4cb64ed..278e1ff 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java
index 5d6e44b..819005e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java
index d0344fb..81de52a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java
index 41506a8..c97a2f8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.List;
 
 import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlValue;
 
 /**
  * Information about JAXB-bound class.
@@ -100,6 +100,12 @@
     List<? extends PropertyInfo<T,C>> getProperties();
 
     /**
+     * Returns true if this class or its ancestor has {@link XmlValue}
+     * property.
+     */
+    boolean hasValueProperty();
+
+    /**
      * Gets the property that has the specified name.
      *
      * <p>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java
index a51429f..62d4984 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java
index 6d2c029..6a89040 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java
index 500457f..d866d50 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.List;
@@ -83,6 +82,14 @@
     QName getXmlName();
 
     /**
+     * Checks if the wrapper element is required.
+     *
+     * @return
+     *      Always false if {@link #getXmlName()}==null.
+     */
+    boolean isCollectionRequired();
+
+    /**
      * Returns true if this property is nillable
      * (meaning the absence of the value is treated as nil='true')
      *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java
index a25baea..d2f7d13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.bind.annotation.XmlEnumValue;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java
index 6a074cb..60dfa68 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
index b87a2aa..47198f1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java
index 2f448b1..6a24371 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java
index 4c16d93..33cf00a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java
index 03dbc06..30d2cd2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Map;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java
index 81cb3c1..56fff25 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java
index 25ade4d..bf34310 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java
index 9c623e9..ed63520 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java
index 3cbca34..9367e0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Collection;
@@ -35,6 +34,7 @@
 import javax.xml.namespace.QName;
 
 import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.v2.model.annotation.AnnotationSource;
 
 /**
  * Information about a JAXB-bound property.
@@ -48,7 +48,7 @@
  *
  * @author Kohsuke Kawaguchi
  */
-public interface PropertyInfo<T,C> {
+public interface PropertyInfo<T,C> extends AnnotationSource {
 
     /**
      * Gets the {@link ClassInfo} or {@link ElementInfo} to which this property belongs.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
index b9b88d5..fefbbf5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.bind.annotation.XmlMimeType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java
index a61584d..528c80e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.bind.annotation.XmlList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java
index 4ae9fe7..25afe96 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Collection;
@@ -86,6 +85,14 @@
     boolean isCollectionNillable();
 
     /**
+     * Checks if the wrapper element is required.
+     *
+     * @return
+     *      Always false if {@link #getXmlName()}==null.
+     */
+    boolean isCollectionRequired();
+
+    /**
      * Returns true if this property can hold {@link String}s to represent
      * mixed content model.
      */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
index 03638d6..091bdae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Set;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java
index aaaffc7..ff917d9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.bind.annotation.XmlIDREF;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java
index e440614..270c371 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import java.util.Map;
@@ -144,6 +143,20 @@
     Map<String,String> getXmlNs(String namespaceUri);
 
     /**
+     * Gets {@link XmlSchema#location()} found in this context.
+     *
+     * <p>
+     * This operation is expected to be only used in schema generator, so it can be slow.
+     *
+     * @return
+     *      A map from namespace URI to the value of the location.
+     *      If the entry is missing, that means a schema should be generated for that namespace.
+     *      If the value is "", that means the schema location is implied
+     *      (&lt;xs:schema namespace="..."/> w/o schemaLocation.)
+     */
+    Map<String,String> getSchemaLocations();
+
+    /**
      * Gets the reasonable {@link XmlNsForm} for the given namespace URI.
      *
      * <p>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java
index 158801f..ec1f5aa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java
index 6e7a88f..a1640f1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java
index 3320c1d..996652a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java
index 45d088c..8c3ff28 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.core;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java
index 459113a..c64208b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * The in-memory model of the JAXB-bound beans.
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java
index e1fe7dc..dc9250d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java
index 29e11fe..68f8d08 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java
index 39ea191..ae466dd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.bind.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java
index 16b7ecd..a3e4c69 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java
index 3ef9e11..9a136e0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,11 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -67,15 +67,16 @@
 
 import com.sun.istack.internal.FinalArrayList;
 import com.sun.xml.internal.bind.annotation.XmlLocation;
-import com.sun.xml.internal.bind.v2.TODO;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
 import com.sun.xml.internal.bind.v2.model.annotation.MethodLocatable;
 import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
 import com.sun.xml.internal.bind.v2.model.core.Element;
 import com.sun.xml.internal.bind.v2.model.core.ID;
+import com.sun.xml.internal.bind.v2.model.core.NonElement;
 import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
 import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
 import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
+import com.sun.xml.internal.bind.v2.model.core.ValuePropertyInfo;
 import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
 import com.sun.xml.internal.bind.v2.runtime.Location;
 
@@ -86,8 +87,7 @@
  *
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
-class ClassInfoImpl<T,C,F,M>
-    extends TypeInfoImpl<T,C,F,M>
+class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
     implements ClassInfo<T,C>, Element<T,C> {
 
     protected final C clazz;
@@ -169,12 +169,17 @@
             propOrder = DEFAULT_ORDER;
         }
 
+        if(nav().isInterface(clazz)) {
+            builder.reportError(new IllegalAnnotationException(
+                Messages.CANT_HANDLE_INTERFACE.format(nav().getClassName(clazz)), this ));
+        }
+
         // the class must have the default constructor
         if (!hasFactoryConstructor(t)){
             if(!nav().hasDefaultConstructor(clazz)){
                 Messages msg;
-                if(nav().isInterface(clazz))
-                    msg = Messages.CANT_HANDLE_INTERFACE;
+                if(nav().isInnerClass(clazz))
+                    msg = Messages.CANT_HANDLE_INNER_CLASS;
                 else
                     msg = Messages.NO_DEFAULT_CONSTRUCTOR;
 
@@ -192,8 +197,13 @@
             if(s==null || s==nav().asDecl(Object.class))
                 baseClass = null;
             else {
-                baseClass = (ClassInfoImpl<T,C,F,M>) builder.getClassInfo(s,this);
-                baseClass.hasSubClasses = true;
+                NonElement<T,C> b = builder.getClassInfo(s, true, this);
+                if(b instanceof ClassInfoImpl) {
+                    baseClass = (ClassInfoImpl<T,C,F,M>) b;
+                    baseClass.hasSubClasses = true;
+                } else {
+                    baseClass = null;
+                }
             }
         }
         return baseClass;
@@ -239,7 +249,7 @@
             if(p.id()== ID.ID)
                 return true;
         }
-        ClassInfoImpl<T, C, F, M> base = getBaseClass();
+        ClassInfoImpl<T,C,F,M> base = getBaseClass();
         if(base!=null)
             return base.canBeReferencedByIDREF();
         else
@@ -269,28 +279,7 @@
 
         properties = new FinalArrayList<PropertyInfoImpl<T,C,F,M>>();
 
-        // find properties from fields
-        for( F f : nav().getDeclaredFields(clazz) ) {
-            Annotation[] annotations = reader().getAllFieldAnnotations(f,this);
-            if( nav().isTransient(f) ) {
-                // it's an error for transient field to have any binding annotation
-                if(hasJAXBAnnotation(annotations))
-                    builder.reportError(new IllegalAnnotationException(
-                        Messages.TRANSIENT_FIELD_NOT_BINDABLE.format(nav().getFieldName(f)),
-                            getSomeJAXBAnnotation(annotations)));
-            } else
-            if( nav().isStaticField(f) ) {
-                // static fields are bound only when there's explicit annotation.
-                if(hasJAXBAnnotation(annotations))
-                    addProperty(createFieldSeed(f),annotations);
-            } else {
-                if(at==XmlAccessType.FIELD
-                ||(at==XmlAccessType.PUBLIC_MEMBER && nav().isPublicField(f))
-                || hasJAXBAnnotation(annotations))
-                    addProperty(createFieldSeed(f),annotations);
-                checkFieldXmlLocation(f);
-            }
-        }
+        findFieldProperties(clazz,at);
 
         findGetterSetterProperties(at);
 
@@ -350,6 +339,47 @@
         return properties;
     }
 
+    private void findFieldProperties(C c, XmlAccessType at) {
+        // always find properties from the super class first
+        C sc = nav().getSuperClass(c);
+        if(shouldRecurseSuperClass(sc))
+            findFieldProperties(sc,at);
+
+        for( F f : nav().getDeclaredFields(c) ) {
+            Annotation[] annotations = reader().getAllFieldAnnotations(f,this);
+            if( nav().isTransient(f) ) {
+                // it's an error for transient field to have any binding annotation
+                if(hasJAXBAnnotation(annotations))
+                    builder.reportError(new IllegalAnnotationException(
+                        Messages.TRANSIENT_FIELD_NOT_BINDABLE.format(nav().getFieldName(f)),
+                            getSomeJAXBAnnotation(annotations)));
+            } else
+            if( nav().isStaticField(f) ) {
+                // static fields are bound only when there's explicit annotation.
+                if(hasJAXBAnnotation(annotations))
+                    addProperty(createFieldSeed(f),annotations);
+            } else {
+                if(at==XmlAccessType.FIELD
+                ||(at==XmlAccessType.PUBLIC_MEMBER && nav().isPublicField(f))
+                || hasJAXBAnnotation(annotations))
+                    addProperty(createFieldSeed(f),annotations);
+                checkFieldXmlLocation(f);
+            }
+        }
+    }
+
+    public final boolean hasValueProperty() {
+        ClassInfoImpl<T, C, F, M> bc = getBaseClass();
+        if(bc!=null && bc.hasValueProperty())
+            return true;
+
+        for (PropertyInfo p : getProperties()) {
+            if (p instanceof ValuePropertyInfo) return true;
+        }
+
+        return false;
+    }
+
     public PropertyInfo<T,C> getProperty(String name) {
         for( PropertyInfo<T,C> p: getProperties() ) {
             if(p.getName().equals(name))
@@ -817,23 +847,23 @@
         }
     }
 
-    protected ReferencePropertyInfoImpl<T,C,F,M> createReferenceProperty(PropertySeed<T, C, F, M> seed) {
+    protected ReferencePropertyInfoImpl<T,C,F,M> createReferenceProperty(PropertySeed<T,C,F,M> seed) {
         return new ReferencePropertyInfoImpl<T,C,F,M>(this,seed);
     }
 
-    protected AttributePropertyInfoImpl<T, C, F, M> createAttributeProperty(PropertySeed<T, C, F, M> seed) {
+    protected AttributePropertyInfoImpl<T,C,F,M> createAttributeProperty(PropertySeed<T,C,F,M> seed) {
         return new AttributePropertyInfoImpl<T,C,F,M>(this,seed);
     }
 
-    protected ValuePropertyInfoImpl<T, C, F, M> createValueProperty(PropertySeed<T, C, F, M> seed) {
+    protected ValuePropertyInfoImpl<T,C,F,M> createValueProperty(PropertySeed<T,C,F,M> seed) {
         return new ValuePropertyInfoImpl<T,C,F,M>(this,seed);
     }
 
-    protected ElementPropertyInfoImpl<T, C, F, M> createElementProperty(PropertySeed<T, C, F, M> seed) {
+    protected ElementPropertyInfoImpl<T,C,F,M> createElementProperty(PropertySeed<T,C,F,M> seed) {
         return new ElementPropertyInfoImpl<T,C,F,M>(this,seed);
     }
 
-    protected MapPropertyInfoImpl<T, C, F, M> createMapProperty(PropertySeed<T, C, F, M> seed) {
+    protected MapPropertyInfoImpl<T,C,F,M> createMapProperty(PropertySeed<T,C,F,M> seed) {
         return new MapPropertyInfoImpl<T,C,F,M>(this,seed);
     }
 
@@ -842,54 +872,19 @@
      * Adds properties that consists of accessors.
      */
     private void findGetterSetterProperties(XmlAccessType at) {
-        TODO.checkSpec();   // TODO: I don't think the spec describes how properties are found
-
         // in the first step we accumulate getters and setters
         // into this map keyed by the property name.
         Map<String,M> getters = new LinkedHashMap<String,M>();
         Map<String,M> setters = new LinkedHashMap<String,M>();
 
-        Collection<? extends M> methods = nav().getDeclaredMethods(clazz);
-        for( M method : methods ) {
-            boolean used = false;   // if this method is added to getters or setters
+        C c = clazz;
+        do {
+            collectGetterSetters(clazz, getters, setters);
 
-            if(nav().isBridgeMethod(method))
-                continue;   // ignore
+            // take super classes into account if they have @XmlTransient
+            c = nav().getSuperClass(c);
+        } while(shouldRecurseSuperClass(c));
 
-            String name = nav().getMethodName(method);
-            int arity = nav().getMethodParameters(method).length;
-
-            if(nav().isStaticMethod(method)) {
-                ensureNoAnnotation(method);
-                continue;
-            }
-
-            // don't look at XmlTransient. We'll deal with that later.
-
-            // is this a get method?
-            String propName = getPropertyNameFromGetMethod(name);
-            if(propName!=null) {
-                if(arity==0) {
-                    getters.put(propName,method);
-                    used = true;
-                }
-                // TODO: do we support indexed property?
-            }
-
-            // is this a set method?
-            propName = getPropertyNameFromSetMethod(name);
-            if(propName!=null) {
-                if(arity==1) {
-                    // TODO: we should check collisions like setFoo(int) and setFoo(String)
-                    setters.put(propName,method);
-                    used = true;
-                }
-                // TODO: do we support indexed property?
-            }
-
-            if(!used)
-                ensureNoAnnotation(method);
-        }
 
         // compute the intersection
         Set<String> complete = new TreeSet<String>(getters.keySet());
@@ -911,8 +906,8 @@
             if(!hasAnnotation) {
                 // checking if the method is overriding others isn't free,
                 // so we don't compute it if it's not necessary.
-                isOverriding = (getter!=null && nav().isOverriding(getter))
-                            || (setter!=null && nav().isOverriding(setter));
+                isOverriding = (getter!=null && nav().isOverriding(getter,c))
+                            || (setter!=null && nav().isOverriding(setter,c));
             }
 
             if((at==XmlAccessType.PROPERTY && !isOverriding)
@@ -962,6 +957,90 @@
         // and how it will be XML-ized.
     }
 
+    private void collectGetterSetters(C c, Map<String,M> getters, Map<String,M> setters) {
+        // take super classes into account if they have @XmlTransient.
+        // always visit them first so that
+        //   1) order is right
+        //   2) overriden properties are handled accordingly
+        C sc = nav().getSuperClass(c);
+        if(shouldRecurseSuperClass(sc))
+            collectGetterSetters(sc,getters,setters);
+
+
+        Collection<? extends M> methods = nav().getDeclaredMethods(c);
+        Map<String,List<M>> allSetters = new LinkedHashMap<String,List<M>>();
+        for( M method : methods ) {
+            boolean used = false;   // if this method is added to getters or setters
+
+            if(nav().isBridgeMethod(method))
+                continue;   // ignore
+
+            String name = nav().getMethodName(method);
+            int arity = nav().getMethodParameters(method).length;
+
+            if(nav().isStaticMethod(method)) {
+                ensureNoAnnotation(method);
+                continue;
+            }
+
+            // don't look at XmlTransient on properties. We'll deal with that later.
+
+            // is this a get method?
+            String propName = getPropertyNameFromGetMethod(name);
+            if(propName!=null && arity==0) {
+                getters.put(propName,method);
+                used = true;
+            }
+
+            // is this a set method?
+            propName = getPropertyNameFromSetMethod(name);
+            if(propName!=null && arity==1) {
+                List<M> propSetters = allSetters.get(propName);
+                if(null == propSetters){
+                    propSetters = new ArrayList<M>();
+                    allSetters.put(propName, propSetters);
+                }
+                propSetters.add(method);
+                used = true; // used check performed later
+            }
+
+            if(!used)
+                ensureNoAnnotation(method);
+        }
+
+        // Match getter with setters by comparing getter return type to setter param
+        for (Map.Entry<String,M> entry : getters.entrySet()) {
+            String propName = entry.getKey();
+            M getter = entry.getValue();
+            List<M> propSetters = allSetters.remove(propName);
+            if (null == propSetters) {
+                //no matching setter
+                continue;
+            }
+            T getterType = nav().getReturnType(getter);
+            for (M setter : propSetters) {
+                T setterType = nav().getMethodParameters(setter)[0];
+                if (setterType.equals(getterType)) {
+                    setters.put(propName, setter);
+                    break;
+                }
+            }
+        }
+
+        // also allow set-only properties
+        for (Map.Entry<String,List<M>> e : allSetters.entrySet()) {
+            setters.put(e.getKey(),e.getValue().get(0));
+        }
+    }
+
+    /**
+     * Checks if the properties in this given super class should be aggregated into this class.
+     */
+    private boolean shouldRecurseSuperClass(C sc) {
+        return sc!=null
+            && (builder.isReplaced(sc) || reader().hasClassAnnotation(sc, XmlTransient.class));
+    }
+
     /**
      * Returns true if the method is considered 'public'.
      */
@@ -1182,9 +1261,13 @@
         return factoryMethod != null;
     }
 
-
     public Method getFactoryMethod(){
         return (Method) factoryMethod;
     }
+
+    public String toString() {
+        return "ClassInfo("+clazz+')';
+    }
+
     private static final String[] DEFAULT_ORDER = new String[0];
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java
index e79d57a..1faed72 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.bind.annotation.XmlElementWrapper;
@@ -44,6 +43,7 @@
         XmlElementWrapper e = seed.readAnnotation(XmlElementWrapper.class);
 
         boolean nil = false;
+        boolean required = false;
         if(!isCollection()) {
             xmlName = null;
             if(e!=null)
@@ -56,11 +56,13 @@
             if(e!=null) {
                 xmlName = calcXmlName(e);
                 nil = e.nillable();
+                required = e.required();
             } else
                 xmlName = null;
         }
 
         wrapperNillable = nil;
+        wrapperRequired = required;
     }
 
     private final QName xmlName;
@@ -71,6 +73,11 @@
     private final boolean wrapperNillable;
 
     /**
+     * True if the wrapper tag is required.
+     */
+    private final boolean wrapperRequired;
+
+    /**
      * Gets the wrapper element name.
      */
     public final QName getXmlName() {
@@ -80,4 +87,8 @@
     public final boolean isCollectionNillable() {
         return wrapperNillable;
     }
+
+    public final boolean isCollectionRequired() {
+        return wrapperRequired;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java
index 1c7f6f3..ddcae96 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.annotation.Annotation;
@@ -41,6 +40,7 @@
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
 
+import com.sun.istack.internal.FinalArrayList;
 import com.sun.xml.internal.bind.v2.TODO;
 import com.sun.xml.internal.bind.v2.model.annotation.AnnotationSource;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
@@ -57,7 +57,6 @@
 import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
 import com.sun.xml.internal.bind.v2.runtime.Location;
 import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
-import com.sun.istack.internal.FinalArrayList;
 
 /**
  * {@link ElementInfo} implementation.
@@ -70,6 +69,8 @@
 
     private final NonElement<T,C> contentType;
 
+    private final T tOfJAXBElementT;
+
     private final T elementType;
 
     private final ClassInfo<T,C> scope;
@@ -140,6 +141,10 @@
             return tagName;
         }
 
+        public boolean isCollectionRequired() {
+            return false;
+        }
+
         public boolean isCollectionNillable() {
             return true;
         }
@@ -264,15 +269,16 @@
         }
         this.adapter = a;
 
+        // T of JAXBElement<T>
+        tOfJAXBElementT =
+            methodParams.length>0 ? methodParams[0] // this is more reliable, as it works even for ObjectFactory that sometimes have to return public types
+            : nav().getTypeArgument(baseClass,0); // fall back to infer from the return type if no parameter.
+
         if(adapter==null) {
-            // T of JAXBElement<T>
-            T typeType =
-                methodParams.length>0 ? methodParams[0] // this is more reliable, as it works even for ObjectFactory that sometimes have to return public types
-                : nav().getTypeArgument(baseClass,0); // fall back to infer from the return type if no parameter.
-            T list = nav().getBaseClass(typeType,nav().asDecl(List.class));
+            T list = nav().getBaseClass(tOfJAXBElementT,nav().asDecl(List.class));
             if(list==null) {
                 isCollection = false;
-                contentType = builder.getTypeInfo(typeType,this);  // suck this type into the current set.
+                contentType = builder.getTypeInfo(tOfJAXBElementT,this);  // suck this type into the current set.
             } else {
                 isCollection = true;
                 contentType = builder.getTypeInfo(nav().getTypeArgument(list,0),this);
@@ -339,7 +345,7 @@
 
     public T getContentInMemoryType() {
         if(adapter==null) {
-            return contentType.getType();
+            return tOfJAXBElementT;
         } else {
             return adapter.customType;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java
index d0e737e..3ed3164 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.AbstractList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java
index d852123..b13521e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import com.sun.xml.internal.bind.v2.model.core.EnumConstant;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java
index ae2ae6a..3e0967e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Iterator;
@@ -108,7 +107,9 @@
      */
     protected void calcConstants() {
         EnumConstantImpl<T,C,F,M> last = null;
-        for( F constant : nav().getEnumConstants(clazz) ) {
+        F[] constants = nav().getEnumConstants(clazz);
+        for( int i=constants.length-1; i>=0; i-- ) {
+            F constant = constants[i];
             String name = nav().getFieldName(constant);
             XmlEnumValue xev = builder.reader.getFieldAnnotation(XmlEnumValue.class, constant, this);
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java
index 33f3da9..6c7bdd8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java
index a08ba9a..2c8fa37 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java
index 9229704..e8c9874 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java
index 8e8535b..eaea94f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Arrays;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java
index 8f9e79a..7a49bf2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.text.MessageFormat;
@@ -39,6 +38,7 @@
     DUPLICATE_ANNOTATIONS, // 1 arg
     NO_DEFAULT_CONSTRUCTOR, // 1 arg
     CANT_HANDLE_INTERFACE, // 1 arg
+    CANT_HANDLE_INNER_CLASS, // 1 arg
     ANNOTATION_ON_WRONG_METHOD, // 0 args
     GETTER_SETTER_INCOMPATIBLE_TYPE, // 2 args
     DUPLICATE_ENTRY_IN_PROP_ORDER, // 1 arg
@@ -82,9 +82,18 @@
     NO_FACTORY_METHOD, // 2 args
     FACTORY_CLASS_NEEDS_FACTORY_METHOD, // 1 arg
 
+    INCOMPATIBLE_API_VERSION, // 2 args
+    INCOMPATIBLE_API_VERSION_MUSTANG, // 2 args
+
     MISSING_JAXB_PROPERTIES, // 1arg
     TRANSIENT_FIELD_NOT_BINDABLE, // 1 arg
-    THERE_MUST_BE_VALUE_IN_XMLVALUE // 1 arg
+    THERE_MUST_BE_VALUE_IN_XMLVALUE, // 1 arg
+    UNMATCHABLE_ADAPTER, // 2 args
+
+    ACCESSORFACTORY_INSTANTIATION_EXCEPTION, // 2 arg
+    ACCESSORFACTORY_ACCESS_EXCEPTION, // 2 arg
+    CUSTOM_ACCESSORFACTORY_PROPERTY_ERROR, // 2 arg
+    CUSTOM_ACCESSORFACTORY_FIELD_ERROR, // 2 arg
     ;
 
     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties
index a32e0b0..929ba29 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 ID_MUST_BE_STRING = \
     Property "{0}" has an XmlID annotation but its type is not String.
 
@@ -13,6 +38,9 @@
 CANT_HANDLE_INTERFACE = \
     {0} is an interface, and JAXB can''t handle interfaces.
 
+CANT_HANDLE_INNER_CLASS = \
+    {0} is a non-static inner class, and JAXB can''t handle those.
+
 ANNOTATION_ON_WRONG_METHOD = \
     JAXB annotation is placed on a method that is not a JAXB property
 
@@ -124,4 +152,27 @@
 
 THERE_MUST_BE_VALUE_IN_XMLVALUE = \
     Object must have some value in its @XmlValue field: {0}
+
+INCOMPATIBLE_API_VERSION = \
+    JAXB 2.0 API jar is being loaded (from {0}), but this RI (from {1}) requires JAXB 2.1 API jar.
+
+INCOMPATIBLE_API_VERSION_MUSTANG = \
+    JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from {1}) needs 2.1 API. \
+    Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. \
+    (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
+
+UNMATCHABLE_ADAPTER = \
+    Adapter {0} is not applicable to the field type {1}. 
+
+ACCESSORFACTORY_INSTANTIATION_EXCEPTION = \
+    Unable to create instance of AccessorFactory, {0} for class {1}.
+
+ACCESSORFACTORY_ACCESS_EXCEPTION = \
+    Unable to access instance of AccessorFactory, {0} for class {1}.
+
+CUSTOM_ACCESSORFACTORY_PROPERTY_ERROR = \
+    Custom AccessorFactory, {0}, is reporting an error accessing a property. {1}
+
+CUSTOM_ACCESSORFACTORY_FIELD_ERROR = \
+    Custom AccessorFactory, {0}, is reporting an error accessing a field. {1}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java
index e7fc190..1baa96d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,16 +22,21 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.xml.bind.annotation.XmlAttachmentRef;
 import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.namespace.QName;
 
+import com.sun.xml.internal.bind.util.Which;
 import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
+import com.sun.xml.internal.bind.v2.model.annotation.ClassLocatable;
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
 import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
 import com.sun.xml.internal.bind.v2.model.core.ErrorHandler;
@@ -90,10 +95,14 @@
      */
     public final String defaultNsUri;
 
+
     /**
      * Packages whose registries are already added.
      */
-    /*package*/ final Map<String,RegistryInfoImpl> registries = new HashMap<String,RegistryInfoImpl>();
+    /*package*/ final Map<String,RegistryInfoImpl<T,C,F,M>> registries
+            = new HashMap<String,RegistryInfoImpl<T,C,F,M>>();
+
+    private final Map<C,C> subclassReplacements;
 
     /**
      * @see #setErrorHandler
@@ -101,20 +110,28 @@
     private ErrorHandler errorHandler;
     private boolean hadError;
 
+    /**
+     * Set to true if the model includes {@link XmlAttachmentRef}. JAX-WS
+     * needs to know this information.
+     */
+    public boolean hasSwaRef;
+
     private final ErrorHandler proxyErrorHandler = new ErrorHandler() {
         public void error(IllegalAnnotationException e) {
             reportError(e);
         }
     };
 
-
     public ModelBuilder(
-        AnnotationReader<T,C,F,M> reader,
-        Navigator<T,C,F,M> navigator,
-        String defaultNamespaceRemap ) {
+            AnnotationReader<T, C, F, M> reader,
+            Navigator<T, C, F, M> navigator,
+            Map<C, C> subclassReplacements,
+            String defaultNamespaceRemap
+    ) {
 
         this.reader = reader;
         this.nav = navigator;
+        this.subclassReplacements = subclassReplacements;
         if(defaultNamespaceRemap==null)
             defaultNamespaceRemap = "";
         this.defaultNsUri = defaultNamespaceRemap;
@@ -122,8 +139,33 @@
         typeInfoSet = createTypeInfoSet();
     }
 
+    /**
+     * Makes sure that we are running with 2.1 JAXB API,
+     * and report an error if not.
+     */
+    static {
+        try {
+            XmlSchema s = null;
+            s.location();
+        } catch (NullPointerException e) {
+            // as epxected
+        } catch (NoSuchMethodError e) {
+            // this is not a 2.1 API. Where is it being loaded from?
+            Messages res;
+            if(XmlSchema.class.getClassLoader()==null)
+                res = Messages.INCOMPATIBLE_API_VERSION_MUSTANG;
+            else
+                res = Messages.INCOMPATIBLE_API_VERSION;
+
+            throw new LinkageError( res.format(
+                Which.which(XmlSchema.class),
+                Which.which(ModelBuilder.class)
+            ));
+        }
+    }
+
     protected TypeInfoSetImpl<T,C,F,M> createTypeInfoSet() {
-        return new TypeInfoSetImpl(nav,reader,BuiltinLeafInfoImpl.createLeaves(nav));
+        return new TypeInfoSetImpl<T,C,F,M>(nav,reader,BuiltinLeafInfoImpl.createLeaves(nav));
     }
 
     /**
@@ -135,6 +177,15 @@
      * {@link String} or {@link Enum}-derived ones)
      */
     public NonElement<T,C> getClassInfo( C clazz, Locatable upstream ) {
+        return getClassInfo(clazz,false,upstream);
+    }
+
+    /**
+     * For limited cases where the caller needs to search for a super class.
+     * This is necessary because we don't want {@link #subclassReplacements}
+     * to kick in for the super class search, which will cause infinite recursion.
+     */
+    public NonElement<T,C> getClassInfo( C clazz, boolean searchForSuperClass, Locatable upstream ) {
         assert clazz!=null;
         NonElement<T,C> r = typeInfoSet.getClassInfo(clazz);
         if(r!=null)
@@ -144,32 +195,53 @@
             EnumLeafInfoImpl<T,C,F,M> li = createEnumLeafInfo(clazz,upstream);
             typeInfoSet.add(li);
             r = li;
+            addTypeName(r);
         } else {
-            ClassInfoImpl<T,C,F,M> ci = createClassInfo(clazz,upstream);
-            typeInfoSet.add(ci);
+            boolean isReplaced = subclassReplacements.containsKey(clazz);
+            if(isReplaced && !searchForSuperClass) {
+                // handle it as if the replacement was specified
+                r = getClassInfo(subclassReplacements.get(clazz),upstream);
+            } else
+            if(reader.hasClassAnnotation(clazz,XmlTransient.class) || isReplaced) {
+                // handle it as if the base class was specified
+                r = getClassInfo( nav.getSuperClass(clazz), searchForSuperClass,
+                        new ClassLocatable<C>(upstream,clazz,nav) );
+            } else {
+                ClassInfoImpl<T,C,F,M> ci = createClassInfo(clazz,upstream);
+                typeInfoSet.add(ci);
 
-            // compute the closure by eagerly expanding references
-            for( PropertyInfo<T,C> p : ci.getProperties() ) {
-                if(p.kind()== PropertyKind.REFERENCE) {
-                    // make sure that we have a registry for this package
-                    String pkg = nav.getPackageName(ci.getClazz());
-                    if(!registries.containsKey(pkg)) {
-                        // insert the package's object factory
-                        C c = nav.findClass(pkg + ".ObjectFactory",ci.getClazz());
-                        if(c!=null)
-                            addRegistry(c,(Locatable)p);
+                // compute the closure by eagerly expanding references
+                for( PropertyInfo<T,C> p : ci.getProperties() ) {
+                    if(p.kind()== PropertyKind.REFERENCE) {
+                        // make sure that we have a registry for this package
+                        String pkg = nav.getPackageName(ci.getClazz());
+                        if(!registries.containsKey(pkg)) {
+                            // insert the package's object factory
+                            C c = nav.findClass(pkg + ".ObjectFactory",ci.getClazz());
+                            if(c!=null)
+                                addRegistry(c,(Locatable)p);
+                        }
                     }
+
+                    for( TypeInfo<T,C> t : p.ref() )
+                        ; // just compute a reference should be suffice
                 }
+                ci.getBaseClass(); // same as above.
 
-                for( TypeInfo<T,C> t : p.ref() )
-                    ; // just compute a reference should be suffice
+                r = ci;
+                addTypeName(r);
             }
-            ci.getBaseClass();
-
-            r = ci;
         }
 
-        addTypeName(r);
+
+        // more reference closure expansion. @XmlSeeAlso
+        XmlSeeAlso sa = reader.getClassAnnotation(XmlSeeAlso.class, clazz, upstream);
+        if(sa!=null) {
+            for( T t : reader.getClassArrayValue(sa,"value") ) {
+                getTypeInfo(t,(Locatable)sa);
+            }
+        }
+
 
         return r;
     }
@@ -234,8 +306,7 @@
         return new EnumLeafInfoImpl<T,C,F,M>(this,upstream,clazz,nav.use(clazz));
     }
 
-    protected ClassInfoImpl<T,C,F,M> createClassInfo(
-            C clazz, Locatable upstream ) {
+    protected ClassInfoImpl<T,C,F,M> createClassInfo(C clazz, Locatable upstream ) {
         return new ClassInfoImpl<T,C,F,M>(this,upstream,clazz);
     }
 
@@ -254,8 +325,7 @@
      * in it.
      */
     public RegistryInfo<T,C> addRegistry(C registryClass, Locatable upstream ) {
-        RegistryInfoImpl<T,C,F,M> r = new RegistryInfoImpl<T,C,F,M>(this,upstream,registryClass);
-        return r;
+        return new RegistryInfoImpl<T,C,F,M>(this,upstream,registryClass);
     }
 
     /**
@@ -324,4 +394,8 @@
         if(errorHandler!=null)
             errorHandler.error(e);
     }
+
+    public boolean isReplaced(C sc) {
+        return subclassReplacements.containsKey(sc);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java
index 8675beb..93c2c25 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Collection;
+import java.lang.annotation.Annotation;
 
 import javax.activation.MimeType;
 import javax.xml.bind.annotation.XmlAttachmentRef;
@@ -38,6 +38,7 @@
 import javax.xml.bind.annotation.XmlSchema;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.namespace.QName;
 
 import com.sun.xml.internal.bind.v2.TODO;
@@ -81,7 +82,16 @@
     protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent, PropertySeed<T,C,F,M> spi) {
         this.seed = spi;
         this.parent = parent;
-        this.id = calcId();
+
+        if(parent==null)
+            /*
+                Various people reported a bug where this parameter is somehow null.
+                In an attempt to catch the error better, let's do an explicit check here.
+
+                http://forums.java.net/jive/thread.jspa?threadID=18479
+                http://forums.java.net/jive/thread.jspa?messageID=165946
+             */
+            throw new AssertionError();
 
         MimeType mt = Util.calcExpectedMediaType(seed,parent.builder);
         if(mt!=null && !kind().canHaveXmlMimeType) {
@@ -97,21 +107,46 @@
                 getIndividualType(),this);
 
         T t = seed.getRawType();
-        this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
-                         || nav().isArrayButNotByteArray(t);
 
-        XmlJavaTypeAdapter xjta = getApplicableAdapter(getIndividualType());
-        if(xjta==null) {
-            // ugly ugly hack, but we implement swaRef as adapter
-            XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
-            if(xsa!=null) {
-                adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
-            } else {
-                adapter = null;
-            }
-        } else {
+        // check if there's an adapter applicable to the whole property
+        XmlJavaTypeAdapter xjta = getApplicableAdapter(t);
+        if(xjta!=null) {
+            isCollection = false;
             adapter = new Adapter<T,C>(xjta,reader(),nav());
+        } else {
+            // check if the adapter is applicable to the individual item in the property
+
+            this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
+                             || nav().isArrayButNotByteArray(t);
+
+            xjta = getApplicableAdapter(getIndividualType());
+            if(xjta==null) {
+                // ugly ugly hack, but we implement swaRef as adapter
+                XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
+                if(xsa!=null) {
+                    parent.builder.hasSwaRef = true;
+                    adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
+                } else {
+                    adapter = null;
+
+                    // if this field has adapter annotation but not applicable,
+                    // that must be an error of the user
+                    xjta = seed.readAnnotation(XmlJavaTypeAdapter.class);
+                    if(xjta!=null) {
+                        T adapter = reader().getClassValue(xjta,"value");
+                        parent.builder.reportError(new IllegalAnnotationException(
+                            Messages.UNMATCHABLE_ADAPTER.format(
+                                    nav().getTypeName(adapter), nav().getTypeName(t)),
+                            xjta
+                        ));
+                    }
+                }
+            } else {
+                adapter = new Adapter<T,C>(xjta,reader(),nav());
+            }
         }
+
+        this.id = calcId();
     }
 
 
@@ -159,13 +194,21 @@
         if(jta==null)   return false;
 
         T type = reader().getClassValue(jta,"type");
-        return declaredType.equals(type);
+        if(declaredType.equals(type))
+            return true;    // for types explicitly marked in XmlJavaTypeAdapter.type()
 
+        T adapter = reader().getClassValue(jta,"value");
+        T ba = nav().getBaseClass(adapter, nav().asDecl(XmlAdapter.class));
+        if(!nav().isParameterizedType(ba))
+            return true;   // can't check type applicability. assume Object, which means applicable to any.
+        T inMemType = nav().getTypeArgument(ba, 1);
+
+        return nav().isSubClassOf(declaredType,inMemType);
     }
 
     private XmlJavaTypeAdapter getApplicableAdapter(T type) {
         XmlJavaTypeAdapter jta = seed.readAnnotation(XmlJavaTypeAdapter.class);
-        if(jta!=null)
+        if(jta!=null && isApplicable(jta,type))
             return jta;
 
         // check the applicable adapters on the package
@@ -181,10 +224,10 @@
             return jta;
 
         // then on the target class
-        C refType = nav().asDecl(seed.getRawType());
+        C refType = nav().asDecl(type);
         if(refType!=null) {
             jta = reader().getClassAnnotation(XmlJavaTypeAdapter.class, refType, seed );
-            if(jta!=null) // the one on the type always apply.
+            if(jta!=null && isApplicable(jta,type)) // the one on the type always apply.
                 return jta;
         }
 
@@ -211,7 +254,7 @@
     private ID calcId() {
         if(seed.hasAnnotation(XmlID.class)) {
             // check the type
-            if(!seed.getRawType().equals(nav().ref(String.class)))
+            if(!getIndividualType().equals(nav().ref(String.class)))
                 parent.builder.reportError(new IllegalAnnotationException(
                     Messages.ID_MUST_BE_STRING.format(getName()), seed )
                 );
@@ -331,4 +374,12 @@
     public int compareTo(PropertyInfoImpl that) {
         return this.getName().compareTo(that.getName());
     }
+
+    public final <A extends Annotation> A readAnnotation(Class<A> annotationType) {
+        return seed.readAnnotation(annotationType);
+    }
+
+    public final boolean hasAnnotation(Class<? extends Annotation> annotationType) {
+        return seed.hasAnnotation(annotationType);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java
index 9c190a3..422e7e6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java
index 7e95ce1..d45cc5a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Collections;
@@ -34,6 +33,8 @@
 import javax.xml.bind.annotation.XmlElementRef;
 import javax.xml.bind.annotation.XmlElementRefs;
 import javax.xml.bind.annotation.XmlMixed;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlNsForm;
 import javax.xml.namespace.QName;
 
 import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
@@ -185,8 +186,15 @@
 
     private String getEffectiveNamespaceFor(XmlElementRef r) {
         String nsUri = r.namespace();
-        if(nsUri.length()==0)
-            nsUri = parent.builder.defaultNsUri;
+
+        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
+        if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
+            // JAX-RPC doesn't want the default namespace URI swapping to take effect to
+            // local "unqualified" elements. UGLY.
+            if(nsUri.length()==0)
+                nsUri = parent.builder.defaultNsUri;
+        }
+
         return nsUri;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java
index eebc654..1528d20 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.LinkedHashSet;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java
index 06e5214..c84fc8d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java
index 2731afa..13232eb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java
index a4e3bd1..272759a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
index 719ae13..3b8e1db 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.awt.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java
index 93dac63..fce327a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.io.IOException;
@@ -34,8 +33,10 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.xml.bind.annotation.XmlType;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.bind.JAXBException;
 
 import com.sun.istack.internal.NotNull;
 import com.sun.xml.internal.bind.annotation.XmlLocation;
@@ -51,9 +52,14 @@
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.Transducer;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+import com.sun.xml.internal.bind.AccessorFactory;
+import com.sun.xml.internal.bind.AccessorFactoryImpl;
 import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+import com.sun.xml.internal.bind.XmlAccessorFactory;
+import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
 
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -72,10 +78,53 @@
      */
     private Accessor<?,Locator> xmlLocationAccessor;
 
+    private AccessorFactory accessorFactory;
+
     public RuntimeClassInfoImpl(RuntimeModelBuilder modelBuilder, Locatable upstream, Class clazz) {
         super(modelBuilder, upstream, clazz);
+        accessorFactory = createAccessorFactory(clazz);
     }
 
+    protected AccessorFactory createAccessorFactory(Class clazz) {
+        XmlAccessorFactory factoryAnn;
+        AccessorFactory accFactory = null;
+
+        // user providing class to be used.
+        if (((RuntimeModelBuilder)builder).context.xmlAccessorFactorySupport){
+            factoryAnn = findXmlAccessorFactoryAnnotation(clazz);
+
+            if (factoryAnn != null) {
+                try {
+                    accFactory = factoryAnn.value().newInstance();
+                } catch (InstantiationException e) {
+                    builder.reportError(new IllegalAnnotationException(
+                            Messages.ACCESSORFACTORY_INSTANTIATION_EXCEPTION.format(
+                            factoryAnn.getClass().getName(), nav().getClassName(clazz)), this));
+                } catch (IllegalAccessException e) {
+                    builder.reportError(new IllegalAnnotationException(
+                            Messages.ACCESSORFACTORY_ACCESS_EXCEPTION.format(
+                            factoryAnn.getClass().getName(), nav().getClassName(clazz)),this));
+                }
+            }
+        }
+
+        // Fall back to local AccessorFactory when no
+        // user not providing one or as error recovery.
+        if (accFactory == null){
+            accFactory = AccessorFactoryImpl.getInstance();
+        }
+        return accFactory;
+    }
+
+    protected XmlAccessorFactory findXmlAccessorFactoryAnnotation(Class clazz) {
+        XmlAccessorFactory factoryAnn = reader().getClassAnnotation(XmlAccessorFactory.class,clazz,this);
+        if (factoryAnn == null) {
+            factoryAnn = reader().getPackageAnnotation(XmlAccessorFactory.class,clazz,this);
+        }
+        return factoryAnn;
+    }
+
+
     public Method getFactoryMethod(){
         return super.getFactoryMethod();
     }
@@ -122,8 +171,8 @@
 
 
     public void link() {
-        super.link();
         getTransducer();    // populate the transducer
+        super.link();
     }
 
     private Accessor<?,Map<QName,String>> attributeWildcardAccessor;
@@ -171,7 +220,8 @@
         if( !valuep.getTarget().isSimpleType() )
             return null;    // if there's an error, recover from it by returning null.
 
-        return new TransducerImpl(getClazz(),TransducedAccessor.get(valuep));
+        return new TransducerImpl(getClazz(),TransducedAccessor.get(
+                ((RuntimeModelBuilder)builder).context,valuep));
     }
 
     /**
@@ -184,29 +234,32 @@
 
     @Override
     protected RuntimePropertySeed createFieldSeed(Field field) {
-        Accessor.FieldReflection acc;
-        if(Modifier.isStatic(field.getModifiers()))
-            acc = new Accessor.ReadOnlyFieldReflection(field);
-        else
-            acc = new Accessor.FieldReflection(field);
-
-        return new RuntimePropertySeed(
-            super.createFieldSeed(field),
-                acc );
+       final boolean readOnly = Modifier.isStatic(field.getModifiers());
+        Accessor acc;
+        try {
+            acc = accessorFactory.createFieldAccessor(clazz, field, readOnly);
+        } catch(JAXBException e) {
+            builder.reportError(new IllegalAnnotationException(
+                    Messages.CUSTOM_ACCESSORFACTORY_FIELD_ERROR.format(
+                    nav().getClassName(clazz), e.toString()), this ));
+            acc = Accessor.getErrorInstance(); // error recovery
+        }
+        return new RuntimePropertySeed(super.createFieldSeed(field), acc );
     }
 
     @Override
     public RuntimePropertySeed createAccessorSeed(Method getter, Method setter) {
         Accessor acc;
-        if(getter==null)
-            acc = new Accessor.SetterOnlyReflection(setter);
-        else
-        if(setter==null)
-            acc = new Accessor.GetterOnlyReflection(getter);
-        else
-            acc = new Accessor.GetterSetterReflection(getter, setter);
-
-        return new RuntimePropertySeed( super.createAccessorSeed(getter,setter), acc );
+        try {
+            acc = accessorFactory.createPropertyAccessor(clazz, getter, setter);
+        } catch(JAXBException e) {
+            builder.reportError(new IllegalAnnotationException(
+                Messages.CUSTOM_ACCESSORFACTORY_PROPERTY_ERROR.format(
+                nav().getClassName(clazz), e.toString()), this ));
+            acc = Accessor.getErrorInstance(); // error recovery
+        }
+        return new RuntimePropertySeed( super.createAccessorSeed(getter,setter),
+          acc );
     }
 
     @Override
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java
index 7bf5397..f8840be 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
@@ -42,6 +41,7 @@
 import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement;
 import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
 import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeRef;
+import com.sun.xml.internal.bind.v2.model.nav.Navigator;
 import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
 import com.sun.xml.internal.bind.v2.runtime.Transducer;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
@@ -121,7 +121,7 @@
     }
 
     public Class<? extends JAXBElement> getType() {
-        return JAXBElement.class;
+        return Navigator.REFLECTION.erasure(super.getType());
     }
 
     public RuntimeClassInfo getScope() {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java
index 24edc32..99b07e6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java
index a4eb831..9e7dd64 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java
index 92fad55..edf1dfb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java
index 245e73d..f272a29 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java
index 8455748..06b25a2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
+import java.util.Map;
 
 import javax.activation.MimeType;
 
@@ -48,6 +48,7 @@
 import com.sun.xml.internal.bind.v2.runtime.MimeTypedTransducer;
 import com.sun.xml.internal.bind.v2.runtime.SchemaTypeTransducer;
 import com.sun.xml.internal.bind.v2.runtime.Transducer;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
 
 import org.xml.sax.SAXException;
@@ -63,9 +64,14 @@
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public class RuntimeModelBuilder extends ModelBuilder<Type,Class,Field,Method> {
+    /**
+     * The {@link JAXBContextImpl} for which the model is built.
+     */
+    public final JAXBContextImpl context;
 
-    public RuntimeModelBuilder(RuntimeAnnotationReader annotationReader, String defaultNamespaceRemap) {
-        super(annotationReader, Navigator.REFLECTION, defaultNamespaceRemap);
+    public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
+        super(annotationReader, Navigator.REFLECTION, subclassReplacements, defaultNamespaceRemap);
+        this.context = context;
     }
 
     @Override
@@ -74,6 +80,11 @@
     }
 
     @Override
+    public RuntimeNonElement getClassInfo( Class clazz, boolean searchForSuperClass, Locatable upstream ) {
+        return (RuntimeNonElement)super.getClassInfo(clazz,searchForSuperClass,upstream);
+    }
+
+    @Override
     protected RuntimeEnumLeafInfoImpl createEnumLeafInfo(Class clazz, Locatable upstream) {
         return new RuntimeEnumLeafInfoImpl(this,upstream,clazz);
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java
index fdd90f2..b96c46f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java
index 23e29ca..709d047 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java
index 43316b2..2dd76c6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java
index 88d8ad0..f428ebd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java
index 18f5fd9..2676694 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Collections;
@@ -63,7 +62,7 @@
             if(getAdapter()!=null && !isCollection())
                 // adapter for a single-value property is handled by accessor.
                 // adapter for a collection property is handled by lister.
-                rawAcc = rawAcc.adapt(getAdapter());
+                rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
             this.acc = rawAcc;
         } else
             this.acc = null;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java
index d9e8d41..1766502 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.bind.annotation.XmlRootElement;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java
index ef5fa01..9c966a5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import java.util.Collections;
@@ -67,28 +66,27 @@
  *
  * @author Kohsuke Kawaguchi
  */
-class TypeInfoSetImpl<TypeT,ClassDeclT,FieldT,MethodT> implements
-        TypeInfoSet<TypeT,ClassDeclT,FieldT,MethodT> {
+class TypeInfoSetImpl<T,C,F,M> implements TypeInfoSet<T,C,F,M> {
 
     @XmlTransient
-    public final Navigator<TypeT,ClassDeclT,FieldT,MethodT> nav;
+    public final Navigator<T,C,F,M> nav;
 
     @XmlTransient
-    public final AnnotationReader<TypeT,ClassDeclT,FieldT,MethodT> reader;
+    public final AnnotationReader<T,C,F,M> reader;
 
     /**
      * All the leaves.
      */
-    private final Map<TypeT,BuiltinLeafInfo<TypeT,ClassDeclT>> builtins =
-            new LinkedHashMap<TypeT,BuiltinLeafInfo<TypeT,ClassDeclT>>();
+    private final Map<T,BuiltinLeafInfo<T,C>> builtins =
+            new LinkedHashMap<T,BuiltinLeafInfo<T,C>>();
 
     /** All {@link EnumLeafInfoImpl}s. */
-    private final Map<ClassDeclT,EnumLeafInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> enums =
-            new LinkedHashMap<ClassDeclT,EnumLeafInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>();
+    private final Map<C,EnumLeafInfoImpl<T,C,F,M>> enums =
+            new LinkedHashMap<C,EnumLeafInfoImpl<T,C,F,M>>();
 
     /** All {@link ArrayInfoImpl}s. */
-    private final Map<TypeT,ArrayInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> arrays =
-            new LinkedHashMap<TypeT,ArrayInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>();
+    private final Map<T,ArrayInfoImpl<T,C,F,M>> arrays =
+            new LinkedHashMap<T,ArrayInfoImpl<T,C,F,M>>();
 
     /**
      * All the user-defined classes.
@@ -99,23 +97,23 @@
      * an error to be reported on a class closer to the user's code.
      */
     @XmlJavaTypeAdapter(RuntimeUtil.ToStringAdapter.class)
-    private final Map<ClassDeclT,ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> beans
-            = new LinkedHashMap<ClassDeclT,ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>();
+    private final Map<C,ClassInfoImpl<T,C,F,M>> beans
+            = new LinkedHashMap<C,ClassInfoImpl<T,C,F,M>>();
 
     @XmlTransient
-    private final Map<ClassDeclT,ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> beansView =
+    private final Map<C,ClassInfoImpl<T,C,F,M>> beansView =
         Collections.unmodifiableMap(beans);
 
     /**
      * The element mapping.
      */
-    private final Map<ClassDeclT,Map<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>> elementMappings =
-        new LinkedHashMap<ClassDeclT,Map<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>>();
+    private final Map<C,Map<QName,ElementInfoImpl<T,C,F,M>>> elementMappings =
+        new LinkedHashMap<C,Map<QName,ElementInfoImpl<T,C,F,M>>>();
 
-    private final Iterable<? extends ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> allElements =
-        new Iterable<ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>() {
-            public Iterator<ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> iterator() {
-                return new FlattenIterator<ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>(elementMappings.values());
+    private final Iterable<? extends ElementInfoImpl<T,C,F,M>> allElements =
+        new Iterable<ElementInfoImpl<T,C,F,M>>() {
+            public Iterator<ElementInfoImpl<T,C,F,M>> iterator() {
+                return new FlattenIterator<ElementInfoImpl<T,C,F,M>>(elementMappings.values());
             }
         };
 
@@ -125,7 +123,7 @@
      * anyType is the only {@link TypeInfo} that works with an interface,
      * and accordingly it requires a lot of special casing.
      */
-    private final NonElement<TypeT,ClassDeclT> anyType;
+    private final NonElement<T,C> anyType;
 
     /**
      * Lazily parsed set of {@link XmlNs}s.
@@ -134,9 +132,9 @@
      */
     private Map<String,Map<String,String>> xmlNsCache;
 
-    public TypeInfoSetImpl(Navigator<TypeT,ClassDeclT,FieldT,MethodT> nav,
-                           AnnotationReader<TypeT,ClassDeclT,FieldT,MethodT> reader,
-                           Map<TypeT,? extends BuiltinLeafInfoImpl<TypeT,ClassDeclT>> leaves) {
+    public TypeInfoSetImpl(Navigator<T,C,F,M> nav,
+                           AnnotationReader<T,C,F,M> reader,
+                           Map<T,? extends BuiltinLeafInfoImpl<T,C>> leaves) {
         this.nav = nav;
         this.reader = reader;
         this.builtins.putAll(leaves);
@@ -149,32 +147,32 @@
         }
 
         // make sure at lease we got a map for global ones.
-        elementMappings.put(null,new LinkedHashMap<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>());
+        elementMappings.put(null,new LinkedHashMap<QName,ElementInfoImpl<T,C,F,M>>());
     }
 
-    protected NonElement<TypeT,ClassDeclT> createAnyType() {
-        return new AnyTypeImpl<TypeT,ClassDeclT>(nav);
+    protected NonElement<T,C> createAnyType() {
+        return new AnyTypeImpl<T,C>(nav);
     }
 
-    public Navigator<TypeT,ClassDeclT,FieldT,MethodT> getNavigator() {
+    public Navigator<T,C,F,M> getNavigator() {
         return nav;
     }
 
     /**
      * Adds a new {@link ClassInfo} to the set.
      */
-    public void add( ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci ) {
+    public void add( ClassInfoImpl<T,C,F,M> ci ) {
         beans.put( ci.getClazz(), ci );
     }
 
     /**
      * Adds a new {@link LeafInfo} to the set.
      */
-    public void add( EnumLeafInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> li ) {
+    public void add( EnumLeafInfoImpl<T,C,F,M> li ) {
         enums.put( li.clazz,  li );
     }
 
-    public void add(ArrayInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> ai) {
+    public void add(ArrayInfoImpl<T, C, F, M> ai) {
         arrays.put( ai.getType(), ai );
     }
 
@@ -185,32 +183,32 @@
      *      null if the specified type cannot be bound by JAXB, or
      *      not known to this set.
      */
-    public NonElement<TypeT,ClassDeclT> getTypeInfo( TypeT type ) {
+    public NonElement<T,C> getTypeInfo( T type ) {
         type = nav.erasure(type);   // replace type variables by their bounds
 
-        LeafInfo<TypeT,ClassDeclT> l = builtins.get(type);
+        LeafInfo<T,C> l = builtins.get(type);
         if(l!=null)     return l;
 
         if( nav.isArray(type) ) {
             return arrays.get(type);
         }
 
-        ClassDeclT d = nav.asDecl(type);
+        C d = nav.asDecl(type);
         if(d==null)     return null;
         return getClassInfo(d);
     }
 
-    public NonElement<TypeT,ClassDeclT> getAnyTypeInfo() {
+    public NonElement<T,C> getAnyTypeInfo() {
         return anyType;
     }
 
     /**
      * This method is used to add a root reference to a model.
      */
-    public NonElement<TypeT,ClassDeclT> getTypeInfo(Ref<TypeT,ClassDeclT> ref) {
+    public NonElement<T,C> getTypeInfo(Ref<T,C> ref) {
         // TODO: handle XmlValueList
         assert !ref.valueList;
-        ClassDeclT c = nav.asDecl(ref.type);
+        C c = nav.asDecl(ref.type);
         if(c!=null && reader.getClassAnnotation(XmlRegistry.class,c,null/*TODO: is this right?*/)!=null) {
             return null;    // TODO: is this correct?
         } else
@@ -220,19 +218,19 @@
     /**
      * Returns all the {@link ClassInfo}s known to this set.
      */
-    public Map<ClassDeclT,? extends ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> beans() {
+    public Map<C,? extends ClassInfoImpl<T,C,F,M>> beans() {
         return beansView;
     }
 
-    public Map<TypeT, ? extends BuiltinLeafInfo<TypeT,ClassDeclT>> builtins() {
+    public Map<T, ? extends BuiltinLeafInfo<T,C>> builtins() {
         return builtins;
     }
 
-    public Map<ClassDeclT, ? extends EnumLeafInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> enums() {
+    public Map<C, ? extends EnumLeafInfoImpl<T,C,F,M>> enums() {
         return enums;
     }
 
-    public Map<? extends TypeT, ? extends ArrayInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> arrays() {
+    public Map<? extends T, ? extends ArrayInfoImpl<T,C,F,M>> arrays() {
         return arrays;
     }
 
@@ -247,8 +245,8 @@
      *      null if the specified type is not bound by JAXB or otherwise
      *      unknown to this set.
      */
-    public NonElement<TypeT,ClassDeclT> getClassInfo( ClassDeclT type ) {
-        LeafInfo<TypeT,ClassDeclT> l = builtins.get(nav.use(type));
+    public NonElement<T,C> getClassInfo( C type ) {
+        LeafInfo<T,C> l = builtins.get(nav.use(type));
         if(l!=null)     return l;
 
         l = enums.get(type);
@@ -260,11 +258,11 @@
         return beans.get(type);
     }
 
-    public ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> getElementInfo( ClassDeclT scope, QName name ) {
+    public ElementInfoImpl<T,C,F,M> getElementInfo( C scope, QName name ) {
         while(scope!=null) {
-            Map<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> m = elementMappings.get(scope);
+            Map<QName,ElementInfoImpl<T,C,F,M>> m = elementMappings.get(scope);
             if(m!=null) {
-                ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> r = m.get(name);
+                ElementInfoImpl<T,C,F,M> r = m.get(name);
                 if(r!=null)     return r;
             }
             scope = nav.getSuperClass(scope);
@@ -276,16 +274,16 @@
      * @param builder
      *      used for reporting errors.
      */
-    public final void add( ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ei, ModelBuilder<TypeT,ClassDeclT,FieldT,MethodT> builder ) {
-        ClassDeclT scope = null;
+    public final void add( ElementInfoImpl<T,C,F,M> ei, ModelBuilder<T,C,F,M> builder ) {
+        C scope = null;
         if(ei.getScope()!=null)
             scope = ei.getScope().getClazz();
 
-        Map<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> m = elementMappings.get(scope);
+        Map<QName,ElementInfoImpl<T,C,F,M>> m = elementMappings.get(scope);
         if(m==null)
-            elementMappings.put(scope,m=new LinkedHashMap<QName,ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>>());
+            elementMappings.put(scope,m=new LinkedHashMap<QName,ElementInfoImpl<T,C,F,M>>());
 
-        ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> existing = m.put(ei.getElementName(),ei);
+        ElementInfoImpl<T,C,F,M> existing = m.put(ei.getElementName(),ei);
 
         if(existing!=null) {
             QName en = ei.getElementName();
@@ -296,11 +294,11 @@
         }
     }
 
-    public Map<QName,? extends ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> getElementMappings( ClassDeclT scope ) {
+    public Map<QName,? extends ElementInfoImpl<T,C,F,M>> getElementMappings( C scope ) {
         return elementMappings.get(scope);
     }
 
-    public Iterable<? extends ElementInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>> getAllElements() {
+    public Iterable<? extends ElementInfoImpl<T,C,F,M>> getAllElements() {
         return allElements;
     }
 
@@ -308,7 +306,7 @@
         if(xmlNsCache==null) {
             xmlNsCache = new HashMap<String,Map<String,String>>();
 
-            for (ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> ci : beans().values()) {
+            for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
                 XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
                 if(xs==null)
                     continue;
@@ -329,8 +327,24 @@
         else            return Collections.emptyMap();
     }
 
+    public Map<String,String> getSchemaLocations() {
+        Map<String, String> r = new HashMap<String,String>();
+        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
+            XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
+            if(xs==null)
+                continue;
+
+            String loc = xs.location();
+            if(loc.equals(XmlSchema.NO_LOCATION))
+                continue;   // unspecified
+
+            r.put(xs.namespace(),loc);
+        }
+        return r;
+    }
+
     public final XmlNsForm getElementFormDefault(String nsUri) {
-        for (ClassInfoImpl<TypeT, ClassDeclT, FieldT, MethodT> ci : beans().values()) {
+        for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
             XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
             if(xs==null)
                 continue;
@@ -346,7 +360,7 @@
     }
 
     public final XmlNsForm getAttributeFormDefault(String nsUri) {
-        for (ClassInfoImpl<TypeT,ClassDeclT,FieldT,MethodT> ci : beans().values()) {
+        for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
             XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
             if(xs==null)
                 continue;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java
index 7c63cfc..4f4d464 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java
index 03f7f34..d205e72 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import javax.activation.MimeType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java
index aac00b1..3847867 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.impl;
 
 import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
index 1644fb0..8d3b067 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 Implementation of the com.sun.xml.internal.bind.j2s.model package.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java
index 2cc55cb..47efff3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.lang.reflect.GenericArrayType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java
index 38c89be..596a031 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.util.Collection;
@@ -368,9 +367,9 @@
 
     /**
      * Returns true if the given method is overriding another one
-     * defined in the base class.
+     * defined in the base class 'base' or its ancestors.
      */
-    boolean isOverriding(M method);
+    boolean isOverriding(M method, C base);
 
     /**
      * Returns true if 'clazz' is an interface.
@@ -381,4 +380,12 @@
      * Returns true if the field is transient.
      */
     boolean isTransient(F f);
+
+    /**
+     * Returns true if the given class is an inner class.
+     *
+     * This is only used to improve the error diagnostics, so
+     * it's OK to fail to detect some inner classes as such.
+     */
+    boolean isInnerClass(C clazz);
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java
index 9af56d9..8b71c4a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.lang.reflect.MalformedParameterizedTypeException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java
index e826a09..6f59f82 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.lang.reflect.Array;
@@ -53,7 +52,10 @@
     ReflectionNavigator() {}
 
     public Class getSuperClass(Class clazz) {
-        return clazz.getSuperclass();
+        if(clazz==Object.class) return null;
+        Class sc = clazz.getSuperclass();
+        if(sc==null)    sc=Object.class;        // error recovery
+        return sc;
     }
 
     private static final TypeVisitor<Type,Class> baseClassFinder = new TypeVisitor<Type,Class>() {
@@ -509,7 +511,7 @@
         return method.isBridge();
     }
 
-    public boolean isOverriding(Method method) {
+    public boolean isOverriding(Method method, Class base) {
         // this isn't actually correct,
         // as the JLS considers
         // class Derived extends Base<Integer> {
@@ -520,19 +522,18 @@
         // }
         // to be overrided. Handling this correctly needs a careful implementation
 
-        Class<?> s = method.getDeclaringClass().getSuperclass();
         String name = method.getName();
         Class[] params = method.getParameterTypes();
 
-        while(s!=null) {
+        while(base!=null) {
             try {
-                if(s.getDeclaredMethod(name,params)!=null)
+                if(base.getDeclaredMethod(name,params)!=null)
                     return true;
             } catch (NoSuchMethodException e) {
-                ; // recursively go into the base class
+                // recursively go into the base class
             }
 
-            s = s.getSuperclass();
+            base = base.getSuperclass();
         }
 
         return false;
@@ -546,6 +547,10 @@
         return Modifier.isTransient(f.getModifiers());
     }
 
+    public boolean isInnerClass(Class clazz) {
+        return clazz.getEnclosingClass()!=null;
+    }
+
 
     /**
      * JDK 5.0 has a bug of createing {@link GenericArrayType} where it shouldn't.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java
index 528f7c9..b0205e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.lang.reflect.GenericArrayType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java
index 3d3fe4c..8e001d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.nav;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
index e1ff6df..d77cf2c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and APT).
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java
index f1a5648..62994a1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java
index 8b8de96..641b27c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java
index 204d763..8438e9c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java
index 44d7b2a..7309343 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
@@ -33,7 +32,6 @@
 import javax.xml.namespace.QName;
 
 import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
-import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
 import com.sun.xml.internal.bind.annotation.XmlLocation;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java
index ecb204c..183fd78 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java
index 0ae24cf..cf114d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java
index c018c35..33eb07a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java
index fc1cfd1..7e78aa0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java
index 91cbcce..ad351f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java
index eeb1666..7a94c5c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java
index bffafd1..ec5d58c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
 
 import com.sun.xml.internal.bind.v2.model.core.NonElement;
 import com.sun.xml.internal.bind.v2.runtime.Transducer;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 
 /**
  * @author Kohsuke Kawaguchi
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java
index 94ce8ed..6f20325 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java
index cac777a..87610b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java
index f2dcbce..db24c7f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java
index ab88d9f..15fc651 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java
index dc59cd3..0724b71 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java
index 2f1aecb..3f7e579 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java
index bc6e310..974854c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.model.runtime;
 
 import java.lang.reflect.Type;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java
index fe560ca..45cfb38 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * The specialization of {@link com.sun.xml.internal.bind.v2.model.core} for the runtime.
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java
index 6913902..e62f76e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * <h1>The JAXB 2.0 runtime</h1>.
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java
index 6cc85b7..3777a56 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
@@ -137,11 +136,11 @@
         for( int i=0; i<len; i++ ) {
             Attr a = (Attr)al.item(i);
             if( "xmlns".equals(a.getPrefix()) ) {
-                context.declareNamespace( a.getValue(), a.getLocalName(), true );
+                context.force(a.getValue(), a.getLocalName());
                 continue;
             }
             if( "xmlns".equals(a.getName()) ) {
-                context.declareNamespace( a.getValue(), "", false );
+                context.force(a.getValue(), "");
                 continue;
             }
             String nsUri = a.getNamespaceURI();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java
index eb30d24..2c3b404 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java
index 5f60346..7b99219 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
-import java.util.HashMap;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.Map;
 import java.util.Set;
-import java.util.HashSet;
 
 /**
  * Bi-directional map between elements, inner peers,
@@ -62,8 +61,8 @@
         }
     }
 
-    private final Map<XmlNode,Entry<XmlNode>> byElement = new HashMap<XmlNode,Entry<XmlNode>>();
-    private final Map<Object,Entry<XmlNode>> byPeer = new HashMap<Object,Entry<XmlNode>>();
+    private final Map<XmlNode,Entry<XmlNode>> byElement = new IdentityHashMap<XmlNode,Entry<XmlNode>>();
+    private final Map<Object,Entry<XmlNode>> byPeer = new IdentityHashMap<Object,Entry<XmlNode>>();
     private final Set<XmlNode> usedNodes = new HashSet<XmlNode>();
 
     /** Records the new element&lt;->inner peer association. */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java
index f1eb450..bc103aa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import javax.xml.bind.Binder;
@@ -123,6 +122,7 @@
     }
 
     public void setSchema(Schema schema) {
+        getMarshaller().setSchema(schema);
         getUnmarshaller().setSchema(schema);
     }
 
@@ -157,6 +157,8 @@
     }
 
     public Object getJAXBNode(XmlNode xmlNode) {
+        if(xmlNode==null)
+            throw new IllegalArgumentException();
         AssociationMap.Entry e = assoc.byElement(xmlNode);
         if(e==null)     return null;
         if(e.outer()!=null)     return e.outer();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java
index 4c338d4..380d2ba 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java
index d1b10d0..c95ca8c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import javax.xml.bind.JAXBException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java
index 5cb5d76..3688773 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
@@ -76,7 +75,7 @@
 
     public void marshal(Marshaller _m, T t, XMLStreamWriter output) throws JAXBException {
         MarshallerImpl m = (MarshallerImpl)_m;
-        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output),new StAXPostInitAction(output,m.serializer));
+        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output,context),new StAXPostInitAction(output,m.serializer));
     }
 
     public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java
index c64bf83..d9ae488 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java
index 283fb2e..3fc2806 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java
index e640f63..bd71257 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
@@ -46,7 +45,7 @@
 final class ContentHandlerAdaptor extends DefaultHandler {
 
     /** Stores newly declared prefix-URI mapping. */
-    private final FinalArrayList prefixMap = new FinalArrayList();
+    private final FinalArrayList<String> prefixMap = new FinalArrayList<String>();
 
     /** Events will be sent to this object. */
     private final XMLSerializer serializer;
@@ -67,6 +66,15 @@
         prefixMap.add(uri);
     }
 
+    private boolean containsPrefixMapping(String prefix, String uri) {
+        for( int i=0; i<prefixMap.size(); i+=2 ) {
+            if(prefixMap.get(i).equals(prefix)
+            && prefixMap.get(i+1).equals(uri))
+                return true;
+        }
+        return false;
+    }
+
     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
         throws SAXException {
         try {
@@ -74,8 +82,24 @@
 
             int len = atts.getLength();
 
-            serializer.startElement(namespaceURI,localName,getPrefix(qName),null);
+            String p = getPrefix(qName);
+
+            // is this prefix going to be declared on this element?
+            if(containsPrefixMapping(p,namespaceURI))
+                serializer.startElementForce(namespaceURI,localName,p,null);
+            else
+                serializer.startElement(namespaceURI,localName, p,null);
+
             // declare namespace events
+            for( int i=0; i<prefixMap.size(); i+=2 ) {
+                // forcibly set this binding, instead of using declareNsUri.
+                // this guarantees that namespaces used in DOM will show up
+                // as-is in the marshalled output (instead of reassigned to something else,
+                // which may happen if you'd use declareNsUri.)
+                serializer.getNamespaceContext().force(
+                    prefixMap.get(i+1), prefixMap.get(i) );
+            }
+            // make sure namespaces needed by attributes are bound
             for( int i=0; i<len; i++ ) {
                 String qname = atts.getQName(i);
                 if(qname.startsWith("xmlns"))
@@ -85,13 +109,6 @@
                 serializer.getNamespaceContext().declareNamespace(
                     atts.getURI(i), prefix, true );
             }
-            for( int i=0; i<prefixMap.size(); i+=2 ) {
-                String prefix = (String)prefixMap.get(i);
-                serializer.getNamespaceContext().declareNamespace(
-                    (String)prefixMap.get(i+1),
-                    prefix,
-                    prefix.length()!=0 );
-            }
 
             serializer.endNamespaceDecls(null);
             // fire attribute events
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java
index ebdc76b..a381562 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.util.HashMap;
@@ -126,7 +125,8 @@
      * Sohuld be called at the end of the episode to avoid memory leak.
      */
     protected final void resetThreadAffinity() {
-        guyWhoSetTheTableToNull = new Exception(); // remember that we set it to null
+        if(debugTableNPE)
+            guyWhoSetTheTableToNull = new Exception(); // remember that we set it to null
         table = null;
     }
 
@@ -204,5 +204,12 @@
         }
     }
 
+    public static boolean debugTableNPE;
 
+    static {
+        try {
+            debugTableNPE = Boolean.getBoolean(Coordinator.class.getName()+".debugTableNPE");
+        } catch (SecurityException t) {
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java
index 5602da5..e29725f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.util.HashSet;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java
index 04967bd..6621761 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
@@ -66,6 +67,12 @@
     public final Class expectedType;
     private final Class scope;
 
+    /**
+     * If non-null, use this to create an instance.
+     * It takes one value.
+     */
+    private final Constructor<? extends JAXBElement> constructor;
+
     ElementBeanInfoImpl(JAXBContextImpl grammar, RuntimeElementInfo rei) {
         super(grammar,rei,(Class<JAXBElement>)rei.getType(),true,false,true);
 
@@ -74,6 +81,19 @@
         tagName = rei.getElementName();
         expectedType = Navigator.REFLECTION.erasure(rei.getContentInMemoryType());
         scope = rei.getScope()==null ? JAXBElement.GlobalScope.class : rei.getScope().getClazz();
+
+        Class type = Navigator.REFLECTION.erasure(rei.getType());
+        if(type==JAXBElement.class)
+            constructor = null;
+        else {
+            try {
+                constructor = type.getConstructor(expectedType);
+            } catch (NoSuchMethodException e) {
+                NoSuchMethodError x = new NoSuchMethodError("Failed to find the constructor for " + type + " with " + expectedType);
+                x.initCause(e);
+                throw x;
+            }
+        }
     }
 
     /**
@@ -89,6 +109,7 @@
         tagName = null;
         expectedType = null;
         scope = null;
+        constructor = null;
 
         this.property = new Property<JAXBElement>() {
             public void reset(JAXBElement o) {
@@ -238,12 +259,15 @@
         return loader;
     }
 
-    public final JAXBElement createInstance(UnmarshallingContext context) {
+    public final JAXBElement createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException {
         return createInstanceFromValue(null);
     }
 
-    public final JAXBElement createInstanceFromValue(Object o) {
-        return new JAXBElement(tagName,expectedType,scope,o);
+    public final JAXBElement createInstanceFromValue(Object o) throws IllegalAccessException, InvocationTargetException, InstantiationException {
+        if(constructor==null)
+            return new JAXBElement(tagName,expectedType,scope,o);
+        else
+            return constructor.newInstance(o);
     }
 
     public boolean reset(JAXBElement e, UnmarshallingContext context) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java
index a85fbaf..fec5064 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java
index 34030d3..ef78781 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.lang.annotation.Annotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java
index 0f63671..e1a07fe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java
index 36e7a0e..aab952d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java
index 415ea5e..930b502 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
index 35b340b..0fd9cb0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
@@ -32,6 +31,7 @@
 import java.lang.reflect.Type;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -43,6 +43,7 @@
 
 import javax.xml.bind.Binder;
 import javax.xml.bind.DatatypeConverter;
+import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.JAXBIntrospector;
@@ -67,18 +68,21 @@
 import javax.xml.transform.sax.TransformerHandler;
 
 import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 import com.sun.istack.internal.Pool;
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
 import com.sun.xml.internal.bind.api.AccessorException;
 import com.sun.xml.internal.bind.api.Bridge;
 import com.sun.xml.internal.bind.api.BridgeContext;
 import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.ErrorListener;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
 import com.sun.xml.internal.bind.api.RawAccessor;
 import com.sun.xml.internal.bind.api.TypeReference;
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
 import com.sun.xml.internal.bind.util.Which;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
 import com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader;
 import com.sun.xml.internal.bind.v2.model.core.Adapter;
 import com.sun.xml.internal.bind.v2.model.core.NonElement;
@@ -106,16 +110,19 @@
 import com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator;
 import com.sun.xml.internal.bind.v2.util.EditDistance;
 import com.sun.xml.internal.bind.v2.util.QNameMap;
+import com.sun.xml.internal.txw2.output.ResultFactory;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * This class provides the implementation of JAXBContext.
  *
+ * @version $Revision$
  */
 public final class JAXBContextImpl extends JAXBRIContext {
 
@@ -198,24 +205,70 @@
      */
     protected final boolean c14nSupport;
 
+    /**
+     * Flag that user has provided a custom AccessorFactory for JAXB to use
+     */
+    public final boolean xmlAccessorFactorySupport;
+
+    /**
+     * @see JAXBRIContext#TREAT_EVERYTHING_NILLABLE
+     */
+    public final boolean allNillable;
+
+
     private WeakReference<RuntimeTypeInfoSet> typeInfoSetCache;
 
+    private @NotNull RuntimeAnnotationReader annotaitonReader;
+
+    private /*almost final*/ boolean hasSwaRef;
+    private final @NotNull Map<Class,Class> subclassReplacements;
+
+    /**
+     * If true, we aim for faster {@link JAXBContext} instanciation performance,
+     * instead of going after efficient sustained unmarshalling/marshalling performance.
+     *
+     * @since 2.0.4
+     */
+    public final boolean fastBoot;
+
     /**
      *
      * @param typeRefs
      *      used to build {@link Bridge}s. Can be empty.
      * @param c14nSupport
      *      {@link #c14nSupport}.
+     * @param xmlAccessorFactorySupport
+     *      Use custom com.sun.xml.internal.bind.v2.runtime.reflect.Accessor implementation.
      */
-    public JAXBContextImpl(Class[] classes, Collection<TypeReference> typeRefs, String defaultNsUri, boolean c14nSupport) throws JAXBException {
-
+    public JAXBContextImpl(Class[] classes, Collection<TypeReference> typeRefs,
+        Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport,
+        @Nullable RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable) throws JAXBException {
         // initialize datatype converter with ours
         DatatypeConverter.setDatatypeConverter(DatatypeConverterImpl.theInstance);
 
         if(defaultNsUri==null)      defaultNsUri="";    // fool-proof
 
+        if(ar==null)
+            ar = new RuntimeInlineAnnotationReader();
+
+        if(subclassReplacements==null)  subclassReplacements=Collections.emptyMap();
+        if(typeRefs==null)              typeRefs=Collections.emptyList();
+
+        this.annotaitonReader = ar;
+        this.subclassReplacements = subclassReplacements;
+
+        boolean fastBoot;
+        try {
+            fastBoot = Boolean.getBoolean(JAXBContextImpl.class.getName()+".fastBoot");
+        } catch (SecurityException e) {
+            fastBoot = false;
+        }
+        this.fastBoot = fastBoot;
+
         this.defaultNsUri = defaultNsUri;
         this.c14nSupport = c14nSupport;
+        this.xmlAccessorFactorySupport = xmlAccessorFactorySupport;
+        this.allNillable = allNillable;
         this.classes = new Class[classes.length];
         System.arraycopy(classes,0,this.classes,0,classes.length);
 
@@ -304,6 +357,7 @@
             }
             if(tr.get(XmlAttachmentRef.class)!=null) {
                 a = new Adapter<Type,Class>(SwaRefAdapter.class,nav);
+                hasSwaRef = true;
             }
 
             if(a!=null) {
@@ -336,6 +390,13 @@
     }
 
     /**
+     * True if this JAXBContext has {@link XmlAttachmentRef}.
+     */
+    public boolean hasSwaRef() {
+        return hasSwaRef;
+    }
+
+    /**
      * Creates a {@link RuntimeTypeInfoSet}.
      */
     private RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException {
@@ -347,9 +408,8 @@
                 return r;
         }
 
-        final RuntimeModelBuilder builder = new RuntimeModelBuilder(
-                new RuntimeInlineAnnotationReader(),
-                defaultNsUri);
+        final RuntimeModelBuilder builder = new RuntimeModelBuilder(this,annotaitonReader,subclassReplacements,defaultNsUri);
+
         IllegalAnnotationsException.Builder errorHandler = new IllegalAnnotationsException.Builder();
         builder.setErrorHandler(errorHandler);
 
@@ -361,6 +421,7 @@
             builder.getTypeInfo(new Ref<Type,Class>(c));
         }
 
+        this.hasSwaRef |= builder.hasSwaRef;
         RuntimeTypeInfoSet r = builder.link();
 
         errorHandler.check();
@@ -478,8 +539,11 @@
     public final JaxBeanInfo getBeanInfo(Object o,boolean fatal) throws JAXBException {
         JaxBeanInfo bi = getBeanInfo(o);
         if(bi!=null)    return bi;
-        if(fatal)
-            throw new JAXBException(o.getClass().getName()+" nor any of its super class is known to this context");
+        if(fatal) {
+            if(o instanceof Document)
+                throw new JAXBException(Messages.ELEMENT_NEEDED_BUT_FOUND_DOCUMENT.format(o.getClass()));
+            throw new JAXBException(Messages.UNKNOWN_CLASS.format(o.getClass()));
+        }
         return null;
     }
 
@@ -520,10 +584,9 @@
      * @return
      *      null if the given name pair is not recognized.
      */
-    public final Loader selectRootLoader( UnmarshallingContext.State state, TagName ea ) {
-        JaxBeanInfo beanInfo = rootMap.get(ea.uri,ea.local);
+    public final Loader selectRootLoader( UnmarshallingContext.State state, TagName tag ) {
+        JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local);
         if(beanInfo==null)
-            // TODO: this is probably the right place to handle @xsi:type
             return null;
 
         return beanInfo.getLoader(this,true);
@@ -692,17 +755,46 @@
         XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class);
         XmlList xl = tr.get(XmlList.class);
 
-        Ref<Type,Class> ref = new Ref<Type,Class>(
-            new RuntimeInlineAnnotationReader(), tis.getNavigator(), tr.type, xjta, xl );
+        Ref<Type,Class> ref = new Ref<Type,Class>(annotaitonReader, tis.getNavigator(), tr.type, xjta, xl );
 
         return tis.getTypeInfo(ref);
     }
 
-    public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
-        if(outputResolver==null) {
-            throw new IOException(Messages.NULL_OUTPUT_RESOLVER.format());
-        }
+    @Override
+    public void generateEpisode(Result output) {
+        if(output==null)
+            throw new IllegalArgumentException();
+        createSchemaGenerator().writeEpisodeFile(ResultFactory.createSerializer(output));
+    }
 
+    @Override
+    public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
+        if(outputResolver==null)
+            throw new IOException(Messages.NULL_OUTPUT_RESOLVER.format());
+
+        final SAXParseException[] e = new SAXParseException[1];
+
+        createSchemaGenerator().write(outputResolver, new ErrorListener() {
+            public void error(SAXParseException exception) {
+                e[0] = exception;
+            }
+
+            public void fatalError(SAXParseException exception) {
+                e[0] = exception;
+            }
+
+            public void warning(SAXParseException exception) {}
+            public void info(SAXParseException exception) {}
+        });
+
+        if(e[0]!=null) {
+            IOException x = new IOException(Messages.FAILED_TO_GENERATE_SCHEMA.format());
+            x.initCause(e[0]);
+            throw x;
+        }
+    }
+
+    private XmlSchemaGenerator<Type,Class,Field,Method> createSchemaGenerator() {
         RuntimeTypeInfoSet tis;
         try {
             tis = getTypeInfoSet();
@@ -711,8 +803,8 @@
             throw new AssertionError(e);
         }
 
-        XmlSchemaGenerator<Type,Class, Field, Method> xsdgen =
-                new XmlSchemaGenerator<Type,Class, Field, Method>(tis.getNavigator(),tis);
+        XmlSchemaGenerator<Type,Class,Field,Method> xsdgen =
+                new XmlSchemaGenerator<Type,Class,Field,Method>(tis.getNavigator(),tis);
 
         // JAX-RPC uses Bridge objects that collide with
         // @XmlRootElement.
@@ -732,13 +824,15 @@
 
             if(tr.type==void.class || tr.type==Void.class) {
                 xsdgen.add(tr.tagName,false,null);
+            } else
+            if(tr.type==CompositeStructure.class) {
+                // this is a special class we introduced for JAX-WS that we *don't* want in the schema
             } else {
                 NonElement<Type,Class> typeInfo = getXmlType(tis,tr);
                 xsdgen.add(tr.tagName, !Navigator.REFLECTION.isPrimitive(tr.type),typeInfo);
             }
         }
-
-        xsdgen.write(outputResolver);
+        return xsdgen;
     }
 
     public QName getTypeName(TypeReference tr) {
@@ -874,6 +968,18 @@
         return null;
     }
 
+    /**
+     * Creates a {@link JAXBContextImpl} that includes the specified additional classes.
+     */
+    public JAXBContextImpl createAugmented(Class<?> clazz) throws JAXBException {
+        Class[] newList = new Class[classes.length+1];
+        System.arraycopy(classes,0,newList,0,classes.length);
+        newList[classes.length] = clazz;
+
+        return new JAXBContextImpl(newList,bridges.keySet(),subclassReplacements,
+        defaultNsUri,c14nSupport,annotaitonReader, xmlAccessorFactorySupport, allNillable);
+    }
+
     private static final Comparator<QName> QNAME_COMPARATOR = new Comparator<QName>() {
         public int compare(QName lhs, QName rhs) {
             int r = lhs.getLocalPart().compareTo(rhs.getLocalPart());
@@ -881,5 +987,5 @@
 
             return lhs.getNamespaceURI().compareTo(rhs.getNamespaceURI());
         }
-    }; ;
+    };
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java
index 02fdd8c..5b89cba 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
@@ -415,47 +414,40 @@
      */
     protected final void setLifecycleFlags() {
         try {
-            Method m;
-
-            // beforeUnmarshal
-            try {
-                m = jaxbType.getDeclaredMethod("beforeUnmarshal", unmarshalEventParams);
-                cacheLifecycleMethod(m, FLAG_HAS_BEFORE_UNMARSHAL_METHOD);
-            } catch (NoSuchMethodException e) {
-                // no-op, look for the next method
-            }
-
-            // afterUnmarshal
-            try {
-                m = jaxbType.getDeclaredMethod("afterUnmarshal", unmarshalEventParams);
-                cacheLifecycleMethod(m, FLAG_HAS_AFTER_UNMARSHAL_METHOD);
-            } catch (NoSuchMethodException e) {
-                // no-op, look for the next method
-            }
-
-            // beforeMarshal
-            try {
-                m = jaxbType.getDeclaredMethod("beforeMarshal", marshalEventParams);
-                cacheLifecycleMethod(m, FLAG_HAS_BEFORE_MARSHAL_METHOD);
-            } catch (NoSuchMethodException e) {
-                // no-op, look for the next method
-            }
-
-            // afterMarshal
-            try {
-                m = jaxbType.getDeclaredMethod("afterMarshal", marshalEventParams);
-                cacheLifecycleMethod(m, FLAG_HAS_AFTER_MARSHAL_METHOD);
-            } catch (NoSuchMethodException e) {
-                // no-op
+            for( Method m : jaxbType.getDeclaredMethods() ) {
+                String name = m.getName();
+                if(name.equals("beforeUnmarshal")) {
+                    if(match(m,unmarshalEventParams)) {
+                        cacheLifecycleMethod(m, FLAG_HAS_BEFORE_UNMARSHAL_METHOD);
+                    }
+                } else
+                if(name.equals("afterUnmarshal")) {
+                    if(match(m,unmarshalEventParams)) {
+                        cacheLifecycleMethod(m, FLAG_HAS_AFTER_UNMARSHAL_METHOD);
+                    }
+                } else
+                if(name.equals("beforeMarshal")) {
+                    if(match(m,marshalEventParams)) {
+                        cacheLifecycleMethod(m, FLAG_HAS_BEFORE_MARSHAL_METHOD);
+                    }
+                } else
+                if(name.equals("afterMarshal")) {
+                    if(match(m,marshalEventParams)) {
+                        cacheLifecycleMethod(m, FLAG_HAS_AFTER_MARSHAL_METHOD);
+                    }
+                }
             }
         } catch(SecurityException e) {
             // this happens when we don't have enough permission.
             logger.log( Level.WARNING, Messages.UNABLE_TO_DISCOVER_EVENTHANDLER.format(
-                jaxbType.getName(),
-                e ));
+                jaxbType.getName(), e ));
         }
     }
 
+    private boolean match(Method m, Class[] params) {
+        return Arrays.equals(m.getParameterTypes(),params);
+    }
+
     /**
      * Cache a reference to the specified lifecycle method for the jaxbType
      * associated with this beanInfo.
@@ -477,16 +469,16 @@
 
         switch (lifecycleFlag) {
         case FLAG_HAS_BEFORE_UNMARSHAL_METHOD:
-            lcm.setBeforeUnmarshal(m);
+            lcm.beforeUnmarshal = m;
             break;
         case FLAG_HAS_AFTER_UNMARSHAL_METHOD:
-            lcm.setAfterUnmarshal(m);
+            lcm.afterUnmarshal = m;
             break;
         case FLAG_HAS_BEFORE_MARSHAL_METHOD:
-            lcm.setBeforeMarshal(m);
+            lcm.beforeMarshal = m;
             break;
         case FLAG_HAS_AFTER_MARSHAL_METHOD:
-            lcm.setAfterMarshal(m);
+            lcm.afterMarshal = m;
             break;
         }
     }
@@ -504,7 +496,7 @@
      * Invokes the beforeUnmarshal method if applicable.
      */
     public final void invokeBeforeUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent) throws SAXException {
-        Method m = getLifecycleMethods().getBeforeUnmarshal();
+        Method m = getLifecycleMethods().beforeUnmarshal;
         invokeUnmarshallCallback(m, child, unm, parent);
     }
 
@@ -512,7 +504,7 @@
      * Invokes the afterUnmarshal method if applicable.
      */
     public final void invokeAfterUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent) throws SAXException {
-        Method m = getLifecycleMethods().getAfterUnmarshal();
+        Method m = getLifecycleMethods().afterUnmarshal;
         invokeUnmarshallCallback(m, child, unm, parent);
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java
index 32f1929..2f434a4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java
index 4c60cd9..23008cc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.lang.reflect.Method;
 
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
 
 /**
  * This class is a simple container for caching lifecycle methods that are
@@ -39,41 +38,9 @@
  * @see Loader#fireAfterUnmarshal(JaxBeanInfo, Object, UnmarshallingContext.State)
  * @see XMLSerializer#fireMarshalEvent(Object, Method)
  */
-public final class LifecycleMethods {
-    private Method beforeUnmarshal;
-    private Method afterUnmarshal;
-    private Method beforeMarshal;
-    private Method afterMarshal;
-
-    public Method getAfterMarshal() {
-        return afterMarshal;
-    }
-
-    public void setAfterMarshal(Method afterMarshal) {
-        this.afterMarshal = afterMarshal;
-    }
-
-    public Method getAfterUnmarshal() {
-        return afterUnmarshal;
-    }
-
-    public void setAfterUnmarshal(Method afterUnmarshal) {
-        this.afterUnmarshal = afterUnmarshal;
-    }
-
-    public Method getBeforeMarshal() {
-        return beforeMarshal;
-    }
-
-    public void setBeforeMarshal(Method beforeMarshal) {
-        this.beforeMarshal = beforeMarshal;
-    }
-
-    public Method getBeforeUnmarshal() {
-        return beforeUnmarshal;
-    }
-
-    public void setBeforeUnmarshal(Method beforeUnmarshal) {
-        this.beforeUnmarshal = beforeUnmarshal;
-    }
+final class LifecycleMethods {
+    Method beforeUnmarshal;
+    Method afterUnmarshal;
+    Method beforeMarshal;
+    Method afterMarshal;
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java
index b0acf59..4670926 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java
index 1f5c5fd..820c7f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.BufferedWriter;
@@ -151,7 +150,7 @@
     }
 
     public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
-        write(obj, XMLStreamWriterOutput.create(writer), new StAXPostInitAction(writer,serializer));
+        write(obj, XMLStreamWriterOutput.create(writer,context), new StAXPostInitAction(writer,serializer));
     }
 
     public void marshal(Object obj, XMLEventWriter writer) throws JAXBException {
@@ -195,7 +194,16 @@
                         fileURL = fileURL.substring(8);
                     else
                         fileURL = fileURL.substring(7);
-                } // otherwise assume that it's a file name
+                }
+                if (fileURL.startsWith("file:/")) {
+                    // some people use broken URLs like "file:/c:/abc/def/ghi.txt"
+                    // so let's make it work with that
+                    if (fileURL.substring(6).indexOf(":") > 0)
+                        fileURL = fileURL.substring(6);
+                    else
+                        fileURL = fileURL.substring(5);
+                }
+                // otherwise assume that it's a file name
 
                 try {
                     FileOutputStream fos = new FileOutputStream(fileURL);
@@ -247,7 +255,7 @@
                         serializer.childAsXsiType(obj,"root",bi);
                 }
                 serializer.endElement();
-                postwrite(out);
+                postwrite();
             } catch( SAXException e ) {
                 throw new MarshalException(e);
             } catch (IOException e) {
@@ -296,7 +304,7 @@
             try {
                 prewrite(out,isFragment(),postInitAction);
                 serializer.childAsRoot(obj);
-                postwrite(out);
+                postwrite();
             } catch( SAXException e ) {
                 throw new MarshalException(e);
             } catch (IOException e) {
@@ -348,10 +356,9 @@
         serializer.setPrefixMapper(prefixMapper);
     }
 
-    private void postwrite(XmlOutput out) throws IOException, SAXException, XMLStreamException {
+    private void postwrite() throws IOException, SAXException, XMLStreamException {
         serializer.endDocument();
         serializer.reconcileID();   // extra check
-        out.flush();
     }
 
 
@@ -444,7 +451,7 @@
     public Object getProperty(String name) throws PropertyException {
         if( INDENT_STRING.equals(name) )
             return indent;
-        if( ENCODING_HANDLER.equals(name) )
+        if( ENCODING_HANDLER.equals(name) || ENCODING_HANDLER2.equals(name) )
             return escapeHandler;
         if( PREFIX_MAPPER.equals(name) )
             return prefixMapper;
@@ -454,6 +461,9 @@
             return header;
         if( C14N.equals(name) )
             return c14nSupport;
+        if ( OBJECT_IDENTITY_CYCLE_DETECTION.equals(name))
+                return serializer.getObjectIdentityCycleDetection();
+;
 
         return super.getProperty(name);
     }
@@ -464,7 +474,7 @@
             indent = (String)value;
             return;
         }
-        if( ENCODING_HANDLER.equals(name) ) {
+        if( ENCODING_HANDLER.equals(name) || ENCODING_HANDLER2.equals(name)) {
             if(!(value instanceof CharacterEscapeHandler))
                 throw new PropertyException(
                     Messages.MUST_BE_X.format(
@@ -501,6 +511,11 @@
             c14nSupport = (Boolean)value;
             return;
         }
+        if (OBJECT_IDENTITY_CYCLE_DETECTION.equals(name)) {
+                checkBoolean(name,value);
+            serializer.setObjectIdentityCycleDetection((Boolean)value);
+            return;
+        }
 
         super.setProperty(name, value);
     }
@@ -585,7 +600,9 @@
     protected static final String INDENT_STRING = "com.sun.xml.internal.bind.indentString";
     protected static final String PREFIX_MAPPER = "com.sun.xml.internal.bind.namespacePrefixMapper";
     protected static final String ENCODING_HANDLER = "com.sun.xml.internal.bind.characterEscapeHandler";
+    protected static final String ENCODING_HANDLER2 = "com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler";
     protected static final String XMLDECLARATION = "com.sun.xml.internal.bind.xmlDeclaration";
     protected static final String XML_HEADERS = "com.sun.xml.internal.bind.xmlHeaders";
     protected static final String C14N = JAXBRIContext.CANONICALIZATION_SUPPORT;
+    protected static final String OBJECT_IDENTITY_CYCLE_DETECTION = "com.sun.xml.internal.bind.objectIdentitityCycleDetection";
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java
index 0d74210..1f4be62 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.text.MessageFormat;
@@ -52,6 +51,9 @@
     SUBSTITUTED_BY_ANONYMOUS_TYPE, // 3 arg
     CYCLE_IN_MARSHALLER, // 1 arg
     UNABLE_TO_DISCOVER_EVENTHANDLER, // 1 arg
+    ELEMENT_NEEDED_BUT_FOUND_DOCUMENT, // 1 arg
+    UNKNOWN_CLASS, // 1 arg
+    FAILED_TO_GENERATE_SCHEMA, // 0 args
     ;
 
     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties
index d3c25d9..79d34b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 NOT_MARSHALLABLE = \
 	the object parameter to marshal() is not marshallable
 
@@ -58,4 +83,13 @@
 
 UNABLE_TO_DISCOVER_EVENTHANDLER = \
     Unable to list methods of "{0}". If there is any event callback handler on this class, it will be ignored.
+
+ELEMENT_NEEDED_BUT_FOUND_DOCUMENT = \
+    A DOM document "{0}" is found but an element is needed. Use Document.getDocumentElement() and set that object instead.
+
+UNKNOWN_CLASS = \
+    {0} nor any of its super class is known to this context.
+
+FAILED_TO_GENERATE_SCHEMA = \
+    Failed to generate schema.
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java
index 20b088e..8eee884 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.awt.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java
index 4db0810..c1650c3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java
index 82a4994..8682f7d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java
index e0fc006..a076711 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java
index 2e63730..7c14fb1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,8 @@
 
 import javax.xml.namespace.NamespaceContext;
 
+import com.sun.istack.internal.NotNull;
+
 /**
  * Maintains namespace&lt;->prefix bindings.
  *
@@ -74,4 +76,13 @@
      *      the default namespace, null is returned.
      */
     String declareNamespace( String namespaceUri, String preferedPrefix, boolean requirePrefix );
+
+    /**
+     * Forcibly make a namespace declaration in effect.
+     *
+     * If the (prefix,uri) binding is already in-scope, this method
+     * simply returns the assigned prefix index. Otherwise a new
+     * declaration will be put.
+     */
+    int force(@NotNull String uri, @NotNull String prefix);
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java
index 6921a9c..d6d77f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.util.Collections;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java
index 1b1db3b..2582b3a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java
index 023e0f9..58d2dd4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import javax.xml.namespace.NamespaceContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java
index 2e2d2ad..c87e4e2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java
index c47a7bb..1173ecd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java
index 8ed9574..83d16fd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java
index fb85c09..bfc6d5c3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.IntData;
 import com.sun.xml.internal.bind.v2.util.CollisionCheckStack;
+import com.sun.xml.internal.bind.CycleRecoverable;
 
 import org.xml.sax.SAXException;
 
@@ -254,6 +255,16 @@
         nse.setTagName(idx,localName,outerPeer);
     }
 
+    /**
+     * Variation of {@link #startElement(String, String, String, Object)} that forces
+     * a specific prefix. Needed to preserve the prefix when marshalling DOM.
+     */
+    public void startElementForce(String nsUri, String localName, String forcedPrefix, Object outerPeer) {
+        startElement();
+        int idx = nsContext.force(nsUri, forcedPrefix);
+        nse.setTagName(idx,localName,outerPeer);
+    }
+
     public void endNamespaceDecls(Object innerPeer) throws IOException, XMLStreamException {
         nsContext.collectionMode = false;
         nse.startElement(out,innerPeer);
@@ -472,25 +483,46 @@
         cycleDetectionStack.pop();
     }
 
-    private void pushObject(Object obj, String fieldName) throws SAXException {
-        if(cycleDetectionStack.push(obj)) {
-            // cycle detected
-            StringBuilder sb = new StringBuilder();
-            sb.append(obj);
-            int i=cycleDetectionStack.size()-1;
-            Object x;
-            do {
-                sb.append(" -> ");
-                x = cycleDetectionStack.get(--i);
-                sb.append(x);
-            } while(obj!=x);
+    /**
+     * Pushes the object to {@link #cycleDetectionStack} and also
+     * detect any cycles.
+     *
+     * When a cycle is found, this method tries to recover from it.
+     *
+     * @return
+     *      the object that should be marshalled instead of the given <tt>obj</tt>,
+     *      or null if the error is found and we need to avoid marshalling this object
+     *      to prevent infinite recursion. When this method returns null, the error
+     *      has already been reported.
+     */
+    private Object pushObject(Object obj, String fieldName) throws SAXException {
+        if(!cycleDetectionStack.push(obj))
+            return obj;
 
-            reportError(new ValidationEventImpl(
-                ValidationEvent.ERROR,
-                Messages.CYCLE_IN_MARSHALLER.format(sb),
-                getCurrentLocation(fieldName),
-                null));
+        // allow the object to nominate its replacement
+        if(obj instanceof CycleRecoverable) {
+            obj = ((CycleRecoverable)obj).onCycleDetected(new CycleRecoverable.Context(){
+                public Marshaller getMarshaller() {
+                    return marshaller;
+                }
+            });
+            if(obj!=null) {
+                // object nominated its replacement.
+                // we still need to make sure that the nominated.
+                // this may cause inifinite recursion on its own.
+                cycleDetectionStack.pop();
+                return pushObject(obj,fieldName);
+            } else
+                return null;
         }
+
+        // cycle detected and no one is catching the error.
+        reportError(new ValidationEventImpl(
+            ValidationEvent.ERROR,
+            Messages.CYCLE_IN_MARSHALLER.format(cycleDetectionStack.getCycleString()),
+            getCurrentLocation(fieldName),
+            null));
+        return null;
     }
 
     /**
@@ -512,6 +544,14 @@
         if(child==null) {
             handleMissingObjectError(fieldName);
         } else {
+            child = pushObject(child,fieldName);
+            if(child==null) {
+                // error recovery
+                endNamespaceDecls(null);
+                endAttributes();
+                cycleDetectionStack.pop();
+            }
+
             JaxBeanInfo beanInfo;
             try {
                 beanInfo = grammar.getBeanInfo(child,true);
@@ -520,11 +560,10 @@
                 // recover by ignore
                 endNamespaceDecls(null);
                 endAttributes();
+                cycleDetectionStack.pop();
                 return;
             }
 
-            pushObject(child,fieldName);
-
             final boolean lookForLifecycleMethods = beanInfo.lookForLifecycleMethods();
             if (lookForLifecycleMethods) {
                 fireBeforeMarshalEvents(beanInfo, child);
@@ -572,12 +611,17 @@
         if(child==null) {
             handleMissingObjectError(fieldName);
         } else {
+            child = pushObject(child,fieldName);
+            if(child==null) { // error recovery
+                endNamespaceDecls(null);
+                endAttributes();
+                return;
+            }
+
             boolean asExpected = child.getClass()==expected.jaxbType;
             JaxBeanInfo actual = expected;
             QName actualTypeName = null;
 
-            pushObject(child,fieldName);
-
             if((asExpected) && (actual.lookForLifecycleMethods())) {
                 fireBeforeMarshalEvents(actual, child);
             }
@@ -643,7 +687,7 @@
     private void fireAfterMarshalEvents(final JaxBeanInfo beanInfo, Object currentTarget) {
         // first invoke bean embedded listener
         if (beanInfo.hasAfterMarshalMethod()) {
-            Method m = beanInfo.getLifecycleMethods().getAfterMarshal();
+            Method m = beanInfo.getLifecycleMethods().afterMarshal;
             fireMarshalEvent(currentTarget, m);
         }
 
@@ -667,7 +711,7 @@
     private void fireBeforeMarshalEvents(final JaxBeanInfo beanInfo, Object currentTarget) {
         // first invoke bean embedded listener
         if (beanInfo.hasBeforeMarshalMethod()) {
-            Method m = beanInfo.getLifecycleMethods().getBeforeMarshal();
+            Method m = beanInfo.getLifecycleMethods().beforeMarshal;
             fireMarshalEvent(currentTarget, m);
         }
 
@@ -908,6 +952,13 @@
         return schemaType;
     }
 
+    public void setObjectIdentityCycleDetection(boolean val) {
+        cycleDetectionStack.setUseIdentity(val);
+    }
+    public boolean getObjectIdentityCycleDetection() {
+        return cycleDetectionStack.getUseIdentity();
+    }
+
     void reconcileID() throws SAXException {
         // find objects that were not a part of the object graph
         idReferencedObjects.removeAll(objectsWithId);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java
index d093aad..dc67cda 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java
index 13243a1..391b1cb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java
index ae97528..03274cb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java
index 0424016..6350afb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,46 +22,423 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
-import java.io.IOException;
-
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+import com.sun.xml.internal.bind.v2.runtime.Name;
+import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
 import javax.xml.stream.XMLStreamException;
 
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
+import com.sun.xml.internal.fastinfoset.EncodingConstants;
 import com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer;
-
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.WeakHashMap;
+import javax.xml.bind.JAXBContext;
+import com.sun.xml.internal.org.jvnet.fastinfoset.VocabularyApplicationData;
 import org.xml.sax.SAXException;
 
 /**
- * {@link XmlOutput} for {@link StAXDocumentSerializer}.
+ * {@link XmlOutput} for {@link LowLevelStAXDocumentSerializer}.
+ * <p>
+ * This class is responsible for managing the indexing of elements, attributes
+ * and local names that are known to JAXB by way of the JAXBContext (generated
+ * from JAXB beans or schema). The pre-encoded UTF-8 representations of known
+ * local names are also utilized.
+ * <p>
+ * The lookup of  elements, attributes and local names with respect to a context
+ * is very efficient. It relies on an incrementing base line so that look up is
+ * performed in O(1) time and only uses static memory. When the base line reaches
+ * a point where integer overflow will occur the arrays and base line are reset
+ * (such an event is rare and will have little impact on performance).
+ * <p>
+ * A weak map of JAXB contexts to optimized tables for attributes, elements and
+ * local names is utilized and stored on the LowLevel StAX serializer. Thus,
+ * optimized serializing can work other multiple serializing of JAXB beans using
+ * the same LowLevel StAX serializer instance. This approach works best when JAXB
+ * contexts are only created once per schema or JAXB beans (which is the recommended
+ * practice as the creation JAXB contexts are expensive, they are thread safe and
+ * can be reused).
  *
- * @author Paul Sandoz.
+ * @author Paul.Sandoz@Sun.Com
  */
 public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
     private final StAXDocumentSerializer fiout;
+    private final Encoded[] localNames;
+    private final TablesPerJAXBContext tables;
 
-    public FastInfosetStreamWriterOutput(StAXDocumentSerializer out) {
-        super(out);
-        this.fiout = out;
+    /**
+     * Holder for the optimzed element, attribute and
+     * local name tables.
+     */
+    final static class TablesPerJAXBContext {
+        final int[] elementIndexes;
+        final int[] attributeIndexes;
+        final int[] localNameIndexes;
+
+        /**
+         * The offset of the index
+         */
+        int indexOffset;
+
+        /**
+         * The the maximum known value of an index
+         */
+        int maxIndex;
+
+        /**
+         * True if the tables require clearing
+         */
+        boolean requiresClear;
+
+        /**
+         * Create a new set of tables for a JAXB context.
+         * <p>
+         * @param content the JAXB context.
+         * @param initialIndexOffset the initial index offset to calculate
+         *                           the maximum possible index
+         *
+         */
+        TablesPerJAXBContext(JAXBContextImpl context, int initialIndexOffset) {
+            elementIndexes = new int[context.getNumberOfElementNames()];
+            attributeIndexes = new int[context.getNumberOfAttributeNames()];
+            localNameIndexes = new int[context.getNumberOfLocalNames()];
+
+            indexOffset = 1;
+            maxIndex = initialIndexOffset + elementIndexes.length + attributeIndexes.length;
+        }
+
+        /**
+         * Require that tables are cleared.
+         */
+        public void requireClearTables() {
+            requiresClear = true;
+        }
+
+        /**
+         * Clear or reset the tables.
+         * <p>
+         * @param initialIndexOffset the initial index offset to calculate
+         *                           the maximum possible index
+         */
+        public void clearOrResetTables(int intialIndexOffset) {
+            if (requiresClear) {
+                requiresClear = false;
+
+                // Increment offset to new position
+                indexOffset += maxIndex;
+                // Reset the maximum known value of an index
+                maxIndex = intialIndexOffset + elementIndexes.length + attributeIndexes.length;
+                // Check if there is enough free space
+                // If overflow
+                if ((indexOffset + maxIndex) < 0) {
+                    clearAll();
+                }
+            } else {
+                // Reset the maximum known value of an index
+                maxIndex = intialIndexOffset + elementIndexes.length + attributeIndexes.length;
+                // Check if there is enough free space
+                // If overflow
+                if ((indexOffset + maxIndex) < 0) {
+                    resetAll();
+                }
+            }
+        }
+
+        private void clearAll() {
+            clear(elementIndexes);
+            clear(attributeIndexes);
+            clear(localNameIndexes);
+            indexOffset = 1;
+        }
+
+        private void clear(int[] array) {
+            for (int i = 0; i < array.length; i++) {
+                array[i] = 0;
+            }
+        }
+
+        /**
+         * Increment the maximum know index value
+         * <p>
+         * The indexes are preserved.
+         */
+        public void incrementMaxIndexValue() {
+            // Increment the maximum value of an index
+            maxIndex++;
+            // Check if there is enough free space
+            // If overflow
+            if ((indexOffset + maxIndex) < 0) {
+                resetAll();
+            }
+        }
+
+        private void resetAll() {
+            clear(elementIndexes);
+            clear(attributeIndexes);
+            clear(localNameIndexes);
+            indexOffset = 1;
+        }
+
+        private void reset(int[] array) {
+            for (int i = 0; i < array.length; i++) {
+                if (array[i] > indexOffset) {
+                    array[i] = array[i] - indexOffset + 1;
+                } else {
+                    array[i] = 0;
+                }
+            }
+        }
+
     }
 
-    public void text(Pcdata value, boolean needsSeparatingWhitespace) throws XMLStreamException {
-        if(needsSeparatingWhitespace) {
-            fiout.writeCharacters(" ");
+    /**
+     * Holder of JAXB contexts -> tables.
+     * <p>
+     * An instance will be registered with the
+     * {@link LowLevelStAXDocumentSerializer}.
+     */
+    final static class AppData implements VocabularyApplicationData {
+        final Map<JAXBContext, TablesPerJAXBContext> contexts =
+                new WeakHashMap<JAXBContext, TablesPerJAXBContext>();
+        final Collection<TablesPerJAXBContext> collectionOfContexts = contexts.values();
+
+        /**
+         * Clear all the tables.
+         */
+        public void clear() {
+            for(TablesPerJAXBContext c : collectionOfContexts)
+                c.requireClearTables();
         }
+    }
+
+    public FastInfosetStreamWriterOutput(StAXDocumentSerializer out,
+            JAXBContextImpl context) {
+        super(out);
+
+        this.fiout = out;
+        this.localNames = context.getUTF8NameTable();
+
+        final VocabularyApplicationData vocabAppData = fiout.getVocabularyApplicationData();
+        AppData appData = null;
+        if (vocabAppData == null || !(vocabAppData instanceof AppData)) {
+            appData = new AppData();
+            fiout.setVocabularyApplicationData(appData);
+        } else {
+            appData = (AppData)vocabAppData;
+        }
+
+        final TablesPerJAXBContext tablesPerContext = appData.contexts.get(context);
+        if (tablesPerContext != null) {
+            tables = tablesPerContext;
+            /**
+             * Obtain the current local name index. Thus will be used to
+             * calculate the maximum index value when serializing for this context
+             */
+            tables.clearOrResetTables(out.getLocalNameIndex());
+        } else {
+            tables = new TablesPerJAXBContext(context, out.getLocalNameIndex());
+            appData.contexts.put(context, tables);
+        }
+    }
+
+    public void startDocument(XMLSerializer serializer, boolean fragment,
+            int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext)
+            throws IOException, SAXException, XMLStreamException {
+        super.startDocument(serializer, fragment, nsUriIndex2prefixIndex, nsContext);
+
+        if (fragment)
+            fiout.initiateLowLevelWriting();
+    }
+
+    public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException {
+        super.endDocument(fragment);
+    }
+
+    public void beginStartTag(Name name) throws IOException {
+        fiout.writeLowLevelTerminationAndMark();
+
+        if (nsContext.getCurrent().count() == 0) {
+            final int qNameIndex = tables.elementIndexes[name.qNameIndex] - tables.indexOffset;
+            if (qNameIndex >= 0) {
+                fiout.writeLowLevelStartElementIndexed(EncodingConstants.ELEMENT, qNameIndex);
+            } else {
+                tables.elementIndexes[name.qNameIndex] = fiout.getNextElementIndex() + tables.indexOffset;
+
+                final int prefix = nsUriIndex2prefixIndex[name.nsUriIndex];
+                writeLiteral(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                        name,
+                        nsContext.getPrefix(prefix),
+                        nsContext.getNamespaceURI(prefix));
+            }
+        } else {
+            beginStartTagWithNamespaces(name);
+        }
+    }
+
+    public void beginStartTagWithNamespaces(Name name) throws IOException {
+        final NamespaceContextImpl.Element nse = nsContext.getCurrent();
+
+        fiout.writeLowLevelStartNamespaces();
+        for (int i = nse.count() - 1; i >= 0; i--) {
+            final String uri = nse.getNsUri(i);
+            if (uri.length() == 0 && nse.getBase() == 1)
+                continue;   // no point in definint xmlns='' on the root
+            fiout.writeLowLevelNamespace(nse.getPrefix(i), uri);
+        }
+        fiout.writeLowLevelEndNamespaces();
+
+        final int qNameIndex = tables.elementIndexes[name.qNameIndex] - tables.indexOffset;
+        if (qNameIndex >= 0) {
+            fiout.writeLowLevelStartElementIndexed(0, qNameIndex);
+        } else {
+            tables.elementIndexes[name.qNameIndex] = fiout.getNextElementIndex() + tables.indexOffset;
+
+            final int prefix = nsUriIndex2prefixIndex[name.nsUriIndex];
+            writeLiteral(EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                    name,
+                    nsContext.getPrefix(prefix),
+                    nsContext.getNamespaceURI(prefix));
+        }
+    }
+
+    public void attribute(Name name, String value) throws IOException {
+        fiout.writeLowLevelStartAttributes();
+
+        final int qNameIndex = tables.attributeIndexes[name.qNameIndex] - tables.indexOffset;
+        if (qNameIndex >= 0) {
+            fiout.writeLowLevelAttributeIndexed(qNameIndex);
+        } else {
+            tables.attributeIndexes[name.qNameIndex] = fiout.getNextAttributeIndex() + tables.indexOffset;
+
+            final int namespaceURIId = name.nsUriIndex;
+            if (namespaceURIId == -1) {
+                writeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG,
+                        name,
+                        "",
+                        "");
+            } else {
+                final int prefix = nsUriIndex2prefixIndex[namespaceURIId];
+                writeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG,
+                        name,
+                        nsContext.getPrefix(prefix),
+                        nsContext.getNamespaceURI(prefix));
+            }
+        }
+
+        fiout.writeLowLevelAttributeValue(value);
+    }
+
+    private void writeLiteral(int type, Name name, String prefix, String namespaceURI) throws IOException {
+        final int localNameIndex = tables.localNameIndexes[name.localNameIndex] - tables.indexOffset;
+
+        if (localNameIndex < 0) {
+            tables.localNameIndexes[name.localNameIndex] = fiout.getNextLocalNameIndex() + tables.indexOffset;
+
+            fiout.writeLowLevelStartNameLiteral(
+                    type,
+                    prefix,
+                    localNames[name.localNameIndex].buf,
+                    namespaceURI);
+        } else {
+            fiout.writeLowLevelStartNameLiteral(
+                    type,
+                    prefix,
+                    localNameIndex,
+                    namespaceURI);
+        }
+    }
+
+    public void endStartTag() throws IOException {
+        fiout.writeLowLevelEndStartElement();
+    }
+
+    public void endTag(Name name) throws IOException {
+        fiout.writeLowLevelEndElement();
+    }
+
+    public void endTag(int prefix, String localName) throws IOException {
+        fiout.writeLowLevelEndElement();
+    }
+
+
+    public void text(Pcdata value, boolean needsSeparatingWhitespace) throws IOException {
+        if (needsSeparatingWhitespace)
+            fiout.writeLowLevelText(" ");
 
         /*
          * Check if the CharSequence is from a base64Binary data type
          */
         if (!(value instanceof Base64Data)) {
-            // Write out characters
-            fiout.writeCharacters(value.toString());
+            final int len = value.length();
+            if(len <buf.length) {
+                value.writeTo(buf, 0);
+                fiout.writeLowLevelText(buf, len);
+            } else {
+                fiout.writeLowLevelText(value.toString());
+            }
         } else {
             final Base64Data dataValue = (Base64Data)value;
             // Write out the octets using the base64 encoding algorithm
-            fiout.writeOctets(dataValue.get(), 0, dataValue.getDataLen());
+            fiout.writeLowLevelOctets(dataValue.get(), dataValue.getDataLen());
         }
     }
+
+
+    public void text(String value, boolean needsSeparatingWhitespace) throws IOException {
+        if (needsSeparatingWhitespace)
+            fiout.writeLowLevelText(" ");
+
+        fiout.writeLowLevelText(value);
+    }
+
+
+    public void beginStartTag(int prefix, String localName) throws IOException {
+        fiout.writeLowLevelTerminationAndMark();
+
+        int type = EncodingConstants.ELEMENT;
+        if (nsContext.getCurrent().count() > 0) {
+            final NamespaceContextImpl.Element nse = nsContext.getCurrent();
+
+            fiout.writeLowLevelStartNamespaces();
+            for (int i = nse.count() - 1; i >= 0; i--) {
+                final String uri = nse.getNsUri(i);
+                if (uri.length() == 0 && nse.getBase() == 1)
+                    continue;   // no point in definint xmlns='' on the root
+                fiout.writeLowLevelNamespace(nse.getPrefix(i), uri);
+            }
+            fiout.writeLowLevelEndNamespaces();
+
+            type= 0;
+        }
+
+        final boolean isIndexed = fiout.writeLowLevelStartElement(
+                type,
+                nsContext.getPrefix(prefix),
+                localName,
+                nsContext.getNamespaceURI(prefix));
+
+        if (!isIndexed)
+            tables.incrementMaxIndexValue();
+    }
+
+    public void attribute(int prefix, String localName, String value) throws IOException {
+        fiout.writeLowLevelStartAttributes();
+
+        boolean isIndexed;
+        if (prefix == -1)
+            isIndexed = fiout.writeLowLevelAttribute("", "", localName);
+        else
+            isIndexed = fiout.writeLowLevelAttribute(
+                    nsContext.getPrefix(prefix),
+                    nsContext.getNamespaceURI(prefix),
+                    localName);
+
+        if (!isIndexed)
+            tables.incrementMaxIndexValue();
+
+        fiout.writeLowLevelAttributeValue(value);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java
index f5e2df0..42c229b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -77,12 +76,6 @@
         rhs.endTag(name);
     }
 
-    @Override
-    public void flush() throws IOException, XMLStreamException {
-        lhs.flush();
-        rhs.flush();
-    }
-
     public void beginStartTag(int prefix, String localName) throws IOException, XMLStreamException {
         lhs.beginStartTag(prefix,localName);
         rhs.beginStartTag(prefix,localName);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java
index 6130d56..17835a0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java
index 50707fc..d189430 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java
index 6f913d2..7e12ce8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -126,8 +125,4 @@
         }
         next.text(value, needsSeparatingWhitespace);
     }
-
-    public void flush() throws IOException, XMLStreamException {
-        next.flush();
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java
index a4076d9..2bc80c2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -216,11 +215,32 @@
         }
     }
 
+    public int force(@NotNull String uri, @NotNull String prefix) {
+        // check for the existing binding
+        for( int i=size-1; i>=0; i-- ) {
+            if(prefixes[i].equals(prefix)) {
+                if(nsUris[i].equals(uri))
+                    return i;   // found duplicate
+                else
+                    // the prefix is used for another namespace. we need to declare it
+                    break;
+            }
+        }
+
+        return put(uri, prefix);
+    }
+
     /**
-     * {@inheritDoc}.
+     * Puts this new binding into the declared prefixes list
+     * without doing any duplicate check.
      *
-     * @param prefix
-     *      if null, an unique prefix (including "") is allocated.
+     * This can be used to forcibly set namespace declarations.
+     *
+     * <p>
+     * Most of the time {@link #declareNamespace(String, String, boolean)} shall be used.
+     *
+     * @return
+     *      the index of this new binding.
      */
     public int put(@NotNull String uri, @Nullable String prefix) {
         if(size==nsUris.length) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java
index 7258634..22454b9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java
index 111518a..060d4d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java
index 0bace85..f7603e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -33,6 +32,7 @@
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
 
 import org.xml.sax.SAXException;
 
@@ -82,6 +82,11 @@
     protected boolean closeStartTagPending = false;
 
     /**
+     * @see MarshallerImpl#header
+     */
+    private String header;
+
+    /**
      *
      * @param localNames
      *      local names encoded in UTF-8.
@@ -93,6 +98,10 @@
             prefixes[i] = new Encoded();
     }
 
+    public void setHeader(String header) {
+        this.header = header;
+    }
+
     @Override
     public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException {
         super.startDocument(serializer, fragment,nsUriIndex2prefixIndex,nsContext);
@@ -101,6 +110,10 @@
         if(!fragment) {
             write(XML_DECL);
         }
+        if(header!=null) {
+            textBuffer.set(header);
+            textBuffer.write(this);
+        }
     }
 
     public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException {
@@ -377,13 +390,6 @@
         octetBufferIndex = 0;
     }
 
-    public void flush() throws IOException {
-        flushBuffer();
-        out.flush();
-    }
-
-
-
     static byte[] toBytes(String s) {
         byte[] buf = new byte[s.length()];
         for( int i=s.length()-1; i>=0; i-- )
@@ -391,11 +397,23 @@
         return buf;
     }
 
-    private static final byte[] XMLNS_EQUALS = toBytes(" xmlns=\"");
-    private static final byte[] XMLNS_COLON = toBytes(" xmlns:");
-    private static final byte[] EQUALS = toBytes("=\"");
-    private static final byte[] CLOSE_TAG = toBytes("</");
-    private static final byte[] EMPTY_TAG = toBytes("/>");
+    // per instance copy to prevent an attack where malicious OutputStream
+    // rewrites the byte array.
+    private final byte[] XMLNS_EQUALS = _XMLNS_EQUALS.clone();
+    private final byte[] XMLNS_COLON = _XMLNS_COLON.clone();
+    private final byte[] EQUALS = _EQUALS.clone();
+    private final byte[] CLOSE_TAG = _CLOSE_TAG.clone();
+    private final byte[] EMPTY_TAG = _EMPTY_TAG.clone();
+    private final byte[] XML_DECL = _XML_DECL.clone();
+
+    // masters
+    private static final byte[] _XMLNS_EQUALS = toBytes(" xmlns=\"");
+    private static final byte[] _XMLNS_COLON = toBytes(" xmlns:");
+    private static final byte[] _EQUALS = toBytes("=\"");
+    private static final byte[] _CLOSE_TAG = toBytes("</");
+    private static final byte[] _EMPTY_TAG = toBytes("/>");
+    private static final byte[] _XML_DECL = toBytes("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
+
+    // no need to copy
     private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
-    private static final byte[] XML_DECL = toBytes("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java
index c95f9c5..68b18d5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -123,8 +122,4 @@
     public void text(Pcdata value, boolean needsSeparatingWhitespace) throws IOException, SAXException, XMLStreamException {
         text(value.toString(),needsSeparatingWhitespace);
     }
-
-    public void flush() throws IOException, XMLStreamException {
-        out.flush();
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java
index 7004946..fad0839 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -31,6 +30,7 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl;
@@ -39,6 +39,11 @@
 
 /**
  * {@link XmlOutput} that writes to StAX {@link XMLStreamWriter}.
+ * <p>
+ * TODO:
+ * Finding the optimized FI implementations is a bit hacky and not very
+ * extensible. Can we use the service provider mechnism in general for
+ * concrete implementations of XmlOutputAbstractImpl.
  *
  * @author Kohsuke Kawaguchi
  */
@@ -48,15 +53,16 @@
      * Creates a new {@link XmlOutput} from a {@link XMLStreamWriter}.
      * This method recognizes an FI StAX writer.
      */
-    public static XmlOutput create(XMLStreamWriter out) {
+    public static XmlOutput create(XMLStreamWriter out, JAXBContextImpl context) {
         // try optimized path
-        if(out.getClass()==FI_STAX_WRITER_CLASS) {
+        final Class writerClass = out.getClass();
+        if (writerClass==FI_STAX_WRITER_CLASS) {
             try {
-                return FI_OUTPUT_CTOR.newInstance(out);
+                return FI_OUTPUT_CTOR.newInstance(out, context);
             } catch (Exception e) {
             }
         }
-        if(STAXEX_WRITER_CLASS!=null && STAXEX_WRITER_CLASS.isAssignableFrom(out.getClass())) {
+        if (STAXEX_WRITER_CLASS!=null && STAXEX_WRITER_CLASS.isAssignableFrom(writerClass)) {
             try {
                 return STAXEX_OUTPUT_CTOR.newInstance(out);
             } catch (Exception e) {
@@ -70,7 +76,7 @@
 
     private final XMLStreamWriter out;
 
-    private final char[] buf = new char[256];
+    protected final char[] buf = new char[256];
 
     protected XMLStreamWriterOutput(XMLStreamWriter out) {
         this.out = out;
@@ -154,7 +160,15 @@
 
     private static Class initFIStAXWriterClass() {
         try {
-            return MarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
+            Class llfisw = MarshallerImpl.class.getClassLoader().
+                    loadClass("com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter");
+            Class sds = MarshallerImpl.class.getClassLoader().
+                    loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
+            // Check if StAXDocumentSerializer implements LowLevelFastInfosetStreamWriter
+            if (llfisw.isAssignableFrom(sds))
+                return sds;
+            else
+                return null;
         } catch (Throwable e) {
             return null;
         }
@@ -162,8 +176,11 @@
 
     private static Constructor<? extends XmlOutput> initFastInfosetOutputClass() {
         try {
+            if (FI_STAX_WRITER_CLASS == null)
+                return null;
+
             Class c = UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.output.FastInfosetStreamWriterOutput");
-            return c.getConstructor(FI_STAX_WRITER_CLASS);
+            return c.getConstructor(FI_STAX_WRITER_CLASS, JAXBContextImpl.class);
         } catch (Throwable e) {
             return null;
         }
@@ -177,7 +194,7 @@
 
     private static Class initStAXExWriterClass() {
         try {
-            return MarshallerImpl.class.getClassLoader().loadClass("org.jvnet.staxex.XMLStreamWriterEx");
+            return MarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx");
         } catch (Throwable e) {
             return null;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java
index 9132eb3..37ba1ed 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,11 +22,9 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
-import java.io.OutputStream;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.stream.XMLStreamException;
@@ -116,8 +114,9 @@
      *      true if we are marshalling a fragment.
      */
     public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException;
+
     /**
-     * Called at the very end.
+     * Called at the very end. This is the last method to be invoked.
      *
      * @param fragment
      *      false if we are writing the whole document.
@@ -172,11 +171,4 @@
      * @param needsSeparatingWhitespace
      */
     public void text( Pcdata value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException;
-
-    /**
-     * Flush the output.
-     *
-     * @see OutputStream#flush()
-     */
-    public void flush() throws IOException, XMLStreamException;
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java
index 918e4a5..af3607e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.output;
 
 import java.io.IOException;
@@ -110,14 +109,6 @@
     }
     public abstract void endTag(int prefix, String localName) throws IOException, SAXException, XMLStreamException;
 
-    /**
-     * Flush the output.
-     *
-     * @see OutputStream#flush()
-     */
-    public void flush() throws IOException, XMLStreamException {
-    }
-
 
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java
index 2626f44..b715ea0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * Code that writes well-formed XML ({@link XmlOutput} and its implementations}.
  */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
index d599e94..98bc486 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 Code that implements JAXBContext, Unmarshaller, and Marshaller.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java
index 366f70b..476bc07 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -37,12 +36,15 @@
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+import com.sun.xml.internal.bind.v2.runtime.reflect.Lister;
+import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.TagName;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Receiver;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader;
 
 import org.xml.sax.SAXException;
 
@@ -75,18 +77,30 @@
         this.isWrapperNillable = isWrapperNillable;
     }
 
-
+    /**
+     * Used to handle the collection wrapper element.
+     */
     private static final class ItemsLoader extends Loader {
-        public ItemsLoader(QNameMap<ChildLoader> children) {
+
+        private final Accessor acc;
+        private final Lister lister;
+
+        public ItemsLoader(Accessor acc, Lister lister, QNameMap<ChildLoader> children) {
             super(false);
+            this.acc = acc;
+            this.lister = lister;
             this.children = children;
         }
 
         @Override
-        public void startElement(UnmarshallingContext.State state, TagName ea) {
-            state.getContext().startScope(1);
+        public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
+            UnmarshallingContext context = state.getContext();
+            context.startScope(1);
             // inherit the target so that our children can access its target
             state.target = state.prev.target;
+
+            // start it now, so that even if there's no children we can still return empty collection
+            context.getScope(0).start(acc,lister);
         }
 
         private final QNameMap<ChildLoader> children;
@@ -157,7 +171,10 @@
             UnmarshallerChain c = new UnmarshallerChain(chain.context);
             QNameMap<ChildLoader> m = new QNameMap<ChildLoader>();
             createBodyUnmarshaller(c,m);
-            loaders.put(wrapperTagName,new ChildLoader(new ItemsLoader(m),null));
+            Loader loader = new ItemsLoader(acc, lister, m);
+            if(isWrapperNillable || chain.context.allNillable)
+                loader = new XsiNilLoader(loader);
+            loaders.put(wrapperTagName,new ChildLoader(loader,null));
         } else {
             createBodyUnmarshaller(chain,loaders);
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java
index 271e9d2..af69456 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java
index 858033f..8d2d990 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java
index 83bbb20..f5c27ae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -190,7 +189,7 @@
             Name tagName = chain.context.nameBuilder.createElementName(typeRef.getTagName());
             Loader item = createItemUnmarshaller(chain,typeRef);
 
-            if(typeRef.isNillable())
+            if(typeRef.isNillable() || chain.context.allNillable)
                 item = new XsiNilLoader.Array(item);
             if(typeRef.getDefaultValue()!=null)
                 item = new DefaultValueLoaderDecorator(item,typeRef.getDefaultValue());
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java
index 31df5d5..7c10a7b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 
@@ -51,7 +50,7 @@
         lister = Lister.create(
             Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
         assert lister!=null;
-        acc = prop.getAccessor().optimize();
+        acc = prop.getAccessor().optimize(context);
         assert acc!=null;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java
index 8d5dea4..270dc10 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java
index 4e9e5ac..5c89991 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -31,7 +30,6 @@
 
 import com.sun.xml.internal.bind.api.AccessorException;
 import com.sun.xml.internal.bind.v2.util.QNameMap;
-import com.sun.xml.internal.bind.v2.util.QNameMap;
 import com.sun.xml.internal.bind.v2.model.core.AttributePropertyInfo;
 import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
 import com.sun.xml.internal.bind.v2.model.runtime.RuntimeAttributePropertyInfo;
@@ -39,7 +37,6 @@
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
 import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
 import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
@@ -72,10 +69,10 @@
 
     private final Accessor acc;
 
-    public AttributeProperty(JAXBContextImpl p, RuntimeAttributePropertyInfo prop) {
-        super(p,prop);
-        this.attName = p.nameBuilder.createAttributeName(prop.getXmlName());
-        this.xacc = TransducedAccessor.get(prop);
+    public AttributeProperty(JAXBContextImpl context, RuntimeAttributePropertyInfo prop) {
+        super(context,prop);
+        this.attName = context.nameBuilder.createAttributeName(prop.getXmlName());
+        this.xacc = TransducedAccessor.get(context,prop);
         this.acc = prop.getAccessor();   // we only use this for binder, so don't waste memory by optimizing
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java
index df50fe1..6146d26 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java
index de20059..5458d00 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties
index 5d044d3..fc31ce4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 UNSUBSTITUTABLE_TYPE = \
     type {0} is mapped to {1} but it cannot substitute {2} here
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java
index 51e27b9..6e20e6d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java
index cdce8eb..db35b10 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.lang.reflect.Constructor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java
index e1fe1a4..6bbdb44 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java
index 5afe698..d17d29a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -67,9 +66,9 @@
         assert tagName!=null;
         nillable = ref.isNillable();
         defaultValue = ref.getDefaultValue();
-        this.acc = prop.getAccessor().optimize();
+        this.acc = prop.getAccessor().optimize(context);
 
-        xacc = TransducedAccessor.get(ref);
+        xacc = TransducedAccessor.get(context,ref);
         assert xacc!=null;
     }
 
@@ -97,7 +96,7 @@
         Loader l = new LeafPropertyLoader(xacc);
         if(defaultValue!=null)
             l = new DefaultValueLoaderDecorator(l,defaultValue);
-        if(nillable)
+        if(nillable || chain.context.allNillable)
             l = new XsiNilLoader.Single(l,acc);
         handlers.put(tagName,new ChildLoader(l,null));
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java
index 5a58f5d..cd6826c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -48,7 +47,6 @@
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.DefaultValueLoaderDecorator;
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiTypeLoader;
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
 
 import org.xml.sax.SAXException;
@@ -75,7 +73,7 @@
 
     public SingleElementNodeProperty(JAXBContextImpl context, RuntimeElementPropertyInfo prop) {
         super(context,prop);
-        acc = prop.getAccessor().optimize();
+        acc = prop.getAccessor().optimize(context);
         this.prop = prop;
 
         QName nt = null;
@@ -155,7 +153,7 @@
             Loader l = bi.getLoader(context,true);
             if(e.getDefaultValue()!=null)
                 l = new DefaultValueLoaderDecorator(l,e.getDefaultValue());
-            if(nillable)
+            if(nillable || chain.context.allNillable)
                 l = new XsiNilLoader.Single(l,acc);
             handlers.put( e.getTagName(), new ChildLoader(l,acc));
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java
index d9b84d7..d044e00 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
@@ -54,7 +53,6 @@
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Receiver;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiTypeLoader;
 
 import org.xml.sax.SAXException;
 
@@ -88,7 +86,7 @@
 
     public SingleMapNodeProperty(JAXBContextImpl context, RuntimeMapPropertyInfo prop) {
         super(context, prop);
-        acc = prop.getAccessor().optimize();
+        acc = prop.getAccessor().optimize(context);
         this.tagName = context.nameBuilder.createElementName(prop.getXmlName());
         this.entryTag = context.nameBuilder.createElementName("","entry");
         this.keyTag = context.nameBuilder.createElementName("","key");
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java
index 2585e80..89d4a39 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,10 +22,10 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
@@ -61,12 +61,12 @@
     private final DomHandler domHandler;
     private final WildcardMode wcMode;
 
-    public SingleReferenceNodeProperty(JAXBContextImpl p, RuntimeReferencePropertyInfo prop) {
-        super(p,prop);
-        acc = prop.getAccessor().optimize();
+    public SingleReferenceNodeProperty(JAXBContextImpl context, RuntimeReferencePropertyInfo prop) {
+        super(context,prop);
+        acc = prop.getAccessor().optimize(context);
 
         for (RuntimeElement e : prop.getElements()) {
-            expectedElements.put( e.getElementName(), p.getOrCreate(e) );
+            expectedElements.put( e.getElementName(), context.getOrCreate(e) );
         }
 
         if(prop.getWildcard()!=null) {
@@ -136,7 +136,15 @@
 
                     public void set(BeanT bean, Object value) throws AccessorException {
                         if(value!=null) {
-                            value = ebi.createInstanceFromValue(value);
+                            try {
+                                value = ebi.createInstanceFromValue(value);
+                            } catch (IllegalAccessException e) {
+                                throw new AccessorException(e);
+                            } catch (InvocationTargetException e) {
+                                throw new AccessorException(e);
+                            } catch (InstantiationException e) {
+                                throw new AccessorException(e);
+                            }
                         }
                         acc.set(bean,(ValueT)value);
                     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java
index 9169725..2a41727 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java
index 589abea..9f3b5fb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java
index f0af637..c0a278c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
  * have any questions.
  */
 
+/*
+ * @(#)$Id:
+ */
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java
index dddde4d..44a4b27 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.property;
 
 
@@ -61,9 +60,9 @@
     private final Accessor<BeanT,?> acc;
 
 
-    public ValueProperty(JAXBContextImpl grammar, RuntimeValuePropertyInfo prop) {
-        super(grammar,prop);
-        xacc = TransducedAccessor.get(prop);
+    public ValueProperty(JAXBContextImpl context, RuntimeValuePropertyInfo prop) {
+        super(context,prop);
+        xacc = TransducedAccessor.get(context,prop);
         acc = prop.getAccessor();   // we only use this for binder, so don't waste memory by optimizing
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java
index a5c9e4c..e06ac09 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.lang.reflect.Field;
@@ -47,6 +46,7 @@
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Receiver;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 
 import org.xml.sax.SAXException;
 
@@ -82,10 +82,12 @@
     /**
      * Returns the optimized version of the same accessor.
      *
+     * @param context
+     *      The {@link JAXBContextImpl} that owns the whole thing.
      * @return
      *      At least the implementation can return <tt>this</tt>.
      */
-    public Accessor<BeanT,ValueT> optimize() {
+    public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
         return this;
     }
 
@@ -131,6 +133,15 @@
     }
 
     /**
+     * Returns true if this accessor wraps an adapter.
+     *
+     * This method needs to be used with care, but it helps some optimization.
+     */
+    public boolean isAdapted() {
+        return false;
+    }
+
+    /**
      * Sets the value without adapting the value.
      *
      * This ugly entry point is only used by JAX-WS.
@@ -219,7 +230,10 @@
         }
 
         @Override
-        public Accessor<BeanT,ValueT> optimize() {
+        public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
+            if(context.fastBoot)
+                // let's not waste time on doing this for the sake of faster boot.
+                return this;
             Accessor<BeanT,ValueT> acc = OptimizedAccessorFactory.get(f);
             if(acc!=null)
                 return acc;
@@ -241,7 +255,7 @@
         }
 
         @Override
-        public Accessor<BeanT,ValueT> optimize() {
+        public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
             return this;
         }
     }
@@ -325,10 +339,13 @@
         }
 
         @Override
-        public Accessor<BeanT,ValueT> optimize() {
+        public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
             if(getter==null || setter==null)
                 // if we aren't complete, OptimizedAccessor won't always work
                 return this;
+            if(context.fastBoot)
+                // let's not waste time on doing this for the sake of faster boot.
+                return this;
 
             Accessor<BeanT,ValueT> acc = OptimizedAccessorFactory.get(getter,setter);
             if(acc!=null)
@@ -373,9 +390,14 @@
     }
 
     /**
-     * Special {@link Accessor} used to recover from errors.
+     * Gets the special {@link Accessor} used to recover from errors.
      */
-    public static final Accessor ERROR = new Accessor(Object.class) {
+    @SuppressWarnings("unchecked")
+    public static <A,B> Accessor<A,B> getErrorInstance() {
+        return ERROR;
+    }
+
+    private static final Accessor ERROR = new Accessor<Object,Object>(Object.class) {
         public Object get(Object o) {
             return null;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java
index 80df7c3..913cbf0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import javax.xml.bind.annotation.adapters.XmlAdapter;
@@ -48,6 +47,11 @@
         this.adapter = adapter;
     }
 
+    @Override
+    public boolean isAdapted() {
+        return true;
+    }
+
     public OnWireValueT get(BeanT bean) throws AccessorException {
         InMemValueT v = core.get(bean);
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java
index 521120d..49e6f77 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import javax.xml.bind.annotation.adapters.XmlAdapter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java
index ad55abe..2c584f7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java
index 4a0fdea..c26d297 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java
index 139585b..71f5305 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import javax.xml.bind.JAXBException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java
index 8b133f3..f4df2e6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.lang.ref.WeakReference;
@@ -51,6 +50,7 @@
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Patcher;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.LocatorEx;
 
 import org.xml.sax.SAXException;
 
@@ -138,7 +138,7 @@
         return l;
     }
 
-    private static Class getImplClass(Class fieldType) {
+    private static Class getImplClass(Class<?> fieldType) {
         return ClassFactory.inferImplClass(fieldType,ClassFactory.COLLECTION_IMPL_CLASSES);
     }
 
@@ -274,6 +274,8 @@
             T collection = acc.get(bean);
             if(collection==null) {
                 collection = ClassFactory.create(implClass);
+                if(!acc.isAdapted())
+                    acc.set(bean,collection);
             }
             collection.clear();
             return collection;
@@ -286,12 +288,21 @@
         public void endPacking( T collection, BeanT bean, Accessor<BeanT,T> acc ) throws AccessorException {
             // this needs to be done in the endPacking, because
             // sometimes the accessor uses an adapter, and the adapter needs to see
-            // the whole thing
-            acc.set(bean,collection);
+            // the whole thing.
+
+            // but always doing so causes a problem when this collection property
+            // is getter-only
+
+            if(acc.isAdapted())
+                acc.set(bean,collection);
         }
 
         public void reset(BeanT bean, Accessor<BeanT, T> acc) throws AccessorException {
-            acc.get(bean).clear();
+            T collection = acc.get(bean);
+            if(collection == null) {
+                return;
+            }
+            collection.clear();
         }
     }
 
@@ -339,11 +350,13 @@
             private final List<String> idrefs = new ArrayList<String>();
             private final UnmarshallingContext context;
             private final Accessor<BeanT,PropT> acc;
+            private final LocatorEx location;
 
             public Pack(BeanT bean, Accessor<BeanT,PropT> acc) {
                 this.bean = bean;
                 this.acc = acc;
                 this.context = UnmarshallingContext.getInstance();
+                this.location = new LocatorEx.Snapshot(context.getLocator());
                 context.addPatcher(this);
             }
 
@@ -371,7 +384,7 @@
                         }
 
                         if(t==null) {
-                            context.errorUnresolvedIDREF(bean,id);
+                            context.errorUnresolvedIDREF(bean,id,location);
                         } else {
                             TODO.prototype(); // TODO: check if the type of t is proper.
                             core.addToPack(pack,t);
@@ -425,8 +438,13 @@
     }
 
     /**
-     * Special {@link Lister} used to recover from an error.
+     * Gets the special {@link Lister} used to recover from an error.
      */
+    @SuppressWarnings("unchecked")
+    public static <A,B,C,D> Lister<A,B,C,D> getErrorInstance() {
+        return ERROR;
+    }
+
     public static final Lister ERROR = new Lister() {
         public ListIterator iterator(Object o, XMLSerializer context) {
             return EMPTY_ITERATOR;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java
index da1c89b..b74f0f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties
index a43f603..58daf1a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 UNABLE_TO_ACCESS_NON_PUBLIC_FIELD = \
     Unable to make {0}.{1} accessible.
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java
index 25abec3..8608583 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java
index 12b046c..552d7cc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java
index dea07a0..5b2e9683 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java
index e2d2153..21af486 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java
index 3f4257d..00580f3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java
index 636c253..0a72a79 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java
index 99c3801..53b9a8a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java
index c6abaf9..02c6a7a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java
index cc0ca43..673b0eb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java
index bdaf784..26f4d82 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect;
 
 import java.io.IOException;
@@ -45,9 +44,11 @@
 import com.sun.xml.internal.bind.v2.runtime.Name;
 import com.sun.xml.internal.bind.v2.runtime.Transducer;
 import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
 import com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedTransducedAccessorFactory;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Patcher;
 import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.LocatorEx;
 
 import org.xml.sax.SAXException;
 
@@ -136,7 +137,7 @@
      * <p>
      * This allows the implementation to use an optimized code.
      */
-    public static <T> TransducedAccessor<T> get(RuntimeNonElementRef ref) {
+    public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
         Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
         RuntimePropertyInfo prop = ref.getSource();
 
@@ -149,15 +150,15 @@
         if(prop.id()==ID.IDREF)
             return new IDREFTransducedAccessorImpl(prop.getAccessor());
 
-        if(xducer.isDefault()) {
+        if(xducer.isDefault() && !context.fastBoot) {
             TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
             if(xa!=null)    return xa;
         }
 
         if(xducer.useNamespace())
-            return new CompositeContextDependentTransducedAccessorImpl( xducer, prop.getAccessor() );
+            return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
         else
-            return new CompositeTransducedAccessorImpl( xducer, prop.getAccessor() );
+            return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
     }
 
     /**
@@ -178,8 +179,8 @@
     public abstract void writeText(XMLSerializer w, BeanT o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException;
 
     static class CompositeContextDependentTransducedAccessorImpl<BeanT,ValueT> extends CompositeTransducedAccessorImpl<BeanT,ValueT> {
-        public CompositeContextDependentTransducedAccessorImpl(Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc) {
-            super(xducer, acc);
+        public CompositeContextDependentTransducedAccessorImpl(JAXBContextImpl context,Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc) {
+            super(context,xducer,acc);
             assert xducer.useNamespace();
         }
 
@@ -213,9 +214,9 @@
         protected final Transducer<ValueT> xducer;
         protected final Accessor<BeanT,ValueT> acc;
 
-        public CompositeTransducedAccessorImpl(Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc) {
+        public CompositeTransducedAccessorImpl(JAXBContextImpl context, Transducer<ValueT> xducer, Accessor<BeanT,ValueT> acc) {
             this.xducer = xducer;
-            this.acc = acc.optimize();
+            this.acc = acc.optimize(context);
         }
 
         public CharSequence print(BeanT bean) throws AccessorException {
@@ -291,7 +292,8 @@
 
             final Callable callable = context.getObjectFromId(idref,acc.valueType);
             if(callable==null) {
-                context.errorUnresolvedIDREF(bean,idref);
+                // the IDResolver decided to abort it now
+                context.errorUnresolvedIDREF(bean,idref,context.getLocator());
                 return;
             }
 
@@ -309,12 +311,13 @@
                 assign(bean,t,context);
             } else {
                 // try again later
+                final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator());
                 context.addPatcher(new Patcher() {
                     public void run() throws SAXException {
                         try {
                             TargetT t = (TargetT)callable.call();
                             if(t==null) {
-                                context.errorUnresolvedIDREF(bean,idref);
+                                context.errorUnresolvedIDREF(bean,idref,loc);
                             } else {
                                 assign(bean,t,context);
                             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
index 0690dfd..b2a61d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.io.InputStream;
@@ -53,7 +52,7 @@
      * @return null
      *      if it fails for some reason.
      */
-    public static final Class<?> prepare(
+    public static Class<?> prepare(
         Class beanClass, String templateClassName, String newClassName, String... replacements ) {
 
         if(noOptimize)
@@ -96,7 +95,7 @@
      *      The search strings found in the constant pool will be replaced by the corresponding
      *      replacement string.
      */
-    private static final byte[] tailor( String templateClassName, String newClassName, String... replacements ) {
+    private static byte[] tailor( String templateClassName, String newClassName, String... replacements ) {
         InputStream resource;
         if(CLASS_LOADER!=null)
             resource = CLASS_LOADER.getResourceAsStream(templateClassName+".class");
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java
index 4aec754..9d31df9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java
index feab106..205570f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java
index 09c0f07..d37fb41 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java
index fa2a415..e563817 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java
index d3c03a8..f403894 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java
index 15417f6..992021c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java
index 885dbcc..1be74c2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java
index 7676ea4..1e6baf9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java
index 7cf0a7a..e929827 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java
index d1beb11..f0e4ee5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java
index 54a9e30..8f5f1b2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
index 91cc7e9..fc97c48 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.lang.reflect.InvocationTargetException;
@@ -158,6 +157,9 @@
             } catch (SecurityException e) {
                 logger.log(Level.FINE,"Unable to inject "+className,e);
                 return null;
+            } catch (LinkageError e) {
+                logger.log(Level.FINE,"Unable to inject "+className,e);
+                return null;
             }
             classes.put(className,c);
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java
index 3de8d7a..a0549b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java
index 4ad0028..0d21430 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java
index fe1acf5..bdc0de7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java
index 3783ab9..c3b9a9e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java
index 1050933..1cb1358 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java
index f2178db..95d6020 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java
index 6342218..c38737b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java
index 8135d7c..4500602 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java
index 4e7d720..00be3e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java
index 2dd7438..cfe3659 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java
index cfe28e5..4e9f320 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.lang.reflect.Field;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java
index 0797785..78750da 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java
index c328dc9..9ac66b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java
index f5b8ad0..c283842 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java
index ed4eabf..f248583 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java
index 5a71a37..b2eedfd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java
index a9c3036..f2000d84 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java
index f12e9b3..3c72844 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java
index 0ec9cd0..30179aa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java
index 202c70e..a33499f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java
index 73b6ac1..6a422b5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java
index 24334df..6647ba3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java
index 7aa7e0b..5c9bb78 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java
index 4f32c07..2a1f291 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java
index 8bd50bb..a0b4247 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java
index f6c60a2..3e0883f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
index f571755..3027e47 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Hosts optimized
 {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor},
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
index 988a3f2..5be12b3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
   Abstraction around accessing data of actual objects.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java
index 048a934..57149a8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java
index 335a0cb..1d2337c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.util.AttributesImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java
index 08445bc..0214853 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.io.ByteArrayInputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java
index 36223df..5b0349c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java
index 1d52edd..5bc387d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java
index 0febfe9..6ff02a6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java
index d235699..40ed98a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
  * have any questions.
  */
 
+/*
+ * @(#)$Id: Discarder.java,v 1.4 2005/09/10 19:07:43 kohsuke Exp $
+ */
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java
index 841c7bf..52f846c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.bind.annotation.DomHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java
index f2cc63a..97f7739 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.stream.Location;
@@ -31,12 +30,13 @@
 
 import com.sun.xml.internal.bind.WhiteSpaceProcessor;
 import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
-
-import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes;
 import org.xml.sax.SAXException;
 
 /**
  * Reads from FastInfoset StAX parser and feeds into JAXB Unmarshaller.
+ * <p>
+ * This class will peek at future events to ascertain if characters need to be
+ * buffered or not.
  *
  * @author Paul Sandoz.
  */
@@ -45,16 +45,14 @@
     // event source
     private final StAXDocumentParser fastInfosetStreamReader;
 
-    // Flag set to true if there is octets instead of characters
-    boolean hasBase64Data = false;
-    // Flag set to true if the first chunk of CIIs
-    boolean firstCIIChunk = true;
+    // Flag set to true if text has been reported
+    private boolean textReported;
 
     // Buffer for octets
-    private Base64Data base64Data = new Base64Data();
+    private final Base64Data base64Data = new Base64Data();
 
     // Buffer for characters
-    private StringBuilder buffer = new StringBuilder();
+    private final StringBuilder buffer = new StringBuilder();
 
     public FastInfosetConnector(StAXDocumentParser fastInfosetStreamReader,
             XmlVisitor visitor) {
@@ -102,7 +100,17 @@
                     case XMLStreamConstants.CHARACTERS :
                     case XMLStreamConstants.CDATA :
                     case XMLStreamConstants.SPACE :
-                        handleCharacters();
+                        if (predictor.expectText()) {
+                            // Peek at the next event to see if there are
+                            // fragmented characters
+                            event = fastInfosetStreamReader.peekNext();
+                            if (event == XMLStreamConstants.END_ELEMENT)
+                                processNonIgnorableText();
+                            else if (event == XMLStreamConstants.START_ELEMENT)
+                                processIgnorableText();
+                            else
+                                handleFragmentedCharacters();
+                        }
                         break;
                     // otherwise simply ignore
                 }
@@ -127,78 +135,142 @@
     }
 
     private void handleStartElement() throws SAXException {
-        processText(true);
+        processUnreportedText();
 
-        for (int i = 0; i < fastInfosetStreamReader.getNamespaceCount(); i++) {
+        for (int i = 0; i < fastInfosetStreamReader.accessNamespaceCount(); i++) {
             visitor.startPrefixMapping(fastInfosetStreamReader.getNamespacePrefix(i),
                     fastInfosetStreamReader.getNamespaceURI(i));
         }
 
-        tagName.uri = fastInfosetStreamReader.getNamespaceURI();
-        tagName.local = fastInfosetStreamReader.getLocalName();
+        tagName.uri = fastInfosetStreamReader.accessNamespaceURI();
+        tagName.local = fastInfosetStreamReader.accessLocalName();
         tagName.atts = fastInfosetStreamReader.getAttributesHolder();
 
         visitor.startElement(tagName);
     }
 
-    private void handleCharacters() {
-        if (predictor.expectText()) {
-            // If the first chunk of CIIs and character data is present
-            if (firstCIIChunk &&
-                    fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
-                buffer.append(fastInfosetStreamReader.getTextCharacters(),
-                        fastInfosetStreamReader.getTextStart(),
-                        fastInfosetStreamReader.getTextLength());
-                firstCIIChunk = false;
-            // If the first chunk of CIIs and octet data is present
-            } else if (firstCIIChunk &&
-                    fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
-                firstCIIChunk = false;
-                hasBase64Data = true;
-                // Clone the octets
-                base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
-                return;
-            // If a subsequent sequential chunk of CIIs
-            } else {
-                // If the first chunk is octet data
-                if (hasBase64Data) {
-                    // Append base64 encoded octets to the character buffer
-                    buffer.append(base64Data);
-                    hasBase64Data = false;
-                }
+    private void handleFragmentedCharacters() throws XMLStreamException, SAXException {
+        buffer.setLength(0);
 
-                // Append the second or subsequence chunk of CIIs to the buffer
-                buffer.append(fastInfosetStreamReader.getTextCharacters(),
-                        fastInfosetStreamReader.getTextStart(),
-                        fastInfosetStreamReader.getTextLength());
+        // Append characters of first character event
+        buffer.append(fastInfosetStreamReader.accessTextCharacters(),
+                fastInfosetStreamReader.accessTextStart(),
+                fastInfosetStreamReader.accessTextLength());
+
+        // Consume all character
+        while(true) {
+            switch(fastInfosetStreamReader.peekNext()) {
+                case XMLStreamConstants.START_ELEMENT :
+                    processBufferedText(true);
+                    return;
+                case XMLStreamConstants.END_ELEMENT :
+                    processBufferedText(false);
+                    return;
+                case XMLStreamConstants.CHARACTERS :
+                case XMLStreamConstants.CDATA :
+                case XMLStreamConstants.SPACE :
+                    // Append characters of second and subsequent character events
+                    fastInfosetStreamReader.next();
+                    buffer.append(fastInfosetStreamReader.accessTextCharacters(),
+                            fastInfosetStreamReader.accessTextStart(),
+                            fastInfosetStreamReader.accessTextLength());
+                    break;
+                default:
+                    fastInfosetStreamReader.next();
             }
-
         }
     }
 
     private void handleEndElement() throws SAXException {
-        processText(false);
+        processUnreportedText();
 
-        tagName.uri = fastInfosetStreamReader.getNamespaceURI();
-        tagName.local = fastInfosetStreamReader.getLocalName();
+        tagName.uri = fastInfosetStreamReader.accessNamespaceURI();
+        tagName.local = fastInfosetStreamReader.accessLocalName();
 
         visitor.endElement(tagName);
 
-        for (int i = fastInfosetStreamReader.getNamespaceCount() - 1; i >= 0; i--) {
+        for (int i = fastInfosetStreamReader.accessNamespaceCount() - 1; i >= 0; i--) {
             visitor.endPrefixMapping(fastInfosetStreamReader.getNamespacePrefix(i));
         }
     }
 
-    private void processText(boolean ignorable) throws SAXException {
-        firstCIIChunk = true;
-        if(predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) {
-            if (!hasBase64Data) {
-                visitor.text(buffer);
-            } else {
-                visitor.text(base64Data);
-                hasBase64Data = false;
-            }
+    final private class CharSequenceImpl implements CharSequence {
+        char[] ch;
+        int start;
+        int length;
+
+        CharSequenceImpl() {
         }
-        buffer.setLength(0);
+
+        CharSequenceImpl(final char[] ch, final int start, final int length) {
+            this.ch = ch;
+            this.start = start;
+            this.length = length;
+        }
+
+        public void set() {
+            ch = fastInfosetStreamReader.accessTextCharacters();
+            start = fastInfosetStreamReader.accessTextStart();
+            length = fastInfosetStreamReader.accessTextLength();
+        }
+
+        // CharSequence interface
+
+        public final int length() {
+            return length;
+        }
+
+        public final char charAt(final int index) {
+            return ch[start + index];
+        }
+
+        public final CharSequence subSequence(final int start, final int end) {
+            return new CharSequenceImpl(ch, this.start + start, end - start);
+        }
+
+        public String toString() {
+            return new String(ch, start, length);
+        }
+    }
+
+    final private CharSequenceImpl charArray = new CharSequenceImpl();
+
+    private void processNonIgnorableText() throws SAXException {
+        textReported = true;
+        if (fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
+            charArray.set();
+            visitor.text(charArray);
+        } else {
+            base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
+            visitor.text(base64Data);
+        }
+    }
+
+    private void processIgnorableText() throws SAXException {
+        if (fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
+            charArray.set();
+            if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
+                visitor.text(charArray);
+                textReported = true;
+            }
+        } else {
+            base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
+            visitor.text(base64Data);
+            textReported = true;
+        }
+    }
+
+    private void processBufferedText(boolean ignorable) throws SAXException {
+        if (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer)) {
+            visitor.text(buffer);
+            textReported = true;
+        }
+    }
+
+    private void processUnreportedText() throws SAXException {
+        if(!textReported && predictor.expectText()) {
+            visitor.text("");
+        }
+        textReported = false;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java
index 091855d..994dd02 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java
index 59c67f9..3d9ae5a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java
index 9f449e4..e83d9c8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java
index 5b661c7..3a3b44a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.namespace.NamespaceContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java
index 01ac54b..3c4cc3b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java
index 26e5e0a..599efd1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
index 1995e69..be47507 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,14 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
+import java.net.URL;
+
 import javax.xml.bind.ValidationEventLocator;
 
 import org.xml.sax.Locator;
+import org.w3c.dom.Node;
 
 /**
  * Object that returns the current location that the {@link XmlVisitor} is parsing.
@@ -40,4 +42,63 @@
      */
     ValidationEventLocator getLocation();
 
+    /**
+     * Immutable snapshot of a {@link LocatorEx}
+     */
+    public static final class Snapshot implements LocatorEx, ValidationEventLocator {
+        private final int columnNumber,lineNumber,offset;
+        private final String systemId,publicId;
+        private final URL url;
+        private final Object object;
+        private final Node node;
+
+        public Snapshot(LocatorEx loc) {
+            columnNumber = loc.getColumnNumber();
+            lineNumber = loc.getLineNumber();
+            systemId = loc.getSystemId();
+            publicId = loc.getPublicId();
+
+            ValidationEventLocator vel = loc.getLocation();
+            offset = vel.getOffset();
+            url = vel.getURL();
+            object = vel.getObject();
+            node = vel.getNode();
+        }
+
+        public Object getObject() {
+            return object;
+        }
+
+        public Node getNode() {
+            return node;
+        }
+
+        public int getOffset() {
+            return offset;
+        }
+
+        public URL getURL() {
+            return url;
+        }
+
+        public int getColumnNumber() {
+            return columnNumber;
+        }
+
+        public int getLineNumber() {
+            return lineNumber;
+        }
+
+        public String getSystemId() {
+            return systemId;
+        }
+
+        public String getPublicId() {
+            return publicId;
+        }
+
+        public ValidationEventLocator getLocation() {
+            return this;
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java
index d3a1c61..7eba826 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.bind.ValidationEventLocator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java
index ae38421..ff9b0cd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.activation.DataHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java
index f76b164..6267214 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties
index 0a4db7e..2f61f7a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 NOT_A_QNAME = \
     {0} is not a valid QName
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java
index 5167db9..11feacb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java
index 1fb0126..73741a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java
index 99c2e70..d1f5884 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java
index d724792..4a7ad29 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.bind.JAXBException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java
index b559136..6ae0183 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.api.AccessorException;
@@ -107,8 +106,30 @@
         } catch (AccessorException e) {
             Loader.handleGenericException(e,true);
             // recover from this error by ignoring future items.
-            this.lister = Lister.ERROR;
-            this.acc = Accessor.ERROR;
+            this.lister = Lister.getErrorInstance();
+            this.acc = Accessor.getErrorInstance();
+        }
+    }
+
+    /**
+     * Starts the packing scope, without adding any item.
+     *
+     * This allows us to return an empty pack, thereby allowing the user
+     * to distinguish empty array vs null array.
+     */
+    public void start( Accessor<BeanT,PropT> acc, Lister<BeanT,PropT,ItemT,PackT> lister) throws SAXException{
+        try {
+            if(!hasStarted()) {
+                this.bean = (BeanT)context.getCurrentState().target;
+                this.acc = acc;
+                this.lister = lister;
+                this.pack = lister.startPacking(bean,acc);
+            }
+        } catch (AccessorException e) {
+            Loader.handleGenericException(e,true);
+            // recover from this error by ignoring future items.
+            this.lister = Lister.getErrorInstance();
+            this.acc = Accessor.getErrorInstance();
         }
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java
index 9378cbd..72dd423 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.bind.ValidationEventLocator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java
index e77f053..848e57b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.util.Iterator;
@@ -50,6 +49,7 @@
  * parser technologies.
  *
  * @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
  */
 final class StAXEventConnector extends StAXConnector {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java
index 959ad2d..81870b5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.lang.reflect.Constructor;
@@ -40,9 +39,15 @@
 /**
  * Reads XML from StAX {@link XMLStreamReader} and
  * feeds events to {@link XmlVisitor}.
+ * <p>
+ * TODO:
+ * Finding the optimized FI implementations is a bit hacky and not very
+ * extensible. Can we use the service provider mechnism in general for
+ * concrete implementations of StAXConnector.
  *
  * @author Ryan.Shoemaker@Sun.COM
  * @author Kohsuke Kawaguchi
+ * @version JAXB 2.0
  */
 class StAXStreamConnector extends StAXConnector {
 
@@ -53,26 +58,59 @@
      */
     public static StAXConnector create(XMLStreamReader reader, XmlVisitor visitor) {
         // try optimized codepath
-        if (reader.getClass()==FI_STAX_READER_CLASS && FI_CONNECTOR_CTOR!=null) {
+        final Class readerClass = reader.getClass();
+        if (FI_STAX_READER_CLASS != null && FI_STAX_READER_CLASS.isAssignableFrom(readerClass) && FI_CONNECTOR_CTOR!=null) {
             try {
                 return FI_CONNECTOR_CTOR.newInstance(reader,visitor);
             } catch (Exception t) {
             }
         }
-        if (STAX_EX_READER!=null && STAX_EX_READER.isAssignableFrom(reader.getClass())) {
+
+        // Quick hack until SJSXP fixes 6270116
+        boolean isZephyr = readerClass.getName().equals("com.sun.xml.internal.stream.XMLReaderImpl");
+        if(isZephyr)
+            ; // no need for interning
+        else
+        if(checkImplementaionNameOfSjsxp(reader))
+            ; // no need for interning
+        if(getBoolProp(reader,"org.codehaus.stax2.internNames")
+        && getBoolProp(reader,"org.codehaus.stax2.internNsUris"))
+            ; // no need for interning.
+        else
+            visitor = new InterningXmlVisitor(visitor);
+
+        if (STAX_EX_READER_CLASS!=null && STAX_EX_READER_CLASS.isAssignableFrom(readerClass)) {
             try {
                 return STAX_EX_CONNECTOR_CTOR.newInstance(reader,visitor);
             } catch (Exception t) {
             }
         }
 
-        // Quick hack until SJSXP fixes 6270116
-        boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.internal.stream.XMLReaderImpl");
-        if(!isZephyr)
-            visitor = new InterningXmlVisitor(visitor);
         return new StAXStreamConnector(reader,visitor);
     }
 
+    private static boolean checkImplementaionNameOfSjsxp(XMLStreamReader reader) {
+        try {
+            Object name = reader.getProperty("http://java.sun.com/xml/stream/properties/implementation-name");
+            return name!=null && name.equals("sjsxp");
+        } catch (Exception e) {
+            // be defensive against broken StAX parsers since javadoc is not clear
+            // about when an error happens
+            return false;
+        }
+    }
+
+    private static boolean getBoolProp(XMLStreamReader r, String n) {
+        try {
+            Object o = r.getProperty(n);
+            if(o instanceof Boolean)    return (Boolean)o;
+            return false;
+        } catch (Exception e) {
+            // be defensive against broken StAX parsers since javadoc is not clear
+            // about when an error happens
+            return false;
+        }
+    }
 
 
     // StAX event source
@@ -296,7 +334,15 @@
 
     private static Class initFIStAXReaderClass() {
         try {
-            return UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
+            Class fisr = UnmarshallerImpl.class.getClassLoader().
+                    loadClass("com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader");
+            Class sdp = UnmarshallerImpl.class.getClassLoader().
+                    loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
+            // Check if StAXDocumentParser implements FastInfosetStreamReader
+            if (fisr.isAssignableFrom(sdp))
+                return sdp;
+            else
+                return null;
         } catch (Throwable e) {
             return null;
         }
@@ -304,23 +350,26 @@
 
     private static Constructor<? extends StAXConnector> initFastInfosetConnectorClass() {
         try {
-            Class c = UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.unmarshaller.FastInfosetConnector");
+            if (FI_STAX_READER_CLASS == null)
+                return null;
+
+            Class c = UnmarshallerImpl.class.getClassLoader().loadClass(
+                    "com.sun.xml.internal.bind.v2.runtime.unmarshaller.FastInfosetConnector");
             return c.getConstructor(FI_STAX_READER_CLASS,XmlVisitor.class);
         } catch (Throwable e) {
             return null;
         }
     }
 
-
     //
     // reference to StAXEx classes
     //
-    private static final Class STAX_EX_READER = initStAXExReader();
+    private static final Class STAX_EX_READER_CLASS = initStAXExReader();
     private static final Constructor<? extends StAXConnector> STAX_EX_CONNECTOR_CTOR = initStAXExConnector();
 
     private static Class initStAXExReader() {
         try {
-            return UnmarshallerImpl.class.getClassLoader().loadClass("org.jvnet.staxex.XMLStreamReaderEx");
+            return UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx");
         } catch (Throwable e) {
             return null;
         }
@@ -329,7 +378,7 @@
     private static Constructor<? extends StAXConnector> initStAXExConnector() {
         try {
             Class c = UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXExConnector");
-            return c.getConstructor(STAX_EX_READER,XmlVisitor.class);
+            return c.getConstructor(STAX_EX_READER_CLASS,XmlVisitor.class);
         } catch (Throwable e) {
             return null;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
index 1aea12f..bd24507 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.util.Collection;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java
index c465be1..5f6576a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java
index f499ec7..3bf69b4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.api.AccessorException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java
index 92acbea..18e21d5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.io.IOException;
@@ -52,6 +51,7 @@
 import javax.xml.validation.Schema;
 
 import com.sun.xml.internal.bind.IDResolver;
+import com.sun.xml.internal.bind.api.ClassResolver;
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
 import com.sun.xml.internal.bind.unmarshaller.InfosetScanner;
 import com.sun.xml.internal.bind.unmarshaller.Messages;
@@ -418,6 +418,10 @@
             idResolver = (IDResolver)value;
             return;
         }
+        if(name.equals(ClassResolver.class.getName())) {
+            coordinator.classResolver = (ClassResolver)value;
+            return;
+        }
         super.setProperty(name, value);
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
index cef1283..bc0c0b3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import java.lang.reflect.InvocationTargetException;
@@ -44,14 +43,15 @@
 import javax.xml.bind.ValidationEventHandler;
 import javax.xml.bind.ValidationEventLocator;
 import javax.xml.bind.helpers.ValidationEventImpl;
-import javax.xml.bind.helpers.ValidationEventLocatorImpl;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 
 import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 import com.sun.istack.internal.SAXParseException2;
 import com.sun.xml.internal.bind.IDResolver;
 import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.ClassResolver;
 import com.sun.xml.internal.bind.unmarshaller.InfosetScanner;
 import com.sun.xml.internal.bind.v2.ClassFactory;
 import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
@@ -154,6 +154,10 @@
      */
     private NamespaceContext environmentNamespaceContext;
 
+    /**
+     * Used to discover additional classes when we hit unknown elements/types.
+     */
+    public @Nullable ClassResolver classResolver;
 
     /**
      * State information for each element.
@@ -293,6 +297,35 @@
     }
 
     /**
+     * On top of {@link JAXBContextImpl#selectRootLoader(State, TagName)},
+     * this method also consults {@link ClassResolver}.
+     *
+     * @throws SAXException
+     *      if {@link ValidationEventHandler} reported a failure.
+     */
+    public Loader selectRootLoader(State state, TagName tag) throws SAXException {
+        try {
+            Loader l = getJAXBContext().selectRootLoader(state, tag);
+            if(l!=null)     return l;
+
+            if(classResolver!=null) {
+                Class<?> clazz = classResolver.resolveElementName(tag.uri, tag.local);
+                if(clazz!=null) {
+                    JAXBContextImpl enhanced = getJAXBContext().createAugmented(clazz);
+                    JaxBeanInfo<?> bi = enhanced.getBeanInfo(clazz);
+                    return bi.getLoader(enhanced,true);
+                }
+            }
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            handleError(e);
+        }
+
+        return null;
+    }
+
+    /**
      * Allocates a few more {@link State}s.
      *
      * Allocating multiple {@link State}s at once allows those objects
@@ -343,7 +376,8 @@
     }
 
     public void startDocument(LocatorEx locator, NamespaceContext nsContext) throws SAXException {
-        this.locator = locator;
+        if(locator!=null)
+            this.locator = locator;
         this.environmentNamespaceContext = nsContext;
         // reset the object
         result = null;
@@ -354,8 +388,6 @@
         isUnmarshalInProgress = true;
         nsLen=0;
 
-        startPrefixMapping("",""); // by default, the default ns is bound to "".
-
         setThreadAffinity();
 
         if(expectedType!=null)
@@ -596,11 +628,11 @@
     /**
      * Called when there's no corresponding ID value.
      */
-    public void errorUnresolvedIDREF(Object bean, String idref) throws SAXException {
+    public void errorUnresolvedIDREF(Object bean, String idref, LocatorEx loc) throws SAXException {
         handleEvent( new ValidationEventImpl(
             ValidationEvent.ERROR,
             Messages.UNRESOLVED_IDREF.format(idref),
-            new ValidationEventLocatorImpl(bean)), true );
+            loc.getLocation()), true );
     }
 
 
@@ -728,6 +760,12 @@
             // temporary workaround until Zephyr fixes 6337180
             return environmentNamespaceContext.getNamespaceURI(prefix.intern());
 
+        // by default, the default ns is bound to "".
+        // but allow environmentNamespaceContext to take precedence
+        if(prefix.equals(""))
+            return "";
+
+        // unresolved. error.
         return null;
     }
 
@@ -750,7 +788,7 @@
      *      is represented by the empty string.
      */
     public String[] getAllDeclaredPrefixes() {
-        return getPrefixList( 2 );  // skip the default ""->"" mapping
+        return getPrefixList(0);
     }
 
     private String[] getPrefixList( int startIndex ) {
@@ -885,10 +923,15 @@
      */
     public void endScope(int frameSize) throws SAXException {
         try {
-            for( ; frameSize>0; frameSize-- )
-                scopes[scopeTop--].finish();
+            for( ; frameSize>0; frameSize--, scopeTop-- )
+                scopes[scopeTop].finish();
         } catch (AccessorException e) {
             handleError(e);
+
+            // the error might have left scopes in inconsistent state,
+            // so replace them by fresh ones
+            for( ; frameSize>0; frameSize-- )
+                scopes[scopeTop--] = new Scope(this);
         }
     }
 
@@ -928,9 +971,7 @@
          * unmarshalling.
          */
         public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
-            JAXBContextImpl jaxbContext = state.getContext().getJAXBContext();
-
-            Loader loader = jaxbContext.selectRootLoader(state,ea);
+            Loader loader = state.getContext().selectRootLoader(state,ea);
             if(loader!=null) {
                 state.loader = loader;
                 state.receiver = this;
@@ -939,7 +980,7 @@
 
             // the registry doesn't know about this element.
             // try its xsi:type
-            JaxBeanInfo beanInfo = XsiTypeLoader.parseXsiType(state, ea);
+            JaxBeanInfo beanInfo = XsiTypeLoader.parseXsiType(state, ea, null);
             if(beanInfo==null) {
                 // we don't even know its xsi:type
                 reportUnexpectedChildElement(ea,false);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java
index dac6bd4..5109afa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.namespace.NamespaceContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java
index ba8ad3f..fdc871a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java
index 53340fc..2b49b88 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
  * have any questions.
  */
 
+/*
+ * @(#)$Id: WildcardLoader.java,v 1.3.6.1 2006/08/23 17:24:39 kohsuke Exp $
+ */
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.bind.annotation.DomHandler;
@@ -53,11 +56,11 @@
         this.mode = mode;
     }
 
-    protected Loader selectLoader(UnmarshallingContext.State state, TagName ea) {
+    protected Loader selectLoader(UnmarshallingContext.State state, TagName tag) throws SAXException {
         UnmarshallingContext context = state.getContext();
 
         if(mode.allowTypedObject) {
-            Loader l = context.getJAXBContext().selectRootLoader(state,ea);
+            Loader l = context.selectRootLoader(state,tag);
             if(l!=null)
                 return l;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java
index 73b8a6d..7e4078c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.namespace.NamespaceContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java
index 9285e56..740eaa6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
index 0a3dd39..f3d8cdb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
 
 import javax.xml.namespace.QName;
@@ -30,6 +29,7 @@
 import com.sun.xml.internal.bind.DatatypeConverterImpl;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
 import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
+import com.sun.istack.internal.Nullable;
 
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -52,7 +52,7 @@
     }
 
     public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
-        JaxBeanInfo beanInfo = parseXsiType(state, ea);
+        JaxBeanInfo beanInfo = parseXsiType(state,ea,defaultBeanInfo);
         if(beanInfo==null)
             beanInfo = defaultBeanInfo;
 
@@ -61,7 +61,7 @@
         loader.startElement(state,ea);
     }
 
-    /*pacakge*/ static JaxBeanInfo parseXsiType(UnmarshallingContext.State state, TagName ea) throws SAXException {
+    /*pacakge*/ static JaxBeanInfo parseXsiType(UnmarshallingContext.State state, TagName ea, @Nullable JaxBeanInfo defaultBeanInfo) throws SAXException {
         UnmarshallingContext context = state.getContext();
         JaxBeanInfo beanInfo = null;
 
@@ -78,6 +78,15 @@
             if(type==null) {
                 reportError(Messages.NOT_A_QNAME.format(value),true);
             } else {
+                if(defaultBeanInfo!=null && defaultBeanInfo.getTypeNames().contains(type))
+                    // if this xsi:type is something that the default type can already handle,
+                    // let it do so. This is added as a work around to bug https://jax-ws.dev.java.net/issues/show_bug.cgi?id=195
+                    // where a redundant xsi:type="xs:dateTime" causes JAXB to unmarshal XMLGregorianCalendar,
+                    // where Date is expected.
+                    // this is not a complete fix, as we still won't be able to handle simple type substitution in general,
+                    // but none-the-less
+                    return defaultBeanInfo;
+
                 beanInfo = context.getJAXBContext().getGlobalType(type);
                 if(beanInfo==null) {
                     String nearest = context.getJAXBContext().getNearestTypeName(type);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java
index 75c9b2d..8d6ba01 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.schemagen;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java
index dfb45b4..1477210 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.schemagen;
 
 import javax.xml.bind.annotation.XmlNsForm;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/GroupKind.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/GroupKind.java
new file mode 100644
index 0000000..6b2dee0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/GroupKind.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen;
+
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Particle;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.ContentModelContainer;
+
+/**
+ * Enum for model group type.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+enum GroupKind {
+    ALL("all"), SEQUENCE("sequence"), CHOICE("choice");
+
+    private final String name;
+
+    GroupKind(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Writes the model group.
+     */
+    Particle write(ContentModelContainer parent) {
+        return parent._element(name,Particle.class);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.java
new file mode 100644
index 0000000..2743e2c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen;
+
+import java.util.ResourceBundle;
+import java.text.MessageFormat;
+
+/**
+ * Message resources
+ */
+enum Messages {
+    ANONYMOUS_TYPE_CYCLE // 1 arg
+    ;
+
+    private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
+
+    public String toString() {
+        return format();
+    }
+
+    public String format( Object... args ) {
+        return MessageFormat.format( rb.getString(name()), args );
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.properties
new file mode 100644
index 0000000..28d7d71
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.properties
@@ -0,0 +1,27 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+ANONYMOUS_TYPE_CYCLE=Anonymous types form an infinite cycle: {0}
+ 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java
index 9e41737..6c8c842 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.schemagen;
 
 import java.util.TreeMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Tree.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Tree.java
new file mode 100644
index 0000000..c3b0419
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Tree.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.ContentModelContainer;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Particle;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.TypeDefParticle;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Occurs;
+
+/**
+ * Normalized representation of the content model.
+ *
+ * <p>
+ * This is built from bottom up so that we can eliminate redundant constructs,
+ * and produce the most concise content model definition in XML.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class Tree {
+
+    /**
+     * Returns "T?" from "T".
+     *
+     * @param really
+     *      if false this method becomes no-op. This is so that we can write
+     *      the caller fluently.
+     */
+    Tree makeOptional(boolean really) {
+        return really?new Optional(this) :this;
+    }
+
+    /**
+     * Returns "T+" from "T".
+     *
+     * @param really
+     *      if false this method becomes no-op. This is so that we can write
+     *      the caller fluently.
+     */
+    Tree makeRepeated(boolean really) {
+        return really?new Repeated(this) :this;
+    }
+
+    /**
+     * Returns a group tree.
+     */
+    static Tree makeGroup(GroupKind kind, List<Tree> children ) {
+        // pointless binary operator.
+        if(children.size()==1)
+            return children.get(0);
+
+        // we neither have epsilon or emptySet, so can't handle children.length==0 nicely
+
+        // eliminated nesting groups of the same kind.
+        // this is where binary tree would have shined.
+        List<Tree> normalizedChildren = new ArrayList<Tree>(children.size());
+        for (Tree t : children) {
+            if (t instanceof Group) {
+                Group g = (Group) t;
+                if(g.kind==kind) {
+                    normalizedChildren.addAll(Arrays.asList(g.children));
+                    continue;
+                }
+            }
+            normalizedChildren.add(t);
+        }
+
+        return new Group(kind,normalizedChildren.toArray(new Tree[normalizedChildren.size()]));
+    }
+
+    /**
+     * Returns true if this tree accepts empty sequence.
+     */
+    abstract boolean isNullable();
+
+    /**
+     * Returns true if the top node of this tree can
+     * appear as a valid top-level content model in XML Schema.
+     *
+     * <p>
+     * Model groups and occurrences that have model group in it can.
+     */
+    boolean canBeTopLevel() { return false; }
+
+    /**
+     * Writes out the content model.
+     *
+     * Normall this runs recursively until we write out the whole content model.
+     */
+    protected abstract void write(ContentModelContainer parent, boolean isOptional, boolean repeated);
+
+    /**
+     * Writes inside the given complex type.
+     */
+    protected void write(TypeDefParticle ct) {
+        if(canBeTopLevel())
+            write(ct._cast(ContentModelContainer.class), false, false);
+        else
+            // need a dummy wrapper
+            new Group(GroupKind.SEQUENCE,this).write(ct);
+    }
+
+    /**
+     * Convenience method to write occurrence constraints.
+     */
+    protected final void writeOccurs(Occurs o, boolean isOptional, boolean repeated) {
+        if(isOptional)
+            o.minOccurs(0);
+        if(repeated)
+            o.maxOccurs("unbounded");
+    }
+
+    /**
+     * Represents a terminal tree node, such as element, wildcard, etc.
+     */
+    abstract static class Term extends Tree {
+        boolean isNullable() {
+            return false;
+        }
+    }
+
+    /**
+     * "T?"
+     */
+    private static final class Optional extends Tree {
+        private final Tree body;
+
+        private Optional(Tree body) {
+            this.body = body;
+        }
+
+        @Override
+        boolean isNullable() {
+            return true;
+        }
+
+        @Override
+        Tree makeOptional(boolean really) {
+            return this;
+        }
+
+        @Override
+        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+            body.write(parent,true,repeated);
+        }
+    }
+
+    /**
+     * "T+"
+     */
+    private static final class Repeated extends Tree {
+        private final Tree body;
+
+        private Repeated(Tree body) {
+            this.body = body;
+        }
+
+        @Override
+        boolean isNullable() {
+            return body.isNullable();
+        }
+
+        @Override
+        Tree makeRepeated(boolean really) {
+            return this;
+        }
+
+        @Override
+        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+            body.write(parent,isOptional,true);
+        }
+    }
+
+    /**
+     * "S|T", "S,T", and "S&amp;T".
+     */
+    private static final class Group extends Tree {
+        private final GroupKind kind;
+        private final Tree[] children;
+
+        private Group(GroupKind kind, Tree... children) {
+            this.kind = kind;
+            this.children = children;
+        }
+
+        @Override
+        boolean canBeTopLevel() {
+            return true;
+        }
+
+        @Override
+        boolean isNullable() {
+            if(kind== GroupKind.CHOICE) {
+                for (Tree t : children) {
+                    if(t.isNullable())
+                        return true;
+                }
+                return false;
+            } else {
+                for (Tree t : children) {
+                    if(!t.isNullable())
+                        return false;
+                }
+                return true;
+            }
+        }
+
+        @Override
+        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+            Particle c = kind.write(parent);
+            writeOccurs(c,isOptional,repeated);
+
+            for (Tree child : children) {
+                child.write(c,false,false);
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java
index 9a13e35..dd4c683 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.schemagen;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java
index 1baa833..2676fc6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.schemagen;
 
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Comparator;
@@ -36,6 +36,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+import java.util.ArrayList;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -46,10 +47,13 @@
 import javax.xml.transform.stream.StreamResult;
 
 import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
 import com.sun.xml.internal.bind.Util;
 import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.ErrorListener;
 import com.sun.xml.internal.bind.v2.TODO;
 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+import com.sun.xml.internal.bind.v2.util.CollisionCheckStack;
 import static com.sun.xml.internal.bind.v2.WellKnownNamespace.XML_SCHEMA;
 import com.sun.xml.internal.bind.v2.model.core.Adapter;
 import com.sun.xml.internal.bind.v2.model.core.ArrayInfo;
@@ -83,7 +87,6 @@
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalAttribute;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalElement;
-import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Occurs;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Schema;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.SimpleExtension;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.SimpleRestrictionModel;
@@ -92,10 +95,17 @@
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.TopLevelAttribute;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.TopLevelElement;
 import com.sun.xml.internal.bind.v2.schemagen.xmlschema.TypeHost;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.ContentModelContainer;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.TypeDefParticle;
+import com.sun.xml.internal.bind.v2.schemagen.xmlschema.AttributeType;
+import com.sun.xml.internal.bind.v2.schemagen.episode.Bindings;
 import com.sun.xml.internal.txw2.TXW;
 import com.sun.xml.internal.txw2.TxwException;
 import com.sun.xml.internal.txw2.TypedXmlWriter;
 import com.sun.xml.internal.txw2.output.ResultFactory;
+import com.sun.xml.internal.txw2.output.XmlSerializer;
+
+import org.xml.sax.SAXParseException;
 
 /**
  * Generates a set of W3C XML Schema documents from a set of Java classes.
@@ -127,6 +137,11 @@
      */
     private final Map<String,Namespace> namespaces = new TreeMap<String,Namespace>(NAMESPACE_COMPARATOR);
 
+    /**
+     * {@link ErrorListener} to send errors to.
+     */
+    private ErrorListener errorListener;
+
     /** model navigator **/
     private Navigator<T,C,F,M> navigator;
 
@@ -142,6 +157,11 @@
      */
     private final NonElement<T,C> anyType;
 
+    /**
+     * Used to detect cycles in anonymous types.
+     */
+    private final CollisionCheckStack<ClassInfo<T,C>> collisionChecker = new CollisionCheckStack<ClassInfo<T,C>>();
+
     public XmlSchemaGenerator( Navigator<T,C,F,M> navigator, TypeInfoSet<T,C,F,M> types ) {
         this.navigator = navigator;
         this.types = types;
@@ -228,12 +248,17 @@
                     }
                 }
             }
+
+            if(generateSwaRefAdapter(p))
+                n.useSwaRef = true;
         }
 
         // recurse on baseTypes to make sure that we can refer to them in the schema
         ClassInfo<T,C> bc = clazz.getBaseClass();
-        if (bc != null)
+        if (bc != null) {
             add(bc);
+            n.addDependencyTo(bc.getTypeName());
+        }
     }
 
     /**
@@ -316,16 +341,77 @@
     }
 
     /**
+     * Writes out the episode file.
+     */
+    public void writeEpisodeFile(XmlSerializer out) {
+        Bindings root = TXW.create(Bindings.class, out);
+
+        if(namespaces.containsKey("")) // otherwise jaxb binding NS should be the default namespace
+            root._namespace(WellKnownNamespace.JAXB,"jaxb");
+        root.version("2.1");
+        // TODO: don't we want to bake in versions?
+
+        // generate listing per schema
+        for (Map.Entry<String,Namespace> e : namespaces.entrySet()) {
+            Bindings group = root.bindings();
+
+            String prefix;
+            String tns = e.getKey();
+            if(!tns.equals("")) {
+                group._namespace(tns,"tns");
+                prefix = "tns:";
+            } else {
+                prefix = "";
+            }
+
+            group.scd("x-schema::"+(tns.equals("")?"":"tns"));
+            group.schemaBindings().map(false);
+
+            for (ClassInfo<T,C> ci : e.getValue().classes) {
+                if(ci.getTypeName()==null)  continue;   // local type
+
+                if(ci.getTypeName().getNamespaceURI().equals(tns)) {
+                    Bindings child = group.bindings();
+                    child.scd('~'+prefix+ci.getTypeName().getLocalPart());
+                    child.klass().ref(ci.getName());
+                }
+
+                if(ci.isElement() && ci.getElementName().getNamespaceURI().equals(tns)) {
+                    Bindings child = group.bindings();
+                    child.scd(prefix+ci.getElementName().getLocalPart());
+                    child.klass().ref(ci.getName());
+                }
+            }
+
+            for (EnumLeafInfo<T,C> en : e.getValue().enums) {
+                if(en.getTypeName()==null)  continue;   // local type
+
+                Bindings child = group.bindings();
+                child.scd('~'+prefix+en.getTypeName().getLocalPart());
+                child.klass().ref(navigator.getClassName(en.getClazz()));
+            }
+
+            group.commit(true);
+        }
+
+        root.commit();
+    }
+
+    /**
      * Write out the schema documents.
      */
-    public void write(SchemaOutputResolver resolver) throws IOException {
+    public void write(SchemaOutputResolver resolver, ErrorListener errorListener) throws IOException {
         if(resolver==null)
             throw new IllegalArgumentException();
 
         // make it fool-proof
         resolver = new FoolProofResolver(resolver);
+        this.errorListener = errorListener;
+
+        Map<String, String> schemaLocations = types.getSchemaLocations();
 
         Map<Namespace,Result> out = new HashMap<Namespace,Result>();
+        Map<Namespace,String> systemIds = new HashMap<Namespace,String>();
 
         // we create a Namespace object for the XML Schema namespace
         // as a side-effect, but we don't want to generate it.
@@ -334,25 +420,29 @@
         // first create the outputs for all so that we can resolve references among
         // schema files when we write
         for( Namespace n : namespaces.values() ) {
-            final Result output = resolver.createOutput(n.uri,"schema"+(out.size()+1)+".xsd");
-            if(output!=null) {  // null result means no schema for that namespace
-                out.put(n,output);
+            String schemaLocation = schemaLocations.get(n.uri);
+            if(schemaLocation!=null) {
+                systemIds.put(n,schemaLocation);
+            } else {
+                Result output = resolver.createOutput(n.uri,"schema"+(out.size()+1)+".xsd");
+                if(output!=null) {  // null result means no schema for that namespace
+                    out.put(n,output);
+                    systemIds.put(n,output.getSystemId());
+                }
             }
         }
 
         // then write'em all
-        for( Namespace n : namespaces.values() ) {
-            Result result = out.get(n);
-            if(result!=null) {
-                n.writeTo( result, out );
-                if(result instanceof StreamResult) {
-                    OutputStream outputStream = ((StreamResult)result).getOutputStream();
-                    if(outputStream != null) {
-                        outputStream.close(); // fix for bugid: 6291301
-                    } else {
-                        final Writer writer = ((StreamResult)result).getWriter();
-                        if(writer != null) writer.close();
-                    }
+        for( Map.Entry<Namespace,Result> e : out.entrySet() ) {
+            Result result = e.getValue();
+            e.getKey().writeTo( result, systemIds );
+            if(result instanceof StreamResult) {
+                OutputStream outputStream = ((StreamResult)result).getOutputStream();
+                if(outputStream != null) {
+                    outputStream.close(); // fix for bugid: 6291301
+                } else {
+                    final Writer writer = ((StreamResult)result).getWriter();
+                    if(writer != null) writer.close();
                 }
             }
         }
@@ -364,7 +454,7 @@
      * Schema components are organized per namespace.
      */
     private class Namespace {
-        final String uri;
+        final @NotNull String uri;
 
         /**
          * Other {@link Namespace}s that this namespace depends on.
@@ -394,7 +484,7 @@
         /**
          * Global attribute declarations keyed by their local names.
          */
-        private final MultiMap<String,NonElement<T,C>> attributeDecls = new MultiMap<String,NonElement<T,C>>(stringType);
+        private final MultiMap<String,AttributePropertyInfo<T,C>> attributeDecls = new MultiMap<String,AttributePropertyInfo<T,C>>(null);
 
         /**
          * Global element declarations to be written, keyed by their local names.
@@ -405,6 +495,12 @@
         private Form attributeFormDefault;
         private Form elementFormDefault;
 
+        /**
+         * Does schema in this namespace uses swaRef? If so, we need to generate import
+         * statement.
+         */
+        private boolean useSwaRef;
+
         public Namespace(String uri) {
             this.uri = uri;
             assert !XmlSchemaGenerator.this.namespaces.containsKey(uri);
@@ -455,8 +551,11 @@
 
         /**
          * Writes the schema document to the specified result.
+         *
+         * @param systemIds
+         *      System IDs of the other schema documents. "" indicates 'implied'.
          */
-        private void writeTo(Result result, Map<Namespace,Result> out) throws IOException {
+        private void writeTo(Result result, Map<Namespace,String> systemIds) throws IOException {
             try {
                 Schema schema = TXW.create(Schema.class,ResultFactory.createSerializer(result));
 
@@ -467,6 +566,9 @@
                     schema._namespace(e.getValue(),e.getKey());
                 }
 
+                if(useSwaRef)
+                    schema._namespace(WellKnownNamespace.SWA_URI,"swaRef");
+
                 attributeFormDefault = Form.get(types.getAttributeFormDefault(uri));
                 attributeFormDefault.declare("attributeFormDefault",schema);
 
@@ -504,9 +606,16 @@
                     Import imp = schema._import();
                     if(n.uri.length()!=0)
                         imp.namespace(n.uri);
-                    imp.schemaLocation(relativize(out.get(n).getSystemId(),result.getSystemId()));
+                    String refSystemId = systemIds.get(n);
+                    if(refSystemId!=null && !refSystemId.equals("")) {
+                        // "" means implied. null if the SchemaOutputResolver said "don't generate!"
+                        imp.schemaLocation(relativize(refSystemId,result.getSystemId()));
+                    }
                     schema._pcdata(newline);
                 }
+                if(useSwaRef) {
+                    schema._import().namespace(WellKnownNamespace.SWA_URI).schemaLocation("http://ws-i.org/profiles/basic/1.1/swaref.xsd");
+                }
 
                 // then write each component
                 for (Map.Entry<String,ElementDeclaration> e : elementDecls.entrySet()) {
@@ -535,10 +644,13 @@
                     writeArray(a,schema);
                     schema._pcdata(newline);
                 }
-                for (Map.Entry<String,NonElement<T,C>> e : attributeDecls.entrySet()) {
+                for (Map.Entry<String,AttributePropertyInfo<T,C>> e : attributeDecls.entrySet()) {
                     TopLevelAttribute a = schema.attribute();
                     a.name(e.getKey());
-                    writeTypeRef(a,e.getValue(),"type");
+                    if(e.getValue()==null)
+                        writeTypeRef(a,stringType,"type");
+                    else
+                        writeAttributeTypeRef(e.getValue(),a);
                     schema._pcdata(newline);
                 }
 
@@ -601,18 +713,6 @@
         }
 
         /**
-         * Examine the specified element ref and determine if a swaRef attribute needs to be generated
-         * @param typeRef
-         */
-        private boolean generateSwaRefAdapter(NonElementRef<T,C> typeRef) {
-            final Adapter<T,C> adapter = typeRef.getSource().getAdapter();
-            if (adapter == null) return false;
-            final Object o = navigator.asDecl(SwaRefAdapter.class);
-            if (o == null) return false;
-            return (o.equals(adapter.adapterType));
-        }
-
-        /**
          * Writes a type attribute (if the referenced type is a global type)
          * or writes out the definition of the anonymous type in place (if the referenced
          * type is not a global type.)
@@ -626,8 +726,18 @@
          */
         private void writeTypeRef(TypeHost th, NonElement<T,C> type, String refAttName) {
             if(type.getTypeName()==null) {
+                // anonymous
+                th.block(); // so that the caller may write other attribuets
                 if(type instanceof ClassInfo) {
-                    writeClass( (ClassInfo<T,C>)type, th );
+                    if(collisionChecker.push((ClassInfo<T,C>)type)) {
+                        errorListener.error(new SAXParseException(
+                            Messages.ANONYMOUS_TYPE_CYCLE.format(collisionChecker.getCycleString()),
+                            null
+                        ));
+                    } else {
+                        writeClass( (ClassInfo<T,C>)type, th );
+                    }
+                    collisionChecker.pop();
                 } else {
                     writeEnum( (EnumLeafInfo<T,C>)type, (SimpleTypeHost)th);
                 }
@@ -746,64 +856,57 @@
             if(c.isAbstract())
                 ct._abstract(true);
 
-            // hold the ct open in case we need to generate @mixed below...
-            ct.block();
-
-            // either <sequence> or <all>
-            ExplicitGroup compositor = null;
-
-            // only necessary if this type has a base class we need to extend from
+            // these are where we write content model and attributes
             AttrDecls contentModel = ct;
+            TypeDefParticle contentModelOwner = ct;
 
             // if there is a base class, we need to generate an extension in the schema
             final ClassInfo<T,C> bc = c.getBaseClass();
             if (bc != null) {
-                ComplexExtension ce = ct.complexContent().extension();
-                contentModel = ce;
-
-                ce.base(bc.getTypeName());
-                // TODO: what if the base type is anonymous?
-                // ordered props go in a sequence, unordered go in an all
-                if( c.isOrdered() ) {
-                    compositor = ce.sequence();
+                if(bc.hasValueProperty()) {
+                    // extending complex type with simple content
+                    SimpleExtension se = ct.simpleContent().extension();
+                    contentModel = se;
+                    contentModelOwner = null;
+                    se.base(bc.getTypeName());
                 } else {
-                    compositor = ce.all();
+                    ComplexExtension ce = ct.complexContent().extension();
+                    contentModel = ce;
+                    contentModelOwner = ce;
+
+                    ce.base(bc.getTypeName());
+                    // TODO: what if the base type is anonymous?
                 }
             }
 
-            // iterate over the properties
-            if (c.hasProperties()) {
-                if( compositor == null ) { // if there is no extension base, create a top level seq
-                    // ordered props go in a sequence, unordered go in an all
-                    if( c.isOrdered() ) {
-                        compositor = ct.sequence();
-                    } else {
-                        compositor = ct.all();
-                    }
-                }
-
-                // block writing the compositor because we might need to
-                // write some out of order attributes to handle min/maxOccurs
-                compositor.block();
-
+            if(contentModelOwner!=null) {
+                // build the tree that represents the explicit content model from iterate over the properties
+                ArrayList<Tree> children = new ArrayList<Tree>();
                 for (PropertyInfo<T,C> p : c.getProperties()) {
                     // handling for <complexType @mixed='true' ...>
                     if(p instanceof ReferencePropertyInfo && ((ReferencePropertyInfo)p).isMixed()) {
                         ct.mixed(true);
                     }
-                    writeProperty(p, contentModel, compositor);
+                    Tree t = buildPropertyContentModel(p);
+                    if(t!=null)
+                        children.add(t);
                 }
 
-                compositor.commit();
+                Tree top = Tree.makeGroup( c.isOrdered() ? GroupKind.SEQUENCE : GroupKind.ALL, children);
+
+                // write the content model
+                top.write(contentModelOwner);
             }
 
-            // look for wildcard attributes
+            // then attributes
+            for (PropertyInfo<T,C> p : c.getProperties()) {
+                if (p instanceof AttributePropertyInfo) {
+                    handleAttributeProp((AttributePropertyInfo<T,C>)p, contentModel);
+                }
+            }
             if( c.hasAttributeWildcard()) {
-                // TODO: not type safe
                 contentModel.anyAttribute().namespace("##other").processContents("skip");
             }
-
-            // finally commit the ct
             ct.commit();
         }
 
@@ -824,27 +927,23 @@
         }
 
         /**
-         * write the schema definition(s) for the specified property
+         * Builds content model writer for the specified property.
          */
-        private void writeProperty(PropertyInfo<T,C> p, AttrDecls attr, ExplicitGroup compositor) {
+        private Tree buildPropertyContentModel(PropertyInfo<T,C> p) {
             switch(p.kind()) {
             case ELEMENT:
-                handleElementProp((ElementPropertyInfo<T,C>)p, compositor);
-                break;
+                return handleElementProp((ElementPropertyInfo<T,C>)p);
             case ATTRIBUTE:
-                handleAttributeProp((AttributePropertyInfo<T,C>)p, attr);
-                break;
+                // attribuets are handled later
+                return null;
             case REFERENCE:
-                handleReferenceProp((ReferencePropertyInfo<T,C>)p, compositor);
-                break;
+                return handleReferenceProp((ReferencePropertyInfo<T,C>)p);
             case MAP:
-                handleMapProp((MapPropertyInfo<T,C>)p, compositor);
-                break;
+                return handleMapProp((MapPropertyInfo<T,C>)p);
             case VALUE:
                 // value props handled above in writeClass()
                 assert false;
                 throw new IllegalStateException();
-                // break();
             default:
                 assert false;
                 throw new IllegalStateException();
@@ -859,91 +958,83 @@
          * not be wrapped.
          *
          * @param ep the element property
-         * @param compositor the schema compositor (sequence or all)
          */
-        private void handleElementProp(ElementPropertyInfo<T,C> ep, ExplicitGroup compositor) {
-            QName ename = ep.getXmlName();
-            Occurs occurs = null;
-
+        private Tree handleElementProp(final ElementPropertyInfo<T,C> ep) {
             if (ep.isValueList()) {
-                TypeRef<T,C> t = ep.getTypes().get(0);
-                LocalElement e = compositor.element();
-
-                QName tn = t.getTagName();
-                e.name(tn.getLocalPart());
-                List lst = e.simpleType().list();
-                writeTypeRef(lst,t, "itemType");
-                elementFormDefault.writeForm(e,tn);
-                return;
+                return new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        TypeRef<T,C> t = ep.getTypes().get(0);
+                        LocalElement e = parent.element();
+                        e.block(); // we will write occurs later
+                        QName tn = t.getTagName();
+                        e.name(tn.getLocalPart());
+                        List lst = e.simpleType().list();
+                        writeTypeRef(lst,t, "itemType");
+                        elementFormDefault.writeForm(e,tn);
+                        writeOccurs(e,isOptional||!ep.isRequired(),repeated);
+                    }
+                };
             }
 
-            if (ep.isCollection()) {
-                if (ename != null) { // wrapped collection
-                    LocalElement e = compositor.element();
-                    if(ename.getNamespaceURI().length()>0) {
-                        if (!ename.getNamespaceURI().equals(this.uri)) {
-                            // TODO: we need to generate the corresponding element declaration for this
-                            // table 8-25: Property/field element wrapper with ref attribute
-                            e.ref(new QName(ename.getNamespaceURI(), ename.getLocalPart()));
-                            return;
+            ArrayList<Tree> children = new ArrayList<Tree>();
+            for (final TypeRef<T,C> t : ep.getTypes()) {
+                children.add(new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        LocalElement e = parent.element();
+
+                        QName tn = t.getTagName();
+
+                        if(canBeDirectElementRef(t,tn) || (!tn.getNamespaceURI().equals(uri) && tn.getNamespaceURI().length()>0)) {
+                            e.ref(tn);
+                        } else {
+                            e.name(tn.getLocalPart());
+                            writeTypeRef(e,t, "type");
+                            elementFormDefault.writeForm(e,tn);
                         }
-                    }
-                    elementFormDefault.writeForm(e,ename);
 
-                    ComplexType p = e.name(ename.getLocalPart()).complexType();
-                    if(ep.isCollectionNillable()) {
-                        e.nillable(true);
-                    } else {
-                        e.minOccurs(0);
+                        if (t.isNillable()) {
+                            e.nillable(true);
+                        }
+                        if(t.getDefaultValue()!=null)
+                            e._default(t.getDefaultValue());
+                        writeOccurs(e,isOptional,repeated);
                     }
-                    if (ep.getTypes().size() == 1) {
-                        compositor = p.sequence();
-                    } else {
-                        compositor = p.choice();
-                        occurs = compositor;
-                    }
-                } else { // unwrapped collection
-                    if (ep.getTypes().size() > 1) {
-                        compositor = compositor.choice();
-                        occurs = compositor;
-                    }
-                }
-            } else {
-                if (ep.getTypes().size() > 1) {
-                    compositor = compositor.choice();
-                    occurs = compositor;
-                }
+                });
             }
 
+            final Tree choice = Tree.makeGroup(GroupKind.CHOICE, children)
+                    .makeOptional(!ep.isRequired())
+                    .makeRepeated(ep.isCollection()); // see Spec table 8-13
 
-            // fill in the content model
-            for (TypeRef<T,C> t : ep.getTypes()) {
-                LocalElement e = compositor.element();
-                if (occurs == null) occurs = e;
-                QName tn = t.getTagName();
 
-                if(canBeDirectElementRef(t,tn) || (!tn.getNamespaceURI().equals(uri) && tn.getNamespaceURI().length()>0)) {
-                    e.ref(tn);
-                } else {
-                    e.name(tn.getLocalPart());
-                    writeTypeRef(e,t, "type");
-                    elementFormDefault.writeForm(e,tn);
-                }
+            final QName ename = ep.getXmlName();
+            if (ename != null) { // wrapped collection
+                return new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        LocalElement e = parent.element();
+                        if(ename.getNamespaceURI().length()>0) {
+                            if (!ename.getNamespaceURI().equals(uri)) {
+                                // TODO: we need to generate the corresponding element declaration for this
+                                // table 8-25: Property/field element wrapper with ref attribute
+                                e.ref(new QName(ename.getNamespaceURI(), ename.getLocalPart()));
+                                return;
+                            }
+                        }
+                        e.name(ename.getLocalPart());
+                        elementFormDefault.writeForm(e,ename);
 
-                if (t.isNillable()) {
-                    e.nillable(true);
-                }
-                if(t.getDefaultValue()!=null)
-                    e._default(t.getDefaultValue());
+                        if(ep.isCollectionNillable()) {
+                            e.nillable(true);
+                        }
+                        writeOccurs(e,true,repeated);
+
+                        ComplexType p = e.complexType();
+                        choice.write(p);
+                    }
+                };
+            } else {// non-wrapped
+                return choice;
             }
-
-            if (ep.isCollection())
-                occurs.maxOccurs("unbounded");
-
-            if (!ep.isRequired())
-                // see Spec table 8-13
-                occurs.minOccurs(0);
-            // else minOccurs defaults to 1
         }
 
         /**
@@ -999,18 +1090,10 @@
             LocalAttribute localAttribute = attr.attribute();
 
             final String attrURI = ap.getXmlName().getNamespaceURI();
-            if (attrURI.equals("") || attrURI.equals(uri)) {
+            if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) {
                 localAttribute.name(ap.getXmlName().getLocalPart());
 
-                TypeHost th; String refAtt;
-                if( ap.isCollection() ) {
-                    th = localAttribute.simpleType().list();
-                    refAtt = "itemType";
-                } else {
-                    th = localAttribute;
-                    refAtt = "type";
-                }
-                writeTypeRef(th, ap, refAtt);
+                writeAttributeTypeRef(ap, localAttribute);
 
                 attributeFormDefault.writeForm(localAttribute,ap.getXmlName());
             } else { // generate an attr ref
@@ -1023,90 +1106,103 @@
             }
         }
 
+        private void writeAttributeTypeRef(AttributePropertyInfo<T,C> ap, AttributeType a) {
+            if( ap.isCollection() )
+                writeTypeRef(a.simpleType().list(), ap, "itemType");
+            else
+                writeTypeRef(a, ap, "type");
+        }
+
         /**
          * Generate the proper schema fragment for the given reference property into the
          * specified schema compositor.
          *
          * The reference property may or may not refer to a collection and it may or may
          * not be wrapped.
-         *
-         * @param rp
-         * @param compositor
          */
-        private void handleReferenceProp(ReferencePropertyInfo<T,C> rp, ExplicitGroup compositor) {
-            QName ename = rp.getXmlName();
-            Occurs occurs = null;
-
-            if (rp.isCollection()) {
-                if (ename != null) { // wrapped collection
-                    LocalElement e = compositor.element();
-                    ComplexType p = e.name(ename.getLocalPart()).complexType();
-                    elementFormDefault.writeForm(e,ename);
-                    if(rp.isCollectionNillable())
-                        e.nillable(true);
-                    if (rp.getElements().size() == 1) {
-                        compositor = p.sequence();
-                    } else {
-                        compositor = p.choice();
-                        occurs = compositor;
-                    }
-                } else { // unwrapped collection
-                    if (rp.getElements().size() > 1) {
-                        compositor = compositor.choice();
-                        occurs = compositor;
-                    }
-                }
-            }
-
+        private Tree handleReferenceProp(final ReferencePropertyInfo<T, C> rp) {
             // fill in content model
-            TODO.checkSpec("should we loop in the case of a non-collection ep?");
-            for (Element<T,C> e : rp.getElements()) {
-                LocalElement eref = compositor.element();
-                if (occurs == null) occurs = eref;
+            ArrayList<Tree> children = new ArrayList<Tree>();
 
-                QName en = e.getElementName();
-                if(e.getScope()!=null) {
-                    // scoped. needs to be inlined
-                    boolean qualified = en.getNamespaceURI().equals(uri);
-                    boolean unqualified = en.getNamespaceURI().equals("");
-                    if(qualified || unqualified) {
-                        // can be inlined indeed
+            for (final Element<T,C> e : rp.getElements()) {
+                children.add(new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        LocalElement eref = parent.element();
 
-                        // write form="..." if necessary
-                        if(unqualified) {
-                            if(elementFormDefault.isEffectivelyQualified)
-                                eref.form("unqualified");
-                        } else {
-                            if(!elementFormDefault.isEffectivelyQualified)
-                                eref.form("qualified");
+                        boolean local=false;
+
+                        QName en = e.getElementName();
+                        if(e.getScope()!=null) {
+                            // scoped. needs to be inlined
+                            boolean qualified = en.getNamespaceURI().equals(uri);
+                            boolean unqualified = en.getNamespaceURI().equals("");
+                            if(qualified || unqualified) {
+                                // can be inlined indeed
+
+                                // write form="..." if necessary
+                                if(unqualified) {
+                                    if(elementFormDefault.isEffectivelyQualified)
+                                        eref.form("unqualified");
+                                } else {
+                                    if(!elementFormDefault.isEffectivelyQualified)
+                                        eref.form("qualified");
+                                }
+
+                                local = true;
+                                eref.name(en.getLocalPart());
+
+                                // write out type reference
+                                if(e instanceof ClassInfo) {
+                                    writeTypeRef(eref,(ClassInfo<T,C>)e,"type");
+                                } else {
+                                    writeTypeRef(eref,((ElementInfo<T,C>)e).getContentType(),"type");
+                                }
+                            }
                         }
-
-                        eref.name(en.getLocalPart());
-
-                        // write out type reference
-                        if(e instanceof ClassInfo) {
-                            writeTypeRef(eref,(ClassInfo<T,C>)e,"type");
-                        } else {
-                            writeTypeRef(eref,((ElementInfo<T,C>)e).getContentType(),"type");
-                        }
-                        continue;
+                        if(!local)
+                            eref.ref(en);
+                        writeOccurs(eref,isOptional,repeated);
                     }
-                }
-                eref.ref(en);
+                });
             }
 
-            WildcardMode wc = rp.getWildcard();
+            final WildcardMode wc = rp.getWildcard();
             if( wc != null ) {
-                Any any = compositor.any();
-                final String pcmode = getProcessContentsModeName(wc);
-                if( pcmode != null ) any.processContents(pcmode);
-                TODO.schemaGenerator("generate @namespace ???");
-                if( occurs == null ) occurs = any;
+                children.add(new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        Any any = parent.any();
+                        final String pcmode = getProcessContentsModeName(wc);
+                        if( pcmode != null ) any.processContents(pcmode);
+                        any.namespace("##other");
+                        writeOccurs(any,isOptional,repeated);
+                    }
+                });
             }
 
-            if(rp.isCollection())
-                occurs.maxOccurs("unbounded");
 
+            final Tree choice = Tree.makeGroup(GroupKind.CHOICE, children).makeRepeated(rp.isCollection()).makeOptional(rp.isCollection());
+            // it's a curious omission that XmlElementRef doesn't have required().
+            // instead right now a collection will make it [0,unbounded]
+
+
+            final QName ename = rp.getXmlName();
+
+            if (ename != null) { // wrapped
+                return new Tree.Term() {
+                    protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                        LocalElement e = parent.element().name(ename.getLocalPart());
+                        elementFormDefault.writeForm(e,ename);
+                        if(rp.isCollectionNillable())
+                            e.nillable(true);
+                        writeOccurs(e,true,repeated);
+
+                        ComplexType p = e.complexType();
+                        choice.write(p);
+                    }
+                };
+            } else { // unwrapped
+                return choice;
+            }
         }
 
         /**
@@ -1114,25 +1210,31 @@
          * specified schema compositor.
          *
          * @param mp the map property
-         * @param compositor the schema compositor (sequence or all)
          */
-        private void handleMapProp(MapPropertyInfo<T,C> mp, ExplicitGroup compositor) {
-            QName ename = mp.getXmlName();
+        private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
+            return new Tree.Term() {
+                protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
+                    QName ename = mp.getXmlName();
 
-            LocalElement e = compositor.element();
-            elementFormDefault.writeForm(e,ename);
-            if(mp.isCollectionNillable())
-                e.nillable(true);
-            ComplexType p = e.name(ename.getLocalPart()).complexType();
+                    LocalElement e = parent.element();
+                    elementFormDefault.writeForm(e,ename);
+                    if(mp.isCollectionNillable())
+                        e.nillable(true);
 
-            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
-            // TODO: we need to generate the corresponding element declaration, if they are qualified
-            e = p.sequence().element();
-            e.name("entry").minOccurs(0).maxOccurs("unbounded");
+                    e = e.name(ename.getLocalPart());
+                    writeOccurs(e,isOptional,repeated);
+                    ComplexType p = e.complexType();
 
-            ExplicitGroup seq = e.complexType().sequence();
-            writeKeyOrValue(seq, "key", mp.getKeyType());
-            writeKeyOrValue(seq, "value", mp.getValueType());
+                    // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
+                    // TODO: we need to generate the corresponding element declaration, if they are qualified
+                    e = p.sequence().element();
+                    e.name("entry").minOccurs(0).maxOccurs("unbounded");
+
+                    ExplicitGroup seq = e.complexType().sequence();
+                    writeKeyOrValue(seq, "key", mp.getKeyType());
+                    writeKeyOrValue(seq, "value", mp.getValueType());
+                }
+            };
         }
 
         private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
@@ -1142,7 +1244,7 @@
         }
 
         public void addGlobalAttribute(AttributePropertyInfo<T,C> ap) {
-            attributeDecls.put( ap.getXmlName().getLocalPart(), ap.getTarget() );
+            attributeDecls.put( ap.getXmlName().getLocalPart(), ap );
             addDependencyTo(ap.getTarget().getTypeName());
         }
 
@@ -1217,6 +1319,24 @@
         }
     }
 
+    /**
+     * Examine the specified element ref and determine if a swaRef attribute needs to be generated
+     * @param typeRef
+     */
+    private boolean generateSwaRefAdapter(NonElementRef<T,C> typeRef) {
+        return generateSwaRefAdapter(typeRef.getSource());
+    }
+
+    /**
+     * Examine the specified element ref and determine if a swaRef attribute needs to be generated
+     */
+    private boolean generateSwaRefAdapter(PropertyInfo<T,C> prop) {
+        final Adapter<T,C> adapter = prop.getAdapter();
+        if (adapter == null) return false;
+        final Object o = navigator.asDecl(SwaRefAdapter.class);
+        if (o == null) return false;
+        return (o.equals(adapter.adapterType));
+    }
 
     /**
      * return the string representation of the processContents mode of the
@@ -1281,7 +1401,7 @@
             if( uriPath.equals(basePath))
                 return ".";
 
-            String relPath = calculateRelativePath(uriPath, basePath);
+            String relPath = calculateRelativePath(uriPath, basePath, fixNull(theUri.getScheme()).equals("file"));
 
             if (relPath == null)
                 return uri; // recursion found no commonality in the two uris at all
@@ -1298,17 +1418,30 @@
         }
     }
 
-    private static String calculateRelativePath(String uri, String base) {
+    private static String fixNull(String s) {
+        if(s==null)     return "";
+        else            return s;
+    }
+
+    private static String calculateRelativePath(String uri, String base, boolean fileUrl) {
+        // if this is a file URL (very likely), and if this is on a case-insensitive file system,
+        // then treat it accordingly.
+        boolean onWindows = File.pathSeparatorChar==';';
+
         if (base == null) {
             return null;
         }
-        if (uri.startsWith(base)) {
+        if ((fileUrl && onWindows && startsWithIgnoreCase(uri,base)) || uri.startsWith(base)) {
             return uri.substring(base.length());
         } else {
-            return "../" + calculateRelativePath(uri, getParentUriPath(base));
+            return "../" + calculateRelativePath(uri, getParentUriPath(base), fileUrl);
         }
     }
 
+    private static boolean startsWithIgnoreCase(String s, String t) {
+        return s.toUpperCase().startsWith(t.toUpperCase());
+    }
+
     /**
      * JAX-RPC wants the namespaces to be sorted in the reverse order
      * so that the empty namespace "" comes to the very end. Don't ask me why.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Bindings.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Bindings.java
new file mode 100644
index 0000000..bf83391
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Bindings.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen.episode;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlElement;
+import com.sun.xml.internal.txw2.annotation.XmlAttribute;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+@XmlElement("bindings")
+public interface Bindings extends TypedXmlWriter {
+    /**
+     * Nested bindings.
+     */
+    @XmlElement
+    Bindings bindings();
+
+    /**
+     * Nested class customization.
+     */
+    @XmlElement("class")
+    Klass klass();
+
+    @XmlElement
+    SchemaBindings schemaBindings();
+
+    @XmlAttribute
+    void scd(String scd);
+
+    @XmlAttribute
+    void version(String v);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Klass.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Klass.java
new file mode 100644
index 0000000..fbdf2f9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Klass.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen.episode;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlAttribute;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public interface Klass extends TypedXmlWriter {
+    /**
+     * FQCN.
+     */
+    @XmlAttribute
+    void ref(String className);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/SchemaBindings.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/SchemaBindings.java
new file mode 100644
index 0000000..534ff75
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/SchemaBindings.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen.episode;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlAttribute;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public interface SchemaBindings extends TypedXmlWriter {
+    @XmlAttribute
+    void map(boolean value);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/package-info.java
new file mode 100644
index 0000000..4af20cd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/package-info.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/**
+ * TXW interfaces for writing episode file, which is what XJC needs to
+ * handle separate compilation.
+ */
+@XmlNamespace(WellKnownNamespace.JAXB)
+package com.sun.xml.internal.bind.v2.schemagen.episode;
+
+import com.sun.xml.internal.txw2.annotation.XmlNamespace;
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java
index fd1ef80..336802e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /**
  * Schema generator.
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java
index 531fd89..36ce652 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotated.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java
index 8a25134..341f2ad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Annotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java
index dc7e4a0..7bddd97 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Any.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java
index f225649..19912f1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Appinfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java
index 555e0e1..28bf256 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttrDecls.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java
index 3c0f3bf..ac4bb69 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/AttributeType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java
index a6a1f2c..ffbd2f2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexContent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java
index 827b9c8..ad9e510 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexExtension.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java
index fd93634..697ab2fd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexRestriction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java
index 1045eb8..f641776 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
@@ -37,17 +35,17 @@
 
 
     @XmlAttribute("final")
-    public ComplexType _final(String[] value);
-
-    @XmlAttribute("final")
     public ComplexType _final(String value);
 
-    @XmlAttribute
-    public ComplexType block(String[] value);
+    @XmlAttribute("final")
+    public ComplexType _final(String[] value);
 
     @XmlAttribute
     public ComplexType block(String value);
 
+    @XmlAttribute
+    public ComplexType block(String[] value);
+
     @XmlAttribute("abstract")
     public ComplexType _abstract(boolean value);
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java
index 86c3656..a3bc52d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java
index 7398a20..6f82d39 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ComplexTypeModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ContentModelContainer.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ContentModelContainer.java
new file mode 100644
index 0000000..013f0aa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ContentModelContainer.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlElement;
+
+/**
+ * Used to write a content model.
+ *
+ * This mixes the particle and model group as the child of complex type.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface ContentModelContainer extends TypedXmlWriter {
+    @XmlElement
+    LocalElement element();
+
+    @XmlElement
+    Any any();
+
+    @XmlElement
+    ExplicitGroup all();
+
+    @XmlElement
+    ExplicitGroup sequence();
+
+    @XmlElement
+    ExplicitGroup choice();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java
index c150fa1..85e9976 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Documentation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java
index 6503af7..d3a0c64 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
@@ -39,10 +37,10 @@
     public Element type(QName value);
 
     @XmlAttribute
-    public Element block(String[] value);
+    public Element block(String value);
 
     @XmlAttribute
-    public Element block(String value);
+    public Element block(String[] value);
 
     @XmlAttribute
     public Element nillable(boolean value);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java
index 0c8de44..d915548 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExplicitGroup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java
index 290171f..930a051 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ExtensionType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java
index e9199d3..7bf1d17 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/FixedOrDefault.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java
index 533a9c3..a4f82b4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Import.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java
index 6dd3dca..e3454b4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/List.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java
index 9ee57e8..11e9016 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalAttribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java
index 5c91404..5bac06f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/LocalElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java
index ee88be0..15f8fff 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NestedParticle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java
index c72efb7..101bcad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/NoFixedFacet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java
index d81692c..2fbb766 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
@@ -38,9 +36,9 @@
     public Occurs minOccurs(int value);
 
     @XmlAttribute
-    public Occurs maxOccurs(String value);
+    public Occurs maxOccurs(int value);
 
     @XmlAttribute
-    public Occurs maxOccurs(int value);
+    public Occurs maxOccurs(String value);
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Particle.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Particle.java
new file mode 100644
index 0000000..3b5f9b6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Particle.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public interface Particle extends ContentModelContainer, Occurs {
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java
index a947074..698c4fd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Redefinable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java
index a3e4685..6f77007 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
@@ -58,18 +56,18 @@
     public Schema attributeFormDefault(String value);
 
     @XmlAttribute
-    public Schema blockDefault(String[] value);
-
-    @XmlAttribute
     public Schema blockDefault(String value);
 
     @XmlAttribute
-    public Schema finalDefault(String[] value);
+    public Schema blockDefault(String[] value);
 
     @XmlAttribute
     public Schema finalDefault(String value);
 
     @XmlAttribute
+    public Schema finalDefault(String[] value);
+
+    @XmlAttribute
     public Schema version(String value);
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java
index 42c2b53..a291b42 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SchemaTop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java
index 2eea5b4..260fa0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleContent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java
index f57e62a..607a932 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleDerivation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java
index 3ef40ca..42c906b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleExtension.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java
index d74c58b..547e34e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestriction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java
index 46291f4..ab70d17 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleRestrictionModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java
index 14ffb04..a417fde 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java
index ed8d783..9c1921a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleTypeHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java
index 8bbaba8..c992fad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelAttribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java
index 3f48b1e..3761d6d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TopLevelElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
@@ -38,10 +36,10 @@
 
 
     @XmlAttribute("final")
-    public TopLevelElement _final(String[] value);
+    public TopLevelElement _final(String value);
 
     @XmlAttribute("final")
-    public TopLevelElement _final(String value);
+    public TopLevelElement _final(String[] value);
 
     @XmlAttribute("abstract")
     public TopLevelElement _abstract(boolean value);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java
index e0073d3..9e73265 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeDefParticle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java
index 3d86b37..8c46f37 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/TypeHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java
index 492d322..b3bbd0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Union.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java
index 16f85fa..07d0233 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
-
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
@@ -38,9 +36,9 @@
     public Wildcard processContents(String value);
 
     @XmlAttribute
-    public Wildcard namespace(String value);
+    public Wildcard namespace(String[] value);
 
     @XmlAttribute
-    public Wildcard namespace(String[] value);
+    public Wildcard namespace(String value);
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
index 7dbae08..e1ff9e1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,5 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 @com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema")
 package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
index d5ec73f..61c4d07 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 XML Schema writer generated by TXW.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng
index e6ad1df..0938747 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng
@@ -1,4 +1,28 @@
 <?xml version="1.0"?>
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <grammar xmlns="http://relaxng.org/ns/structure/1.0"
       datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
       ns="http://www.w3.org/2001/XMLSchema"
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java
index 6107524..05c7fda 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 
 import java.io.ByteArrayOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java
index 67f14b3..c563b01 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 
 import java.util.AbstractList;
@@ -53,6 +52,12 @@
     private int[] next;
     private int size = 0;
 
+    /**
+     * True if the check shall be done by using the object identity.
+     * False if the check shall be done with the equals method.
+     */
+    private boolean useIdentity = true;
+
     // for our purpose, there isn't much point in resizing this as we don't expect
     // the stack to grow that much.
     private final int[] initialHash;
@@ -64,6 +69,18 @@
     }
 
     /**
+     * Set to false to use {@link Object#equals(Object)} to detect cycles.
+     * This method can be only used when the stack is empty.
+     */
+    public void setUseIdentity(boolean useIdentity) {
+        this.useIdentity = useIdentity;
+    }
+
+    public boolean getUseIdentity() {
+        return useIdentity;
+    }
+
+    /**
      * Pushes a new object to the stack.
      *
      * @return
@@ -105,7 +122,7 @@
     }
 
     private int hash(Object o) {
-        return System.identityHashCode(o) % initialHash.length;
+        return ((useIdentity?System.identityHashCode(o):o.hashCode())&0x7FFFFFFF) % initialHash.length;
     }
 
     /**
@@ -138,7 +155,11 @@
         while(p!=0) {
             p--;
             Object existing = data[p];
-            if(existing==o)     return true;
+            if (useIdentity) {
+                if(existing==o)     return true;
+            } else {
+                if (o.equals(existing)) return true;
+            }
             p = next[p];
         }
         return false;
@@ -166,4 +187,22 @@
             Arrays.fill(initialHash,0);
         }
     }
+
+    /**
+     * String that represents the cycle.
+     */
+    public String getCycleString() {
+        StringBuilder sb = new StringBuilder();
+        int i=size()-1;
+        E obj = get(i);
+        sb.append(obj);
+        Object x;
+        do {
+            sb.append(" -> ");
+            x = get(--i);
+            sb.append(x);
+        } while(obj!=x);
+
+        return sb.toString();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java
index 5c981a5..6b017eb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java
index 6da0668..6c35c59 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,16 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)$Id$
+ */
+
 
 package com.sun.xml.internal.bind.v2.util;
 
+import java.util.Collection;
+import java.util.Arrays;
+
 /**
  * Computes the string edit distance.
  *
@@ -54,14 +61,24 @@
      * @return null if group.length==0.
      */
     public static String findNearest( String key, String[] group ) {
+        return findNearest(key, Arrays.asList(group));
+    }
+
+    /**
+     * Finds the string in the <code>group</code> closest to
+     * <code>key</code> and returns it.
+     *
+     * @return null if group.length==0.
+     */
+    public static String findNearest( String key, Collection<String> group ) {
         int c = Integer.MAX_VALUE;
         String r = null;
 
-        for( int i=0; i<group.length; i++ ) {
-            int ed = editDistance(key,group[i]);
+        for (String s : group) {
+            int ed = editDistance(key,s);
             if( c>ed ) {
                 c = ed;
-                r = group[i];
+                r = s;
             }
         }
         return r;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java
index 5e7d5c2..52ddc36 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 
 import org.xml.sax.ErrorHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java
index 02a3db9..b93b6ec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java
index 92855b2..00fbb5d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.bind.v2.util;
 import java.util.AbstractSet;
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/TypeCast.java b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/TypeCast.java
new file mode 100644
index 0000000..0b0d7e4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/TypeCast.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.bind.v2.util;
+
+import java.util.Map;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public class TypeCast {
+    /**
+     * Makes sure that a map contains the right type, and returns it to the desirable type.
+     */
+    public static <K,V> Map<K,V> checkedCast( Map<?,?> m, Class<K> keyType, Class<V> valueType ) {
+        if(m==null)
+            return null;
+        for (Map.Entry e : m.entrySet()) {
+            if(!keyType.isInstance(e.getKey()))
+                throw new ClassCastException(e.getKey().getClass().toString());
+            if(!valueType.isInstance(e.getValue()))
+                throw new ClassCastException(e.getValue().getClass().toString());
+        }
+        return (Map<K,V>)m;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDEventListener.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDEventListener.java
index 8ce5b54..ef9780d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDEventListener.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDEventListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java
index d169040..dbcf558 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java
index 505ccb4..7ffc6ef 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,7 @@
  * @author David Brownell
  * @author Janet Koenig
  * @author Kohsuke KAWAGUCHI
+ * @version $Id: DTDParser.java,v 1.1 2005/05/15 04:24:19 kohsuke Exp $
  */
 public class DTDParser {
     public final static String TYPE_CDATA = "CDATA";
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java
index b88256b..9d65079 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EntityDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EntityDecl.java
index cb1944e..f51037c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EntityDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EntityDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
  *
  * @author David Brownell
  * @author Janet Koenig
+ * @version 1.3 00/02/24
  */
 class EntityDecl {
     String name;        // <!ENTITY name ... >
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/ExternalEntity.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/ExternalEntity.java
index 64a9cc1..e7c89ae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/ExternalEntity.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/ExternalEntity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InputEntity.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InputEntity.java
index f0098d1..7db3603 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InputEntity.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InputEntity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,6 +52,7 @@
  *
  * @author David Brownell
  * @author Janet Koenig
+ * @version 1.4 00/08/05
  */
 public class InputEntity {
     private int start, finish;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InternalEntity.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InternalEntity.java
index 0116b96..95e96d7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InternalEntity.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/InternalEntity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/MessageCatalog.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/MessageCatalog.java
index f29d0c6..2229961 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/MessageCatalog.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/MessageCatalog.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,6 +130,7 @@
  * as distributed in its JAR file.
  *
  * @author David Brownell
+ * @version 1.1, 00/08/05
  * @see java.util.Locale
  * @see java.util.ListResourceBundle
  * @see java.text.MessageFormat
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/Resolver.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/Resolver.java
index 848d5d7..bb73c7e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/Resolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/Resolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -91,6 +91,7 @@
  *
  * @author David Brownell
  * @author Janet Koenig
+ * @version 1.3 00/02/24
  */
 public class Resolver implements EntityResolver {
     private boolean ignoringMIME;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/SimpleHashtable.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/SimpleHashtable.java
index fa5e1e8..0f548b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/SimpleHashtable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/SimpleHashtable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,7 @@
  * it makes a significant difference when normalizing attributes,
  * which is done for each start-element construct.
  *
+ * @version $Revision: 1.1 $
  */
 final class SimpleHashtable implements Enumeration {
     // entries ...
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlChars.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlChars.java
index 227cecd..021daca 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlChars.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlChars.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
  * both to parse and to create such documents.
  *
  * @author David Brownell
+ * @version 1.1, 00/08/05
  */
 public class XmlChars {
     // can't construct instances
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlNames.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlNames.java
index 823d532..13aea64 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlNames.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlNames.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
  * both to parse and to create such documents.
  *
  * @author David Brownell
+ * @version 1.1, 00/08/05
  */
 public class XmlNames {
     private XmlNames() {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlReader.java b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlReader.java
index 8d11693..0732a80 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/XmlReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@
  *
  * @author David Brownell
  * @author Janet Koenig
+ * @version 1.3 00/02/24
  */
 // package private
 final class XmlReader extends Reader {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/package.html b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/package.html
index a1f0908..a10f44d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <HTML><BODY>
 <P>   scan DTD stream and generates appropriate events.</P>
 </BODY></HTML>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties
index f419068..57f3628 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 #
 # English diagnostic messages (and fragments) for Sun's XML parser.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java
index 17fa432..27e8640 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,44 +24,6 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-/*
- * ====================================================================
- *
- * This code is subject to the freebxml License, Version 1.1
- *
- * Copyright (c) 2001 - 2005 freebxml.org.  All rights reserved.
- *
- * $Header: /cvs/fi/FastInfoset/src/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java,v 1.2 2005/05/17 20:53:19 joehw Exp $
- * ====================================================================
- */
 package com.sun.xml.internal.fastinfoset;
 
 import java.text.MessageFormat;
@@ -83,7 +45,7 @@
     public static String getBundleName() {
         return _bundleName;
     }
-    public void setBundleName(String name) {
+    public static void setBundleName(String name) {
         _bundleName = name;
     }
     /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java
index d9fe20d..e9d992c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,34 +24,6 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.fastinfoset;
 
 import java.util.Locale;
@@ -79,14 +51,12 @@
     public static CommonResourceBundle getInstance() {
         if (instance == null) {
             synchronized (CommonResourceBundle.class) {
-                if (instance == null) {
-                    instance = new CommonResourceBundle();
-                    //**need to know where to get the locale
-                    //String localeString = CommonProperties.getInstance()
-                    //                  .getProperty("omar.common.locale");
-                    String localeString = null;
-                    locale = parseLocale(localeString);
-                }
+                instance = new CommonResourceBundle();
+                //**need to know where to get the locale
+                //String localeString = CommonProperties.getInstance()
+                //                  .getProperty("omar.common.locale");
+                String localeString = null;
+                locale = parseLocale(localeString);
             }
         }
 
@@ -96,9 +66,7 @@
     public static CommonResourceBundle getInstance(Locale locale) {
         if (instance == null) {
             synchronized (CommonResourceBundle.class) {
-                if (instance == null) {
-                    instance = new CommonResourceBundle(locale);
-                }
+                instance = new CommonResourceBundle(locale);
             }
         } else {
             synchronized (CommonResourceBundle.class) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java
index c4722ce..68619d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,34 +24,6 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.fastinfoset;
 
 import com.sun.xml.internal.fastinfoset.alphabet.BuiltInRestrictedAlphabets;
@@ -100,17 +72,23 @@
  */
 public abstract class Decoder implements FastInfosetParser {
 
+    protected static final char[] XML_NAMESPACE_NAME_CHARS = EncodingConstants.XML_NAMESPACE_NAME.toCharArray();
+
+    protected static final char[] XMLNS_NAMESPACE_PREFIX_CHARS = EncodingConstants.XMLNS_NAMESPACE_PREFIX.toCharArray();
+
+    protected static final char[] XMLNS_NAMESPACE_NAME_CHARS = EncodingConstants.XMLNS_NAMESPACE_NAME.toCharArray();
+
     /**
      * String interning system property.
      */
     public static final String STRING_INTERNING_SYSTEM_PROPERTY =
-        "com.sun.xml.internal.fastinfoset.parser.string-interning";
+            "com.sun.xml.internal.fastinfoset.parser.string-interning";
 
     /**
      * Internal buffer size interning system property.
      */
     public static final String BUFFER_SIZE_SYSTEM_PROPERTY =
-        "com.sun.xml.internal.fastinfoset.parser.buffer-size";
+            "com.sun.xml.internal.fastinfoset.parser.buffer-size";
 
     private static boolean _stringInterningSystemDefault = false;
 
@@ -118,11 +96,11 @@
 
     static {
         String p = System.getProperty(STRING_INTERNING_SYSTEM_PROPERTY,
-            Boolean.toString(_stringInterningSystemDefault));
+                Boolean.toString(_stringInterningSystemDefault));
         _stringInterningSystemDefault = Boolean.valueOf(p).booleanValue();
 
         p = System.getProperty(BUFFER_SIZE_SYSTEM_PROPERTY,
-            Integer.toString(_bufferSizeSystemDefault));
+                Integer.toString(_bufferSizeSystemDefault));
         try {
             int i = Integer.valueOf(p).intValue();
             if (i > 0) {
@@ -148,6 +126,16 @@
     private Map _externalVocabularies;
 
     /**
+     * True if can parse fragments.
+     */
+    protected boolean _parseFragments;
+
+    /**
+     * True if needs to close underlying input stream.
+     */
+    protected boolean _needForceStreamClose;
+
+    /**
      * True if the vocabulary is internally created by decoder.
      */
     private boolean _vIsInternal;
@@ -359,8 +347,35 @@
         return _externalVocabularies;
     }
 
-    // End FastInfosetParser interface
+    /**
+     * {@inheritDoc}
+     */
+    public void setParseFragments(boolean parseFragments) {
+        _parseFragments = parseFragments;
+    }
 
+    /**
+     * {@inheritDoc}
+     */
+    public boolean getParseFragments() {
+        return _parseFragments;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setForceStreamClose(boolean needForceStreamClose) {
+        _needForceStreamClose = needForceStreamClose;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean getForceStreamClose() {
+        return _needForceStreamClose;
+    }
+
+// End FastInfosetParser interface
 
     /**
      * Reset the decoder for reuse decoding another XML infoset.
@@ -404,7 +419,7 @@
             decodeInitialVocabulary();
         } else if (b != 0) {
             throw new IOException(CommonResourceBundle.getInstance().
-                getString("message.optinalValues"));
+                    getString("message.optinalValues"));
         }
     }
 
@@ -604,9 +619,9 @@
             String name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
 
             String system_identifier = ((_b & EncodingConstants.NOTATIONS_SYSTEM_IDENTIFIER_FLAG) > 0)
-                ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+            ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
             String public_identifier = ((_b & EncodingConstants.NOTATIONS_PUBLIC_IDENTIFIER_FLAG) > 0)
-                ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+            ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
 
             Notation notation = new Notation(name, system_identifier, public_identifier);
             _notations.add(notation);
@@ -631,7 +646,7 @@
             String system_identifier = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI);
 
             String public_identifier = ((_b & EncodingConstants.UNPARSED_ENTITIES_PUBLIC_IDENTIFIER_FLAG) > 0)
-                ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+            ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
 
             String notation_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
 
@@ -669,7 +684,7 @@
 
     protected final QualifiedName decodeEIIIndexMedium() throws FastInfosetException, IOException {
         final int i = (((_b & EncodingConstants.INTEGER_3RD_BIT_MEDIUM_MASK) << 8) | read())
-            + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
+        + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
         return _v.elementName._array[i];
     }
 
@@ -678,20 +693,22 @@
         if ((_b & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_FLAG) == 0x20) {
             // EII large index
             i = (((_b & EncodingConstants.INTEGER_3RD_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                + EncodingConstants.INTEGER_3RD_BIT_MEDIUM_LIMIT;
+            + EncodingConstants.INTEGER_3RD_BIT_MEDIUM_LIMIT;
         } else {
             // EII large large index
             i = (((read() & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_MASK) << 16) | (read() << 8) | read())
-                + EncodingConstants.INTEGER_3RD_BIT_LARGE_LIMIT;
+            + EncodingConstants.INTEGER_3RD_BIT_LARGE_LIMIT;
         }
         return _v.elementName._array[i];
     }
 
-    protected final QualifiedName decodeLiteralQualifiedName(int state) throws FastInfosetException, IOException {
+    protected final QualifiedName decodeLiteralQualifiedName(int state, QualifiedName q)
+    throws FastInfosetException, IOException {
+        if (q == null) q = new QualifiedName();
         switch (state) {
             // no prefix, no namespace
             case 0:
-                return new QualifiedName(
+                return q.set(
                         "",
                         "",
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -699,9 +716,9 @@
                         -1,
                         _identifier,
                         null);
-            // no prefix, namespace
+                // no prefix, namespace
             case 1:
-                return new QualifiedName(
+                return q.set(
                         "",
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false),
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -709,12 +726,12 @@
                         _namespaceNameIndex,
                         _identifier,
                         null);
-            // prefix, no namespace
+                // prefix, no namespace
             case 2:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
-            // prefix, namespace
+                // prefix, namespace
             case 3:
-                return new QualifiedName(
+                return q.set(
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true),
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true),
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -753,9 +770,9 @@
             {
                 _addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
                 decodeUtf8StringAsCharBuffer();
                 return NISTRING_STRING;
@@ -774,9 +791,9 @@
             {
                 _addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
                 decodeUtf16StringAsCharBuffer();
                 return NISTRING_STRING;
@@ -810,11 +827,11 @@
                 return NISTRING_INDEX;
             case DecoderStateTables.NISTRING_INDEX_MEDIUM:
                 _integer = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return NISTRING_INDEX;
             case DecoderStateTables.NISTRING_INDEX_LARGE:
                 _integer = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return NISTRING_INDEX;
             case DecoderStateTables.NISTRING_EMPTY:
                 return NISTRING_EMPTY_STRING;
@@ -836,9 +853,9 @@
                 break;
             case DecoderStateTables.NISTRING_UTF8_LARGE_LENGTH:
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
                 break;
             default:
@@ -856,20 +873,20 @@
             case 0:
                 _octetBufferLength = 1;
                 break;
-            // Small length
+                // Small length
             case 1:
                 _octetBufferLength = 2;
                 break;
-            // Medium length
+                // Medium length
             case 2:
                 _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
                 break;
-            // Large length
+                // Large length
             case 3:
                 _octetBufferLength = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength += EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
                 break;
         }
@@ -902,9 +919,9 @@
             case DecoderStateTables.ISTRING_LARGE_LENGTH:
             {
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT;
                 final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
                 _identifier = table.add(s) - 1;
@@ -915,11 +932,11 @@
                 return table._array[_identifier];
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 _identifier = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return table._array[_identifier];
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 _identifier = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return table._array[_identifier];
             default:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingString"));
@@ -987,9 +1004,9 @@
             case DecoderStateTables.ISTRING_LARGE_LENGTH:
             {
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT;
                 final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
                 _prefixIndex = _v.prefix.add(s);
@@ -999,7 +1016,7 @@
                 if (namespaceNamePresent) {
                     _prefixIndex = 0;
                     // Peak at next byte and check the index of the XML namespace name
-                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peak()]
+                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peek()]
                             != DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO) {
                         throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
                     }
@@ -1012,11 +1029,11 @@
                 return _v.prefix._array[_prefixIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 _prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return _v.prefix._array[_prefixIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 _prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return _v.prefix._array[_prefixIndex - 1];
             default:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
@@ -1033,7 +1050,7 @@
                 if (namespaceNamePresent) {
                     _prefixIndex = 0;
                     // Peak at next byte and check the index of the XML namespace name
-                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peak()]
+                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peek()]
                             != DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO) {
                         throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
                     }
@@ -1046,11 +1063,11 @@
                 return _v.prefix._array[_prefixIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 _prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return _v.prefix._array[_prefixIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 _prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return _v.prefix._array[_prefixIndex - 1];
             default:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
@@ -1079,7 +1096,7 @@
                 _octetBufferLength = EncodingConstants.XMLNS_NAMESPACE_NAME_LENGTH;
                 decodeUtf8StringAsCharBuffer();
 
-                if (compareCharsWithCharBufferFromEndToStart(EncodingConstants.XMLNS_NAMESPACE_NAME_CHARS)) {
+                if (compareCharsWithCharBufferFromEndToStart(XMLNS_NAMESPACE_NAME_CHARS)) {
                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.xmlnsConnotBeBoundToPrefix"));
                 }
 
@@ -1093,7 +1110,7 @@
                 _octetBufferLength = EncodingConstants.XML_NAMESPACE_NAME_LENGTH;
                 decodeUtf8StringAsCharBuffer();
 
-                if (compareCharsWithCharBufferFromEndToStart(EncodingConstants.XML_NAMESPACE_NAME_CHARS)) {
+                if (compareCharsWithCharBufferFromEndToStart(XML_NAMESPACE_NAME_CHARS)) {
                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalNamespaceName"));
                 }
 
@@ -1112,9 +1129,9 @@
             case DecoderStateTables.ISTRING_LARGE_LENGTH:
             {
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT;
                 final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
                 _namespaceNameIndex = _v.namespaceName.add(s);
@@ -1132,11 +1149,11 @@
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 _namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 _namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             default:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
@@ -1161,11 +1178,11 @@
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 _namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 _namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                 return _v.namespaceName._array[_namespaceNameIndex - 1];
             default:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
@@ -1213,9 +1230,9 @@
             case DecoderStateTables.ISTRING_LARGE_LENGTH:
             {
                 final int length = (read() << 24) |
-                    (read() << 16) |
-                    (read() << 8) |
-                    read();
+                        (read() << 16) |
+                        (read() << 8) |
+                        read();
                 _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT;
                 break;
             }
@@ -1237,10 +1254,10 @@
                 return b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK;
             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
                 return (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
             case DecoderStateTables.ISTRING_INDEX_LARGE:
                 return (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
             case DecoderStateTables.ISTRING_SMALL_LENGTH:
             case DecoderStateTables.ISTRING_MEDIUM_LENGTH:
             case DecoderStateTables.ISTRING_LARGE_LENGTH:
@@ -1262,7 +1279,7 @@
         } else if (_identifier >= EncodingConstants.RESTRICTED_ALPHABET_APPLICATION_START) {
             CharArray ca = _v.restrictedAlphabet.get(_identifier - EncodingConstants.RESTRICTED_ALPHABET_APPLICATION_START);
             if (ca == null) {
-                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetNotPresent", new Object[]{new Integer(_identifier)}));
+                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetNotPresent", new Object[]{Integer.valueOf(_identifier)}));
             }
             decodeAlphabetOctetsAsCharBuffer(ca.ch);
         } else {
@@ -1279,13 +1296,13 @@
     }
 
     protected final String decodeRAOctetsAsString(char[] restrictedAlphabet) throws FastInfosetException, IOException {
-        decodeAlphabetOctetsAsCharBuffer(null);
+        decodeAlphabetOctetsAsCharBuffer(restrictedAlphabet);
         return new String(_charBuffer, 0, _charBufferLength);
     }
 
     protected final void decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) throws FastInfosetException, IOException {
         _charBufferLength = 0;
-        final int characters = _octetBufferLength / 2;
+        final int characters = _octetBufferLength * 2;
         if (_charBuffer.length < characters) {
             _charBuffer = new char[characters];
         }
@@ -1364,6 +1381,11 @@
         decodeUtf8StringIntoCharBuffer();
     }
 
+    protected final void decodeUtf8StringAsCharBuffer(char[] ch, int offset) throws IOException {
+        ensureOctetBufferSize();
+        decodeUtf8StringIntoCharBuffer(ch, offset);
+    }
+
     protected final String decodeUtf8StringAsString() throws IOException {
         decodeUtf8StringAsCharBuffer();
         return new String(_charBuffer, 0, _charBufferLength);
@@ -1440,6 +1462,21 @@
         }
     }
 
+    protected final void decodeUtf8StringIntoCharBuffer(char[] ch, int offset) throws IOException {
+        _charBufferLength = offset;
+        final int end = _octetBufferLength + _octetBufferOffset;
+        int b1;
+        while (end != _octetBufferOffset) {
+            b1 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+            if (DecoderStateTables.UTF8[b1] == DecoderStateTables.UTF8_ONE_BYTE) {
+                ch[_charBufferLength++] = (char) b1;
+            } else {
+                decodeTwoToFourByteUtf8Character(ch, b1, end);
+            }
+        }
+        _charBufferLength -= offset;
+    }
+
     private void decodeTwoToFourByteUtf8Character(int b1, int end) throws IOException {
         switch(DecoderStateTables.UTF8[b1]) {
             case DecoderStateTables.UTF8_TWO_BYTES:
@@ -1457,18 +1494,18 @@
                 // since a character encoded in two bytes will be in the
                 // range [0x80, 0x1FFF]
                 _charBuffer[_charBufferLength++] = (char) (
-                    ((b1 & 0x1F) << 6)
-                    | (b2 & 0x3F));
+                        ((b1 & 0x1F) << 6)
+                        | (b2 & 0x3F));
                 break;
             }
             case DecoderStateTables.UTF8_THREE_BYTES:
                 final char c = decodeUtf8ThreeByteChar(end, b1);
                 if (XMLChar.isContent(c)) {
                     _charBuffer[_charBufferLength++] = c;
-                    break;
                 } else {
                     decodeUtf8StringIllegalState();
                 }
+                break;
             case DecoderStateTables.UTF8_FOUR_BYTES:
             {
                 final int supplemental = decodeUtf8FourByteChar(end, b1);
@@ -1485,6 +1522,51 @@
         }
     }
 
+    private void decodeTwoToFourByteUtf8Character(char ch[], int b1, int end) throws IOException {
+        switch(DecoderStateTables.UTF8[b1]) {
+            case DecoderStateTables.UTF8_TWO_BYTES:
+            {
+                // Decode byte 2
+                if (end == _octetBufferOffset) {
+                    decodeUtf8StringLengthTooSmall();
+                }
+                final int b2 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+                if ((b2 & 0xC0) != 0x80) {
+                    decodeUtf8StringIllegalState();
+                }
+
+                // Character guaranteed to be in [0x20, 0xD7FF] range
+                // since a character encoded in two bytes will be in the
+                // range [0x80, 0x1FFF]
+                ch[_charBufferLength++] = (char) (
+                        ((b1 & 0x1F) << 6)
+                        | (b2 & 0x3F));
+                break;
+            }
+            case DecoderStateTables.UTF8_THREE_BYTES:
+                final char c = decodeUtf8ThreeByteChar(end, b1);
+                if (XMLChar.isContent(c)) {
+                    ch[_charBufferLength++] = c;
+                } else {
+                    decodeUtf8StringIllegalState();
+                }
+                break;
+            case DecoderStateTables.UTF8_FOUR_BYTES:
+            {
+                final int supplemental = decodeUtf8FourByteChar(end, b1);
+                if (XMLChar.isContent(supplemental)) {
+                    ch[_charBufferLength++] = _utf8_highSurrogate;
+                    ch[_charBufferLength++] = _utf8_lowSurrogate;
+                } else {
+                    decodeUtf8StringIllegalState();
+                }
+                break;
+            }
+            default:
+                decodeUtf8StringIllegalState();
+        }
+    }
+
     protected final void decodeUtf8NCNameIntoCharBuffer() throws IOException {
         _charBufferLength = 0;
         if (_charBuffer.length < _octetBufferLength) {
@@ -1524,20 +1606,19 @@
                 }
 
                 final char c = (char) (
-                    ((b1 & 0x1F) << 6)
-                    | (b2 & 0x3F));
+                        ((b1 & 0x1F) << 6)
+                        | (b2 & 0x3F));
                 if (XMLChar.isNCNameStart(c)) {
                     _charBuffer[_charBufferLength++] = c;
-                    break;
                 } else {
                     decodeUtf8NCNameIllegalState();
                 }
+                break;
             }
             case DecoderStateTables.UTF8_THREE_BYTES:
                 final char c = decodeUtf8ThreeByteChar(end, b1);
                 if (XMLChar.isNCNameStart(c)) {
                     _charBuffer[_charBufferLength++] = c;
-                    break;
                 } else {
                     decodeUtf8NCNameIllegalState();
                 }
@@ -1574,20 +1655,19 @@
                 }
 
                 final char c = (char) (
-                    ((b1 & 0x1F) << 6)
-                    | (b2 & 0x3F));
+                        ((b1 & 0x1F) << 6)
+                        | (b2 & 0x3F));
                 if (XMLChar.isNCName(c)) {
                     _charBuffer[_charBufferLength++] = c;
-                    break;
                 } else {
                     decodeUtf8NCNameIllegalState();
                 }
+                break;
             }
             case DecoderStateTables.UTF8_THREE_BYTES:
                 final char c = decodeUtf8ThreeByteChar(end, b1);
                 if (XMLChar.isNCName(c)) {
                     _charBuffer[_charBufferLength++] = c;
-                    break;
                 } else {
                     decodeUtf8NCNameIllegalState();
                 }
@@ -1615,8 +1695,8 @@
         }
         final int b2 = _octetBuffer[_octetBufferOffset++] & 0xFF;
         if ((b2 & 0xC0) != 0x80
-            || (b1 == 0xED && b2 >= 0xA0)
-            || ((b1 & 0x0F) == 0 && (b2 & 0x20) == 0)) {
+                || (b1 == 0xED && b2 >= 0xA0)
+                || ((b1 & 0x0F) == 0 && (b2 & 0x20) == 0)) {
             decodeUtf8StringIllegalState();
         }
 
@@ -1630,9 +1710,9 @@
         }
 
         return (char) (
-            (b1 & 0x0F) << 12
-            | (b2 & 0x3F) << 6
-            | (b3 & 0x3F));
+                (b1 & 0x0F) << 12
+                | (b2 & 0x3F) << 6
+                | (b3 & 0x3F));
     }
 
     private char _utf8_highSurrogate;
@@ -1645,7 +1725,7 @@
         }
         final int b2 = _octetBuffer[_octetBufferOffset++] & 0xFF;
         if ((b2 & 0xC0) != 0x80
-            || ((b2 & 0x30) == 0 && (b1 & 0x07) == 0)) {
+                || ((b2 & 0x30) == 0 && (b1 & 0x07) == 0)) {
             decodeUtf8StringIllegalState();
         }
 
@@ -1674,8 +1754,8 @@
         final int wwww = uuuuu - 1;
 
         _utf8_highSurrogate = (char) (0xD800 |
-             ((wwww << 6) & 0x03C0) | ((b2 << 2) & 0x003C) |
-             ((b3 >> 4) & 0x0003));
+                ((wwww << 6) & 0x03C0) | ((b2 << 2) & 0x003C) |
+                ((b3 >> 4) & 0x0003));
         _utf8_lowSurrogate = (char) (0xDC00 | ((b3 << 6) & 0x03C0) | (b4 & 0x003F));
 
         return XMLChar.supplemental(_utf8_highSurrogate, _utf8_lowSurrogate);
@@ -1738,10 +1818,24 @@
         }
     }
 
-    protected final int peak() throws IOException {
+    protected final void closeIfRequired() throws IOException {
+        if (_s != null && _needForceStreamClose) {
+            _s.close();
+        }
+    }
+
+    protected final int peek() throws IOException {
+        return peek(null);
+    }
+
+    protected final int peek(OctetBufferListener octetBufferListener) throws IOException {
         if (_octetBufferOffset < _octetBufferEnd) {
             return _octetBuffer[_octetBufferOffset] & 0xFF;
         } else {
+            if (octetBufferListener != null) {
+                octetBufferListener.onBeforeOctetBufferOverwrite();
+            }
+
             _octetBufferEnd = _s.read(_octetBuffer);
             if (_octetBufferEnd < 0) {
                 throw new EOFException(CommonResourceBundle.getInstance().getString("message.EOF"));
@@ -1752,6 +1846,30 @@
         }
     }
 
+    protected final int peek2(OctetBufferListener octetBufferListener) throws IOException {
+        if (_octetBufferOffset + 1 < _octetBufferEnd) {
+            return _octetBuffer[_octetBufferOffset + 1] & 0xFF;
+        } else {
+            if (octetBufferListener != null) {
+                octetBufferListener.onBeforeOctetBufferOverwrite();
+            }
+
+            int offset = 0;
+            if (_octetBufferOffset < _octetBufferEnd) {
+                _octetBuffer[0] = _octetBuffer[_octetBufferOffset];
+                offset = 1;
+            }
+            _octetBufferEnd = _s.read(_octetBuffer, offset, _octetBuffer.length - offset);
+
+            if (_octetBufferEnd < 0) {
+                throw new EOFException(CommonResourceBundle.getInstance().getString("message.EOF"));
+            }
+
+            _octetBufferOffset = 0;
+            return _octetBuffer[1] & 0xFF;
+        }
+    }
+
     protected class EncodingAlgorithmInputStream extends InputStream {
 
         public int read() throws IOException {
@@ -1770,7 +1888,7 @@
             if (b == null) {
                 throw new NullPointerException();
             } else if ((off < 0) || (off > b.length) || (len < 0) ||
-                       ((off + len) > b.length) || ((off + len) < 0)) {
+                    ((off + len) > b.length) || ((off + len) < 0)) {
                 throw new IndexOutOfBoundsException();
             } else if (len == 0) {
                 return 0;
@@ -1794,7 +1912,7 @@
 
     protected final boolean _isFastInfosetDocument() throws IOException {
         // Fill up the octet buffer
-        peak();
+        peek();
 
         _octetBufferLength = EncodingConstants.BINARY_HEADER.length;
         ensureOctetBufferSize();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java
index f720df6..36a5b7b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset;
@@ -541,14 +514,14 @@
     };
 
 
-    public final static int ISTRING_SMALL_LENGTH        = 0;
-    public final static int ISTRING_MEDIUM_LENGTH       = 1;
-    public final static int ISTRING_LARGE_LENGTH        = 2;
-    public final static int ISTRING_INDEX_SMALL         = 3;
-    public final static int ISTRING_INDEX_MEDIUM        = 4;
-    public final static int ISTRING_INDEX_LARGE         = 5;
+    /* package */ final static int ISTRING_SMALL_LENGTH        = 0;
+    /* package */ final static int ISTRING_MEDIUM_LENGTH       = 1;
+    /* package */ final static int ISTRING_LARGE_LENGTH        = 2;
+    /* package */ final static int ISTRING_INDEX_SMALL         = 3;
+    /* package */ final static int ISTRING_INDEX_MEDIUM        = 4;
+    /* package */ final static int ISTRING_INDEX_LARGE         = 5;
 
-    public static final int[] ISTRING = new int[256];
+    /* package */ static final int[] ISTRING = new int[256];
 
     private static int[][] ISTRING_RANGES = {
         // %00000000 to %00111111 small length
@@ -580,13 +553,13 @@
     };
 
 
-    public final static int ISTRING_PREFIX_NAMESPACE_LENGTH_3   = 6;
-    public final static int ISTRING_PREFIX_NAMESPACE_LENGTH_5   = 7;
-    public final static int ISTRING_PREFIX_NAMESPACE_LENGTH_29  = 8;
-    public final static int ISTRING_PREFIX_NAMESPACE_LENGTH_36  = 9;
-    public final static int ISTRING_PREFIX_NAMESPACE_INDEX_ZERO = 10;
+    /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_3   = 6;
+    /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_5   = 7;
+    /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_29  = 8;
+    /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_36  = 9;
+    /* package */ final static int ISTRING_PREFIX_NAMESPACE_INDEX_ZERO = 10;
 
-    public static final int[] ISTRING_PREFIX_NAMESPACE = new int[256];
+    /* package */ static final int[] ISTRING_PREFIX_NAMESPACE = new int[256];
 
     private static int[][] ISTRING_PREFIX_NAMESPACE_RANGES = {
         // %00000000 to %00000001 small length
@@ -648,13 +621,13 @@
     };
 
     // UTF-8 states
-    public final static int UTF8_NCNAME_NCNAME         = 0;
-    public final static int UTF8_NCNAME_NCNAME_CHAR    = 1;
-    public final static int UTF8_TWO_BYTES             = 2;
-    public final static int UTF8_THREE_BYTES           = 3;
-    public final static int UTF8_FOUR_BYTES            = 4;
+    /* package */ final static int UTF8_NCNAME_NCNAME         = 0;
+    /* package */ final static int UTF8_NCNAME_NCNAME_CHAR    = 1;
+    /* package */ final static int UTF8_TWO_BYTES             = 2;
+    /* package */ final static int UTF8_THREE_BYTES           = 3;
+    /* package */ final static int UTF8_FOUR_BYTES            = 4;
 
-    public static final int[] UTF8_NCNAME = new int[256];
+    /* package */ static final int[] UTF8_NCNAME = new int[256];
 
     private static int[][] UTF8_NCNAME_RANGES = {
 
@@ -724,9 +697,9 @@
         { 0xFF, STATE_ILLEGAL }
     };
 
-    public final static int UTF8_ONE_BYTE              = 1;
+    /* package */ final static int UTF8_ONE_BYTE = 1;
 
-    public static final int[] UTF8 = new int[256];
+    /* package */ static final int[] UTF8 = new int[256];
 
     private static int[][] UTF8_RANGES = {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java
index 8027ea0..b9983dd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,37 +24,8 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.fastinfoset;
 
-import com.sun.xml.internal.fastinfoset.algorithm.BuiltInEncodingAlgorithm;
 import com.sun.xml.internal.fastinfoset.algorithm.BuiltInEncodingAlgorithmFactory;
 import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar;
 import com.sun.xml.internal.fastinfoset.util.CharArrayIntMap;
@@ -72,6 +43,8 @@
 import com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary;
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSerializer;
+import com.sun.xml.internal.org.jvnet.fastinfoset.RestrictedAlphabet;
+import com.sun.xml.internal.org.jvnet.fastinfoset.VocabularyApplicationData;
 import org.xml.sax.helpers.DefaultHandler;
 
 /**
@@ -110,18 +83,57 @@
      * Default character encoding scheme system property for the encoding
      * of content and attribute values.
      */
-    protected static String _characterEncodingSchemeSystemDefault = UTF_8;
+    protected static final String _characterEncodingSchemeSystemDefault = getDefaultEncodingScheme();
 
-    static {
-        // Initiate the default character encoding schema from the system
-        // property
+    private static String getDefaultEncodingScheme() {
         String p = System.getProperty(CHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTY,
-            _characterEncodingSchemeSystemDefault);
+            UTF_8);
         if (p.equals(UTF_16BE)) {
-            _characterEncodingSchemeSystemDefault = UTF_16BE;
+            return UTF_16BE;
+        } else {
+            return UTF_8;
         }
     }
 
+    protected static int[] NUMERIC_CHARACTERS_TABLE;
+
+    protected static int[] DATE_TIME_CHARACTERS_TABLE;
+
+    static {
+        NUMERIC_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.NUMERIC_CHARACTERS) + 1];
+        DATE_TIME_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.DATE_TIME_CHARACTERS) + 1];
+
+        for (int i = 0; i < NUMERIC_CHARACTERS_TABLE.length ; i++) {
+            NUMERIC_CHARACTERS_TABLE[i] = -1;
+        }
+        for (int i = 0; i < DATE_TIME_CHARACTERS_TABLE.length ; i++) {
+            DATE_TIME_CHARACTERS_TABLE[i] = -1;
+        }
+
+        for (int i = 0; i < RestrictedAlphabet.NUMERIC_CHARACTERS.length() ; i++) {
+            NUMERIC_CHARACTERS_TABLE[RestrictedAlphabet.NUMERIC_CHARACTERS.charAt(i)] = i;
+        }
+        for (int i = 0; i < RestrictedAlphabet.DATE_TIME_CHARACTERS.length() ; i++) {
+            DATE_TIME_CHARACTERS_TABLE[RestrictedAlphabet.DATE_TIME_CHARACTERS.charAt(i)] = i;
+        }
+    }
+
+    private static int maxCharacter(String alphabet) {
+        int c = 0;
+        for (int i = 0; i < alphabet.length() ; i++) {
+            if (c < alphabet.charAt(i)) {
+                c = alphabet.charAt(i);
+            }
+        }
+
+        return c;
+    }
+
+    /**
+     * True if DTD and internal subset shall be ignored.
+     */
+    private boolean _ignoreDTD;
+
     /**
      * True if comments shall be ignored.
      */
@@ -173,6 +185,11 @@
     protected SerializerVocabulary _v;
 
     /**
+     * The vocabulary application data that is used by the encoder
+     */
+    protected VocabularyApplicationData _vData;
+
+    /**
      * True if the vocubulary is internal to the encoder
      */
     private boolean _vIsInternal;
@@ -224,12 +241,23 @@
     protected int attributeValueSizeConstraint = FastInfosetSerializer.ATTRIBUTE_VALUE_SIZE_CONSTRAINT;
 
     /**
+     * The limit on the size of indexed Map for attribute values
+     * Limit is measured in characters number
+     */
+    protected int attributeValueMapTotalCharactersConstraint = FastInfosetSerializer.ATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT / 2;
+
+    /**
      * The limit on the size of character content chunks
      * of Character Information Items or Comment Information Items that
      * will be indexed.
      */
     protected int characterContentChunkSizeContraint = FastInfosetSerializer.CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT;
 
+    /**
+     * The limit on the size of indexed Map for character content chunks
+     * Limit is measured in characters number
+     */
+    protected int characterContentChunkMapTotalCharactersConstraint = FastInfosetSerializer.CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT / 2;
 
     /**
      * Default constructor for the Encoder.
@@ -249,6 +277,20 @@
     /**
      * {@inheritDoc}
      */
+    public final void setIgnoreDTD(boolean ignoreDTD) {
+        _ignoreDTD = ignoreDTD;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public final boolean getIgnoreDTD() {
+        return _ignoreDTD;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public final void setIgnoreComments(boolean ignoreComments) {
         _ignoreComments = ignoreComments;
     }
@@ -349,6 +391,38 @@
     /**
      * {@inheritDoc}
      */
+    public void setCharacterContentChunkMapMemoryLimit(int size) {
+        if (size < 0 ) {
+            size = 0;
+        }
+
+        characterContentChunkMapTotalCharactersConstraint = size / 2;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getCharacterContentChunkMapMemoryLimit() {
+        return characterContentChunkMapTotalCharactersConstraint * 2;
+    }
+
+    /**
+     * Checks whether character content chunk (its length) matches limits:
+     * length limit itself and limit for total capacity of specified CharArrayIntMap
+     *
+     * @param length the length of character content chunk is checking to be added to Map.
+     * @param map the custom CharArrayIntMap, which memory limits will be checked.
+     * @return whether character content chunk length matches limits
+     */
+    public boolean isCharacterContentChunkLengthMatchesLimit(int length, CharArrayIntMap map) {
+        return (length < characterContentChunkSizeContraint) &&
+                (map.getTotalCharacterCount() + length <
+                        characterContentChunkMapTotalCharactersConstraint);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void setAttributeValueSizeLimit(int size) {
         if (size < 0 ) {
             size = 0;
@@ -367,6 +441,37 @@
     /**
      * {@inheritDoc}
      */
+    public void setAttributeValueMapMemoryLimit(int size) {
+        if (size < 0 ) {
+            size = 0;
+        }
+
+        attributeValueMapTotalCharactersConstraint = size / 2;
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getAttributeValueMapMemoryLimit() {
+        return attributeValueMapTotalCharactersConstraint * 2;
+    }
+
+    /**
+     * Checks whether attribute value (its length) matches limits:
+     * length limit itself and limit for index Map total capacity
+     *
+     * @return whether attribute value matches limits
+     */
+    public boolean isAttributeValueLengthMatchesLimit(int length) {
+        return (length < attributeValueSizeConstraint) &&
+                (_v.attributeValue.getTotalCharacterCount() + length <
+                        attributeValueMapTotalCharactersConstraint);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void setExternalVocabulary(ExternalVocabulary v) {
         // Create internal serializer vocabulary
         _v = new SerializerVocabulary();
@@ -379,6 +484,20 @@
         _vIsInternal = true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public void setVocabularyApplicationData(VocabularyApplicationData data) {
+        _vData = data;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public VocabularyApplicationData getVocabularyApplicationData() {
+        return _vData;
+    }
+
     // End of FastInfosetSerializer interface
 
     /**
@@ -432,9 +551,13 @@
             _vIsInternal = true;
         } else if (_vIsInternal) {
             _v.clear();
+            if (_vData != null)
+                _vData.clear();
         }
 
-        if (_v.hasInitialVocabulary()) {
+        if (!_v.hasInitialVocabulary() && !_v.hasExternalVocabulary()) {
+            write(0);
+        } else if (_v.hasInitialVocabulary()) {
             _b = EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG;
             write(_b);
 
@@ -448,7 +571,7 @@
             }
 
             if (initialVocabulary.hasExternalVocabulary()) {
-                encodeNonEmptyOctetStringOnSecondBit(_v.getExternalVocabularyURI().toString());
+                encodeNonEmptyOctetStringOnSecondBit(_v.getExternalVocabularyURI());
             }
 
             // TODO check for contents of vocabulary to encode values
@@ -460,9 +583,7 @@
             write(_b);
             write(0);
 
-            encodeNonEmptyOctetStringOnSecondBit(_v.getExternalVocabularyURI().toString());
-        } else {
-            write(0);
+            encodeNonEmptyOctetStringOnSecondBit(_v.getExternalVocabularyURI());
         }
     }
 
@@ -501,6 +622,7 @@
     protected final void encodeTermination() throws IOException {
         if (_terminate) {
             write(_b);
+            _b = 0;
             _terminate = false;
         }
     }
@@ -515,10 +637,10 @@
      */
     protected final void encodeNamespaceAttribute(String prefix, String uri) throws IOException {
         _b = EncodingConstants.NAMESPACE_ATTRIBUTE;
-        if (prefix != "") {
+        if (prefix.length() > 0) {
             _b |= EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_FLAG;
         }
-        if (uri != "") {
+        if (uri.length() > 0) {
             _b |= EncodingConstants.NAMESPACE_ATTRIBUTE_NAME_FLAG;
         }
 
@@ -529,10 +651,10 @@
 
         write(_b);
 
-        if (prefix != "") {
+        if (prefix.length() > 0) {
             encodeIdentifyingNonEmptyStringOnFirstBit(prefix, _v.prefix);
         }
-        if (uri != "") {
+        if (uri.length() > 0) {
             encodeIdentifyingNonEmptyStringOnFirstBit(uri, _v.namespaceName);
         }
     }
@@ -546,7 +668,7 @@
      * @throws ArrayIndexOutOfBoundsException.
      */
     protected final void encodeCharacters(char[] ch, int offset, int length) throws IOException {
-        final boolean addToTable = (length < characterContentChunkSizeContraint) ? true : false;
+        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
         encodeNonIdentifyingStringOnThirdBit(ch, offset, length, _v.characterContentChunk, addToTable, true);
     }
 
@@ -563,7 +685,7 @@
      * @throws ArrayIndexOutOfBoundsException.
      */
     protected final void encodeCharactersNoClone(char[] ch, int offset, int length) throws IOException {
-        final boolean addToTable = (length < characterContentChunkSizeContraint) ? true : false;
+        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
         encodeNonIdentifyingStringOnThirdBit(ch, offset, length, _v.characterContentChunk, addToTable, false);
     }
 
@@ -577,11 +699,22 @@
      * @param ch the array of characters.
      * @param offset the offset into the array of characters.
      * @param length the length of characters.
+     * @param addToTable if characters should be added to table.
      * @throws ArrayIndexOutOfBoundsException.
      */
-    protected final void encodeFourBitCharacters(int id, int[] table, char[] ch, int offset, int length) throws FastInfosetException, IOException {
+    protected final void encodeFourBitCharacters(int id, int[] table, char[] ch, int offset, int length,
+            boolean addToTable) throws FastInfosetException, IOException {
+        if (addToTable) {
+            final int index = _v.characterContentChunk.obtainIndex(ch, offset, length, true);
+            if (index != KeyIntMap.NOT_PRESENT) {
+                _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
+                encodeNonZeroIntegerOnFourthBit(index);
+                return;
+            }
+        }
+
         // This procedure assumes that id <= 64
-        _b = (length < characterContentChunkSizeContraint) ?
+        _b = (addToTable) ?
             EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG :
             EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
         write (_b);
@@ -601,22 +734,33 @@
      * @param ch the array of characters.
      * @param offset the offset into the array of characters.
      * @param length the length of characters.
+     * @param addToTable if characters should be added to table
      * @throws ArrayIndexOutOfBoundsException.
      * @throws FastInfosetException if the alphabet is not present in the
      *         vocabulary.
      */
-    protected final void encodeAlphabetCharacters(String alphabet, char[] ch, int offset, int length) throws FastInfosetException, IOException {
+    protected final void encodeAlphabetCharacters(String alphabet, char[] ch, int offset, int length,
+            boolean addToTable) throws FastInfosetException, IOException {
+        if (addToTable) {
+            final int index = _v.characterContentChunk.obtainIndex(ch, offset, length, true);
+            if (index != KeyIntMap.NOT_PRESENT) {
+                _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
+                encodeNonZeroIntegerOnFourthBit(index);
+                return;
+            }
+        }
+
         int id = _v.restrictedAlphabet.get(alphabet);
         if (id == KeyIntMap.NOT_PRESENT) {
             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.restrictedAlphabetNotPresent"));
         }
         id += EncodingConstants.RESTRICTED_ALPHABET_APPLICATION_START;
 
-        _b = (length < characterContentChunkSizeContraint) ?
+        _b = (addToTable) ?
             EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG :
             EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
         _b |= (id & 0xC0) >> 6;
-        write (_b);
+        write(_b);
 
         // Encode bottom 6 bits of enoding algorithm id
         _b = (id & 0x3F) << 2;
@@ -637,11 +781,35 @@
         encodeIdentifyingNonEmptyStringOnFirstBit(target, _v.otherNCName);
 
         // Data
-        boolean addToTable = (data.length() < characterContentChunkSizeContraint) ? true : false;
+        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(data.length(), _v.characterContentChunk);
         encodeNonIdentifyingStringOnFirstBit(data, _v.otherString, addToTable);
     }
 
     /**
+     * Encode a Document Type Declaration.
+     *
+     * @param systemId the system identifier of the external subset.
+     * @param publicId the public identifier of the external subset.
+     */
+    protected final void encodeDocumentTypeDeclaration(String systemId, String publicId) throws IOException {
+        _b = EncodingConstants.DOCUMENT_TYPE_DECLARATION;
+        if (systemId != null && systemId.length() > 0) {
+            _b |= EncodingConstants.DOCUMENT_TYPE_SYSTEM_IDENTIFIER_FLAG;
+        }
+        if (publicId != null && publicId.length() > 0) {
+            _b |= EncodingConstants.DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG;
+        }
+        write(_b);
+
+        if (systemId != null && systemId.length() > 0) {
+            encodeIdentifyingNonEmptyStringOnFirstBit(systemId, _v.otherURI);
+        }
+        if (publicId != null && publicId.length() > 0) {
+            encodeIdentifyingNonEmptyStringOnFirstBit(publicId, _v.otherURI);
+        }
+    }
+
+    /**
      * Encode a Comment Information Item.
      *
      * @param ch the array of characters that is as comment.
@@ -652,7 +820,7 @@
     protected final void encodeComment(char[] ch, int offset, int length) throws IOException {
         write(EncodingConstants.COMMENT);
 
-        boolean addToTable = (length < characterContentChunkSizeContraint) ? true : false;
+        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.otherString);
         encodeNonIdentifyingStringOnFirstBit(ch, offset, length, _v.otherString, addToTable, true);
     }
 
@@ -671,7 +839,7 @@
     protected final void encodeCommentNoClone(char[] ch, int offset, int length) throws IOException {
         write(EncodingConstants.COMMENT);
 
-        boolean addToTable = (length < characterContentChunkSizeContraint) ? true : false;
+        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.otherString);
         encodeNonIdentifyingStringOnFirstBit(ch, offset, length, _v.otherString, addToTable, false);
     }
 
@@ -722,13 +890,13 @@
 
         int namespaceURIIndex = KeyIntMap.NOT_PRESENT;
         int prefixIndex = KeyIntMap.NOT_PRESENT;
-        if (namespaceURI != "") {
+        if (namespaceURI.length() > 0) {
             namespaceURIIndex = _v.namespaceName.get(namespaceURI);
             if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
                 throw new IOException(CommonResourceBundle.getInstance().getString("message.namespaceURINotIndexed", new Object[]{namespaceURI}));
             }
 
-            if (prefix != "") {
+            if (prefix.length() > 0) {
                 prefixIndex = _v.prefix.get(prefix);
                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                     throw new IOException(CommonResourceBundle.getInstance().getString("message.prefixNotIndexed", new Object[]{prefix}));
@@ -805,7 +973,7 @@
                 LocalNameQualifiedNamesMap.Entry entry) throws IOException {
         int namespaceURIIndex = KeyIntMap.NOT_PRESENT;
         int prefixIndex = KeyIntMap.NOT_PRESENT;
-        if (namespaceURI != "") {
+        if (namespaceURI.length() > 0) {
             namespaceURIIndex = _v.namespaceName.get(namespaceURI);
             if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
                 if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME ||
@@ -816,7 +984,7 @@
                 }
             }
 
-            if (prefix != "") {
+            if (prefix.length() > 0) {
                 prefixIndex = _v.prefix.get(prefix);
                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                     throw new IOException(CommonResourceBundle.getInstance().getString("message.prefixNotIndexed", new Object[]{prefix}));
@@ -830,9 +998,9 @@
         entry.addQualifiedName(name);
 
         _b = EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG;
-        if (namespaceURI != "") {
+        if (namespaceURI.length() > 0) {
             _b |= EncodingConstants.LITERAL_QNAME_NAMESPACE_NAME_FLAG;
-            if (prefix != "") {
+            if (prefix.length() > 0) {
                 _b |= EncodingConstants.LITERAL_QNAME_PREFIX_FLAG;
             }
         }
@@ -953,6 +1121,35 @@
         }
     }
 
+    protected final void encodeNonIdentifyingStringOnFirstBit(int id, int[] table, String s, boolean addToTable)
+            throws IOException, FastInfosetException {
+        if (s == null || s.length() == 0) {
+            // C.26 an index (first bit '1') with seven '1' bits for an empty string
+            write(0xFF);
+            return;
+        } else if (addToTable) {
+            final int index = _v.attributeValue.obtainIndex(s);
+            if (index != KeyIntMap.NOT_PRESENT) {
+                encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
+                return;
+            }
+        }
+
+        _b = (addToTable)
+                ? EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG | EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG
+                : EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG;
+        // Encode identification and top four bits of alphabet id
+        write (_b | ((id & 0xF0) >> 4));
+        // Encode bottom 4 bits of alphabet id
+        _b = (id & 0x0F) << 4;
+
+        final int length = s.length();
+        final int octetPairLength = length / 2;
+        final int octetSingleLength = length % 2;
+        encodeNonZeroOctetStringLengthOnFifthBit(octetPairLength + octetSingleLength);
+        encodeNonEmptyFourBitCharacterString(table, s.toCharArray(), 0, octetPairLength, octetSingleLength);
+    }
+
     /**
      * Encode a non identifying string on the first bit of an octet as binary
      * data using an encoding algorithm.
@@ -986,12 +1183,9 @@
                 }
             }
         } else if (id <= EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
-            BuiltInEncodingAlgorithm a = BuiltInEncodingAlgorithmFactory.table[id];
             int length = 0;
             switch(id) {
                 case EncodingAlgorithmIndexes.HEXADECIMAL:
-                    length = ((byte[])data).length;
-                    break;
                 case EncodingAlgorithmIndexes.BASE64:
                     length = ((byte[])data).length;
                     break;
@@ -1002,6 +1196,7 @@
                     length = ((int[])data).length;
                     break;
                 case EncodingAlgorithmIndexes.LONG:
+                case EncodingAlgorithmIndexes.UUID:
                     length = ((long[])data).length;
                     break;
                 case EncodingAlgorithmIndexes.BOOLEAN:
@@ -1013,13 +1208,10 @@
                 case EncodingAlgorithmIndexes.DOUBLE:
                     length = ((double[])data).length;
                     break;
-                case EncodingAlgorithmIndexes.UUID:
-                    length = ((long[])data).length;
-                    break;
                 case EncodingAlgorithmIndexes.CDATA:
                     throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.CDATA"));
                 default:
-                    throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.UnsupportedBuiltInAlgorithm", new Object[]{new Integer(id)}));
+                    throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.UnsupportedBuiltInAlgorithm", new Object[]{Integer.valueOf(id)}));
             }
             encodeAIIBuiltInAlgorithmData(id, data, 0, length);
         } else if (id >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
@@ -1182,8 +1374,6 @@
             int length = 0;
             switch(id) {
                 case EncodingAlgorithmIndexes.HEXADECIMAL:
-                    length = ((byte[])data).length;
-                    break;
                 case EncodingAlgorithmIndexes.BASE64:
                     length = ((byte[])data).length;
                     break;
@@ -1194,7 +1384,8 @@
                     length = ((int[])data).length;
                     break;
                 case EncodingAlgorithmIndexes.LONG:
-                    length = ((int[])data).length;
+                case EncodingAlgorithmIndexes.UUID:
+                    length = ((long[])data).length;
                     break;
                 case EncodingAlgorithmIndexes.BOOLEAN:
                     length = ((boolean[])data).length;
@@ -1205,13 +1396,10 @@
                 case EncodingAlgorithmIndexes.DOUBLE:
                     length = ((double[])data).length;
                     break;
-                case EncodingAlgorithmIndexes.UUID:
-                    length = ((int[])data).length;
-                    break;
                 case EncodingAlgorithmIndexes.CDATA:
                     throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.CDATA"));
                 default:
-                    throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.UnsupportedBuiltInAlgorithm", new Object[]{new Integer(id)}));
+                    throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.UnsupportedBuiltInAlgorithm", new Object[]{Integer.valueOf(id)}));
             }
             encodeCIIBuiltInAlgorithmData(id, data, 0, length);
         } else if (id >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
@@ -1496,7 +1684,11 @@
 
         // Encode the length
         encodeNonZeroOctetStringLengthOnSenventhBit(octetPairLength + octetSingleLength);
+        encodeNonEmptyFourBitCharacterString(table, ch, offset, octetPairLength, octetSingleLength);
+    }
 
+    protected final void encodeNonEmptyFourBitCharacterString(int[] table, char[] ch, int offset,
+            int octetPairLength, int octetSingleLength) throws FastInfosetException, IOException {
         ensureSize(octetPairLength + octetSingleLength);
         // Encode all pairs
         int v = 0;
@@ -1533,7 +1725,6 @@
         while ((1 << bitsPerCharacter) <= alphabet.length()) {
             bitsPerCharacter++;
         }
-        final int terminatingValue = (1 << bitsPerCharacter) - 1;
 
         final int bits = length * bitsPerCharacter;
         final int octets = bits / 8;
@@ -1635,7 +1826,7 @@
             // _b = 0xC0 | (i >> 8); // 010 00000
             write(_b);
             write(i & 0xFF);
-        } else {
+        } else if (i < EncodingConstants.INTEGER_2ND_BIT_LARGE_LIMIT) {
             // [8257, 1048576] ( [8256, 1048575] ) 20 bits
             i -= EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
             _b = (0x80 | EncodingConstants.INTEGER_2ND_BIT_LARGE_FLAG) | (i >> 16); // 0110 0000
@@ -1643,6 +1834,10 @@
             write(_b);
             write((i >> 8) & 0xFF);
             write(i & 0xFF);
+        } else {
+            throw new IOException(
+                    CommonResourceBundle.getInstance().getString("message.integerMaxSize",
+                    new Object[]{Integer.valueOf(EncodingConstants.INTEGER_2ND_BIT_LARGE_LIMIT)}));
         }
     }
 
@@ -1833,25 +2028,33 @@
             write((i >> 8) & 0xFF);
             write(i & 0xFF);
         } else {
-            throw new IOException(CommonResourceBundle.getInstance().getString("message.integerMaxSize", new Object[]{new Integer(EncodingConstants.INTEGER_MAXIMUM_SIZE)}));
+            throw new IOException(CommonResourceBundle.getInstance().getString("message.integerMaxSize", new Object[]{Integer.valueOf(EncodingConstants.INTEGER_MAXIMUM_SIZE)}));
         }
     }
 
     /**
      * Mark the current position in the buffered stream.
      */
-    protected final void mark() throws IOException {
+    protected final void mark() {
         _markIndex = _octetBufferIndex;
     }
 
     /**
      * Reset the marked position in the buffered stream.
      */
-    protected final void resetMark() throws IOException {
+    protected final void resetMark() {
         _markIndex = -1;
     }
 
     /**
+     * @return true if the mark has been set, otherwise false if the mark
+     *         has not been set.
+     */
+    protected final boolean hasMark() {
+        return _markIndex != -1;
+    }
+
+    /**
      * Write a byte to the buffered stream.
      */
     protected final void write(int i) throws IOException {
@@ -2133,8 +2336,8 @@
         if (!XMLChar.isSpace(ch[start])) return false;
 
         final int end = start + length;
-        start++;
-        while(start < end && XMLChar.isSpace(ch[start++]));
+        while(++start < end && XMLChar.isSpace(ch[start]));
+
         return start == end;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java
index db3e426..e4dca13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset;
@@ -61,7 +34,6 @@
 
 public final class EncodingConstants {
     static {
-        initiateCharacterTables();
         initiateXMLDeclarationValues();
     }
 
@@ -69,14 +41,11 @@
     public static final int XML_NAMESPACE_PREFIX_LENGTH = XML_NAMESPACE_PREFIX.length();
     public static final String XML_NAMESPACE_NAME = "http://www.w3.org/XML/1998/namespace";
     public static final int XML_NAMESPACE_NAME_LENGTH = XML_NAMESPACE_NAME.length();
-    public static final char[] XML_NAMESPACE_NAME_CHARS = XML_NAMESPACE_NAME.toCharArray();
 
     public static final String XMLNS_NAMESPACE_PREFIX = "xmlns";
     public static final int XMLNS_NAMESPACE_PREFIX_LENGTH = XMLNS_NAMESPACE_PREFIX.length();
-    public static final char[] XMLNS_NAMESPACE_PREFIX_CHARS = XMLNS_NAMESPACE_PREFIX.toCharArray();
     public static final String XMLNS_NAMESPACE_NAME = "http://www.w3.org/2000/xmlns/";
     public static final int XMLNS_NAMESPACE_NAME_LENGTH = XMLNS_NAMESPACE_NAME.length();
-    public static final char[] XMLNS_NAMESPACE_NAME_CHARS = XMLNS_NAMESPACE_NAME.toCharArray();
 
     public static final QualifiedName DEFAULT_NAMESPACE_DECLARATION = new QualifiedName(
             "",
@@ -194,7 +163,7 @@
     public static final int OCTET_STRING_LENGTH_2ND_BIT_LARGE_FLAG = 0x60;
     public static final int OCTET_STRING_LENGTH_2ND_BIT_SMALL_MASK = 0x1F;
 
-    public static final int[] OCTET_STRING_LENGTH_2ND_BIT_VALUES = {
+    /* package */ static final int[] OCTET_STRING_LENGTH_2ND_BIT_VALUES = {
         OCTET_STRING_LENGTH_2ND_BIT_SMALL_LIMIT,
         OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT,
         OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_FLAG,
@@ -210,7 +179,7 @@
     public static final int OCTET_STRING_LENGTH_5TH_BIT_LARGE_FLAG = 0x0C;
     public static final int OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK = 0x07;
 
-    public static final int[] OCTET_STRING_LENGTH_5TH_BIT_VALUES = {
+    /* package */ static final int[] OCTET_STRING_LENGTH_5TH_BIT_VALUES = {
         OCTET_STRING_LENGTH_5TH_BIT_SMALL_LIMIT,
         OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT,
         OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_FLAG,
@@ -226,7 +195,7 @@
     public static final int OCTET_STRING_LENGTH_7TH_BIT_LARGE_FLAG = 0x03;
     public static final int OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK = 0x01;
 
-    public static final int[] OCTET_STRING_LENGTH_7TH_BIT_VALUES = {
+    /* package */ static final int[] OCTET_STRING_LENGTH_7TH_BIT_VALUES = {
         OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT,
         OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT,
         OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_FLAG,
@@ -257,7 +226,7 @@
     public static final int INTEGER_2ND_BIT_MEDIUM_MASK = 0x1F;
     public static final int INTEGER_2ND_BIT_LARGE_MASK = 0x0F;
 
-    public static final int[] INTEGER_2ND_BIT_VALUES = {
+    /* package */ static final int[] INTEGER_2ND_BIT_VALUES = {
         INTEGER_2ND_BIT_SMALL_LIMIT,
         INTEGER_2ND_BIT_MEDIUM_LIMIT,
         INTEGER_2ND_BIT_LARGE_LIMIT,
@@ -280,7 +249,7 @@
     public static final int INTEGER_3RD_BIT_LARGE_MASK = 0x07;
     public static final int INTEGER_3RD_BIT_LARGE_LARGE_MASK = 0x0F;
 
-    public static final int[] INTEGER_3RD_BIT_VALUES = {
+    /* package */ static final int[] INTEGER_3RD_BIT_VALUES = {
         INTEGER_3RD_BIT_SMALL_LIMIT,
         INTEGER_3RD_BIT_MEDIUM_LIMIT,
         INTEGER_3RD_BIT_LARGE_LIMIT,
@@ -302,7 +271,7 @@
     public static final int INTEGER_4TH_BIT_MEDIUM_MASK = 0x03;
     public static final int INTEGER_4TH_BIT_LARGE_MASK = 0x03;
 
-    public static final int[] INTEGER_4TH_BIT_VALUES = {
+    /* package */ static final int[] INTEGER_4TH_BIT_VALUES = {
         INTEGER_4TH_BIT_SMALL_LIMIT,
         INTEGER_4TH_BIT_MEDIUM_LIMIT,
         INTEGER_4TH_BIT_LARGE_LIMIT,
@@ -311,44 +280,9 @@
         INTEGER_4TH_BIT_LARGE_LARGE_FLAG
     };
 
+    /* package */ static final byte[] BINARY_HEADER = {(byte)0xE0, 0, 0, 1};
 
-    public static int[] NUMERIC_CHARACTERS_TABLE;
-
-    public static int[] DATE_TIME_CHARACTERS_TABLE;
-
-    private static void initiateCharacterTables() {
-        NUMERIC_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.NUMERIC_CHARACTERS) + 1];
-        DATE_TIME_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.DATE_TIME_CHARACTERS) + 1];
-
-        for (int i = 0; i < NUMERIC_CHARACTERS_TABLE.length ; i++) {
-            NUMERIC_CHARACTERS_TABLE[i] = -1;
-        }
-        for (int i = 0; i < DATE_TIME_CHARACTERS_TABLE.length ; i++) {
-            DATE_TIME_CHARACTERS_TABLE[i] = -1;
-        }
-
-        for (int i = 0; i < RestrictedAlphabet.NUMERIC_CHARACTERS.length() ; i++) {
-            NUMERIC_CHARACTERS_TABLE[RestrictedAlphabet.NUMERIC_CHARACTERS.charAt(i)] = i;
-        }
-        for (int i = 0; i < RestrictedAlphabet.DATE_TIME_CHARACTERS.length() ; i++) {
-            DATE_TIME_CHARACTERS_TABLE[RestrictedAlphabet.DATE_TIME_CHARACTERS.charAt(i)] = i;
-        }
-    }
-
-    private static int maxCharacter(String alphabet) {
-        int c = 0;
-        for (int i = 0; i < alphabet.length() ; i++) {
-            if (c < alphabet.charAt(i)) {
-                c = alphabet.charAt(i);
-            }
-        }
-
-        return c;
-    }
-
-    public static final byte[] BINARY_HEADER = {(byte)0xE0, 0, 0, 1};
-
-    public static byte[][] XML_DECLARATION_VALUES;
+    /* package */ static byte[][] XML_DECLARATION_VALUES;
 
     private static void initiateXMLDeclarationValues() {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java
index 71de72a..3351c3c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/OctetBufferListener.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/OctetBufferListener.java
new file mode 100644
index 0000000..fe11997
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/OctetBufferListener.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.fastinfoset;
+
+/**
+ * @author Paul Sandoz
+ * @author Alexey Stashok
+ */
+public interface OctetBufferListener {
+    /**
+     * Callback method that will be called before the
+     * (@link Decoder) octet buffer content is going to be changed.
+     * So it will be possible to preserve a read data by
+     * cloning, or perform other actions.
+     */
+    public void onBeforeOctetBufferOverwrite();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java
index 8f8d22a..488ce38 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset;
@@ -59,18 +32,20 @@
 import javax.xml.namespace.QName;
 
 public class QualifiedName {
-    public final String prefix;
-    public final String namespaceName;
-    public final String localName;
+    public String prefix;
+    public String namespaceName;
+    public String localName;
     public String qName;
-    public final int index;
-    public final int prefixIndex;
-    public final int namespaceNameIndex;
-    public final int localNameIndex;
+    public int index;
+    public int prefixIndex;
+    public int namespaceNameIndex;
+    public int localNameIndex;
     public int attributeId;
     public int attributeHash;
     private QName qNameObject;
 
+    public QualifiedName() { }
+
     public QualifiedName(String prefix, String namespaceName, String localName, String qName) {
         this.prefix = prefix;
         this.namespaceName = namespaceName;
@@ -82,6 +57,18 @@
         this.localNameIndex = -1;
     }
 
+    public void set(String prefix, String namespaceName, String localName, String qName) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = qName;
+        this.index = -1;
+        this.prefixIndex = 0;
+        this.namespaceNameIndex = 0;
+        this.localNameIndex = -1;
+        this.qNameObject = null;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName, String qName, int index) {
         this.prefix = prefix;
         this.namespaceName = namespaceName;
@@ -93,6 +80,19 @@
         this.localNameIndex = -1;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName, String qName, int index) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = qName;
+        this.index = index;
+        this.prefixIndex = 0;
+        this.namespaceNameIndex = 0;
+        this.localNameIndex = -1;
+        this.qNameObject = null;
+        return this;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName, String qName, int index,
             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
         this.prefix = prefix;
@@ -105,6 +105,20 @@
         this.localNameIndex = localNameIndex;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName, String qName, int index,
+            int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = qName;
+        this.index = index;
+        this.prefixIndex = prefixIndex + 1;
+        this.namespaceNameIndex = namespaceNameIndex + 1;
+        this.localNameIndex = localNameIndex;
+        this.qNameObject = null;
+        return this;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName) {
         this.prefix = prefix;
         this.namespaceName = namespaceName;
@@ -116,6 +130,19 @@
         this.localNameIndex = -1;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = createQNameString(prefix, localName);
+        this.index = -1;
+        this.prefixIndex = 0;
+        this.namespaceNameIndex = 0;
+        this.localNameIndex = -1;
+        this.qNameObject = null;
+        return this;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName,
             int prefixIndex, int namespaceNameIndex, int localNameIndex,
             char[] charBuffer) {
@@ -145,6 +172,37 @@
         this.index = -1;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName,
+            int prefixIndex, int namespaceNameIndex, int localNameIndex,
+            char[] charBuffer) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+
+        if (charBuffer != null) {
+            final int l1 = prefix.length();
+            final int l2 = localName.length();
+            final int total = l1 + l2 + 1;
+            if (total < charBuffer.length) {
+                prefix.getChars(0, l1, charBuffer, 0);
+                charBuffer[l1] = ':';
+                localName.getChars(0, l2, charBuffer, l1 + 1);
+                this.qName = new String(charBuffer, 0, total);
+            } else {
+                this.qName = createQNameString(prefix, localName);
+            }
+        } else {
+            this.qName = this.localName;
+        }
+
+        this.prefixIndex = prefixIndex + 1;
+        this.namespaceNameIndex = namespaceNameIndex + 1;
+        this.localNameIndex = localNameIndex;
+        this.index = -1;
+        this.qNameObject = null;
+        return this;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName, int index) {
         this.prefix = prefix;
         this.namespaceName = namespaceName;
@@ -156,6 +214,19 @@
         this.localNameIndex = -1;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName, int index) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = createQNameString(prefix, localName);
+        this.index = index;
+        this.prefixIndex = 0;
+        this.namespaceNameIndex = 0;
+        this.localNameIndex = -1;
+        this.qNameObject = null;
+        return this;
+    }
+
     public QualifiedName(String prefix, String namespaceName, String localName, int index,
             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
         this.prefix = prefix;
@@ -168,6 +239,20 @@
         this.localNameIndex = localNameIndex;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName, String localName, int index,
+            int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = localName;
+        this.qName = createQNameString(prefix, localName);
+        this.index = index;
+        this.prefixIndex = prefixIndex + 1;
+        this.namespaceNameIndex = namespaceNameIndex + 1;
+        this.localNameIndex = localNameIndex;
+        this.qNameObject = null;
+        return this;
+    }
+
     // Qualified Name as a Namespace Name
     public QualifiedName(String prefix, String namespaceName) {
         this.prefix = prefix;
@@ -180,6 +265,19 @@
         this.localNameIndex = -1;
     }
 
+    public final QualifiedName set(String prefix, String namespaceName) {
+        this.prefix = prefix;
+        this.namespaceName = namespaceName;
+        this.localName = "";
+        this.qName = "";
+        this.index = -1;
+        this.prefixIndex = 0;
+        this.namespaceNameIndex = 0;
+        this.localNameIndex = -1;
+        this.qNameObject = null;
+        return this;
+    }
+
     public final QName getQName() {
         if (qNameObject == null) {
             qNameObject = new QName(namespaceName, localName, prefix);
@@ -202,7 +300,7 @@
     }
 
     private final String createQNameString(String p, String l) {
-        if (p != null && p != "") {
+        if (p != null && p.length() > 0) {
             final StringBuffer b = new StringBuffer(p);
             b.append(':');
             b.append(l);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java
index adaf428..62739b3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java
index 57d5eb3..3eb72c6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -64,7 +36,7 @@
 
 public class BASE64EncodingAlgorithm extends BuiltInEncodingAlgorithm {
 
-    protected static final char encodeBase64[] = {
+    /* package */ static final char encodeBase64[] = {
         'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
         'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
         'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
@@ -72,7 +44,7 @@
         '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
     };
 
-    protected static final int decodeBase64[] = {
+    /* package */ static final int decodeBase64[] = {
         /*'+'*/ 62,
         -1, -1, -1,
         /*'/'*/ 63,
@@ -210,23 +182,46 @@
             return;
         }
         final byte[] value = (byte[]) data;
-        if (value.length == 0) {
+
+        convertToCharacters(value, 0, value.length, s);
+    }
+
+    public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
+        return octetLength;
+    }
+
+    public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+        return primitiveLength;
+    }
+
+    public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+        System.arraycopy((byte[])array, astart, b, start, alength);
+    }
+
+    public final void convertToCharacters(byte[] data, int offset, int length, StringBuffer s) {
+        if (data == null) {
+            return;
+        }
+        final byte[] value = data;
+        if (length == 0) {
             return;
         }
 
-        final int partialBlockLength = value.length % 3;
+        final int partialBlockLength = length % 3;
         final int blockCount = (partialBlockLength != 0) ?
-            value.length / 3 + 1 :
-            value.length / 3;
+            length / 3 + 1 :
+            length / 3;
 
         final int encodedLength = blockCount * 4;
-        s.ensureCapacity(encodedLength);
+        final int originalBufferSize = s.length();
+        s.ensureCapacity(encodedLength + originalBufferSize);
 
-        int idx = 0;
+        int idx = offset;
+        int lastIdx = offset + length;
         for (int i = 0; i < blockCount; ++i) {
             int b1 = value[idx++] & 0xFF;
-            int b2 = (idx < value.length) ? value[idx++] & 0xFF : 0;
-            int b3 = (idx < value.length) ? value[idx++] & 0xFF : 0;
+            int b2 = (idx < lastIdx) ? value[idx++] & 0xFF : 0;
+            int b3 = (idx < lastIdx) ? value[idx++] & 0xFF : 0;
 
             s.append(encodeBase64[b1 >> 2]);
 
@@ -239,26 +234,12 @@
 
         switch (partialBlockLength) {
             case 1 :
-                s.setCharAt(encodedLength - 1, '=');
-                s.setCharAt(encodedLength - 2, '=');
+                s.setCharAt(originalBufferSize + encodedLength - 1, '=');
+                s.setCharAt(originalBufferSize + encodedLength - 2, '=');
                 break;
             case 2 :
-                s.setCharAt(encodedLength - 1, '=');
+                s.setCharAt(originalBufferSize + encodedLength - 1, '=');
                 break;
         }
     }
-
-
-
-    public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
-        return octetLength;
-    }
-
-    public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
-        return primitiveLength;
-    }
-
-    public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
-        System.arraycopy((byte[])array, astart, b, start, alength);
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java
index 7b050d3..f604691 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -132,7 +104,7 @@
 
             while(bitPosition < bitPositionEnd) {
                 booleanList.add(
-                        new Boolean((value & BIT_TABLE[bitPosition++]) > 0));
+                        Boolean.valueOf((value & BIT_TABLE[bitPosition++]) > 0));
             }
 
             value = valueNext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java
index e0918fd..6e12d16 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -86,7 +58,8 @@
             }
             i = m.end();
         }
-        wl.word(i, cb.length());
+        if (i != cb.length())
+            wl.word(i, cb.length());
     }
 
     public StringBuffer removeWhitespace(char[] ch, int start, int length) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java
index f0482d2..77cdb1e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java
index d84ccca..b061b19 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java
index a509793..0f6e4be 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -73,7 +45,7 @@
     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % DOUBLE_SIZE != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthIsNotMultipleOfDouble", new Object[]{new Integer(DOUBLE_SIZE)}));
+                    getString("message.lengthIsNotMultipleOfDouble", new Object[]{Integer.valueOf(DOUBLE_SIZE)}));
         }
 
         return octetLength / DOUBLE_SIZE;
@@ -113,7 +85,7 @@
                 new WordListener() {
             public void word(int start, int end) {
                 String fStringValue = cb.subSequence(start, end).toString();
-                doubleList.add(Float.valueOf(fStringValue));
+                doubleList.add(Double.valueOf(fStringValue));
             }
         }
         );
@@ -168,17 +140,17 @@
                 }
             }
 
-            final int bits =
-                    ((b[0] & 0xFF) << 56) |
-                    ((b[1] & 0xFF) << 48) |
-                    ((b[2] & 0xFF) << 40) |
-                    ((b[3] & 0xFF) << 32) |
+            final long bits =
+                    ((long)(b[0] & 0xFF) << 56) |
+                    ((long)(b[1] & 0xFF) << 48) |
+                    ((long)(b[2] & 0xFF) << 40) |
+                    ((long)(b[3] & 0xFF) << 32) |
                     ((b[4] & 0xFF) << 24) |
                     ((b[5] & 0xFF) << 16) |
                     ((b[6] & 0xFF) << 8) |
                     (b[7] & 0xFF);
 
-            doubleList.add(new Double(Double.longBitsToDouble(bits)));
+            doubleList.add(Double.valueOf(Double.longBitsToDouble(bits)));
         }
 
         return generateArrayFromList(doubleList);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java
index 7a6ec05..331abb2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -73,7 +45,7 @@
     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % FLOAT_SIZE != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthNotMultipleOfFloat", new Object[]{new Integer(FLOAT_SIZE)}));
+                    getString("message.lengthNotMultipleOfFloat", new Object[]{Integer.valueOf(FLOAT_SIZE)}));
         }
 
         return octetLength / FLOAT_SIZE;
@@ -167,7 +139,7 @@
                     ((b[1] & 0xFF) << 16) |
                     ((b[2] & 0xFF) << 8) |
                     (b[3] & 0xFF);
-            floatList.add(new Float(Float.intBitsToFloat(bits)));
+            floatList.add(Float.valueOf(Float.intBitsToFloat(bits)));
         }
 
         return generateArrayFromList(floatList);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java
index 4748d2e..5ecfebb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java
index 5d98a61..ca406ef 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java
index 5a6f49b..1a921f4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -73,7 +45,7 @@
     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % INT_SIZE != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthNotMultipleOfInt", new Object[]{new Integer(INT_SIZE)}));
+                    getString("message.lengthNotMultipleOfInt", new Object[]{Integer.valueOf(INT_SIZE)}));
         }
 
         return octetLength / INT_SIZE;
@@ -167,7 +139,7 @@
                     ((b[1] & 0xFF) << 16) |
                     ((b[2] & 0xFF) << 8) |
                     (b[3] & 0xFF);
-            integerList.add(new Integer(i));
+            integerList.add(Integer.valueOf(i));
         }
 
         return generateArrayFromList(integerList);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java
index 38b0794..69b205b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java
index cb3f930..61f1861 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -72,7 +44,7 @@
     public int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % LONG_SIZE != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthNotMultipleOfLong", new Object[]{new Integer(LONG_SIZE)}));
+                    getString("message.lengthNotMultipleOfLong", new Object[]{Integer.valueOf(LONG_SIZE)}));
         }
 
         return octetLength / LONG_SIZE;
@@ -167,16 +139,16 @@
                 }
             }
 
-            final int l =
-                    ((b[0] & 0xFF) << 56) |
-                    ((b[1] & 0xFF) << 48) |
-                    ((b[2] & 0xFF) << 40) |
-                    ((b[3] & 0xFF) << 32) |
+            final long l =
+                    ((long)(b[0] & 0xFF) << 56) |
+                    ((long)(b[1] & 0xFF) << 48) |
+                    ((long)(b[2] & 0xFF) << 40) |
+                    ((long)(b[3] & 0xFF) << 32) |
                     ((b[4] & 0xFF) << 24) |
                     ((b[5] & 0xFF) << 16) |
                     ((b[6] & 0xFF) << 8) |
                     (b[7] & 0xFF);
-            longList.add(new Long(l));
+            longList.add(Long.valueOf(l));
         }
 
         return generateArrayFromList(longList);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/ShortEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/ShortEncodingAlgorithm.java
index c328fce..4fb05bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/ShortEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/ShortEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.algorithm;
 
@@ -78,7 +50,7 @@
     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % SHORT_SIZE != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthNotMultipleOfShort", new Object[]{new Integer(SHORT_SIZE)}));
+                    getString("message.lengthNotMultipleOfShort", new Object[]{Integer.valueOf(SHORT_SIZE)}));
         }
 
         return octetLength / SHORT_SIZE;
@@ -168,7 +140,7 @@
 
             final int i = ((b[0] & 0xFF) << 8) |
                     (b[1] & 0xFF);
-            shortList.add(new Short((short)i));
+            shortList.add(Short.valueOf((short)i));
         }
 
         return generateArrayFromList(shortList);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java
index a4e0796..93f9613 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.algorithm;
 
 import java.util.ArrayList;
@@ -66,7 +38,7 @@
     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
         if (octetLength % (LONG_SIZE * 2) != 0) {
             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                    getString("message.lengthNotMultipleOfUUID",new Object[]{new Integer(LONG_SIZE * 2)}));
+                    getString("message.lengthNotMultipleOfUUID",new Object[]{Integer.valueOf(LONG_SIZE * 2)}));
         }
 
         return octetLength / LONG_SIZE;
@@ -81,8 +53,8 @@
             public void word(int start, int end) {
                 String uuidValue = cb.subSequence(start, end).toString();
                 fromUUIDString(uuidValue);
-                longList.add(new Long(_msb));
-                longList.add(new Long(_lsb));
+                longList.add(Long.valueOf(_msb));
+                longList.add(Long.valueOf(_lsb));
             }
         }
         );
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java
index 18e19e4..09a36f7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.alphabet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java
index 3076dcb..fbfc0f1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.dom;
 
 import com.sun.xml.internal.fastinfoset.Decoder;
@@ -175,7 +147,8 @@
                 case DecoderStateTables.EII_LITERAL:
                 {
                     final QualifiedName qn = processLiteralQualifiedName(
-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                                _elementNameTable.getNext());
                     _elementNameTable.add(qn);
                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
                     firstElementHasOccured = true;
@@ -201,7 +174,6 @@
                     while (_b == EncodingConstants.PROCESSING_INSTRUCTION) {
                         switch(decodeNonIdentifyingStringOnFirstBit()) {
                             case NISTRING_STRING:
-                                final String data = new String(_charBuffer, 0, _charBufferLength);
                                 if (_addToTable) {
                                     _v.otherString.add(new CharArray(_charBuffer, 0, _charBufferLength, true));
                                 }
@@ -314,7 +286,7 @@
         }
 
         if ((_b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
-            String version = decodeVersion();
+            decodeVersion();
             /*
              * TODO
              * how to report the document version?
@@ -363,7 +335,8 @@
                 case DecoderStateTables.EII_LITERAL:
                 {
                     final QualifiedName qn = processLiteralQualifiedName(
-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                                _elementNameTable.getNext());
                     _elementNameTable.add(qn);
                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
                     break;
@@ -375,23 +348,13 @@
                 {
                     _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
                         + 1;
-                    String v = decodeUtf8StringAsString();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    _currentNode.appendChild(_document.createTextNode(v));
+                    processUtf8CharacterString();
                     break;
                 }
                 case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
                 {
                     _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
-                    String v = decodeUtf8StringAsString();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    _currentNode.appendChild(_document.createTextNode(v));
+                    processUtf8CharacterString();
                     break;
                 }
                 case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
@@ -401,12 +364,7 @@
                         (read() << 8) |
                         read();
                     _octetBufferLength += EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
-                    String v = decodeUtf8StringAsString();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    _currentNode.appendChild(_document.createTextNode(v));
+                    processUtf8CharacterString();
                     break;
                 }
                 case DecoderStateTables.CII_UTF16_SMALL_LENGTH:
@@ -554,6 +512,21 @@
         _currentNode = parentCurrentNode;
     }
 
+    private final void processUtf8CharacterString() throws FastInfosetException, IOException {
+        if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+            _characterContentChunkTable.ensureSize(_octetBufferLength);
+            final int charactersOffset = _characterContentChunkTable._arrayIndex;
+            decodeUtf8StringAsCharBuffer(_characterContentChunkTable._array, charactersOffset);
+            _characterContentChunkTable.add(_charBufferLength);
+            _currentNode.appendChild(_document.createTextNode(
+                    _characterContentChunkTable.getString(_characterContentChunkTable._cachedIndex)));
+        } else {
+            decodeUtf8StringAsCharBuffer();
+            _currentNode.appendChild(_document.createTextNode(
+                    new String(_charBuffer, 0, _charBufferLength)));
+        }
+    }
+
     protected final void processEIIWithNamespaces() throws FastInfosetException, IOException {
         final boolean hasAttributes = (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0;
 
@@ -608,7 +581,7 @@
                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                     a = createAttribute(
                             EncodingConstants.XMLNS_NAMESPACE_NAME,
-                            createQualifiedNameString(EncodingConstants.XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
+                            createQualifiedNameString(XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
                             prefix);
                     a.setValue ("");
 
@@ -621,7 +594,7 @@
                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                     a = createAttribute(
                             EncodingConstants.XMLNS_NAMESPACE_NAME,
-                            createQualifiedNameString(EncodingConstants.XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
+                            createQualifiedNameString(XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
                             prefix);
                     a.setValue (decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true));
 
@@ -654,7 +627,8 @@
             case DecoderStateTables.EII_LITERAL:
             {
                 final QualifiedName qn = processLiteralQualifiedName(
-                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _elementNameTable.getNext());
                 _elementNameTable.add(qn);
                 processEII(qn, hasAttributes);
                 break;
@@ -670,7 +644,51 @@
 
     }
 
-    protected final QualifiedName processLiteralQualifiedName(int state) throws FastInfosetException, IOException {
+    protected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q)
+    throws FastInfosetException, IOException {
+        if (q == null) q = new QualifiedName();
+
+        switch (state) {
+            // no prefix, no namespace
+            case 0:
+                return q.set(
+                        null,
+                        null,
+                        decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                        -1,
+                        -1,
+                        _identifier,
+                        null);
+            // no prefix, namespace
+            case 1:
+                return q.set(
+                        null,
+                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false),
+                        decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                        -1,
+                        _namespaceNameIndex,
+                        _identifier,
+                        null);
+            // prefix, no namespace
+            case 2:
+                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
+            // prefix, namespace
+            case 3:
+                return q.set(
+                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true),
+                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true),
+                        decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                        _prefixIndex,
+                        _namespaceNameIndex,
+                        _identifier,
+                        _charBuffer);
+            default:
+                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
+        }
+    }
+
+    protected final QualifiedName processLiteralQualifiedName(int state)
+    throws FastInfosetException, IOException {
         switch (state) {
             // no prefix, no namespace
             case 0:
@@ -742,7 +760,8 @@
                 }
                 case DecoderStateTables.AII_LITERAL:
                     name = processLiteralQualifiedName(
-                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _attributeNameTable.getNext());
                     name.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
                     _attributeNameTable.add(name);
                     break;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java
index 8b8e35c..7b27332 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,16 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.dom;
 
 import com.sun.xml.internal.fastinfoset.Encoder;
 import com.sun.xml.internal.fastinfoset.EncodingConstants;
 import com.sun.xml.internal.fastinfoset.QualifiedName;
+import com.sun.xml.internal.fastinfoset.util.NamespaceContextImplementation;
 import com.sun.xml.internal.fastinfoset.util.LocalNameQualifiedNamesMap;
 import java.io.IOException;
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
@@ -84,6 +58,7 @@
         switch (n.getNodeType()) {
             case Node.DOCUMENT_NODE:
                 serialize((Document)n);
+                break;
             case Node.ELEMENT_NODE:
                 serializeElementAsDocument(n);
                 break;
@@ -134,15 +109,20 @@
         encodeDocumentTermination();
     }
 
+//    protected Node[] _namespaceAttributes = new Node[4];
 
-    protected Node[] _namespaceAttributes = new Node[4];
+    // map which will hold all current scope prefixes and associated attributes
+    // Collection of populated namespace available for current scope
+    protected NamespaceContextImplementation _namespaceScopeContext = new NamespaceContextImplementation();
     protected Node[] _attributes = new Node[32];
 
     protected final void serializeElement(Node e) throws IOException {
         encodeTermination();
 
-        int namespaceAttributesSize = 0;
         int attributesSize = 0;
+
+        _namespaceScopeContext.pushContext();
+
         if (e.hasAttributes()) {
             /*
              * Split the attribute nodes into namespace attributes
@@ -153,12 +133,12 @@
                 final Node a = nnm.item(i);
                 final String namespaceURI = a.getNamespaceURI();
                 if (namespaceURI != null && namespaceURI.equals("http://www.w3.org/2000/xmlns/")) {
-                    if (namespaceAttributesSize == _namespaceAttributes.length) {
-                        final Node[] attributes = new Node[namespaceAttributesSize * 3 / 2 + 1];
-                        System.arraycopy(_namespaceAttributes, 0, attributes, 0, namespaceAttributesSize);
-                        _namespaceAttributes = attributes;
+                    String attrPrefix = a.getLocalName();
+                    String attrNamespace = a.getNodeValue();
+                    if (attrPrefix == "xmlns" || attrPrefix.equals("xmlns")) {
+                        attrPrefix = "";
                     }
-                    _namespaceAttributes[namespaceAttributesSize++] = a;
+                    _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespace);
                 } else {
                     if (attributesSize == _attributes.length) {
                         final Node[] attributes = new Node[attributesSize * 3 / 2 + 1];
@@ -166,11 +146,25 @@
                         _attributes = attributes;
                     }
                     _attributes[attributesSize++] = a;
+
+                    String attrNamespaceURI = a.getNamespaceURI();
+                    String attrPrefix = a.getPrefix();
+                    if (attrPrefix != null && !_namespaceScopeContext.getNamespaceURI(attrPrefix).equals(attrNamespaceURI)) {
+                        _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespaceURI);
+                    }
                 }
             }
         }
 
-        if (namespaceAttributesSize > 0) {
+        String elementNamespaceURI = e.getNamespaceURI();
+        String elementPrefix = e.getPrefix();
+        if (elementPrefix == null)  elementPrefix = "";
+        if (elementNamespaceURI != null &&
+                !_namespaceScopeContext.getNamespaceURI(elementPrefix).equals(elementNamespaceURI)) {
+            _namespaceScopeContext.declarePrefix(elementPrefix, elementNamespaceURI);
+        }
+
+        if (!_namespaceScopeContext.isCurrentContextEmpty()) {
             if (attributesSize > 0) {
                 write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG |
                         EncodingConstants.ELEMENT_ATTRIBUTE_FLAG);
@@ -178,18 +172,13 @@
                 write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
             }
 
-            // Serialize the namespace attributes
-            for (int i = 0; i < namespaceAttributesSize; i++) {
-                final Node a = _namespaceAttributes[i];
-                _namespaceAttributes[i] = null;
-                String prefix = a.getLocalName();
-                if (prefix == "xmlns" || prefix.equals("xmlns")) {
-                    prefix = "";
-                }
-                final String uri = a.getNodeValue();
+            for (int i = _namespaceScopeContext.getCurrentContextStartIndex();
+                     i < _namespaceScopeContext.getCurrentContextEndIndex(); i++) {
+
+                String prefix = _namespaceScopeContext.getPrefix(i);
+                String uri = _namespaceScopeContext.getNamespaceURI(i);
                 encodeNamespaceAttribute(prefix, uri);
             }
-
             write(EncodingConstants.TERMINATOR);
             _b = 0;
         } else {
@@ -197,7 +186,8 @@
                 EncodingConstants.ELEMENT;
         }
 
-        String namespaceURI = e.getNamespaceURI();
+        String namespaceURI = elementNamespaceURI;
+//        namespaceURI = (namespaceURI == null) ? _namespaceScopeContext.getNamespaceURI("") : namespaceURI;
         namespaceURI = (namespaceURI == null) ? "" : namespaceURI;
         encodeElement(namespaceURI, e.getNodeName(), e.getLocalName());
 
@@ -211,7 +201,7 @@
                 encodeAttribute(namespaceURI, a.getNodeName(), a.getLocalName());
 
                 final String value = a.getNodeValue();
-                final boolean addToTable = (value.length() < attributeValueSizeConstraint) ? true : false;
+                final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
                 encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
             }
 
@@ -244,8 +234,10 @@
             }
         }
         encodeElementTermination();
+        _namespaceScopeContext.popContext();
     }
 
+
     protected final void serializeText(Node t) throws IOException {
         final String text = t.getNodeValue();
 
@@ -334,8 +326,7 @@
         if (localName != null) {
             encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefixFromQualifiedName(qName),
                     localName, entry);
-        }
-        else {
+        } else {
             encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, "", qName, entry);
         }
     }
@@ -356,8 +347,7 @@
         if (localName != null) {
             encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefixFromQualifiedName(qName),
                     localName, entry);
-        }
-        else {
+        } else {
             encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, "", qName, entry);
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java
index 1cd39fa..9bf8375 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java
@@ -3,7 +3,7 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
  * have any questions.
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
  */
 
 /*
@@ -113,6 +112,7 @@
  * @author Michael Glavassevich, IBM
  * @author Rahul Srivastava, Sun Microsystems Inc.
  *
+ * @version $Id: XMLChar.java,v 1.1 2005/04/18 12:54:47 sandoz Exp $
  */
 public class XMLChar {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties
index a250f51..e76aa6e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # Sample ResourceBundle properties file
 message.optinalValues = Optional values (other than initial vocabulary) of DII not supported
 message.noExternalVocabularies=No external vocabularies registered
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java
index ed99ad6..7f45b19 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.sax;
@@ -229,6 +202,13 @@
         return _algorithmData[index];
     }
 
+    public String getAlpababet(int index) {
+        return null;
+    }
+
+    public boolean getToIndex(int index) {
+        return false;
+    }
 
     // -----
 
@@ -311,4 +291,5 @@
         ea.convertToCharacters(data, sb);
         return sb;
     }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java
index 014da1b..f62f881 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.sax;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java
index f8108b2..fdf47ab 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.sax;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java
index f8192b1..d69461a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.sax;
 
 import com.sun.xml.internal.fastinfoset.Decoder;
@@ -428,7 +400,10 @@
         try {
             reset();
             decodeHeader();
-            processDII();
+            if (_parseFragments)
+                processDIIFragment();
+            else
+                processDII();
         } catch (RuntimeException e) {
             try {
                 _errorHandler.fatalError(new SAXParseException(e.getClass().getName(), null, e));
@@ -491,7 +466,8 @@
                 case DecoderStateTables.EII_LITERAL:
                 {
                     final QualifiedName qn = decodeLiteralQualifiedName(
-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                                _elementNameTable.getNext());
                     _elementNameTable.add(qn);
                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
                     firstElementHasOccured = true;
@@ -517,7 +493,6 @@
                     while (_b == EncodingConstants.PROCESSING_INSTRUCTION) {
                         switch(decodeNonIdentifyingStringOnFirstBit()) {
                             case NISTRING_STRING:
-                                final String data = new String(_charBuffer, 0, _charBufferLength);
                                 if (_addToTable) {
                                     _v.otherString.add(new CharArray(_charBuffer, 0, _charBufferLength, true));
                                 }
@@ -538,8 +513,8 @@
                         _terminate = true;
                     }
 
-                    _notations.clear();
-                    _unparsedEntities.clear();
+                    if (_notations != null) _notations.clear();
+                    if (_unparsedEntities != null) _unparsedEntities.clear();
                     /*
                      * TODO
                      * Report All events associated with DTD, PIs, notations etc
@@ -589,6 +564,249 @@
         }
     }
 
+    protected final void processDIIFragment() throws FastInfosetException, IOException {
+        try {
+            _contentHandler.startDocument();
+        } catch (SAXException e) {
+            throw new FastInfosetException("processDII", e);
+        }
+
+        _b = read();
+        if (_b > 0) {
+            processDIIOptionalProperties();
+        }
+
+        while(!_terminate) {
+            _b = read();
+            switch(DecoderStateTables.EII[_b]) {
+                case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                    processEII(_elementNameTable._array[_b], false);
+                    break;
+                case DecoderStateTables.EII_AIIS_INDEX_SMALL:
+                    processEII(_elementNameTable._array[_b & EncodingConstants.INTEGER_3RD_BIT_SMALL_MASK], true);
+                    break;
+                case DecoderStateTables.EII_INDEX_MEDIUM:
+                    processEII(decodeEIIIndexMedium(), (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                    break;
+                case DecoderStateTables.EII_INDEX_LARGE:
+                    processEII(decodeEIIIndexLarge(), (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                    break;
+                case DecoderStateTables.EII_LITERAL:
+                {
+                    final QualifiedName qn = decodeLiteralQualifiedName(
+                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                                _elementNameTable.getNext());
+                    _elementNameTable.add(qn);
+                    processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                    break;
+                }
+                case DecoderStateTables.EII_NAMESPACES:
+                    processEIIWithNamespaces();
+                    break;
+                case DecoderStateTables.CII_UTF8_SMALL_LENGTH:
+                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
+                    + 1;
+                    processUtf8CharacterString();
+                    break;
+                case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
+                    _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
+                    processUtf8CharacterString();
+                    break;
+                case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
+                    _octetBufferLength = ((read() << 24) |
+                            (read() << 16) |
+                            (read() << 8) |
+                            read())
+                            + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
+                    processUtf8CharacterString();
+                    break;
+                case DecoderStateTables.CII_UTF16_SMALL_LENGTH:
+                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
+                    + 1;
+                    decodeUtf16StringAsCharBuffer();
+                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                    }
+
+                    try {
+                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                case DecoderStateTables.CII_UTF16_MEDIUM_LENGTH:
+                    _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
+                    decodeUtf16StringAsCharBuffer();
+                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                    }
+
+                    try {
+                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                case DecoderStateTables.CII_UTF16_LARGE_LENGTH:
+                    _octetBufferLength = ((read() << 24) |
+                            (read() << 16) |
+                            (read() << 8) |
+                            read())
+                            + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
+                    decodeUtf16StringAsCharBuffer();
+                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                    }
+
+                    try {
+                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                case DecoderStateTables.CII_RA:
+                {
+                    final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+
+                    // Decode resitricted alphabet integer
+                    _identifier = (_b & 0x02) << 6;
+                    _b = read();
+                    _identifier |= (_b & 0xFC) >> 2;
+
+                    decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+
+                    decodeRestrictedAlphabetAsCharBuffer();
+
+                    if (addToTable) {
+                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                    }
+
+                    try {
+                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.CII_EA:
+                {
+                    if ((_b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+                    }
+
+                    // Decode encoding algorithm integer
+                    _identifier = (_b & 0x02) << 6;
+                    _b = read();
+                    _identifier |= (_b & 0xFC) >> 2;
+
+                    decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+
+                    processCIIEncodingAlgorithm();
+                    break;
+                }
+                case DecoderStateTables.CII_INDEX_SMALL:
+                {
+                    final int index = _b & EncodingConstants.INTEGER_4TH_BIT_SMALL_MASK;
+                    try {
+                        _contentHandler.characters(_characterContentChunkTable._array,
+                                _characterContentChunkTable._offset[index],
+                                _characterContentChunkTable._length[index]);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.CII_INDEX_MEDIUM:
+                {
+                    final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
+                            + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                    try {
+                        _contentHandler.characters(_characterContentChunkTable._array,
+                                _characterContentChunkTable._offset[index],
+                                _characterContentChunkTable._length[index]);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.CII_INDEX_LARGE:
+                {
+                    final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_LARGE_MASK) << 16) |
+                            (read() << 8) |
+                            read())
+                            + EncodingConstants.INTEGER_4TH_BIT_MEDIUM_LIMIT;
+
+                    try {
+                        _contentHandler.characters(_characterContentChunkTable._array,
+                                _characterContentChunkTable._offset[index],
+                                _characterContentChunkTable._length[index]);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.CII_INDEX_LARGE_LARGE:
+                {
+                    final int index = ((read() << 16) |
+                            (read() << 8) |
+                            read())
+                            + EncodingConstants.INTEGER_4TH_BIT_LARGE_LIMIT;
+
+                    try {
+                        _contentHandler.characters(_characterContentChunkTable._array,
+                                _characterContentChunkTable._offset[index],
+                                _characterContentChunkTable._length[index]);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processCII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.COMMENT_II:
+                    processCommentII();
+                    break;
+                case DecoderStateTables.PROCESSING_INSTRUCTION_II:
+                    processProcessingII();
+                    break;
+                case DecoderStateTables.UNEXPANDED_ENTITY_REFERENCE_II:
+                {
+                    String entity_reference_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+
+                    String system_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0)
+                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+                    String public_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0)
+                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+
+                    try {
+                        /*
+                         * TODO
+                         * Need to verify if the skippedEntity method:
+                         * http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String)
+                         * is the correct method to call. It appears so but a more extensive
+                         * check is necessary.
+                         */
+                        _contentHandler.skippedEntity(entity_reference_name);
+                    } catch (SAXException e) {
+                        throw new FastInfosetException("processUnexpandedEntityReferenceII", e);
+                    }
+                    break;
+                }
+                case DecoderStateTables.TERMINATOR_DOUBLE:
+                    _doubleTerminate = true;
+                case DecoderStateTables.TERMINATOR_SINGLE:
+                    _terminate = true;
+                    break;
+                default:
+                    throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
+            }
+        }
+
+        try {
+            _contentHandler.endDocument();
+        } catch (SAXException e) {
+            throw new FastInfosetException("processDII", e);
+        }
+    }
+
     protected final void processDIIOptionalProperties() throws FastInfosetException, IOException {
         // Optimize for the most common case
         if (_b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
@@ -647,7 +865,7 @@
         }
 
         if ((_b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
-            String version = decodeVersion();
+            decodeVersion();
             /*
              * TODO
              * how to report the standalone flag?
@@ -694,7 +912,8 @@
                 case DecoderStateTables.EII_LITERAL:
                 {
                     final QualifiedName qn = decodeLiteralQualifiedName(
-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                                _elementNameTable.getNext());
                     _elementNameTable.add(qn);
                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
                     break;
@@ -705,29 +924,11 @@
                 case DecoderStateTables.CII_UTF8_SMALL_LENGTH:
                     _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
                     + 1;
-                    decodeUtf8StringAsCharBuffer();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    try {
-                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
-                    } catch (SAXException e) {
-                        throw new FastInfosetException("processCII", e);
-                    }
+                    processUtf8CharacterString();
                     break;
                 case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
                     _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
-                    decodeUtf8StringAsCharBuffer();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    try {
-                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
-                    } catch (SAXException e) {
-                        throw new FastInfosetException("processCII", e);
-                    }
+                    processUtf8CharacterString();
                     break;
                 case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
                     _octetBufferLength = ((read() << 24) |
@@ -735,16 +936,7 @@
                             (read() << 8) |
                             read())
                             + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
-                    decodeUtf8StringAsCharBuffer();
-                    if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-                        _characterContentChunkTable.add(_charBuffer, _charBufferLength);
-                    }
-
-                    try {
-                        _contentHandler.characters(_charBuffer, 0, _charBufferLength);
-                    } catch (SAXException e) {
-                        throw new FastInfosetException("processCII", e);
-                    }
+                    processUtf8CharacterString();
                     break;
                 case DecoderStateTables.CII_UTF16_SMALL_LENGTH:
                     _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
@@ -936,6 +1128,27 @@
         }
     }
 
+    private final void processUtf8CharacterString() throws FastInfosetException, IOException {
+        if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+            _characterContentChunkTable.ensureSize(_octetBufferLength);
+            final int charactersOffset = _characterContentChunkTable._arrayIndex;
+            decodeUtf8StringAsCharBuffer(_characterContentChunkTable._array, charactersOffset);
+            _characterContentChunkTable.add(_charBufferLength);
+            try {
+                _contentHandler.characters(_characterContentChunkTable._array, charactersOffset, _charBufferLength);
+            } catch (SAXException e) {
+                throw new FastInfosetException("processCII", e);
+            }
+        } else {
+            decodeUtf8StringAsCharBuffer();
+            try {
+                _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+            } catch (SAXException e) {
+                throw new FastInfosetException("processCII", e);
+            }
+        }
+    }
+
     protected final void processEIIWithNamespaces() throws FastInfosetException, IOException {
         final boolean hasAttributes = (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0;
 
@@ -1032,7 +1245,8 @@
             case DecoderStateTables.EII_LITERAL:
             {
                 final QualifiedName qn = decodeLiteralQualifiedName(
-                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _elementNameTable.getNext());
                 _elementNameTable.add(qn);
                 processEII(qn, hasAttributes);
                 break;
@@ -1089,7 +1303,8 @@
                 }
                 case DecoderStateTables.AII_LITERAL:
                     name = decodeLiteralQualifiedName(
-                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _attributeNameTable.getNext());
                     name.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
                     _attributeNameTable.add(name);
                     break;
@@ -1352,7 +1567,7 @@
             final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
             if (URI == null) {
                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                        getString("message.URINotPresent", new Object[]{new Integer(_identifier)}));
+                        getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
             }
 
             final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
@@ -1387,8 +1602,6 @@
             int length;
             switch(_identifier) {
                 case EncodingAlgorithmIndexes.HEXADECIMAL:
-                    _primitiveHandler.bytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
-                    break;
                 case EncodingAlgorithmIndexes.BASE64:
                     _primitiveHandler.bytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
                     break;
@@ -1502,7 +1715,7 @@
                     throw new UnsupportedOperationException("CDATA");
                 default:
                     throw new FastInfosetException(CommonResourceBundle.getInstance().
-                            getString("message.unsupportedAlgorithm", new Object[]{new Integer(_identifier)}));
+                            getString("message.unsupportedAlgorithm", new Object[]{Integer.valueOf(_identifier)}));
             }
         } catch (SAXException e) {
             throw new FastInfosetException(e);
@@ -1524,7 +1737,7 @@
             final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
             if (URI == null) {
                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
-                        getString("message.URINotPresent", new Object[]{new Integer(_identifier)}));
+                        getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
             }
 
             final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java
index effce51..97c137a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.sax;
 
 import com.sun.xml.internal.fastinfoset.Encoder;
@@ -69,7 +41,6 @@
 import org.xml.sax.SAXException;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
 
-
 /**
  * The Fast Infoset SAX serializer.
  * <p>
@@ -91,6 +62,10 @@
 
     protected boolean _charactersAsCDATA = false;
 
+    protected SAXDocumentSerializer(boolean v) {
+        super(v);
+    }
+
     public SAXDocumentSerializer() {
     }
 
@@ -122,7 +97,7 @@
         }
     }
 
-    public final void startPrefixMapping(String prefix, String uri) throws SAXException {
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
         try {
             if (_elementHasNamespaces == false) {
                 encodeTermination();
@@ -170,35 +145,7 @@
             encodeElement(namespaceURI, qName, localName);
 
             if (attributeCount > 0) {
-                boolean addToTable;
-                String value;
-                if (atts instanceof EncodingAlgorithmAttributes) {
-                    final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
-                    for (int i = 0; i < eAtts.getLength(); i++) {
-                        if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
-                            final Object data = eAtts.getAlgorithmData(i);
-                            // If data is null then there is no algorithm data
-                            if (data == null) {
-                                value = eAtts.getValue(i);
-                                addToTable = (value.length() < attributeValueSizeConstraint) ? true : false;
-                                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
-                            } else {
-                                encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
-                                        eAtts.getAlgorithmIndex(i), data);
-                            }
-                        }
-                    }
-                } else {
-                    for (int i = 0; i < atts.getLength(); i++) {
-                        if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
-                            value = atts.getValue(i);
-                            addToTable = (value.length() < attributeValueSizeConstraint) ? true : false;
-                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
-                        }
-                    }
-                }
-                _b = EncodingConstants.TERMINATOR;
-                _terminate = true;
+                encodeAttributes(atts);
             }
         } catch (IOException e) {
             throw new SAXException("startElement", e);
@@ -207,25 +154,11 @@
         }
     }
 
-    public final int countAttributes(Attributes atts) {
-        // Count attributes ignoring any in the XMLNS namespace
-        // Note, such attributes may be produced when transforming from a DOM node
-        int count = 0;
-        for (int i = 0; i < atts.getLength(); i++) {
-            final String uri = atts.getURI(i);
-            if (uri == "http://www.w3.org/2000/xmlns/" || uri.equals("http://www.w3.org/2000/xmlns/")) {
-                continue;
-            }
-            count++;
-        }
-        return count;
-    }
-
     public final void endElement(String namespaceURI, String localName, String qName) throws SAXException {
         try {
             encodeElementTermination();
         } catch (IOException e) {
-            throw new SAXException("startElement", e);
+            throw new SAXException("endElement", e);
         }
     }
 
@@ -262,7 +195,7 @@
         try {
             if (getIgnoreProcesingInstructions()) return;
 
-            if (target == "") {
+            if (target.length() == 0) {
                 throw new SAXException(CommonResourceBundle.getInstance().
                         getString("message.processingInstructionTargetIsEmpty"));
             }
@@ -305,6 +238,16 @@
     }
 
     public final void startDTD(String name, String publicId, String systemId) throws SAXException {
+        if (getIgnoreDTD()) return;
+
+        try {
+            encodeTermination();
+
+            encodeDocumentTypeDeclaration(publicId, systemId);
+            encodeElementTermination();
+        } catch (IOException e) {
+            throw new SAXException("startDTD", e);
+        }
     }
 
     public final void endDTD() throws SAXException {
@@ -487,7 +430,9 @@
         try {
             encodeTermination();
 
-            encodeFourBitCharacters(RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, EncodingConstants.NUMERIC_CHARACTERS_TABLE, ch, start, length);
+            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
+            encodeFourBitCharacters(RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, NUMERIC_CHARACTERS_TABLE,
+                    ch, start, length, addToTable);
         } catch (IOException e) {
             throw new SAXException(e);
         } catch (FastInfosetException e) {
@@ -503,7 +448,9 @@
         try {
             encodeTermination();
 
-            encodeFourBitCharacters(RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, EncodingConstants.DATE_TIME_CHARACTERS_TABLE, ch, start, length);
+            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
+            encodeFourBitCharacters(RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, DATE_TIME_CHARACTERS_TABLE,
+                    ch, start, length, addToTable);
         } catch (IOException e) {
             throw new SAXException(e);
         } catch (FastInfosetException e) {
@@ -519,7 +466,33 @@
         try {
             encodeTermination();
 
-            encodeAlphabetCharacters(alphabet, ch, start, length);
+            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
+            encodeAlphabetCharacters(alphabet, ch, start, length, addToTable);
+        } catch (IOException e) {
+            throw new SAXException(e);
+        } catch (FastInfosetException e) {
+            throw new SAXException(e);
+        }
+    }
+
+    // ExtendedContentHandler
+
+    public void characters(char[] ch, int start, int length, boolean index) throws SAXException {
+        if (length <= 0) {
+            return;
+        }
+
+        if (getIgnoreWhiteSpaceTextContent() &&
+                isWhiteSpace(ch, start, length)) return;
+
+        try {
+            encodeTermination();
+
+            if (!_charactersAsCDATA) {
+                encodeNonIdentifyingStringOnThirdBit(ch, start, length, _v.characterContentChunk, index, true);
+            } else {
+                encodeCIIBuiltInAlgorithmDataAsCDATA(ch, start, length);
+            }
         } catch (IOException e) {
             throw new SAXException(e);
         } catch (FastInfosetException e) {
@@ -529,12 +502,77 @@
 
 
 
-    protected final void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
+    protected final int countAttributes(Attributes atts) {
+        // Count attributes ignoring any in the XMLNS namespace
+        // Note, such attributes may be produced when transforming from a DOM node
+        int count = 0;
+        for (int i = 0; i < atts.getLength(); i++) {
+            final String uri = atts.getURI(i);
+            if (uri == "http://www.w3.org/2000/xmlns/" || uri.equals("http://www.w3.org/2000/xmlns/")) {
+                continue;
+            }
+            count++;
+        }
+        return count;
+    }
+
+    protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
+        boolean addToTable;
+        String value;
+        if (atts instanceof EncodingAlgorithmAttributes) {
+            final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
+            Object data;
+            String alphabet;
+            for (int i = 0; i < eAtts.getLength(); i++) {
+                if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
+                    data = eAtts.getAlgorithmData(i);
+                    // If data is null then there is no algorithm data
+                    if (data == null) {
+                        value = eAtts.getValue(i);
+                        addToTable = eAtts.getToIndex(i) || isAttributeValueLengthMatchesLimit(value.length());
+
+                        alphabet = eAtts.getAlpababet(i);
+                        if (alphabet == null)
+                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS)
+                            encodeNonIdentifyingStringOnFirstBit(
+                                    RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX,
+                                    DATE_TIME_CHARACTERS_TABLE,
+                                    value, addToTable);
+                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS)
+                            encodeNonIdentifyingStringOnFirstBit(
+                                    RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX,
+                                    NUMERIC_CHARACTERS_TABLE,
+                                    value, addToTable);
+                        else
+                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+
+                    } else {
+                        encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
+                                eAtts.getAlgorithmIndex(i), data);
+                    }
+                }
+            }
+        } else {
+            for (int i = 0; i < atts.getLength(); i++) {
+                if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
+                    value = atts.getValue(i);
+                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
+                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+                }
+            }
+        }
+        _b = EncodingConstants.TERMINATOR;
+        _terminate = true;
+    }
+
+    protected void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
         LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(qName);
         if (entry._valueIndex > 0) {
             QualifiedName[] names = entry._value;
             for (int i = 0; i < entry._valueIndex; i++) {
-                if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
+                final QualifiedName n = names[i];
+                if ((namespaceURI == n.namespaceName || namespaceURI.equals(n.namespaceName))) {
                     encodeNonZeroIntegerOnThirdBit(names[i].index);
                     return;
                 }
@@ -545,7 +583,7 @@
                 localName, entry);
     }
 
-    protected final boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException {
+    protected boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException {
         LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(qName);
         if (entry._valueIndex > 0) {
             QualifiedName[] names = entry._value;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializerWithPrefixMapping.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializerWithPrefixMapping.java
new file mode 100644
index 0000000..c943b3a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializerWithPrefixMapping.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.fastinfoset.sax;
+
+import com.sun.xml.internal.fastinfoset.EncodingConstants;
+import com.sun.xml.internal.fastinfoset.QualifiedName;
+import com.sun.xml.internal.fastinfoset.util.KeyIntMap;
+import com.sun.xml.internal.fastinfoset.util.LocalNameQualifiedNamesMap;
+import com.sun.xml.internal.fastinfoset.util.StringIntMap;
+import java.io.IOException;
+import java.util.HashMap;
+import org.xml.sax.SAXException;
+import java.util.Map;
+import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
+import com.sun.xml.internal.org.jvnet.fastinfoset.RestrictedAlphabet;
+import com.sun.xml.internal.org.jvnet.fastinfoset.sax.EncodingAlgorithmAttributes;
+import org.xml.sax.Attributes;
+
+/**
+ * The Fast Infoset SAX serializer that maps prefixes to user specified prefixes
+ * that are specified in a namespace URI to prefix map.
+ * <p>
+ * This serializer will not preserve the original prefixes and this serializer
+ * should not be used when prefixes need to be preserved, such as the case
+ * when there are qualified names in content.
+ * <p>
+ * A namespace URI to prefix map is utilized such that the prefixes
+ * in the map are utilized rather than the prefixes specified in
+ * the qualified name for elements and attributes.
+ * <p>
+ * Any namespace declarations with a namespace URI that is not present in
+ * the map are added.
+ * <p>
+ */
+public class SAXDocumentSerializerWithPrefixMapping extends SAXDocumentSerializer {
+    protected Map _namespaceToPrefixMapping;
+    protected Map _prefixToPrefixMapping;
+    protected String _lastCheckedNamespace;
+    protected String _lastCheckedPrefix;
+
+    protected StringIntMap _declaredNamespaces;
+
+    public SAXDocumentSerializerWithPrefixMapping(Map namespaceToPrefixMapping) {
+        // Use the local name to look up elements/attributes
+        super(true);
+        _namespaceToPrefixMapping = new HashMap(namespaceToPrefixMapping);
+        _prefixToPrefixMapping = new HashMap();
+
+        // Empty prefix
+        _namespaceToPrefixMapping.put("", "");
+        // 'xml' prefix
+        _namespaceToPrefixMapping.put(EncodingConstants.XML_NAMESPACE_NAME, EncodingConstants.XML_NAMESPACE_PREFIX);
+
+        _declaredNamespaces = new StringIntMap(4);
+    }
+
+    public final void startPrefixMapping(String prefix, String uri) throws SAXException {
+        try {
+            if (_elementHasNamespaces == false) {
+                encodeTermination();
+
+                // Mark the current buffer position to flag attributes if necessary
+                mark();
+                _elementHasNamespaces = true;
+
+                // Write out Element byte with namespaces
+                write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
+
+                _declaredNamespaces.clear();
+                _declaredNamespaces.obtainIndex(uri);
+            } else {
+                if (_declaredNamespaces.obtainIndex(uri) != KeyIntMap.NOT_PRESENT) {
+                    final String p = getPrefix(uri);
+                    if (p != null) {
+                        _prefixToPrefixMapping.put(prefix, p);
+                    }
+                    return;
+                }
+            }
+
+            final String p = getPrefix(uri);
+            if (p != null) {
+                encodeNamespaceAttribute(p, uri);
+                _prefixToPrefixMapping.put(prefix, p);
+            } else {
+                putPrefix(uri, prefix);
+                encodeNamespaceAttribute(prefix, uri);
+            }
+
+        } catch (IOException e) {
+            throw new SAXException("startElement", e);
+        }
+    }
+
+    protected final void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
+        LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(localName);
+        if (entry._valueIndex > 0) {
+            if (encodeElementMapEntry(entry, namespaceURI)) return;
+            // Check the entry is a member of the read only map
+            if (_v.elementName.isQNameFromReadOnlyMap(entry._value[0])) {
+                entry = _v.elementName.obtainDynamicEntry(localName);
+                if (entry._valueIndex > 0) {
+                    if (encodeElementMapEntry(entry, namespaceURI)) return;
+                }
+            }
+        }
+
+        encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefix(namespaceURI),
+                localName, entry);
+    }
+
+    protected boolean encodeElementMapEntry(LocalNameQualifiedNamesMap.Entry entry, String namespaceURI) throws IOException {
+        QualifiedName[] names = entry._value;
+        for (int i = 0; i < entry._valueIndex; i++) {
+            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
+                encodeNonZeroIntegerOnThirdBit(names[i].index);
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    protected final void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
+        boolean addToTable;
+        String value;
+        if (atts instanceof EncodingAlgorithmAttributes) {
+            final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
+            Object data;
+            String alphabet;
+            for (int i = 0; i < eAtts.getLength(); i++) {
+                final String uri = atts.getURI(i);
+                if (encodeAttribute(uri, atts.getQName(i), atts.getLocalName(i))) {
+                    data = eAtts.getAlgorithmData(i);
+                    // If data is null then there is no algorithm data
+                    if (data == null) {
+                        value = eAtts.getValue(i);
+                        addToTable = eAtts.getToIndex(i) || isAttributeValueLengthMatchesLimit(value.length());
+
+                        alphabet = eAtts.getAlpababet(i);
+                        if (alphabet == null) {
+                            if (uri == "http://www.w3.org/2001/XMLSchema-instance" ||
+                                    uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+                                value = convertQName(value);
+                            }
+                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+                        } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS)
+                            encodeNonIdentifyingStringOnFirstBit(
+                                    RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX,
+                                    DATE_TIME_CHARACTERS_TABLE,
+                                    value, addToTable);
+                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS)
+                            encodeNonIdentifyingStringOnFirstBit(
+                                    RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX,
+                                    NUMERIC_CHARACTERS_TABLE,
+                                    value, addToTable);
+                        else
+                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+
+                    } else {
+                        encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
+                                eAtts.getAlgorithmIndex(i), data);
+                    }
+                }
+            }
+        } else {
+            for (int i = 0; i < atts.getLength(); i++) {
+                final String uri = atts.getURI(i);
+                if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
+                    value = atts.getValue(i);
+                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
+
+                    if (uri == "http://www.w3.org/2001/XMLSchema-instance" ||
+                            uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+                        value = convertQName(value);
+                    }
+                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+                }
+            }
+        }
+        _b = EncodingConstants.TERMINATOR;
+        _terminate = true;
+    }
+
+    private String convertQName(String qName) {
+        int i = qName.indexOf(':');
+        String prefix = "";
+        String localName = qName;
+        if (i != -1) {
+            prefix = qName.substring(0, i);
+            localName = qName.substring(i + 1);
+        }
+
+        String p = (String)_prefixToPrefixMapping.get(prefix);
+        if (p != null) {
+            if (p.length() == 0)
+                return localName;
+            else
+                return p + ":" + localName;
+        } else {
+            return qName;
+        }
+    }
+
+    protected final boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException {
+        LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName);
+        if (entry._valueIndex > 0) {
+            if (encodeAttributeMapEntry(entry, namespaceURI)) return true;
+            // Check the entry is a member of the read only map
+            if (_v.attributeName.isQNameFromReadOnlyMap(entry._value[0])) {
+                entry = _v.attributeName.obtainDynamicEntry(localName);
+                if (entry._valueIndex > 0) {
+                    if (encodeAttributeMapEntry(entry, namespaceURI)) return true;
+                }
+            }
+        }
+
+        return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefix(namespaceURI),
+                localName, entry);
+    }
+
+    protected boolean encodeAttributeMapEntry(LocalNameQualifiedNamesMap.Entry entry, String namespaceURI) throws IOException {
+        QualifiedName[] names = entry._value;
+        for (int i = 0; i < entry._valueIndex; i++) {
+            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
+                encodeNonZeroIntegerOnSecondBitFirstBitZero(names[i].index);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected final String getPrefix(String namespaceURI) {
+        if (_lastCheckedNamespace == namespaceURI) return _lastCheckedPrefix;
+
+        _lastCheckedNamespace = namespaceURI;
+        return _lastCheckedPrefix = (String)_namespaceToPrefixMapping.get(namespaceURI);
+    }
+
+    protected final void putPrefix(String namespaceURI, String prefix) {
+        _namespaceToPrefixMapping.put(namespaceURI, prefix);
+
+        _lastCheckedNamespace = namespaceURI;
+        _lastCheckedPrefix = prefix;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java
index d242d94..db4df22 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.sax;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java
index 3731c41..6016838 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java
index 912be44..fd13d2f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,39 +25,12 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.stax;
 
 import com.sun.xml.internal.fastinfoset.Decoder;
 import com.sun.xml.internal.fastinfoset.DecoderStateTables;
 import com.sun.xml.internal.fastinfoset.EncodingConstants;
+import com.sun.xml.internal.fastinfoset.OctetBufferListener;
 import com.sun.xml.internal.fastinfoset.QualifiedName;
 import com.sun.xml.internal.fastinfoset.algorithm.BuiltInEncodingAlgorithmFactory;
 import com.sun.xml.internal.fastinfoset.sax.AttributesHolder;
@@ -78,6 +51,7 @@
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
 import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar;
+import com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader;
 
 /**
  * The Fast Infoset StAX parser.
@@ -89,7 +63,8 @@
  * More than one fast infoset document may be decoded from the
  * {@link java.io.InputStream}.
  */
-public class StAXDocumentParser extends Decoder implements XMLStreamReader {
+public class StAXDocumentParser extends Decoder
+        implements XMLStreamReader, FastInfosetStreamReader, OctetBufferListener {
     protected static final int INTERNAL_STATE_START_DOCUMENT = 0;
     protected static final int INTERNAL_STATE_START_ELEMENT_TERMINATE = 1;
     protected static final int INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES = 2;
@@ -143,6 +118,7 @@
 
     protected String _algorithmURI;
     protected int _algorithmId;
+    protected boolean _isAlgorithmDataCloned;
     protected byte[] _algorithmData;
     protected int _algorithmDataOffset;
     protected int _algorithmDataLength;
@@ -161,11 +137,13 @@
 
     public StAXDocumentParser() {
         reset();
+        _manager = new StAXManager(StAXManager.CONTEXT_READER);
     }
 
     public StAXDocumentParser(InputStream s) {
         this();
         setInputStream(s);
+        _manager = new StAXManager(StAXManager.CONTEXT_READER);
     }
 
     public StAXDocumentParser(InputStream s, StAXManager manager) {
@@ -181,7 +159,7 @@
     public void reset() {
         super.reset();
         if (_internalState != INTERNAL_STATE_START_DOCUMENT &&
-            _internalState != INTERNAL_STATE_END_DOCUMENT) {
+                _internalState != INTERNAL_STATE_END_DOCUMENT) {
 
             for (int i = _namespaceAIIsIndex - 1; i >= 0; i--) {
                 _prefixTable.popScopeWithPrefixEntry(_namespaceAIIsPrefixIndex[i]);
@@ -220,7 +198,7 @@
     // -- XMLStreamReader Interface -------------------------------------------
 
     public Object getProperty(java.lang.String name)
-            throws java.lang.IllegalArgumentException {
+    throws java.lang.IllegalArgumentException {
         if (_manager != null) {
             return _manager.getProperty(name);
         }
@@ -276,8 +254,8 @@
                         popStack();
 
                         _internalState = (_currentNamespaceAIIsEnd > 0) ?
-                                INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES :
-                                INTERNAL_STATE_VOID;
+                            INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES :
+                            INTERNAL_STATE_VOID;
                         return _eventType = END_ELEMENT;
                     case INTERNAL_STATE_END_DOCUMENT:
                         throw new NoSuchElementException(CommonResourceBundle.getInstance().getString("message.noMoreEvents"));
@@ -307,7 +285,8 @@
                 case DecoderStateTables.EII_LITERAL:
                 {
                     final QualifiedName qn = processLiteralQualifiedName(
-                                b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _elementNameTable.getNext());
                     _elementNameTable.add(qn);
                     processEII(qn, (b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
                     return _eventType;
@@ -317,7 +296,7 @@
                     return _eventType;
                 case DecoderStateTables.CII_UTF8_SMALL_LENGTH:
                     _octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
-                            + 1;
+                    + 1;
                     processUtf8CharacterString(b);
                     return _eventType = CHARACTERS;
                 case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
@@ -351,7 +330,7 @@
                     return _eventType = CHARACTERS;
                 case DecoderStateTables.CII_RA:
                 {
-                    final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+                    final boolean addToTable = (b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
 
                     _identifier = (b & 0x02) << 6;
                     final int b2 = read();
@@ -399,7 +378,7 @@
                 case DecoderStateTables.CII_INDEX_MEDIUM:
                 {
                     final int index = (((b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
-                            + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                    + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
                     _characterContentChunkTable._cachedIndex = index;
 
                     _characters = _characterContentChunkTable._array;
@@ -488,11 +467,14 @@
     }
 
     private final void processUtf8CharacterString(final int b) throws IOException {
-        decodeUtf8StringAsCharBuffer();
         if ((b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
-            _charactersOffset = _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+            _characterContentChunkTable.ensureSize(_octetBufferLength);
             _characters = _characterContentChunkTable._array;
+            _charactersOffset = _characterContentChunkTable._arrayIndex;
+            decodeUtf8StringAsCharBuffer(_characterContentChunkTable._array, _charactersOffset);
+            _characterContentChunkTable.add(_charBufferLength);
         } else {
+            decodeUtf8StringAsCharBuffer();
             _characters = _charBuffer;
             _charactersOffset = 0;
         }
@@ -549,7 +531,7 @@
                     CommonResourceBundle.getInstance().getString("message.mustBeOnSTARTELEMENT"), getLocation());
         }
         //current is StartElement, move to the next
-        int eventType = next();
+        next();
         return getElementText(true);
     }
     /**
@@ -599,7 +581,7 @@
      * @throws XMLStreamException if the current event is not white space
      */
     public final int nextTag() throws XMLStreamException {
-        int eventType = next();
+        next();
         return nextTag(true);
     }
     /** if the current tag has already read, such as in the case EventReader's
@@ -628,6 +610,10 @@
     }
 
     public void close() throws XMLStreamException {
+        try {
+            super.closeIfRequired();
+        } catch (IOException ex) {
+        }
     }
 
     public final String getNamespaceURI(String prefix) {
@@ -993,7 +979,88 @@
         }
     }
 
+    // FastInfosetStreamReader impl
 
+    public final int peekNext() throws XMLStreamException {
+        try {
+            switch(DecoderStateTables.EII[peek(this)]) {
+                case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                case DecoderStateTables.EII_AIIS_INDEX_SMALL:
+                case DecoderStateTables.EII_INDEX_MEDIUM:
+                case DecoderStateTables.EII_INDEX_LARGE:
+                case DecoderStateTables.EII_LITERAL:
+                case DecoderStateTables.EII_NAMESPACES:
+                    return START_ELEMENT;
+                case DecoderStateTables.CII_UTF8_SMALL_LENGTH:
+                case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
+                case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
+                case DecoderStateTables.CII_UTF16_SMALL_LENGTH:
+                case DecoderStateTables.CII_UTF16_MEDIUM_LENGTH:
+                case DecoderStateTables.CII_UTF16_LARGE_LENGTH:
+                case DecoderStateTables.CII_RA:
+                case DecoderStateTables.CII_EA:
+                case DecoderStateTables.CII_INDEX_SMALL:
+                case DecoderStateTables.CII_INDEX_MEDIUM:
+                case DecoderStateTables.CII_INDEX_LARGE:
+                case DecoderStateTables.CII_INDEX_LARGE_LARGE:
+                    return CHARACTERS;
+                case DecoderStateTables.COMMENT_II:
+                    return COMMENT;
+                case DecoderStateTables.PROCESSING_INSTRUCTION_II:
+                    return PROCESSING_INSTRUCTION;
+                case DecoderStateTables.UNEXPANDED_ENTITY_REFERENCE_II:
+                    return ENTITY_REFERENCE;
+                case DecoderStateTables.TERMINATOR_DOUBLE:
+                case DecoderStateTables.TERMINATOR_SINGLE:
+                    return (_stackCount != -1) ? END_ELEMENT : END_DOCUMENT;
+                default:
+                    throw new FastInfosetException(
+                            CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
+            }
+        } catch (IOException e) {
+            throw new XMLStreamException(e);
+        } catch (FastInfosetException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    public void onBeforeOctetBufferOverwrite() {
+        if (_algorithmData != null) {
+            _algorithmData = getTextAlgorithmBytesClone();
+            _algorithmDataOffset = 0;
+            _isAlgorithmDataCloned = true;
+        }
+    }
+
+    // Faster access methods without checks
+
+    public final int accessNamespaceCount() {
+        return (_currentNamespaceAIIsEnd > 0) ? (_currentNamespaceAIIsEnd - _currentNamespaceAIIsStart) : 0;
+    }
+
+    public final String accessLocalName() {
+        return _qualifiedName.localName;
+    }
+
+    public final String accessNamespaceURI() {
+        return _qualifiedName.namespaceName;
+    }
+
+    public final String accessPrefix() {
+        return _qualifiedName.prefix;
+    }
+
+    public final char[] accessTextCharacters() {
+        return _characters;
+    }
+
+    public final int accessTextStart() {
+        return _charactersOffset;
+    }
+
+    public final int accessTextLength() {
+        return _charBufferLength;
+    }
 
     //
 
@@ -1058,7 +1125,7 @@
         }
 
         if ((b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
-            String version = decodeVersion();
+            decodeVersion();
             /*
              * TODO
              * how to report the standalone flag?
@@ -1104,8 +1171,8 @@
 
                     _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                     break;
-                // no prefix, namespace
-                // Declaration of default namespace
+                    // no prefix, namespace
+                    // Declaration of default namespace
                 case 1:
                     prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                     namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
@@ -1113,8 +1180,8 @@
 
                     _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                     break;
-                // prefix, no namespace
-                // Undeclaration of namespace
+                    // prefix, no namespace
+                    // Undeclaration of namespace
                 case 2:
                     prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                             decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
@@ -1123,8 +1190,8 @@
                     _namespaceNameIndex = -1;
                     _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                     break;
-                // prefix, namespace
-                // Declaration of prefixed namespace
+                    // prefix, namespace
+                    // Declaration of prefixed namespace
                 case 3:
                     prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                             decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
@@ -1159,7 +1226,8 @@
             case DecoderStateTables.EII_LITERAL:
             {
                 final QualifiedName qn = processLiteralQualifiedName(
-                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                        b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                        _elementNameTable.getNext());
                 _elementNameTable.add(qn);
                 processEII(qn, hasAttributes);
                 break;
@@ -1227,20 +1295,21 @@
                 case DecoderStateTables.AII_INDEX_MEDIUM:
                 {
                     final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
-                            + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
                     name = _attributeNameTable._array[i];
                     break;
                 }
                 case DecoderStateTables.AII_INDEX_LARGE:
                 {
                     final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                            + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
                     name = _attributeNameTable._array[i];
                     break;
                 }
                 case DecoderStateTables.AII_LITERAL:
                     name = processLiteralQualifiedName(
-                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK);
+                            b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                            _attributeNameTable.getNext());
                     name.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
                     _attributeNameTable.add(name);
                     break;
@@ -1396,7 +1465,7 @@
 
     protected final QualifiedName processEIIIndexMedium(int b) throws FastInfosetException, IOException {
         final int i = (((b & EncodingConstants.INTEGER_3RD_BIT_MEDIUM_MASK) << 8) | read())
-            + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
+        + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
         return _elementNameTable._array[i];
     }
 
@@ -1405,20 +1474,23 @@
         if ((b & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_FLAG) == 0x20) {
             // EII large index
             i = (((b & EncodingConstants.INTEGER_3RD_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
-                + EncodingConstants.INTEGER_3RD_BIT_MEDIUM_LIMIT;
+            + EncodingConstants.INTEGER_3RD_BIT_MEDIUM_LIMIT;
         } else {
             // EII large large index
             i = (((read() & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_MASK) << 16) | (read() << 8) | read())
-                + EncodingConstants.INTEGER_3RD_BIT_LARGE_LIMIT;
+            + EncodingConstants.INTEGER_3RD_BIT_LARGE_LIMIT;
         }
         return _elementNameTable._array[i];
     }
 
-    protected final QualifiedName processLiteralQualifiedName(int state) throws FastInfosetException, IOException {
+    protected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q)
+    throws FastInfosetException, IOException {
+        if (q == null) q = new QualifiedName();
+
         switch (state) {
             // no prefix, no namespace
             case 0:
-                return new QualifiedName(
+                return q.set(
                         "",
                         "",
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -1427,9 +1499,9 @@
                         -1,
                         -1,
                         _identifier);
-            // no prefix, namespace
+                // no prefix, namespace
             case 1:
-                return new QualifiedName(
+                return q.set(
                         "",
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false),
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -1438,12 +1510,12 @@
                         -1,
                         _namespaceNameIndex,
                         _identifier);
-            // prefix, no namespace
+                // prefix, no namespace
             case 2:
                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
-            // prefix, namespace
+                // prefix, namespace
             case 3:
-                return new QualifiedName(
+                return q.set(
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true),
                         decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true),
                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
@@ -1528,11 +1600,12 @@
         _algorithmData = _octetBuffer;
         _algorithmDataOffset = _octetBufferStart;
         _algorithmDataLength = _octetBufferLength;
+        _isAlgorithmDataCloned = false;
 
         if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
             _algorithmURI = _v.encodingAlgorithm.get(_algorithmId - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
             if (_algorithmURI == null) {
-                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{new Integer(_identifier)}));
+                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
             }
         } else if (_algorithmId > EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
             // Reserved built-in algorithms for future use
@@ -1547,7 +1620,7 @@
         if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
             URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
             if (URI == null) {
-                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{new Integer(_identifier)}));
+                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
             }
         } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
             if (_identifier == EncodingAlgorithmIndexes.CDATA) {
@@ -1567,9 +1640,11 @@
 
     protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
         StringBuffer buffer = new StringBuffer();
-        if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+        if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
+            convertBase64AlorithmDataToCharacters(buffer);
+        } else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
             Object array = BuiltInEncodingAlgorithmFactory.table[_algorithmId].
-                decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
+                    decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
             BuiltInEncodingAlgorithmFactory.table[_algorithmId].convertToCharacters(array,  buffer);
         } else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
             _octetBufferOffset -= _octetBufferLength;
@@ -1595,6 +1670,93 @@
         _charBufferLength = _characters.length;
     }
 
+    /* If base64 data comes is chunks, bytes, which were cut to align 3,
+     * from prev. base64 chunk are stored in this buffer */
+    private byte[] base64TaleBytes = new byte[3];
+    private int base64TaleLength;
+    /*
+     * Method converts _algorithmData to base64 encoded String
+     * Counts with base64 data coming in chunks, aligning input chunks by 3,
+     * avoiding double cloning, happening after possible peek, peek2 cloning by Base64 algorithm
+     */
+    protected void convertBase64AlorithmDataToCharacters(StringBuffer buffer) throws EncodingAlgorithmException, IOException {
+        // How much new came data was serialized with prev. tale
+        int afterTaleOffset = 0;
+
+        if (base64TaleLength > 0) {
+            // Serialize tale left from prev. chunk
+            int bytesToCopy = Math.min(3 - base64TaleLength, _algorithmDataLength);
+            System.arraycopy(_algorithmData, _algorithmDataOffset, base64TaleBytes, base64TaleLength, bytesToCopy);
+            if (base64TaleLength + bytesToCopy == 3) {
+                base64DecodeWithCloning(buffer, base64TaleBytes, 0, 3);
+            } else if (!isBase64Follows()) {
+                // End of text was read to temp array
+                base64DecodeWithCloning(buffer, base64TaleBytes, 0, base64TaleLength + bytesToCopy);
+                return;
+            } else {
+                // If the end of chunk fit to tmp array, but next chunk is expected
+                base64TaleLength += bytesToCopy;
+                return;
+            }
+
+            afterTaleOffset = bytesToCopy;
+            base64TaleLength = 0;
+        }
+
+        int taleBytesRemaining = isBase64Follows() ? (_algorithmDataLength - afterTaleOffset) % 3 : 0;
+
+        if (_isAlgorithmDataCloned) {
+            base64DecodeWithoutCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
+                    _algorithmDataLength - afterTaleOffset - taleBytesRemaining);
+        } else {
+            base64DecodeWithCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
+                    _algorithmDataLength - afterTaleOffset - taleBytesRemaining);
+        }
+
+        if (taleBytesRemaining > 0) {
+            System.arraycopy(_algorithmData, _algorithmDataOffset + _algorithmDataLength - taleBytesRemaining,
+                    base64TaleBytes, 0, taleBytesRemaining);
+            base64TaleLength = taleBytesRemaining;
+        }
+    }
+
+    /*
+     * Encodes incoming data to Base64 string.
+     * Method performs additional input data cloning
+     */
+    private void base64DecodeWithCloning(StringBuffer dstBuffer, byte[] data, int offset, int length) throws EncodingAlgorithmException {
+        Object array = BuiltInEncodingAlgorithmFactory.base64EncodingAlgorithm.
+                decodeFromBytes(data, offset, length);
+        BuiltInEncodingAlgorithmFactory.base64EncodingAlgorithm.convertToCharacters(array, dstBuffer);
+    }
+
+    /*
+     * Encodes incoming data to Base64 string.
+     * Avoids input data cloning
+     */
+    private void base64DecodeWithoutCloning(StringBuffer dstBuffer, byte[] data, int offset, int length) throws EncodingAlgorithmException {
+        BuiltInEncodingAlgorithmFactory.base64EncodingAlgorithm.convertToCharacters(data, offset, length, dstBuffer);
+    }
+
+
+    /*
+     * Looks ahead in InputStream, whether next data is Base64 chunk
+     */
+    public boolean isBase64Follows() throws IOException {
+        // Process information item
+        int b = peek(this);
+        switch (DecoderStateTables.EII[b]) {
+            case DecoderStateTables.CII_EA:
+                int algorithmId = (b & 0x02) << 6;
+                int b2 = peek2(this);
+                algorithmId |= (b2 & 0xFC) >> 2;
+
+                return algorithmId == EncodingAlgorithmIndexes.BASE64;
+            default:
+                return false;
+        }
+    }
+
     protected class NamespaceContextImpl implements NamespaceContext {
         public final String getNamespaceURI(String prefix) {
             return _prefixTable.getNamespaceFromPrefix(prefix);
@@ -1656,5 +1818,4 @@
         }
         return "UNKNOWN_EVENT_TYPE";
     }
-
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java
index 69667d7..5b9b792 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,49 +25,22 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.fastinfoset.stax;
 
 import com.sun.xml.internal.fastinfoset.Encoder;
 import com.sun.xml.internal.fastinfoset.EncodingConstants;
+import com.sun.xml.internal.fastinfoset.util.NamespaceContextImplementation;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.EmptyStackException;
-import java.util.Enumeration;
-import java.util.Iterator;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes;
-import org.xml.sax.helpers.NamespaceSupport;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+import com.sun.xml.internal.fastinfoset.QualifiedName;
+import com.sun.xml.internal.fastinfoset.util.LocalNameQualifiedNamesMap;
+import com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter;
 
 /**
  * The Fast Infoset StAX serializer.
@@ -79,7 +52,8 @@
  * More than one fast infoset document may be encoded to the
  * {@link java.io.OutputStream}.
  */
-public class StAXDocumentSerializer extends Encoder implements XMLStreamWriter {
+public class StAXDocumentSerializer extends Encoder
+        implements XMLStreamWriter, LowLevelFastInfosetStreamWriter {
     protected StAXManager _manager;
 
     protected String _encoding;
@@ -114,15 +88,14 @@
     protected String[] _attributesArray = new String[4 * 16];
     protected int _attributesArrayIndex = 0;
 
-    /**
-     * Mapping between uris and prefixes.
-     */
-    protected NamespaceSupport _nsSupport = new NamespaceSupport();
-
     protected boolean[] _nsSupportContextStack = new boolean[32];
     protected int _stackCount = -1;
 
-    protected NamespaceContext _nsContext = new NamespaceContextImpl();
+    /**
+     * Mapping between uris and prefixes.
+     */
+    protected NamespaceContextImplementation _nsContext =
+            new NamespaceContextImplementation();
 
     /**
      * List of namespaces defined in the current element.
@@ -132,11 +105,13 @@
 
     public StAXDocumentSerializer() {
         super(true);
+        _manager = new StAXManager(StAXManager.CONTEXT_WRITER);
     }
 
     public StAXDocumentSerializer(OutputStream outputStream) {
         super(true);
         setOutputStream(outputStream);
+        _manager = new StAXManager(StAXManager.CONTEXT_WRITER);
     }
 
     public StAXDocumentSerializer(OutputStream outputStream, StAXManager manager) {
@@ -150,7 +125,8 @@
 
         _attributesArrayIndex = 0;
         _namespacesArrayIndex = 0;
-        _nsSupport.reset();
+
+        _nsContext.reset();
         _stackCount = -1;
 
         _currentUri = _currentPrefix = null;
@@ -183,16 +159,13 @@
     }
 
     public void writeEndDocument() throws XMLStreamException {
-        // Need to flush a pending empty element?
-        if (_inStartElement) {
-//            encodeTerminationAndCurrentElement();
-        }
-
         try {
-            // TODO
-            // Use nsSupport to terminate all elements not terminated
-            // by writeEndElement
 
+            // terminate all elements not terminated
+            // by writeEndElement
+            for(;_stackCount >= 0; _stackCount--) {
+                writeEndElement();
+            }
 
             encodeDocumentTermination();
         }
@@ -247,7 +220,6 @@
         }
 
         _nsSupportContextStack[_stackCount] = false;
-        // _nsSupport.pushContext();
     }
 
     public void writeEmptyElement(String localName)
@@ -281,7 +253,6 @@
         }
 
         _nsSupportContextStack[_stackCount] = false;
-        //_nsSupport.pushContext();
     }
 
     public void writeEndElement() throws XMLStreamException {
@@ -292,7 +263,7 @@
         try {
             encodeElementTermination();
             if (_nsSupportContextStack[_stackCount--] == true) {
-                _nsSupport.popContext();
+                _nsContext.popContext();
             }
         }
         catch (IOException e) {
@@ -317,7 +288,7 @@
 
         // Find prefix for attribute, ignoring default namespace
         if (namespaceURI.length() > 0) {
-            prefix = _nsSupport.getPrefix(namespaceURI);
+            prefix = _nsContext.getNonDefaultPrefix(namespaceURI);
 
             // Undeclared prefix or ignorable default ns?
             if (prefix == null || prefix.length() == 0) {
@@ -386,6 +357,7 @@
 
             _namespacesArray[_namespacesArrayIndex++] = prefix;
             _namespacesArray[_namespacesArrayIndex++] = namespaceURI;
+            setPrefix(prefix, namespaceURI);
         }
     }
 
@@ -404,6 +376,7 @@
 
         _namespacesArray[_namespacesArrayIndex++] = "";
         _namespacesArray[_namespacesArrayIndex++] = namespaceURI;
+        setPrefix("", namespaceURI);
     }
 
     public void writeComment(String data) throws XMLStreamException {
@@ -506,7 +479,7 @@
     }
 
     public String getPrefix(String uri) throws XMLStreamException {
-        return _nsSupport.getPrefix(uri);
+        return _nsContext.getPrefix(uri);
     }
 
     public void setPrefix(String prefix, String uri)
@@ -514,10 +487,10 @@
     {
         if (_stackCount > -1 && _nsSupportContextStack[_stackCount] == false) {
             _nsSupportContextStack[_stackCount] = true;
-            _nsSupport.pushContext();
+            _nsContext.pushContext();
         }
 
-        _nsSupport.declarePrefix(prefix, uri);
+        _nsContext.declarePrefix(prefix, uri);
     }
 
     public void setDefaultNamespace(String uri) throws XMLStreamException {
@@ -565,33 +538,6 @@
         _encoding = encoding;
     }
 
-    protected class NamespaceContextImpl implements NamespaceContext {
-        public final String getNamespaceURI(String prefix) {
-            return _nsSupport.getURI(prefix);
-        }
-
-        public final String getPrefix(String namespaceURI) {
-            return _nsSupport.getPrefix(namespaceURI);
-        }
-
-        public final Iterator getPrefixes(String namespaceURI) {
-            final Enumeration e = _nsSupport.getPrefixes(namespaceURI);
-
-            return new Iterator() {
-                    public boolean hasNext() {
-                        return e.hasMoreElements();
-                    }
-
-                    public Object next() {
-                        return e.nextElement();
-                    }
-
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-                };
-        }
-    }
 
     public void writeOctets(byte[] b, int start, int len)
         throws XMLStreamException
@@ -634,7 +580,11 @@
                     _b = 0;
                 }
 
-                // Encode element and its attributes
+                // If element's prefix is empty - apply default scope namespace
+                if (_currentPrefix.length() == 0 && _currentUri.length() == 0) {
+                    _currentUri = _nsContext.getNamespaceURI("");
+                }
+
                 encodeElementQualifiedNameOnThirdBit(_currentUri, _currentPrefix, _currentLocalName);
 
                 for (int i = 0; i < _attributesArrayIndex;) {
@@ -643,7 +593,7 @@
 
                     final String value = _attributesArray[i];
                     _attributesArray[i++] = null;
-                    final boolean addToTable = (value.length() < attributeValueSizeConstraint) ? true : false;
+                    final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
                     encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
 
                     _b = EncodingConstants.TERMINATOR;
@@ -655,7 +605,7 @@
                 if (_isEmptyElement) {
                     encodeElementTermination();
                     if (_nsSupportContextStack[_stackCount--] == true) {
-                        _nsSupport.popContext();
+                        _nsContext.popContext();
                     }
 
                     _isEmptyElement = false;
@@ -669,4 +619,204 @@
             throw new XMLStreamException(e);
         }
     }
+
+
+    // LowLevelFastInfosetSerializer
+
+    public final void initiateLowLevelWriting() throws XMLStreamException {
+        encodeTerminationAndCurrentElement(false);
+    }
+
+    public final int getNextElementIndex() {
+        return _v.elementName.getNextIndex();
+    }
+
+    public final int getNextAttributeIndex() {
+        return _v.attributeName.getNextIndex();
+    }
+
+    public final int getLocalNameIndex() {
+        return _v.localName.getIndex();
+    }
+
+    public final int getNextLocalNameIndex() {
+        return _v.localName.getNextIndex();
+    }
+
+    public final void writeLowLevelTerminationAndMark() throws IOException {
+        encodeTermination();
+        mark();
+    }
+
+    public final void writeLowLevelStartElementIndexed(int type, int index) throws IOException {
+        _b = type;
+        encodeNonZeroIntegerOnThirdBit(index);
+    }
+
+    public final boolean writeLowLevelStartElement(int type, String prefix, String localName,
+            String namespaceURI) throws IOException {
+        final boolean isIndexed = encodeElement(type, namespaceURI, prefix, localName);
+
+        if (!isIndexed)
+            encodeLiteral(type | EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                    namespaceURI, prefix, localName);
+
+        return isIndexed;
+    }
+
+    public final void writeLowLevelStartNamespaces() throws IOException {
+        write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
+    }
+
+    public final void writeLowLevelNamespace(String prefix, String namespaceName)
+        throws IOException {
+        encodeNamespaceAttribute(prefix, namespaceName);
+    }
+
+    public final void writeLowLevelEndNamespaces() throws IOException {
+        write(EncodingConstants.TERMINATOR);
+    }
+
+    public final void writeLowLevelStartAttributes() throws IOException {
+        if (hasMark()) {
+            _octetBuffer[_markIndex] |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
+            resetMark();
+        }
+    }
+
+    public final void writeLowLevelAttributeIndexed(int index) throws IOException {
+        encodeNonZeroIntegerOnSecondBitFirstBitZero(index);
+    }
+
+    public final boolean writeLowLevelAttribute(String prefix, String namespaceURI, String localName) throws IOException {
+        final boolean isIndexed = encodeAttribute(namespaceURI, prefix, localName);
+
+        if (!isIndexed)
+            encodeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG,
+                    namespaceURI, prefix, localName);
+
+        return isIndexed;
+    }
+
+    public final void writeLowLevelAttributeValue(String value) throws IOException
+    {
+        final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
+        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+    }
+
+    public final void writeLowLevelStartNameLiteral(int type, String prefix, byte[] utf8LocalName,
+            String namespaceURI) throws IOException {
+        encodeLiteralHeader(type, namespaceURI, prefix);
+        encodeNonZeroOctetStringLengthOnSecondBit(utf8LocalName.length);
+        write(utf8LocalName, 0, utf8LocalName.length);
+    }
+
+    public final void writeLowLevelStartNameLiteral(int type, String prefix, int localNameIndex,
+            String namespaceURI) throws IOException {
+        encodeLiteralHeader(type, namespaceURI, prefix);
+        encodeNonZeroIntegerOnSecondBitFirstBitOne(localNameIndex);
+    }
+
+    public final void writeLowLevelEndStartElement() throws IOException {
+        if (hasMark()) {
+            resetMark();
+        } else {
+            // Terminate the attributes
+            _b = EncodingConstants.TERMINATOR;
+            _terminate = true;
+        }
+    }
+
+    public final void writeLowLevelEndElement() throws IOException {
+        encodeElementTermination();
+    }
+
+    public final void writeLowLevelText(char[] text, int length) throws IOException {
+        if (length == 0)
+            return;
+
+        encodeTermination();
+
+        encodeCharacters(text, 0, length);
+    }
+
+    public final void writeLowLevelText(String text) throws IOException {
+        final int length = text.length();
+        if (length == 0)
+            return;
+
+        encodeTermination();
+
+        if (length < _charBuffer.length) {
+            text.getChars(0, length, _charBuffer, 0);
+            encodeCharacters(_charBuffer, 0, length);
+        } else {
+            final char ch[] = text.toCharArray();
+            encodeCharactersNoClone(ch, 0, length);
+        }
+    }
+
+    public final void writeLowLevelOctets(byte[] octets, int length) throws IOException {
+        if (length == 0)
+            return;
+
+        encodeTermination();
+
+        encodeCIIOctetAlgorithmData(EncodingAlgorithmIndexes.BASE64, octets, 0, length);
+    }
+
+    private boolean encodeElement(int type, String namespaceURI, String prefix, String localName) throws IOException {
+        final LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(localName);
+        for (int i = 0; i < entry._valueIndex; i++) {
+            final QualifiedName name = entry._value[i];
+            if ((prefix == name.prefix || prefix.equals(name.prefix))
+                    && (namespaceURI == name.namespaceName || namespaceURI.equals(name.namespaceName))) {
+                _b = type;
+                encodeNonZeroIntegerOnThirdBit(name.index);
+                return true;
+            }
+        }
+
+        entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.elementName.getNextIndex()));
+        return false;
+    }
+
+    private boolean encodeAttribute(String namespaceURI, String prefix, String localName) throws IOException {
+        final LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName);
+        for (int i = 0; i < entry._valueIndex; i++) {
+            final QualifiedName name = entry._value[i];
+            if ((prefix == name.prefix || prefix.equals(name.prefix))
+                    && (namespaceURI == name.namespaceName || namespaceURI.equals(name.namespaceName))) {
+                encodeNonZeroIntegerOnSecondBitFirstBitZero(name.index);
+                return true;
+            }
+        }
+
+        entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.attributeName.getNextIndex()));
+        return false;
+    }
+
+    private void encodeLiteralHeader(int type, String namespaceURI, String prefix) throws IOException {
+        if (namespaceURI != "") {
+            type |= EncodingConstants.LITERAL_QNAME_NAMESPACE_NAME_FLAG;
+            if (prefix != "")
+                type |= EncodingConstants.LITERAL_QNAME_PREFIX_FLAG;
+
+            write(type);
+            if (prefix != "")
+                encodeNonZeroIntegerOnSecondBitFirstBitOne(_v.prefix.get(prefix));
+            encodeNonZeroIntegerOnSecondBitFirstBitOne(_v.namespaceName.get(namespaceURI));
+        } else
+            write(type);
+    }
+
+    private void encodeLiteral(int type, String namespaceURI, String prefix, String localName) throws IOException {
+        encodeLiteralHeader(type, namespaceURI, prefix);
+
+        final int localNameIndex = _v.localName.obtainIndex(localName);
+        if (localNameIndex == -1) {
+            encodeNonEmptyOctetStringOnSecondBit(localName);
+        } else
+            encodeNonZeroIntegerOnSecondBitFirstBitOne(localNameIndex);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java
index c37b371..bc88dea 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java
index b2b6d41..071e3b9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java
index 1f39b7a..95c3319 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java
index 4731425..05d9988 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java
index e95c24b..89154a5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java
index 4413d88..fcf9389 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,37 +25,11 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 import java.util.Iterator;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+import java.util.NoSuchElementException;
 
 
 public class EmptyIterator implements Iterator {
@@ -69,8 +43,8 @@
     public boolean hasNext() {
         return false;
     }
-    public Object next() {
-        return null;
+    public Object next() throws NoSuchElementException {
+        throw new NoSuchElementException();
     }
     public void remove() {
          throw new  UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.emptyIterator"));
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java
index ead84b1..ac22015 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java
index ccb75cc..d9721f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java
index bb7df06..9f45b97 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
@@ -128,6 +101,18 @@
         return _baseURI;
     }
 
+    public void setPublicId(String publicId) {
+        _publicId = publicId;
+    }
+
+    public void setSystemId(String systemId) {
+        _systemId = systemId;
+    }
+
+    public void setBaseURI(String baseURI) {
+        _baseURI = baseURI;
+    }
+
     public void setName(String entityName){
         _entityName = entityName;
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java
index b52b950..36c5e1b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java
index 9e8e443..a0bdabf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java
index 76b9f2b..1861cdb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java
index f8b95a7..546c0c1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java
index a943b3a..f4cefa8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.events;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocator.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocator.java
index 5ca5067..582200e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.events;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java
index d12c460..82d58d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java
index 4cf1be0..2aeac66 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java
index 628d641..b7cbdf5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java
index cd21dda..8587d5f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,9 @@
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
 /*
  * StAXFilteredEvent.java
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java
index cd70c06..3bee013 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java
index d7b8f2f..dfb40ce 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.events ;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java
index e53e7e7..526c464 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.fastinfoset.stax.events;
 
 import javax.xml.stream.XMLStreamConstants;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java
index 3d1e4af..0fc46a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.events;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java
index 2878360..2622acb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.factory;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java
index 3709beb..0e7c7553 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.factory;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java
index 2098688..2fc9db4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.stax.factory;
@@ -113,7 +86,7 @@
                 }
             }
         }
-        else if(result instanceof Result){
+        else {
             try{
                 //xxx: should we be using FileOutputStream - nb.
                 FileWriter writer = new FileWriter(new File(result.getSystemId()));
@@ -144,7 +117,7 @@
 
     public Object getProperty(String name) throws java.lang.IllegalArgumentException {
         if(name == null){
-            throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{name}));
+            throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{null}));
         }
         if(_manager.containsProperty(name))
             return _manager.getProperty(name);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java
index 589260a..b8f773e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java
index ca8ff1b..a1317f3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.stax.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java
index 1cc95b1..20715b0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
@@ -71,7 +43,7 @@
 
 public class FI_DOM_Or_XML_DOM_SAX_SAXEvent extends TransformInputOutput {
 
-    public void parse(InputStream document, OutputStream events) throws Exception {
+    public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
         if (!document.markSupported()) {
             document = new BufferedInputStream(document);
         }
@@ -90,6 +62,9 @@
             DOMDocumentParser ddp = new DOMDocumentParser();
             ddp.parse(d, document);
         } else {
+            if (workingDirectory != null) {
+                db.setEntityResolver(createRelativePathResolver(workingDirectory));
+            }
             d = db.parse(document);
         }
 
@@ -100,6 +75,10 @@
         t.transform(new DOMSource(d), new SAXResult(ses));
     }
 
+    public void parse(InputStream document, OutputStream events) throws Exception {
+        parse(document, events, null);
+    }
+
     public static void main(String[] args) throws Exception {
         FI_DOM_Or_XML_DOM_SAX_SAXEvent p = new FI_DOM_Or_XML_DOM_SAX_SAXEvent();
         p.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java
index ed3a04a..c72b4b8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,38 +25,13 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
 import com.sun.xml.internal.fastinfoset.Decoder;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.sax.SAXSource;
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource;
 import java.io.BufferedInputStream;
 import java.io.InputStream;
@@ -67,13 +42,15 @@
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.stream.StreamSource;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
 
 public class FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent extends TransformInputOutput {
 
     public FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent() {
     }
 
-    public void parse(InputStream document, OutputStream events) throws Exception {
+    public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
         if (!document.markSupported()) {
             document = new BufferedInputStream(document);
         }
@@ -88,6 +65,13 @@
 
         if (isFastInfosetDocument) {
             t.transform(new FastInfosetSource(document), dr);
+        } else if (workingDirectory != null) {
+            SAXParser parser = getParser();
+            XMLReader reader = parser.getXMLReader();
+            reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+            SAXSource source = new SAXSource(reader, new InputSource(document));
+
+            t.transform(source, dr);
         } else {
             t.transform(new StreamSource(document), dr);
         }
@@ -96,6 +80,20 @@
         t.transform(new DOMSource(dr.getNode()), new SAXResult(ses));
     }
 
+    public void parse(InputStream document, OutputStream events) throws Exception {
+        parse(document, events, null);
+    }
+
+    private SAXParser getParser() {
+        SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+        saxParserFactory.setNamespaceAware(true);
+        try {
+            return saxParserFactory.newSAXParser();
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
     public static void main(String[] args) throws Exception {
         FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent p = new FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent();
         p.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java
index 8c10474..3cd0d73 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
@@ -64,13 +36,15 @@
 import java.io.OutputStream;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
 
 public class FI_SAX_Or_XML_SAX_SAXEvent extends TransformInputOutput {
 
     public FI_SAX_Or_XML_SAX_SAXEvent() {
     }
 
-    public void parse(InputStream document, OutputStream events) throws Exception {
+    public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
         if (!document.markSupported()) {
             document = new BufferedInputStream(document);
         }
@@ -90,11 +64,21 @@
             parserFactory.setNamespaceAware(true);
             SAXParser parser = parserFactory.newSAXParser();
             SAXEventSerializer ses = new SAXEventSerializer(events);
-            parser.setProperty(Properties.LEXICAL_HANDLER_PROPERTY, ses);
-            parser.parse(document, ses);
+
+            XMLReader reader = parser.getXMLReader();
+            reader.setProperty("http://xml.org/sax/properties/lexical-handler", ses);
+            reader.setContentHandler(ses);
+            if (workingDirectory != null) {
+                reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+            }
+            reader.parse(new InputSource(document));
         }
     }
 
+    public void parse(InputStream document, OutputStream events) throws Exception {
+        parse(document, events, null);
+    }
+
     public static void main(String[] args) throws Exception {
         FI_SAX_Or_XML_SAX_SAXEvent p = new FI_SAX_Or_XML_SAX_SAXEvent();
         p.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java
index 29043a6..36f1e28 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java
index 577ea3d..d87c7e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java
index 299dbd6..70e7d31 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java
index c658402..20a71e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
@@ -158,13 +131,15 @@
     public void startPrefixMapping(String prefix, String uri)
         throws SAXException
     {
-        try {
-            _writer.setPrefix(prefix, uri);
+    // Commented as in StAX NS are declared for current element?
+    // now _writer.setPrefix() is invoked in _writer.writeNamespace()
+//        try {
+//            _writer.setPrefix(prefix, uri);
             _namespaces.add(new QualifiedName(prefix, uri));
-        }
-        catch (XMLStreamException e) {
-            throw new SAXException(e);
-        }
+//        }
+//        catch (XMLStreamException e) {
+//            throw new SAXException(e);
+//        }
     }
 
     public void endPrefixMapping(String prefix) throws SAXException {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java
index 4c416be..2380cfa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
@@ -118,7 +91,7 @@
             _namespaceAttributes = new ArrayList();
         }
 
-        String qName = (prefix == "") ? "xmlns" : "xmlns" + prefix;
+        String qName = (prefix.length() == 0) ? "xmlns" : "xmlns" + prefix;
         AttributeValueHolder attribute = new AttributeValueHolder(
                 qName,
                 prefix,
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java
index e641b36..f013a5f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
@@ -185,7 +158,7 @@
                 case XMLStreamConstants.END_DOCUMENT:
                     break;
                 default:
-                    throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.StAX2SAXReader", new Object[]{new Integer(event)}));
+                    throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.StAX2SAXReader", new Object[]{Integer.valueOf(event)}));
                 } // switch
             }
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java
index dee0db0..1fc0f38 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,44 +25,23 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+import java.net.URI;
+import java.net.URISyntaxException;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 public abstract class TransformInputOutput {
 
@@ -89,5 +68,85 @@
         parse(in, out);
     }
 
-    abstract void parse(InputStream in, OutputStream out) throws Exception;
+    abstract public void parse(InputStream in, OutputStream out) throws Exception;
+
+    // parse alternative with current working directory parameter
+    // is used to process xml documents, which have external imported entities
+    public void parse(InputStream in, OutputStream out, String workingDirectory) throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
+    private static URI currentJavaWorkingDirectory;
+    static {
+        currentJavaWorkingDirectory = new File(System.getProperty("user.dir")).toURI();
+    }
+
+    protected static EntityResolver createRelativePathResolver(final String workingDirectory) {
+        return new EntityResolver() {
+            public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+                if (systemId != null && systemId.startsWith("file:/")) {
+                    URI workingDirectoryURI = new File(workingDirectory).toURI();
+                    URI workingFile;
+                    try {
+                        // Construction new File(new URI(String)).toURI() is used to be sure URI has correct representation without redundant '/'
+                        workingFile = convertToNewWorkingDirectory(currentJavaWorkingDirectory, workingDirectoryURI, new File(new URI(systemId)).toURI());
+                        return new InputSource(workingFile.toString());
+                    } catch (URISyntaxException ex) {
+                        //Should not get here
+                    }
+                }
+                return null;
+            }
+        };
+    }
+
+    private static URI convertToNewWorkingDirectory(URI oldwd, URI newwd, URI file) throws IOException, URISyntaxException {
+        String oldwdStr = oldwd.toString();
+        String newwdStr = newwd.toString();
+        String fileStr = file.toString();
+
+        String cmpStr = null;
+        // In simpliest case <user.dir>/file.xml - do it faster
+        if (fileStr.startsWith(oldwdStr) && (cmpStr = fileStr.substring(oldwdStr.length())).indexOf('/') == -1) {
+            return new URI(newwdStr + '/' + cmpStr);
+        }
+
+        String[] oldwdSplit = oldwdStr.split("/");
+        String[] newwdSplit = newwdStr.split("/");
+        String[] fileSplit = fileStr.split("/");
+
+        int diff;
+        for(diff = 0; diff<oldwdSplit.length & diff<fileSplit.length; diff++) {
+            if (!oldwdSplit[diff].equals(fileSplit[diff])) {
+                break;
+            }
+        }
+
+        int diffNew;
+        for(diffNew=0; diffNew<newwdSplit.length && diffNew<fileSplit.length; diffNew++) {
+            if (!newwdSplit[diffNew].equals(fileSplit[diffNew])) {
+                break;
+            }
+        }
+
+        //Workaround for case, when extrnal imported entity has imports other entity
+        //in that case systemId has correct path, not based on user.dir
+        if (diffNew > diff) {
+            return file;
+        }
+
+        int elemsToSub = oldwdSplit.length - diff;
+        StringBuffer resultStr = new StringBuffer(100);
+        for(int i=0; i<newwdSplit.length - elemsToSub; i++) {
+            resultStr.append(newwdSplit[i]);
+            resultStr.append('/');
+        }
+
+        for(int i=diff; i<fileSplit.length; i++) {
+            resultStr.append(fileSplit[i]);
+            if (i < fileSplit.length - 1) resultStr.append('/');
+        }
+
+        return new URI(resultStr.toString());
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java
index 36c62de..ded97a5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.tools;
@@ -223,7 +196,7 @@
 
 
     public void addToTable(String s, Set v, StringIntMap m, StringArray a) {
-        if (s == "") {
+        if (s.length() == 0) {
             return;
         }
 
@@ -235,7 +208,7 @@
     }
 
     public void addToTable(String s, Set v, StringIntMap m, PrefixArray a) {
-        if (s == "") {
+        if (s.length() == 0) {
             return;
         }
 
@@ -272,18 +245,18 @@
         int namespaceURIIndex = -1;
         int prefixIndex = -1;
         int localNameIndex = -1;
-        if (namespaceURI != "") {
+        if (namespaceURI.length() > 0) {
             namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
             if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
                 throw new SAXException(CommonResourceBundle.getInstance().
-                        getString("message.namespaceURINotIndexed", new Object[]{new Integer(namespaceURIIndex)}));
+                        getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
             }
 
-            if (prefix != "") {
+            if (prefix.length() > 0) {
                 prefixIndex = _serializerVocabulary.prefix.get(prefix);
                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                     throw new SAXException(CommonResourceBundle.getInstance().
-                            getString("message.prefixNotIndexed", new Object[]{new Integer(prefixIndex)}));
+                            getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
                 }
             }
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java
index d1b4ab1..621d1b0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,9 @@
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-
 package com.sun.xml.internal.fastinfoset.tools;
 
 import com.sun.xml.internal.fastinfoset.dom.DOMDocumentSerializer;
@@ -38,10 +38,13 @@
     public XML_DOM_FI() {
     }
 
-    public void parse(InputStream document, OutputStream finf) throws Exception {
+    public void parse(InputStream document, OutputStream finf, String workingDirectory) throws Exception {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         DocumentBuilder db = dbf.newDocumentBuilder();
+        if (workingDirectory != null) {
+            db.setEntityResolver(createRelativePathResolver(workingDirectory));
+        }
         Document d = db.parse(document);
 
         DOMDocumentSerializer s = new DOMDocumentSerializer();
@@ -49,6 +52,10 @@
         s.serialize(d);
     }
 
+    public void parse(InputStream document, OutputStream finf) throws Exception {
+        parse(document, finf, null);
+    }
+
     public static void main(String[] args) throws Exception {
         XML_DOM_FI p = new XML_DOM_FI();
         p.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java
index d50276a..9053e259 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
@@ -73,10 +45,13 @@
     public XML_DOM_SAX_FI() {
     }
 
-    public void parse(InputStream document, OutputStream finf) throws Exception {
+    public void parse(InputStream document, OutputStream finf, String workingDirectory) throws Exception {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         DocumentBuilder db = dbf.newDocumentBuilder();
+        if (workingDirectory != null) {
+            db.setEntityResolver(createRelativePathResolver(workingDirectory));
+        }
         Document d = db.parse(document);
 
         TransformerFactory tf = TransformerFactory.newInstance();
@@ -84,6 +59,10 @@
         t.transform(new DOMSource(d), new FastInfosetResult(finf));
     }
 
+    public void parse(InputStream document, OutputStream finf) throws Exception {
+        parse(document, finf, null);
+    }
+
     public static void main(String[] args) throws Exception {
         XML_DOM_SAX_FI p = new XML_DOM_SAX_FI();
         p.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java
index 4377c17..93d5281 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
@@ -63,18 +35,29 @@
 import javax.xml.parsers.SAXParserFactory;
 import java.io.Reader;
 import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
 
 public class XML_SAX_FI extends TransformInputOutput {
 
     public XML_SAX_FI() {
     }
 
-    public void parse(InputStream xml, OutputStream finf) throws Exception {
+    public void parse(InputStream xml, OutputStream finf, String workingDirectory) throws Exception {
         SAXParser saxParser = getParser();
         SAXDocumentSerializer documentSerializer = getSerializer(finf);
 
-        saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", documentSerializer);
-        saxParser.parse(xml, documentSerializer);
+        XMLReader reader = saxParser.getXMLReader();
+        reader.setProperty("http://xml.org/sax/properties/lexical-handler", documentSerializer);
+        reader.setContentHandler(documentSerializer);
+
+        if (workingDirectory != null) {
+            reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+        }
+        reader.parse(new InputSource(xml));
+    }
+
+    public void parse(InputStream xml, OutputStream finf) throws Exception {
+        parse(xml, finf, null);
     }
 
     public void convert(Reader reader, OutputStream finf) throws Exception {
@@ -92,8 +75,7 @@
         saxParserFactory.setNamespaceAware(true);
         try {
             return saxParserFactory.newSAXParser();
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             return null;
         }
     }
@@ -103,6 +85,7 @@
         documentSerializer.setOutputStream(finf);
         return documentSerializer;
     }
+
     public static void main(String[] args) throws Exception {
         XML_SAX_FI s = new XML_SAX_FI();
         s.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java
index 81a6f2b..5cd8d55 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.tools;
 
@@ -61,14 +33,15 @@
 import java.io.OutputStream;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import com.sun.xml.internal.fastinfoset.tools.SAX2StAXWriter;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
 
 public class XML_SAX_StAX_FI extends TransformInputOutput {
 
     public XML_SAX_StAX_FI() {
     }
 
-    public void parse(InputStream xml, OutputStream finf) throws Exception {
+    public void parse(InputStream xml, OutputStream finf, String workingDirectory) throws Exception {
         StAXDocumentSerializer documentSerializer = new StAXDocumentSerializer();
         documentSerializer.setOutputStream(finf);
 
@@ -78,12 +51,23 @@
         saxParserFactory.setNamespaceAware(true);
         SAXParser saxParser = saxParserFactory.newSAXParser();
 
-        saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", saxTostax);
-        saxParser.parse(xml, saxTostax);
+        XMLReader reader = saxParser.getXMLReader();
+        reader.setProperty("http://xml.org/sax/properties/lexical-handler", saxTostax);
+        reader.setContentHandler(saxTostax);
+
+        if (workingDirectory != null) {
+            reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+        }
+        reader.parse(new InputSource(xml));
+
         xml.close();
         finf.close();
     }
 
+    public void parse(InputStream xml, OutputStream finf) throws Exception {
+        parse(xml, finf, null);
+    }
+
     public static void main(String[] args) throws Exception {
         XML_SAX_StAX_FI s = new XML_SAX_StAX_FI();
         s.parse(args);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java
index 0d199d7..a19d961 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.util;
 
@@ -107,6 +79,8 @@
     }
 
     public static final int hashCode(char[] ch, int start, int length) {
+        // Same hash code algorithm as used for String
+        // s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
         int hash = 0;
         for (int i = start; i < start + length; i++) {
             hash = 31*hash + ch[i];
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java
index d223b06..f2715d9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java
index a2aba6c..5fa6422 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,18 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.util;
+
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
 
 public class CharArrayIntMap extends KeyIntMap {
 
     private CharArrayIntMap _readOnlyMap;
 
+    // Total character count of Map
+    protected int _totalCharacterCount;
+
     static class Entry extends BaseEntry {
         final char[] _ch;
         final int _start;
@@ -113,6 +89,7 @@
             _table[i] = null;
         }
         _size = 0;
+        _totalCharacterCount = 0;
     }
 
     public final void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear) {
@@ -166,6 +143,10 @@
         return NOT_PRESENT;
     }
 
+    public final int getTotalCharacterCount() {
+        return _totalCharacterCount;
+    }
+
     private final int get(char[] ch, int start, int length, int hash) {
         if (_readOnlyMap != null) {
             final int i = _readOnlyMap.get(ch, start, length, hash);
@@ -187,7 +168,8 @@
     private final void addEntry(char[] ch, int start, int length, int hash, int value, int bucketIndex) {
         Entry e = _table[bucketIndex];
         _table[bucketIndex] = new Entry(ch, start, length, hash, value, e);
-        if (_size++ >= _threshold) {
+        _totalCharacterCount += length;
+                if (_size++ >= _threshold) {
             resize(2 * _table.length);
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java
index ff8196c..0e9a1db 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java
index e575960..80154d7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.fastinfoset.util;
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
@@ -178,6 +150,24 @@
         return _cachedStrings[i] = new String(_array, _offset[i], _length[i]);
     }
 
+    public final void ensureSize(int l) {
+        if (_arrayIndex + l >= _array.length) {
+            resizeArray(_arrayIndex + l);
+        }
+    }
+
+    public final void add(int l) {
+        if (_size == _offset.length) {
+            resize();
+        }
+
+        _cachedIndex = _size;
+        _offset[_size] = _arrayIndex;
+        _length[_size++] = l;
+
+        _arrayIndex += l;
+    }
+
     public final int add(char[] c, int l) {
         if (_size == _offset.length) {
             resize();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java
index 9111ef2..7a2cb93 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,9 @@
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-
 package com.sun.xml.internal.fastinfoset.util;
 
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java
index a8ef866..c1e70ac 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -68,7 +41,7 @@
         // Add the fixed entry
         final int hash = hashHash(fixedEntry.hashCode());
         final int tableIndex = indexFor(hash, _table.length);
-        _table[tableIndex] = _fixedEntry = new Entry(fixedEntry, hash, 0, null);
+        _table[tableIndex] = _fixedEntry = new Entry(fixedEntry, hash, _index++, null);
         if (_size++ >= _threshold) {
             resize(2 * _table.length);
         }
@@ -86,11 +59,17 @@
         for (int i = 0; i < _table.length; i++) {
             _table[i] = null;
         }
+        _lastEntry = NULL_ENTRY;
+
         if (_fixedEntry != null) {
             final int tableIndex = indexFor(_fixedEntry._hash, _table.length);
             _table[tableIndex] = _fixedEntry;
             _fixedEntry._next = null;
             _size = 1;
+            _index = _readOnlyMapSize + 1;
+        } else {
+            _size = 0;
+            _index = _readOnlyMapSize;
         }
     }
 
@@ -108,6 +87,7 @@
         if (_readOnlyMap != null) {
             readOnlyMap.removeFixedEntry();
             _readOnlyMapSize = readOnlyMap.size();
+            _index = _readOnlyMapSize + _size;
             if (clear) {
                 clear();
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java
index f81fd00..da7aab4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -109,12 +82,12 @@
     public KeyIntMap(int initialCapacity, float loadFactor) {
         if (initialCapacity < 0)
             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
-                    getString("message.illegalInitialCapacity", new Object[]{new Integer(initialCapacity)}));
+                    getString("message.illegalInitialCapacity", new Object[]{Integer.valueOf(initialCapacity)}));
         if (initialCapacity > MAXIMUM_CAPACITY)
             initialCapacity = MAXIMUM_CAPACITY;
         if (loadFactor <= 0 || Float.isNaN(loadFactor))
             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
-                    getString("message.illegalLoadFactor", new Object[]{new Float(loadFactor)}));
+                    getString("message.illegalLoadFactor", new Object[]{Float.valueOf(loadFactor)}));
 
         // Find a power of 2 >= initialCapacity
         if (initialCapacity != DEFAULT_INITIAL_CAPACITY) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java
index b91fd4a..efbcef5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -143,13 +116,16 @@
         }
     }
 
+    public final boolean isQNameFromReadOnlyMap(QualifiedName name) {
+        return (_readOnlyMap != null && name.index <= _readOnlyMap.getIndex());
+    }
+
     public final int getNextIndex() {
         return _index++;
     }
 
     public final int getIndex() {
         return _index;
-
     }
 
     public final Entry obtainEntry(String key) {
@@ -172,6 +148,19 @@
         return addEntry(key, hash, tableIndex);
     }
 
+    public final Entry obtainDynamicEntry(String key) {
+        final int hash = hashHash(key.hashCode());
+
+        final int tableIndex = indexFor(hash, _table.length);
+        for (Entry e = _table[tableIndex]; e != null; e = e._next) {
+            if (e._hash == hash && eq(key, e._key)) {
+                return e;
+            }
+        }
+
+        return addEntry(key, hash, tableIndex);
+    }
+
     private final Entry getEntry(String key, int hash) {
         if (_readOnlyMap != null) {
             final Entry entry = _readOnlyMap.getEntry(key, hash);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/NamespaceContextImplementation.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/NamespaceContextImplementation.java
new file mode 100644
index 0000000..f821395
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/NamespaceContextImplementation.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.fastinfoset.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final public class NamespaceContextImplementation implements NamespaceContext {
+    private static int DEFAULT_SIZE = 8;
+
+    private String[] prefixes = new String[DEFAULT_SIZE];
+    private String[] namespaceURIs = new String[DEFAULT_SIZE];
+    private int namespacePosition;
+
+    private int[] contexts = new int[DEFAULT_SIZE];
+    private int contextPosition;
+
+    private int currentContext;
+
+    public NamespaceContextImplementation() {
+        prefixes[0] = "xml";
+        namespaceURIs[0] = "http://www.w3.org/XML/1998/namespace";
+        prefixes[1] = "xmlns";
+        namespaceURIs[1] = "http://www.w3.org/2000/xmlns/";
+
+        currentContext = namespacePosition = 2;
+    }
+
+
+    public String getNamespaceURI(String prefix) {
+        if (prefix == null) throw new IllegalArgumentException();
+
+        prefix = prefix.intern();
+
+        for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredPrefix = prefixes[i];
+            if (declaredPrefix == prefix) {
+                return namespaceURIs[i];
+            }
+        }
+
+        return "";
+    }
+
+    public String getPrefix(String namespaceURI) {
+        if (namespaceURI == null) throw new IllegalArgumentException();
+
+        // namespaceURI = namespaceURI.intern();
+
+        for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredNamespaceURI = namespaceURIs[i];
+            if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                final String declaredPrefix = prefixes[i];
+
+                // Check if prefix is out of scope
+                for (++i; i < namespacePosition; i++)
+                    if (declaredPrefix == prefixes[i])
+                        return null;
+
+                return declaredPrefix;
+            }
+        }
+
+        return null;
+    }
+
+    public String getNonDefaultPrefix(String namespaceURI) {
+        if (namespaceURI == null) throw new IllegalArgumentException();
+
+        // namespaceURI = namespaceURI.intern();
+
+        for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredNamespaceURI = namespaceURIs[i];
+            if ((declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) &&
+                prefixes[i].length() > 0){
+                final String declaredPrefix = prefixes[i];
+
+                // Check if prefix is out of scope
+                for (++i; i < namespacePosition; i++)
+                    if (declaredPrefix == prefixes[i])
+                        return null;
+
+                return declaredPrefix;
+            }
+        }
+
+        return null;
+    }
+
+    public Iterator getPrefixes(String namespaceURI) {
+        if (namespaceURI == null) throw new IllegalArgumentException();
+
+        // namespaceURI = namespaceURI.intern();
+
+        List l = new ArrayList();
+
+        NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredNamespaceURI = namespaceURIs[i];
+            if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                final String declaredPrefix = prefixes[i];
+
+                // Check if prefix is out of scope
+                for (int j = i + 1; j < namespacePosition; j++)
+                    if (declaredPrefix == prefixes[j])
+                        continue NAMESPACE_LOOP;
+
+                l.add(declaredPrefix);
+            }
+        }
+
+        return l.iterator();
+    }
+
+
+    public String getPrefix(int index) {
+        return prefixes[index];
+    }
+
+    public String getNamespaceURI(int index) {
+        return namespaceURIs[index];
+    }
+
+    public int getCurrentContextStartIndex() {
+        return currentContext;
+    }
+
+    public int getCurrentContextEndIndex() {
+        return namespacePosition;
+    }
+
+    public boolean isCurrentContextEmpty() {
+        return currentContext == namespacePosition;
+    }
+
+    public void declarePrefix(String prefix, String namespaceURI) {
+        prefix = prefix.intern();
+        namespaceURI = namespaceURI.intern();
+
+        // Ignore the "xml" or "xmlns" declarations
+        if (prefix == "xml" || prefix == "xmlns")
+            return;
+
+        // Replace any previous declaration
+        for (int i = currentContext; i < namespacePosition; i++) {
+            final String declaredPrefix = prefixes[i];
+            if (declaredPrefix == prefix) {
+                prefixes[i] = prefix;
+                namespaceURIs[i] = namespaceURI;
+                return;
+            }
+        }
+
+        if (namespacePosition == namespaceURIs.length)
+            resizeNamespaces();
+
+        // Add new declaration
+        prefixes[namespacePosition] = prefix;
+        namespaceURIs[namespacePosition++] = namespaceURI;
+    }
+
+    private void resizeNamespaces() {
+        final int newLength = namespaceURIs.length * 3 / 2 + 1;
+
+        String[] newPrefixes = new String[newLength];
+        System.arraycopy(prefixes, 0, newPrefixes, 0, prefixes.length);
+        prefixes = newPrefixes;
+
+        String[] newNamespaceURIs = new String[newLength];
+        System.arraycopy(namespaceURIs, 0, newNamespaceURIs, 0, namespaceURIs.length);
+        namespaceURIs = newNamespaceURIs;
+    }
+
+    public void pushContext() {
+        if (contextPosition == contexts.length)
+            resizeContexts();
+
+        contexts[contextPosition++] = currentContext = namespacePosition;
+    }
+
+    private void resizeContexts() {
+        int[] newContexts = new int[contexts.length * 3 / 2 + 1];
+        System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
+        contexts = newContexts;
+    }
+
+    public void popContext() {
+        if (contextPosition > 0) {
+            namespacePosition = currentContext = contexts[--contextPosition];
+        }
+    }
+
+    public void reset() {
+        currentContext = namespacePosition = 2;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java
index beac788b..8860bc9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,35 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
-
 package com.sun.xml.internal.fastinfoset.util;
 
 import com.sun.xml.internal.fastinfoset.EncodingConstants;
@@ -302,13 +273,13 @@
         System.arraycopy(_array, 0, newArray, 0, _size);
         _array = newArray;
 
-        newSize += _readOnlyArraySize;
-        final NamespaceEntry[] newInScopeNamespaces = new NamespaceEntry[newSize + 2];
-        System.arraycopy(_inScopeNamespaces, 0, newInScopeNamespaces, 0, _readOnlyArraySize + _size + 2);
+        newSize += 2;
+        final NamespaceEntry[] newInScopeNamespaces = new NamespaceEntry[newSize];
+        System.arraycopy(_inScopeNamespaces, 0, newInScopeNamespaces, 0, _inScopeNamespaces.length);
         _inScopeNamespaces = newInScopeNamespaces;
 
-        final int[] newCurrentInScope = new int[newSize + 2];
-        System.arraycopy(_currentInScope, 0, newCurrentInScope, 0, _readOnlyArraySize + _size + 2);
+        final int[] newCurrentInScope = new int[newSize];
+        System.arraycopy(_currentInScope, 0, newCurrentInScope, 0, _currentInScope.length);
         _currentInScope = newCurrentInScope;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java
index 8f77810..da92f9d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -75,9 +48,6 @@
     }
 
     public final void clear() {
-        for (int i = _readOnlyArraySize; i < _size; i++) {
-            _array[i] = null;
-        }
         _size = _readOnlyArraySize;
     }
 
@@ -119,8 +89,8 @@
         }
     }
 
-    public final QualifiedName get(int i) {
-        return _array[i];
+    public final QualifiedName getNext() {
+        return (_size == _array.length) ? null : _array[_size];
     }
 
     public final void add(QualifiedName s) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java
index 99c2a91..cdc39fb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -63,17 +36,20 @@
 
     private StringArray _readOnlyArray;
 
-    public StringArray(int initialCapacity, int maximumCapacity) {
+    private boolean _clear;
+
+    public StringArray(int initialCapacity, int maximumCapacity, boolean clear) {
         _array = new String[initialCapacity];
         _maximumCapacity = maximumCapacity;
+        _clear = clear;
     }
 
     public StringArray() {
-        this(DEFAULT_CAPACITY, MAXIMUM_CAPACITY);
+        this(DEFAULT_CAPACITY, MAXIMUM_CAPACITY, false);
     }
 
     public final void clear() {
-        for (int i = _readOnlyArraySize; i < _size; i++) {
+        if (_clear) for (int i = _readOnlyArraySize; i < _size; i++) {
             _array[i] = null;
         }
         _size = _readOnlyArraySize;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java
index b81ea10..38a7582 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
@@ -59,6 +32,7 @@
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
 
 public class StringIntMap extends KeyIntMap {
+    protected static final Entry NULL_ENTRY = new Entry(null, 0, -1, null);
 
     protected StringIntMap _readOnlyMap;
 
@@ -73,8 +47,15 @@
         }
     }
 
+    protected Entry _lastEntry = NULL_ENTRY;
+
     protected Entry[] _table;
 
+    protected int _index;
+
+    // Total character count of Map
+    protected int _totalCharacterCount;
+
     public StringIntMap(int initialCapacity, float loadFactor) {
         super(initialCapacity, loadFactor);
 
@@ -93,7 +74,10 @@
         for (int i = 0; i < _table.length; i++) {
             _table[i] = null;
         }
+        _lastEntry = NULL_ENTRY;
         _size = 0;
+        _index = _readOnlyMapSize;
+        _totalCharacterCount = 0;
     }
 
     public void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear) {
@@ -109,15 +93,25 @@
         _readOnlyMap = readOnlyMap;
         if (_readOnlyMap != null) {
             _readOnlyMapSize = _readOnlyMap.size();
+            _index = _size + _readOnlyMapSize;
 
             if (clear) {
                 clear();
             }
         }  else {
             _readOnlyMapSize = 0;
+            _index = _size;
         }
     }
 
+    public final int getNextIndex() {
+        return _index++;
+    }
+
+    public final int getIndex() {
+        return _index;
+    }
+
     public final int obtainIndex(String key) {
         final int hash = hashHash(key.hashCode());
 
@@ -135,20 +129,27 @@
             }
         }
 
-        addEntry(key, hash, _size + _readOnlyMapSize, tableIndex);
+        addEntry(key, hash, tableIndex);
         return NOT_PRESENT;
     }
 
     public final void add(String key) {
         final int hash = hashHash(key.hashCode());
         final int tableIndex = indexFor(hash, _table.length);
-        addEntry(key, hash, _size + _readOnlyMapSize, tableIndex);
+        addEntry(key, hash, tableIndex);
     }
 
     public final int get(String key) {
+        if (key == _lastEntry._key)
+            return _lastEntry._value;
+
         return get(key, hashHash(key.hashCode()));
     }
 
+    public final int getTotalCharacterCount() {
+        return _totalCharacterCount;
+    }
+
     private final int get(String key, int hash) {
         if (_readOnlyMap != null) {
             final int i = _readOnlyMap.get(key, hash);
@@ -160,6 +161,7 @@
         final int tableIndex = indexFor(hash, _table.length);
         for (Entry e = _table[tableIndex]; e != null; e = e._next) {
             if (e._hash == hash && eq(key, e._key)) {
+                _lastEntry = e;
                 return e._value;
             }
         }
@@ -168,9 +170,10 @@
     }
 
 
-    private final void addEntry(String key, int hash, int value, int bucketIndex) {
+    private final void addEntry(String key, int hash, int bucketIndex) {
         Entry e = _table[bucketIndex];
-        _table[bucketIndex] = new Entry(key, hash, value, e);
+        _table[bucketIndex] = new Entry(key, hash, _index++, e);
+        _totalCharacterCount += key.length();
         if (_size++ >= _threshold) {
             resize(2 * _table.length);
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java
index 728a9b8..11704fe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.util;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java
index 41c7571..076e658 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java
index ab6f90c..4849c2f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.vocab;
@@ -80,18 +53,12 @@
     public static final String NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY =
         "com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary.NonIdentifyingStringTable.maximumCharacters";
 
-    protected static int IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS;
-    protected static int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS;
-    protected static int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS;
-
-    static {
-        IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
-                getIntegerValueFromProperty(IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
-        NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
-                getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
-        NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS =
-                getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY);
-    }
+    protected static final int IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
+            getIntegerValueFromProperty(IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
+    protected static final int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
+            getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
+    protected static final int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS =
+            getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY);
 
     private static int getIntegerValueFromProperty(String property) {
         String value = System.getProperty(property);
@@ -107,7 +74,7 @@
     }
 
     public final CharArrayArray restrictedAlphabet = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, 256);
-    public final StringArray encodingAlgorithm = new StringArray(ValueArray.DEFAULT_CAPACITY, 256);
+    public final StringArray encodingAlgorithm = new StringArray(ValueArray.DEFAULT_CAPACITY, 256, true);
 
     public final StringArray namespaceName;
     public final PrefixArray prefix;
@@ -128,12 +95,12 @@
 
     /** Creates a new instance of ParserVocabulary */
     public ParserVocabulary() {
-        namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
+        namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
         prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
-        localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
-        otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
-        otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
-        attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
+        localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
+        otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
+        otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
+        attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
         otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
 
         characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java
index 943374b..39cfdaa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.fastinfoset.vocab;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java
index 9e43a3f..b6b4c7f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.fastinfoset.vocab;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
index b403bf4..e986f03 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: SOAPExceptionImpl.java,v 1.3 2006/01/27 12:49:17 vj135062 Exp $
- * $Revision: 1.3 $
- * $Date: 2006/01/27 12:49:17 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPExceptionImpl.java,v 1.3 2006/01/27 12:49:17 vj135062 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2006/01/27 12:49:17 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj;
 
 import java.io.PrintStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
index a9f0535..643f2d5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
@@ -1,11 +1,5 @@
 /*
- * $Id: HttpSOAPConnection.java,v 1.41 2006/01/27 12:49:17 vj135062 Exp $
- * $Revision: 1.41 $
- * $Date: 2006/01/27 12:49:17 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HttpSOAPConnection.java,v 1.41 2006/01/27 12:49:17 vj135062 Exp $
+ * $Revision: 1.41 $
+ * $Date: 2006/01/27 12:49:17 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.client.p2p;
 
 import java.io.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
index 88b180a..340ceac 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
@@ -1,11 +1,5 @@
 /*
- * $Id: HttpSOAPConnectionFactory.java,v 1.6 2006/01/27 12:49:18 vj135062 Exp $
- * $Revision: 1.6 $
- * $Date: 2006/01/27 12:49:18 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HttpSOAPConnectionFactory.java,v 1.6 2006/01/27 12:49:18 vj135062 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/01/27 12:49:18 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.client.p2p;
 
 import javax.xml.soap.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
index 00e2468..3a4eaee 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages
 # Error messages
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
index e0065b2..778f446 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)Header.java    1.3 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
index d83cea8..0d2f1af 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MessagingException.java        1.10 02/06/13
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
index ed86e59..eb15ad9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MultipartDataSource.java       1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime;
 
@@ -42,6 +47,7 @@
  * This interface will typically be implemented by providers that
  * preparse multipart bodies, for example an IMAP provider.
  *
+ * @version     1.6, 02/03/27
  * @author      John Mani
  * @see         javax.activation.DataSource
  */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
index b7466df..7769bde 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MimeMultipart.java     1.31 03/01/29
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -210,7 +215,6 @@
         } catch (IOException ioex) {
             throw new MessagingException("IO Error", ioex);
         } catch (Exception ex) {
-            ex.printStackTrace();
             throw new MessagingException("Error", ex);
         }
 
@@ -496,16 +500,34 @@
                     // so if s == 1 : it must be an LF
                     // if s == 2 : it must be a CR LF
                     if (s <= 2) {
-                        String crlf = new String(prevBuffer, 0, s);
-                        if (!"\n".equals(crlf) && !"\r\n".equals(crlf)) {
-                            throw new Exception(
-                                "Boundary characters encountered in part Body " +
-                                "without a preceeding CRLF");
-                        } else {
-                            if (sin != null) {
-                                posVector[0] = endPos;
+                        //it could be "some-char\n" so write some-char
+                        if (s == 2) {
+                            if (prevBuffer[1] == '\n') {
+                                if (prevBuffer[0] != '\r' && prevBuffer[0] != '\n') {
+                                    out.write(prevBuffer,0,1);
+                                }
+                                if (sin != null) {
+                                    posVector[0] = endPos;
+                                }
+
+                            } else {
+                                throw new Exception(
+                                        "Boundary characters encountered in part Body " +
+                                        "without a preceeding CRLF");
+                            }
+
+                        } else if (s==1) {
+                            if (prevBuffer[0] != '\n') {
+                                throw new Exception(
+                                        "Boundary characters encountered in part Body " +
+                                        "without a preceeding CRLF");
+                            }else {
+                                if (sin != null) {
+                                    posVector[0] = endPos;
+                                }
                             }
                         }
+
                     } else if (s > 2) {
                         if ((prevBuffer[s-2] == '\r') && (prevBuffer[s-1] == '\n')) {
                             if (sin != null) {
@@ -530,7 +552,7 @@
                 // found the boundary, skip *LWSP-char and CRLF
                 if (!skipLWSPAndCRLF(is)) {
                     //throw new Exception(
-                     //   "Boundary does not terminate with CRLF");
+                    //   "Boundary does not terminate with CRLF");
                 }
                 return true;
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
index 0774051..62724f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)ContentDisposition.java        1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -31,6 +36,7 @@
  * methods to parse a ContentDisposition string into individual components
  * and to generate a MIME style ContentDisposition string.
  *
+ * @version 1.6, 02/03/27
  * @author  John Mani
  */
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
index 082cc51..8e18b9d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)ContentType.java       1.7 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -31,6 +36,7 @@
  * methods to parse a ContentType string into individual components
  * and to generate a MIME style ContentType string.
  *
+ * @version 1.7, 02/03/27
  * @author  John Mani
  */
 public final class ContentType {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
index 7486de6..acf827a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)HeaderTokenizer.java   1.9 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -34,6 +39,7 @@
  * CRLF SPACE sequences). The folds are removed in the returned
  * tokens.
  *
+ * @version 1.9, 02/03/27
  * @author  John Mani
  */
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
index 15c106c..5e8f734 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)InternetHeaders.java   1.16 02/08/08
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
index 12c9364..a3e810f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MimeBodyPart.java      1.52 03/02/12
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
index 4394aed..693b40a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MimeMultipart.java     1.31 03/01/29
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -61,6 +66,7 @@
  * constructor.  For example, to create a "multipart/alternative" object,
  * use <code>new MimeMultipart("alternative")</code>.
  *
+ * @version 1.31, 03/01/29
  * @author  John Mani
  * @author  Bill Shannon
  * @author  Max Spivak
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
index e8d3298..8d77004 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MimePartDataSource.java        1.9 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
index 95c8f19..a5042c2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)MimeUtility.java       1.45 03/03/10
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -108,6 +113,7 @@
  * mail messages is different than the charset used for files stored on
  * the system, this property should be set.
  *
+ * @version 1.45, 03/03/10
  * @author  John Mani
  * @author  Bill Shannon
  */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
index 4fa98eb..1baebdb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)ParameterList.java     1.10 03/02/12
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -32,6 +37,7 @@
 /**
  * This class holds MIME parameters (attribute-value pairs).
  *
+ * @version 1.10, 03/02/12
  * @author  John Mani
  */
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
index 724fa67..1a7f1d0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)ParseException.java    1.3 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
index 4b993ad..c1ae4b3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)SharedInputStream.java 1.2 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
@@ -37,6 +42,7 @@
  * original InputStream.  The new InputStream will access the same
  * underlying data as the original, without copying the data.
  *
+ * @version 1.2, 02/03/27
  * @author  Bill Shannon
  * @since JavaMail 1.2
  */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
index 61d486a..5ccd70a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)UniqueValue.java       1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.internet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
index 9f33685..5b22430 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)ASCIIUtility.java      1.9 02/03/27
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
 import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
index 470ffde..c58cc7d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)BASE64DecoderStream.java       1.8 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
index 05d9cbc..09e592b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)BASE64EncoderStream.java       1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
index 1170a93..5501a79 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)BEncoderStream.java    1.3 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
index 93b8775..927e42b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)LineInputStream.java   1.7 03/01/07
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
index d0a6a90..7dc23fd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)OutputUtil.java  1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
index 358b7ce..3762daf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)QDecoderStream.java    1.5 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
index 2b635d2..7ad9271 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)QEncoderStream.java    1.4 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
index 3dcc0a1..535df0e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)QPDecoderStream.java   1.9 02/04/02
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
index ab323db..5a5a490 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)QPEncoderStream.java   1.6 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
index 625634c..b625d7c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)UUDecoderStream.java   1.8 02/07/08
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
index 6287228..bd52b53 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * @(#)UUEncoderStream.java   1.3 02/03/27
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
index 62ee4c4..9ded988 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: AttachmentPartImpl.java,v 1.45 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.45 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: AttachmentPartImpl.java,v 1.1.1.1.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+ * $Revision: 1.1.1.1.2.1 $
+ * $Date: 2007/11/27 07:19:29 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
@@ -91,6 +92,7 @@
                     "application/fastinfoset"
                         + hndlrStr
                         + "com.sun.xml.internal.messaging.saaj.soap.FastInfosetDataContentHandler");
+                /* Image DataContentHandler handles all image types
                 mailMap.addMailcap(
                     "image/jpeg"
                         + hndlrStr
@@ -98,7 +100,7 @@
                 mailMap.addMailcap(
                     "image/gif"
                         + hndlrStr
-                        + "com.sun.xml.internal.messaging.saaj.soap.GifDataContentHandler");
+                        + "com.sun.xml.internal.messaging.saaj.soap.GifDataContentHandler");*/
                 /*mailMap.addMailcap(
                     "multipart/*"
                         + hndlrStr
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
index 2c3301d..f136a46 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
@@ -1,11 +1,5 @@
 /*
- * $Id: Envelope.java,v 1.8 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.8 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Envelope.java,v 1.8 2006/01/27 12:49:26 vj135062 Exp $
+ * $Revision: 1.8 $
+ * $Date: 2006/01/27 12:49:26 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
index 1ae2aa1..81adca3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
@@ -1,11 +1,5 @@
 /*
- * $Id: EnvelopeFactory.java,v 1.24 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.24 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: EnvelopeFactory.java,v 1.24 2006/01/27 12:49:26 vj135062 Exp $
+ * $Revision: 1.24 $
+ * $Date: 2006/01/27 12:49:26 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
index 8056b0e..c4e2c23 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: FastInfosetDataContentHandler.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
- * $Revision: 1.1.1.1 $
- * $Date: 2006/01/27 13:10:56 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FastInfosetDataContentHandler.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
+ * $Revision: 1.1.1.1 $
+ * $Date: 2006/01/27 13:10:56 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.datatransfer.DataFlavor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
index 30e5154..587b09a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: GifDataContentHandler.java,v 1.15 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.15 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,14 +22,18 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: GifDataContentHandler.java,v 1.2.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+ * $Revision: 1.2.2.1 $
+ * $Date: 2007/11/27 07:19:29 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.datatransfer.DataFlavor;
 import java.io.*;
-
-import java.awt.image.BufferedImage;
 import java.awt.*;
-
 import javax.activation.*;
 
 /**
@@ -108,7 +106,7 @@
      */
     public void writeTo(Object obj, String type, OutputStream os)
                         throws IOException {
-        if (!(obj instanceof Image))
+        if (obj != null && !(obj instanceof Image))
             throw new IOException("\"" + getDF().getMimeType() +
                 "\" DataContentHandler requires Image object, " +
                 "was given object of type " + obj.getClass().toString());
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
index 23e957e..a8eed2e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: ImageDataContentHandler.java,v 1.5 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.5 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ImageDataContentHandler.java,v 1.1.1.1.2.1 2007/11/27 07:19:28 kumarjayanti Exp $
+ * $Revision: 1.1.1.1.2.1 $
+ * $Date: 2007/11/27 07:19:28 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.*;
@@ -144,6 +145,7 @@
                 stream = ImageIO.createImageOutputStream(os);
                 writer.setOutput(stream);
                 writer.write(bufImage);
+                writer.dispose();
                 stream.close();
             } else {
                 log.log(Level.SEVERE, "SAAJ0526.soap.unsupported.mime.type",
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
index e1cae6c..41391b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: JpegDataContentHandler.java,v 1.15 2006/01/27 12:49:26 vj135062 Exp $
- * $Revision: 1.15 $
- * $Date: 2006/01/27 12:49:26 $
- */
-
-/*
- * Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: JpegDataContentHandler.java,v 1.1.1.1.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+ * $Revision: 1.1.1.1.2.1 $
+ * $Date: 2007/11/27 07:19:29 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.*;
@@ -37,6 +38,7 @@
 
 import javax.activation.*;
 
+//import com.sun.image.codec.jpeg.*;
 import javax.imageio.ImageIO;
 
 /**
@@ -155,7 +157,9 @@
                 Graphics g = bufImage.createGraphics();
                 g.drawImage(img, 0, 0, null);
             }
+
             ImageIO.write(bufImage, "jpeg", os);
+
         } catch (Exception ex) {
             throw new IOException(
                 "Unable to run the JPEG Encoder on a stream "
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
index bbb0d0f..a60c617 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for soap pkg
 # Error messages
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
index 8a8920d..97cff5a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: MessageFactoryImpl.java,v 1.23 2006/01/27 12:49:27 vj135062 Exp $
- * $Revision: 1.23 $
- * $Date: 2006/01/27 12:49:27 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MessageFactoryImpl.java,v 1.23 2006/01/27 12:49:27 vj135062 Exp $
+ * $Revision: 1.23 $
+ * $Date: 2006/01/27 12:49:27 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.io.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
index 6f49a1c..02be27a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: MessageImpl.java,v 1.3 2006/08/04 09:24:24 ashutoshshahi Exp $
- * $Revision: 1.3 $
- * $Date: 2006/08/04 09:24:24 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MessageImpl.java,v 1.5 2006/12/12 10:16:33 kumarjayanti Exp $
+ * $Revision: 1.5 $
+ * $Date: 2006/12/12 10:16:33 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.io.*;
@@ -1253,11 +1254,19 @@
     }
 
     public SOAPBody getSOAPBody() throws SOAPException {
-        return getSOAPPart().getEnvelope().getBody();
+        SOAPBody body = getSOAPPart().getEnvelope().getBody();
+        /*if (body == null) {
+             throw new SOAPException("No SOAP Body was found in the SOAP Message");
+        }*/
+        return body;
     }
 
     public SOAPHeader getSOAPHeader() throws SOAPException {
-        return getSOAPPart().getEnvelope().getHeader();
+        SOAPHeader hdr = getSOAPPart().getEnvelope().getHeader();
+        /*if (hdr == null) {
+            throw new SOAPException("No SOAP Header was found in the SOAP Message");
+        }*/
+        return hdr;
     }
 
     private void initializeAllAttachments ()
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
index 6b5defe..4e0d902 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: MultipartDataContentHandler.java,v 1.3 2006/01/27 12:49:28 vj135062 Exp $
- * $Revision: 1.3 $
- * $Date: 2006/01/27 12:49:28 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MultipartDataContentHandler.java,v 1.3 2006/01/27 12:49:28 vj135062 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2006/01/27 12:49:28 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.io.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
index ea99d40..f06b596 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import javax.xml.soap.SAAJMetaFactory;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
index 92ce2c1..560f841 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPDocument.java,v 1.5 2006/01/27 12:49:28 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPDocument.java,v 1.5 2006/01/27 12:49:28 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
index 71c0b28..41e8981 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPDocumentFragment.java,v 1.6 2006/01/27 12:49:28 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPDocumentFragment.java,v 1.6 2006/01/27 12:49:28 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
index 5b8d797..a2e7ae7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPDocumentImpl.java,v 1.15 2006/01/27 12:49:29 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPDocumentImpl.java,v 1.15 2006/01/27 12:49:29 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
index 897a607..2c1f713 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: SOAPFactoryImpl.java,v 1.21 2006/01/27 12:49:29 vj135062 Exp $
- * $Revision: 1.21 $
- * $Date: 2006/01/27 12:49:29 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFactoryImpl.java,v 1.21 2006/01/27 12:49:29 vj135062 Exp $
+ * $Revision: 1.21 $
+ * $Date: 2006/01/27 12:49:29 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
index d9e6ea9..4eced47 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * have any questions.
  */
 
+
 /**
  * Created on Nov 19, 2002
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
index 60d4c1c..1125bdc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: SOAPPartImpl.java,v 1.1.1.1 2006/01/27 13:10:55 kumarjayanti Exp $
- * $Revision: 1.1.1.1 $
- * $Date: 2006/01/27 13:10:55 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPPartImpl.java,v 1.1.1.1 2006/01/27 13:10:55 kumarjayanti Exp $
+ * $Revision: 1.1.1.1 $
+ * $Date: 2006/01/27 13:10:55 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.io.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
index db53492..e5c6079 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
@@ -1,11 +1,5 @@
 /*
- * $Id: SOAPVersionMismatchException.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
- * $Revision: 1.6 $
- * $Date: 2006/01/27 12:49:29 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPVersionMismatchException.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/01/27 12:49:29 $
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.soap;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
index cad725c..d810918 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: StringDataContentHandler.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
- * $Revision: 1.6 $
- * $Date: 2006/01/27 12:49:29 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: StringDataContentHandler.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/01/27 12:49:29 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.datatransfer.DataFlavor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
index e188cf4..46f89c4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
@@ -1,11 +1,5 @@
 /*
- * $Id: XmlDataContentHandler.java,v 1.12 2006/01/27 12:49:30 vj135062 Exp $
- * $Revision: 1.12 $
- * $Date: 2006/01/27 12:49:30 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: XmlDataContentHandler.java,v 1.12 2006/01/27 12:49:30 vj135062 Exp $
+ * $Revision: 1.12 $
+ * $Date: 2006/01/27 12:49:30 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap;
 
 import java.awt.datatransfer.DataFlavor;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
index 4331e98..2db889d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPFactoryDynamicImpl.java,v 1.2 2006/01/27 12:49:32 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFactoryDynamicImpl.java,v 1.2 2006/01/27 12:49:32 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
index 51afa7b..6bba9c8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPMessageFactoryDynamicImpl.java,v 1.4 2006/01/27 12:49:32 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPMessageFactoryDynamicImpl.java,v 1.4 2006/01/27 12:49:32 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
index a14e586..83f4ac2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: BodyElementImpl.java,v 1.14 2006/01/27 12:49:33 vj135062 Exp $
- * $Revision: 1.14 $
- * $Date: 2006/01/27 12:49:33 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: BodyElementImpl.java,v 1.14 2006/01/27 12:49:33 vj135062 Exp $
+ * $Revision: 1.14 $
+ * $Date: 2006/01/27 12:49:33 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
index ebf51c5..2ec0855 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: BodyImpl.java,v 1.41 2006/01/27 12:49:34 vj135062 Exp $
- * $Revision: 1.41 $
- * $Date: 2006/01/27 12:49:34 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: BodyImpl.java,v 1.41 2006/01/27 12:49:34 vj135062 Exp $
+ * $Revision: 1.41 $
+ * $Date: 2006/01/27 12:49:34 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
index 99431d2..6411061 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: CDATAImpl.java,v 1.19 2006/01/27 12:49:34 vj135062 Exp $
- * $Revision: 1.19 $
- * $Date: 2006/01/27 12:49:34 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: CDATAImpl.java,v 1.19 2006/01/27 12:49:34 vj135062 Exp $
+ * $Revision: 1.19 $
+ * $Date: 2006/01/27 12:49:34 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java
index fe775b1..6931d53 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: CommentImpl.java,v 1.17 2006/01/27 12:49:34 vj135062 Exp $
- * $Revision: 1.17 $
- * $Date: 2006/01/27 12:49:34 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: CommentImpl.java,v 1.17 2006/01/27 12:49:34 vj135062 Exp $
+ * $Revision: 1.17 $
+ * $Date: 2006/01/27 12:49:34 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.ResourceBundle;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
index 24a8d32..d8286f1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: DetailEntryImpl.java,v 1.8 2006/01/27 12:49:34 vj135062 Exp $
- * $Revision: 1.8 $
- * $Date: 2006/01/27 12:49:34 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: DetailEntryImpl.java,v 1.8 2006/01/27 12:49:34 vj135062 Exp $
+ * $Revision: 1.8 $
+ * $Date: 2006/01/27 12:49:34 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
index 8c67ca0..caecc72 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: DetailImpl.java,v 1.16 2006/01/27 12:49:34 vj135062 Exp $
- * $Revision: 1.16 $
- * $Date: 2006/01/27 12:49:34 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: DetailImpl.java,v 1.16 2006/01/27 12:49:34 vj135062 Exp $
+ * $Revision: 1.16 $
+ * $Date: 2006/01/27 12:49:34 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
index efae488..e5e124e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
@@ -1,11 +1,5 @@
 /*
- * $Id: ElementFactory.java,v 1.16 2006/01/27 12:49:35 vj135062 Exp $
- * $Revision: 1.16 $
- * $Date: 2006/01/27 12:49:35 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ElementFactory.java,v 1.16 2006/01/27 12:49:35 vj135062 Exp $
+ * $Revision: 1.16 $
+ * $Date: 2006/01/27 12:49:35 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
index f9cfa2a..2afcf90 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: ElementImpl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
- * $Revision: 1.1.1.1 $
- * $Date: 2006/01/27 13:10:57 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ElementImpl.java,v 1.6 2006/11/16 16:01:14 kumarjayanti Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/11/16 16:01:14 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.*;
@@ -184,16 +185,24 @@
         } else if (prefix != null) {
             // Find if there's an ancester whose name contains this prefix
             org.w3c.dom.Node currentAncestor = this;
+
+//            String uri = currentAncestor.lookupNamespaceURI(prefix);
+//            return uri;
             while (currentAncestor != null &&
                    !(currentAncestor instanceof Document)) {
-                /*
-                if (prefix.equals(currentAncestor.getPrefix())) {
+
+               /* if (prefix.equals(currentAncestor.getPrefix())) {
                     String uri = currentAncestor.getNamespaceURI();
                     // this is because the javadoc says getNamespaceURI() is not a computed value
                     // and URI for a non-empty prefix cannot be null
                     if (uri != null)
                         return uri;
                 }*/
+                //String uri = currentAncestor.lookupNamespaceURI(prefix);
+                //if (uri != null) {
+                //    return uri;
+                //}
+
                 if (((Element) currentAncestor).hasAttributeNS(
                         NamespaceContext.XMLNS_URI, prefix)) {
                     return ((Element) currentAncestor).getAttributeNS(
@@ -500,7 +509,8 @@
         } else {
             setAttributeNS(NamespaceContext.XMLNS_URI, "xmlns", uri);
         }
-        tryToFindEncodingStyleAttributeName();
+        //Fix for CR:6474641
+        //tryToFindEncodingStyleAttributeName();
         return this;
     }
 
@@ -932,8 +942,9 @@
         if (parent != null) {
             parent.removeChild(this);
         }
-        encodingStyleAttribute.clearName();
-        tryToFindEncodingStyleAttributeName();
+        encodingStyleAttribute.clearNameAndValue();
+        // Fix for CR: 6474641
+        //tryToFindEncodingStyleAttributeName();
     }
 
     public void tryToFindEncodingStyleAttributeName() {
@@ -973,6 +984,13 @@
         public String getValue() {
             return attributeValue;
         }
+
+        /** Note: to be used only in detachNode method */
+        public void clearNameAndValue() {
+            attributeName = null;
+            attributeValue = null;
+        }
+
         private void reconcileAttribute() throws SOAPException {
             if (attributeName != null) {
                 removeAttribute(attributeName);
@@ -1211,7 +1229,18 @@
             prefix = qualifiedName.substring(0, index);
             localName = qualifiedName.substring(index + 1);
         }
-                super.setAttributeNS(namespaceURI,qualifiedName,value);
+
+        // Workaround for bug 6467808 - This needs to be fixed in JAXP
+
+        // Rolling back this fix, this is a wrong fix, infact its causing other regressions in JAXWS tck and
+        // other tests, because of this change the namespace declarations on soapenv:Fault element are never
+        // picked up. The fix for bug 6467808 should be in JAXP.
+//        if(elementQName.getLocalPart().equals("Fault") &&
+//                (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(value) ||
+//                SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value)))
+//            return;
+
+        super.setAttributeNS(namespaceURI,qualifiedName,value);
         //String tmpLocalName = this.getLocalName();
         String tmpURI = this.getNamespaceURI();
         boolean isIDNS = false;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
index 76af746..1c4cf2b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: EnvelopeImpl.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
- * $Revision: 1.1.1.1 $
- * $Date: 2006/01/27 13:10:56 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: EnvelopeImpl.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
+ * $Revision: 1.1.1.1 $
+ * $Date: 2006/01/27 13:10:56 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
index 8206c5a..47ac1d0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: FaultElementImpl.java,v 1.10 2006/01/27 12:49:35 vj135062 Exp $
- * $Revision: 1.10 $
- * $Date: 2006/01/27 12:49:35 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FaultElementImpl.java,v 1.10 2006/01/27 12:49:35 vj135062 Exp $
+ * $Revision: 1.10 $
+ * $Date: 2006/01/27 12:49:35 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.logging.Level;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
index 21c87fc..f9c4474 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: FaultImpl.java,v 1.55 2006/01/27 12:49:35 vj135062 Exp $
- * $Revision: 1.55 $
- * $Date: 2006/01/27 12:49:35 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FaultImpl.java,v 1.2 2006/11/16 17:39:10 kumarjayanti Exp $
+ * $Revision: 1.2 $
+ * $Date: 2006/11/16 17:39:10 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.Locale;
@@ -65,6 +66,8 @@
     protected abstract NameImpl getFaultActorName();
     protected abstract DetailImpl createDetail();
     protected abstract FaultElementImpl createSOAPFaultElement(String localName);
+    protected abstract FaultElementImpl createSOAPFaultElement(QName qname);
+    protected abstract FaultElementImpl createSOAPFaultElement(Name qname);
     protected abstract void checkIfStandardFaultCode(String faultCode, String uri) throws SOAPException;
     protected abstract void finallySetFaultCode(String faultcode) throws SOAPException;
     protected abstract boolean isStandardFaultElement(String localName);
@@ -152,8 +155,8 @@
         }
 
         String prefix = code.substring(0, prefixIndex);
-        String nsName =
-            ((ElementImpl) codeContainingElement).getNamespaceURI(prefix);
+        String nsName =((ElementImpl) codeContainingElement).lookupNamespaceURI(prefix);
+            //((ElementImpl) codeContainingElement).getNamespaceURI(prefix);
         return new QName(nsName, getLocalPart(code), prefix);
     }
 
@@ -233,7 +236,7 @@
                 if (isStandardFaultElement(localName))
                     return replaceElementWithSOAPElement(
                                element,
-                               createSOAPFaultElement(localName));
+                               createSOAPFaultElement(soapElement.getElementQName()));
                 return soapElement;
             }
         } else {
@@ -245,7 +248,7 @@
                 String localName = elementName.getLocalName();
                 if (isStandardFaultElement(localName))
                     newElement =
-                        (ElementImpl) createSOAPFaultElement(localName);
+                        (ElementImpl) createSOAPFaultElement(elementName);
                 else
                     newElement = (ElementImpl) createElement(elementName);
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
index 0d6ec82..eab766d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: HeaderElementImpl.java,v 1.26 2006/01/27 12:49:35 vj135062 Exp $
- * $Revision: 1.26 $
- * $Date: 2006/01/27 12:49:35 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HeaderElementImpl.java,v 1.26 2006/01/27 12:49:35 vj135062 Exp $
+ * $Revision: 1.26 $
+ * $Date: 2006/01/27 12:49:35 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
index 2ea6d07..fa87cee 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: HeaderImpl.java,v 1.33 2006/01/27 12:49:35 vj135062 Exp $
- * $Revision: 1.33 $
- * $Date: 2006/01/27 12:49:35 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HeaderImpl.java,v 1.33 2006/01/27 12:49:35 vj135062 Exp $
+ * $Revision: 1.33 $
+ * $Date: 2006/01/27 12:49:35 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
index 10bec01..2def1f5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for impl
 # Error messages
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
index a1b542a..9b6dc60 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: TextImpl.java,v 1.19 2006/01/27 12:49:36 vj135062 Exp $
- * $Revision: 1.19 $
- * $Date: 2006/01/27 12:49:36 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: TextImpl.java,v 1.19 2006/01/27 12:49:36 vj135062 Exp $
+ * $Revision: 1.19 $
+ * $Date: 2006/01/27 12:49:36 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
index a21fee8..5145375 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
@@ -1,11 +1,5 @@
 /*
- * $Id: TreeException.java,v 1.5 2006/01/27 12:49:36 vj135062 Exp $
- * $Revision: 1.5 $
- * $Date: 2006/01/27 12:49:36 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: TreeException.java,v 1.5 2006/01/27 12:49:36 vj135062 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2006/01/27 12:49:36 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.impl;
 
 public class TreeException extends RuntimeException {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
index 616870d..12b953a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for name pkg
 # Error messages
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
index f580ef3..2b682ca 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
@@ -1,11 +1,5 @@
 /*
- * $Id: NameImpl.java,v 1.48 2006/01/27 12:49:38 vj135062 Exp $
- * $Revision: 1.48 $
- * $Date: 2006/01/27 12:49:38 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: NameImpl.java,v 1.48 2006/01/27 12:49:38 vj135062 Exp $
+ * $Revision: 1.48 $
+ * $Date: 2006/01/27 12:49:38 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.soap.name;
 
 import java.util.logging.Level;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
index 600b4a1..10ab166 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Body1_1Impl.java,v 1.14 2006/01/27 12:49:38 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Body1_1Impl.java,v 1.14 2006/01/27 12:49:38 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
index 5cb845f..14607fc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: BodyElement1_1Impl.java,v 1.13 2006/01/27 12:49:39 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: BodyElement1_1Impl.java,v 1.13 2006/01/27 12:49:39 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
index 29b7ee4..8d300bb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Detail1_1Impl.java,v 1.12 2006/01/27 12:49:40 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Detail1_1Impl.java,v 1.12 2006/01/27 12:49:40 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
index ab8be34..9b61ae1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: DetailEntry1_1Impl.java,v 1.13 2006/01/27 12:49:40 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: DetailEntry1_1Impl.java,v 1.13 2006/01/27 12:49:40 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
index 5ec27a4..2369a22 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
  * $Id: Envelope1_1Impl.java,v 1.8 2006/01/27 12:49:41 vj135062 Exp $
  */
 
+
+
 /**
 *
 * @author SAAJ RI Development Team
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
index 2015515..0eb5fe3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Fault1_1Impl.java,v 1.20 2006/01/27 12:49:41 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Fault1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
@@ -301,4 +302,17 @@
         }
         return super.addChildElement(element);
     }
+
+    protected FaultElementImpl createSOAPFaultElement(QName qname) {
+         return new FaultElement1_1Impl(
+                       ((SOAPDocument) getOwnerDocument()).getDocument(),
+                       qname);
+    }
+
+    protected FaultElementImpl createSOAPFaultElement(Name qname) {
+         return new FaultElement1_1Impl(
+                       ((SOAPDocument) getOwnerDocument()).getDocument(),
+                       (NameImpl)qname);
+    }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
index 53487d1..45225bf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: FaultElement1_1Impl.java,v 1.12 2006/01/27 12:49:41 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FaultElement1_1Impl.java,v 1.12 2006/01/27 12:49:41 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
index 73a22b2..99eedfa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Header1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Header1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
index 9c24353..fbc54bd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: HeaderElement1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HeaderElement1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
index 5a9f7f6..695a231 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for ver1_1 pkg
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
index 2af5bf0..c1d60c0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Message1_1Impl.java,v 1.24 2006/01/27 12:49:41 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Message1_1Impl.java,v 1.24 2006/01/27 12:49:41 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
index 8f09a65..641c123 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPFactory1_1Impl.java,v 1.4 2006/01/27 12:49:42 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFactory1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
@@ -53,9 +54,17 @@
 
     public SOAPFault createFault(String reasonText, QName faultCode)
         throws SOAPException {
+        if (faultCode == null) {
+            throw new IllegalArgumentException("faultCode argument for createFault was passed NULL");
+        }
+        if (reasonText == null) {
+            throw new IllegalArgumentException("reasonText argument for createFault was passed NULL");
+        }
         Fault1_1Impl fault = new Fault1_1Impl(createDocument(), null);
         fault.setFaultString(reasonText);
+
         fault.setFaultCode(faultCode);
+
         return fault;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
index 845d2bf..365326a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPMessageFactory1_1Impl.java,v 1.7 2006/01/27 12:49:42 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPMessageFactory1_1Impl.java,v 1.7 2006/01/27 12:49:42 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
index 69d534a..805b20c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPPart1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPPart1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
index 357bd0a..b5dd821 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Body1_2Impl.java,v 1.32 2006/01/27 12:49:44 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Body1_2Impl.java,v 1.32 2006/01/27 12:49:44 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
index 3a1340d..ddc753d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: BodyElement1_2Impl.java,v 1.13 2006/01/27 12:49:44 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: BodyElement1_2Impl.java,v 1.13 2006/01/27 12:49:44 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
index 45c670b..bf7cbcb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Detail1_2Impl.java,v 1.24 2006/01/27 12:49:45 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Detail1_2Impl.java,v 1.24 2006/01/27 12:49:45 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
index 64af1a3..06a4fec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: DetailEntry1_2Impl.java,v 1.13 2006/01/27 12:49:45 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: DetailEntry1_2Impl.java,v 1.13 2006/01/27 12:49:45 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
index 9c0b568..468ee62 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Envelope1_2Impl.java,v 1.26 2006/01/27 12:49:47 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Envelope1_2Impl.java,v 1.26 2006/01/27 12:49:47 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
index 73d3236..431c94b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Fault1_2Impl.java,v 1.45 2006/01/27 12:49:47 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Fault1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
@@ -300,7 +301,7 @@
         if (faultNode != null) {
             faultNode.detachNode();
         }
-        faultNode = createSOAPFaultElement(getFaultNodeName().getLocalName());
+        faultNode = createSOAPFaultElement(getFaultNodeName());
         faultNode = faultNode.addTextNode(uri);
         if (getFaultRole() != null) {
             insertBefore(faultNode, this.faultActorElement);
@@ -323,7 +324,7 @@
         if (this.faultActorElement != null)
             this.faultActorElement.detachNode();
         this.faultActorElement =
-            createSOAPFaultElement(getFaultActorName().getLocalName());
+            createSOAPFaultElement(getFaultActorName());
         this.faultActorElement.addTextNode(uri);
         if (hasDetail()) {
             insertBefore(this.faultActorElement, this.detail);
@@ -547,4 +548,16 @@
         return SOAPConstants.SOAP_SENDER_FAULT;
     }
 
+     protected FaultElementImpl createSOAPFaultElement(QName qname) {
+         return new FaultElement1_2Impl(
+                       ((SOAPDocument) getOwnerDocument()).getDocument(),
+                       qname);
+    }
+
+    protected FaultElementImpl createSOAPFaultElement(Name qname) {
+         return new FaultElement1_2Impl(
+                       ((SOAPDocument) getOwnerDocument()).getDocument(),
+                       (NameImpl)qname);
+    }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
index d82058a..3bcd71b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: FaultElement1_2Impl.java,v 1.13 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FaultElement1_2Impl.java,v 1.13 2006/01/27 12:49:48 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
index 7f99063..20d64a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Header1_2Impl.java,v 1.36 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Header1_2Impl.java,v 1.36 2006/01/27 12:49:48 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
index 41f97b6..afdf5c8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: HeaderElement1_2Impl.java,v 1.29 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: HeaderElement1_2Impl.java,v 1.29 2006/01/27 12:49:48 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
index 79d1f3b..d2f7769 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for ver1_2 pkg
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
index fbe3527..5bae9a1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: Message1_2Impl.java,v 1.18 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Message1_2Impl.java,v 1.18 2006/01/27 12:49:48 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
index 0fa8a53..e1ffa63 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPFactory1_2Impl.java,v 1.4 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFactory1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
@@ -53,6 +54,12 @@
 
     public SOAPFault createFault(String reasonText, QName faultCode)
         throws SOAPException {
+         if (faultCode == null) {
+            throw new IllegalArgumentException("faultCode argument for createFault was passed NULL");
+        }
+        if (reasonText == null) {
+            throw new IllegalArgumentException("reasonText argument for createFault was passed NULL");
+        }
         Fault1_2Impl fault = new Fault1_2Impl(createDocument(), null);
         fault.setFaultString(reasonText);
         fault.setFaultCode(faultCode);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
index 0bd20e1..433cb69 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPMessageFactory1_2Impl.java,v 1.7 2006/01/27 12:49:48 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPMessageFactory1_2Impl.java,v 1.7 2006/01/27 12:49:48 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
index 91ceb39..25afd91 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
@@ -1,9 +1,5 @@
 /*
- * $Id: SOAPPart1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPPart1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
index e8d3b0c..44319d3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
@@ -1,11 +1,5 @@
 /*
- * $Id: Base64.java,v 1.4 2006/01/27 12:49:50 vj135062 Exp $
- * $Revision: 1.4 $
- * $Date: 2006/01/27 12:49:50 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Base64.java,v 1.4 2006/01/27 12:49:50 vj135062 Exp $
+ * $Revision: 1.4 $
+ * $Date: 2006/01/27 12:49:50 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 
@@ -42,6 +43,7 @@
  * This class is used by XML Schema binary format validation
  *
  * @author Jeffrey Rodriguez
+ * @version $Revision: 1.4 $ $Date: 2006/01/27 12:49:50 $
  */
 public final class Base64 {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
index 8b06d45..2540507 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
@@ -1,10 +1,5 @@
 /*
- * $Id: ByteInputStream.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $ $Revision:
- * 1.3 $ $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ByteInputStream.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $ $Revision:
+ * 1.3 $ $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.ByteArrayInputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
index 569a05b..96b95a8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
@@ -1,10 +1,5 @@
 /*
- * $Id: ByteOutputStream.java,v 1.7 2006/01/27 12:49:51 vj135062 Exp $
- * $Revision: 1.7 $ $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ByteOutputStream.java,v 1.7 2006/01/27 12:49:51 vj135062 Exp $
+ * $Revision: 1.7 $ $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.BufferedOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
index c1af31f..e2be171 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
@@ -1,11 +1,5 @@
 /*
- * $Id: CharReader.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
- * $Revision: 1.6 $
- * $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: CharReader.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.CharArrayReader;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
index 9b3be81..6755232 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
@@ -1,11 +1,5 @@
 /*
- * $Id: CharWriter.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
- * $Revision: 1.6 $
- * $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: CharWriter.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.CharArrayWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
index 526c0ce..52d2946 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
@@ -1,11 +1,5 @@
 /*
- * $Id: FastInfosetReflection.java,v 1.2 2006/06/06 18:46:01 sandoz Exp $
- * $Revision: 1.2 $
- * $Date: 2006/06/06 18:46:01 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FastInfosetReflection.java,v 1.2 2006/06/06 18:46:01 sandoz Exp $
+ * $Revision: 1.2 $
+ * $Date: 2006/06/06 18:46:01 $
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
index 22768e6..66991a9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
index 81dc485..ea897bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
@@ -1,11 +1,5 @@
 /*
- * $Id: JAXMStreamSource.java,v 1.9 2006/01/27 12:49:51 vj135062 Exp $
- * $Revision: 1.9 $
- * $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: JAXMStreamSource.java,v 1.9 2006/01/27 12:49:51 vj135062 Exp $
+ * $Revision: 1.9 $
+ * $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
index e805e7e..1bfc1ed 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
@@ -1,11 +1,5 @@
 /*
- * $Id: JaxmURI.java,v 1.4 2006/01/27 12:49:51 vj135062 Exp $
- * $Revision: 1.4 $
- * $Date: 2006/01/27 12:49:51 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: JaxmURI.java,v 1.4 2006/01/27 12:49:51 vj135062 Exp $
+ * $Revision: 1.4 $
+ * $Date: 2006/01/27 12:49:51 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 // Imported from: org.apache.xerces.util
@@ -66,6 +67,7 @@
 * default port for a specific scheme). Rather, it only knows the
 * grammar and basic set of operations that can be applied to a URI.
 *
+* @version  $Id: JaxmURI.java,v 1.4 2006/01/27 12:49:51 vj135062 Exp $
 *
 **********************************************************************/
  public class JaxmURI implements Serializable {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
index ecfbb43..c6ec377 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # SAAJ ResourceBundle properties file
 # Contains Log messages for util pkg
 # Error messages
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
index 2896864..0493b40 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
@@ -1,11 +1,5 @@
 /*
- * $Id: LogDomainConstants.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
- * $Revision: 1.5 $
- * $Date: 2006/01/27 12:49:52 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: LogDomainConstants.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2006/01/27 12:49:52 $
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
index 5847e54..79e0b689 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
@@ -1,9 +1,5 @@
 /*
- * $Id: MimeHeadersUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MimeHeadersUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
index a78d1ef..e1e3f2f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
@@ -1,9 +1,5 @@
 /*
- * $Id: NamespaceContextIterator.java,v 1.8 2006/01/27 12:49:52 vj135062 Exp $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: NamespaceContextIterator.java,v 1.8 2006/01/27 12:49:52 vj135062 Exp $
+ */
+
+
 
 /**
 *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
index fef90d3..6b736cf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
@@ -1,11 +1,5 @@
 /*
- * $Id: ParseUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
- * $Revision: 1.5 $
- * $Date: 2006/01/27 12:49:52 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ParseUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2006/01/27 12:49:52 $
+ */
+
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
index 75fb28c..00c1130 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
@@ -1,11 +1,5 @@
 /*
- * $Id: ParserPool.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
- * $Revision: 1.5 $
- * $Date: 2006/01/27 12:49:52 $
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: ParserPool.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2006/01/27 12:49:52 $
+ */
+
+
 
 package com.sun.xml.internal.messaging.saaj.util;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
index 4ea1c90..9a83344 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * have any questions.
  */
 
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.util.logging.Logger;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
index 79aace8..584fd80 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * have any questions.
  */
 
+
 /*
  * Created on Feb 28, 2003
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
index 720a28d..c404867 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.messaging.saaj.util;
 
 import java.io.*;
@@ -35,6 +36,7 @@
  *  <?xml ... ?>
  *
  * @author Panos Kougiouris (panos@acm.org)
+ * @version $Revision: 1.1.1.1 $ $Date: 2006/01/27 13:10:58 $
  */
 
 public class XMLDeclarationParser {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
index 540f606..620f9c5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * have any questions.
  */
 
+
 /*
  * EfficientStreamingTransformer.java
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java
index 20b6429..779d982 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java
index 579ab95..717b774 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java
index 15b321a..ed69201 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java
index 917ec32..7d8e0a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java
index 632dc89..9a2fa90 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java
index c668f58..4dd83ae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
 import java.util.Map;
@@ -98,6 +70,13 @@
     public static final String EXTERNAL_VOCABULARIES_PROPERTY =
         "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
 
+   /**
+     * The property name to be used for getting and setting the
+     * flag, which will indicate whether underlying Parser's
+     * input stream should be really closed
+     */
+    public static final String FORCE_STREAM_CLOSE_PROPERTY =
+        "http://jvnet.org/fastinfoset/parser/properties/force-stream-close";
 
     /**
      * Set the string interning property.
@@ -172,4 +151,38 @@
      */
     public Map getExternalVocabularies();
 
+    /**
+     * Set the parse fragments property.
+     *
+     * <p>If the parse fragments property is set to true then
+     * fragments of an XML infoset may be parsed.
+     *
+     * @param parseFragments The parse fragments property.
+     */
+    public void setParseFragments(boolean parseFragments);
+
+    /**
+     * Return the parse fragments property.
+     *
+     * @return The parse fragments property.
+     */
+    public boolean getParseFragments();
+
+    /**
+     * Set the force stream close property.
+     *
+     * <p>If the force stream property is set to true then
+     * Parser's underlying InputStream will be closed.
+     *
+     * @param needForceStreamClose The force stream close property.
+     */
+    public void setForceStreamClose(boolean needForceStreamClose);
+
+    /**
+     * Return the force stream close property.
+     *
+     * @return The force stream close property.
+     */
+    public boolean getForceStreamClose();
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java
index 53f66c7..37e0ef0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java
index 3570433..128c771 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,34 +24,6 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
 import java.io.OutputStream;
@@ -69,6 +41,16 @@
  */
 public interface FastInfosetSerializer {
     /**
+     * The feature to ignore the document type declaration and the
+     * internal subset.
+     * <p>
+     * The default value is false. If true a serializer shall ignore document
+     * type declaration and the internal subset.
+     */
+    public static final String IGNORE_DTD_FEATURE =
+        "http://jvnet.org/fastinfoset/serializer/feature/ignore/DTD";
+
+    /**
      * The feature to ignore comments.
      * <p>
      * The default value is false. If true a serializer shall ignore comments
@@ -123,13 +105,25 @@
      * The default value for the limit on the size of character content chunks
      * that will be indexed.
      */
-    public final static int CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT = 7;
+    public final static int CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT = 32;
+
+    /**
+     * The default value for limit on the size of indexed Map for attribute values
+     * Limit is measured in bytes not in number of entries
+     */
+    public static final int CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT = Integer.MAX_VALUE;
 
     /**
      * The default value for the limit on the size of attribute values
      * that will be indexed.
      */
-    public final static int ATTRIBUTE_VALUE_SIZE_CONSTRAINT = 7;
+    public final static int ATTRIBUTE_VALUE_SIZE_CONSTRAINT = 32;
+
+    /**
+     * The default value for limit on the size of indexed Map for character content chunks
+     * Limit is measured in bytes not in number of entries
+     */
+    public static final int ATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT = Integer.MAX_VALUE;
 
     /**
      * The character encoding scheme string for UTF-8.
@@ -142,6 +136,18 @@
     public static final String UTF_16BE = "UTF-16BE";
 
     /**
+     * Set the {@link #IGNORE_DTD_FEATURE}.
+     * @param ignoreDTD true if the feature shall be ignored.
+     */
+    public void setIgnoreDTD(boolean ignoreDTD);
+
+    /**
+     * Get the {@link #IGNORE_DTD_FEATURE}.
+     * @return true if the feature is ignored, false otherwise.
+     */
+    public boolean getIgnoreDTD();
+
+    /**
      * Set the {@link #IGNORE_COMMENTS_FEATURE}.
      * @param ignoreComments true if the feature shall be ignored.
      */
@@ -228,6 +234,23 @@
     public int getCharacterContentChunkSizeLimit();
 
     /**
+     * Sets the limit on the memory size of Map of attribute values
+     * that will be indexed.
+     *
+     * @param size The attribute value size limit. Any value less
+     * that a length of size limit will be indexed.
+     */
+    public void setCharacterContentChunkMapMemoryLimit(int size);
+
+    /**
+     * Gets the limit on the memory size of Map of attribute values
+     * that will be indexed.
+     *
+     * @return The attribute value size limit.
+     */
+    public int getCharacterContentChunkMapMemoryLimit();
+
+    /**
      * Sets the limit on the size of attribute values
      * that will be indexed.
      *
@@ -245,6 +268,23 @@
     public int getAttributeValueSizeLimit();
 
     /**
+     * Sets the limit on the memory size of Map of attribute values
+     * that will be indexed.
+     *
+     * @param size The attribute value size limit. Any value less
+     * that a length of size limit will be indexed.
+     */
+    public void setAttributeValueMapMemoryLimit(int size);
+
+    /**
+     * Gets the limit on the memory size of Map of attribute values
+     * that will be indexed.
+     *
+     * @return The attribute value size limit.
+     */
+    public int getAttributeValueMapMemoryLimit();
+
+    /**
      * Set the external vocabulary that shall be used when serializing.
      *
      * @param v the vocabulary.
@@ -252,6 +292,20 @@
     public void setExternalVocabulary(ExternalVocabulary v);
 
     /**
+     * Set the application data to be associated with the serializer vocabulary.
+     *
+     * @param data the application data.
+     */
+    public void setVocabularyApplicationData(VocabularyApplicationData data);
+
+    /**
+     * Get the application data associated with the serializer vocabulary.
+     *
+     * @return the application data.
+     */
+    public VocabularyApplicationData getVocabularyApplicationData();
+
+    /**
      * Reset the serializer for reuse serializing another XML infoset.
      */
     public void reset();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java
index d68dc5e..d682a50 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java
index 03ced32..cab8d1d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java
index 15cfced..fc8c4bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.org.jvnet.fastinfoset;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/VocabularyApplicationData.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/VocabularyApplicationData.java
new file mode 100644
index 0000000..2071c94
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/VocabularyApplicationData.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+
+package com.sun.xml.internal.org.jvnet.fastinfoset;
+
+/**
+ * Application data that can be associated with a vocabulary.
+ * <p>
+ * The application will implement this inteface and provide
+ * application specific functionality related to a vocabulary.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+public interface VocabularyApplicationData {
+    /**
+     *  Clear the vocabulary  application data.
+     *  <p>
+     *  This method will be invoked when a parser or serializer clears
+     *  the vocabulary.
+     */
+    public void clear();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java
index 7d2d1d5..2a9b3dd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
 import org.xml.sax.Attributes;
@@ -122,4 +94,22 @@
      * @return The data. If the index is out of range then null is returned.
      */
     public Object getAlgorithmData(int index);
+
+    /**
+     * Return the alphabet associated with the attribute value.
+     *
+     * @param index The attribute index (zero-based).
+     * @return The alphabet.
+     *         If the index is out of range then null is returned.
+     *         If there is is no alphabet then null is returned.
+     */
+    public String getAlpababet(int index);
+
+    /**
+     * Return the whether the attribute value should be indexed or not.
+     *
+     * @param index The attribute index (zero-based).
+     * @return True if attribute value should be indexed, otherwise false.
+     */
+    public boolean getToIndex(int index);
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java
index 8975eb5..1f04e53 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/ExtendedContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/ExtendedContentHandler.java
new file mode 100644
index 0000000..008fae5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/ExtendedContentHandler.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+public interface ExtendedContentHandler extends ContentHandler {
+
+    /**
+     * Receive notification of character data.
+     *
+     * @param ch the characters from the XML document
+     * @param start the start position in the array
+     * @param length the number of characters to read from the array
+     * @param index true if the characters are indexed, otherwise false.
+     * @throws org.xml.sax.SAXException any SAX exception, possibly
+     *            wrapping another exception
+     * @see ContentHandler#characters
+     */
+    public void characters(char[] ch, int start, int length, boolean index) throws SAXException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java
index 0b1871a..fdfb77c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java
index 5ff2c89..a3eb7d2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,9 @@
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
 import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSerializer;
@@ -31,5 +32,6 @@
 
 public interface FastInfosetWriter extends ContentHandler, LexicalHandler,
         EncodingAlgorithmContentHandler, PrimitiveTypeContentHandler,
-        RestrictedAlphabetContentHandler, FastInfosetSerializer {
+        RestrictedAlphabetContentHandler, ExtendedContentHandler,
+        FastInfosetSerializer {
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java
index 17021a6..190e7dc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,33 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java
index f60bc6a..d4653a2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java
index 24e1bda..8ade78d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,34 +24,6 @@
  *
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax.helpers;
 
 import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
@@ -105,6 +77,10 @@
 
     private Object[] _algorithmData;
 
+    private String[] _alphabets;
+
+    private boolean[] _toIndex;
+
     /**
      * Construct a new, empty EncodingAlgorithmAttributesImpl object.
      */
@@ -139,6 +115,8 @@
         _data = new String[DEFAULT_CAPACITY * SIZE];
         _algorithmIds = new int[DEFAULT_CAPACITY];
         _algorithmData = new Object[DEFAULT_CAPACITY];
+        _alphabets = new String[DEFAULT_CAPACITY];
+        _toIndex = new boolean[DEFAULT_CAPACITY];
 
         _registeredEncodingAlgorithms = registeredEncodingAlgorithms;
 
@@ -192,6 +170,46 @@
         _data[i++] = replaceNull(qName);
         _data[i++] = replaceNull(type);
         _data[i++] = replaceNull(value);
+        _toIndex[_length] = false;
+        _alphabets[_length] = null;
+
+        _length++;
+    }
+
+    /**
+     * Add an attribute to the end of the list.
+     *
+     * <p>For the sake of speed, this method does no checking
+     * to see if the attribute is already in the list: that is
+     * the responsibility of the application.</p>
+     *
+     * @param uri The Namespace URI, or the empty string if
+     *        none is available or Namespace processing is not
+     *        being performed.
+     * @param localName The local name, or the empty string if
+     *        Namespace processing is not being performed.
+     * @param qName The qualified (prefixed) name, or the empty string
+     *        if qualified names are not available.
+     * @param type The attribute type as a string.
+     * @param value The attribute value.
+     * @param index True if attribute should be indexed.
+     * @param index The alphabet associated with the attribute value,
+     *              may be null if there is no associated alphabet.
+     */
+    public void addAttribute(String URI, String localName, String qName,
+            String type, String value, boolean index, String alphabet) {
+        if (_length >= _algorithmData.length) {
+            resize();
+        }
+
+        int i = _length * SIZE;
+        _data[i++] = replaceNull(URI);
+        _data[i++] = replaceNull(localName);
+        _data[i++] = replaceNull(qName);
+        _data[i++] = replaceNull(type);
+        _data[i++] = replaceNull(value);
+        _toIndex[_length] = index;
+        _alphabets[_length] = alphabet;
 
         _length++;
     }
@@ -228,6 +246,8 @@
         _data[i++] = null;
         _algorithmIds[_length] = builtInAlgorithmID;
         _algorithmData[_length] = algorithmData;
+        _toIndex[_length] = false;
+        _alphabets[_length] = null;
 
         _length++;
     }
@@ -265,6 +285,8 @@
         _data[i++] = algorithmURI;
         _algorithmIds[_length] = algorithmID;
         _algorithmData[_length] = algorithmData;
+        _toIndex[_length] = false;
+        _alphabets[_length] = null;
 
         _length++;
     }
@@ -290,6 +312,8 @@
         _data[i + ALGORITHMURI_OFFSET] = algorithmURI;
         _algorithmIds[index] = algorithmID;
         _algorithmData[index] = algorithmData;
+        _toIndex[index] = false;
+        _alphabets[index] = null;
     }
 
     /**
@@ -313,6 +337,8 @@
                 _data[index++] = atts.getType(i);
                 _data[index++] = atts.getValue(i);
                 index++;
+                _toIndex[i] = false;
+                _alphabets[i] = null;
             }
         }
     }
@@ -340,6 +366,8 @@
                 _data[index++] = atts.getAlgorithmURI(i);
                 _algorithmIds[i] = atts.getAlgorithmIndex(i);
                 _algorithmData[i] = atts.getAlgorithmData(i);
+                _toIndex[i] = false;
+                _alphabets[i] = null;
             }
         }
     }
@@ -487,6 +515,23 @@
         }
     }
 
+    // ExtendedAttributes
+
+    public final String getAlpababet(int index) {
+        if (index >= 0 && index < _length) {
+            return _alphabets[index];
+        } else {
+            return null;
+        }
+    }
+
+    public final boolean getToIndex(int index) {
+        if (index >= 0 && index < _length) {
+            return _toIndex[index];
+        } else {
+            return false;
+        }
+    }
 
     // -----
 
@@ -508,14 +553,20 @@
         String[] data = new String[newLength * SIZE];
         int[] algorithmIds = new int[newLength];
         Object[] algorithmData = new Object[newLength];
+        String[] alphabets = new String[newLength];
+        boolean[] toIndex = new boolean[newLength];
 
         System.arraycopy(_data, 0, data, 0, _length * SIZE);
         System.arraycopy(_algorithmIds, 0, algorithmIds, 0, _length);
         System.arraycopy(_algorithmData, 0, algorithmData, 0, _length);
+        System.arraycopy(_alphabets, 0, alphabets, 0, _length);
+        System.arraycopy(_toIndex, 0, toIndex, 0, _length);
 
         _data = data;
         _algorithmIds = algorithmIds;
         _algorithmData = algorithmData;
+        _alphabets = alphabets;
+        _toIndex = toIndex;
     }
 
     private final StringBuffer convertEncodingAlgorithmDataToString(
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java
index 50b8723..1489f82 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,34 +25,6 @@
  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
  */
 
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
- *
- */
-
 
 package com.sun.xml.internal.org.jvnet.fastinfoset.sax.helpers;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/FastInfosetStreamReader.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/FastInfosetStreamReader.java
new file mode 100644
index 0000000..43f7ec3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/FastInfosetStreamReader.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.org.jvnet.fastinfoset.stax;
+
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * Fast Infoset Stream Reader.
+ * <p>
+ * This interface provides additional optimized methods to that of
+ * {@link javax.xml.stream.XMLStreamReader}.
+ */
+public interface FastInfosetStreamReader {
+    /**
+     * Peek at the next event.
+     *
+     * @return the event, which will be the same as that returned from
+     *         {@link #next}.
+     */
+    public int peekNext() throws XMLStreamException;
+
+    // Faster access methods without checks
+
+    public int accessNamespaceCount();
+
+    public String accessLocalName();
+
+    public String accessNamespaceURI();
+
+    public String accessPrefix();
+
+    public char[] accessTextCharacters();
+
+    public int accessTextStart();
+
+    public int accessTextLength();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/LowLevelFastInfosetStreamWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/LowLevelFastInfosetStreamWriter.java
new file mode 100644
index 0000000..4f68ac3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/LowLevelFastInfosetStreamWriter.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+ */
+
+package com.sun.xml.internal.org.jvnet.fastinfoset.stax;
+
+import com.sun.xml.internal.fastinfoset.EncodingConstants;
+import java.io.IOException;
+import javax.xml.stream.XMLStreamException;
+import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes;
+
+/**
+ * Low level Fast Infoset stream writer.
+ * <p>
+ * This interface provides additional stream-based serialization methods for the
+ * case where an application is in specific control of the serialization
+ * process and has the knowledge to call the LowLevel methods in the required
+ * order.
+ * <p>
+ * For example, the application may be able to perform efficient information
+ * to indexing mapping and to provide certain information in UTF-8 encoded form.
+ * <p>
+ * These methods may be used in conjuction with {@link javax.xml.stream.XMLStreamWriter}
+ * as long as an element fragment written using the efficient streaming methods
+ * are self-contained and no sub-fragment is written using methods from
+ * {@link javax.xml.stream.XMLStreamWriter}.
+ * <p>
+ * The required call sequence is as follows:
+ * <pre>
+ * CALLSEQUENCE    := {@link #startDocument startDocument}
+ *                    initiateLowLevelWriting ELEMENT
+ *                    {@link #endDocument endDocument}
+ *                 |  initiateLowLevelWriting ELEMENT   // for fragment
+ *
+ * ELEMENT         := writeLowLevelTerminationAndMark
+ *                    NAMESPACES?
+ *                    ELEMENT_NAME
+ *                    ATTRIBUTES?
+ *                    writeLowLevelEndStartElement
+ *                    CONTENTS
+ *                    writeLowLevelEndElement
+ *
+ * NAMESPACES      := writeLowLevelStartNamespaces
+ *                    writeLowLevelNamespace*
+ *                    writeLowLevelEndNamespaces
+ *
+ * ELEMENT_NAME    := writeLowLevelStartElementIndexed
+ *                 |  writeLowLevelStartNameLiteral
+ *                 |  writeLowLevelStartElement
+ *
+ * ATTRUBUTES      := writeLowLevelStartAttributes
+ *                   (ATTRIBUTE_NAME writeLowLevelAttributeValue)*
+ *
+ * ATTRIBUTE_NAME  := writeLowLevelAttributeIndexed
+ *                 |  writeLowLevelStartNameLiteral
+ *                 |  writeLowLevelAttribute
+ *
+ *
+ * CONTENTS      := (ELEMENT | writeLowLevelText writeLowLevelOctets)*
+ * </pre>
+ * <p>
+ * Some methods defer to the application for the mapping of information
+ * to indexes.
+ */
+public interface LowLevelFastInfosetStreamWriter {
+    /**
+     * Initiate low level writing of an element fragment.
+     * <p>
+     * This method must be invoked before other low level method.
+     */
+    public void initiateLowLevelWriting()
+    throws XMLStreamException;
+
+    /**
+     * Get the next index to apply to an Element Information Item.
+     * <p>
+     * This will increment the next obtained index such that:
+     * <pre>
+     * i = w.getNextElementIndex();
+     * j = w.getNextElementIndex();
+     * i == j + 1;
+     * </pre>
+     * @return the index.
+     */
+    public int getNextElementIndex();
+
+    /**
+     * Get the next index to apply to an Attribute Information Item.
+     * This will increment the next obtained index such that:
+     * <pre>
+     * i = w.getNextAttributeIndex();
+     * j = w.getNextAttributeIndex();
+     * i == j + 1;
+     * </pre>
+     * @return the index.
+     */
+    public int getNextAttributeIndex();
+
+    /**
+     * Get the current index that was applied to an [local name] of an
+     * Element or Attribute Information Item.
+     * </pre>
+     * @return the index.
+     */
+    public int getLocalNameIndex();
+
+    /**
+     * Get the next index to apply to an [local name] of an Element or Attribute
+     * Information Item.
+     * This will increment the next obtained index such that:
+     * <pre>
+     * i = w.getNextLocalNameIndex();
+     * j = w.getNextLocalNameIndex();
+     * i == j + 1;
+     * </pre>
+     * @return the index.
+     */
+    public int getNextLocalNameIndex();
+
+    public void writeLowLevelTerminationAndMark()
+    throws IOException;
+
+    public void writeLowLevelStartElementIndexed(int type, int index)
+    throws IOException;
+
+    /**
+     * Write the start of an element.
+     *
+     * @return true if element is indexed, otherwise false.
+     */
+    public boolean writeLowLevelStartElement(int type,
+            String prefix, String localName, String namespaceURI)
+            throws IOException;
+
+    public void writeLowLevelStartNamespaces()
+    throws IOException;
+
+    public void writeLowLevelNamespace(String prefix, String namespaceName)
+        throws IOException;
+
+    public void writeLowLevelEndNamespaces()
+    throws IOException;
+
+    public void writeLowLevelStartAttributes()
+    throws IOException;
+
+    public void writeLowLevelAttributeIndexed(int index)
+    throws IOException;
+
+    /**
+     * Write an attribute.
+     *
+     * @return true if attribute is indexed, otherwise false.
+     */
+    public boolean writeLowLevelAttribute(
+            String prefix, String namespaceURI, String localName)
+            throws IOException;
+
+    public void writeLowLevelAttributeValue(String value)
+    throws IOException;
+
+    public void writeLowLevelStartNameLiteral(int type,
+            String prefix, byte[] utf8LocalName, String namespaceURI)
+            throws IOException;
+
+    public void writeLowLevelStartNameLiteral(int type,
+            String prefix, int localNameIndex, String namespaceURI)
+            throws IOException;
+
+    public void writeLowLevelEndStartElement()
+    throws IOException;
+
+    public void writeLowLevelEndElement()
+    throws IOException;
+
+    public void writeLowLevelText(char[] text, int length)
+    throws IOException;
+
+    public void writeLowLevelText(String text)
+    throws IOException;
+
+    public void writeLowLevelOctets(byte[] octets, int length)
+    throws IOException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java
new file mode 100644
index 0000000..1f49ce3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java
@@ -0,0 +1,313 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.OutputStream;
+
+/**
+ * Binary data represented as base64-encoded string
+ * in XML.
+ *
+ * <p>
+ * Used in conjunction with {@link XMLStreamReaderEx}
+ * and {@link XMLStreamWriterEx}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class Base64Data implements CharSequence, Cloneable {
+
+    // either dataHandler or (data,dataLen,mimeType?) must be present
+
+    private DataHandler dataHandler;
+
+    private byte[] data;
+    /**
+     * Length of the valid data in {@link #data}.
+     */
+    private int dataLen;
+    /**
+     * True if {@link #data} can be cloned by reference
+     * if Base64Data instance is cloned.
+     */
+    private boolean dataCloneByRef;
+    /**
+     * Optional MIME type of {@link #data}.
+     *
+     * Unused when {@link #dataHandler} is set.
+     * Use {@link DataHandler#getContentType()} in that case.
+     */
+    private String mimeType;
+
+    /**
+     * Default constructor
+     */
+    public Base64Data() {
+    }
+
+    /**
+     * Clone constructor
+     */
+    public Base64Data(Base64Data that) {
+        that.get();
+        if (that.dataCloneByRef) {
+            this.data = that.data;
+        } else {
+            this.data = new byte[that.dataLen];
+            System.arraycopy(that.data, 0, this.data, 0, that.dataLen);
+        }
+
+        this.dataCloneByRef = true;
+        this.dataLen = that.dataLen;
+        this.dataHandler = null;
+        this.mimeType = that.mimeType;
+    }
+
+    /**
+     * Fills in the data object by a portion of the byte[].
+     *
+     * @param len
+     *      data[0] to data[len-1] are treated as the data.
+     * @param cloneByRef
+     *      true if data[] can be cloned by reference
+     */
+    public void set(byte[] data, int len, String mimeType, boolean cloneByRef) {
+        this.data = data;
+        this.dataLen = len;
+        this.dataCloneByRef = cloneByRef;
+        this.dataHandler = null;
+        this.mimeType = mimeType;
+    }
+
+    /**
+     * Fills in the data object by a portion of the byte[].
+     *
+     * @param len
+     *      data[0] to data[len-1] are treated as the data.
+     */
+    public void set(byte[] data, int len, String mimeType) {
+        set(data,len,mimeType,false);
+    }
+
+    /**
+     * Fills in the data object by the byte[] of the exact length.
+     *
+     * @param data
+     *      this buffer may be owned directly by the unmarshaleld JAXB object.
+     */
+    public void set(byte[] data,String mimeType) {
+        set(data,data.length,mimeType,false);
+    }
+
+    /**
+     * Fills in the data object by a {@link DataHandler}.
+     */
+    public void set(DataHandler data) {
+        assert data!=null;
+        this.dataHandler = data;
+        this.data = null;
+    }
+
+    /**
+     * Gets the raw data.
+     */
+    public DataHandler getDataHandler() {
+        if(dataHandler==null){
+            dataHandler = new DataHandler(new DataSource() {
+                public String getContentType() {
+                    return getMimeType();
+                }
+
+                public InputStream getInputStream() {
+                    return new ByteArrayInputStream(data,0,dataLen);
+                }
+
+                public String getName() {
+                    return null;
+                }
+
+                public OutputStream getOutputStream() {
+                    throw new UnsupportedOperationException();
+                }
+            });
+        }
+        return dataHandler;
+    }
+
+    /**
+     * Gets the byte[] of the exact length.
+     */
+    public byte[] getExact() {
+        get();
+        if(dataLen!=data.length) {
+            byte[] buf = new byte[dataLen];
+            System.arraycopy(data,0,buf,0,dataLen);
+            data = buf;
+        }
+        return data;
+    }
+
+    /**
+     * Gets the data as an {@link InputStream}.
+     */
+    public InputStream getInputStream() throws IOException {
+        if(dataHandler!=null)
+            return dataHandler.getInputStream();
+        else
+            return new ByteArrayInputStream(data,0,dataLen);
+    }
+
+    /**
+     * Returns false if this object only has {@link DataHandler} and therefore
+     * {@link #get()} operation is likely going to be expensive.
+     */
+    public boolean hasData() {
+        return data!=null;
+    }
+
+    /**
+     * Gets the raw data. The size of the byte array maybe larger than the actual length.
+     */
+    public byte[] get() {
+        if(data==null) {
+            try {
+                ByteArrayOutputStreamEx baos = new ByteArrayOutputStreamEx(1024);
+                InputStream is = dataHandler.getDataSource().getInputStream();
+                baos.readFrom(is);
+                is.close();
+                data = baos.getBuffer();
+                dataLen = baos.size();
+                dataCloneByRef = true;
+            } catch (IOException e) {
+                // TODO: report the error to the unmarshaller
+                dataLen = 0;    // recover by assuming length-0 data
+            }
+        }
+        return data;
+    }
+
+    public int getDataLen() {
+        return dataLen;
+    }
+
+    public String getMimeType() {
+        if(mimeType==null)
+            return "application/octet-stream";
+        return mimeType;
+    }
+
+    /**
+     * Gets the number of characters needed to represent
+     * this binary data in the base64 encoding.
+     */
+    public int length() {
+        // for each 3 bytes you use 4 chars
+        // if the remainder is 1 or 2 there will be 4 more
+        get();  // fill in the buffer if necessary
+        return ((dataLen+2)/3)*4;
+    }
+
+    /**
+     * Encode this binary data in the base64 encoding
+     * and returns the character at the specified position.
+     */
+    public char charAt(int index) {
+        // we assume that the length() method is called before this method
+        // (otherwise how would the caller know that the index is valid?)
+        // so we assume that the byte[] is already populated
+
+        int offset = index%4;
+        int base = (index/4)*3;
+
+        byte b1,b2;
+
+        switch(offset) {
+        case 0:
+            return Base64Encoder.encode(data[base]>>2);
+        case 1:
+            if(base+1<dataLen)
+                b1 = data[base+1];
+            else
+                b1 = 0;
+            return Base64Encoder.encode(
+                        ((data[base]&0x3)<<4) |
+                        ((b1>>4)&0xF));
+        case 2:
+            if(base+1<dataLen) {
+                b1 = data[base+1];
+                if(base+2<dataLen)
+                    b2 = data[base+2];
+                else
+                    b2 = 0;
+
+                return Base64Encoder.encode(
+                            ((b1&0xF)<<2)|
+                            ((b2>>6)&0x3));
+            } else
+                return '=';
+        case 3:
+            if(base+2<dataLen)
+                return Base64Encoder.encode(data[base+2]&0x3F);
+            else
+                return '=';
+        }
+
+        throw new IllegalStateException();
+    }
+
+    /**
+     * Internally this is only used to split a text to a list,
+     * which doesn't happen that much for base64.
+     * So this method should be smaller than faster.
+     */
+    public CharSequence subSequence(int start, int end) {
+        StringBuilder buf = new StringBuilder();
+        get();  // fill in the buffer if we haven't done so
+        for( int i=start; i<end; i++ )
+            buf.append(charAt(i));
+        return buf;
+    }
+
+    /**
+     * Returns the base64 encoded string of this data.
+     */
+    public String toString() {
+        get();  // fill in the buffer
+        return Base64Encoder.print(data, 0, dataLen);
+    }
+
+    public void writeTo(char[] buf, int start) {
+        get();
+        Base64Encoder.print(data, 0, dataLen, buf, start);
+    }
+
+    public Base64Data clone() {
+        return new Base64Data(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Encoder.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Encoder.java
new file mode 100644
index 0000000..e7c90e5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Encoder.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+class Base64Encoder {
+    private static final char[] encodeMap = initEncodeMap();
+
+    private static char[] initEncodeMap() {
+        char[] map = new char[64];
+        int i;
+        for( i= 0; i<26; i++ )        map[i] = (char)('A'+i);
+        for( i=26; i<52; i++ )        map[i] = (char)('a'+(i-26));
+        for( i=52; i<62; i++ )        map[i] = (char)('0'+(i-52));
+        map[62] = '+';
+        map[63] = '/';
+
+        return map;
+    }
+
+    public static char encode( int i ) {
+        return encodeMap[i&0x3F];
+    }
+
+    public static byte encodeByte( int i ) {
+        return (byte)encodeMap[i&0x3F];
+    }
+
+    public static String print(byte[] input, int offset, int len) {
+        char[] buf = new char[((len+2)/3)*4];
+        int ptr = print(input,offset,len,buf,0);
+        assert ptr==buf.length;
+        return new String(buf);
+    }
+
+    /**
+     * Encodes a byte array into a char array by doing base64 encoding.
+     *
+     * The caller must supply a big enough buffer.
+     *
+     * @return
+     *      the value of {@code ptr+((len+2)/3)*4}, which is the new offset
+     *      in the output buffer where the further bytes should be placed.
+     */
+    public static int print(byte[] input, int offset, int len, char[] buf, int ptr) {
+        for( int i=offset; i<len; i+=3 ) {
+            switch( len-i ) {
+            case 1:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(((input[i])&0x3)<<4);
+                buf[ptr++] = '=';
+                buf[ptr++] = '=';
+                break;
+            case 2:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encode((input[i+1]&0xF)<<2);
+                buf[ptr++] = '=';
+                break;
+            default:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encode(
+                            ((input[i+1]&0xF)<<2)|
+                            ((input[i+2]>>6)&0x3));
+                buf[ptr++] = encode(input[i+2]&0x3F);
+                break;
+            }
+        }
+        return ptr;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/ByteArrayOutputStreamEx.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/ByteArrayOutputStreamEx.java
new file mode 100644
index 0000000..b435885
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/ByteArrayOutputStreamEx.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * {@link ByteArrayOutputStream} with access to its raw buffer.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class ByteArrayOutputStreamEx extends ByteArrayOutputStream {
+    public ByteArrayOutputStreamEx() {
+    }
+
+    public ByteArrayOutputStreamEx(int size) {
+        super(size);
+    }
+
+    public void set(Base64Data dt,String mimeType) {
+        dt.set(buf,count,mimeType);
+    }
+
+    public byte[] getBuffer() {
+        return buf;
+    }
+
+    /**
+     * Reads the given {@link InputStream} completely into the buffer.
+     */
+    public void readFrom(InputStream is) throws IOException {
+        while(true) {
+            if(count==buf.length) {
+                // realllocate
+                byte[] data = new byte[buf.length*2];
+                System.arraycopy(buf,0,data,0,buf.length);
+                buf = data;
+            }
+
+            int sz = is.read(buf,count,buf.length-count);
+            if(sz<0)     return;
+            count += sz;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java
new file mode 100644
index 0000000..04bc27b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+import javax.xml.namespace.NamespaceContext;
+import java.util.Iterator;
+
+/**
+ * Extended {@link NamespaceContext}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Paul Sandoz
+ */
+public interface NamespaceContextEx extends NamespaceContext, Iterable<NamespaceContextEx.Binding> {
+
+    /**
+     * Iterates all the in-scope namespace bindings.
+     *
+     * <p>
+     * This method enumerates all the active in-scope namespace bindings.
+     * This does not include implicit bindings, such as
+     * <tt>"xml"->"http://www.w3.org/XML/1998/namespace"</tt>
+     * or <tt>""->""</tt> (the implicit default namespace URI.)
+     *
+     * <p>
+     * The returned iterator may not include the same prefix more than once.
+     * For example, the returned iterator may only contain <tt>f=ns2</tt>
+     * if the document is as follows and this method is used at the bar element.
+     *
+     * <pre><xmp>
+     * <foo xmlns:f='ns1'>
+     *   <bar xmlns:f='ns2'>
+     *     ...
+     * </xmp></pre>
+     *
+     * <p>
+     * The iteration may be done in no particular order.
+     *
+     * @return
+     *      may return an empty iterator, but never null.
+     */
+    Iterator<Binding> iterator();
+
+    /**
+     * Prefix to namespace URI binding.
+     */
+    interface Binding {
+        /**
+         * Gets the prefix.
+         *
+         * <p>
+         * The default namespace URI is represented by using an
+         * empty string "", not null.
+         *
+         * @return
+         *      never null. String like "foo", "ns12", or "".
+         */
+        String getPrefix();
+
+        /**
+         * Gets the namespace URI.
+         *
+         * <p>
+         * The empty namespace URI is represented by using
+         * an empty string "", not null.
+         *
+         * @return
+         *      never null. String like "http://www.w3.org/XML/1998/namespace",
+         *      "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", or "".
+         */
+        String getNamespaceURI();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java
new file mode 100644
index 0000000..8bf0f1c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * {@link XMLStreamReader} extended for reading binary data.
+ *
+ * <p>
+ * Some producer of infoset (in particular, such as FastInfoset,
+ * XOP deecoder), usees a native format that enables efficient
+ * treatment of binary data. For ordinary infoset consumer
+ * (that just uses {@link XMLStreamReader}, those binary data
+ * will just look like base64-encoded string, but this interface
+ * allows consumers of such infoset to access this raw binary data.
+ * Such infoset producer may choose to implement this additoinal
+ * interface, to expose this functionality.
+ *
+ * <p>
+ * Consumers that are capable of using this interface can query
+ * {@link XMLStreamReader} if it supports this by simply downcasting
+ * it to this interface like this:
+ *
+ * <pre>
+ * XMLStreamReader reader = ...;
+ * if( reader instanceof XMLStreamReaderEx ) {
+ *   // this reader supports binary data exchange
+ *   ...
+ * } else {
+ *   // noop
+ *   ...
+ * }
+ * </pre>
+ *
+ * <p>
+ * Also note that it is also allowed for the infoset producer
+ * to implement this interface in such a way that {@link #getPCDATA()}
+ * always delegate to {@link #getText()}, although it's not desirable.
+ *
+ * <p>
+ * This interface is a private contract between such producers
+ * and consumers to allow them to exchange binary data without
+ * converting it to base64.
+ *
+ * @see XMLStreamWriterEx
+ * @author Kohsuke Kawaguchi
+ * @author Paul Sandoz
+ */
+public interface XMLStreamReaderEx extends XMLStreamReader {
+    ///**
+    // * Works like {@link XMLStreamReader#getText()}
+    // * but returns text as {@link DataSource}.
+    // *
+    // * <p>
+    // * This method can be invoked whenever {@link XMLStreamReader#getText()}
+    // * can be invoked. Invoking this method means the caller is assuming
+    // * that the text is (conceptually) base64-encoded binary data.
+    // *
+    // * <p>
+    // * This abstraction is necessary to treat XOP as infoset encoding.
+    // * That is, you can either access the XOP-attached binary through
+    // * {@link XMLStreamReader#getText()} (in which case you'll see the
+    // * base64 encoded string), or you can access it as a binary data
+    // * directly by using this method.
+    // *
+    // * <p>
+    // * Note that even if you are reading from non XOP-aware {@link XMLStreamReader},
+    // * this method must be still supported; if the reader is pointing
+    // * to a text, this method is responsible for decoding base64 and
+    // * producing a {@link DataHandler} with "application/octet-stream"
+    // * as the content type.
+    // *
+    // * @return
+    // *      always non-null valid object.
+    // *      Invocations of this method may return the same object as long
+    // *      as the {@link XMLStreamReader#next()} method is not used,
+    // *      but otherwise {@link DataSource} object returned from this method
+    // *      is considered to be owned by the client, and therefore it shouldn't
+    // *      be reused by the implementation of this method.
+    // *
+    // *      <p>
+    // *      The returned {@link DataSource} is read-only, and the caller
+    // *      must not invoke {@link DataSource#getOutputStream()}.
+    // *
+    // * @throws IllegalStateException
+    // *      if the parser is not pointing at characters infoset item.
+    // * @throws XMLStreamException
+    // *      if the parser points to text but text is not base64-encoded text,
+    // *      or if some other parsing error occurs (such as if the &lt;xop:Include>
+    // *      points to a non-existing attachment.)
+    // *
+    // *      <p>
+    // *      It is also OK for this method to return successfully, only to fail
+    // *      during an {@link InputStream} is read from {@link DataSource}.
+    // */
+    //DataSource getTextAsDataHandler() throws XMLStreamException;
+
+    ///**
+    // * Works like {@link XMLStreamReader#getText()}
+    // * but returns text as {@link byte[]}.
+    // *
+    // * <p>
+    // * The contract of this method is mostly the same as
+    // * {@link #getTextAsDataHandler()}, except that this
+    // * method returns the binary datas as an exact-size byte[].
+    // *
+    // * <p>
+    // * This method is also not capable of reporting the content type
+    // * of this binary data, even if it is available to the parser.
+    // *
+    // * @see #getTextAsDataHandler()
+    // */
+    //byte[] getTextAsByteArray() throws XMLStreamException;
+
+    /**
+     * Works like {@link #getText()}
+     * but hides the actual data representation.
+     *
+     * @return
+     *      The {@link CharSequence} that represents the
+     *      character infoset items at the current position.
+     *
+     *      <p>
+     *      The {@link CharSequence} is normally a {@link String},
+     *      but can be any other {@link CharSequence} implementation.
+     *      For binary data, however, use of {@link Base64Data} is
+     *      recommended (so that the consumer interested in seeing it
+     *      as binary data may take advantage of mor efficient
+     *      data representation.)
+     *
+     *      <p>
+     *      The object returned from this method belongs to the parser,
+     *      and its content is guaranteed to be the same only until
+     *      the {@link #next()} method is invoked.
+     *
+     * @throws IllegalStateException
+     *      if the parser is not pointing at characters infoset item.
+     *
+     * TODO:
+     *      fix the dependency to JAXB internal class.
+     */
+    CharSequence getPCDATA() throws XMLStreamException;
+
+    /**
+     * {@inheritDoc}
+     */
+    NamespaceContextEx getNamespaceContext();
+
+    /**
+     * Works like {@link #getElementText()} but trims the leading
+     * and trailing whitespace.
+     *
+     * <p>
+     * The parser can often do this more efficiently than
+     * {@code getElementText().trim()}.
+     *
+     * @see #getElementText()
+     */
+    String getElementTextTrim() throws XMLStreamException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamWriterEx.java b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamWriterEx.java
new file mode 100644
index 0000000..255b32d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamWriterEx.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.org.jvnet.staxex;
+
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamException;
+import javax.activation.DataHandler;
+import java.io.OutputStream;
+
+/**
+ * {@link XMLStreamWriter} extended to support XOP.
+ *
+ * <p>
+ * Some infoset serializer (such as XOP encoder, FastInfoset) uses a format
+ * that can represent binary data more efficiently than base64 encoding.
+ * Such infoset serializer may choose to implement this interface, to allow
+ * the caller to pass in binary data more efficiently without first converting
+ * it to binary data.
+ *
+ * <p>
+ * Callers capable of using this interface can see if the serializer supports
+ * it by simply downcasting {@link XMLStreamWriter} to {@link XMLStreamWriterEx}.
+ *
+ * <h2>TODO</h2>
+ * <ol>
+ * <li>
+ *   Add methods to write other primitive types, such as hex and integers
+ *   (and arrays of).
+ *   A textual implementation would write characters in accordance
+ *   to the canonical lexical definitions specified in W3C XML Schema: datatypes.
+ *   A MTOM implementation would write characters except for the case where octets
+ *   that would otherwise be base64 encoded when using the textual implementation.
+ *   A Fast Infoset implementation would encoded binary data the primitive types in
+ *   binary form.
+ * <li>
+ *   Consider renaming writeBinary to writeBytesAsBase64 to be consistent with
+ *   infoset abstraction.
+ * <li>
+ *   Add the ability to writeStart and writeEnd on attributes so that the same
+ *   methods for writing primitive types (and characters, which will require new methods)
+ *   can be used for writing attribute values as well as element content.
+ * </ol>
+ *
+ * @see XMLStreamReaderEx
+ * @author Kohsuke Kawaguchi
+ * @author Paul Sandoz
+ */
+public interface XMLStreamWriterEx extends XMLStreamWriter {
+
+    /**
+     * Write the binary data.
+     *
+     * <p>
+     * Conceptually (infoset-wise), this produces the base64-encoded binary data on the
+     * output. But this allows implementations like FastInfoset or XOP to do the smart
+     * thing.
+     *
+     * <p>
+     * The use of this method has some restriction to support XOP. Namely, this method
+     * must be invoked as a sole content of an element.
+     *
+     * <p>
+     * (data,start,len) triplet identifies the binary data to be written.
+     *
+     * @param contentType
+     *      this mandatory parameter identifies the MIME type of the binary data.
+     *      If the MIME type isn't known by the caller, "application/octet-stream" can
+     *      be always used to indicate "I don't know." Never null.
+     */
+    void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException;
+
+    /**
+     * Writes the binary data.
+     *
+     * <p>
+     * This method works like the {@link #writeBinary(byte[], int, int, String)} method,
+     * except that it takes the binary data in the form of {@link DataHandler}, which
+     * contains a MIME type ({@link DataHandler#getContentType()} as well as the payload
+     * {@link DataHandler#getInputStream()}.
+     *
+     * @param data
+     *      always non-null.
+     */
+    void writeBinary(DataHandler data) throws XMLStreamException;
+
+    /**
+     * Writes the binary data.
+     *
+     * <p>
+     * This version of the writeBinary method allows the caller to produce
+     * the binary data by writing it to {@link OutputStream}.
+     *
+     * <p>
+     * It is the caller's responsibility to write and close
+     * a stream before it invokes any other methods on {@link XMLStreamWriter}.
+     *
+     * TODO: experimental. appreciate feedback
+     * @param contentType
+     *      See the content-type parameter of
+     *      {@link #writeBinary(byte[], int, int, String)}. Must not be null.
+     *
+     * @return
+     *      always return a non-null {@link OutputStream}.
+     */
+    OutputStream writeBinary(String contentType) throws XMLStreamException;
+
+    /**
+     * Writes like {@link #writeCharacters(String)} but hides
+     * actual data format.
+     *
+     * @return
+     *      The {@link CharSequence} that represents the
+     *      character infoset items to be written.
+     *
+     *      <p>
+     *      The {@link CharSequence} is normally a {@link String},
+     *      but can be any other {@link CharSequence} implementation.
+     *      For binary data, however, use of {@link Base64Data} is
+     *      recommended (so that the consumer interested in seeing it
+     *      as binary data may take advantage of mor efficient
+     *      data representation.)
+     *
+     *      <p>
+     *      The object returned from this method belongs to the parser,
+     *      and its content is guaranteed to be the same only until
+     *      the {@link #next()} method is invoked.
+     */
+    void writePCDATA(CharSequence data) throws XMLStreamException;
+
+    /**
+     * {@inheritDoc}
+     */
+    NamespaceContextEx getNamespaceContext();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Annotations.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Annotations.java
index 3e6f4b4..e6d1670 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Annotations.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Annotations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java
index 3b62400..ee8ca3e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/CommentList.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/CommentList.java
index 39c2879..e711670 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/CommentList.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/CommentList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/DataPatternBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/DataPatternBuilder.java
index 6826c32..53a73c6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/DataPatternBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/DataPatternBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Div.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Div.java
index 759c324..3f3127e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Div.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Div.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/ElementAnnotationBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/ElementAnnotationBuilder.java
index 9e52d48..e0d33bd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/ElementAnnotationBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/ElementAnnotationBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Grammar.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Grammar.java
index c6658d0..9a45b76 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Grammar.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Grammar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/GrammarSection.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/GrammarSection.java
index caf78e0..ef0a461 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/GrammarSection.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/GrammarSection.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Include.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Include.java
index 7acbce7..b6490da 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Include.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Include.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/IncludedGrammar.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/IncludedGrammar.java
index f7ff878..c58dbc1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/IncludedGrammar.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/IncludedGrammar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java
index 8a342a3..e018b5c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java
index cd20f03..78d9f64 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Scope.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Scope.java
index 5f208bc..c9ce2c6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Scope.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/Scope.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.builder;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/Location.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/Location.java
index a078fba..14a3ac5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/Location.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/Location.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.om;
 
 public interface Location { }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedElementAnnotation.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedElementAnnotation.java
index ceb22d8..c9cf4fb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedElementAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedElementAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.om;
 
 public interface ParsedElementAnnotation { }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedNameClass.java
index e9da9c4..57f5f3c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.om;
 
 public interface ParsedNameClass { }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedPattern.java
index d3a1ff9..15fd9d5d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/om/ParsedPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.om;
 
 public interface ParsedPattern { }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java
index ff2a977..9dfcd48 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.util;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/LocatorImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/LocatorImpl.java
index e85e96c..79ee25d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/LocatorImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/LocatorImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.ast.util;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/package.html
index 2e91664..30a3633 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 Typical implementations of the ast.builder/ast.om packages.
 
 Those classes are solely intended to make the AST implementation easier.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java
index 034ebef..0eda64c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java
index e93bd85..d071cc0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.nc.ChoiceNameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java
index bce2aad..48f9655 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/BinaryPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/BinaryPattern.java
index b1ca8c9..99888f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/BinaryPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/BinaryPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java
index 14cbea7..f260642 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataExceptPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataExceptPattern.java
index 7e3cdd4..f951720 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataExceptPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataExceptPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataPattern.java
index 2c4573c..3091f4c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DataPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DuplicateAttributeDetector.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DuplicateAttributeDetector.java
index aa9d8b5..61b1293 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DuplicateAttributeDetector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/DuplicateAttributeDetector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import java.util.ArrayList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java
index 59bf0ba..ee5694e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/EmptyPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/EmptyPattern.java
index 3a6db7e..d09834d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/EmptyPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/EmptyPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ErrorPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ErrorPattern.java
index 2fad943..0fb9530 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ErrorPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ErrorPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java
index 86bd95b..2306008 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java
index 068ca23..c52f4f6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java
index c898dd1..8da2c03 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties
index 0b71e64..5cc5b00 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # Properties file specifying messages
 illegal_href_attribute=illegal \"href\" attribute
 ns_attribute_ignored=\"ns\" attribute ignored
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/NotAllowedPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/NotAllowedPattern.java
index ccb97c0..e7809b2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/NotAllowedPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/NotAllowedPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java
index 8c9f1bd..d2e933f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Pattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Pattern.java
index 6f04f43..489e92a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Pattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Pattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java
index 4086d72..ae5b9b1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 public class PatternBuilder {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternInterner.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternInterner.java
index 5ae8d1e..0b7bc25 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternInterner.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternInterner.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 final class PatternInterner {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java
index 4e02208..92a78de 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RestrictionViolationException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RestrictionViolationException.java
index a9de621..d039364 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RestrictionViolationException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RestrictionViolationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java
index 75546b8..cd789fa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import java.util.Enumeration;
@@ -48,6 +47,7 @@
 import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
 import com.sun.xml.internal.rngom.ast.util.LocatorImpl;
 import com.sun.xml.internal.rngom.dt.builtin.BuiltinDatatypeLibraryFactory;
+import com.sun.xml.internal.rngom.dt.CascadingDatatypeLibraryFactory;
 import com.sun.xml.internal.rngom.nc.NameClass;
 import com.sun.xml.internal.rngom.nc.NameClassBuilderImpl;
 import com.sun.xml.internal.rngom.parse.Context;
@@ -117,7 +117,10 @@
    *        Error handler to receive errors while building the schema.
    */
   public SchemaBuilderImpl(ErrorHandler eh) {
-      this(eh,new BuiltinDatatypeLibraryFactory(new DatatypeLibraryLoader()),new SchemaPatternBuilder());
+      this(eh,
+          new CascadingDatatypeLibraryFactory(new DatatypeLibraryLoader(),
+            new BuiltinDatatypeLibraryFactory(new DatatypeLibraryLoader())),
+          new SchemaPatternBuilder());
   }
 
   /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaPatternBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaPatternBuilder.java
index 919fa27..b849630 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaPatternBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaPatternBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.nc.NameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/StringPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/StringPattern.java
index 09d8da1..2d38e5f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/StringPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/StringPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 abstract class StringPattern extends Pattern {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/TextPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/TextPattern.java
index 6b15463..03e9edd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/TextPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/TextPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java
index 18e4c59..e3e8298 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary;
 
 import com.sun.xml.internal.rngom.binary.visitor.PatternFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/package.html
index b924926..eb6e205 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
   <body>
     Minimal binarized pattern object model (one example of <tt>ast.om</tt> implementation).
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/ChildElementFinder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/ChildElementFinder.java
index 4a40740..ec65da3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/ChildElementFinder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/ChildElementFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary.visitor;
 
 import com.sun.xml.internal.rngom.binary.Pattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternFunction.java
index ef7bef9..cd5d688 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary.visitor;
 
 import com.sun.xml.internal.rngom.binary.AfterPattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternVisitor.java
index adaab60..78b5cf9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary.visitor;
 
 import com.sun.xml.internal.rngom.binary.Pattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java
index fa52209..e2b99ed 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.binary.visitor;
 
 import com.sun.xml.internal.rngom.binary.Pattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Annotation.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Annotation.java
index 381e6b0..f96caf6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Annotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Annotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/CommentListImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/CommentListImpl.java
index 843a592..952ae61 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/CommentListImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/CommentListImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.CommentList;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAnnotation.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAnnotation.java
index b4d4609..d565dfe0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import org.xml.sax.Locator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAttributePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAttributePattern.java
index eb08aed..2d25d4e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAttributePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DAttributePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.nc.NameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DChoicePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DChoicePattern.java
index 863fed0..8225c4d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DChoicePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DChoicePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DContainerPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DContainerPattern.java
index 5e29a5f..6a7cad3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DContainerPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DContainerPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDataPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDataPattern.java
index 38aa868..c476349 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDataPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDataPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDefine.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDefine.java
index 8401f18..4929a13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDefine.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DDefine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DElementPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DElementPattern.java
index c0b0b7d..26e8ad2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DElementPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DElementPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.nc.NameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DEmptyPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DEmptyPattern.java
index 36226a0..ad68906 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DEmptyPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DEmptyPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGrammarPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGrammarPattern.java
index 7690a77..e45916b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGrammarPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGrammarPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import java.util.HashMap;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGroupPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGroupPattern.java
index 403b6cf..b1cf486 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGroupPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DGroupPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DInterleavePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DInterleavePattern.java
index d0b2201..6559c28 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DInterleavePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DInterleavePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DListPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DListPattern.java
index 7655d66..0a9ad4d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DListPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DListPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DMixedPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DMixedPattern.java
index 8b4de88..722de69 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DMixedPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DMixedPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DNotAllowedPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DNotAllowedPattern.java
index fa3aa69..96a62c0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DNotAllowedPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DNotAllowedPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java
index d65d6fe..d6a3033 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import org.w3c.dom.Attr;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOneOrMorePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOneOrMorePattern.java
index c8a77c8..1a56dc1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOneOrMorePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOneOrMorePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOptionalPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOptionalPattern.java
index 3956f19..a27d19d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOptionalPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOptionalPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPattern.java
index 118d148..2a120b1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternVisitor.java
index d879298..15870f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternWalker.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternWalker.java
index 3ca7fb6..bb1d9d1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternWalker.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DPatternWalker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DRefPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DRefPattern.java
index 7eb09cf..8aea0db 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DRefPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DRefPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DSchemaBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DSchemaBuilderImpl.java
index ff9fb90..3cc7be8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DSchemaBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DSchemaBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DTextPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DTextPattern.java
index dcdc9b6..6330cbb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DTextPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DTextPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DUnaryPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DUnaryPattern.java
index f83deb7..e641c47 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DUnaryPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DUnaryPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DValuePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DValuePattern.java
index ed7bfdf..30444ac 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DValuePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DValuePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.parse.Context;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java
index fb17c24..1d0c19b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import java.io.FileOutputStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXmlTokenPattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXmlTokenPattern.java
index 41a7584..1e2dee5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXmlTokenPattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DXmlTokenPattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.nc.NameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DZeroOrMorePattern.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DZeroOrMorePattern.java
index 77fbf8a..40ce70f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DZeroOrMorePattern.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DZeroOrMorePattern.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java
index 896529f..da5031a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementAnnotationBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementAnnotationBuilderImpl.java
index 22046d3..884aae4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementAnnotationBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementAnnotationBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementWrapper.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementWrapper.java
index dc3cf31..6fd82bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementWrapper.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/ElementWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java
index 31d8a47..c412705 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/IncludeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/IncludeImpl.java
index 34f4d1a..f3d1001 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/IncludeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/IncludeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Main.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Main.java
index d5db94f..de9531d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Main.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/PatternParseable.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/PatternParseable.java
index 6ba41e3..2735e7b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/PatternParseable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/PatternParseable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.digested;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/package.html
index e6f75b9..b6657b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Another RELAX NG AST implementation that optimizes away
 inclusions and some other syntax sugars, while still retaining
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java
index 415efff..cc18d4f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt;
 
 import org.relaxng.datatype.DatatypeLibrary;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java
index 6f79fb3..6b158e0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt;
 
 import org.relaxng.datatype.DatatypeLibrary;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/DoNothingDatatypeLibraryFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/DoNothingDatatypeLibraryFactoryImpl.java
index af62b73..f3f89b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/DoNothingDatatypeLibraryFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/DoNothingDatatypeLibraryFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt;
 
 import org.relaxng.datatype.DatatypeLibraryFactory;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java
index ac5d825..c5c5c2e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt.builtin;
 
 import org.relaxng.datatype.Datatype;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibrary.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibrary.java
index 4c2c2ff..622b795 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibrary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibrary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt.builtin;
 
 import org.relaxng.datatype.Datatype;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java
index b7b2f5f..e5e4915 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt.builtin;
 
 import org.relaxng.datatype.DatatypeLibrary;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java
index ab62681..ec032ff 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.dt.builtin;
 
 import org.relaxng.datatype.Datatype;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties
index 42e74f4..be8e2e5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # Properties file specifying messages
 builtin_param=builtin datatypes do not have any parameters
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/package.html
index c12e27d..3e8f23e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/package.html
@@ -1 +1,25 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 RELAX NG built-in datatype implementation.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java
index eb5751c..3a95700 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameExceptNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameExceptNameClass.java
index 6d75a29..ab727ec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameExceptNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameExceptNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/ChoiceNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/ChoiceNameClass.java
index ccc0f73..68788df 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/ChoiceNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/ChoiceNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java
index f15d4a4..2f33115 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedNameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java
index 278cf1a..dabc469 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassVisitor.java
index b527fe9..e6a7c3d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassWalker.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassWalker.java
index 2fca7d2..21e5f13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassWalker.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassWalker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameClass.java
index 9a45c0d..6cbc6a0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java
index ead30dd..fecb0c4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NullNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NullNameClass.java
index 16121db..3dd9464 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NullNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NullNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/OverlapDetector.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/OverlapDetector.java
index ab453b9..5fcd8a9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/OverlapDetector.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/OverlapDetector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java
index 8b4429b..6881feb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.nc;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/package.html
index 90a792a..bda75a6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
   <body>
     Default Name Class Object Model (one example of <tt>ast.om</tt> implementation).
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java
index 2e74e43..7c86972 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse;
 
 import java.util.Enumeration;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/IllegalSchemaException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/IllegalSchemaException.java
index b83223b..ce97dbe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/IllegalSchemaException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/IllegalSchemaException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties
index 011c2a6..141893f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 # common messages between XML and compact syntax parser
 parent_ref_outside_grammar=parentRef is used outside a grammar
 ref_outside_grammar=ref is used outside a grammar
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java
index eef5efb..e6503d8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse;
 
 import com.sun.xml.internal.rngom.ast.builder.*;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactParseable.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactParseable.java
index b60d9c0..35e6646 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactParseable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactParseable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.compact;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java
index cf0d077..540a112 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. CompactSyntax.java */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxConstants.java
index 0872c13..9f75a2a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. CompactSyntaxConstants.java */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java
index 963b0cd..32d3d94 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. CompactSyntaxTokenManager.java */
 package com.sun.xml.internal.rngom.parse.compact;
 import java.io.Reader;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EOFException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EOFException.java
index b7cca0a..537f564a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EOFException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EOFException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.compact;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EscapeSyntaxException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EscapeSyntaxException.java
index 57d51be..6bdf3cd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EscapeSyntaxException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/EscapeSyntaxException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.compact;
 
 class EscapeSyntaxException extends RuntimeException {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java
index bb0a085..15484a4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties
index 45c8940..9f53da0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 syntax_error=syntax error: {0}
 undeclared_prefix=undeclared prefix \"{0}\"
 xmlns_prefix=prefix must not be \"xmlns\"
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java
index 5e198e8..a48f0ea 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Token.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Token.java
index 3e56daa..d3d23f8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Token.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Token.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java
index 6cba0d2..1ffe53d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
 package com.sun.xml.internal.rngom.parse.compact;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java
index 86ac3e9..2129a16 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* Generated By:JavaCC: Do not edit this line. UCode_UCodeESC_CharStream.java Version 0.7pre6 */
 /* The previous line keeps JavaCC quiet. In fact, the JavaCC generated file
    has been edited to fix some bugs. */
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java
index 0e2e646..54e5644 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java
index f48cd2b..3f8d7e8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java
index 4b42441..1149eee 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java
index c80b7ba..fc554e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java
index 1493bfa..5b669e8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java
index bf81d57..608b575 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.BuildException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java
index a35ab1d..2a996b9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java
index 48ef7da..4aef51d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java
index 0385ec7..6959a14 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java
index 363ec50..6aa1664 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.om.Location;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java
index 039520c..8d15c8d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java
index d6fc53e..acccb67 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java
index a6a11f8..dc0cac9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedNameClass;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java
index c6cc785..8a9f7f8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java
index 1260b6c..661bfaa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java
index c5b12da..aec20af 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.host;
 
 import com.sun.xml.internal.rngom.ast.builder.Annotations;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/package.html b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/package.html
index c3635be..d65170f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/package.html
@@ -1,2 +1,26 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 implementation of the <tt>asm.builder</tt> package that uses two
 other builds simultaneously.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/DtdContext.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/DtdContext.java
index ca15677..300b225 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/DtdContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/DtdContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.xml;
 
 import org.xml.sax.DTDHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties
index 5aa4b02..9fc08f3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 no_comment_support=SAX parser \"{0}\" cannot report comments
 any_name_except_contains_any_name=\"except\" in \"anyName\" contains \"anyName\"
 attribute_multi_pattern=\"attribute\" pattern must contain at most one pattern
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java
index e1c0dc8..56e921e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.xml;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java
index f755a5e..4d03f21 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.parse.xml;
 
 import java.util.Enumeration;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java
index 22eea0c..afc606a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.util;
 
 import java.text.MessageFormat;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java
index 7724b38..fdd5db7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.util;
 
 import java.net.URL;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java
index caebb73..85c66af 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.util;
 
 public abstract class Utf16 {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/AbstractLexicalHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/AbstractLexicalHandler.java
index 605c146..369d103 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/AbstractLexicalHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/AbstractLexicalHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.sax;
 
 import org.xml.sax.ext.LexicalHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java
index 58998a8..64b5cfc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.sax;
 
 import javax.xml.parsers.ParserConfigurationException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XMLReaderCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XMLReaderCreator.java
index d7641a0..99a79fd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XMLReaderCreator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XMLReaderCreator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.sax;
 
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java
index d11044d..d892c0d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.sax;
 
 import com.sun.xml.internal.rngom.util.Uri;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java
index 4a25f02..880a22d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.util;
 
 import java.io.UnsupportedEncodingException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java
index e333360..aade9c3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.util;
 
 public class Naming {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/WellKnownNamespaces.java b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/WellKnownNamespaces.java
index 2c7021c..5133395 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/WellKnownNamespaces.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/WellKnownNamespaces.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.rngom.xml.util;
 
 public class WellKnownNamespaces {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java
new file mode 100644
index 0000000..fccd44b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+/**
+ * Base class for classes that creates {@link MutableXMLStreamBuffer}
+ * and from infoset in API-specific form.
+ */
+public class AbstractCreator extends AbstractCreatorProcessor {
+
+    protected MutableXMLStreamBuffer _buffer;
+
+    public void setXMLStreamBuffer(MutableXMLStreamBuffer buffer) {
+        if (buffer == null) {
+            throw new NullPointerException("buffer cannot be null");
+        }
+        setBuffer(buffer);
+    }
+
+    public MutableXMLStreamBuffer getXMLStreamBuffer() {
+        return _buffer;
+    }
+
+
+    protected final void createBuffer() {
+        setBuffer(new MutableXMLStreamBuffer());
+    }
+
+    /**
+     * Should be called whenever a new tree is stored on the buffer.
+     */
+    protected final void increaseTreeCount() {
+        _buffer.treeCount++;
+    }
+
+    protected final void setBuffer(MutableXMLStreamBuffer buffer) {
+        _buffer = buffer;
+
+        _currentStructureFragment = _buffer.getStructure();
+        _structure = _currentStructureFragment.getArray();
+        _structurePtr = 0;
+
+        _currentStructureStringFragment = _buffer.getStructureStrings();
+        _structureStrings = _currentStructureStringFragment.getArray();
+        _structureStringsPtr = 0;
+
+        _currentContentCharactersBufferFragment = _buffer.getContentCharactersBuffer();
+        _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+        _contentCharactersBufferPtr = 0;
+
+        _currentContentObjectFragment = _buffer.getContentObjects();
+        _contentObjects = _currentContentObjectFragment.getArray();
+        _contentObjectsPtr = 0;
+    }
+
+    protected final void setHasInternedStrings(boolean hasInternedStrings) {
+        _buffer.setHasInternedStrings(hasInternedStrings);
+    }
+
+    protected final void storeStructure(int b) {
+        _structure[_structurePtr++] = (byte)b;
+        if (_structurePtr == _structure.length) {
+            resizeStructure();
+        }
+    }
+
+    protected final void resizeStructure() {
+        _structurePtr = 0;
+        if (_currentStructureFragment.getNext() != null) {
+            _currentStructureFragment = _currentStructureFragment.getNext();
+            _structure = _currentStructureFragment.getArray();
+        } else {
+            _structure = new byte[_structure.length];
+            _currentStructureFragment = new FragmentedArray(_structure, _currentStructureFragment);
+        }
+    }
+
+    protected final void storeStructureString(String s) {
+        _structureStrings[_structureStringsPtr++] = s;
+        if (_structureStringsPtr == _structureStrings.length) {
+            resizeStructureStrings();
+        }
+    }
+
+    protected final void resizeStructureStrings() {
+        _structureStringsPtr = 0;
+        if (_currentStructureStringFragment.getNext() != null) {
+            _currentStructureStringFragment = _currentStructureStringFragment.getNext();
+            _structureStrings = _currentStructureStringFragment.getArray();
+        } else {
+            _structureStrings = new String[_structureStrings.length];
+            _currentStructureStringFragment = new FragmentedArray(_structureStrings, _currentStructureStringFragment);
+        }
+    }
+
+    protected final void storeContentString(String s) {
+        storeContentObject(s);
+    }
+
+    protected final void storeContentCharacters(int type, char[] ch, int start, int length) {
+        if (_contentCharactersBufferPtr + length >= _contentCharactersBuffer.length) {
+            if (length >= 512) {
+                storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY);
+                storeContentCharactersCopy(ch, start, length);
+                return;
+            }
+            resizeContentCharacters();
+        }
+
+        if (length < CHAR_ARRAY_LENGTH_SMALL_SIZE) {
+            storeStructure(type | CHAR_ARRAY_LENGTH_SMALL);
+            storeStructure(length);
+            System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length);
+            _contentCharactersBufferPtr += length;
+        } else if (length < CHAR_ARRAY_LENGTH_MEDIUM_SIZE) {
+            storeStructure(type | CHAR_ARRAY_LENGTH_MEDIUM);
+            storeStructure(length >> 8);
+            storeStructure(length & 255);
+            System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length);
+            _contentCharactersBufferPtr += length;
+        } else {
+            storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY);
+            storeContentCharactersCopy(ch, start, length);
+        }
+    }
+
+    protected final void resizeContentCharacters() {
+        _contentCharactersBufferPtr = 0;
+        if (_currentContentCharactersBufferFragment.getNext() != null) {
+            _currentContentCharactersBufferFragment = _currentContentCharactersBufferFragment.getNext();
+            _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+        } else {
+            _contentCharactersBuffer = new char[_contentCharactersBuffer.length];
+            _currentContentCharactersBufferFragment = new FragmentedArray(_contentCharactersBuffer,
+                    _currentContentCharactersBufferFragment);
+        }
+    }
+
+    protected final void storeContentCharactersCopy(char[] ch, int start, int length) {
+        char[] copyOfCh = new char[length];
+        System.arraycopy(ch, start, copyOfCh, 0, length);
+        storeContentObject(copyOfCh);
+    }
+
+    protected final Object peekAtContentObject() {
+        return _contentObjects[_contentObjectsPtr];
+    }
+
+    protected final void storeContentObject(Object s) {
+        _contentObjects[_contentObjectsPtr++] = s;
+        if (_contentObjectsPtr == _contentObjects.length) {
+            resizeContentObjects();
+        }
+    }
+
+    protected final void resizeContentObjects() {
+        _contentObjectsPtr = 0;
+        if (_currentContentObjectFragment.getNext() != null) {
+            _currentContentObjectFragment = _currentContentObjectFragment.getNext();
+            _contentObjects = _currentContentObjectFragment.getArray();
+        } else {
+            _contentObjects = new Object[_contentObjects.length];
+            _currentContentObjectFragment = new FragmentedArray(_contentObjects, _currentContentObjectFragment);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreatorProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreatorProcessor.java
new file mode 100644
index 0000000..2827669
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreatorProcessor.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+public abstract class AbstractCreatorProcessor {
+    /**
+     * Flag on a T_DOCUMENT to indicate if a fragment
+     */
+    protected static final int FLAG_DOCUMENT_FRAGMENT      = 1 << 0;
+
+    /*
+     * Flags on T_ELEMENT, T_ATTRIBUTE, T_NAMESPACE_ATTRIBUTE
+     * to indicate namespace information is represent
+     */
+    protected static final int FLAG_PREFIX                 = 1 << 0;
+    protected static final int FLAG_URI                    = 1 << 1;
+    protected static final int FLAG_QUALIFIED_NAME         = 1 << 2;
+
+    /*
+     * Types of content for T_TEXT and T_COMMENT
+     * <p>
+     * Highest 2 bits of lower nibble are used.
+     */
+    protected static final int CONTENT_TYPE_CHAR_ARRAY        = 0 << 2;
+    protected static final int CONTENT_TYPE_CHAR_ARRAY_COPY   = 1 << 2;
+    protected static final int CONTENT_TYPE_STRING            = 2 << 2;
+    protected static final int CONTENT_TYPE_OBJECT            = 3 << 2;
+
+    /*
+     * Size of the length of character content for CONTENT_TYPE_CHAR_ARRAY
+     * <p>
+     * Last bit of lower nibble is used.
+     */
+    protected static final int CHAR_ARRAY_LENGTH_SMALL        = 0;
+    protected static final int CHAR_ARRAY_LENGTH_MEDIUM       = 1;
+    protected static final int CHAR_ARRAY_LENGTH_SMALL_SIZE   = 1 << 8;
+    protected static final int CHAR_ARRAY_LENGTH_MEDIUM_SIZE  = 1 << 16;
+
+    /*
+     * Types of value for T_ATTRIBUTE
+     * <p>
+     * Highest bit of lower nibble is used.
+     */
+    protected static final int VALUE_TYPE_STRING              = 0;
+    protected static final int VALUE_TYPE_OBJECT              = 1 << 3;
+
+    /*
+     * Mask for types.
+     * <p>
+     * Highest nibble is used.
+     */
+    protected static final int TYPE_MASK                     = 0xF0;
+    protected static final int T_END                         = 0x00;
+    protected static final int T_DOCUMENT                    = 0x10;
+    protected static final int T_ELEMENT                     = 0x20;
+    protected static final int T_ATTRIBUTE                   = 0x30;
+    protected static final int T_NAMESPACE_ATTRIBUTE         = 0x40;
+    protected static final int T_TEXT                        = 0x50;
+    protected static final int T_COMMENT                     = 0x60;
+    protected static final int T_PROCESSING_INSTRUCTION      = 0x70;
+    protected static final int T_UNEXPANDED_ENTITY_REFERENCE = 0x80;
+
+    /*
+     * Composed types.
+     * <p>
+     * One octet is used.
+     */
+    protected static final int T_DOCUMENT_FRAGMENT           = T_DOCUMENT | FLAG_DOCUMENT_FRAGMENT;
+
+    protected static final int T_ELEMENT_U_LN_QN             = T_ELEMENT | FLAG_URI | FLAG_QUALIFIED_NAME;
+    protected static final int T_ELEMENT_P_U_LN              = T_ELEMENT | FLAG_PREFIX | FLAG_URI;
+    protected static final int T_ELEMENT_U_LN                = T_ELEMENT | FLAG_URI;
+    protected static final int T_ELEMENT_LN                  = T_ELEMENT;
+
+    protected static final int T_NAMESPACE_ATTRIBUTE_P       = T_NAMESPACE_ATTRIBUTE | FLAG_PREFIX;
+    protected static final int T_NAMESPACE_ATTRIBUTE_P_U     = T_NAMESPACE_ATTRIBUTE | FLAG_PREFIX | FLAG_URI;
+    protected static final int T_NAMESPACE_ATTRIBUTE_U       = T_NAMESPACE_ATTRIBUTE | FLAG_URI;
+
+    protected static final int T_ATTRIBUTE_U_LN_QN           = T_ATTRIBUTE | FLAG_URI | FLAG_QUALIFIED_NAME;
+    protected static final int T_ATTRIBUTE_P_U_LN            = T_ATTRIBUTE | FLAG_PREFIX | FLAG_URI;
+    protected static final int T_ATTRIBUTE_U_LN              = T_ATTRIBUTE | FLAG_URI;
+    protected static final int T_ATTRIBUTE_LN                = T_ATTRIBUTE;
+    protected static final int T_ATTRIBUTE_U_LN_QN_OBJECT    = T_ATTRIBUTE_U_LN_QN | VALUE_TYPE_OBJECT;
+    protected static final int T_ATTRIBUTE_P_U_LN_OBJECT     = T_ATTRIBUTE_P_U_LN | VALUE_TYPE_OBJECT;
+    protected static final int T_ATTRIBUTE_U_LN_OBJECT       = T_ATTRIBUTE_U_LN | VALUE_TYPE_OBJECT;
+    protected static final int T_ATTRIBUTE_LN_OBJECT         = T_ATTRIBUTE_LN | VALUE_TYPE_OBJECT;
+
+    protected static final int T_TEXT_AS_CHAR_ARRAY          = T_TEXT;
+    protected static final int T_TEXT_AS_CHAR_ARRAY_SMALL    = T_TEXT | CHAR_ARRAY_LENGTH_SMALL;
+    protected static final int T_TEXT_AS_CHAR_ARRAY_MEDIUM   = T_TEXT | CHAR_ARRAY_LENGTH_MEDIUM;
+    protected static final int T_TEXT_AS_CHAR_ARRAY_COPY     = T_TEXT | CONTENT_TYPE_CHAR_ARRAY_COPY;
+    protected static final int T_TEXT_AS_STRING              = T_TEXT | CONTENT_TYPE_STRING;
+    protected static final int T_TEXT_AS_OBJECT              = T_TEXT | CONTENT_TYPE_OBJECT;
+
+    protected static final int T_COMMENT_AS_CHAR_ARRAY        = T_COMMENT;
+    protected static final int T_COMMENT_AS_CHAR_ARRAY_SMALL  = T_COMMENT | CHAR_ARRAY_LENGTH_SMALL;
+    protected static final int T_COMMENT_AS_CHAR_ARRAY_MEDIUM = T_COMMENT | CHAR_ARRAY_LENGTH_MEDIUM;
+    protected static final int T_COMMENT_AS_CHAR_ARRAY_COPY   = T_COMMENT | CONTENT_TYPE_CHAR_ARRAY_COPY;
+    protected static final int T_COMMENT_AS_STRING            = T_COMMENT | CONTENT_TYPE_STRING;
+
+    protected static final int T_END_OF_BUFFER               = -1;
+
+    protected FragmentedArray<byte[]> _currentStructureFragment;
+    protected byte[] _structure;
+    protected int _structurePtr;
+
+    protected FragmentedArray<String[]> _currentStructureStringFragment;
+    protected String[] _structureStrings;
+    protected int _structureStringsPtr;
+
+    protected FragmentedArray<char[]> _currentContentCharactersBufferFragment;
+    protected char[] _contentCharactersBuffer;
+    protected int _contentCharactersBufferPtr;
+
+    protected FragmentedArray<Object[]> _currentContentObjectFragment;
+    protected Object[] _contentObjects;
+    protected int _contentObjectsPtr;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractProcessor.java
new file mode 100644
index 0000000..b9f15ba
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractProcessor.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+/**
+ * Base class for classes that processes {@link XMLStreamBuffer}
+ * and produces infoset in API-specific form.
+ */
+public abstract class AbstractProcessor extends AbstractCreatorProcessor {
+    protected  static final int STATE_ILLEGAL                       = 0;
+
+    protected  static final int STATE_DOCUMENT                      = 1;
+    protected  static final int STATE_DOCUMENT_FRAGMENT             = 2;
+    protected  static final int STATE_ELEMENT_U_LN_QN               = 3;
+    protected  static final int STATE_ELEMENT_P_U_LN                = 4;
+    protected  static final int STATE_ELEMENT_U_LN                  = 5;
+    protected  static final int STATE_ELEMENT_LN                    = 6;
+    protected  static final int STATE_TEXT_AS_CHAR_ARRAY_SMALL      = 7;
+    protected  static final int STATE_TEXT_AS_CHAR_ARRAY_MEDIUM     = 8;
+    protected  static final int STATE_TEXT_AS_CHAR_ARRAY_COPY       = 9;
+    protected  static final int STATE_TEXT_AS_STRING                = 10;
+    protected  static final int STATE_TEXT_AS_OBJECT                = 11;
+    protected  static final int STATE_COMMENT_AS_CHAR_ARRAY_SMALL   = 12;
+    protected  static final int STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM  = 13;
+    protected  static final int STATE_COMMENT_AS_CHAR_ARRAY_COPY    = 14;
+    protected  static final int STATE_COMMENT_AS_STRING             = 15;
+    protected  static final int STATE_PROCESSING_INSTRUCTION        = 16;
+    protected  static final int STATE_END                           = 17;
+    protected  static final int[] _eiiStateTable = new int[256];
+
+    protected  static final int STATE_NAMESPACE_ATTRIBUTE           = 1;
+    protected  static final int STATE_NAMESPACE_ATTRIBUTE_P         = 2;
+    protected  static final int STATE_NAMESPACE_ATTRIBUTE_P_U       = 3;
+    protected  static final int STATE_NAMESPACE_ATTRIBUTE_U         = 4;
+    protected  static final int[] _niiStateTable = new int[256];
+
+    protected  static final int STATE_ATTRIBUTE_U_LN_QN             = 1;
+    protected  static final int STATE_ATTRIBUTE_P_U_LN              = 2;
+    protected  static final int STATE_ATTRIBUTE_U_LN                = 3;
+    protected  static final int STATE_ATTRIBUTE_LN                  = 4;
+    protected  static final int STATE_ATTRIBUTE_U_LN_QN_OBJECT      = 5;
+    protected  static final int STATE_ATTRIBUTE_P_U_LN_OBJECT       = 6;
+    protected  static final int STATE_ATTRIBUTE_U_LN_OBJECT         = 7;
+    protected  static final int STATE_ATTRIBUTE_LN_OBJECT           = 8;
+    protected  static final int[] _aiiStateTable = new int[256];
+
+    static {
+        /*
+         * Create a state table from information items and options.
+         * The swtich statement using such states will often generate a more
+         * efficient byte code representation that can be hotspotted using
+         * jump tables.
+         */
+        _eiiStateTable[T_DOCUMENT] = STATE_DOCUMENT;
+        _eiiStateTable[T_DOCUMENT_FRAGMENT] = STATE_DOCUMENT_FRAGMENT;
+        _eiiStateTable[T_ELEMENT_U_LN_QN] = STATE_ELEMENT_U_LN_QN;
+        _eiiStateTable[T_ELEMENT_P_U_LN] = STATE_ELEMENT_P_U_LN;
+        _eiiStateTable[T_ELEMENT_U_LN] = STATE_ELEMENT_U_LN;
+        _eiiStateTable[T_ELEMENT_LN] = STATE_ELEMENT_LN;
+        _eiiStateTable[T_TEXT_AS_CHAR_ARRAY_SMALL] = STATE_TEXT_AS_CHAR_ARRAY_SMALL;
+        _eiiStateTable[T_TEXT_AS_CHAR_ARRAY_MEDIUM] = STATE_TEXT_AS_CHAR_ARRAY_MEDIUM;
+        _eiiStateTable[T_TEXT_AS_CHAR_ARRAY_COPY] = STATE_TEXT_AS_CHAR_ARRAY_COPY;
+        _eiiStateTable[T_TEXT_AS_STRING] = STATE_TEXT_AS_STRING;
+        _eiiStateTable[T_TEXT_AS_OBJECT] = STATE_TEXT_AS_OBJECT;
+        _eiiStateTable[T_COMMENT_AS_CHAR_ARRAY_SMALL] = STATE_COMMENT_AS_CHAR_ARRAY_SMALL;
+        _eiiStateTable[T_COMMENT_AS_CHAR_ARRAY_MEDIUM] = STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM;
+        _eiiStateTable[T_COMMENT_AS_CHAR_ARRAY_COPY] = STATE_COMMENT_AS_CHAR_ARRAY_COPY;
+        _eiiStateTable[T_COMMENT_AS_STRING] = STATE_COMMENT_AS_STRING;
+        _eiiStateTable[T_PROCESSING_INSTRUCTION] = STATE_PROCESSING_INSTRUCTION;
+        _eiiStateTable[T_END] = STATE_END;
+
+        _niiStateTable[T_NAMESPACE_ATTRIBUTE] = STATE_NAMESPACE_ATTRIBUTE;
+        _niiStateTable[T_NAMESPACE_ATTRIBUTE_P] = STATE_NAMESPACE_ATTRIBUTE_P;
+        _niiStateTable[T_NAMESPACE_ATTRIBUTE_P_U] = STATE_NAMESPACE_ATTRIBUTE_P_U;
+        _niiStateTable[T_NAMESPACE_ATTRIBUTE_U] = STATE_NAMESPACE_ATTRIBUTE_U;
+
+        _aiiStateTable[T_ATTRIBUTE_U_LN_QN] = STATE_ATTRIBUTE_U_LN_QN;
+        _aiiStateTable[T_ATTRIBUTE_P_U_LN] = STATE_ATTRIBUTE_P_U_LN;
+        _aiiStateTable[T_ATTRIBUTE_U_LN] = STATE_ATTRIBUTE_U_LN;
+        _aiiStateTable[T_ATTRIBUTE_LN] = STATE_ATTRIBUTE_LN;
+        _aiiStateTable[T_ATTRIBUTE_U_LN_QN_OBJECT] = STATE_ATTRIBUTE_U_LN_QN_OBJECT;
+        _aiiStateTable[T_ATTRIBUTE_P_U_LN_OBJECT] = STATE_ATTRIBUTE_P_U_LN_OBJECT;
+        _aiiStateTable[T_ATTRIBUTE_U_LN_OBJECT] = STATE_ATTRIBUTE_U_LN_OBJECT;
+        _aiiStateTable[T_ATTRIBUTE_LN_OBJECT] = STATE_ATTRIBUTE_LN_OBJECT;
+    }
+
+    protected XMLStreamBuffer _buffer;
+
+    /**
+     * True if this processor should create a fragment of XML, without the start/end document markers.
+     */
+    protected boolean _fragmentMode;
+
+    protected boolean _stringInterningFeature = false;
+
+    /**
+     * Number of remaining XML element trees that should be visible
+     * through this {@link AbstractProcessor}.
+     */
+    protected int _treeCount;
+
+    /**
+     * @deprecated
+     *      Use {@link #setBuffer(XMLStreamBuffer, boolean)}
+     */
+    protected final void setBuffer(XMLStreamBuffer buffer) {
+        setBuffer(buffer,buffer.isFragment());
+    }
+    protected final void setBuffer(XMLStreamBuffer buffer, boolean fragmentMode) {
+        _buffer = buffer;
+        _fragmentMode = fragmentMode;
+
+        _currentStructureFragment = _buffer.getStructure();
+        _structure = _currentStructureFragment.getArray();
+        _structurePtr = _buffer.getStructurePtr();
+
+        _currentStructureStringFragment = _buffer.getStructureStrings();
+        _structureStrings = _currentStructureStringFragment.getArray();
+        _structureStringsPtr = _buffer.getStructureStringsPtr();
+
+        _currentContentCharactersBufferFragment = _buffer.getContentCharactersBuffer();
+        _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+        _contentCharactersBufferPtr = _buffer.getContentCharactersBufferPtr();
+
+        _currentContentObjectFragment = _buffer.getContentObjects();
+        _contentObjects = _currentContentObjectFragment.getArray();
+        _contentObjectsPtr = _buffer.getContentObjectsPtr();
+
+        _stringInterningFeature = _buffer.hasInternedStrings();
+        _treeCount = _buffer.treeCount;
+    }
+
+    protected final int peekStructure() {
+        if (_structurePtr < _structure.length) {
+            return _structure[_structurePtr] & 255;
+        }
+
+        return readFromNextStructure(0);
+    }
+
+    protected final int readStructure() {
+        if (_structurePtr < _structure.length) {
+            return _structure[_structurePtr++] & 255;
+        }
+
+        return readFromNextStructure(1);
+    }
+
+    protected final int readEiiState() {
+        return _eiiStateTable[readStructure()];
+    }
+
+    protected final int readStructure16() {
+        return (readStructure() << 8) | readStructure();
+    }
+
+    private int readFromNextStructure(int v) {
+        _structurePtr = v;
+        _currentStructureFragment = _currentStructureFragment.getNext();
+        _structure = _currentStructureFragment.getArray();
+        return _structure[0] & 255;
+    }
+
+    protected final String readStructureString() {
+        if (_structureStringsPtr < _structureStrings.length) {
+            return _structureStrings[_structureStringsPtr++];
+        }
+
+        _structureStringsPtr = 1;
+        _currentStructureStringFragment = _currentStructureStringFragment.getNext();
+        _structureStrings = _currentStructureStringFragment.getArray();
+        return _structureStrings[0];
+    }
+
+    protected final String readContentString() {
+        return (String)readContentObject();
+    }
+
+    protected final char[] readContentCharactersCopy() {
+        return (char[])readContentObject();
+    }
+
+    protected final int readContentCharactersBuffer(int length) {
+        if (_contentCharactersBufferPtr + length < _contentCharactersBuffer.length) {
+            final int start = _contentCharactersBufferPtr;
+            _contentCharactersBufferPtr += length;
+            return start;
+        }
+
+        _contentCharactersBufferPtr = length;
+        _currentContentCharactersBufferFragment = _currentContentCharactersBufferFragment.getNext();
+        _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+        return 0;
+    }
+
+    protected final Object readContentObject() {
+        if (_contentObjectsPtr < _contentObjects.length) {
+            return _contentObjects[_contentObjectsPtr++];
+        }
+
+        _contentObjectsPtr = 1;
+        _currentContentObjectFragment = _currentContentObjectFragment.getNext();
+        _contentObjects = _currentContentObjectFragment.getArray();
+        return _contentObjects[0];
+    }
+
+    protected final StringBuilder _qNameBuffer = new StringBuilder();
+
+    protected final String getQName(String prefix, String localName) {
+        _qNameBuffer.append(prefix).append(':').append(localName);
+        final String qName = _qNameBuffer.toString();
+        _qNameBuffer.setLength(0);
+        return (_stringInterningFeature) ? qName.intern() : qName;
+    }
+
+    protected final String getPrefixFromQName(String qName) {
+        int pIndex = qName.indexOf(':');
+        if (_stringInterningFeature) {
+            return (pIndex != -1) ? qName.substring(0,pIndex).intern() : "";
+        } else {
+            return (pIndex != -1) ? qName.substring(0,pIndex) : "";
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AttributesHolder.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AttributesHolder.java
new file mode 100644
index 0000000..9daa2ce
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AttributesHolder.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import org.xml.sax.Attributes;
+
+/**
+ * Class for holding attributes.
+ *
+ * Since it implements {@link Attributes}, this class follows the SAX convention
+ * of using "" instead of null.
+ */
+@SuppressWarnings({"PointlessArithmeticExpression"})
+public final class AttributesHolder implements Attributes {
+    protected static final int DEFAULT_CAPACITY = 8;
+    protected static final int ITEM_SIZE = 1 << 3;
+
+    protected static final int PREFIX     = 0;
+    protected static final int URI        = 1;
+    protected static final int LOCAL_NAME = 2;
+    protected static final int QNAME      = 3;
+    protected static final int TYPE       = 4;
+    protected static final int VALUE      = 5;
+
+    protected int _attributeCount;
+
+    protected String[] _strings;
+
+    public AttributesHolder() {
+        _strings = new String[DEFAULT_CAPACITY * ITEM_SIZE];
+    }
+
+    public final int getLength() {
+        return _attributeCount;
+    }
+
+    public final String getPrefix(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + PREFIX] : null;
+    }
+
+    public final String getLocalName(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + LOCAL_NAME] : null;
+    }
+
+    public final String getQName(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + QNAME] : null;
+    }
+
+    public final String getType(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + TYPE] : null;
+    }
+
+    public final String getURI(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + URI] : null;
+    }
+
+    public final String getValue(int index) {
+        return (index >= 0 && index < _attributeCount) ?
+            _strings[(index << 3) + VALUE] : null;
+    }
+
+    public final int getIndex(String qName) {
+        for (int i = 0; i < _attributeCount; i++) {
+            if (qName.equals(_strings[(i << 3) + QNAME])) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    public final String getType(String qName) {
+        final int i = (getIndex(qName) << 3) + TYPE;
+        return (i >= 0) ? _strings[i] : null;
+    }
+
+    public final String getValue(String qName) {
+        final int i = (getIndex(qName) << 3) + VALUE;
+        return (i >= 0) ? _strings[i] : null;
+    }
+
+    public final int getIndex(String uri, String localName) {
+        for (int i = 0; i < _attributeCount; i++) {
+            if (localName.equals(_strings[(i << 3) + LOCAL_NAME]) &&
+                uri.equals(_strings[(i << 3) + URI])) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    public final String getType(String uri, String localName) {
+        final int i = (getIndex(uri, localName) << 3) + TYPE;
+        return (i >= 0) ? _strings[i] : null;
+    }
+
+    public final String getValue(String uri, String localName) {
+        final int i = (getIndex(uri, localName) << 3) + VALUE;
+        return (i >= 0) ? _strings[i] : null;
+    }
+
+    public final void clear() {
+        if (_attributeCount > 0) {
+            for (int i = 0; i < _attributeCount; i++) {
+                _strings[(i << 3) + VALUE] = null;
+            }
+            _attributeCount = 0;
+        }
+    }
+
+
+    /**
+     * Add an attribute using a qualified name that contains the
+     * prefix and local name.
+     *
+     * @param uri
+     *      This can be empty but not null, just like everywhere else in SAX.
+     */
+    public final void addAttributeWithQName(String uri, String localName, String qName, String type, String value) {
+        final int i = _attributeCount << 3;
+        if (i == _strings.length) {
+            resize(i);
+        }
+
+        _strings[i + PREFIX] = null;
+        _strings[i + URI] = uri;
+        _strings[i + LOCAL_NAME] = localName;
+        _strings[i + QNAME] = qName;
+        _strings[i + TYPE] = type;
+        _strings[i + VALUE] = value;
+
+        _attributeCount++;
+    }
+
+    /**
+     * Add an attribute using a prefix.
+     *
+     * @param prefix
+     *      This can be empty but not null, just like everywhere else in SAX.
+     * @param uri
+     *      This can be empty but not null, just like everywhere else in SAX.
+     */
+    public final void addAttributeWithPrefix(String prefix, String uri, String localName, String type, String value) {
+        final int i = _attributeCount << 3;
+        if (i == _strings.length) {
+            resize(i);
+        }
+
+        _strings[i + PREFIX] = prefix;
+        _strings[i + URI] = uri;
+        _strings[i + LOCAL_NAME] = localName;
+        _strings[i + QNAME] = null;
+        _strings[i + TYPE] = type;
+        _strings[i + VALUE] = value;
+
+        _attributeCount++;
+    }
+
+    private void resize(int length) {
+        final int newLength = length * 2;
+        final String[] strings = new String[newLength];
+        System.arraycopy(_strings, 0, strings, 0, length);
+        _strings = strings;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/FragmentedArray.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/FragmentedArray.java
new file mode 100644
index 0000000..9175167
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/FragmentedArray.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+class FragmentedArray<T> {
+    protected T _item;
+    protected FragmentedArray<T> _next;
+    protected FragmentedArray<T> _previous;
+
+    FragmentedArray(T item) {
+        this(item, null);
+    }
+
+    FragmentedArray(T item, FragmentedArray<T> previous) {
+        setArray(item);
+        if (previous != null) {
+            previous._next = this;
+            _previous = previous;
+        }
+    }
+
+    T getArray() {
+        return _item;
+    }
+
+    void setArray(T item) {
+        assert(item.getClass().isArray());
+
+        _item = item;
+    }
+
+    FragmentedArray<T> getNext() {
+        return _next;
+    }
+
+    void setNext(FragmentedArray<T> next) {
+        _next = next;
+        if (next != null) {
+            next._previous = this;
+        }
+    }
+
+    FragmentedArray<T> getPrevious() {
+        return _previous;
+    }
+
+    void setPrevious(FragmentedArray<T> previous) {
+        _previous = previous;
+        if (previous != null) {
+            previous._next = this;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/MutableXMLStreamBuffer.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/MutableXMLStreamBuffer.java
new file mode 100644
index 0000000..cf699ac
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/MutableXMLStreamBuffer.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import com.sun.xml.internal.stream.buffer.sax.Properties;
+import com.sun.xml.internal.stream.buffer.sax.SAXBufferCreator;
+import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferCreator;
+import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferCreator;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ *
+ * A mutable stream-based buffer of an XML infoset.
+ *
+ * <p>
+ * A MutableXMLStreamBuffer is created using specific SAX and StAX-based
+ * creators. Utility methods on MutableXMLStreamBuffer are provided for
+ * such functionality that utilize SAX and StAX-based creators.
+ *
+ * <p>
+ * Once instantiated the same instance of a MutableXMLStreamBuffer may be reused for
+ * creation to reduce the amount of Objects instantiated and garbage
+ * collected that are required for internally representing an XML infoset.
+ *
+ * <p>
+ * A MutableXMLStreamBuffer is not designed to be created and processed
+ * concurrently. If done so unspecified behaviour may occur.
+ */
+public class MutableXMLStreamBuffer extends XMLStreamBuffer {
+    /**
+     * The default array size for the arrays used in internal representation
+     * of the XML infoset.
+     */
+    public static int DEFAULT_ARRAY_SIZE = 512;
+
+    /**
+     * Create a new MutableXMLStreamBuffer using the
+     * {@link MutableXMLStreamBuffer#DEFAULT_ARRAY_SIZE}.
+     */
+    public MutableXMLStreamBuffer() {
+        this(DEFAULT_ARRAY_SIZE);
+    }
+
+    /**
+     * Set the system identifier for this buffer.
+     * @param systemId The system identifier.
+     */
+    public void setSystemId(String systemId) {
+        this.systemId = systemId;
+    }
+
+    /**
+     * Create a new MutableXMLStreamBuffer.
+     *
+     * @param size
+     * The size of the arrays used in the internal representation
+     * of the XML infoset.
+     * @throws NegativeArraySizeException
+     * If the <code>size</code> argument is less than <code>0</code>.
+     */
+    public MutableXMLStreamBuffer(int size) {
+        _structure = new FragmentedArray<byte[]>(new byte[size]);
+        _structureStrings = new FragmentedArray<String[]>(new String[size]);
+        _contentCharactersBuffer = new FragmentedArray<char[]>(new char[4096]);
+        _contentObjects = new FragmentedArray<Object[]>(new Object[size]);
+
+        // Set the first element of structure array to indicate an empty buffer
+        // that has not been created
+        _structure.getArray()[0] = AbstractCreatorProcessor.T_END;
+    }
+
+    /**
+     * Create contents of a buffer from a XMLStreamReader.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is created by consuming the events on the XMLStreamReader using
+     * an instance of {@link StreamReaderBufferCreator}.
+     *
+     * @param reader
+     * A XMLStreamReader to read from to create.
+     */
+    public void createFromXMLStreamReader(XMLStreamReader reader) throws XMLStreamException {
+        reset();
+        StreamReaderBufferCreator c = new StreamReaderBufferCreator(this);
+        c.create(reader);
+    }
+
+    /**
+     * Create contents of a buffer from a XMLStreamWriter.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is created by consuming events on a XMLStreamWriter using
+     * an instance of {@link StreamWriterBufferCreator}.
+     */
+    public XMLStreamWriter createFromXMLStreamWriter() {
+        reset();
+        return new StreamWriterBufferCreator(this);
+    }
+
+    /**
+     * Create contents of a buffer from a {@link SAXBufferCreator}.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is created by consuming events from a {@link ContentHandler} using
+     * an instance of {@link SAXBufferCreator}.
+     *
+     * @return The {@link SAXBufferCreator} to create from.
+     */
+    public SAXBufferCreator createFromSAXBufferCreator() {
+        reset();
+        SAXBufferCreator c = new SAXBufferCreator();
+        c.setBuffer(this);
+        return c;
+    }
+
+    /**
+     * Create contents of a buffer from a {@link XMLReader} and {@link InputStream}.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is created by using an instance of {@link SAXBufferCreator}
+     * and registering associated handlers on the {@link XMLReader}.
+     *
+     * @param reader
+     * The {@link XMLReader} to use for parsing.
+     * @param in
+     * The {@link InputStream} to be parsed.
+     */
+    public void createFromXMLReader(XMLReader reader, InputStream in) throws SAXException, IOException {
+        createFromXMLReader(reader, in, null);
+    }
+
+    /**
+     * Create contents of a buffer from a {@link XMLReader} and {@link InputStream}.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+     *
+     * <p>
+     * The MutableXMLStreamBuffer is created by using an instance of {@link SAXBufferCreator}
+     * and registering associated handlers on the {@link XMLReader}.
+     *
+     * @param reader
+     * The {@link XMLReader} to use for parsing.
+     * @param in
+     * The {@link InputStream} to be parsed.
+     * @param systemId
+     * The system ID of the input stream.
+     */
+    public void createFromXMLReader(XMLReader reader, InputStream in, String systemId) throws SAXException, IOException {
+        reset();
+        SAXBufferCreator c = new SAXBufferCreator(this);
+
+        reader.setContentHandler(c);
+        reader.setDTDHandler(c);
+        reader.setProperty(Properties.LEXICAL_HANDLER_PROPERTY, c);
+
+        c.create(reader, in, systemId);
+    }
+
+    /**
+     * Reset the MutableXMLStreamBuffer.
+     *
+     * <p>
+     * This method will reset the MutableXMLStreamBuffer to a state of being "uncreated"
+     * similar to the state of a newly instantiated MutableXMLStreamBuffer.
+     *
+     * <p>
+     * As many Objects as possible will be retained for reuse in future creation.
+     */
+    public void reset() {
+        // Reset the ptrs in arrays to 0
+        _structurePtr =
+                _structureStringsPtr =
+                _contentCharactersBufferPtr =
+                _contentObjectsPtr = 0;
+
+        // Set the first element of structure array to indicate an empty buffer
+        // that has not been created
+        _structure.getArray()[0] = AbstractCreatorProcessor.T_END;
+
+        // Clean up content objects
+        _contentObjects.setNext(null);
+        final Object[] o = _contentObjects.getArray();
+        for (int i = 0; i < o.length; i++) {
+            if (o[i] != null) {
+                o[i] = null;
+            } else {
+                break;
+            }
+        }
+
+        treeCount = 0;
+
+        /*
+         * TODO consider truncating the size of _structureStrings and
+         * _contentCharactersBuffer to limit the memory used by the buffer
+         */
+    }
+
+
+    protected void setHasInternedStrings(boolean hasInternedStrings) {
+        _hasInternedStrings = hasInternedStrings;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBuffer.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBuffer.java
new file mode 100644
index 0000000..b7394e3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBuffer.java
@@ -0,0 +1,473 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import com.sun.xml.internal.stream.buffer.sax.SAXBufferProcessor;
+import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferProcessor;
+import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferProcessor;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Map;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.dom.DOMResult;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.w3c.dom.Node;
+
+/**
+ * An immutable stream-based buffer of an XML infoset.
+ *
+ * <p>
+ * A XMLStreamBuffer is an abstract class. It is immutable with
+ * respect to the methods on the class, which are non-modifying in terms
+ * of state.
+ *
+ * <p>
+ * A XMLStreamBuffer can be processed using specific SAX and StAX-based
+ * processors. Utility methods on XMLStreamBuffer are provided for
+ * such functionality that utilize SAX and StAX-based processors.
+ * The same instance of a XMLStreamBuffer may be processed
+ * multiple times and concurrently by more than one processor.
+ *
+ * <p>
+ * There are two concrete implementations of XMLStreamBuffer.
+ * The first, {@link MutableXMLStreamBuffer}, can be instantiated for the creation
+ * of a buffer using SAX and StAX-based creators, and from which may be
+ * processed as an XMLStreamBuffer. The second,
+ * {@link XMLStreamBufferMark}, can be instantiated to mark into an existing
+ * buffer that is being created or processed. This allows a subtree of
+ * {@link XMLStreamBuffer} to be treated as its own {@link XMLStreamBuffer}.
+ *
+ * <p>
+ * A XMLStreamBuffer can represent a complete XML infoset or a subtree
+ * of an XML infoset. It is also capable of representing a "forest",
+ * where the buffer represents multiple adjacent XML elements, although
+ * in this mode there are restrictions about how you can consume such
+ * forest, because not all XML APIs handle forests very well.
+ */
+public abstract class XMLStreamBuffer {
+
+    /**
+     * In scope namespaces on a fragment
+     */
+    protected Map<String,String> _inscopeNamespaces = Collections.emptyMap();
+
+    /**
+     * True if the buffer was created from a parser that interns Strings
+     * as specified by the SAX interning features
+     */
+    protected boolean _hasInternedStrings;
+
+    /**
+     * Fragmented array to hold structural information
+     */
+    protected FragmentedArray<byte[]> _structure;
+    protected int _structurePtr;
+
+    /**
+     * Fragmented array to hold structural information as strings
+     */
+    protected FragmentedArray<String[]> _structureStrings;
+    protected int _structureStringsPtr;
+
+    /**
+     * Fragmented array to hold content information in a shared char[]
+     */
+    protected FragmentedArray<char[]> _contentCharactersBuffer;
+    protected int _contentCharactersBufferPtr;
+
+    /**
+     * Fragmented array to hold content information as objects
+     */
+    protected FragmentedArray<Object[]> _contentObjects;
+    protected int _contentObjectsPtr;
+
+    /**
+     * Number of trees in this stream buffer.
+     *
+     * <p>
+     * 1 if there's only one, which is the normal case. When the buffer
+     * holds a forest, this value is greater than 1. If the buffer is empty, then 0.
+     *
+     * <p>
+     * Notice that we cannot infer this value by looking at the {@link FragmentedArray}s,
+     * because this {@link XMLStreamBuffer} maybe a view of a portion of another bigger
+     * {@link XMLStreamBuffer}.
+     */
+    protected int treeCount;
+
+    /**
+     * The system identifier associated with the buffer
+     */
+    protected String systemId;
+
+    /**
+     * Is the buffer created by creator.
+     *
+     * @return
+     * <code>true</code> if the buffer has been created.
+     */
+    public final boolean isCreated() {
+        return _structure.getArray()[0] != AbstractCreatorProcessor.T_END;
+    }
+
+    /**
+     * Is the buffer a representation of a fragment of an XML infoset.
+     *
+     * @return
+     * <code>true</code> if the buffer is a representation of a fragment
+     * of an XML infoset.
+     */
+    public final boolean isFragment() {
+        return (isCreated() && (_structure.getArray()[_structurePtr] & AbstractCreatorProcessor.TYPE_MASK)
+                != AbstractCreatorProcessor.T_DOCUMENT);
+    }
+
+    /**
+     * Is the buffer a representation of a fragment of an XML infoset
+     * that is an element (and its contents).
+     *
+     * @return
+     * <code>true</code> if the buffer a representation
+     * of a fragment of an XML infoset that is an element (and its contents).
+     */
+    public final boolean isElementFragment() {
+        return (isCreated() && (_structure.getArray()[_structurePtr] & AbstractCreatorProcessor.TYPE_MASK)
+                == AbstractCreatorProcessor.T_ELEMENT);
+    }
+
+    /**
+     * Returns ture if this buffer represents a forest, which is
+     * are more than one adjacent XML elements.
+     */
+    public final boolean isForest() {
+        return isCreated() && treeCount>1;
+    }
+
+    /**
+     * Get the system identifier associated with the buffer.
+     * @return The system identifier.
+     */
+    public final String getSystemId() {
+        return systemId;
+    }
+
+    /**
+     * Get the in-scope namespaces.
+     *
+     * <p>
+     *
+     * The in-scope namespaces will be empty if the buffer is not a
+     * fragment ({@link #isFragment} returns <code>false</code>).
+     *
+     * The in-scope namespace will correspond to the in-scope namespaces of the
+     * fragment if the buffer is a fragment ({@link #isFragment}
+     * returns <code>false</code>). The in-scope namespaces will include any
+     * namespace delcarations on an element if the fragment correspond to that
+     * of an element ({@link #isElementFragment} returns <code>false</code>).
+     *
+     * @return
+     *      The in-scope namespaces of the XMLStreamBuffer.
+     *      Prefix to namespace URI.
+     */
+    public final Map<String,String> getInscopeNamespaces() {
+        return _inscopeNamespaces;
+    }
+
+    /**
+     * Has the buffer been created using Strings that have been interned
+     * for certain properties of information items. The Strings that are interned
+     * are those that correspond to Strings that are specified by the SAX API
+     * "string-interning" property
+     * (see <a href="http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/package-summary.html#package_description">here</a>).
+     *
+     * <p>
+     * An buffer may have been created, for example, from an XML document parsed
+     * using the Xerces SAX parser. The Xerces SAX parser will have interned certain Strings
+     * according to the SAX string interning property.
+     * This method enables processors to avoid the duplication of
+     * String interning if such a feature is required by a procesing application and the
+     * buffer being processed was created using Strings that have been interned.
+     *
+     * @return
+     * <code>true</code> if the buffer has been created using Strings that
+     * have been interned.
+     */
+    public final boolean hasInternedStrings() {
+        return _hasInternedStrings;
+    }
+
+    /**
+     * Read the contents of the buffer as a {@link XMLStreamReader}.
+     *
+     * @return
+     * A an instance of a {@link StreamReaderBufferProcessor}. Always non-null.
+     */
+    public final StreamReaderBufferProcessor readAsXMLStreamReader() throws XMLStreamException {
+        return new StreamReaderBufferProcessor(this);
+    }
+
+    /**
+     * Write the contents of the buffer to an XMLStreamWriter.
+     *
+     * <p>
+     * The XMLStreamBuffer will be written out to the XMLStreamWriter using
+     * an instance of {@link StreamWriterBufferProcessor}.
+     *
+     * @param writer
+     *      A XMLStreamWriter to write to.
+     * @param writeAsFragment
+     *      If true, {@link XMLStreamWriter} will not receive {@link XMLStreamWriter#writeStartDocument()}
+     *      nor {@link XMLStreamWriter#writeEndDocument()}. This is desirable behavior when
+     *      you are writing the contents of a buffer into a bigger document.
+     */
+    public final void writeToXMLStreamWriter(XMLStreamWriter writer, boolean writeAsFragment) throws XMLStreamException {
+        StreamWriterBufferProcessor p = new StreamWriterBufferProcessor(this,writeAsFragment);
+        p.process(writer);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #writeToXMLStreamWriter(XMLStreamWriter, boolean)}
+     */
+    public final void writeToXMLStreamWriter(XMLStreamWriter writer) throws XMLStreamException {
+        writeToXMLStreamWriter(writer, this.isFragment());
+    }
+
+    /**
+     * Reads the contents of the buffer from a {@link XMLReader}.
+     *
+     * @return
+     * A an instance of a {@link SAXBufferProcessor}.
+     * @deprecated
+     *      Use {@link #readAsXMLReader(boolean)}
+     */
+    public final SAXBufferProcessor readAsXMLReader() {
+        return new SAXBufferProcessor(this,isFragment());
+    }
+
+    /**
+     * Reads the contents of the buffer from a {@link XMLReader}.
+     *
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     * @return
+     *      A an instance of a {@link SAXBufferProcessor}.
+     */
+    public final SAXBufferProcessor readAsXMLReader(boolean produceFragmentEvent) {
+        return new SAXBufferProcessor(this,produceFragmentEvent);
+    }
+
+    /**
+     * Write the contents of the buffer to a {@link ContentHandler}.
+     *
+     * <p>
+     * If the <code>handler</code> is also an instance of other SAX-based
+     * handlers, such as {@link LexicalHandler}, than corresponding SAX events
+     * will be reported to those handlers.
+     *
+     * @param handler
+     *      The ContentHandler to receive SAX events.
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     *
+     * @throws SAXException
+     *      if a parsing fails, or if {@link ContentHandler} throws a {@link SAXException}.
+     */
+    public final void writeTo(ContentHandler handler, boolean produceFragmentEvent) throws SAXException {
+        SAXBufferProcessor p = readAsXMLReader(produceFragmentEvent);
+        p.setContentHandler(handler);
+        if (p instanceof LexicalHandler) {
+            p.setLexicalHandler((LexicalHandler)handler);
+        }
+        if (p instanceof DTDHandler) {
+            p.setDTDHandler((DTDHandler)handler);
+        }
+        if (p instanceof ErrorHandler) {
+            p.setErrorHandler((ErrorHandler)handler);
+        }
+        p.process();
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #writeTo(ContentHandler,boolean)}
+     */
+    public final void writeTo(ContentHandler handler) throws SAXException {
+        writeTo(handler,isFragment());
+    }
+
+    /**
+     * Write the contents of the buffer to a {@link ContentHandler} with errors
+     * report to a {@link ErrorHandler}.
+     *
+     * <p>
+     * If the <code>handler</code> is also an instance of other SAX-based
+     * handlers, such as {@link LexicalHandler}, than corresponding SAX events
+     * will be reported to those handlers.
+     *
+     * @param handler
+     * The ContentHandler to receive SAX events.
+     * @param errorHandler
+     * The ErrorHandler to receive error events.
+     *
+     * @throws SAXException
+     *      if a parsing fails and {@link ErrorHandler} throws a {@link SAXException},
+     *      or if {@link ContentHandler} throws a {@link SAXException}.
+     */
+    public final void writeTo(ContentHandler handler, ErrorHandler errorHandler, boolean produceFragmentEvent) throws SAXException {
+        SAXBufferProcessor p = readAsXMLReader(produceFragmentEvent);
+        p.setContentHandler(handler);
+        if (p instanceof LexicalHandler) {
+            p.setLexicalHandler((LexicalHandler)handler);
+        }
+        if (p instanceof DTDHandler) {
+            p.setDTDHandler((DTDHandler)handler);
+        }
+
+        p.setErrorHandler(errorHandler);
+
+        p.process();
+    }
+
+    public final void writeTo(ContentHandler handler, ErrorHandler errorHandler) throws SAXException {
+        writeTo(handler, errorHandler, isFragment());
+    }
+
+    private static final TransformerFactory trnsformerFactory = TransformerFactory.newInstance();
+
+    /**
+     * Writes out the contents of this buffer as DOM node and append that to the given node.
+     *
+     * Faster implementation would be desirable.
+     *
+     * @return
+     *      The newly added child node.
+     */
+    public final Node writeTo(Node n) throws XMLStreamBufferException {
+        try {
+            Transformer t = trnsformerFactory.newTransformer();
+            t.transform(new XMLStreamBufferSource(this), new DOMResult(n));
+            return n.getLastChild();
+        } catch (TransformerException e) {
+            throw new XMLStreamBufferException(e);
+        }
+    }
+
+    /**
+     * Create a new buffer from a XMLStreamReader.
+     *
+     * @param reader
+     * A XMLStreamReader to read from to create.
+     * @return XMLStreamBuffer the created buffer
+     * @see MutableXMLStreamBuffer#createFromXMLStreamReader(XMLStreamReader)
+     */
+    public static XMLStreamBuffer createNewBufferFromXMLStreamReader(XMLStreamReader reader)
+            throws XMLStreamException {
+        MutableXMLStreamBuffer b = new MutableXMLStreamBuffer();
+        b.createFromXMLStreamReader(reader);
+        return b;
+    }
+
+    /**
+     * Create a new buffer from a {@link XMLReader} and {@link InputStream}.
+     *
+     * @param reader
+     * The {@link XMLReader} to use for parsing.
+     * @param in
+     * The {@link InputStream} to be parsed.
+     * @return XMLStreamBuffer the created buffer
+     * @see MutableXMLStreamBuffer#createFromXMLReader(XMLReader, InputStream)
+     */
+    public static XMLStreamBuffer createNewBufferFromXMLReader(XMLReader reader, InputStream in) throws SAXException, IOException {
+        MutableXMLStreamBuffer b = new MutableXMLStreamBuffer();
+        b.createFromXMLReader(reader, in);
+        return b;
+    }
+
+    /**
+     * Create a new buffer from a {@link XMLReader} and {@link InputStream}.
+     *
+     * @param reader
+     * The {@link XMLReader} to use for parsing.
+     * @param in
+     * The {@link InputStream} to be parsed.
+     * @param systemId
+     * The system ID of the input stream.
+     * @return XMLStreamBuffer the created buffer
+     * @see MutableXMLStreamBuffer#createFromXMLReader(XMLReader, InputStream, String)
+     */
+    public static XMLStreamBuffer createNewBufferFromXMLReader(XMLReader reader, InputStream in,
+                                                               String systemId) throws SAXException, IOException {
+        MutableXMLStreamBuffer b = new MutableXMLStreamBuffer();
+        b.createFromXMLReader(reader, in, systemId);
+        return b;
+    }
+
+    protected final FragmentedArray<byte[]> getStructure() {
+        return _structure;
+    }
+
+    protected final int getStructurePtr() {
+        return _structurePtr;
+    }
+
+    protected final FragmentedArray<String[]> getStructureStrings() {
+        return _structureStrings;
+    }
+
+    protected final int getStructureStringsPtr() {
+        return _structureStringsPtr;
+    }
+
+    protected final FragmentedArray<char[]> getContentCharactersBuffer() {
+        return _contentCharactersBuffer;
+    }
+
+    protected final int getContentCharactersBufferPtr() {
+        return _contentCharactersBufferPtr;
+    }
+
+    protected final FragmentedArray<Object[]> getContentObjects() {
+        return _contentObjects;
+    }
+
+    protected final int getContentObjectsPtr() {
+        return _contentObjectsPtr;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferException.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferException.java
new file mode 100644
index 0000000..df71e52
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferException.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+public class XMLStreamBufferException extends Exception {
+
+    public XMLStreamBufferException(String message) {
+        super(message);
+    }
+
+    public XMLStreamBufferException(String message, Exception e) {
+        super(message, e);
+    }
+
+    public XMLStreamBufferException(Exception e) {
+        super(e);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java
new file mode 100644
index 0000000..42fc447
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import java.util.Map;
+
+/**
+ * A mark into a buffer.
+ *
+ * <p>
+ * A mark can be processed in the same manner as a XMLStreamBuffer.
+ *
+ * <p>
+ * A mark will share a sub set of information of the buffer that is
+ * marked. If the buffer is directly or indirectly associated with a
+ * (mutable) {@link XMLStreamBuffer} which is reset and/or re-created
+ * then this will invalidate the mark and processing behvaiour of the mark
+ * is undefined. It is the responsibility of the application to manage the
+ * relationship between the marked XMLStreamBuffer and one or more marks.
+ */
+public class XMLStreamBufferMark extends XMLStreamBuffer {
+
+    /**
+     * Create a mark from the buffer that is being created.
+     *
+     * <p>
+     * A mark will be created from the current position of creation of the
+     * {@link XMLStreamBuffer} that is being created by a {@link AbstractCreator}.
+     *
+     * @param inscopeNamespaces
+     * The in-scope namespaces on the fragment of XML infoset that is
+     * to be marked.
+     *
+     * @param src
+     * The {@link AbstractCreator} or {@link AbstractProcessor} from which the current
+     * position of creation of the XMLStreamBuffer will be taken as the mark.
+     */
+    public XMLStreamBufferMark(Map<String,String> inscopeNamespaces, AbstractCreatorProcessor src) {
+        _inscopeNamespaces = inscopeNamespaces;
+
+        _structure = src._currentStructureFragment;
+        _structurePtr = src._structurePtr;
+
+        _structureStrings = src._currentStructureStringFragment;
+        _structureStringsPtr = src._structureStringsPtr;
+
+        _contentCharactersBuffer = src._currentContentCharactersBufferFragment;
+        _contentCharactersBufferPtr = src._contentCharactersBufferPtr;
+
+        _contentObjects = src._currentContentObjectFragment;
+        _contentObjectsPtr = src._contentObjectsPtr;
+        treeCount = 1; // TODO: define a way to create a mark over a forest
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferResult.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferResult.java
new file mode 100644
index 0000000..b4d9045
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferResult.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import com.sun.xml.internal.stream.buffer.sax.SAXBufferCreator;
+import javax.xml.transform.sax.SAXResult;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ext.LexicalHandler;
+
+/**
+ * A JAXP Result implementation that supports the serialization to an
+ * {@link MutableXMLStreamBuffer} for use by applications that expect a Result.
+ *
+ * <p>
+ * Reuse of a XMLStreamBufferResult more than once will require that the
+ * MutableXMLStreamBuffer is reset by called
+ * {@link #.getXMLStreamBuffer()}.reset(), or by calling
+ * {@link #.setXMLStreamBuffer()} with a new instance of
+ * {@link MutableXMLStreamBuffer}.
+ *
+ * <p>
+ * The derivation of XMLStreamBufferResult from SAXResult is an implementation
+ * detail.
+ *
+ * <p>General applications shall not call the following methods:
+ * <ul>
+ * <li>setHandler</li>
+ * <li>setLexicalHandler</li>
+ * <li>setSystemId</li>
+ * </ul>
+ */
+public class XMLStreamBufferResult extends SAXResult {
+    protected MutableXMLStreamBuffer _buffer;
+    protected SAXBufferCreator _bufferCreator;
+
+    /**
+     * The default XMLStreamBufferResult constructor.
+     *
+     * <p>
+     * A {@link MutableXMLStreamBuffer} is instantiated and used.
+     */
+    public XMLStreamBufferResult() {
+        setXMLStreamBuffer(new MutableXMLStreamBuffer());
+    }
+
+    /**
+     * XMLStreamBufferResult constructor.
+     *
+     * @param buffer the {@link MutableXMLStreamBuffer} to use.
+     */
+    public XMLStreamBufferResult(MutableXMLStreamBuffer buffer) {
+        setXMLStreamBuffer(buffer);
+    }
+
+    /**
+     * Get the {@link MutableXMLStreamBuffer} that is used.
+     *
+     * @return the {@link MutableXMLStreamBuffer}.
+     */
+    public MutableXMLStreamBuffer getXMLStreamBuffer() {
+        return _buffer;
+    }
+
+    /**
+     * Set the {@link MutableXMLStreamBuffer} to use.
+     *
+     * @param buffer the {@link MutableXMLStreamBuffer}.
+     */
+    public void setXMLStreamBuffer(MutableXMLStreamBuffer buffer) {
+        if (buffer == null) {
+            throw new NullPointerException("buffer cannot be null");
+        }
+        _buffer = buffer;
+        setSystemId(_buffer.getSystemId());
+
+        if (_bufferCreator != null) {
+            _bufferCreator.setXMLStreamBuffer(_buffer);
+        }
+    }
+
+    public ContentHandler getHandler() {
+        if (_bufferCreator == null) {
+            _bufferCreator = new SAXBufferCreator(_buffer);
+            setHandler(_bufferCreator);
+        } else if (super.getHandler() == null) {
+            setHandler(_bufferCreator);
+        }
+
+        return _bufferCreator;
+    }
+
+    public LexicalHandler getLexicalHandler() {
+        return (LexicalHandler) getHandler();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferSource.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferSource.java
new file mode 100644
index 0000000..d283007
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferSource.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer;
+
+import com.sun.xml.internal.stream.buffer.sax.SAXBufferProcessor;
+import java.io.ByteArrayInputStream;
+import javax.xml.transform.sax.SAXSource;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+
+/**
+ * A JAXP Source implementation that supports the parsing
+ * of {@link XMLStreamBuffer} for use by applications that expect a Source.
+ *
+ * <p>
+ * The derivation of XMLStreamBufferSource from SAXSource is an implementation
+ * detail.
+ *
+ * <p>Applications shall obey the following restrictions:
+ * <ul>
+ * <li>The setXMLReader and setInputSource shall not be called.</li>
+ * <li>The XMLReader object obtained by the getXMLReader method shall
+ *     be used only for parsing the InputSource object returned by
+ *     the getInputSource method.</li>
+ * <li>The InputSource object obtained by the getInputSource method shall
+ *     be used only for being parsed by the XMLReader object returned by
+ *     the getXMLReader method.</li>
+ * </ul>
+ */
+public class XMLStreamBufferSource extends SAXSource {
+    protected XMLStreamBuffer _buffer;
+    protected SAXBufferProcessor _bufferProcessor;
+
+    /**
+     * XMLStreamBufferSource constructor.
+     *
+     * @param buffer the {@link XMLStreamBuffer} to use.
+     */
+    public XMLStreamBufferSource(XMLStreamBuffer buffer) {
+        super(new InputSource(
+                new ByteArrayInputStream(new byte[0])));
+        setXMLStreamBuffer(buffer);
+    }
+
+    /**
+     * Get the {@link XMLStreamBuffer} that is used.
+     *
+     * @return the {@link XMLStreamBuffer}.
+     */
+    public XMLStreamBuffer getXMLStreamBuffer() {
+        return _buffer;
+    }
+
+    /**
+     * Set the {@link XMLStreamBuffer} to use.
+     *
+     * @param buffer the {@link XMLStreamBuffer}.
+     */
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer) {
+        if (buffer == null) {
+            throw new NullPointerException("buffer cannot be null");
+        }
+        _buffer = buffer;
+
+        if (_bufferProcessor != null) {
+            _bufferProcessor.setBuffer(_buffer,false);
+        }
+    }
+
+    public XMLReader getXMLReader() {
+        if (_bufferProcessor == null) {
+            _bufferProcessor = new SAXBufferProcessor(_buffer,false);
+            setXMLReader(_bufferProcessor);
+        } else if (super.getXMLReader() == null) {
+            setXMLReader(_bufferProcessor);
+        }
+
+        return _bufferProcessor;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/DefaultWithLexicalHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/DefaultWithLexicalHandler.java
new file mode 100644
index 0000000..159b036
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/DefaultWithLexicalHandler.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.sax;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class DefaultWithLexicalHandler extends DefaultHandler implements LexicalHandler {
+
+    public void comment(char[] ch, int start, int length) throws SAXException { }
+
+    public void startDTD(String name, String publicId, String systemId) throws SAXException { }
+
+    public void endDTD() throws SAXException { }
+
+    public void startEntity(String name) throws SAXException { }
+
+    public void endEntity(String name) throws SAXException { }
+
+    public void startCDATA() throws SAXException { }
+
+    public void endCDATA() throws SAXException { }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Features.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Features.java
new file mode 100644
index 0000000..4605ef6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Features.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.xml.internal.stream.buffer.sax;
+
+public class Features {
+    public static final String NAMESPACES_FEATURE =
+        "http://xml.org/sax/features/namespaces";
+    public static final String NAMESPACE_PREFIXES_FEATURE =
+        "http://xml.org/sax/features/namespace-prefixes";
+    public static final String EXTERNAL_GENERAL_ENTITIES =
+        "http://xml.org/sax/features/external-general-entities";
+    public static final String EXTERNAL_PARAMETER_ENTITIES =
+        "http://xml.org/sax/features/external-parameter-entities";
+    public static final String STRING_INTERNING_FEATURE =
+        "http://xml.org/sax/features/string-interning";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Properties.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Properties.java
new file mode 100644
index 0000000..e596b36
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Properties.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.xml.internal.stream.buffer.sax;
+
+public class Properties {
+    public static final String LEXICAL_HANDLER_PROPERTY =
+            "http://xml.org/sax/properties/lexical-handler";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferCreator.java
new file mode 100644
index 0000000..01fe77e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferCreator.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.sax;
+
+import com.sun.xml.internal.stream.buffer.AbstractCreator;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import java.io.IOException;
+import java.io.InputStream;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+
+/**
+ * Writes into {@link MutableXMLStreamBuffer} from SAX.
+ *
+ * TODO
+ * Implement the marking the stream on the element when an ID
+ * attribute on the element is defined
+ */
+public class SAXBufferCreator extends AbstractCreator
+        implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler, LexicalHandler {
+    protected String[] _namespaceAttributes;
+
+    protected int _namespaceAttributesPtr;
+
+    private int depth = 0;
+
+    public SAXBufferCreator() {
+        _namespaceAttributes = new String[16 * 2];
+    }
+
+    public SAXBufferCreator(MutableXMLStreamBuffer buffer) {
+        this();
+        setBuffer(buffer);
+    }
+
+    public MutableXMLStreamBuffer create(XMLReader reader, InputStream in) throws IOException, SAXException {
+        return create(reader, in, null);
+    }
+
+    public MutableXMLStreamBuffer create(XMLReader reader, InputStream in, String systemId) throws IOException, SAXException {
+        if (_buffer == null) {
+            createBuffer();
+        }
+        _buffer.setSystemId(systemId);
+        reader.setContentHandler(this);
+        reader.setProperty(Properties.LEXICAL_HANDLER_PROPERTY, this);
+
+        try {
+            setHasInternedStrings(reader.getFeature(Features.STRING_INTERNING_FEATURE));
+        } catch (SAXException e) {
+        }
+
+
+        if (systemId != null) {
+            InputSource s = new InputSource(systemId);
+            s.setByteStream(in);
+            reader.parse(s);
+        } else {
+            reader.parse(new InputSource(in));
+        }
+
+        return getXMLStreamBuffer();
+    }
+
+    public void reset() {
+        _buffer = null;
+        _namespaceAttributesPtr = 0;
+        depth=0;
+    }
+
+    public void startDocument() throws SAXException {
+        storeStructure(T_DOCUMENT);
+    }
+
+    public void endDocument() throws SAXException {
+        storeStructure(T_END);
+    }
+
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        cacheNamespaceAttribute(prefix, uri);
+    }
+
+    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+        storeQualifiedName(T_ELEMENT_LN,
+                uri, localName, qName);
+
+        // Has namespaces attributes
+        if (_namespaceAttributesPtr > 0) {
+            storeNamespaceAttributes();
+        }
+
+        // Has attributes
+        if (attributes.getLength() > 0) {
+            storeAttributes(attributes);
+        }
+        depth++;
+    }
+
+    public void endElement(String uri, String localName, String qName) throws SAXException {
+        storeStructure(T_END);
+        if(--depth==0)
+            increaseTreeCount();    // one tree processed
+    }
+
+    public void characters(char ch[], int start, int length) throws SAXException {
+        storeContentCharacters(T_TEXT_AS_CHAR_ARRAY, ch, start, length);
+    }
+
+    public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
+        characters(ch, start, length);
+    }
+
+    public void processingInstruction(String target, String data) throws SAXException {
+        storeStructure(T_PROCESSING_INSTRUCTION);
+        storeStructureString(target);
+        storeStructureString(data);
+    }
+
+    public void comment(char[] ch, int start, int length) throws SAXException {
+        storeContentCharacters(T_COMMENT_AS_CHAR_ARRAY, ch, start, length);
+    }
+
+    //
+
+    private void cacheNamespaceAttribute(String prefix, String uri) {
+        _namespaceAttributes[_namespaceAttributesPtr++] = prefix;
+        _namespaceAttributes[_namespaceAttributesPtr++] = uri;
+
+        if (_namespaceAttributesPtr == _namespaceAttributes.length) {
+            final String[] namespaceAttributes = new String[_namespaceAttributesPtr * 3 / 2 + 1];
+            System.arraycopy(_namespaceAttributes, 0, namespaceAttributes, 0, _namespaceAttributesPtr);
+            _namespaceAttributes = namespaceAttributes;
+        }
+    }
+
+    private void storeNamespaceAttributes() {
+        for (int i = 0; i < _namespaceAttributesPtr; i += 2) {
+            int item = T_NAMESPACE_ATTRIBUTE;
+            if (_namespaceAttributes[i].length() > 0) {
+                item |= FLAG_PREFIX;
+                storeStructureString(_namespaceAttributes[i]);
+            }
+            if (_namespaceAttributes[i + 1].length() > 0) {
+                item |= FLAG_URI;
+                storeStructureString(_namespaceAttributes[i + 1]);
+            }
+            storeStructure(item);
+        }
+        _namespaceAttributesPtr = 0;
+    }
+
+    private void storeAttributes(Attributes attributes) {
+        for (int i = 0; i < attributes.getLength(); i++) {
+            storeQualifiedName(T_ATTRIBUTE_LN,
+                    attributes.getURI(i),
+                    attributes.getLocalName(i),
+                    attributes.getQName(i));
+
+            storeStructureString(attributes.getType(i));
+            storeContentString(attributes.getValue(i));
+        }
+    }
+
+    private void storeQualifiedName(int item, String uri, String localName, String qName) {
+        if (uri.length() > 0) {
+            item |= FLAG_URI;
+            storeStructureString(uri);
+        }
+
+        storeStructureString(localName);
+
+        if (qName.indexOf(':') >= 0) {
+            item |= FLAG_QUALIFIED_NAME;
+            storeStructureString(qName);
+        }
+
+        storeStructure(item);
+    }
+
+
+    // Empty methods for SAX handlers
+
+    // Entity resolver handler
+
+    public InputSource resolveEntity (String publicId, String systemId)
+        throws IOException, SAXException
+    {
+        return null;
+    }
+
+    // DTD handler
+
+    public void notationDecl (String name, String publicId, String systemId)
+        throws SAXException
+    { }
+
+    public void unparsedEntityDecl (String name, String publicId,
+                                    String systemId, String notationName)
+        throws SAXException
+    { }
+
+    // Content handler
+
+    public void setDocumentLocator (Locator locator) { }
+
+    public void endPrefixMapping (String prefix) throws SAXException { }
+
+    public void skippedEntity (String name) throws SAXException { }
+
+    // Lexical handler
+
+    public void startDTD(String name, String publicId, String systemId) throws SAXException { }
+
+    public void endDTD() throws SAXException { }
+
+    public void startEntity(String name) throws SAXException { }
+
+    public void endEntity(String name) throws SAXException { }
+
+    public void startCDATA() throws SAXException { }
+
+    public void endCDATA() throws SAXException { }
+
+    // Error handler
+
+    public void warning(SAXParseException e) throws SAXException { }
+
+    public void error(SAXParseException e) throws SAXException { }
+
+    public void fatalError(SAXParseException e) throws SAXException
+    {
+        throw e;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java
new file mode 100644
index 0000000..795d596
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java
@@ -0,0 +1,671 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.sax;
+
+import com.sun.xml.internal.stream.buffer.AbstractProcessor;
+import com.sun.xml.internal.stream.buffer.AttributesHolder;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.XMLConstants;
+import java.io.IOException;
+
+/**
+ * A processor of a {@link XMLStreamBuffer} that that reads the XML infoset as
+ * {@link XMLReader}.
+ */
+public class SAXBufferProcessor extends AbstractProcessor implements XMLReader {
+    /**
+     * Reference to entity resolver.
+     */
+    protected EntityResolver _entityResolver = DEFAULT_LEXICAL_HANDLER;
+
+    /**
+     * Reference to dtd handler.
+     */
+    protected DTDHandler _dtdHandler = DEFAULT_LEXICAL_HANDLER;
+
+    /**
+     * Reference to content handler.
+     */
+    protected ContentHandler _contentHandler = DEFAULT_LEXICAL_HANDLER;
+
+    /**
+     * Reference to error handler.
+     */
+    protected ErrorHandler _errorHandler = DEFAULT_LEXICAL_HANDLER;
+
+    /**
+     * Reference to lexical handler.
+     */
+    protected LexicalHandler _lexicalHandler = DEFAULT_LEXICAL_HANDLER;
+
+    /**
+     * SAX Namespace attributes features
+     */
+    protected boolean _namespacePrefixesFeature = false;
+
+    protected AttributesHolder _attributes = new AttributesHolder();
+
+    protected String[] _namespacePrefixes = new String[16];
+    protected int _namespacePrefixesIndex;
+
+    protected int[] _namespaceAttributesStack = new int[16];
+    protected int _namespaceAttributesStackIndex;
+
+    public SAXBufferProcessor() {
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #SAXBufferProcessor(XMLStreamBuffer, boolean)}
+     */
+    public SAXBufferProcessor(XMLStreamBuffer buffer) {
+        setXMLStreamBuffer(buffer);
+    }
+
+    /**
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     */
+    public SAXBufferProcessor(XMLStreamBuffer buffer, boolean produceFragmentEvent) {
+        setXMLStreamBuffer(buffer,produceFragmentEvent);
+    }
+
+    public boolean getFeature(String name)
+            throws SAXNotRecognizedException, SAXNotSupportedException {
+        if (name.equals(Features.NAMESPACES_FEATURE)) {
+            return true;
+        } else if (name.equals(Features.NAMESPACE_PREFIXES_FEATURE)) {
+            return _namespacePrefixesFeature;
+        } else if (name.equals(Features.EXTERNAL_GENERAL_ENTITIES)) {
+            return true;
+        } else if (name.equals(Features.EXTERNAL_PARAMETER_ENTITIES)) {
+            return true;
+        } else if (name.equals(Features.STRING_INTERNING_FEATURE)) {
+            return _stringInterningFeature;
+        } else {
+            throw new SAXNotRecognizedException(
+                    "Feature not supported: " + name);
+        }
+    }
+
+    public void setFeature(String name, boolean value)
+            throws SAXNotRecognizedException, SAXNotSupportedException {
+        if (name.equals(Features.NAMESPACES_FEATURE)) {
+            if (!value) {
+                throw new SAXNotSupportedException(name + ":" + value);
+            }
+        } else if (name.equals(Features.NAMESPACE_PREFIXES_FEATURE)) {
+            _namespacePrefixesFeature = value;
+        } else if (name.equals(Features.EXTERNAL_GENERAL_ENTITIES)) {
+            // ignore
+        } else if (name.equals(Features.EXTERNAL_PARAMETER_ENTITIES)) {
+            // ignore
+        } else if (name.equals(Features.STRING_INTERNING_FEATURE)) {
+            if (value != _stringInterningFeature) {
+                throw new SAXNotSupportedException(name + ":" + value);
+            }
+        } else {
+            throw new SAXNotRecognizedException(
+                    "Feature not supported: " + name);
+        }
+    }
+
+    public Object getProperty(String name)
+            throws SAXNotRecognizedException, SAXNotSupportedException {
+        if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+            return getLexicalHandler();
+        } else {
+            throw new SAXNotRecognizedException("Property not recognized: " + name);
+        }
+    }
+
+    public void setProperty(String name, Object value)
+            throws SAXNotRecognizedException, SAXNotSupportedException {
+        if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+            if (value instanceof LexicalHandler) {
+                setLexicalHandler((LexicalHandler)value);
+            } else {
+                throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
+            }
+        } else {
+            throw new SAXNotRecognizedException("Property not recognized: " + name);
+        }
+    }
+
+    public void setEntityResolver(EntityResolver resolver) {
+        _entityResolver = resolver;
+    }
+
+    public EntityResolver getEntityResolver() {
+        return _entityResolver;
+    }
+
+    public void setDTDHandler(DTDHandler handler) {
+        _dtdHandler = handler;
+    }
+
+    public DTDHandler getDTDHandler() {
+        return _dtdHandler;
+    }
+
+    public void setContentHandler(ContentHandler handler) {
+        _contentHandler = handler;
+    }
+
+    public ContentHandler getContentHandler() {
+        return _contentHandler;
+    }
+
+    public void setErrorHandler(ErrorHandler handler) {
+        _errorHandler = handler;
+    }
+
+    public ErrorHandler getErrorHandler() {
+        return _errorHandler;
+    }
+
+    public void setLexicalHandler(LexicalHandler handler) {
+        _lexicalHandler = handler;
+    }
+
+    public LexicalHandler getLexicalHandler() {
+        return _lexicalHandler;
+    }
+
+    public void parse(InputSource input) throws IOException, SAXException {
+        // InputSource is ignored
+        process();
+    }
+
+    public void parse(String systemId) throws IOException, SAXException {
+        // systemId is ignored
+        process();
+    }
+
+    /**
+     * Short-hand for {@link #setXMLStreamBuffer(XMLStreamBuffer)} then {@link #process()}.
+     *
+     * @deprecated
+     *      Use {@link #process(XMLStreamBuffer, boolean)}
+     */
+    public final void process(XMLStreamBuffer buffer) throws SAXException {
+        setXMLStreamBuffer(buffer);
+        process();
+    }
+
+    /**
+     * Short-hand for {@link #setXMLStreamBuffer(XMLStreamBuffer,boolean)} then {@link #process()}.
+     *
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     */
+    public final void process(XMLStreamBuffer buffer, boolean produceFragmentEvent) throws SAXException {
+        setXMLStreamBuffer(buffer);
+        process();
+    }
+
+    /**
+     * Resets the parser to read from the beginning of the given {@link XMLStreamBuffer}.
+     *
+     * @deprecated
+     *      Use {@link #setXMLStreamBuffer(XMLStreamBuffer, boolean)}.
+     */
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer) {
+        setBuffer(buffer);
+    }
+
+    /**
+     * Resets the parser to read from the beginning of the given {@link XMLStreamBuffer}.
+     *
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     */
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer, boolean produceFragmentEvent) {
+        if(!produceFragmentEvent && _treeCount>1)
+            throw new IllegalStateException("Can't write a forest to a full XML infoset");
+        setBuffer(buffer,produceFragmentEvent);
+    }
+
+    /**
+     * Parse the sub-tree (or a whole document) that {@link XMLStreamBuffer}
+     * points to, and sends events to handlers.
+     *
+     * <p>
+     * TODO:
+     * We probably need two modes for a sub-tree event generation. One for
+     * firing a sub-tree as if it's a whole document (in which case start/endDocument
+     * and appropriate additional namespace bindings are necessary), and the other
+     * mode for firing a subtree as a subtree, like it does today.
+     * A stream buffer SAX feature could be used to specify this.
+     *
+     * @throws SAXException
+     *      Follow the same semantics as {@link XMLReader#parse(InputSource)}.
+     */
+    public final void process() throws SAXException {
+        if(!_fragmentMode) {
+            LocatorImpl nullLocator = new LocatorImpl();
+            nullLocator.setSystemId(_buffer.getSystemId());
+            nullLocator.setLineNumber(-1);
+            nullLocator.setColumnNumber(-1);
+            _contentHandler.setDocumentLocator(nullLocator);
+
+            _contentHandler.startDocument();
+            // TODO: if we are writing a fragment stream buffer as a full XML document,
+            // we need to declare in-scope namespaces as if they are on the root element.
+        }
+
+        while (_treeCount>0) {
+            final int item = readEiiState();
+            switch(item) {
+                case STATE_DOCUMENT:
+                    processDocument();
+                    _treeCount--;
+                    break;
+                case STATE_END:
+                    // Empty buffer
+                    return;
+                case STATE_ELEMENT_U_LN_QN:
+                    processElement(readStructureString(), readStructureString(), readStructureString());
+                    _treeCount--;
+                    break;
+                case STATE_ELEMENT_P_U_LN:
+                {
+                    final String prefix = readStructureString();
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    processElement(uri, localName, getQName(prefix, localName));
+                    _treeCount--;
+                    break;
+                }
+                case STATE_ELEMENT_U_LN: {
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    processElement(uri, localName, localName);
+                    _treeCount--;
+                    break;
+                }
+                case STATE_ELEMENT_LN:
+                {
+                    final String localName = readStructureString();
+                    processElement("", localName, localName);
+                    _treeCount--;
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL:
+                    processCommentAsCharArraySmall();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM:
+                    processCommentAsCharArrayMedium();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY:
+                    processCommentAsCharArrayCopy();
+                    break;
+                case STATE_COMMENT_AS_STRING:
+                    processComment(readContentString());
+                    break;
+                case STATE_PROCESSING_INSTRUCTION:
+                    processProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                default:
+                    throw reportFatalError("Illegal state for DIIs: "+item);
+            }
+        }
+
+        if(!_fragmentMode)
+            _contentHandler.endDocument();
+    }
+
+    private void processCommentAsCharArraySmall() throws SAXException {
+        final int length = readStructure();
+        final int start = readContentCharactersBuffer(length);
+        processComment(_contentCharactersBuffer, start, length);
+    }
+
+    /**
+     * Report a fatal error and abort.
+     *
+     * This is necessary to follow the SAX semantics of error handling.
+     */
+    private SAXParseException reportFatalError(String msg) throws SAXException {
+        SAXParseException spe = new SAXParseException(msg, null);
+        if(_errorHandler!=null)
+            _errorHandler.fatalError(spe);
+        return spe;
+    }
+
+    private void processDocument() throws SAXException {
+        while(true) {
+            int item = readEiiState();
+            switch(item) {
+                case STATE_ELEMENT_U_LN_QN:
+                    processElement(readStructureString(), readStructureString(), readStructureString());
+                    break;
+                case STATE_ELEMENT_P_U_LN:
+                {
+                    final String prefix = readStructureString();
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    processElement(uri, localName, getQName(prefix, localName));
+                    break;
+                }
+                case STATE_ELEMENT_U_LN: {
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    processElement(uri, localName, localName);
+                    break;
+                }
+                case STATE_ELEMENT_LN:
+                {
+                    final String localName = readStructureString();
+                    processElement("", localName, localName);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL:
+                    processCommentAsCharArraySmall();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM:
+                    processCommentAsCharArrayMedium();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY:
+                    processCommentAsCharArrayCopy();
+                    break;
+                case STATE_COMMENT_AS_STRING:
+                    processComment(readContentString());
+                    break;
+                case STATE_PROCESSING_INSTRUCTION:
+                    processProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                case STATE_END:
+                    return;
+                default:
+                    throw reportFatalError("Illegal state for child of DII: "+item);
+            }
+        }
+    }
+
+    protected void processElement(String uri, String localName, String qName) throws SAXException {
+        boolean hasAttributes = false;
+        boolean hasNamespaceAttributes = false;
+        int item = peekStructure();
+        if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) {
+            hasNamespaceAttributes = true;
+            item = processNamespaceAttributes(item);
+        }
+        if ((item & TYPE_MASK) == T_ATTRIBUTE) {
+            hasAttributes = true;
+            processAttributes(item);
+        }
+
+        _contentHandler.startElement(uri, localName, qName, _attributes);
+
+        if (hasAttributes) {
+            _attributes.clear();
+        }
+
+        do {
+            item = readEiiState();
+            switch(item) {
+                case STATE_ELEMENT_U_LN_QN:
+                    processElement(readStructureString(), readStructureString(), readStructureString());
+                    break;
+                case STATE_ELEMENT_P_U_LN:
+                {
+                    final String p = readStructureString();
+                    final String u = readStructureString();
+                    final String ln = readStructureString();
+                    processElement(u, ln, getQName(p, ln));
+                    break;
+                }
+                case STATE_ELEMENT_U_LN: {
+                    final String u = readStructureString();
+                    final String ln = readStructureString();
+                    processElement(u, ln, ln);
+                    break;
+                }
+                case STATE_ELEMENT_LN: {
+                    final String ln = readStructureString();
+                    processElement("", ln, ln);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_SMALL:
+                {
+                    final int length = readStructure();
+                    int start = readContentCharactersBuffer(length);
+                    _contentHandler.characters(_contentCharactersBuffer, start, length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_MEDIUM:
+                {
+                    final int length = readStructure16();
+                    int start = readContentCharactersBuffer(length);
+                    _contentHandler.characters(_contentCharactersBuffer, start, length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_COPY:
+                {
+                    final char[] ch = readContentCharactersCopy();
+
+                    _contentHandler.characters(ch, 0, ch.length);
+                    break;
+                }
+                case STATE_TEXT_AS_STRING:
+                {
+                    final String s = readContentString();
+                    _contentHandler.characters(s.toCharArray(), 0, s.length());
+                    break;
+                }
+                case STATE_TEXT_AS_OBJECT:
+                {
+                    final CharSequence c = (CharSequence)readContentObject();
+                    final String s = c.toString();
+                    _contentHandler.characters(s.toCharArray(), 0, s.length());
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL:
+                    processCommentAsCharArraySmall();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM:
+                    processCommentAsCharArrayMedium();
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY:
+                    processCommentAsCharArrayCopy();
+                    break;
+                case T_COMMENT_AS_STRING:
+                    processComment(readContentString());
+                    break;
+                case STATE_PROCESSING_INSTRUCTION:
+                    processProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                case STATE_END:
+                    break;
+                default:
+                    throw reportFatalError("Illegal state for child of EII: "+item);
+            }
+        } while(item != STATE_END);
+
+        _contentHandler.endElement(uri, localName, qName);
+
+        if (hasNamespaceAttributes) {
+            processEndPrefixMapping();
+        }
+    }
+
+    private void processCommentAsCharArrayCopy() throws SAXException {
+        final char[] ch = readContentCharactersCopy();
+        processComment(ch, 0, ch.length);
+    }
+
+    private void processCommentAsCharArrayMedium() throws SAXException {
+        final int length = readStructure16();
+        final int start = readContentCharactersBuffer(length);
+        processComment(_contentCharactersBuffer, start, length);
+    }
+
+    private void processEndPrefixMapping() throws SAXException {
+        final int end = _namespaceAttributesStack[--_namespaceAttributesStackIndex];
+        final int start = (_namespaceAttributesStackIndex > 0) ? _namespaceAttributesStack[_namespaceAttributesStackIndex] : 0;
+
+        for (int i = end - 1; i >= start; i--) {
+            _contentHandler.endPrefixMapping(_namespacePrefixes[i]);
+        }
+        _namespacePrefixesIndex = start;
+    }
+
+    private int processNamespaceAttributes(int item) throws SAXException {
+        do {
+            switch(_niiStateTable[item]) {
+                case STATE_NAMESPACE_ATTRIBUTE:
+                    // Undeclaration of default namespace
+                    processNamespaceAttribute("", "");
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P:
+                    // Undeclaration of namespace
+                    processNamespaceAttribute(readStructureString(), "");
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P_U:
+                    // Declaration with prefix
+                    processNamespaceAttribute(readStructureString(), readStructureString());
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_U:
+                    // Default declaration
+                    processNamespaceAttribute("", readStructureString());
+                    break;
+                default:
+                    throw reportFatalError("Illegal state: "+item);
+            }
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE);
+
+
+        cacheNamespacePrefixIndex();
+
+        return item;
+    }
+
+    private void processAttributes(int item) throws SAXException {
+        do {
+            switch(_aiiStateTable[item]) {
+                case STATE_ATTRIBUTE_U_LN_QN:
+                    _attributes.addAttributeWithQName(readStructureString(), readStructureString(), readStructureString(), readStructureString(), readContentString());
+                    break;
+                case STATE_ATTRIBUTE_P_U_LN:
+                {
+                    final String p = readStructureString();
+                    final String u = readStructureString();
+                    final String ln = readStructureString();
+                    _attributes.addAttributeWithQName(u, ln, getQName(p, ln), readStructureString(), readContentString());
+                    break;
+                }
+                case STATE_ATTRIBUTE_U_LN: {
+                    final String u = readStructureString();
+                    final String ln = readStructureString();
+                    _attributes.addAttributeWithQName(u, ln, ln, readStructureString(), readContentString());
+                    break;
+                }
+                case STATE_ATTRIBUTE_LN: {
+                    final String ln = readStructureString();
+                    _attributes.addAttributeWithQName("", ln, ln, readStructureString(), readContentString());
+                    break;
+                }
+                default:
+                    throw reportFatalError("Illegal state: "+item);
+            }
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_ATTRIBUTE);
+    }
+
+    private void processNamespaceAttribute(String prefix, String uri) throws SAXException {
+        _contentHandler.startPrefixMapping(prefix, uri);
+
+        if (_namespacePrefixesFeature) {
+            // Add the namespace delcaration as an attribute
+            if (prefix != "") {
+                _attributes.addAttributeWithQName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix,
+                        getQName(XMLConstants.XMLNS_ATTRIBUTE, prefix),
+                        "CDATA", uri);
+            } else {
+                _attributes.addAttributeWithQName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE,
+                        XMLConstants.XMLNS_ATTRIBUTE,
+                        "CDATA", uri);
+            }
+        }
+
+        cacheNamespacePrefix(prefix);
+    }
+
+    private void cacheNamespacePrefix(String prefix) {
+        if (_namespacePrefixesIndex == _namespacePrefixes.length) {
+            final String[] namespaceAttributes = new String[_namespacePrefixesIndex * 3 / 2 + 1];
+            System.arraycopy(_namespacePrefixes, 0, namespaceAttributes, 0, _namespacePrefixesIndex);
+            _namespacePrefixes = namespaceAttributes;
+        }
+
+        _namespacePrefixes[_namespacePrefixesIndex++] = prefix;
+    }
+
+    private void cacheNamespacePrefixIndex() {
+        if (_namespaceAttributesStackIndex == _namespaceAttributesStack.length) {
+            final int[] namespaceAttributesStack = new int[_namespaceAttributesStackIndex * 3 /2 + 1];
+            System.arraycopy(_namespaceAttributesStack, 0, namespaceAttributesStack, 0, _namespaceAttributesStackIndex);
+            _namespaceAttributesStack = namespaceAttributesStack;
+        }
+
+        _namespaceAttributesStack[_namespaceAttributesStackIndex++] = _namespacePrefixesIndex;
+    }
+
+    private void processComment(String s)  throws SAXException {
+        processComment(s.toCharArray(), 0, s.length());
+    }
+
+    private void processComment(char[] ch, int start, int length) throws SAXException {
+        _lexicalHandler.comment(ch, start, length);
+    }
+
+    private void processProcessingInstruction(String target, String data) throws SAXException {
+        _contentHandler.processingInstruction(target, data);
+    }
+
+    private static final DefaultWithLexicalHandler DEFAULT_LEXICAL_HANDLER = new DefaultWithLexicalHandler();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java
new file mode 100644
index 0000000..a903625
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java
@@ -0,0 +1,289 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.stream.buffer.stax;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx;
+
+/**
+ * A helper class for managing the declaration of namespaces.
+ * <p>
+ * A namespace is declared on a namespace context.
+ * Namespace contexts are pushed on and popped off the namespace context stack.
+ * <p>
+ * A declared namespace will be in scope iff the context that it was declared on
+ * has not been popped off the stack.
+ * <p>
+ * When instantiated the namespace stack consists of the root namespace context,
+ * which contains, by default, the "xml" and "xmlns" declarations.
+ * Namespaces may be declarations may be declared on the root context.
+ * The root context cannot be popped but can be reset to contain just the
+ * "xml" and "xmlns" declarations.
+ * <p>
+ * Implementation note: determining the prefix from a namespace URI
+ * (or vice versa) is efficient when there are few namespace
+ * declarations i.e. what is considered to be the case for namespace
+ * declarations in 'average' XML documents. The look up of a namespace URI
+ * given a prefix is performed in O(n) time. The look up of a prefix given
+ * a namespace URI is performed in O(2n) time.
+ * <p>
+ * The implementation does not scale when there are many namespace
+ * declarations. TODO: Use a hash map when there are many namespace
+ * declarations.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final public class NamespaceContexHelper implements NamespaceContextEx {
+    private static int DEFAULT_SIZE = 8;
+
+    // The prefixes of the namespace declarations
+    private String[] prefixes = new String[DEFAULT_SIZE];
+    // The URIs of the namespace declarations
+    private String[] namespaceURIs = new String[DEFAULT_SIZE];
+    // Current position to store the next namespace declaration
+    private int namespacePosition;
+
+    // The namespace contexts
+    private int[] contexts = new int[DEFAULT_SIZE];
+    // Current position to store the next namespace context
+    private int contextPosition;
+
+    // The current namespace context
+    private int currentContext;
+
+    /**
+     * Create a new NamespaceContexHelper.
+     *
+     */
+    public NamespaceContexHelper() {
+        // The default namespace declarations that are always in scope
+        prefixes[0] = "xml";
+        namespaceURIs[0] = "http://www.w3.org/XML/1998/namespace";
+        prefixes[1] = "xmlns";
+        namespaceURIs[1] = "http://www.w3.org/2000/xmlns/";
+
+        currentContext = namespacePosition = 2;
+    }
+
+
+    // NamespaceContext interface
+
+    public String getNamespaceURI(String prefix) {
+        if (prefix == null) throw new IllegalArgumentException();
+
+        prefix = prefix.intern();
+
+        for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredPrefix = prefixes[i];
+            if (declaredPrefix == prefix) {
+                return namespaceURIs[i];
+            }
+        }
+
+        return "";
+    }
+
+    public String getPrefix(String namespaceURI) {
+        if (namespaceURI == null) throw new IllegalArgumentException();
+
+        for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredNamespaceURI = namespaceURIs[i];
+            if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                final String declaredPrefix = prefixes[i];
+
+                // Check if prefix is out of scope
+                for (++i; i < namespacePosition; i++)
+                    if (declaredPrefix == prefixes[i])
+                        return null;
+
+                return declaredPrefix;
+            }
+        }
+
+        return null;
+    }
+
+    public Iterator getPrefixes(String namespaceURI) {
+        if (namespaceURI == null) throw new IllegalArgumentException();
+
+        List<String> l = new ArrayList<String>();
+
+        NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 0; i--) {
+            final String declaredNamespaceURI = namespaceURIs[i];
+            if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                final String declaredPrefix = prefixes[i];
+
+                // Check if prefix is out of scope
+                for (int j = i + 1; j < namespacePosition; j++)
+                    if (declaredPrefix == prefixes[j])
+                        continue NAMESPACE_LOOP;
+
+                l.add(declaredPrefix);
+            }
+        }
+
+        return l.iterator();
+    }
+
+    // NamespaceContextEx interface
+
+    public Iterator<NamespaceContextEx.Binding> iterator() {
+        if (namespacePosition == 2)
+            return Collections.EMPTY_LIST.iterator();
+
+        final List<NamespaceContextEx.Binding> namespaces =
+                new ArrayList<NamespaceContextEx.Binding>(namespacePosition);
+
+        NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 2; i--) {
+            final String declaredPrefix = prefixes[i];
+
+            // Check if prefix is out of scope
+            for (int j = i + 1; j < namespacePosition; j++) {
+                if (declaredPrefix == prefixes[j])
+                    continue NAMESPACE_LOOP;
+
+                namespaces.add(new NamespaceBindingImpl(i));
+            }
+        }
+
+        return namespaces.iterator();
+    }
+
+    final private class NamespaceBindingImpl implements NamespaceContextEx.Binding {
+        int index;
+
+        NamespaceBindingImpl(int index) {
+            this.index = index;
+        }
+
+        public String getPrefix() {
+            return prefixes[index];
+        }
+
+        public String getNamespaceURI() {
+            return namespaceURIs[index];
+        }
+    }
+
+    /**
+     * Declare a default namespace.
+     * <p>
+     * @param namespaceURI the namespace URI to declare, may be null.
+     */
+    public void declareDefaultNamespace(String namespaceURI) {
+        declareNamespace("", namespaceURI);
+    }
+
+    /**
+     * Declare a namespace.
+     * <p>
+     * The namespace will be declared on the current namespace context.
+     * <p>
+     * The namespace can be removed by popping the current namespace
+     * context, or, if the declaration occured in the root context, by
+     * reseting the namespace context.
+     * <p>
+     * A default namespace can be declared by passing <code>""</code> as
+     * the value of the prefix parameter.
+     * A namespace may be undeclared by passing <code>null</code> as the
+     * value of the namespaceURI parameter.
+     * <p>
+     * @param prefix the namespace prefix to declare, may not be null.
+     * @param namespaceURI the namespace URI to declare, may be null.
+     * @throws IllegalArgumentException, if the prefix is null.
+     */
+    public void declareNamespace(String prefix, String namespaceURI) {
+        if (prefix == null) throw new IllegalArgumentException();
+
+        prefix = prefix.intern();
+        // Ignore the "xml" or "xmlns" declarations
+        if (prefix == "xml" || prefix == "xmlns")
+            return;
+
+        // Check for undeclaration
+        if (namespaceURI != null)
+            namespaceURI = namespaceURI.intern();
+
+        if (namespacePosition == namespaceURIs.length)
+            resizeNamespaces();
+
+        // Add new declaration
+        prefixes[namespacePosition] = prefix;
+        namespaceURIs[namespacePosition++] = namespaceURI;
+    }
+
+    private void resizeNamespaces() {
+        final int newLength = namespaceURIs.length * 3 / 2 + 1;
+
+        String[] newPrefixes = new String[newLength];
+        System.arraycopy(prefixes, 0, newPrefixes, 0, prefixes.length);
+        prefixes = newPrefixes;
+
+        String[] newNamespaceURIs = new String[newLength];
+        System.arraycopy(namespaceURIs, 0, newNamespaceURIs, 0, namespaceURIs.length);
+        namespaceURIs = newNamespaceURIs;
+    }
+
+    /**
+     * Push a namespace context on the stack.
+     */
+    public void pushContext() {
+        if (contextPosition == contexts.length)
+            resizeContexts();
+
+        contexts[contextPosition++] = currentContext = namespacePosition;
+    }
+
+    private void resizeContexts() {
+        int[] newContexts = new int[contexts.length * 3 / 2 + 1];
+        System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
+        contexts = newContexts;
+    }
+
+    /**
+     * Pop the namespace context off the stack.
+     * <p>
+     * Namespaces declared within the context (to be popped)
+     * will be removed and no longer be in scope.
+     */
+    public void popContext() {
+        if (contextPosition > 0) {
+            namespacePosition = currentContext = contexts[--contextPosition];
+        }
+    }
+
+    /**
+     * Reset namespace contexts.
+     * <p>
+     * Pop all namespace contexts and reset the root context.
+     */
+    public void resetContexts() {
+        currentContext = namespacePosition = 2;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamBufferCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamBufferCreator.java
new file mode 100644
index 0000000..88c8fd9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamBufferCreator.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.stax;
+
+import com.sun.xml.internal.stream.buffer.AbstractCreator;
+
+/**
+ * {@link AbstractCreator} with additional convenience code.
+ *
+ * @author Paul Sandoz
+ * @author Venu
+ * @author Kohsuke Kawaguchi
+ */
+abstract class StreamBufferCreator extends AbstractCreator {
+    protected void storeQualifiedName(int item, String prefix, String uri, String localName) {
+        if (uri != null && uri.length() > 0) {
+            if (prefix != null && prefix.length() > 0) {
+                item |= FLAG_PREFIX;
+                storeStructureString(prefix);
+            }
+
+            item |= FLAG_URI;
+            storeStructureString(uri);
+        }
+
+        storeStructureString(localName);
+
+        storeStructure(item);
+    }
+
+    protected final void storeNamespaceAttribute(String prefix, String uri) {
+        int item = T_NAMESPACE_ATTRIBUTE;
+
+        if (prefix != null && prefix.length() > 0) {
+            item |= FLAG_PREFIX;
+            storeStructureString(prefix);
+        }
+
+        if (uri != null && uri.length() > 0) {
+            item |= FLAG_URI;
+            storeStructureString(uri);
+        }
+
+        storeStructure(item);
+    }
+
+    protected final void storeAttribute(String prefix, String uri, String localName, String type, String value) {
+        storeQualifiedName(T_ATTRIBUTE_LN, prefix, uri, localName);
+
+        storeStructureString(type);
+        storeContentString(value);
+    }
+
+    protected final void storeProcessingInstruction(String target, String data) {
+        storeStructure(T_PROCESSING_INSTRUCTION);
+        storeStructureString(target);
+        storeStructureString(data);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferCreator.java
new file mode 100644
index 0000000..7f07e4b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferCreator.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.stax;
+
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Create a buffer using an {@link XMLStreamReader}.
+ * <p>
+ * TODO: Implement the marking the stream on the element when an ID
+ * attribute on the element is defined
+ */
+public class StreamReaderBufferCreator extends StreamBufferCreator {
+    private int _eventType;
+    private boolean _storeInScopeNamespacesOnElementFragment;
+    private Map<String, Integer> _inScopePrefixes;
+
+    /**
+     * Create a stream reader buffer creator.
+     * <p>
+     * A stream buffer will be created for storing the infoset
+     * from a stream reader.
+     */
+    public StreamReaderBufferCreator() {
+    }
+
+    /**
+     * Create a stream reader buffer creator using a mutable stream buffer.
+     * <p>
+     * @param buffer the mutable stream buffer.
+     */
+    public StreamReaderBufferCreator(MutableXMLStreamBuffer buffer) {
+        setBuffer(buffer);
+    }
+
+    /**
+     * Create the buffer from a stream reader.
+     * <p>
+     * The stream reader must be positioned at the start of the document
+     * or the start of an element.
+     * <p>
+     * If the stream is positioned at the start of the document then the
+     * whole document is stored and after storing the stream will be positioned
+     * at the end of the document.
+     * <p>
+     * If the stream is positioned at the start of an element then the
+     * element and all its children will be stored and after storing the stream
+     * will be positioned at the next event after the end of the element.
+     * <p>
+     * @return the mutable stream buffer.
+     * @throws XMLStreamException if the stream reader is not positioned at
+     *         the start of the document or at an element.
+     */
+    public MutableXMLStreamBuffer create(XMLStreamReader reader) throws XMLStreamException {
+        if (_buffer == null) {
+            createBuffer();
+        }
+        store(reader);
+
+        return getXMLStreamBuffer();
+    }
+
+    /**
+     * Creates the buffer from a stream reader that is an element fragment.
+     * <p>
+     * The stream reader will be moved to the position of the next start of
+     * an element if the stream reader is not already positioned at the start
+     * of an element.
+     * <p>
+     * The element and all its children will be stored and after storing the stream
+     * will be positioned at the next event after the end of the element.
+     * <p>
+     * @param storeInScopeNamespaces true if in-scope namespaces of the element
+     *        fragment should be stored.
+     * @return the mutable stream buffer.
+     * @throws XMLStreamException if the stream reader cannot be positioned at
+     *         the start of an element.
+     */
+    public MutableXMLStreamBuffer createElementFragment(XMLStreamReader reader,
+            boolean storeInScopeNamespaces) throws XMLStreamException {
+        if (_buffer == null) {
+            createBuffer();
+        }
+
+        if (!reader.hasNext()) {
+            return _buffer;
+        }
+
+        _storeInScopeNamespacesOnElementFragment = storeInScopeNamespaces;
+
+        _eventType = reader.getEventType();
+        if (_eventType != XMLStreamReader.START_ELEMENT) {
+            do {
+                _eventType = reader.next();
+            } while(_eventType != XMLStreamReader.START_ELEMENT && _eventType != XMLStreamReader.END_DOCUMENT);
+        }
+
+        if (storeInScopeNamespaces) {
+            _inScopePrefixes = new HashMap<String,Integer>();
+        }
+
+        storeElementAndChildren(reader);
+
+        return getXMLStreamBuffer();
+    }
+
+    private void store(XMLStreamReader reader) throws XMLStreamException {
+        if (!reader.hasNext()) {
+            return;
+        }
+
+        _eventType = reader.getEventType();
+        switch (_eventType) {
+            case XMLStreamReader.START_DOCUMENT:
+                storeDocumentAndChildren(reader);
+                break;
+            case XMLStreamReader.START_ELEMENT:
+                storeElementAndChildren(reader);
+                break;
+            default:
+                throw new XMLStreamException("XMLStreamReader not positioned at a document or element");
+        }
+
+        increaseTreeCount();
+    }
+
+    private void storeDocumentAndChildren(XMLStreamReader reader) throws XMLStreamException {
+        storeStructure(T_DOCUMENT);
+
+        _eventType = reader.next();
+        while (_eventType != XMLStreamReader.END_DOCUMENT) {
+            switch (_eventType) {
+                case XMLStreamReader.START_ELEMENT:
+                    storeElementAndChildren(reader);
+                    continue;
+                case XMLStreamReader.COMMENT:
+                    storeComment(reader);
+                    break;
+                case XMLStreamReader.PROCESSING_INSTRUCTION:
+                    storeProcessingInstruction(reader);
+                    break;
+            }
+            _eventType = reader.next();
+        }
+
+        storeStructure(T_END);
+    }
+
+    private void storeElementAndChildren(XMLStreamReader reader) throws XMLStreamException {
+        if (reader instanceof XMLStreamReaderEx) {
+            storeElementAndChildrenEx((XMLStreamReaderEx)reader);
+        } else {
+            storeElementAndChildrenNoEx(reader);
+        }
+    }
+
+    private void storeElementAndChildrenEx(XMLStreamReaderEx reader) throws XMLStreamException {
+        int depth = 1;
+        if (_storeInScopeNamespacesOnElementFragment) {
+            storeElementWithInScopeNamespaces(reader);
+        } else {
+            storeElement(reader);
+        }
+
+        while(depth > 0) {
+            _eventType = reader.next();
+            switch (_eventType) {
+                case XMLStreamReader.START_ELEMENT:
+                    depth++;
+                    storeElement(reader);
+                    break;
+                case XMLStreamReader.END_ELEMENT:
+                    depth--;
+                    storeStructure(T_END);
+                    break;
+                case XMLStreamReader.NAMESPACE:
+                    storeNamespaceAttributes(reader);
+                    break;
+                case XMLStreamReader.ATTRIBUTE:
+                    storeAttributes(reader);
+                    break;
+                case XMLStreamReader.SPACE:
+                case XMLStreamReader.CHARACTERS:
+                case XMLStreamReader.CDATA: {
+                    CharSequence c = reader.getPCDATA();
+                    if (c instanceof Base64Data) {
+                        storeStructure(T_TEXT_AS_OBJECT);
+                        storeContentObject(((Base64Data)c).clone());
+                    } else {
+                        storeContentCharacters(T_TEXT_AS_CHAR_ARRAY,
+                                reader.getTextCharacters(), reader.getTextStart(),
+                                reader.getTextLength());
+                    }
+                    break;
+                }
+                case XMLStreamReader.COMMENT:
+                    storeComment(reader);
+                    break;
+                case XMLStreamReader.PROCESSING_INSTRUCTION:
+                    storeProcessingInstruction(reader);
+                    break;
+            }
+        }
+
+        /*
+         * Move to next item after the end of the element
+         * that has been stored
+         */
+        _eventType = reader.next();
+    }
+
+    private void storeElementAndChildrenNoEx(XMLStreamReader reader) throws XMLStreamException {
+        int depth = 1;
+        if (_storeInScopeNamespacesOnElementFragment) {
+            storeElementWithInScopeNamespaces(reader);
+        } else {
+            storeElement(reader);
+        }
+
+        while(depth > 0) {
+            _eventType = reader.next();
+            switch (_eventType) {
+                case XMLStreamReader.START_ELEMENT:
+                    depth++;
+                    storeElement(reader);
+                    break;
+                case XMLStreamReader.END_ELEMENT:
+                    depth--;
+                    storeStructure(T_END);
+                    break;
+                case XMLStreamReader.NAMESPACE:
+                    storeNamespaceAttributes(reader);
+                    break;
+                case XMLStreamReader.ATTRIBUTE:
+                    storeAttributes(reader);
+                    break;
+                case XMLStreamReader.SPACE:
+                case XMLStreamReader.CHARACTERS:
+                case XMLStreamReader.CDATA: {
+                    storeContentCharacters(T_TEXT_AS_CHAR_ARRAY,
+                            reader.getTextCharacters(), reader.getTextStart(),
+                            reader.getTextLength());
+                    break;
+                }
+                case XMLStreamReader.COMMENT:
+                    storeComment(reader);
+                    break;
+                case XMLStreamReader.PROCESSING_INSTRUCTION:
+                    storeProcessingInstruction(reader);
+                    break;
+            }
+        }
+
+        /*
+         * Move to next item after the end of the element
+         * that has been stored
+         */
+        _eventType = reader.next();
+    }
+
+    private void storeElementWithInScopeNamespaces(XMLStreamReader reader) {
+        storeQualifiedName(T_ELEMENT_LN,
+                reader.getPrefix(), reader.getNamespaceURI(), reader.getLocalName());
+
+        if (reader.getNamespaceCount() > 0) {
+            storeNamespaceAttributes(reader);
+        }
+
+        if (reader.getAttributeCount() > 0) {
+            storeAttributes(reader);
+        }
+    }
+
+    private void storeElement(XMLStreamReader reader) {
+        storeQualifiedName(T_ELEMENT_LN,
+                reader.getPrefix(), reader.getNamespaceURI(), reader.getLocalName());
+
+        if (reader.getNamespaceCount() > 0) {
+            storeNamespaceAttributes(reader);
+        }
+
+        if (reader.getAttributeCount() > 0) {
+            storeAttributes(reader);
+        }
+    }
+
+    private void storeNamespaceAttributes(XMLStreamReader reader) {
+        int count = reader.getNamespaceCount();
+        for (int i = 0; i < count; i++) {
+            storeNamespaceAttribute(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+        }
+    }
+
+    private void storeAttributes(XMLStreamReader reader) {
+        int count = reader.getAttributeCount();
+        for (int i = 0; i < count; i++) {
+            storeAttribute(reader.getAttributePrefix(i), reader.getAttributeNamespace(i), reader.getAttributeLocalName(i),
+                    reader.getAttributeType(i), reader.getAttributeValue(i));
+        }
+    }
+
+    private void storeComment(XMLStreamReader reader) {
+        storeContentCharacters(T_COMMENT_AS_CHAR_ARRAY,
+                reader.getTextCharacters(), reader.getTextStart(), reader.getTextLength());
+    }
+
+    private void storeProcessingInstruction(XMLStreamReader reader) {
+        storeProcessingInstruction(reader.getPITarget(), reader.getPIData());
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java
new file mode 100644
index 0000000..d1e5bc6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java
@@ -0,0 +1,1081 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.stax;
+
+import com.sun.xml.internal.stream.buffer.AbstractProcessor;
+import com.sun.xml.internal.stream.buffer.AttributesHolder;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferMark;
+import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * A processor of a {@link XMLStreamBuffer} that reads the XML infoset as
+ * {@link XMLStreamReader}.
+ *
+ * <p>
+ * Because of {@link XMLStreamReader} design, this processor always produce
+ * a full document infoset, even if the buffer just contains a fragment.
+ *
+ * <p>
+ * When {@link XMLStreamBuffer} contains a multiple tree (AKA "forest"),
+ * {@link XMLStreamReader} will behave as if there are multiple root elements
+ * (so you'll see {@link #START_ELEMENT} event where you'd normally expect
+ * {@link #END_DOCUMENT}.)
+ *
+ * @author Paul.Sandoz@Sun.Com
+ * @author K.Venugopal@sun.com
+ */
+public class StreamReaderBufferProcessor extends AbstractProcessor implements XMLStreamReaderEx {
+    private static final int CACHE_SIZE = 16;
+
+    // Stack to hold element and namespace declaration information
+    protected ElementStackEntry[] _stack = new ElementStackEntry[CACHE_SIZE];
+    /** The top-most active entry of the {@link #_stack}. */
+    protected ElementStackEntry _stackTop;
+    /** The element depth that we are in. Used to determine when we are done with a tree. */
+    protected int _depth;
+
+    // Arrays to hold all namespace declarations
+    /**
+     * Namespace prefixes. Can be empty but not null.
+     */
+    protected String[] _namespaceAIIsPrefix = new String[CACHE_SIZE];
+    protected String[] _namespaceAIIsNamespaceName = new String[CACHE_SIZE];
+    protected int _namespaceAIIsEnd;
+
+    // Internal namespace context implementation
+    protected InternalNamespaceContext _nsCtx = new InternalNamespaceContext();
+
+    // The current event type
+    protected int _eventType;
+
+    /**
+     * Holder of the attributes.
+     *
+     * Be careful that this follows the SAX convention of using "" instead of null.
+     */
+    protected AttributesHolder _attributeCache;
+
+    // Characters as a CharSequence
+    protected CharSequence _charSequence;
+
+    // Characters as a char array with offset and length
+    protected char[] _characters;
+    protected int _textOffset;
+    protected int _textLen;
+
+    protected String _piTarget;
+    protected String _piData;
+
+    //
+    // Represents the parser state wrt the end of parsing.
+    //
+    /**
+     * The parser is in the middle of parsing a document,
+     * with no end in sight.
+     */
+    private static final int PARSING = 1;
+    /**
+     * The parser has already reported the {@link #END_ELEMENT},
+     * and we are parsing a fragment. We'll report {@link #END_DOCUMENT}
+     * next and be done.
+     */
+    private static final int PENDING_END_DOCUMENT = 2;
+    /**
+     * The parser has reported the {@link #END_DOCUMENT} event,
+     * so we are really done parsing.
+     */
+    private static final int COMPLETED = 3;
+
+    /**
+     * True if processing is complete.
+     */
+    private int _completionState;
+
+    public StreamReaderBufferProcessor() {
+        for (int i=0; i < _stack.length; i++){
+            _stack[i] = new ElementStackEntry();
+        }
+
+        _attributeCache = new AttributesHolder();
+    }
+
+    public StreamReaderBufferProcessor(XMLStreamBuffer buffer) throws XMLStreamException {
+        this();
+        setXMLStreamBuffer(buffer);
+    }
+
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer) throws XMLStreamException {
+        setBuffer(buffer,buffer.isFragment());
+
+        _completionState = PARSING;
+        _namespaceAIIsEnd = 0;
+        _characters = null;
+        _charSequence = null;
+        _eventType = START_DOCUMENT;
+    }
+
+    /**
+     * Does {@link #nextTag()} and if the parser moved to a new start tag,
+     * returns a {@link XMLStreamBufferMark} that captures the infoset starting
+     * from the newly discovered element.
+     *
+     * <p>
+     * (Ideally we should have a method that works against the current position,
+     * but the way the data structure is read makes this somewhat difficult.)
+     *
+     * This creates a new {@link XMLStreamBufferMark} that shares the underlying
+     * data storage, thus it's fairly efficient.
+     */
+    public XMLStreamBuffer nextTagAndMark() throws XMLStreamException {
+        while (true) {
+            int s = peekStructure();
+            if((s &TYPE_MASK)==T_ELEMENT) {
+                // next is start element.
+                Map<String,String> inscope = new HashMap<String, String>(_namespaceAIIsEnd);
+
+                for (int i=0 ; i<_namespaceAIIsEnd; i++)
+                    inscope.put(_namespaceAIIsPrefix[i],_namespaceAIIsNamespaceName[i]);
+
+                XMLStreamBufferMark mark = new XMLStreamBufferMark(inscope, this);
+                next();
+                return mark;
+            }
+
+            if(next()==END_ELEMENT)
+                return null;
+        }
+    }
+
+    public Object getProperty(String name) {
+        return null;
+    }
+
+    public int next() throws XMLStreamException {
+        switch(_completionState) {
+            case COMPLETED:
+                throw new XMLStreamException("Invalid State");
+            case PENDING_END_DOCUMENT:
+                _namespaceAIIsEnd = 0;
+                _completionState = COMPLETED;
+                return _eventType = END_DOCUMENT;
+        }
+
+        // Pop the stack of elements
+        // This is a post-processing operation
+        // The stack of the element should be poppoed after
+        // the END_ELEMENT event is returned so that the correct element name
+        // and namespace scope is returned
+        switch(_eventType) {
+            case END_ELEMENT:
+                if (_depth > 1) {
+                    _depth--;
+                    // _depth index is always set to the next free stack entry
+                    // to push
+                    popElementStack(_depth);
+                } else if (_depth == 1) {
+                    _depth--;
+                }
+        }
+
+        _characters = null;
+        _charSequence = null;
+        while(true) {// loop only if we read STATE_DOCUMENT
+            switch(readEiiState()) {
+                case STATE_DOCUMENT:
+                    // we'll always produce a full document, and we've already report START_DOCUMENT event.
+                    // so simply skil this
+                    continue;
+                case STATE_ELEMENT_U_LN_QN: {
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    final String prefix = getPrefixFromQName(readStructureString());
+
+                    processElement(prefix, uri, localName);
+                    return _eventType = START_ELEMENT;
+                }
+                case STATE_ELEMENT_P_U_LN:
+                    processElement(readStructureString(), readStructureString(), readStructureString());
+                    return _eventType = START_ELEMENT;
+                case STATE_ELEMENT_U_LN:
+                    processElement(null, readStructureString(), readStructureString());
+                    return _eventType = START_ELEMENT;
+                case STATE_ELEMENT_LN:
+                    processElement(null, null, readStructureString());
+                    return _eventType = START_ELEMENT;
+                case STATE_TEXT_AS_CHAR_ARRAY_SMALL:
+                    _textLen = readStructure();
+                    _textOffset = readContentCharactersBuffer(_textLen);
+                    _characters = _contentCharactersBuffer;
+
+                    return _eventType = CHARACTERS;
+                case STATE_TEXT_AS_CHAR_ARRAY_MEDIUM:
+                    _textLen = readStructure16();
+                    _textOffset = readContentCharactersBuffer(_textLen);
+                    _characters = _contentCharactersBuffer;
+
+                    return _eventType = CHARACTERS;
+                case STATE_TEXT_AS_CHAR_ARRAY_COPY:
+                    _characters = readContentCharactersCopy();
+                    _textLen = _characters.length;
+                    _textOffset = 0;
+
+                    return _eventType = CHARACTERS;
+                case STATE_TEXT_AS_STRING:
+                    _eventType = CHARACTERS;
+                    _charSequence = readContentString();
+
+                    return _eventType = CHARACTERS;
+                case STATE_TEXT_AS_OBJECT:
+                    _eventType = CHARACTERS;
+                    _charSequence = (CharSequence)readContentObject();
+
+                    return _eventType = CHARACTERS;
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL:
+                    _textLen = readStructure();
+                    _textOffset = readContentCharactersBuffer(_textLen);
+                    _characters = _contentCharactersBuffer;
+
+                    return _eventType = COMMENT;
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM:
+                    _textLen = readStructure16();
+                    _textOffset = readContentCharactersBuffer(_textLen);
+                    _characters = _contentCharactersBuffer;
+
+                    return _eventType = COMMENT;
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY:
+                    _characters = readContentCharactersCopy();
+                    _textLen = _characters.length;
+                    _textOffset = 0;
+
+                    return _eventType = COMMENT;
+                case STATE_COMMENT_AS_STRING:
+                    _charSequence = readContentString();
+
+                    return _eventType = COMMENT;
+                case STATE_PROCESSING_INSTRUCTION:
+                    _piTarget = readStructureString();
+                    _piData = readStructureString();
+
+                    return _eventType = PROCESSING_INSTRUCTION;
+                case STATE_END:
+                    if (_depth > 1) {
+                        // normal case
+                        return _eventType = END_ELEMENT;
+                    } else if (_depth == 1) {
+                        // this is the last end element for the current tree.
+                        if (_fragmentMode) {
+                            if(--_treeCount==0) // is this the last tree in the forest?
+                                _completionState = PENDING_END_DOCUMENT;
+                        }
+                        return _eventType = END_ELEMENT;
+                    } else {
+                        // this only happens when we are processing a full document
+                        // and we hit the "end of document" marker
+                        _namespaceAIIsEnd = 0;
+                        _completionState = COMPLETED;
+                        return _eventType = END_DOCUMENT;
+                    }
+                default:
+                    throw new XMLStreamException("Invalid State");
+            }
+            // this should be unreachable
+        }
+    }
+
+    public final void require(int type, String namespaceURI, String localName) throws XMLStreamException {
+        if( type != _eventType) {
+            throw new XMLStreamException("");
+        }
+        if( namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
+            throw new XMLStreamException("");
+        }
+        if(localName != null && !localName.equals(getLocalName())) {
+            throw new XMLStreamException("");
+        }
+    }
+
+    public final String getElementTextTrim() throws XMLStreamException {
+        // TODO getElementText* methods more efficiently
+        return getElementText().trim();
+    }
+
+    public final String getElementText() throws XMLStreamException {
+        if(_eventType != START_ELEMENT) {
+            throw new XMLStreamException("");
+        }
+
+        next();
+        return getElementText(true);
+    }
+
+    public final String getElementText(boolean startElementRead) throws XMLStreamException {
+        if (!startElementRead) {
+            throw new XMLStreamException("");
+        }
+
+        int eventType = getEventType();
+        StringBuffer content = new StringBuffer();
+        while(eventType != END_ELEMENT ) {
+            if(eventType == CHARACTERS
+                    || eventType == CDATA
+                    || eventType == SPACE
+                    || eventType == ENTITY_REFERENCE) {
+                content.append(getText());
+            } else if(eventType == PROCESSING_INSTRUCTION
+                    || eventType == COMMENT) {
+                // skipping
+            } else if(eventType == END_DOCUMENT) {
+                throw new XMLStreamException("");
+            } else if(eventType == START_ELEMENT) {
+                throw new XMLStreamException("");
+            } else {
+                throw new XMLStreamException("");
+            }
+            eventType = next();
+        }
+        return content.toString();
+    }
+
+    public final int nextTag() throws XMLStreamException {
+        next();
+        return nextTag(true);
+    }
+
+    public final int nextTag(boolean currentTagRead) throws XMLStreamException {
+        int eventType = getEventType();
+        if (!currentTagRead) {
+            eventType = next();
+        }
+        while((eventType == CHARACTERS && isWhiteSpace()) // skip whitespace
+        || (eventType == CDATA && isWhiteSpace())
+        || eventType == SPACE
+        || eventType == PROCESSING_INSTRUCTION
+        || eventType == COMMENT) {
+            eventType = next();
+        }
+        if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
+            throw new XMLStreamException("");
+        }
+        return eventType;
+    }
+
+    public final boolean hasNext() {
+        return (_eventType != END_DOCUMENT);
+    }
+
+    public void close() throws XMLStreamException {
+    }
+
+    public final boolean isStartElement() {
+        return (_eventType == START_ELEMENT);
+    }
+
+    public final boolean isEndElement() {
+        return (_eventType == END_ELEMENT);
+    }
+
+    public final boolean isCharacters() {
+        return (_eventType == CHARACTERS);
+    }
+
+    public final boolean isWhiteSpace() {
+        if(isCharacters() || (_eventType == CDATA)){
+            char [] ch = this.getTextCharacters();
+            int start = this.getTextStart();
+            int length = this.getTextLength();
+            for (int i = start; i < length; i++){
+                final char c = ch[i];
+                if (!(c == 0x20 || c == 0x9 || c == 0xD || c == 0xA))
+                    return false;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    public final String getAttributeValue(String namespaceURI, String localName) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+
+        if (namespaceURI == null) {
+            // Set to the empty string to be compatible with the
+            // org.xml.sax.Attributes interface
+            namespaceURI = "";
+        }
+
+        return _attributeCache.getValue(namespaceURI, localName);
+    }
+
+    public final int getAttributeCount() {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+
+        return _attributeCache.getLength();
+    }
+
+    public final javax.xml.namespace.QName getAttributeName(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+
+        final String prefix = _attributeCache.getPrefix(index);
+        final String localName = _attributeCache.getLocalName(index);
+        final String uri = _attributeCache.getURI(index);
+        return new QName(uri,localName,prefix);
+    }
+
+
+    public final String getAttributeNamespace(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+        return fixEmptyString(_attributeCache.getURI(index));
+    }
+
+    public final String getAttributeLocalName(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+        return _attributeCache.getLocalName(index);
+    }
+
+    public final String getAttributePrefix(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+        return fixEmptyString(_attributeCache.getPrefix(index));
+    }
+
+    public final String getAttributeType(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+        return _attributeCache.getType(index);
+    }
+
+    public final String getAttributeValue(int index) {
+        if (_eventType != START_ELEMENT) {
+            throw new IllegalStateException("");
+        }
+
+        return _attributeCache.getValue(index);
+    }
+
+    public final boolean isAttributeSpecified(int index) {
+        return false;
+    }
+
+    public final int getNamespaceCount() {
+        if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+            return _stackTop.namespaceAIIsEnd - _stackTop.namespaceAIIsStart;
+        }
+
+        throw new IllegalStateException("");
+    }
+
+    public final String getNamespacePrefix(int index) {
+        if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+            return _namespaceAIIsPrefix[_stackTop.namespaceAIIsStart + index];
+        }
+
+        throw new IllegalStateException("");
+    }
+
+    public final String getNamespaceURI(int index) {
+        if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+            return _namespaceAIIsNamespaceName[_stackTop.namespaceAIIsStart + index];
+        }
+
+        throw new IllegalStateException("");
+    }
+
+    public final String getNamespaceURI(String prefix) {
+        return _nsCtx.getNamespaceURI(prefix);
+    }
+
+    public final NamespaceContextEx getNamespaceContext() {
+        return _nsCtx;
+    }
+
+    public final int getEventType() {
+        return _eventType;
+    }
+
+    public final String getText() {
+        if (_characters != null) {
+            String s = new String(_characters, _textOffset, _textLen);
+            _charSequence = s;
+            return s;
+        } else if (_charSequence != null) {
+            return _charSequence.toString();
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public final char[] getTextCharacters() {
+        if (_characters != null) {
+            return _characters;
+        } else if (_charSequence != null) {
+            // TODO try to avoid creation of a temporary String for some
+            // CharSequence implementations
+            _characters = _charSequence.toString().toCharArray();
+            _textLen = _characters.length;
+            _textOffset = 0;
+            return _characters;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public final int getTextStart() {
+        if (_characters != null) {
+            return _textOffset;
+        } else if (_charSequence != null) {
+            return 0;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public final int getTextLength() {
+        if (_characters != null) {
+            return _textLen;
+        } else if (_charSequence != null) {
+            return _charSequence.length();
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public final int getTextCharacters(int sourceStart, char[] target,
+                                       int targetStart, int length) throws XMLStreamException {
+        if (_characters != null) {
+        } else if (_charSequence != null) {
+            _characters = _charSequence.toString().toCharArray();
+            _textLen = _characters.length;
+            _textOffset = 0;
+        } else {
+            throw new IllegalStateException("");
+        }
+
+        try {
+            System.arraycopy(_characters, sourceStart, target,
+                    targetStart, length);
+            return length;
+        } catch (IndexOutOfBoundsException e) {
+            throw new XMLStreamException(e);
+        }
+    }
+
+    private class CharSequenceImpl implements CharSequence {
+        private final int _offset;
+        private final int _length;
+
+        CharSequenceImpl(int offset, int length) {
+            _offset = offset;
+            _length = length;
+        }
+
+        public int length() {
+            return _length;
+        }
+
+        public char charAt(int index) {
+            if (index >= 0 && index < _textLen) {
+                return _characters[_textOffset + index];
+            } else {
+                throw new IndexOutOfBoundsException();
+            }
+        }
+
+        public CharSequence subSequence(int start, int end) {
+            final int length = end - start;
+            if (end < 0 || start < 0 || end > length || start > end) {
+                throw new IndexOutOfBoundsException();
+            }
+
+            return new CharSequenceImpl(_offset + start, length);
+        }
+
+        public String toString() {
+            return new String(_characters, _offset, _length);
+        }
+    }
+
+    public final CharSequence getPCDATA() {
+        if (_characters != null) {
+            return new CharSequenceImpl(_textOffset, _textLen);
+        } else if (_charSequence != null) {
+            return _charSequence;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public final String getEncoding() {
+        return "UTF-8";
+    }
+
+    public final boolean hasText() {
+        return (_characters != null || _charSequence != null);
+    }
+
+    public final Location getLocation() {
+        return new DummyLocation();
+    }
+
+    public final boolean hasName() {
+        return (_eventType == START_ELEMENT || _eventType == END_ELEMENT);
+    }
+
+    public final QName getName() {
+        return _stackTop.getQName();
+    }
+
+    public final String getLocalName() {
+        return _stackTop.localName;
+    }
+
+    public final String getNamespaceURI() {
+        return _stackTop.uri;
+    }
+
+    public final String getPrefix() {
+        return _stackTop.prefix;
+
+    }
+
+    public final String getVersion() {
+        return "1.0";
+    }
+
+    public final boolean isStandalone() {
+        return false;
+    }
+
+    public final boolean standaloneSet() {
+        return false;
+    }
+
+    public final String getCharacterEncodingScheme() {
+        return "UTF-8";
+    }
+
+    public final String getPITarget() {
+        if (_eventType == PROCESSING_INSTRUCTION) {
+            return _piTarget;
+        }
+        throw new IllegalStateException("");
+    }
+
+    public final String getPIData() {
+        if (_eventType == PROCESSING_INSTRUCTION) {
+            return _piData;
+        }
+        throw new IllegalStateException("");
+    }
+
+    protected void processElement(String prefix, String uri, String localName) {
+        pushElementStack();
+        _stackTop.set(prefix, uri, localName);
+
+        _attributeCache.clear();
+
+        int item = peekStructure();
+        if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) {
+            // Skip the namespace declarations on the element
+            // they will have been added already
+            item = processNamespaceAttributes(item);
+        }
+        if ((item & TYPE_MASK) == T_ATTRIBUTE) {
+            processAttributes(item);
+        }
+    }
+
+    private void resizeNamespaceAttributes() {
+        final String[] namespaceAIIsPrefix = new String[_namespaceAIIsEnd * 2];
+        System.arraycopy(_namespaceAIIsPrefix, 0, namespaceAIIsPrefix, 0, _namespaceAIIsEnd);
+        _namespaceAIIsPrefix = namespaceAIIsPrefix;
+
+        final String[] namespaceAIIsNamespaceName = new String[_namespaceAIIsEnd * 2];
+        System.arraycopy(_namespaceAIIsNamespaceName, 0, namespaceAIIsNamespaceName, 0, _namespaceAIIsEnd);
+        _namespaceAIIsNamespaceName = namespaceAIIsNamespaceName;
+    }
+
+    private int processNamespaceAttributes(int item){
+        _stackTop.namespaceAIIsStart = _namespaceAIIsEnd;
+
+        do {
+            if (_namespaceAIIsEnd == _namespaceAIIsPrefix.length) {
+                resizeNamespaceAttributes();
+            }
+
+            switch(_niiStateTable[item]){
+                case STATE_NAMESPACE_ATTRIBUTE:
+                    // Undeclaration of default namespace
+                    _namespaceAIIsPrefix[_namespaceAIIsEnd] =
+                    _namespaceAIIsNamespaceName[_namespaceAIIsEnd++] = "";
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P:
+                    // Undeclaration of namespace
+                    _namespaceAIIsPrefix[_namespaceAIIsEnd] = readStructureString();
+                    _namespaceAIIsNamespaceName[_namespaceAIIsEnd++] = "";
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P_U:
+                    // Declaration with prefix
+                    _namespaceAIIsPrefix[_namespaceAIIsEnd] = readStructureString();
+                    _namespaceAIIsNamespaceName[_namespaceAIIsEnd++] = readStructureString();
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_U:
+                    // Default declaration
+                    _namespaceAIIsPrefix[_namespaceAIIsEnd] = "";
+                    _namespaceAIIsNamespaceName[_namespaceAIIsEnd++] = readStructureString();
+                    break;
+            }
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE);
+
+        _stackTop.namespaceAIIsEnd = _namespaceAIIsEnd;
+
+        return item;
+    }
+
+    private void processAttributes(int item){
+        do {
+            switch(_aiiStateTable[item]){
+                case STATE_ATTRIBUTE_U_LN_QN: {
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    final String prefix = getPrefixFromQName(readStructureString());
+                    _attributeCache.addAttributeWithPrefix(prefix, uri, localName, readStructureString(), readContentString());
+                    break;
+                }
+                case STATE_ATTRIBUTE_P_U_LN:
+                    _attributeCache.addAttributeWithPrefix(readStructureString(), readStructureString(), readStructureString(), readStructureString(), readContentString());
+                    break;
+                case STATE_ATTRIBUTE_U_LN:
+                    // _attributeCache follows SAX convention
+                    _attributeCache.addAttributeWithPrefix("", readStructureString(), readStructureString(), readStructureString(), readContentString());
+                    break;
+                case STATE_ATTRIBUTE_LN: {
+                    _attributeCache.addAttributeWithPrefix("", "", readStructureString(), readStructureString(), readContentString());
+                    break;
+                }
+            }
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_ATTRIBUTE);
+    }
+
+    private void pushElementStack() {
+        if (_depth == _stack.length) {
+            // resize stack
+            ElementStackEntry [] tmp = _stack;
+            _stack = new ElementStackEntry[_stack.length * 3 /2 + 1];
+            System.arraycopy(tmp, 0, _stack, 0, tmp.length);
+            for (int i = tmp.length; i < _stack.length; i++){
+                _stack[i] = new ElementStackEntry();
+            }
+        }
+
+        _stackTop = _stack[_depth++];
+    }
+
+    private void popElementStack(int depth) {
+        // _depth is checked outside this method
+        _stackTop = _stack[depth - 1];
+        // Move back the position of the namespace index
+        _namespaceAIIsEnd = _stack[depth].namespaceAIIsStart;
+    }
+
+    private final class ElementStackEntry {
+        /**
+         * Prefix.
+         * Just like everywhere else in StAX, this can be null but can't be empty.
+         */
+        String prefix;
+        /**
+         * Namespace URI.
+         * Just like everywhere else in StAX, this can be null but can't be empty.
+         */
+        String uri;
+        String localName;
+        QName qname;
+
+        // Start and end of namespace declarations
+        // in namespace declaration arrays
+        int namespaceAIIsStart;
+        int namespaceAIIsEnd;
+
+        public void set(String prefix, String uri, String localName) {
+            this.prefix = prefix;
+            this.uri = uri;
+            this.localName = localName;
+            this.qname = null;
+
+            this.namespaceAIIsStart = this.namespaceAIIsEnd = StreamReaderBufferProcessor.this._namespaceAIIsEnd;
+        }
+
+        public QName getQName() {
+            if (qname == null) {
+                qname = new QName(fixNull(uri), localName, fixNull(prefix));
+            }
+            return qname;
+        }
+
+        private String fixNull(String s) {
+            return (s == null) ? "" : s;
+        }
+    }
+
+    private final class InternalNamespaceContext implements NamespaceContextEx {
+        @SuppressWarnings({"StringEquality"})
+        public String getNamespaceURI(String prefix) {
+            if (prefix == null) {
+                throw new IllegalArgumentException("Prefix cannot be null");
+            }
+
+            /*
+             * If the buffer was created using string interning
+             * intern the prefix and check for reference equality
+             * rather than using String.equals();
+             */
+            if (_stringInterningFeature) {
+                prefix = prefix.intern();
+
+                // Find the most recently declared prefix
+                for (int i = _namespaceAIIsEnd - 1; i >=0; i--) {
+                    if (prefix == _namespaceAIIsPrefix[i]) {
+                        return _namespaceAIIsNamespaceName[i];
+                    }
+                }
+            } else {
+                // Find the most recently declared prefix
+                for (int i = _namespaceAIIsEnd - 1; i >=0; i--) {
+                    if (prefix.equals(_namespaceAIIsPrefix[i])) {
+                        return _namespaceAIIsNamespaceName[i];
+                    }
+                }
+            }
+
+            // Check for XML-based prefixes
+            if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
+                return XMLConstants.XML_NS_URI;
+            } else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
+                return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
+            }
+
+            return null;
+        }
+
+        public String getPrefix(String namespaceURI) {
+            final Iterator i = getPrefixes(namespaceURI);
+            if (i.hasNext()) {
+                return (String)i.next();
+            } else {
+                return null;
+            }
+        }
+
+        public Iterator getPrefixes(final String namespaceURI) {
+            if (namespaceURI == null){
+                throw new IllegalArgumentException("NamespaceURI cannot be null");
+            }
+
+            if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
+                return Collections.singletonList(XMLConstants.XML_NS_PREFIX).iterator();
+            } else if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+                return Collections.singletonList(XMLConstants.XMLNS_ATTRIBUTE).iterator();
+            }
+
+            return new Iterator() {
+                private int i = _namespaceAIIsEnd - 1;
+                private boolean requireFindNext = true;
+                private String p;
+
+                private String findNext() {
+                    while(i >= 0) {
+                        // Find the most recently declared namespace
+                        if (namespaceURI.equals(_namespaceAIIsNamespaceName[i])) {
+                            // Find the most recently declared prefix of the namespace
+                            // and check if the prefix is in scope with that namespace
+                            if (getNamespaceURI(_namespaceAIIsPrefix[i]).equals(
+                                    _namespaceAIIsNamespaceName[i])) {
+                                return p = _namespaceAIIsPrefix[i];
+                            }
+                        }
+                        i--;
+                    }
+                    return p = null;
+                }
+
+                public boolean hasNext() {
+                    if (requireFindNext) {
+                        findNext();
+                        requireFindNext = false;
+                    }
+                    return (p != null);
+                }
+
+                public Object next() {
+                    if (requireFindNext) {
+                        findNext();
+                    }
+                    requireFindNext = true;
+
+                    if (p == null) {
+                        throw new NoSuchElementException();
+                    }
+
+                    return p;
+                }
+
+                public void remove() {
+                    throw new UnsupportedOperationException();
+                }
+            };
+        }
+
+        private class BindingImpl implements NamespaceContextEx.Binding {
+            final String _prefix;
+            final String _namespaceURI;
+
+            BindingImpl(String prefix, String namespaceURI) {
+                _prefix = prefix;
+                _namespaceURI = namespaceURI;
+            }
+
+            public String getPrefix() {
+                return _prefix;
+            }
+
+            public String getNamespaceURI() {
+                return _namespaceURI;
+            }
+        }
+
+        public Iterator<NamespaceContextEx.Binding> iterator() {
+            return new Iterator<NamespaceContextEx.Binding>() {
+                private final int end = _namespaceAIIsEnd - 1;
+                private int current = end;
+                private boolean requireFindNext = true;
+                private NamespaceContextEx.Binding namespace;
+
+                private NamespaceContextEx.Binding findNext() {
+                    while(current >= 0) {
+                        final String prefix = _namespaceAIIsPrefix[current];
+
+                        // Find if the current prefix occurs more recently
+                        // If so then it is not in scope
+                        int i = end;
+                        for (;i > current; i--) {
+                            if (prefix.equals(_namespaceAIIsPrefix[i])) {
+                                break;
+                            }
+                        }
+                        if (i == current--) {
+                            // The current prefix is in-scope
+                            return namespace = new BindingImpl(prefix, _namespaceAIIsNamespaceName[current]);
+                        }
+                    }
+                    return namespace = null;
+                }
+
+                public boolean hasNext() {
+                    if (requireFindNext) {
+                        findNext();
+                        requireFindNext = false;
+                    }
+                    return (namespace != null);
+                }
+
+                public NamespaceContextEx.Binding next() {
+                    if (requireFindNext) {
+                        findNext();
+                    }
+                    requireFindNext = true;
+
+                    if (namespace == null) {
+                        throw new NoSuchElementException();
+                    }
+
+                    return namespace;
+                }
+
+                public void remove() {
+                    throw new UnsupportedOperationException();
+                }
+            };
+        }
+    }
+
+    private class DummyLocation  implements Location {
+        public int getLineNumber() {
+            return -1;
+        }
+
+        public int getColumnNumber() {
+            return -1;
+        }
+
+        public int getCharacterOffset() {
+            return -1;
+        }
+
+        public String getPublicId() {
+            return null;
+        }
+
+        public String getSystemId() {
+            return _buffer.getSystemId();
+        }
+    }
+
+    private static String fixEmptyString(String s) {
+        // s must not be null, so no need to check for that. that would be bug.
+        if(s.length()==0)   return null;
+        else                return s;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferCreator.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferCreator.java
new file mode 100644
index 0000000..6f165ef
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferCreator.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.stream.buffer.stax;
+
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.OutputStream;
+
+/**
+ * {@link XMLStreamWriter} that fills {@link MutableXMLStreamBuffer}.
+ * <p>
+ * TODO: need to retain all attributes/namespaces and then store all namespaces
+ * before the attributes. Currently it is necessary for the caller to ensure
+ * all namespaces are written before attributes and the caller must not intermix
+ * calls to the writeNamespace and writeAttribute methods.
+ *
+ */
+public class StreamWriterBufferCreator extends StreamBufferCreator implements XMLStreamWriterEx {
+    private final NamespaceContexHelper namespaceContext = new NamespaceContexHelper();
+
+    /**
+     * Nesting depth of the element.
+     * This field is ultimately used to keep track of the # of trees we created in
+     * the buffer.
+     */
+    private int depth=0;
+
+    public StreamWriterBufferCreator() {
+        setXMLStreamBuffer(new MutableXMLStreamBuffer());
+    }
+
+    public StreamWriterBufferCreator(MutableXMLStreamBuffer buffer) {
+        setXMLStreamBuffer(buffer);
+    }
+
+    // XMLStreamWriter
+
+    public Object getProperty(String str) throws IllegalArgumentException {
+        return null; //return  null for all the property names instead of
+                    //throwing unsupported operation exception.
+    }
+
+    public void close() throws XMLStreamException {
+    }
+
+    public void flush() throws XMLStreamException {
+    }
+
+    public NamespaceContextEx getNamespaceContext() {
+        return namespaceContext;
+    }
+
+    public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException {
+        /*
+         * It is really unclear from the JavaDoc how to implement this method.
+         */
+        throw new UnsupportedOperationException();
+    }
+
+    public void setDefaultNamespace(String namespaceURI) throws XMLStreamException {
+        setPrefix("", namespaceURI);
+    }
+
+    public void setPrefix(String prefix, String namespaceURI) throws XMLStreamException {
+        namespaceContext.declareNamespace(prefix, namespaceURI);
+    }
+
+    public String getPrefix(String namespaceURI) throws XMLStreamException {
+        return namespaceContext.getPrefix(namespaceURI);
+    }
+
+
+    public void writeStartDocument() throws XMLStreamException {
+        writeStartDocument("", "");
+    }
+
+    public void writeStartDocument(String version) throws XMLStreamException {
+        writeStartDocument("", "");
+    }
+
+    public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+        namespaceContext.resetContexts();
+
+        storeStructure(T_DOCUMENT);
+    }
+
+    public void writeEndDocument() throws XMLStreamException {
+        storeStructure(T_END);
+    }
+
+    public void writeStartElement(String localName) throws XMLStreamException {
+        namespaceContext.pushContext();
+        depth++;
+
+        final String defaultNamespaceURI = namespaceContext.getNamespaceURI("");
+
+        if (defaultNamespaceURI == null)
+            storeQualifiedName(T_ELEMENT_LN, null, null, localName);
+        else
+            storeQualifiedName(T_ELEMENT_LN, null, defaultNamespaceURI, localName);
+    }
+
+    public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+        namespaceContext.pushContext();
+        depth++;
+
+        final String prefix = namespaceContext.getPrefix(namespaceURI);
+        if (prefix == null) {
+            throw new XMLStreamException();
+        }
+
+        namespaceContext.pushContext();
+        storeQualifiedName(T_ELEMENT_LN, prefix, namespaceURI, localName);
+    }
+
+    public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        namespaceContext.pushContext();
+        depth++;
+
+        storeQualifiedName(T_ELEMENT_LN, prefix, namespaceURI, localName);
+    }
+
+    public void writeEmptyElement(String localName) throws XMLStreamException {
+        writeStartElement(localName);
+        writeEndElement();
+    }
+
+    public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
+        writeStartElement(namespaceURI, localName);
+        writeEndElement();
+    }
+
+    public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        writeStartElement(prefix, localName, namespaceURI);
+        writeEndElement();
+    }
+
+    public void writeEndElement() throws XMLStreamException {
+        namespaceContext.popContext();
+
+        storeStructure(T_END);
+        if(--depth==0)
+            increaseTreeCount();
+    }
+
+    public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
+        storeNamespaceAttribute(null, namespaceURI);
+    }
+
+    public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
+        if ("xmlns".equals(prefix))
+            prefix = null;
+        storeNamespaceAttribute(prefix, namespaceURI);
+    }
+
+
+    public void writeAttribute(String localName, String value) throws XMLStreamException {
+        storeAttribute(null, null, localName, "CDATA", value);
+    }
+
+    public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
+        final String prefix = namespaceContext.getPrefix(namespaceURI);
+        if (prefix == null) {
+            // TODO
+            throw new XMLStreamException();
+        }
+
+        writeAttribute(prefix, namespaceURI, localName, value);
+    }
+
+    public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
+        storeAttribute(prefix, namespaceURI, localName, "CDATA", value);
+    }
+
+    public void writeCData(String data) throws XMLStreamException {
+        storeStructure(T_TEXT_AS_STRING);
+        storeContentString(data);
+    }
+
+    public void writeCharacters(String charData) throws XMLStreamException {
+        storeStructure(T_TEXT_AS_STRING);
+        storeContentString(charData);
+    }
+
+    public void writeCharacters(char[] buf, int start, int len) throws XMLStreamException {
+        storeContentCharacters(T_TEXT_AS_CHAR_ARRAY, buf, start, len);
+    }
+
+    public void writeComment(String str) throws XMLStreamException {
+        storeStructure(T_COMMENT_AS_STRING);
+        storeContentString(str);
+    }
+
+    public void writeDTD(String str) throws XMLStreamException {
+        // not support. just ignore.
+    }
+
+    public void writeEntityRef(String str) throws XMLStreamException {
+        storeStructure(T_UNEXPANDED_ENTITY_REFERENCE);
+        storeContentString(str);
+    }
+
+    public void writeProcessingInstruction(String target) throws XMLStreamException {
+        writeProcessingInstruction(target, "");
+    }
+
+    public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
+        storeProcessingInstruction(target, data);
+    }
+
+    // XMLStreamWriterEx
+
+    public void writePCDATA(CharSequence charSequence) throws XMLStreamException {
+        if (charSequence instanceof Base64Data) {
+            storeStructure(T_TEXT_AS_OBJECT);
+            storeContentObject(((Base64Data)charSequence).clone());
+        } else {
+            writeCharacters(charSequence.toString());
+        }
+    }
+
+    public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException {
+        Base64Data d = new Base64Data();
+        byte b[] = new byte[length];
+        System.arraycopy(bytes, offset, b, 0, length);
+        d.set(b, length, null, true);
+        storeStructure(T_TEXT_AS_OBJECT);
+        storeContentObject(d);
+    }
+
+    public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    public OutputStream writeBinary(String endpointURL) throws XMLStreamException {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java
new file mode 100644
index 0000000..5167649
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java
@@ -0,0 +1,464 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.stream.buffer.stax;
+
+import com.sun.xml.internal.stream.buffer.AbstractProcessor;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+
+/**
+ * A processor of a {@link XMLStreamBuffer} that writes the XML infoset to a
+ * {@link XMLStreamWriter}.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ * @author K.Venugopal@sun.com
+ */
+public class StreamWriterBufferProcessor extends AbstractProcessor {
+
+
+    public StreamWriterBufferProcessor() {
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #StreamWriterBufferProcessor(XMLStreamBuffer, boolean)}
+     */
+    public StreamWriterBufferProcessor(XMLStreamBuffer buffer) {
+        setXMLStreamBuffer(buffer,buffer.isFragment());
+    }
+
+    /**
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     */
+    public StreamWriterBufferProcessor(XMLStreamBuffer buffer,boolean produceFragmentEvent) {
+        setXMLStreamBuffer(buffer,produceFragmentEvent);
+    }
+
+    public final void process(XMLStreamBuffer buffer, XMLStreamWriter writer) throws XMLStreamException {
+        setXMLStreamBuffer(buffer,buffer.isFragment());
+        process(writer);
+    }
+
+    public void process(XMLStreamWriter writer) throws XMLStreamException {
+        if(_fragmentMode){
+            writeFragment(writer);
+        }else{
+            write(writer);
+        }
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #setXMLStreamBuffer(XMLStreamBuffer, boolean)}
+     */
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer) {
+        setBuffer(buffer);
+    }
+
+    /**
+     * @param produceFragmentEvent
+     *      True to generate fragment SAX events without start/endDocument.
+     *      False to generate a full document SAX events.
+     */
+    public void setXMLStreamBuffer(XMLStreamBuffer buffer, boolean produceFragmentEvent) {
+        setBuffer(buffer,produceFragmentEvent);
+    }
+
+    /**
+     * Writes a full XML infoset event to the given writer,
+     * including start/end document.
+     */
+    public void write(XMLStreamWriter writer) throws XMLStreamException{
+
+        if(!_fragmentMode) {
+            if(_treeCount>1)
+                throw new IllegalStateException("forest cannot be written as a full infoset");
+            writer.writeStartDocument();
+        }
+
+        // TODO: if we are writing a fragment XMLStreamBuffer as a full document,
+        // we need to put in-scope namespaces as top-level ns decls.
+
+        while(true) {
+            int item = _eiiStateTable[peekStructure()];
+            writer.flush();
+
+            switch(item) {
+                case STATE_DOCUMENT:
+                    readStructure(); //skip
+                    break;
+                case STATE_ELEMENT_U_LN_QN:
+                case STATE_ELEMENT_P_U_LN:
+                case STATE_ELEMENT_U_LN:
+                case STATE_ELEMENT_LN:
+                    writeFragment(writer);
+                    break;
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL: {
+                    readStructure();
+                    final int length = readStructure();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM: {
+                    readStructure();
+                    final int length = readStructure16();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY: {
+                    readStructure();
+                    final char[] ch = readContentCharactersCopy();
+                    writer.writeComment(new String(ch));
+                    break;
+                }
+                case STATE_PROCESSING_INSTRUCTION:
+                    readStructure();
+                    writer.writeProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                case STATE_END: // done
+                    readStructure();
+                    writer.writeEndDocument();
+                    return;
+                default:
+                    throw new XMLStreamException("Invalid State "+item);
+            }
+        }
+
+    }
+
+    /**
+     * Writes the buffer as a fragment, meaning
+     * the writer will not receive start/endDocument events.
+     *
+     * <p>
+     * If {@link XMLStreamBuffer} has a forest, this method will write all the forests.
+     */
+    public void writeFragment(XMLStreamWriter writer) throws XMLStreamException {
+        if (writer instanceof XMLStreamWriterEx) {
+            writeFragmentEx((XMLStreamWriterEx)writer);
+        } else {
+            writeFragmentNoEx(writer);
+        }
+    }
+
+    public void writeFragmentEx(XMLStreamWriterEx writer) throws XMLStreamException {
+        int depth = 0;  // used to determine when we are done with a tree.
+
+        int item = _eiiStateTable[peekStructure()];
+        if(item==STATE_DOCUMENT)
+            readStructure();    // skip STATE_DOCUMENT
+
+        do {
+
+            item = readEiiState();
+
+            switch(item) {
+                case STATE_DOCUMENT:
+                    throw new AssertionError();
+                case STATE_ELEMENT_U_LN_QN: {
+                    depth ++;
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    final String prefix = getPrefixFromQName(readStructureString());
+                    writer.writeStartElement(prefix,localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_P_U_LN: {
+                    depth ++;
+                    final String prefix = readStructureString();
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    writer.writeStartElement(prefix,localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_U_LN: {
+                    depth ++;
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    writer.writeStartElement("",localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_LN: {
+                    depth ++;
+                    final String localName = readStructureString();
+                    writer.writeStartElement(localName);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_SMALL: {
+                    final int length = readStructure();
+                    final int start = readContentCharactersBuffer(length);
+                    writer.writeCharacters(_contentCharactersBuffer,start,length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_MEDIUM: {
+                    final int length = readStructure16();
+                    final int start = readContentCharactersBuffer(length);
+                    writer.writeCharacters(_contentCharactersBuffer,start,length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_COPY: {
+                    char[] c = readContentCharactersCopy();
+                    writer.writeCharacters(c,0,c.length);
+                    break;
+                }
+                case STATE_TEXT_AS_STRING: {
+                    final String s = readContentString();
+                    writer.writeCharacters(s);
+                    break;
+                }
+                case STATE_TEXT_AS_OBJECT: {
+                    final CharSequence c = (CharSequence)readContentObject();
+                    writer.writePCDATA(c);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL: {
+                    final int length = readStructure();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM: {
+                    final int length = readStructure16();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY: {
+                    final char[] ch = readContentCharactersCopy();
+                    writer.writeComment(new String(ch));
+                    break;
+                }
+                case STATE_PROCESSING_INSTRUCTION:
+                    writer.writeProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                case STATE_END:
+                    writer.writeEndElement();
+                    depth --;
+                    if(depth==0)
+                        _treeCount--;
+                    break;
+                default:
+                    throw new XMLStreamException("Invalid State "+item);
+            }
+        } while(depth>0 || _treeCount>0);
+
+    }
+
+    public void writeFragmentNoEx(XMLStreamWriter writer) throws XMLStreamException {
+        int depth = 0;
+
+        int item = _eiiStateTable[peekStructure()];
+        if(item==STATE_DOCUMENT)
+            readStructure();    // skip STATE_DOCUMENT
+
+        do {
+            item = readEiiState();
+
+            switch(item) {
+                case STATE_DOCUMENT:
+                    throw new AssertionError();
+                case STATE_ELEMENT_U_LN_QN: {
+                    depth ++;
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    final String prefix = getPrefixFromQName(readStructureString());
+                    writer.writeStartElement(prefix,localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_P_U_LN: {
+                    depth ++;
+                    final String prefix = readStructureString();
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    writer.writeStartElement(prefix,localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_U_LN: {
+                    depth ++;
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    writer.writeStartElement("",localName,uri);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_ELEMENT_LN: {
+                    depth ++;
+                    final String localName = readStructureString();
+                    writer.writeStartElement(localName);
+                    writeAttributes(writer);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_SMALL: {
+                    final int length = readStructure();
+                    final int start = readContentCharactersBuffer(length);
+                    writer.writeCharacters(_contentCharactersBuffer,start,length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_MEDIUM: {
+                    final int length = readStructure16();
+                    final int start = readContentCharactersBuffer(length);
+                    writer.writeCharacters(_contentCharactersBuffer,start,length);
+                    break;
+                }
+                case STATE_TEXT_AS_CHAR_ARRAY_COPY: {
+                    char[] c = readContentCharactersCopy();
+                    writer.writeCharacters(c,0,c.length);
+                    break;
+                }
+                case STATE_TEXT_AS_STRING: {
+                    final String s = readContentString();
+                    writer.writeCharacters(s);
+                    break;
+                }
+                case STATE_TEXT_AS_OBJECT: {
+                    final CharSequence c = (CharSequence)readContentObject();
+                    writer.writeCharacters(c.toString());
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_SMALL: {
+                    final int length = readStructure();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM: {
+                    final int length = readStructure16();
+                    final int start = readContentCharactersBuffer(length);
+                    final String comment = new String(_contentCharactersBuffer, start, length);
+                    writer.writeComment(comment);
+                    break;
+                }
+                case STATE_COMMENT_AS_CHAR_ARRAY_COPY: {
+                    final char[] ch = readContentCharactersCopy();
+                    writer.writeComment(new String(ch));
+                    break;
+                }
+                case STATE_PROCESSING_INSTRUCTION:
+                    writer.writeProcessingInstruction(readStructureString(), readStructureString());
+                    break;
+                case STATE_END:
+                    writer.writeEndElement();
+                    depth --;
+                    if(depth==0)
+                        _treeCount--;
+                    break;
+                default:
+                    throw new XMLStreamException("Invalid State "+item);
+            }
+        } while(depth > 0 && _treeCount>0);
+
+    }
+
+    private void writeAttributes(XMLStreamWriter writer) throws XMLStreamException {
+        int item = peekStructure();
+        if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) {
+            // Skip the namespace declarations on the element
+            // they will have been added already
+            item = writeNamespaceAttributes(item, writer);
+        }
+        if ((item & TYPE_MASK) == T_ATTRIBUTE) {
+            writeAttributes(item, writer);
+        }
+    }
+
+    private int writeNamespaceAttributes(int item, XMLStreamWriter writer) throws XMLStreamException {
+        do {
+            switch(_niiStateTable[item]){
+                case STATE_NAMESPACE_ATTRIBUTE:
+                    // Undeclaration of default namespace
+                    writer.writeDefaultNamespace("");
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P:
+                    // Undeclaration of namespace
+                    // Declaration with prefix
+                    writer.writeNamespace(readStructureString(), "");
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_P_U:
+                    // Declaration with prefix
+                    writer.writeNamespace(readStructureString(), readStructureString());
+                    break;
+                case STATE_NAMESPACE_ATTRIBUTE_U:
+                    // Default declaration
+                    writer.writeDefaultNamespace(readStructureString());
+                    break;
+            }
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE);
+
+        return item;
+    }
+
+    private void writeAttributes(int item, XMLStreamWriter writer) throws XMLStreamException {
+        do {
+            switch(_aiiStateTable[item]) {
+                case STATE_ATTRIBUTE_U_LN_QN: {
+                    final String uri = readStructureString();
+                    final String localName = readStructureString();
+                    final String prefix = getPrefixFromQName(readStructureString());
+                    writer.writeAttribute(prefix,uri,localName,readContentString());
+                    break;
+                }
+                case STATE_ATTRIBUTE_P_U_LN:
+                    writer.writeAttribute(readStructureString(), readStructureString(),
+                            readStructureString(), readContentString());
+                    break;
+                case STATE_ATTRIBUTE_U_LN:
+                    writer.writeAttribute(readStructureString(), readStructureString(), readContentString());
+                    break;
+                case STATE_ATTRIBUTE_LN:
+                    writer.writeAttribute(readStructureString(), readContentString());
+                    break;
+            }
+            // Ignore the attribute type
+            readStructureString();
+
+            readStructure();
+
+            item = peekStructure();
+        } while((item & TYPE_MASK) == T_ATTRIBUTE);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Attribute.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Attribute.java
index 40f05db..23c67f3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Attribute.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Attribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Cdata.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Cdata.java
index e28fa76..dab6849 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Cdata.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Cdata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Comment.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Comment.java
index 95ae608..29ceb2d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Comment.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Comment.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContainerElement.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContainerElement.java
index d07d3ce..bc29730 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContainerElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContainerElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import com.sun.xml.internal.txw2.annotation.XmlAttribute;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Content.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Content.java
index 0be8c32..7294fbf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Content.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Content.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContentVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContentVisitor.java
index fc93d60..60859d7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContentVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/ContentVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java
index 3b6c350..c9e4b17 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Document.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Document.java
index e7bda23..a69a3d8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Document.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Document.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import com.sun.xml.internal.txw2.output.XmlSerializer;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndDocument.java
index 0402c56..3cd2e79 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndDocument.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndDocument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndTag.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndTag.java
index 34b3964..c60a920 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndTag.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/EndTag.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalAnnotationException.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalAnnotationException.java
index 5a02573..89f13ec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalAnnotationException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalAnnotationException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalSignatureException.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalSignatureException.java
index b714779..d315e7e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalSignatureException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/IllegalSignatureException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceDecl.java
index 48003a9..5595ce6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceResolver.java
index c182d2c..2a05a45 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java
index 8dd4c21..1564b2b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 // NamespaceSupport.java - generic Namespace support for SAX.
 // http://www.saxproject.org
 // Written by David Megginson
@@ -91,6 +92,7 @@
  *
  * @since SAX 2.0
  * @author David Megginson
+ * @version 2.0.1 (sax2r2)
  */
 final class NamespaceSupport
 {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Pcdata.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Pcdata.java
index c32eaa1..4321fdc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Pcdata.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Pcdata.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartDocument.java
index 56e659a..42a4602 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartDocument.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartDocument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartTag.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartTag.java
index f1642ca..6b95d60 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartTag.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/StartTag.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TXW.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TXW.java
index ae67641..c65accc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TXW.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TXW.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import com.sun.xml.internal.txw2.output.XmlSerializer;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Text.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Text.java
index 22558c1..49a5f07 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/Text.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/Text.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TxwException.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TxwException.java
index 7179d99..017f862 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TxwException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TxwException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TypedXmlWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TypedXmlWriter.java
index f2c984c..90aa954 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/TypedXmlWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/TypedXmlWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2;
 
 import com.sun.xml.internal.txw2.annotation.XmlElement;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlAttribute.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlAttribute.java
index 0a58a21..e28f1d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlAttribute.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlAttribute.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.annotation;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlCDATA.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlCDATA.java
index 9828095..21dfdf4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlCDATA.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlCDATA.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.annotation;
 
 import java.lang.annotation.Retention;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlElement.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlElement.java
index e7dc725..fea96cd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlElement.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlElement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.annotation;
 
 import com.sun.xml.internal.txw2.TypedXmlWriter;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlNamespace.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlNamespace.java
index 3602f3c..b33af40 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlNamespace.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlNamespace.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.annotation;
 
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java
index 071c441..915b6bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.annotation;
 
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/package.html b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/package.html
index de8b832..c136c29 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
   <p>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java
index e441cad..f71a44d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,8 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
+
 package com.sun.xml.internal.txw2.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java
index 27e0eeb..dbe80fe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 //@@3RD PARTY CODE@@
 
 // DataWriter.java - XML writer for data-oriented files.
@@ -91,6 +92,7 @@
  *
  * @since 1.0
  * @author David Megginson, david@megginson.com
+ * @version 0.2
  * @see XMLWriter
  */
 public class DataWriter extends XMLWriter
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DelegatingXMLStreamWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DelegatingXMLStreamWriter.java
new file mode 100644
index 0000000..4b4baa7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DelegatingXMLStreamWriter.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.txw2.output;
+
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ * Delegating {@link XMLStreamWriter}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class DelegatingXMLStreamWriter implements XMLStreamWriter {
+    private final XMLStreamWriter writer;
+
+    public DelegatingXMLStreamWriter(XMLStreamWriter writer) {
+        this.writer = writer;
+    }
+
+    public void writeStartElement(String localName) throws XMLStreamException {
+        writer.writeStartElement(localName);
+    }
+
+    public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+        writer.writeStartElement(namespaceURI, localName);
+    }
+
+    public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        writer.writeStartElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
+        writer.writeEmptyElement(namespaceURI, localName);
+    }
+
+    public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        writer.writeEmptyElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeEmptyElement(String localName) throws XMLStreamException {
+        writer.writeEmptyElement(localName);
+    }
+
+    public void writeEndElement() throws XMLStreamException {
+        writer.writeEndElement();
+    }
+
+    public void writeEndDocument() throws XMLStreamException {
+        writer.writeEndDocument();
+    }
+
+    public void close() throws XMLStreamException {
+        writer.close();
+    }
+
+    public void flush() throws XMLStreamException {
+        writer.flush();
+    }
+
+    public void writeAttribute(String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(localName, value);
+    }
+
+    public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(prefix, namespaceURI, localName, value);
+    }
+
+    public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(namespaceURI, localName, value);
+    }
+
+    public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
+        writer.writeNamespace(prefix, namespaceURI);
+    }
+
+    public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
+        writer.writeDefaultNamespace(namespaceURI);
+    }
+
+    public void writeComment(String data) throws XMLStreamException {
+        writer.writeComment(data);
+    }
+
+    public void writeProcessingInstruction(String target) throws XMLStreamException {
+        writer.writeProcessingInstruction(target);
+    }
+
+    public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
+        writer.writeProcessingInstruction(target, data);
+    }
+
+    public void writeCData(String data) throws XMLStreamException {
+        writer.writeCData(data);
+    }
+
+    public void writeDTD(String dtd) throws XMLStreamException {
+        writer.writeDTD(dtd);
+    }
+
+    public void writeEntityRef(String name) throws XMLStreamException {
+        writer.writeEntityRef(name);
+    }
+
+    public void writeStartDocument() throws XMLStreamException {
+        writer.writeStartDocument();
+    }
+
+    public void writeStartDocument(String version) throws XMLStreamException {
+        writer.writeStartDocument(version);
+    }
+
+    public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+        writer.writeStartDocument(encoding, version);
+    }
+
+    public void writeCharacters(String text) throws XMLStreamException {
+        writer.writeCharacters(text);
+    }
+
+    public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
+        writer.writeCharacters(text, start, len);
+    }
+
+    public String getPrefix(String uri) throws XMLStreamException {
+        return writer.getPrefix(uri);
+    }
+
+    public void setPrefix(String prefix, String uri) throws XMLStreamException {
+        writer.setPrefix(prefix, uri);
+    }
+
+    public void setDefaultNamespace(String uri) throws XMLStreamException {
+        writer.setDefaultNamespace(uri);
+    }
+
+    public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
+        writer.setNamespaceContext(context);
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        return writer.getNamespaceContext();
+    }
+
+    public Object getProperty(String name) throws IllegalArgumentException {
+        return writer.getProperty(name);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DomSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DomSerializer.java
index 8de932f..34e3c40 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DomSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DomSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import org.w3c.dom.Document;
@@ -55,7 +56,7 @@
 
     public DomSerializer(Node node) {
         Dom2SaxAdapter adapter = new Dom2SaxAdapter(node);
-        serializer = new SaxSerializer(adapter,adapter);
+        serializer = new SaxSerializer(adapter,adapter,false);
     }
 
     public DomSerializer(DOMResult domResult) {
@@ -68,12 +69,12 @@
                 DocumentBuilder db = dbf.newDocumentBuilder();
                 Document doc = db.newDocument();
                 domResult.setNode(doc);
-                serializer = new SaxSerializer(new Dom2SaxAdapter(doc));
+                serializer = new SaxSerializer(new Dom2SaxAdapter(doc),null,false);
             } catch (ParserConfigurationException pce) {
                 throw new TxwException(pce);
             }
         } else {
-            serializer = new SaxSerializer(new Dom2SaxAdapter(node));
+            serializer = new SaxSerializer(new Dom2SaxAdapter(node),null,false);
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java
index b887f7e..0ee526b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,8 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
+
 package com.sun.xml.internal.txw2.output;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumpSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumpSerializer.java
index 67bce07..1460613 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumpSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumpSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import java.io.PrintStream;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLFilter.java
new file mode 100644
index 0000000..b4e2640
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLFilter.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.txw2.output;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import java.util.Stack;
+
+/**
+ * {@link XMLFilterImpl} that does indentation to SAX events.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class IndentingXMLFilter extends XMLFilterImpl implements LexicalHandler {
+    private LexicalHandler lexical;
+
+    public IndentingXMLFilter() {
+    }
+
+    public IndentingXMLFilter(ContentHandler handler) {
+        setContentHandler(handler);
+    }
+
+    public IndentingXMLFilter(ContentHandler handler, LexicalHandler lexical) {
+        setContentHandler(handler);
+        setLexicalHandler(lexical);
+    }
+
+    public LexicalHandler getLexicalHandler() {
+        return lexical;
+    }
+
+    public void setLexicalHandler(LexicalHandler lexical) {
+        this.lexical = lexical;
+    }
+
+
+    /**
+     * Return the current indent step.
+     *
+     * <p>Return the current indent step: each start tag will be
+     * indented by this number of spaces times the number of
+     * ancestors that the element has.</p>
+     *
+     * @return The number of spaces in each indentation step,
+     *         or 0 or less for no indentation.
+     * @see #setIndentStep(int)
+     *
+     * @deprecated
+     *      Only return the length of the indent string.
+     */
+    public int getIndentStep ()
+    {
+        return indentStep.length();
+    }
+
+
+    /**
+     * Set the current indent step.
+     *
+     * @param indentStep The new indent step (0 or less for no
+     *        indentation).
+     * @see #getIndentStep()
+     *
+     * @deprecated
+     *      Should use the version that takes string.
+     */
+    public void setIndentStep (int indentStep)
+    {
+        StringBuilder s = new StringBuilder();
+        for( ; indentStep>0; indentStep-- )   s.append(' ');
+        setIndentStep(s.toString());
+    }
+
+    public void setIndentStep(String s) {
+        this.indentStep = s;
+    }
+
+
+
+    ////////////////////////////////////////////////////////////////////
+    // Override methods from XMLWriter.
+    ////////////////////////////////////////////////////////////////////
+
+    /**
+     * Write a start tag.
+     *
+     * <p>Each tag will begin on a new line, and will be
+     * indented by the current indent step times the number
+     * of ancestors that the element has.</p>
+     *
+     * <p>The newline and indentation will be passed on down
+     * the filter chain through regular characters events.</p>
+     *
+     * @param uri The element's Namespace URI.
+     * @param localName The element's local name.
+     * @param qName The element's qualified (prefixed) name.
+     * @param atts The element's attribute list.
+     * @exception org.xml.sax.SAXException If there is an error
+     *            writing the start tag, or if a filter further
+     *            down the chain raises an exception.
+     * @see XMLWriter#startElement(String, String, String,Attributes)
+     */
+    public void startElement (String uri, String localName,
+                              String qName, Attributes atts)
+        throws SAXException {
+        stateStack.push(SEEN_ELEMENT);
+        state = SEEN_NOTHING;
+        if (depth > 0) {
+            writeNewLine();
+        }
+        doIndent();
+        super.startElement(uri, localName, qName, atts);
+        depth++;
+    }
+
+    private void writeNewLine() throws SAXException {
+        super.characters(NEWLINE,0,NEWLINE.length);
+    }
+
+    private static final char[] NEWLINE = {'\n'};
+
+
+    /**
+     * Write an end tag.
+     *
+     * <p>If the element has contained other elements, the tag
+     * will appear indented on a new line; otherwise, it will
+     * appear immediately following whatever came before.</p>
+     *
+     * <p>The newline and indentation will be passed on down
+     * the filter chain through regular characters events.</p>
+     *
+     * @param uri The element's Namespace URI.
+     * @param localName The element's local name.
+     * @param qName The element's qualified (prefixed) name.
+     * @exception org.xml.sax.SAXException If there is an error
+     *            writing the end tag, or if a filter further
+     *            down the chain raises an exception.
+     * @see XMLWriter#endElement(String, String, String)
+     */
+    public void endElement (String uri, String localName, String qName)
+        throws SAXException
+    {
+        depth--;
+        if (state == SEEN_ELEMENT) {
+            writeNewLine();
+            doIndent();
+        }
+        super.endElement(uri, localName, qName);
+        state = stateStack.pop();
+    }
+
+
+//    /**
+//     * Write a empty element tag.
+//     *
+//     * <p>Each tag will appear on a new line, and will be
+//     * indented by the current indent step times the number
+//     * of ancestors that the element has.</p>
+//     *
+//     * <p>The newline and indentation will be passed on down
+//     * the filter chain through regular characters events.</p>
+//     *
+//     * @param uri The element's Namespace URI.
+//     * @param localName The element's local name.
+//     * @param qName The element's qualified (prefixed) name.
+//     * @param atts The element's attribute list.
+//     * @exception org.xml.sax.SAXException If there is an error
+//     *            writing the empty tag, or if a filter further
+//     *            down the chain raises an exception.
+//     * @see XMLWriter#emptyElement(String, String, String, Attributes)
+//     */
+//    public void emptyElement (String uri, String localName,
+//                              String qName, Attributes atts)
+//        throws SAXException
+//    {
+//        state = SEEN_ELEMENT;
+//        if (depth > 0) {
+//            super.characters("\n");
+//        }
+//        doIndent();
+//        super.emptyElement(uri, localName, qName, atts);
+//    }
+
+
+    /**
+     * Write a sequence of characters.
+     *
+     * @param ch The characters to write.
+     * @param start The starting position in the array.
+     * @param length The number of characters to use.
+     * @exception org.xml.sax.SAXException If there is an error
+     *            writing the characters, or if a filter further
+     *            down the chain raises an exception.
+     * @see XMLWriter#characters(char[], int, int)
+     */
+    public void characters (char ch[], int start, int length)
+        throws SAXException
+    {
+        state = SEEN_DATA;
+        super.characters(ch, start, length);
+    }
+
+    public void comment(char ch[], int start, int length) throws SAXException {
+        if (depth > 0) {
+            writeNewLine();
+        }
+        doIndent();
+        if(lexical!=null)
+            lexical.comment(ch,start,length);
+    }
+
+    public void startDTD(String name, String publicId, String systemId) throws SAXException {
+        if(lexical!=null)
+            lexical.startDTD(name, publicId, systemId);
+    }
+
+    public void endDTD() throws SAXException {
+        if(lexical!=null)
+            lexical.endDTD();
+    }
+
+    public void startEntity(String name) throws SAXException {
+        if(lexical!=null)
+            lexical.startEntity(name);
+    }
+
+    public void endEntity(String name) throws SAXException {
+        if(lexical!=null)
+            lexical.endEntity(name);
+    }
+
+    public void startCDATA() throws SAXException {
+        if(lexical!=null)
+            lexical.startCDATA();
+    }
+
+    public void endCDATA() throws SAXException {
+        if(lexical!=null)
+            lexical.endCDATA();
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    // Internal methods.
+    ////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Print indentation for the current level.
+     *
+     * @exception org.xml.sax.SAXException If there is an error
+     *            writing the indentation characters, or if a filter
+     *            further down the chain raises an exception.
+     */
+    private void doIndent ()
+        throws SAXException
+    {
+        if (depth > 0) {
+            char[] ch = indentStep.toCharArray();
+            for( int i=0; i<depth; i++ )
+                characters(ch, 0, ch.length);
+        }
+    }
+
+
+    ////////////////////////////////////////////////////////////////////
+    // Constants.
+    ////////////////////////////////////////////////////////////////////
+
+    private final static Object SEEN_NOTHING = new Object();
+    private final static Object SEEN_ELEMENT = new Object();
+    private final static Object SEEN_DATA = new Object();
+
+
+    ////////////////////////////////////////////////////////////////////
+    // Internal state.
+    ////////////////////////////////////////////////////////////////////
+
+    private Object state = SEEN_NOTHING;
+    private Stack<Object> stateStack = new Stack<Object>();
+
+    private String indentStep = "";
+    private int depth = 0;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLStreamWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLStreamWriter.java
new file mode 100644
index 0000000..5114410
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLStreamWriter.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.txw2.output;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.util.Stack;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public class IndentingXMLStreamWriter extends DelegatingXMLStreamWriter {
+    private final static Object SEEN_NOTHING = new Object();
+    private final static Object SEEN_ELEMENT = new Object();
+    private final static Object SEEN_DATA = new Object();
+
+    private Object state = SEEN_NOTHING;
+    private Stack<Object> stateStack = new Stack<Object>();
+
+    private String indentStep = "  ";
+    private int depth = 0;
+
+    public IndentingXMLStreamWriter(XMLStreamWriter writer) {
+        super(writer);
+    }
+
+    /**
+     * Return the current indent step.
+     *
+     * <p>Return the current indent step: each start tag will be
+     * indented by this number of spaces times the number of
+     * ancestors that the element has.</p>
+     *
+     * @return The number of spaces in each indentation step,
+     *         or 0 or less for no indentation.
+     * @see #setIndentStep(int)
+     *
+     * @deprecated
+     *      Only return the length of the indent string.
+     */
+    public int getIndentStep() {
+        return indentStep.length();
+    }
+
+
+    /**
+     * Set the current indent step.
+     *
+     * @param indentStep The new indent step (0 or less for no
+     *        indentation).
+     * @see #getIndentStep()
+     *
+     * @deprecated
+     *      Should use the version that takes string.
+     */
+    public void setIndentStep(int indentStep) {
+        StringBuilder s = new StringBuilder();
+        for (; indentStep > 0; indentStep--) s.append(' ');
+        setIndentStep(s.toString());
+    }
+
+    public void setIndentStep(String s) {
+        this.indentStep = s;
+    }
+
+    private void onStartElement() throws XMLStreamException {
+        stateStack.push(SEEN_ELEMENT);
+        state = SEEN_NOTHING;
+        if (depth > 0) {
+            super.writeCharacters("\n");
+        }
+        doIndent();
+        depth++;
+    }
+
+    private void onEndElement() throws XMLStreamException {
+        depth--;
+        if (state == SEEN_ELEMENT) {
+            super.writeCharacters("\n");
+            doIndent();
+        }
+        state = stateStack.pop();
+    }
+
+    private void onEmptyElement() throws XMLStreamException {
+        state = SEEN_ELEMENT;
+        if (depth > 0) {
+            super.writeCharacters("\n");
+        }
+        doIndent();
+    }
+
+    /**
+     * Print indentation for the current level.
+     *
+     * @exception org.xml.sax.SAXException If there is an error
+     *            writing the indentation characters, or if a filter
+     *            further down the chain raises an exception.
+     */
+    private void doIndent() throws XMLStreamException {
+        if (depth > 0) {
+            for (int i = 0; i < depth; i++)
+                super.writeCharacters(indentStep);
+        }
+    }
+
+
+    public void writeStartDocument() throws XMLStreamException {
+        super.writeStartDocument();
+        super.writeCharacters("\n");
+    }
+
+    public void writeStartDocument(String version) throws XMLStreamException {
+        super.writeStartDocument(version);
+        super.writeCharacters("\n");
+    }
+
+    public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+        super.writeStartDocument(encoding, version);
+        super.writeCharacters("\n");
+    }
+
+    public void writeStartElement(String localName) throws XMLStreamException {
+        onStartElement();
+        super.writeStartElement(localName);
+    }
+
+    public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+        onStartElement();
+        super.writeStartElement(namespaceURI, localName);
+    }
+
+    public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        onStartElement();
+        super.writeStartElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
+        onEmptyElement();
+        super.writeEmptyElement(namespaceURI, localName);
+    }
+
+    public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        onEmptyElement();
+        super.writeEmptyElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeEmptyElement(String localName) throws XMLStreamException {
+        onEmptyElement();
+        super.writeEmptyElement(localName);
+    }
+
+    public void writeEndElement() throws XMLStreamException {
+        onEndElement();
+        super.writeEndElement();
+    }
+
+    public void writeCharacters(String text) throws XMLStreamException {
+        state = SEEN_DATA;
+        super.writeCharacters(text);
+    }
+
+    public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
+        state = SEEN_DATA;
+        super.writeCharacters(text, start, len);
+    }
+
+    public void writeCData(String data) throws XMLStreamException {
+        state = SEEN_DATA;
+        super.writeCData(data);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java
index 9b2bb48..0dd7889 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import javax.xml.transform.Result;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/SaxSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/SaxSerializer.java
index 570cd0d..106d1c3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/SaxSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/SaxSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import com.sun.xml.internal.txw2.TxwException;
@@ -44,7 +45,7 @@
     private final LexicalHandler lexical;
 
     public SaxSerializer(ContentHandler handler) {
-        this(handler,null);
+        this(handler,null,true);
     }
 
     /**
@@ -55,8 +56,18 @@
      * to write comments and CDATA sections.
      */
     public SaxSerializer(ContentHandler handler,LexicalHandler lex) {
-        writer = handler;
-        lexical = lex;
+        this(handler, lex, true);
+    }
+
+    public SaxSerializer(ContentHandler handler,LexicalHandler lex, boolean indenting) {
+        if(!indenting) {
+            writer = handler;
+            lexical = lex;
+        } else {
+            IndentingXMLFilter indenter = new IndentingXMLFilter(handler, lex);
+            writer = indenter;
+            lexical = indenter;
+        }
     }
 
     public SaxSerializer(SAXResult result) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StaxSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StaxSerializer.java
index 4b6c821..d8d34a5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StaxSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StaxSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import com.sun.xml.internal.txw2.TxwException;
@@ -41,6 +42,12 @@
     private final XMLStreamWriter out;
 
     public StaxSerializer(XMLStreamWriter writer) {
+        this(writer,true);
+    }
+
+    public StaxSerializer(XMLStreamWriter writer, boolean indenting) {
+        if(indenting)
+            writer = new IndentingXMLStreamWriter(writer);
         this.out = writer;
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StreamSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StreamSerializer.java
index 601fafb..0370870 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StreamSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/StreamSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.txw2.output;
 
 import com.sun.xml.internal.txw2.TxwException;
@@ -83,7 +84,7 @@
             throw new IllegalArgumentException();
 
         // now delegate to the SaxSerializer
-        serializer = new SaxSerializer(writer,writer) {
+        serializer = new SaxSerializer(writer,writer,false) {
             public void endDocument() {
                 super.endDocument();
                 if(autoClose[0]!=null) {
@@ -101,7 +102,7 @@
     private StreamSerializer(XMLWriter writer) {
         this.writer = writer;
         // now delegate to the SaxSerializer
-        serializer = new SaxSerializer(writer,writer);
+        serializer = new SaxSerializer(writer,writer,false);
     }
 
     private String convertURL(String url) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java
index bdbf0ec..f131512 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,6 +22,7 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 // @@3RD PARTY CODE@@
 
 // XMLWriter.java - serialize an XML document.
@@ -260,6 +261,7 @@
  * character data.</p>
  *
  * @author David Megginson, david@megginson.com
+ * @version 0.2
  * @since JAXB1.0
  * @see org.xml.sax.XMLFilter
  * @see org.xml.sax.ContentHandler
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XmlSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XmlSerializer.java
index 644d443..f1de6ab 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XmlSerializer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XmlSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/package.html b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/package.html
index f6c3b6c..7008cef 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
   <p>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/txw2/package.html b/jaxws/src/share/classes/com/sun/xml/internal/txw2/package.html
index 9340078..2c55871 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/txw2/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/txw2/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
   <p>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/Closeable.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/Closeable.java
new file mode 100644
index 0000000..3a003c7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/Closeable.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.Dispatch;
+import java.io.IOException;
+
+/**
+ * Closeable JAX-WS proxy object.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAX-WS 2.0.2
+ */
+// this interface is exposed to applications.
+public interface Closeable extends java.io.Closeable {
+    /**
+     * Closes this object and cleans up any resources
+     * it holds, such as network connections.
+     *
+     * <p>
+     * This interface is implemented by a port proxy
+     * or {@link Dispatch}. In particular, this signals
+     * the implementation of certain specs (like WS-ReliableMessaging
+     * and WS-SecureConversation) to terminate sessions that they
+     * create during the life time of a proxy object.
+     *
+     * <p>
+     * This is not a mandatory operation, so the application
+     * does not have to call this method.
+     *
+     *
+     * @throws WebServiceException
+     *      If clean up fails unexpectedly, this exception
+     *      will be thrown (instead of {@link IOException}.
+     */
+    public void close() throws WebServiceException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java
new file mode 100644
index 0000000..7f042f0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferSource;
+import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferCreator;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants;
+import org.w3c.dom.*;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Rama Pulavarthi
+ */
+
+public class EndpointReferenceUtil {
+    /**
+     * Gives the EPR based on the clazz. It may need to perform tranformation from
+     * W3C EPR to MS EPR or vise-versa.
+     */
+    public static <T extends EndpointReference> T transform(Class<T> clazz, @NotNull EndpointReference epr) {
+        assert epr != null;
+        if (clazz.isAssignableFrom(W3CEndpointReference.class)) {
+            if (epr instanceof W3CEndpointReference) {
+                return (T) epr;
+            } else if (epr instanceof MemberSubmissionEndpointReference) {
+                return (T) toW3CEpr((MemberSubmissionEndpointReference) epr);
+            }
+        } else if (clazz.isAssignableFrom(MemberSubmissionEndpointReference.class)) {
+            if (epr instanceof W3CEndpointReference) {
+                return (T) toMSEpr((W3CEndpointReference) epr);
+            } else if (epr instanceof MemberSubmissionEndpointReference) {
+                return (T) epr;
+            }
+        }
+
+        //This must be an EPR that we dont know
+        throw new WebServiceException("Unknwon EndpointReference: " + epr.getClass());
+    }
+
+    //TODO: bit of redundency on writes of w3c epr, should modularize it
+    private static W3CEndpointReference toW3CEpr(MemberSubmissionEndpointReference msEpr) {
+        StreamWriterBufferCreator writer = new StreamWriterBufferCreator();
+        w3cMetadataWritten = false;
+        try {
+            writer.writeStartDocument();
+            writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
+                    "EndpointReference", AddressingVersion.W3C.nsUri);
+            writer.writeNamespace(AddressingVersion.W3C.getPrefix(),
+                    AddressingVersion.W3C.nsUri);
+            //write wsa:Address
+            writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
+                    W3CAddressingConstants.WSA_ADDRESS_NAME, AddressingVersion.W3C.nsUri);
+            writer.writeCharacters(msEpr.addr.uri);
+            writer.writeEndElement();
+            //TODO: write extension attributes on wsa:Address
+            if ((msEpr.referenceProperties != null && msEpr.referenceProperties.elements.size() > 0) ||
+                    (msEpr.referenceParameters != null && msEpr.referenceParameters.elements.size() > 0)) {
+
+                writer.writeStartElement(AddressingVersion.W3C.getPrefix(), "ReferenceParameters", AddressingVersion.W3C.nsUri);
+
+                //write ReferenceProperties
+                if (msEpr.referenceProperties != null) {
+                    for (Element e : msEpr.referenceProperties.elements) {
+                        DOMUtil.serializeNode(e, writer);
+                    }
+                }
+                //write referenceParameters
+                if (msEpr.referenceParameters != null) {
+                    for (Element e : msEpr.referenceParameters.elements) {
+                        DOMUtil.serializeNode(e, writer);
+                    }
+                }
+                writer.writeEndElement();
+            }
+            // Supress writing ServiceName and EndpointName in W3CEPR,
+            // Until the ns for those metadata elements is resolved.
+            /*
+            //Write Interface info
+            if (msEpr.portTypeName != null) {
+                writeW3CMetadata(writer);
+                writer.writeStartElement(AddressingVersion.W3C.getWsdlPrefix(),
+                        W3CAddressingConstants.WSAW_INTERFACENAME_NAME,
+                        AddressingVersion.W3C.wsdlNsUri);
+                writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
+                        AddressingVersion.W3C.wsdlNsUri);
+                String portTypePrefix = fixNull(msEpr.portTypeName.name.getPrefix());
+                writer.writeNamespace(portTypePrefix, msEpr.portTypeName.name.getNamespaceURI());
+                if (portTypePrefix.equals(""))
+                    writer.writeCharacters(msEpr.portTypeName.name.getLocalPart());
+                else
+                    writer.writeCharacters(portTypePrefix + ":" + msEpr.portTypeName.name.getLocalPart());
+                writer.writeEndElement();
+            }
+            if (msEpr.serviceName != null) {
+                writeW3CMetadata(writer);
+                //Write service and Port info
+                writer.writeStartElement(AddressingVersion.W3C.getWsdlPrefix(),
+                        W3CAddressingConstants.WSAW_SERVICENAME_NAME,
+                        AddressingVersion.W3C.wsdlNsUri);
+                writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
+                        AddressingVersion.W3C.wsdlNsUri);
+
+                String servicePrefix = fixNull(msEpr.serviceName.name.getPrefix());
+                if (msEpr.serviceName.portName != null)
+                    writer.writeAttribute(W3CAddressingConstants.WSAW_ENDPOINTNAME_NAME,
+                            msEpr.serviceName.portName);
+
+                writer.writeNamespace(servicePrefix, msEpr.serviceName.name.getNamespaceURI());
+                if (servicePrefix.length() > 0)
+                    writer.writeCharacters(servicePrefix + ":" + msEpr.serviceName.name.getLocalPart());
+                else
+                    writer.writeCharacters(msEpr.serviceName.name.getLocalPart());
+                writer.writeEndElement();
+            }
+            */
+            //TODO: revisit this
+            Element wsdlElement = null;
+            //Check for wsdl in extension elements
+            if ((msEpr.elements != null) && (msEpr.elements.size() > 0)) {
+                for (Element e : msEpr.elements) {
+                    if(e.getNamespaceURI().equals(MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI()) &&
+                            e.getLocalName().equals(MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart())) {
+                        NodeList nl = e.getElementsByTagNameNS(WSDLConstants.NS_WSDL,
+                                WSDLConstants.QNAME_DEFINITIONS.getLocalPart());
+                        if(nl != null)
+                            wsdlElement = (Element) nl.item(0);
+                    }
+                }
+            }
+            //write WSDL
+            if (wsdlElement != null) {
+                DOMUtil.serializeNode(wsdlElement, writer);
+            }
+
+            if (w3cMetadataWritten)
+                writer.writeEndElement();
+            //TODO revisit this
+            //write extension elements
+            if ((msEpr.elements != null) && (msEpr.elements.size() > 0)) {
+                for (Element e : msEpr.elements) {
+                    if (e.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
+                            e.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
+                        // Don't write it as this is written already in Metadata
+                    }
+                    DOMUtil.serializeNode(e, writer);
+                }
+            }
+
+            //TODO:write extension attributes
+
+            //</EndpointReference>
+            writer.writeEndElement();
+            writer.writeEndDocument();
+            writer.flush();
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+        return new W3CEndpointReference(new XMLStreamBufferSource(writer.getXMLStreamBuffer()));
+    }
+
+    private static boolean w3cMetadataWritten = false;
+
+    private static void writeW3CMetadata(StreamWriterBufferCreator writer) throws XMLStreamException {
+        if (!w3cMetadataWritten) {
+            writer.writeStartElement(AddressingVersion.W3C.getPrefix(), W3CAddressingConstants.WSA_METADATA_NAME, AddressingVersion.W3C.nsUri);
+            w3cMetadataWritten = true;
+        }
+    }
+
+    private static MemberSubmissionEndpointReference toMSEpr(W3CEndpointReference w3cEpr) {
+        DOMResult result = new DOMResult();
+        w3cEpr.writeTo(result);
+        Node eprNode = result.getNode();
+        Element e = DOMUtil.getFirstElementChild(eprNode);
+        if (e == null)
+            return null;
+
+        MemberSubmissionEndpointReference msEpr = new MemberSubmissionEndpointReference();
+
+        NodeList nodes = e.getChildNodes();
+        for (int i = 0; i < nodes.getLength(); i++) {
+            if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) {
+                Element child = (Element) nodes.item(i);
+                if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) &&
+                        child.getLocalName().equals(W3CAddressingConstants.WSA_ADDRESS_NAME)) {
+                    if (msEpr.addr == null)
+                        msEpr.addr = new MemberSubmissionEndpointReference.Address();
+                    msEpr.addr.uri = XmlUtil.getTextForNode(child);
+
+                    //now add the attribute extensions
+                    msEpr.addr.attributes = getAttributes(child);
+                } else if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) &&
+                        child.getLocalName().equals("ReferenceParameters")) {
+                    NodeList refParams = child.getChildNodes();
+                    for (int j = 0; j < refParams.getLength(); j++) {
+                        if (refParams.item(j).getNodeType() == Node.ELEMENT_NODE) {
+                            if (msEpr.referenceParameters == null) {
+                                msEpr.referenceParameters = new MemberSubmissionEndpointReference.Elements();
+                                msEpr.referenceParameters.elements = new ArrayList<Element>();
+                            }
+                            msEpr.referenceParameters.elements.add((Element) refParams.item(i));
+                        }
+                    }
+                } else if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) &&
+                        child.getLocalName().equals(W3CAddressingConstants.WSA_METADATA_NAME)) {
+                    NodeList metadata = child.getChildNodes();
+                    for (int j = 0; j < metadata.getLength(); j++) {
+                        Node node = metadata.item(j);
+                        if (node.getNodeType() != Node.ELEMENT_NODE)
+                            continue;
+
+                        Element elm = (Element) node;
+                        if (elm.getNamespaceURI().equals(AddressingVersion.W3C.wsdlNsUri) &&
+                                elm.getLocalName().equals(W3CAddressingConstants.WSAW_SERVICENAME_NAME)) {
+                            msEpr.serviceName = new MemberSubmissionEndpointReference.ServiceNameType();
+                            msEpr.serviceName.portName = elm.getAttribute(W3CAddressingConstants.WSAW_ENDPOINTNAME_NAME);
+
+                            String service = elm.getTextContent();
+                            String prefix = XmlUtil.getPrefix(service);
+                            String name = XmlUtil.getLocalPart(service);
+
+                            //if there is no service name then its not a valid EPR but lets continue as its optional anyway
+                            if (name == null)
+                                continue;
+
+                            if (prefix != null) {
+                                String ns = elm.lookupNamespaceURI(prefix);
+                                if (ns != null)
+                                    msEpr.serviceName.name = new QName(ns, name, prefix);
+                            } else {
+                                msEpr.serviceName.name = new QName(null, name);
+                            }
+                            msEpr.serviceName.attributes = getAttributes(elm);
+                        } else if (elm.getNamespaceURI().equals(AddressingVersion.W3C.wsdlNsUri) &&
+                                elm.getLocalName().equals(W3CAddressingConstants.WSAW_INTERFACENAME_NAME)) {
+                            msEpr.portTypeName = new MemberSubmissionEndpointReference.AttributedQName();
+
+                            String portType = elm.getTextContent();
+                            String prefix = XmlUtil.getPrefix(portType);
+                            String name = XmlUtil.getLocalPart(portType);
+
+                            //if there is no portType name then its not a valid EPR but lets continue as its optional anyway
+                            if (name == null)
+                                continue;
+
+                            if (prefix != null) {
+                                String ns = elm.lookupNamespaceURI(prefix);
+                                if (ns != null)
+                                    msEpr.portTypeName.name = new QName(ns, name, prefix);
+                            } else {
+                                msEpr.portTypeName.name = new QName(null, name);
+                            }
+                            msEpr.portTypeName.attributes = getAttributes(elm);
+                        } else if(elm.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
+                                elm.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
+                            Document doc = DOMUtil.createDom();
+                            Element mexEl = doc.createElementNS(MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI(),
+                                    MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix()+":"
+                                            +MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart());
+                            Element metadataEl = doc.createElementNS(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI(),
+                                    MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix()+":"
+                                            +MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart());
+                            metadataEl.setAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
+                                    MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);
+                            metadataEl.appendChild(elm);
+                            mexEl.appendChild(metadataEl);
+
+                        } else {
+                            //TODO : Revisit this
+                            //its extensions in META-DATA and should be copied to extensions in MS EPR
+                            if (msEpr.elements == null) {
+                                msEpr.elements = new ArrayList<Element>();
+                            }
+                            msEpr.elements.add(elm);
+                        }
+                    }
+                } else {
+                    //its extensions
+                    if (msEpr.elements == null) {
+                        msEpr.elements = new ArrayList<Element>();
+                    }
+                    msEpr.elements.add((Element) child);
+
+                }
+            } else if (nodes.item(i).getNodeType() == Node.ATTRIBUTE_NODE) {
+                Node n = nodes.item(i);
+                if (msEpr.attributes == null) {
+                    msEpr.attributes = new HashMap<QName, String>();
+                    String prefix = fixNull(n.getPrefix());
+                    String ns = fixNull(n.getNamespaceURI());
+                    String localName = n.getLocalName();
+                    msEpr.attributes.put(new QName(ns, localName, prefix), n.getNodeValue());
+                }
+            }
+        }
+
+        return msEpr;
+    }
+
+    private static Map<QName, String> getAttributes(Node node) {
+        Map<QName, String> attribs = null;
+
+        NamedNodeMap nm = node.getAttributes();
+        for (int i = 0; i < nm.getLength(); i++) {
+            if (attribs == null)
+                attribs = new HashMap<QName, String>();
+            Node n = nm.item(i);
+            String prefix = fixNull(n.getPrefix());
+            String ns = fixNull(n.getNamespaceURI());
+            String localName = n.getLocalName();
+            if (prefix.equals("xmlns") || prefix.length() == 0 && localName.equals("xmlns"))
+                continue;
+
+            //exclude some attributes
+            if (!localName.equals(W3CAddressingConstants.WSAW_ENDPOINTNAME_NAME))
+                attribs.put(new QName(ns, localName, prefix), n.getNodeValue());
+        }
+        return attribs;
+    }
+
+    private static
+    @NotNull
+    String fixNull(@Nullable String s) {
+        if (s == null) return "";
+        else return s;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemAction.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemAction.java
new file mode 100644
index 0000000..dc15556
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemAction.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+
+/**
+ * @author Arun Gupta
+ */
+@XmlRootElement(name="ProblemAction", namespace= W3CAddressingConstants.WSA_NAMESPACE_NAME)
+public class ProblemAction {
+
+    @XmlElement(name="Action", namespace=W3CAddressingConstants.WSA_NAMESPACE_NAME)
+    private String action;
+
+    @XmlElement(name="SoapAction", namespace=W3CAddressingConstants.WSA_NAMESPACE_NAME)
+    private String soapAction;
+
+    /** Creates a new instance of ProblemAction */
+    public ProblemAction() {
+    }
+
+    public ProblemAction(String action) {
+        this.action = action;
+    }
+
+    public ProblemAction(String action, String soapAction) {
+        this.action = action;
+        this.soapAction = soapAction;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public String getSoapAction() {
+        return soapAction;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java
new file mode 100644
index 0000000..17a8128
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.WSA_NAMESPACE_NAME;
+
+/**
+ * @author Arun Gupta
+ */
+@XmlRootElement(name="ProblemHeaderQName", namespace= WSA_NAMESPACE_NAME)
+public class ProblemHeaderQName {
+    @XmlValue
+    private QName value;
+
+    /** Creates a new instance of ProblemHeaderQName */
+    public ProblemHeaderQName() {
+    }
+
+    public ProblemHeaderQName(QName name) {
+        this.value = name;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/W3CAddressingConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/W3CAddressingConstants.java
new file mode 100644
index 0000000..44b0981
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/W3CAddressingConstants.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import javax.xml.namespace.QName;
+
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+
+/**
+ * Constants for W3C WS-Addressing version
+ *
+ * @author Arun Gupta
+ */
+public interface W3CAddressingConstants {
+    public static final String WSA_NAMESPACE_NAME = "http://www.w3.org/2005/08/addressing";
+    public static final String WSA_NAMESPACE_WSDL_NAME = "http://www.w3.org/2006/05/addressing/wsdl";
+
+    public static final String WSAW_SERVICENAME_NAME = "ServiceName";
+    public static final String WSAW_INTERFACENAME_NAME = "InterfaceName";
+    public static final String WSAW_ENDPOINTNAME_NAME = "EndpointName";
+
+    public static final String WSA_REFERENCEPROPERTIES_NAME = "ReferenceParameters";
+    public static final QName WSA_REFERENCEPROPERTIES_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPROPERTIES_NAME);
+
+    public static final String WSA_REFERENCEPARAMETERS_NAME = "ReferenceParameters";
+    public static final QName WSA_REFERENCEPARAMETERS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_REFERENCEPARAMETERS_NAME);
+
+    public static final String WSA_METADATA_NAME = "Metadata";
+    public static final QName WSA_METADATA_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_METADATA_NAME);
+
+    public static final String WSA_ADDRESS_NAME = "Address";
+    public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME);
+
+    public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/anonymous";
+    public static final String WSA_NONE_ADDRESS = WSA_NAMESPACE_NAME + "/none";
+
+    public static final String WSA_DEFAULT_FAULT_ACTION = WSA_NAMESPACE_NAME + "/fault";
+
+    public static final String WSAW_USING_ADDRESSING_NAME = "UsingAddressing";
+    public static final QName WSAW_USING_ADDRESSING_QNAME = new QName(WSA_NAMESPACE_WSDL_NAME, WSAW_USING_ADDRESSING_NAME);
+
+    public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidAddressingHeader");
+    public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageAddressingHeaderRequired");
+    public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable");
+    public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported");
+    public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable");
+
+    public static final String ACTION_NOT_SUPPORTED_TEXT = "The \"%s\" cannot be processed at the receiver";
+    public static final String DESTINATION_UNREACHABLE_TEXT = "No route can be determined to reach %s";
+    public static final String ENDPOINT_UNAVAILABLE_TEXT = "The endpoint is unable to process the message at this time";
+    public static final String INVALID_MAP_TEXT = "A header representing a Message Addressing Property is not valid and the message cannot be processed";
+    public static final String MAP_REQUIRED_TEXT = "A required header representing a Message Addressing Property is not present";
+
+    public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction");
+    public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName");
+    public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail");
+
+    // Fault subsubcode when an invalid address is specified.
+    public static final QName INVALID_ADDRESS_SUBCODE = new QName(WSA_NAMESPACE_NAME, "InvalidAddress",
+                                                                  AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when an invalid header was expected to be EndpointReference but was not valid.
+    public static final QName INVALID_EPR = new QName(WSA_NAMESPACE_NAME, "InvalidEPR", AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when greater than expected number of the specified header is received.
+    public static final QName INVALID_CARDINALITY = new QName(WSA_NAMESPACE_NAME, "InvalidCardinality",
+                                                              AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when an invalid header was expected to be EndpointReference but did not contain address.
+    public static final QName MISSING_ADDRESS_IN_EPR = new QName(WSA_NAMESPACE_NAME, "MissingAddressInEPR",
+                                                                 AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when a header contains a message id that was a duplicate of one already received.
+    public static final QName DUPLICATE_MESSAGEID = new QName(WSA_NAMESPACE_NAME, "DuplicateMessageID",
+                                                              AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when <code>Action</code> and <code>SOAPAction</code> for the mesage did not match.
+    public static final QName ACTION_MISMATCH = new QName(WSA_NAMESPACE_NAME, "ActionMismatch",
+                                                          AddressingVersion.W3C.getPrefix());
+
+    // Fault subsubcode when the only address supported is the anonymous address.
+    public static final QName ONLY_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyAnonymousAddressSupported",
+                                                                           AddressingVersion.W3C.getPrefix());
+
+    //Fault subsubcode when anonymous address is not supported.
+    public static final QName ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED = new QName(WSA_NAMESPACE_NAME, "OnlyNonAnonymousAddressSupported",
+                                                                               AddressingVersion.W3C.getPrefix());
+
+    public static final String ANONYMOUS_EPR = "<EndpointReference xmlns=\"http://www.w3.org/2005/08/addressing\">\n" +
+            "    <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>\n" +
+            "</EndpointReference>";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java
new file mode 100644
index 0000000..11714a5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.addressing.model.ActionNotSupportedException;
+import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * WsaClientTube appears in the Tubeline only if addressing is enabled.
+ * This tube checks the validity of addressing headers in the incoming messages
+ * based on the WSDL model.
+ *
+ * @author Arun Gupta
+ */
+public final class WsaClientTube extends WsaTube {
+    public WsaClientTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
+        super(wsdlPort, binding, next);
+    }
+
+    public WsaClientTube(WsaClientTube that, TubeCloner cloner) {
+        super(that, cloner);
+    }
+
+    public WsaClientTube copy(TubeCloner cloner) {
+        return new WsaClientTube(this, cloner);
+    }
+
+    public @NotNull NextAction processRequest(Packet request) {
+        return doInvoke(next,request);
+   }
+
+    public @NotNull NextAction processResponse(Packet response) {
+        // if one-way then, no validation
+        if (response.getMessage() != null)
+            response = validateInboundHeaders(response);
+
+        return doReturnWith(response);
+    }
+
+
+    @Override
+    public void validateAction(Packet packet) {
+        //There may not be a WSDL operation.  There may not even be a WSDL.
+        //For instance this may be a RM CreateSequence message.
+        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+
+        if (wbo == null)    return;
+
+        String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
+        if (gotA == null)
+            throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION());
+
+        String expected = helper.getOutputAction(packet);
+
+        if (expected != null && !gotA.equals(expected))
+            throw new ActionNotSupportedException(gotA);
+    }
+
+    @Override
+    protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageID, boolean foundRelatesTo) {
+        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageID, foundRelatesTo);
+
+//        if(!foundRelatesTo)
+//            // RelatesTo required as per
+//            // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse
+//            throw new MapRequiredException(addressingVersion.relatesToTag);
+
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java
new file mode 100644
index 0000000..901ce3f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java
@@ -0,0 +1,353 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import com.sun.istack.internal.NotNull;
+import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_ANONYMOUS_ADDRESS_SUPPORTED;
+import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED;
+import com.sun.xml.internal.ws.addressing.model.ActionNotSupportedException;
+import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.TransportTubeFactory;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.message.FaultDetailHeader;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceException;
+import java.net.URI;
+import java.util.logging.Logger;
+
+/**
+ * Handles WS-Addressing for the server.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Arun Gupta
+ */
+public final class WsaServerTube extends WsaTube {
+
+    // store the replyTo/faultTo of the message currently being processed.
+    // both will be set to non-null in processRequest
+    private WSEndpointReference replyTo;
+    private WSEndpointReference faultTo;
+    private boolean isAnonymousRequired = false;
+    /**
+     * WSDLBoundOperation calculated on the Request payload.
+     * Used for determining ReplyTo or Fault Action for non-anonymous responses     *
+     */
+    private WSDLBoundOperation wbo;
+    public WsaServerTube(@NotNull WSDLPort wsdlPort, WSBinding binding, Tube next) {
+        super(wsdlPort, binding, next);
+    }
+
+    public WsaServerTube(WsaServerTube that, TubeCloner cloner) {
+        super(that, cloner);
+    }
+
+    public WsaServerTube copy(TubeCloner cloner) {
+        return new WsaServerTube(this, cloner);
+    }
+
+    public @NotNull NextAction processRequest(Packet request) {
+        Message msg = request.getMessage();
+        if(msg==null)   return doInvoke(next,request); // hmm?
+
+
+        // Store request ReplyTo and FaultTo in requestPacket.invocationProperties
+        // so that they can be used after responsePacket is received.
+        // These properties are used if a fault is thrown from the subsequent Pipe/Tubes.
+
+        HeaderList hl = request.getMessage().getHeaders();
+        try {
+        replyTo = hl.getReplyTo(addressingVersion, soapVersion);
+        faultTo = hl.getFaultTo(addressingVersion, soapVersion);
+        } catch (InvalidMapException e) {
+            SOAPFault soapFault = helper.newInvalidMapFault(e, addressingVersion);
+            // WS-A fault processing for one-way methods
+            if (request.getMessage().isOneWay(wsdlPort)) {
+                request.createServerResponse(null, wsdlPort, null, binding);
+                return doInvoke(next, request);
+            }
+
+            Message m = Messages.create(soapFault);
+            if (soapVersion == SOAPVersion.SOAP_11) {
+                FaultDetailHeader s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
+                m.getHeaders().add(s11FaultDetailHeader);
+            }
+
+            Packet response = request.createServerResponse(m, wsdlPort, null, binding);
+            return doReturnWith(response);
+        }
+        String messageId = hl.getMessageID(addressingVersion, soapVersion);
+
+        // TODO: This is probably not a very good idea.
+        // if someone wants to get this data, let them get from HeaderList.
+        // we can even provide a convenience method
+        //  -- KK.
+        request.invocationProperties.put(REQUEST_MESSAGE_ID, messageId);
+
+
+        // defaulting
+        if (replyTo == null)    replyTo = addressingVersion.anonymousEpr;
+        if (faultTo == null)    faultTo = replyTo;
+
+        wbo = getWSDLBoundOperation(request);
+        if(wbo != null && wbo.getAnonymous()== WSDLBoundOperation.ANONYMOUS.required)
+            isAnonymousRequired = true;
+        Packet p = validateInboundHeaders(request);
+        // if one-way message and WS-A header processing fault has occurred,
+        // then do no further processing
+        if (p.getMessage() == null)
+            // TODO: record the problem that we are dropping this problem on the floor.
+            return doReturnWith(p);
+
+        // if we find an error in addressing header, just turn around the direction here
+        if (p.getMessage().isFault()) {
+            // close the transportBackChannel if we know that
+            // we'll never use them
+            if (!(isAnonymousRequired) &&
+                    !faultTo.isAnonymous() && request.transportBackChannel != null)
+                request.transportBackChannel.close();
+            return processResponse(p);
+        }
+        // close the transportBackChannel if we know that
+        // we'll never use them
+        if (!(isAnonymousRequired) &&
+                !replyTo.isAnonymous() && !faultTo.isAnonymous() &&
+                request.transportBackChannel != null)
+            request.transportBackChannel.close();
+        return doInvoke(next,p);
+    }
+
+    @Override
+    public @NotNull NextAction processResponse(Packet response) {
+        Message msg = response.getMessage();
+        if (msg ==null)
+            return doReturnWith(response);  // one way message. Nothing to see here. Move on.
+
+        WSEndpointReference target = msg.isFault()?faultTo:replyTo;
+
+        if(target.isAnonymous() || isAnonymousRequired )
+            // the response will go back the back channel. most common case
+            return doReturnWith(response);
+
+        if(target.isNone()) {
+            // the caller doesn't want to hear about it, so proceed like one-way
+            response.setMessage(null);
+            return doReturnWith(response);
+        }
+
+        // send the response to this EPR.
+        processNonAnonymousReply(response,target);
+
+        // then we'll proceed the rest like one-way.
+        response.setMessage(null);
+        return doReturnWith(response);
+    }
+
+    /**
+     * Send a response to a non-anonymous address. Also closes the transport back channel
+     * of {@link Packet} if it's not closed already.
+     *
+     * <p>
+     * TODO: ideally we should be doing this by creating a new fiber.
+     *
+     * @param packet
+     *      The response from our server, which will be delivered to the destination.
+     * @param target
+     *      Where do we send the packet to?
+     */
+    private void processNonAnonymousReply(final Packet packet, WSEndpointReference target) {
+        // at this point we know we won't be sending anything back through the back channel,
+        // so close it first to let the client go.
+        if (packet.transportBackChannel != null)
+            packet.transportBackChannel.close();
+
+        if (packet.getMessage().isOneWay(wsdlPort)) {
+            // one way message but with replyTo. I believe this is a hack for WS-TX - KK.
+            LOGGER.fine(AddressingMessages.NON_ANONYMOUS_RESPONSE_ONEWAY());
+            return;
+        }
+
+        EndpointAddress adrs;
+        try {
+             adrs = new EndpointAddress(URI.create(target.getAddress()));
+        } catch (NullPointerException e) {
+            throw new WebServiceException(e);
+        } catch (IllegalArgumentException e) {
+            throw new WebServiceException(e);
+        }
+
+        // we need to assemble a pipeline to talk to this endpoint.
+        // TODO: what to pass as WSService?
+        Tube transport = TransportTubeFactory.create(Thread.currentThread().getContextClassLoader(),
+            new ClientTubeAssemblerContext(adrs, wsdlPort, null, binding));
+
+        packet.endpointAddress = adrs;
+        String action = packet.getMessage().isFault() ?
+                helper.getFaultAction(wbo, packet) :
+                helper.getOutputAction(wbo);
+        //set the SOAPAction, as its got to be same as wsa:Action
+        packet.soapAction = action;
+        Fiber.current().runSync(transport, packet);
+    }
+
+    @Override
+    public void validateAction(Packet packet) {
+        //There may not be a WSDL operation.  There may not even be a WSDL.
+        //For instance this may be a RM CreateSequence message.
+        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+
+        if (wbo == null)
+            return;
+
+        String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
+
+        if (gotA == null)
+            throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
+
+        String expected = helper.getInputAction(packet);
+        String soapAction = helper.getSOAPAction(packet);
+        if (helper.isInputActionDefault(packet) && (soapAction != null && !soapAction.equals("")))
+            expected = soapAction;
+
+        if (expected != null && !gotA.equals(expected)) {
+            throw new ActionNotSupportedException(gotA);
+        }
+    }
+
+    @Override
+    public void checkCardinality(Packet packet) {
+        super.checkCardinality(packet);
+
+        // wsaw:Anonymous validation
+        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+        checkAnonymousSemantics(wbo, replyTo, faultTo);
+         // check if addresses are valid
+        checkNonAnonymousAddresses(replyTo,faultTo);
+    }
+
+    private void checkNonAnonymousAddresses(WSEndpointReference replyTo, WSEndpointReference faultTo) {
+        if (!replyTo.isAnonymous()) {
+            try {
+                new EndpointAddress(URI.create(replyTo.getAddress()));
+            } catch (Exception e) {
+                throw new InvalidMapException(addressingVersion.replyToTag, addressingVersion.invalidAddressTag);
+            }
+        }
+        //for now only validate ReplyTo
+        /*
+        if (!faultTo.isAnonymous()) {
+            try {
+                new EndpointAddress(URI.create(faultTo.getAddress()));
+            } catch (IllegalArgumentException e) {
+                throw new InvalidMapException(addressingVersion.faultToTag, addressingVersion.invalidAddressTag);
+            }
+        }
+        */
+
+    }
+
+    protected void checkMandatoryHeaders(
+        Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageId, boolean foundRelatesTo) {
+        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageId, foundRelatesTo);
+        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+        // no need to check for for non-application messages
+        if (wbo == null)
+            return;
+
+        // if no wsa:To header is found
+        if (!foundTo)
+            throw new MapRequiredException(addressingVersion.toTag);
+
+        // if two-way and no wsa:MessageID is found
+        if (!wbo.getOperation().isOneWay() && !foundMessageId)
+            throw new MapRequiredException(addressingVersion.messageIDTag);
+    }
+
+
+    final void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
+        // no check if Addressing is not enabled or is Member Submission
+        if (addressingVersion == null || addressingVersion == AddressingVersion.MEMBER)
+            return;
+
+        if (wbo == null)
+            return;
+
+        WSDLBoundOperation.ANONYMOUS anon = wbo.getAnonymous();
+
+        String replyToValue = null;
+        String faultToValue = null;
+
+        if (replyTo != null)
+            replyToValue = replyTo.getAddress();
+
+        if (faultTo != null)
+            faultToValue = faultTo.getAddress();
+
+        switch (anon) {
+        case optional:
+            // no check is required
+            break;
+        case prohibited:
+            if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
+                throw new InvalidMapException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
+
+            if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
+                throw new InvalidMapException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
+            break;
+        case required:
+            if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
+                throw new InvalidMapException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
+
+            if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
+                throw new InvalidMapException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
+            break;
+        default:
+            // cannot reach here
+            throw new WebServiceException(AddressingMessages.INVALID_WSAW_ANONYMOUS(anon.toString()));
+        }
+    }
+
+    public static final String REQUEST_MESSAGE_ID = "com.sun.xml.internal.ws.addressing.request.messageID";
+
+    private static final Logger LOGGER = Logger.getLogger(WsaServerTube.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTube.java
new file mode 100644
index 0000000..1baa69b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTube.java
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
+import com.sun.xml.internal.ws.message.FaultDetailHeader;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.AddressingFeature;
+import java.util.Iterator;
+
+/**
+ * WS-Addressing processing code shared between client and server.
+ *
+ * <p>
+ * This tube is used only when WS-Addressing is enabled.
+ *
+ * @author Arun Gupta
+ */
+abstract class WsaTube extends AbstractFilterTubeImpl {
+    /**
+     * Port that we are processing.
+     */
+    protected final @NotNull WSDLPort wsdlPort;
+    protected final WSBinding binding;
+    final WsaTubeHelper helper;
+    protected final @NotNull AddressingVersion addressingVersion;
+    protected final SOAPVersion soapVersion;
+
+    /**
+     * True if the addressing headers are mandatory.
+     */
+    private final boolean addressingRequired;
+
+    public WsaTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
+        super(next);
+        this.wsdlPort = wsdlPort;
+        this.binding = binding;
+        addressingVersion = binding.getAddressingVersion();
+        soapVersion = binding.getSOAPVersion();
+        helper = getTubeHelper();
+        addressingRequired = AddressingVersion.isRequired(binding);
+    }
+
+    public WsaTube(WsaTube that, TubeCloner cloner) {
+        super(that, cloner);
+        this.wsdlPort = that.wsdlPort;
+        this.binding = that.binding;
+        this.helper = that.helper;
+        addressingVersion = that.addressingVersion;
+        soapVersion = that.soapVersion;
+        addressingRequired = that.addressingRequired;
+    }
+
+    @Override
+    public
+    @NotNull
+    NextAction processException(Throwable t) {
+        return super.processException(t);
+    }
+
+    protected WsaTubeHelper getTubeHelper() {
+        if(binding.isFeatureEnabled(AddressingFeature.class)) {
+            return new WsaTubeHelperImpl(wsdlPort, null, binding);
+        } else if(binding.isFeatureEnabled(MemberSubmissionAddressingFeature.class)) {
+            //seiModel is null as it is not needed.
+            return new com.sun.xml.internal.ws.addressing.v200408.WsaTubeHelperImpl(wsdlPort, null, binding);
+        } else {
+            // Addressing is not enabled, WsaTube should not be included in the pipeline
+            throw new WebServiceException(AddressingMessages.ADDRESSING_NOT_ENABLED(this.getClass().getSimpleName()));
+        }
+    }
+
+    /**
+     * Validates the inbound message. If an error is found, create
+     * a fault message and returns that. Otherwise
+     * it will pass through the parameter 'packet' object to the return value.
+     */
+    protected final Packet validateInboundHeaders(Packet packet) {
+        SOAPFault soapFault;
+        FaultDetailHeader s11FaultDetailHeader;
+
+        try {
+            checkCardinality(packet);
+
+            return packet;
+        } catch (InvalidMapException e) {
+            soapFault = helper.newInvalidMapFault(e, addressingVersion);
+            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
+        } catch (MapRequiredException e) {
+            soapFault = helper.newMapRequiredFault(e, addressingVersion);
+            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
+        }
+
+        if (soapFault != null) {
+            // WS-A fault processing for one-way methods
+            if (packet.getMessage().isOneWay(wsdlPort)) {
+                return packet.createServerResponse(null, wsdlPort, null, binding);
+            }
+
+            Message m = Messages.create(soapFault);
+            if (soapVersion == SOAPVersion.SOAP_11) {
+                m.getHeaders().add(s11FaultDetailHeader);
+            }
+
+            Packet response = packet.createServerResponse(m, wsdlPort, null,  binding);
+            return response;
+        }
+
+        return packet;
+    }
+
+    final boolean isAddressingEngagedOrRequired(Packet packet, WSBinding binding) {
+        if (AddressingVersion.isRequired(binding))
+            return true;
+
+        if (packet == null)
+            return false;
+
+        if (packet.getMessage() == null)
+            return false;
+
+        if (packet.getMessage().getHeaders() != null)
+            return false;
+
+        String action = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
+        if (action == null)
+            return true;
+
+        return true;
+    }
+
+    /**
+     * Checks the cardinality of WS-Addressing headers on an inbound {@link Packet}. This method
+     * checks for the cardinality if WS-Addressing is engaged (detected by the presence of wsa:Action
+     * header) or wsdl:required=true.
+     *
+     * @param packet The inbound packet.
+     * @throws WebServiceException if:
+     * <ul>
+     * <li>there is an error reading ReplyTo or FaultTo</li>
+     * <li>WS-Addressing is required and {@link Message} within <code>packet</code> is null</li>
+     * <li>WS-Addressing is required and no headers are found in the {@link Message}</li>
+     * <li>an uknown WS-Addressing header is present</li>
+     * </ul>
+     */
+    public void checkCardinality(Packet packet) {
+        Message message = packet.getMessage();
+        if (message == null) {
+            if (addressingRequired)
+                throw new WebServiceException(AddressingMessages.NULL_MESSAGE());
+            else
+                return;
+        }
+
+        Iterator<Header> hIter = message.getHeaders().getHeaders(addressingVersion.nsUri, true);
+
+        if (!hIter.hasNext()) {
+            // no WS-A headers are found
+            if (addressingRequired)
+                // if WS-A is required, then throw an exception looking for wsa:Action header
+                throw new MapRequiredException(addressingVersion.actionTag);
+            else
+                // else no need to process
+                return;
+        }
+
+        boolean foundFrom = false;
+        boolean foundTo = false;
+        boolean foundReplyTo = false;
+        boolean foundFaultTo = false;
+        boolean foundAction = false;
+        boolean foundMessageId = false;
+        boolean foundRelatesTo = false;
+        QName duplicateHeader = null;
+
+        while (hIter.hasNext()) {
+            Header h = hIter.next();
+
+            // check if the Header is in current role
+            if (!isInCurrentRole(h, binding)) {
+                continue;
+            }
+
+            String local = h.getLocalPart();
+            if (local.equals(addressingVersion.fromTag.getLocalPart())) {
+                if (foundFrom) {
+                    duplicateHeader = addressingVersion.fromTag;
+                    break;
+                }
+                foundFrom = true;
+            } else if (local.equals(addressingVersion.toTag.getLocalPart())) {
+                if (foundTo) {
+                    duplicateHeader = addressingVersion.toTag;
+                    break;
+                }
+                foundTo = true;
+            } else if (local.equals(addressingVersion.replyToTag.getLocalPart())) {
+                if (foundReplyTo) {
+                    duplicateHeader = addressingVersion.replyToTag;
+                    break;
+                }
+                foundReplyTo = true;
+                try { // verify that the header is in a good shape
+                    h.readAsEPR(addressingVersion);
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
+                }
+            } else if (local.equals(addressingVersion.faultToTag.getLocalPart())) {
+                if (foundFaultTo) {
+                    duplicateHeader = addressingVersion.faultToTag;
+                    break;
+                }
+                foundFaultTo = true;
+                try { // verify that the header is in a good shape
+                    h.readAsEPR(addressingVersion);
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
+                }
+            } else if (local.equals(addressingVersion.actionTag.getLocalPart())) {
+                if (foundAction) {
+                    duplicateHeader = addressingVersion.actionTag;
+                    break;
+                }
+                foundAction = true;
+            } else if (local.equals(addressingVersion.messageIDTag.getLocalPart())) {
+                if (foundMessageId) {
+                    duplicateHeader = addressingVersion.messageIDTag;
+                    break;
+                }
+                foundMessageId = true;
+            } else if (local.equals(addressingVersion.relatesToTag.getLocalPart())) {
+                foundRelatesTo = true;
+            } else if (local.equals(addressingVersion.faultDetailTag.getLocalPart())) {
+                // TODO: should anything be done here ?
+                // TODO: fault detail element - only for SOAP 1.1
+            } else {
+                System.err.println(AddressingMessages.UNKNOWN_WSA_HEADER());
+            }
+        }
+
+        // check for invalid cardinality first before checking for mandatory headers
+        if (duplicateHeader != null) {
+            throw new InvalidMapException(duplicateHeader, addressingVersion.invalidCardinalityTag);
+        }
+
+        // WS-A is engaged if wsa:Action header is found
+        boolean engaged = foundAction;
+
+        // check for mandatory set of headers only if:
+        // 1. WS-A is engaged or
+        // 2. wsdl:required=true
+        // Both wsa:Action and wsa:To MUST be present on request (for oneway MEP) and
+        // response messages (for oneway and request/response MEP only)
+        if (engaged || addressingRequired) {
+            checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageId, foundRelatesTo);
+        }
+    }
+
+    final boolean isInCurrentRole(Header header, WSBinding binding) {
+        // TODO: binding will be null for protocol messages
+        // TODO: returning true assumes that protocol messages are
+        // TODO: always in current role, this may not to be fixed.
+        if (binding == null)
+            return true;
+
+
+        if (soapVersion == SOAPVersion.SOAP_11) {
+            // Rama: Why not checking for SOAP 1.1?
+            return true;
+        } else {
+            String role = header.getRole(soapVersion);
+            return (role.equals(SOAPVersion.SOAP_12.implicitRole));
+        }
+    }
+
+    protected final WSDLBoundOperation getWSDLBoundOperation(Packet packet) {
+        return packet.getMessage().getOperation(wsdlPort);
+    }
+
+    protected void validateSOAPAction(Packet packet) {
+        String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
+        if (gotA == null)
+            throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
+        if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
+            throw new InvalidMapException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
+        }
+    }
+
+    protected abstract void validateAction(Packet packet);
+    protected void checkMandatoryHeaders(
+        Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageId, boolean foundRelatesTo) {
+        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+        // no need to check for for non-application messages
+        if (wbo == null)
+            return;
+
+        // if no wsa:Action header is found
+        if (!foundAction)
+            throw new MapRequiredException(addressingVersion.actionTag);
+        validateSOAPAction(packet);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java
new file mode 100644
index 0000000..7fd6d7c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import java.util.Map;
+
+/**
+ * @author Arun Gupta
+ */
+public abstract class WsaTubeHelper {
+
+    public WsaTubeHelper(WSBinding binding, SEIModel seiModel, WSDLPort wsdlPort) {
+        this.binding = binding;
+        this.wsdlPort = wsdlPort;
+        this.seiModel = seiModel;
+        this.soapVer = binding.getSOAPVersion();
+        this.addVer = binding.getAddressingVersion();
+
+    }
+
+    public String getFaultAction(Packet requestPacket, Packet responsePacket) {
+        String action = null;
+        if(seiModel != null) {
+            action = getFaultActionFromSEIModel(requestPacket,responsePacket);
+        }
+        if(action != null)
+            return action;
+        else
+            action = addVer.getDefaultFaultAction();
+        if (wsdlPort == null)
+            return action;
+        WSDLBoundOperation wbo = requestPacket.getMessage().getOperation(wsdlPort);
+        return getFaultAction(wbo,responsePacket);
+    }
+
+    String getFaultActionFromSEIModel(Packet requestPacket, Packet responsePacket) {
+        String action = null;
+        if (seiModel == null || wsdlPort == null)
+            return action;
+
+        try {
+            SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage();
+            if (sm == null)
+                return action;
+
+            if (sm.getSOAPBody() == null)
+                return action;
+
+            if (sm.getSOAPBody().getFault() == null)
+                return action;
+
+            Detail detail = sm.getSOAPBody().getFault().getDetail();
+            if (detail == null)
+                return action;
+
+            String ns = detail.getFirstChild().getNamespaceURI();
+            String name = detail.getFirstChild().getLocalName();
+            JavaMethodImpl jm = (JavaMethodImpl) requestPacket.getMessage().getMethod(seiModel);
+            for (CheckedExceptionImpl ce : jm.getCheckedExceptions()) {
+                if (ce.getDetailType().tagName.getLocalPart().equals(name) &&
+                        ce.getDetailType().tagName.getNamespaceURI().equals(ns)) {
+                    return ce.getFaultAction();
+                }
+            }
+            return action;
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    String getFaultAction(@Nullable WSDLBoundOperation wbo, Packet responsePacket) {
+        String action = addVer.getDefaultFaultAction();
+        if (wbo == null)
+            return action;
+
+        try {
+            SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage();
+            if (sm == null)
+                return action;
+
+            if (sm.getSOAPBody() == null)
+                return action;
+
+            if (sm.getSOAPBody().getFault() == null)
+                return action;
+
+            Detail detail = sm.getSOAPBody().getFault().getDetail();
+            if (detail == null)
+                return action;
+
+            String ns = detail.getFirstChild().getNamespaceURI();
+            String name = detail.getFirstChild().getLocalName();
+
+            WSDLOperation o = wbo.getOperation();
+
+            WSDLFault fault = o.getFault(new QName(ns, name));
+            if (fault == null)
+                return action;
+
+            WSDLOperationImpl impl = (WSDLOperationImpl)o;
+            Map<String,String> map = impl.getFaultActionMap();
+            if (map == null)
+                return action;
+
+            action = map.get(fault.getName());
+
+            return action;
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public String getInputAction(Packet packet) {
+        String action = null;
+
+        if (wsdlPort != null) {
+            WSDLBoundOperation wbo = wsdlPort.getBinding().getOperation(packet.getMessage().getPayloadNamespaceURI(), packet.getMessage().getPayloadLocalPart());
+            if (wbo != null) {
+                WSDLOperation op = wbo.getOperation();
+                action = op.getInput().getAction();
+            }
+        }
+
+        return action;
+    }
+
+    /**
+     * This method gives the Input addressing Action for a message.
+     * It gives the Action set in the wsdl operation for the corresponding payload.
+     * If it is not explicitly set, it gives the soapAction
+     * @param packet
+     * @return input Action
+     */
+    public String getEffectiveInputAction(Packet packet) {
+        //non-default SOAPAction beomes wsa:action
+        if(packet.soapAction != null && !packet.soapAction.equals(""))
+                return packet.soapAction;
+        String action = null;
+
+        if (wsdlPort != null) {
+            WSDLBoundOperation wbo = wsdlPort.getBinding().getOperation(packet.getMessage().getPayloadNamespaceURI(), packet.getMessage().getPayloadLocalPart());
+            if (wbo != null) {
+                WSDLOperation op = wbo.getOperation();
+                action = op.getInput().getAction();
+            } else
+                action = packet.soapAction;
+        } else {
+            action = packet.soapAction;
+        }
+        return action;
+    }
+
+    public boolean isInputActionDefault(Packet packet) {
+        if (wsdlPort == null)
+            return false;
+
+        WSDLBoundOperation wbo = wsdlPort.getBinding().getOperation(packet.getMessage().getPayloadNamespaceURI(), packet.getMessage().getPayloadLocalPart());
+        if (wbo == null)
+            return false;
+
+        WSDLOperation op = wbo.getOperation();
+        return ((WSDLOperationImpl) op).getInput().isDefaultAction();
+
+    }
+
+    public String getSOAPAction(Packet packet) {
+        String action = "";
+
+        if (packet == null)
+            return action;
+
+        if (packet.getMessage() == null)
+            return action;
+
+        WSDLBoundOperation op = packet.getMessage().getOperation(wsdlPort);
+        if (op == null)
+            return action;
+
+        action = op.getSOAPAction();
+
+        return action;
+    }
+
+    public String getOutputAction(Packet packet) {
+        String action = AddressingVersion.UNSET_OUTPUT_ACTION;
+        if(seiModel!= null) {
+            JavaMethodImpl jm = (JavaMethodImpl) packet.getMessage().getMethod(seiModel);
+            if(jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
+                return jm.getOutputAction();
+            }
+        }
+        if (wsdlPort != null) {
+            WSDLBoundOperation wbo = wsdlPort.getBinding().getOperation(packet.getMessage().getPayloadNamespaceURI(), packet.getMessage().getPayloadLocalPart());
+            return getOutputAction(wbo);
+        }
+        return action;
+    }
+
+    String getOutputAction(@Nullable WSDLBoundOperation wbo) {
+        String action = AddressingVersion.UNSET_OUTPUT_ACTION;
+        if (wbo != null) {
+            WSDLOutput op = wbo.getOperation().getOutput();
+            if (op != null)
+                action = op.getAction();
+        }
+        return action;
+    }
+    public SOAPFault newInvalidMapFault(InvalidMapException e, AddressingVersion av) {
+        QName name = e.getMapQName();
+        QName subsubcode = e.getSubsubcode();
+        QName subcode = av.invalidMapTag;
+        String faultstring = String.format(av.getInvalidMapText(), name, subsubcode);
+
+        try {
+            SOAPFactory factory;
+            SOAPFault fault;
+            if (soapVer == SOAPVersion.SOAP_12) {
+                factory = SOAPVersion.SOAP_12.saajSoapFactory;
+                fault = factory.createFault();
+                fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
+                fault.appendFaultSubcode(subcode);
+                fault.appendFaultSubcode(subsubcode);
+                getInvalidMapDetail(name, fault.addDetail());
+            } else {
+                factory = SOAPVersion.SOAP_11.saajSoapFactory;
+                fault = factory.createFault();
+                fault.setFaultCode(subsubcode);
+            }
+
+            fault.setFaultString(faultstring);
+
+            return fault;
+        } catch (SOAPException se) {
+            throw new WebServiceException(se);
+        }
+    }
+
+    public SOAPFault newMapRequiredFault(MapRequiredException e, AddressingVersion av) {
+        QName subcode = av.mapRequiredTag;
+        QName subsubcode = av.mapRequiredTag;
+        String faultstring = av.getMapRequiredText();
+
+        try {
+            SOAPFactory factory;
+            SOAPFault fault;
+            if (soapVer == SOAPVersion.SOAP_12) {
+                factory = SOAPVersion.SOAP_12.saajSoapFactory;
+                fault = factory.createFault();
+                fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
+                fault.appendFaultSubcode(subcode);
+                fault.appendFaultSubcode(subsubcode);
+                getMapRequiredDetail(e.getMapQName(), fault.addDetail());
+            } else {
+                factory = SOAPVersion.SOAP_11.saajSoapFactory;
+                fault = factory.createFault();
+                fault.setFaultCode(subsubcode);
+            }
+
+            fault.setFaultString(faultstring);
+
+            return fault;
+        } catch (SOAPException se) {
+            throw new WebServiceException(se);
+        }
+    }
+
+    public abstract void getProblemActionDetail(String action, Element element);
+    public abstract void getInvalidMapDetail(QName name, Element element);
+    public abstract void getMapRequiredDetail(QName name, Element element);
+
+    protected Unmarshaller unmarshaller;
+    protected Marshaller marshaller;
+    protected SEIModel seiModel;
+    protected WSDLPort wsdlPort;
+    protected WSBinding binding;
+    protected final SOAPVersion soapVer;
+    protected final AddressingVersion addVer;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java
new file mode 100644
index 0000000..8a24292
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import org.w3c.dom.Element;
+
+/**
+ * @author Arun Gupta
+ */
+public class WsaTubeHelperImpl extends WsaTubeHelper {
+    static final JAXBContext jc;
+
+    static {
+        try {
+            jc = JAXBContext.newInstance(ProblemAction.class,
+                                         ProblemHeaderQName.class);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public WsaTubeHelperImpl(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+        super(binding,seiModel,wsdlPort);
+        try {
+            unmarshaller = jc.createUnmarshaller();
+            marshaller = jc.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getProblemActionDetail(String action, Element element) {
+        ProblemAction pa = new ProblemAction(action);
+        try {
+            marshaller.marshal(pa, element);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getInvalidMapDetail(QName name, Element element) {
+        ProblemHeaderQName phq = new ProblemHeaderQName(name);
+        try {
+            marshaller.marshal(phq, element);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getMapRequiredDetail(QName name, Element element) {
+        getInvalidMapDetail(name, element);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java
new file mode 100644
index 0000000..6718544
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.model;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * @author Arun Gupta
+ */
+public class ActionNotSupportedException extends WebServiceException {
+    String action;
+
+    protected ActionNotSupportedException() {
+        super();
+    }
+
+    public ActionNotSupportedException(String action) {
+        this.action = action;
+    }
+
+    public String getAction() {
+        return action;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/InvalidMapException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/InvalidMapException.java
new file mode 100644
index 0000000..5e84bd5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/InvalidMapException.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.model;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Arun Gupta
+ */
+public class InvalidMapException extends WebServiceException {
+    QName name;
+    QName subsubcode;
+
+    public InvalidMapException(QName name, QName subsubcode) {
+        this.name = name;
+        this.subsubcode = subsubcode;
+    }
+
+    public QName getMapQName() {
+        return name;
+    }
+
+    public QName getSubsubcode() {
+        return subsubcode;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/MapRequiredException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/MapRequiredException.java
new file mode 100644
index 0000000..d1161ee
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/MapRequiredException.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.model;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Arun Gupta
+ */
+public class MapRequiredException extends WebServiceException {
+    QName name;
+
+    public MapRequiredException(QName name) {
+        this.name = name;
+    }
+
+    public QName getMapQName() {
+        return name;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionAddressingConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionAddressingConstants.java
new file mode 100644
index 0000000..e94d63d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionAddressingConstants.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.v200408;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants for Member Submission WS-Addressing version
+ *
+ * @author Arun Gupta
+ */
+public interface MemberSubmissionAddressingConstants {
+    public static final String WSA_NAMESPACE_NAME = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+    public static final String WSA_NAMESPACE_WSDL_NAME = WSA_NAMESPACE_NAME;
+    public static final String WSA_NAMESPACE_POLICY_NAME = "http://schemas.xmlsoap.org/ws/2004/08/addressing/policy";
+
+    public static final String WSA_SERVICENAME_NAME = "ServiceName";
+    public static final String WSA_PORTTYPE_NAME = "PortType";
+    public static final String WSA_PORTNAME_NAME = "PortName";
+
+    public static final String WSA_ADDRESS_NAME = "Address";
+    public static final QName WSA_ADDRESS_QNAME = new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME);
+
+    public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/role/anonymous";
+    public static final String WSA_NONE_ADDRESS = "";
+
+    public static final String WSA_DEFAULT_FAULT_ACTION = WSA_NAMESPACE_NAME + "/fault";
+
+    public static final QName INVALID_MAP_QNAME = new QName(WSA_NAMESPACE_NAME, "InvalidMessageInformationHeader");
+    public static final QName MAP_REQUIRED_QNAME = new QName(WSA_NAMESPACE_NAME, "MessageInformationHeaderRequired");
+    public static final QName DESTINATION_UNREACHABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "DestinationUnreachable");
+    public static final QName ACTION_NOT_SUPPORTED_QNAME = new QName(WSA_NAMESPACE_NAME, "ActionNotSupported");
+    public static final QName ENDPOINT_UNAVAILABLE_QNAME = new QName(WSA_NAMESPACE_NAME, "EndpointUnavailable");
+
+    public static final String ACTION_NOT_SUPPORTED_TEXT = "The \"%s\" cannot be processed at the receiver.";
+    public static final String DESTINATION_UNREACHABLE_TEXT = "No route can be determined to reach the destination role defined by the WS-Addressing To.";
+    public static final String ENDPOINT_UNAVAILABLE_TEXT = "The endpoint is unable to process the message at this time.";
+    public static final String INVALID_MAP_TEXT = "A message information header is not valid and the message cannot be processed.";
+    public static final String MAP_REQUIRED_TEXT = "A required message information header, To, MessageID, or Action, is not present.";
+
+    public static final QName PROBLEM_ACTION_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemAction");
+    public static final QName PROBLEM_HEADER_QNAME_QNAME = new QName(WSA_NAMESPACE_NAME, "ProblemHeaderQName");
+    public static final QName FAULT_DETAIL_QNAME = new QName(WSA_NAMESPACE_NAME, "FaultDetail");
+
+    public
+    static final String ANONYMOUS_EPR = "<EndpointReference xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\n"+
+        "    <Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address>\n"+
+        "</EndpointReference>";
+
+    public static final QName MEX_METADATA = new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "Metadata","mex");
+    public static final QName MEX_METADATA_SECTION = new QName("http://schemas.xmlsoap.org/ws/2004/09/mex", "MetadataSection","mex");
+    public static final String MEX_METADATA_DIALECT_ATTRIBUTE = "Dialect";
+    public static final String MEX_METADATA_DIALECT_VALUE = "http://schemas.xmlsoap.org/wsdl/";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemAction.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemAction.java
new file mode 100644
index 0000000..f39eba0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemAction.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.v200408;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import static com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants.WSA_NAMESPACE_NAME;
+/**
+ * @author Arun Gupta
+ */
+@XmlRootElement(name="ProblemAction", namespace= WSA_NAMESPACE_NAME)
+public class ProblemAction {
+
+    @XmlElement(name="Action", namespace= WSA_NAMESPACE_NAME)
+    private String action;
+
+    @XmlElement(name="SoapAction", namespace=WSA_NAMESPACE_NAME)
+    private String soapAction;
+
+    /** Creates a new instance of ProblemAction */
+    public ProblemAction() {
+    }
+
+    public ProblemAction(String action) {
+        this.action = action;
+    }
+
+    public ProblemAction(String action, String soapAction) {
+        this.action = action;
+        this.soapAction = soapAction;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public String getSoapAction() {
+        return soapAction;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemHeaderQName.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemHeaderQName.java
new file mode 100644
index 0000000..5cfda49
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/ProblemHeaderQName.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.v200408;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+import static com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants.WSA_NAMESPACE_NAME;
+
+/**
+ * @author Arun Gupta
+ */
+@XmlRootElement(name="ProblemHeaderQName", namespace= WSA_NAMESPACE_NAME)
+public class ProblemHeaderQName {
+    @XmlValue
+    private QName value;
+
+    /** Creates a new instance of ProblemHeaderQName */
+    public ProblemHeaderQName() {
+    }
+
+    public ProblemHeaderQName(QName name) {
+        this.value = name;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java
new file mode 100644
index 0000000..27ff72e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.addressing.v200408;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+
+import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import org.w3c.dom.Element;
+
+/**
+ * @author Arun Gupta
+ */
+public class WsaTubeHelperImpl extends WsaTubeHelper {
+    static final JAXBContext jc;
+
+    static {
+        try {
+            jc = JAXBContext.newInstance(ProblemAction.class,
+                                         ProblemHeaderQName.class);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public WsaTubeHelperImpl(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+        super(binding,seiModel,wsdlPort);
+        try {
+            unmarshaller = jc.createUnmarshaller();
+            marshaller = jc.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getProblemActionDetail(String action, Element element) {
+        ProblemAction pa = new ProblemAction(action);
+        try {
+            marshaller.marshal(pa, element);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getInvalidMapDetail(QName name, Element element) {
+        ProblemHeaderQName phq = new ProblemHeaderQName(name);
+        try {
+            marshaller.marshal(phq, element);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    @Override
+    public final void getMapRequiredDetail(QName name, Element element) {
+        getInvalidMapDetail(name, element);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingID.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingID.java
new file mode 100644
index 0000000..f466f24
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingID.java
@@ -0,0 +1,411 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.encoding.SOAPBindingCodec;
+import com.sun.xml.internal.ws.encoding.XMLHTTPBindingCodec;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+
+import javax.xml.ws.BindingType;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Parsed binding ID string.
+ *
+ * <p>
+ * {@link BindingID} is an immutable object that represents a binding ID,
+ * much like how {@link URL} is a representation of an URL.
+ * Like {@link URL}, this class offers a bunch of methods that let you
+ * query various traits/properties of a binding ID.
+ *
+ * <p>
+ * {@link BindingID} is extensible; one can plug in a parser from
+ * {@link String} to {@link BindingID} to interpret binding IDs that
+ * the JAX-WS RI does no a-priori knowledge of.
+ * Technologies such as Tango uses this to make the JAX-WS RI understand
+ * binding IDs defined in their world.
+ *
+ * Such technologies are free to extend this class and expose more characterstics.
+ *
+ * <p>
+ * Even though this class defines a few well known constants, {@link BindingID}
+ * instances do not necessarily have singleton semantics. Use {@link #equals(Object)}
+ * for the comparison.
+ *
+ * <h3>{@link BindingID} and {@link WSBinding}</h3>
+ * <p>
+ * {@link WSBinding} is mutable and represents a particular "use" of a {@link BindingID}.
+ * As such, it has state like a list of {@link Handler}s, which are inherently local
+ * to a particular usage. For example, if you have two proxies, you need two instances.
+ *
+ * {@link BindingID}, OTOH, is immutable and thus the single instance
+ * that represents "SOAP1.2/HTTP" can be shared and reused by all proxies in the same VM.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class BindingID {
+
+    /**
+     * Creates an instance of {@link WSBinding} (which is conceptually an "use"
+     * of {@link BindingID}) from a {@link BindingID}.
+     *
+     * @return
+     *      Always a new instance.
+     */
+    public final @NotNull WSBinding createBinding() {
+        return BindingImpl.create(this);
+    }
+
+    public final @NotNull WSBinding createBinding(WebServiceFeature... features) {
+        return BindingImpl.create(this, features);
+    }
+
+    public final @NotNull WSBinding createBinding(WSFeatureList features) {
+        return createBinding(features.toArray());
+    }
+
+    /**
+     * Gets the SOAP version of this binding.
+     *
+     * TODO: clarify what to do with XML/HTTP binding
+     *
+     * @return
+     *      If the binding is using SOAP, this method returns
+     *      a {@link SOAPVersion} constant.
+     *
+     *      If the binding is not based on SOAP, this method
+     *      returns null. See {@link Message} for how a non-SOAP
+     *      binding shall be handled by {@link Tube}s.
+     */
+    public abstract SOAPVersion getSOAPVersion();
+
+    /**
+     * Creates a new {@link Codec} for this binding.
+     *
+     * @param binding
+     *      Ocassionally some aspects of binding can be overridden by
+     *      {@link WSBinding} at runtime by users, so some {@link Codec}s
+     *      need to have access to {@link WSBinding} that it's working for.
+     */
+    public abstract @NotNull Codec createEncoder(@NotNull WSBinding binding);
+
+    /**
+     * Gets the binding ID, which uniquely identifies the binding.
+     *
+     * <p>
+     * The relevant specs define the binding IDs and what they mean.
+     * The ID is used in many places to identify the kind of binding
+     * (such as SOAP1.1, SOAP1.2, REST, ...)
+     *
+     * @return
+     *      Always non-null same value.
+     */
+    public abstract String toString();
+
+    /**
+     * Returna a new {@link WebServiceFeatureList} instance
+     * that represents the features that are built into this binding ID.
+     *
+     * <p>
+     * For example, {@link BindingID} for
+     * <tt>"{@value SOAPBinding#SOAP11HTTP_MTOM_BINDING}"</tt>
+     * would always return a list that has {@link MTOMFeature} enabled.
+     */
+    public WebServiceFeatureList createBuiltinFeatureList() {
+        return new WebServiceFeatureList();
+    }
+
+    /**
+     * Returns true if this binding can generate WSDL.
+     *
+     * <p>
+     * For e.g.: SOAP 1.1 and "XSOAP 1.2" is supposed to return true
+     * from this method. For SOAP1.2, there is no standard WSDL, so the
+     * runtime is not generating one and it expects the WSDL is packaged.
+     *
+     */
+    public boolean canGenerateWSDL() {
+        return false;
+    }
+
+    /**
+     * Returns a parameter of this binding ID.
+     *
+     * <p>
+     * Some binding ID, such as those for SOAP/HTTP, uses the URL
+     * query syntax (like <tt>?mtom=true</tt>) to control
+     * the optional part of the binding. This method obtains
+     * the value for such optional parts.
+     *
+     * <p>
+     * For implementors of the derived classes, if your binding ID
+     * does not define such optional parts (such as the XML/HTTP binding ID),
+     * then you should simply return the specified default value
+     * (which is what this implementation does.)
+     *
+     * @param parameterName
+     *      The parameter name, such as "mtom" in the above example.
+     * @param defaultValue
+     *      If this binding ID doesn't have the specified parameter explicitly,
+     *      this value will be returned.
+     *
+     * @return
+     *      the value of the parameter, if it's present (such as "true"
+     *      in the above example.) If not present, this method returns
+     *      the {@code defaultValue}.
+     */
+    public String getParameter(String parameterName, String defaultValue) {
+        return defaultValue;
+    }
+
+    /**
+     * Compares the equality based on {@link #toString()}.
+     */
+    public boolean equals(Object obj) {
+        if(!(obj instanceof BindingID))
+            return false;
+        return toString().equals(obj.toString());
+    }
+
+    public int hashCode() {
+        return toString().hashCode();
+    }
+
+    /**
+     * Parses a binding ID string into a {@link BindingID} object.
+     *
+     * <p>
+     * This method first checks for a few known values and then delegate
+     * the parsing to {@link BindingIDFactory}.
+     *
+     * <p>
+     * If parsing succeeds this method returns a value. Otherwise
+     * throws {@link WebServiceException}.
+     *
+     * @throws WebServiceException
+     *      If the binding ID is not understood.
+     */
+    public static @NotNull BindingID parse(String lexical) {
+        if(lexical.equals(XML_HTTP.toString()))
+            return XML_HTTP;
+        if(belongsTo(lexical,SOAP11_HTTP.toString()))
+            return customize(lexical,SOAP11_HTTP);
+        if(belongsTo(lexical,SOAP12_HTTP.toString()))
+            return customize(lexical,SOAP12_HTTP);
+        if(belongsTo(lexical,SOAPBindingImpl.X_SOAP12HTTP_BINDING))
+            return customize(lexical,X_SOAP12_HTTP);
+
+        // OK, it's none of the values JAX-WS understands.
+        for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) {
+            BindingID r = f.parse(lexical);
+            if(r!=null)
+                return r;
+        }
+
+        // nobody understood this value
+        throw new WebServiceException("Wrong binding ID: "+lexical);
+    }
+
+    private static boolean belongsTo(String lexical, String id) {
+        return lexical.equals(id) || lexical.startsWith(id+'?');
+    }
+
+    /**
+     * Parses parameter portion and returns appropriately populated {@link SOAPHTTPImpl}
+     */
+    private static SOAPHTTPImpl customize(String lexical, SOAPHTTPImpl base) {
+        if(lexical.equals(base.toString()))
+            return base;
+
+        // otherwise we must have query parameter
+        // we assume the spec won't define any tricky parameters that require
+        // complicated handling (such as %HH or non-ASCII char), so this parser
+        // is quite simple-minded.
+        SOAPHTTPImpl r = new SOAPHTTPImpl(base.getSOAPVersion(), lexical, base.canGenerateWSDL());
+        try {
+            // With X_SOAP12_HTTP, base != lexical and lexical does n't have any query string
+            if(lexical.indexOf('?') == -1) {
+                return r;
+            }
+            String query = URLDecoder.decode(lexical.substring(lexical.indexOf('?')+1),"UTF-8");
+            for( String token : query.split("&") ) {
+                int idx = token.indexOf('=');
+                if(idx<0)
+                    throw new WebServiceException("Malformed binding ID (no '=' in "+token+")");
+                r.parameters.put(token.substring(0,idx),token.substring(idx+1));
+            }
+        } catch (UnsupportedEncodingException e) {
+            throw new AssertionError(e);    // UTF-8 is supported everywhere
+        }
+
+        return r;
+    }
+
+
+    /**
+     * Figures out the binding from {@link BindingType} annotation.
+     *
+     * @return
+     *      default to {@link BindingID#SOAP11_HTTP}, if no such annotation is present.
+     * @see #parse(String)
+     */
+    public static @NotNull BindingID parse(Class<?> implClass) {
+        BindingType bindingType = implClass.getAnnotation(BindingType.class);
+        if (bindingType != null) {
+            String bindingId = bindingType.value();
+            if (bindingId.length() > 0) {
+                return BindingID.parse(bindingId);
+            }
+        }
+        return SOAP11_HTTP;
+    }
+
+    /**
+     * Constant that represents implementation specific SOAP1.2/HTTP which is
+     * used to generate non-standard WSDLs
+     */
+    public static final SOAPHTTPImpl X_SOAP12_HTTP = new SOAPHTTPImpl(
+        SOAPVersion.SOAP_12, SOAPBindingImpl.X_SOAP12HTTP_BINDING, true);
+
+    /**
+     * Constant that represents SOAP1.2/HTTP.
+     */
+    public static final SOAPHTTPImpl SOAP12_HTTP = new SOAPHTTPImpl(
+        SOAPVersion.SOAP_12, SOAPBinding.SOAP12HTTP_BINDING, false);
+    /**
+     * Constant that represents SOAP1.1/HTTP.
+     */
+    public static final SOAPHTTPImpl SOAP11_HTTP = new SOAPHTTPImpl(
+        SOAPVersion.SOAP_11, SOAPBinding.SOAP11HTTP_BINDING, true);
+
+    /**
+     * Constant that represents SOAP1.2/HTTP.
+     */
+    public static final SOAPHTTPImpl SOAP12_HTTP_MTOM = new SOAPHTTPImpl(
+        SOAPVersion.SOAP_12, SOAPBinding.SOAP12HTTP_MTOM_BINDING, false, true);
+    /**
+     * Constant that represents SOAP1.1/HTTP.
+     */
+    public static final SOAPHTTPImpl SOAP11_HTTP_MTOM = new SOAPHTTPImpl(
+        SOAPVersion.SOAP_11, SOAPBinding.SOAP11HTTP_MTOM_BINDING, true, true);
+
+
+    /**
+     * Constant that represents REST.
+     */
+    public static final BindingID XML_HTTP = new Impl(SOAPVersion.SOAP_11, HTTPBinding.HTTP_BINDING,false) {
+        public Codec createEncoder(WSBinding binding) {
+            return new XMLHTTPBindingCodec();
+        }
+    };
+
+    private static abstract class Impl extends BindingID {
+        final SOAPVersion version;
+        private final String lexical;
+        private final boolean canGenerateWSDL;
+
+        public Impl(SOAPVersion version, String lexical, boolean canGenerateWSDL) {
+            this.version = version;
+            this.lexical = lexical;
+            this.canGenerateWSDL = canGenerateWSDL;
+        }
+
+        public SOAPVersion getSOAPVersion() {
+            return version;
+        }
+
+        public String toString() {
+            return lexical;
+        }
+
+        @Deprecated
+        public boolean canGenerateWSDL() {
+            return canGenerateWSDL;
+        }
+    }
+
+    /**
+     * Internal implementation for SOAP/HTTP.
+     */
+    private static final class SOAPHTTPImpl extends Impl implements Cloneable {
+        /*final*/ Map<String,String> parameters = new HashMap<String,String>();
+
+        static final String MTOM_PARAM = "mtom";
+        Boolean mtomSetting = null;
+
+        public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL) {
+            super(version, lexical, canGenerateWSDL);
+        }
+
+        public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL,
+                           boolean mtomEnabled) {
+            this(version, lexical, canGenerateWSDL);
+            String mtomStr = mtomEnabled ? "true" : "false";
+            parameters.put(MTOM_PARAM, mtomStr);
+            mtomSetting = mtomEnabled;
+        }
+
+        public @NotNull Codec createEncoder(WSBinding binding) {
+            return new SOAPBindingCodec(binding);
+        }
+
+        private Boolean isMTOMEnabled() {
+            String mtom = parameters.get(MTOM_PARAM);
+            return mtom==null?null:Boolean.valueOf(mtom);
+        }
+
+        public WebServiceFeatureList createBuiltinFeatureList() {
+            WebServiceFeatureList r=super.createBuiltinFeatureList();
+            Boolean mtom = isMTOMEnabled();
+            if(mtom != null)
+                r.add(new MTOMFeature(mtom));
+            return r;
+        }
+
+        public String getParameter(String parameterName, String defaultValue) {
+            if (parameters.get(parameterName) == null)
+                return super.getParameter(parameterName, defaultValue);
+            return parameters.get(parameterName);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingIDFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingIDFactory.java
new file mode 100644
index 0000000..cb2c02e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingIDFactory.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Extension point to plug in additional {@link BindingID} parsing logic.
+ *
+ * <p>
+ * When the JAX-WS RI is asked to parse a binding ID string into a {@link BindingID}
+ * object, it uses service idiom to look for the implementations of this class
+ * in the <tt>META-INF/services/...</tt>.
+ *
+ * @since JAX-WS 2.0.next
+ * @author Kohsuke Kawaguchi
+ * @see BindingID#parse(String)
+ */
+public abstract class BindingIDFactory {
+    /**
+     * Parses a binding ID string into {@link BindingID} if possible.
+     *
+     * @return
+     *      a non-null return value would cause the JAX-WS RI to consider
+     *      the parsing to be successful. No furhter {@link BindingIDFactory}
+     *      will be consulted.
+     *
+     *      <p>
+     *      Retruning a null value indicates that this factory doesn't understand
+     *      this string, in which case the JAX-WS RI will keep asking next
+     *      {@link BindingIDFactory}.
+     *
+     * @throws WebServiceException
+     *      if the implementation understood the lexical value but it is not correct,
+     *      this exception can be thrown to abort the parsing with error.
+     *      No further {@link BindingIDFactory} will be consulted, and
+     *      {@link BindingID#parse(String)} will throw the exception.
+     */
+    public abstract @Nullable BindingID parse(@NotNull String lexical) throws WebServiceException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java
new file mode 100644
index 0000000..85a394b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/DistributedPropertySet.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContext;
+
+import javax.xml.ws.WebServiceContext;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * {@link PropertySet} that combines properties exposed from multiple
+ * {@link PropertySet}s into one.
+ *
+ * <p>
+ * This implementation allows one {@link PropertySet} to assemble
+ * all properties exposed from other "satellite" {@link PropertySet}s.
+ * (A satellite may itself be a {@link DistributedPropertySet}, so
+ * in general this can form a tree.)
+ *
+ * <p>
+ * This is useful for JAX-WS because the properties we expose to the application
+ * are contributed by different pieces, and therefore we'd like each of them
+ * to have a separate {@link PropertySet} implementation that backs up
+ * the properties. For example, this allows FastInfoset to expose its
+ * set of properties to {@link RequestContext} by using a strongly-typed fields.
+ *
+ * <p>
+ * This is also useful for a client-side transport to expose a bunch of properties
+ * into {@link ResponseContext}. It simply needs to create a {@link PropertySet}
+ * object with methods for each property it wants to expose, and then add that
+ * {@link PropertySet} to {@link Packet}. This allows property values to be
+ * lazily computed (when actually asked by users), thus improving the performance
+ * of the typical case where property values are not asked.
+ *
+ * <p>
+ * A similar benefit applies on the server-side, for a transport to expose
+ * a bunch of properties to {@link WebServiceContext}.
+ *
+ * <p>
+ * To achieve these benefits, access to {@link DistributedPropertySet} is slower
+ * compared to {@link PropertySet} (such as get/set), while adding a satellite
+ * object is relatively fast.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class DistributedPropertySet extends PropertySet {
+    /**
+     * All {@link PropertySet}s that are bundled into this {@link PropertySet}.
+     */
+    private final FinalArrayList<PropertySet> satellites = new FinalArrayList<PropertySet>();
+
+    public void addSatellite(@NotNull PropertySet satellite) {
+        satellites.add(satellite);
+    }
+
+    public void removeSatellite(@NotNull PropertySet satellite) {
+        satellites.remove(satellite);
+    }
+
+    public void copySatelliteInto(@NotNull DistributedPropertySet r) {
+        r.satellites.addAll(this.satellites);
+    }
+
+    @Override
+    public Object get(Object key) {
+        // check satellites
+        for (PropertySet child : satellites) {
+            if(child.supports(key))
+                return child.get(key);
+        }
+
+        // otherwise it must be the master
+        return super.get(key);
+    }
+
+    @Override
+    public Object put(String key, Object value) {
+        // check satellites
+        for (PropertySet child : satellites) {
+            if(child.supports(key))
+                return child.put(key,value);
+        }
+
+        // otherwise it must be the master
+        return super.put(key,value);
+    }
+
+    @Override
+    public boolean supports(Object key) {
+        // check satellites
+        for (PropertySet child : satellites) {
+            if(child.supports(key))
+                return true;
+        }
+
+        return super.supports(key);
+    }
+
+    @Override
+    public Object remove(Object key) {
+        // check satellites
+        for (PropertySet child : satellites) {
+            if(child.supports(key))
+                return child.remove(key);
+        }
+
+        return super.remove(key);
+    }
+
+    @Override
+    /*package*/ void createEntrySet(Set<Entry<String, Object>> core) {
+        super.createEntrySet(core);
+        for (PropertySet child : satellites) {
+            child.createEntrySet(core);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/EndpointAddress.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/EndpointAddress.java
new file mode 100644
index 0000000..14bdf40
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/EndpointAddress.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.Iterator;
+
+/**
+ * Represents the endpoint address URI.
+ *
+ * <p>
+ * Conceptually this can be really thought of as an {@link URI},
+ * but it hides some of the details that improve the performance.
+ *
+ * <p>
+ * Being an {@link URI} allows this class to represent custom made-up URIs
+ * (like "jms" for example.) Whenever possible, this object
+ * also creates an {@link URL} (this is only possible when the address
+ * has a registered {@link URLStreamHandler}), so that if the clients
+ * of this code wants to use it, it can do so.
+ *
+ *
+ * <h3>How it improves the performance</h3>
+ * <ol>
+ *  <li>
+ *  Endpoint address is often eventually turned into an {@link URLConnection},
+ *  and given that generally this value is read more often than being set,
+ *  it makes sense to eagerly turn it into an {@link URL},
+ *  thereby avoiding a repeated conversion.
+ *
+ *  <li>
+ *  JDK spends a lot of time choosing a list of {@link Proxy}
+ *  to connect to an {@link URL}. Since the default proxy selector
+ *  implementation always return the same proxy for the same URL,
+ *  we can determine the proxy by ourselves to let JDK skip its
+ *  proxy-discovery step.
+ *
+ *  (That said, user-defined proxy selector can do a lot of interesting things
+ *  --- like doing a round-robin, or pick one from a proxy farm randomly,
+ *  and so it's dangerous to stick to one proxy. For this case,
+ *  we still let JDK decide the proxy. This shouldn't be that much of an
+ *  disappointment, since most people only mess with system properties,
+ *  and never with {@link ProxySelector}. Also, avoiding optimization
+ *  with non-standard proxy selector allows people to effectively disable
+ *  this optimization, which may come in handy for a trouble-shooting.)
+ * </ol>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class EndpointAddress {
+    @Nullable
+    private URL url;
+    private final URI uri;
+    private final String stringForm;
+    /**
+     * Pre-selected proxy.
+     *
+     * If {@link #url} is null, this field is null.
+     * Otherwise, this field could still be null if the proxy couldn't be chosen
+     * upfront.
+     */
+    private Proxy proxy;
+
+    public EndpointAddress(URI uri) {
+        this.uri = uri;
+        this.stringForm = uri.toString();
+        try {
+            this.url = uri.toURL();
+            proxy = chooseProxy();
+        } catch (MalformedURLException e) {
+            // ignore
+        }
+    }
+
+    /**
+     *
+     * @see #create(String)
+     */
+    public EndpointAddress(String url) throws URISyntaxException {
+        this.uri = new URI(url);
+        this.stringForm = url;
+        try {
+            this.url = new URL(url);
+            proxy = chooseProxy();
+        } catch (MalformedURLException e) {
+            // ignore
+        }
+    }
+
+    /**
+     * Creates a new {@link EndpointAddress} with a reasonably
+     * generic error handling.
+     */
+    public static EndpointAddress create(String url) {
+        try {
+            return new EndpointAddress(url);
+        } catch(URISyntaxException e) {
+            throw new WebServiceException("Illegal endpoint address: "+url,e);
+        }
+    }
+
+    private Proxy chooseProxy() {
+        ProxySelector sel =
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<ProxySelector>() {
+                    public ProxySelector run() {
+                        return ProxySelector.getDefault();
+                    }
+                });
+
+        if(sel==null)
+            return Proxy.NO_PROXY;
+
+
+        if(!sel.getClass().getName().equals("sun.net.spi.DefaultProxySelector"))
+            // user-defined proxy. may return a different proxy for each invocation
+            return null;
+
+        Iterator<Proxy> it = sel.select(uri).iterator();
+        if(it.hasNext())
+            return it.next();
+
+        return Proxy.NO_PROXY;
+    }
+
+    /**
+     * Returns an URL of this endpoint adress.
+     *
+     * @return
+     *      null if this endpoint address doesn't have a registered {@link URLStreamHandler}.
+     */
+    public URL getURL() {
+        return url;
+    }
+
+    /**
+     * Returns an URI of the endpoint address.
+     *
+     * @return
+     *      always non-null.
+     */
+    public URI getURI() {
+        return uri;
+    }
+
+    /**
+     * Tries to open {@link URLConnection} for this endpoint.
+     *
+     * <p>
+     * This is possible only when an endpoint address has
+     * the corresponding {@link URLStreamHandler}.
+     *
+     * @throws IOException
+     *      if {@link URL#openConnection()} reports an error.
+     * @throws AssertionError
+     *      if this endpoint doesn't have an associated URL.
+     *      if the code is written correctly this shall never happen.
+     */
+    public URLConnection openConnection() throws IOException {
+        assert url!=null : uri+" doesn't have the corresponding URL";
+        if(proxy!=null)
+            return url.openConnection(proxy);
+        else
+            return url.openConnection();
+    }
+
+    public String toString() {
+        return stringForm;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/FeatureConstructor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/FeatureConstructor.java
new file mode 100644
index 0000000..6fba74b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/FeatureConstructor.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressing;
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
+import com.sun.xml.internal.ws.developer.Stateful;
+import com.sun.xml.internal.ws.developer.StatefulFeature;
+
+import javax.xml.ws.WebServiceFeature;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * This annotation should be used on a constructor of classes extending {@link WebServiceFeature} other than
+ * Spec defined features, to help JAX-WS runtime recognize feature extensions.
+ * </p>
+ * <p>
+ * For WebServiceFeature annotations to be recognizable by JAX-WS runtime, the feature annotation should point
+ * to a corresponding bean (class extending WebServiceFeature). Only one of the constructors in the bean MUST be marked
+ * with @FeatureConstructor whose value captures the annotaion attribute names for the corresponding parameters.
+ * </p>
+ * For example,
+ * @see MemberSubmissionAddressingFeature
+ * @see MemberSubmissionAddressing
+ *
+ * @see Stateful
+ * @see StatefulFeature
+ *
+ * @author Rama Pulavarthi
+ */
+@Retention(RUNTIME)
+@Target(ElementType.CONSTRUCTOR)
+
+public @interface FeatureConstructor {
+    /**
+     * The name of the parameter.
+     */
+    String[] value() default {};
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/PropertySet.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/PropertySet.java
new file mode 100644
index 0000000..8b8ae22
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/PropertySet.java
@@ -0,0 +1,422 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.util.ReadOnlyPropertyException;
+
+import javax.xml.ws.handler.MessageContext;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.AbstractMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * A set of "properties" that can be accessed via strongly-typed fields
+ * as well as reflexibly through the property name.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+@SuppressWarnings("SuspiciousMethodCalls")
+public abstract class PropertySet {
+
+    /**
+     * Creates a new instance of TypedMap.
+     */
+    protected PropertySet() {}
+
+    /**
+     * Marks a field on {@link PropertySet} as a
+     * property of {@link MessageContext}.
+     *
+     * <p>
+     * To make the runtime processing easy, this annotation
+     * must be on a public field (since the property name
+     * can be set through {@link Map} anyway, you won't be
+     * losing abstraction by doing so.)
+     *
+     * <p>
+     * For similar reason, this annotation can be only placed
+     * on a reference type, not primitive type.
+     *
+     * @see Packet
+     * @author Kohsuke Kawaguchi
+     */
+    @Inherited
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target({ElementType.FIELD,ElementType.METHOD})
+    public @interface Property {
+        /**
+         * Name of the property.
+         */
+        String[] value();
+    }
+
+    /**
+     * Represents the list of strongly-typed known propertyies
+     * (keyed by property names.)
+     *
+     * <p>
+     * Just giving it an alias to make the use of this class more fool-proof.
+     */
+    protected static final class PropertyMap extends HashMap<String,Accessor> {}
+
+    /**
+     * Map representing the Fields and Methods annotated with {@link Property}.
+     * Model of {@link PropertySet} class.
+     *
+     * <p>
+     * At the end of the derivation chain this method just needs to be implemented
+     * as:
+     *
+     * <pre>
+     * private static final PropertyMap model;
+     * static {
+     *   model = parse(MyDerivedClass.class);
+     * }
+     * protected PropertyMap getPropertyMap() {
+     *   return model;
+     * }
+     * </pre>
+     */
+    protected abstract PropertyMap getPropertyMap();
+
+    // maybe we can use this some time
+    ///**
+    // * If all the properties defined on this {@link PropertySet} has a certain prefix
+    // * (such as, say, "javax.xml.ws.http."), then return it.
+    // *
+    // * <p>
+    // * Returning a non-null name from this method allows methods like
+    // * {@link #get(Object)} and {@link #put(String, Object)} to work faster.
+    // * This is especially so with {@link DistributedPropertySet}, so implementations
+    // * are encouraged to set a common prefix, as much as possible.
+    // *
+    // * <p>
+    // * Currently, this is used only by {@link DistributedPropertySet}.
+    // *
+    // * @return
+    // *      Null if no such common prefix exists. Otherwise string like
+    // *      "javax.xml.ws.http." (the dot at the last is usually preferrable,
+    // *      so that properties like "javax.xml.ws.https.something" won't match.
+    // */
+    //protected abstract String getPropertyPrefix();
+
+    /**
+     * This method parses a class for fields and methods with {@link Property}.
+     */
+    protected static PropertyMap parse(final Class clazz) {
+        // make all relevant fields and methods accessible.
+        // this allows runtime to skip the security check, so they runs faster.
+        return AccessController.doPrivileged(new PrivilegedAction<PropertyMap>() {
+            public PropertyMap run() {
+                PropertyMap props = new PropertyMap();
+                for( Class c=clazz; c!=null; c=c.getSuperclass()) {
+                    for (Field f : c.getDeclaredFields()) {
+                        Property cp = f.getAnnotation(Property.class);
+                        if(cp!=null) {
+                            for(String value : cp.value()) {
+                                props.put(value, new FieldAccessor(f, value));
+                            }
+                        }
+                    }
+                    for (Method m : c.getDeclaredMethods()) {
+                        Property cp = m.getAnnotation(Property.class);
+                        if(cp!=null) {
+                            String name = m.getName();
+                            assert name.startsWith("get");
+
+                            String setName = 's'+name.substring(1);   // getFoo -> setFoo
+                            Method setter;
+                            try {
+                                setter = clazz.getMethod(setName,m.getReturnType());
+                            } catch (NoSuchMethodException e) {
+                                setter = null; // no setter
+                            }
+                            for(String value : cp.value()) {
+                                props.put(value, new MethodAccessor(m, setter, value));
+                            }
+                        }
+                    }
+                }
+
+                return props;
+            }
+        });
+    }
+
+    /**
+     * Represents a typed property defined on a {@link PropertySet}.
+     */
+    protected interface Accessor {
+        String getName();
+        boolean hasValue(PropertySet props);
+        Object get(PropertySet props);
+        void set(PropertySet props, Object value);
+    }
+
+    static final class FieldAccessor implements Accessor {
+        /**
+         * Field with the annotation.
+         */
+        private final Field f;
+
+        /**
+         * One of the values in {@link Property} annotation on {@link #f}.
+         */
+        private final String name;
+
+        protected FieldAccessor(Field f, String name) {
+            this.f = f;
+            f.setAccessible(true);
+            this.name = name;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public boolean hasValue(PropertySet props) {
+            return get(props)!=null;
+        }
+
+        public Object get(PropertySet props) {
+            try {
+                return f.get(props);
+            } catch (IllegalAccessException e) {
+                throw new AssertionError();
+            }
+        }
+
+        public void set(PropertySet props, Object value) {
+            try {
+                f.set(props,value);
+            } catch (IllegalAccessException e) {
+                throw new AssertionError();
+            }
+        }
+    }
+
+    static final class MethodAccessor implements Accessor {
+        /**
+         * Getter method.
+         */
+        private final @NotNull Method getter;
+        /**
+         * Setter method.
+         * Some property is read-only.
+         */
+        private final @Nullable Method setter;
+
+        /**
+         * One of the values in {@link Property} annotation on {@link #getter}.
+         */
+        private final String name;
+
+        protected MethodAccessor(Method getter, Method setter, String value) {
+            this.getter = getter;
+            this.setter = setter;
+            this.name = value;
+            getter.setAccessible(true);
+            if(setter!=null)
+                setter.setAccessible(true);
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public boolean hasValue(PropertySet props) {
+            return get(props)!=null;
+        }
+
+        public Object get(PropertySet props) {
+            try {
+                return getter.invoke(props);
+            } catch (IllegalAccessException e) {
+                throw new AssertionError();
+            } catch (InvocationTargetException e) {
+                handle(e);
+                return 0;   // never reach here
+            }
+        }
+
+        public void set(PropertySet props, Object value) {
+            if(setter==null)
+                throw new ReadOnlyPropertyException(getName());
+            try {
+                setter.invoke(props,value);
+            } catch (IllegalAccessException e) {
+                throw new AssertionError();
+            } catch (InvocationTargetException e) {
+                handle(e);
+            }
+        }
+
+        /**
+         * Since we don't expect the getter/setter to throw a checked exception,
+         * it should be possible to make the exception propagation transparent.
+         * That's what we are trying to do here.
+         */
+        private Exception handle(InvocationTargetException e) {
+            Throwable t = e.getTargetException();
+            if(t instanceof Error)
+                throw (Error)t;
+            if(t instanceof RuntimeException)
+                throw (RuntimeException)t;
+            throw new Error(e);
+        }
+    }
+
+
+    public final boolean containsKey(Object key) {
+        return get(key)!=null;
+    }
+
+    /**
+     * Gets the name of the property.
+     *
+     * @param key
+     *      This field is typed as {@link Object} to follow the {@link Map#get(Object)}
+     *      convention, but if anything but {@link String} is passed, this method
+     *      just returns null.
+     */
+    public Object get(Object key) {
+        Accessor sp = getPropertyMap().get(key);
+        if(sp!=null)
+            return sp.get(this);
+        throw new IllegalArgumentException("Undefined property "+key);
+    }
+
+    /**
+     * Sets a property.
+     *
+     * <h3>Implementation Note</h3>
+     * This method is slow. Code inside JAX-WS should define strongly-typed
+     * fields in this class and access them directly, instead of using this.
+     *
+     * @throws ReadOnlyPropertyException
+     *      if the given key is an alias of a strongly-typed field,
+     *      and if the name object given is not assignable to the field.
+     *
+     * @see Property
+     */
+    public Object put(String key, Object value) {
+        Accessor sp = getPropertyMap().get(key);
+        if(sp!=null) {
+            Object old = sp.get(this);
+            sp.set(this,value);
+            return old;
+        } else {
+            throw new IllegalArgumentException("Undefined property "+key);
+        }
+    }
+
+    /**
+     * Checks if this {@link PropertySet} supports a property of the given name.
+     */
+    public boolean supports(Object key) {
+        return getPropertyMap().containsKey(key);
+    }
+
+    public Object remove(Object key) {
+        Accessor sp = getPropertyMap().get(key);
+        if(sp!=null) {
+            Object old = sp.get(this);
+            sp.set(this,null);
+            return old;
+        } else {
+            throw new IllegalArgumentException("Undefined property "+key);
+        }
+    }
+
+
+    /**
+     * Lazily created view of {@link Property}s that
+     * forms the core of {@link #createMapView()}.
+     */
+    /*package*/ Set<Entry<String,Object>> mapViewCore;
+
+    /**
+     * Creates a {@link Map} view of this {@link PropertySet}.
+     *
+     * <p>
+     * This map is partially live, in the sense that values you set to it
+     * will be reflected to {@link PropertySet}.
+     *
+     * <p>
+     * However, this map may not pick up changes made
+     * to {@link PropertySet} after the view is created.
+     *
+     * @return
+     *      always non-null valid instance.
+     */
+    public final Map<String,Object> createMapView() {
+        final Set<Entry<String,Object>> core = new HashSet<Entry<String,Object>>();
+        createEntrySet(core);
+
+        return new AbstractMap<String, Object>() {
+            public Set<Entry<String,Object>> entrySet() {
+                return core;
+            }
+        };
+    }
+
+    /*package*/ void createEntrySet(Set<Entry<String,Object>> core) {
+        for (final Entry<String, Accessor> e : getPropertyMap().entrySet()) {
+            core.add(new Entry<String, Object>() {
+                public String getKey() {
+                    return e.getKey();
+                }
+
+                public Object getValue() {
+                    return e.getValue().get(PropertySet.this);
+                }
+
+                public Object setValue(Object value) {
+                    Accessor acc = e.getValue();
+                    Object old = acc.get(PropertySet.this);
+                    acc.set(PropertySet.this,value);
+                    return old;
+                }
+            });
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/SOAPVersion.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/SOAPVersion.java
new file mode 100644
index 0000000..4642d6c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/SOAPVersion.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.ws.soap.SOAPBinding;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ * Version of SOAP (1.1 and 1.2).
+ *
+ * <p>
+ * This class defines various constants for SOAP 1.1 and SOAP 1.2,
+ * and also defines convenience methods to simplify the processing
+ * of multiple SOAP versions.
+ *
+ * <p>
+ * This constant alows you to do:
+ *
+ * <pre>
+ * SOAPVersion version = ...;
+ * version.someOp(...);
+ * </pre>
+ *
+ * As opposed to:
+ *
+ * <pre>
+ * if(binding is SOAP11) {
+ *   doSomeOp11(...);
+ * } else {
+ *   doSomeOp12(...);
+ * }
+ * </pre>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public enum SOAPVersion {
+    SOAP_11(SOAPBinding.SOAP11HTTP_BINDING,
+            com.sun.xml.internal.ws.encoding.soap.SOAPConstants.URI_ENVELOPE,
+            "text/xml",
+            SOAPConstants.URI_SOAP_ACTOR_NEXT, "actor",
+            javax.xml.soap.SOAPConstants.SOAP_1_1_PROTOCOL,
+            new QName(com.sun.xml.internal.ws.encoding.soap.SOAPConstants.URI_ENVELOPE, "MustUnderstand"),
+            "Client",
+            "Server",
+            Collections.singleton(SOAPConstants.URI_SOAP_ACTOR_NEXT)),
+
+    SOAP_12(SOAPBinding.SOAP12HTTP_BINDING,
+            SOAP12Constants.URI_ENVELOPE,
+            "application/soap+xml",
+            SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER, "role",
+            javax.xml.soap.SOAPConstants.SOAP_1_2_PROTOCOL,
+            new QName(com.sun.xml.internal.ws.encoding.soap.SOAP12Constants.URI_ENVELOPE, "MustUnderstand"),
+            "Sender",
+            "Receiver",
+            new HashSet<String>(Arrays.asList(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT,SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER)));
+
+    /**
+     * Binding ID for SOAP/HTTP binding of this SOAP version.
+     *
+     * <p>
+     * Either {@link SOAPBinding#SOAP11HTTP_BINDING} or
+     *  {@link SOAPBinding#SOAP12HTTP_BINDING}
+     */
+    public final String httpBindingId;
+
+    /**
+     * SOAP envelope namespace URI.
+     */
+    public final String nsUri;
+
+    /**
+     * Content-type. Either "text/xml" or "application/soap+xml".
+     */
+    public final String contentType;
+
+    /**
+     * SOAP MustUnderstand FaultCode for this SOAP version
+     */
+    public final QName faultCodeMustUnderstand;
+
+    /**
+     * SAAJ {@link MessageFactory} for this SOAP version.
+     */
+    public final MessageFactory saajMessageFactory;
+
+    /**
+     * SAAJ {@link SOAPFactory} for this SOAP version.
+     */
+    public final SOAPFactory saajSoapFactory;
+
+    /**
+     * If the actor/role attribute is absent, this SOAP version assumes this value.
+     */
+    public final String implicitRole;
+
+    /**
+     * Singleton set that contains {@link #implicitRole}.
+     */
+    public final Set<String> implicitRoleSet;
+
+    /**
+     * This represents the roles required to be assumed by SOAP binding implementation.
+     */
+    public final Set<String> requiredRoles;
+
+    /**
+     * "role" (SOAP 1.2) or "actor" (SOAP 1.1)
+     */
+    public final String roleAttributeName;
+
+    /**
+     * "{nsUri}Client" or "{nsUri}Sender"
+     */
+    public final QName faultCodeClient;
+
+    /**
+     * "{nsUri}Server" or "{nsUri}Receiver"
+     */
+    public final QName faultCodeServer;
+
+
+    private SOAPVersion(String httpBindingId, String nsUri, String contentType, String implicitRole, String roleAttributeName,
+                        String saajFactoryString, QName faultCodeMustUnderstand, String faultCodeClientLocalName,
+                        String faultCodeServerLocalName,Set<String> requiredRoles) {
+        this.httpBindingId = httpBindingId;
+        this.nsUri = nsUri;
+        this.contentType = contentType;
+        this.implicitRole = implicitRole;
+        this.implicitRoleSet = Collections.singleton(implicitRole);
+        this.roleAttributeName = roleAttributeName;
+        try {
+            saajMessageFactory = MessageFactory.newInstance(saajFactoryString);
+            saajSoapFactory = SOAPFactory.newInstance(saajFactoryString);
+        } catch (SOAPException e) {
+            throw new Error(e);
+        }
+        this.faultCodeMustUnderstand = faultCodeMustUnderstand;
+        this.requiredRoles = requiredRoles;
+        this.faultCodeClient = new QName(nsUri,faultCodeClientLocalName);
+        this.faultCodeServer = new QName(nsUri,faultCodeServerLocalName);
+    }
+
+
+    public String toString() {
+        return httpBindingId;
+    }
+
+    /**
+     * Returns {@link SOAPVersion} whose {@link #httpBindingId} equals to
+     * the given string.
+     *
+     * This method does not perform input string validation.
+     *
+     * @param binding
+     *      for historical reason, we treat null as {@link #SOAP_11},
+     *      but you really shouldn't be passing null.
+     * @return always non-null.
+     */
+    public static SOAPVersion fromHttpBinding(String binding) {
+        if(binding==null)
+            return SOAP_11;
+
+        if(binding.equals(SOAP_12.httpBindingId))
+            return SOAP_12;
+        else
+            return SOAP_11;
+    }
+
+    /**
+     * Returns {@link SOAPVersion} whose {@link #nsUri} equals to
+     * the given string.
+     *
+     * This method does not perform input string validation.
+     *
+     * @param nsUri
+     *      must not be null.
+     * @return always non-null.
+     */
+    public static SOAPVersion fromNsUri(String nsUri) {
+        if(nsUri.equals(SOAP_12.nsUri))
+            return SOAP_12;
+        else
+            return SOAP_11;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSBinding.java
new file mode 100644
index 0000000..c1a4381
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSBinding.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.handler.Handler;
+import java.util.List;
+
+/**
+ * JAX-WS implementation of {@link Binding}.
+ *
+ * <p>
+ * This object can be created by {@link BindingID#createBinding()}.
+ *
+ * <p>
+ * Binding conceptually includes the on-the-wire format of the message,
+ * this this object owns {@link Codec}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSBinding extends Binding {
+    /**
+     * Gets the SOAP version of this binding.
+     *
+     * TODO: clarify what to do with XML/HTTP binding
+     *
+     * <p>
+     * This is just a shor-cut for  {@code getBindingID().getSOAPVersion()}
+     *
+     * @return
+     *      If the binding is using SOAP, this method returns
+     *      a {@link SOAPVersion} constant.
+     *
+     *      If the binding is not based on SOAP, this method
+     *      returns null. See {@link Message} for how a non-SOAP
+     *      binding shall be handled by {@link Tube}s.
+     */
+    SOAPVersion getSOAPVersion();
+    /**
+     * Gets the WS-Addressing version of this binding.
+     * <p/>
+     * TODO: clarify what to do with XML/HTTP binding
+     *
+     * @return If the binding is using SOAP and WS-Addressing is enabled,
+     *         this method returns a {@link AddressingVersion} constant.
+     *         If binding is not using SOAP or WS-Addressing is not enabled,
+     *         this method returns null.
+     *
+     *          This might be little slow as it has to go over all the features on binding.
+     *          Its advisable to cache the addressingVersion wherever possible and reuse it.
+     */
+    AddressingVersion getAddressingVersion();
+
+    /**
+     * Gets the binding ID, which uniquely identifies the binding.
+     *
+     * <p>
+     * The relevant specs define the binding IDs and what they mean.
+     * The ID is used in many places to identify the kind of binding
+     * (such as SOAP1.1, SOAP1.2, REST, ...)
+     *
+     * @return
+     *      Always non-null same value.
+     */
+    @NotNull BindingID getBindingId();
+
+    @NotNull List<Handler> getHandlerChain();
+
+    /**
+     * Checks if a particular {@link WebServiceFeature} is enabled.
+     *
+     * @return
+     *      true if enabled.
+     */
+    boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature);
+
+    /**
+     * Gets a {@link WebServiceFeature} of the specific type.
+     *
+     * @param featureType
+     *      The type of the feature to retrieve.
+     * @return
+     *      If the feature is present and enabled, return a non-null instance.
+     *      Otherwise null.
+     */
+    @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType);
+
+    /**
+     * Returns a list of features associated with {@link WSBinding}.
+     */
+    @NotNull WSFeatureList getFeatures();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSFeatureList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSFeatureList.java
new file mode 100644
index 0000000..6fe13df
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSFeatureList.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Read-only list of {@link WebServiceFeature}s.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSFeatureList extends Iterable<WebServiceFeature> {
+    /**
+     * Checks if a particular {@link WebServiceFeature} is enabled.
+     *
+     * @return
+     *      true if enabled.
+     */
+    boolean isEnabled(@NotNull Class<? extends WebServiceFeature> feature);
+
+    /**
+     * Gets a {@link WebServiceFeature} of the specific type.
+     *
+     * @param featureType
+     *      The type of the feature to retrieve.
+     * @return
+     *      If the feature is present and enabled, return a non-null instance.
+     *      Otherwise null.
+     */
+    @Nullable <F extends WebServiceFeature> F get(@NotNull Class<F> featureType);
+
+    /**
+     * Obtains all the features in the array.
+      */
+    @NotNull WebServiceFeature[] toArray();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSService.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSService.java
new file mode 100644
index 0000000..42cdd66
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSService.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.spi.ServiceDelegate;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * JAX-WS implementation of {@link ServiceDelegate}.
+ *
+ * <p>
+ * This abstract class is used only to improve the static type safety
+ * of the JAX-WS internal API.
+ *
+ * <p>
+ * The class name intentionally doesn't include "Delegate",
+ * because the fact that it's a delegate is a detail of
+ * the JSR-224 API, and for the layers above us this object
+ * nevertheless represents {@link Service}. We want them
+ * to think of this as an internal representation of a service.
+ *
+ * <p>
+ * Only JAX-WS internal code may downcast this to {@link WSServiceDelegate}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class WSService extends ServiceDelegate {
+    protected WSService() {
+    }
+
+    /**
+     * Works like {@link #getPort(EndpointReference, Class, WebServiceFeature...)}
+     * but takes {@link WSEndpointReference}.
+     */
+    public abstract <T> T getPort(WSEndpointReference epr, Class<T> portInterface, WebServiceFeature... features);
+
+    /**
+     * Works like {@link #createDispatch(EndpointReference, Class, Mode, WebServiceFeature[])}
+     * but it takes the port name separately, so that EPR without embedded metadata can be used.
+     */
+    public abstract <T> Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, Service.Mode mode, WebServiceFeature... features);
+
+    /**
+     * Works like {@link #createDispatch(EndpointReference, JAXBContext, Mode, WebServiceFeature[])}
+     * but it takes the port name separately, so that EPR without embedded metadata can be used.
+     */
+    public abstract Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features);
+
+    /**
+     * Create a <code>Service</code> instance.
+     *
+     * The specified WSDL document location and service qualified name MUST
+     * uniquely identify a <code>wsdl:service</code> element.
+     *
+     * @param wsdlDocumentLocation URL for the WSDL document location
+     *                             for the service
+     * @param serviceName QName for the service
+     * @throws WebServiceException If any error in creation of the
+     *                    specified service.
+     **/
+    public static WSService create( URL wsdlDocumentLocation, QName serviceName) {
+        return new WSServiceDelegate(wsdlDocumentLocation,serviceName,Service.class);
+    }
+
+    /**
+     * Create a <code>Service</code> instance.
+     *
+     * @param serviceName QName for the service
+     * @throws WebServiceException If any error in creation of the
+     *                    specified service
+     */
+    public static WSService create(QName serviceName) {
+        return create(null,serviceName);
+    }
+
+    /**
+     * Creates a service with a dummy service name.
+     */
+    public static WSService create() {
+        return create(null,new QName(WSService.class.getName(),"dummy"));
+    }
+
+    /**
+     * Obtains the {@link WSService} that's encapsulated inside a {@link Service}.
+     *
+     * @throws IllegalArgumentException
+     *      if the given service object is not from the JAX-WS RI.
+     */
+    public static WSService unwrap(final Service svc) {
+        return AccessController.doPrivileged(new PrivilegedAction<WSService>() {
+            public WSService run() {
+                try {
+                    Field f = svc.getClass().getField("delegate");
+                    f.setAccessible(true);
+                    Object delegate = f.get(svc);
+                    if(!(delegate instanceof WSService))
+                        throw new IllegalArgumentException();
+                    return (WSService) delegate;
+                } catch (NoSuchFieldException e) {
+                    AssertionError x = new AssertionError("Unexpected service API implementation");
+                    x.initCause(e);
+                    throw x;
+                } catch (IllegalAccessException e) {
+                    IllegalAccessError x = new IllegalAccessError(e.getMessage());
+                    x.initCause(e);
+                    throw x;
+                }
+            }
+        });
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java
new file mode 100644
index 0000000..9a28f71
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java
@@ -0,0 +1,744 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
+import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
+import com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference;
+import com.sun.xml.internal.ws.message.stream.OutboundStreamHeader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.ByteArrayInputStream;
+
+/**
+ * 'Traits' object that absorbs differences of WS-Addressing versions.
+ *
+ * @author Arun Gupta
+ */
+public enum AddressingVersion {
+
+    W3C("http://www.w3.org/2005/08/addressing",
+        W3CAddressingConstants.ANONYMOUS_EPR,
+        "http://www.w3.org/2006/05/addressing/wsdl",
+        "http://www.w3.org/2006/05/addressing/wsdl",
+        "http://www.w3.org/2005/08/addressing/anonymous",
+        "http://www.w3.org/2005/08/addressing/none",
+        new EPR(W3CEndpointReference.class,
+                    "Address",
+                    "ServiceName",
+                    "EndpointName",
+                    "InterfaceName",
+                    new QName("http://www.w3.org/2005/08/addressing","Metadata"),
+                    "ReferenceParameters",
+                    null )) {
+
+        /* package */  String getActionMismatchLocalName() {
+            return "ActionMismatch";
+        }
+        @Override
+        public boolean isReferenceParameter(String localName) {
+            return localName.equals("ReferenceParameters");
+        }
+
+        @Override
+        public WsaTubeHelper getWsaHelper(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+            return new com.sun.xml.internal.ws.addressing.WsaTubeHelperImpl(wsdlPort, seiModel, binding);
+        }
+
+        @Override
+        /* package */ String getMapRequiredLocalName() {
+            return "MessageAddressingHeaderRequired";
+        }
+
+        @Override
+        public String getMapRequiredText() {
+            return "A required header representing a Message Addressing Property is not present";
+        }
+
+        /* package */ String getInvalidAddressLocalName() {
+            return "InvalidAddress";
+        }
+
+        @Override
+        /* package */ String getInvalidMapLocalName() {
+            return "InvalidAddressingHeader";
+        }
+
+        @Override
+        public String getInvalidMapText() {
+            return "A header representing a Message Addressing Property is not valid and the message cannot be processed";
+        }
+
+        @Override
+        /* package */ String getInvalidCardinalityLocalName() {
+            return "InvalidCardinality";
+        }
+
+        /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName) {
+            return new OutboundReferenceParameterHeader(mark,nsUri,localName);
+        }
+
+        /*package*/ String getIsReferenceParameterLocalName() {
+            return "IsReferenceParameter";
+        }
+
+        /* package */ String getWsdlAnonymousLocalName() {
+            return "Anonymous";
+        }
+
+        public String getPrefix() {
+            return "wsa";
+        }
+
+        public String getWsdlPrefix() {
+            return "wsaw";
+        }
+
+        public Class<? extends WebServiceFeature> getFeatureClass() {
+            return AddressingFeature.class;
+        }
+    },
+    MEMBER("http://schemas.xmlsoap.org/ws/2004/08/addressing",
+           MemberSubmissionAddressingConstants.ANONYMOUS_EPR,
+           "http://schemas.xmlsoap.org/ws/2004/08/addressing",
+           "http://schemas.xmlsoap.org/ws/2004/08/addressing/policy",
+           "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous",
+            "",
+           new EPR(MemberSubmissionEndpointReference.class,
+                    "Address",
+                    "ServiceName",
+                    "PortName",
+                    "PortType",
+                    MemberSubmissionAddressingConstants.MEX_METADATA,
+                    "ReferenceParameters",
+                    "ReferenceProperties")) {
+        /* package */  String getActionMismatchLocalName() {
+            return "InvalidMessageInformationHeader";
+        }
+        @Override
+        public boolean isReferenceParameter(String localName) {
+            return localName.equals("ReferenceParameters") || localName.equals("ReferenceProperties");
+        }
+
+        @Override
+        public WsaTubeHelper getWsaHelper(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+            return new com.sun.xml.internal.ws.addressing.v200408.WsaTubeHelperImpl(wsdlPort, seiModel, binding);
+        }
+
+        @Override
+        /* package */ String getMapRequiredLocalName() {
+            return "MessageInformationHeaderRequired";
+        }
+
+        @Override
+        public String getMapRequiredText() {
+            return "A required message information header, To, MessageID, or Action, is not present.";
+        }
+
+        /* package */ String getInvalidAddressLocalName() {
+            return getInvalidMapLocalName();
+        }
+
+        @Override
+        /* package */ String getInvalidMapLocalName() {
+            return "InvalidMessageInformationHeader";
+        }
+
+        @Override
+        public String getInvalidMapText() {
+            return "A message information header is not valid and the message cannot be processed.";
+        }
+
+        @Override
+        /* package */ String getInvalidCardinalityLocalName() {
+            return getInvalidMapLocalName();
+        }
+
+        /*package*/ Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName) {
+            return new OutboundStreamHeader(mark,nsUri,localName);
+        }
+
+        /*package*/ String getIsReferenceParameterLocalName() {
+            return "";
+        }
+
+        /* package */ String getWsdlAnonymousLocalName() {
+            return "";
+        }
+
+        public String getPrefix() {
+            return "wsa";
+        }
+
+        public String getWsdlPrefix() {
+            return "wsaw";
+        }
+
+        public Class<? extends WebServiceFeature> getFeatureClass() {
+            return MemberSubmissionAddressingFeature.class;
+        }
+    };
+
+    /**
+     * Namespace URI
+     */
+    public final String nsUri;
+
+    /**
+     * Namespace URI for the WSDL Binding
+     */
+    public final String wsdlNsUri;
+
+    /**
+     * Representing either {@link W3CEndpointReference} or
+     * {@link MemberSubmissionEndpointReference}.
+     */
+    public final EPR eprType;
+
+    /**
+     * Namespace URI for the WSDL Binding
+     */
+    public final String policyNsUri;
+
+    /**
+     * Gets the anonymous URI value associated with this WS-Addressing version.
+     */
+    public final @NotNull String anonymousUri;
+
+    /**
+     * Gets the none URI value associated with this WS-Addressing version.
+     */
+    public final @NotNull String noneUri;
+
+    /**
+     * Represents the anonymous EPR.
+     */
+    public final WSEndpointReference anonymousEpr;
+
+    /**
+     * Represents the To QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName toTag;
+
+    /**
+     * Represents the From QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName fromTag;
+
+    /**
+     * Represents the ReplyTo QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName replyToTag;
+
+    /**
+     * Represents the FaultTo QName for a specific WS-Addressing Version.
+     */
+    public final QName faultToTag;
+
+    /**
+     * Represents the Action QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName actionTag;
+
+    /**
+     * Represents the MessageID QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName messageIDTag;
+
+    /**
+     * Represents the RelatesTo QName in the SOAP message for a specific WS-Addressing Version.
+     */
+    public final QName relatesToTag;
+
+    /**
+     * Represents the QName of the fault code when a required header representing a
+     * WS-Addressing Message Addressing Property is not present.
+     */
+    public final QName mapRequiredTag;
+
+    /**
+     * Represents the QName of the fault code when Action is not supported at this endpoint.
+     */
+    public final QName actionMismatchTag;
+
+    /**
+     * Represents the QName of the fault code when Action is not supported at this endpoint.
+     */
+    public final QName actionNotSupportedTag;
+
+    /**
+     * Represents the text of the fault when Action is not supported at this endpoint.
+     */
+    public final String actionNotSupportedText;
+
+    /**
+     * Represents the QName of the fault code when a header representing a
+     * WS-Addressing Message Addressing Property is invalid and cannot be processed.
+     */
+    public final QName invalidMapTag;
+
+    /**
+     * Represents the QName of the fault code when a header representing a
+     * WS-Addressing Message Addressing Property occurs greater than expected number.
+     */
+    public final QName invalidCardinalityTag;
+
+    /**
+     * Represents the QName of the fault code when a header representing an
+     * address is not valid.
+     */
+    public final QName invalidAddressTag;
+
+    /**
+     * Represents the QName of the element that conveys additional information
+     * on the pre-defined WS-Addressing faults.
+     */
+    public final QName problemHeaderQNameTag;
+
+    /**
+     * Represents the QName of the element that conveys additional information
+     * if Action is not matching with that expected.
+     */
+    public final QName problemActionTag;
+
+    /**
+     * Represents the QName of the header element that is used to capture the fault detail
+     * if there is a fault processing WS-Addressing Message Addressing Property. This is
+     * only used for SOAP 1.1.
+     */
+    public final QName faultDetailTag;
+
+    /**
+     * Fault sub-sub-code that represents
+     * "Specifies that the invalid header was expected to be an EPR but did not contain an [address]."
+     */
+    public final QName fault_missingAddressInEpr;
+
+    /**
+     * Represents the Action QName in the WSDL for a specific WS-Addressing Version.
+     */
+    public final QName wsdlActionTag;
+
+    /**
+     * Represents the WSDL extension QName for a specific WS-Addressing Version.
+     */
+    public final QName wsdlExtensionTag;
+
+    /**
+     * Represents the WSDL anonymous QName for a specific WS-Addressing Version.
+     */
+    public final QName wsdlAnonymousTag;
+
+    /**
+     * Represents the QName of the reference parameter in a SOAP message. This is
+     * only valid for W3C WS-Addressing.
+     */
+    public final QName isReferenceParameterTag;
+
+    private static final String EXTENDED_FAULT_NAMESPACE = "http://jax-ws.dev.java.net/addressing/fault";
+    public static final String UNSET_OUTPUT_ACTION = "http://jax-ws.dev.java.net/addressing/output-action-not-set";
+    public static final String UNSET_INPUT_ACTION = "http://jax-ws.dev.java.net/addressing/input-action-not-set";
+
+    /**
+     * Fault sub-sub-code that represents duplicate &lt;Address> element in EPR.
+     * This is a fault code not defined in the spec.
+     */
+    public static final QName fault_duplicateAddressInEpr = new QName(
+        EXTENDED_FAULT_NAMESPACE, "DuplicateAddressInEpr"
+    );
+
+    private AddressingVersion(String nsUri, String anonymousEprString, String wsdlNsUri, String policyNsUri,
+                              String anonymousUri, String noneUri,
+                              EPR eprType ) {
+        this.nsUri = nsUri;
+        this.wsdlNsUri = wsdlNsUri;
+        this.policyNsUri = policyNsUri;
+        this.anonymousUri = anonymousUri;
+        this.noneUri = noneUri;
+        toTag = new QName(nsUri,"To");
+        fromTag = new QName(nsUri,"From");
+        replyToTag = new QName(nsUri,"ReplyTo");
+        faultToTag = new QName(nsUri,"FaultTo");
+        actionTag = new QName(nsUri,"Action");
+        messageIDTag = new QName(nsUri,"MessageID");
+        relatesToTag = new QName(nsUri,"RelatesTo");
+
+        mapRequiredTag = new QName(nsUri,getMapRequiredLocalName());
+        actionMismatchTag = new QName(nsUri,getActionMismatchLocalName());
+        actionNotSupportedTag = new QName(nsUri,"ActionNotSupported");
+        actionNotSupportedText = "The \"%s\" cannot be processed at the receiver";
+        invalidMapTag = new QName(nsUri,getInvalidMapLocalName());
+        invalidAddressTag = new QName(nsUri,getInvalidAddressLocalName());
+        invalidCardinalityTag = new QName(nsUri,getInvalidCardinalityLocalName());
+        faultDetailTag = new QName(nsUri,"FaultDetail");
+
+        problemHeaderQNameTag = new QName(nsUri,"ProblemHeaderQName");
+        problemActionTag = new QName(nsUri, "ProblemAction");
+
+        fault_missingAddressInEpr = new QName(nsUri,"MissingAddressInEPR","wsa");
+        isReferenceParameterTag = new QName(nsUri,getIsReferenceParameterLocalName());
+
+        wsdlActionTag = new QName(wsdlNsUri,"Action");
+        wsdlExtensionTag = new QName(wsdlNsUri, "UsingAddressing");
+        wsdlAnonymousTag = new QName(wsdlNsUri, getWsdlAnonymousLocalName());
+
+        // create stock anonymous EPR
+        try {
+            this.anonymousEpr = new WSEndpointReference(new ByteArrayInputStream(anonymousEprString.getBytes()),this);
+        } catch (XMLStreamException e) {
+            throw new Error(e); // bug in our code as EPR should parse.
+        }
+        this.eprType = eprType;
+    }
+
+    /**
+     * Gets the local name of the fault when a header representing a WS-Addressing Action is not same as SOAPAction
+     *
+     * @return local name
+     */
+    /* package */ abstract String getActionMismatchLocalName();
+
+    /**
+     * Returns {@link AddressingVersion} whose {@link #nsUri} equals to
+     * the given string.
+     *
+     * This method does not perform input string validation.
+     *
+     * @param nsUri
+     *      must not be null.
+     * @return always non-null.
+     */
+    public static AddressingVersion fromNsUri(String nsUri) {
+        if (nsUri.equals(W3C.nsUri))
+            return W3C;
+
+        if (nsUri.equals(MEMBER.nsUri))
+            return MEMBER;
+
+        return null;
+    }
+
+    /**
+     * Gets the {@link AddressingVersion} from a {@link WSBinding}
+     *
+     * @param binding WSDL binding
+     * @return
+     *     addresing version enabled, or null if none is enabled.
+     */
+    public static @Nullable
+    AddressingVersion fromBinding(WSBinding binding) {
+        // TODO: who is responsible for reporting an error if both versions
+        // are on?
+        if (binding.isFeatureEnabled(AddressingFeature.class))
+            return W3C;
+
+        if (binding.isFeatureEnabled(MemberSubmissionAddressingFeature.class))
+            return MEMBER;
+
+        return null;
+    }
+
+    /**
+     * Gets the {@link AddressingVersion} from a {@link WSDLPort}
+     *
+     * @param port WSDL port
+     * @return addresing version
+     */
+    public static AddressingVersion fromPort(WSDLPort port) {
+        if (port == null)
+            return null;
+
+        WebServiceFeature wsf = port.getFeature(AddressingFeature.class);
+        if (wsf == null) {
+            wsf = port.getFeature(MemberSubmissionAddressingFeature.class);
+        }
+        if (wsf == null)
+            return null;
+
+        return fromFeature(wsf);
+    }
+
+    /**
+     * Returns {@link #nsUri} associated with this {@link AddressingVersion}
+     *
+     * @return namespace URI
+     * @deprecated
+     *      Use {@link #nsUri}.
+     */
+    public String getNsUri() {
+        return nsUri;
+    }
+
+    /**
+     * Returns true if the given local name is considered as
+     * a reference parameter in EPR.
+     *
+     * For W3C, this means "ReferenceParameters",
+     * and for the member submission version, this means
+     * either "ReferenceParameters" or "ReferenceProperties".
+     */
+    public abstract boolean isReferenceParameter(String localName);
+
+    /**
+     * Returns WsaTubeHelper for the WS-Addressing version identified by <code>binding</code>
+     * {@link WSBinding} and for the {@link WSDLPort} port.
+     *
+     * @return WS-A version specific helper
+     */
+    public abstract WsaTubeHelper getWsaHelper(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding);
+
+    /**
+     * Gets the none URI value associated with this WS-Addressing version.
+     *
+     * @return none URI value
+     * @deprecated
+     *      Use {@link #noneUri}.
+     */
+    public final String getNoneUri() {
+        return noneUri;
+    }
+
+    /**
+     * Gets the anonymous URI value associated with this WS-Addressing version.
+     *
+     * @deprecated
+     *      Use {@link #anonymousUri}
+     */
+    public final String getAnonymousUri() {
+        return anonymousUri;
+    }
+
+    /**
+     * Gets the default fault Action value associated with this WS-Addressing version.
+     *
+     * @return default fault Action value
+     */
+    public String getDefaultFaultAction() {
+        return nsUri + "/fault";
+    }
+
+    /**
+     * Gets the local name of the fault when a header representing a WS-Addressing Message
+     * Addresing Property is absent.
+     *
+     * @return local name
+     */
+    /* package */ abstract String getMapRequiredLocalName();
+
+    /**
+     * Gets the description text when a required WS-Addressing header representing a
+     * Message Addressing Property is absent.
+     *
+     * @return description text
+     */
+    public abstract String getMapRequiredText();
+
+    /**
+         * Gets the local name of the fault when a header representing anaddress is invalid.
+         * @return local name
+         */
+    /* package */ abstract String getInvalidAddressLocalName();
+
+
+    /**
+     * Gets the local name of the fault when a header representing a WS-Addressing Message
+     * Addresing Property is invalid and cannot be processed.
+     *
+     * @return local name
+     */
+    /* package */ abstract String getInvalidMapLocalName();
+
+    /**
+     * Gets the description text when a header representing a WS-Addressing
+     * Message Addressing Property is invalid and cannot be processed.
+     *
+     * @return description text
+     */
+    public abstract String getInvalidMapText();
+
+    /**
+     * Gets the local name of the fault when a header representing a WS-Addressing Message
+     * Addresing Property occurs greater than expected number.
+     *
+     * @return local name
+     */
+    /* package */ abstract String getInvalidCardinalityLocalName();
+
+    /* package */ abstract String getWsdlAnonymousLocalName();
+
+    public abstract String getPrefix();
+
+    public abstract String getWsdlPrefix();
+
+    public abstract Class<? extends WebServiceFeature> getFeatureClass();
+    /**
+     * Creates an outbound {@link Header} from a reference parameter.
+     */
+    /*package*/ abstract Header createReferenceParameterHeader(XMLStreamBuffer mark, String nsUri, String localName);
+
+    /**
+     * Gets the local name for wsa:IsReferenceParameter. This method will return a valid
+     * value only valid for W3C WS-Addressing. For Member Submission WS-Addressing, this method
+     * returns null.
+     */
+    /*package*/ abstract String getIsReferenceParameterLocalName();
+
+    public static AddressingVersion fromFeature(WebServiceFeature af) {
+        if (af.getID().equals(AddressingFeature.ID))
+            return W3C;
+        else if (af.getID().equals(MemberSubmissionAddressingFeature.ID))
+            return MEMBER;
+        else
+            return null;
+    }
+
+    /**
+     * Gets the {@link WebServiceFeature} corresponding to the namespace URI of
+     * WS-Addressing policy assertion in the WSDL. <code>enabled</code> and
+     * <code>required</code> are used to initialize the value of the feature.
+     *
+     * @param nsUri namespace URI of the WS-Addressing policy assertion in the WSDL
+     * @param enabled true if feature is to be enabled, false otherwise
+     * @param required true if feature is required, false otherwise. Corresponds
+     *          to wsdl:required on the extension/assertion.
+     * @return WebServiceFeature corresponding to the assertion namespace URI
+     * @throws WebServiceException if an unsupported namespace URI is passed
+     */
+    public static @NotNull WebServiceFeature getFeature(String nsUri, boolean enabled, boolean required) {
+        if (nsUri.equals(W3C.policyNsUri))
+            return new AddressingFeature(enabled, required);
+        else if (nsUri.equals(MEMBER.policyNsUri))
+            return new MemberSubmissionAddressingFeature(enabled, required);
+        else
+            throw new WebServiceException("Unsupported namespace URI: " + nsUri);
+    }
+
+    /**
+     * Gets the corresponding {@link AddressingVersion} instance from the
+     * EPR class.
+     */
+    public static @NotNull AddressingVersion fromSpecClass(Class<? extends EndpointReference> eprClass) {
+        if(eprClass==W3CEndpointReference.class)
+            return W3C;
+        if(eprClass==MemberSubmissionEndpointReference.class)
+            return MEMBER;
+        throw new WebServiceException("Unsupported EPR type: "+eprClass);
+    }
+
+    /**
+     * Returns true if the WebServiceFeature is either a {@link AddressingFeature} or
+     * {@link MemberSubmissionAddressingFeature} and is required.
+     *
+     * @param wsf The WebServiceFeature encaps
+     * @throws WebServiceException if <code>wsf</code> does not contain either {@link AddressingFeature} or
+     * {@link MemberSubmissionAddressingFeature}
+     * @return true if <code>wsf</code> requires WS-Addressing
+     */
+    public static boolean isRequired(WebServiceFeature wsf) {
+        if (wsf.getID().equals(AddressingFeature.ID)) {
+            return ((AddressingFeature)wsf).isRequired();
+        } else if (wsf.getID().equals(MemberSubmissionAddressingFeature.ID)) {
+            return ((MemberSubmissionAddressingFeature)wsf).isRequired();
+        } else
+            throw new WebServiceException("WebServiceFeature not an Addressing feature: "+ wsf.getID());
+    }
+
+    /**
+     * Returns true if <code>binding</code> contains either a {@link AddressingFeature} or
+     * {@link MemberSubmissionAddressingFeature} and is required.
+     *
+     * @param binding The binding
+     * @return true if <code>binding</code> requires WS-Addressing
+     */
+    public static boolean isRequired(WSBinding binding) {
+        AddressingFeature af = binding.getFeature(AddressingFeature.class);
+        if (af != null)
+            return af.isRequired();
+        MemberSubmissionAddressingFeature msaf = binding.getFeature(MemberSubmissionAddressingFeature.class);
+        if(msaf != null)
+            return msaf.isRequired();
+
+        return false;
+    }
+
+    /**
+     * Returns true if <code>binding</code> contains either a {@link AddressingFeature} or
+     * {@link MemberSubmissionAddressingFeature} and is enabled.
+     *
+     * @param binding The binding
+     * @return true if WS-Addressing is enabled for <code>binding</code>.
+     */
+    public static boolean isEnabled(WSBinding binding) {
+        return binding.isFeatureEnabled(MemberSubmissionAddressingFeature.class) ||
+                binding.isFeatureEnabled(AddressingFeature.class);
+    }
+
+    public final static class EPR {
+        public final Class<? extends EndpointReference> eprClass;
+        public final String address;
+        public final String serviceName;
+        public final String portName;
+        public final String portTypeName;
+        public final String referenceParameters;
+        /**
+         * Element under which metadata is specified.
+         * In W3C, it is wsa:Metadata
+         * In Member, it is directly under mex:MetadataSection
+         */
+        public final QName wsdlMetadata;
+        public final String referenceProperties;
+
+        public EPR(Class<? extends EndpointReference> eprClass, String address, String serviceName, String portName,
+                    String portTypeName, QName wsdlMetadata,
+                    String referenceParameters, String referenceProperties) {
+            this.eprClass = eprClass;
+            this.address = address;
+            this.serviceName = serviceName;
+            this.portName = portName;
+            this.portTypeName = portTypeName;
+            this.referenceParameters = referenceParameters;
+            this.referenceProperties = referenceProperties;
+            this.wsdlMetadata = wsdlMetadata;
+
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java
new file mode 100644
index 0000000..977bab8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.message.AbstractHeaderImpl;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMResult;
+
+/**
+ * Used to represent outbound endpoint reference header,
+ * such as &lt;ReplyTo> and &lt;FaultTo>.
+ * Used from {@link WSEndpointReference}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see WSEndpointReference
+ */
+final class EPRHeader extends AbstractHeaderImpl {
+
+    private final String nsUri,localName;
+    private final WSEndpointReference epr;
+
+    EPRHeader(QName tagName, WSEndpointReference epr) {
+        this.nsUri = tagName.getNamespaceURI();
+        this.localName = tagName.getLocalPart();
+        this.epr = epr;
+    }
+
+    public @NotNull String getNamespaceURI() {
+        return nsUri;
+    }
+
+    public @NotNull String getLocalPart() {
+        return localName;
+    }
+
+    @Nullable
+    public String getAttribute(@NotNull String nsUri, @NotNull String localName) {
+        try {
+            XMLStreamReader sr = epr.read("EndpointReference"/*doesn't matter*/);
+            while(sr.getEventType()!= XMLStreamConstants.START_ELEMENT)
+                sr.next();
+
+            return sr.getAttributeValue(nsUri,localName);
+        } catch (XMLStreamException e) {
+            // since we are reading from buffer, this can't happen.
+            throw new AssertionError(e);
+        }
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        return epr.read(localName);
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        epr.writeTo(localName, w);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        try {
+            // TODO what about in-scope namespaces
+            // Not very efficient consider implementing a stream buffer
+            // processor that produces a DOM node from the buffer.
+            Transformer t = XmlUtil.newTransformer();
+            t.transform(epr.asSource(localName), new DOMResult(saaj.getSOAPHeader()));
+        } catch (Exception e) {
+            throw new SOAPException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        epr.writeTo(localName,contentHandler,errorHandler,true);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java
new file mode 100644
index 0000000..cbcecb7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.addressing;
+
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Unsupported RI extension to work around an issue in WSIT.
+ *
+ * <p>
+ * <b>This feature is not meant to be used by a common Web service developer</b> as there
+ * is no need to send the above mentioned header for a one-way operation. But these
+ * properties may need to be sent in certain middleware Web services.
+ *
+ * <p>
+ * This feature allows ReplyTo, From and RelatesTo Message Addressing Properties
+ * to be added for all messages that are sent from the port configured with
+ * this annotation. All operations are assumed to be one-way, and
+ * this feature should be used for one-way
+ * operations only.
+ *
+ * If a non-null ReplyTo is specified, then MessageID property is also added.
+ *
+ * @author Arun Gupta
+ */
+public class OneWayFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the {@link OneWayFeature}
+     */
+    public static final String ID = "http://java.sun.com/xml/ns/jaxws/addressing/oneway";
+
+    private WSEndpointReference replyTo;
+    private WSEndpointReference from;
+    private String relatesToID;
+
+    /**
+     * Create an {@link OneWayFeature}. The instance created will be enabled.
+     */
+    public OneWayFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Create an {@link OneWayFeature}
+     *
+     * @param enabled specifies whether this feature should
+     *                be enabled or not.
+     */
+    public OneWayFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * Create an {@link OneWayFeature}
+     *
+     * @param enabled specifies whether this feature should be enabled or not.
+     * @param replyTo specifies the {@link WSEndpointReference} of wsa:ReplyTo header.
+     */
+    public OneWayFeature(boolean enabled, WSEndpointReference replyTo) {
+        this.enabled = enabled;
+        this.replyTo = replyTo;
+    }
+
+    /**
+     * Create an {@link OneWayFeature}
+     *
+     * @param enabled specifies whether this feature should be enabled or not.
+     * @param replyTo specifies the {@link WSEndpointReference} of wsa:ReplyTo header.
+     * @param from specifies the {@link WSEndpointReference} of wsa:From header.
+     * @param relatesTo specifies the MessageID to be used for wsa:RelatesTo header.
+     */
+    @FeatureConstructor({"enabled","replyTo","from","relatesTo"})
+    public OneWayFeature(boolean enabled, WSEndpointReference replyTo, WSEndpointReference from, String relatesTo) {
+        this.enabled = enabled;
+        this.replyTo = replyTo;
+        this.from = from;
+        this.relatesToID = relatesTo;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+
+    /**
+     * Getter for wsa:ReplyTo header {@link WSEndpointReference} .
+     *
+     * @return address of the wsa:ReplyTo header
+     */
+    public WSEndpointReference getReplyTo() {
+        return replyTo;
+    }
+
+    /**
+     * Setter for wsa:ReplyTo header {@link WSEndpointReference}.
+     *
+     * @param address
+     */
+    public void setReplyTo(WSEndpointReference address) {
+        this.replyTo = address;
+    }
+
+    /**
+     * Getter for wsa:From header {@link WSEndpointReference}.
+     *
+     * @return address of the wsa:From header
+     */
+    public WSEndpointReference getFrom() {
+        return from;
+    }
+
+    /**
+     * Setter for wsa:From header {@link WSEndpointReference}.
+     *
+     * @param address of the wsa:From header
+     */
+    public void setFrom(WSEndpointReference address) {
+        this.from = address;
+    }
+
+    /**
+     * Getter for MessageID for wsa:RelatesTo header.
+     *
+     * @return address of the wsa:FaultTo header
+     */
+    public String getRelatesToID() {
+        return relatesToID;
+    }
+
+    /**
+     * Setter for MessageID for wsa:RelatesTo header.
+     *
+     * @param id
+     */
+    public void setRelatesToID(String id) {
+        this.relatesToID = id;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java
new file mode 100644
index 0000000..f0de7f5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.addressing;
+
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferException;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.message.AbstractHeaderImpl;
+import com.sun.xml.internal.ws.util.xml.XMLStreamWriterFilter;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.util.StreamReaderDelegate;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Used to represent outbound header created from {@link WSEndpointReference}'s
+ * referenec parameters.
+ *
+ * <p>
+ * This is optimized for outbound use, so it implements some of the methods lazily,
+ * in a slow way.
+ *
+ * <p>
+ * This header adds "wsa:IsReferenceParameter" and thus only used for the W3C version.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class OutboundReferenceParameterHeader extends AbstractHeaderImpl {
+    private final XMLStreamBuffer infoset;
+    private final String nsUri,localName;
+
+    /**
+     * The attributes on the header element.
+     * Lazily parsed.
+     * Null if not parsed yet.
+     */
+    private FinalArrayList<Attribute> attributes;
+
+    OutboundReferenceParameterHeader(XMLStreamBuffer infoset, String nsUri, String localName) {
+        this.infoset = infoset;
+        this.nsUri = nsUri;
+        this.localName = localName;
+    }
+
+    public @NotNull String getNamespaceURI() {
+        return nsUri;
+    }
+
+    public @NotNull String getLocalPart() {
+        return localName;
+    }
+
+    public String getAttribute(String nsUri, String localName) {
+        if(attributes==null)
+            parseAttributes();
+        for(int i=attributes.size()-1; i>=0; i-- ) {
+            Attribute a = attributes.get(i);
+            if(a.localName.equals(localName) && a.nsUri.equals(nsUri))
+                return a.value;
+        }
+        return null;
+    }
+
+    /**
+     * We don't really expect this to be used, but just to satisfy
+     * the {@link Header} contract.
+     *
+     * So this is rather slow.
+     */
+    private void parseAttributes() {
+        try {
+            XMLStreamReader reader = readHeader();
+            reader.nextTag();   // move to the first element, which is the header element
+
+            attributes = new FinalArrayList<Attribute>();
+
+            for (int i = 0; i < reader.getAttributeCount(); i++) {
+                final String localName = reader.getAttributeLocalName(i);
+                final String namespaceURI = reader.getAttributeNamespace(i);
+                final String value = reader.getAttributeValue(i);
+
+                attributes.add(new Attribute(namespaceURI,localName,value));
+            }
+
+            // we are adding one more attribute "wsa:IsReferenceParameter"
+            attributes.add(new Attribute(AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE));
+        } catch (XMLStreamException e) {
+            throw new WebServiceException("Unable to read the attributes for {"+nsUri+"}"+localName+" header",e);
+        }
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        return new StreamReaderDelegate(infoset.readAsXMLStreamReader()) {
+            int state=0; /* 0:expecting root, 1:in root, 2:past root */
+            public int next() throws XMLStreamException {
+                return check(super.next());
+            }
+
+            public int nextTag() throws XMLStreamException {
+                return check(super.nextTag());
+            }
+
+            private int check(int type) {
+                switch(state) {
+                case 0:
+                    if(type==START_ELEMENT)
+                        state=1;
+                    break;
+                case 1:
+                    state=2;
+                }
+
+                return type;
+            }
+
+            public int getAttributeCount() {
+                if(state==1)    return super.getAttributeCount()+1;
+                else            return super.getAttributeCount();
+            }
+
+            public String getAttributeLocalName(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return IS_REFERENCE_PARAMETER;
+                else
+                    return super.getAttributeLocalName(index);
+            }
+
+            public String getAttributeNamespace(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return AddressingVersion.W3C.nsUri;
+                else
+                    return super.getAttributeNamespace(index);
+            }
+
+            public String getAttributePrefix(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return "wsa";
+                else
+                    return super.getAttributePrefix(index);
+            }
+
+            public String getAttributeType(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return "CDATA";
+                else
+                    return super.getAttributeType(index);
+            }
+
+            public String getAttributeValue(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return TRUE_VALUE;
+                else
+                    return super.getAttributeValue(index);
+            }
+
+            public QName getAttributeName(int index) {
+                if(state==1 && index==super.getAttributeCount())
+                    return new QName(AddressingVersion.W3C.nsUri, IS_REFERENCE_PARAMETER, "wsa");
+                else
+                    return super.getAttributeName(index);
+            }
+
+            public String getAttributeValue(String namespaceUri, String localName) {
+                if(state==1 && localName.equals(IS_REFERENCE_PARAMETER) && namespaceUri.equals(AddressingVersion.W3C.nsUri))
+                    return TRUE_VALUE;
+                else
+                    return super.getAttributeValue(namespaceUri, localName);
+            }
+        };
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        infoset.writeToXMLStreamWriter(new XMLStreamWriterFilter(w) {
+            private boolean root=true;
+
+            public void writeStartElement(String localName) throws XMLStreamException {
+                super.writeStartElement(localName);
+                writeAddedAttribute();
+            }
+
+            private void writeAddedAttribute() throws XMLStreamException {
+                if(!root)   return;
+                root=false;
+                writeNamespace("wsa",AddressingVersion.W3C.nsUri);
+                super.writeAttribute("wsa",AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE);
+            }
+
+            public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+                super.writeStartElement(namespaceURI, localName);
+                writeAddedAttribute();
+            }
+
+            public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+                //TODO: Verify with KK later
+                //check if prefix is declared before writing start element.
+                boolean prefixDeclared = isPrefixDeclared(prefix,namespaceURI);
+                super.writeStartElement(prefix, localName, namespaceURI);
+                if(!prefixDeclared && !prefix.equals(""))
+                    super.writeNamespace(prefix,namespaceURI);
+                writeAddedAttribute();
+            }
+            public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException{
+                //TODO: Verify with KK later
+                if(isPrefixDeclared(prefix, namespaceURI)) {
+                    //Dont write it again , as its already in NamespaceContext
+                    return;
+                } else
+                    super.writeNamespace(prefix,namespaceURI);
+            }
+
+            private boolean isPrefixDeclared(String prefix, String namespaceURI ) {
+                return namespaceURI.equals(getNamespaceContext().getNamespaceURI(prefix));
+            }
+        },true);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        //TODO: SAAJ returns null instead of throwing SOAPException,
+        // when there is no SOAPHeader in the message,
+        // which leads to NPE.
+        try {
+            Element node = (Element)infoset.writeTo(saaj.getSOAPHeader());
+            node.setAttributeNS(AddressingVersion.W3C.nsUri,AddressingVersion.W3C.getPrefix()+":"+IS_REFERENCE_PARAMETER,TRUE_VALUE);
+        } catch (XMLStreamBufferException e) {
+            throw new SOAPException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        class Filter extends XMLFilterImpl {
+            Filter(ContentHandler ch) { setContentHandler(ch); }
+            private int depth=0;
+            public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+                if(depth++==0) {
+                    // add one more attribute
+                    super.startPrefixMapping("wsa",AddressingVersion.W3C.nsUri);
+                    AttributesImpl atts2 = new AttributesImpl(atts);
+                    atts2.addAttribute(
+                        AddressingVersion.W3C.nsUri,
+                        IS_REFERENCE_PARAMETER,
+                        "wsa:IsReferenceParameter",
+                        "CDATA",
+                        TRUE_VALUE);
+                    atts = atts2;
+                }
+
+                super.startElement(uri, localName, qName, atts);
+            }
+
+            public void endElement(String uri, String localName, String qName) throws SAXException {
+                super.endElement(uri, localName, qName);
+                if(--depth==0)
+                    super.endPrefixMapping("wsa");
+            }
+        }
+
+        infoset.writeTo(new Filter(contentHandler),errorHandler);
+    }
+
+
+    /**
+     * Keep the information about an attribute on the header element.
+     */
+    static final class Attribute {
+        /**
+         * Can be empty but never null.
+         */
+        final String nsUri;
+        final String localName;
+        final String value;
+
+        public Attribute(String nsUri, String localName, String value) {
+            this.nsUri = fixNull(nsUri);
+            this.localName = localName;
+            this.value = value;
+        }
+
+        /**
+         * Convert null to "".
+         */
+        private static String fixNull(String s) {
+            if(s==null) return "";
+            else        return s;
+        }
+    }
+
+    /**
+     * We the performance paranoid people in the JAX-WS RI thinks
+     * saving three bytes is worth while...
+     */
+    private static final String TRUE_VALUE = "1";
+    private static final String IS_REFERENCE_PARAMETER = "IsReferenceParameter";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java
new file mode 100644
index 0000000..6014672
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java
@@ -0,0 +1,954 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.addressing;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferSource;
+import com.sun.xml.internal.stream.buffer.sax.SAXBufferProcessor;
+import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferProcessor;
+import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferCreator;
+import com.sun.xml.internal.ws.addressing.EndpointReferenceUtil;
+import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.spi.ProviderImpl;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import com.sun.xml.internal.ws.util.xml.XMLStreamWriterFilter;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Internal representation of the EPR.
+ *
+ * <p>
+ * Instances of this class are immutable and thread-safe.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see AddressingVersion#anonymousEpr
+ */
+public final class WSEndpointReference {
+    private final XMLStreamBuffer infoset;
+    /**
+     * Version of the addressing spec.
+     */
+    private final AddressingVersion version;
+
+    /**
+     * Marked Reference parameters inside this EPR.
+     *
+     * Parsed when the object is created. can be empty but never null.
+     * @see #parse()
+     */
+    private @NotNull Header[] referenceParameters;
+    private @NotNull String address;
+
+    /**
+     * Creates from the spec version of {@link EndpointReference}.
+     *
+     * <p>
+     * This method performs the data conversion, so it's slow.
+     * Do not use this method in a performance critical path.
+     */
+    public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
+        try {
+            MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+            epr.writeTo(new XMLStreamBufferResult(xsb));
+            this.infoset = xsb;
+            this.version = version;
+            parse();
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
+        }
+    }
+
+    /**
+     * Creates from the spec version of {@link EndpointReference}.
+     *
+     * <p>
+     * This method performs the data conversion, so it's slow.
+     * Do not use this method in a performance critical path.
+     */
+    public WSEndpointReference(EndpointReference epr) {
+        this(epr,AddressingVersion.fromSpecClass(epr.getClass()));
+    }
+
+    /**
+     * Creates a {@link WSEndpointReference} that wraps a given infoset.
+     */
+    public WSEndpointReference(XMLStreamBuffer infoset, AddressingVersion version) {
+        try {
+            this.infoset = infoset;
+            this.version = version;
+            parse();
+        } catch (XMLStreamException e) {
+            // this can never happen because XMLStreamBuffer never has underlying I/O error.
+            throw new AssertionError(e);
+        }
+    }
+
+    /**
+     * Creates a {@link WSEndpointReference} by parsing an infoset.
+     */
+    public WSEndpointReference(InputStream infoset, AddressingVersion version) throws XMLStreamException {
+        this(XMLStreamReaderFactory.create(null,infoset,false),version);
+    }
+
+    /**
+     * Creates a {@link WSEndpointReference} from the given infoset.
+     * The {@link XMLStreamReader} must point to either a document or an element.
+     */
+    public WSEndpointReference(XMLStreamReader in, AddressingVersion version) throws XMLStreamException {
+        this(XMLStreamBuffer.createNewBufferFromXMLStreamReader(in), version);
+    }
+
+    /**
+     * @see #WSEndpointReference(String, AddressingVersion)
+     */
+    public WSEndpointReference(URL address, AddressingVersion version) {
+        this(address.toExternalForm(), version);
+    }
+
+    /**
+     * @see #WSEndpointReference(String, AddressingVersion)
+     */
+    public WSEndpointReference(URI address, AddressingVersion version) {
+        this(address.toString(), version);
+    }
+
+    /**
+     * Creates a {@link WSEndpointReference} that only has an address.
+     */
+    public WSEndpointReference(String address, AddressingVersion version) {
+        this.infoset = createBufferFromAddress(address,version);
+        this.version = version;
+        this.address = address;
+        this.referenceParameters = EMPTY_ARRAY;
+    }
+
+    private static XMLStreamBuffer createBufferFromAddress(String address, AddressingVersion version) {
+        try {
+            MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+            StreamWriterBufferCreator w = new StreamWriterBufferCreator(xsb);
+            w.writeStartDocument();
+            w.writeStartElement(version.getPrefix(),
+                "EndpointReference", version.nsUri);
+            w.writeNamespace(version.getPrefix(),
+                version.nsUri);
+            w.writeStartElement(version.getPrefix(),
+                W3CAddressingConstants.WSA_ADDRESS_NAME, version.nsUri);
+            w.writeCharacters(address);
+            w.writeEndElement();
+            w.writeEndElement();
+            w.writeEndDocument();
+            w.close();
+            return xsb;
+        } catch (XMLStreamException e) {
+            // can never happen because we are writing to XSB
+            throw new AssertionError(e);
+        }
+    }
+
+    /**
+     * Creates an EPR from individual components.
+     *
+     * <p>
+     * This version takes various information about metadata, and creates an EPR that has
+     * the necessary embedded WSDL.
+     */
+    public WSEndpointReference(@NotNull AddressingVersion version,
+                               @NotNull String address,
+                               @Nullable QName service,
+                               @Nullable QName port,
+                               @Nullable QName portType,
+                               @Nullable List<Element> metadata,
+                               @Nullable String wsdlAddress,
+                               @Nullable List<Element> referenceParameters) {
+       this(
+            createBufferFromData(version, address, referenceParameters, service, port, portType, metadata, wsdlAddress),
+            version );
+    }
+
+    private static XMLStreamBuffer createBufferFromData(AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType, List<Element> metadata, String wsdlAddress) {
+
+        StreamWriterBufferCreator writer = new StreamWriterBufferCreator();
+
+        try {
+            writer.writeStartDocument();
+            writer.writeStartElement(version.getPrefix(),"EndpointReference", version.nsUri);
+            writer.writeNamespace(version.getPrefix(),version.nsUri);
+            writer.writeStartElement(version.getPrefix(),"Address", version.nsUri);
+            writer.writeCharacters(address);
+            writer.writeEndElement();
+            if(referenceParameters != null) {
+                writer.writeStartElement(version.getPrefix(),"ReferenceParameters", version.nsUri);
+                for (Element e : referenceParameters)
+                    DOMUtil.serializeNode(e, writer);
+                writer.writeEndElement();
+            }
+
+            switch(version) {
+            case W3C:
+                writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress);
+                break;
+
+            case MEMBER:
+                writeMSMetaData(writer, service, port, portType, metadata);
+                if (wsdlAddress != null) {
+                    //Inline the wsdl as extensibility element
+                    //Write mex:Metadata wrapper
+                    writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
+                            MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
+                            MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
+                    writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
+                            MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
+                            MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
+                    writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
+                            MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);
+
+                    writeWsdl(writer, service, wsdlAddress);
+
+                    writer.writeEndElement();
+                    writer.writeEndElement();
+                }
+
+                break;
+            }
+            writer.writeEndElement();
+            writer.writeEndDocument();
+            writer.flush();
+
+            return writer.getXMLStreamBuffer();
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    private static void writeW3CMetaData(StreamWriterBufferCreator writer,
+                                         QName service,
+                                         QName port,
+                                         QName portType, List<Element> metadata,
+                                         String wsdlAddress) throws XMLStreamException {
+
+        writer.writeStartElement(AddressingVersion.W3C.getPrefix(),
+                W3CAddressingConstants.WSA_METADATA_NAME, AddressingVersion.W3C.nsUri);
+        writer.writeNamespace(AddressingVersion.W3C.getWsdlPrefix(),
+                AddressingVersion.W3C.wsdlNsUri);
+
+        //Write Interface info
+        if (portType != null) {
+            writer.writeStartElement(AddressingVersion.W3C.getWsdlPrefix(),
+                    W3CAddressingConstants.WSAW_INTERFACENAME_NAME,
+                    AddressingVersion.W3C.wsdlNsUri);
+            String portTypePrefix = portType.getPrefix();
+            if (portTypePrefix == null || portTypePrefix.equals("")) {
+                //TODO check prefix again
+                portTypePrefix = "wsns";
+            }
+            writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
+            writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
+            writer.writeEndElement();
+        }
+        if (service != null) {
+            //Write service and Port info
+            if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
+                writer.writeStartElement(AddressingVersion.W3C.getWsdlPrefix(),
+                        W3CAddressingConstants.WSAW_SERVICENAME_NAME,
+                        AddressingVersion.W3C.wsdlNsUri);
+                String servicePrefix = service.getPrefix();
+                if (servicePrefix == null || servicePrefix.equals("")) {
+                    //TODO check prefix again
+                    servicePrefix = "wsns";
+                }
+                writer.writeNamespace(servicePrefix, service.getNamespaceURI());
+                if (port != null) {
+                    writer.writeAttribute(W3CAddressingConstants.WSAW_ENDPOINTNAME_NAME, port.getLocalPart());
+                }
+                writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
+                writer.writeEndElement();
+            }
+        }
+        //Inline the wsdl
+        if (wsdlAddress != null) {
+            writeWsdl(writer, service, wsdlAddress);
+        }
+        //Add the extra metadata Elements
+        if (metadata != null)
+            for (Element e : metadata) {
+                DOMUtil.serializeNode(e, writer);
+            }
+        writer.writeEndElement();
+
+    }
+
+    private static void writeMSMetaData(StreamWriterBufferCreator writer,
+                                        QName service,
+                                        QName port,
+                                        QName portType, List<Element> metadata) throws XMLStreamException {
+        // TODO: write ReferenceProperties
+        //TODO: write ReferenceParameters
+        if (portType != null) {
+            //Write Interface info
+            writer.writeStartElement(AddressingVersion.MEMBER.getPrefix(),
+                    MemberSubmissionAddressingConstants.WSA_PORTTYPE_NAME,
+                    AddressingVersion.MEMBER.nsUri);
+
+
+            String portTypePrefix = portType.getPrefix();
+            if (portTypePrefix == null || portTypePrefix.equals("")) {
+                //TODO check prefix again
+                portTypePrefix = "wsns";
+            }
+            writer.writeNamespace(portTypePrefix, portType.getNamespaceURI());
+            writer.writeCharacters(portTypePrefix + ":" + portType.getLocalPart());
+            writer.writeEndElement();
+        }
+        //Write service and Port info
+        if (service != null) {
+            if (!(service.getNamespaceURI().equals("") || service.getLocalPart().equals(""))) {
+                writer.writeStartElement(AddressingVersion.MEMBER.getPrefix(),
+                        MemberSubmissionAddressingConstants.WSA_SERVICENAME_NAME,
+                        AddressingVersion.MEMBER.nsUri);
+                String servicePrefix = service.getPrefix();
+                if (servicePrefix == null || servicePrefix.equals("")) {
+                    //TODO check prefix again
+                    servicePrefix = "wsns";
+                }
+                writer.writeNamespace(servicePrefix, service.getNamespaceURI());
+                if (port != null) {
+                    writer.writeAttribute(MemberSubmissionAddressingConstants.WSA_PORTNAME_NAME,
+                            port.getLocalPart());
+                }
+                writer.writeCharacters(servicePrefix + ":" + service.getLocalPart());
+                writer.writeEndElement();
+            }
+        }
+    }
+
+    private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
+       // Inline-wsdl
+       writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
+               WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
+               WSDLConstants.NS_WSDL);
+       writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
+       writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
+               WSDLConstants.QNAME_IMPORT.getLocalPart(),
+               WSDLConstants.NS_WSDL);
+       writer.writeAttribute("namespace", service.getNamespaceURI());
+       writer.writeAttribute("location", wsdlAddress);
+       writer.writeEndElement();
+       writer.writeEndElement();
+   }
+
+
+
+    /**
+     * Converts from {@link EndpointReference}.
+     *
+     * This handles null {@link EndpointReference} correctly.
+     * Call {@link #WSEndpointReference(EndpointReference)} directly
+     * if you know it's not null.
+     */
+    public static @Nullable
+    WSEndpointReference create(@Nullable EndpointReference epr) {
+        if (epr != null)
+            return new WSEndpointReference(epr);
+        else
+            return null;
+    }
+
+    /**
+     * @see #createWithAddress(String)
+     */
+    public @NotNull WSEndpointReference createWithAddress(@NotNull URI newAddress) {
+        return createWithAddress(newAddress.toString());
+    }
+
+    /**
+     * @see #createWithAddress(String)
+     */
+    public @NotNull WSEndpointReference createWithAddress(@NotNull URL newAddress) {
+        return createWithAddress(newAddress.toString());
+    }
+
+    /**
+     * Creates a new {@link WSEndpointReference} by replacing the address of this EPR
+     * to the new one.
+     *
+     * <p>
+     * The following example shows how you can use this to force an HTTPS EPR,
+     * when the endpoint can serve both HTTP and HTTPS requests.
+     * <pre>
+     * if(epr.getAddress().startsWith("http:"))
+     *   epr = epr.createWithAddress("https:"+epr.getAddress().substring(5));
+     * </pre>
+     *
+     * @param newAddress
+     *      This is a complete URL to be written inside &lt;Adress> element of the EPR,
+     *      such as "http://foo.bar/abc/def"
+     */
+    public @NotNull WSEndpointReference createWithAddress(@NotNull final String newAddress) {
+        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+        XMLFilterImpl filter = new XMLFilterImpl() {
+            private boolean inAddress = false;
+            public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+                if(localName.equals("Address") && uri.equals(version.nsUri))
+                    inAddress = true;
+                super.startElement(uri,localName,qName,atts);
+            }
+
+            public void characters(char ch[], int start, int length) throws SAXException {
+                if(!inAddress)
+                    super.characters(ch, start, length);
+            }
+
+
+            public void endElement(String uri, String localName, String qName) throws SAXException {
+                if(inAddress)
+                    super.characters(newAddress.toCharArray(),0,newAddress.length());
+                inAddress = false;
+                super.endElement(uri, localName, qName);
+            }
+        };
+        filter.setContentHandler(xsb.createFromSAXBufferCreator());
+        try {
+            infoset.writeTo(filter,false);
+        } catch (SAXException e) {
+            throw new AssertionError(e); // impossible since we are writing from XSB to XSB.
+        }
+
+        return new WSEndpointReference(xsb,version);
+    }
+
+    /**
+     * Convert the EPR to the spec version. The actual type of
+     * {@link EndpointReference} to be returned depends on which version
+     * of the addressing spec this EPR conforms to.
+     *
+     * @throws WebServiceException
+     *      if the conversion fails, which can happen if the EPR contains
+     *      invalid infoset (wrong namespace URI, etc.)
+     */
+    public @NotNull EndpointReference toSpec() {
+        return ProviderImpl.INSTANCE.readEndpointReference(asSource("EndpointReference"));
+    }
+
+    /**
+     * Converts the EPR to the specified spec version.
+     *
+     * If the {@link #getVersion() the addressing version in use} and
+     * the given class is different, then this may involve version conversion.
+     */
+    public @NotNull <T extends EndpointReference> T toSpec(Class<T> clazz) {
+        return EndpointReferenceUtil.transform(clazz,toSpec());
+    }
+
+    /**
+     * Creates a proxy that can be used to talk to this EPR.
+     *
+     * <p>
+     * All the normal WS-Addressing processing happens automatically,
+     * such as setting the endpoint address to {@link #getAddress() the address},
+     * and sending the reference parameters associated with this EPR as
+     * headers, etc.
+     */
+    public @NotNull <T> T getPort(@NotNull Service jaxwsService,
+                     @NotNull Class<T> serviceEndpointInterface,
+                     WebServiceFeature... features)     {
+        // TODO: implement it in a better way
+        return jaxwsService.getPort(toSpec(),serviceEndpointInterface,features);
+    }
+
+    /**
+     * Creates a {@link Dispatch} that can be used to talk to this EPR.
+     *
+     * <p>
+     * All the normal WS-Addressing processing happens automatically,
+     * such as setting the endpoint address to {@link #getAddress() the address},
+     * and sending the reference parameters associated with this EPR as
+     * headers, etc.
+     */
+    public @NotNull <T> Dispatch<T> createDispatch(
+        @NotNull Service jaxwsService,
+        @NotNull Class<T> type,
+        @NotNull Service.Mode mode,
+        WebServiceFeature... features) {
+
+        // TODO: implement it in a better way
+        return jaxwsService.createDispatch(toSpec(),type,mode,features);
+    }
+
+    /**
+     * Creates a {@link Dispatch} that can be used to talk to this EPR.
+     *
+     * <p>
+     * All the normal WS-Addressing processing happens automatically,
+     * such as setting the endpoint address to {@link #getAddress() the address},
+     * and sending the reference parameters associated with this EPR as
+     * headers, etc.
+     */
+    public @NotNull Dispatch<Object> createDispatch(
+        @NotNull Service jaxwsService,
+        @NotNull JAXBContext context,
+        @NotNull Service.Mode mode,
+        WebServiceFeature... features) {
+
+        // TODO: implement it in a better way
+        return jaxwsService.createDispatch(toSpec(),context,mode,features);
+    }
+
+    /**
+     * Gets the addressing version of this EPR.
+     */
+    public @NotNull AddressingVersion getVersion() {
+        return version;
+    }
+
+    /**
+     * The value of the &lt;wsa:address> header.
+     */
+    public @NotNull String getAddress() {
+        return address;
+    }
+
+    /**
+     * Returns true if this has anonymous URI as the {@link #getAddress() address}.
+     */
+    public boolean isAnonymous() {
+        return address.equals(version.anonymousUri);
+    }
+
+    /**
+     * Returns true if this has {@link AddressingVersion#noneUri none URI}
+     * as the {@link #getAddress() address}.
+     */
+    public boolean isNone() {
+        return address.equals(version.noneUri);
+    }
+
+    /**
+     * Parses inside EPR and mark all reference parameters.
+     */
+    private void parse() throws XMLStreamException {
+        // TODO: validate the EPR structure.
+        // check for non-existent Address, that sort of things.
+
+        StreamReaderBufferProcessor xsr = infoset.readAsXMLStreamReader();
+
+        // parser should be either at the start element or the start document
+        if(xsr.getEventType()==XMLStreamReader.START_DOCUMENT)
+            xsr.nextTag();
+        assert xsr.getEventType()==XMLStreamReader.START_ELEMENT;
+
+        String rootLocalName = xsr.getLocalName();
+        if(!xsr.getNamespaceURI().equals(version.nsUri))
+            throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION(
+                version.nsUri, xsr.getNamespaceURI()));
+
+        // since often EPR doesn't have a reference parameter, create array lazily
+        List<Header> marks=null;
+
+        while(xsr.nextTag()==XMLStreamReader.START_ELEMENT) {
+            String localName = xsr.getLocalName();
+            if(version.isReferenceParameter(localName)) {
+                XMLStreamBuffer mark;
+                while((mark = xsr.nextTagAndMark())!=null) {
+                    if(marks==null)
+                        marks = new ArrayList<Header>();
+
+                    // TODO: need a different header for member submission version
+                    marks.add(version.createReferenceParameterHeader(
+                        mark, xsr.getNamespaceURI(), xsr.getLocalName()));
+                    XMLStreamReaderUtil.skipElement(xsr);
+                }
+            } else
+            if(localName.equals("Address")) {
+                if(address!=null) // double <Address>. That's an error.
+                    throw new InvalidMapException(new QName(version.nsUri,rootLocalName),AddressingVersion.fault_duplicateAddressInEpr);
+                address = xsr.getElementText();
+            } else {
+                XMLStreamReaderUtil.skipElement(xsr);
+            }
+        }
+
+        // hit to </EndpointReference> by now
+
+        if(marks==null) {
+            this.referenceParameters = EMPTY_ARRAY;
+        } else {
+            this.referenceParameters = marks.toArray(new Header[marks.size()]);
+        }
+
+        if(address==null)
+            throw new InvalidMapException(new QName(version.nsUri,rootLocalName),version.fault_missingAddressInEpr);
+    }
+
+
+    /**
+     * Reads this EPR as {@link XMLStreamReader}.
+     *
+     * @param localName
+     *      EPR uses a different root tag name depending on the context.
+     *      The returned {@link XMLStreamReader} will use the given local name
+     *      for the root element name.
+     */
+    public XMLStreamReader read(final @NotNull String localName) throws XMLStreamException {
+        return new StreamReaderBufferProcessor(infoset) {
+            protected void processElement(String prefix, String uri, String _localName) {
+                if(_depth==0)
+                        _localName = localName;
+                super.processElement(prefix, uri, _localName);
+            }
+        };
+    }
+
+    /**
+     * Returns a {@link Source} that represents this EPR.
+     *
+     * @param localName
+     *      EPR uses a different root tag name depending on the context.
+     *      The returned {@link Source} will use the given local name
+     *      for the root element name.
+     */
+    public Source asSource(@NotNull String localName) {
+        return new SAXSource(new SAXBufferProcessorImpl(localName),new InputSource());
+    }
+
+    /**
+     * Writes this EPR to the given {@link ContentHandler}.
+     *
+     * @param localName
+     *      EPR uses a different root tag name depending on the context.
+     *      The returned {@link Source} will use the given local name
+     *      for the root element name.
+     * @param fragment
+     *      If true, generate a fragment SAX events without start/endDocument callbacks.
+     *      If false, generate a full XML document event.
+     */
+    public void writeTo(@NotNull String localName, ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        SAXBufferProcessorImpl p = new SAXBufferProcessorImpl(localName);
+        p.setContentHandler(contentHandler);
+        p.setErrorHandler(errorHandler);
+        p.process(infoset,fragment);
+    }
+
+    /**
+     * Writes this EPR into the given writer.
+     *
+     * @param localName
+     *      EPR uses a different root tag name depending on the context.
+     *      The returned {@link Source} will use the given local name
+     */
+    public void writeTo(final @NotNull String localName, @NotNull XMLStreamWriter w) throws XMLStreamException {
+        infoset.writeToXMLStreamWriter(new XMLStreamWriterFilter(w) {
+            private boolean root=true;
+
+            @Override
+            public void writeStartDocument() throws XMLStreamException {
+            }
+
+            @Override
+            public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+            }
+
+            @Override
+            public void writeStartDocument(String version) throws XMLStreamException {
+            }
+
+            @Override
+            public void writeEndDocument() throws XMLStreamException {
+            }
+
+            private String override(String ln) {
+                if(root) {
+                    root = false;
+                    return localName;
+                }
+                return ln;
+            }
+
+            public void writeStartElement(String localName) throws XMLStreamException {
+                super.writeStartElement(override(localName));
+            }
+
+            public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+                super.writeStartElement(namespaceURI, override(localName));
+            }
+
+            public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+                super.writeStartElement(prefix, override(localName), namespaceURI);
+            }
+        },true/*write as fragment*/);
+    }
+
+    /**
+     * Returns a {@link Header} that wraps this {@link WSEndpointReference}.
+     *
+     * <p>
+     * The returned header is immutable too, and can be reused with
+     * many {@link Message}s.
+     *
+     * @param rootTagName
+     *      The header tag name to be used, such as &lt;ReplyTo> or &lt;FaultTo>.
+     *      (It's bit ugly that this method takes {@link QName} and not just local name,
+     *      unlike other methods. If it's making the caller's life miserable, then
+     *      we can talk.)
+     */
+    public Header createHeader(QName rootTagName) {
+        return new EPRHeader(rootTagName,this);
+    }
+
+    /**
+     * Copies all the reference parameters in this EPR as headers
+     * to the given {@link HeaderList}.
+     */
+    public void addReferenceParameters(HeaderList outbound) {
+        for (Header header : referenceParameters) {
+            outbound.add(header);
+        }
+    }
+
+    /**
+     * Dumps the EPR infoset in a human-readable string.
+     */
+    @Override
+    public String toString() {
+        try {
+            // debug convenience
+            StringWriter sw = new StringWriter();
+            XmlUtil.newTransformer().transform(asSource("EndpointReference"),new StreamResult(sw));
+            return sw.toString();
+        } catch (TransformerException e) {
+            return e.toString();
+        }
+    }
+
+    /**
+     * Filtering {@link SAXBufferProcessor} that replaces the root tag name.
+     */
+    class SAXBufferProcessorImpl extends SAXBufferProcessor {
+        private final String rootLocalName;
+        private boolean root=true;
+
+        public SAXBufferProcessorImpl(String rootLocalName) {
+            super(infoset,false);
+            this.rootLocalName = rootLocalName;
+        }
+
+        protected void processElement(String uri, String localName, String qName) throws SAXException {
+            if(root) {
+                root = false;
+
+                if(qName.equals(localName)) {
+                    qName = localName = rootLocalName;
+                } else {
+                    localName = rootLocalName;
+                    int idx = qName.indexOf(':');
+                    qName = qName.substring(0,idx+1)+rootLocalName;
+                }
+            }
+            super.processElement(uri, localName, qName);
+        }
+    }
+
+    private static final OutboundReferenceParameterHeader[] EMPTY_ARRAY = new OutboundReferenceParameterHeader[0];
+
+    /**
+     * Parses the metadata inside this EPR and obtains it in a easy-to-process form.
+     *
+     * <p>
+     * See {@link Metadata} class for what's avaliable as "metadata".
+     */
+    public @NotNull Metadata getMetaData() {
+        return new Metadata();
+    }
+
+    /**
+     * Parses the Metadata in an EPR and provides convenience methods to access
+     * the metadata.
+     *
+     */
+   public class Metadata {
+        private @Nullable QName serviceName;
+        private @Nullable QName portName;
+        private @Nullable QName portTypeName; //interfaceName
+        private @Nullable Source wsdlSource;
+        public @Nullable QName getServiceName(){
+            return serviceName;
+        }
+        public @Nullable QName getPortName(){
+            return portName;
+        }
+        public @Nullable QName getPortTypeName(){
+            return portTypeName;
+        }
+        public @Nullable Source getWsdlSource(){
+            return wsdlSource;
+        }
+
+        private Metadata() {
+            try {
+                parseMetaData();
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+       /**
+         * Parses the Metadata section of the EPR.
+         */
+       private void parseMetaData() throws XMLStreamException {
+           StreamReaderBufferProcessor xsr = infoset.readAsXMLStreamReader();
+
+            // parser should be either at the start element or the start document
+            if (xsr.getEventType() == XMLStreamReader.START_DOCUMENT)
+                xsr.nextTag();
+            assert xsr.getEventType() == XMLStreamReader.START_ELEMENT;
+            String rootElement = xsr.getLocalName();
+            if (!xsr.getNamespaceURI().equals(version.nsUri))
+                throw new WebServiceException(AddressingMessages.WRONG_ADDRESSING_VERSION(
+                        version.nsUri, xsr.getNamespaceURI()));
+            String localName;
+            String ns;
+            if (version == AddressingVersion.W3C) {
+                do {
+                    //If the current element is metadata enclosure, look inside
+                    if (xsr.getLocalName().equals(version.eprType.wsdlMetadata.getLocalPart())) {
+                        XMLStreamBuffer mark;
+                        while ((mark = xsr.nextTagAndMark()) != null) {
+                            localName = xsr.getLocalName();
+                            ns = xsr.getNamespaceURI();
+                            if (localName.equals(version.eprType.serviceName)) {
+                                String portStr = xsr.getAttributeValue(null, version.eprType.portName);
+                                serviceName = getElementTextAsQName(xsr);
+                                if (serviceName != null)
+                                    portName = new QName(serviceName.getNamespaceURI(), portStr);
+                            } else if (localName.equals(version.eprType.portTypeName)) {
+                                portTypeName = getElementTextAsQName(xsr);
+                            } else if (ns.equals(WSDLConstants.NS_WSDL)
+                                    && localName.equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
+                                wsdlSource = new XMLStreamBufferSource(mark);
+                            } else {
+                                XMLStreamReaderUtil.skipElement(xsr);
+                            }
+                        }
+                    } else {
+                        //Skip is it is not root element
+                        if (!xsr.getLocalName().equals(rootElement))
+                            XMLStreamReaderUtil.skipElement(xsr);
+                    }
+                } while (XMLStreamReaderUtil.nextElementContent(xsr) == XMLStreamReader.START_ELEMENT);
+            } else if (version == AddressingVersion.MEMBER) {
+                do {
+                    localName = xsr.getLocalName();
+                    ns = xsr.getNamespaceURI();
+                    //If the current element is metadata enclosure, look inside
+                    if (localName.equals(version.eprType.wsdlMetadata.getLocalPart()) &&
+                            ns.equals(version.eprType.wsdlMetadata.getNamespaceURI())) {
+                        while (xsr.nextTag() == XMLStreamReader.START_ELEMENT) {
+                            XMLStreamBuffer mark;
+                            while ((mark = xsr.nextTagAndMark()) != null) {
+                                localName = xsr.getLocalName();
+                                ns = xsr.getNamespaceURI();
+                                if (ns.equals(WSDLConstants.NS_WSDL)
+                                        && localName.equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
+                                    wsdlSource = new XMLStreamBufferSource(mark);
+                                } else {
+                                    XMLStreamReaderUtil.skipElement(xsr);
+                                }
+                            }
+                        }
+                    } else if (localName.equals(version.eprType.serviceName)) {
+                        String portStr = xsr.getAttributeValue(null, version.eprType.portName);
+                        serviceName = getElementTextAsQName(xsr);
+                        if (serviceName != null)
+                            portName = new QName(serviceName.getNamespaceURI(), portStr);
+                    } else if (localName.equals(version.eprType.portTypeName)) {
+                        portTypeName = getElementTextAsQName(xsr);
+                    } else {
+                        //Skip is it is not root element
+                        if (!xsr.getLocalName().equals(rootElement))
+                            XMLStreamReaderUtil.skipElement(xsr);
+                    }
+                } while (XMLStreamReaderUtil.nextElementContent(xsr) == XMLStreamReader.START_ELEMENT);
+            }
+        }
+
+        private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
+            String text = xsr.getElementText();
+            String prefix = XmlUtil.getPrefix(text);
+            String name = XmlUtil.getLocalPart(text);
+            if (name != null) {
+                if (prefix != null) {
+                    String ns = xsr.getNamespaceURI(prefix);
+                    if (ns != null)
+                        return new QName(ns, name, prefix);
+                } else {
+                    return new QName(null, name);
+                }
+            }
+            return null;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/package-info.java
new file mode 100644
index 0000000..4669ef9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/package-info.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing",
+        location = "http://schemas.xmlsoap.org/ws/2004/08/addressing")
+package com.sun.xml.internal.ws.api.addressing;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ClientPipelineHook.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ClientPipelineHook.java
new file mode 100644
index 0000000..7a55e35
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ClientPipelineHook.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.ClientPipeAssemblerContext;
+
+/**
+ * Allow the container (primarily Glassfish) to inject
+ * their own pipes into the client pipeline.
+ *
+ * <p>
+ * This interface has a rather ad-hoc set of methods, because
+ * we didn't want to define an autonomous pipe-assembly process.
+ * (We thought this is a smaller evil compared to that.)
+ *
+ * <p>
+ * JAX-WS obtains this through {@link com.sun.xml.internal.ws.api.server.Container#getSPI(Class)}.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class ClientPipelineHook {
+
+    /**
+     * Called during the pipeline construction process once to allow a container
+     * to register a pipe for security.
+     *
+     * This pipe will be injected to a point very close to the transport, allowing
+     * it to do some security operations.
+     *
+     * @param ctxt
+     *      Represents abstraction of SEI, WSDL abstraction etc. Context can be used
+     *      whether add a new pipe to the head or not.
+     *
+     * @param tail
+     *      Head of the partially constructed pipeline. If the implementation
+     *      wishes to add new pipes, it should do so by extending
+     *      {@link com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterPipeImpl} and making sure that this {@link com.sun.xml.internal.ws.api.pipe.Pipe}
+     *      eventually processes messages.
+     *
+     * @return
+     *      The default implementation just returns <tt>tail</tt>, which means
+     *      no additional pipe is inserted. If the implementation adds
+     *      new pipes, return the new head pipe.
+     */
+    public @NotNull Pipe createSecurityPipe(ClientPipeAssemblerContext ctxt, @NotNull Pipe tail) {
+        return tail;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java
new file mode 100644
index 0000000..c105b3e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.client;
+
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Client side feature to enable or disable the selection of the optimal
+ * encoding by the client when sending outbound messages.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, the most optimal encoding will be selected
+ *       depending on the configuration and capabilities of the client
+ *       the capabilities of the Web service.
+ *  <li> DISABLED: In this Mode, the default encoding will be selected.
+ * </ul>
+ * <p>
+ * If this feature is not present on a Web service then the default behaviour
+ * is equivalent to this feature being present and disabled.
+ * <p>
+ * If this feature is enabled by the client and the Service supports the
+ * Fast Infoset encoding, as specified by the {@link FastInfosetFeature},
+ * and Fast Infoset is determined to be the most optimal encoding, then the
+ * Fast Infoset encoding will be automatically selected by the client.
+ * <p>
+ * TODO: Still not sure if a feature is a server side only thing or can
+ * also be a client side thing. If the former then this class should be
+ * removed.
+ * @author Paul.Sandoz@Sun.Com
+ */
+public class SelectOptimalEncodingFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the {@link SelectOptimalEncodingFeature}
+     */
+    public static final String ID = "http://java.sun.com/xml/ns/jaxws/client/selectOptimalEncoding";
+
+    /**
+     * Create a {@link SelectOptimalEncodingFeature}.
+     * The instance created will be enabled.
+     */
+    public SelectOptimalEncodingFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Create a {@link SelectOptimalEncodingFeature}
+     *
+     * @param enabled specifies whether this feature should
+     *                be enabled or not.
+     */
+    @FeatureConstructor({"enabled"})
+    public SelectOptimalEncodingFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptor.java
new file mode 100644
index 0000000..0755684
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.WSFeatureList;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.developer.WSBindingProvider;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.WebServiceFeature;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Interception point for inner working of {@link WSService}.
+ *
+ * <p>
+ * System-level code could hook an implementation of this to
+ * {@link WSService} to augument its behavior.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1 EA3
+ * @see ServiceInterceptorFactory
+ */
+public abstract class ServiceInterceptor {
+    /**
+     * Called before {@link WSBinding} is created, to allow interceptors
+     * to add {@link WebServiceFeature}s to the created {@link WSBinding}.
+     *
+     * @param port
+     *      Information about the port for which dispatch/proxy will be created.
+     * @param serviceEndpointInterface
+     *      Null if the created binding is for {@link Dispatch}. Otheriwse
+     *      it represents the port interface of the proxy to be created.
+     * @param defaultFeatures
+     *      The list of features that are currently scheduled to be set for
+     *      the newly created {@link WSBinding}.
+     *
+     * @return
+     *      A set of features to be added to the newly created {@link WSBinding}.
+     *      Can be empty but never null.
+     *      <tt>defaultFeatures</tt> will take precedence over what this method
+     *      would return (because it includes user-specified ones which will
+     *      take the at-most priority), but features you return from this method
+     *      will take precedence over {@link BindingID}'s
+     *      {@link BindingID#createBuiltinFeatureList() implicit features}.
+     */
+    public List<WebServiceFeature> preCreateBinding(@NotNull WSPortInfo port, @Nullable Class<?> serviceEndpointInterface, @NotNull WSFeatureList defaultFeatures) {
+        return Collections.emptyList();
+    }
+
+
+    /**
+     * A callback to notify the event of creation of proxy object for SEI endpoint. The
+     * callback could set some properties on the {@link BindingProvider}.
+     *
+     * @param bp created proxy instance
+     * @param serviceEndpointInterface SEI of the endpoint
+     */
+    public void postCreateProxy(@NotNull WSBindingProvider bp,@NotNull Class<?> serviceEndpointInterface) {
+    }
+
+
+    /**
+     * A callback to notify that a {@link Dispatch} object is created. The callback
+     * could set some properties on the {@link BindingProvider}.
+     *
+     * @param bp BindingProvider of dispatch object
+     */
+    public void postCreateDispatch(@NotNull WSBindingProvider bp) {
+    }
+
+    /**
+     * Aggregates multiple interceptors into one facade.
+     */
+    public static ServiceInterceptor aggregate(final ServiceInterceptor... interceptors) {
+        if(interceptors.length==1)
+            return interceptors[0];
+        return new ServiceInterceptor() {
+            public List<WebServiceFeature> preCreateBinding(@NotNull WSPortInfo port, @Nullable Class<?> portInterface, @NotNull WSFeatureList defaultFeatures) {
+                List<WebServiceFeature> r = new ArrayList<WebServiceFeature>();
+                for (ServiceInterceptor si : interceptors)
+                    r.addAll(si.preCreateBinding(port,portInterface,defaultFeatures));
+                return r;
+            }
+
+            public void postCreateProxy(@NotNull WSBindingProvider bp, @NotNull Class<?> serviceEndpointInterface) {
+                for (ServiceInterceptor si : interceptors)
+                    si.postCreateProxy(bp,serviceEndpointInterface);
+            }
+
+            public void postCreateDispatch(@NotNull WSBindingProvider bp) {
+                for (ServiceInterceptor si : interceptors)
+                    si.postCreateDispatch(bp);
+            }
+        };
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptorFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptorFactory.java
new file mode 100644
index 0000000..32eb395
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/ServiceInterceptorFactory.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+
+import javax.xml.ws.Service;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Creates {@link ServiceInterceptor}.
+ *
+ * <p>
+ * Code that wishes to inject {@link ServiceInterceptor} into {@link WSService}
+ * must implement this class. There are two ways to have the JAX-WS RI
+ * recognize your {@link ServiceInterceptor}s.
+ *
+ * <h3>Use {@link ServiceFinder}</h3>
+ * <p>
+ * {@link ServiceInterceptorFactory}s discovered via {@link ServiceFinder}
+ * will be incorporated to all {@link WSService} instances.
+ *
+ * <h3>Register per-thread</h3>
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ * @see ServiceInterceptor
+ * @see 2.1 EA3
+ */
+public abstract class ServiceInterceptorFactory {
+    public abstract ServiceInterceptor create(@NotNull WSService service);
+
+    /**
+     * Loads all {@link ServiceInterceptor}s and return aggregated one.
+     */
+    public static @NotNull ServiceInterceptor load(@NotNull WSService service, @Nullable ClassLoader cl) {
+        List<ServiceInterceptor> l = new ArrayList<ServiceInterceptor>();
+
+        // first service look-up
+        for( ServiceInterceptorFactory f : ServiceFinder.find(ServiceInterceptorFactory.class))
+            l.add(f.create(service));
+
+        // then thread-local
+        for( ServiceInterceptorFactory f : threadLocalFactories.get())
+            l.add(f.create(service));
+
+        return ServiceInterceptor.aggregate(l.toArray(new ServiceInterceptor[l.size()]));
+    }
+
+    private static ThreadLocal<Set<ServiceInterceptorFactory>> threadLocalFactories = new ThreadLocal<Set<ServiceInterceptorFactory>>() {
+        protected Set<ServiceInterceptorFactory> initialValue() {
+            return new HashSet<ServiceInterceptorFactory>();
+        }
+    };
+
+    /**
+     * Registers {@link ServiceInterceptorFactory} for this thread.
+     *
+     * <p>
+     * Once registered, {@link ServiceInterceptorFactory}s are consulted for every
+     * {@link Service} created in this thread, until it gets unregistered.
+     */
+    public static boolean registerForThread(ServiceInterceptorFactory factory) {
+        return threadLocalFactories.get().add(factory);
+    }
+
+    /**
+     * Removes previously registered {@link ServiceInterceptorFactory} for this thread.
+     */
+    public static boolean unregisterForThread(ServiceInterceptorFactory factory) {
+        return threadLocalFactories.get().remove(factory);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java
new file mode 100644
index 0000000..845bdd3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+
+import javax.xml.ws.handler.PortInfo;
+
+/**
+ * JAX-WS RI's extension to {@link PortInfo}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSPortInfo extends PortInfo {
+    /**
+     * Returns {@link WSService} object that owns this port.
+     */
+    @NotNull WSService getOwner();
+
+    /**
+     * Returns the same information as {@link #getBindingID()}
+     * but in a strongly-typed fashion
+     */
+    @NotNull BindingID getBindingId();
+
+    /**
+     * Gets the endpoint address of this port.
+     */
+    @NotNull EndpointAddress getEndpointAddress();
+
+    /**
+     * Gets the {@link WSDLPort} object that represents this port,
+     * if {@link WSService} is configured with WSDL. Otherwise null.
+     */
+    @Nullable WSDLPort getPort();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java
new file mode 100644
index 0000000..cc75bab
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.fastinfoset;
+
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Enable or disable Fast Infoset on a Web service.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, Fast Infoset will be enabled.
+ *  <li> DISABLED: In this Mode, Fast Infoset will be disabled and the
+ *       Web service will not process incoming messages or produce outgoing
+ *       messages encoded using Fast Infoset.
+ * </ul>
+ * <p>
+ * If this feature is not present on a Web service then the default behaviour
+ * is equivalent to this feature being present and enabled.
+ * @author Paul.Sandoz@Sun.Com
+ */
+public class FastInfosetFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the {@link FastInfosetFeature}
+     */
+    public static final String ID = "http://java.sun.com/xml/ns/jaxws/fastinfoset";
+
+    /**
+     * Create a {@link FastInfosetFeature}. The instance created will be enabled.
+     */
+    public FastInfosetFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Create a {@link FastInfosetFeature}
+     *
+     * @param enabled specifies whether this feature should
+     *                be enabled or not.
+     */
+    @FeatureConstructor({"enabled"})
+    public FastInfosetFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Attachment.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Attachment.java
new file mode 100644
index 0000000..276d95b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Attachment.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+
+import javax.activation.DataHandler;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPException;
+import javax.xml.transform.Source;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Attachment.
+ */
+public interface Attachment {
+
+    /**
+     * Content ID of the attachment. Uniquely identifies an attachment.
+     *
+     * @return
+     *      The content ID like "foo-bar-zot@abc.com", without
+     *      surrounding '&lt;' and '>' used as the transfer syntax.
+     */
+    @NotNull String getContentId();
+
+    /**
+     * Gets the MIME content-type of this attachment.
+     */
+    String getContentType();
+
+    /**
+     * Gets the attachment as an exact-length byte array.
+     */
+    byte[] asByteArray();
+
+    /**
+     * Gets the attachment as a {@link DataHandler}.
+     */
+    DataHandler asDataHandler();
+
+    /**
+     * Gets the attachment as a {@link Source}.
+     * Note that there's no guarantee that the attachment is actually an XML.
+     */
+    Source asSource();
+
+    /**
+     * Obtains this attachment as an {@link InputStream}.
+     */
+    InputStream asInputStream();
+
+    /**
+     * Writes the contents of the attachment into the given stream.
+     */
+    void writeTo(OutputStream os) throws IOException;
+
+    /**
+     * Writes this attachment to the given {@link SOAPMessage}.
+     */
+    void writeTo(SOAPMessage saaj) throws SOAPException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/AttachmentSet.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/AttachmentSet.java
new file mode 100644
index 0000000..651abf6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/AttachmentSet.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.Nullable;
+
+/**
+ * A set of {@link Attachment} on a {@link Message}.
+ *
+ * <p>
+ * A particular attention is made to ensure that attachments
+ * can be read and parsed lazily as requested.
+ *
+ * @see Message#getAttachments()
+ */
+public interface AttachmentSet extends Iterable<Attachment> {
+    /**
+     * Gets the attachment by the content ID.
+     *
+     * @param contentId
+     *      The content ID like "foo-bar-zot@abc.com", without
+     *      surrounding '&lt;' and '>' used as the transfer syntax.
+     *
+     * @return null
+     *      if no such attachment exist.
+     */
+    @Nullable
+    Attachment get(String contentId);
+
+    /**
+     * Returns true if there's no attachment.
+     */
+    boolean isEmpty();
+
+    /**
+     * Adds an attachment to this set.
+     *
+     * <p>
+     * Note that it's OK for an {@link Attachment} to belong to
+     * more than one {@link AttachmentSet} (which is in fact
+     * necessary when you wrap a {@link Message} into another.
+     *
+     * @param att
+     *      must not be null.
+     */
+    public void add(Attachment att);
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/ExceptionHasMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/ExceptionHasMessage.java
new file mode 100644
index 0000000..eea4543
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/ExceptionHasMessage.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
+import com.sun.xml.internal.ws.protocol.soap.VersionMismatchException;
+
+/**
+ * This class represents an Exception that needs to be marshalled
+ * with a specific protocol wire format. For example, the SOAP's
+ * VersionMismatchFault needs to be written with a correct fault code.
+ * In that case, decoder could throw {@link VersionMismatchException},
+ * and the correspoinding fault {@link Message} from {@link ExceptionHasMessage::getFaultMessage}
+ * is sent on the wire.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class ExceptionHasMessage extends JAXWSExceptionBase {
+
+    public ExceptionHasMessage(String key, Object... args) {
+        super(key, args);
+    }
+
+    /**
+     * Returns the exception into a fault Message
+     *
+     * @return Message for this exception
+     */
+    public abstract Message getFaultMessage();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Header.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Header.java
new file mode 100644
index 0000000..edef2ad
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Header.java
@@ -0,0 +1,325 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+import java.util.Set;
+
+
+/**
+ * A SOAP header.
+ *
+ * <p>
+ * A header is immutable, but unlike body it can be read
+ * multiple times.
+ * The {@link Header} abstraction hides how the header
+ * data is represented in memory; instead, it commits to
+ * the ability to write itself to XML infoset.
+ *
+ * <p>
+ * When a message is received from the transport and
+ * being processed, the processor needs to "peek"
+ * some information of a header, such as the tag name,
+ * the mustUnderstand attribute, and so on. Therefore,
+ * the {@link Header} interface exposes those information
+ * as properties, so that they can be checked without
+ * replaying the infoset, which is efficiently but still
+ * costly.
+ *
+ * <p>
+ * A {@link Header} may belong to more than one {@link HeaderList}
+ * due to wrapping of {@link Message}.
+ *
+ * @see HeaderList
+ * @see Headers
+ */
+public interface Header {
+    // TODO: Vivek pointed out that the only time we are looking at
+    // mustUnderstand and role are when we do the mustUnderstand error check
+    // (that is, to find out if there's any header with @mustUnderstand that
+    // has appropriate role for us.)
+    // if that's the case, it might be better if we define this whole operation
+    // as one method, instead of exposing two properties.
+
+    /**
+     * Checks if this header is ignorable for us (IOW, make sure
+     * that this header has a problematic "mustUnderstand" header value
+     * that we have to reject.)
+     *
+     * <p>
+     * This method is used as a part of the
+     * <a href="HeaderList.html#MU">mustUnderstanx processing</a>.
+     * At the end of the processing, the JAX-WS identifies a list of {@link Header}s
+     * that were not understood. This method is invoked on those {@link Header}s,
+     * to verify that we don't need to report an error for it.
+     *
+     * <p>
+     * specifically, this method has to perform the following tasks:
+     *
+     * <ul>
+     *  <li>If this header does not have <tt>mustUnderstand</tt> as "1" nor "true",
+     *      then this method must return true.
+     *  <li>Otherwise, check the role attribute (for SOAP 1.2) or the actor attribute (for SOAP 1.1).
+     *      When those attributes are absent, the default values have to be assumed.
+     *      See {@link #getRole(SOAPVersion)} for how the values are defaulted.
+     *      Now, see if the {@code roles} set contains the value.
+     *      If so, this method must return false (indicating that an error is in order.)
+     *  <li>Otherwise return true (since we don't play the role this header is intended for.)
+     * </ul>
+     *
+     * @param soapVersion
+     *      The caller specifies the SOAP version that the pipeline is working against.
+     *      Often each {@link Header} implementation already knows the SOAP version
+     *      anyway, but this allows some {@link Header}s to avoid keeping it.
+     *      That's why this redundant parameter is passed in.
+     * @param roles
+     *      The set of role values that the current JAX-WS pipeline is assuming.
+     *      Note that SOAP 1.1 and SOAP 1.2 use different strings for the same role,
+     *      and the caller is responsible for supplying a proper value depending on the
+     *      active SOAP version in use.
+     *
+     * @return
+     *      true if no error needs to be reported. False if an error needs to be raised.
+     *      See the method javadoc for more discussion.
+     */
+    public boolean isIgnorable(@NotNull SOAPVersion soapVersion, @NotNull Set<String> roles);
+
+    /**
+     * Gets the value of the soap:role attribute (or soap:actor for SOAP 1.1).
+     *
+     * <p>
+     * If the attribute is omitted, the value defaults to {@link SOAPVersion#implicitRole}.
+     *
+     * @param soapVersion
+     *      The caller specifies the SOAP version that the pipeline is working against.
+     *      Often each {@link Header} implementation already knows the SOAP version
+     *      anyway, but this allows some {@link Header}s to avoid keeping it.
+     *      That's why this redundant parameter is passed in.
+     * @return
+     *      never null. This string need not be interned.
+     */
+    public @NotNull String getRole(@NotNull SOAPVersion soapVersion);
+
+    /**
+     * True if this header is to be relayed if not processed.
+     * For SOAP 1.1 messages, this method always return false.
+     *
+     * <p>
+     * IOW, this method returns true if there's @soap:relay='true'
+     * is present.
+     *
+     * <h3>Implementation Note</h3>
+     * <p>
+     * The implementation needs to check for both "true" and "1",
+     * but because attribute values are normalized, it doesn't have
+     * to consider " true", " 1 ", and so on.
+     *
+     * @return
+     *      false.
+     */
+    public boolean isRelay();
+
+    /**
+     * Gets the namespace URI of this header element.
+     *
+     * @return
+     *      this string must be interned.
+     */
+    public @NotNull String getNamespaceURI();
+
+    /**
+     * Gets the local name of this header element.
+     *
+     * @return
+     *      this string must be interned.
+     */
+    public @NotNull String getLocalPart();
+
+    /**
+     * Gets the attribute value on the header element.
+     *
+     * @param nsUri
+     *      The namespace URI of the attribute. Can be empty.
+     * @param localName
+     *      The local name of the attribute.
+     *
+     * @return
+     *      if the attribute is found, return the whitespace normalized value.
+     *      (meaning no leading/trailing space, no consequtive whitespaces in-between.)
+     *      Otherwise null. Note that the XML parsers are responsible for
+     *      whitespace-normalizing attributes, so {@link Header} implementation
+     *      doesn't have to do anything.
+     */
+    @Nullable String getAttribute(@NotNull String nsUri, @NotNull String localName);
+
+    /**
+     * Gets the attribute value on the header element.
+     *
+     * <p>
+     * This is a convenience method that calls into {@link #getAttribute(String, String)}
+     *
+     * @param name
+     *      Never null.
+     *
+     * @see #getAttribute(String, String)
+     */
+    @Nullable String getAttribute(@NotNull QName name);
+
+    /**
+     * Reads the header as a {@link XMLStreamReader}.
+     *
+     * <p>
+     * The returned parser points at the start element of this header.
+     * (IOW, {@link XMLStreamReader#getEventType()} would return
+     * {@link XMLStreamReader#START_ELEMENT}.
+     *
+     * <h3>Performance Expectation</h3>
+     * <p>
+     * For some {@link Header} implementations, this operation
+     * is a non-trivial operation. Therefore, use of this method
+     * is discouraged unless the caller is interested in reading
+     * the whole header.
+     *
+     * <p>
+     * Similarly, if the caller wants to use this method only to do
+     * the API conversion (such as simply firing SAX events from
+     * {@link XMLStreamReader}), then the JAX-WS team requests
+     * that you talk to us.
+     *
+     * <p>
+     * {@link Message}s that come from tranport usually provides
+     * a reasonably efficient implementation of this method.
+     *
+     * @return
+     *      must not null.
+     */
+    public XMLStreamReader readHeader() throws XMLStreamException;
+
+    /**
+     * Reads the header as a JAXB object by using the given unmarshaller.
+     */
+    public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException;
+
+    /**
+     * Reads the header as a JAXB object by using the given unmarshaller.
+     */
+    public <T> T readAsJAXB(Bridge<T> bridge) throws JAXBException;
+
+    /**
+     * Reads this header as an {@link WSEndpointReference}.
+     *
+     * @param expected
+     *      The version of the addressing used to parse the EPR.
+     *      If the actual infoset and this doesn't agree, then
+     *      you'll get an {@link WebServiceException} stating that fact.
+     *
+     * @return
+     *      On a successful return, this method never returns null.
+     */
+    public @NotNull WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException;
+
+    /**
+     * Writes out the header as a fragment.
+     *
+     * @throws XMLStreamException
+     *      if the operation fails for some reason. This leaves the
+     *      writer to an undefined state.
+     */
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException;
+
+    /**
+     * Writes out the header to the given SOAPMessage.
+     *
+     * <p>
+     * Sometimes a {@link Message} needs to produce itself
+     * as {@link SOAPMessage}, in which case each header needs
+     * to turn itself into a header.
+     *
+     * @throws SOAPException
+     *      if the operation fails for some reason. This leaves the
+     *      writer to an undefined state.
+     */
+    public void writeTo(SOAPMessage saaj) throws SOAPException;
+
+    /**
+     * Writes out the header as SAX events.
+     *
+     * <p>
+     * Sometimes a {@link Message} needs to produce SAX events,
+     * and this method is necessary for headers to participate to it.
+     *
+     * <p>
+     * A header is responsible for producing the SAX events for its part,
+     * including <tt>startPrefixMapping</tt> and <tt>endPrefixMapping</tt>,
+     * but not startDocument/endDocument.
+     *
+     * <p>
+     * Note that SAX contract requires that any error that does NOT originate
+     * from {@link ContentHandler} (meaning any parsing error and etc) must
+     * be first reported to {@link ErrorHandler}. If the SAX event production
+     * cannot be continued and the processing needs to abort, the code may
+     * then throw the same {@link SAXParseException} reported to {@link ErrorHandler}.
+     *
+     * @param contentHandler
+     *      The {@link ContentHandler} that receives SAX events.
+     *
+     * @param errorHandler
+     *      The {@link ErrorHandler} that receives parsing errors.
+     */
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException;
+
+    /**
+     * Used to obtain value XYZ from a header that looks like
+     * "&lt;header&gt;XYZ&lt;/header&gt;". The primary use of this header
+     * for now is to access certain Addressing headers quickly.
+     *
+     * @throws WebServiceException
+     *      If the structure of the header is more complicated than
+     *      a simple string header.
+     *
+     * @return
+     *      Can be empty but always non-null.
+     */
+    public @NotNull String getStringContent();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/HeaderList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/HeaderList.java
new file mode 100644
index 0000000..6da2c3d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/HeaderList.java
@@ -0,0 +1,794 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.OneWayFeature;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.message.RelatesToHeader;
+import com.sun.xml.internal.ws.message.StringHeader;
+import com.sun.xml.internal.ws.protocol.soap.ClientMUTube;
+import com.sun.xml.internal.ws.protocol.soap.ServerMUTube;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.WebServiceException;
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+/**
+ * A list of {@link Header}s on a {@link Message}.
+ *
+ * <p>
+ * This list can be modified to add headers
+ * from outside a {@link Message}, this is necessary
+ * since intermediate processing layers often need to
+ * put additional headers.
+ *
+ * <p>
+ * Following the SOAP convention, the order among headers
+ * are not significant. However, {@link Codec}s are
+ * expected to preserve the order of headers in the input
+ * message as much as possible.
+ *
+ *
+ * <a name="MU"></a>
+ * <h3>MustUnderstand Processing</h3>
+ * <p>
+ * To perform SOAP mustUnderstang processing correctly, we need to keep
+ * track of headers that are understood and headers that are not.
+ * This is a collaborative process among {@link Pipe}s, thus it's something
+ * a {@link Pipe} author needs to keep in mind.
+ *
+ * <p>
+ * Specifically, when a {@link Pipe} sees a header and processes it
+ * (that is, if it did enough computing with the header to claim that
+ * the header is understood), then it should mark the corresponding
+ * header as "understood". For example, when a pipe that handles JAX-WSA
+ * examins the &lt;wsa:To> header, it can claim that it understood the header.
+ * But for example, if a pipe that does the signature verification checks
+ * &lt;wsa:To> for a signature, that would not be considered as "understood".
+ *
+ * <p>
+ * There are two ways to mark a header as understood:
+ *
+ * <ol>
+ *  <li>Use one of the <tt>getXXX</tt> methods that take a
+ *      boolean <tt>markAsUnderstood</tt> parameter.
+ *      Most often, a {@link Pipe} knows it's going to understand a header
+ *      as long as it's present, so this is the easiest and thus the preferred way.
+ *
+ *      For example, if JAX-WSA looks for &lt;wsa:To>, then it can set
+ *      <tt>markAsUnderstand</tt> to true, to do the obtaining of a header
+ *      and marking at the same time.
+ *
+ *  <li>Call {@link #understood(int)}.
+ *      If under a rare circumstance, a pipe cannot determine whether
+ *      it can understand it or not when you are fetching a header, then
+ *      you can use this method afterward to mark it as understood.
+ * </ol>
+ *
+ * <p>
+ * Intuitively speaking, at the end of the day, if a header is not
+ * understood but {@link Header#isIgnorable(SOAPVersion, Set)} is false, a bad thing
+ * will happen. The actual implementation of the checking is more complicated,
+ * for that see {@link ClientMUTube}/{@link ServerMUTube}.
+ *
+ * @see Message#getHeaders()
+ */
+public final class HeaderList extends ArrayList<Header> {
+
+    /**
+     * Bit set to keep track of which headers are understood.
+     * <p>
+     * The first 32 headers use this field, and the rest will use
+     * {@link #moreUnderstoodBits}. The expectation is that
+     * most of the time a SOAP message will only have up to 32 headers,
+     * so we can avoid allocating separate objects for {@link BitSet}.
+     */
+    private int understoodBits;
+    /**
+     * If there are more than 32 headers, we use this {@link BitSet}
+     * to keep track of whether those headers are understood.
+     * Lazily allocated.
+     */
+    private BitSet moreUnderstoodBits = null;
+
+    private String to = null;
+    private String action = null;
+    private WSEndpointReference replyTo = null;
+    private WSEndpointReference faultTo = null;
+    private String messageId;
+
+
+    /**
+     * Creates an empty {@link HeaderList}.
+     */
+    public HeaderList() {
+    }
+
+    /**
+     * Copy constructor.
+     */
+    public HeaderList(HeaderList that) {
+        super(that);
+        this.understoodBits = that.understoodBits;
+        if(that.moreUnderstoodBits!=null)
+            this.moreUnderstoodBits = (BitSet)that.moreUnderstoodBits.clone();
+        this.to = that.to;
+        this.action = that.action;
+        this.replyTo = that.replyTo;
+        this.faultTo = that.faultTo;
+        this.messageId = that.messageId;
+    }
+
+    /**
+     * The number of total headers.
+     */
+    public int size() {
+        return super.size();
+    }
+
+    /**
+     * Adds all the headers.
+     */
+    public void addAll(Header... headers) {
+        for (Header header : headers)
+            add(header);
+    }
+
+    /**
+     * Gets the {@link Header} at the specified index.
+     *
+     * <p>
+     * This method does not mark the returned {@link Header} as understood.
+     *
+     * @see #understood(int)
+     */
+    public Header get(int index) {
+        return super.get(index);
+    }
+
+    /**
+     * Marks the {@link Header} at the specified index as
+     * <a href="#MU">"understood"</a>.
+     */
+    public void understood(int index) {
+        assert index<size();    // check that index is in range
+        if(index<32)
+            understoodBits |= 1<<index;
+        else {
+            if(moreUnderstoodBits==null)
+                moreUnderstoodBits = new BitSet();
+            moreUnderstoodBits.set(index-32);
+        }
+    }
+
+    /**
+     * Returns true if a {@link Header} at the given index
+     * was <a href="#MU">"understood"</a>.
+     */
+    public boolean isUnderstood(int index) {
+        assert index<size();    // check that index is in range
+        if(index<32)
+            return understoodBits == (understoodBits|(1<<index));
+        else {
+            if(moreUnderstoodBits==null)
+                return false;
+            return moreUnderstoodBits.get(index-32);
+        }
+    }
+
+    /**
+     * Marks the specified {@link Header} as <a href="#MU">"understood"</a>.
+     *
+     * @deprecated
+     * By the deifnition of {@link ArrayList}, this operation requires
+     * O(n) search of the array, and thus inherently inefficient.
+     *
+     * Because of this, if you are developing a {@link Pipe} for
+     * a performance sensitive environment, do not use this method.
+     *
+     * @throws IllegalArgumentException
+     *      if the given header is not {@link #contains(Object) contained}
+     *      in this header.
+     */
+    public void understood(@NotNull Header header) {
+        int sz = size();
+        for( int i=0; i<sz; i++ ) {
+            if(get(i)==header) {
+                understood(i);
+                return;
+            }
+        }
+        throw new IllegalArgumentException();
+    }
+
+    /**
+     * Gets the first {@link Header} of the specified name.
+     *
+     * @param markAsUnderstood
+     *      If this parameter is true, the returned header will
+     *      be marked as <a href="#MU">"understood"</a>.
+     * @return null if not found.
+     */
+    public @Nullable Header get(@NotNull String nsUri, @NotNull String localName, boolean markAsUnderstood) {
+        int len = size();
+        for( int i=0; i<len; i++ ) {
+            Header h = get(i);
+            if(h.getLocalPart().equals(localName) && h.getNamespaceURI().equals(nsUri)) {
+                if(markAsUnderstood)
+                    understood(i);
+                return h;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #get(String, String, boolean)}
+     */
+    public Header get(String nsUri, String localName) {
+        return get(nsUri,localName,true);
+    }
+
+    /**
+     * Gets the first {@link Header} of the specified name.
+     *
+     * @param markAsUnderstood
+     *      If this parameter is true, the returned header will
+     *      be marked as <a href="#MU">"understood"</a>.
+     * @return null
+     *      if not found.
+     */
+    public @Nullable Header get(@NotNull QName name, boolean markAsUnderstood) {
+        return get(name.getNamespaceURI(),name.getLocalPart(),markAsUnderstood);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #get(QName)}
+     */
+    public @Nullable Header get(@NotNull QName name) {
+        return get(name,true);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #getHeaders(String, String, boolean)}
+     */
+    public Iterator<Header> getHeaders(final String nsUri, final String localName) {
+        return getHeaders(nsUri,localName,true);
+    }
+
+    /**
+     * Gets all the {@link Header}s of the specified name,
+     * including duplicates (if any.)
+     *
+     * @param markAsUnderstood
+     *      If this parameter is true, the returned headers will
+     *      be marked as <a href="#MU">"understood"</a> when they are returned
+     *      from {@link Iterator#next()}.
+     * @return empty iterator if not found.
+     */
+    public @NotNull Iterator<Header> getHeaders(@NotNull final String nsUri, @NotNull final String localName, final boolean markAsUnderstood) {
+        return new Iterator<Header>() {
+            int idx = 0;
+            Header next;
+            public boolean hasNext() {
+                if(next==null)
+                    fetch();
+                return next!=null;
+            }
+
+            public Header next() {
+                if(next==null) {
+                    fetch();
+                    if(next==null)
+                        throw new NoSuchElementException();
+                }
+
+                if(markAsUnderstood) {
+                    assert get(idx-1)==next;
+                    understood(idx-1);
+                }
+
+                Header r = next;
+                next = null;
+                return r;
+            }
+
+            private void fetch() {
+                while(idx<size()) {
+                    Header h = get(idx++);
+                    if(h.getLocalPart().equals(localName) && h.getNamespaceURI().equals(nsUri)) {
+                        next = h;
+                        break;
+                    }
+                }
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /**
+     * @see #getHeaders(String, String, boolean)
+     */
+    public @NotNull Iterator<Header> getHeaders(@NotNull QName headerName, final boolean markAsUnderstood) {
+        return getHeaders(headerName.getNamespaceURI(),headerName.getLocalPart(),markAsUnderstood);
+    }
+
+    /**
+     * @deprecated
+     *      use {@link #getHeaders(String, boolean)}.
+     */
+    public @NotNull Iterator<Header> getHeaders(@NotNull final String nsUri) {
+        return getHeaders(nsUri,true);
+    }
+
+    /**
+     * Gets an iteration of headers {@link Header} in the specified namespace,
+     * including duplicates (if any.)
+     *
+     * @param markAsUnderstood
+     *      If this parameter is true, the returned headers will
+     *      be marked as <a href="#MU">"understood"</a> when they are returned
+     *      from {@link Iterator#next()}.
+     * @return
+     *      empty iterator if not found.
+     */
+    public @NotNull Iterator<Header> getHeaders(@NotNull final String nsUri, final boolean markAsUnderstood) {
+        return new Iterator<Header>() {
+            int idx = 0;
+            Header next;
+            public boolean hasNext() {
+                if(next==null)
+                    fetch();
+                return next!=null;
+            }
+
+            public Header next() {
+                if(next==null) {
+                    fetch();
+                    if(next==null)
+                        throw new NoSuchElementException();
+                }
+
+                if(markAsUnderstood) {
+                    assert get(idx-1)==next;
+                    understood(idx-1);
+                }
+
+                Header r = next;
+                next = null;
+                return r;
+            }
+
+            private void fetch() {
+                while(idx<size()) {
+                    Header h = get(idx++);
+                    if(h.getNamespaceURI().equals(nsUri)) {
+                        next = h;
+                        break;
+                    }
+                }
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    /**
+     * Gets the first {@link Header} of the specified name targeted at the
+     * current implicit role.
+     *
+     * @param name name of the header
+     * @param markUnderstood
+     *      If this parameter is true, the returned headers will
+     *      be marked as <a href="#MU">"understood"</a> when they are returned
+     *      from {@link Iterator#next()}.
+     * @return null if header not found
+     */
+    private Header getFirstHeader(QName name, boolean markUnderstood, SOAPVersion sv) {
+        if (sv == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION());
+
+        Iterator<Header> iter = getHeaders(name.getNamespaceURI(), name.getLocalPart(), markUnderstood);
+        while (iter.hasNext()) {
+            Header h = iter.next();
+            if (h.getRole(sv).equals(sv.implicitRole))
+                return h;
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the value of WS-Addressing <code>To</code> header. The <code>version</code>
+     * identifies the WS-Addressing version and the header returned is targeted at
+     * the current implicit role. Caches the value for subsequent invocation.
+     * Duplicate <code>To</code> headers are detected earlier.
+     *
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @throws IllegalArgumentException if either <code>av</code> or <code>sv</code> is null.
+     * @return Value of WS-Addressing To header, anonymous URI if no header is present
+     */
+    public String getTo(AddressingVersion av, SOAPVersion sv) {
+        if (to != null)
+            return to;
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        Header h = getFirstHeader(av.toTag, true, sv);
+        if (h != null) {
+            to = h.getStringContent();
+        } else {
+            to = av.anonymousUri;
+        }
+
+        return to;
+    }
+
+    /**
+     * Returns the value of WS-Addressing <code>Action</code> header. The <code>version</code>
+     * identifies the WS-Addressing version and the header returned is targeted at
+     * the current implicit role. Caches the value for subsequent invocation.
+     * Duplicate <code>Action</code> headers are detected earlier.
+     *
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @throws IllegalArgumentException if either <code>av</code> or <code>sv</code> is null.
+     * @return Value of WS-Addressing Action header, null if no header is present
+     */
+    public String getAction(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
+        if (action!= null)
+            return action;
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        Header h = getFirstHeader(av.actionTag, true, sv);
+        if (h != null) {
+            action = h.getStringContent();
+        }
+
+        return action;
+    }
+
+    /**
+     * Returns the value of WS-Addressing <code>ReplyTo</code> header. The <code>version</code>
+     * identifies the WS-Addressing version and the header returned is targeted at
+     * the current implicit role. Caches the value for subsequent invocation.
+     * Duplicate <code>ReplyTo</code> headers are detected earlier.
+     *
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @throws IllegalArgumentException if either <code>av</code> or <code>sv</code> is null.
+     * @return Value of WS-Addressing ReplyTo header, null if no header is present
+     */
+    public WSEndpointReference getReplyTo(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
+        if (replyTo!=null)
+            return replyTo;
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        Header h = getFirstHeader(av.replyToTag, true, sv);
+        if (h != null) {
+            try {
+                replyTo = h.readAsEPR(av);
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
+            }
+        } else {
+            replyTo = av.anonymousEpr;
+        }
+
+        return replyTo;
+    }
+
+    /**
+     * Returns the value of WS-Addressing <code>FaultTo</code> header. The <code>version</code>
+     * identifies the WS-Addressing version and the header returned is targeted at
+     * the current implicit role. Caches the value for subsequent invocation.
+     * Duplicate <code>FaultTo</code> headers are detected earlier.
+     *
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @throws IllegalArgumentException if either <code>av</code> or <code>sv</code> is null.
+     * @return Value of WS-Addressing FaultTo header, null if no header is present
+     */
+    public WSEndpointReference getFaultTo(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
+        if (faultTo != null)
+            return faultTo;
+
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        Header h = getFirstHeader(av.faultToTag, true, sv);
+        if (h != null) {
+            try {
+                faultTo = h.readAsEPR(av);
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(AddressingMessages.FAULT_TO_CANNOT_PARSE(), e);
+            }
+        }
+
+        return faultTo;
+    }
+
+    /**
+     * Returns the value of WS-Addressing <code>MessageID</code> header. The <code>version</code>
+     * identifies the WS-Addressing version and the header returned is targeted at
+     * the current implicit role. Caches the value for subsequent invocation.
+     * Duplicate <code>MessageID</code> headers are detected earlier.
+     *
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @throws WebServiceException if either <code>av</code> or <code>sv</code> is null.
+     * @return Value of WS-Addressing MessageID header, null if no header is present
+     */
+    public String getMessageID(@NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
+        if (messageId != null)
+            return messageId;
+
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        Header h = getFirstHeader(av.messageIDTag, true, sv);
+        if (h != null) {
+            messageId = h.getStringContent();
+        }
+
+        return messageId;
+    }
+
+    /**
+     * Creates a set of outbound WS-Addressing headers on the client with the
+     * specified Action Message Addressing Property value.
+     * <p><p>
+     * This method needs to be invoked right after such a Message is
+     * created which is error prone but so far only MEX, RM and JAX-WS
+     * creates a request so this ugliness is acceptable. This method is also used
+     * to create protocol messages that are not associated with any {@link WSBinding}
+     * and {@link WSDLPort}.
+     *
+     * @param packet request packet
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @param oneway Indicates if the message exchange pattern is oneway
+     * @param action Action Message Addressing Property value
+     */
+    public void fillRequestAddressingHeaders(Packet packet, AddressingVersion av, SOAPVersion sv, boolean oneway, String action) {
+        fillCommonAddressingHeaders(packet, av, sv, action);
+
+        // wsa:ReplyTo
+        // null or "true" is equivalent to request/response MEP
+        if (!oneway) {
+            WSEndpointReference epr = av.anonymousEpr;
+            add(epr.createHeader(av.replyToTag));
+
+            // wsa:MessageID
+            Header h = new StringHeader(av.messageIDTag, packet.getMessage().getID(av, sv));
+            add(h);
+        }
+    }
+
+    /**
+     * Creates a set of outbound WS-Addressing headers on the client with the
+     * default Action Message Addressing Property value.
+     * <p><p>
+     * This method needs to be invoked right after such a Message is
+     * created which is error prone but so far only MEX, RM and JAX-WS
+     * creates a request so this ugliness is acceptable. If more components
+     * are identified using this, then we may revisit this.
+     * <p><p>
+     * This method is used if default Action Message Addressing Property is to
+     * be used. See
+     * {@link #fillRequestAddressingHeaders(Packet, com.sun.xml.internal.ws.api.addressing.AddressingVersion, com.sun.xml.internal.ws.api.SOAPVersion, boolean, String)}
+     * if non-default Action is to be used, for example when creating a protocol message not
+     * associated with {@link WSBinding} and {@link WSDLPort}.
+     * This method uses SOAPAction as the Action unless set expplicitly in the wsdl.
+     * @param wsdlPort request WSDL port
+     * @param binding request WSBinding
+     * @param packet request packet
+     */
+    public void fillRequestAddressingHeaders(WSDLPort wsdlPort, @NotNull WSBinding binding, Packet packet) {
+        if (binding == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_BINDING());
+
+        AddressingVersion addressingVersion = binding.getAddressingVersion();
+        //seiModel is passed as null as it is not needed.
+        WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding);
+
+        // wsa:Action
+        String action = wsaHelper.getEffectiveInputAction(packet);
+        if (action == null || action.equals("")) {
+            throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION());
+        }
+        boolean oneway = !packet.expectReply;
+        if (wsdlPort != null) {
+            // if WSDL has <wsaw:Anonymous>prohibited</wsaw:Anonymous>, then throw an error
+            // as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to
+            // disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft
+            // the SOAP message with non-anonymous ReplyTo/FaultTo.
+            if (!oneway && packet.getMessage() != null && packet.getMessage().getOperation(wsdlPort) != null && packet.getMessage().getOperation(wsdlPort).getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited)
+            {
+                throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED());
+            }
+        }
+        if (!binding.isFeatureEnabled(OneWayFeature.class)) {
+            // standard oneway
+            fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), oneway, action);
+        } else {
+            // custom oneway
+            fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), binding.getFeature(OneWayFeature.class), action);
+        }
+    }
+
+    private void fillRequestAddressingHeaders(@NotNull Packet packet, @NotNull AddressingVersion av, @NotNull SOAPVersion sv, @NotNull OneWayFeature of, @NotNull String action) {
+        fillCommonAddressingHeaders(packet, av, sv, action);
+
+        // wsa:ReplyTo
+        if (of.getReplyTo() != null) {
+            add(of.getReplyTo().createHeader(av.replyToTag));
+
+            // add wsa:MessageID only for non-null ReplyTo
+            Header h = new StringHeader(av.messageIDTag, packet.getMessage().getID(av, sv));
+            add(h);
+        }
+
+        // wsa:From
+        if (of.getFrom() != null) {
+            add(of.getFrom().createHeader(av.fromTag));
+        }
+
+        // wsa:RelatesTo
+        if (of.getRelatesToID() != null) {
+            add(new RelatesToHeader(av.relatesToTag, of.getRelatesToID()));
+        }
+    }
+
+    /**
+     * Creates wsa:To, wsa:Action and wsa:MessageID header on the client
+     *
+     * @param packet request packet
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @param action Action Message Addressing Property value
+     * @throws IllegalArgumentException if any of the parameters is null.
+     */
+    private void fillCommonAddressingHeaders(Packet packet, @NotNull AddressingVersion av, @NotNull SOAPVersion sv, @NotNull String action) {
+        if (packet == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_PACKET());
+
+        if (av == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
+
+        if (sv == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_SOAP_VERSION());
+
+        if (action == null)
+            throw new IllegalArgumentException(AddressingMessages.NULL_ACTION());
+
+        // wsa:To
+        StringHeader h = new StringHeader(av.toTag, packet.endpointAddress.toString());
+        add(h);
+
+        // wsa:Action
+        packet.soapAction = action;
+        h = new StringHeader(av.actionTag, action);
+        add(h);
+    }
+
+    /**
+     * Adds a new {@link Header}.
+     *
+     * <p>
+     * Order doesn't matter in headers, so this method
+     * does not make any guarantee as to where the new header
+     * is inserted.
+     *
+     * @return
+     *      always true. Don't use the return value.
+     */
+    public boolean add(Header header) {
+        return super.add(header);
+    }
+
+    /**
+     * @deprecated
+     *      {@link HeaderList} is monotonic and you can't remove anything.
+     */
+    // to allow this, we need to implement the resizing of understoodBits
+    public Header remove(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @deprecated
+     *      {@link HeaderList} is monotonic and you can't remove anything.
+     */
+    public boolean remove(Object o) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @deprecated
+     *      {@link HeaderList} is monotonic and you can't remove anything.
+     */
+    public boolean removeAll(Collection<?> c) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @deprecated
+     *      {@link HeaderList} is monotonic and you can't remove anything.
+     */
+    public boolean retainAll(Collection<?> c) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Creates a copy.
+     *
+     * This handles null {@link HeaderList} correctly.
+     *
+     * @param original
+     *      Can be null, in which case null will be returned.
+     */
+    public static HeaderList copy(HeaderList original) {
+        if(original==null)
+            return null;
+        else
+            return new HeaderList(original);
+    }
+
+    public void readResponseAddressingHeaders(WSDLPort wsdlPort, WSBinding binding) {
+        // read Action
+        String action = getAction(binding.getAddressingVersion(), binding.getSOAPVersion());
+        // TODO: validate client-inbound Action
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Headers.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Headers.java
new file mode 100644
index 0000000..3c695fe
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Headers.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.message.DOMHeader;
+import com.sun.xml.internal.ws.message.StringHeader;
+import com.sun.xml.internal.ws.message.jaxb.JAXBHeader;
+import com.sun.xml.internal.ws.message.saaj.SAAJHeader;
+import com.sun.xml.internal.ws.message.stream.StreamHeader11;
+import com.sun.xml.internal.ws.message.stream.StreamHeader12;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Factory methods for various {@link Header} implementations.
+ *
+ * <p>
+ * This class provides various methods to create different
+ * flavors of {@link Header} classes that store data
+ * in different formats.
+ *
+ * <p>
+ * This is a part of the JAX-WS RI internal API so that
+ * {@link Pipe} implementations can reuse the implementations
+ * done inside the JAX-WS without having a strong dependency
+ * to the actual class.
+ *
+ * <p>
+ * If you find some of the useful convenience methods missing
+ * from this class, please talk to us.
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Headers {
+    private Headers() {}
+
+    /**
+     * @deprecated
+     *      Use {@link #create(JAXBRIContext, Object)} instead.
+     */
+    public static Header create(SOAPVersion soapVersion, Marshaller m, Object o) {
+        return new JAXBHeader(((MarshallerImpl)m).getContext(),o);
+    }
+
+    /**
+     * Creates a {@link Header} backed a by a JAXB bean.
+     */
+    public static Header create(JAXBRIContext context, Object o) {
+        return new JAXBHeader(context,o);
+    }
+
+    /**
+     * Creates a {@link Header} backed a by a JAXB bean, with the given tag name.
+     *
+     * See {@link #create(SOAPVersion, Marshaller, Object)} for the meaning
+     * of other parameters.
+     *
+     * @param tagName
+     *      The name of the newly created header. Must not be null.
+     * @param o
+     *      The JAXB bean that represents the contents of the header. Must not be null.
+     */
+    public static Header create(SOAPVersion soapVersion, Marshaller m, QName tagName, Object o) {
+        return create(soapVersion,m,new JAXBElement(tagName,o.getClass(),o));
+    }
+
+    /**
+     * Creates a {@link Header} backed a by a JAXB bean.
+     */
+    public static Header create(Bridge bridge, Object jaxbObject) {
+        return new JAXBHeader(bridge, jaxbObject);
+    }
+
+    /**
+     * Creates a new {@link Header} backed by a SAAJ object.
+     */
+    public static Header create(SOAPHeaderElement header) {
+        return new SAAJHeader(header);
+    }
+
+    /**
+     * Creates a new {@link Header} backed by an {@link Element}.
+     */
+    public static Header create( Element node ) {
+        return new DOMHeader<Element>(node);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #create(Element)}
+     */
+    public static Header create( SOAPVersion soapVersion, Element node ) {
+        return create(node);
+    }
+
+    /**
+     * Creates a new {@link Header} that reads from {@link XMLStreamReader}.
+     *
+     * <p>
+     * Note that the header implementation will read the entire data
+     * into memory anyway, so this might not be as efficient as you might hope.
+     */
+    public static Header create( SOAPVersion soapVersion, XMLStreamReader reader ) throws XMLStreamException {
+        switch(soapVersion) {
+        case SOAP_11:
+            return new StreamHeader11(reader);
+        case SOAP_12:
+            return new StreamHeader12(reader);
+        default:
+            throw new AssertionError();
+        }
+    }
+
+    /**
+     * Creates a new {@link Header} that that has a single text value in it
+     * (IOW, of the form &lt;foo>text&lt;/foo>.)
+     *
+     * @param name QName of the header element
+     * @param value text value of the header
+     */
+    public static Header create(QName name, String value) {
+        return new StringHeader(name, value);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Message.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Message.java
new file mode 100644
index 0000000..8a313d6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Message.java
@@ -0,0 +1,672 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.client.dispatch.DispatchImpl;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.ws.Dispatch;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.UUID;
+
+/**
+ * Represents a SOAP message.
+ *
+ *
+ * <h2>What is a message?</h2>
+ * <p>
+ * A {@link Message} consists of the following:
+ *
+ * <ol>
+ * <li>
+ *    Random-accessible list of headers.
+ *    a header is a representation of an element inside
+ *    &lt;soap:Header>.
+ *    It can be read multiple times,
+ *    can be added or removed, but it is not modifiable.
+ *    See {@link HeaderList} for more about headers.
+ *
+ * <li>
+ *    The payload of the message, which is a representation
+ *    of an element inside &lt;soap:Body>.
+ *    the payload is streamed, and therefore it can be
+ *    only read once (or can be only written to something once.)
+ *    once a payload is used, a message is said to be <b>consumed</b>.
+ *    A message {@link #hasPayload() may not have any payload.}
+ *
+ * <li>
+ *    Attachments.
+ *    TODO: can attachments be streamed? I suspect so.
+ *    does anyone need to read attachment twice?
+ *
+ * </ol>
+ *
+ *
+ * <h2>How does this abstraction work?</h2>
+ * <p>
+ * The basic idea behind the {@link Message} is to hide the actual
+ * data representation. For example, a {@link Message} might be
+ * constructed on top of an {@link InputStream} from the accepted HTTP connection,
+ * or it might be constructed on top of a JAXB object as a result
+ * of the method invocation through {@link Proxy}. There will be
+ * a {@link Message} implementation for each of those cases.
+ *
+ * <p>
+ * This interface provides a lot of methods that access the payload
+ * in many different forms, and implementations can implement those
+ * methods in the best possible way.
+ *
+ * <p>
+ * A particular attention is paid to make sure that a {@link Message}
+ * object can be constructed on a stream that is not fully read yet.
+ * We believe this improves the turn-around time on the server side.
+ *
+ * <p>
+ * It is often useful to wrap a {@link Message} into another {@link Message},
+ * for example to encrypt the body, or to verify the signature as the body
+ * is read.
+ *
+ * <p>
+ * This representation is also used for a REST-ful XML message.
+ * In such case we'll construct a {@link Message} with empty
+ * attachments and headers, and when serializing all headers
+ * and attachments will be ignored.
+ *
+ *
+ *
+ * <h2>Message and XOP</h2>
+ * <p>
+ * XOP is considered as an {@link Codec}, and therefore when you are looking at
+ * {@link Message}, you'll never see &lt;xop:Include> or any such elements
+ * (instead you'll see the base64 data inlined.) If a consumer of infoset isn't
+ * interested in handling XOP by himself, this allows him to work with XOP
+ * correctly even without noticing it.
+ *
+ * <p>
+ * For producers and consumers that are interested in accessing the binary data
+ * more efficiently, they can use {@link XMLStreamReaderEx} and
+ * {@link XMLStreamWriterEx}.
+ *
+ *
+ *
+ * <h2>Message lifespan</h2>
+ * <p>
+ * Often {@link Packet} include information local to a particular
+ * invocaion (such as {@code HttpServletRequest}, from this angle, it makes sense
+ * to tie a lifespan of a message to one pipeline invocation.
+ * <p>
+ * On the other hand, if you think about WS-RM, it often needs to hold on to
+ * a message longer than a pipeline invocation (you might get an HTTP request,
+ * get a message X, get a second HTTP request, get another message Y, and
+ * only then you might want to process X.)
+ * <p>
+ * TODO: what do we do about this?
+ *
+ *
+ * <pre>
+ * TODO: can body element have foreign attributes? maybe ID for security?
+ *       Yes, when the SOAP body is signed there will be an ID attribute present
+ *       But in this case any security based impl may need access
+ *       to the concrete representation.
+ * TODO: HTTP headers?
+ *       Yes. Abstracted as transport-based properties.
+ * TODO: who handles SOAP 1.1 and SOAP 1.2 difference?
+ *       As separate channel implementations responsible for the creation of the
+ *       message?
+ * TODO: session?
+ * TODO: Do we need to expose SOAPMessage explicitly?
+ *       SOAPMessage could be the concrete representation but is it necessary to
+ *       transform between different concrete representations?
+ *       Perhaps this comes down to how use channels for creation and processing.
+ * TODO: Do we need to distinguish better between creation and processing?
+ *       Do we really need the requirement that a created message can be resused
+ *       for processing. Shall we bifurcate?
+ *
+ * TODO: SOAP version issue
+ *       SOAP version is determined by the context, so message itself doesn't carry it around (?)
+ *
+ * TODO: wrapping message needs easier. in particular properties and attachments.
+ * </pre>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Message {
+
+    /**
+     * Returns true if headers are present in the message.
+     *
+     * @return
+     *      true if headers are present.
+     */
+    public abstract boolean hasHeaders();
+
+    /**
+     * Gets all the headers of this message.
+     *
+     * <h3>Implementation Note</h3>
+     * <p>
+     * {@link Message} implementation is allowed to defer
+     * the construction of {@link HeaderList} object. So
+     * if you only want to check for the existence of any header
+     * element, use {@link #hasHeaders()}.
+     *
+     * @return
+     *      always return the same non-null object.
+     */
+    public abstract @NotNull HeaderList getHeaders();
+
+    /**
+     * Gets the attachments of this message
+     * (attachments live outside a message.)
+     */
+    public @NotNull AttachmentSet getAttachments() {
+        if (attachmentSet == null) {
+            attachmentSet = new AttachmentSetImpl();
+        }
+        return attachmentSet;
+    }
+
+    /**
+     * Optimization hint for the derived class to check
+     * if we may have some attachments.
+     */
+    protected boolean hasAttachments() {
+        return attachmentSet!=null;
+    }
+
+    protected AttachmentSet attachmentSet;
+
+    private WSDLBoundOperation operation = null;
+
+    /**
+     * Returns the operation of which this message is an instance of.
+     *
+     * <p>
+     * This method relies on {@link WSDLBoundPortType#getOperation(String, String)} but
+     * it does so in an efficient way.
+     *
+     * <p>
+     * This method works only for a request. A pipe can determine an operation for a request,
+     * and then keep it in a local variable to use it with a response, so there should be
+     * no need to find out operation from a response (besides, there might not be any response!).
+     *
+     * @param boundPortType
+     *      This represents the port for which this message is used.
+     *      Most {@link Pipe}s should get this information when they are created,
+     *      since a pippeline always work against a particular type of {@link WSDLPort}.
+     *
+     * @return
+     *      Null if the operation was not found. This is possible, for example when a protocol
+     *      message is sent through a pipeline, or when we receive an invalid request on the server,
+     *      or when we are on the client and the user appliation sends a random DOM through
+     *      {@link Dispatch}, so this error needs to be handled gracefully.
+     */
+    public final @Nullable WSDLBoundOperation getOperation(@NotNull WSDLBoundPortType boundPortType) {
+        if(operation==null)
+            operation = boundPortType.getOperation(getPayloadNamespaceURI(),getPayloadLocalPart());
+        return operation;
+    }
+
+    /**
+     * The same as {@link #getOperation(WSDLBoundPortType)} but
+     * takes {@link WSDLPort} for convenience.
+     */
+    public final @Nullable WSDLBoundOperation getOperation(@NotNull WSDLPort port) {
+        return getOperation(port.getBinding());
+    }
+
+    /**
+     * Returns the java Method of which this message is an instance of.
+     *
+     *
+     * <p>
+     * This method works only for a request. A pipe can determine a {@link Method}
+     * for a request, and then keep it in a local variable to use it with a response,
+     * so there should be no need to find out operation from a response (besides,
+     * there might not be any response!).
+     *
+     * @param seiModel
+     *      This represents the java model for the endpoint
+     *      Some server {@link Pipe}s would get this information when they are created.
+     *
+     * @return
+     *      Null if there is no corresponding Method for this message. This is
+     *      possible, for example when a protocol message is sent through a
+     *      pipeline, or when we receive an invalid request on the server,
+     *      or when we are on the client and the user appliation sends a random
+     *      DOM through {@link Dispatch}, so this error needs to be handled
+     *      gracefully.
+     */
+    public final @Nullable JavaMethod getMethod(@NotNull SEIModel seiModel) {
+        String localPart = getPayloadLocalPart();
+        String nsUri;
+        if (localPart == null) {
+            localPart = "";
+            nsUri = "";
+        } else {
+            nsUri = getPayloadNamespaceURI();
+        }
+        QName name = new QName(nsUri, localPart);
+        return seiModel.getJavaMethod(name);
+    }
+
+    private Boolean isOneWay;
+
+    /**
+     * Returns true if this message is a request message for a
+     * one way operation according to the given WSDL. False otherwise.
+     *
+     * <p>
+     * This method is functionally equivalent as doing
+     * {@code getOperation(port).getOperation().isOneWay()}
+     * (with proper null check and all.) But this method
+     * can sometimes work faster than that (for example,
+     * on the client side when used with SEI.)
+     *
+     * @param port
+     *      {@link Message}s are always created under the context of
+     *      one {@link WSDLPort} and they never go outside that context.
+     *      Pass in that "governing" {@link WSDLPort} object here.
+     *      We chose to receive this as a parameter instead of
+     *      keeping {@link WSDLPort} in a message, just to save the storage.
+     *
+     *      <p>
+     *      The implementation of this method involves caching the return
+     *      value, so the behavior is undefined if multiple callers provide
+     *      different {@link WSDLPort} objects, which is a bug of the caller.
+     */
+    public boolean isOneWay(@NotNull WSDLPort port) {
+        if(isOneWay==null) {
+            // we don't know, so compute.
+            WSDLBoundOperation op = getOperation(port);
+            if(op!=null)
+                isOneWay = op.getOperation().isOneWay();
+            else
+                // the contract is to return true only when it's known to be one way.
+                isOneWay = false;
+        }
+        return isOneWay;
+    }
+
+    /**
+     * Makes an assertion that this {@link Message} is
+     * a request message for an one-way operation according
+     * to the context WSDL.
+     *
+     * <p>
+     * This method is really only intended to be invoked from within
+     * the JAX-WS runtime, and not by any code building on top of it.
+     *
+     * <p>
+     * This method can be invoked only when the caller "knows" what
+     * WSDL says. Also, there's no point in invoking this method if the caller
+     * is doing  {@code getOperation(port).getOperation().isOneWay()},
+     * or sniffing the payload tag name.
+     * In particular, this includes {@link DispatchImpl}.
+     *
+     * <p>
+     * Once called, this allows {@link #isOneWay(WSDLPort)} method
+     * to return a value quickly.
+     *
+     * @see #isOneWay(WSDLPort)
+     */
+    public final void assertOneWay(boolean value) {
+        // if two callers make different assertions, that's a bug.
+        // this is an assertion, not a runtime check because
+        // nobody outside JAX-WS should be using this.
+        assert isOneWay==null || isOneWay==value;
+
+        isOneWay = value;
+    }
+
+
+    /**
+     * Gets the local name of the payload element.
+     *
+     * @return
+     *      null if a {@link Message} doesn't have any payload.
+     */
+    public abstract @Nullable String getPayloadLocalPart();
+
+    /**
+     * Gets the namespace URI of the payload element.
+     *
+     * @return
+     *      null if a {@link Message} doesn't have any payload.
+     */
+    public abstract String getPayloadNamespaceURI();
+    // I'm not putting @Nullable on it because doing null check on getPayloadLocalPart() should be suffice
+
+    /**
+     * Returns true if a {@link Message} has a payload.
+     *
+     * <p>
+     * A message without a payload is a SOAP message that looks like:
+     * <pre><xmp>
+     * <S:Envelope>
+     *   <S:Header>
+     *     ...
+     *   </S:Header>
+     *   <S:Body />
+     * </S:Envelope>
+     * </xmp></pre>
+     */
+    public abstract boolean hasPayload();
+
+    /**
+     * Returns true if this message is a fault.
+     *
+     * <p>
+     * Just a convenience method built on {@link #getPayloadNamespaceURI()}
+     * and {@link #getPayloadLocalPart()}.
+     */
+    public boolean isFault() {
+        // TODO: is SOAP version a property of a Message?
+        // or is it defined by external factors?
+        // how do I compare?
+        String localPart = getPayloadLocalPart();
+        if(localPart==null || !localPart.equals("Fault"))
+            return false;
+
+        String nsUri = getPayloadNamespaceURI();
+        return nsUri.equals(SOAPVersion.SOAP_11.nsUri) || nsUri.equals(SOAPVersion.SOAP_12.nsUri);
+    }
+
+    /**
+     * Consumes this message including the envelope.
+     * returns it as a {@link Source} object.
+     */
+    public abstract Source readEnvelopeAsSource();
+
+
+    /**
+     * Returns the payload as a {@link Source} object.
+     *
+     * This consumes the message.
+     *
+     * @return
+     *      if there's no payload, this method returns null.
+     */
+    public abstract Source readPayloadAsSource();
+
+    /**
+     * Creates the equivalent {@link SOAPMessage} from this message.
+     *
+     * This consumes the message.
+     *
+     * @throws SOAPException
+     *      if there's any error while creating a {@link SOAPMessage}.
+     */
+    public abstract SOAPMessage readAsSOAPMessage() throws SOAPException ;
+
+    /**
+     * Creates the equivalent {@link SOAPMessage} from this message. It also uses
+     * transport specific headers from Packet during the SOAPMessage construction
+     * so that {@link SOAPMessage#getMimeHeaders()} gives meaningful transport
+     * headers.
+     *
+     * This consumes the message.
+     *
+     * @throws SOAPException
+     *      if there's any error while creating a {@link SOAPMessage}.
+     */
+    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
+        return readAsSOAPMessage();
+    }
+
+    /**
+     * Reads the payload as a JAXB object by using the given unmarshaller.
+     *
+     * This consumes the message.
+     *
+     * @throws JAXBException
+     *      If JAXB reports an error during the processing.
+     */
+    public abstract <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException;
+
+    /**
+     * Reads the payload as a JAXB object according to the given {@link Bridge}.
+     *
+     * This consumes the message.
+     *
+     * @throws JAXBException
+     *      If JAXB reports an error during the processing.
+     */
+    public abstract <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException;
+
+    /**
+     * Reads the payload as a {@link XMLStreamReader}
+     *
+     * This consumes the message. The caller is encouraged to call
+     * {@link XMLStreamReaderFactory#recycle(XMLStreamReader)} when finished using
+     * the instance.
+     *
+     * @return
+     *      If there's no payload, this method returns null.
+     *      Otherwise always non-null valid {@link XMLStreamReader} that points to
+     *      the payload tag name.
+     */
+    public abstract XMLStreamReader readPayload() throws XMLStreamException;
+
+    /**
+     * Marks the message as consumed, without actually reading the contents.
+     *
+     * <p>
+     * This method provides an opportunity for implementations to reuse
+     * any reusable resources needed for representing the payload.
+     */
+    public void consume() {}
+
+    /**
+     * Writes the payload to StAX.
+     *
+     * This method writes just the payload of the message to the writer.
+     * This consumes the message.
+     * The implementation will not write
+     * {@link XMLStreamWriter#writeStartDocument()}
+     * nor
+     * {@link XMLStreamWriter#writeEndDocument()}
+     *
+     * <p>
+     * If there's no payload, this method is no-op.
+     *
+     * @throws XMLStreamException
+     *      If the {@link XMLStreamWriter} reports an error,
+     *      or some other errors happen during the processing.
+     */
+    public abstract void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException;
+
+    /**
+     * Writes the whole SOAP message (but not attachments)
+     * to the given writer.
+     *
+     * This consumes the message.
+     *
+     * @throws XMLStreamException
+     *      If the {@link XMLStreamWriter} reports an error,
+     *      or some other errors happen during the processing.
+     */
+    public abstract void writeTo(XMLStreamWriter sw) throws XMLStreamException;
+
+    /**
+     * Writes the whole SOAP envelope as SAX events.
+     *
+     * <p>
+     * This consumes the message.
+     *
+     * @param contentHandler
+     *      must not be nulll.
+     * @param errorHandler
+     *      must not be null.
+     *      any error encountered during the SAX event production must be
+     *      first reported to this error handler. Fatal errors can be then
+     *      thrown as {@link SAXParseException}. {@link SAXException}s thrown
+     *      from {@link ErrorHandler} should propagate directly through this method.
+     */
+    public abstract void writeTo( ContentHandler contentHandler, ErrorHandler errorHandler ) throws SAXException;
+
+    // TODO: do we need a method that reads payload as a fault?
+    // do we want a separte streaming representation of fault?
+    // or would SOAPFault in SAAJ do?
+
+
+
+    /**
+     * Creates a copy of a {@link Message}.
+     *
+     * <p>
+     * This method creates a new {@link Message} whose header/payload/attachments/properties
+     * are identical to this {@link Message}. Once created, the created {@link Message}
+     * and the original {@link Message} behaves independently --- adding header/
+     * attachment to one {@link Message} doesn't affect another {@link Message}
+     * at all.
+     *
+     * <p>
+     * This method does <b>NOT</b> consume a message.
+     *
+     * <p>
+     * To enable efficient copy operations, there's a few restrictions on
+     * how copied message can be used.
+     *
+     * <ol>
+     *  <li>The original and the copy may not be
+     *      used concurrently by two threads (this allows two {@link Message}s
+     *      to share some internal resources, such as JAXB marshallers.)
+     *      Note that it's OK for the original and the copy to be processed
+     *      by two threads, as long as they are not concurrent.
+     *
+     *  <li>The copy has the same 'life scope'
+     *      as the original (this allows shallower copy, such as
+     *      JAXB beans wrapped in {@link JAXBMessage}.)
+     * </ol>
+     *
+     * <p>
+     * A 'life scope' of a message created during a message processing
+     * in a pipeline is until a pipeline processes the next message.
+     * A message cannot be kept beyond its life scope.
+     *
+     * (This experimental design is to allow message objects to be reused
+     * --- feedback appreciated.)
+     *
+     *
+     *
+     * <h3>Design Rationale</h3>
+     * <p>
+     * Since a {@link Message} body is read-once, sometimes
+     * (such as when you do fail-over, or WS-RM) you need to
+     * create an idential copy of a {@link Message}.
+     *
+     * <p>
+     * The actual copy operation depends on the layout
+     * of the data in memory, hence it's best to be done by
+     * the {@link Message} implementation itself.
+     *
+     * <p>
+     * The restrictions placed on the use of copied {@link Message} can be
+     * relaxed if necessary, but it will make the copy method more expensive.
+     */
+    // TODO: update the class javadoc with 'lifescope'
+    // and move the discussion about life scope there.
+    public abstract Message copy();
+
+    private String uuid;
+
+    /**
+     * Retuns a unique id for the message. The id can be used for various things,
+     * like debug assistance, logging, and MIME encoding(say for boundary).
+     *
+     * <p>
+     * This method will check the existence of the addressing <MessageID> header,
+     * and if present uses that value. Otherwise it generates one from UUID.random(),
+     * and return it without adding a new header. But it doesn't add a <MessageID>
+     * to the header list since we expect them to be added before calling this
+     * method.
+     *
+     * <p>
+     * Addressing tube will go do a separate verification on inbound
+     * headers to make sure that <MessageID> header is present when it's
+     * supposed to be.
+     *
+     * @param binding object created by {@link BindingID#createBinding()}
+     *
+     * @return unique id for the message
+     */
+    public @NotNull String getID(@NotNull WSBinding binding) {
+        return getID(binding.getAddressingVersion(), binding.getSOAPVersion());
+    }
+
+    /**
+     * Retuns a unique id for the message.
+     * <p><p>
+     * @see {@link #getID(com.sun.xml.internal.ws.api.WSBinding)} for detailed description.
+     * @param av WS-Addressing version
+     * @param sv SOAP version
+     * @return unique id for the message
+     */
+    public @NotNull String getID(AddressingVersion av, SOAPVersion sv) {
+        if (uuid == null) {
+            if (av != null) {
+                uuid = getHeaders().getMessageID(av, sv);
+            }
+            if (uuid == null) {
+                uuid = "uuid:" + UUID.randomUUID().toString();
+            }
+        }
+        return uuid;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Messages.java
new file mode 100644
index 0000000..93367d5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Messages.java
@@ -0,0 +1,360 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.Codecs;
+import com.sun.xml.internal.ws.encoding.StreamSOAPCodec;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.DOMMessage;
+import com.sun.xml.internal.ws.message.EmptyMessageImpl;
+import com.sun.xml.internal.ws.message.ProblemActionHeader;
+import com.sun.xml.internal.ws.message.stream.PayloadStreamReaderMessage;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.message.saaj.SAAJMessage;
+import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+import com.sun.xml.internal.ws.message.source.ProtocolSourceMessage;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderException;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import javax.xml.soap.*;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Factory methods for various {@link Message} implementations.
+ *
+ * <p>
+ * This class provides various methods to create different
+ * flavors of {@link Message} classes that store data
+ * in different formats.
+ *
+ * <p>
+ * This is a part of the JAX-WS RI internal API so that
+ * {@link Tube} implementations can reuse the implementations
+ * done inside the JAX-WS.
+ *
+ * <p>
+ * If you find some of the useful convenience methods missing
+ * from this class, please talk to us.
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Messages {
+    private Messages() {}
+
+    /**
+     * Creates a {@link Message} backed by a JAXB bean.
+     *
+     * @param context
+     *      The context to be used to produce infoset from the object. Must not be null.
+     * @param jaxbObject
+     *      The JAXB object that represents the payload. must not be null. This object
+     *      must be bound to an element (which means it either is a {@link JAXBElement} or
+     *      an instanceof a class with {@link XmlRootElement}).
+     * @param soapVersion
+     *      The SOAP version of the message. Must not be null.
+     */
+    public static Message create(JAXBRIContext context, Object jaxbObject, SOAPVersion soapVersion) {
+        return JAXBMessage.create(context,jaxbObject,soapVersion);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #create(JAXBRIContext, Object, SOAPVersion)}
+     */
+    public static Message create(Marshaller marshaller, Object jaxbObject, SOAPVersion soapVersion) {
+        return create(((MarshallerImpl)marshaller).getContext(),jaxbObject,soapVersion);
+    }
+
+    /**
+     * Creates a {@link Message} backed by a SAAJ {@link SOAPMessage} object.
+     *
+     * <p>
+     * If the {@link SOAPMessage} contains headers and attachments, this method
+     * does the right thing.
+     *
+     * @param saaj
+     *      The SOAP message to be represented as a {@link Message}.
+     *      Must not be null. Once this method is invoked, the created
+     *      {@link Message} will own the {@link SOAPMessage}, so it shall
+     *      never be touched directly.
+     */
+    public static Message create(SOAPMessage saaj) {
+        return new SAAJMessage(saaj);
+    }
+
+    /**
+     * Creates a {@link Message} using {@link Source} as payload.
+     *
+     * @param payload
+     *      Source payload is {@link Message}'s payload
+     *      Must not be null. Once this method is invoked, the created
+     *      {@link Message} will own the {@link Source}, so it shall
+     *      never be touched directly.
+     *
+     * @param ver
+     *      The SOAP version of the message. Must not be null.
+     */
+    public static Message createUsingPayload(Source payload, SOAPVersion ver) {
+        return new PayloadSourceMessage(payload, ver);
+    }
+
+    /**
+     * Creates a {@link Message} using {@link XMLStreamReader} as payload.
+     *
+     * @param payload
+     *      XMLStreamReader payload is {@link Message}'s payload
+     *      Must not be null. Once this method is invoked, the created
+     *      {@link Message} will own the {@link XMLStreamReader}, so it shall
+     *      never be touched directly.
+     *
+     * @param ver
+     *      The SOAP version of the message. Must not be null.
+     */
+    public static Message createUsingPayload(XMLStreamReader payload, SOAPVersion ver) {
+        return new PayloadStreamReaderMessage(payload, ver);
+    }
+
+    /**
+     * Creates a {@link Message} from an {@link Element} that represents
+     * a payload.
+     *
+     * @param payload
+     *      The element that becomes the child element of the SOAP body.
+     *      Must not be null.
+     *
+     * @param ver
+     *      The SOAP version of the message. Must not be null.
+     */
+    public static Message createUsingPayload(Element payload, SOAPVersion ver) {
+        return new DOMMessage(ver,payload);
+    }
+
+    /**
+     * Creates a {@link Message} from an {@link Element} that represents
+     * the whole SOAP message.
+     *
+     * @param soapEnvelope
+     *      The SOAP envelope element.
+     */
+    public static Message create(Element soapEnvelope) {
+        SOAPVersion ver = SOAPVersion.fromNsUri(soapEnvelope.getNamespaceURI());
+        // find the headers
+        Element header = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Header");
+        HeaderList headers = null;
+        if(header!=null) {
+            for( Node n=header.getFirstChild(); n!=null; n=n.getNextSibling() ) {
+                if(n.getNodeType()==Node.ELEMENT_NODE) {
+                    if(headers==null)
+                        headers = new HeaderList();
+                    headers.add(Headers.create((Element)n));
+                }
+            }
+        }
+
+        // find the payload
+        Element body = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
+        if(body==null)
+            throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
+        Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");
+
+        if(payload==null) {
+            return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
+        } else {
+            return new DOMMessage(ver,headers,payload);
+        }
+    }
+
+    /**
+     * Creates a {@link Message} using Source as entire envelope.
+     *
+     * @param envelope
+     *      Source envelope is used to create {@link Message}
+     *      Must not be null. Once this method is invoked, the created
+     *      {@link Message} will own the {@link Source}, so it shall
+     *      never be touched directly.
+     *
+     */
+    public static Message create(Source envelope, SOAPVersion soapVersion) {
+        return new ProtocolSourceMessage(envelope, soapVersion);
+    }
+
+
+    /**
+     * Creates a {@link Message} that doesn't have any payload.
+     */
+    public static Message createEmpty(SOAPVersion soapVersion) {
+        return new EmptyMessageImpl(soapVersion);
+    }
+
+    /**
+     * Creates a {@link Message} from {@link XMLStreamReader} that points to
+     * the start of the envelope.
+     *
+     * @param reader
+     *      can point to the start document or the start element (of &lt;s:Envelope>)
+     */
+    public static @NotNull Message create(@NotNull XMLStreamReader reader) {
+        // skip until the root element
+        if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT)
+            XMLStreamReaderUtil.nextElementContent(reader);
+        assert reader.getEventType()== XMLStreamConstants.START_ELEMENT :reader.getEventType();
+
+        SOAPVersion ver = SOAPVersion.fromNsUri(reader.getNamespaceURI());
+
+        return Codecs.createSOAPEnvelopeXmlCodec(ver).decode(reader);
+    }
+
+    /**
+     * Creates a {@link Message} from {@link XMLStreamBuffer} that retains the
+     * whole envelope infoset.
+     *
+     * @param xsb
+     *      This buffer must contain the infoset of the whole envelope.
+     */
+    public static @NotNull Message create(@NotNull XMLStreamBuffer xsb) {
+        // TODO: we should be able to let Messae know that it's working off from a buffer,
+        // to make some of the operations more efficient.
+        // meanwhile, adding this as an API so that our users can take advantage of it
+        // when we get around to such an implementation later.
+        try {
+            return create(xsb.readAsXMLStreamReader());
+        } catch (XMLStreamException e) {
+            throw new XMLStreamReaderException(e);
+        }
+    }
+
+    /**
+     * Creates a {@link Message} that represents an exception as a fault. The
+     * created message reflects if t or t.getCause() is SOAPFaultException.
+     *
+     * creates a fault message with default faultCode env:Server if t or t.getCause()
+     * is not SOAPFaultException. Otherwise, it use SOAPFaultException's faultCode
+     *
+     * @return
+     *      Always non-null. A message that wraps this {@link Throwable}.
+     *
+     */
+    public static Message create(Throwable t, SOAPVersion soapVersion) {
+        return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, t);
+    }
+
+    /**
+     * Creates a fault {@link Message}.
+     *
+     * <p>
+     * This method is not designed for efficiency, and we don't expect
+     * to be used for the performance critical codepath.
+     *
+     * @param fault
+     *      The populated SAAJ data structure that represents a fault
+     *      in detail.
+     *
+     * @return
+     *      Always non-null. A message that wraps this {@link SOAPFault}.
+     */
+    public static Message create(SOAPFault fault) {
+        SOAPVersion ver = SOAPVersion.fromNsUri(fault.getNamespaceURI());
+        return new DOMMessage(ver,fault);
+    }
+
+    /**
+     * Creates a fault {@link Message} that captures the code/subcode/subsubcode
+     * defined by WS-Addressing if wsa:Action is not supported.
+     *
+     * @param unsupportedAction The unsupported Action. Must not be null.
+     * @param av The WS-Addressing version of the message. Must not be null.
+     * @param sv The SOAP Version of the message. Must not be null.
+     *
+     * @return
+     *      A message representing SOAPFault that contains the WS-Addressing code/subcode/subsubcode.
+     */
+    public static Message create(@NotNull String unsupportedAction, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
+        QName subcode = av.actionNotSupportedTag;
+        String faultstring = String.format(av.actionNotSupportedText, unsupportedAction);
+
+        Message faultMessage;
+        SOAPFault fault;
+        try {
+            if (sv == SOAPVersion.SOAP_12) {
+                fault = SOAPVersion.SOAP_12.saajSoapFactory.createFault();
+                fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
+                fault.appendFaultSubcode(subcode);
+                Detail detail = fault.addDetail();
+                SOAPElement se = detail.addChildElement(av.problemActionTag);
+                se = se.addChildElement(av.actionTag);
+                se.addTextNode(unsupportedAction);
+            } else {
+                fault = SOAPVersion.SOAP_11.saajSoapFactory.createFault();
+                fault.setFaultCode(subcode);
+            }
+            fault.setFaultString(faultstring);
+
+            faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(sv, fault);
+            if (sv == SOAPVersion.SOAP_11) {
+                faultMessage.getHeaders().add(new ProblemActionHeader(unsupportedAction, av));
+            }
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+
+        return faultMessage;
+    }
+
+    /**
+     * To be called to convert a  {@link ProtocolException} and faultcode for a given {@link SOAPVersion} in to a {@link Message}.
+     *
+     * @param soapVersion {@link SOAPVersion#SOAP_11} or {@link SOAPVersion#SOAP_12}
+     * @param pex a ProtocolException
+     * @param faultcode soap faultcode. Its ignored if the {@link ProtocolException} instance is {@link javax.xml.ws.soap.SOAPFaultException} and it has a
+     * faultcode present in the underlying {@link SOAPFault}.
+     * @return {@link Message} representing SOAP fault
+     */
+    public static @NotNull Message create(@NotNull SOAPVersion soapVersion, @NotNull ProtocolException pex, @Nullable QName faultcode){
+        return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, pex, faultcode);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Packet.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Packet.java
new file mode 100644
index 0000000..9a9ddfa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Packet.java
@@ -0,0 +1,763 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
+import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+import com.sun.xml.internal.ws.api.DistributedPropertySet;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.server.TransportBackChannel;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+import com.sun.xml.internal.ws.client.BindingProviderProperties;
+import com.sun.xml.internal.ws.client.ContentNegotiation;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.client.ResponseContext;
+import com.sun.xml.internal.ws.developer.JAXWSProperties;
+import com.sun.xml.internal.ws.message.RelatesToHeader;
+import com.sun.xml.internal.ws.message.StringHeader;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Represents a container of a {@link Message}.
+ *
+ * <h2>What is a {@link Packet}?</h2>
+ * <p>
+ * A packet can be thought of as a frame/envelope/package that wraps
+ * a {@link Message}. A packet keeps track of optional metadata (properties)
+ * about a {@link Message} that doesn't go across the wire.
+ * This roughly corresponds to {@link MessageContext} in the JAX-WS API.
+ *
+ * <p>
+ * Usually a packet contains a {@link Message} in it, but sometimes
+ * (such as for a reply of an one-way operation), a packet may
+ * float around without a {@link Message} in it.
+ *
+ *
+ * <a name="properties"></a>
+ * <h2>Properties</h2>
+ * <p>
+ * Information frequently used inside the JAX-WS RI
+ * is stored in the strongly-typed fields. Other information is stored
+ * in terms of a generic {@link Map} (see
+ * {@link #invocationProperties}.)
+ *
+ * <p>
+ * Some properties need to be retained between request and response,
+ * some don't. For strongly typed fields, this characteristic is
+ * statically known for each of them, and propagation happens accordingly.
+ * For generic information stored in {@link Map}, {@link #invocationProperties}
+ * stores per-invocation scope information (which carries over to
+ * the response.)
+ *
+ * <p>
+ * This object is used as the backing store of {@link MessageContext}, and
+ * {@link LogicalMessageContext} and {@link SOAPMessageContext} will
+ * be delegating to this object for storing/retrieving values.
+ *
+ *
+ * <h3>Relationship to request/response context</h3>
+ * <p>
+ * {@link BindingProvider#getRequestContext() Request context} is used to
+ * seed the initial values of {@link Packet}.
+ * Some of those values go to strongly-typed fields, and others go to
+ * {@link #invocationProperties}, as they need to be retained in the reply message.
+ *
+ * <p>
+ * Similarly, {@link BindingProvider#getResponseContext() response context}
+ * is constructed from {@link Packet} (or rather it's just a view of {@link Packet}.)
+ * by using properties from {@link #invocationProperties},
+ * modulo properties named explicitly in {@link #getHandlerScopePropertyNames(boolean)}.
+ * IOW, properties added to {@link #invocationProperties}
+ * are exposed to the response context by default.
+ *
+ *
+ *
+ * <h3>TODO</h3>
+ * <ol>
+ *  <li>this class needs to be cloneable since Message is copiable.
+ *  <li>The three live views aren't implemented correctly. It will be
+ *      more work to do so, although I'm sure it's possible.
+ *  <li>{@link Property} annotation is to make it easy
+ *      for {@link MessageContext} to export properties on this object,
+ *      but it probably needs some clean up.
+ * </ol>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class Packet extends DistributedPropertySet {
+
+    /**
+     * Creates a {@link Packet} that wraps a given {@link Message}.
+     *
+     * <p>
+     * This method should be only used to create a fresh {@link Packet}.
+     * To create a {@link Packet} for a reply, use {@link #createResponse(Message)}.
+     *
+     * @param request
+     *      The request {@link Message}. Can be null.
+     */
+    public Packet(Message request) {
+        this();
+        this.message = request;
+    }
+
+    /**
+     * Creates an empty {@link Packet} that doesn't have any {@link Message}.
+     */
+    public Packet() {
+        this.invocationProperties = new HashMap<String,Object>();
+    }
+
+    /**
+     * Used by {@link #createResponse(Message)}.
+     */
+    private Packet(Packet that) {
+        that.copySatelliteInto(this);
+        this.handlerConfig = that.handlerConfig;
+        this.invocationProperties = that.invocationProperties;
+        this.handlerScopePropertyNames = that.handlerScopePropertyNames;
+        this.contentNegotiation = that.contentNegotiation;
+        this.wasTransportSecure = that.wasTransportSecure;
+        // copy other properties that need to be copied. is there any?
+    }
+
+    private Message message;
+
+    /**
+     * Gets the last {@link Message} set through {@link #setMessage(Message)}.
+     *
+     * @return
+     *      may null. See the class javadoc for when it's null.
+     */
+    public Message getMessage() {
+        return message;
+    }
+
+    /**
+     * Sets a {@link Message} to this packet.
+     *
+     * @param message
+     *      Can be null.
+     */
+    public void setMessage(Message message) {
+        this.message = message;
+    }
+
+    /**
+     * True if this message came from a transport (IOW inbound),
+     * and in paricular from a "secure" transport. A transport
+     * needs to set this flag appropriately.
+     *
+     * <p>
+     * This is a requirement from the security team.
+     */
+    // TODO: expose this as a property
+    public boolean wasTransportSecure;
+
+    /**
+     * Inbound transport headers are captured in a transport neutral way.
+     * Transports are expected to fill this data after creating a Packet.
+     * <p>
+     * {@link SOAPMessage#getMimeHeaders()} would return these headers.
+     *
+     */
+    public static final String INBOUND_TRANSPORT_HEADERS = "com.sun.xml.internal.ws.api.message.packet.inbound.transport.headers";
+
+    /**
+     * Outbound transport headers are captured in a transport neutral way.
+     *
+     * <p>
+     * Transports may choose to ignore certain headers that interfere with
+     * its correct operation, such as
+     * <tt>Content-Type</tt> and <tt>Content-Length</tt>.
+     */
+    public static final String OUTBOUND_TRANSPORT_HEADERS = "com.sun.xml.internal.ws.api.message.packet.outbound.transport.headers";
+
+
+    /**
+     * This property holds the snapshot of HandlerConfiguration
+     * at the time of invocation.
+     * This property is used by MUPipe and HandlerPipe implementations.
+     */
+    @Property(BindingProviderProperties.JAXWS_HANDLER_CONFIG)
+    public HandlerConfiguration handlerConfig;
+
+    /**
+     * If a message originates from a proxy stub that implements
+     * a port interface, this field is set to point to that object.
+     *
+     * TODO: who's using this property?
+     */
+    @Property(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY)
+    public BindingProvider proxy;
+
+    /**
+     * The endpoint address to which this message is sent to.
+     *
+     * <p>
+     * The JAX-WS spec allows this to be changed for each message,
+     * so it's designed to be a property.
+     *
+     * <p>
+     * Must not be null for a request message on the client. Otherwise
+     * it's null.
+     */
+    public EndpointAddress endpointAddress;
+
+    /**
+     * @deprecated
+     *      The programatic acccess should be done via
+     *      {@link #endpointAddress}. This is for JAX-WS client applications
+     *      that access this property via {@link BindingProvider#ENDPOINT_ADDRESS_PROPERTY}.
+     */
+    @Property(BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
+    public String getEndPointAddressString() {
+        if(endpointAddress==null)
+            return null;
+        else
+            return endpointAddress.toString();
+    }
+
+    public void setEndPointAddressString(String s) {
+        if(s==null)
+            this.endpointAddress = null;
+        else
+            this.endpointAddress = EndpointAddress.create(s);
+    }
+
+    /**
+     * The value of {@link ContentNegotiation#PROPERTY}
+     * property.
+     *
+     * This property is used only on the client side.
+     */
+    public ContentNegotiation contentNegotiation;
+
+    @Property(ContentNegotiation.PROPERTY)
+    public String getContentNegotiationString() {
+        return (contentNegotiation != null) ? contentNegotiation.toString() : null;
+    }
+
+    public void setContentNegotiationString(String s) {
+        if(s==null)
+            contentNegotiation = null;
+        else {
+            try {
+                contentNegotiation = ContentNegotiation.valueOf(s);
+            } catch (IllegalArgumentException e) {
+                // If the value is not recognized default to none
+                contentNegotiation = ContentNegotiation.none;
+            }
+        }
+    }
+
+    /**
+     * Gives a list of Reference Parameters in the Message
+     * <p>
+     * Headers which have attribute wsa:IsReferenceParameter="true"
+     * This is not cached as one may reset the Message.
+     *<p>
+     */
+    @Property(MessageContext.REFERENCE_PARAMETERS)
+    public @NotNull List<Element> getReferenceParameters() {
+        List<Element> refParams =  new ArrayList<Element>();
+        HeaderList hl = message.getHeaders();
+        for(Header h :hl) {
+            String attr = h.getAttribute(AddressingVersion.W3C.nsUri,"IsReferenceParameter");
+            if(attr!=null && (attr.equals("true") || attr.equals("1"))) {
+                Document d = DOMUtil.createDom();
+                SAX2DOMEx s2d = new SAX2DOMEx(d);
+                try {
+                    h.writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
+                    refParams.add((Element) d.getLastChild());
+                } catch (SAXException e) {
+                    throw new WebServiceException(e);
+                }
+                /*
+                DOMResult result = new DOMResult(d);
+                XMLDOMWriterImpl domwriter = new XMLDOMWriterImpl(result);
+                try {
+                    h.writeTo(domwriter);
+                    refParams.add((Element) result.getNode().getLastChild());
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(e);
+                }
+                */
+            }
+        }
+        return refParams;
+    }
+
+    /**
+     * @deprecated
+     *      This method is for exposing header list through {@link PropertySet#get(Object)},
+     *      for user applications, and should never be invoked directly from within the JAX-WS RI.
+     */
+    @Property(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY)
+    /*package*/ HeaderList getHeaderList() {
+        if(message==null)   return null;
+        return message.getHeaders();
+    }
+
+    /**
+     * The list of MIME types that are acceptable to a receiver
+     * of an outbound message.
+     *
+     * This property is used only on the server side.
+     *
+     * <p>The representation shall be that specified by the HTTP Accept
+     * request-header field.
+     *
+     * <p>The list of content types will be obtained from the transport
+     * meta-data of a inbound message in a request/response message exchange.
+     * Hence this property will be set by the service-side transport pipe.
+     *
+     */
+    public String acceptableMimeTypes;
+
+    /**
+     * When non-null, this object is consulted to
+     * implement {@link WebServiceContext} methods
+     * exposed to the user application.
+     *
+     * Used only on the server side.
+     *
+     * <p>
+     * This property is set from the parameter
+     * of {@link WSEndpoint.PipeHead#process}.
+     */
+    public WebServiceContextDelegate webServiceContextDelegate;
+
+    /**
+     * Used only on the server side so that the transport
+     * can close the connection early.
+     *
+     * <p>
+     * This field can be null. While a message is being processed,
+     * this field can be set explicitly to null, to prevent
+     * future pipes from closing a transport.
+     *
+     * <p>
+     * This property is set from the parameter
+     * of {@link WSEndpoint.PipeHead#process}.
+     */
+    public @Nullable TransportBackChannel transportBackChannel;
+
+    /**
+     * The governing {@link WSEndpoint} in which this message is floating.
+     *
+     * <p>
+     * This property is set if and only if this is on the server side.
+     */
+    public WSEndpoint endpoint;
+
+    /**
+     * The value of the SOAPAction header associated with the message.
+     *
+     * <p>
+     * For outgoing messages, the transport may sends out this value.
+     * If this field is null, the transport may choose to send <tt>""</tt>
+     * (quoted empty string.)
+     *
+     * For incoming messages, the transport will set this field.
+     * If the incoming message did not contain the SOAPAction header,
+     * the transport sets this field to null.
+     *
+     * <p>
+     * If the value is non-null, it must be always in the quoted form.
+     * The value can be null.
+     *
+     * <p>
+     * Note that the way the transport sends this value out depends on
+     * transport and SOAP version.
+     *
+     * For HTTP transport and SOAP 1.1, BP requires that SOAPAction
+     * header is present (See {@BP R2744} and {@BP R2745}.) For SOAP 1.2,
+     * this is moved to the parameter of the "application/soap+xml".
+     */
+    @Property(BindingProvider.SOAPACTION_URI_PROPERTY)
+    public String soapAction;
+
+    /**
+     * A hint indicating that whether a transport should expect
+     * a reply back from the server.
+     *
+     * <p>
+     * This property is used on the client-side for
+     * outbound messages, so that a pipeline
+     * can communicate to the terminal (or intermediate) {@link Tube}s
+     * about this knowledge.
+     *
+     * <p>
+     * This property <b>MUST NOT</b> be used by 2-way transports
+     * that have the transport back channel. Those transports
+     * must always check a reply coming through the transport back
+     * channel regardless of this value, and act accordingly.
+     * (This is because the expectation of the client and
+     * that of the server can be different, for example because
+     * of a bug in user's configuration.)
+     *
+     * <p>
+     * This property is for one-way transports, and more
+     * specifically for the coordinator that correlates sent requests
+     * and incoming replies, to decide whether to block
+     * until a response is received.
+     *
+     * <p>
+     * Also note that this property is related to
+     * {@link WSDLOperation#isOneWay()} but not the same thing.
+     * In fact in general, they are completely orthogonal.
+     *
+     * For example, the calling application can choose to invoke
+     * {@link Dispatch#invoke(Object)} or {@link Dispatch#invokeOneWay(Object)}
+     * with an operation (which determines the value of this property),
+     * regardless of whether WSDL actually says it's one way or not.
+     * So these two booleans can take any combinations.
+     *
+     *
+     * <p>
+     * When this property is {@link Boolean#TRUE}, it means that
+     * the pipeline does not expect a reply from a server (and therefore
+     * the correlator should not block for a reply message
+     * -- if such a reply does arrive, it can be just ignored.)
+     *
+     * <p>
+     * When this property is {@link Boolean#FALSE}, it means that
+     * the pipeline expects a reply from a server (and therefore
+     * the correlator should block to see if a reply message is received,
+     *
+     * <p>
+     * This property is always set to {@link Boolean#TRUE} or
+     * {@link Boolean#FALSE} when used on the request message
+     * on the client side.
+     * No other {@link Boolean} instances are allowed.
+     * <p>
+     *
+     * In all other situations, this property is null.
+     *
+     */
+    @Property(BindingProviderProperties.ONE_WAY_OPERATION)
+    public Boolean expectReply;
+
+
+    /**
+     * This property will be removed in a near future.
+     *
+     * <p>
+     * A part of what this flag represented moved to
+     * {@link #expectReply} and the other part was moved
+     * to {@link Message#isOneWay(WSDLPort)}. Please update
+     * your code soon, or risk breaking your build!!
+     */
+    @Deprecated
+    public Boolean isOneWay;
+
+    /**
+     * Lazily created set of handler-scope property names.
+     *
+     * <p>
+     * We expect that this is only used when handlers are present
+     * and they explicitly set some handler-scope values.
+     *
+     * @see #getHandlerScopePropertyNames(boolean)
+     */
+    private Set<String> handlerScopePropertyNames;
+
+    /**
+     * Bag to capture properties that are available for the whole
+     * message invocation (namely on both requests and responses.)
+     *
+     * <p>
+     * These properties are copied from a request to a response.
+     * This is where we keep properties that are set by handlers.
+     *
+     * <p>
+     * See <a href="#properties">class javadoc</a> for more discussion.
+     *
+     * @see #getHandlerScopePropertyNames(boolean)
+     */
+    public final Map<String,Object> invocationProperties;
+
+    /**
+     * Gets a {@link Set} that stores handler-scope properties.
+     *
+     * <p>
+     * These properties will not be exposed to the response context.
+     * Consequently, if a {@link Tube} wishes to hide a property
+     * to {@link ResponseContext}, it needs to add the property name
+     * to this set.
+     *
+     * @param readOnly
+     *      Return true if the caller only intends to read the value of this set.
+     *      Internally, the {@link Set} is allocated lazily, and this flag helps
+     *      optimizing the strategy.
+     *
+     * @return
+     *      always non-null, possibly empty set that stores property names.
+     */
+    public final Set<String> getHandlerScopePropertyNames( boolean readOnly ) {
+        Set<String> o = this.handlerScopePropertyNames;
+        if(o==null) {
+            if(readOnly)
+                return Collections.emptySet();
+            o = new HashSet<String>();
+            this.handlerScopePropertyNames = o;
+        }
+        return o;
+    }
+
+    /**
+     * This method no longer works.
+     *
+     * @deprecated
+     *      Use {@link #getHandlerScopePropertyNames(boolean)}.
+     *      To be removed once Tango components are updated.
+     */
+    public final Set<String> getApplicationScopePropertyNames( boolean readOnly ) {
+        assert false;
+        return new HashSet<String>();
+    }
+
+    /**
+     * Creates a response {@link Packet} from a request packet ({@code this}).
+     *
+     * <p>
+     * When a {@link Packet} for a reply is created, some properties need to be
+     * copied over from a request to a response, and this method handles it correctly.
+     *
+     * @deprecated
+     *      Use createClientResponse(Message) for client side and
+     *      createServerResponse(Message, String) for server side response
+     *      creation.
+     *
+     * @param msg
+     *      The {@link Message} that represents a reply. Can be null.
+     */
+    @Deprecated
+    public Packet createResponse(Message msg) {
+        Packet response = new Packet(this);
+        response.setMessage(msg);
+        return response;
+    }
+
+    /**
+     * Creates a response {@link Packet} from a request packet ({@code this}).
+     *
+     * <p>
+     * When a {@link Packet} for a reply is created, some properties need to be
+     * copied over from a request to a response, and this method handles it correctly.
+     *
+     * @param msg
+     *      The {@link Message} that represents a reply. Can be null.
+     */
+    public Packet createClientResponse(Message msg) {
+        Packet response = new Packet(this);
+        response.setMessage(msg);
+        return response;
+    }
+
+    /**
+     * Creates a server-side response {@link Packet} from a request
+     * packet ({@code this}). If WS-Addressing is enabled, a default Action
+     * Message Addressing Property is obtained using <code>wsdlPort</code> {@link WSDLPort}
+     * and <code>binding</code> {@link WSBinding}.
+     * <p><p>
+     * This method should be called to create application response messages
+     * since they are associated with a {@link WSBinding} and {@link WSDLPort}.
+     * For creating protocol messages that require a non-default Action, use
+     * {@link #createServerResponse(Message, com.sun.xml.internal.ws.api.addressing.AddressingVersion, com.sun.xml.internal.ws.api.SOAPVersion, String)}.
+     *
+     * @param responseMessage The {@link Message} that represents a reply. Can be null.
+     * @param wsdlPort The response WSDL port.
+     * @param binding The response Binding. Cannot be null.
+     * @return response packet
+     */
+    public Packet createServerResponse(@Nullable Message responseMessage, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) {
+        Packet r = createClientResponse(responseMessage);
+
+        AddressingVersion av = binding.getAddressingVersion();
+        // populate WS-A headers only if WS-A is enabled
+        if (av == null)
+            return r;
+        //populate WS-A headers only if the request has addressing headers
+        String inputAction = this.getMessage().getHeaders().getAction(av, binding.getSOAPVersion());
+        if (inputAction == null) {
+            return r;
+        }
+        // if one-way, then dont populate any WS-A headers
+        if (message == null || (wsdlPort != null && message.isOneWay(wsdlPort)))
+            return r;
+
+        // otherwise populate WS-Addressing headers
+        return populateAddressingHeaders(binding, r, wsdlPort,seiModel);
+
+    }
+
+    /**
+     * Creates a server-side response {@link Packet} from a request
+     * packet ({@code this}). If WS-Addressing is enabled, <code>action</code>
+     * is used as Action Message Addressing Property.
+     * <p><p>
+     * This method should be called only for creating protocol response messages
+     * that require a particular value of Action since they are not associated
+     * with a {@link WSBinding} and {@link WSDLPort} but do know the {@link AddressingVersion}
+     * and {@link SOAPVersion}.
+     *
+     * @param responseMessage The {@link Message} that represents a reply. Can be null.
+     * @param addressingVersion The WS-Addressing version of the response message.
+     * @param soapVersion The SOAP version of the response message.
+     * @param action The response Action Message Addressing Property value.
+     * @return response packet
+     */
+    public Packet createServerResponse(@Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) {
+        Packet responsePacket = createClientResponse(responseMessage);
+
+        // populate WS-A headers only if WS-A is enabled
+        if (addressingVersion == null)
+            return responsePacket;
+        //populate WS-A headers only if the request has addressing headers
+        String inputAction = this.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
+        if (inputAction == null) {
+            return responsePacket;
+        }
+
+        return populateAddressingHeaders(responsePacket,
+                addressingVersion,
+                soapVersion,
+                action);
+    }
+
+    private Packet populateAddressingHeaders(Packet responsePacket, AddressingVersion av, SOAPVersion sv, String action) {
+        // populate WS-A headers only if WS-A is enabled
+        if (av == null)
+            return responsePacket;
+
+        // if one-way, then dont populate any WS-A headers
+        if (responsePacket.getMessage() == null)
+            return responsePacket;
+
+        HeaderList hl = responsePacket.getMessage().getHeaders();
+
+        // wsa:To
+        WSEndpointReference replyTo;
+        try {
+        replyTo = message.getHeaders().getReplyTo(av, sv);
+        if (replyTo != null)
+            hl.add(new StringHeader(av.toTag, replyTo.getAddress()));
+        } catch (InvalidMapException e) {
+            replyTo = null;
+        }
+
+        // wsa:Action
+        hl.add(new StringHeader(av.actionTag, action));
+
+        // wsa:MessageID
+        hl.add(new StringHeader(av.messageIDTag, responsePacket.getMessage().getID(av, sv)));
+
+        // wsa:RelatesTo
+        // TODO: this property is defined in WsaServerTube.REQUEST_MESSAGE_ID
+        String mid = (String)responsePacket.invocationProperties.get("com.sun.xml.internal.ws.addressing.request.messageID");
+        if (mid != null)
+            hl.add(new RelatesToHeader(av.relatesToTag, mid));
+
+        // populate reference parameters
+        WSEndpointReference refpEPR;
+        if (responsePacket.getMessage().isFault()) {
+            // choose FaultTo
+            refpEPR = message.getHeaders().getFaultTo(av, sv);
+
+            // if FaultTo is null, then use ReplyTo
+            if (refpEPR == null)
+                refpEPR = replyTo;
+        } else {
+            // choose ReplyTo
+            refpEPR = replyTo;
+        }
+        if (refpEPR != null) {
+            refpEPR.addReferenceParameters(hl);
+        }
+
+        return responsePacket;
+    }
+
+    private Packet populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
+        AddressingVersion addressingVersion = binding.getAddressingVersion();
+
+        if (addressingVersion == null)
+            return responsePacket;
+
+        WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort,seiModel, binding);
+        String action = responsePacket.message.isFault() ?
+                wsaHelper.getFaultAction(this, responsePacket) :
+                wsaHelper.getOutputAction(this);
+
+        return populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action);
+    }
+
+    // completes TypedMap
+    private static final PropertyMap model;
+
+    static {
+        model = parse(Packet.class);
+    }
+
+    protected PropertyMap getPropertyMap() {
+        return model;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/package-info.java
new file mode 100644
index 0000000..d98d305
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * {@link Message} and related abstractions that represent a SOAP message.
+ */
+package com.sun.xml.internal.ws.api.message;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java
new file mode 100644
index 0000000..096aa2f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message.stream;
+
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import java.io.InputStream;
+
+/**
+ * Low level representation of an XML or SOAP message as an {@link InputStream}.
+ *
+ */
+public class InputStreamMessage extends StreamBasedMessage {
+    /**
+     * The MIME content-type of the encoding.
+     */
+    public final String contentType;
+
+    /**
+     * The message represented as an {@link InputStream}.
+     */
+    public final InputStream msg;
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     * @param contentType
+     *      the MIME content-type of the encoding.
+     *
+     * @param msg
+     *      always a non-null unconsumed {@link InputStream} that
+     *      represents a request.
+     */
+    public InputStreamMessage(Packet properties, String contentType, InputStream msg) {
+        super(properties);
+
+        this.contentType = contentType;
+        this.msg = msg;
+    }
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     * @param attachments
+     *      the attachments of the message.
+     *
+     * @param contentType
+     *      the MIME content-type of the encoding.
+     *
+     * @param msg
+     *      always a non-null unconsumed {@link InputStream} that
+     *      represents a request.
+     */
+    public InputStreamMessage(Packet properties, AttachmentSet attachments,
+            String contentType, InputStream msg) {
+        super(properties, attachments);
+
+        this.contentType = contentType;
+        this.msg = msg;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java
new file mode 100644
index 0000000..4331793
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message.stream;
+
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+
+/**
+ * Base representation an XML or SOAP message as stream.
+ *
+ */
+abstract class StreamBasedMessage {
+    /**
+     * The properties of the message.
+     */
+    public final Packet properties;
+
+    /**
+     * The attachments of this message
+     * (attachments live outside a message.)
+     */
+    public final AttachmentSet attachments;
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     */
+    protected StreamBasedMessage(Packet properties) {
+        this.properties = properties;
+        this.attachments = new AttachmentSetImpl();
+    }
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     * @param attachments
+     *      the attachments of the message.
+     */
+    protected StreamBasedMessage(Packet properties, AttachmentSet attachments) {
+        this.properties = properties;
+        this.attachments = attachments;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java
new file mode 100644
index 0000000..24bd047
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.message.stream;
+
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Low level representation of an XML or SOAP message as an {@link XMLStreamReader}.
+ *
+ */
+public class XMLStreamReaderMessage extends StreamBasedMessage {
+    /**
+     * The message represented as an {@link XMLStreamReader}.
+     */
+    public final XMLStreamReader msg;
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     * @param msg
+     *      always a non-null unconsumed {@link XMLStreamReader} that
+     *      represents a request.
+     */
+    public XMLStreamReaderMessage(Packet properties, XMLStreamReader msg) {
+        super(properties);
+        this.msg = msg;
+    }
+
+    /**
+     * Create a new message.
+     *
+     * @param properties
+     *      the properties of the message.
+     *
+     * @param attachments
+     *      the attachments of the message.
+     *
+     * @param msg
+     *      always a non-null unconsumed {@link XMLStreamReader} that
+     *      represents a request.
+     */
+    public XMLStreamReaderMessage(Packet properties, AttachmentSet attachments, XMLStreamReader msg) {
+        super(properties, attachments);
+        this.msg = msg;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/CheckedException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/CheckedException.java
new file mode 100644
index 0000000..41a258e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/CheckedException.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model;
+
+import com.sun.xml.internal.bind.api.Bridge;
+
+import javax.xml.ws.WebFault;
+import javax.xml.namespace.QName;
+import java.rmi.RemoteException;
+
+/**
+ * This class provides abstractio to the  the exception class
+ * corresponding to the wsdl:fault, such as class MUST have
+ * {@link WebFault} annotation defined on it.
+ *
+ * Also the exception class must have
+ *
+ * <code>public WrapperException()String message, FaultBean){}</code>
+ *
+ * and method
+ *
+ * <code>public FaultBean getFaultInfo();</code>
+ *
+ * @author Vivek Pandey
+ */
+public interface CheckedException {
+    /**
+     * Gets the root {@link SEIModel} that owns this model.
+     */
+    SEIModel getOwner();
+
+    /**
+     * Gets the parent {@link JavaMethod} to which this checked exception belongs.
+     */
+    JavaMethod getParent();
+
+    /**
+     * The returned exception class would be userdefined or WSDL exception class.
+     *
+     * @return
+     *      always non-null same object.
+     */
+    Class getExceptionClass();
+
+    /**
+     * The detail bean is serialized inside the detail entry in the SOAP message.
+     * This must be known to the {@link javax.xml.bind.JAXBContext} inorder to get
+     * marshalled/unmarshalled.
+     *
+     * @return the detail bean
+     */
+    Class getDetailBean();
+
+    /**
+     * Gives the {@link com.sun.xml.internal.bind.api.Bridge} associated with the detail
+     */
+    Bridge getBridge();
+
+    /**
+     * Tells whether the exception class is a userdefined or a WSDL exception.
+     * A WSDL exception class follows the pattern defined in JSR 224. According to that
+     * a WSDL exception class must have:
+     *
+     * <code>public WrapperException()String message, FaultBean){}</code>
+     *
+     * and accessor method
+     *
+     * <code>public FaultBean getFaultInfo();</code>
+     */
+    ExceptionType getExceptionType();
+
+    /**
+     * Gives the wsdl:portType/wsdl:operation/wsdl:fault@message value - that is the wsdl:message
+     * referenced by wsdl:fault
+     */
+    String getMessageName();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ExceptionType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ExceptionType.java
new file mode 100644
index 0000000..925d00d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ExceptionType.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.model;
+/**
+ * Type of java exception as defined by JAXWS 2.0 JSR 224.
+ *
+ * Tells whether the exception class is a userdefined or a WSDL exception.
+ * A WSDL exception class follows the pattern defined in JSR 224. According to that
+ * a WSDL exception class must have:
+ *
+ * <code>public WrapperException()String message, FaultBean){}</code>
+ *
+ * and accessor method
+ *
+ * <code>public FaultBean getFaultInfo();</code>
+ *
+ * @author Vivek Pandey
+ */
+public enum ExceptionType {
+    WSDLException(0), UserDefined(1);
+
+    ExceptionType(int exceptionType){
+        this.exceptionType = exceptionType;
+    }
+
+    public int value() {
+        return exceptionType;
+    }
+    private final int exceptionType;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/JavaMethod.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/JavaMethod.java
new file mode 100644
index 0000000..91a384e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/JavaMethod.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.model.soap.SOAPBinding;
+
+import java.lang.reflect.Method;
+
+/**
+ * Abstracts the annotated {@link Method} of a SEI.
+ *
+ * @author Vivek Pandey
+ */
+public interface JavaMethod {
+
+    /**
+     * Gets the root {@link SEIModel} that owns this model.
+     */
+    SEIModel getOwner();
+
+    /**
+     * On the server side, it uses this for invocation of the web service
+     *
+     * <p>
+     * {@link @WebService}(endpointInterface="I")
+     * class A { }
+     *
+     * In this case, it retuns A's method
+     *
+     * <p>
+     * {@link @WebService}(endpointInterface="I")
+     * class A implements I { }
+     * In this case, it returns A's method
+     *
+     * <p>
+     * {@link @WebService}
+     * class A { }
+     * In this case, it returns A's method
+     *
+     * @return Returns the java {@link Method}
+     */
+    @NotNull Method getMethod();
+
+    /**
+     * This should be used if you want to access annotations on WebMethod
+     * Returns the SEI method if there is one.
+     *
+     * <p>
+     * {@link @WebService}(endpointInterface="I")
+     * class A { }
+     * In this case, it retuns I's method
+     *
+     * <p>
+     * {@link @WebService}(endpointInterface="I")
+     * class A implements I { }
+     * In this case, it returns I's method
+     *
+     * <p>
+     * {@link @WebService}
+     * class A { }
+     * In this case, it returns A's method
+     *
+     * @return Returns the java {@link Method}
+     */
+    @NotNull Method getSEIMethod();
+
+    /**
+     * @return Returns the {@link MEP}.
+     */
+    MEP getMEP();
+
+    /**
+     * Binding object - a {@link SOAPBinding} isntance.
+     *
+     * @return the Binding object
+     */
+    SOAPBinding getBinding();
+
+    /**
+     * Gives the wsdl:operation@name value
+     */
+    @NotNull String getOperationName();
+
+
+    /**
+     * Gives the request wsdl:message@name value
+     */
+    @NotNull String getRequestMessageName();
+
+    /**
+     * Gives the response wsdl:messageName value
+     * @return null if its a oneway operation that is getMEP().isOneWay()==true.
+     * @see com.sun.xml.internal.ws.api.model.MEP#isOneWay()
+     */
+    @Nullable String getResponseMessageName();
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/MEP.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/MEP.java
new file mode 100644
index 0000000..bd0d98e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/MEP.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model;
+
+/**
+ * Constants that represents four message exchange patterns.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public enum MEP {
+    REQUEST_RESPONSE(false),
+    ONE_WAY(false),
+    ASYNC_POLL(true),
+    ASYNC_CALLBACK(true);
+
+    /**
+     * True for {@link #ASYNC_CALLBACK} and {@link #ASYNC_POLL}.
+     */
+    public final boolean isAsync;
+
+    MEP(boolean async) {
+        isAsync = async;
+    }
+
+    public final boolean isOneWay() {
+        return this==ONE_WAY;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/Parameter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/Parameter.java
new file mode 100644
index 0000000..b1b5e12
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/Parameter.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model;
+
+import com.sun.xml.internal.bind.api.Bridge;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+
+/**
+ * Runtime Parameter that abstracts the annotated java parameter
+ * <p/>
+ * <p/>
+ * A parameter may be bound to a header, a body, or an attachment.
+ * Note that when it's bound to a body, it's bound to a body,
+ * it binds to the whole payload.
+ * <p/>
+ * <p/>
+ * Sometimes multiple Java parameters are packed into the payload,
+ * in which case the subclass {@link com.sun.xml.internal.ws.model.WrapperParameter} is used.
+ *
+ * @author Vivek Pandey
+ */
+public interface Parameter {
+    /**
+     * Gets the root {@link SEIModel} that owns this model.
+     */
+    SEIModel getOwner();
+
+    /**
+     * Gets the parent {@link JavaMethod} to which this parameter belongs.
+     */
+    JavaMethod getParent();
+
+    /**
+     * @return Returns the {@link QName} of the payload/infoset of a SOAP body or header.
+     */
+    QName getName();
+
+    /**
+     * Gives the {@link Bridge} associated with this Parameter
+     */
+    Bridge getBridge();
+
+    /**
+     * @return Returns the mode, such as IN, OUT or INOUT.
+     */
+    Mode getMode();
+
+    /**
+     * Position of a parameter in the method signature. It would be -1 if the parameter is a return.
+     *
+     * @return Returns the index.
+     */
+    int getIndex();
+
+    /**
+     * @return true if <tt>this instanceof {@link com.sun.xml.internal.ws.model.WrapperParameter}</tt>.
+     */
+    boolean isWrapperStyle();
+
+    /**
+     * Returns true if this parameter is bound to the return value from the {@link JavaMethod}.
+     *
+     * <p>
+     * Just the convenience method for <tt>getIndex()==-1</tt>
+     */
+    boolean isReturnValue();
+
+    /**
+     * Returns the binding associated with the parameter. For IN parameter the binding will be
+     * same as {@link #getInBinding()}, for OUT parameter the binding will be same as
+     * {@link #getOutBinding()} and for INOUT parameter the binding will be same as calling
+     * {@link #getInBinding()}
+     *
+     * @return the Binding for this Parameter. Returns {@link ParameterBinding#BODY} by default.
+     */
+    ParameterBinding getBinding();
+
+    /**
+     * Returns the {@link ParameterBinding} associated with the IN mode
+     *
+     * @return the binding
+     */
+    ParameterBinding getInBinding();
+
+    /**
+     * Returns the {@link ParameterBinding} associated with the OUT mode
+     *
+     * @return the binding
+     */
+    ParameterBinding getOutBinding();
+
+    /**
+     * @return true if the {@link Mode} associated with the parameter is {@link Mode#IN} and false otherwise.
+     */
+    boolean isIN();
+
+    /**
+     * @return true if the {@link Mode} associated with the parameter is {@link Mode#OUT} and false otherwise.
+     */
+    boolean isOUT();
+
+    /**
+     * @return true if the {@link Mode} associated with the parameter is {@link Mode#INOUT} and false otherwise.
+     */
+    boolean isINOUT();
+
+    /**
+     * If true, this parameter maps to the return value of a method invocation.
+     *
+     * <p>
+     * {@link JavaMethod#getResponseParameters()} is guaranteed to have
+     * at most one such {@link Parameter}. Note that there coule be none,
+     * in which case the method returns <tt>void</tt>.
+     *
+     * <p>
+     * Other response parameters are bound to {@link Holder}.
+     */
+    boolean isResponse();
+
+    /**
+     * Gets the holder value if applicable. To be called for inbound client side
+     * message.
+     *
+     * @param obj
+     * @return the holder value if applicable.
+     */
+    Object getHolderValue(Object obj);
+
+    /**
+     * Gives the wsdl:part@name value
+     *
+     * @return Value of {@link WebParam#partName()} annotation if present,
+     *         otherwise its the localname of the infoset associated with the parameter
+     */
+    String getPartName();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ParameterBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ParameterBinding.java
new file mode 100644
index 0000000..53a9b6a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ParameterBinding.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.model;
+
+/**
+ * Denotes the binding of a parameter.
+ *
+ * <p>
+ * This is somewhat like an enumeration (but it is <b>NOT</b> an enumeration.)
+ *
+ * <p>
+ * The possible values are
+ * BODY, HEADER, UNBOUND, and ATTACHMENT. BODY, HEADER, and UNBOUND
+ * has a singleton semantics, but there are multiple ATTACHMENT instances
+ * as it carries additional MIME type parameter.
+ *
+ * <p>
+ * So don't use '==' for testing the equality.
+ */
+public final class ParameterBinding {
+    /**
+     * Singleton instance that represents 'BODY'
+     */
+    public static final ParameterBinding BODY = new ParameterBinding(Kind.BODY,null);
+    /**
+     * Singleton instance that represents 'HEADER'
+     */
+    public static final ParameterBinding HEADER = new ParameterBinding(Kind.HEADER,null);
+    /**
+     * Singleton instance that represents 'UNBOUND',
+     * meaning the parameter doesn't have a representation in a SOAP message.
+     */
+    public static final ParameterBinding UNBOUND = new ParameterBinding(Kind.UNBOUND,null);
+    /**
+     * Creates an instance that represents the attachment
+     * with a given MIME type.
+     *
+     * <p>
+     * TODO: shall we consider givint the singleton semantics by using
+     * a cache? It's more elegant to do so, but
+     * no where in JAX-WS RI two {@link ParameterBinding}s are compared today,
+     */
+    public static ParameterBinding createAttachment(String mimeType) {
+        return new ParameterBinding(Kind.ATTACHMENT,mimeType);
+    }
+
+    /**
+     * Represents 4 kinds of binding.
+     */
+    public static enum Kind {
+        BODY, HEADER, UNBOUND, ATTACHMENT;
+    }
+
+
+    /**
+     * Represents the kind of {@link ParameterBinding}.
+     * Always non-null.
+     */
+    public final Kind kind;
+
+    /**
+     * Only used with attachment binding.
+     */
+    private String mimeType;
+
+    private ParameterBinding(Kind kind,String mimeType) {
+        this.kind = kind;
+        this.mimeType = mimeType;
+    }
+
+
+
+    public String toString() {
+        return kind.toString();
+    }
+
+    /**
+     * Returns the MIME type associated with this binding.
+     *
+     * @throws IllegalStateException
+     *      if this binding doesn't represent an attachment.
+     *      IOW, if {@link #isAttachment()} returns false.
+     * @return
+     *      Can be null, if the MIME type is not known.
+     */
+    public String getMimeType() {
+        if(!isAttachment())
+            throw new IllegalStateException();
+        return mimeType;
+    }
+
+    public boolean isBody(){
+        return this==BODY;
+    }
+
+    public boolean isHeader(){
+        return this==HEADER;
+    }
+
+    public boolean isUnbound(){
+        return this==UNBOUND;
+    }
+
+    public boolean isAttachment(){
+        return kind==Kind.ATTACHMENT;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/SEIModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/SEIModel.java
new file mode 100644
index 0000000..330a7f6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/SEIModel.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.util.Pool;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Provider;
+import java.lang.reflect.Method;
+import java.util.Collection;
+
+/**
+ * Represents abstraction of SEI.
+ *
+ * <p>
+ * This interface would be used to access which Java concepts correspond to
+ * which WSDL concepts, such as which <code>wsdl:port</code> corresponds to
+ * a SEI, or which <code>wsdl:operation</code> corresponds to {@link JavaMethod}.
+ *
+ * <P>
+ * It also retains information about the databinding done for a SEI;
+ * such as {@link JAXBRIContext} and {@link Bridge}.
+ *
+ * <p>
+ * This model is constructed only when there is a Java SEI. Therefore it's
+ * not available with {@link Dispatch} or {@link Provider}. Technologies that
+ * need to work regardless of such surface API difference shall not be using
+ * this model.
+ *
+ * @author Vivek Pandey
+ */
+public interface SEIModel {
+    Pool.Marshaller getMarshallerPool();
+
+    /**
+     * JAXBContext that will be used to marshall/unmarshall the java classes found in the SEI.
+     *
+     * @return the <code>{@link JAXBRIContext}</code>
+     */
+    JAXBRIContext getJAXBContext();
+
+    /**
+     * Get the Bridge associated with the {@link TypeReference}
+     *
+     * @param type
+     * @return the <code>{@link Bridge}</code> for the <code>type</code>
+     */
+//    Bridge getBridge(TypeReference type);
+
+    /**
+     * Its a known fault if the exception thrown by {@link Method} is annotated with the
+     * {@link javax.xml.ws.WebFault#name()} thas equal to the name passed as parameter.
+     *
+     * @param name   is the qualified name of fault detail element as specified by wsdl:fault@element value.
+     * @param method is the Java {@link Method}
+     * @return true if <code>name</code> is the name
+     *         of a known fault name for the <code>method</code>
+     */
+//    boolean isKnownFault(QName name, Method method);
+
+    /**
+     * Checks if the {@link JavaMethod} for the {@link Method} knowns the exception class.
+     *
+     * @param m  {@link Method} to pickup the right {@link JavaMethod} model
+     * @param ex exception class
+     * @return true if <code>ex</code> is a Checked Exception
+     *         for <code>m</code>
+     */
+//    boolean isCheckedException(Method m, Class ex);
+
+    /**
+     * This method will be useful to get the {@link JavaMethod} corrrespondiong to
+     * a {@link Method} - such as on the client side.
+     *
+     * @param method for which {@link JavaMethod} is asked for
+     * @return the {@link JavaMethod} representing the <code>method</code>
+     */
+    JavaMethod getJavaMethod(Method method);
+
+    /**
+     * Gives a {@link JavaMethod} for a given {@link QName}. The {@link QName} will
+     * be equivalent to the SOAP Body or Header block or can simply be the name of an
+     * infoset that corresponds to the payload.
+     *
+     * @param name
+     * @return the <code>JavaMethod</code> associated with the
+     *         operation named name
+     */
+    public JavaMethod getJavaMethod(QName name);
+
+    /**
+     * Gives all the {@link JavaMethod} for a wsdl:port for which this {@link SEIModel} is
+     * created.
+     *
+     * @return a {@link Collection} of {@link JavaMethod}
+     *         associated with the {@link SEIModel}
+     */
+    Collection<? extends JavaMethod> getJavaMethods();
+
+    /**
+     * Location of the WSDL that defines the port associated with the {@link SEIModel}
+     *
+     * @return wsdl location uri - always non-null
+     */
+    @NotNull String getWSDLLocation();
+
+    /**
+     * wsdl:service qualified name for the port associated with the {@link SEIModel)
+     *
+     * @return wsdl:service@name value - always non-null
+     */
+    @NotNull QName getServiceQName();
+
+    /**
+     * Gets the {@link WSDLPort} that represents the port that this SEI binds to.
+     */
+    @NotNull WSDLPort getPort();
+
+    /**
+     * Value of the wsdl:port name associated with the {@link SEIModel)
+     *
+     * @return wsdl:service/wsdl:port@name value, always non-null
+     */
+    @NotNull QName getPortName();
+
+    /**
+     * Value of wsdl:portType bound to the port associated with the {@link SEIModel)
+     *
+     * @return
+     */
+    @NotNull QName getPortTypeName();
+
+    /**
+     *  Gives the wsdl:binding@name value
+     */
+    @NotNull QName getBoundPortTypeName();
+
+    /**
+     * Namespace of the wsd;:port associated with the {@link SEIModel)
+     */
+    @NotNull String getTargetNamespace();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/soap/SOAPBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/soap/SOAPBinding.java
new file mode 100644
index 0000000..c1e1730
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/soap/SOAPBinding.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.soap;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+
+import javax.jws.soap.SOAPBinding.Style;
+import javax.jws.soap.SOAPBinding.Use;
+import javax.jws.WebMethod;
+
+/**
+ * Models soap:binding in a WSDL document or a {@link javax.jws.soap.SOAPBinding} annotation. This
+ * can be the return of {@link JavaMethod#getBinding()}.
+ *
+ * @author Vivek Pandey
+ */
+abstract public class SOAPBinding {
+    protected Use use = Use.LITERAL;
+    protected Style style = Style.DOCUMENT;
+    protected SOAPVersion soapVersion = SOAPVersion.SOAP_11;
+    protected String soapAction = "";
+
+    /**
+     * Get {@link Use} such as <code>literal</code> or <code>encoded</code>.
+     */
+    public Use getUse() {
+        return use;
+    }
+
+    /**
+     * Get {@link Style} - such as <code>document</code> or <code>rpc</code>.
+     */
+    public Style getStyle() {
+        return style;
+    }
+
+    /**
+     * Get the {@link SOAPVersion}
+     */
+    public SOAPVersion getSOAPVersion() {
+        return soapVersion;
+    }
+
+    /**
+     * Returns true if its document/literal
+     */
+    public boolean isDocLit() {
+        return style == Style.DOCUMENT && use == Use.LITERAL;
+    }
+
+    /**
+     * Returns true if this is a rpc/literal binding
+     */
+    public boolean isRpcLit() {
+        return style == Style.RPC && use == Use.LITERAL;
+    }
+
+    /**
+     * Value of <code>wsdl:binding/wsdl:operation/soap:operation@soapAction</code> attribute or
+     * {@link WebMethod#action()} annotation.
+     * <pre>
+     * For example:
+     * &lt;wsdl:binding name="HelloBinding" type="tns:Hello">
+     *   &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+     *   &lt;wsdl:operation name="echoData">
+     *       &lt;soap12:operation soapAction=""/>
+     * ...
+     * </pre>
+     * It's always non-null. soap message serializer needs to generated SOAPAction HTTP header with
+     * the return of this method enclosed in quotes("").
+     *
+     * @see com.sun.xml.internal.ws.api.message.Packet#soapAction
+     */
+    public String getSOAPAction() {
+        return soapAction;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java
new file mode 100644
index 0000000..af6e958
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.namespace.QName;
+import java.util.List;
+
+/**
+ * Abstracts wsdl:binding/wsdl:operation. It can be used to determine the parts and their binding.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible {
+    /**
+     * Short-cut for {@code getOperation().getName()}
+     */
+    @NotNull QName getName();
+
+    /**
+     * Gives soapbinding:operation@soapAction value. soapbinding:operation@soapAction is optional attribute.
+     * If not present an empty String is returned as per BP 1.1 R2745.
+     */
+    @NotNull String getSOAPAction();
+
+    /**
+     * Gets the wsdl:portType/wsdl:operation model - {@link WSDLOperation},
+     * associated with this binding operation.
+     *
+     * @return always same {@link WSDLOperation}
+     */
+    @NotNull WSDLOperation getOperation();
+
+    /**
+     * Gets the soapbinding:binding/operation/wsaw:Anonymous. A default value of OPTIONAL is returned.
+     *
+     * @return Anonymous value of the operation
+     */
+    public ANONYMOUS getAnonymous();
+
+    enum ANONYMOUS { optional, required, prohibited }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java
new file mode 100644
index 0000000..8398dc8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.message.Message;
+
+import javax.xml.namespace.QName;
+
+/**
+ * {@link WSDLPortType} bound with a specific binding.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLBoundPortType extends WSDLFeaturedObject, WSDLExtensible {
+    /**
+     * Gets the name of the wsdl:binding@name attribute value as local name and wsdl:definitions@targetNamespace
+     * as the namespace uri.
+     */
+    QName getName();
+
+    /**
+     * Gets the {@link WSDLModel} that owns this port type.
+     */
+    @NotNull WSDLModel getOwner();
+
+    /**
+     * Gets the {@link WSDLBoundOperation} for a given operation name
+     *
+     * @param operationName non-null operationName
+     * @return null if a {@link WSDLBoundOperation} is not found
+     */
+    public WSDLBoundOperation get(QName operationName);
+
+    /**
+     * Gets the wsdl:binding@type value, same as {@link WSDLPortType#getName()}
+     */
+    QName getPortTypeName();
+
+    /**
+     * Gets the {@link WSDLPortType} associated with the wsdl:binding
+     */
+    WSDLPortType getPortType();
+
+    /**
+     * Gets the {@link WSDLBoundOperation}s
+     */
+    Iterable<? extends WSDLBoundOperation> getBindingOperations();
+
+    /**
+     * Returns the binding ID.
+     * This would typically determined by the binding extension elements in wsdl:binding.
+     */
+    BindingID getBindingId();
+
+    /**
+     * Gets the bound operation in this port for a tag name. Here the operation would be the one whose
+     * input part descriptor bound to soap:body is same as the tag name except for rpclit where the tag
+     * name would be {@link WSDLBoundOperation#getName()}.
+     *
+     * <p>
+     * If you have a {@link Message} and trying to figure out which operation it belongs to,
+     * always use {@link Message#getOperation}, as that performs better.
+     *
+     * <p>
+     * For example this can be used in the case when a message receipient can get the
+     * {@link WSDLBoundOperation} from the payload tag name.
+     *
+     * <p>
+     * namespaceUri and the local name both can be null to get the WSDLBoundOperation that has empty body -
+     * there is no payload. According to BP 1.1 in a port there can be at MOST one operation with empty body.
+     * Its an error to have namespace URI non-null but local name as null.
+     *
+     * @param namespaceUri namespace of the payload element.
+     * @param localName local name of the payload
+     * @throws NullPointerException if localName is null and namespaceUri is not.
+     * @return
+     *      null if no operation with the given tag name is found.
+     */
+    @Nullable WSDLBoundOperation getOperation(String namespaceUri, String localName);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLDescriptorKind.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLDescriptorKind.java
new file mode 100644
index 0000000..f4f016f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLDescriptorKind.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+/**
+ * Enumeration that tells a wsdl:part that can be defined either using a type
+ * attribute or an element attribute.
+ *
+ * @author Vivek Pandey
+ */
+public enum WSDLDescriptorKind {
+    /**
+     * wsdl:part is defined using element attribute.
+     *
+     * <pre>
+     * for exmaple,
+     * &lt;wsdl:part name="foo" element="ns1:FooElement">
+     * </pre>
+     */
+    ELEMENT(0),
+
+    /**
+     * wsdl:part is defined using type attribute.
+     *
+     * <pre>
+     * for exmaple,
+     * &lt;wsdl:part name="foo" element="ns1:FooType">
+     * </pre>
+     */
+    TYPE(1);
+
+    WSDLDescriptorKind(int value) {
+        this.value = value;
+    }
+
+    private final int value;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java
new file mode 100644
index 0000000..423b847
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+/**
+ * Interface that represents WSDL concepts that
+ * can have extensions.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSDLExtensible extends WSDLObject {
+    /**
+     * Gets all the {@link WSDLExtension}s
+     * added through {@link #addExtension(WSDLExtension)}.
+     *
+     * @return
+     *      never null.
+     */
+    Iterable<WSDLExtension> getExtensions();
+
+    /**
+     * Gets all the extensions that is assignable to the given type.
+     *
+     * <p>
+     * This allows clients to find specific extensions in a type-safe
+     * and convenient way.
+     *
+     * @param type
+     *      The type of the extension to obtain. Must not be null.
+     *
+     * @return
+     *      Can be an empty collection but never null.
+     */
+    <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type);
+
+    /**
+     * Gets the extension that is assignable to the given type.
+     *
+     * <p>
+     * This is just a convenient version that does
+     *
+     * <pre>
+     * Iterator itr = getExtensions(type);
+     * if(itr.hasNext())  return itr.next();
+     * else               return null;
+     * </pre>
+     *
+     * @return
+     *      null if the extension was not found.
+     */
+    <T extends WSDLExtension> T getExtension(Class<T> type);
+
+    /**
+     * Adds a new {@link WSDLExtension}
+     * to this object.
+     *
+     * @param extension
+     *      must not be null.
+     */
+    void addExtension(WSDLExtension extension);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtension.java
new file mode 100644
index 0000000..518793c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtension.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a WSDL extensibility element or attribute.
+ *
+ * <p>
+ * This interface can be implemented by the programs that build
+ * on top of the JAX-WS RI, to hook additional information into
+ * {@link WSDLModel}.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLExtension {
+    /**
+     * Gets the qualified name of the WSDL extensibility element or attribute.
+     *
+     * @return
+     *      must not be null.
+     */
+    public QName getName();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java
new file mode 100644
index 0000000..e435aa0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+/**
+ * Abstracts wsdl:portType/wsdl:operation/wsdl:fault
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLFault extends WSDLObject, WSDLExtensible {
+    /**
+     * Gives wsdl:fault@name value
+     */
+    String getName();
+
+    /**
+     * Gives the WSDLMessage corresponding to wsdl:fault@message
+     * This method should not be called before the entire WSDLModel is built. Basically after the WSDLModel is built
+     * all the references are resolve in a post processing phase. IOW, the WSDL extensions should
+     * not call this method.
+     *
+     * @return Always returns null when called from inside WSDL extensions.
+     */
+    WSDLMessage getMessage();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFeaturedObject.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFeaturedObject.java
new file mode 100644
index 0000000..4911ec9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFeaturedObject.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.WSFeatureList;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * {@link WSDLObject} that can have features associated with it.
+ *
+ * <p>
+ * {@link WSDLParserExtension}s can add features to this object,
+ * which will then be incorporated when {@link Dispatch}s and
+ * proxies are created for the port.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSDLFeaturedObject extends WSDLObject {
+
+    @Nullable
+    <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType);
+
+    /**
+     * Gets the feature list associated with this object.
+     */
+    @NotNull WSFeatureList getFeatures();
+
+    /**
+     * Enables a {@link WebServiceFeature} based upon policy assertions on this port.
+     * This method would be called during WSDL parsing by WS-Policy code.
+     */
+    void addFeature(@NotNull WebServiceFeature feature);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java
new file mode 100644
index 0000000..b2e0af8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+/**
+ * Abstraction of wsdl:portType/wsdl:operation/wsdl:input
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLInput extends WSDLObject, WSDLExtensible {
+    /**
+     * Gives the wsdl:portType/wsdl:operation/wsdl:input@name
+     */
+    String getName();
+
+    /**
+     * Gives the WSDLMessage corresponding to wsdl:input@message
+     * <p/>
+     * This method should not be called before the entire WSDLModel is built. Basically after the WSDLModel is built
+     * all the references are resolve in a post processing phase. IOW, the WSDL extensions should
+     * not call this method.
+     *
+     * @return Always returns null when called from inside WSDL extensions.
+     */
+    WSDLMessage getMessage();
+
+    /**
+     * Gives the Action Message Addressing Property value for
+     * {@link this} message.
+     * <p/>
+     * This method provides the correct value irrespective of
+     * whether the Action is explicitly specified in the WSDL or
+     * implicitly derived using the rules defined in WS-Addressing.
+     *
+     * @return Action
+     */
+    String getAction();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java
new file mode 100644
index 0000000..2cba135
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Abstraction of wsdl:message.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLMessage extends WSDLObject, WSDLExtensible {
+    /**
+     * Gives wsdl:message@name value.
+     */
+    QName getName();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java
new file mode 100644
index 0000000..7c948a1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Provides abstraction of wsdl:definitions.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLModel extends WSDLExtensible {
+    /**
+     * Gets {@link WSDLPortType} that models <code>wsdl:portType</code>
+     *
+     * @param name non-null quaified name of wsdl:message, where the localName is the value of <code>wsdl:portType@name</code> and
+     *             the namespaceURI is the value of wsdl:definitions@targetNamespace
+     * @return A {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType} or null if no wsdl:portType found.
+     */
+    WSDLPortType getPortType(@NotNull QName name);
+
+    /**
+     * Gets {@link WSDLBoundPortType} that models <code>wsdl:binding</code>
+     *
+     * @param name non-null quaified name of wsdl:binding, where the localName is the value of <code>wsdl:binding@name</code> and
+     *             the namespaceURI is the value of wsdl:definitions@targetNamespace
+     * @return A {@link WSDLBoundPortType} or null if no wsdl:binding found
+     */
+    WSDLBoundPortType getBinding(@NotNull QName name);
+
+    /**
+     * Give a {@link WSDLBoundPortType} for the given wsdl:service and wsdl:port names.
+     *
+     * @param serviceName service QName
+     * @param portName    port QName
+     * @return A {@link WSDLBoundPortType}. null if the Binding for the given wsd:service and wsdl:port name are not
+     *         found.
+     */
+    WSDLBoundPortType getBinding(@NotNull QName serviceName, @NotNull QName portName);
+
+    /**
+     * Gets {@link WSDLService} that models <code>wsdl:service</code>
+     *
+     * @param name non-null quaified name of wsdl:service, where the localName is the value of <code>wsdl:service@name</code> and
+     *             the namespaceURI is the value of wsdl:definitions@targetNamespace
+     * @return A {@link WSDLService} or null if no wsdl:service found
+     */
+    WSDLService getService(@NotNull QName name);
+
+    /**
+     * Gives a {@link Map} of wsdl:portType {@link QName} and {@link WSDLPortType}
+     *
+     * @return an empty Map if the wsdl document has no wsdl:portType
+     */
+    @NotNull Map<QName, ? extends WSDLPortType> getPortTypes();
+
+    /**
+     * Gives a {@link Map} of wsdl:binding {@link QName} and {@link WSDLBoundPortType}
+     *
+     * @return an empty Map if the wsdl document has no wsdl:binding
+     */
+    @NotNull Map<QName, WSDLBoundPortType> getBindings();
+
+    /**
+     * Gives a {@link Map} of wsdl:service qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLService}
+     *
+     * @return an empty Map if the wsdl document has no wsdl:service
+     */
+    @NotNull Map<QName, ? extends WSDLService> getServices();
+
+    /**
+     * Main purpose of this class is to  parsing of a WSDL and get the {@link WSDLModel} from it.
+     */
+    public class WSDLParser{
+       /**
+         * Parses WSDL from the given wsdlLoc and gives a {@link WSDLModel} built from it.
+         *
+         * @param wsdlEntityParser  Works like an entityResolver to resolve WSDLs
+         * @param resolver  {@link XMLEntityResolver}, works at XML infoset level
+         * @param isClientSide  true - its invoked on the client, false means its invoked on the server
+         * @param extensions var args of {@link com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension}s
+         * @return A {@link WSDLModel} built from the given wsdlLocation}
+         * @throws java.io.IOException
+         * @throws javax.xml.stream.XMLStreamException
+         * @throws org.xml.sax.SAXException
+         */
+        public static @NotNull WSDLModel parse(XMLEntityResolver.Parser wsdlEntityParser, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+            return RuntimeWSDLParser.parse(wsdlEntityParser, resolver, isClientSide, extensions);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLObject.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLObject.java
new file mode 100644
index 0000000..916a773
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLObject.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import org.xml.sax.Locator;
+
+/**
+ * Marker interface serves as base interface for the wsdl model
+ * @author Vivek Pandey
+ */
+public interface WSDLObject {
+    /**
+     * Gets the source location information in the parsed WSDL.
+     *
+     * This is useful when producing error messages.
+     */
+    @NotNull
+    Locator getLocation();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java
new file mode 100644
index 0000000..76a8ba3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Provides abstraction of wsdl:portType/wsdl:operation.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLOperation extends WSDLObject, WSDLExtensible {
+    /**
+     * Gets the name of the wsdl:portType/wsdl:operation@name attribute value as local name and wsdl:definitions@targetNamespace
+     * as the namespace uri.
+     */
+    @NotNull QName getName();
+
+    /**
+     * Gets the wsdl:input of this operation
+     */
+    @NotNull WSDLInput getInput();
+
+    /**
+     * Gets the wsdl:output of this operation.
+     *
+     * @return
+     *      null if this is an one-way operation.
+     */
+    @Nullable WSDLOutput getOutput();
+
+
+
+    /**
+     * Returns true if this operation is an one-way operation.
+     */
+    boolean isOneWay();
+
+    /**
+     * Gets the {link WSDLFault} corresponding to wsdl:fault of this operation.
+     */
+    Iterable<? extends WSDLFault> getFaults();
+
+    /**
+     * Gives {@link WSDLFault} for the given soap fault detail value.
+     *
+     * <pre>
+     *
+     * Given a wsdl fault:
+     *
+     * &lt;wsdl:message nae="faultMessage">
+     *  &lt;wsdl:part name="fault" element="<b>ns:myException</b>/>
+     * &lt;/wsdl:message>
+     *
+     * &lt;wsdl:portType>
+     *  &lt;wsdl:operation ...>
+     *      &lt;wsdl:fault name="aFault" message="faultMessage"/>
+     *  &lt;/wsdl:operation>
+     * &lt;wsdl:portType>
+     *
+     *
+     * For example given a soap 11 soap message:
+     *
+     * &lt;soapenv:Fault>
+     *      ...
+     *      &lt;soapenv:detail>
+     *          &lt;<b>ns:myException</b>>
+     *              ...
+     *          &lt;/ns:myException>
+     *      &lt;/soapenv:detail>
+     *
+     * QName faultQName = new QName(ns, "myException");
+     * WSDLFault wsdlFault  = getFault(faultQName);
+     *
+     * The above call will return a WSDLFault that abstracts wsdl:portType/wsdl:operation/wsdl:fault.
+     *
+     * </pre>
+     *
+     * @param faultDetailName tag name of the element inside soaenv:Fault/detail/, must be non-null.
+     * @return returns null if a wsdl fault corresponding to the detail entry name not found.
+     */
+    @Nullable WSDLFault getFault(QName faultDetailName);
+
+    /**
+     * Gives the enclosing wsdl:portType@name attribute value.
+     */
+    @NotNull QName getPortTypeName();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java
new file mode 100644
index 0000000..a39cb2c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+/**
+ * Abstraction of wsdl:portType/wsdl:operation/wsdl:output
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLOutput extends WSDLObject, WSDLExtensible {
+    /**
+     * Gives the wsdl:portType/wsdl:operation/wsdl:output@name
+     */
+    String getName();
+
+    /**
+     * Gives the WSDLMessage corresponding to wsdl:output@message
+     * <p/>
+     * This method should not be called before the entire WSDLModel is built. Basically after the WSDLModel is built
+     * all the references are resolve in a post processing phase. IOW, the WSDL extensions should
+     * not call this method.
+     *
+     * @return Always returns null when called from inside WSDL extensions.
+     */
+    WSDLMessage getMessage();
+
+    /**
+     * Gives the Action Message Addressing Property value for
+     * {@link this} message.
+     * <p/>
+     * This method provides the correct value irrespective of
+     * whether the Action is explicitly specified in the WSDL or
+     * implicitly derived using the rules defined in WS-Addressing.
+     *
+     * @return Action
+     */
+    String getAction();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPart.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPart.java
new file mode 100644
index 0000000..08ab97d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPart.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+
+/**
+ * Abstracts wsdl:part after applying binding information from wsdl:binding.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLPart extends WSDLObject {
+    /**
+     * Gets wsdl:part@name attribute value.
+     */
+    String getName();
+
+    /**
+     * Gets the wsdl:part binding as seen thru wsdl:binding
+     */
+    ParameterBinding getBinding();
+
+    /**
+     * Index value is as the order in which the wsdl:part appears inside the input or output wsdl:message.
+     * @return n where n >= 0
+     */
+    int getIndex();
+
+    /**
+     * Gives the XML Schema descriptor referenced using either wsdl:part@element or wsdl:part@type.
+     */
+    public WSDLPartDescriptor getDescriptor();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPartDescriptor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPartDescriptor.java
new file mode 100644
index 0000000..d183b6e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPartDescriptor.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Abstracts wsdl:part descriptor that is defined using element or type attribute.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLPartDescriptor extends WSDLObject {
+    /**
+     * Gives Qualified name of the XML Schema element or type
+     */
+    public QName name();
+
+    /**
+     * Gives whether wsdl:part references a schema type or a global element.
+     */
+    public WSDLDescriptorKind type();
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java
new file mode 100644
index 0000000..652247a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Abstracts wsdl:service/wsdl:port
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLPort extends WSDLFeaturedObject, WSDLExtensible {
+    /**
+     * Gets wsdl:port@name attribute value as local name and wsdl:definitions@targetNamespace
+     * as the namespace uri.
+     */
+    QName getName();
+
+    /**
+     * Gets {@link WSDLBoundPortType} associated with the {@link WSDLPort}.
+     */
+    @NotNull
+    WSDLBoundPortType getBinding();
+
+    /**
+     * Gets endpoint address of this port.
+     *
+     * @return
+     *      always non-null.
+     */
+    EndpointAddress getAddress();
+
+    /**
+     * Gets the {@link WSDLService} that owns this port.
+     *
+     * @return
+     *      always non-null.
+     */
+    @NotNull
+    WSDLService getOwner();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java
new file mode 100644
index 0000000..3407bc2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Abstraction of wsdl:portType.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLPortType extends WSDLObject, WSDLExtensible {
+    /**
+     * Gets the name of the wsdl:portType@name attribute value as local name and wsdl:definitions@targetNamespace
+     * as the namespace uri.
+     */
+    public QName getName();
+
+    /**
+     * Gets the {@link WSDLOperation} for a given operation name
+     *
+     * @param operationName non-null operationName
+     * @return null if a {@link WSDLOperation} is not found
+     */
+    public WSDLOperation get(String operationName);
+
+
+    /**
+     * Gets {@link Iterable}<{$link WSDLOperation}>
+     */
+    public Iterable<? extends WSDLOperation> getOperations();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java
new file mode 100644
index 0000000..78fa22c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Abstracts wsdl:service.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLService extends WSDLObject, WSDLExtensible {
+    /**
+     * Gets the {@link WSDLModel} that owns this service.
+     */
+    @NotNull
+    WSDLModel getParent();
+
+    /**
+     * Gets the name of the wsdl:service@name attribute value as local name and wsdl:definitions@targetNamespace
+     * as the namespace uri.
+     */
+    @NotNull
+    QName getName();
+
+    /**
+     * Gets the {@link WSDLPort} for a given port name
+     *
+     * @param portName non-null operationName
+     * @return null if a {@link WSDLPort} is not found
+     */
+    WSDLPort get(QName portName);
+
+    /**
+     * Gets the first {@link WSDLPort} if any, or otherwise null.
+     */
+    WSDLPort getFirstPort();
+
+    /**
+     * Gives all the {@link WSDLPort} in a wsdl:service {@link WSDLService}
+     */
+    Iterable<? extends WSDLPort> getPorts();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/package-info.java
new file mode 100644
index 0000000..bdc4e22
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/package-info.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * JAX-WS RI extension of JAX-WS API.
+ *
+ * <p>
+ * This package hosts classes/interfaces that directly extend
+ * the JAX-WS API. Sometimes objects of these types are passed
+ * to external components from higher layers, only to be passed
+ * back into other parts of the JAX-WS RI.
+ * By defining these types, we improve the type-safety in
+ * this scenario, while isolating the actual implementation classes.
+ *
+ * <p>
+ * Sometimes these types also define additional methods.
+ *
+ * <p>
+ * Types defined in package can only be implemented by the JAX-WS RI.
+ * The code internal to the JAX-WS RI may safely case instances
+ * of these types to their implementation classes. This warning doesn't
+ * apply to subpackages.
+ */
+package com.sun.xml.internal.ws.api;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java
new file mode 100644
index 0000000..4f6ed00
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.api.server.Container;
+
+import java.io.PrintStream;
+
+/**
+ * Factory for well-known {@link Pipe} implementations
+ * that the {@link PipelineAssembler} needs to use
+ * to satisfy JAX-WS requirements.
+ *
+ * @author Kohsuke Kawaguchi
+ * @deprecated Use {@link ClientTubeAssemblerContext}.
+ */
+public final class ClientPipeAssemblerContext extends ClientTubeAssemblerContext {
+
+    public ClientPipeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding) {
+        this(address, wsdlModel, rootOwner, binding, Container.NONE);
+    }
+
+    public ClientPipeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel,
+                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
+                                      @NotNull Container container) {
+        super(address, wsdlModel, rootOwner, binding, container);
+    }
+
+    /**
+     * creates a {@link Pipe} that dumps messages that pass through.
+     */
+    public Pipe createDumpPipe(String name, PrintStream out, Pipe next) {
+        return PipeAdapter.adapt(super.createDumpTube(name, out, PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that performs WS-Addressig processing.
+     * This pipe should be before {@link com.sun.xml.internal.ws.protocol.soap.ClientMUTube}.
+     */
+    public Pipe createWsaPipe(Pipe next) {
+        return PipeAdapter.adapt(super.createWsaTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that performs SOAP mustUnderstand processing.
+     * This pipe should be before HandlerPipes.
+     */
+    public Pipe createClientMUPipe(Pipe next) {
+        return PipeAdapter.adapt(super.createClientMUTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that invokes protocol and logical handlers.
+     */
+    public Pipe createHandlerPipe(Pipe next) {
+        return PipeAdapter.adapt(super.createHandlerTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Tube} that adds container specific security
+     */
+    public @NotNull Pipe createSecurityPipe(@NotNull Pipe next) {
+        return PipeAdapter.adapt(super.createSecurityTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a transport pipe (for client), which becomes the terminal pipe.
+     */
+    public Pipe createTransportPipe() {
+        return PipeAdapter.adapt(super.createTransportTube());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java
new file mode 100644
index 0000000..da7cd48
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.addressing.WsaClientTube;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.client.ClientPipelineHook;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.handler.ClientLogicalHandlerTube;
+import com.sun.xml.internal.ws.handler.ClientSOAPHandlerTube;
+import com.sun.xml.internal.ws.handler.HandlerTube;
+import com.sun.xml.internal.ws.protocol.soap.ClientMUTube;
+import com.sun.xml.internal.ws.transport.DeferredTransportPipe;
+import com.sun.xml.internal.ws.util.pipe.DumpTube;
+
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.PrintStream;
+
+/**
+ * Factory for well-known {@link Tube} implementations
+ * that the {@link TubelineAssembler} needs to use
+ * to satisfy JAX-WS requirements.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class ClientTubeAssemblerContext {
+
+    private final @NotNull EndpointAddress address;
+    private final @NotNull WSDLPort wsdlModel;
+    private final @NotNull WSService rootOwner;
+    private final @NotNull WSBinding binding;
+    private final @NotNull Container container;
+    private @NotNull Codec codec;
+
+    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding) {
+        this(address, wsdlModel, rootOwner, binding, Container.NONE);
+    }
+
+    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel,
+                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
+                                      @NotNull Container container, Codec codec) {
+        this.address = address;
+        this.wsdlModel = wsdlModel;
+        this.rootOwner = rootOwner;
+        this.binding = binding;
+        this.container = container;
+        this.codec = codec;
+    }
+
+    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel,
+                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
+                                      @NotNull Container container) {
+        // WSBinding is actually BindingImpl
+        this(address, wsdlModel, rootOwner, binding, container, ((BindingImpl)binding).createCodec() );
+    }
+
+    /**
+     * The endpoint address. Always non-null. This parameter is taken separately
+     * from {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort} (even though there's {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort#getAddress()})
+     * because sometimes WSDL is not available.
+     */
+    public @NotNull EndpointAddress getAddress() {
+        return address;
+    }
+
+    /**
+     * The created pipeline will be used to serve this port.
+     * Null if the service isn't associated with any port definition in WSDL,
+     * and otherwise non-null.
+     */
+    public @Nullable WSDLPort getWsdlModel() {
+        return wsdlModel;
+    }
+
+    /**
+     * The pipeline is created for this {@link com.sun.xml.internal.ws.api.WSService}.
+     * Always non-null. (To be precise, the newly created pipeline
+     * is owned by a proxy or a dispatch created from thsi {@link com.sun.xml.internal.ws.api.WSService}.)
+     */
+    public @NotNull WSService getService() {
+        return rootOwner;
+    }
+
+    /**
+     * The binding of the new pipeline to be created.
+     */
+    public @NotNull WSBinding getBinding() {
+        return binding;
+    }
+
+    /**
+     * Returns the Container in which the client is running
+     *
+     * @return Container in which client is running
+     */
+    public Container getContainer() {
+        return container;
+    }
+
+    /**
+     * creates a {@link Tube} that dumps messages that pass through.
+     */
+    public Tube createDumpTube(String name, PrintStream out, Tube next) {
+        return new DumpTube(name, out, next);
+    }
+
+    /**
+     * Creates a {@link Tube} that adds container specific security
+     */
+    public @NotNull Tube createSecurityTube(@NotNull Tube next) {
+        ClientPipelineHook hook = container.getSPI(ClientPipelineHook.class);
+        if (hook != null) {
+            ClientPipeAssemblerContext ctxt = new ClientPipeAssemblerContext(address, wsdlModel,
+                                      rootOwner, binding, container);
+            return PipeAdapter.adapt(hook.createSecurityPipe(ctxt, PipeAdapter.adapt(next)));
+        }
+        return next;
+    }
+
+    /**
+     * Creates a {@link Tube} that invokes protocol and logical handlers.
+     */
+    public Tube createWsaTube(Tube next) {
+        if (binding instanceof SOAPBinding && AddressingVersion.isEnabled(binding) && wsdlModel!=null)
+            return new WsaClientTube(wsdlModel, binding, next);
+        else
+            return next;
+    }
+
+    /**
+     * Creates a {@link Tube} that invokes protocol and logical handlers.
+     */
+    public Tube createHandlerTube(Tube next) {
+        HandlerTube soapHandlerTube = null;
+        //XML/HTTP Binding can have only LogicalHandlerPipe
+        if (binding instanceof SOAPBinding) {
+            soapHandlerTube = new ClientSOAPHandlerTube(binding, wsdlModel, next);
+            next = soapHandlerTube;
+        }
+        return new ClientLogicalHandlerTube(binding, next, soapHandlerTube);
+    }
+
+    /**
+     * Creates a {@link Tube} that performs SOAP mustUnderstand processing.
+     * This pipe should be before HandlerPipes.
+     */
+    public Tube createClientMUTube(Tube next) {
+        if(binding instanceof SOAPBinding)
+            return new ClientMUTube(binding,next);
+        else
+            return next;
+    }
+
+    /**
+     * Creates a transport pipe (for client), which becomes the terminal pipe.
+     */
+    public Tube createTransportTube() {
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+        // wsgen generates a WSDL with the address attribute that says "REPLACE_WITH_ACTUAL_URL".
+        // while it's technically correct to reject such address (since there's no transport registered
+        // with it), it's desirable to allow the user a benefit of doubt, and wait until the runtime
+        // to see if the user configures the endpoint address through request context.
+        // DeferredTransportPipe is used for this purpose.
+        //
+        // Ideally, we shouldn't have @address at all for such cases, but due to the backward
+        // compatibility and the fact that this attribute is mandatory, we have no option but
+        // to check for REPLACE_WITH_ACTUAL_URL.
+        if(address.toString().equals("") || address.toString().equals("REPLACE_WITH_ACTUAL_URL"))
+            return new DeferredTransportPipe(cl,this);
+
+        return TransportTubeFactory.create(cl, this);
+    }
+
+    /**
+     * Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
+     * based on the binding.
+     *
+     * @return codec to be used for web service requests
+     */
+    public @NotNull Codec getCodec() {
+        return codec;
+    }
+
+    /**
+     * Interception point to change {@link Codec} during {@link Tube}line assembly. The
+     * new codec will be used by jax-ws client runtime for encoding/decoding web service
+     * request/response messages. The new codec should be used by the transport tubes.
+     *
+     * <p>
+     * the codec should correctly implement {@link Codec#copy} since it is used while
+     * serving requests concurrently.
+     *
+     * @param codec codec to be used for web service requests
+     */
+    public void setCodec(@NotNull Codec codec) {
+        this.codec = codec;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codec.java
new file mode 100644
index 0000000..ff2d73c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codec.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.EndpointAwareCodec;
+
+import javax.xml.stream.XMLStreamWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+
+/**
+ * Encodes a {@link Message} (its XML infoset and attachments) to a sequence of bytes.
+ *
+ * <p>
+ * This interface provides pluggability for different ways of encoding XML infoset,
+ * such as plain XML (plus MIME attachments), XOP, and FastInfoset.
+ *
+ * <p>
+ * Transport usually needs a MIME content type of the encoding, so the {@link Codec}
+ * interface is designed to return this information. However, for some encoding
+ * (such as XOP), the encoding may actually change based on the actual content of
+ * {@link Message}, therefore the codec returns the content type as a result of encoding.
+ *
+ * <p>
+ * {@link Codec} does not produce transport-specific information, such as HTTP headers.
+ *
+ * <p>
+ * {@link Codec} is a non-reentrant object, meaning no two threads
+ * can concurrently invoke the decode method. This allows the implementation
+ * to easily reuse parser objects (as instance variables), which are costly otherwise.
+ *
+ *
+ * <p>
+ * {@link BindingID} determines the {@link Codec}. See {@link BindingID#createEncoder(WSBinding)}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see EndpointAwareCodec
+ */
+public interface Codec {
+
+    /**
+     * Get the MIME type associated with this Codec.
+     * <p>
+     * If available the MIME type will represent the media that the codec
+     * encodes and decodes.
+     *
+     * The MIME type returned will be the most general representation independent
+     * of an instance of this MIME type utilized as a MIME content-type.
+     *
+     * @return
+     *      null if the MIME type can't be determined by the <code>Codec</code>
+     *      implementation. Otherwise the MIME type is returned.
+     */
+    public String getMimeType();
+
+    /**
+     * If the MIME content-type of the encoding is known statically
+     * then this method returns it.
+     *
+     * <p>
+     * Transports often need to write the content type before it writes
+     * the message body, and since the encode method returns the content type
+     * after the body is written, it requires a buffering.
+     *
+     * For those {@link Codec}s that always use a constant content type,
+     * This method allows a transport to streamline the write operation.
+     *
+     * @return
+     *      null if the content-type can't be determined in short of
+     *      encodin the packet. Otherwise content type for this {@link Packet},
+     *      such as "application/xml".
+     */
+    ContentType getStaticContentType(Packet packet);
+
+    /**
+     * Encodes an XML infoset portion of the {@link Message}
+     * (from &lt;soap:Envelope> to &lt;/soap:Envelope>).
+     *
+     * <p>
+     * Internally, this method is most likely invoke {@link Message#writeTo(XMLStreamWriter)}
+     * to turn the message into infoset.
+     *
+     * @param packet
+     * @param out
+     *      Must not be null. The caller is responsible for closing the stream,
+     *      not the callee.
+     *
+     * @return
+     *      The MIME content type of the encoded message (such as "application/xml").
+     *      This information is often ncessary by transport.
+     *
+     * @throws IOException
+     *      if a {@link OutputStream} throws {@link IOException}.
+     */
+    ContentType encode( Packet packet, OutputStream out ) throws IOException;
+
+    /**
+     * The version of {@link #encode(Packet,OutputStream)}
+     * that writes to NIO {@link ByteBuffer}.
+     *
+     * <p>
+     * TODO: for the convenience of implementation, write
+     * an adapter that wraps {@link WritableByteChannel} to {@link OutputStream}.
+     */
+    ContentType encode( Packet packet, WritableByteChannel buffer );
+
+    /*
+     * The following methods need to be documented and implemented.
+     *
+     * Such methods will be used by a client side
+     * transport pipe that implements the ClientEdgePipe.
+     *
+    String encode( InputStreamMessage message, OutputStream out ) throws IOException;
+    String encode( InputStreamMessage message, WritableByteChannel buffer );
+    */
+
+    /**
+     * Creates a copy of this {@link Codec}.
+     *
+     * <p>
+     * Since {@link Codec} instance is not re-entrant, the caller
+     * who needs to encode two {@link Message}s simultaneously will
+     * want to have two {@link Codec} instances. That's what this
+     * method produces.
+     *
+     * <h3>Implentation Note</h3>
+     * <p>
+     * Note that this method might be invoked by one thread while
+     * another thread is executing one of the {@link #encode} methods.
+     * <!-- or otherwise you'd always have to maintain one idle copy -->
+     * <!-- just so that you can make copies from -->
+     * This should be OK because you'll be only copying things that
+     * are thread-safe, and creating new ones for thread-unsafe resources,
+     * but please let us know if this contract is difficult.
+     *
+     * @return
+     *      always non-null valid {@link Codec} that performs
+     *      the encoding work in the same way --- that is, if you
+     *      copy an FI codec, you'll get another FI codec.
+     *
+     *      <p>
+     *      Once copied, two {@link Codec}s may be invoked from
+     *      two threads concurrently; therefore, they must not share
+     *      any state that requires isolation (such as temporary buffer.)
+     *
+     *      <p>
+     *      If the {@link Codec} implementation is already
+     *      re-entrant and multi-thread safe to begin with,
+     *      then this method may simply return <tt>this</tt>.
+     */
+    Codec copy();
+
+    /**
+     * Reads bytes from {@link InputStream} and constructs a {@link Message}.
+     *
+     * <p>
+     * The design encourages lazy decoding of a {@link Message}, where
+     * a {@link Message} is returned even before the whole message is parsed,
+     * and additional parsing is done as the {@link Message} body is read along.
+     * A {@link Codec} is most likely have its own implementation of {@link Message}
+     * for this purpose.
+     *
+     * @param in
+     *      the data to be read into a {@link Message}. The transport would have
+     *      read any transport-specific header before it passes an {@link InputStream},
+     *      and {@link InputStream} is expected to be read until EOS. Never null.
+     *
+     *      <p>
+     *      Some transports, such as SMTP, may 'encode' data into another format
+     *      (such as uuencode, base64, etc.) It is the caller's responsibility to
+     *      'decode' these transport-level encoding before it passes data into
+     *      {@link Codec}.
+     *
+     * @param contentType
+     *      The MIME content type (like "application/xml") of this byte stream.
+     *      Thie text includes all the sub-headers of the content-type header. Therefore,
+     *      in more complex case, this could be something like
+     *      <tt>multipart/related; boundary="--=_outer_boundary"; type="multipart/alternative"</tt>.
+     *      This parameter must not be null.
+     *
+     * @param response
+     *      The parsed {@link Message} will be set to this {@link Packet}.
+     *      {@link Codec} may add additional properties to this {@link Packet}.
+     *      On a successful method completion, a {@link Packet} must contain a
+     *      {@link Message}.
+     *
+     * @throws IOException
+     *      if {@link InputStream} throws an exception.
+     */
+    void decode( InputStream in, String contentType, Packet response ) throws IOException;
+
+    /**
+     *
+     * @see #decode(InputStream, String, Packet)
+     */
+    void decode( ReadableByteChannel in, String contentType, Packet response );
+
+    /*
+     * The following methods need to be documented and implemented.
+     *
+     * Such methods will be used by a server side
+     * transport pipe that can support the invocation of methods on a
+     * ServerEdgePipe.
+     *
+    XMLStreamReaderMessage decode( InputStream in, String contentType ) throws IOException;
+    XMLStreamReaderMessage decode( ReadableByteChannel in, String contentType );
+    */
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codecs.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codecs.java
new file mode 100644
index 0000000..201779f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codecs.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+
+/**
+ * Factory methods for some of the {@link Codec} implementations.
+ *
+ * <p>
+ * This class provides methods to create codecs for SOAP/HTTP binding.
+ * It allows to replace default SOAP envelope(primary part in MIME message)
+ * codec in the whole Codec.
+ *
+ * <p>
+ * This is a part of the JAX-WS RI internal API so that
+ * {@link Tube} and transport implementations can reuse the implementations
+ * done inside the JAX-WS.
+ *
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Codecs {
+
+    /**
+     * This creates a full {@link Codec} for SOAP binding using the primary
+     * XML codec argument. The codec argument is used to encode/decode SOAP envelopes
+     * while the returned codec is responsible for encoding/decoding the whole
+     * message.
+     *
+     * <p>
+     * Creates codecs can be set during the {@link Tube}line assembly process.
+     *
+     * @see ServerTubeAssemblerContext#setCodec(Codec)
+     * @see ClientTubeAssemblerContext#setCodec(Codec)
+     *
+     * @param binding binding of the webservice
+     * @param xmlEnvelopeCodec SOAP envelope codec
+     * @return non null codec to parse entire SOAP message(including MIME parts)
+     */
+    public static @NotNull SOAPBindingCodec createSOAPBindingCodec(WSBinding binding, StreamSOAPCodec xmlEnvelopeCodec) {
+        return new com.sun.xml.internal.ws.encoding.SOAPBindingCodec(binding, xmlEnvelopeCodec);
+    }
+
+    /**
+     * Creates a default {@link Codec} that can be used to used to
+     * decode XML infoset in SOAP envelope(primary part in MIME message). New codecs
+     * can be written using this codec as delegate.
+     *
+     * @param version SOAP version of the binding
+     * @return non null default xml codec
+     */
+    public static @NotNull
+    StreamSOAPCodec createSOAPEnvelopeXmlCodec(@NotNull SOAPVersion version) {
+        return com.sun.xml.internal.ws.encoding.StreamSOAPCodec.create(version);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ContentType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ContentType.java
new file mode 100644
index 0000000..a11bcfd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ContentType.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+/**
+ * A Content-Type transport header that will be returned by {@link Codec#encode(com.sun.xml.internal.ws.api.message.Packet, java.io.OutputStream)}.
+ * It will provide the Content-Type header and also take care of SOAP 1.1 SOAPAction header.
+ *
+ * TODO: rename to ContentMetadata?
+ *
+ * @author Vivek Pandey
+ */
+public interface ContentType {
+    /**
+     * Gives non-null Content-Type header value.
+     */
+    public String getContentType();
+
+    /**
+     * Gives SOAPAction transport header value. It will be non-null only for SOAP 1.1 messages. In other cases
+     * it MUST be null. The SOAPAction transport header should be written out only when its non-null.
+     *
+     * @return It can be null, in that case SOAPAction header should be written.
+     */
+    public String getSOAPActionHeader();
+
+    /**
+     * Controls the Accept transport header, if the transport supports it.
+     * Returning null means the transport need not add any new header.
+     *
+     * <p>
+     * We realize that this is not an elegant abstraction, but
+     * this would do for now. If another person comes and asks for
+     * a similar functionality, we'll define a real abstraction.
+     */
+    public String getAcceptHeader();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Engine.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Engine.java
new file mode 100644
index 0000000..3830248
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Engine.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+
+/**
+ * Collection of {@link Fiber}s.
+ * Owns an {@link Executor} to run them.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class Engine {
+    private volatile Executor threadPool;
+    public final String id;
+
+    public Engine(String id, Executor threadPool) {
+        this(id);
+        this.threadPool = threadPool;
+    }
+
+    public Engine(String id) {
+        this.id = id;
+    }
+
+    public void setExecutor(Executor threadPool) {
+        this.threadPool = threadPool;
+    }
+
+    void addRunnable(Fiber fiber) {
+        if(threadPool==null) {
+            synchronized(this) {
+                threadPool = Executors.newFixedThreadPool(5, new DaemonThreadFactory());
+            }
+        }
+        threadPool.execute(fiber);
+    }
+
+    /**
+     * Creates a new fiber in a suspended state.
+     *
+     * <p>
+     * To start the returned fiber, call {@link Fiber#start(Tube,Packet,Fiber.CompletionCallback)}.
+     * It will start executing the given {@link Tube} with the given {@link Packet}.
+     *
+     * @return new Fiber
+     */
+    public Fiber createFiber() {
+        return new Fiber(this);
+    }
+
+    private static class DaemonThreadFactory implements ThreadFactory {
+        private final AtomicInteger threadNumber = new AtomicInteger(1);
+
+        public Thread newThread(Runnable r) {
+            Thread daemonThread = new Thread(r, "JAXWS-Engine-"+threadNumber.getAndIncrement());
+            daemonThread.setDaemon(Boolean.TRUE);
+            return daemonThread;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Fiber.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Fiber.java
new file mode 100644
index 0000000..99e4611
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Fiber.java
@@ -0,0 +1,771 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.server.Adapter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * User-level thread&#x2E; Represents the execution of one request/response processing.
+ *
+ * <p>
+ * JAX-WS RI is capable of running a large number of request/response concurrently by
+ * using a relatively small number of threads. This is made possible by utilizing
+ * a {@link Fiber} &mdash; a user-level thread that gets created for each request/response
+ * processing.
+ *
+ * <p>
+ * A fiber remembers where in the pipeline the processing is at, what needs to be
+ * executed on the way out (when processing response), and other additional information
+ * specific to the execution of a particular request/response.
+ *
+ * <h2>Suspend/Resume</h2>
+ * <p>
+ * Fiber can be {@link NextAction#suspend() suspended} by a {@link Tube}.
+ * When a fiber is suspended, it will be kept on the side until it is
+ * {@link #resume(Packet) resumed}. This allows threads to go execute
+ * other runnable fibers, allowing efficient utilization of smaller number of
+ * threads.
+ *
+ * <h2>Context-switch Interception</h2>
+ * <p>
+ * {@link FiberContextSwitchInterceptor} allows {@link Tube}s and {@link Adapter}s
+ * to perform additional processing every time a thread starts running a fiber
+ * and stops running it.
+ *
+ * <h2>Context ClassLoader</h2>
+ * <p>
+ * Just like thread, a fiber has a context class loader (CCL.) A fiber's CCL
+ * becomes the thread's CCL when it's executing the fiber. The original CCL
+ * of the thread will be restored when the thread leaves the fiber execution.
+ *
+ *
+ * <h2>Debugging Aid</h2>
+ * <p>
+ * Because {@link Fiber} doesn't keep much in the call stack, and instead use
+ * {@link #conts} to store the continuation, debugging fiber related activities
+ * could be harder.
+ *
+ * <p>
+ * Setting the {@link #LOGGER} for FINE would give you basic start/stop/resume/suspend
+ * level logging. Using FINER would cause more detailed logging, which includes
+ * what tubes are executed in what order and how they behaved.
+ *
+ * <p>
+ * When you debug the server side, consider setting {@link Fiber#serializeExecution}
+ * to true, so that execution of fibers are serialized. Debugging a server
+ * with more than one running threads is very tricky, and this switch will
+ * prevent that. This can be also enabled by setting the system property on.
+ * See the source code.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public final class Fiber implements Runnable {
+    /**
+     * {@link Tube}s whose {@link Tube#processResponse(Packet)} method needs
+     * to be invoked on the way back.
+     */
+    private Tube[] conts = new Tube[16];
+    private int contsSize;
+
+    /**
+     * If this field is non-null, the next instruction to execute is
+     * to call its {@link Tube#processRequest(Packet)}. Otherwise
+     * the instruction is to call {@link #conts}.
+     */
+    private Tube next;
+
+    private Packet packet;
+
+    private Throwable/*but really it's either RuntimeException or Error*/ throwable;
+
+    public final Engine owner;
+
+    /**
+     * Is this thread suspended? 0=not suspended, 1=suspended.
+     *
+     * <p>
+     * Logically this is just a boolean, but we need to prepare for the case
+     * where the thread is {@link #resume(Packet) resumed} before we get to the {@link #suspend()}.
+     * This happens when things happen in the following order:
+     *
+     * <ol>
+     *  <li>Tube decides that the fiber needs to be suspended to wait for the external event.
+     *  <li>Tube hooks up fiber with some external mechanism (like NIO channel selector)
+     *  <li>Tube returns with {@link NextAction#suspend()}.
+     *  <li>"External mechanism" becomes signal state and invokes {@link Fiber#resume(Packet)}
+     *      to wake up fiber
+     *  <li>{@link Fiber#doRun} invokes {@link Fiber#suspend()}.
+     * </ol>
+     *
+     * <p>
+     * Using int, this will work OK because {@link #suspendedCount} becomes -1 when
+     * {@link #resume(Packet)} occurs before {@link #suspend()}.
+     *
+     * <p>
+     * Increment and decrement is guarded by 'this' object.
+     */
+    private volatile int suspendedCount = 0;
+
+    /**
+     * Is this fiber completed?
+     */
+    private volatile boolean completed;
+
+    /**
+     * Is this {@link Fiber} currently running in the synchronous mode?
+     */
+    private boolean synchronous;
+
+    private boolean interrupted;
+
+    private final int id;
+
+    /**
+     * Active {@link FiberContextSwitchInterceptor}s for this fiber.
+     */
+    private List<FiberContextSwitchInterceptor> interceptors;
+
+    /**
+     * Not null when {@link #interceptors} is not null.
+     */
+    private InterceptorHandler interceptorHandler;
+
+    /**
+     * This flag is set to true when a new interceptor is added.
+     *
+     * When that happens, we need to first exit the current interceptors
+     * and then reenter them, so that the newly added interceptors start
+     * taking effect. This flag is used to control that flow.
+     */
+    private boolean needsToReenter;
+
+    /**
+     * Fiber's context {@link ClassLoader}.
+     */
+    private @Nullable ClassLoader contextClassLoader;
+
+    private @Nullable CompletionCallback completionCallback;
+
+    /**
+     * Set to true if this fiber is started asynchronously, to avoid
+     * doubly-invoking completion code.
+     */
+    private boolean started;
+
+    /**
+     * Callback to be invoked when a {@link Fiber} finishs execution.
+     */
+    public interface CompletionCallback {
+        /**
+         * Indicates that the fiber has finished its execution.
+         *
+         * <p>
+         * Since the JAX-WS RI runs asynchronously,
+         * this method maybe invoked by a different thread
+         * than any of the threads that started it or run a part of tubeline.
+         */
+        void onCompletion(@NotNull Packet response);
+
+        /**
+         * Indicates that the fiber has finished abnormally, by throwing a given {@link Throwable}.
+         */
+        void onCompletion(@NotNull Throwable error);
+    }
+
+    Fiber(Engine engine) {
+        this.owner = engine;
+        if(isTraceEnabled()) {
+            id = iotaGen.incrementAndGet();
+            LOGGER.fine(getName()+" created");
+        } else {
+            id = -1;
+        }
+
+        // if this is run from another fiber, then we naturally inherit its context classloader,
+        // so this code works for fiber->fiber inheritance just fine.
+        contextClassLoader = Thread.currentThread().getContextClassLoader();
+    }
+
+    /**
+     * Starts the execution of this fiber asynchronously.
+     *
+     * <p>
+     * This method works like {@link Thread#start()}.
+     *
+     * @param tubeline
+     *      The first tube of the tubeline that will act on the packet.
+     * @param request
+     *      The request packet to be passed to <tt>startPoint.processRequest()</tt>.
+     * @param completionCallback
+     *      The callback to be invoked when the processing is finished and the
+     *      final response packet is available.
+     *
+     * @see #runSync(Tube,Packet)
+     */
+    public void start(@NotNull Tube tubeline, @NotNull Packet request, @Nullable CompletionCallback completionCallback) {
+        next = tubeline;
+        this.packet = request;
+        this.completionCallback = completionCallback;
+        this.started = true;
+        owner.addRunnable(this);
+    }
+
+    /**
+     * Wakes up a suspended fiber.
+     *
+     * <p>
+     * If a fiber was suspended from the {@link Tube#processRequest(Packet)} method,
+     * then the execution will be resumed from the corresponding
+     * {@link Tube#processResponse(Packet)} method with the specified response packet
+     * as the parameter.
+     *
+     * <p>
+     * If a fiber was suspended from the {@link Tube#processResponse(Packet)} method,
+     * then the execution will be resumed from the next tube's
+     * {@link Tube#processResponse(Packet)} method with the specified response packet
+     * as the parameter.
+     *
+     * <p>
+     * This method is implemented in a race-free way. Another thread can invoke
+     * this method even before this fiber goes into the suspension mode. So the caller
+     * need not worry about synchronizing {@link NextAction#suspend()} and this method.
+     */
+    public synchronized void resume(@NotNull Packet response) {
+        if(isTraceEnabled())
+            LOGGER.fine(getName()+" resumed");
+        packet = response;
+        if( --suspendedCount == 0 ) {
+            if(synchronous) {
+                notifyAll();
+            } else {
+                owner.addRunnable(this);
+            }
+        }
+    }
+
+
+    /**
+     * Suspends this fiber's execution until the resume method is invoked.
+     *
+     * The call returns immediately, and when the fiber is resumed
+     * the execution picks up from the last scheduled continuation.
+     */
+    private synchronized void suspend() {
+        if(isTraceEnabled())
+            LOGGER.fine(getName()+" suspended");
+        suspendedCount++;
+    }
+
+    /**
+     * Adds a new {@link FiberContextSwitchInterceptor} to this fiber.
+     *
+     * <p>
+     * The newly installed fiber will take effect immediately after the current
+     * tube returns from its {@link Tube#processRequest(Packet)} or
+     * {@link Tube#processResponse(Packet)}, before the next tube begins processing.
+     *
+     * <p>
+     * So when the tubeline consists of X and Y, and when X installs an interceptor,
+     * the order of execution will be as follows:
+     *
+     * <ol>
+     *  <li>X.processRequest()
+     *  <li>interceptor gets installed
+     *  <li>interceptor.execute() is invoked
+     *  <li>Y.processRequest()
+     * </ol>
+     */
+    public void addInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) {
+        if(interceptors ==null) {
+            interceptors = new ArrayList<FiberContextSwitchInterceptor>();
+            interceptorHandler = new InterceptorHandler();
+        }
+        interceptors.add(interceptor);
+        needsToReenter = true;
+    }
+
+    /**
+     * Removes a {@link FiberContextSwitchInterceptor} from this fiber.
+     *
+     * <p>
+     * The removal of the interceptor takes effect immediately after the current
+     * tube returns from its {@link Tube#processRequest(Packet)} or
+     * {@link Tube#processResponse(Packet)}, before the next tube begins processing.
+     *
+     *
+     * <p>
+     * So when the tubeline consists of X and Y, and when Y uninstalls an interceptor
+     * on the way out, then the order of execution will be as follows:
+     *
+     * <ol>
+     *  <li>Y.processResponse() (notice that this happens with interceptor.execute() in the callstack)
+     *  <li>interceptor gets uninstalled
+     *  <li>interceptor.execute() returns
+     *  <li>X.processResponse()
+     * </ol>
+     *
+     * @return
+     *      true if the specified interceptor was removed. False if
+     *      the specified interceptor was not registered with this fiber to begin with.
+     */
+    public boolean removeInterceptor(@NotNull FiberContextSwitchInterceptor interceptor) {
+        if(interceptors !=null && interceptors.remove(interceptor)) {
+            needsToReenter = true;
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Gets the context {@link ClassLoader} of this fiber.
+     */
+    public @Nullable ClassLoader getContextClassLoader() {
+        return contextClassLoader;
+    }
+
+    /**
+     * Sets the context {@link ClassLoader} of this fiber.
+     */
+    public ClassLoader setContextClassLoader(@Nullable ClassLoader contextClassLoader) {
+        ClassLoader r = this.contextClassLoader;
+        this.contextClassLoader = contextClassLoader;
+        return r;
+    }
+
+    /**
+     * DO NOT CALL THIS METHOD. This is an implementation detail
+     * of {@link Fiber}.
+     */
+    @Deprecated
+    public void run() {
+        assert !synchronous;
+        next = doRun(next);
+        completionCheck();
+    }
+
+    /**
+     * Runs a given {@link Tube} (and everything thereafter) synchronously.
+     *
+     * <p>
+     * This method blocks and returns only when all the successive {@link Tube}s
+     * complete their request/response processing. This method can be used
+     * if a {@link Tube} needs to fallback to synchronous processing.
+     *
+     * <h3>Example:</h3>
+     * <pre>
+     * class FooTube extends {@link AbstractFilterTubeImpl} {
+     *   NextAction processRequest(Packet request) {
+     *     // run everything synchronously and return with the response packet
+     *     return doReturnWith(Fiber.current().runSync(next,request));
+     *   }
+     *   NextAction processResponse(Packet response) {
+     *     // never be invoked
+     *   }
+     * }
+     * </pre>
+     *
+     * @param tubeline
+     *      The first tube of the tubeline that will act on the packet.
+     * @param request
+     *      The request packet to be passed to <tt>startPoint.processRequest()</tt>.
+     * @return
+     *      The response packet to the <tt>request</tt>.
+     *
+     * @see #start(Tube, Packet, CompletionCallback)
+     */
+    public synchronized @NotNull Packet runSync(@NotNull Tube tubeline, @NotNull Packet request) {
+        // save the current continuation, so that we return runSync() without executing them.
+        final Tube[] oldCont = conts;
+        final int oldContSize = contsSize;
+        final boolean oldSynchronous = synchronous;
+
+        if(oldContSize>0) {
+            conts = new Tube[16];
+            contsSize=0;
+        }
+
+        try {
+            synchronous = true;
+            this.packet = request;
+            doRun(tubeline);
+            if(throwable!=null) {
+                if (throwable instanceof RuntimeException) {
+                    throw (RuntimeException) throwable;
+                }
+                if (throwable instanceof Error) {
+                    throw (Error) throwable;
+                }
+                // our system is supposed to only accept Error or RuntimeException
+                throw new AssertionError(throwable);
+            }
+            return this.packet;
+        } finally {
+            conts = oldCont;
+            contsSize = oldContSize;
+            synchronous = oldSynchronous;
+            if(interrupted) {
+                Thread.currentThread().interrupt();
+                interrupted = false;
+            }
+            if(!started)
+                completionCheck();
+        }
+    }
+
+    private synchronized void completionCheck() {
+        if(contsSize==0) {
+            if(isTraceEnabled())
+                LOGGER.fine(getName()+" completed");
+            completed = true;
+            notifyAll();
+            if(completionCallback!=null) {
+                if(throwable!=null)
+                    completionCallback.onCompletion(throwable);
+                else
+                    completionCallback.onCompletion(packet);
+            }
+        }
+    }
+
+    ///**
+    // * Blocks until the fiber completes.
+    // */
+    //public synchronized void join() throws InterruptedException {
+    //    while(!completed)
+    //        wait();
+    //}
+
+    /**
+     * Invokes all registered {@link InterceptorHandler}s and then call into
+     * {@link Fiber#__doRun(Tube)}.
+     */
+    private class InterceptorHandler implements FiberContextSwitchInterceptor.Work<Tube,Tube> {
+        /**
+         * Index in {@link Fiber#interceptors} to invoke next.
+         */
+        private int idx;
+
+        /**
+         * Initiate the interception, and eventually invokes {@link Fiber#__doRun(Tube)}.
+         */
+        Tube invoke(Tube next) {
+            idx=0;
+            return execute(next);
+        }
+
+        public Tube execute(Tube next) {
+            if(idx==interceptors.size()) {
+                return __doRun(next);
+            } else {
+                FiberContextSwitchInterceptor interceptor = interceptors.get(idx++);
+                return interceptor.execute(Fiber.this,next,this);
+            }
+        }
+    }
+
+    /**
+     * Executes the fiber as much as possible.
+     *
+     * @param next
+     *      The next tube whose {@link Tube#processRequest(Packet)} is to be invoked. If null,
+     *      that means we'll just call {@link Tube#processResponse(Packet)} on the continuation.
+     *
+     * @return
+     *      If non-null, the next time execution resumes, it should resume from calling
+     *      the {@link Tube#processRequest(Packet)}. Otherwise it means just finishing up
+     *      the continuation.
+     */
+    @SuppressWarnings({"LoopStatementThatDoesntLoop"}) // IntelliJ reports this bogus error
+    private Tube doRun(Tube next) {
+        Thread currentThread = Thread.currentThread();
+
+        if(isTraceEnabled())
+            LOGGER.fine(getName()+" running by "+currentThread.getName());
+
+        if(serializeExecution) {
+            serializedExecutionLock.lock();
+            try {
+                return _doRun(next);
+            } finally {
+                serializedExecutionLock.unlock();
+            }
+        } else {
+            return _doRun(next);
+        }
+    }
+
+    private Tube _doRun(Tube next) {
+        Thread currentThread = Thread.currentThread();
+
+        ClassLoader old = currentThread.getContextClassLoader();
+        currentThread.setContextClassLoader(contextClassLoader);
+        try {
+            do {
+                needsToReenter = false;
+
+                // if interceptors are set, go through the interceptors.
+                if(interceptorHandler ==null)
+                    next = __doRun(next);
+                else
+                    next = interceptorHandler.invoke(next);
+            } while(needsToReenter);
+
+            return next;
+        } finally {
+            currentThread.setContextClassLoader(old);
+        }
+    }
+
+    /**
+     * To be invoked from {@link #doRun(Tube)}.
+     *
+     * @see #doRun(Tube)
+     */
+    private Tube __doRun(Tube next) {
+        final Fiber old = CURRENT_FIBER.get();
+        CURRENT_FIBER.set(this);
+
+        // if true, lots of debug messages to show what's being executed
+        final boolean traceEnabled = LOGGER.isLoggable(Level.FINER);
+
+        try {
+            while(!isBlocking() && !needsToReenter) {
+                try {
+                    NextAction na;
+                    Tube last;
+                    if(throwable!=null) {
+                        if(contsSize==0) {
+                            // nothing else to execute. we are done.
+                            return null;
+                        }
+                        last = popCont();
+                        if(traceEnabled)
+                            LOGGER.finer(getName()+' '+last+".processException("+throwable+')');
+                        na = last.processException(throwable);
+                    } else {
+                        if(next!=null) {
+                            if(traceEnabled)
+                                LOGGER.finer(getName()+' '+next+".processRequest("+packet+')');
+                            na = next.processRequest(packet);
+                            last = next;
+                        } else {
+                            if(contsSize==0) {
+                                // nothing else to execute. we are done.
+                                return null;
+                            }
+                            last = popCont();
+                            if(traceEnabled)
+                                LOGGER.finer(getName()+' '+last+".processResponse("+packet+')');
+                            na = last.processResponse(packet);
+                        }
+                    }
+
+                    if(traceEnabled)
+                        LOGGER.finer(getName()+' '+last+" returned with "+na);
+
+                    // If resume is called before suspend, then make sure
+                                        // resume(Packet) is not lost
+                    if (na.kind != NextAction.SUSPEND) {
+                        packet = na.packet;
+                        throwable = na.throwable;
+                    }
+
+                    switch(na.kind) {
+                    case NextAction.INVOKE:
+                        pushCont(last);
+                        // fall through next
+                    case NextAction.INVOKE_AND_FORGET:
+                        next = na.next;
+                        break;
+                    case NextAction.RETURN:
+                    case NextAction.THROW:
+                        next = null;
+                        break;
+                    case NextAction.SUSPEND:
+                        pushCont(last);
+                        next = null;
+                        suspend();
+                        break;
+                    default:
+                        throw new AssertionError();
+                    }
+                } catch (RuntimeException t) {
+                    if(traceEnabled)
+                        LOGGER.log(Level.FINER,getName()+" Caught "+t+". Start stack unwinding",t);
+                    throwable = t;
+                } catch (Error t) {
+                    if(traceEnabled)
+                        LOGGER.log(Level.FINER,getName()+" Caught "+t+". Start stack unwinding",t);
+                    throwable = t;
+                }
+            }
+            // there's nothing we can execute right away.
+            // we'll be back when this fiber is resumed.
+            return next;
+        } finally {
+            CURRENT_FIBER.set(old);
+        }
+    }
+
+    private void pushCont(Tube tube) {
+        conts[contsSize++] = tube;
+
+        // expand if needed
+        int len = conts.length;
+        if(contsSize==len) {
+            Tube[] newBuf = new Tube[len*2];
+            System.arraycopy(conts,0,newBuf,0,len);
+            conts = newBuf;
+        }
+    }
+
+    private Tube popCont() {
+        return conts[--contsSize];
+    }
+
+    /**
+     * Returns true if the fiber needs to block its execution.
+     */
+    // TODO: synchronization on synchronous case is wrong.
+    private boolean isBlocking() {
+        if(synchronous) {
+            while(suspendedCount==1)
+                try {
+                    if (isTraceEnabled()) {
+                        LOGGER.fine(getName()+" is blocking thread "+Thread.currentThread().getName());
+                    }
+                    wait(); // the synchronized block is the whole runSync method.
+                } catch (InterruptedException e) {
+                    // remember that we are interrupted, but don't respond to it
+                    // right away. This behavior is in line with what happens
+                    // when you are actually running the whole thing synchronously.
+                    interrupted = true;
+                }
+            return false;
+        }
+        else
+            return suspendedCount==1;
+    }
+
+    private String getName() {
+        return "engine-"+owner.id+"fiber-"+id;
+    }
+
+    public String toString() {
+        return getName();
+    }
+
+    /**
+     * Gets the current {@link Packet} associated with this fiber.
+     *
+     * <p>
+     * This method returns null if no packet has been associated with the fiber yet.
+     */
+    public @Nullable Packet getPacket() {
+        return packet;
+    }
+
+    /**
+     * Returns true if this fiber is still running or suspended.
+     */
+    public boolean isAlive() {
+        return !completed;
+    }
+
+    /**
+     * (ADVANCED) Returns true if the current fiber is being executed synchronously.
+     *
+     * <p>
+     * Fiber may run synchronously for various reasons. Perhaps this is
+     * on client side and application has invoked a synchronous method call.
+     * Perhaps this is on server side and we have deployed on a synchronous
+     * transport (like servlet.)
+     *
+     * <p>
+     * When a fiber is run synchronously (IOW by {@link #runSync(Tube, Packet)}),
+     * further invocations to {@link #runSync(Tube, Packet)} can be done
+     * without degrading the performance.
+     *
+     * <p>
+     * So this value can be used as a further optimization hint for
+     * advanced {@link Tube}s to choose the best strategy to invoke
+     * the next {@link Tube}. For example, a tube may want to install
+     * a {@link FiberContextSwitchInterceptor} if running async, yet
+     * it might find it faster to do {@link #runSync(Tube, Packet)}
+     * if it's already running synchronously.
+     */
+    public static boolean isSynchronous() {
+        return current().synchronous;
+    }
+
+    /**
+     * Gets the current fiber that's running.
+     *
+     * <p>
+     * This works like {@link Thread#currentThread()}.
+     * This method only works when invoked from {@link Tube}.
+     */
+    public static @NotNull Fiber current() {
+        Fiber fiber = CURRENT_FIBER.get();
+        if(fiber==null)
+            throw new IllegalStateException("Can be only used from fibers");
+        return fiber;
+    }
+
+    private static final ThreadLocal<Fiber> CURRENT_FIBER = new ThreadLocal<Fiber>();
+
+    /**
+     * Used to allocate unique number for each fiber.
+     */
+    private static final AtomicInteger iotaGen = new AtomicInteger();
+
+    private static boolean isTraceEnabled() {
+        return LOGGER.isLoggable(Level.FINE);
+    }
+
+    private static final Logger LOGGER = Logger.getLogger(Fiber.class.getName());
+
+
+    private static final ReentrantLock serializedExecutionLock = new ReentrantLock();
+
+    /**
+     * Set this boolean to true to execute fibers sequentially one by one.
+     * See class javadoc.
+     */
+    public static volatile boolean serializeExecution = Boolean.getBoolean(Fiber.class.getName()+".serialize");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java
new file mode 100644
index 0000000..47d5e36
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Interception for {@link Fiber} context switch.
+ *
+ * <p>
+ * Even though pipeline runs asynchronously, sometimes it's desirable
+ * to bind some state to the current thread running a fiber. Such state
+ * may include security subject (in terms of {@link AccessController#doPrivileged}),
+ * or a transaction.
+ *
+ * <p>
+ * This mechanism makes it possible to do such things, by allowing
+ * some code to be executed before and after a thread executes a fiber.
+ *
+ * <p>
+ * The design also encapsulates the entire fiber execution in a single
+ * opaque method invocation {@link Work#execute}, allowing the use of
+ * <tt>finally</tt> block.
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface FiberContextSwitchInterceptor {
+    /**
+     * Allows the interception of the fiber execution.
+     *
+     * <p>
+     * This method needs to be implemented like this:
+     *
+     * <pre>
+     * &lt;R,P> R execute( Fiber f, P p, Work&lt;R,P> work ) {
+     *   // do some preparation work
+     *   ...
+     *   try {
+     *     // invoke
+     *     return work.execute(p);
+     *   } finally {
+     *     // do some clean up work
+     *     ...
+     *   }
+     * }
+     * </pre>
+     *
+     * <p>
+     * While somewhat unintuitive,
+     * this interception mechanism enables the interceptor to wrap
+     * the whole fiber execution into a {@link AccessController#doPrivileged(PrivilegedAction)},
+     * for example.
+     *
+     * @param f
+     *      {@link Fiber} to be executed.
+     * @param p
+     *      The opaque parameter value for {@link Work}. Simply pass this value to
+     *      {@link Work#execute(Object)}.
+     * @return
+     *      The opaque return value from the the {@link Work}. Simply return
+     *      the value from {@link Work#execute(Object)}.
+     */
+    <R,P> R execute( Fiber f, P p, Work<R,P> work );
+
+    /**
+     * Abstraction of the execution that happens inside the interceptor.
+     */
+    interface Work<R,P> {
+        /**
+         * Have the current thread executes the current fiber,
+         * and returns when it stops doing so.
+         *
+         * <p>
+         * The parameter and the return value is controlled by the
+         * JAX-WS runtime, and interceptors should simply treat
+         * them as opaque values.
+         */
+        R execute(P param);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/NextAction.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/NextAction.java
new file mode 100644
index 0000000..bbd35d3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/NextAction.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+
+/**
+ * Indicates what shall happen after {@link Tube#processRequest(Packet)} or
+ * {@link Tube#processResponse(Packet)} returns.
+ *
+ * <p>
+ * To allow reuse of this object, this class is mutable.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class NextAction {
+    int kind;
+    Tube next;
+    Packet packet;
+    /**
+     * Really either {@link RuntimeException} or {@link Error}.
+     */
+    Throwable throwable;
+
+    // public enum Kind { INVOKE, INVOKE_AND_FORGET, RETURN, SUSPEND }
+
+    static final int INVOKE = 0;
+    static final int INVOKE_AND_FORGET = 1;
+    static final int RETURN = 2;
+    static final int THROW = 3;
+    static final int SUSPEND = 4;
+
+    private void set(int k, Tube v, Packet p, Throwable t) {
+        this.kind = k;
+        this.next = v;
+        this.packet = p;
+        this.throwable = t;
+    }
+
+    /**
+     * Indicates that the next action should be to
+     * invoke the next tube's {@link Tube#processRequest(Packet)},
+     * then later invoke the current tube's {@link Tube#processResponse(Packet)}
+     * with the response packet.
+     */
+    public void invoke(Tube next, Packet p) {
+        set(INVOKE, next, p, null);
+    }
+
+    /**
+     * Indicates that the next action should be to
+     * invoke the next tube's {@link Tube#processRequest(Packet)},
+     * but the current tube doesn't want to receive the response packet to
+     * its {@link Tube#processResponse(Packet)}.
+     */
+    public void invokeAndForget(Tube next, Packet p) {
+        set(INVOKE_AND_FORGET, next, p, null);
+    }
+
+    /**
+     * Indicates that the next action is to flip the processing direction
+     * and starts response processing.
+     */
+    public void returnWith( Packet response ) {
+        set(RETURN, null, response, null);
+    }
+
+    /**
+     * Indicates that the next action is to flip the processing direction
+     * and starts exception processing.
+     *
+     * @param t
+     *      Either {@link RuntimeException} or {@link Error}, but defined to
+     *      take {@link Throwable} because {@link Tube#processException(Throwable)}
+     *      takes {@link Throwable}.
+     */
+    public void throwException(Throwable t) {
+        assert t instanceof RuntimeException || t instanceof Error;
+        set(THROW,null,null,t);
+    }
+
+    /**
+     * Indicates that the fiber should be suspended.
+     * Once {@link Fiber#resume(Packet) resumed}, return the response processing.
+     */
+    public void suspend() {
+        set(SUSPEND, null, null, null);
+    }
+
+    /**
+     * Dumps the contents to assist debugging.
+     */
+    public String toString() {
+        StringBuilder buf = new StringBuilder();
+        buf.append(super.toString()).append(" [");
+        buf.append("kind=").append(getKindString()).append(',');
+        buf.append("next=").append(next).append(',');
+        buf.append("packet=").append(packet).append(',');
+        buf.append("throwable=").append(throwable).append(']');
+        return buf.toString();
+    }
+
+    /**
+     * Returns {@link #kind} in a human readable string, to assist debugging.
+     */
+    public String getKindString() {
+        switch(kind) {
+        case INVOKE:            return "INVOKE";
+        case INVOKE_AND_FORGET: return "INVOKE_AND_FORGET";
+        case RETURN:            return "RETURN";
+        case THROW:             return "THROW";
+        case SUSPEND:           return "SUSPEND";
+        default:                throw new AssertionError(kind);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Pipe.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Pipe.java
new file mode 100644
index 0000000..6c86e6d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Pipe.java
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterPipeImpl;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractPipeImpl;
+
+import javax.annotation.PreDestroy;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+
+/**
+ * Abstraction of the intermediate layers in the processing chain
+ * and transport.
+ *
+ * <h2>What is a {@link Pipe}?</h2>
+ * <p>
+ * Transport is a kind of pipe. It sends the {@link Packet}
+ * through, say, HTTP connection, and receives the data back into another {@link Packet}.
+ *
+ * <p>
+ * More often, a pipe is a filter. It acts on a packet,
+ * and then it passes the packet into another pipe. It can
+ * do the same on the way back.
+ *
+ * <p>
+ * For example, XWSS will be a {@link Pipe}
+ * that delegates to another {@link Pipe}, and it can wrap a {@link Packet} into
+ * another {@link Packet} to encrypt the body and add a header, for example.
+ *
+ * <p>
+ * Yet another kind of filter pipe is those that wraps {@link LogicalHandler}
+ * and {@link SOAPHandler}. These pipes are heavy-weight; they often consume
+ * a message in a packet and create a new one, and then pass it to the next pipe.
+ * For performance reason it probably makes sense to have one {@link Pipe}
+ * instance that invokes a series of {@link LogicalHandler}s, another one
+ * for {@link SOAPHandler}.
+ *
+ * <p>
+ * There would be a {@link Pipe} implementation that invokes {@link Provider}.
+ * There would be a {@link Pipe} implementation that invokes a service method
+ * on the user's code.
+ * There would be a {@link Dispatch} implementation that invokes a {@link Pipe}.
+ *
+ * <p>
+ * WS-MEX can be implemented as a {@link Pipe} that looks for
+ * {@link Message#getPayloadNamespaceURI()} and serves the request.
+ *
+ *
+ * <h2>Pipe Lifecycle</h2>
+ * {@link Pipe}line is expensive to set up, so once it's created it will be reused.
+ * A {@link Pipe}line is not reentrant; one pipeline is used to process one request/response
+ * at at time. The same pipeline instance may serve request/response for different threads,
+ * if one comes after another and they don't overlap.
+ * <p>
+ * Where a need arises to process multiple requests concurrently, a pipeline
+ * gets cloned through {@link PipeCloner}. Note that this need may happen on
+ * both server (because it quite often serves multiple requests concurrently)
+ * and client (because it needs to support asynchronous method invocations.)
+ * <p>
+ * Created pipelines (including cloned ones and the original) may be discarded and GCed
+ * at any time at the discretion of whoever owns pipelines. Pipes can, however, expect
+ * at least one copy (or original) of pipeline to live at any given time while a pipeline
+ * owner is interested in the given pipeline configuration (in more concerete terms,
+ * for example, as long as a dispatch object lives, it's going to keep at least one
+ * copy of a pipeline alive.)
+ * <p>
+ * Before a pipeline owner dies, it may invoke {@link #preDestroy()} on the last
+ * remaining pipeline. It is "may" for pipeline owners that live in the client-side
+ * of JAX-WS (such as dispatches and proxies), but it is a "must" for pipeline owners
+ * that live in the server-side of JAX-WS.
+ * <p>
+ * This last invocation gives a chance for some pipes to clean up any state/resource
+ * acquired (such as WS-RM's sequence, WS-Trust's SecurityToken), although as stated above,
+ * this is not required for clients.
+ *
+ *
+ *
+ * <h2>Pipe and State</h2>
+ * <p>
+ * The lifecycle of pipelines is designed to allow a {@link Pipe} to store various
+ * state in easily accessible fashion.
+ *
+ *
+ * <h3>Per-packet state</h3>
+ * <p>
+ * Any information that changes from a packet to packet should be
+ * stored in {@link Packet}. This includes information like
+ * transport-specific headers.
+ *
+ * <h3>Per-thread state</h3>
+ * <p>
+ * Any expensive objects that are non-reentrant can be stored in
+ * instance variables of a {@link Pipe}, since {@link #process(Packet)} is
+ * non reentrant. When a pipe is copied, new instances should be allocated
+ * so that two {@link Pipe} instances don't share thread-unsafe resources.
+ * This includes things like canonicalizers, JAXB unmarshallers, buffers,
+ * and so on.
+ *
+ * <h3>Per-proxy/per-endpoint state</h3>
+ * <p>
+ * Information that is tied to a particular proxy/dispatch can be stored
+ * in a separate object that is referenced from a pipe. When
+ * a new pipe is copied, you can simply hand out a reference to the newly
+ * created one, so that all copied pipes refer to the same instance.
+ * See the following code as an example:
+ *
+ * <pre>
+ * class PipeImpl {
+ *   // this object stores per-proxy state
+ *   class DataStore {
+ *     int counter;
+ *   }
+ *
+ *   private DataStore ds;
+ *
+ *   // create a fresh new pipe
+ *   public PipeImpl(...) {
+ *     ....
+ *     ds = new DataStore();
+ *   }
+ *
+ *   // copy constructor
+ *   private PipeImpl(PipeImpl that, PipeCloner cloner) {
+ *     cloner.add(that,this);
+ *     ...
+ *     this.ds = that.ds;
+ *   }
+ *
+ *   public PipeImpl copy(PipeCloner pc) {
+ *     return new PipeImpl(this,pc);
+ *   }
+ * }
+ * </pre>
+ *
+ * <p>
+ * Note that access to such resource often needs to be synchronized,
+ * since multiple copies of pipelines may execute concurrently.
+ *
+ * <p>
+ * If such information is read-only,
+ * it can be stored as instance variables of a pipe,
+ * and its reference copied as pipes get copied. (The only difference between
+ * this and per-thread state is that you just won't allocate new things when
+ * pipes get copied here.)
+ *
+ *
+ * <h3>VM-wide state</h3>
+ * <p>
+ * <tt>static</tt> is always there for you to use.
+ *
+ *
+ *
+ * <h2>Pipes and Handlers</h2>
+ * <p>
+ * JAX-WS has a notion of {@link LogicalHandler} and {@link SOAPHandler}, and
+ * we intend to have one {@link Pipe} implementation that invokes all the
+ * {@link LogicalHandler}s and another {@link Pipe} implementation that invokes
+ * all the {@link SOAPHandler}s. Those implementations need to convert a {@link Message}
+ * into an appropriate format, but grouping all the handlers together eliminates
+ * the intermediate {@link Message} instanciation between such handlers.
+ * <p>
+ * This grouping also allows such implementations to follow the event notifications
+ * to handlers (i.e. {@link Handler#close(MessageContext)} method.
+ *
+ *
+ * <pre>
+ * TODO: Possible types of pipe:
+ *      creator: create message from wire
+ *          to SAAJ SOAP message
+ *          to cached representation
+ *          directly to JAXB beans
+ *      transformer: transform message from one representation to another
+ *          JAXB beans to encoded SOAP message
+ *          StAX writing + JAXB bean to encoded SOAP message
+ *      modifier: modify message
+ *          add SOAP header blocks
+ *          security processing
+ *      header block processor:
+ *          process certain SOAP header blocks
+ *      outbound initiator: input from the client
+ *          Manage input e.g. JAXB beans and associated with parts of the SOAP message
+ *      inbound invoker: invoke the service
+ *         Inkoke SEI, e.g. EJB or SEI in servlet.
+ * </pre>
+ *
+ * @see AbstractPipeImpl
+ * @see AbstractFilterPipeImpl
+ * @deprecated
+ *      Use {@link Tube}.
+ */
+public interface Pipe {
+    /**
+     * Sends a {@link Packet} and returns a response {@link Packet} to it.
+     *
+     * @throws WebServiceException
+     *      On the server side, this signals an error condition where
+     *      a fault reply is in order (or the exception gets eaten by
+     *      the top-most transport {@link Pipe} if it's one-way.)
+     *      This frees each {@link Pipe} from try/catching a
+     *      {@link WebServiceException} in every layer.
+     *
+     *      Note that this method is also allowed to return a {@link Packet}
+     *      that has a fault as the payload.
+     *
+     *      <p>
+     *      On the client side, the {@link WebServiceException} thrown
+     *      will be propagated all the way back to the calling client
+     *      applications. (The consequence of that is that if you are
+     *      a filtering {@link Pipe}, you must not catch the exception
+     *      that your next {@link Pipe} threw.
+     *
+     * @throws RuntimeException
+     *      Other runtime exception thrown by this method must
+     *      be treated as a bug in the pipe implementation,
+     *      and therefore should not be converted into a fault.
+     *      (Otherwise it becomes very difficult to debug implementation
+     *      problems.)
+     *
+     *      <p>
+     *      On the server side, this exception should be most likely
+     *      just logged. On the client-side it gets propagated to the
+     *      client application.
+     *
+     *      <p>
+     *      The consequence of this is that if a pipe calls
+     *      into an user application (such as {@link SOAPHandler}
+     *      or {@link LogicalHandler}), where a {@link RuntimeException}
+     *      is *not* a bug in the JAX-WS implementation, it must be catched
+     *      and wrapped into a {@link WebServiceException}.
+     *
+     * @param request
+     *      The packet that represents a request message. Must not be null.
+     *      If the packet has a non-null message, it must be a valid
+     *      unconsumed {@link Message}. This message represents the
+     *      SOAP message to be sent as a request.
+     *      <p>
+     *      The packet is also allowed to carry no message, which indicates
+     *      that this is an output-only request.
+     *      (that's called "solicit", right? - KK)
+     *
+     * @return
+     *      The packet that represents a response message. Must not be null.
+     *      If the packet has a non-null message, it must be
+     *      a valid unconsumed {@link Message}. This message represents
+     *      a response to the request message passed as a parameter.
+     *      <p>
+     *      The packet is also allowed to carry no message, which indicates
+     *      that there was no response. This is used for things like
+     *      one-way message and/or one-way transports.
+     */
+    Packet process( Packet request);
+
+    /**
+     * Invoked before the last copy of the pipeline is about to be discarded,
+     * to give {@link Pipe}s a chance to clean up any resources.
+     *
+     * <p>
+     * This can be used to invoke {@link PreDestroy} lifecycle methods
+     * on user handler. The invocation of it is optional on the client side,
+     * but mandatory on the server side.
+     *
+     * <p>
+     * When multiple copies of pipelines are created, this method is called
+     * only on one of them.
+     *
+     * @throws WebServiceException
+     *      If the clean up fails, {@link WebServiceException} can be thrown.
+     *      This exception will be propagated to users (if this is client),
+     *      or recorded (if this is server.)
+     */
+    void preDestroy();
+
+    /**
+     * Creates an identical clone of this {@link Pipe}.
+     *
+     * <p>
+     * This method creates an identical pipeline that can be used
+     * concurrently with this pipeline. When the caller of a pipeline
+     * is multi-threaded and need concurrent use of the same pipeline,
+     * it can do so by creating copies through this method.
+     *
+     * <h3>Implementation Note</h3>
+     * <p>
+     * It is the implementation's responsibility to call
+     * {@link PipeCloner#add(Pipe,Pipe)} to register the copied pipe
+     * with the original. This is required before you start copying
+     * the other {@link Pipe} references you have, or else there's a
+     * risk of infinite recursion.
+     * <p>
+     * For most {@link Pipe} implementations that delegate to another
+     * {@link Pipe}, this method requires that you also copy the {@link Pipe}
+     * that you delegate to.
+     * <p>
+     * For limited number of {@link Pipe}s that do not maintain any
+     * thread unsafe resource, it is allowed to simply return <tt>this</tt>
+     * from this method (notice that even if you are stateless, if you
+     * got a delegating {@link Pipe} and that one isn't stateless, you
+     * still have to copy yourself.)
+     *
+     * <p>
+     * Note that this method might be invoked by one thread while another
+     * thread is executing the {@link #process(Packet)} method. See
+     * the {@link Codec#copy()} for more discussion about this.
+     *
+     * @param cloner
+     *      Use this object (in particular its {@link PipeCloner#copy(Pipe)} method
+     *      to clone other pipe references you have
+     *      in your pipe. See {@link PipeCloner} for more discussion
+     *      about why.
+     *
+     * @return
+     *      always non-null {@link Pipe}.
+     * @param cloner
+     */
+    Pipe copy(PipeCloner cloner);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipeCloner.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipeCloner.java
new file mode 100644
index 0000000..a331241
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipeCloner.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+
+/**
+ * Clones the whole pipeline.
+ *
+ * <p>
+ * Since {@link Pipe}s may form an arbitrary directed graph, someone needs
+ * to keep track of isomorphism for a clone to happen correctly. This class
+ * serves that role.
+ *
+ * @deprecated
+ *      Use {@link TubeCloner}.
+ * @author Kohsuke Kawaguchi
+ */
+public final class PipeCloner extends TubeCloner {
+    /**
+     * {@link Pipe} version of {@link #clone(Tube)}
+     */
+    public static Pipe clone(Pipe p) {
+        return new PipeCloner().copy(p);
+    }
+
+    // no need to be constructed publicly. always use the static clone method.
+    /*package*/ PipeCloner() {}
+
+    /**
+     * {@link Pipe} version of {@link #copy(Tube)}
+     */
+    public <T extends Pipe> T copy(T p) {
+        Pipe r = (Pipe)master2copy.get(p);
+        if(r==null) {
+            r = p.copy(this);
+            // the pipe must puts its copy to the map by itself
+            assert master2copy.get(p)==r : "the pipe must call the add(...) method to register itself before start copying other pipes, but "+p+" hasn't done so";
+        }
+        return (T)r;
+    }
+
+
+    /**
+     * The {@link Pipe} version of {@link #add(Tube, Tube)}.
+     */
+    public void add(Pipe original, Pipe copy) {
+        assert !master2copy.containsKey(original);
+        assert original!=null && copy!=null;
+        master2copy.put(original,copy);
+    }
+
+    /**
+     * Disambiguation version.
+     */
+    public void add(AbstractTubeImpl original, AbstractTubeImpl copy) {
+        add((Tube)original,copy);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssembler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssembler.java
new file mode 100644
index 0000000..ebc37d3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssembler.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Creates a pipeline.
+ *
+ * <p>
+ * This pluggability layer enables the upper layer to
+ * control exactly how the pipeline is composed.
+ *
+ * <p>
+ * JAX-WS is going to have its own default implementation
+ * when used all by itself, but it can be substituted by
+ * other implementations.
+ *
+ * <p>
+ * See {@link PipelineAssemblerFactory} for how {@link PipelineAssembler}s
+ * are located.
+ *
+ * <p>
+ * TODO: the JAX-WS team felt that no {@link Pipe} should be relying
+ * on the {@link SEIModel}, so it is no longer given to the assembler.
+ * Talk to us if you need it.
+ *
+ * @see ClientPipeAssemblerContext
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface PipelineAssembler {
+    /**
+     * Creates a new pipeline for clients.
+     *
+     * <p>
+     * When a JAX-WS client creates a proxy or a {@link Dispatch} from
+     * a {@link Service}, JAX-WS runtime internally uses this method
+     * to create a new pipeline as a part of the initilization.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the pipeline to be assembled.
+     *
+     * @return
+     *      non-null freshly created pipeline.
+     *
+     * @throws WebServiceException
+     *      if there's any configuration error that prevents the
+     *      pipeline from being constructed. This exception will be
+     *      propagated into the application, so it must have
+     *      a descriptive error.
+     */
+    @NotNull Pipe createClient(@NotNull ClientPipeAssemblerContext context);
+
+    /**
+     * Creates a new pipeline for servers.
+     *
+     * <p>
+     * When a JAX-WS server deploys a new endpoint, it internally
+     * uses this method to create a new pipeline as a part of the
+     * initialization.
+     *
+     * <p>
+     * Note that this method is called only once to set up a
+     * 'master pipeline', and it gets {@link Pipe#copy(PipeCloner) copied}
+     * from it.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the pipeline to be assembled.
+     *
+     * @return
+     *      non-null freshly created pipeline.
+     *
+     * @throws WebServiceException
+     *      if there's any configuration error that prevents the
+     *      pipeline from being constructed. This exception will be
+     *      propagated into the container, so it must have
+     *      a descriptive error.
+     *
+     */
+    @NotNull Pipe createServer(@NotNull ServerPipeAssemblerContext context);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssemblerFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssemblerFactory.java
new file mode 100644
index 0000000..610e7ba
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/PipelineAssemblerFactory.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+
+import javax.xml.ws.soap.SOAPBinding;
+import java.util.logging.Logger;
+
+/**
+ * Creates {@link PipelineAssembler}.
+ *
+ * <p>
+ * To create a pipeline,
+ * the JAX-WS runtime locates {@link PipelineAssemblerFactory}s through
+ * the <tt>META-INF/services/com.sun.xml.internal.ws.api.pipe.PipelineAssemblerFactory</tt> files.
+ * Factories found are checked to see if it supports the given binding ID one by one,
+ * and the first valid {@link PipelineAssembler} returned will be used to create
+ * a pipeline.
+ *
+ * <p>
+ * TODO: is bindingId really extensible? for this to be extensible,
+ * someone seems to need to hook into WSDL parsing.
+ *
+ * <p>
+ * TODO: JAX-WSA might not define its own binding ID -- it may just go to an extension element
+ * of WSDL. So this abstraction might need to be worked on.
+ *
+ * @author Kohsuke Kawaguchi
+ * @deprecated
+ *      Use {@link TubelineAssemblerFactory} instead.
+ */
+public abstract class PipelineAssemblerFactory {
+    /**
+     * Creates a {@link PipelineAssembler} applicable for the given binding ID.
+     *
+     * @param bindingId
+     *      The binding ID for which a pipeline will be created,
+     *      such as {@link SOAPBinding#SOAP11HTTP_BINDING}.
+     *      Must not be null.
+     *
+     * @return
+     *      null if this factory doesn't recognize the given binding ID.
+     */
+    public abstract PipelineAssembler doCreate(BindingID bindingId);
+
+    /**
+     * Locates {@link PipelineAssemblerFactory}s and create
+     * a suitable {@link PipelineAssembler}.
+     *
+     * @param bindingId
+     *      The binding ID string for which the new {@link PipelineAssembler}
+     *      is created. Must not be null.
+     * @return
+     *      Always non-null, since we fall back to our default {@link PipelineAssembler}.
+     */
+    public static PipelineAssembler create(ClassLoader classLoader, BindingID bindingId) {
+        for (PipelineAssemblerFactory factory : ServiceFinder.find(PipelineAssemblerFactory.class,classLoader)) {
+            PipelineAssembler assembler = factory.doCreate(bindingId);
+            if(assembler!=null) {
+                logger.fine(factory.getClass()+" successfully created "+assembler);
+                return assembler;
+            }
+        }
+
+        // default binding IDs that are known
+        // TODO: replace this with proper ones
+        return new com.sun.xml.internal.ws.util.pipe.StandalonePipeAssembler();
+    }
+
+    private static final Logger logger = Logger.getLogger(PipelineAssemblerFactory.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/SOAPBindingCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/SOAPBindingCodec.java
new file mode 100644
index 0000000..6b274de
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/SOAPBindingCodec.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Message;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ *
+ *
+ * @see com.sun.xml.internal.ws.api.pipe.Codecs
+ * @author Jitendra Kotamraju
+ */
+public interface SOAPBindingCodec extends Codec {
+    StreamSOAPCodec getXMLCodec();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java
new file mode 100644
index 0000000..48af034
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+
+import java.io.PrintStream;
+
+/**
+ * Factory for well-known server {@link Pipe} implementations
+ * that the {@link PipelineAssembler} needs to use
+ * to satisfy JAX-WS requirements.
+ *
+ * @author Jitendra Kotamraju
+ * @deprecated Use {@link ServerTubeAssemblerContext}.
+ */
+public final class ServerPipeAssemblerContext extends ServerTubeAssemblerContext {
+
+    public ServerPipeAssemblerContext(@Nullable SEIModel seiModel, @Nullable WSDLPort wsdlModel, @NotNull WSEndpoint endpoint, @NotNull Tube terminal, boolean isSynchronous) {
+        super(seiModel, wsdlModel, endpoint, terminal, isSynchronous);
+    }
+
+    /**
+     * Creates a {@link Pipe} that performs SOAP mustUnderstand processing.
+     * This pipe should be before HandlerPipes.
+     */
+    public @NotNull Pipe createServerMUPipe(@NotNull Pipe next) {
+        return PipeAdapter.adapt(super.createServerMUTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * creates a {@link Pipe} that dumps messages that pass through.
+     */
+    public Pipe createDumpPipe(String name, PrintStream out, Pipe next) {
+        return PipeAdapter.adapt(super.createDumpTube(name, out, PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that does the monitoring of the invocation for a
+     * container
+     */
+    public @NotNull Pipe createMonitoringPipe(@NotNull Pipe next) {
+        return PipeAdapter.adapt(super.createMonitoringTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that adds container specific security
+     */
+    public @NotNull Pipe createSecurityPipe(@NotNull Pipe next) {
+        return PipeAdapter.adapt(super.createSecurityTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * Creates a {@link Pipe} that invokes protocol and logical handlers.
+     */
+    public @NotNull Pipe createHandlerPipe(@NotNull Pipe next) {
+        return PipeAdapter.adapt(super.createHandlerTube(PipeAdapter.adapt(next)));
+    }
+
+    /**
+     * The last {@link Pipe} in the pipeline. The assembler is expected to put
+     * additional {@link Pipe}s in front of it.
+     *
+     * <p>
+     * (Just to give you the idea how this is used, normally the terminal pipe
+     * is the one that invokes the user application or {@link javax.xml.ws.Provider}.)
+     *
+     * @return always non-null terminal pipe
+     */
+     public @NotNull Pipe getTerminalPipe() {
+         return PipeAdapter.adapt(super.getTerminalTube());
+    }
+
+     /**
+     * Creates WS-Addressing pipe
+     */
+    public Pipe createWsaPipe(Pipe next) {
+        return PipeAdapter.adapt(super.createWsaTube(PipeAdapter.adapt(next)));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java
new file mode 100644
index 0000000..4a0a325
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.addressing.WsaServerTube;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.api.server.ServerPipelineHook;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.handler.HandlerTube;
+import com.sun.xml.internal.ws.handler.ServerLogicalHandlerTube;
+import com.sun.xml.internal.ws.handler.ServerSOAPHandlerTube;
+import com.sun.xml.internal.ws.protocol.soap.ServerMUTube;
+import com.sun.xml.internal.ws.util.pipe.DumpTube;
+
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.PrintStream;
+
+/**
+ * Factory for well-known server {@link Tube} implementations
+ * that the {@link TubelineAssembler} needs to use
+ * to satisfy JAX-WS requirements.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class ServerTubeAssemblerContext {
+
+    private final SEIModel seiModel;
+    private final WSDLPort wsdlModel;
+    private final WSEndpoint endpoint;
+    private final BindingImpl binding;
+    private final Tube terminal;
+    private final boolean isSynchronous;
+    private @NotNull Codec codec;
+
+    public ServerTubeAssemblerContext(@Nullable SEIModel seiModel,
+                                      @Nullable WSDLPort wsdlModel, @NotNull WSEndpoint endpoint,
+                                      @NotNull Tube terminal, boolean isSynchronous) {
+        this.seiModel = seiModel;
+        this.wsdlModel = wsdlModel;
+        this.endpoint = endpoint;
+        this.terminal = terminal;
+        // WSBinding is actually BindingImpl
+        this.binding = (BindingImpl)endpoint.getBinding();
+        this.isSynchronous = isSynchronous;
+        this.codec = this.binding.createCodec();
+    }
+
+    /**
+     * The created pipeline will use seiModel to get java concepts for the endpoint
+     *
+     * @return Null if the service doesn't have SEI model e.g. Provider endpoints,
+     *         and otherwise non-null.
+     */
+    public @Nullable SEIModel getSEIModel() {
+        return seiModel;
+    }
+
+    /**
+     * The created pipeline will be used to serve this port.
+     *
+     * @return Null if the service isn't associated with any port definition in WSDL,
+     *         and otherwise non-null.
+     */
+    public @Nullable WSDLPort getWsdlModel() {
+        return wsdlModel;
+    }
+
+    /**
+     *
+     * The created pipeline is used to serve this {@link com.sun.xml.internal.ws.api.server.WSEndpoint}.
+     * Specifically, its {@link com.sun.xml.internal.ws.api.WSBinding} should be of interest to  many
+     * {@link com.sun.xml.internal.ws.api.pipe.Pipe}s.
+     *  @return Always non-null.
+     */
+    public @NotNull WSEndpoint getEndpoint() {
+        return endpoint;
+    }
+
+    /**
+     * The last {@link com.sun.xml.internal.ws.api.pipe.Pipe} in the pipeline. The assembler is expected to put
+     * additional {@link com.sun.xml.internal.ws.api.pipe.Pipe}s in front of it.
+     *
+     * <p>
+     * (Just to give you the idea how this is used, normally the terminal pipe
+     * is the one that invokes the user application or {@link javax.xml.ws.Provider}.)
+     *
+     * @return always non-null terminal pipe
+     */
+     public @NotNull Tube getTerminalTube() {
+         return terminal;
+    }
+
+    /**
+     * If this server pipeline is known to be used for serving synchronous transport,
+     * then this method returns true. This can be potentially use as an optimization
+     * hint, since often synchronous versions are cheaper to execute than asycnhronous
+     * versions.
+     */
+    public boolean isSynchronous() {
+        return isSynchronous;
+    }
+
+    /**
+     * Creates a {@link Tube} that performs SOAP mustUnderstand processing.
+     * This pipe should be before HandlerPipes.
+     */
+    public @NotNull Tube createServerMUTube(@NotNull Tube next) {
+        if (binding instanceof SOAPBinding)
+            return new ServerMUTube(binding,next);
+        else
+            return next;
+    }
+
+    /**
+     * Creates a {@link Tube} that invokes protocol and logical handlers.
+     */
+    public @NotNull Tube createHandlerTube(@NotNull Tube next) {
+        if (!binding.getHandlerChain().isEmpty()) {
+            HandlerTube cousin = new ServerLogicalHandlerTube(binding, wsdlModel, next);
+            next = cousin;
+            if (binding instanceof SOAPBinding) {
+                return new ServerSOAPHandlerTube(binding, next, cousin);
+            }
+        }
+        return next;
+    }
+
+    /**
+     * Creates a {@link Tube} that does the monitoring of the invocation for a
+     * container
+     */
+    public @NotNull Tube createMonitoringTube(@NotNull Tube next) {
+        ServerPipelineHook hook = endpoint.getContainer().getSPI(ServerPipelineHook.class);
+        if (hook != null) {
+            ServerPipeAssemblerContext ctxt = new ServerPipeAssemblerContext(seiModel, wsdlModel, endpoint, terminal, isSynchronous);
+            return PipeAdapter.adapt(hook.createMonitoringPipe(ctxt, PipeAdapter.adapt(next)));
+        }
+        return next;
+    }
+
+    /**
+     * Creates a {@link Tube} that adds container specific security
+     */
+    public @NotNull Tube createSecurityTube(@NotNull Tube next) {
+        ServerPipelineHook hook = endpoint.getContainer().getSPI(ServerPipelineHook.class);
+        if (hook != null) {
+            ServerPipeAssemblerContext ctxt = new ServerPipeAssemblerContext(seiModel, wsdlModel, endpoint, terminal, isSynchronous);
+            return PipeAdapter.adapt(hook.createSecurityPipe(ctxt, PipeAdapter.adapt(next)));
+        }
+        return next;
+    }
+
+    /**
+     * creates a {@link Tube} that dumps messages that pass through.
+     */
+    public Tube createDumpTube(String name, PrintStream out, Tube next) {
+        return new DumpTube(name, out, next);
+    }
+
+    /**
+     * Creates WS-Addressing pipe
+     */
+    public Tube createWsaTube(Tube next) {
+        if (binding instanceof SOAPBinding && AddressingVersion.isEnabled(binding) && wsdlModel!=null)
+            return new WsaServerTube(wsdlModel, binding, next);
+        else
+            return next;
+    }
+
+    /**
+     * Gets the {@link Codec} that is set by {@link #setCodec} or the default codec
+     * based on the binding. The codec is a full codec that is responsible for
+     * encoding/decoding entire protocol message(for e.g: it is responsible to
+     * encode/decode entire MIME messages in SOAP binding)
+     *
+     * @return codec to be used for web service requests
+     * @see {@link Codecs}
+     */
+    public @NotNull Codec getCodec() {
+        return codec;
+    }
+
+    /**
+     * Interception point to change {@link Codec} during {@link Tube}line assembly. The
+     * new codec will be used by jax-ws server runtime for encoding/decoding web service
+     * request/response messages. {@link WSEndpoint#createCodec()} will return a copy
+     * of this new codec and will be used in the server runtime.
+     *
+     * <p>
+     * The codec is a full codec that is responsible for
+     * encoding/decoding entire protocol message(for e.g: it is responsible to
+     * encode/decode entire MIME messages in SOAP binding)
+     *
+     * <p>
+     * the codec should correctly implement {@link Codec#copy} since it is used while
+     * serving requests concurrently.
+     *
+     * @param codec codec to be used for web service requests
+     * @see {@link Codecs}
+     */
+    public void setCodec(@NotNull Codec codec) {
+        this.codec = codec;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java
new file mode 100644
index 0000000..36f3b41
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Message;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Reads events from {@link XMLStreamReader} and constructs a
+ * {@link Message} for SOAP envelope. {@link Codecs} allows a
+ * way to construct a whole codec that can handle MTOM, MIME
+ * encoded packages using this codec.
+ *
+ *
+ * @see Codecs
+ * @author Jitendra Kotamraju
+ */
+public interface StreamSOAPCodec extends Codec {
+    /**
+     * Reads events from {@link XMLStreamReader} and constructs a
+     * {@link Message} for SOAP envelope.
+     *
+     * @param reader that represents SOAP envelope infoset
+     * @return a {@link Message} for SOAP envelope
+     */
+    public @NotNull Message decode(@NotNull XMLStreamReader reader);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Stubs.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Stubs.java
new file mode 100644
index 0000000..8349d21
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Stubs.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.client.dispatch.DataSourceDispatch;
+import com.sun.xml.internal.ws.client.dispatch.DispatchImpl;
+import com.sun.xml.internal.ws.client.dispatch.JAXBDispatch;
+import com.sun.xml.internal.ws.client.dispatch.MessageDispatch;
+import com.sun.xml.internal.ws.client.sei.SEIStub;
+import com.sun.xml.internal.ws.developer.WSBindingProvider;
+import com.sun.xml.internal.ws.model.SOAPSEIModel;
+
+import javax.activation.DataSource;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceException;
+import java.lang.reflect.Proxy;
+
+/**
+ * Factory methods of various stubs.
+ *
+ * <p>
+ * This class provides various methods to create "stub"s,
+ * which are the component that turns a method invocation
+ * into a {@link Message} and back into a return value.
+ *
+ * <p>
+ * This class is meant to serve as the API from JAX-WS to
+ * Tango, so that they don't have hard-code dependency on
+ * our implementation classes.
+ *
+ * <a name="param"></a>
+ * <h2>Common Parameters and Their Meanings</h2>
+ *
+ * <h3>Pipe next</h3>
+ * <p>
+ * Stubs turn a method invocation into a {@link Pipe#process(com.sun.xml.internal.ws.api.message.Packet)} invocation,
+ * and this pipe passed in as the <tt>next</tt> parameter will receive a {@link Message}
+ * from newly created stub.
+ *
+ * <h3>BindingImpl binding</h3>
+ * <p>
+ * Stubs implement {@link BindingProvider}, and its {@link BindingProvider#getBinding()}
+ * will return this <tt>binding</tt> object. Stubs often also use this information
+ * to decide which SOAP version a {@link Message} should be created in.
+ *
+ * <h3>{@link WSService} service</h3>
+ * <p>
+ * This object represents a {@link Service} that owns the newly created stub.
+ * For example, asynchronous method invocation will use {@link Service#getExecutor()}.
+ *
+ * <h3>{@link WSEndpointReference} epr</h3>
+ * <p>
+ * If you want the created {@link Dispatch} to talk to the given EPR, specify the parameter.
+ * Otherwise leave it <tt>null</tt>. Note that the addressing needs to be enabled separately
+ * for this to take effect.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Kathy Walsh
+ */
+public abstract class Stubs {
+    private Stubs() {}   // no instanciation please
+
+    /**
+     * Creates a new {@link Dispatch} stub for {@link SOAPMessage}.
+     *
+     * This is short-cut of calling
+     * <pre>
+     * createDispatch(port,owner,binding,SOAPMessage.class,mode,next);
+     * </pre>
+     */
+    public static Dispatch<SOAPMessage> createSAAJDispatch(QName portName, WSService owner, WSBinding binding, Service.Mode mode, Tube next, @Nullable WSEndpointReference epr) {
+        DispatchImpl.checkValidSOAPMessageDispatch(binding, mode);
+        return new com.sun.xml.internal.ws.client.dispatch.SOAPMessageDispatch(portName, mode, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
+    }
+
+    /**
+     * Creates a new {@link Dispatch} stub for {@link DataSource}.
+     *
+     * This is short-cut of calling
+     * <pre>
+     * createDispatch(port,owner,binding,DataSource.class,mode,next);
+     * </pre>
+     */
+    public static Dispatch<DataSource> createDataSourceDispatch(QName portName, WSService owner, WSBinding binding, Service.Mode mode, Tube next, @Nullable WSEndpointReference epr) {
+        DispatchImpl.checkValidDataSourceDispatch(binding, mode);
+        return new DataSourceDispatch(portName, mode, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
+    }
+
+    /**
+     * Creates a new {@link Dispatch} stub for {@link Source}.
+     *
+     * This is short-cut of calling
+     * <pre>
+     * createDispatch(port,owner,binding,Source.class,mode,next);
+     * </pre>
+     */
+    public static Dispatch<Source> createSourceDispatch(QName portName, WSService owner, WSBinding binding, Service.Mode mode, Tube next, @Nullable WSEndpointReference epr) {
+        return DispatchImpl.createSourceDispatch(portName, mode, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
+    }
+
+    /**
+     * Creates a new {@link Dispatch} stub that connects to the given pipe.
+     *
+     * @param portName
+     *      see {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param owner
+     *      see <a href="#param">common parameters</a>
+     * @param binding
+     *      see <a href="#param">common parameters</a>
+     * @param clazz
+     *      Type of the {@link Dispatch} to be created.
+     *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param mode
+     *      The mode of the dispatch.
+     *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param next
+     *      see <a href="#param">common parameters</a>
+     * @param epr
+     *      see <a href="#param">common parameters</a>
+     * TODO: are these parameters making sense?
+     */
+    public static <T> Dispatch<T> createDispatch(QName portName,
+                                                 WSService owner,
+                                                 WSBinding binding,
+                                                 Class<T> clazz, Service.Mode mode, Tube next,
+                                                 @Nullable WSEndpointReference epr) {
+        if (clazz == SOAPMessage.class) {
+            return (Dispatch<T>) createSAAJDispatch(portName, owner, binding, mode, next, epr);
+        } else if (clazz == Source.class) {
+            return (Dispatch<T>) createSourceDispatch(portName, owner, binding, mode, next, epr);
+        } else if (clazz == DataSource.class) {
+            return (Dispatch<T>) createDataSourceDispatch(portName, owner, binding, mode, next, epr);
+        } else if (clazz == Message.class) {
+            if(mode==Mode.MESSAGE)
+                return (Dispatch<T>) createMessageDispatch(portName, owner, binding, next, epr);
+            else
+                throw new WebServiceException(mode+" not supported with Dispatch<Message>");
+        } else
+            throw new WebServiceException("Unknown class type " + clazz.getName());
+    }
+
+    /**
+     * Creates a new JAXB-based {@link Dispatch} stub that connects to the given pipe.
+     *
+     * @param portName
+     *      see {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param owner
+     *      see <a href="#param">common parameters</a>
+     * @param binding
+     *      see <a href="#param">common parameters</a>
+     * @param jaxbContext
+     *      {@link JAXBContext} used to convert between objects and XML.
+     * @param mode
+     *      The mode of the dispatch.
+     *      See {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param next
+     *      see <a href="#param">common parameters</a>
+     * @param epr
+     *      see <a href="#param">common parameters</a>
+     */
+    public static Dispatch<Object> createJAXBDispatch(
+                                           QName portName, WSService owner, WSBinding binding,
+                                           JAXBContext jaxbContext, Service.Mode mode, Tube next,
+                                           @Nullable WSEndpointReference epr) {
+        return new JAXBDispatch(portName, jaxbContext, mode, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
+    }
+
+    /**
+     * Creates a new {@link Message}-based {@link Dispatch} stub that connects to the given pipe.
+     * The returned dispatch is always {@link Service.Mode#MESSAGE}.
+     *
+     * @param portName
+     *      see {@link Service#createDispatch(QName, Class, Service.Mode)}.
+     * @param owner
+     *      see <a href="#param">common parameters</a>
+     * @param binding
+     *      see <a href="#param">common parameters</a>
+     * @param next
+     *      see <a href="#param">common parameters</a>
+     * @param epr
+     *      see <a href="#param">common parameters</a>
+     */
+    public static Dispatch<Message> createMessageDispatch(
+                                           QName portName, WSService owner, WSBinding binding,
+                                           Tube next, @Nullable WSEndpointReference epr) {
+        return new MessageDispatch(portName, (WSServiceDelegate)owner, next, (BindingImpl)binding, epr);
+    }
+
+    /**
+     * Creates a new strongly-typed proxy object that implements a given port interface.
+     *
+     * @param service
+     *      see <a href="#param">common parameters</a>
+     * @param binding
+     *      see <a href="#param">common parameters</a>
+     * @param model
+     *      This model shall represent a port interface.
+     *      TODO: can model be constructed from portInterface and binding?
+     *      Find out and update.
+     * @param portInterface
+     *      The port interface that has operations as Java methods.
+     * @param next
+     *      see <a href="#param">common parameters</a>
+     * @param epr
+     *      see <a href="#param">common parameters</a>
+     */
+    public <T> T createPortProxy( WSService service, WSBinding binding, SEIModel model,
+                                  Class<T> portInterface, Tube next, @Nullable WSEndpointReference epr ) {
+
+        SEIStub ps = new SEIStub((WSServiceDelegate)service,(BindingImpl)binding, (SOAPSEIModel)model,next, epr);
+        return portInterface.cast(
+            Proxy.newProxyInstance( portInterface.getClassLoader(),
+                new Class[]{portInterface, WSBindingProvider.class}, ps ));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportPipeFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportPipeFactory.java
new file mode 100644
index 0000000..23cac62
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportPipeFactory.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.util.pipe.StandalonePipeAssembler;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Factory for transport pipes that enables transport pluggability.
+ *
+ * <p>
+ * At runtime, on the client side, JAX-WS (more specifically the default {@link PipelineAssembler}
+ * of JAX-WS client runtime) relies on this factory to create a suitable transport {@link Pipe}
+ * that can handle the given {@link EndpointAddress endpoint address}.
+ *
+ * <p>
+ * JAX-WS extensions that provide additional transport support can
+ * extend this class and implement the {@link #doCreate} method.
+ * They are expected to check the scheme of the endpoint address
+ * (and possibly some other settings from bindings), and create
+ * their transport pipe implementations accordingly.
+ * For example,
+ *
+ * <pre>
+ * class MyTransportPipeFactoryImpl {
+ *   Pipe doCreate(...) {
+ *     String scheme = address.getURI().getScheme();
+ *     if(scheme.equals("foo"))
+ *       return new MyTransport(...);
+ *     else
+ *       return null;
+ *   }
+ * }
+ * </pre>
+ *
+ * <p>
+ * {@link TransportPipeFactory} look-up follows the standard service
+ * discovery mechanism, so you need
+ * {@code META-INF/services/com.sun.xml.internal.ws.api.pipe.TransportPipeFactory}.
+ *
+ *
+ *
+ * <h2>TODO</h2>
+ * <p>
+ * One of the JAX-WS operation mode is supposedly where it doesn't have no WSDL whatsoever.
+ * How do we identify the endpoint in such case?
+ *
+ * @author Kohsuke Kawaguchi
+ * @see StandalonePipeAssembler
+ */
+public abstract class TransportPipeFactory {
+    /**
+     * Creates a transport {@link Pipe} for the given port, if this factory can do so,
+     * or return null.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the pipeline to be assembled.
+     *
+     * @return
+     *      null to indicate that this factory isn't capable of creating a transport
+     *      for this port (which causes the caller to search for other {@link TransportPipeFactory}s
+     *      that can. Or non-null.
+     *
+     * @throws WebServiceException
+     *      if this factory is capable of creating a transport pipe but some fatal
+     *      error prevented it from doing so. This exception will be propagated
+     *      back to the user application, and no further {@link TransportPipeFactory}s
+     *      are consulted.
+     */
+    public abstract Pipe doCreate(@NotNull ClientPipeAssemblerContext context);
+
+    /**
+     * Locates {@link PipelineAssemblerFactory}s and create
+     * a suitable {@link PipelineAssembler}.
+     *
+     * @param classLoader
+     *      used to locate {@code META-INF/servces} files.
+     * @return
+     *      Always non-null, since we fall back to our default {@link PipelineAssembler}.
+     *
+     * @deprecated
+     *      Use {@link TransportTubeFactory#create(ClassLoader, ClientTubeAssemblerContext)}
+     */
+    public static Pipe create(@Nullable ClassLoader classLoader, @NotNull ClientPipeAssemblerContext context) {
+        return PipeAdapter.adapt(TransportTubeFactory.create(classLoader,context));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java
new file mode 100644
index 0000000..cab59529
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.xml.internal.ws.util.pipe.StandaloneTubeAssembler;
+
+import javax.xml.ws.WebServiceException;
+import java.util.logging.Logger;
+
+/**
+ * Factory for transport tubes that enables transport pluggability.
+ *
+ * <p>
+ * At runtime, on the client side, JAX-WS (more specifically the default {@link TubelineAssembler}
+ * of JAX-WS client runtime) relies on this factory to create a suitable transport {@link Tube}
+ * that can handle the given {@link EndpointAddress endpoint address}.
+ *
+ * <p>
+ * JAX-WS extensions that provide additional transport support can
+ * extend this class and implement the {@link #doCreate} method.
+ * They are expected to check the scheme of the endpoint address
+ * (and possibly some other settings from bindings), and create
+ * their transport tube implementations accordingly.
+ * For example,
+ *
+ * <pre>
+ * class MyTransportTubeFactoryImpl {
+ *   Tube doCreate(...) {
+ *     String scheme = address.getURI().getScheme();
+ *     if(scheme.equals("foo"))
+ *       return new MyTransport(...);
+ *     else
+ *       return null;
+ *   }
+ * }
+ * </pre>
+ *
+ * <p>
+ * {@link TransportTubeFactory} look-up follows the standard service
+ * discovery mechanism, so you need
+ * {@code META-INF/services/com.sun.xml.internal.ws.api.pipe.TransportTubeFactory}.
+ *
+ * @author Jitendra Kotamraju
+ * @see StandaloneTubeAssembler
+ */
+public abstract class TransportTubeFactory {
+    /**
+     * Creates a transport {@link Tube} for the given port, if this factory can do so,
+     * or return null.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the tubeline to be assembled.
+     *
+     * @return
+     *      null to indicate that this factory isn't capable of creating a transport
+     *      for this port (which causes the caller to search for other {@link TransportTubeFactory}s
+     *      that can. Or non-null.
+     *
+     * @throws WebServiceException
+     *      if this factory is capable of creating a transport tube but some fatal
+     *      error prevented it from doing so. This exception will be propagated
+     *      back to the user application, and no further {@link TransportTubeFactory}s
+     *      are consulted.
+     */
+    public abstract Tube doCreate(@NotNull ClientTubeAssemblerContext context);
+
+    /**
+     * Locates {@link TransportTubeFactory}s and create a suitable transport {@link Tube}.
+     *
+     * @param classLoader
+     *      used to locate {@code META-INF/servces} files.
+     * @return
+     *      Always non-null, since we fall back to our default {@link Tube}.
+     */
+    public static Tube create(@Nullable ClassLoader classLoader, @NotNull ClientTubeAssemblerContext context) {
+        for (TransportTubeFactory factory : ServiceFinder.find(TransportTubeFactory.class,classLoader)) {
+            Tube tube = factory.doCreate(context);
+            if(tube !=null) {
+                TransportTubeFactory.logger.fine(factory.getClass()+" successfully created "+tube);
+                return tube;
+            }
+        }
+
+        // See if there is a {@link TransportPipeFactory} out there and use it for compatibility.
+        ClientPipeAssemblerContext ctxt = new ClientPipeAssemblerContext(
+                context.getAddress(), context.getWsdlModel(), context.getService(),
+                context.getBinding(), context.getContainer());
+        for (TransportPipeFactory factory : ServiceFinder.find(TransportPipeFactory.class,classLoader)) {
+            Pipe pipe = factory.doCreate(ctxt);
+            if (pipe!=null) {
+                logger.fine(factory.getClass()+" successfully created "+pipe);
+                return PipeAdapter.adapt(pipe);
+            }
+        }
+
+        // default built-in transports
+        String scheme = context.getAddress().getURI().getScheme();
+        if (scheme != null) {
+            if(scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https"))
+                return new HttpTransportPipe(context.getCodec());
+        }
+
+        throw new WebServiceException("Unsupported endpoint address: "+context.getAddress());    // TODO: i18n
+    }
+
+    private static final Logger logger = Logger.getLogger(TransportTubeFactory.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Tube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Tube.java
new file mode 100644
index 0000000..53a1823
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Tube.java
@@ -0,0 +1,397 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+import com.sun.xml.internal.ws.api.server.Adapter;
+
+import javax.annotation.PreDestroy;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import java.text.SimpleDateFormat;
+
+/**
+ * Abstraction of the intermediate layers in the processing chain
+ * and transport.
+ *
+ * <h2>What is a {@link Tube}?</h2>
+ * <p>
+ * {@link Tube} is a basic processing unit that represents SOAP-level
+ * protocol handling code. Mutliple tubes are often put together in
+ * a line (it needs not one dimensional &mdash; more later), and act on
+ * {@link Packet}s in a sequential fashion.
+ *
+ * <p>
+ * {@link Tube}s run asynchronously. That is, there is no guarantee that
+ * {@link #processRequest(Packet)} and {@link #processResponse(Packet)} runs
+ * in the same thread, nor is there any guarantee that this tube and next
+ * tube runs in the same thread. Furthermore, one thread may be used to
+ * run multiple pipeline in turn (just like a real CPU runs multiple
+ * threads in turn.)
+ *
+ *
+ * <h2>Tube examples</h2>
+ * <p>
+ * Transport is a kind of tube. It sends the {@link Packet}
+ * through, say, HTTP connection, and receives the data back into another {@link Packet}.
+ *
+ * <p>
+ * More often, a tube works like a filter. It acts on a packet,
+ * and then it tells the JAX-WS that the packet should be passed into another
+ * tube. It can do the same on the way back.
+ *
+ * <p>
+ * For example, XWSS will be a {@link Tube}. It will act on a request
+ * {@link Packet}, then perhaps wrap it into
+ * another {@link Packet} to encrypt the body and add a header, then
+ * the processing will go on to the next tube.
+ *
+ * <p>
+ * Yet another kind of filter tube is those that wraps {@link LogicalHandler}
+ * and {@link SOAPHandler}. These tubes are heavy-weight; they often consume
+ * a message in a packet and create a new one, and then pass it to the next tube.
+ *
+ * <p>
+ * There would be a {@link Tube} implementation that invokes {@link Provider}.
+ * There would be a {@link Tube} implementation that invokes a service method
+ * on the user's code.
+ * There would be a {@link Dispatch} implementation that invokes a {@link Tube}.
+ *
+ * <p>
+ * WS-MEX can be implemented as a {@link Tube} that looks for
+ * {@link Message#getPayloadNamespaceURI()} and serves the request.
+ *
+ *
+ *
+ *
+ * <h2>Tube Lifecycle</h2>
+ * Pipeline is expensive to set up, so once it's created it will be reused.
+ * A pipeline is not reentrant; one pipeline is used to process one request/response
+ * at at time. The same pipeline instance may serve multiple request/response,
+ * if one comes after another and they don't overlap.
+ * <p>
+ * Where a need arises to process multiple requests concurrently, a pipeline
+ * gets cloned through {@link TubeCloner}. Note that this need may happen on
+ * both server (because it quite often serves multiple requests concurrently)
+ * and client (because it needs to support asynchronous method invocations.)
+ * <p>
+ * Created pipelines (including cloned ones and the original) may be discarded and GC-ed
+ * at any time at the discretion of whoever owns pipelines. Tubes can, however, expect
+ * at least one copy (or original) of pipeline to live at any given time while a pipeline
+ * owner is interested in the given pipeline configuration (in more concerete terms,
+ * for example, as long as a dispatch object lives, it's going to keep at least one
+ * copy of a pipeline alive.)
+ * <p>
+ * Before a pipeline owner dies, it may invoke {@link #preDestroy()} on the last
+ * remaining pipeline. It is "may" for pipeline owners that live in the client-side
+ * of JAX-WS (such as dispatches and proxies), but it is a "must" for pipeline owners
+ * that live in the server-side of JAX-WS.
+ * <p>
+ * This last invocation gives a chance for some pipes to clean up any state/resource
+ * acquired (such as WS-RM's sequence, WS-Trust's SecurityToken), although as stated above,
+ * this is not required for clients.
+ *
+ *
+ *
+ * <h2>Tube and state</h2>
+ * <p>
+ * The lifecycle of pipelines is designed to allow a {@link Tube} to store various
+ * state in easily accessible fashion.
+ *
+ *
+ * <h3>Per-packet state</h3>
+ * <p>
+ * Any information that changes from a packet to packet should be
+ * stored in {@link Packet} (if such informaton is specific to your problem domain,
+ * then most likely {@link Packet#invocationProperties}.)
+ * This includes information like transport-specific headers.
+ *
+ * <h3>Per-thread state</h3>
+ * <p>
+ * Any expensive-to-create objects that are non-reentrant can be stored
+ * either in instance variables of a {@link Tube}, or a static {@link ThreadLocal}.
+ *
+ * <p>
+ * The first approach works, because {@link Tube} is
+ * non reentrant. When a tube is copied, new instances should be allocated
+ * so that two {@link Tube} instances don't share thread-unsafe resources.
+ *
+ * Similarly the second approach works, since {@link ThreadLocal} guarantees
+ * that each thread gets its own private copy.
+ *
+ * <p>
+ * The former is faster to access, and you need not worry about clean up.
+ * On the other hand, because there can be many more concurrent requests
+ * than # of threads, you may end up holding onto more resources than necessary.
+ *
+ * <p>
+ * This includes state like canonicalizers, JAXB unmarshallers,
+ * {@link SimpleDateFormat}, etc.
+ *
+ *
+ * <h3>Per-proxy/per-endpoint state</h3>
+ * <p>
+ * Information that is tied to a particular proxy/dispatch can be stored
+ * in a separate object that is referenced from a tube. When
+ * a new tube is copied, you can simply hand out a reference to the newly
+ * created one, so that all copied tubes refer to the same instance.
+ * See the following code as an example:
+ *
+ * <pre>
+ * class TubeImpl {
+ *   // this object stores per-proxy state
+ *   class DataStore {
+ *     int counter;
+ *   }
+ *
+ *   private DataStore ds;
+ *
+ *   // create a fresh new pipe
+ *   public TubeImpl(...) {
+ *     ....
+ *     ds = new DataStore();
+ *   }
+ *
+ *   // copy constructor
+ *   private TubeImpl(TubeImpl that, PipeCloner cloner) {
+ *     cloner.add(that,this);
+ *     ...
+ *     this.ds = that.ds;
+ *   }
+ *
+ *   public TubeImpl copy(PipeCloner pc) {
+ *     return new TubeImpl(this,pc);
+ *   }
+ * }
+ * </pre>
+ *
+ * <p>
+ * Note that access to such resource may need to be synchronized,
+ * since multiple copies of pipelines may execute concurrently.
+ *
+ *
+ *
+ * <h3>VM-wide state</h3>
+ * <p>
+ * <tt>static</tt> is always there for you to use.
+ *
+ *
+ *
+ * @see AbstractTubeImpl
+ * @see AbstractFilterTubeImpl
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public interface Tube {
+    /**
+     * Acts on a request and perform some protocol specific operation.
+     *
+     * TODO: exception handling semantics need more discussion
+     *
+     * @throws WebServiceException
+     *      On the server side, this signals an error condition where
+     *      a fault reply is in order (or the exception gets eaten by
+     *      the top-most transport {@link Adapter} if it's one-way.)
+     *      This frees each {@link Tube} from try/catching a
+     *      {@link WebServiceException} in every layer.
+     *
+     *      Note that this method is also allowed to return
+     *      {@link NextAction#returnWith(Packet)} with
+     *      a {@link Packet} that has a fault as the payload.
+     *
+     *      <p>
+     *      On the client side, the {@link WebServiceException} thrown
+     *      will be propagated all the way back to the calling client
+     *      applications. (The consequence of that is that if you are
+     *      a filtering {@link Tube}, you must not eat the exception
+     *      that was given to {@link #processException(Throwable)} .
+     *
+     * @throws RuntimeException
+     *      Other runtime exception thrown by this method must
+     *      be treated as a bug in the tube implementation,
+     *      and therefore should not be converted into a fault.
+     *      (Otherwise it becomes very difficult to debug implementation
+     *      problems.)
+     *
+     *      <p>
+     *      On the server side, this exception should be most likely
+     *      just logged. On the client-side it gets propagated to the
+     *      client application.
+     *
+     *      <p>
+     *      The consequence of this is that if a pipe calls
+     *      into an user application (such as {@link SOAPHandler}
+     *      or {@link LogicalHandler}), where a {@link RuntimeException}
+     *      is *not* a bug in the JAX-WS implementation, it must be catched
+     *      and wrapped into a {@link WebServiceException}.
+     *
+     * @param request
+     *      The packet that represents a request message.
+     *      If the packet has a non-null message, it must be a valid
+     *      unconsumed {@link Message}. This message represents the
+     *      SOAP message to be sent as a request.
+     *      <p>
+     *      The packet is also allowed to carry no message, which indicates
+     *      that this is an output-only request.
+     *      (that's called "solicit", right? - KK)
+     *
+     * @return
+     *      A {@link NextAction} object that represents the next action
+     *      to be taken by the JAX-WS runtime.
+     */
+    @NotNull NextAction processRequest(@NotNull Packet request);
+
+    /**
+     * Acts on a response and performs some protocol specific operation.
+     *
+     * <p>
+     * Once a {@link #processRequest(Packet)} is invoked, this method
+     * will be always invoked with the response, before this {@link Tube}
+     * processes another request.
+     *
+     * @param response
+     *      If the packet has a non-null message, it must be
+     *      a valid unconsumed {@link Message}. This message represents
+     *      a response to the request message passed to
+     *      {@link #processRequest(Packet)} earlier.
+     *      <p>
+     *      The packet is also allowed to carry no message, which indicates
+     *      that there was no response. This is used for things like
+     *      one-way message and/or one-way transports.
+     *
+     * TODO: exception handling semantics need more discussion
+     *
+     * @return
+     *      A {@link NextAction} object that represents the next action
+     *      to be taken by the JAX-WS runtime.
+     */
+    @NotNull NextAction processResponse(@NotNull Packet response);
+
+
+    /**
+     * Acts on a exception and performs some clean up operations.
+     *
+     * <p>
+     * If a {@link #processRequest(Packet)}, {@link #processResponse(Packet)},
+     * {@link #processException(Throwable)} throws an exception, this method
+     * will be always invoked on all the {@link Tube}s in the remaining
+     * {@link NextAction}s.
+     *
+     * <p>
+     * On the server side, the {@link Throwable} thrown will be propagated to the
+     * top-most transport. The transport converts the exception to fault reply or
+     * simply logs in case of one-way MEP. If you are a filtering {@link Tube} like
+     * {@link AbstractTubeImpl}, you don't have to override the implementation). On
+     * the other hand, any intermediate {@link Tube} may want to convert the exception
+     * to a fault message.
+     *
+     * <p>
+     * On the client side, the {@link Throwable} thrown
+     * will be propagated all the way back to the calling client
+     * applications. (The consequence of that is that if you are
+     * a filtering {@link Tube} like {@link AbstractTubeImpl}, you don't have to
+     * override the implementation)
+     *
+     * @param t
+     *
+     * @return
+     *      A {@link NextAction} object that represents the next action
+     *      to be taken by the JAX-WS runtime.
+     */
+    @NotNull NextAction processException(@NotNull Throwable t);
+
+    /**
+     * Invoked before the last copy of the pipeline is about to be discarded,
+     * to give {@link Tube}s a chance to clean up any resources.
+     *
+     * <p>
+     * This can be used to invoke {@link PreDestroy} lifecycle methods
+     * on user handler. The invocation of it is optional on the client side,
+     * but mandatory on the server side.
+     *
+     * <p>
+     * When multiple copies of pipelines are created, this method is called
+     * only on one of them.
+     *
+     * @throws WebServiceException
+     *      If the clean up fails, {@link WebServiceException} can be thrown.
+     *      This exception will be propagated to users (if this is client),
+     *      or recorded (if this is server.)
+     */
+    void preDestroy();
+
+    /**
+     * Creates an identical clone of this {@link Tube}.
+     *
+     * <p>
+     * This method creates an identical pipeline that can be used
+     * concurrently with this pipeline. When the caller of a pipeline
+     * is multi-threaded and need concurrent use of the same pipeline,
+     * it can do so by creating copies through this method.
+     *
+     * <h3>Implementation Note</h3>
+     * <p>
+     * It is the implementation's responsibility to call
+     * {@link TubeCloner#add(Tube,Tube)} to register the copied pipe
+     * with the original. This is required before you start copying
+     * the other {@link Tube} references you have, or else there's a
+     * risk of infinite recursion.
+     * <p>
+     * For most {@link Tube} implementations that delegate to another
+     * {@link Tube}, this method requires that you also copy the {@link Tube}
+     * that you delegate to.
+     * <p>
+     * For limited number of {@link Tube}s that do not maintain any
+     * thread unsafe resource, it is allowed to simply return <tt>this</tt>
+     * from this method (notice that even if you are stateless, if you
+     * got a delegating {@link Tube} and that one isn't stateless, you
+     * still have to copy yourself.)
+     *
+     * <p>
+     * Note that this method might be invoked by one thread while another
+     * thread is executing the other process method. See
+     * the {@link Codec#copy()} for more discussion about this.
+     *
+     * @param cloner
+     *      Use this object (in particular its {@link TubeCloner#copy(Tube)} method
+     *      to clone other pipe references you have
+     *      in your pipe. See {@link TubeCloner} for more discussion
+     *      about why.
+     *
+     * @return
+     *      always non-null {@link Tube}.
+     * @param cloner
+     */
+    Tube copy(TubeCloner cloner);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubeCloner.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubeCloner.java
new file mode 100644
index 0000000..0c4d24f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubeCloner.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Clones the whole pipeline.
+ *
+ * <p>
+ * Since {@link Tube}s may form an arbitrary directed graph, someone needs
+ * to keep track of isomorphism for a clone to happen correctly. This class
+ * serves that role.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class TubeCloner {
+    // Pipe to pipe, or tube to tube
+    protected final Map<Object,Object> master2copy = new HashMap<Object,Object>();
+
+    /*package*/ TubeCloner() {
+    }
+
+    /**
+     * Invoked by a client of a tube to clone the whole pipeline.
+     *
+     * <p>
+     * {@link Tube}s implementing the {@link Tube#copy(TubeCloner)} method
+     * shall use {@link #copy(Tube)} method.
+     *
+     * @param p
+     *      The entry point of a pipeline to be copied. must not be null.
+     * @return
+     *      The cloned pipeline. Always non-null.
+     */
+    public static Tube clone(Tube p) {
+        // we often want to downcast TubeCloner to PipeCloner,
+        // so let's create PipeCloner to make that possible
+        return new PipeCloner().copy(p);
+    }
+
+    /**
+     * Invoked by a {@link Tube#copy(TubeCloner)} implementation
+     * to copy a reference to another pipe.
+     *
+     * <p>
+     * This method is for {@link Tube} implementations, not for users.
+     *
+     * <p>
+     * If the given tube is already copied for this cloning episode,
+     * this method simply returns that reference. Otherwise it copies
+     * a tube, make a note, and returns a copied tube. This additional
+     * step ensures that a graph is cloned isomorphically correctly.
+     *
+     * <p>
+     * (Think about what happens when a graph is A->B, A->C, B->D, and C->D
+     * if you don't have this step.)
+     *
+     * @param t
+     *      The tube to be copied.
+     * @return
+     *      The cloned tube. Always non-null.
+     */
+    public <T extends Tube> T copy(T t) {
+        Tube r = (Tube)master2copy.get(t);
+        if(r==null) {
+            r = t.copy(this);
+            // the pipe must puts its copy to the map by itself
+            assert master2copy.get(t)==r : "the tube must call the add(...) method to register itself before start copying other pipes, but "+t +" hasn't done so";
+        }
+        return (T)r;
+    }
+
+    /**
+     * This method must be called from within the copy constructor
+     * to notify that the copy was created.
+     *
+     * <p>
+     * When your pipe has references to other pipes,
+     * it's particularly important to call this method
+     * before you start copying the pipes you refer to,
+     * or else there's a chance of inifinite loop.
+     */
+    public void add(Tube original, Tube copy) {
+        assert !master2copy.containsKey(original);
+        assert original!=null && copy!=null;
+        master2copy.put(original,copy);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssembler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssembler.java
new file mode 100644
index 0000000..b05c245
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssembler.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+
+/**
+ * Creates a tubeline.
+ *
+ * <p>
+ * This pluggability layer enables the upper layer to
+ * control exactly how the tubeline is composed.
+ *
+ * <p>
+ * JAX-WS is going to have its own default implementation
+ * when used all by itself, but it can be substituted by
+ * other implementations.
+ *
+ * <p>
+ * See {@link TubelineAssemblerFactory} for how {@link TubelineAssembler}s
+ * are located.
+ *
+ *
+ * @see com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public interface TubelineAssembler {
+    /**
+     * Creates a new tubeline for clients.
+     *
+     * <p>
+     * When a JAX-WS client creates a proxy or a {@link javax.xml.ws.Dispatch} from
+     * a {@link javax.xml.ws.Service}, JAX-WS runtime internally uses this method
+     * to create a new tubeline as a part of the initilization.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the tubeline to be assembled.
+     *
+     * @return
+     *      non-null freshly created tubeline.
+     *
+     * @throws javax.xml.ws.WebServiceException
+     *      if there's any configuration error that prevents the
+     *      tubeline from being constructed. This exception will be
+     *      propagated into the application, so it must have
+     *      a descriptive error.
+     */
+    @NotNull Tube createClient(@NotNull ClientTubeAssemblerContext context);
+
+    /**
+     * Creates a new tubeline for servers.
+     *
+     * <p>
+     * When a JAX-WS server deploys a new endpoint, it internally
+     * uses this method to create a new tubeline as a part of the
+     * initialization.
+     *
+     * <p>
+     * Note that this method is called only once to set up a
+     * 'master tubeline', and it gets {@link Tube#copy(TubeCloner) copied}
+     * from it.
+     *
+     * @param context
+     *      Object that captures various contextual information
+     *      that can be used to determine the tubeline to be assembled.
+     *
+     * @return
+     *      non-null freshly created tubeline.
+     *
+     * @throws javax.xml.ws.WebServiceException
+     *      if there's any configuration error that prevents the
+     *      tubeline from being constructed. This exception will be
+     *      propagated into the container, so it must have
+     *      a descriptive error.
+     *
+     */
+    @NotNull Tube createServer(@NotNull ServerTubeAssemblerContext context);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssemblerFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssemblerFactory.java
new file mode 100644
index 0000000..22f2678
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TubelineAssemblerFactory.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.pipe.helper.PipeAdapter;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.xml.internal.ws.util.pipe.StandaloneTubeAssembler;
+
+import java.util.logging.Logger;
+
+/**
+ * Creates {@link TubelineAssembler}.
+ * <p/>
+ * <p/>
+ * To create a tubeline,
+ * the JAX-WS runtime locates {@link TubelineAssemblerFactory}s through
+ * the <tt>META-INF/services/com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory</tt> files.
+ * Factories found are checked to see if it supports the given binding ID one by one,
+ * and the first valid {@link TubelineAssembler} returned will be used to create
+ * a tubeline.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class TubelineAssemblerFactory {
+    /**
+     * Creates a {@link TubelineAssembler} applicable for the given binding ID.
+     *
+     * @param bindingId The binding ID for which a tubeline will be created,
+     *                  such as {@link javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING}.
+     *                  Must not be null.
+     * @return null if this factory doesn't recognize the given binding ID.
+     */
+    public abstract TubelineAssembler doCreate(BindingID bindingId);
+
+    /**
+     * @deprecated
+     *      Use {@link #create(ClassLoader, BindingID, Container)}
+     */
+    public static TubelineAssembler create(ClassLoader classLoader, BindingID bindingId) {
+        return create(classLoader,bindingId,null);
+    }
+
+    /**
+     * Locates {@link TubelineAssemblerFactory}s and create
+     * a suitable {@link TubelineAssembler}.
+     *
+     * @param bindingId The binding ID string for which the new {@link TubelineAssembler}
+     *                  is created. Must not be null.
+     * @param container
+     *      if specified, the container is given a chance to specify a {@link TubelineAssembler}
+     *      instance. This parameter should be always given on the server, but can be null.
+     * @return Always non-null, since we fall back to our default {@link TubelineAssembler}.
+     */
+    public static TubelineAssembler create(ClassLoader classLoader, BindingID bindingId, @Nullable Container container) {
+
+        if(container!=null) {
+            // first allow the container to control pipeline for individual endpoint.
+            TubelineAssemblerFactory taf = container.getSPI(TubelineAssemblerFactory.class);
+            if(taf!=null) {
+                TubelineAssembler a = taf.doCreate(bindingId);
+                if(a!=null)
+                    return a;
+            }
+        }
+
+        for (TubelineAssemblerFactory factory : ServiceFinder.find(TubelineAssemblerFactory.class, classLoader)) {
+            TubelineAssembler assembler = factory.doCreate(bindingId);
+            if (assembler != null) {
+                TubelineAssemblerFactory.logger.fine(factory.getClass() + " successfully created " + assembler);
+                return assembler;
+            }
+        }
+
+        // See if there is a PipelineAssembler out there and use it for compatibility.
+        for (PipelineAssemblerFactory factory : ServiceFinder.find(PipelineAssemblerFactory.class,classLoader)) {
+            PipelineAssembler assembler = factory.doCreate(bindingId);
+            if(assembler!=null) {
+                logger.fine(factory.getClass()+" successfully created "+assembler);
+                return new TubelineAssemblerAdapter(assembler);
+            }
+        }
+
+        // default binding IDs that are known
+        return new StandaloneTubeAssembler();
+    }
+
+    private static class TubelineAssemblerAdapter implements TubelineAssembler {
+        private PipelineAssembler assembler;
+
+        TubelineAssemblerAdapter(PipelineAssembler assembler) {
+            this.assembler = assembler;
+        }
+
+        public @NotNull Tube createClient(@NotNull ClientTubeAssemblerContext context) {
+            ClientPipeAssemblerContext ctxt = new ClientPipeAssemblerContext(
+                    context.getAddress(), context.getWsdlModel(), context.getService(),
+                    context.getBinding(), context.getContainer());
+            return PipeAdapter.adapt(assembler.createClient(ctxt));
+        }
+
+        public @NotNull Tube createServer(@NotNull ServerTubeAssemblerContext context) {
+            return PipeAdapter.adapt(assembler.createServer((ServerPipeAssemblerContext) context));
+        }
+    }
+
+    private static final Logger logger = Logger.getLogger(TubelineAssemblerFactory.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterPipeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterPipeImpl.java
new file mode 100644
index 0000000..10a9f7a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterPipeImpl.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.PipeCloner;
+import com.sun.xml.internal.ws.api.message.Packet;
+
+/**
+ * Default implementation of {@link Pipe} that is used as a filter.
+ *
+ * <p>
+ * A filter pipe works on a {@link Packet}, then pass it onto the next pipe.
+ *
+ *
+ * <h2>How do I implement a filter?</h2>
+ * <p>
+ * Filter {@link Pipe}s are ideal for those components that wish to
+ * do some of the followings:
+ *
+ * <dl>
+ * <dt><b>
+ * To read an incoming message and perform some work before the
+ * application (or more precisely the next pipe sees it)
+ * </b>
+ * <dd>
+ * Implement the {@link #process} method and do some processing before
+ * you pass the packet to the next pipe:
+ * <pre>
+ * process(request) {
+ *   doSomethingWith(request);
+ *   return next.process(request);
+ * }
+ * </pre>
+ *
+ *
+ * <dt><b>
+ * To intercept an incoming message and prevent the next pipe from seeing it.
+ * </b>
+ * <dd>
+ * Implement the {@link #process} method and do some processing,
+ * then do NOT pass the request onto the next pipe.
+ * <pre>
+ * process(request) {
+ *   if(isSomethingWrongWith(request))
+ *     return createErrorMessage();
+ *   else
+ *     return next.proces(request);
+ * }
+ * </pre>
+ *
+ * <dt><b>
+ * To post process a reply and possibly modify a message:
+ * </b>
+ * <dd>
+ * Implement the {@link #process} method and do some processing,
+ * then do NOT pass the request onto the next pipe.
+ * <pre>
+ * process(request) {
+ *   op = request.getMessage().getOperation();
+ *   reply = next.proces(request);
+ *   if(op is something I care) {
+ *     reply = playWith(reply);
+ *   }
+ *   return reply;
+ * }
+ * </pre>
+ *
+ * </dl>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractFilterPipeImpl extends AbstractPipeImpl {
+    /**
+     * Next pipe to call.
+     */
+    protected final Pipe next;
+
+    protected AbstractFilterPipeImpl(Pipe next) {
+        this.next = next;
+        assert next!=null;
+    }
+
+    protected AbstractFilterPipeImpl(AbstractFilterPipeImpl that, PipeCloner cloner) {
+        super(that, cloner);
+        this.next = cloner.copy(that.next);
+        assert next!=null;
+    }
+
+    public Packet process(Packet packet) {
+        return next.process(packet);
+    }
+
+    @Override
+    public void preDestroy() {
+        next.preDestroy();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java
new file mode 100644
index 0000000..3b8ed52
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+
+/**
+ * Convenient default implementation for filtering {@link Tube}.
+ *
+ * <p>
+ * In this prototype, this is not that convenient, but in the real production
+ * code where we have {@code preDestroy()} and {@code clone()}, this
+ * is fairly handy.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractFilterTubeImpl extends AbstractTubeImpl {
+    protected final Tube next;
+
+    protected AbstractFilterTubeImpl(Tube next) {
+        this.next = next;
+    }
+
+    protected AbstractFilterTubeImpl(AbstractFilterTubeImpl that, TubeCloner cloner) {
+        super(that, cloner);
+        this.next = cloner.copy(that.next);
+    }
+
+    /**
+     * Default no-op implementation.
+     */
+    public @NotNull NextAction processRequest(Packet request) {
+        return doInvoke(next,request);
+    }
+
+    /**
+     * Default no-op implementation.
+     */
+    public @NotNull NextAction processResponse(Packet response) {
+        return doReturnWith(response);
+    }
+
+    /**
+     * Default no-op implementation.
+     */
+    public @NotNull NextAction processException(Throwable t) {
+        return doThrow(t);
+    }
+
+    public void preDestroy() {
+        next.preDestroy();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractPipeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractPipeImpl.java
new file mode 100644
index 0000000..99bbc17
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractPipeImpl.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.PipeCloner;
+
+/**
+ * Partial default implementation of {@link Pipe}.
+ *
+ * <p>
+ * To be shielded from potentail changes in JAX-WS,
+ * please consider extending from this class, instead
+ * of implementing {@link Pipe} directly.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractPipeImpl implements Pipe {
+
+    /**
+     * Do-nothing constructor.
+     */
+    protected AbstractPipeImpl() {
+    }
+
+    /**
+     * Basis for the copy constructor.
+     *
+     * <p>
+     * This registers the newly created {@link Pipe} with the {@link PipeCloner}
+     * through {@link PipeCloner#add(Pipe, Pipe)}.
+     */
+    protected AbstractPipeImpl(Pipe that, PipeCloner cloner) {
+        cloner.add(that,this);
+    }
+
+    public void preDestroy() {
+        // noop
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java
new file mode 100644
index 0000000..32a4cc7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.PipeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+
+/**
+ * Base class for {@link Tube} implementation.
+ *
+ * <p>
+ * This can be also used as a {@link Pipe}, and thus effectively
+ * making every {@link Tube} usable as a {@link Pipe}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractTubeImpl implements Tube, Pipe {
+
+    /**
+     * Default constructor.
+     */
+    protected AbstractTubeImpl() {
+    }
+
+    /**
+     * Copy constructor.
+     */
+    protected AbstractTubeImpl(AbstractTubeImpl that, TubeCloner cloner) {
+        cloner.add(that,this);
+    }
+
+    protected final NextAction doInvoke(Tube next, Packet packet) {
+        NextAction na = new NextAction();
+        na.invoke(next,packet);
+        return na;
+    }
+
+    protected final NextAction doInvokeAndForget(Tube next, Packet packet) {
+        NextAction na = new NextAction();
+        na.invokeAndForget(next,packet);
+        return na;
+    }
+
+    protected final NextAction doReturnWith(Packet response) {
+        NextAction na = new NextAction();
+        na.returnWith(response);
+        return na;
+    }
+
+    protected final NextAction doSuspend() {
+        NextAction na = new NextAction();
+        na.suspend();
+        return na;
+    }
+
+    protected final NextAction doThrow(Throwable t) {
+        NextAction na = new NextAction();
+        na.throwException(t);
+        return na;
+    }
+
+    /**
+     * "Dual stack" compatibility mechanism.
+     * Allows {@link Tube} to be invoked from a {@link Pipe}.
+     */
+    public Packet process(Packet p) {
+        return Fiber.current().runSync(this,p);
+    }
+
+    /**
+     * Needs to be implemented by the derived class, but we can't make it abstract
+     * without upsetting javac.
+     */
+    public final AbstractTubeImpl copy(PipeCloner cloner) {
+        return copy((TubeCloner)cloner);
+    }
+
+    public abstract AbstractTubeImpl copy(TubeCloner cloner);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/PipeAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/PipeAdapter.java
new file mode 100644
index 0000000..38b3e1f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/PipeAdapter.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.PipeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+
+/**
+ * {@link Tube} that invokes {@link Pipe}.
+ *
+ * <p>
+ * This can be used to make a {@link Pipe} look like a {@link Tube}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class PipeAdapter extends AbstractTubeImpl {
+    private final Pipe next;
+
+    public static Tube adapt(Pipe p) {
+        if (p instanceof Tube) {
+            return (Tube) p;
+        } else {
+            return new PipeAdapter(p);
+        }
+    }
+
+    public static Pipe adapt(Tube p) {
+        if (p instanceof Pipe) {
+            return (Pipe) p;
+        } else {
+            class TubeAdapter extends AbstractPipeImpl {
+                private final Tube t;
+
+                public TubeAdapter(Tube t) {
+                    this.t = t;
+                }
+
+                private TubeAdapter(TubeAdapter that, PipeCloner cloner) {
+                    super(that, cloner);
+                    this.t = cloner.copy(that.t);
+                }
+
+                public Packet process(Packet request) {
+                    return Fiber.current().runSync(t,request);
+                }
+
+                public Pipe copy(PipeCloner cloner) {
+                    return new TubeAdapter(this,cloner);
+                }
+            }
+
+            return new TubeAdapter(p);
+        }
+    }
+
+
+    private PipeAdapter(Pipe next) {
+        this.next = next;
+    }
+
+    /**
+     * Copy constructor
+     */
+    private PipeAdapter(PipeAdapter that, TubeCloner cloner) {
+        super(that,cloner);
+        this.next = ((PipeCloner)cloner).copy(that.next);
+    }
+
+    /**
+     * Uses the current fiber and runs the whole pipe to the completion
+     * (meaning everything from now on will run synchronously.)
+     */
+    public @NotNull NextAction processRequest(@NotNull Packet p) {
+        return doReturnWith(next.process(p));
+    }
+
+    public @NotNull NextAction processResponse(@NotNull Packet p) {
+        throw new IllegalStateException();
+    }
+
+    @NotNull
+    public NextAction processException(@NotNull Throwable t) {
+        throw new IllegalStateException();
+    }
+
+    public void preDestroy() {
+        next.preDestroy();
+    }
+
+    public PipeAdapter copy(TubeCloner cloner) {
+        return new PipeAdapter(this,cloner);
+    }
+
+    public String toString() {
+        return super.toString()+"["+next.toString()+"]";
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/package-info.java
new file mode 100644
index 0000000..189550b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Default partial implementations of {@link Pipe}.
+ *
+ * <p>
+ * This is intended to be useful for projects building on
+ * top of the JAX-WS RI.
+ */
+package com.sun.xml.internal.ws.api.pipe.helper;
+
+import com.sun.xml.internal.ws.api.pipe.Pipe;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/package-info.java
new file mode 100644
index 0000000..cf41160
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * {@link com.sun.xml.internal.ws.api.pipe.Pipe} and related abstractions.
+ */
+package com.sun.xml.internal.ws.api.pipe;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java
new file mode 100644
index 0000000..8f936f8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.util.Pool;
+
+import java.io.IOException;
+
+/**
+ * Partial server side async transport implementation. It manages pooling of
+ * {@link Codec} and other details.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class AbstractServerAsyncTransport<T> {
+
+    private final WSEndpoint endpoint;
+    private final CodecPool codecPool;
+
+    /**
+     * {@link WSEndpoint#setExecutor} should be called before creating the
+     * transport
+     *
+     * @param endpoint webservices requests are directed towards this endpoint
+     */
+    public AbstractServerAsyncTransport(WSEndpoint endpoint) {
+        this.endpoint = endpoint;
+        codecPool = new CodecPool(endpoint);
+    }
+
+    /**
+     * decodes the transport data to Packet
+     *
+     * @param connection that carries the web service request
+     * @param codec for encoding/decoding {@link Message}
+     * @return decoded {@link Packet}
+     * @throws IOException if an i/o error happens while encoding/decoding
+     */
+    protected Packet decodePacket(T connection, @NotNull Codec codec) throws IOException {
+        Packet packet = new Packet();
+        packet.acceptableMimeTypes = getAcceptableMimeTypes(connection);
+        packet.addSatellite(getPropertySet(connection));
+        packet.transportBackChannel = getTransportBackChannel(connection);
+        return packet;
+    }
+
+    /**
+     * Encodes the {@link Packet} to infoset and writes on the connection.
+     *
+     * @param connection that carries the web service request
+     * @param packet that needs to encoded to infoset
+     * @param codec that does the encoding of Packet
+     * @throws IOException if an i/o error happens while encoding/decoding
+     */
+    protected abstract void encodePacket(T connection, @NotNull Packet packet, @NotNull Codec codec) throws IOException;
+
+    /**
+     * If the request has Accept header, return that value
+     *
+     * @param connection that carries the web service request
+     * @return Accept MIME types
+     */
+    protected abstract @Nullable String getAcceptableMimeTypes(T connection);
+
+    /**
+     * {@link TransportBackChannel} used by jax-ws runtime to close the connection
+     * while the processing of the request is still continuing. In oneway HTTP case, a
+     * response code needs to be sent before invoking the endpoint.
+     *
+     * @param connection that carries the web service request
+     * @return TransportBackChannel instance using the connection
+     */
+    protected abstract @Nullable TransportBackChannel getTransportBackChannel(T connection);
+
+    /**
+     * If there are any properties associated with the connection, those will
+     * be added to {@link Packet}
+     *
+     * @param connection that carries the web service request
+     * @return {@link PropertySet} for the connection
+     */
+    protected abstract @NotNull PropertySet getPropertySet(T connection);
+
+    /**
+     * Return a {@link WebServiceContextDelegate} using the underlying connection.
+     *
+     * @param connection that carries the web service request
+     * @return non-null WebServiceContextDelegate instance
+     */
+    protected abstract @NotNull WebServiceContextDelegate getWebServiceContextDelegate(T connection);
+
+    /**
+     * Reads and decodes infoset from the connection and invokes the endpoints. The
+     * response is encoded and written to the connection. The response could be
+     * written using a different thread.
+     *
+     * @param connection that carries the web service request
+     * @throws IOException if an i/o error happens while encoding/decoding
+     */
+    protected void handle(final T connection) throws IOException {
+        final Codec codec = codecPool.take();
+        Packet request = decodePacket(connection, codec);
+        if (!request.getMessage().isFault()) {
+            endpoint.schedule(request, new WSEndpoint.CompletionCallback() {
+                public void onCompletion(@NotNull Packet response) {
+                    try {
+                        encodePacket(connection, response, codec);
+                    } catch(IOException ioe) {
+                        ioe.printStackTrace();
+                    }
+                    codecPool.recycle(codec);
+                }
+            });
+        }
+    }
+
+    private static final class CodecPool extends Pool<Codec> {
+        WSEndpoint endpoint;
+
+        CodecPool(WSEndpoint endpoint) {
+            this. endpoint = endpoint;
+        }
+
+        protected Codec create() {
+            return endpoint.createCodec();
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Adapter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Adapter.java
new file mode 100644
index 0000000..a050156
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Adapter.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.WSEndpoint.PipeHead;
+import com.sun.xml.internal.ws.util.Pool;
+
+/**
+ * Receives incoming messages from a transport (such as HTTP, JMS, etc)
+ * in a transport specific way, and delivers it to {@link WSEndpoint.PipeHead#process}.
+ *
+ * <p>
+ * Since this class mostly concerns itself with converting a
+ * transport-specific message representation to a {@link Packet},
+ * the name is the "adapter".
+ *
+ * <p>
+ * The purpose of this class is twofolds:
+ *
+ * <ol>
+ * <li>
+ * To hide the logic of converting a transport-specific connection
+ * to a {@link Packet} and do the other way around.
+ *
+ * <li>
+ * To manage thread-unsafe resources, such as {@link WSEndpoint.PipeHead},
+ * and {@link Codec}.
+ * </ol>
+ *
+ * <p>
+ * {@link Adapter}s are extended to work with each kind of transport,
+ * and therefore {@link Adapter} class itself is not all that
+ * useful by itself --- it merely provides a design template
+ * that can be followed.
+ *
+ * <p>
+ * For managing resources, an adapter uses an object called {@link Toolkit}
+ * (think of it as a tray full of tools that a dentist uses ---
+ * trays are identical, but each patient has to get one. You have
+ * a pool of them and you assign it to a patient.)
+ *
+ * {@link Adapter.Toolkit} can be extended by derived classes.
+ * That actual type is the {@code TK} type parameter this class takes.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Adapter<TK extends Adapter.Toolkit> {
+
+    protected final WSEndpoint<?> endpoint;
+
+    /**
+     * Object that groups all thread-unsafe resources.
+     */
+    public class Toolkit {
+        /**
+         * For encoding/decoding infoset to/from the byte stream.
+         */
+        public final Codec codec;
+        /**
+         * This object from {@link WSEndpoint} serves the request.
+         */
+        public final PipeHead head;
+
+        public Toolkit() {
+            this.codec = endpoint.createCodec();
+            this.head = endpoint.createPipeHead();
+        }
+    }
+
+    /**
+     * Pool of {@link Toolkit}s.
+     */
+    protected final Pool<TK> pool = new Pool<TK>() {
+        protected TK create() {
+            return createToolkit();
+        }
+    };
+
+    /**
+     * Creates an {@link Adapter} that delivers
+     * messages to the given endpoint.
+     */
+    protected Adapter(WSEndpoint endpoint) {
+        assert endpoint!=null;
+        this.endpoint = endpoint;
+    }
+
+    /**
+     * Gets the endpoint that this {@link Adapter} is serving.
+     *
+     * @return
+     *      always non-null.
+     */
+    public WSEndpoint<?> getEndpoint() {
+        return endpoint;
+    }
+
+    /**
+     * Creates a {@link Toolkit} instance.
+     *
+     * <p>
+     * If the derived class doesn't have to add any per-thread state
+     * to {@link Toolkit}, simply implement this as {@code new Toolkit()}.
+     */
+    protected abstract TK createToolkit();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java
new file mode 100644
index 0000000..288076b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceContext;
+import java.util.concurrent.Executor;
+
+/**
+ * Asynchronous version of {@link Provider}.
+ *
+ * <p>
+ * Applications that use the JAX-WS RI can implement this interface instead of
+ * {@link Provider} to implement asynchronous web services (AWS.) AWS enables
+ * applications to perform operations with long latency without blocking a thread,
+ * and thus particularly suitable for highly scalable service implementation,
+ * at the expesnce of implementation complexity.
+ *
+ * <h2>Programming Model</h2>
+ * <p>
+ * Whenever a new reuqest arrives, the JAX-WS RI invokes the {@link #invoke} method
+ * to notify the application. Normally, the application then schedules an execution
+ * of this request, and exit from this method immediately (the point of AWS is not
+ * to use this calling thread for request processing.)
+ *
+ * <p>
+ * Unlike the synchronous version, which requires the response to be given as the return value,
+ * with AWS the JAX-WS RI will keep the connection with client open, until the application
+ * eventually notifies the JAX-WS RI via {@link AsyncProviderCallback}. When that
+ * happens that causes the JAX-WS RI to send back a response to the client.
+ *
+ * <p>
+ * The following code shows a very simple AWS example:
+ *
+ * <pre>
+ * &#64;WebService
+ * class MyAsyncEchoService implements AsyncProvider&lt;Source> {
+ *     private static final {@link Executor} exec = ...;
+ *
+ *     public void invoke( final Source request, final AsyncProviderCallback&lt;Source> callback, final WebServiceContext context) {
+ *         exec.execute(new {@link Runnable}() {
+ *             public void run() {
+ *                 Thread.sleep(1000);     // kill time.
+ *                 callback.send(request); // just echo back
+ *             }
+ *         });
+ *     }
+ * }
+ * </pre>
+ *
+ * <p>
+ * Please also check the {@link Provider} and its programming model for general
+ * provider programming model.
+ *
+ *
+ * <h2>WebServiceContext</h2>
+ * <p>
+ * In synchronous web services, the injected {@link WebServiceContext} instance uses
+ * the calling {@link Thread} to determine which request it should return information about.
+ * This no longer works with AWS, as you may need to call {@link WebServiceContext}
+ * much later, possibly from entirely different thread.
+ *
+ * <p>
+ * For this reason, {@link AsyncProvider} passes in {@link WebServiceContext} as
+ * a parameter. This object remains usable until you invoke {@link AsyncProviderCallback},
+ * and it can be invoked from any thread, even concurrently. AWS must not use the injected
+ * {@link WebServiceContext}, as its behavior is undefined.
+ *
+ * @see Provider
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ * @since 2.1
+ */
+public interface AsyncProvider<T> {
+    /**
+     * Schedules an execution of a request.
+     *
+     * @param request
+     *      Represents the request message or payload.
+     * @param callback
+     *      Application must notify this callback interface when the processing
+     *      of a request is complete.
+     * @param context
+     *      The web service context instance that can be used to retrieve
+     *      context information about the given request.
+     */
+    public void invoke(
+        @NotNull T request,
+        @NotNull AsyncProviderCallback<T> callback,
+        @NotNull WebServiceContext context);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProviderCallback.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProviderCallback.java
new file mode 100644
index 0000000..2275283
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProviderCallback.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+/**
+ * Callback interface to signal JAX-WS RI that the processing of an asynchronous request is complete.
+ *
+ * <p>
+ * The application is responsible for invoking one of the two defined methods to
+ * indicate the result of the request processing.
+ *
+ * <p>
+ * Both methods will return immediately, and the JAX-WS RI will
+ * send out an actual response at some later point.
+ *
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ * @since 2.1
+ * @see AsyncProvider
+ */
+public interface AsyncProviderCallback<T> {
+    /**
+     * Indicates that a request was processed successfully.
+     *
+     * @param response
+     *      Represents an object to be sent back to the client
+     *      as a response. To indicate one-way, response needs to be null
+     */
+    void send(@Nullable T response);
+
+    /**
+     * Indicates that an error had occured while processing a request.
+     *
+     * @param t
+     *      The error is propagated to the client. For example, if this is
+     *      a SOAP-based web service, the server will send back a SOAP fault.
+     */
+    void sendError(@NotNull Throwable t);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java
new file mode 100644
index 0000000..2eb9cd7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+
+import java.net.URI;
+
+/**
+ * Represents the {@link WSEndpoint} bound to a particular transport.
+ *
+ * @see Module#getBoundEndpoints()
+ * @author Kohsuke Kawaguchi
+ */
+public interface BoundEndpoint {
+    /**
+     * The endpoint that was bound.
+     *
+     * <p>
+     * Multiple {@link BoundEndpoint}s may point to the same {@link WSEndpoint},
+     * if it's bound to multiple transports.
+     */
+    @NotNull WSEndpoint getEndpoint();
+
+    /**
+     * The address of the bound endpoint.
+     *
+     * <p>
+     * For example, if this endpoint is bound to a servlet endpoint
+     * "http://foobar/myapp/myservice", then this method should
+     * return that address.
+     */
+    @NotNull URI getAddress();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Container.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Container.java
new file mode 100644
index 0000000..37baf8b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Container.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+/**
+ * Root of the SPI implemented by the container
+ * (such as application server.)
+ *
+ * <p>
+ * Often technologies that are built on top of JAX-WS
+ * (such as Tango) needs to negotiate private contracts between
+ * them and the container. This interface allows such technologies
+ * to query the negotiated SPI by using the {@link #getSPI(Class)}.
+ *
+ * <p>
+ * For example, if a security pipe needs to get some information
+ * from a container, they can do the following:
+ * <ol>
+ *  <li>Negotiate an interface with the container and define it.
+ *      (let's call it <tt>ContainerSecuritySPI</tt>.)
+ *  <li>The container will implement <tt>ContainerSecuritySPI</tt>.
+ *  <li>At the runtime, a security pipe gets
+ *      {@link WSEndpoint} and then to {@link Container}.
+ *  <li>It calls <tt>container.getSPI(ContainerSecuritySPI.class)</tt>
+ *  <li>The container returns an instance of <tt>ContainerSecuritySPI</tt>.
+ *  <li>The security pipe talks to the container through this SPI.
+ * </ol>
+ *
+ * <p>
+ * This protects JAX-WS from worrying about the details of such contracts,
+ * while still providing the necessary service of hooking up those parties.
+ *
+ * <p>
+ * Technologies that run inside JAX-WS server runtime can access this object through
+ * {@link WSEndpoint#getContainer()}. In the client runtime, it can be accessed from
+ * {@link ContainerResolver#getContainer()}
+ *
+ * @author Kohsuke Kawaguchi
+ * @see WSEndpoint
+ */
+public abstract class Container {
+    /**
+     * For derived classes.
+     */
+    protected Container() {
+    }
+
+    /**
+     * Gets the specified SPI.
+     *
+     * <p>
+     * This method works as a kind of directory service
+     * for SPIs between technologies on top of JAX-WS
+     * and the container.
+     *
+     * @param spiType
+     *      Always non-null.
+     *
+     * @return
+     *      null if such an SPI is not implemented by this container.
+     */
+    public abstract <T> T getSPI(Class<T> spiType);
+
+
+    /**
+     * Constant that represents a "no {@link Container}",
+     * which always returns null from {@link #getSPI(Class)}.
+     */
+    public static final Container NONE = new Container() {
+        public <T> T getSPI(Class<T> spiType) {
+            return null;
+        }
+    };
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ContainerResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ContainerResolver.java
new file mode 100644
index 0000000..f00ac38
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ContainerResolver.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+
+/**
+ * This class determines an instance of {@link Container} for the runtime.
+ * It applies for both server and client runtimes(for e.g in Servlet could
+ * be accessing a Web Service). Always call {@link #setInstance} when the
+ * application's environment is initailized and a Container instance should
+ * be associated with an application.
+ *
+ * A client that is invoking a web service may be running in a
+ * container(for e.g servlet). T
+ *
+ * <p>
+ * ContainerResolver uses a static field to keep the instance of the resolver object.
+ * Typically appserver may set its custom container resolver using the static method
+ * {@link #setInstance(ContainerResolver)}
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class ContainerResolver {
+
+    private static final ContainerResolver NONE = new ContainerResolver() {
+        public Container getContainer() {
+            return Container.NONE;
+        }
+    };
+
+    private static volatile ContainerResolver theResolver = NONE;
+
+    /**
+     * Sets the custom container resolver which can be used to get client's
+     * {@link Container}.
+     *
+     * @param resolver container resolver
+     */
+    public static void setInstance(ContainerResolver resolver) {
+        if(resolver==null)
+            resolver = NONE;
+        theResolver = resolver;
+    }
+
+    /**
+     * Returns the container resolver which can be used to get client's {@link Container}.
+     *
+     * @return container resolver instance
+     */
+    public static @NotNull ContainerResolver getInstance() {
+        return theResolver;
+    }
+
+    /**
+     * Returns the default container resolver which can be used to get {@link Container}.
+     *
+     * @return default container resolver
+     */
+    public static ContainerResolver getDefault() {
+        return NONE;
+    }
+
+    /**
+     * Returns the {@link Container} context in which client is running.
+     *
+     * @return container instance for the client
+     */
+    public abstract @NotNull Container getContainer();
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/DocumentAddressResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/DocumentAddressResolver.java
new file mode 100644
index 0000000..d4387ea
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/DocumentAddressResolver.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+/**
+ * Resolves relative references among {@link SDDocument}s.
+ *
+ * <p>
+ * This interface is implemented by the caller of
+ * {@link SDDocument#writeTo} method so
+ * that the {@link SDDocument} can correctly produce references
+ * to other documents.
+ *
+ * <p>
+ * This mechanism allows the user of {@link WSEndpoint} to
+ * assign logical URLs to each {@link SDDocument} (which is often
+ * necessarily done in a transport-dependent way), and then
+ * serve description documents.
+ *
+ *
+ *
+ * <h2>Usage Example 1</h2>
+ * <p>
+ * HTTP servlet transport chose to expose those metadata documents
+ * to HTTP GET requests where each {@link SDDocument} is identified
+ * by a simple query string "?<i>ID</i>". (HTTP servlet transport
+ * assigns such IDs by itself.)
+ *
+ * <p>
+ * In this nameing scheme, when {@link SDDocument} X refers to
+ * {@link SDDocument} Y, it can put a reference as "?<i>IDofY</i>".
+ * By implementing {@link DocumentAddressResolver} it can do so.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface DocumentAddressResolver {
+    /**
+     * Produces a relative reference from one document to another.
+     *
+     * @param current
+     *      The document that is being generated.
+     * @param referenced
+     *      The document that is referenced.
+     * @return
+     *      The reference to be put inside {@code current} to refer to
+     *      {@code referenced}. This can be a relative URL as well as
+     *      an absolute. If null is returned, then the {@link SDDocument}
+     *      will produce a "implicit reference" (for example, &lt;xs:import>
+     *      without the @schemaLocation attribute, etc).
+     */
+    @Nullable String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/EndpointAwareCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/EndpointAwareCodec.java
new file mode 100644
index 0000000..650ade9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/EndpointAwareCodec.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+
+/**
+ * Implemented by {@link Codec}s that want to have access to
+ * {@link WSEndpoint} object.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1.1
+ */
+public interface EndpointAwareCodec extends Codec {
+    /**
+     * Called by the {@linK WSEndpoint} implementation
+     * when the codec is associated with an endpoint.
+     */
+    void setEndpoint(@NotNull WSEndpoint endpoint);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java
new file mode 100644
index 0000000..9da551e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.resources.WsservletMessages;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.server.SingletonResolver;
+
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Determines the instance that serves
+ * the given request packet.
+ *
+ * <p>
+ * The JAX-WS spec always use a singleton instance
+ * to serve all the requests, but this hook provides
+ * a convenient way to route messages to a proper receiver.
+ *
+ * <p>
+ * Externally, an instance of {@link InstanceResolver} is
+ * associated with {@link WSEndpoint}.
+ *
+ * <h2>Possible Uses</h2>
+ * <p>
+ * One can use WS-Addressing message properties to
+ * decide which instance to deliver a message. This
+ * would be an important building block for a stateful
+ * web services.
+ *
+ * <p>
+ * One can associate an instance of a service
+ * with a specific WS-RM session.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class InstanceResolver<T> {
+    /**
+     * Decides which instance of 'T' serves the given request message.
+     *
+     * <p>
+     * This method is called concurrently by multiple threads.
+     * It is also on a criticail path that affects the performance.
+     * A good implementation should try to avoid any synchronization,
+     * and should minimize the amount of work as much as possible.
+     *
+     * @param request
+     *      Always non-null. Represents the request message to be served.
+     *      The caller may not consume the {@link Message}.
+     */
+    public abstract @NotNull T resolve(Packet request);
+
+    /**
+     * Called by {@link WSEndpoint} when it's set up.
+     *
+     * <p>
+     * This is an opportunity for {@link InstanceResolver}
+     * to do a endpoint-specific initialization process.
+     *
+     * @param wsc
+     *      The {@link WebServiceContext} instance to be injected
+     *      to the user instances (assuming {@link InstanceResolver}
+     */
+    public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
+        // backward compatibility
+        start(wsc);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #start(WSWebServiceContext,WSEndpoint)}.
+     */
+    public void start(@NotNull WebServiceContext wsc) {}
+
+    /**
+     * Called by {@link WSEndpoint}
+     * when {@link WSEndpoint#dispose()} is called.
+     *
+     * This allows {@link InstanceResolver} to do final clean up.
+     *
+     * <p>
+     * This method is guaranteed to be only called once by {@link WSEndpoint}.
+     */
+    public void dispose() {}
+
+
+    /**
+     * Creates a {@link InstanceResolver} implementation that always
+     * returns the specified singleton instance.
+     */
+    public static <T> InstanceResolver<T> createSingleton(T singleton) {
+        assert singleton!=null;
+        InstanceResolver ir = createFromInstanceResolverAnnotation(singleton.getClass());
+        if(ir==null)
+            ir = new SingletonResolver<T>(singleton);
+        return ir;
+    }
+
+    /**
+     * @deprecated
+     *      This is added here because a Glassfish integration happened
+     *      with this signature. Please do not use this. Will be removed
+     *      after the next GF integration.
+     */
+    public static <T> InstanceResolver<T> createDefault(@NotNull Class<T> clazz, boolean bool) {
+        return createDefault(clazz);
+    }
+
+    /**
+     * Creates a default {@link InstanceResolver} that serves the given class.
+     */
+    public static <T> InstanceResolver<T> createDefault(@NotNull Class<T> clazz) {
+        InstanceResolver<T> ir = createFromInstanceResolverAnnotation(clazz);
+        if(ir==null)
+            ir = new SingletonResolver<T>(createNewInstance(clazz));
+        return ir;
+    }
+
+    /**
+     * Checks for {@link InstanceResolverAnnotation} and creates an instance resolver from it if any.
+     * Otherwise null.
+     */
+    private static <T> InstanceResolver<T> createFromInstanceResolverAnnotation(@NotNull Class<T> clazz) {
+        for( Annotation a : clazz.getAnnotations() ) {
+            InstanceResolverAnnotation ira = a.annotationType().getAnnotation(InstanceResolverAnnotation.class);
+            if(ira==null)   continue;
+            Class<? extends InstanceResolver> ir = ira.value();
+            try {
+                return ir.getConstructor(Class.class).newInstance(clazz);
+            } catch (InstantiationException e) {
+                throw new WebServiceException(ServerMessages.FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(
+                    ir.getName(),a.annotationType(),clazz.getName()));
+            } catch (IllegalAccessException e) {
+                throw new WebServiceException(ServerMessages.FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(
+                    ir.getName(),a.annotationType(),clazz.getName()));
+            } catch (InvocationTargetException e) {
+                throw new WebServiceException(ServerMessages.FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(
+                    ir.getName(),a.annotationType(),clazz.getName()));
+            } catch (NoSuchMethodException e) {
+                throw new WebServiceException(ServerMessages.FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(
+                    ir.getName(),a.annotationType(),clazz.getName()));
+            }
+        }
+
+        return null;
+    }
+
+    protected static <T> T createNewInstance(Class<T> cl) {
+        try {
+            return cl.newInstance();
+        } catch (InstantiationException e) {
+            logger.log(Level.SEVERE, e.getMessage(), e);
+            throw new ServerRtException(
+                WsservletMessages.ERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(cl));
+        } catch (IllegalAccessException e) {
+            logger.log(Level.SEVERE, e.getMessage(), e);
+            throw new ServerRtException(
+                WsservletMessages.ERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(cl));
+        }
+    }
+
+    /**
+     * Wraps this {@link InstanceResolver} into an {@link Invoker}.
+     */
+    public @NotNull Invoker createInvoker() {
+        return new Invoker() {
+            @Override
+            public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
+                InstanceResolver.this.start(wsc,endpoint);
+            }
+
+            @Override
+            public void dispose() {
+                InstanceResolver.this.dispose();
+            }
+
+            @Override
+            public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException {
+                return m.invoke( resolve(p), args );
+            }
+
+            @Override
+            public <T> T invokeProvider(@NotNull Packet p, T arg) {
+                return ((Provider<T>)resolve(p)).invoke(arg);
+            }
+
+            public String toString() {
+                return "Default Invoker over "+InstanceResolver.this.toString();
+            }
+        };
+    }
+
+    private static final Logger logger =
+        Logger.getLogger(
+            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java
new file mode 100644
index 0000000..8b4fa0b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.xml.internal.ws.developer.Stateful;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Meta annotation for selecting instance resolver.
+ *
+ * <p>
+ * When service class is annotated with an annotation that has
+ * {@link InstanceResolverAnnotation} as meta annotation, the JAX-WS RI
+ * runtime will use the instance resolver class specified on {@link #value()}.
+ *
+ * <p>
+ * The {@link InstanceResolver} class must have the public constructor that
+ * takes {@link Class}, which represents the type of the service.
+ *
+ * <p>
+ * See {@link Stateful} for a real example. This annotation is only for
+ * advanced users of the JAX-WS RI.
+ *
+ * @since JAX-WS 2.1
+ * @see Stateful
+ * @author Kohsuke Kawaguchi
+ */
+@Target(ANNOTATION_TYPE)
+@Retention(RUNTIME)
+@Documented
+public @interface InstanceResolverAnnotation {
+    Class<? extends InstanceResolver> value();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Invoker.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Invoker.java
new file mode 100644
index 0000000..0111154
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Invoker.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceContext;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Hides the detail of calling into application endpoint implementation.
+ *
+ * <p>
+ * Typical host of the JAX-WS RI would want to use
+ * {@link InstanceResolver#createDefault(Class)} and then
+ * use <tt>{@link InstanceResolver#createInvoker()} to obtain
+ * the default invoker implementation.
+ *
+ *
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Invoker {
+    /**
+     * Called by {@link WSEndpoint} when it's set up.
+     *
+     * <p>
+     * This is an opportunity for {@link Invoker}
+     * to do a endpoint-specific initialization process.
+     *
+     * @param wsc
+     *      The {@link WebServiceContext} instance that can be injected
+     *      to the user instances.
+     * @param endpoint
+     */
+    public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
+        // backward compatibility
+        start(wsc);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #start(WSWebServiceContext,WSEndpoint)}
+     */
+    public void start(@NotNull WebServiceContext wsc) {
+        throw new IllegalStateException("deprecated version called");
+    }
+
+    /**
+     * Called by {@link WSEndpoint}
+     * when {@link WSEndpoint#dispose()} is called.
+     *
+     * This allows {@link InstanceResolver} to do final clean up.
+     *
+     * <p>
+     * This method is guaranteed to be only called once by {@link WSEndpoint}.
+     */
+    public void dispose() {}
+
+    /**
+     *
+     */
+    public abstract Object invoke( @NotNull Packet p, @NotNull Method m, @NotNull Object... args ) throws InvocationTargetException, IllegalAccessException;
+
+    /**
+     * Invokes {@link Provider#invoke(Object)}
+     */
+    public <T> T invokeProvider( @NotNull Packet p, T arg ) throws IllegalAccessException, InvocationTargetException {
+        // default slow implementation that delegates to the other invoke method.
+        return (T)invoke(p,invokeMethod,arg);
+    }
+
+    /**
+     * Invokes {@link AsyncProvider#invoke(Object, AsyncProviderCallback, WebServiceContext)}
+     */
+    public <T> void invokeAsyncProvider( @NotNull Packet p, T arg, AsyncProviderCallback cbak, WebServiceContext ctxt ) throws IllegalAccessException, InvocationTargetException {
+        // default slow implementation that delegates to the other invoke method.
+        invoke(p, asyncInvokeMethod, arg, cbak, ctxt);
+    }
+
+    private static final Method invokeMethod;
+
+    static {
+        try {
+            invokeMethod = Provider.class.getMethod("invoke",Object.class);
+        } catch (NoSuchMethodException e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    private static final Method asyncInvokeMethod;
+
+    static {
+        try {
+            asyncInvokeMethod = AsyncProvider.class.getMethod("invoke",Object.class, AsyncProviderCallback.class, WebServiceContext.class);
+        } catch (NoSuchMethodException e) {
+            throw new AssertionError(e);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Module.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Module.java
new file mode 100644
index 0000000..559d7e2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Module.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.transport.http.HttpAdapterList;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import java.util.List;
+
+/**
+ * Represents an object scoped to the current "module" (like a JavaEE web appliation).
+ *
+ * <p>
+ * This object can be obtained from {@link Container#getSPI(Class)}.
+ *
+ * <p>
+ * The scope of the module is driven by {@link W3CEndpointReferenceBuilder#build()}'s
+ * requirement that we need to identify a {@link WSEndpoint} that has a specific
+ * service/port name.
+ *
+ * <p>
+ * For JavaEE containers this should be scoped to a JavaEE application. For
+ * other environment, this could be scoped to any similar notion. If no such
+ * notion is available, the implementation of {@link Container} can return
+ * a new {@link Module} object each time {@link Container#getSPI(Class)} is invoked.
+ *
+ * <p>
+ * There's a considerable overlap between this and {@link HttpAdapterList}.
+ * The SPI really needs to be reconsidered
+ *
+ *
+ * @see Container
+ * @author Kohsuke Kawaguchi
+ * @since 2.1 EA3
+ */
+public abstract class Module {
+    /**
+     * Gets the list of {@link BoundEndpoint} deployed in this module.
+     *
+     * <p>
+     * From the point of view of the {@link Module} implementation,
+     * it really only needs to provide a {@link List} object as a data store.
+     * JAX-WS will update this list accordingly.
+     *
+     * @return
+     *      always return the same non-null instance.
+     */
+    public abstract @NotNull List<BoundEndpoint> getBoundEndpoints();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java
new file mode 100644
index 0000000..20e8637
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Resolves port address for an endpoint. A WSDL may contain multiple
+ * endpoints, and some of the endpoints may be packaged in a single WAR file.
+ * If an endpoint is serving the WSDL, it would be nice to fill the port addresses
+ * of other endpoints in the WAR.
+ *
+ * <p>
+ * This interface is implemented by the caller of
+ * {@link SDDocument#writeTo} method so
+ * that the {@link SDDocument} can correctly fills the addresses of known
+ * endpoints.
+ *
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class PortAddressResolver {
+    /**
+     * Gets the endpoint address for a WSDL port
+     *
+     * @param serviceName
+     *       WSDL service name(wsd:service in WSDL) for which address is needed. Always non-null.
+     * @param portName
+     *       WSDL port name(wsdl:port in WSDL) for which address is needed. Always non-null.
+     * @return
+     *      The address needs to be put in WSDL for port element's location
+     *      attribute. Can be null. If it is null, existing port address
+     *      is written as it is (without any patching).
+     */
+    public abstract @Nullable String getAddressFor(@NotNull QName serviceName, @NotNull String portName);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ResourceInjector.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ResourceInjector.java
new file mode 100644
index 0000000..f24d599
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ResourceInjector.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.server.DefaultResourceInjector;
+
+import javax.annotation.PostConstruct;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Represents a functionality of the container to inject resources
+ * to application service endpoint object (usually but not necessarily as per JavaEE spec.)
+ *
+ * <p>
+ * If {@link Container#getSPI(Class)} returns a valid instance of {@link ResourceInjector},
+ * The JAX-WS RI will call the {@link #inject} method for each service endpoint
+ * instance that it manages.
+ *
+ * <p>
+ * The JAX-WS RI will be responsible for calling {@link PostConstruct} callback,
+ * so implementations of this class need not do so.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see Container
+ */
+public abstract class ResourceInjector {
+    /**
+     * Performs resource injection.
+     *
+     * @param context
+     *      {@link WebServiceContext} implementation to be injected into the instance.
+     * @param instance
+     *      Instance of the service endpoint class to which resources will be injected.
+     *
+     * @throws WebServiceException
+     *      If the resource injection fails.
+     */
+    public abstract void inject(@NotNull WSWebServiceContext context, @NotNull Object instance);
+
+    /**
+     * Fallback {@link ResourceInjector} implementation used when the {@link Container}
+     * doesn't provide one.
+     *
+     * <p>
+     * Just inject {@link WSWebServiceContext} and done.
+     */
+    public static final ResourceInjector STANDALONE = new DefaultResourceInjector();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocument.java
new file mode 100644
index 0000000..ea50c4c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocument.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.Nullable;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.namespace.QName;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Represents an individual document that forms a {@link ServiceDefinition}.
+ *
+ * <pre>
+ * TODO:
+ *      how does those documents refer to each other?
+ *
+ * </pre>
+ *
+ * @author Jitendra Kotamraju
+ */
+public interface SDDocument {
+
+    /**
+     * Gets the root tag name of this document.
+     *
+     * <p>
+     * This can be used to identify a kind of document quickly
+     * (such as schema, WSDL, ...)
+     *
+     * @return
+     *      always non-null.
+     */
+    QName getRootName();
+
+    /**
+     * Returns true if this document is WSDL.
+     */
+    boolean isWSDL();
+
+    /**
+     * Returns true if this document is schema.
+     */
+    boolean isSchema();
+
+    /**
+     * Gets the system ID of the document where it's taken from. Generated documents
+     * use a fake URL that can be used to resolve relative URLs. So donot use this URL
+     * for reading or writing.
+     */
+    URL getURL();
+
+    /**
+     * Writes the document to the given {@link OutputStream}.
+     *
+     * <p>
+     * Since {@link ServiceDefinition} doesn't know which endpoint address
+     * {@link Adapter} is serving to, (and often it serves multiple URLs
+     * simultaneously), this method takes the PortAddressResolver as a parameter,
+     * so that it can produce the corret address information in the generated WSDL.
+     *
+     * @param portAddressResolver
+     *      An endpoint address resolver that gives endpoint address for a WSDL
+     *      port. Can be null.
+     * @param resolver
+     *      Used to resolve relative references among documents.
+     * @param os
+     *      The {@link OutputStream} that receives the generated document.
+     *
+     * @throws IOException
+     *      if there was a failure reported from the {@link OutputStream}.
+     */
+    void writeTo(@Nullable PortAddressResolver portAddressResolver,
+            DocumentAddressResolver resolver, OutputStream os) throws IOException;
+
+    /**
+     * Writes the document to the given {@link XMLStreamWriter}.
+     *
+     * <p>
+     * The same as {@link #writeTo(PortAddressResolver,DocumentAddressResolver,OutputStream)} except
+     * it writes to an {@link XMLStreamWriter}.
+     *
+     * <p>
+     * The implementation must not call {@link XMLStreamWriter#writeStartDocument()}
+     * nor {@link XMLStreamWriter#writeEndDocument()}. Those are the caller's
+     * responsibility.
+     *
+     * @throws XMLStreamException
+     *      if the {@link XMLStreamWriter} reports an error.
+     */
+    void writeTo(PortAddressResolver portAddressResolver,
+            DocumentAddressResolver resolver, XMLStreamWriter out) throws XMLStreamException, IOException;
+
+    /**
+     * {@link SDDocument} that represents an XML Schema.
+     */
+    interface Schema extends SDDocument {
+        /**
+         * Gets the target namepsace of this schema.
+         */
+        String getTargetNamespace();
+    }
+
+    /**
+     * {@link SDDocument} that represents a WSDL.
+     */
+    interface WSDL extends SDDocument {
+        /**
+         * Gets the target namepsace of this schema.
+         */
+        String getTargetNamespace();
+
+        /**
+         * This WSDL has a portType definition
+         * that matches what {@link WSEndpoint} is serving.
+         *
+         * TODO: does this info needs to be exposed?
+         */
+        boolean hasPortType();
+
+        /**
+         * This WSDL has a service definition
+         * that matches the {@link WSEndpoint}.
+         *
+         * TODO: does this info need to be exposed?
+         */
+        boolean hasService();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java
new file mode 100644
index 0000000..69c3d94
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.IOException;
+
+/**
+ * Provides a way to filter {@link SDDocument} infoset while writing it. These
+ * filter objects can be added to {@link ServiceDefinition} using
+ * {@link ServiceDefinition#addFilter(SDDocumentFilter)}
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public interface SDDocumentFilter {
+    /**
+     * Returns a wrapped XMLStreamWriter on top of passed-in XMLStreamWriter.
+     * It works like any filtering API for e.g. {@link java.io.FilterOutputStream}.
+     * The method returns a XMLStreamWriter that calls the same methods on original
+     * XMLStreamWriter with some modified events. The end result is some infoset
+     * is filtered before it reaches the original writer and the infoset writer
+     * doesn't have to change any code to incorporate this filter.
+     *
+     * @param doc gives context for the filter. This should only be used to query
+     *  read-only information. Calling doc.writeTo() may result in infinite loop.
+     * @param w Original XMLStreamWriter
+     * @return Filtering {@link XMLStreamWriter}
+     */
+    XMLStreamWriter filter(SDDocument doc, XMLStreamWriter w) throws XMLStreamException, IOException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java
new file mode 100644
index 0000000..cc6d1b3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * SPI that provides the source of {@link SDDocument}.
+ *
+ * <p>
+ * This abstract class could be implemented by appliations, or one of the
+ * {@link #create} methods can be used.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class SDDocumentSource {
+    /**
+     * Returns the {@link XMLStreamReader} that reads the document.
+     *
+     * <p>
+     * This method maybe invoked multiple times concurrently.
+     *
+     * @param xif
+     *      The implementation may choose to use this object when it wants to
+     *      create a new parser (or it can just ignore this parameter completely.)
+     * @return
+     *      The caller is responsible for closing the reader to avoid resource leak.
+     *
+     * @throws XMLStreamException
+     *      if something goes wrong while creating a parser.
+     * @throws IOException
+     *      if something goes wrong trying to read the document.
+     */
+    public abstract XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException;
+
+    /**
+     * Returns the {@link XMLStreamReader} that reads the document.
+     *
+     * <p>
+     * This method maybe invoked multiple times concurrently.
+     *
+     * @return
+     *      The caller is responsible for closing the reader to avoid resource leak.
+     *
+     * @throws XMLStreamException
+     *      if something goes wrong while creating a parser.
+     * @throws IOException
+     *      if something goes wrong trying to read the document.
+     */
+    public abstract XMLStreamReader read() throws IOException, XMLStreamException;
+
+    /**
+     * System ID of this document.
+     */
+    public abstract URL getSystemId();
+
+    /**
+     * Creates {@link SDDocumentSource} from an URL.
+     */
+    public static SDDocumentSource create(final URL url) {
+        return new SDDocumentSource() {
+            private final URL systemId = url;
+
+            public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
+                InputStream is = url.openStream();
+                return new TidyXMLStreamReader(
+                    xif.createXMLStreamReader(systemId.toExternalForm(),is), is);
+            }
+
+            public XMLStreamReader read() throws IOException, XMLStreamException {
+                InputStream is = url.openStream();
+                return new TidyXMLStreamReader(
+                   XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is);
+            }
+
+            public URL getSystemId() {
+                return systemId;
+            }
+        };
+    }
+
+    /**
+     * Creates a {@link SDDocumentSource} from {@link XMLStreamBuffer}.
+     */
+    public static SDDocumentSource create(final URL systemId, final XMLStreamBuffer xsb) {
+        return new SDDocumentSource() {
+            public XMLStreamReader read(XMLInputFactory xif) throws XMLStreamException {
+                return xsb.readAsXMLStreamReader();
+            }
+
+            public XMLStreamReader read() throws XMLStreamException {
+                return xsb.readAsXMLStreamReader();
+            }
+
+            public URL getSystemId() {
+                return systemId;
+            }
+        };
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java
new file mode 100644
index 0000000..1e995ca
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterPipeImpl;
+
+/**
+ * Allow the container (primarily Glassfish) to inject
+ * their own pipes into the pipeline.
+ *
+ * <p>
+ * This interface has a rather ad-hoc set of methods, because
+ * we didn't want to define an autonomous pipe-assembly process.
+ * (We thought this is a smaller evil compared to that.)
+ *
+ * <p>
+ * JAX-WS obtains this through {@link Container#getSPI(Class)}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class ServerPipelineHook {
+    /**
+     * Called during the pipeline construction process once to allow a container
+     * to register a pipe for monitoring.
+     *
+     * This pipe will be injected to a point very close to the transport, allowing
+     * it to measure the time it takes for processing as well as detecting errors.
+     *
+     * @param ctxt
+     *      Represents abstraction of SEI, WSDL abstraction etc. Context can be used
+     *      whether add a new pipe to the head or not.
+     *
+     * @param tail
+     *      Head of the partially constructed pipeline. If the implementation
+     *      wishes to add new pipes, it should do so by extending
+     *      {@link AbstractFilterPipeImpl} and making sure that this {@link Pipe}
+     *      eventually processes messages.
+     *
+     * @return
+     *      The default implementation just returns <tt>tail</tt>, which means
+     *      no additional pipe is inserted. If the implementation adds
+     *      new pipes, return the new head pipe.
+     */
+    public @NotNull Pipe createMonitoringPipe(ServerPipeAssemblerContext ctxt, @NotNull Pipe tail) {
+        return tail;
+    }
+
+    /**
+     * Called during the pipeline construction process once to allow a container
+     * to register a pipe for security.
+     *
+     * This pipe will be injected to a point very close to the transport, allowing
+     * it to do some security operations.
+     *
+     * @param ctxt
+     *      Represents abstraction of SEI, WSDL abstraction etc. Context can be used
+     *      whether add a new pipe to the head or not.
+     *
+     * @param tail
+     *      Head of the partially constructed pipeline. If the implementation
+     *      wishes to add new pipes, it should do so by extending
+     *      {@link AbstractFilterPipeImpl} and making sure that this {@link Pipe}
+     *      eventually processes messages.
+     *
+     * @return
+     *      The default implementation just returns <tt>tail</tt>, which means
+     *      no additional pipe is inserted. If the implementation adds
+     *      new pipes, return the new head pipe.
+     */
+    public @NotNull Pipe createSecurityPipe(ServerPipeAssemblerContext ctxt, @NotNull Pipe tail) {
+        return tail;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServiceDefinition.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServiceDefinition.java
new file mode 100644
index 0000000..93513b0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServiceDefinition.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+
+/**
+ * Root of the unparsed WSDL and other resources referenced from it.
+ * This object represents the description of the service
+ * that a {@link WSEndpoint} offers.
+ *
+ * <p>
+ * A description consists of a set of {@link SDDocument}, which
+ * each represents a single XML document that forms a part of the
+ * descriptor (for example, WSDL might refer to separate schema documents,
+ * or a WSDL might refer to another WSDL.)
+ *
+ * <p>
+ * {@link ServiceDefinition} and its descendants are immutable
+ * read-only objects. Once they are created, they always return
+ * the same value.
+ *
+ * <h2>Expected Usage</h2>
+ * <p>
+ * This object is intended to be used for serving the descriptors
+ * to remote clients (such as by MEX, or other protocol-specific
+ * metadata query, such as HTTP GET with "?wsdl" query string.)
+ *
+ * <p>
+ * This object is <b>NOT</b> intended to be used by other
+ * internal components to parse them. For that purpose, use
+ * {@link WSDLModel} instead.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface ServiceDefinition extends Iterable<SDDocument> {
+    /**
+     * Gets the "primary" {@link SDDocument} that represents a WSDL.
+     *
+     * <p>
+     * This WSDL eventually refers to all the other {@link SDDocument}s.
+     *
+     * @return
+     *      always non-null.
+     */
+    @NotNull SDDocument getPrimary();
+
+    /**
+     * Adds a filter that is called while writing {@link SDDocument}'s infoset. This
+     * filter is applied to the all the other reachable {@link SDDocument}s.
+     *
+     * @param filter that is called while writing the document
+     */
+    void addFilter(@NotNull SDDocumentFilter filter);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/TransportBackChannel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/TransportBackChannel.java
new file mode 100644
index 0000000..5686798
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/TransportBackChannel.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.WSEndpoint.PipeHead;
+
+/**
+ * Represents a transport back-channel.
+ *
+ * <p>
+ * When the JAX-WS runtime finds out that the request
+ * {@link Packet} being processed is known not to produce
+ * a response, it invokes the {@link #close()} method
+ * to indicate that the transport does not need to keep
+ * the channel for the response message open.
+ *
+ * <p>
+ * This allows the transport to close down the communication
+ * channel sooner than wainting for
+ * {@link PipeHead#process}
+ * method to return, thereby improving the overall throughput
+ * of the system.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitu
+ */
+public interface TransportBackChannel {
+    /**
+     * See the class javadoc for the discussion.
+     *
+     * <p>
+     * JAX-WS is not guaranteed to call this method for all
+     * operations that do not have a response. This is merely
+     * a hint.
+     *
+     * <p>
+     * When the implementation of this method fails to close
+     * the connection successfuly, it should record the error,
+     * and return normally. Do not throw any exception.
+     */
+    void close();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java
new file mode 100644
index 0000000..5a9e033
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java
@@ -0,0 +1,485 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Engine;
+import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor;
+import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.server.EndpointFactory;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.xml.sax.EntityResolver;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Binding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.concurrent.Executor;
+
+/**
+ * Root object that hosts the {@link Packet} processing code
+ * at the server.
+ *
+ * <p>
+ * One instance of {@link WSEndpoint} is created for each deployed service
+ * endpoint. A hosted service usually handles multiple concurrent
+ * requests. To do this efficiently, an endpoint handles incoming
+ * {@link Packet} through {@link PipeHead}s, where many copies can be created
+ * for each endpoint.
+ *
+ * <p>
+ * Each {@link PipeHead} is thread-unsafe, and request needs to be
+ * serialized. A {@link PipeHead} represents a sizable resource
+ * (in particular a whole pipeline), so the caller is expected to
+ * reuse them and avoid excessive allocations as much as possible.
+ * Making {@link PipeHead}s thread-unsafe allow the JAX-WS RI internal to
+ * tie thread-local resources to {@link PipeHead}, and reduce the total
+ * resource management overhead.
+ *
+ * <p>
+ * To abbreviate this resource management (and for a few other reasons),
+ * JAX-WS RI provides {@link Adapter} class. If you are hosting a JAX-WS
+ * service, you'll most likely want to send requests to {@link WSEndpoint}
+ * through {@link Adapter}.
+ *
+ * <p>
+ * {@link WSEndpoint} is ready to handle {@link Packet}s as soon as
+ * it's created. No separate post-initialization step is necessary.
+ * However, to comply with the JAX-WS spec requirement, the caller
+ * is expected to call the {@link #dispose()} method to allow an
+ * orderly shut-down of a hosted service.
+ *
+ *
+ *
+ * <h3>Objects Exposed From Endpoint</h3>
+ * <p>
+ * {@link WSEndpoint} exposes a series of information that represents
+ * how an endpoint is configured to host a service. See the getXXX methods
+ * for more details.
+ *
+ *
+ *
+ * <h3>Implementation Notes</h3>
+ * <p>
+ * {@link WSEndpoint} owns a {@link WSWebServiceContext} implementation.
+ * But a bulk of the work is delegated to {@link WebServiceContextDelegate},
+ * which is passed in as a parameter to {@link PipeHead#process(Packet, WebServiceContextDelegate, TransportBackChannel)}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class WSEndpoint<T> {
+
+    /**
+     * Gets the Endpoint's codec that is used to encode/decode {@link Message}s. This is a
+     * copy of the master codec and it shouldn't be shared across two requests running
+     * concurrently(unless it is stateless).
+     *
+     * @return codec to encode/decode
+     */
+    public abstract @NotNull Codec createCodec();
+
+    /**
+     * Gets the application endpoint's serviceName. It could be got from DD or annotations
+     *
+     * @return same as wsdl:service QName if WSDL exists or generated
+     */
+    public abstract @NotNull QName getServiceName();
+
+    /**
+     * Gets the application endpoint's portName. It could be got from DD or annotations
+     *
+     * @return same as wsdl:port QName if WSDL exists or generated
+     */
+    public abstract @NotNull QName getPortName();
+
+    /**
+     * Gets the application endpoint {@link Class} that eventually serves the request.
+     *
+     * <p>
+     * This is the same value given to the {@link #create} method.
+     */
+    public abstract @NotNull Class<T> getImplementationClass();
+
+    /**
+     * Represents the binding for which this {@link WSEndpoint}
+     * is created for.
+     *
+     * @return
+     *      always same object.
+     */
+    public abstract @NotNull WSBinding getBinding();
+
+    /**
+     * Gets the {@link Container} object.
+     *
+     * <p>
+     * The components inside {@link WSEndpoint} uses this reference
+     * to communicate with the hosting environment.
+     *
+     * @return
+     *      always same object. If no "real" {@link Container} instance
+     *      is given, {@link Container#NONE} will be returned.
+     */
+    public abstract @NotNull Container getContainer();
+
+    /**
+     * Gets the port that this endpoint is serving.
+     *
+     * <p>
+     * A service is not required to have a WSDL, and when it doesn't,
+     * this method returns null. Otherwise it returns an object that
+     * describes the port that this {@link WSEndpoint} is serving.
+     *
+     * @return
+     *      Possibly null, but always the same value.
+     */
+    public abstract @Nullable WSDLPort getPort();
+
+    /**
+     * Set this {@link Executor} to run asynchronous requests using this executor.
+     * This executor is set on {@link Engine} and must be set before
+     * calling {@link #schedule(Packet,CompletionCallback) } and
+     * {@link #schedule(Packet,CompletionCallback,FiberContextSwitchInterceptor)} methods.
+     *
+     * @param exec Executor to run async requests
+     */
+    public abstract void setExecutor(@NotNull Executor exec);
+
+    /**
+     * This method takes a {@link Packet} that represents
+     * a request, run it through a {@link Tube}line, eventually
+     * pass it to the user implementation code, which produces
+     * a reply, then run that through the tubeline again,
+     * and eventually return it as a return value through {@link CompletionCallback}.
+     *
+     * <p>
+     * This takes care of pooling of {@link Tube}lines and reuses
+     * tubeline for requests. Same instance of tubeline is not used concurrently
+     * for two requests.
+     *
+     * <p>
+     * If the transport is capable of asynchronous execution, use this
+     * instead of using {@link PipeHead#process}.
+     *
+     * <p>
+     * Before calling this method, set the executor using {@link #setExecutor}. The
+     * executor may used multiple times to run this request in a asynchronous fashion.
+     * The calling thread will be returned immediately, and the callback will be
+     * called in a different a thread.
+     *
+     * <p>
+     * {@link Packet#transportBackChannel} should have the correct value, so that
+     * one-way message processing happens correctly. {@link Packet#webServiceContextDelegate}
+     * should have the correct value, so that some {@link WebServiceContext} methods correctly.
+     *
+     * @see {@link Packet#transportBackChannel}
+     * @see {@link Packet#webServiceContextDelegate}
+     *
+     * @param request web service request
+     * @param callback callback to get response packet
+     */
+    public final void schedule(@NotNull Packet request, @NotNull CompletionCallback callback ) {
+        schedule(request,callback,null);
+    }
+
+    /**
+     * Schedule invocation of web service asynchronously.
+     *
+     * @see {@link #schedule(Packet, CompletionCallback)}
+     *
+     * @param request web service request
+     * @param callback callback to get response packet(exception if there is one)
+     * @param interceptor caller's interceptor to impose a context of execution
+     */
+    public abstract void schedule(@NotNull Packet request, @NotNull CompletionCallback callback, @Nullable FiberContextSwitchInterceptor interceptor );
+
+    /**
+     * Callback to notify that jax-ws runtime has finished execution of a request
+     * submitted via schedule().
+     */
+    public interface CompletionCallback {
+        /**
+         * Indicates that the jax-ws runtime has finished execution of a request
+         * submitted via schedule().
+         *
+         * <p>
+         * Since the JAX-WS RI runs asynchronously,
+         * this method maybe invoked by a different thread
+         * than any of the threads that started it or run a part of tubeline.
+         *
+         * @param response {@link Packet}
+         */
+        void onCompletion(@NotNull Packet response);
+    }
+
+    /**
+     * Creates a new {@link PipeHead} to process
+     * incoming requests.
+     *
+     * <p>
+     * This is not a cheap operation. The caller is expected
+     * to reuse the returned {@link PipeHead}. See
+     * {@link WSEndpoint class javadoc} for details.
+     *
+     * @return
+     *      A newly created {@link PipeHead} that's ready to serve.
+     */
+    public abstract @NotNull PipeHead createPipeHead();
+
+    /**
+     * Represents a resource local to a thread.
+     *
+     * See {@link WSEndpoint} class javadoc for more discussion about
+     * this.
+     */
+    public interface PipeHead {
+        /**
+         * Processes a request and produces a reply.
+         *
+         * <p>
+         * This method takes a {@link Packet} that represents
+         * a request, run it through a {@link Tube}line, eventually
+         * pass it to the user implementation code, which produces
+         * a reply, then run that through the pipeline again,
+         * and eventually return it as a return value.
+         *
+         * @param request
+         *      Unconsumed {@link Packet} that represents
+         *      a request.
+         * @param wscd
+         *      {@link WebServiceContextDelegate} to be set to {@link Packet}.
+         *      (we didn't have to take this and instead just ask the caller to
+         *      set to {@link Packet#webServiceContextDelegate}, but that felt
+         *      too error prone.)
+         * @param tbc
+         *      {@link TransportBackChannel} to be set to {@link Packet}.
+         *      See the {@code wscd} parameter javadoc for why this is a parameter.
+         *      Can be null.
+         * @return
+         *      Unconsumed {@link Packet} that represents
+         *      a reply to the request.
+         *
+         * @throws WebServiceException
+         *      This method <b>does not</b> throw a {@link WebServiceException}.
+         *      The {@link WSEndpoint} must always produce a fault {@link Message}
+         *      for it.
+         *
+         * @throws RuntimeException
+         *      A {@link RuntimeException} thrown from this method, including
+         *      {@link WebServiceException}, must be treated as a bug in the
+         *      code (including JAX-WS and all the pipe implementations), not
+         *      an operator error by the user.
+         *
+         *      <p>
+         *      Therefore, it should be recorded by the caller in a way that
+         *      allows developers to fix a bug.
+         */
+        @NotNull Packet process(
+            @NotNull Packet request, @Nullable WebServiceContextDelegate wscd, @Nullable TransportBackChannel tbc);
+    }
+
+    /**
+     * Indicates that the {@link WSEndpoint} is about to be turned off,
+     * and will no longer serve any packet anymore.
+     *
+     * <p>
+     * This method needs to be invoked for the JAX-WS RI to correctly
+     * implement some of the spec semantics (TODO: pointer.)
+     * It's the responsibility of the code that hosts a {@link WSEndpoint}
+     * to invoke this method.
+     *
+     * <p>
+     * Once this method is called, the behavior is undefed for
+     * all in-progress {@link PipeHead#process} methods (by other threads)
+     * and future {@link PipeHead#process} method invocations.
+     */
+    public abstract void dispose();
+
+    /**
+     * Gets the description of the service.
+     *
+     * <p>
+     * A description is a set of WSDL/schema and other documents that together
+     * describes a service.
+     * A service is not required to have a description, and when it doesn't,
+     * this method returns null.
+     *
+     * @return
+     *      Possibly null, but always the same value.
+     */
+    public abstract @Nullable ServiceDefinition getServiceDefinition();
+
+
+
+    /**
+     * Creates an endpoint from deployment or programmatic configuration
+     *
+     * <p>
+     * This method works like the following:
+     * <ol>
+     * <li>{@link ServiceDefinition} is modeleed from the given SEI type.
+     * <li>{@link Invoker} that always serves <tt>implementationObject</tt> will be used.
+     * </ol>
+     * @param implType
+     *      Endpoint class(not SEI). Enpoint class must have @WebService or @WebServiceProvider
+     *      annotation.
+     * @param processHandlerAnnotation
+     *      Flag to control processing of @HandlerChain on Impl class
+     *      if true, processes @HandlerChain on Impl
+     *      if false, DD might have set HandlerChain no need to parse.
+     * @param invoker
+     *      Pass an object to invoke the actual endpoint object. If it is null, a default
+     *      invoker is created using {@link InstanceResolver#createDefault}. Appservers
+     *      could create its own invoker to do additional functions like transactions,
+     *      invoking the endpoint through proxy etc.
+     * @param serviceName
+     *      Optional service name(may be from DD) to override the one given by the
+     *      implementation class. If it is null, it will be derived from annotations.
+     * @param portName
+     *      Optional port name(may be from DD) to override the one given by the
+     *      implementation class. If it is null, it will be derived from annotations.
+     * @param container
+     *      Allows technologies that are built on top of JAX-WS(such as WSIT) needs to
+     *      negotiate private contracts between them and the container
+     * @param binding
+     *      JAX-WS implementation of {@link Binding}. This object can be created by
+     *      {@link BindingID#createBinding()}. Usually the binding can be got from
+     *      DD, {@link javax.xml.ws.BindingType}.
+     *
+     *
+     * TODO: DD has a configuration for MTOM threshold.
+     * Maybe we need something more generic so that other technologies
+     * like Tango can get information from DD.
+     *
+     * TODO: does it really make sense for this to take EntityResolver?
+     * Given that all metadata has to be given as a list anyway.
+     *
+     * @param primaryWsdl
+     *      The {@link ServiceDefinition#getPrimary() primary} WSDL.
+     *      If null, it'll be generated based on the SEI (if this is an SEI)
+     *      or no WSDL is associated (if it's a provider.)
+     *      TODO: shouldn't the implementation find this from the metadata list?
+     * @param metadata
+     *      Other documents that become {@link SDDocument}s. Can be null.
+     * @param resolver
+     *      Optional resolver used to de-reference resources referenced from
+     *      WSDL. Must be null if the {@code url} is null.
+     * @param isTransportSynchronous
+     *      If the caller knows that the returned {@link WSEndpoint} is going to be
+     *      used by a synchronous-only transport, then it may pass in <tt>true</tt>
+     *      to allow the callee to perform an optimization based on that knowledge
+     *      (since often synchronous version is cheaper than an asynchronous version.)
+     *      This value is visible from {@link ServerTubeAssemblerContext#isSynchronous()}.
+     *
+     * @return newly constructed {@link WSEndpoint}.
+     * @throws WebServiceException
+     *      if the endpoint set up fails.
+     */
+    public static <T> WSEndpoint<T> create(
+        @NotNull Class<T> implType,
+        boolean processHandlerAnnotation,
+        @Nullable Invoker invoker,
+        @Nullable QName serviceName,
+        @Nullable QName portName,
+        @Nullable Container container,
+        @Nullable WSBinding binding,
+        @Nullable SDDocumentSource primaryWsdl,
+        @Nullable Collection<? extends SDDocumentSource> metadata,
+        @Nullable EntityResolver resolver,
+        boolean isTransportSynchronous) {
+        return EndpointFactory.createEndpoint(
+            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous);
+    }
+
+    /**
+     * Deprecated version that assumes <tt>isTransportSynchronous==false</tt>
+     */
+    @Deprecated
+    public static <T> WSEndpoint<T> create(
+        @NotNull Class<T> implType,
+        boolean processHandlerAnnotation,
+        @Nullable Invoker invoker,
+        @Nullable QName serviceName,
+        @Nullable QName portName,
+        @Nullable Container container,
+        @Nullable WSBinding binding,
+        @Nullable SDDocumentSource primaryWsdl,
+        @Nullable Collection<? extends SDDocumentSource> metadata,
+        @Nullable EntityResolver resolver) {
+        return create(implType,processHandlerAnnotation,invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,false);
+    }
+
+
+    /**
+     * The same as
+     * {@link #create(Class, boolean, Invoker, QName, QName, Container, WSBinding, SDDocumentSource, Collection, EntityResolver)}
+     * except that this version takes an url of the <tt>jax-ws-catalog.xml</tt>.
+     *
+     * @param catalogUrl
+     *      if not null, an {@link EntityResolver} is created from it and used.
+     *      otherwise no resolution will be performed.
+     */
+    public static <T> WSEndpoint<T> create(
+        @NotNull Class<T> implType,
+        boolean processHandlerAnnotation,
+        @Nullable Invoker invoker,
+        @Nullable QName serviceName,
+        @Nullable QName portName,
+        @Nullable Container container,
+        @Nullable WSBinding binding,
+        @Nullable SDDocumentSource primaryWsdl,
+        @Nullable Collection<? extends SDDocumentSource> metadata,
+        @Nullable URL catalogUrl) {
+        return create(
+            implType,processHandlerAnnotation,invoker,serviceName,portName,container,binding,primaryWsdl,metadata,
+            XmlUtil.createEntityResolver(catalogUrl),false);
+    }
+
+    /**
+     * Gives the wsdl:service default name computed from the endpoint implementaiton class
+     */
+    public static @NotNull QName getDefaultServiceName(Class endpointClass){
+        return EndpointFactory.getDefaultServiceName(endpointClass);
+    }
+
+    /**
+     * Gives the wsdl:service/wsdl:port default name computed from the endpoint implementaiton class
+     */
+    public static @NotNull QName getDefaultPortName(@NotNull QName serviceName, Class endpointClass){
+        return EndpointFactory.getDefaultPortName(serviceName, endpointClass);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSWebServiceContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSWebServiceContext.java
new file mode 100644
index 0000000..c7cb6b7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSWebServiceContext.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+
+import javax.xml.ws.WebServiceContext;
+
+/**
+ * {@link WebServiceContext} that exposes JAX-WS RI specific additions.
+ *
+ * <p>
+ * {@link WebServiceContext} instances that JAX-WS injects always
+ * implement this interface.
+ *
+ * <p>
+ * The JAX-WS RI may add methods on this interface, so do not implement
+ * this interface in your code, or risk {@link LinkageError}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WSWebServiceContext extends WebServiceContext {
+    /**
+     * Obtains the request packet that is being processed.
+     * @return Packet for the request
+     */
+    @Nullable Packet getRequestPacket();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebModule.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebModule.java
new file mode 100644
index 0000000..c9f5603
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebModule.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+
+/**
+ * {@link Module} that is an HTTP container.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1 EA3
+ */
+public abstract class WebModule extends Module {
+    /**
+     * Gets the host, port, and context path portion of this module.
+     *
+     * <p>
+     * For example, if this is an web appliation running in a servlet
+     * container "http://myhost/myapp", then this method should return
+     * this URI.
+     *
+     * <p>
+     * This method follows the convention of the <tt>HttpServletRequest.getContextPath()</tt>,
+     * and accepts strings like "http://myhost" (for web applications that are deployed
+     * to the root context path), or "http://myhost/foobar" (for web applications
+     * that are deployed to context path "/foobar")
+     *
+     * <p>
+     * Notice that this method involves in determining the machine name
+     * without relying on HTTP "Host" header.
+     */
+    public abstract @NotNull String getContextPath();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java
new file mode 100644
index 0000000..6886509
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import java.security.Principal;
+
+/**
+ * This object is set to {@link Packet#webServiceContextDelegate}
+ * to serve {@link WebServiceContext} methods for a {@link Packet}.
+ *
+ * <p>
+ * When the user application calls a method on {@link WebServiceContext},
+ * the JAX-WS RI goes to the {@link Packet} that represents the request,
+ * then check {@link Packet#webServiceContextDelegate}, and forwards
+ * the method calls to {@link WebServiceContextDelegate}.
+ *
+ * <p>
+ * All the methods defined on this interface takes {@link Packet}
+ * (whose {@link Packet#webServiceContextDelegate} points to
+ * this object), so that a single stateless {@link WebServiceContextDelegate}
+ * can be used to serve multiple concurrent {@link Packet}s,
+ * if the implementation wishes to do so.
+ *
+ * <p>
+ * (It is also allowed to create one instance of
+ * {@link WebServiceContextDelegate} for each packet,
+ * and thus effectively ignore the packet parameter.)
+ *
+ * <p>
+ * Attaching this on a {@link Packet} allows {@link Pipe}s to
+ * intercept and replace them, if they wish.
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface WebServiceContextDelegate {
+    /**
+     * Implements {@link WebServiceContext#getUserPrincipal()}
+     * for the given packet.
+     *
+     * @param request
+     *      Always non-null. See class javadoc.
+     * @see WebServiceContext#getUserPrincipal()
+     */
+    Principal getUserPrincipal(@NotNull Packet request);
+
+    /**
+     * Implements {@link WebServiceContext#isUserInRole(String)}
+     * for the given packet.
+     *
+     * @param request
+     *      Always non-null. See class javadoc.
+     * @see WebServiceContext#isUserInRole(String)
+     */
+    boolean isUserInRole(@NotNull Packet request,String role);
+
+    /**
+     * Gets the address of the endpoint.
+     *
+     * <p>
+     * The "address" of endpoints is always affected by a particular
+     * client being served, hence it's up to transport to provide this
+     * information.
+     *
+     * @param request
+     *      Always non-null. See class javadoc.
+     * @param endpoint
+     *      The endpoint whose address will be returned.
+     *
+     * @throws WebServiceException
+     *      if this method could not compute the address for some reason.
+     * @return
+     *      Absolute URL of the endpoint. This shold be an address that the client
+     *      can use to talk back to this same service later.
+     *
+     * @see WebServiceContext#getEndpointReference
+     */
+    @NotNull String getEPRAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint);
+
+    /**
+     * Gets the address of the primary WSDL.
+     *
+     * <p>
+     * If a transport supports publishing of WSDL by itself (instead/in addition to MEX),
+     * then it should implement this method so that the rest of the JAX-WS RI can
+     * use that information.
+     *
+     * For example, HTTP transports often use the convention {@code getEPRAddress()+"?wsdl"}
+     * for publishing WSDL on HTTP.
+     *
+     * <p>
+     * Some transports may not have such WSDL publishing mechanism on its own.
+     * Those transports may choose to return null, indicating that WSDL
+     * is not published. If such transports are always used in conjunction with
+     * other transports that support WSDL publishing (such as SOAP/TCP used
+     * with Servlet transport), then such transport may
+     * choose to find the corresponding servlet endpoint by {@link Module#getBoundEndpoints()}
+     * and try to obtain the address from there.
+     *
+     * <p>
+     * This information is used to put a metadata reference inside an EPR,
+     * among other things. Clients that do not support MEX rely on this
+     * WSDL URL to retrieve metadata, it is desirable for transports to support
+     * this, but not mandatory.
+     *
+     * <p>
+     * This method will be never invoked if the {@link WSEndpoint}
+     * does not have a corresponding WSDL to begin with
+     * (IOW {@link WSEndpoint#getServiceDefinition() returning null}.
+     *
+     * @param request
+     *      Always non-null. See class javadoc.
+     * @param endpoint
+     *      The endpoint whose address will be returned.
+     *
+     * @return
+     *      null if the implementation does not support the notion of
+     *      WSDL publishing.
+     */
+    @Nullable String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/package-info.java
new file mode 100644
index 0000000..69e6b43
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * APIs for hosting JAX-WS services.
+ *
+ * If you are new to the code, start with {@link WSEndpoint}.
+ */
+package com.sun.xml.internal.ws.api.server;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java
new file mode 100644
index 0000000..508c3f9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.streaming;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.streaming.XMLReaderException;
+import org.xml.sax.InputSource;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+
+/**
+ * Factory for {@link XMLStreamReader}.
+ *
+ * <p>
+ * This wraps {@link XMLInputFactory} and allows us to reuse {@link XMLStreamReader} instances
+ * when appropriate.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class XMLStreamReaderFactory {
+
+    /**
+     * Singleton instance.
+     */
+    private static volatile @NotNull XMLStreamReaderFactory theInstance;
+
+    static {
+        XMLInputFactory xif = XMLInputFactory.newInstance();
+        xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);
+        xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
+
+        XMLStreamReaderFactory f=null;
+
+        // this system property can be used to disable the pooling altogether,
+        // in case someone hits an issue with pooling in the production system.
+        if(!Boolean.getBoolean(XMLStreamReaderFactory.class.getName()+".noPool"))
+            f = Zephyr.newInstance(xif);
+
+        if(f==null) {
+            // is this Woodstox?
+            if(xif.getClass().getName().equals("com.ctc.wstx.stax.WstxInputFactory"))
+                f = new Woodstox(xif);
+        }
+
+        if(f==null)
+            f = new Default(xif);
+
+        theInstance = f;
+    }
+
+    /**
+     * Overrides the singleton {@link XMLStreamReaderFactory} instance that
+     * the JAX-WS RI uses.
+     */
+    public static void set(XMLStreamReaderFactory f) {
+        if(f==null) throw new IllegalArgumentException();
+        theInstance = f;
+    }
+
+    public static XMLStreamReaderFactory get() {
+        return theInstance;
+    }
+
+    public static XMLStreamReader create(InputSource source, boolean rejectDTDs) {
+        try {
+            // Char stream available?
+            if (source.getCharacterStream() != null) {
+                return get().doCreate(source.getSystemId(), source.getCharacterStream(), rejectDTDs);
+            }
+
+            // Byte stream available?
+            if (source.getByteStream() != null) {
+                return get().doCreate(source.getSystemId(), source.getByteStream(), rejectDTDs);
+            }
+
+            // Otherwise, open URI
+            return get().doCreate(source.getSystemId(), new URL(source.getSystemId()).openStream(),rejectDTDs);
+        } catch (IOException e) {
+            throw new XMLReaderException("stax.cantCreate",e);
+        }
+    }
+
+    public static XMLStreamReader create(@Nullable String systemId, InputStream in, boolean rejectDTDs) {
+        return get().doCreate(systemId,in,rejectDTDs);
+    }
+
+    public static XMLStreamReader create(@Nullable String systemId, Reader reader, boolean rejectDTDs) {
+        return get().doCreate(systemId,reader,rejectDTDs);
+    }
+
+    /**
+     * Should be invoked when the code finished using an {@link XMLStreamReader}.
+     *
+     * <p>
+     * If the recycled instance implements {@link RecycleAware},
+     * {@link RecycleAware#onRecycled()} will be invoked to let the instance
+     * know that it's being recycled.
+     *
+     * <p>
+     * It is not a hard requirement to call this method on every {@link XMLStreamReader}
+     * instance. Not doing so just reduces the performance by throwing away
+     * possibly reusable instances. So the caller should always consider the effort
+     * it takes to recycle vs the possible performance gain by doing so.
+     *
+     * <p>
+     * This method may be invked by multiple threads concurrently.
+     *
+     * @param r
+     *      The {@link XMLStreamReader} instance that the caller finished using.
+     *      This could be any {@link XMLStreamReader} implementation, not just
+     *      the ones that were created from this factory. So the implementation
+     *      of this class needs to be aware of that.
+     */
+    public static void recycle(XMLStreamReader r) {
+        get().doRecycle(r);
+    }
+
+    // implementations
+
+    public abstract XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs);
+
+    public abstract XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs);
+
+    public abstract void doRecycle(XMLStreamReader r);
+
+    /**
+     * Interface that can be implemented by {@link XMLStreamReader} to
+     * be notified when it's recycled.
+     *
+     * <p>
+     * This provides a filtering {@link XMLStreamReader} an opportunity to
+     * recycle its inner {@link XMLStreamReader}.
+     */
+    public interface RecycleAware {
+        void onRecycled();
+    }
+
+    /**
+     * {@link XMLStreamReaderFactory} implementation for SJSXP/JAXP RI.
+     */
+    public static final class Zephyr extends XMLStreamReaderFactory {
+        private final XMLInputFactory xif;
+
+        private final ThreadLocal<XMLStreamReader> pool = new ThreadLocal<XMLStreamReader>();
+
+        /**
+         * Sun StAX impl <code>XMLReaderImpl.setInputSource()</code> method via reflection.
+         */
+        private final Method setInputSourceMethod;
+
+        /**
+         * Sun StAX impl <code>XMLReaderImpl.reset()</code> method via reflection.
+         */
+        private final Method resetMethod;
+
+        /**
+         * The Sun StAX impl's {@link XMLStreamReader} implementation clas.
+         */
+        private final Class zephyrClass;
+
+        /**
+         * Creates {@link Zephyr} instance if the given {@link XMLInputFactory} is the one
+         * from Zephyr.
+         */
+        public static @Nullable
+        XMLStreamReaderFactory newInstance(XMLInputFactory xif) {
+            // check if this is from Zephyr
+            try {
+                Class<?> clazz = xif.createXMLStreamReader(new StringReader("<foo/>")).getClass();
+
+                if(!clazz.getName().startsWith("com.sun.xml.internal.stream."))
+                    return null;    // nope
+
+                return new Zephyr(xif,clazz);
+            } catch (NoSuchMethodException e) {
+                return null;    // this factory is not for zephyr
+            } catch (XMLStreamException e) {
+                return null;    // impossible to fail to parse <foo/>, but anyway
+            }
+        }
+
+        public Zephyr(XMLInputFactory xif, Class clazz) throws NoSuchMethodException {
+            zephyrClass = clazz;
+            setInputSourceMethod = clazz.getMethod("setInputSource", InputSource.class);
+            resetMethod = clazz.getMethod("reset");
+
+            try {
+                // Turn OFF internal factory caching in Zephyr.
+                // Santiago told me that this makes it thread-safe.
+                xif.setProperty("reuse-instance", false);
+            } catch (IllegalArgumentException e) {
+                // falls through
+            }
+            this.xif = xif;
+        }
+
+        /**
+         * Fetchs an instance from the pool if available, otherwise null.
+         */
+        private @Nullable XMLStreamReader fetch() {
+            XMLStreamReader sr = pool.get();
+            if(sr==null)    return null;
+            pool.set(null);
+            return sr;
+        }
+
+        public void doRecycle(XMLStreamReader r) {
+            if(zephyrClass.isInstance(r))
+                pool.set(r);
+            if(r instanceof RecycleAware)
+                ((RecycleAware)r).onRecycled();
+        }
+
+        public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+            try {
+                XMLStreamReader xsr = fetch();
+                if(xsr==null)
+                    return xif.createXMLStreamReader(systemId,in);
+
+                // try re-using this instance.
+                InputSource is = new InputSource(systemId);
+                is.setByteStream(in);
+                reuse(xsr,is);
+                return xsr;
+            } catch (IllegalAccessException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            } catch (InvocationTargetException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        public XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
+            try {
+                XMLStreamReader xsr = fetch();
+                if(xsr==null)
+                    return xif.createXMLStreamReader(systemId,in);
+
+                // try re-using this instance.
+                InputSource is = new InputSource(systemId);
+                is.setCharacterStream(in);
+                reuse(xsr,is);
+                return xsr;
+            } catch (IllegalAccessException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            } catch (InvocationTargetException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        private void reuse(XMLStreamReader xsr, InputSource in) throws IllegalAccessException, InvocationTargetException {
+            resetMethod.invoke(xsr);
+            setInputSourceMethod.invoke(xsr,in);
+        }
+    }
+
+    /**
+     * Default {@link XMLStreamReaderFactory} implementation
+     * that can work with any {@link XMLInputFactory}.
+     *
+     * <p>
+     * {@link XMLInputFactory} is not required to be thread-safe, so the
+     * create method on this implementation is synchronized.
+     */
+    public static final class Default extends NoLock {
+        public Default(XMLInputFactory xif) {
+            super(xif);
+        }
+
+        public synchronized XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+            return super.doCreate(systemId, in, rejectDTDs);
+        }
+
+        public synchronized XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
+            return super.doCreate(systemId, in, rejectDTDs);
+        }
+    }
+
+    /**
+     * Similar to {@link Default} but doesn't do any synchronization.
+     *
+     * <p>
+     * This is useful when you know your {@link XMLInputFactory} is thread-safe by itself.
+     */
+    public static class NoLock extends XMLStreamReaderFactory {
+        private final XMLInputFactory xif;
+
+        public NoLock(XMLInputFactory xif) {
+            this.xif = xif;
+        }
+
+        public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+            try {
+                return xif.createXMLStreamReader(systemId,in);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        public XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
+            try {
+                return xif.createXMLStreamReader(systemId,in);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        public void doRecycle(XMLStreamReader r) {
+            // there's no way to recycle with the default StAX API.
+        }
+    }
+
+    /**
+     * Handles Woodstox's XIF but set properties to do the string interning.
+     * Woodstox {@link XMLInputFactory} is thread safe.
+     */
+    public static final class Woodstox extends NoLock {
+        public Woodstox(XMLInputFactory xif) {
+            super(xif);
+            xif.setProperty("org.codehaus.stax2.internNsUris",true);
+        }
+
+        public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+            return super.doCreate(systemId, in, rejectDTDs);
+        }
+
+        public XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
+            return super.doCreate(systemId, in, rejectDTDs);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java
new file mode 100644
index 0000000..a6b6054
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java
@@ -0,0 +1,305 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.streaming;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.streaming.XMLReaderException;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.WebServiceException;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Factory for {@link XMLStreamWriter}.
+ *
+ * <p>
+ * This wraps {@link XMLOutputFactory} and allows us to reuse {@link XMLStreamWriter} instances
+ * when appropriate.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class XMLStreamWriterFactory {
+
+    /**
+     * Singleton instance.
+     */
+    private static volatile @NotNull XMLStreamWriterFactory theInstance;
+
+
+    static {
+        XMLOutputFactory xof = XMLOutputFactory.newInstance();
+
+        XMLStreamWriterFactory f=null;
+
+        // this system property can be used to disable the pooling altogether,
+        // in case someone hits an issue with pooling in the production system.
+        if(!Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".noPool"))
+            f = Zephyr.newInstance(xof);
+        if(f==null)
+            f = new Default(xof);
+
+        theInstance = f;
+    }
+
+    /**
+     * See {@link #create(OutputStream)} for the contract.
+     * This method may be invoked concurrently.
+     */
+    public abstract XMLStreamWriter doCreate(OutputStream out);
+
+    /**
+     * See {@link #create(OutputStream,String)} for the contract.
+     * This method may be invoked concurrently.
+     */
+    public abstract XMLStreamWriter doCreate(OutputStream out, String encoding);
+
+    /**
+     * See {@link #recycle(XMLStreamWriter)} for the contract.
+     * This method may be invoked concurrently.
+     */
+    public abstract void doRecycle(XMLStreamWriter r);
+
+    /**
+     * Should be invoked when the code finished using an {@link XMLStreamWriter}.
+     *
+     * <p>
+     * If the recycled instance implements {@link RecycleAware},
+     * {@link RecycleAware#onRecycled()} will be invoked to let the instance
+     * know that it's being recycled.
+     *
+     * <p>
+     * It is not a hard requirement to call this method on every {@link XMLStreamReader}
+     * instance. Not doing so just reduces the performance by throwing away
+     * possibly reusable instances. So the caller should always consider the effort
+     * it takes to recycle vs the possible performance gain by doing so.
+     *
+     * <p>
+     * This method may be invked by multiple threads concurrently.
+     *
+     * @param r
+     *      The {@link XMLStreamReader} instance that the caller finished using.
+     *      This could be any {@link XMLStreamReader} implementation, not just
+     *      the ones that were created from this factory. So the implementation
+     *      of this class needs to be aware of that.
+     */
+    public static void recycle(XMLStreamWriter r) {
+        get().doRecycle(r);
+    }
+
+    /**
+     * Interface that can be implemented by {@link XMLStreamWriter} to
+     * be notified when it's recycled.
+     *
+     * <p>
+     * This provides a filtering {@link XMLStreamWriter} an opportunity to
+     * recycle its inner {@link XMLStreamWriter}.
+     */
+    public interface RecycleAware {
+        void onRecycled();
+    }
+
+    /**
+     * Gets the singleton instance.
+     */
+    public static @NotNull XMLStreamWriterFactory get() {
+        return theInstance;
+    }
+
+    /**
+     * Overrides the singleton {@link XMLStreamWriterFactory} instance that
+     * the JAX-WS RI uses.
+     *
+     * @param f
+     *      must not be null.
+     */
+    public static void set(@NotNull XMLStreamWriterFactory f) {
+        if(f==null) throw new IllegalArgumentException();
+        theInstance = f;
+    }
+
+    /**
+     * Short-cut for {@link #create(OutputStream, String)} with UTF-8.
+     */
+    public static XMLStreamWriter create(OutputStream out) {
+        return get().doCreate(out);
+    }
+
+    public static XMLStreamWriter create(OutputStream out, String encoding) {
+        return get().doCreate(out, encoding);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #create(OutputStream)}
+     */
+    public static XMLStreamWriter createXMLStreamWriter(OutputStream out) {
+        return create(out);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #create(OutputStream, String)}
+     */
+    public static XMLStreamWriter createXMLStreamWriter(OutputStream out, String encoding) {
+        return create(out, encoding);
+    }
+
+    /**
+     * @deprecated
+     *      Use {@link #create(OutputStream, String)}. The boolean flag was unused anyway.
+     */
+    public static XMLStreamWriter createXMLStreamWriter(OutputStream out, String encoding, boolean declare) {
+        return create(out,encoding);
+    }
+
+    /**
+     * Default {@link XMLStreamWriterFactory} implementation
+     * that can work with any {@link XMLOutputFactory}.
+     *
+     * <p>
+     * {@link XMLOutputFactory} is not required to be thread-safe, so the
+     * create method on this implementation is synchronized.
+     */
+    public static final class Default extends XMLStreamWriterFactory {
+        private final XMLOutputFactory xof;
+
+        public Default(XMLOutputFactory xof) {
+            this.xof = xof;
+        }
+
+        public XMLStreamWriter doCreate(OutputStream out) {
+            return doCreate(out,"UTF-8");
+        }
+
+        public synchronized XMLStreamWriter doCreate(OutputStream out, String encoding) {
+            try {
+                return xof.createXMLStreamWriter(out,encoding);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        public void doRecycle(XMLStreamWriter r) {
+            // no recycling
+        }
+    }
+
+    /**
+     * {@link XMLStreamWriterFactory} implementation for Sun's StaX implementation.
+     *
+     * <p>
+     * This implementation supports instance reuse.
+     */
+    public static final class Zephyr extends XMLStreamWriterFactory {
+        private final XMLOutputFactory xof;
+        private final ThreadLocal<XMLStreamWriter> pool = new ThreadLocal<XMLStreamWriter>();
+        private final Method resetMethod;
+        private final Method setOutputMethod;
+        private final Class zephyrClass;
+
+        public static XMLStreamWriterFactory newInstance(XMLOutputFactory xof) {
+            try {
+                Class<?> clazz = xof.createXMLStreamWriter(new StringWriter()).getClass();
+
+                if(!clazz.getName().startsWith("com.sun.xml.internal.stream."))
+                return null;    // nope
+
+                return new Zephyr(xof,clazz);
+            } catch (XMLStreamException e) {
+                return null;    // impossible
+            } catch (NoSuchMethodException e) {
+                return null;    // this xof wasn't Zephyr
+            }
+        }
+
+        private Zephyr(XMLOutputFactory xof, Class clazz) throws NoSuchMethodException {
+            this.xof = xof;
+
+            zephyrClass = clazz;
+            setOutputMethod = clazz.getMethod("setOutput", StreamResult.class, String.class);
+            resetMethod = clazz.getMethod("reset");
+        }
+
+        /**
+         * Fetchs an instance from the pool if available, otherwise null.
+         */
+        private @Nullable XMLStreamWriter fetch() {
+            XMLStreamWriter sr = pool.get();
+            if(sr==null)    return null;
+            pool.set(null);
+            return sr;
+        }
+
+        public XMLStreamWriter doCreate(OutputStream out) {
+            return doCreate(out,"UTF-8");
+        }
+
+        public XMLStreamWriter doCreate(OutputStream out, String encoding) {
+            XMLStreamWriter xsw = fetch();
+            if(xsw!=null) {
+                // try to reuse
+                try {
+                    resetMethod.invoke(xsw);
+                    setOutputMethod.invoke(xsw,new StreamResult(out),encoding);
+                    return xsw;
+                } catch (IllegalAccessException e) {
+                    throw new XMLReaderException("stax.cantCreate",e);
+                } catch (InvocationTargetException e) {
+                    throw new XMLReaderException("stax.cantCreate",e);
+                }
+            }
+
+            // create a new instance
+            try {
+                return xof.createXMLStreamWriter(out,encoding);
+            } catch (XMLStreamException e) {
+                throw new XMLReaderException("stax.cantCreate",e);
+            }
+        }
+
+        public void doRecycle(XMLStreamWriter r) {
+            if(zephyrClass.isInstance(r)) {
+                // this flushes the underlying stream, so it might cause chunking issue
+                try {
+                    r.close();
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(e);
+                }
+                pool.set(r);
+            }
+            if(r instanceof RecycleAware)
+                ((RecycleAware)r).onRecycled();
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetaDataResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetaDataResolver.java
new file mode 100644
index 0000000..bf5d632
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetaDataResolver.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import java.net.URI;
+
+/**
+ * Resolves metadata such as WSDL/schema. This serves as extensibile plugin point which a wsdl parser can use to
+ * get the metadata from an endpoint.
+ *
+ * @author Vivek Pandey
+ */
+public abstract class MetaDataResolver {
+    /**
+     * Gives {@link com.sun.xml.internal.ws.api.wsdl.parser.ServiceDescriptor} resolved from the given location.
+     *
+     * TODO: Does this method need to propogate errors?
+     *
+     * @param location metadata location
+     * @return {@link com.sun.xml.internal.ws.api.wsdl.parser.ServiceDescriptor} resolved from the location. It may be null in the cases when MetadataResolver
+     *         can get the metada associated with the metadata loction.
+     */
+    public abstract @Nullable ServiceDescriptor resolve(@NotNull URI location);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetadataResolverFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetadataResolverFactory.java
new file mode 100644
index 0000000..41dd3fe
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/MetadataResolverFactory.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import org.xml.sax.EntityResolver;
+
+/**
+ * Extension point for resolving metadata using wsimport.
+ * <p/>
+ * wsimport would get a {@link MetaDataResolver} using this factory and from it will resolve all the wsdl/schema
+ * metadata.
+ *
+ * Implementor of this class must provide a zero argument constructor so that
+ * it can be loaded during service lookup mechanism.
+ *
+ * @author Vivek Pandey
+ * @see com.sun.xml.internal.ws.api.wsdl.parser.MetaDataResolver#resolve(java.net.URI)
+ */
+public abstract class MetadataResolverFactory {
+    /**
+     * Gets a {@link com.sun.xml.internal.ws.api.wsdl.parser.MetaDataResolver}
+     *
+     * @param resolver
+     */
+    public abstract
+    @NotNull
+    MetaDataResolver metadataResolver(@Nullable EntityResolver resolver);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java
new file mode 100644
index 0000000..d8755bc
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.transform.Source;
+import java.util.List;
+
+/**
+ * Abstraction over WSDL and Schema metadata
+ *
+ * @author Vivek Pandey
+ */
+public abstract class ServiceDescriptor {
+    /**
+     * Gives list of wsdls
+     * @return List of WSDL documents as {@link Source}.
+     * {@link javax.xml.transform.Source#getSystemId()} must be Non-null
+     */
+    public abstract @NotNull List<? extends Source> getWSDLs();
+
+    /**
+     * Gives list of schemas.
+     * @return List of XML schema documents as {@link Source}. {@link javax.xml.transform.Source#getSystemId()} must be Non-null.
+     *
+     */
+    public abstract @NotNull List<? extends Source> getSchemas();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java
new file mode 100644
index 0000000..eb26556
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java
@@ -0,0 +1,282 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Extends the WSDL parsing process.
+ *
+ * <p>
+ * This interface is implemented by components that build on top of the JAX-WS RI,
+ * to participate in the WSDL parsing process that happens in the runtime.
+ * This allows such components to retrieve information from WSDL extension elements,
+ * and use that later to, for example, configure {@link Tube}s.
+ *
+ *
+ *
+ * <h2>How it works?</h2>
+ * <p>
+ * Each method on this interface denotes one extension point in WSDL
+ * (the place where foreign elements/attributes can be added.) A {@link RuntimeWSDLParser}
+ * starts parsing WSDL with a fixed set of {@link WSDLParserExtension}s, and
+ * as it finds extension elements/attributes, it calls appropriate callback methods
+ * to provide a chance for {@link WSDLParserExtension} to parse such
+ * an extension element.
+ *
+ * <p>
+ * There are two kinds of callbacks.
+ *
+ * <h3>Attribute callbacks</h3>
+ * <p>
+ * One is for attributes, which ends with the name {@code Attributes}.
+ * This callback is invoked with {@link XMLStreamReader} that points
+ * to the start tag of the WSDL element.
+ *
+ * <p>
+ * The callback method can read interesting attributes on it.
+ * The method must return without advancing the parser to the next token.
+ *
+ * <h3>Element callbacks</h3>
+ * <p>
+ * The other callback is for extension elements, which ends with the name
+ * {@code Elements}.
+ * When a callback is invoked, {@link XMLStreamReader} points to the
+ * start tag of the extension element. The callback method can do
+ * one of the following:
+ *
+ * <ol>
+ *  <li>Return {@code false} without moving {@link XMLStreamReader},
+ *      to indicate that the extension element isn't recognized.
+ *      This allows the next {@link WSDLParserExtension} to see this
+ *      extension element.
+ *  <li>Parse the whole subtree rooted at the element,
+ *      move the cursor to the {@link XMLStreamConstants#END_ELEMENT} state,
+ *      and return {@code true}, indicating that the extension
+ *      element is consumed.
+ *      No other {@link WSDLParserExtension}s are notified of this extension.
+ * </ol>
+ *
+ * <h3>Parsing in callback</h3>
+ * <p>
+ * For each callback, the corresponding WSDL model object is passed in,
+ * so that {@link WSDLParserExtension} can relate what it's parsing
+ * to the {@link WSDLModel}. Most likely, extensions can parse
+ * their data into an {@link WSDLExtension}-derived classes, then
+ * use {@link WSDLExtensible} interface to hook them into {@link WSDLModel}.
+ *
+ * <p>
+ * Note that since the {@link WSDLModel} itself
+ * is being built, {@link WSDLParserExtension} may not invoke any of
+ * the query methods on the WSDL model. Those references are passed just so that
+ * {@link WSDLParserExtension} can hold on to those references, or put
+ * {@link WSDLExtensible} objects into the model, not to query it.
+ *
+ * <p>
+ * If {@link WSDLParserExtension} needs to query {@link WSDLModel},
+ * defer that processing until {@link #finished(WSDLParserExtensionContext)}, when it's
+ * safe to use {@link WSDLModel} can be used safely.
+ *
+ * <p>
+ * Also note that {@link WSDLParserExtension}s are called in no particular order.
+ * This interface is not designed for having multiple {@link WSDLParserExtension}s
+ * parse the same extension element.
+ *
+ *
+ * <h2>Error Handling</h2>
+ * <p>
+ * For usability, {@link WSDLParserExtension}s are expected to check possible
+ * errors in the extension elements that it parses. When an error is found,
+ * it may throw a {@link WebServiceException} to abort the parsing of the WSDL.
+ * This exception will be propagated to the user, so it should have
+ * detailed error messages pointing at the problem.
+ *
+ * <h2>Discovery</h2>
+ * <p>
+ * The JAX-WS RI locates the implementation of {@link WSDLParserExtension}s
+ * by using the standard service look up mechanism, in particular looking for
+ * <tt>META-INF/services/com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension</tt>
+ *
+ *
+ * <h2>TODO</h2>
+ * <p>
+ * As it's designed today, extensions cannot access to any of the environmental
+ * information before the parsing begins (such as what {@link WSService} this
+ * WSDL is being parsed for, etc.) We might need to reconsider this aspect.
+ * The JAX-WS team waits for feedback on this topic.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class WSDLParserExtension {
+    public void start(WSDLParserExtensionContext context){
+        // noop
+    }
+    public void serviceAttributes(WSDLService service, XMLStreamReader reader) {
+        // noop
+    }
+
+    public boolean serviceElements(WSDLService service, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portAttributes(WSDLPort port, XMLStreamReader reader) {
+        // noop
+    }
+
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        return false;
+    }
+
+    public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) {
+        return false;
+    }
+
+    public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) {
+        return false;
+    }
+
+    public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) {
+        return false;
+    }
+
+    public boolean definitionsElements(XMLStreamReader reader) {
+        return false;
+    }
+
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) {
+    }
+
+    public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) {
+    }
+
+    public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) {
+    }
+
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+    }
+
+    public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) {
+    }
+
+    public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) {
+    }
+
+    public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) {
+    }
+
+    public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) {
+    }
+
+    public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+    }
+
+    public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+    }
+
+    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+    }
+
+    // TODO: complete the rest of the callback
+
+    /**
+     * Called when the parsing of a set of WSDL documents are all done.
+     * <p>
+     * This is the opportunity to do any post-processing of the parsing
+     * you've done.
+     *
+     * @param context  {@link WSDLParserExtensionContext} gives fully parsed {@link WSDLModel}.
+     */
+    public void finished(WSDLParserExtensionContext context) {
+        // noop
+    }
+
+    public void postFinished(WSDLParserExtensionContext context) {
+        // noop
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java
new file mode 100644
index 0000000..20ce13e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+
+/**
+ * Provides contextual information for {@link WSDLParserExtension}s.
+ *
+ * @author Vivek Pandey
+ */
+public interface WSDLParserExtensionContext {
+    /**
+     * Returns true if the WSDL parsing is happening on the client side. Returns false means
+     * its started on the server side.
+     */
+    boolean isClientSide();
+
+    /**
+     * Gives the {@link WSDLModel}. The WSDLModel may not be complete until
+     * {@link WSDLParserExtension#finished(WSDLParserExtensionContext)} is called.
+     */
+    WSDLModel getWSDLModel();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/XMLEntityResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/XMLEntityResolver.java
new file mode 100644
index 0000000..a8ea70a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/XMLEntityResolver.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Resolves a reference to {@link XMLStreamReader}.
+ *
+ * This is kinda like {@link EntityResolver} but works
+ * at the XML infoset level.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface XMLEntityResolver {
+    /**
+     * See {@link EntityResolver#resolveEntity(String, String)} for the contract.
+     */
+    Parser resolveEntity(String publicId,String systemId)
+        throws SAXException, IOException, XMLStreamException;
+
+    public static final class Parser {
+        /**
+         * System ID of the document being parsed.
+         */
+        public final URL systemId;
+        /**
+         * The parser instance parsing the infoset.
+         */
+        public final XMLStreamReader parser;
+
+        public Parser(URL systemId, XMLStreamReader parser) {
+            assert parser!=null;
+            this.systemId = systemId;
+            this.parser = parser;
+        }
+
+        /**
+         * Creates a {@link Parser} that reads from {@link SDDocumentSource}.
+         */
+        public Parser(SDDocumentSource doc) throws IOException, XMLStreamException {
+            this.systemId = doc.getSystemId();
+            this.parser = doc.read();
+        }
+
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/package-info.java
new file mode 100644
index 0000000..4f6378e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Extension point for WSDL parsing.
+ */
+package com.sun.xml.internal.ws.api.wsdl.parser;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGenExtnContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGenExtnContext.java
new file mode 100644
index 0000000..7bbd775
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGenExtnContext.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.api.wsdl.writer;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+/**
+ * WSDLGeneatorContext provides a context for the WSDLGeneratorExtension and is used in
+ * {@link WSDLGeneratorExtension#start(WSDLGenExtnContext)}. This context consists of TXW, {@link SEIModel},
+ * {@link WSBinding}, {@link Container}, and implementation class. WSDL extensions are used to
+ * extend the generated WSDL by adding implementation specific extensions.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class WSDLGenExtnContext {
+    private final TypedXmlWriter root;
+    private final SEIModel model;
+    private final WSBinding binding;
+    private final Container container;
+    private final Class endpointClass;
+
+    /**
+     * Constructs WSDL Generation context for the extensions
+     *
+     * @param root      This is the root element of the generated WSDL.
+     * @param model     WSDL is being generated from this {@link SEIModel}.
+     * @param binding   The binding for which we generate WSDL. the binding {@link WSBinding} represents a particular
+     *                  configuration of JAXWS. This can be typically be overriden by
+     * @param container The entry point to the external environment.
+     *                  If this extension is used at the runtime to generate WSDL, you get a {@link Container}
+     *                  that was given to {@link com.sun.xml.internal.ws.api.server.WSEndpoint#create}.
+     */
+    public WSDLGenExtnContext(@NotNull TypedXmlWriter root, @NotNull SEIModel model, @NotNull WSBinding binding,
+                              @Nullable Container container, @NotNull Class endpointClass) {
+        this.root = root;
+        this.model = model;
+        this.binding = binding;
+        this.container = container;
+        this.endpointClass = endpointClass;
+    }
+
+    public TypedXmlWriter getRoot() {
+        return root;
+    }
+
+    public SEIModel getModel() {
+        return model;
+    }
+
+    public WSBinding getBinding() {
+        return binding;
+    }
+
+    public Container getContainer() {
+        return container;
+    }
+
+    public Class getEndpointClass() {
+        return endpointClass;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java
new file mode 100644
index 0000000..b58b4e6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/writer/WSDLGeneratorExtension.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.api.wsdl.writer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.model.CheckedException;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+
+/**
+ * This is a callback interface used to extend the WSDLGenerator.  Implementors
+ * of this interface can add their own WSDL extensions to the generated WSDL.
+ * There are a number of methods that will be invoked allowing the extensions
+ * to be generated on various WSDL elements.
+ * <p/>
+ * The JAX-WS WSDLGenerator uses TXW to serialize the WSDL out to XML.
+ * More information about TXW can be located at
+ * <a href="http://txw.dev.java.net">http://txw.dev.java.net</a>.
+ */
+public abstract class WSDLGeneratorExtension {
+    /**
+     * Called at the very beginning of the process.
+     * <p/>
+     * This method is invoked so that the root element can be manipulated before
+     * any tags have been written. This allows to set e.g. namespace prefixes.
+     * <p/>
+     * Another purpose of this method is to let extensions know what model
+     * we are generating a WSDL for.
+     *
+     * @param root      This is the root element of the generated WSDL.
+     * @param model     WSDL is being generated from this {@link SEIModel}.
+     * @param binding   The binding for which we generate WSDL. the binding {@link WSBinding} represents a particular
+     *                  configuration of JAXWS. This can be typically be overriden by
+     * @param container The entry point to the external environment.
+     *                  If this extension is used at the runtime to generate WSDL, you get a {@link Container}
+     *                  that was given to {@link WSEndpoint#create}.
+     *                  TODO: think about tool side
+     * @deprecated
+     */
+    public void start(@NotNull TypedXmlWriter root, @NotNull SEIModel model, @NotNull WSBinding binding, @NotNull Container container) {
+    }
+
+    /**
+     * Called before writing </wsdl:defintions>.
+     *
+     * @param ctxt
+     */
+    public void end(@NotNull WSDLGenExtnContext ctxt) {
+    }
+
+    /**
+     * Called at the very beginning of the process.
+     * <p/>
+     * This method is invoked so that the root element can be manipulated before
+     * any tags have been written. This allows to set e.g. namespace prefixes.
+     * <p/>
+     * Another purpose of this method is to let extensions know what model
+     * we are generating a WSDL for.
+     *
+     * @param ctxt Provides the context for the generator extensions
+     */
+    public void start(WSDLGenExtnContext ctxt) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:definitions</code>
+     * element can be generated.
+     *
+     * @param definitions This is the <code>wsdl:defintions</code> element that the extension can be added to.
+     */
+    public void addDefinitionsExtension(TypedXmlWriter definitions) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:service</code>
+     * element can be generated.
+     *
+     * @param service This is the <code>wsdl:service</code> element that the extension can be added to.
+     */
+    public void addServiceExtension(TypedXmlWriter service) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:port</code>
+     * element can be generated.
+     *
+     * @param port This is the wsdl:port element that the extension can be added to.
+     */
+    public void addPortExtension(TypedXmlWriter port) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:portType</code>
+     * element can be generated.
+     * <p/>
+     *
+     * @param portType This is the wsdl:portType element that the extension can be added to.
+     */
+    public void addPortTypeExtension(TypedXmlWriter portType) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:binding</code>
+     * element can be generated.
+     * <p/>
+     * <p/>
+     * TODO:  Some other information may need to be passed
+     *
+     * @param binding This is the wsdl:binding element that the extension can be added to.
+     */
+    public void addBindingExtension(TypedXmlWriter binding) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation</code>
+     * element can be generated.
+     *
+     * @param operation This is the wsdl:portType/wsdl:operation  element that the
+     *                  extension can be added to.
+     * @param method    {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addOperationExtension(TypedXmlWriter operation, JavaMethod method) {
+    }
+
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation</code>
+     * element can be generated.
+     *
+     * @param operation This is the wsdl:binding/wsdl:operation  element that the
+     *                  extension can be added to.
+     * @param method    {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addBindingOperationExtension(TypedXmlWriter operation, JavaMethod method) {
+    }
+
+    /**
+     * This method is invoked so that extensions to an input <code>wsdl:message</code>
+     * element can be generated.
+     *
+     * @param message This is the input wsdl:message element that the
+     *                extension can be added to.
+     * @param method  {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addInputMessageExtension(TypedXmlWriter message, JavaMethod method) {
+    }
+
+    /**
+     * This method is invoked so that extensions to an output <code>wsdl:message</code>
+     * element can be generated.
+     *
+     * @param message This is the output wsdl:message element that the
+     *                extension can be added to.
+     * @param method  {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addOutputMessageExtension(TypedXmlWriter message, JavaMethod method) {
+    }
+
+
+    /**
+     * This method is invoked so that extensions to a
+     * <code>wsdl:portType/wsdl:operation/wsdl:input</code>
+     * element can be generated.
+     *
+     * @param input  This is the wsdl:portType/wsdl:operation/wsdl:input  element that the
+     *               extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
+    }
+
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:output</code>
+     * element can be generated.
+     *
+     * @param output This is the wsdl:portType/wsdl:operation/wsdl:output  element that the
+     *               extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a
+     * <code>wsdl:binding/wsdl:operation/wsdl:input</code>
+     * element can be generated.
+     *
+     * @param input  This is the wsdl:binding/wsdl:operation/wsdl:input  element that the
+     *               extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addBindingOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
+    }
+
+
+    /**
+     * This method is invoked so that extensions to a  <code>wsdl:binding/wsdl:operation/wsdl:output</code>
+     * element can be generated.
+     *
+     * @param output This is the wsdl:binding/wsdl:operation/wsdl:output  element that the
+     *               extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:binding/wsdl:operation/wsdl:fault</code>
+     * element can be generated.
+     *
+     * @param fault  This is the wsdl:binding/wsdl:operation/wsdl:fault or wsdl:portType/wsdl:output/wsdl:operation/wsdl:fault
+     *               element that the extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     */
+    public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code>
+     * element can be generated.
+     *
+     * @param message This is the fault wsdl:message element that the
+     *                extension can be added to.
+     * @param method  {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     *
+     * @param ce      {@link CheckedException} that abstracts wsdl:fault
+     */
+    public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) {
+    }
+
+    /**
+     * This method is invoked so that extensions to a <code>wsdl:portType/wsdl:operation/wsdl:fault</code>
+     * element can be generated.
+     *
+     * @param fault  This is the wsdl:portType/wsdl:operation/wsdl:fault  element that the
+     *               extension can be added to.
+     * @param method {@link JavaMethod} which captures all the information to generate wsdl:portType/wsdl:operation
+     * @param ce     {@link CheckedException} that abstracts wsdl:fault
+     */
+    public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
index a0104c1..239b6bb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,181 +25,152 @@
 
 package com.sun.xml.internal.ws.binding;
 
-import com.sun.xml.internal.ws.binding.http.HTTPBindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.modeler.RuntimeModeler;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
 
-import javax.xml.ws.Binding;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
 import javax.xml.ws.handler.Handler;
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
 
 /**
  * Instances are created by the service, which then
- * sets the handler chain on the binding impl. The handler
- * caller class actually creates and manages the handlers.
+ * sets the handler chain on the binding impl.
  *
- * <p>Also used on the server side, where non-api calls such as
- * getHandlerChainCaller cannot be used. So the binding impl
- * now stores the handler list rather than deferring to the
- * handler chain caller.
+ * <p>
+ * This class is made abstract as we don't see a situation when
+ * a BindingImpl has much meaning without binding id.
+ * IOW, for a specific binding there will be a class
+ * extending BindingImpl, for example SOAPBindingImpl.
  *
- * <p>This class is made abstract as we dont see a situation when a BindingImpl has much meaning without binding id.
- * IOw, for a specific binding there will be a class extending BindingImpl, for example SOAPBindingImpl.
- *
- * <p>The spi Binding interface extends Binding.
+ * <p>
+ * The spi Binding interface extends Binding.
  *
  * @author WS Development Team
  */
-public abstract class BindingImpl implements
-    com.sun.xml.internal.ws.spi.runtime.Binding {
+public abstract class BindingImpl implements WSBinding {
+    private HandlerConfiguration handlerConfig;
+    private final BindingID bindingId;
+    // Features that are set(enabled/disabled) on the binding
+    protected final WebServiceFeatureList features = new WebServiceFeatureList();
 
-    // caller ignored on server side
-    protected HandlerChainCaller chainCaller;
-
-    private SystemHandlerDelegate systemHandlerDelegate;
-    private List<Handler> handlers;
-    private String bindingId;
-    protected QName serviceName;
-
-   // called by DispatchImpl
-    public BindingImpl(String bindingId, QName serviceName) {
+    protected BindingImpl(BindingID bindingId) {
         this.bindingId = bindingId;
-        this.serviceName = serviceName;
+        setHandlerConfig(createHandlerConfig(Collections.<Handler>emptyList()));
     }
 
-    public BindingImpl(List<Handler> handlerChain, String bindingId, QName serviceName) {
-        handlers = handlerChain;
-        this.bindingId = bindingId;
-        this.serviceName = serviceName;
+    public
+    @NotNull
+    List<Handler> getHandlerChain() {
+        return handlerConfig.getHandlerChain();
+    }
+
+    public HandlerConfiguration getHandlerConfig() {
+        return handlerConfig;
     }
 
 
     /**
-     * Return a copy of the list. If there is a handler chain caller,
-     * this is the proper list. Otherwise, return a copy of 'handlers'
-     * or null if list is null. The RuntimeEndpointInfo.init() method
-     * relies on this list being null if there were no handlers
-     * in the deployment descriptor file.
-     *
-     * @return The list of handlers. This can be null if there are
-     * no handlers. The list may have a different order depending on
-     * whether or not the handlers have been called yet, since the
-     * logical and protocol handlers will be sorted before calling them.
-     *
-     * @see com.sun.xml.internal.ws.server.RuntimeEndpointInfo#init
-     */
-    public List<Handler> getHandlerChain() {
-        if (chainCaller != null) {
-            return new ArrayList(chainCaller.getHandlerChain());
-        }
-        if (handlers == null) {
-            return null;
-        }
-        return new ArrayList(handlers);
-    }
-
-    public boolean hasHandlers() {
-        if (handlers == null || handlers.size() == 0) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Sets the handlers on the binding. If the handler chain
-     * caller already exists, then the handlers will be set on
-     * the caller and the handler chain held by the binding will
-     * be the sorted list.
+     * Sets the handlers on the binding and then
+     * sorts the handlers in to logical and protocol handlers.
+     * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
      */
     public void setHandlerChain(List<Handler> chain) {
-        if (chainCaller != null) {
-            chainCaller = new HandlerChainCaller(chain);
-            handlers = chainCaller.getHandlerChain();
-        } else {
-            handlers = chain;
-        }
+        setHandlerConfig(createHandlerConfig(chain));
     }
 
     /**
-     * Creates the handler chain caller if needed and returns
-     * it. Once the handler chain caller exists, this class
-     * defers getHandlers() calls to it to get the new sorted
-     * list of handlers.
+     * This is called when ever Binding.setHandlerChain() or SOAPBinding.setRoles()
+     * is called.
+     * This sorts out the Handlers into Logical and SOAP Handlers and
+     * sets the HandlerConfiguration.
      */
-    public HandlerChainCaller getHandlerChainCaller() {
-        if (chainCaller == null) {
-            chainCaller = new HandlerChainCaller(handlers);
-        }
-        return chainCaller;
+    protected void setHandlerConfig(HandlerConfiguration handlerConfig) {
+        this.handlerConfig = handlerConfig;
     }
 
-    public String getBindingId(){
+    protected abstract HandlerConfiguration createHandlerConfig(List<Handler> handlerChain);
+
+    public
+    @NotNull
+    BindingID getBindingId() {
         return bindingId;
     }
 
-    public String getActualBindingId() {
-        return bindingId;
+    public final SOAPVersion getSOAPVersion() {
+        return bindingId.getSOAPVersion();
     }
 
-    public void setServiceName(QName serviceName){
-        this.serviceName = serviceName;
+    public AddressingVersion getAddressingVersion() {
+        AddressingVersion addressingVersion;
+        if (features.isEnabled(AddressingFeature.class))
+            addressingVersion = AddressingVersion.W3C;
+        else if (features.isEnabled(MemberSubmissionAddressingFeature.class))
+            addressingVersion = AddressingVersion.MEMBER;
+        else
+            addressingVersion = null;
+        return addressingVersion;
     }
 
-    public SystemHandlerDelegate getSystemHandlerDelegate() {
-        return systemHandlerDelegate;
+    public final
+    @NotNull
+    Codec createCodec() {
+        return bindingId.createEncoder(this);
     }
 
-    public void setSystemHandlerDelegate(SystemHandlerDelegate delegate) {
-        systemHandlerDelegate = delegate;
-    }
-
-    public static com.sun.xml.internal.ws.spi.runtime.Binding getBinding(String bindingId,
-                                                                Class implementorClass, QName serviceName, boolean tokensOK) {
-
-        if (bindingId == null) {
-            // Gets bindingId from @BindingType annotation
-            bindingId = RuntimeModeler.getBindingId(implementorClass);
-            if (bindingId == null) {            // Default one
-                bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-            }
-        }
-        if (tokensOK) {
-            if (bindingId.equals("##SOAP11_HTTP")) {
-                bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-            } else if (bindingId.equals("##SOAP11_HTTP_MTOM")) {
-                bindingId = SOAPBinding.SOAP11HTTP_MTOM_BINDING;
-            } else if (bindingId.equals("##SOAP12_HTTP")) {
-                bindingId = SOAPBinding.SOAP12HTTP_BINDING;
-            } else if (bindingId.equals("##SOAP12_HTTP_MTOM")) {
-                bindingId = SOAPBinding.SOAP12HTTP_MTOM_BINDING;
-            } else if (bindingId.equals("##XML_HTTP")) {
-                bindingId = HTTPBinding.HTTP_BINDING;
-            }
-        }
-        if (bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING)
-            || bindingId.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
-            || bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)
-            || bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)
-            || bindingId.equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
-            return new SOAPBindingImpl(bindingId, serviceName);
-        } else if (bindingId.equals(HTTPBinding.HTTP_BINDING)) {
+    public static BindingImpl create(@NotNull BindingID bindingId) {
+        if (bindingId.equals(BindingID.XML_HTTP))
             return new HTTPBindingImpl();
-        } else {
-            throw new IllegalArgumentException("Wrong bindingId "+bindingId);
+        else
+            return new SOAPBindingImpl(bindingId);
+    }
+
+    public static BindingImpl create(@NotNull BindingID bindingId, WebServiceFeature[] features) {
+        if (bindingId.equals(BindingID.XML_HTTP))
+            return new HTTPBindingImpl();
+        else
+            return new SOAPBindingImpl(bindingId, features);
+    }
+
+    public static WSBinding getDefaultBinding() {
+        return new SOAPBindingImpl(BindingID.SOAP11_HTTP);
+    }
+
+    public String getBindingID() {
+        return bindingId.toString();
+    }
+
+    public @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType){
+        return features.get(featureType);
+    }
+
+    public boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> feature){
+        return features.isEnabled(feature);
+    }
+
+    @NotNull
+    public WebServiceFeatureList getFeatures() {
+        return features;
+    }
+
+
+    public void setFeatures(WebServiceFeature... newFeatures) {
+        if (newFeatures != null) {
+            for (WebServiceFeature f : newFeatures) {
+                features.add(f);
+            }
         }
     }
 
-    public static Binding getDefaultBinding() {
-        return new SOAPBindingImpl(SOAPBinding.SOAP11HTTP_BINDING);
-    }
-
-    public static Binding getDefaultBinding(QName serviceName) {
-        return new SOAPBindingImpl(SOAPBinding.SOAP11HTTP_BINDING, serviceName);
+    public void addFeature(@NotNull WebServiceFeature newFeature) {
+        features.add(newFeature);
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java
new file mode 100644
index 0000000..97ef4bb
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.binding;
+
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.http.HTTPBinding;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author WS Development Team
+ */
+public class HTTPBindingImpl extends BindingImpl implements HTTPBinding {
+
+    /**
+     * Use {@link BindingImpl#create(BindingID)} to create this.
+     */
+    HTTPBindingImpl() {
+        // TODO: implement a real Codec for these
+        super(BindingID.XML_HTTP);
+    }
+
+    /**
+     * This method separates the logical and protocol handlers and
+     * sets the HandlerConfiguration.
+     * Only logical handlers are allowed with HTTPBinding.
+     * Setting SOAPHandlers throws WebServiceException
+     */
+    protected HandlerConfiguration createHandlerConfig(List<Handler> handlerChain) {
+        List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
+        for (Handler handler : handlerChain) {
+            if (!(handler instanceof LogicalHandler)) {
+                throw new WebServiceException(ClientMessages.NON_LOGICAL_HANDLER_SET(handler.getClass()));
+            } else {
+                logicalHandlers.add((LogicalHandler) handler);
+            }
+        }
+        return new HandlerConfiguration(
+                Collections.<String>emptySet(),
+                Collections.<QName>emptySet(),
+                handlerChain,logicalHandlers,null,null);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
new file mode 100644
index 0000000..2b6e7db
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.binding;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
+import com.sun.xml.internal.ws.handler.HandlerException;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.soap.SOAPBinding;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+
+/**
+ * @author WS Development Team
+ */
+public final class SOAPBindingImpl extends BindingImpl implements SOAPBinding {
+
+    public static final String X_SOAP12HTTP_BINDING =
+        "http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/";
+
+    private static final String ROLE_NONE = SOAP12NamespaceConstants.ROLE_NONE;
+    private Set<String> roles;
+    //protected boolean enableMtom;
+    protected final SOAPVersion soapVersion;
+
+    private Set<QName> portKnownHeaders = Collections.emptySet();
+
+    /**
+     * Use {@link BindingImpl#create(BindingID)} to create this.
+     */
+    SOAPBindingImpl(BindingID bindingId) {
+        this(bindingId,EMPTY_FEATURES);
+    }
+
+    /**
+     * Use {@link BindingImpl#create(BindingID)} to create this.
+     *
+     * @param features
+     *      These features have a precedence over
+     *      {@link BindingID#createBuiltinFeatureList() the implicit features}
+     *      associated with the {@link BindingID}.
+     */
+    SOAPBindingImpl(BindingID bindingId, WebServiceFeature... features) {
+        super(bindingId);
+        this.soapVersion = bindingId.getSOAPVersion();
+        roles = new HashSet<String>();
+        addRequiredRoles();
+        //Is this still required? comment out for now
+        //setupSystemHandlerDelegate(serviceName);
+
+        setFeatures(features);
+        this.features.addAll(bindingId.createBuiltinFeatureList());
+    }
+
+    /**
+     *  This method should be called if the binding has SOAPSEIModel
+     *  The Headers understood by the Port are set, so that they can be used for MU
+     *  processing.
+     *
+     * @param headers
+     */
+    public void setPortKnownHeaders(@NotNull Set<QName> headers) {
+        this.portKnownHeaders = headers;
+        // apply this change to HandlerConfiguration
+        setHandlerConfig(createHandlerConfig(getHandlerChain()));
+    }
+
+    /**
+     * This method separates the logical and protocol handlers.
+     * Also parses Headers understood by SOAPHandlers and
+     * sets the HandlerConfiguration.
+     */
+    protected HandlerConfiguration createHandlerConfig(List<Handler> handlerChain) {
+        List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
+        List<SOAPHandler> soapHandlers = new ArrayList<SOAPHandler>();
+        Set<QName> handlerKnownHeaders = new HashSet<QName>();
+
+        for (Handler handler : handlerChain) {
+            if (handler instanceof LogicalHandler) {
+                logicalHandlers.add((LogicalHandler) handler);
+            } else if (handler instanceof SOAPHandler) {
+                soapHandlers.add((SOAPHandler) handler);
+                Set<QName> headers = ((SOAPHandler<?>) handler).getHeaders();
+                if (headers != null) {
+                    handlerKnownHeaders.addAll(headers);
+                }
+            } else {
+                throw new HandlerException("handler.not.valid.type",
+                    handler.getClass());
+            }
+        }
+        return new HandlerConfiguration(roles,portKnownHeaders,handlerChain,
+                logicalHandlers,soapHandlers,handlerKnownHeaders);
+    }
+
+    protected void addRequiredRoles() {
+        roles.addAll(soapVersion.requiredRoles);
+    }
+
+    public Set<String> getRoles() {
+        return roles;
+    }
+
+    /**
+     * Adds the next and other roles in case this has
+     * been called by a user without them.
+     * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
+     */
+    public void setRoles(Set<String> roles) {
+        if (roles == null) {
+            roles = new HashSet<String>();
+        }
+        if (roles.contains(ROLE_NONE)) {
+            throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
+        }
+        this.roles = roles;
+        addRequiredRoles();
+        HandlerConfiguration oldConfig = getHandlerConfig();
+        setHandlerConfig(new HandlerConfiguration(this.roles, portKnownHeaders, oldConfig.getHandlerChain(),
+                oldConfig.getLogicalHandlers(),oldConfig.getSoapHandlers(),
+                oldConfig.getHandlerKnownHeaders()));
+    }
+
+
+    /**
+     * Used typically by the runtime to enable/disable Mtom optimization
+     */
+    public boolean isMTOMEnabled() {
+        return isFeatureEnabled(MTOMFeature.class);
+    }
+
+    /**
+     * Client application can override if the MTOM optimization should be enabled
+     */
+    public void setMTOMEnabled(boolean b) {
+        setFeatures(new MTOMFeature(b));
+    }
+
+    public SOAPFactory getSOAPFactory() {
+        return soapVersion.saajSoapFactory;
+    }
+
+    public MessageFactory getMessageFactory() {
+        return soapVersion.saajMessageFactory;
+    }
+
+    private static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0];
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java
new file mode 100644
index 0000000..76d40a4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.binding;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSFeatureList;
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
+import com.sun.xml.internal.ws.model.RuntimeModelerException;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.resources.ModelerMessages;
+
+import javax.xml.ws.RespectBinding;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
+import java.util.*;
+import java.util.logging.Logger;
+
+/**
+ * Represents a list of {@link WebServiceFeature}s that has bunch of utility methods
+ * pertaining to web service features.
+ *
+ * @author Rama Pulavarthi
+ */
+public final class WebServiceFeatureList implements WSFeatureList {
+    private Map<Class<? extends WebServiceFeature>, WebServiceFeature> wsfeatures =
+            new HashMap<Class<? extends WebServiceFeature>, WebServiceFeature>();
+    public WebServiceFeatureList() {
+    }
+
+    /**
+     * Delegate to this parent if non-null.
+     */
+    private
+    @Nullable
+    WSDLFeaturedObject parent;
+
+    public WebServiceFeatureList(@NotNull WebServiceFeature... features) {
+        if (features != null)
+            for (WebServiceFeature f : features) {
+                wsfeatures.put(f.getClass(), f);
+            }
+    }
+
+    /**
+     * Creates a list by reading featuers from the annotation on a class.
+     */
+    public WebServiceFeatureList(@NotNull Class<?> endpointClass) {
+        parseAnnotations(endpointClass);
+    }
+
+    /**
+     * Reads {@link WebServiceFeatureAnnotation feature annotations} on a class
+     * and adds them to the list.
+     */
+    public void parseAnnotations(Class<?> endpointClass) {
+        for (Annotation a : endpointClass.getAnnotations()) {
+            // TODO: this really needs generalization
+            WebServiceFeature ftr;
+            if (!(a.annotationType().isAnnotationPresent(WebServiceFeatureAnnotation.class))) {
+                continue;
+            } else if (a instanceof Addressing) {
+                Addressing addAnn = (Addressing) a;
+                ftr = new AddressingFeature(addAnn.enabled(), addAnn.required());
+            } else if (a instanceof MTOM) {
+                MTOM mtomAnn = (MTOM) a;
+                ftr = new MTOMFeature(mtomAnn.enabled(), mtomAnn.threshold());
+
+                // check conflict with @BindingType
+                BindingID bindingID = BindingID.parse(endpointClass);
+                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
+                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
+                    throw new RuntimeModelerException(
+                            ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
+                }
+
+            } else if (a instanceof RespectBinding) {
+                RespectBinding rbAnn = (RespectBinding) a;
+                ftr = new RespectBindingFeature(rbAnn.enabled());
+            } else {
+                ftr = getWebServiceFeatureBean(a);
+            }
+            add(ftr);
+        }
+    }
+
+    private static WebServiceFeature getWebServiceFeatureBean(Annotation a) {
+        WebServiceFeatureAnnotation wsfa = a.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+        Class<? extends WebServiceFeature> beanClass = wsfa.bean();
+        WebServiceFeature bean;
+
+        Constructor ftrCtr = null;
+        String[] paramNames = null;
+        for (Constructor con : beanClass.getConstructors()) {
+            FeatureConstructor ftrCtrAnn = (FeatureConstructor) con.getAnnotation(FeatureConstructor.class);
+            if (ftrCtrAnn != null) {
+                if (ftrCtr == null) {
+                    ftrCtr = con;
+                    paramNames = ftrCtrAnn.value();
+                } else {
+                    throw new WebServiceException(ModelerMessages.RUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(a, beanClass));
+                }
+            }
+        }
+        if (ftrCtr == null) {
+            throw new WebServiceException(ModelerMessages.RUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(a, beanClass));
+        }
+        if (ftrCtr.getParameterTypes().length != paramNames.length) {
+            throw new WebServiceException(ModelerMessages.RUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(a, beanClass));
+        }
+
+        try {
+            Object[] params = new Object[paramNames.length];
+            for (int i = 0; i < paramNames.length; i++) {
+                Method m = a.annotationType().getDeclaredMethod(paramNames[i]);
+                params[i] = m.invoke(a);
+            }
+            bean = (WebServiceFeature) ftrCtr.newInstance(params);
+        } catch (Exception e) {
+            throw new WebServiceException(e);
+        }
+        return bean;
+    }
+
+    public Iterator<WebServiceFeature> iterator() {
+        if (parent != null)
+            return new MergedFeatures(parent.getFeatures());
+        return wsfeatures.values().iterator();
+    }
+
+    public
+    @NotNull
+    WebServiceFeature[] toArray() {
+        if (parent != null)
+            return new MergedFeatures(parent.getFeatures()).toArray();
+        return wsfeatures.values().toArray(new WebServiceFeature[]{});
+    }
+
+    public boolean isEnabled(@NotNull Class<? extends WebServiceFeature> feature) {
+        WebServiceFeature ftr = get(feature);
+        return ftr != null && ftr.isEnabled();
+    }
+
+
+    public
+    @Nullable
+            <F extends WebServiceFeature> F get(@NotNull Class<F> featureType) {
+        WebServiceFeature f = featureType.cast(wsfeatures.get(featureType));
+        if (f == null && parent != null) {
+            return parent.getFeatures().get(featureType);
+        }
+        return (F) f;
+    }
+
+    /**
+     * Adds a feature to the list if it's not already added.
+     */
+    public void add(@NotNull WebServiceFeature f) {
+        if (!wsfeatures.containsKey(f.getClass())) {
+            wsfeatures.put(f.getClass(), f);
+        }
+    }
+
+    /**
+     * Adds features to the list if it's not already added.
+     */
+    public void addAll(@NotNull WSFeatureList list) {
+        for (WebServiceFeature f : list)
+            add(f);
+    }
+
+    /**
+     * Extracts features from {@link WSDLPortImpl#getFeatures()}.
+     * Extra features that are not already set on binding.
+     * i.e, if a feature is set already on binding through someother API
+     * the coresponding wsdlFeature is not set.
+     *
+     * @param wsdlPort          WSDLPort model
+     * @param honorWsdlRequired If this is true add WSDL Feature only if wsd:Required=true
+     *                          In SEI case, it should be false
+     *                          In Provider case, it should be true
+     * @param reportConflicts   If true, checks if the feature setting in WSDL (wsdl extension or
+     *                          policy configuration) colflicts with feature setting in Deployed Service and
+     *                          logs warning if there are any conflicts.
+     */
+    public void mergeFeatures(@NotNull WSDLPort wsdlPort, boolean honorWsdlRequired, boolean reportConflicts) {
+        if (honorWsdlRequired && !isEnabled(RespectBindingFeature.class))
+            return;
+        if (!honorWsdlRequired) {
+            addAll(wsdlPort.getFeatures());
+            return;
+        }
+        // Add only if isRequired returns true, when honorWsdlRequired is true
+        for (WebServiceFeature wsdlFtr : wsdlPort.getFeatures()) {
+            if (get(wsdlFtr.getClass()) == null) {
+                try {
+                    // if it is a WSDL Extension , it will have required attribute
+                    Method m = (wsdlFtr.getClass().getMethod("isRequired"));
+                    try {
+                        boolean required = (Boolean) m.invoke(wsdlFtr);
+                        if (required)
+                            add(wsdlFtr);
+                    } catch (IllegalAccessException e) {
+                        throw new WebServiceException(e);
+                    } catch (InvocationTargetException e) {
+                        throw new WebServiceException(e);
+                    }
+                } catch (NoSuchMethodException e) {
+                    // this wsdlFtr is not an WSDL extension, just add it
+                    add(wsdlFtr);
+                }
+            } else if (reportConflicts) {
+                if (isEnabled(wsdlFtr.getClass()) != wsdlFtr.isEnabled()) {
+                    LOGGER.warning(ModelerMessages.RUNTIME_MODELER_FEATURE_CONFLICT(
+                            get(wsdlFtr.getClass()), wsdlFtr));
+                }
+
+            }
+        }
+    }
+
+    /**
+     * Set the parent features. Basically the parent feature list will be overriden
+     * by this feature list.
+     */
+    public void setParentFeaturedObject(@NotNull WSDLFeaturedObject parent) {
+        this.parent = parent;
+    }
+
+    /**
+     * A Union of this WebServiceFeatureList and the parent.
+     */
+    private final class MergedFeatures implements Iterator<WebServiceFeature> {
+        private final Stack<WebServiceFeature> features = new Stack<WebServiceFeature>();
+
+        public MergedFeatures(@NotNull WSFeatureList parent) {
+
+            for (WebServiceFeature f : wsfeatures.values()) {
+                features.push(f);
+            }
+
+            for (WebServiceFeature f : parent) {
+                if (!wsfeatures.containsKey(f.getClass())) {
+                    features.push(f);
+                }
+            }
+        }
+
+        public boolean hasNext() {
+            return !features.empty();
+        }
+
+        public WebServiceFeature next() {
+            if (!features.empty()) {
+                return features.pop();
+            }
+            throw new NoSuchElementException();
+        }
+
+        public void remove() {
+            if (!features.empty()) {
+                features.pop();
+            }
+        }
+
+        public WebServiceFeature[] toArray() {
+            return features.toArray(new WebServiceFeature[]{});
+        }
+    }
+
+    private static final Logger LOGGER = Logger.getLogger(WebServiceFeatureList.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/http/HTTPBindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/http/HTTPBindingImpl.java
deleted file mode 100644
index 56a1870..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/http/HTTPBindingImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.binding.http;
-
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.http.HTTPBinding;
-
-import java.util.List;
-
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
-
-/**
- * @author WS Development Team
- */
-public class HTTPBindingImpl extends BindingImpl implements HTTPBinding {
-
-    public HTTPBindingImpl() {
-        super(HTTPBinding.HTTP_BINDING, null);
-    }
-
-    public HTTPBindingImpl(List<Handler> handlerChain) {
-        super(handlerChain, HTTPBinding.HTTP_BINDING, null);
-    }
-
-    /*
-     * Sets the handler chain. Only logical handlers are
-     * allowed with HTTPBinding.
-     */
-    @Override
-    public void setHandlerChain(List<Handler> chain) {
-        for (Handler handler : chain) {
-            if (!(handler instanceof LogicalHandler)) {
-                LocalizableMessageFactory messageFactory =
-                    new LocalizableMessageFactory(
-                    "com.sun.xml.internal.ws.resources.client");
-                Localizer localizer = new Localizer();
-                Localizable locMessage =
-                    messageFactory.getMessage("non.logical.handler.set",
-                    handler.getClass().toString());
-                throw new WebServiceException(localizer.localize(locMessage));
-            }
-        }
-        super.setHandlerChain(chain);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/soap/SOAPBindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/soap/SOAPBindingImpl.java
deleted file mode 100644
index 60cad69..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/soap/SOAPBindingImpl.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.binding.soap;
-
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegateFactory;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
-
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-
-
-/**
- * @author WS Development Team
- */
-public class SOAPBindingImpl extends BindingImpl implements SOAPBinding {
-
-
-    public static final String X_SOAP12HTTP_BINDING =
-        "http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/";
-
-    protected static String ROLE_NONE;
-
-    protected Set<String> requiredRoles;
-    protected Set<String> roles;
-    protected boolean enableMtom = false;
-
-
-     // called by DispatchImpl
-    public SOAPBindingImpl(String bindingId, QName serviceName) {
-        super(bindingId, serviceName);
-        setup(getBindingId(), getActualBindingId());
-        setupSystemHandlerDelegate(serviceName);
-    }
-
-     public SOAPBindingImpl(String bindingId) {
-        super(bindingId, null);
-        setup(getBindingId(), getActualBindingId());
-        setupSystemHandlerDelegate(null);
-    }
-
-    public SOAPBindingImpl(List<Handler> handlerChain, String bindingId, QName serviceName) {
-        super(handlerChain, bindingId, serviceName);
-        setup(getBindingId(), getActualBindingId());
-        setupSystemHandlerDelegate(serviceName);
-    }
-
-    // if the binding id is unknown, no roles are added
-    protected void setup(String bindingId, String actualBindingId) {
-        requiredRoles = new HashSet<String>();
-        if (bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING)) {
-            requiredRoles.add(SOAPNamespaceConstants.ACTOR_NEXT);
-        } else if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
-            requiredRoles.add(SOAP12NamespaceConstants.ROLE_NEXT);
-            requiredRoles.add(SOAP12NamespaceConstants.ROLE_ULTIMATE_RECEIVER);
-        }
-        ROLE_NONE = SOAP12NamespaceConstants.ROLE_NONE;
-        roles = new HashSet<String>();
-        addRequiredRoles();
-        setRolesOnHandlerChain();
-        if (actualBindingId.equals(SOAP11HTTP_MTOM_BINDING)
-            || actualBindingId.equals(SOAP12HTTP_MTOM_BINDING)) {
-            setMTOMEnabled(true);
-        }
-    }
-
-    /**
-     * For a non standard SOAP1.2 binding, return actual SOAP1.2 binding
-     * For SOAP 1.1 MTOM binding, return SOAP1.1 binding
-     * For SOAP 1.2 MTOM binding, return SOAP 1.2 binding
-     */
-    @Override
-    public String getBindingId() {
-        String bindingId = super.getBindingId();
-        if (bindingId.equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
-            return SOAP12HTTP_BINDING;
-        }
-        if (bindingId.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
-            return SOAP11HTTP_BINDING;
-        }
-        if (bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
-            return SOAP12HTTP_BINDING;
-        }
-        return bindingId;
-    }
-
-    /*
-    * Use this to distinguish SOAP12HTTP_BINDING or X_SOAP12HTTP_BINDING
-    */
-    @Override
-    public String getActualBindingId() {
-        return super.getBindingId();
-    }
-
-    /*
-     * When client sets a new handler chain, must also set roles on
-     * the new handler chain caller that gets created.
-     */
-    public void setHandlerChain(List<Handler> chain) {
-        super.setHandlerChain(chain);
-        setRolesOnHandlerChain();
-    }
-
-    protected void addRequiredRoles() {
-        roles.addAll(requiredRoles);
-    }
-
-    public java.util.Set<String> getRoles() {
-        return roles;
-    }
-
-    /*
-     * Adds the next and other roles in case this has
-     * been called by a user without them.
-     */
-    public void setRoles(Set<String> roles) {
-        if (roles == null) {
-            roles = new HashSet<String>();
-        }
-        if (roles.contains(ROLE_NONE)) {
-            LocalizableMessageFactory messageFactory =
-                new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.client");
-            Localizer localizer = new Localizer();
-            Localizable locMessage =
-                messageFactory.getMessage("invalid.soap.role.none");
-            throw new WebServiceException(localizer.localize(locMessage));
-        }
-        this.roles = roles;
-        addRequiredRoles();
-        setRolesOnHandlerChain();
-    }
-
-
-    /**
-     * Used typically by the runtime to enable/disable Mtom optimization
-     *
-     * @return true or false
-     */
-    public boolean isMTOMEnabled() {
-        return enableMtom;
-    }
-
-    /**
-     * Client application can set if the Mtom optimization should be enabled
-     *
-     * @param b
-     */
-    public void setMTOMEnabled(boolean b) {
-        this.enableMtom = b;
-    }
-
-    public SOAPFactory getSOAPFactory() {
-        return SOAPUtil.getSOAPFactory(getBindingId());
-    }
-
-
-    public MessageFactory getMessageFactory() {
-        return SOAPUtil.getMessageFactory(getBindingId());
-    }
-
-    /**
-     * This call defers to the super class to get the
-     * handler chain caller. It then sets the roles on the
-     * caller before returning it.
-     *
-     * @see com.sun.xml.internal.ws.binding.BindingImpl#getHandlerChainCaller
-     */
-    public HandlerChainCaller getHandlerChainCaller() {
-        HandlerChainCaller caller = super.getHandlerChainCaller();
-        caller.setRoles(roles);
-        return chainCaller;
-    }
-
-    protected void setRolesOnHandlerChain() {
-        if (chainCaller != null) {
-            chainCaller.setRoles(roles);
-        }
-    }
-
-    protected void setupSystemHandlerDelegate(QName serviceName) {
-        SystemHandlerDelegateFactory shdFactory =
-            SystemHandlerDelegateFactory.getFactory();
-        if (shdFactory != null) {
-            setSystemHandlerDelegate((SystemHandlerDelegate)
-                shdFactory.getDelegate(serviceName));
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncHandlerService.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncHandlerService.java
deleted file mode 100644
index 6ccc0ab..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncHandlerService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Response;
-import java.rmi.server.UID;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Executor;
-
-public class AsyncHandlerService {
-
-    private AsyncHandler _handler;
-    private UID _uid;
-    private Executor _executor;
-    private WSFuture wsfuture;
-    private Response response;
-
-    public AsyncHandlerService(AsyncHandler handler, Executor executor) {
-        _uid = new UID();
-        _handler = handler;
-        _executor = executor;
-    }
-
-    public synchronized UID getUID() {
-        return _uid;
-    }
-
-    public void executeWSFuture() {
-
-        _executor.execute((Runnable) wsfuture);
-    }
-
-    public WSFuture<Object> setupAsyncCallback(final Response<Object> result) {
-        response = result;
-
-        wsfuture = new WSFuture<Object>(new Callable<Object>() {
-
-            public Object call() throws Exception {
-                _handler.handleResponse(response);
-                return null;
-            }
-        });
-        return wsfuture;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncInvoker.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncInvoker.java
new file mode 100644
index 0000000..855bf73
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncInvoker.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Fiber.CompletionCallback;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+
+/**
+ * Invokes {@link Tube}line asynchronously for the client's async API(for e.g.: Dispatch#invokeAsync}
+ * The concrete classes need to call {@link Stub#processAsync(Packet, RequestContext, CompletionCallback)} in
+ * run() method.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class AsyncInvoker implements Runnable {
+    /**
+     * Because of the object instantiation order,
+     * we can't take this as a constructor parameter.
+     */
+    protected AsyncResponseImpl responseImpl;
+
+    public void setReceiver(AsyncResponseImpl responseImpl) {
+        this.responseImpl = responseImpl;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java
new file mode 100644
index 0000000..86ecec2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.util.CompletedFuture;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+import java.util.Map;
+import java.util.concurrent.FutureTask;
+
+/**
+ * {@link Response} implementation. When Runnbale is executed, it just hands the
+ * request to Fiber and returns. When the Fiber finishes the execution, it sets
+ * response in the {@link FutureTask}
+ *
+ * <p>
+ * {@link ResponseImpl} executes things synchronously and waits for the return
+ * parameter.
+ *
+ * @author Jitendra Kotamraju
+ */
+public final class AsyncResponseImpl<T> extends FutureTask<T> implements Response<T>, ResponseContextReceiver {
+
+    /**
+     * Optional {@link AsyncHandler} that gets invoked
+     * at the completion of the task.
+     */
+    private final AsyncHandler<T> handler;
+    private ResponseContext responseContext;
+    private final Runnable callable;
+
+    /**
+     *
+     * @param runnable
+     *      This {@link Runnable} is executed asynchronously.
+     * @param handler
+     *      Optional {@link AsyncHandler} to invoke at the end
+     *      of the processing. Can be null.
+     */
+    public AsyncResponseImpl(Runnable runnable, @Nullable AsyncHandler<T> handler) {
+        super(runnable, null);
+        this.callable = runnable;
+        this.handler = handler;
+    }
+
+    @Override
+    public void run() {
+        // override so that AsyncInvoker calls set()
+        // when Fiber calls the callback
+        try {
+            callable.run();
+        } catch (WebServiceException e) {
+            //it could be a WebServiceException or a ProtocolException or any RuntimeException
+            // resulting due to some internal bug.
+            set(null, e);
+        } catch (Throwable e) {
+            //its some other exception resulting from user error, wrap it in
+            // WebServiceException
+            set(null, new WebServiceException(e));
+        }
+    }
+
+
+    public ResponseContext getContext() {
+        return responseContext;
+    }
+
+    public void setResponseContext(ResponseContext rc) {
+        responseContext = rc;
+    }
+
+    public void set(final T v, final Throwable t) {
+        // call the handler before we mark the future as 'done'
+        if (handler!=null) {
+            try {
+                /**
+                 * {@link Response} object passed into the callback.
+                 * We need a separate {@link java.util.concurrent.Future} because we don't want {@link ResponseImpl}
+                 * to be marked as 'done' before the callback finishes execution.
+                 * (That would provide implicit synchronization between the application code
+                 * in the main thread and the callback code, and is compatible with the JAX-RI 2.0 FCS.
+                 */
+                class CallbackFuture<T> extends CompletedFuture<T> implements Response<T> {
+                    public CallbackFuture(T v, Throwable t) {
+                        super(v, t);
+                    }
+
+                    public Map<String, Object> getContext() {
+                        return AsyncResponseImpl.this.getContext();
+                    }
+                }
+                handler.handleResponse(new CallbackFuture<T>(v, t));
+            } catch (Throwable e) {
+                super.setException(e);
+                return;
+            }
+        }
+        if (t != null) {
+            super.setException(t);
+        } else {
+            super.set(v);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java
index 0ea2574..427fe65 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,22 +30,14 @@
 public interface BindingProviderProperties extends JAXWSProperties{
 
     //legacy properties
-    public static final String SERVICEIMPL_NAME = "serviceImplementationName";
+    @Deprecated
     public static final String HOSTNAME_VERIFICATION_PROPERTY =
         "com.sun.xml.internal.ws.client.http.HostnameVerificationProperty";
     public static final String HTTP_COOKIE_JAR =
         "com.sun.xml.internal.ws.client.http.CookieJar";
-    public static final String SECURITY_CONTEXT =
-        "com.sun.xml.internal.ws.security.context";
-    public static final String HTTP_STATUS_CODE =
-        "com.sun.xml.internal.ws.client.http.HTTPStatusCode";
 
     public static final String REDIRECT_REQUEST_PROPERTY =
         "com.sun.xml.internal.ws.client.http.RedirectRequestProperty";
-    public static final String SET_ATTACHMENT_PROPERTY =
-        "com.sun.xml.internal.ws.attachment.SetAttachmentContext";
-    public static final String GET_ATTACHMENT_PROPERTY =
-        "com.sun.xml.internal.ws.attachment.GetAttachmentContext";
     public static final String ONE_WAY_OPERATION =
         "com.sun.xml.internal.ws.server.OneWayOperation";
 
@@ -55,78 +47,9 @@
         "com.sun.xml.internal.ws.request.timeout";
 
     //JAXWS 2.0
-    public static final String JAXWS_RUNTIME_CONTEXT =
-        "com.sun.xml.internal.ws.runtime.context";
-    public static final String JAXWS_CONTEXT_PROPERTY =
-        "com.sun.xml.internal.ws.context.request";
-    public static final String JAXWS_HANDLER_CONTEXT_PROPERTY =
-        "com.sun.xml.internal.ws.handler.context";
-    public static final String JAXWS_RESPONSE_CONTEXT_PROPERTY =
-        "com.sun.xml.internal.ws.context.response";
-    public static final String JAXWS_CLIENT_ASYNC_HANDLER =
-        "com.sun.xml.internal.ws.client.dispatch.asynchandler";
-    public static final String JAXWS_CLIENT_ASYNC_RESPONSE_CONTEXT =
-        "com.sun.xml.internal.ws.client.dispatch.async.response.context";
+    public static final String JAXWS_HANDLER_CONFIG =
+        "com.sun.xml.internal.ws.handler.config";
     public static final String JAXWS_CLIENT_HANDLE_PROPERTY =
         "com.sun.xml.internal.ws.client.handle";
-    public static final String JAXB_CONTEXT_PROPERTY =
-        "com.sun.xml.internal.ws.jaxbcontext";
-
-    public static final String CLIENT_TRANSPORT_FACTORY =
-        "com.sun.xml.internal.ws.client.ClientTransportFactory";
-
-    public static final String JAXB_OUTPUTSTREAM =
-        "com.sun.xml.internal.bind.api.Bridge.outputStream";
-
-    public static final String XML_ENCODING_VALUE = "xml.encoding";                 // deprecated
-    public static final String ACCEPT_ENCODING_PROPERTY = "accept.encoding";
-
-    public static final String CONTENT_TYPE_PROPERTY = "Content-Type";
-    public static final String SOAP_ACTION_PROPERTY = "SOAPAction";
-    public static final String ACCEPT_PROPERTY = "Accept";
-
-    // FI + SOAP 1.1
-    public static final String FAST_INFOSET_TYPE_SOAP11 =
-        "application/fastinfoset";
-
-    // FI + SOAP 1.2
-    public static final String FAST_INFOSET_TYPE_SOAP12 =
-        "application/soap+fastinfoset";
-
-    // XML + XOP + SOAP 1.1
-    public static final String XOP_SOAP11_XML_TYPE_VALUE =
-        "application/xop+xml;type=\"text/xml\"";
-
-    // XML + XOP + SOAP 1.2
-    public static final String XOP_SOAP12_XML_TYPE_VALUE =
-        "application/xop+xml;type=\"application/soap+xml\"";
-
-    public static final String XML_CONTENT_TYPE_VALUE = "text/xml";
-
-    public static final String SOAP12_XML_CONTENT_TYPE_VALUE = "application/soap+xml";
-
-    public static final String STANDARD_ACCEPT_VALUE =
-        "application/xop+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
-
-    public static final String SOAP12_XML_ACCEPT_VALUE =
-        "application/soap+xml" + ", " + STANDARD_ACCEPT_VALUE;
-
-    public static final String XML_ACCEPT_VALUE =
-        XML_CONTENT_TYPE_VALUE + ", " + STANDARD_ACCEPT_VALUE;
-
-    public static final String XML_FI_ACCEPT_VALUE =
-        FAST_INFOSET_TYPE_SOAP11 + ", " + XML_ACCEPT_VALUE;
-
-    public static final String SOAP12_XML_FI_ACCEPT_VALUE =
-        FAST_INFOSET_TYPE_SOAP12 + ", " + SOAP12_XML_ACCEPT_VALUE;
-
-    public String DISPATCH_CONTEXT = "com.sun.xml.internal.ws.client.dispatch.context";
-    public String DISPATCH_MARSHALLER = "com.sun.xml.internal.ws.client.dispatch.marshaller";
-    public String DISPATCH_UNMARSHALLER = "com.sun.xml.internal.ws.client.dispatch.unmarshaller";
-    public static final String BINDING_ID_PROPERTY = "com.sun.xml.internal.ws.binding";
-
-//    // Content negotiation property: values "none", "pessimistic" and "optimistic"
-//    public static final String CONTENT_NEGOTIATION_PROPERTY =
-//        "com.sun.xml.internal.ws.client.ContentNegotiation";
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientConfigurationException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientConfigurationException.java
deleted file mode 100644
index 4cb0a39..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientConfigurationException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-
-/**
- * @author Vivek Pandey
- */
-public class ClientConfigurationException extends JAXWSExceptionBase {
-    public ClientConfigurationException(String key, Object... args) {
-        super(key, args);
-    }
-
-    public ClientConfigurationException(Throwable throwable) {
-        super(throwable);
-    }
-
-    public String getResourceBundleName() {
-        return "com.sun.xml.internal.ws.resources.client";
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java
index 56e8b57..4c50fe3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,15 +32,19 @@
  * @author WS Development Team
  */
 public class ClientTransportException extends JAXWSExceptionBase {
-    public ClientTransportException(String key, Object... args) {
-        super(key, args);
+    public ClientTransportException(Localizable msg) {
+        super(msg);
+    }
+
+    public ClientTransportException(Localizable msg, Throwable cause) {
+        super(msg, cause);
     }
 
     public ClientTransportException(Throwable throwable) {
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.client";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoBase.java
deleted file mode 100644
index e78d350..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoBase.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.ContactInfo;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.protocol.Interceptors;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.soap.ClientEncoderDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-import javax.xml.ws.soap.SOAPBinding;
-
-
-/**
- * @author WS Development Team
- */
-public class ContactInfoBase implements ContactInfo, SOAPEPTFactory {
-    protected WSConnection _connection;
-    protected MessageDispatcher _messageDispatcher;
-    protected Encoder _encoder;
-    protected Decoder _decoder;
-    private String bindingId;
-    private InternalEncoder internalEncoder;
-
-    public ContactInfoBase(WSConnection connection,
-                           MessageDispatcher messageDispatcher, Encoder encoder, Decoder decoder,
-                           String bindingId) {
-        _connection = connection;
-        _messageDispatcher = messageDispatcher;
-        _encoder = encoder;
-        _decoder = decoder;
-        internalEncoder = new ClientEncoderDecoder();
-        this.bindingId = bindingId;
-    }
-
-    public ContactInfoBase() {
-        _connection = null;
-        _messageDispatcher = null;
-        _encoder = null;
-        _decoder = null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.ContactInfo#getConnection(com.sun.pept.ept.MessageInfo)
-     */
-    public WSConnection getConnection(MessageInfo arg0) {
-        return _connection;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.EPTFactory#getMessageDispatcher(com.sun.pept.ept.MessageInfo)
-     */
-    public MessageDispatcher getMessageDispatcher(MessageInfo arg0) {
-        return _messageDispatcher;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.EPTFactory#getEncoder(com.sun.pept.ept.MessageInfo)
-     */
-    public Encoder getEncoder(MessageInfo arg0) {
-        return _encoder;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.EPTFactory#getDecoder(com.sun.pept.ept.MessageInfo)
-     */
-    public Decoder getDecoder(MessageInfo arg0) {
-        return _decoder;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.EPTFactory#getInterceptors(com.sun.pept.ept.MessageInfo)
-     */
-    public Interceptors getInterceptors(MessageInfo arg0) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.EPTFactory#getTargetFinder(com.sun.pept.ept.MessageInfo)
-     */
-    public TargetFinder getTargetFinder(MessageInfo arg0) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public SOAPEncoder getSOAPEncoder() {
-        return (SOAPEncoder) _encoder;
-    }
-
-    public SOAPDecoder getSOAPDecoder() {
-        return (SOAPDecoder) _decoder;
-    }
-
-    public InternalEncoder getInternalEncoder() {
-        return internalEncoder;
-    }
-
-    public String getBindingId() {
-        if (bindingId == null) {
-            return SOAPBinding.SOAP11HTTP_BINDING;
-        }
-
-        return bindingId;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListImpl.java
deleted file mode 100644
index 4f2e5b2..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.pept.ept.ContactInfoList;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoListIterator;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder;
-import com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher;
-import com.sun.xml.internal.ws.protocol.xml.client.XMLMessageDispatcher;
-
-import javax.xml.ws.soap.SOAPBinding;
-import java.util.ArrayList;
-
-/**
- * @author WS Development Team
- * List of {@link com.sun.pept.ept.ContactInfo}s
- */
-public class ContactInfoListImpl implements ContactInfoList {
-    private static final ArrayList arrayList = new ArrayList();
-    static {
-        arrayList.add(new ContactInfoBase(null,
-            new SOAPMessageDispatcher(),
-            new SOAPXMLEncoder(),
-            new SOAPXMLDecoder(), SOAPBinding.SOAP11HTTP_BINDING));
-        arrayList.add(new ContactInfoBase(null,
-            new SOAPMessageDispatcher(),
-            new SOAP12XMLEncoder(),
-            new SOAP12XMLDecoder(), SOAPBinding.SOAP12HTTP_BINDING));
-    }
-
-    /**
-     * Iterator over the list of {@link com.sun.pept.ept.ContactInfo}s
-     * @see com.sun.pept.ept.ContactInfoList#iterator()
-     */
-    public ContactInfoListIterator iterator() {
-        return new ContactInfoListIteratorBase(arrayList);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListIteratorBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListIteratorBase.java
deleted file mode 100644
index e31f563..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContactInfoListIteratorBase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.pept.ept.ContactInfo;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoListIterator;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-
-/**
- * @author WS Development Team
- */
-public class ContactInfoListIteratorBase implements ContactInfoListIterator {
-    private Iterator iterator;
-
-    public ContactInfoListIteratorBase(ArrayList list) {
-        iterator = list.iterator();
-    }
-
-    public ContactInfo next() {
-        return (ContactInfo) iterator.next();
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.ept.ContactInfoListIterator#hasNext()
-     */
-    public boolean hasNext() {
-        return iterator.hasNext();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java
index da96a77..a92766c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,49 +22,56 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.ws.client;
 
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-import java.util.Map;
-
-public class ContentNegotiation {
+/**
+ * Content negotiation enum.
+ * <p>
+ * A value of {@link #none} means no content negotation at level of the
+ * client transport will be performed to negotiate the encoding of XML infoset.
+ * The default encoding will always be used.
+ * <p>
+ * A value of {@link #pessimistic} means the client transport will assume
+ * the default encoding of XML infoset for an outbound message unless informed
+ * otherwise by a previously received inbound message.
+ * (The client transport initially and pessimistically assumes that a service
+ * does not support anything other than the default encoding of XML infoset.)
+ * <p>
+ * A value of {@link #optimistic} means the client transport will assume
+ * a non-default encoding of XML infoset for an outbound message.
+ * (The client transport optimistically assumes that a service
+ * supports the non-default encoding of XML infoset.)
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+public enum ContentNegotiation {
+    none,
+    pessimistic,
+    optimistic;
 
     /**
-     * Initializes content negotiation property in <code>MessageStruct</code>
-     * based on request context and system properties.
+     * Property name for content negotiation on {@link RequestContext}.
      */
-    static public void initialize(Map context, MessageStruct messageStruct) {
-        String value = (String) context.get(CONTENT_NEGOTIATION_PROPERTY);
-        if (value != null) {
-            if (value.equals("none") || value.equals("pessimistic") || value.equals("optimistic")) {
-                messageStruct.setMetaData(CONTENT_NEGOTIATION_PROPERTY, value.intern());
-            } else {
-                throw new SenderException("sender.request.illegalValueForContentNegotiation", value);
-            }
-        } else {
-            initFromSystemProperties(context, messageStruct);
-        }
-    }
+    public static final String PROPERTY = "com.sun.xml.internal.ws.client.ContentNegotiation";
 
     /**
-     * Initializes content negotiation property in <code>MessageStruct</code>
-     * based on system property of the same name.
+     * Obtain the content negotiation value from a system property.
+     * <p>
+     * This method will never throw a runtime exception.
+     *
+     * @return the content negotiation value.
      */
-    static public void initFromSystemProperties(Map context, MessageStruct messageStruct)
-        throws SenderException {
-        String value = System.getProperty(CONTENT_NEGOTIATION_PROPERTY);
+    public static ContentNegotiation obtainFromSystemProperty() {
+        try {
+            String value = System.getProperty(PROPERTY);
 
-        if (value == null) {
-            messageStruct.setMetaData(
-                CONTENT_NEGOTIATION_PROPERTY, "none");      // FI is off by default
-        } else if (value.equals("none") || value.equals("pessimistic") || value.equals("optimistic")) {
-            messageStruct.setMetaData(CONTENT_NEGOTIATION_PROPERTY, value.intern());
-            context.put(CONTENT_NEGOTIATION_PROPERTY, value.intern());
-        } else {
-            throw new SenderException("sender.request.illegalValueForContentNegotiation", value);
+            if (value == null) return none;
+
+            return valueOf(value);
+        } catch (Exception e) {
+            // Default to none for any unrecognized value or any other
+            // runtime exception thrown
+            return none;
         }
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContextMap.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContextMap.java
deleted file mode 100644
index 107e507..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContextMap.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.ws.BindingProvider;
-import static javax.xml.ws.BindingProvider.*;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.MessageContext;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-public abstract class ContextMap extends HashMap<String,Object>
-    implements BindingProviderProperties {
-
-    /**
-     * Read-only list of known properties.
-     */
-    private static final Set<String> KNOWN_PROPERTIES;
-
-    private static final HashMap<String,Class> _allowedClass = new HashMap<String, Class>();
-
-    protected BindingProvider _owner;
-    protected PortInfoBase portInfo;
-
-    public abstract ContextMap copy();
-
-    static {
-        //JAXWS 2.0 defined
-        _allowedClass.put(USERNAME_PROPERTY, java.lang.String.class);
-        _allowedClass.put(PASSWORD_PROPERTY, java.lang.String.class);
-        _allowedClass.put(ENDPOINT_ADDRESS_PROPERTY, java.lang.String.class);
-        _allowedClass.put(SESSION_MAINTAIN_PROPERTY, java.lang.Boolean.class);
-        _allowedClass.put(SOAPACTION_USE_PROPERTY, java.lang.Boolean.class);
-        _allowedClass.put(SOAPACTION_URI_PROPERTY, java.lang.String.class);
-
-        //now defined in jaxwscontext
-        _allowedClass.put(BindingProviderProperties.JAXB_CONTEXT_PROPERTY, JAXBContext.class);
-
-        Set<String> temp = new HashSet<String>();
-        //JAXWS 2.0 defined
-        temp.add(USERNAME_PROPERTY);
-        temp.add(PASSWORD_PROPERTY);
-        temp.add(ENDPOINT_ADDRESS_PROPERTY);
-        temp.add(SESSION_MAINTAIN_PROPERTY);
-        temp.add(SOAPACTION_USE_PROPERTY);
-        temp.add(SOAPACTION_URI_PROPERTY);
-
-        temp.add(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-        //implementation specific
-        temp.add(BindingProviderProperties.ACCEPT_ENCODING_PROPERTY);
-        temp.add(BindingProviderProperties.CLIENT_TRANSPORT_FACTORY);
-        //used to get stub in runtime for handler chain
-        temp.add(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-        temp.add(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-
-        //JAXRPC 1.0 - 1.1 DEFINED - implementation specific
-        temp.add(BindingProviderProperties.HTTP_COOKIE_JAR);
-        temp.add(BindingProviderProperties.ONE_WAY_OPERATION);
-        temp.add(BindingProviderProperties.HTTP_STATUS_CODE);
-        temp.add(BindingProviderProperties.HOSTNAME_VERIFICATION_PROPERTY);
-        temp.add(BindingProviderProperties.REDIRECT_REQUEST_PROPERTY);
-        temp.add(BindingProviderProperties.SECURITY_CONTEXT);
-        temp.add(BindingProviderProperties.SET_ATTACHMENT_PROPERTY);
-        temp.add(BindingProviderProperties.GET_ATTACHMENT_PROPERTY);
-        //Tod:check with mark regarding property modification
-        //KNOWN_PROPERTIES = Collections.unmodifiableSet(temp);
-
-        temp.add(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
-        temp.add(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-        temp.add(MessageContext.WSDL_DESCRIPTION);
-        temp.add(MessageContext.WSDL_INTERFACE);
-        temp.add(MessageContext.WSDL_OPERATION);
-        temp.add(MessageContext.WSDL_PORT);
-        temp.add(MessageContext.WSDL_SERVICE);
-        temp.add(MessageContext.HTTP_REQUEST_METHOD);
-        temp.add(MessageContext.HTTP_REQUEST_HEADERS);
-        temp.add(MessageContext.HTTP_RESPONSE_CODE);
-        temp.add(MessageContext.HTTP_RESPONSE_HEADERS);
-        temp.add(MessageContext.PATH_INFO);
-        temp.add(MessageContext.QUERY_STRING);
-        // Content negotiation property for FI -- "none", "pessimistic", "optimistic"
-        temp.add(BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY);
-        temp.add(BindingProviderProperties.MTOM_THRESHOLOD_VALUE);
-        KNOWN_PROPERTIES = temp;
-    }
-
-    //used for dispatch
-    public ContextMap(PortInfoBase info, BindingProvider provider) {
-        _owner = provider;
-        if (info != null) {
-            this.portInfo = info;
-        }
-    }
-
-    /**
-     * Copy constructor.
-     */
-    public ContextMap(ContextMap original) {
-        super(original);
-        this._owner = original._owner;
-    }
-
-    //may not need this
-    public ContextMap(BindingProvider owner) {
-        this(null, owner);
-    }
-
-    boolean doValidation() {
-        return _owner != null;
-    }
-
-    public Object put(String name, Object value) {
-        if (doValidation()) {
-            validateProperty(name, value, true);
-            return super.put(name, value);
-        }
-        return null;
-    }
-
-    public Object get(String name) {
-        if (doValidation()) {
-            validateProperty(name, null, false);
-            return super.get(name);
-        }
-        return null;
-    }
-
-    public Iterator<String> getPropertyNames() {
-        return keySet().iterator();
-    }
-
-
-    public Object remove(String name) {
-        if (doValidation()) {
-            validateProperty(name, null, false);
-            return super.remove(name);
-        }
-        return null;
-    }
-
-    private boolean isAllowedValue(String name, Object value) {
-        if ( name.equals(MessageContext.PATH_INFO) ||
-            name.equals(MessageContext.QUERY_STRING))
-                return true;
-
-        if (value == null)
-            return false;
-
-        return true;
-    }
-// no value check needed today
-//        Object[] values = _allowedValues.get(name);
-//        if (values != null) {
-//            boolean allowed = false;
-//            for (Object o : values) {
-//                if (STRING_CLASS.isInstance(o) && (STRING_CLASS.isInstance(value))) {
-//                    if (((java.lang.String) o).equalsIgnoreCase((java.lang.String) value)) {
-//                        allowed = true;
-//                        break;
-//                    }
-//                } else if (BOOLEAN_CLASS.isInstance(o) && (BOOLEAN_CLASS.isInstance(value))) {
-//                    if (Boolean.FALSE.equals(o) || Boolean.TRUE.equals(o)) {
-//                        allowed = true;
-//                        break;
-//                    }
-//                } else {
-//                    //log this
-//                }
-//            }
-//            return allowed;
-//        }
-
-
-
-    private boolean isAllowedClass(String propName, Object value) {
-
-        Class allowedClass = _allowedClass.get(propName);
-        if (allowedClass != null) {
-            return allowedClass.isInstance(value);
-        }
-        return true;
-    }
-
-    private void validateProperty(String name, Object value, boolean isSetter) {
-        if (name == null)
-            throw new WebServiceException(name + " is a User-defined property - property name can not be null. ",
-                new IllegalArgumentException("Name of property is null.  This is an invalid property name. "));
-
-        /* Spec clarifies that this check is not needed.
-        if (!KNOWN_PROPERTIES.contains(name)) {
-            //do validation check on not "javax.xml.ws."
-            if (name.startsWith("javax.xml.ws"))
-                throw new WebServiceException(name + " is a User-defined property - can not start with javax.xml.ws. package",
-                    new IllegalArgumentException("can not start with javax.xml.ws. package"));                                            //let's check the propertyContext
-        }
-        */
-        //is it alreadySet
-        //Object currentPropValue = get(name);
-        //if (currentPropValue != null) {
-        //  if (!isDynamic(name))
-        //      throw new WebServiceException("Property bound to Binding Instance",
-        //          new IllegalArgumentException("Cannot overwrite the Static Property"));
-        //}
-
-        if (isSetter) {
-            if (!isAllowedClass(name, value))
-                throw new WebServiceException(value + " is Not Allowed Class for property " + name,
-                    new IllegalArgumentException("Not Allowed Class for property"));
-
-            if (!isAllowedValue(name, value))
-                throw new WebServiceException(value + " is Not Allowed Value for property " + name,
-                    new IllegalArgumentException("Not Allowed value"));
-        }
-
-    }
-
- //currently not used
- /*   public static enum StyleAndUse {
-        RPC_LITERAL,
-        DOCLIT_WRAPPER_STYLE, DOCLIT_NONWRAPPER_STYLE
-    }
-*/
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFBase.java
deleted file mode 100644
index 2113917..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFBase.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.pept.Delegate;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import com.sun.xml.internal.ws.transport.http.client.HttpClientTransportFactory;
-
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-
-import java.util.Map;
-
-/**
- * @author WS Development Team
- */
-public class EndpointIFBase implements com.sun.xml.internal.ws.pept.presentation.Stub,
-    com.sun.xml.internal.ws.spi.runtime.StubBase, BindingProvider, InternalBindingProvider {
-
-    protected Map<String, Object> _requestContext;
-    protected Map<String, Object> _responseContext;
-
-    protected String _bindingId = null;
-    protected Delegate _delegate = null;
-    protected BindingImpl binding;
-
-    private ClientTransportFactory _transportFactory;
-
-    void setResponseContext(ResponseContext context) {
-        _responseContext = context;
-    }
-
-    public void _setDelegate(Delegate delegate) {
-        _delegate = delegate;
-    }
-
-    public Delegate _getDelegate() {
-        return _delegate;
-    }
-
-    public ClientTransportFactory _getTransportFactory() {
-        _transportFactory =
-            (com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory)getRequestContext().get(BindingProviderProperties.CLIENT_TRANSPORT_FACTORY);
-
-        if (_transportFactory == null) {
-            _transportFactory = new HttpClientTransportFactory();
-        }
-        return _transportFactory;
-    }
-
-    public void _setTransportFactory(ClientTransportFactory f) {
-        getRequestContext().put(BindingProviderProperties.CLIENT_TRANSPORT_FACTORY, f);
-        _transportFactory = f;
-    }
-
-    //toDo: have to update generator on PeptStub to getContext
-    public void updateResponseContext(MessageInfo messageInfo) {
-        ResponseContext responseContext = (ResponseContext)
-            messageInfo.getMetaData(BindingProviderProperties.JAXWS_RESPONSE_CONTEXT_PROPERTY);
-        if (responseContext != null) { // null in async case
-            setResponseContext(responseContext);
-        }
-    }
-
-    /**
-     * Get the JAXWSContext that is used in processing request messages.
-     * <p/>
-     * Modifications to the request context do not affect asynchronous
-     * operations that have already been started.
-     *
-     * @return The JAXWSContext that is used in processing request messages.
-     */
-    public Map<String, Object> getRequestContext() {
-        if (_requestContext == null)
-            _requestContext = new RequestContext(this);
-
-        return _requestContext;
-    }
-
-    /**
-     * Get the JAXWSContext that resulted from processing a response message.
-     * <p/>
-     * The returned context is for the most recently completed synchronous
-     * operation. Subsequent synchronous operation invocations overwrite the
-     * response context. Asynchronous operations return their response context
-     * via the Response interface.
-     *
-     * @return The JAXWSContext that is used in processing request messages.
-     */
-    public Map<String, Object> getResponseContext() {
-        if (_responseContext == null)
-            _responseContext = new ResponseContext(this);
-        return _responseContext;
-    }
-
-    public Binding getBinding() {
-        return binding;
-    }
-
-    public void _setBinding(BindingImpl binding) {
-        this.binding = binding;
-    }
-
-    /**
-     * returns binding id from BindingImpl
-     *
-     * @return the String representing the BindingID
-     */
-    public String _getBindingId() {
-        return _bindingId;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFContext.java
deleted file mode 100644
index 30b7cc8..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFContext.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.server.RuntimeContext;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.Handler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * $author: WS Development Team
- */
-public class EndpointIFContext {
-
-    private RuntimeContext runtimeContext; //from annotationPro ess
-    private Class serviceInterface;    //prop can take out
-    private QName serviceName;
-    private Class sei;
-    private QName portName;
-    private ArrayList<Handler> handlers;
-    private String endpointAddress;
-    private String bindingId;
-
-
-    public EndpointIFContext(Class sei) {
-        this.sei = sei;
-        handlers = new ArrayList();
-    }
-
-    public RuntimeContext getRuntimeContext() {
-        return runtimeContext;
-    }
-
-    public void setRuntimeContext(RuntimeContext runtimeContext) {
-        this.runtimeContext = runtimeContext;
-    }
-
-    public Class getServiceInterface() {
-        return serviceInterface;
-    }
-
-    public void setServiceInterface(Class serviceInterface) {
-        this.serviceInterface = serviceInterface;
-    }
-
-    public Class getSei() {
-        return sei;
-    }
-
-    public void setSei(Class sei) {
-        this.sei = sei;
-    }
-
-    public QName getPortName() {
-        if (portName == null){
-        if ((runtimeContext != null) && (runtimeContext.getModel() != null))
-            portName = runtimeContext.getModel().getPortName();
-        }
-        return portName;
-    }
-
-    public String getEndpointAddress() {
-        return endpointAddress;
-    }
-
-    public void setPortInfo(QName portQName, String endpoint, String bindingID) {
-        portName = portQName;
-        endpointAddress = endpoint;
-        this.bindingId = bindingID;
-    }
-
-    public String getBindingID() {
-        return bindingId;
-    }
-
-    public QName getServiceName() {
-        return serviceName;
-    }
-
-    public boolean contains(QName serviceName) {
-        if (serviceName.equals(this.serviceName))
-            return true;
-        return false;
-    }
-
-    public void setServiceName(QName serviceName) {
-        this.serviceName = serviceName;
-    }
-
-    public void setPortName(QName portName) {
-        this.portName = portName;
-    }
-
-    public void setBindingID(String bindingId) {
-        this.bindingId = bindingId;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFInvocationHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFInvocationHandler.java
deleted file mode 100644
index f4480bc..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/EndpointIFInvocationHandler.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.wsdl.WSDLContext;
-import com.sun.xml.internal.ws.wsdl.parser.PortType;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.concurrent.Executor;
-
-public class EndpointIFInvocationHandler
-    extends EndpointIFBase
-    implements InvocationHandler, com.sun.xml.internal.ws.client.BindingProviderProperties {
-
-    Object _proxy;
-    DelegateBase _delegate;
-
-    EndpointIFContext _endpointContext;
-
-    Class _portInterface;
-    QName _serviceQName;
-
-    RuntimeContext _rtcontext;
-    WSDLContext _wsdlContext;
-    boolean failure;
-    URL wsdlDocumentLocation;
-    WSServiceDelegate _service;
-
-    /**
-     * public constructor
-     */
-
-    public EndpointIFInvocationHandler(Class portInterface, EndpointIFContext eif, WSServiceDelegate service, QName serviceName) {
-
-        if ((eif.getBindingID() == null) || (eif.getRuntimeContext() == null)) {
-            failure = true;
-            return;
-        }
-        _endpointContext = eif;
-        _portInterface = portInterface;
-        _rtcontext = eif.getRuntimeContext();
-        _bindingId = eif.getBindingID();
-        _service = service;
-
-        if (serviceName != null) {
-            if (eif.contains(serviceName))
-                _serviceQName = serviceName;
-            else
-                throw new WebServiceException("Supplied service QName " +
-                    serviceName + " does not exist in this wsdl.");
-        } else
-            _serviceQName =
-                eif.getServiceName();
-
-        if (eif.getEndpointAddress() != null)   //temp workaround for local transport kw
-            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                eif.getEndpointAddress());
-
-        ContactInfoListImpl cil = new ContactInfoListImpl();
-        //not sure I need this service argument
-        _delegate = new DelegateBase(cil, service);
-    }
-
-    public void setModel(RuntimeContext rtcontext) {
-        _rtcontext = rtcontext;
-    }
-
-    public void setProxy(Object p) {
-        _proxy = p;
-    }
-
-    public Object invoke(Object proxy, Method method, Object[] args) throws WebServiceException, Throwable {
-
-        try {
-            if (isSEIMethod(method, _portInterface)) {
-                return implementSEIMethod(method, args);
-            } else {
-                return method.invoke(this, args);
-            }
-        } catch (InvocationTargetException e) {
-            throw e.getCause();
-        }
-    }
-
-    /**
-     * Gets a new {@link com.sun.xml.internal.ws.pept.presentation.MessageStruct} from the Delegate, copies
-     * the data and metadata into the newly created MessageStruct, invokes Delegate.send, and
-     * returns the response.
-     */
-    public Object implementSEIMethod(Method method, Object[] parameters) throws Throwable {
-
-        MessageStruct messageStruct = _delegate.getMessageStruct();
-        int mmep = 0;
-        if (_rtcontext != null) {
-            JavaMethod jmethod = _rtcontext.getModel().getJavaMethod(method);
-            if (jmethod != null) {
-                int mep = jmethod.getMEP();
-                mmep = (mep == MessageStruct.REQUEST_RESPONSE_MEP) ?
-                    MessageStruct.REQUEST_RESPONSE_MEP : (mep == MessageStruct.ONE_WAY_MEP) ?
-                    MessageStruct.ONE_WAY_MEP : ((mep == MessageStruct.ASYNC_POLL_MEP) ?
-                    MessageStruct.ASYNC_POLL_MEP : MessageStruct.ASYNC_CALLBACK_MEP);
-            } else throw new WebServiceException("runtime model information for java Method " + method.getName() + " is not known .");
-        } //need to check if this is dispatch invocation
-
-        if (mmep == MessageStruct.ASYNC_CALLBACK_MEP) {
-            for (Object param : parameters) {
-                if (param != null && AsyncHandler.class.isAssignableFrom(param.getClass())) {
-                    //messageStruct.setMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER, param);
-                    messageStruct.setMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER,
-                        new AsyncHandlerService((AsyncHandler)param, getCurrentExecutor()));
-                }
-            }
-        }
-
-        messageStruct.setMethod(method);
-        messageStruct.setData(parameters);
-        RequestContext requestContext = (RequestContext)(java.util.Map)
-            ((BindingProvider) _proxy).getRequestContext();
-        requestContext.put(JAXWS_CLIENT_HANDLE_PROPERTY, _proxy);
-        messageStruct.setMetaData(JAXWS_RUNTIME_CONTEXT, _rtcontext);
-        messageStruct.setMetaData(JAXWS_CONTEXT_PROPERTY, requestContext);
-
-        //set mtom threshold value to
-        Object mtomThreshold = requestContext.get(MTOM_THRESHOLOD_VALUE);
-        messageStruct.setMetaData(MTOM_THRESHOLOD_VALUE, mtomThreshold);
-
-        messageStruct.setMEP(mmep);
-
-        // Initialize content negotiation property
-        ContentNegotiation.initialize(requestContext, messageStruct);
-
-        // Set MTOM processing for XML requests only
-        if (_rtcontext != null && _rtcontext.getModel() != null) {
-            javax.xml.ws.soap.SOAPBinding sb =
-                (binding instanceof javax.xml.ws.soap.SOAPBinding) ?
-                    (javax.xml.ws.soap.SOAPBinding) binding : null;
-            if (sb != null) {
-                _rtcontext.getModel().enableMtom(sb.isMTOMEnabled());
-            }
-        }
-
-        _delegate.send(messageStruct);
-        updateResponseContext((MessageInfo) messageStruct);
-        switch (messageStruct.getResponseType()) {
-            case MessageStruct.NORMAL_RESPONSE:
-                break;
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-                if (_rtcontext.getModel().isCheckedException(method, messageStruct.getResponse().getClass()))
-                    throw (Throwable) messageStruct.getResponse();
-                throw (Exception) messageStruct.getResponse();
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                throw (RuntimeException) messageStruct.getResponse();
-        }
-        return messageStruct.getResponse();
-    }
-
-    boolean isSEIMethod(Method method, Class sei) {
-        return (sei.equals(method.getDeclaringClass())) ? true : false;
-    }
-
-    public EndpointIFContext getEndpointContext() {
-        return _endpointContext;
-    }
-
-    public QName getServiceQName() {
-        return _serviceQName;
-    }
-
-    public Class getPortInterface(){
-        return _portInterface;
-    }
-
-     Executor getCurrentExecutor(){
-        return _service.getExecutor();
-    }
-
-    public QName getWSDLPortTypeQName(){
-        return _service.getWSDLBinding(_endpointContext.getPortName()).getPortTypeName();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java
new file mode 100644
index 0000000..9d86342
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.client;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class holds the handler information on the BindingProvider.
+ * HandlerConfiguration is immutable, and a new object is created
+ * when the BindingImpl is created or User calls Binding.setHandlerChain() or
+ * SOAPBinding.setRoles()
+ * During inovcation in Stub.process(), snapshot of the handler configuration is set in
+ * Packet.handlerConfig
+ * The information in the HandlerConfiguration is used by MUPipe and HandlerTube
+ * implementations.
+ *
+ * @author Rama Pulavarthi
+ */
+public class HandlerConfiguration {
+    private final Set<String> roles;
+    /**
+     * This chain may contain both soap and logical handlers.
+     */
+    private final List<Handler> handlerChain;
+    private final List<LogicalHandler> logicalHandlers;
+    private final List<SOAPHandler> soapHandlers;
+    private Set<QName> knownHeaders;
+    private Set<QName> handlerKnownHeaders;
+    /**
+     * @param roles                    This contains the roles assumed by the Binding implementation.
+     * @param portKnownHeaders    This contains the headers that are bound to the current WSDL Port
+     * @param handlerChain             This contains the handler chain set on the Binding
+     * @param logicalHandlers
+     * @param soapHandlers
+     * @param handlerKnownHeaders The set is comprised of headers returned from SOAPHandler.getHeaders()
+     *                                 method calls.
+     */
+    public HandlerConfiguration(Set<String> roles, Set<QName> portKnownHeaders,
+                                List<Handler> handlerChain,
+                                List<LogicalHandler> logicalHandlers, List<SOAPHandler> soapHandlers,
+                                Set<QName> handlerKnownHeaders) {
+        this.roles = roles;
+        this.handlerChain = handlerChain;
+        this.logicalHandlers = logicalHandlers;
+        this.soapHandlers = soapHandlers;
+        this.handlerKnownHeaders = handlerKnownHeaders;
+        this.knownHeaders = new HashSet<QName>();
+        if(portKnownHeaders != null)
+            knownHeaders.addAll(portKnownHeaders);
+        if(handlerKnownHeaders != null)
+            knownHeaders.addAll(handlerKnownHeaders);
+    }
+
+    public Set<String> getRoles() {
+        return roles;
+    }
+
+    /**
+     *
+     * @return return a copy of handler chain
+     */
+    public List<Handler> getHandlerChain() {
+        if(handlerChain == null)
+            return Collections.emptyList();
+        return new ArrayList<Handler>(handlerChain);
+
+    }
+
+    public List<LogicalHandler> getLogicalHandlers() {
+        return logicalHandlers;
+    }
+
+    public List<SOAPHandler> getSoapHandlers() {
+        return soapHandlers;
+    }
+
+    public Set<QName> getKnownHeaders() {
+        return knownHeaders;
+    }
+
+    public Set<QName> getHandlerKnownHeaders() {
+        return handlerKnownHeaders;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfigurator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfigurator.java
new file mode 100644
index 0000000..283b88e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfigurator.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.client.WSPortInfo;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.handler.HandlerChainsModel;
+import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
+import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor;
+
+import javax.jws.HandlerChain;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.handler.PortInfo;
+import javax.xml.ws.soap.SOAPBinding;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Used by {@link WSServiceDelegate} to configure {@link BindingImpl}
+ * with handlers. The two mechanisms encapsulated by this abstraction
+ * is {@link HandlerChain} annotaion and {@link HandlerResolver}
+ * interface.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class HandlerConfigurator {
+    /**
+     * Configures the given {@link BindingImpl} object by adding handlers to it.
+     */
+    abstract void configureHandlers(@NotNull WSPortInfo port, @NotNull BindingImpl binding);
+
+    /**
+     * Returns a {@link HandlerResolver}, if this object encapsulates any {@link HandlerResolver}.
+     * Otherwise null.
+     */
+    abstract HandlerResolver getResolver();
+
+
+    /**
+     * Configures handlers by calling {@link HandlerResolver}.
+     * <p>
+     * When a null {@link HandlerResolver} is set by the user to
+     * {@link Service#setHandlerResolver(HandlerResolver)}, we'll use this object
+     * with null {@link #resolver}.
+     */
+    static final class HandlerResolverImpl extends HandlerConfigurator {
+        private final @Nullable HandlerResolver resolver;
+
+        public HandlerResolverImpl(HandlerResolver resolver) {
+            this.resolver = resolver;
+        }
+
+        void configureHandlers(@NotNull WSPortInfo port, @NotNull BindingImpl binding) {
+            if(resolver!=null)
+                binding.setHandlerChain(resolver.getHandlerChain(port));
+        }
+
+
+        HandlerResolver getResolver() {
+            return resolver;
+        }
+    }
+
+    /**
+     * Configures handlers from {@link HandlerChain} annotation.
+     *
+     * <p>
+     * This class is a simple
+     * map of PortInfo objects to handler chains. It is used by a
+     * {@link WSServiceDelegate} object, and can
+     * be replaced by user code with a different class implementing
+     * HandlerResolver. This class is only used on the client side, and
+     * it includes a lot of logging to help when there are issues since
+     * it deals with port names, service names, and bindings. All three
+     * must match when getting a handler chain from the map.
+     *
+     * <p>It is created by the {@link WSServiceDelegate}
+     * class , which uses {@link HandlerAnnotationProcessor} to create
+     * a handler chain and then it sets the chains on this class and they
+     * are put into the map. The ServiceContext uses the map to set handler
+     * chains on bindings when they are created.
+     */
+    static final class AnnotationConfigurator extends HandlerConfigurator {
+        private final HandlerChainsModel handlerModel;
+        private final Map<WSPortInfo,HandlerAnnotationInfo> chainMap = new HashMap<WSPortInfo,HandlerAnnotationInfo>();
+        private static final Logger logger = Logger.getLogger(
+            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".handler");
+
+        AnnotationConfigurator(WSServiceDelegate delegate) {
+            handlerModel = HandlerAnnotationProcessor.buildHandlerChainsModel(delegate.getServiceClass());
+            assert handlerModel!=null; // this class is suppeod to be called only when there's @HandlerCHain
+        }
+
+
+        void configureHandlers(WSPortInfo port, BindingImpl binding) {
+            //Check in cache first
+            HandlerAnnotationInfo chain = chainMap.get(port);
+
+            if(chain==null) {
+                logGetChain(port);
+                // Put it in cache
+                chain = handlerModel.getHandlersForPortInfo(port);
+                chainMap.put(port,chain);
+            }
+
+            if (binding instanceof SOAPBinding) {
+                ((SOAPBinding) binding).setRoles(chain.getRoles());
+            }
+
+            logSetChain(port,chain);
+            binding.setHandlerChain(chain.getHandlers());
+        }
+
+        HandlerResolver getResolver() {
+            return new HandlerResolver() {
+                public List<Handler> getHandlerChain(PortInfo portInfo) {
+                    return new ArrayList<Handler>(
+                        handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
+                }
+            };
+        }
+        // logged at finer level
+        private void logSetChain(WSPortInfo info, HandlerAnnotationInfo chain) {
+            logger.finer("Setting chain of length " + chain.getHandlers().size() +
+                " for port info");
+            logPortInfo(info, Level.FINER);
+        }
+
+        // logged at fine level
+        private void logGetChain(WSPortInfo info) {
+            logger.fine("No handler chain found for port info:");
+            logPortInfo(info, Level.FINE);
+            logger.fine("Existing handler chains:");
+            if (chainMap.isEmpty()) {
+                logger.fine("none");
+            } else {
+                for (WSPortInfo key : chainMap.keySet()) {
+                    logger.fine(chainMap.get(key).getHandlers().size() +
+                        " handlers for port info ");
+                    logPortInfo(key, Level.FINE);
+                }
+            }
+        }
+
+        private void logPortInfo(WSPortInfo info, Level level) {
+            logger.log(level, "binding: " + info.getBindingID() +
+                "\nservice: " + info.getServiceName() +
+                "\nport: " + info.getPortName());
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/InternalBindingProvider.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/InternalBindingProvider.java
deleted file mode 100644
index 9ab8ff9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/InternalBindingProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.binding.BindingImpl;
-
-
-/**
- * A utility interface for all the classes
- * that implement BindingProvider.
- *
- * @see WebService#setBindingOnProvider(InternalBindingProvider,
- *      QName, String)
- */
-public interface InternalBindingProvider {
-    public void _setBinding(BindingImpl binding);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfo.java
new file mode 100644
index 0000000..fd841e9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfo.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.client.WSPortInfo;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Information about a port.
+ * <p/>
+ * This object is owned by {@link WSServiceDelegate} to keep track of a port,
+ * since a port maybe added dynamically.
+ *
+ * @author JAXWS Development Team
+ */
+public class PortInfo implements WSPortInfo {
+    private final @NotNull WSServiceDelegate owner;
+
+    public final @NotNull QName portName;
+    public final @NotNull EndpointAddress targetEndpoint;
+    public final @NotNull BindingID bindingId;
+
+    /**
+     * If a port is known statically to a WSDL, {@link PortInfo} may
+     * have the corresponding WSDL model. This would occur when the
+     * service was created with the WSDL location and the port is defined
+     * in the WSDL.
+     * <p/>
+     * If this is a {@link SEIPortInfo}, then this is always non-null.
+     */
+    public final @Nullable WSDLPort portModel;
+
+    public PortInfo(WSServiceDelegate owner, EndpointAddress targetEndpoint, QName name, BindingID bindingId) {
+        this.owner = owner;
+        this.targetEndpoint = targetEndpoint;
+        this.portName = name;
+        this.bindingId = bindingId;
+        this.portModel = getPortModel(owner, name);
+    }
+
+    public PortInfo(@NotNull WSServiceDelegate owner, @NotNull WSDLPort port) {
+        this.owner = owner;
+        this.targetEndpoint = port.getAddress();
+        this.portName = port.getName();
+        this.bindingId = port.getBinding().getBindingId();
+        this.portModel = port;
+    }
+
+    /**
+     * Creates {@link BindingImpl} for this {@link PortInfo}.
+     *
+     * @param webServiceFeatures
+     *      User-specified features.
+     * @param portInterface
+     *      Null if this is for dispatch. Otherwise the interface the proxy is going to implement
+     */
+    public BindingImpl createBinding(WebServiceFeature[] webServiceFeatures, Class<?> portInterface) {
+        WebServiceFeatureList r = new WebServiceFeatureList(webServiceFeatures);
+        if (portModel != null)
+            // merge features from WSDL
+            r.mergeFeatures(portModel, portInterface==null/*if dispatch, true*/, false);
+
+        // merge features from interceptor
+        for( WebServiceFeature wsf : owner.serviceInterceptor.preCreateBinding(this,portInterface,r) )
+            r.add(wsf);
+
+        BindingImpl bindingImpl = BindingImpl.create(bindingId, r.toArray());
+        owner.getHandlerConfigurator().configureHandlers(this,bindingImpl);
+
+        return bindingImpl;
+    }
+
+    //This method is used for Dispatch client only
+    private WSDLPort getPortModel(WSServiceDelegate owner, QName portName) {
+
+        if (owner.getWsdlService() != null){
+            Iterable<WSDLPortImpl> ports = owner.getWsdlService().getPorts();
+            for (WSDLPortImpl port : ports){
+                if (port.getName().equals(portName))
+                    return port;
+            }
+        }
+        return null;
+    }
+
+//
+// implementation of API PortInfo interface
+//
+
+    @Nullable
+    public WSDLPort getPort() {
+        return portModel;
+    }
+
+    @NotNull
+    public WSService getOwner() {
+        return owner;
+    }
+
+    @NotNull
+    public BindingID getBindingId() {
+        return bindingId;
+    }
+
+    @NotNull
+    public EndpointAddress getEndpointAddress() {
+        return targetEndpoint;
+    }
+
+    /**
+     * @deprecated
+     *      Only meant to be used via {@link javax.xml.ws.handler.PortInfo}.
+     *      Use {@link WSServiceDelegate#getServiceName()}.
+     */
+    public QName getServiceName() {
+        return owner.getServiceName();
+    }
+
+    /**
+     * @deprecated
+     *      Only meant to be used via {@link javax.xml.ws.handler.PortInfo}.
+     *      Use {@link #portName}.
+     */
+    public QName getPortName() {
+        return portName;
+    }
+
+    /**
+     * @deprecated
+     *      Only meant to be used via {@link javax.xml.ws.handler.PortInfo}.
+     *      Use {@link #bindingId}.
+     */
+    public String getBindingID() {
+        return bindingId.toString();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfoBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfoBase.java
deleted file mode 100644
index f05497a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfoBase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import javax.xml.namespace.QName;
-
-/**
- * JAXWS Development Team
- */
-public class PortInfoBase {
-
-    protected String targetEndpoint;
-    protected String defaultNamespace;
-    protected QName name;
-    protected QName portTypeName;
-    protected String bindingId;
-
-    public PortInfoBase(QName name) {
-        this.name = name;
-        targetEndpoint = "";
-        defaultNamespace = "";
-    }
-
-    public PortInfoBase(String targetEndpoint, QName name, String bindingId) {
-        this.targetEndpoint = targetEndpoint;
-        this.name = name;
-        this.bindingId = bindingId;
-    }
-
-    void setName(QName nm) {
-        name = nm;
-    }
-
-    public QName getName() {
-        return name;
-    }
-
-    void setTargetEndpoint(String endpoint) {
-        targetEndpoint = endpoint;
-    }
-
-    public String getTargetEndpoint() {
-        return targetEndpoint;
-    }
-
-    void setBindingId(String id) {
-        bindingId = id;
-    }
-
-    public String getBindingId() {
-        return bindingId;
-    }
-
-    void setPortTypeName(QName typeName) {
-        portTypeName = typeName;
-    }
-
-    public QName getPortTypeName() {
-        return portTypeName;
-    }
-
-    void setDefaultNamespace(String namespace) {
-        defaultNamespace = namespace;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java
index 94af3a2..ddf6387 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,27 +24,370 @@
  */
 package com.sun.xml.internal.ws.client;
 
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.message.Packet;
+
 import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
 
+/**
+ * Request context implementation.
+ *
+ * <h2>Why a custom map?</h2>
+ * <p>
+ * The JAX-WS spec exposes properties as a {@link Map}, but if we just use
+ * an ordinary {@link HashMap} for this, it doesn't work as fast as we'd like
+ * it to be. Hence we have this class.
+ *
+ * <p>
+ * We expect the user to set a few properties and then use that same
+ * setting to make a bunch of invocations. So we'd like to take some hit
+ * when the user actually sets a property to do some computation,
+ * then use that computed value during a method invocation again and again.
+ *
+ * <p>
+ * For this goal, we use {@link PropertySet} and implement some properties
+ * as virtual properties backed by methods. This allows us to do the computation
+ * in the setter, and store it in a field.
+ *
+ * <p>
+ * These fields are used by {@link Stub#process} to populate a {@link Packet}.
+ *
+ *
+ *
+ * <h2>How it works?</h2>
+ * <p>
+ * We make an assumption that a request context is mostly used to just
+ * get and put values, not really for things like enumerating or size.
+ *
+ * <p>
+ * So we start by maintaining state as a combination of {@link #others}
+ * bag and strongly-typed fields. As long as the application uses
+ * just {@link Map#put}, {@link Map#get}, and {@link Map#putAll}, we can
+ * do things in this way. In this mode a {@link Map} we return works as
+ * a view into {@link RequestContext}, and by itself it maintains no state.
+ *
+ * <p>
+ * If {@link RequestContext} is in this mode, its state can be copied
+ * efficiently into {@link Packet}.
+ *
+ * <p>
+ * Once the application uses any other {@link Map} method, we move to
+ * the "fallback" mode, where the data is actually stored in a {@link HashMap},
+ * this is necessary for implementing the map interface contract correctly.
+ *
+ * <p>
+ * To be safe, once we fallback, we'll never come back to the efficient state.
+ *
+ *
+ *
+ * <h2>Caution</h2>
+ * <p>
+ * Once we are in the fallback mode, none of the strongly typed field will
+ * be used, and they may contain stale values. So the only method
+ * the code outside this class can safely use is {@link #copy()},
+ * {@link #fill(Packet)}, and constructors. Do not access the strongly
+ * typed fields nor {@link #others} directly.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+@SuppressWarnings({"SuspiciousMethodCalls"})
+public final class RequestContext extends PropertySet {
+    /**
+     * The default value to be use for {@link #contentNegotiation} obtained
+     * from a system property.
+     * <p>
+     * This enables content negotiation to be easily switched on by setting
+     * a system property on the command line for testing purposes tests.
+     */
+    private static ContentNegotiation defaultContentNegotiation =
+            ContentNegotiation.obtainFromSystemProperty();
 
-public class RequestContext extends ContextMap {
+    /**
+     * Stores properties that don't fit the strongly-typed fields.
+     */
+    private final Map<String,Object> others;
 
-    public RequestContext(BindingProvider provider) {
-        super(provider);
+    /**
+     * The endpoint address to which this message is sent to.
+     *
+     * <p>
+     * This is the actual data store for {@link BindingProvider#ENDPOINT_ADDRESS_PROPERTY}.
+     */
+    private @NotNull EndpointAddress endpointAddress;
+
+    /**
+     * Creates {@link BindingProvider#ENDPOINT_ADDRESS_PROPERTY} view
+     * on top of {@link #endpointAddress}.
+     *
+     * @deprecated
+     *      always access {@link #endpointAddress}.
+     */
+    @Property(BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
+    public String getEndPointAddressString() {
+        return endpointAddress.toString();
     }
 
-    public RequestContext(PortInfoBase port, BindingProvider provider) {
-        super(port, provider);
+    public void setEndPointAddressString(String s) {
+        if(s==null)
+            throw new IllegalArgumentException();
+        else
+            this.endpointAddress = EndpointAddress.create(s);
+    }
+
+    public void setEndpointAddress(@NotNull EndpointAddress epa) {
+        this.endpointAddress = epa;
+    }
+
+    public @NotNull EndpointAddress getEndpointAddress() {
+        return endpointAddress;
+    }
+
+    /**
+     * The value of {@link ContentNegotiation#PROPERTY}
+     * property.
+     */
+    public ContentNegotiation contentNegotiation = defaultContentNegotiation;
+
+    @Property(ContentNegotiation.PROPERTY)
+    public String getContentNegotiationString() {
+        return contentNegotiation.toString();
+    }
+
+    public void setContentNegotiationString(String s) {
+        if(s==null)
+            contentNegotiation = ContentNegotiation.none;
+        else {
+            try {
+                contentNegotiation = ContentNegotiation.valueOf(s);
+            } catch (IllegalArgumentException e) {
+                // If the value is not recognized default to none
+                contentNegotiation = ContentNegotiation.none;
+            }
+        }
+    }
+    /**
+     * The value of the SOAPAction header associated with the message.
+     *
+     * <p>
+     * For outgoing messages, the transport may sends out this value.
+     * If this field is null, the transport may choose to send <tt>""</tt>
+     * (quoted empty string.)
+     *
+     * For incoming messages, the transport will set this field.
+     * If the incoming message did not contain the SOAPAction header,
+     * the transport sets this field to null.
+     *
+     * <p>
+     * If the value is non-null, it must be always in the quoted form.
+     * The value can be null.
+     *
+     * <p>
+     * Note that the way the transport sends this value out depends on
+     * transport and SOAP version.
+     *
+     * For HTTP transport and SOAP 1.1, BP requires that SOAPAction
+     * header is present (See {@BP R2744} and {@BP R2745}.) For SOAP 1.2,
+     * this is moved to the parameter of the "application/soap+xml".
+     */
+
+    private String soapAction;
+
+    @Property(BindingProvider.SOAPACTION_URI_PROPERTY)
+    public String getSoapAction(){
+        return soapAction;
+    }
+    public void setSoapAction(String sAction){
+        if(sAction == null) {
+            throw new IllegalArgumentException("SOAPAction value cannot be null");
+        }
+        soapAction = sAction;
+    }
+
+
+    /**
+     * {@link Map} exposed to the user application.
+     */
+    private final MapView mapView = new MapView();
+
+    /**
+     * Creates an empty {@link RequestContext}.
+     */
+    /*package*/ RequestContext() {
+        others = new HashMap<String, Object>();
     }
 
     /**
      * Copy constructor.
      */
-    private RequestContext(RequestContext original) {
-        super(original);
+    private RequestContext(RequestContext that) {
+        others = new HashMap<String,Object>(that.others);
+        endpointAddress = that.endpointAddress;
+        soapAction = that.soapAction;
+        contentNegotiation = that.contentNegotiation;
+        // this is fragile, but it works faster
+    }
+
+    /**
+     * The efficient get method that reads from {@link RequestContext}.
+     */
+    public Object get(Object key) {
+        if(super.supports(key))
+            return super.get(key);
+        else
+            return others.get(key);
+    }
+
+    /**
+     * The efficient put method that updates {@link RequestContext}.
+     */
+    public Object put(String key, Object value) {
+        if(super.supports(key))
+            return super.put(key,value);
+        else
+            return others.put(key,value);
+    }
+
+    /**
+     * Gets the {@link Map} view of this request context.
+     *
+     * @return
+     *      Always same object. Returned map is live.
+     */
+    public Map<String,Object> getMapView() {
+        return mapView;
+    }
+
+    /**
+     * Fill a {@link Packet} with values of this {@link RequestContext}.
+     */
+    public void fill(Packet packet) {
+        if(mapView.fallbackMap==null) {
+            if (endpointAddress != null)
+                packet.endpointAddress = endpointAddress;
+            packet.contentNegotiation = contentNegotiation;
+            if (soapAction != null) {
+                packet.soapAction = soapAction;
+            }
+            if(!others.isEmpty()) {
+                packet.invocationProperties.putAll(others);
+                //if it is not standard property it deafults to Scope.HANDLER
+                packet.getHandlerScopePropertyNames(false).addAll(others.keySet());
+            }
+        } else {
+            Set<String> handlerScopePropertyNames = new HashSet<String>();
+            // fallback mode, simply copy map in a slow way
+            for (Entry<String,Object> entry : mapView.fallbackMap.entrySet()) {
+                String key = entry.getKey();
+                if(packet.supports(key))
+                    packet.put(key,entry.getValue());
+                else
+                    packet.invocationProperties.put(key,entry.getValue());
+
+                //if it is not standard property it deafults to Scope.HANDLER
+                if(!super.supports(key)) {
+                    handlerScopePropertyNames.add(key);
+                }
+            }
+
+            if(!handlerScopePropertyNames.isEmpty())
+                packet.getHandlerScopePropertyNames(false).addAll(handlerScopePropertyNames);
+        }
     }
 
     public RequestContext copy() {
         return new RequestContext(this);
     }
+
+
+    private final class MapView implements Map<String,Object> {
+        private Map<String,Object> fallbackMap;
+
+        private Map<String,Object> fallback() {
+            if(fallbackMap==null) {
+                // has to fall back. fill in fallbackMap
+                fallbackMap = new HashMap<String,Object>(others);
+                // then put all known properties
+                for (Map.Entry<String,Accessor> prop : propMap.entrySet()) {
+                    fallbackMap.put(prop.getKey(),prop.getValue().get(RequestContext.this));
+                }
+            }
+            return fallbackMap;
+        }
+
+        public int size() {
+            return fallback().size();
+        }
+
+        public boolean isEmpty() {
+            return fallback().isEmpty();
+        }
+
+        public boolean containsKey(Object key) {
+            return fallback().containsKey(key);
+        }
+
+        public boolean containsValue(Object value) {
+            return fallback().containsValue(value);
+        }
+
+        public Object get(Object key) {
+            if (fallbackMap ==null) {
+                return RequestContext.this.get(key);
+            } else {
+                return fallback().get(key);
+            }
+        }
+
+        public Object put(String key, Object value) {
+            if(fallbackMap ==null)
+                return RequestContext.this.put(key,value);
+            else
+                return fallback().put(key, value);
+        }
+
+        public Object remove(Object key) {
+            if (fallbackMap ==null) {
+                return RequestContext.this.remove(key);
+            } else {
+                return fallback().remove(key);
+            }
+        }
+
+        public void putAll(Map<? extends String, ? extends Object> t) {
+            for (Entry<? extends String, ? extends Object> e : t.entrySet()) {
+                put(e.getKey(),e.getValue());
+            }
+        }
+
+        public void clear() {
+            fallback().clear();
+        }
+
+        public Set<String> keySet() {
+            return fallback().keySet();
+        }
+
+        public Collection<Object> values() {
+            return fallback().values();
+        }
+
+        public Set<Entry<String, Object>> entrySet() {
+            return fallback().entrySet();
+        }
+    }
+
+    protected PropertyMap getPropertyMap() {
+        return propMap;
+    }
+
+    private static final PropertyMap propMap = parse(RequestContext.class);
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContext.java
index dcb6980..d356061 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContext.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,22 +24,139 @@
  */
 package com.sun.xml.internal.ws.client;
 
-import javax.xml.ws.BindingProvider;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
 
+import javax.xml.ws.handler.MessageContext;
+import javax.activation.DataHandler;
+import java.util.AbstractMap;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
-public class ResponseContext extends ContextMap {
-    public ResponseContext(BindingProvider provider) {
-        super(provider);
-    }
+/**
+ * Implements "response context" on top of {@link Packet}.
+ *
+ * <p>
+ * This class creates a read-only {@link Map} view that
+ * gets exposed to client applications after an invocation
+ * is complete.
+ *
+ * <p>
+ * The design goal of this class is to make it efficient
+ * to create a new {@link ResponseContext}, at the expense
+ * of making some {@link Map} operations slower. This is
+ * justified because the response context is mostly just
+ * used to query a few known values, and operations like
+ * enumeration isn't likely.
+ *
+ * <p>
+ * Some of the {@link Map} methods requre this class to
+ * build the complete {@link Set} of properties, but we
+ * try to avoid that as much as possible.
+ *
+ *
+ * <pre>
+ * TODO: are we exposing all strongly-typed fields, or
+ * do they have appliation/handler scope notion?
+ * </pre>
+ *
+ * @author Kohsuke Kawaguchi
+ */
+@SuppressWarnings({"SuspiciousMethodCalls"})    // IDE doesn't like me calling Map methods with key typed as Object
+public class ResponseContext extends AbstractMap<String,Object> {
+    private final Packet packet;
 
     /**
-     * Copy constructor.
+     * Lazily computed.
      */
-    private ResponseContext(ResponseContext original) {
-        super(original);
+    private Set<Map.Entry<String,Object>> entrySet;
+
+    /**
+     * @param packet
+     *      The {@link Packet} to wrap.
+     */
+    public ResponseContext(Packet packet) {
+        this.packet = packet;
     }
 
-    public ResponseContext copy() {
-        return new ResponseContext(this);
+    public boolean containsKey(Object key) {
+        if(packet.supports(key))
+            return packet.containsKey(key);    // strongly typed
+
+        if(packet.invocationProperties.containsKey(key))
+            // if handler-scope, hide it
+            return !packet.getHandlerScopePropertyNames(true).contains(key);
+
+        return false;
     }
+
+    public Object get(Object key) {
+        if(packet.supports(key))
+            return packet.get(key);    // strongly typed
+
+        if(packet.getHandlerScopePropertyNames(true).contains(key))
+            return null;            // no such application-scope property
+
+        Object value =  packet.invocationProperties.get(key);
+
+        //add the attachments from the Message to the corresponding attachment property
+        if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){
+            Map<String, DataHandler> atts = (Map<String, DataHandler>) value;
+            if(atts == null)
+                atts = new HashMap<String, DataHandler>();
+            AttachmentSet attSet = packet.getMessage().getAttachments();
+            for(Attachment att : attSet){
+                atts.put(att.getContentId(), att.asDataHandler());
+            }
+            return atts;
+        }
+        return value;
+    }
+
+    public Object put(String key, Object value) {
+        // response context is read-only
+        throw new UnsupportedOperationException();
+    }
+
+    public Object remove(Object key) {
+        // response context is read-only
+        throw new UnsupportedOperationException();
+    }
+
+    public void putAll(Map<? extends String, ? extends Object> t) {
+        // response context is read-only
+        throw new UnsupportedOperationException();
+    }
+
+    public void clear() {
+        // response context is read-only
+        throw new UnsupportedOperationException();
+    }
+
+    public Set<Entry<String, Object>> entrySet() {
+        if(entrySet==null) {
+            // this is where the worst case happens. we have to clone the whole properties
+            // to get this view.
+
+            // use TreeSet so that toString() sort them nicely. It's easier for apps.
+            Map<String,Object> r = new HashMap<String,Object>();
+
+            // export application-scope properties
+            r.putAll(packet.invocationProperties);
+
+            // hide handler-scope properties
+            r.keySet().removeAll(packet.getHandlerScopePropertyNames(true));
+
+            // and all strongly typed ones
+            r.putAll(packet.createMapView());
+
+            entrySet = Collections.unmodifiableSet(r.entrySet());
+        }
+
+        return entrySet;
+    }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContextReceiver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContextReceiver.java
new file mode 100644
index 0000000..7a086de
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseContextReceiver.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+/**
+ * Receives {@link ResponseContext} at the end of
+ * the message invocation.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface ResponseContextReceiver {
+    /**
+     * Called upon the completion of the invocation
+     * to set a {@link ResponseContext}.
+     *
+     * <p>
+     * This method is invoked even when the invocation fails.
+     */
+    void setResponseContext(ResponseContext rc);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseImpl.java
new file mode 100644
index 0000000..a48d826
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseImpl.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.xml.internal.ws.util.CompletedFuture;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+
+/**
+ * {@link Response} implementation.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Kathy Walsh
+ */
+public final class ResponseImpl<T> extends FutureTask<T> implements Response<T>, ResponseContextReceiver {
+
+    /**
+     * Optional {@link AsyncHandler} that gets invoked
+     * at the completion of the task.
+     */
+    private final AsyncHandler<T> handler;
+    private ResponseContext responseContext;
+
+    private final Callable<T> callable;
+
+    /**
+     *
+     * @param callable
+     *      This {@link Callable} is executed asynchronously.
+     * @param handler
+     *      Optional {@link AsyncHandler} to invoke at the end
+     *      of the processing. Can be null.
+     */
+    public ResponseImpl(Callable<T> callable, AsyncHandler<T> handler) {
+        super(callable);
+        this.callable = callable;
+        this.handler = handler;
+    }
+
+    @Override
+    public void run() {
+        // override so that we call set()
+        try {
+            set(callable.call(), null);
+        } catch (Throwable t) {
+            set(null, t);
+        }
+    }
+
+    protected void set(final T v, final Throwable t) {
+        // call the handler before we mark the future as 'done'
+        if (handler!=null) {
+            try {
+                /**
+                 * {@link Response} object passed into the callback.
+                 * We need a separate {@link Future} because we don't want {@link ResponseImpl}
+                 * to be marked as 'done' before the callback finishes execution.
+                 * (That would provide implicit synchronization between the application code
+                 * in the main thread and the callback code, and is compatible with the JAX-RI 2.0 FCS.
+                 */
+                class CallbackFuture<T> extends CompletedFuture<T> implements Response<T> {
+                    public CallbackFuture(T v, Throwable t) {
+                        super(v, t);
+                    }
+
+                    public Map<String, Object> getContext() {
+                        return ResponseImpl.this.getContext();
+                    }
+                }
+                handler.handleResponse(new CallbackFuture<T>(v, t));
+            } catch (Throwable e) {
+                super.setException(e);
+                return;
+            }
+        }
+        if (t != null) {
+            super.setException(t);
+        } else {
+            super.set(v);
+        }
+    }
+
+    public ResponseContext getContext() {
+        return responseContext;
+    }
+
+    public void setResponseContext(ResponseContext rc) {
+        responseContext = rc;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SCAnnotations.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SCAnnotations.java
new file mode 100644
index 0000000..bbfbe66
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SCAnnotations.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.xml.internal.ws.util.JAXWSUtils;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+
+/**
+ * Represents parsed {@link WebServiceClient} and {@link WebEndpoint}
+ * annotations on a {@link Service}-derived class.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class SCAnnotations {
+    SCAnnotations(final Class<?> sc) {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
+                WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class);
+                if(wsc==null)
+                    throw new WebServiceException("Service Interface Annotations required, exiting...");
+
+                String name = wsc.name();
+                String tns = wsc.targetNamespace();
+                serviceQName = new QName(tns, name);
+                try {
+                    wsdlLocation = JAXWSUtils.getFileOrURL(wsc.wsdlLocation());
+                } catch (IOException e) {
+                    // TODO: report a reasonable error message
+                    throw new WebServiceException(e);
+                }
+
+                for (Method method : sc.getDeclaredMethods()) {
+                    WebEndpoint webEndpoint = method.getAnnotation(WebEndpoint.class);
+                    if (webEndpoint != null) {
+                        String endpointName = webEndpoint.name();
+                        QName portQName = new QName(tns, endpointName);
+                        portQNames.add(portQName);
+                    }
+                    Class<?> seiClazz = method.getReturnType();
+                    if (seiClazz!=void.class) {
+                        classes.add(seiClazz);
+                    }
+                }
+
+                return null;
+            }
+        });
+    }
+
+    QName serviceQName;
+    final ArrayList<QName> portQNames = new ArrayList<QName>();
+    final ArrayList<Class> classes = new ArrayList<Class>();
+    URL wsdlLocation;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SEIPortInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SEIPortInfo.java
new file mode 100644
index 0000000..f284eb2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SEIPortInfo.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+import com.sun.xml.internal.ws.model.SOAPSEIModel;
+
+import javax.xml.ws.WebServiceFeature;
+
+
+/**
+ * {@link PortInfo} that has {@link SEIModel}.
+ *
+ * This object is created statically when {@link WSServiceDelegate} is created
+ * with an service interface.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class SEIPortInfo extends PortInfo {
+    public final Class sei;
+    /**
+     * Model of {@link #sei}.
+     */
+    public final SOAPSEIModel model;
+
+    public SEIPortInfo(WSServiceDelegate owner, Class sei, SOAPSEIModel model, @NotNull WSDLPort portModel) {
+        super(owner,portModel);
+        this.sei = sei;
+        this.model = model;
+        assert sei!=null && model!=null;
+    }
+
+    public BindingImpl createBinding(WebServiceFeature[] webServiceFeatures, Class<?> portInterface) {
+         BindingImpl bindingImpl = super.createBinding(webServiceFeatures,portInterface);
+         if(bindingImpl instanceof SOAPBindingImpl) {
+            ((SOAPBindingImpl)bindingImpl).setPortKnownHeaders(model.getKnownHeaders());
+         }
+         //Not needed as set above in super.createBinding() call
+         //bindingImpl.setFeatures(webServiceFeatures);
+         return bindingImpl;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SenderException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SenderException.java
index f712344..b7fbdb9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SenderException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/SenderException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
         super("sender.nestedError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.sender";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContext.java
deleted file mode 100644
index 15c6ddb..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContext.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.handler.HandlerResolverImpl;
-import com.sun.xml.internal.ws.wsdl.WSDLContext;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.xml.sax.EntityResolver;
-
-
-/**
- * $author: WS Development Team
- */
-public class ServiceContext {
-    private WSDLContext wsdlContext; //from wsdlParsing
-
-    private Class serviceClass;
-    private HandlerResolverImpl handlerResolver;
-    private QName serviceName; //supplied on creation of service
-    private final HashSet<EndpointIFContext> seiContext = new HashSet<EndpointIFContext>();
-    /**
-     * To be used to resolve WSDL resources.
-     */
-    private final EntityResolver entityResolver;
-    private HashMap<QName,Set<String>> rolesMap = new HashMap<QName,Set<String>>();
-    public ServiceContext(EntityResolver entityResolver) {
-        this.entityResolver = entityResolver;
-    }
-
-    public ServiceContext(Class serviceClass, QName serviceName, EntityResolver entityResolver) {
-        this.serviceClass = serviceClass;
-        this.serviceName = serviceName;
-        this.entityResolver = entityResolver;
-    }
-
-    public WSDLContext getWsdlContext() {
-        return wsdlContext;
-    }
-
-    public void setWsdlContext(WSDLContext wsdlContext) {
-        this.wsdlContext = wsdlContext;
-    }
-
-    public HandlerResolverImpl getHandlerResolver() {
-        return handlerResolver;
-    }
-
-    public void setHandlerResolver(HandlerResolverImpl resolver) {
-        this.handlerResolver = resolver;
-    }
-
-    public Set<String> getRoles(QName portName) {
-        return rolesMap.get(portName);
-    }
-
-    public void setRoles(QName portName,Set<String> roles) {
-        rolesMap.put(portName,roles);
-    }
-
-    public EndpointIFContext getEndpointIFContext(String className) {
-        for (EndpointIFContext eif: seiContext){
-            if (eif.getSei().getName().equals(className)){
-                //this is the one
-                return eif;
-            }
-        }
-        return null;
-    }
-
-    public HashSet<EndpointIFContext> getEndpointIFContext() {
-            return seiContext;
-        }
-
-    public void addEndpointIFContext(EndpointIFContext eifContext) {
-        this.seiContext.add(eifContext);
-    }
-
-     public void addEndpointIFContext(List<EndpointIFContext> eifContexts) {
-        this.seiContext.addAll(eifContexts);
-    }
-
-    public Class getServiceClass() {
-        return serviceClass;
-    }
-
-    public void setServiceClass(Class serviceClass) {
-        this.serviceClass = serviceClass;
-    }
-
-    public QName getServiceName() {
-        if (serviceName == null) {
-            if (wsdlContext != null) {
-                setServiceName(wsdlContext.getFirstServiceName());
-            }
-        }
-        return serviceName;
-    }
-
-    public void setServiceName(QName serviceName) {
-        assert(serviceName != null);
-        this.serviceName = serviceName;
-    }
-
-    public EntityResolver getEntityResolver() {
-        return entityResolver;
-    }
-
-    public String toString() {
-        return "ServiceContext{" +
-            "wsdlContext=" + wsdlContext +
-            ", handleResolver=" + handlerResolver +
-            ", serviceClass=" + serviceClass +
-            ", serviceName=" + serviceName +
-            ", seiContext=" + seiContext +
-            ", entityResolver=" + entityResolver +
-            "}";
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContextBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContextBuilder.java
deleted file mode 100644
index 40050dc..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ServiceContextBuilder.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-import com.sun.xml.internal.ws.handler.HandlerResolverImpl;
-import com.sun.xml.internal.ws.handler.PortInfoImpl;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.modeler.RuntimeModeler;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
-import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
-import com.sun.xml.internal.ws.wsdl.WSDLContext;
-import org.xml.sax.EntityResolver;
-import javax.jws.HandlerChain;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceException;
-import javax.jws.WebService;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-
-/**
- * $author: WS Development Team
- */
-public abstract class ServiceContextBuilder {
-    private ServiceContextBuilder() {
-    }  // no instantication please
-
-    /**
-     * Creates a new {@link ServiceContext}.
-     */
-    public static ServiceContext build(URL wsdlLocation, QName serviceName, final Class service, EntityResolver er) throws WebServiceException {
-        ServiceContext serviceContext = new ServiceContext(service, serviceName, er);
-
-        if (wsdlLocation != null){
-            WSDLContext wsCtx = new WSDLContext(wsdlLocation, er);
-
-            //check if the serviceName is a valid one, if its not in the given WSDL fail
-            if(!wsCtx.contains(serviceName))
-                throw new ClientConfigurationException("service.invalidServiceName", serviceName, wsdlLocation);
-
-            serviceContext.setWsdlContext(wsCtx);
-        }
-
-        //if @HandlerChain present, set HandlerResolver on service context
-        HandlerChain handlerChain = (HandlerChain)
-        AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-                return service.getAnnotation(HandlerChain.class);
-            }
-        });
-        if(handlerChain != null) {
-            HandlerResolverImpl hresolver = new HandlerResolverImpl(serviceContext);
-            serviceContext.setHandlerResolver(hresolver);
-        }
-        return serviceContext;
-    }
-
-    public static void completeServiceContext(QName portName, ServiceContext serviceContext, Class portInterface) {
-        if (portInterface != null)
-            processAnnotations(portName, serviceContext, portInterface);
-    }
-
-    private static void processAnnotations(QName portName, ServiceContext serviceContext, Class portInterface) throws WebServiceException {
-        WSDLContext wsdlContext = serviceContext.getWsdlContext();
-        EndpointIFContext eifc = serviceContext.getEndpointIFContext(portInterface.getName());
-        if ((eifc != null) && (eifc.getRuntimeContext() != null)) {
-            return;
-        }
-        if (eifc == null) {
-            eifc = new EndpointIFContext(portInterface);
-            serviceContext.addEndpointIFContext(eifc);
-        }
-
-        QName serviceName = serviceContext.getServiceName();
-
-        //if portName is null get it from the WSDL
-        if (portName == null) {
-            //get the first port corresponding to the SEI
-            QName portTypeName = RuntimeModeler.getPortTypeName(portInterface);
-            portName = wsdlContext.getWsdlDocument().getPortName(serviceContext.getServiceName(), portTypeName);
-        }
-
-        //still no portName, fail
-        if(portName == null)
-            throw new ClientConfigurationException("service.noPortName", portInterface.getName(), wsdlContext.getWsdlLocation().toString());
-
-        eifc.setPortName(portName);
-        String bindingId = wsdlContext.getBindingID(serviceName, portName);
-        RuntimeModeler modeler = new RuntimeModeler(portInterface,
-            serviceName, bindingId);
-        modeler.setPortName(portName);
-        RuntimeModel model = modeler.buildRuntimeModel();
-
-        eifc.setRuntimeContext(new RuntimeContext(model));
-    }
-
-    private ArrayList<Class<?>> getSEI(final Class sc) {
-
-        if (sc == null) {
-            throw new WebServiceException();
-        }
-
-        //check to make sure this is a service
-        if (!Service.class.isAssignableFrom(sc)) {
-            throw new WebServiceException("service.interface.required" +
-                sc.getName());
-        }
-
-        final ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
-        AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-                Method[] methods = sc.getDeclaredMethods();
-                for (final Method method : methods) {
-                    method.setAccessible(true);
-                    Class<?> seiClazz = method.getReturnType();
-                    if ((seiClazz != null) && (!seiClazz.equals("void")))
-                        classes.add(seiClazz);
-
-                }
-                return null;
-            }
-        });
-
-        return classes;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/Stub.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/Stub.java
new file mode 100644
index 0000000..a1c5160
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/Stub.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.Closeable;
+import com.sun.xml.internal.ws.model.wsdl.WSDLProperties;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Engine;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.developer.JAXWSProperties;
+import com.sun.xml.internal.ws.developer.WSBindingProvider;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.util.Pool;
+import com.sun.xml.internal.ws.util.Pool.TubePool;
+import com.sun.xml.internal.ws.util.RuntimeVersion;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+/**
+ * Base class for stubs, which accept method invocations from
+ * client applications and pass the message to a {@link Tube}
+ * for processing.
+ *
+ * <p>
+ * This class implements the management of pipe instances,
+ * and most of the {@link BindingProvider} methods.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Stub implements WSBindingProvider, ResponseContextReceiver, Closeable {
+
+    /**
+     * Reuse pipelines as it's expensive to create.
+     * <p>
+     * Set to null when {@link #close() closed}.
+     */
+    private Pool<Tube> tubes;
+
+    private final Engine engine;
+
+    /**
+     * The {@link WSServiceDelegate} object that owns us.
+     */
+    protected final WSServiceDelegate owner;
+
+    /**
+     * Non-null if this stub is configured to talk to an EPR.
+     * <p>
+     * When this field is non-null, its reference parameters are sent as out-bound headers.
+     * This field can be null even when addressing is enabled, but if the addressing is
+     * not enabled, this field must be null.
+     * <p>
+     * Unlike endpoint address, we are not letting users to change the EPR,
+     * as it contains references to services and so on that we don't want to change.
+     */
+    protected final @Nullable WSEndpointReference endpointReference;
+
+    protected final BindingImpl binding;
+
+    /**
+     * represents AddressingVersion on binding if enabled, otherwise null;
+     */
+    protected final AddressingVersion addrVersion;
+
+    public final RequestContext requestContext = new RequestContext();
+
+    /**
+     * {@link ResponseContext} from the last synchronous operation.
+     */
+    private ResponseContext responseContext;
+    @Nullable protected final WSDLPort wsdlPort;
+
+    /**
+     * {@link Header}s to be added to outbound {@link Packet}.
+     * The contents is determined by the user.
+     */
+    @Nullable private volatile Header[] userOutboundHeaders;
+
+    private final @Nullable WSDLProperties wsdlProperties;
+
+    /**
+     * @param master                 The created stub will send messages to this pipe.
+     * @param binding                As a {@link BindingProvider}, this object will
+     *                               return this binding from {@link BindingProvider#getBinding()}.
+     * @param defaultEndPointAddress The destination of the message. The actual destination
+     *                               could be overridden by {@link RequestContext}.
+     * @param epr                    To create a stub that sends out reference parameters
+     *                               of a specific EPR, give that instance. Otherwise null.
+     *                               Its address field will not be used, and that should be given
+     *                               separately as the <tt>defaultEndPointAddress</tt>.
+     */
+    protected Stub(WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) {
+        this.owner = owner;
+        this.tubes = new TubePool(master);
+        this.wsdlPort = wsdlPort;
+        this.binding = binding;
+        addrVersion = binding.getAddressingVersion();
+        // if there is an EPR, EPR's address should be used for invocation instead of default address
+        if(epr != null)
+            this.requestContext.setEndPointAddressString(epr.getAddress());
+        else
+            this.requestContext.setEndpointAddress(defaultEndPointAddress);
+        this.engine = new Engine(toString());
+        this.endpointReference = epr;
+        wsdlProperties = (wsdlPort==null) ? null : new WSDLProperties(wsdlPort);
+    }
+
+    /**
+     * Gets the port name that this stub is configured to talk to.
+     * <p>
+     * When {@link #wsdlPort} is non-null, the port name is always
+     * the same as {@link WSDLPort#getName()}, but this method
+     * returns a port name even if no WSDL is available for this stub.
+     */
+    protected abstract @NotNull QName getPortName();
+
+    /**
+     * Gets the service name that this stub is configured to talk to.
+     * <p>
+     * When {@link #wsdlPort} is non-null, the service name is always
+     * the same as the one that's inferred from {@link WSDLPort#getOwner()},
+     * but this method returns a port name even if no WSDL is available for
+     * this stub.
+     */
+    protected final @NotNull QName getServiceName() {
+        return owner.getServiceName();
+    }
+
+    /**
+     * Gets the {@link Executor} to be used for asynchronous method invocations.
+     * <p>
+     * Note that the value this method returns may different from invocations
+     * to invocations. The caller must not cache.
+     *
+     * @return always non-null.
+     */
+    public final Executor getExecutor() {
+        return owner.getExecutor();
+    }
+
+    /**
+     * Passes a message to a pipe for processing.
+     * <p>
+     * Unlike {@link Tube} instances,
+     * this method is thread-safe and can be invoked from
+     * multiple threads concurrently.
+     *
+     * @param packet         The message to be sent to the server
+     * @param requestContext The {@link RequestContext} when this invocation is originally scheduled.
+     *                       This must be the same object as {@link #requestContext} for synchronous
+     *                       invocations, but for asynchronous invocations, it needs to be a snapshot
+     *                       captured at the point of invocation, to correctly satisfy the spec requirement.
+     * @param receiver       Receives the {@link ResponseContext}. Since the spec requires
+     *                       that the asynchronous invocations must not update response context,
+     *                       depending on the mode of invocation they have to go to different places.
+     *                       So we take a setter that abstracts that away.
+     */
+    protected final Packet process(Packet packet, RequestContext requestContext, ResponseContextReceiver receiver) {
+        {// fill in Packet
+            packet.proxy = this;
+            packet.handlerConfig = binding.getHandlerConfig();
+            requestContext.fill(packet);
+            if (wsdlProperties != null) {
+                packet.addSatellite(wsdlProperties);
+            }
+            if (addrVersion != null) {
+                // populate request WS-Addressing headers
+                HeaderList headerList = packet.getMessage().getHeaders();
+                headerList.fillRequestAddressingHeaders(wsdlPort, binding, packet);
+
+
+                // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled,
+                // but the EPR has ReferenceParameters.
+                // Current approach: Add ReferenceParameters only if addressing enabled.
+                if (endpointReference != null)
+                    endpointReference.addReferenceParameters(packet.getMessage().getHeaders());
+            }
+
+            // to make it multi-thread safe we need to first get a stable snapshot
+            Header[] hl = userOutboundHeaders;
+            if(hl!=null)
+                packet.getMessage().getHeaders().addAll(hl);
+        }
+
+
+        Pool<Tube> pool = tubes;
+        if (pool == null)
+            throw new WebServiceException("close method has already been invoked"); // TODO: i18n
+
+        Fiber fiber = engine.createFiber();
+        // then send it away!
+        Tube tube = pool.take();
+
+        try {
+            return fiber.runSync(tube, packet);
+        } finally {
+            // this allows us to capture the packet even when the call failed with an exception.
+            // when the call fails with an exception it's no longer a 'reply' but it may provide some information
+            // about what went wrong.
+
+            // note that Packet can still be updated after
+            // ResponseContext is created.
+            Packet reply = (fiber.getPacket() == null) ? packet : fiber.getPacket();
+            receiver.setResponseContext(new ResponseContext(reply));
+
+            pool.recycle(tube);
+        }
+    }
+
+    /**
+     * Passes a message through a {@link Tube}line for processing. The processing happens
+     * asynchronously and when the response is available, Fiber.CompletionCallback is
+     * called. The processing could happen on multiple threads.
+     *
+     * <p>
+     * Unlike {@link Tube} instances,
+     * this method is thread-safe and can be invoked from
+     * multiple threads concurrently.
+     *
+     * @param request         The message to be sent to the server
+     * @param requestContext The {@link RequestContext} when this invocation is originally scheduled.
+     *                       This must be the same object as {@link #requestContext} for synchronous
+     *                       invocations, but for asynchronous invocations, it needs to be a snapshot
+     *                       captured at the point of invocation, to correctly satisfy the spec requirement.
+     * @param completionCallback Once the processing is done, the callback is invoked.
+     */
+    protected final void processAsync(Packet request, RequestContext requestContext, final Fiber.CompletionCallback completionCallback) {
+        // fill in Packet
+        request.proxy = this;
+        request.handlerConfig = binding.getHandlerConfig();
+        requestContext.fill(request);
+        if (wsdlProperties != null) {
+            request.addSatellite(wsdlProperties);
+        }
+        if (AddressingVersion.isEnabled(binding)) {
+            if(endpointReference!=null)
+                endpointReference.addReferenceParameters(request.getMessage().getHeaders());
+        }
+
+        final Pool<Tube> pool = tubes;
+        if (pool == null)
+            throw new WebServiceException("close method has already been invoked"); // TODO: i18n
+
+        Fiber fiber = engine.createFiber();
+        // then send it away!
+        final Tube tube = pool.take();
+        fiber.start(tube, request, new Fiber.CompletionCallback() {
+            public void onCompletion(@NotNull Packet response) {
+                pool.recycle(tube);
+                completionCallback.onCompletion(response);
+            }
+            public void onCompletion(@NotNull Throwable error) {
+                // let's not reuse tubes as they might be in a wrong state, so not
+                // calling pool.recycle()
+                completionCallback.onCompletion(error);
+            }
+        });
+    }
+
+    public void close() {
+        if (tubes != null) {
+            // multi-thread safety of 'close' needs to be considered more carefully.
+            // some calls might be pending while this method is invoked. Should we
+            // block until they are complete, or should we abort them (but how?)
+            Tube p = tubes.take();
+            tubes = null;
+            p.preDestroy();
+        }
+    }
+
+    public final WSBinding getBinding() {
+        return binding;
+    }
+
+    public final Map<String, Object> getRequestContext() {
+        return requestContext.getMapView();
+    }
+
+    public final ResponseContext getResponseContext() {
+        return responseContext;
+    }
+
+    public void setResponseContext(ResponseContext rc) {
+        this.responseContext = rc;
+    }
+
+    public String toString() {
+        return RuntimeVersion.VERSION + ": Stub for " + getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+    }
+
+    public final W3CEndpointReference getEndpointReference() {
+        if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING))
+            throw new java.lang.UnsupportedOperationException(ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference()", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding"));
+        return getEndpointReference(W3CEndpointReference.class);
+    }
+
+    public final <T extends EndpointReference>
+    T getEndpointReference(Class<T> clazz) {
+
+        if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING))
+            throw new java.lang.UnsupportedOperationException(ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference(Class<T> class)", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding"));
+
+        // we need to expand WSEndpointAddress class to be able to return EPR with arbitrary address.
+        if (endpointReference != null) {
+            return endpointReference.toSpec(clazz);
+        }
+        String eprAddress = requestContext.getEndpointAddress().toString();
+        QName portTypeName = null;
+        String wsdlAddress = null;
+        if(wsdlPort!=null) {
+            portTypeName = wsdlPort.getBinding().getPortTypeName();
+            wsdlAddress = eprAddress +"?wsdl";
+        }
+        AddressingVersion av = AddressingVersion.fromSpecClass(clazz);
+        if (av == AddressingVersion.W3C) {
+            // Supress writing ServiceName and EndpointName in W3C EPR,
+            // Until the ns for those metadata elements is resolved.
+            return new WSEndpointReference(
+                    AddressingVersion.W3C,
+                    eprAddress, null /*getServiceName()*/, null/*getPortName()*/, null /* portTypeName*/, null, null /*wsdlAddress*/, null).toSpec(clazz);
+        } else {
+            return new WSEndpointReference(
+                    AddressingVersion.MEMBER,
+                    eprAddress, getServiceName(), getPortName(), portTypeName, null, wsdlAddress, null).toSpec(clazz);
+        }
+    }
+
+//
+//
+// WSBindingProvider methods
+//
+//
+    public final void setOutboundHeaders(List<Header> headers) {
+        if(headers==null) {
+            this.userOutboundHeaders = null;
+        } else {
+            for (Header h : headers) {
+                if(h==null)
+                    throw new IllegalArgumentException();
+            }
+            userOutboundHeaders = headers.toArray(new Header[headers.size()]);
+        }
+    }
+
+    public final void setOutboundHeaders(Header... headers) {
+        if(headers==null) {
+            this.userOutboundHeaders = null;
+        } else {
+            for (Header h : headers) {
+                if(h==null)
+                    throw new IllegalArgumentException();
+            }
+            Header[] hl = new Header[headers.length];
+            System.arraycopy(headers,0,hl,0,headers.length);
+            userOutboundHeaders = hl;
+        }
+    }
+
+    public final List<Header> getInboundHeaders() {
+        return Collections.unmodifiableList((HeaderList)
+            responseContext.get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSFuture.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSFuture.java
deleted file mode 100644
index cb2d320..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSFuture.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client;
-
-
-import com.sun.xml.internal.ws.client.ResponseContext;
-
-import javax.xml.ws.Response;
-import java.rmi.server.UID;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.logging.Logger;
-
-/**
- * The <code>Response</code> interface provides methods used to obtain the
- * payload and context a message sent in response to an operation invocation.
- * For asynchronous operation invocations it provides additional methods to
- * check the status of the request.
- *
- * @author JAXWS Development Team
- */
-
-
-public class WSFuture<T> extends FutureTask<T> {
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-
-    private Lock _lock;
-
-    public WSFuture(Callable<T> callable) {
-        super(callable);
-        _lock = new ReentrantLock();
-    }
-
-    public WSFuture(Runnable runable, T result) {
-        super(runable, result);
-        _lock = new ReentrantLock();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java
index 772c605..f9f0393 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,36 +23,59 @@
  * have any questions.
  */
 
-/*
- * Copyright (c) 2005 Your Corporation. All Rights Reserved.
- */
 package com.sun.xml.internal.ws.client;
 
-import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver;
-import com.sun.xml.internal.ws.binding.http.HTTPBindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.client.dispatch.DispatchBase;
-import com.sun.xml.internal.ws.handler.PortInfoImpl;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.xml.internal.ws.wsdl.WSDLContext;
-import com.sun.xml.internal.ws.wsdl.parser.Binding;
-import org.xml.sax.EntityResolver;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.Closeable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.client.ServiceInterceptor;
+import com.sun.xml.internal.ws.api.client.ServiceInterceptorFactory;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.pipe.*;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.server.ContainerResolver;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.client.HandlerConfigurator.AnnotationConfigurator;
+import com.sun.xml.internal.ws.client.HandlerConfigurator.HandlerResolverImpl;
+import com.sun.xml.internal.ws.client.sei.SEIStub;
+import com.sun.xml.internal.ws.developer.WSBindingProvider;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.RuntimeModeler;
+import com.sun.xml.internal.ws.model.SOAPSEIModel;
+import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.resources.DispatchMessages;
+import com.sun.xml.internal.ws.resources.ProviderApiMessages;
+import com.sun.xml.internal.ws.util.ServiceConfigurationError;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import static com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+import org.xml.sax.SAXException;
 
+import javax.jws.HandlerChain;
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.*;
 import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.handler.PortInfo;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.spi.ServiceDelegate;
+import javax.xml.ws.soap.AddressingFeature;
+import java.io.IOException;
 import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
 import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
@@ -60,6 +83,7 @@
 
 /**
  * <code>Service</code> objects provide the client view of a Web service.
+ *
  * <p><code>Service</code> acts as a factory of the following:
  * <ul>
  * <li>Proxies for a target service endpoint.
@@ -67,15 +91,15 @@
  * dynamic message-oriented invocation of a remote
  * operation.
  * </li>
- * <p/>
+ *
  * <p>The ports available on a service can be enumerated using the
  * <code>getPorts</code> method. Alternatively, you can pass a
  * service endpoint interface to the unary <code>getPort</code> method
  * and let the runtime select a compatible port.
- * <p/>
+ *
  * <p>Handler chains for all the objects created by a <code>Service</code>
  * can be set by means of the provided <code>HandlerRegistry</code>.
- * <p/>
+ *
  * <p>An <code>Executor</code> may be set on the service in order
  * to gain better control over the threads used to dispatch asynchronous
  * callbacks. For instance, thread pooling with certain parameters
@@ -83,79 +107,146 @@
  * registering it with the service.
  *
  * @author WS Development Team
- * @see java.util.concurrent.Executor
+ * @see Executor
  * @since JAX-WS 2.0
  */
-public class WSServiceDelegate extends ServiceDelegate {
-
-    protected static final String GET = "get";
-
-    protected HashSet<QName> ports;
-
-    protected HashMap<QName, PortInfoBase> dispatchPorts;
-    protected HandlerResolver handlerResolver;
-
-    protected Object serviceProxy;
-    protected URL wsdlLocation;
-    protected ServiceContext serviceContext;
-    protected Executor executor;
-    private HashSet<Object> seiProxies;
+public class WSServiceDelegate extends WSService {
+    /**
+     * All ports.
+     * <p>
+     * This includes ports statically known to WSDL, as well as
+     * ones that are dynamically added
+     * through {@link #addPort(QName, String, String)}.
+     * <p>
+     * For statically known ports we'll have {@link SEIPortInfo}.
+     * For dynamically added ones we'll have {@link PortInfo}.
+     */
+    private final Map<QName, PortInfo> ports = new HashMap<QName, PortInfo>();
 
     /**
-     * {@link CatalogResolver} to check META-INF/jax-ws-catalog.xml.
-     * Lazily created.
+     * Whenever we create {@link BindingProvider}, we use this to configure handlers.
      */
-    private EntityResolver entityResolver;
+    private @NotNull HandlerConfigurator handlerConfigurator = new HandlerResolverImpl(null);
+
+    private final Class<? extends Service> serviceClass;
+
+    /**
+     * Name of the service for which this {@link WSServiceDelegate} is created for.
+     */
+    private final @NotNull QName serviceName;
+
+    /**
+     * Information about SEI, keyed by their interface type.
+     */
+   // private final Map<Class,SEIPortInfo> seiContext = new HashMap<Class,SEIPortInfo>();
+   private final Map<QName,SEIPortInfo> seiContext = new HashMap<QName,SEIPortInfo>();
+    private Executor executor;
+
+    /**
+     * The WSDL service that this {@link Service} object represents.
+     * <p>
+     * This field is null iff no WSDL is given to {@link Service}.
+     * This fiels can be be null if the service is created without wsdl but later
+     * the epr supplies a wsdl that can be parsed.
+     */
+    private  @Nullable WSDLServiceImpl wsdlService;
+
+    private final Container container;
+    /**
+     * Multiple {@link ServiceInterceptor}s are aggregated into one.
+     */
+    /*package*/ final @NotNull ServiceInterceptor serviceInterceptor;
 
 
-    public WSServiceDelegate(ServiceContext scontext) {
-        serviceContext = scontext;
-        this.dispatchPorts = new HashMap();
-        seiProxies = new HashSet();
-        if (serviceContext.getHandlerResolver() != null) {
-            handlerResolver = serviceContext.getHandlerResolver();
-        }
+    public WSServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass) {
+        this(
+            wsdlDocumentLocation==null ? null : new StreamSource(wsdlDocumentLocation.toExternalForm()),
+            serviceName,serviceClass);
     }
 
-    public WSServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass) {
+    /**
+     * @param serviceClass
+     *      Either {@link Service}.class or other generated service-derived classes.
+     */
+    public WSServiceDelegate(@Nullable Source wsdl, @NotNull QName serviceName, @NotNull final Class<? extends Service> serviceClass) {
         //we cant create a Service without serviceName
         if (serviceName == null)
-            throw new ClientConfigurationException("service.noServiceName");
+            throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(serviceName));
+        this.serviceName = serviceName;
+        this.serviceClass = serviceClass;
+        this.container = ContainerResolver.getInstance().getContainer();
 
-        this.dispatchPorts = new HashMap();
-        seiProxies = new HashSet();
+        // load interceptor
+        ServiceInterceptor interceptor = ServiceInterceptorFactory.load(this, Thread.currentThread().getContextClassLoader());
+        ServiceInterceptor si = container.getSPI(ServiceInterceptor.class);
+        if (si != null) {
+            interceptor = ServiceInterceptor.aggregate(interceptor, si);
+        }
+        this.serviceInterceptor = interceptor;
 
-        serviceContext = ServiceContextBuilder.build(wsdlDocumentLocation, serviceName,
-            serviceClass, XmlUtil.createDefaultCatalogResolver());
 
-        if (serviceContext.getHandlerResolver() != null) {
-            handlerResolver = serviceContext.getHandlerResolver();
+        WSDLServiceImpl service=null;
+        if (wsdl != null) {
+            try {
+                URL url = wsdl.getSystemId()==null ? null : new URL(wsdl.getSystemId());
+                WSDLModelImpl model = parseWSDL(url, wsdl);
+                service = model.getService(this.serviceName);
+                if (service == null)
+                    throw new WebServiceException(
+                        ClientMessages.INVALID_SERVICE_NAME(this.serviceName,
+                            buildNameList(model.getServices().keySet())));
+                // fill in statically known ports
+                for (WSDLPortImpl port : service.getPorts())
+                    ports.put(port.getName(), new PortInfo(this, port));
+            } catch (MalformedURLException e) {
+                throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
+            }
+        }
+        this.wsdlService = service;
+
+        if (serviceClass != Service.class) {
+            //if @HandlerChain present, set HandlerResolver on service context
+            HandlerChain handlerChain =
+                    AccessController.doPrivileged(new PrivilegedAction<HandlerChain>() {
+                        public HandlerChain run() {
+                            return serviceClass.getAnnotation(HandlerChain.class);
+                        }
+                    });
+            if (handlerChain != null)
+                handlerConfigurator = new AnnotationConfigurator(this);
         }
 
-        populatePorts();
     }
 
-    private void processServiceContext(QName portName, Class portInterface) throws WebServiceException {
-        ServiceContextBuilder.completeServiceContext(portName, serviceContext, portInterface);
+    /**
+     * Parses the WSDL and builds {@link WSDLModel}.
+     * @param wsdlDocumentLocation
+     *      Either this or <tt>wsdl</tt> parameter must be given.
+     *      Null location means the system won't be able to resolve relative references in the WSDL,
+     */
+    private WSDLModelImpl parseWSDL(URL wsdlDocumentLocation, Source wsdlSource) {
+        try {
+            return RuntimeWSDLParser.parse(wsdlDocumentLocation, wsdlSource, createDefaultCatalogResolver(),
+                true, ServiceFinder.find(WSDLParserExtension.class).toArray());
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        } catch (SAXException e) {
+            throw new WebServiceException(e);
+        } catch (ServiceConfigurationError e) {
+            throw new WebServiceException(e);
+        }
     }
 
-    public URL getWSDLLocation() {
-        if (wsdlLocation == null)
-            setWSDLLocation(getWsdlLocation());
-        return wsdlLocation;
-    }
 
-    public void setWSDLLocation(URL location) {
-        wsdlLocation = location;
-    }
+
 
     public Executor getExecutor() {
-        if (executor != null)
-        //todo:needs to be decoupled from service at execution
-        {
-            return (Executor) executor;
+        if (executor != null) {
+            return executor;
         } else
-            executor = Executors.newFixedThreadPool(3, new DaemonThreadFactory());
+            executor = Executors.newCachedThreadPool(new DaemonThreadFactory());
         return executor;
     }
 
@@ -163,261 +254,360 @@
         this.executor = executor;
     }
 
-
     public HandlerResolver getHandlerResolver() {
-        return handlerResolver;
+        return handlerConfigurator.getResolver();
+    }
+
+    /*package*/ final HandlerConfigurator getHandlerConfigurator() {
+        return handlerConfigurator;
     }
 
     public void setHandlerResolver(HandlerResolver resolver) {
-        handlerResolver = resolver;
+        handlerConfigurator = new HandlerResolverImpl(resolver);
     }
 
-    public Object getPort(QName portName, Class portInterface)
-        throws WebServiceException {
-        Object seiProxy = createEndpointIFBaseProxy(portName, portInterface);
-        seiProxies.add(seiProxy);
-        if (portName != null) {
-            addPort(portName);
-        }
-
-        return seiProxy;
+    public <T> T getPort(QName portName, Class<T> portInterface) throws WebServiceException {
+        return getPort(portName, portInterface, EMPTY_FEATURES);
     }
 
-    public Object getPort(Class portInterface) throws WebServiceException {
-        return createEndpointIFBaseProxy(null, portInterface);
+    public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
+        if (portName == null || portInterface == null)
+            throw new IllegalArgumentException();
+        WSDLPortImpl portModel = getPortModel(portName);
+        return getPort(portModel.getEPR(),portName,portInterface,features);
     }
 
-    //todo: rename addPort :spec tbd
-    public void addPort(QName portName, String bindingId,
-                        String endpointAddress) throws WebServiceException {
+    public <T> T getPort(EndpointReference epr, Class<T> portInterface, WebServiceFeature... features) {
+        return getPort(WSEndpointReference.create(epr),portInterface,features);
+    }
 
-        if (!dispatchPorts.containsKey(portName)) {
-            dispatchPorts.put(portName, new PortInfoBase(endpointAddress,
-                portName, bindingId));
+    public <T> T getPort(WSEndpointReference wsepr, Class<T> portInterface, WebServiceFeature... features) {
+        //get the portType from SEI, so that it can be used if EPR does n't have endpointName
+        QName portTypeName = RuntimeModeler.getPortTypeName(portInterface);
+        //if port name is not specified in EPR, it will use portTypeName to get it from the WSDL model.
+        QName portName = getPortNameFromEPR(wsepr, portTypeName);
+        return getPort(wsepr,portName,portInterface,features);
+    }
+
+    private <T> T getPort(WSEndpointReference wsepr, QName portName, Class<T> portInterface,
+                          WebServiceFeature... features) {
+        addSEI(portName, portInterface);
+        return createEndpointIFBaseProxy(wsepr,portName,portInterface,features);
+    }
+    public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
+        //get the portType from SEI
+        QName portTypeName = RuntimeModeler.getPortTypeName(portInterface);
+        //get the first port corresponding to the SEI
+        WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName);
+        if (port == null)
+                throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
+        QName portName = port.getName();
+        return getPort(portName, portInterface,features);
+    }
+
+    public <T> T getPort(Class<T> portInterface) throws WebServiceException {
+        return getPort(portInterface, EMPTY_FEATURES);
+    }
+
+    public void addPort(QName portName, String bindingId, String endpointAddress) throws WebServiceException {
+        if (!ports.containsKey(portName)) {
+            BindingID bid = (bindingId == null) ? BindingID.SOAP11_HTTP : BindingID.parse(bindingId);
+            ports.put(portName,
+                    new PortInfo(this, (endpointAddress == null) ? null :
+                            EndpointAddress.create(endpointAddress), portName, bid));
         } else
-            throw new WebServiceException("Port " + portName.toString() + " already exists can not create a port with the same name.");
-        // need to add port to list for HandlerRegistry
-        addPort(portName);
+            throw new WebServiceException(DispatchMessages.DUPLICATE_PORT(portName.toString()));
     }
 
 
-    public <T> Dispatch<T> createDispatch(QName qName, Class<T> aClass, Service.Mode mode) throws WebServiceException {
-        return createDispatchClazz(qName, aClass, mode);
+    public <T> Dispatch<T> createDispatch(QName portName, Class<T>  aClass, Service.Mode mode) throws WebServiceException {
+        return createDispatch(portName, aClass, mode, EMPTY_FEATURES);
     }
 
-    public Dispatch<Object> createDispatch(QName qName, JAXBContext jaxbContext, Service.Mode mode) throws WebServiceException {
-        return createDispatchJAXB(qName, jaxbContext, mode);
+    @Override
+    public <T> Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, Service.Mode mode, WebServiceFeature... features) {
+        PortInfo port = safeGetPort(portName);
+        BindingImpl binding = port.createBinding(features,null);
+        Dispatch<T> dispatch = Stubs.createDispatch(portName, this, binding, aClass, mode, createPipeline(port, binding), wsepr);
+        serviceInterceptor.postCreateDispatch((WSBindingProvider) dispatch);
+        return dispatch;
     }
 
+    public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeature... features) {
+        WebServiceFeatureList featureList =  new WebServiceFeatureList(features);
+        WSEndpointReference wsepr = null;
+        if(featureList.isEnabled(AddressingFeature.class) && wsdlService != null && wsdlService.get(portName) != null) {
+            wsepr = wsdlService.get(portName).getEPR();
+        }
+        return createDispatch(portName, wsepr, aClass, mode, features);
+    }
+
+    public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features) {
+        WSEndpointReference wsepr = new WSEndpointReference(endpointReference);
+        QName portName = addPortEpr(wsepr);
+        return createDispatch(portName, wsepr, type, mode, features);
+    }
+
+    /**
+     * Obtains {@link PortInfo} for the given name, with error check.
+     */
+    public
+    @NotNull
+    PortInfo safeGetPort(QName portName) {
+        PortInfo port = ports.get(portName);
+        if (port == null) {
+            throw new WebServiceException(ClientMessages.INVALID_PORT_NAME(portName, buildNameList(ports.keySet())));
+        }
+        return port;
+    }
+
+    private StringBuilder buildNameList(Collection<QName> names) {
+        StringBuilder sb = new StringBuilder();
+        for (QName qn : names) {
+            if (sb.length() > 0) sb.append(',');
+            sb.append(qn);
+        }
+        return sb;
+    }
+
+    /**
+     * Creates a new pipeline for the given port name.
+     */
+    private Tube createPipeline(PortInfo portInfo, WSBinding binding) {
+        //Check all required WSDL extensions are understood
+        checkAllWSDLExtensionsUnderstood(portInfo,binding);
+
+        BindingID bindingId = portInfo.bindingId;
+
+        TubelineAssembler assembler = TubelineAssemblerFactory.create(
+                Thread.currentThread().getContextClassLoader(), bindingId);
+        if (assembler == null)
+            throw new WebServiceException("Unable to process bindingID=" + bindingId);    // TODO: i18n
+        return assembler.createClient(
+                new ClientTubeAssemblerContext(
+                        portInfo.targetEndpoint,
+                        portInfo.portModel,
+                        this, binding, container));
+    }
+
+    /**
+     * Checks only if RespectBindingFeature is enabled
+     * checks if all required wsdl extensions in the
+     * corresponding wsdl:Port are understood when RespectBindingFeature is enabled.
+     * @throws WebServiceException
+     *      when any wsdl extension that has wsdl:required=true is not understood
+     */
+    private void checkAllWSDLExtensionsUnderstood(PortInfo port, WSBinding binding) {
+        if (port.portModel != null && binding.isFeatureEnabled(RespectBindingFeature.class)) {
+            ((WSDLPortImpl) port.portModel).areRequiredExtensionsUnderstood();
+        }
+    }
+
+    public EndpointAddress getEndpointAddress(QName qName) {
+        return ports.get(qName).targetEndpoint;
+    }
+
+    public Dispatch<Object> createDispatch(QName portName, JAXBContext jaxbContext, Service.Mode mode) throws WebServiceException {
+        return createDispatch(portName, jaxbContext, mode, EMPTY_FEATURES);
+    }
+
+    @Override
+    public Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features) {
+        PortInfo port = safeGetPort(portName);
+        BindingImpl binding = port.createBinding(features,null);
+        Dispatch<Object> dispatch = Stubs.createJAXBDispatch(
+                portName, this, binding, jaxbContext, mode,
+                createPipeline(port, binding), wsepr);
+         serviceInterceptor.postCreateDispatch((WSBindingProvider)dispatch);
+         return dispatch;
+    }
+
+    public Dispatch<Object> createDispatch(QName portName, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... webServiceFeatures) {
+        WebServiceFeatureList featureList =  new WebServiceFeatureList(webServiceFeatures);
+        WSEndpointReference wsepr = null;
+        if(featureList.isEnabled(AddressingFeature.class) && wsdlService != null && wsdlService.get(portName) != null) {
+            wsepr = wsdlService.get(portName).getEPR();
+        }
+        return createDispatch(portName, wsepr, jaxbContext, mode, webServiceFeatures);
+    }
+
+    public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
+        WSEndpointReference wsepr = new WSEndpointReference(endpointReference);
+        QName portName = addPortEpr(wsepr);
+        return createDispatch(portName, wsepr, context, mode, features);
+    }
+
+    private QName addPortEpr(WSEndpointReference wsepr) {
+        if (wsepr == null)
+            throw new WebServiceException(ProviderApiMessages.NULL_EPR());
+        QName eprPortName = getPortNameFromEPR(wsepr, null);
+        //add Port, if it does n't exist;
+        // TODO: what if it has different epr address?
+        {
+            PortInfo portInfo = new PortInfo(this, (wsepr.getAddress() == null) ? null : EndpointAddress.create(wsepr.getAddress()), eprPortName,
+                    getPortModel(eprPortName).getBinding().getBindingId());
+            if (!ports.containsKey(eprPortName)) {
+                ports.put(eprPortName, portInfo);
+            }
+        }
+        return eprPortName;
+    }
+
+    /**
+     *
+     * @param wsepr EndpointReference from which portName will be extracted.
+     *      If EndpointName ( port name) is null in EPR, then it will try to get if from WSDLModel using portType QName
+     * @param portTypeName
+     *          should be null in dispatch case
+     *          should be non null in SEI case
+     * @return
+     *      port name from EPR after validating various metadat elements.
+     *      Also if service instance does n't have wsdl,
+     *      then it gets the WSDL metadata from EPR and builds wsdl model.
+     */
+    private QName getPortNameFromEPR(@NotNull WSEndpointReference wsepr, @Nullable QName portTypeName) {
+        QName portName;
+        WSEndpointReference.Metadata metadata = wsepr.getMetaData();
+        QName eprServiceName = metadata.getServiceName();
+        QName eprPortName = metadata.getPortName();
+        if ((eprServiceName != null ) && !eprServiceName.equals(serviceName)) {
+            throw new WebServiceException("EndpointReference WSDL ServiceName differs from Service Instance WSDL Service QName.\n"
+                    + " The two Service QNames must match");
+        }
+        if (wsdlService == null) {
+            Source eprWsdlSource = metadata.getWsdlSource();
+            if (eprWsdlSource == null) {
+                throw new WebServiceException(ProviderApiMessages.NULL_WSDL());
+            }
+            try {
+                WSDLModelImpl eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource);
+                wsdlService = eprWsdlMdl.getService(serviceName);
+                if (wsdlService == null)
+                    throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName,
+                            buildNameList(eprWsdlMdl.getServices().keySet())));
+            } catch (MalformedURLException e) {
+                throw new WebServiceException(ClientMessages.INVALID_ADDRESS(wsepr.getAddress()));
+            }
+        }
+        portName = eprPortName;
+
+        if (portName == null && portTypeName != null) {
+            //get the first port corresponding to the SEI
+            WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName);
+            if (port == null)
+                throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
+            portName = port.getName();
+        }
+        if (portName == null)
+            throw new WebServiceException(ProviderApiMessages.NULL_PORTNAME());
+        if (wsdlService.get(portName) == null)
+            throw new WebServiceException(ClientMessages.INVALID_EPR_PORT_NAME(portName, buildWsdlPortNames()));
+
+        return portName;
+
+    }
     public QName getServiceName() {
-        return serviceContext.getServiceName();
+        return serviceName;
     }
 
-    public Iterator getPorts() throws WebServiceException {
-        if (ports == null)
-            populatePorts();
+    protected Class getServiceClass() {
+        return serviceClass;
+    }
 
-        if (ports.size() == 0)
-            throw noWsdlException();
-        return ports.iterator();
+    public Iterator<QName> getPorts() throws WebServiceException {
+        // KK: the spec seems to be ambigous about whether
+        // this returns ports that are dynamically added or not.
+        if (ports.isEmpty())
+            throw new WebServiceException("dii.service.no.wsdl.available");
+        return ports.keySet().iterator();
     }
 
     public URL getWSDLDocumentLocation() {
-        return getWsdlLocation();
-    }
-
-    protected void addPorts(QName[] ports) {
-        if (ports != null) {
-            for (int i = 0; i < ports.length; ++i) {
-                addPort(ports[i]);
-            }
+        if(wsdlService==null)   return null;
+        try {
+            return new URL(wsdlService.getParent().getLocation().getSystemId());
+        } catch (MalformedURLException e) {
+            throw new AssertionError(e); // impossible
         }
     }
 
-    private void populatePorts() {
-        if (ports == null)
-            ports = new HashSet<QName>();
-
-        WSDLContext wscontext = serviceContext.getWsdlContext();
-
-        if (serviceContext.getServiceName() == null) {
-            if (wscontext != null) {
-                serviceContext.setServiceName(wscontext.getFirstServiceName());
-            }
-        }
-        Set knownPorts = null;
-
-        if (wscontext != null) {
-            QName serviceName = serviceContext.getServiceName();
-            knownPorts =
-                wscontext.getPortsAsSet(serviceName);
-            if (knownPorts != null) {
-                QName[] portz = (QName[]) knownPorts.toArray(
-                    new QName[knownPorts.size()]);
-                addPorts(portz);
-                for (QName port : portz) {
-                    String endpoint =
-                        wscontext.getEndpoint(serviceName, port);
-                    String bid = wscontext.getWsdlBinding(serviceName, port)
-                        .getBindingId();
-                    dispatchPorts.put(port,
-                        new PortInfoBase(endpoint, port, bid));
-                }
-            }
-        }
-    }
-
-    protected void addPort(QName port) {
-        if (ports == null)
-            populatePorts();
-        ports.add(port);
-    }
-
-    protected WebServiceException noWsdlException() {
-        return new WebServiceException("dii.service.no.wsdl.available");
-    }
-
-    private Object createEndpointIFBaseProxy(QName portName, Class portInterface) throws WebServiceException {
+    private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, Class<T> portInterface, WebServiceFeature[] webServiceFeatures) {
         //fail if service doesnt have WSDL
-        if (serviceContext.getWsdlContext() == null)
-            throw new ClientConfigurationException("service.noWSDLUrl");
+        if (wsdlService == null)
+            throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
 
-        //if there is portName validate it
-        if ((portName != null) && !serviceContext.getWsdlContext().contains(serviceContext.getServiceName(), portName))
-        {
-            throw new ClientConfigurationException("service.invalidPort", portName, serviceContext.getServiceName(), serviceContext.getWsdlContext().getWsdlLocation().toString());
+        if (wsdlService.get(portName)==null) {
+            throw new WebServiceException(
+                ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
         }
 
-        processServiceContext(portName, portInterface);
+        SEIPortInfo eif = seiContext.get(portName);
 
-        //if the portName is null it must have been set inside processServiceContext, now get it
-        //from EndpointIfContext
-        if (portName == null)
-            portName = serviceContext.getEndpointIFContext(portInterface.getName()).getPortName();
+        BindingImpl binding = eif.createBinding(webServiceFeatures,portInterface);
+        SEIStub pis = new SEIStub(this, binding, eif.model, createPipeline(eif, binding), epr);
 
-        return buildEndpointIFProxy(portName, portInterface);
+        T proxy = portInterface.cast(Proxy.newProxyInstance(portInterface.getClassLoader(),
+                new Class[]{portInterface, WSBindingProvider.class, Closeable.class}, pis));
+        if (serviceInterceptor != null) {
+            serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
+        }
+        return proxy;
     }
 
-    protected HashSet<QName> getPortsAsSet() {
-        if (ports == null)
-            populatePorts();
-        return ports;
-    }
-
-    /*
-     * Set the binding on the binding provider. Called by the service
-     * class when creating the binding provider.
+    /**
+     * Lists up the port names in WSDL. For error diagnostics.
      */
-    protected void setBindingOnProvider(InternalBindingProvider provider,
-                                        QName portName, String bindingId) {
-
-        // get handler chain
-        List<Handler> handlerChain = null;
-        HandlerResolver hResolver = getHandlerResolver();
-        if (handlerResolver != null && getServiceName() != null) {
-            PortInfo portInfo = new PortInfoImpl(bindingId, portName,
-                getServiceName());
-            handlerChain = handlerResolver.getHandlerChain(portInfo);
-        } else {
-            handlerChain = new ArrayList<Handler>();
-        }
-
-        // create binding
-        if (bindingId.toString().equals(SOAPBinding.SOAP11HTTP_BINDING) ||
-            bindingId.toString().equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) ||
-            bindingId.toString().equals(SOAPBinding.SOAP12HTTP_BINDING) ||
-            bindingId.toString().equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
-            SOAPBindingImpl bindingImpl = new SOAPBindingImpl(handlerChain,
-                bindingId, getServiceName());
-            Set<String> roles = serviceContext.getRoles(portName);
-            if (roles != null) {
-                bindingImpl.setRoles(roles);
-            }
-            provider._setBinding(bindingImpl);
-        } else if (bindingId.equals(HTTPBinding.HTTP_BINDING)) {
-            provider._setBinding(new HTTPBindingImpl(handlerChain));
-        }
+    private StringBuilder buildWsdlPortNames() {
+        Set<QName> wsdlPortNames = new HashSet<QName>();
+        for (WSDLPortImpl port : wsdlService.getPorts())
+            wsdlPortNames.add(port.getName());
+        return buildNameList(wsdlPortNames);
     }
 
-
-    private Dispatch createDispatchClazz(QName port, Class clazz, Service.Mode mode) throws WebServiceException {
-        PortInfoBase dispatchPort = dispatchPorts.get(port);
-        if (dispatchPort != null) {
-            DispatchBase dBase = new DispatchBase((PortInfoBase) dispatchPort, clazz, (Service.Mode) mode, this);
-            setBindingOnProvider(dBase, port, dBase._getBindingId());
-            return dBase;
-        } else {
-            throw new WebServiceException("Port must be defined in order to create Dispatch");
-        }
+    /**
+     * Obtains a {@link WSDLPortImpl} with error check.
+     *
+     * @return guaranteed to be non-null.
+     */
+    public @NotNull WSDLPortImpl getPortModel(QName portName) {
+        WSDLPortImpl port = wsdlService.get(portName);
+        if (port == null)
+            throw new WebServiceException(
+                ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
+        return port;
     }
 
-    private Dispatch createDispatchJAXB(QName port, JAXBContext jaxbContext, Service.Mode mode) throws WebServiceException {
-        PortInfoBase dispatchPort = dispatchPorts.get(port);
-        if (dispatchPort != null) {
-            DispatchBase dBase = new DispatchBase((PortInfoBase) dispatchPort, jaxbContext, mode, this);
-            setBindingOnProvider(dBase, port, dBase._getBindingId());
-            return dBase;
-        } else {
-            throw new WebServiceException("Port must be defined in order to create Dispatch");
-        }
+    /**
+     * Contributes to the construction of {@link WSServiceDelegate} by filling in
+     * {@link SEIPortInfo} about a given SEI (linked from the {@link Service}-derived class.)
+     */
+    //todo: valid port in wsdl
+    private void addSEI(QName portName, Class portInterface) throws WebServiceException {
+        SEIPortInfo spi = seiContext.get(portName);
+        if (spi != null) return;
+        WSDLPortImpl wsdlPort = getPortModel(portName);
+        RuntimeModeler modeler = new RuntimeModeler(portInterface, serviceName, wsdlPort);
+        modeler.setPortName(portName);
+        AbstractSEIModelImpl model = modeler.buildRuntimeModel();
+
+        spi = new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort);
+        seiContext.put(spi.portName, spi);
+        //seiContext.put(spi.sei, spi);
+        ports.put(spi.portName, spi);
+
     }
 
-    private URL getWsdlLocation() {
-        return serviceContext.getWsdlContext().getWsdlLocation();
+    public WSDLServiceImpl getWsdlService() {
+        return wsdlService;
     }
 
-    private Object buildEndpointIFProxy(QName portQName, Class portInterface)
-        throws WebServiceException {
-
-        EndpointIFContext eif = completeEndpointIFContext(serviceContext, portQName, portInterface);
-
-        //apply parameter bindings
-        RuntimeModel model = eif.getRuntimeContext().getModel();
-        if (portQName != null) {
-            Binding binding = getWSDLBinding(portQName);
-            eif.setBindingID(binding.getBindingId());
-            model.applyParameterBinding(binding);
-        }
-
-        //needs cleaning up
-        EndpointIFInvocationHandler handler =
-            new EndpointIFInvocationHandler(portInterface,
-                eif, this, getServiceName()); //need handler registry passed in here
-        setBindingOnProvider(handler, portQName, handler._getBindingId());
-
-        Object proxy = Proxy.newProxyInstance(portInterface.getClassLoader(),
-            new Class[]{
-                portInterface, BindingProvider.class,
-                BindingProviderProperties.class,
-                com.sun.xml.internal.ws.spi.runtime.StubBase.class
-            }, handler);
-        handler.setProxy((Object) proxy);
-        return (BindingProvider) proxy;
-    }
-
-    Binding getWSDLBinding(QName portQName) {
-        return serviceContext.getWsdlContext().getWsdlBinding(serviceContext.getServiceName(), portQName);
-    }
-
-    private EndpointIFContext completeEndpointIFContext(ServiceContext serviceContext, QName portQName, Class portInterface) {
-
-        EndpointIFContext context = serviceContext.getEndpointIFContext(portInterface.getName());
-        WSDLContext wscontext = serviceContext.getWsdlContext();
-        if (wscontext != null) {
-            String endpoint = wscontext.getEndpoint(serviceContext.getServiceName(), portQName);
-            String bindingID = wscontext.getBindingID(
-                serviceContext.getServiceName(), portQName);
-            context.setServiceName(serviceContext.getServiceName());
-            context.setPortInfo(portQName, endpoint, bindingID);
-        }
-        return context;
-    }
-
-    class DaemonThreadFactory implements ThreadFactory {
+     class DaemonThreadFactory implements ThreadFactory {
         public Thread newThread(Runnable r) {
             Thread daemonThread = new Thread(r);
             daemonThread.setDaemon(Boolean.TRUE);
             return daemonThread;
         }
     }
+
+    private static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0];
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java
new file mode 100644
index 0000000..18ee24b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage.MessageDataSource;
+import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+/**
+ *
+ * @author WS Development Team
+ * @version 1.0
+ */
+public class DataSourceDispatch extends DispatchImpl<DataSource> {
+
+    public DataSourceDispatch(QName port, Service.Mode mode, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+       super(port, mode, service, pipe, binding, epr );
+    }
+
+    Packet createPacket(DataSource arg) {
+
+         switch (mode) {
+            case PAYLOAD:
+                throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
+            case MESSAGE:
+                return new Packet(XMLMessage.create(arg));
+            default:
+                throw new WebServiceException("Unrecognized message mode");
+        }
+    }
+
+    DataSource toReturnValue(Packet response) {
+
+        Message message = response.getMessage();
+
+        if (message instanceof MessageDataSource) {
+            MessageDataSource hasDS = (MessageDataSource)message;
+            // TODO Need to call hasUnconsumedDataSource()
+            return hasDS.getDataSource();
+        } else if (message instanceof PayloadSourceMessage) {
+            return XMLMessage.getDataSource(message);
+        }
+        return null;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchBase.java
deleted file mode 100644
index 85a7fe4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchBase.java
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.client.dispatch;
-
-import static javax.xml.ws.Service.Mode.MESSAGE;
-import static javax.xml.ws.Service.Mode.*;
-import static javax.xml.ws.Service.*;
-
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.client.*;
-import com.sun.xml.internal.ws.client.dispatch.impl.DispatchContactInfoList;
-import com.sun.xml.internal.ws.client.dispatch.impl.DispatchDelegate;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.pept.Delegate;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import com.sun.xml.internal.ws.transport.http.client.HttpClientTransportFactory;
-
-import javax.activation.DataSource;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConstants;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.*;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.http.HTTPException;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-import java.util.Map;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Future;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.logging.Logger;
-
-
-/**
- * The <code>javax.xml.ws.Dispatch</code> interface provides support
- * for the dynamic invocation of a service endpoint operation using XML
- * constructs or JAXB objects. The <code>javax.xml.ws.Service</code>
- * interface acts as a factory for the creation of <code>Dispatch</code>
- * instances.
- *
- * @author WS Development Team
- */
-
-public class DispatchBase implements BindingProvider, InternalBindingProvider,
-    Dispatch {
-
-    public DispatchBase(PortInfoBase port, Class aClass, Service.Mode mode, WSServiceDelegate service) {
-        this(port, mode, null, aClass, service);
-    }
-
-    public DispatchBase(PortInfoBase port, JAXBContext jaxbContext, Service.Mode mode, WSServiceDelegate service) {
-        this(port, mode, jaxbContext, null, service);
-    }
-
-    DispatchBase(PortInfoBase port, Service.Mode mode, JAXBContext context, Class clazz, WSServiceDelegate service) {
-        _delegate = new DispatchDelegate(new DispatchContactInfoList());
-        _mode = mode;
-        _portInfo = port;
-        _jaxbContext = context;
-        _clazz = clazz;
-        _service = service;
-    }
-
-    /**
-     * Invoke a service operation synchronously.
-     * <p/>
-     * The client is responsible for ensuring that the <code>msg</code> object
-     * is formed according to the requirements of the protocol binding in use.
-     *
-     * @param msg An object that will form the payload of
-     *            the message used to invoke the operation. Must be an instance of
-     *            either <code>javax.xml.transform.Source</code> or a JAXB object. If
-     *            <code>msg</code> is an instance of a JAXB object then the request
-     *            context must have the <code>javax.xml.ws.binding.context</code>
-     *            property set.
-     * @return The response to the operation invocation. The object is
-     *         either an instance of <code>javax.xml.transform.Source</code>
-     *         or a JAXB object.
-     * @throws javax.xml.ws.WebServiceException
-     *          If there is any error in the configuration of
-     *          the <code>Dispatch</code> instance
-     * @throws javax.xml.ws.WebServiceException
-     *          If an error occurs when using a supplied
-     *          JAXBContext to marshall msg or unmarshall the response. The cause of
-     *          the WebServiceException is the original JAXBException.
-     */
-    public Object invoke(Object msg)
-        throws WebServiceException {
-
-        MessageStruct messageStruct = setupMessageStruct(msg);
-        messageStruct.setMEP(MessageStruct.REQUEST_RESPONSE_MEP);
-        return sendAndReceive(messageStruct);
-    }
-
-    /**
-     * Invoke a service operation asynchronously.  The
-     * method returns without waiting for the response to the operation
-     * invocation, the results of the operation are obtained by polling the
-     * returned <code>Response</code>.
-     * <p/>
-     * The client is responsible for ensuring that the <code>msg</code> object
-     * when marshalled is formed according to the requirements of the protocol
-     * binding in use.
-     *
-     * @param msg An object that, when marshalled, will form the payload of
-     *            the message used to invoke the operation. Must be an instance of
-     *            either <code>javax.xml.transform.Source</code> or a JAXB object. If
-     *            <code>msg</code> is an instance of a JAXB object then the request
-     *            context must have the <code>javax.xml.ws.binding.context</code>
-     *            property set.
-     * @return The response to the operation invocation. The object
-     *         returned by <code>Response.get()</code> is
-     *         either an instance of <code>javax.xml.transform.Source</code>
-     *         or a JAXB object.
-     * @throws javax.xml.ws.WebServiceException
-     *          If there is any error in the configuration of
-     *          the <code>Dispatch</code> instance
-     * @throws javax.xml.ws.WebServiceException
-     *          If an error occurs when using a supplied
-     *          JAXBContext to marshall msg. The cause of
-     *          the WebServicException is the original JAXBException.
-     */
-    public Response<Object> invokeAsync(Object msg)
-        throws WebServiceException {
-
-        MessageStruct messageStruct = setupMessageStruct(msg);
-        messageStruct.setMEP(MessageStruct.ASYNC_POLL_MEP);
-        Object result = sendAsync(messageStruct);
-        if (result instanceof Response)
-            return (Response<Object>) result;
-        else
-            throw (RuntimeException) result;
-    }
-
-
-    /**
-     * Invoke a service operation asynchronously. The
-     * method returns without waiting for the response to the operation
-     * invocation, the results of the operation are communicated to the client
-     * via the passed in handler.
-     * <p/>
-     * The client is responsible for ensuring that the <code>msg</code> object
-     * when marshalled is formed according to the requirements of the protocol
-     * binding in use.
-     *
-     * @param msg     An object that, when marshalled, will form the payload of
-     *                the message used to invoke the operation. Must be an instance of
-     *                either <code>javax.xml.transform.Source</code> or a JAXB object. If
-     *                <code>msg</code> is an instance of a JAXB object then the request
-     *                context must have the <code>javax.xml.ws.binding.context</code>
-     *                property set.
-     * @param handler The handler object that will receive the
-     *                response to the operation invocation. The object
-     *                returned by <code>Response.get()</code> is
-     *                either an instance of
-     *                <code>javax.xml.transform.Source</code> or a JAXB object.
-     * @return A <code>Future</code> object that may be used to check the status
-     *         of the operation invocation. This object must not be used to try to
-     *         obtain the results of the operation - the object returned from
-     *         <code>Future<?>.get()</code> is implementation dependent
-     *         and any use of it will result in non-portable behaviour.
-     * @throws javax.xml.ws.WebServiceException
-     *          If there is any error in the configuration of
-     *          the <code>Dispatch</code> instance
-     * @throws javax.xml.ws.WebServiceException
-     *          If an error occurs when using a supplied
-     *          JAXBContext to marshall msg. The cause of
-     *          the WebServiceException is the original JAXBException.
-     */
-    public Future<?> invokeAsync(java.lang.Object msg, AsyncHandler handler) {
-
-        MessageStruct messageStruct = setupMessageStruct(msg);
-        if (handler != null) {
-            messageStruct.setMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER, (Object) new AsyncHandlerService(handler, getCurrentExecutor()));
-        } else
-            throw new WebServiceException("AsyncHandler argument is null. " +
-                "AsyncHandler is required for asynchronous callback invocations ");
-
-        messageStruct.setMEP(MessageStruct.ASYNC_CALLBACK_MEP);
-        Object result = sendAsync(messageStruct);
-        if (result instanceof WSFuture)
-            return (Future<Object>) result;
-        else
-            throw (RuntimeException) result;
-    }
-
-    /**
-     * Invokes a service operation using the one-way
-     * interaction mode. The operation invocation is logically non-blocking,
-     * subject to the capabilities of the underlying protocol, no results
-     * are returned. When
-     * the protocol in use is SOAP/HTTP, this method must block until
-     * an HTTP response code has been received or an error occurs.
-     * <p/>
-     * The client is responsible for ensuring that the <code>msg</code> object
-     * when marshalled is formed according to the requirements of the protocol
-     * binding in use.
-     *
-     * @param msg An object that, when marshalled, will form the payload of
-     *            the message used to invoke the operation. Must be an instance of
-     *            either <code>javax.xml.transform.Source</code> or a JAXB object. If
-     *            <code>msg</code> is an instance of a JAXB object then the request
-     *            context must have the <code>javax.xml.ws.binding.context</code>
-     *            property set.
-     * @throws javax.xml.ws.WebServiceException
-     *          If there is any error in the configuration of
-     *          the <code>Dispatch</code> instance or if an error occurs during the
-     *          invocation.
-     * @throws javax.xml.ws.WebServiceException
-     *          If an error occurs when using a supplied
-     *          JAXBContext to marshall msg. The cause of
-     *          the WebServiceException is the original JAXBException.
-     */
-
-    public void invokeOneWay(Object msg) {
-
-        MessageStruct messageStruct = setupMessageStruct(msg);
-        messageStruct.setMEP(MessageStruct.ONE_WAY_MEP);
-        sendOneWay(messageStruct);
-    }
-
-    private boolean hasJAXBContext(Object msg, MessageStruct messageStruct) {
-        RequestContext requestContext = (RequestContext) getRequestContext();
-        if (_jaxbContext != null) {
-            requestContext.put(BindingProviderProperties.JAXB_CONTEXT_PROPERTY, _jaxbContext);
-            return true;
-        }
-        return false;
-    }
-
-    public void _setDelegate(Delegate delegate) {
-        _delegate = delegate;
-    }
-
-    public Delegate _getDelegate() {
-        return _delegate;
-    }
-
-    public static void setDefaultTransportFactory(ClientTransportFactory factory) {
-        defaultTransportFactory = factory;
-    }
-
-    public static ClientTransportFactory getDefaultTransportFactory() {
-        if (defaultTransportFactory == null)
-            defaultTransportFactory = new HttpClientTransportFactory();
-        return defaultTransportFactory;
-    }
-
-    public ClientTransportFactory _getTransportFactory() {
-        _transportFactory =
-            (ClientTransportFactory) getRequestContext().get(BindingProviderProperties.CLIENT_TRANSPORT_FACTORY);
-
-        if (_transportFactory == null) {
-            _transportFactory = new HttpClientTransportFactory();
-        }
-        return _transportFactory;
-    }
-
-    public void _setTransportFactory(com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory f) {
-        getRequestContext().put(BindingProviderProperties.CLIENT_TRANSPORT_FACTORY, f);
-        _transportFactory = (ClientTransportFactory) f;
-    }
-
-    private Object sendAndReceive(MessageStruct messageStruct) {
-        Object response = null;
-
-        _delegate.send(messageStruct);
-        response = messageStruct.getResponse();
-        updateResponseContext(messageStruct);
-        //((ContextMap) getRequestContext()).clear();
-        switch (messageStruct.getResponseType()) {
-
-            case MessageStruct.NORMAL_RESPONSE:
-                //not sure where this belongs yet - but for now-
-                break;
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof SOAPFaultException)
-                    throw (SOAPFaultException) response;
-                if (response instanceof SOAPFaultInfo) {
-                    SOAPFaultInfo soapFaultInfo = (SOAPFaultInfo) response;
-                    JAXBException jbe = null;
-                    if (soapFaultInfo.getString().contains("javax.xml.bind")) {
-                        jbe = new JAXBException(soapFaultInfo.getString());
-                        //do I need to put this in a webservice exception
-                        SOAPFaultException sfe = new SOAPFaultException(soapFaultInfo.getSOAPFault());
-                        sfe.initCause(jbe);
-                    } else
-                        throw new SOAPFaultException(soapFaultInfo.getSOAPFault());
-                } else if (response instanceof HTTPException) {
-                    throw (HTTPException) response;
-                } else if (response instanceof RuntimeException)
-                    throw (RuntimeException) response;
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof SOAPFaultException) {
-                    throw (SOAPFaultException) response;
-                } else if (response instanceof HTTPException) {
-                    throw (HTTPException) response;
-                } else if (response instanceof RuntimeException) {
-                    throw (RuntimeException) response;
-                }
-                break;   //just break and return response
-            default:
-                if (response != null) //must be some kind of exception
-                    throw new WebServiceException("Client side exception - examine cause ", (Exception) response);
-        }
-        return response;
-    }
-
-    private Object sendAsync(MessageStruct messageStruct)
-        throws WebServiceException {
-        Object response = null;
-        _lock = new ReentrantLock();
-        _lock.lock();
-        try {
-            _delegate.send(messageStruct);
-            response = messageStruct.getResponse();
-        } catch (Throwable t) {
-            throw (RuntimeException) t;
-        } finally {
-            _lock.unlock();
-        }
-        return response;
-    }
-
-    private void sendOneWay(MessageStruct messageStruct) {
-
-        _delegate.send(messageStruct);
-        Object response = messageStruct.getResponse();
-        //no exceptions should be returned from server but
-        //exceptions may be returned from the client
-        switch (messageStruct.getResponseType()) {
-            case MessageStruct.NORMAL_RESPONSE:
-                break;
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                //before invocation
-                if (response instanceof RuntimeException)
-                    throw (RuntimeException) response;
-            default:
-                throw new RuntimeException("Client side Exception ");
-        }
-    }
-
-    private MessageStruct setupMessageStruct(Object msg) throws WebServiceException {
-        MessageStruct messageStruct = _delegate.getMessageStruct();
-
-        if (msg != null) {
-            MessageFactory factory = null;
-            if (((msg instanceof Source) && _mode == MESSAGE) &&
-                (!_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING)))
-            {
-                try {
-
-                    if (_getBindingId().toString().equals(SOAPBinding.SOAP12HTTP_BINDING))
-                        factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-                    else
-                        factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
-
-                    SOAPMessage message = factory.createMessage();
-                    message.getSOAPPart().setContent((Source) msg);
-                    message.saveChanges();
-                    msg = message;
-                } catch (SOAPException se) {
-                    throw new WebServiceException(se);
-                }
-            }
-
-            //setMessageStruct(messageStruct, msg);
-
-        } else {
-            //todo - needs to be a get request
-            if (!isValidNullParameter(msg))
-                throw new WebServiceException("This is not a valid request ");
-        }
-        setMessageStruct(messageStruct, msg);
-        return messageStruct;
-    }
-
-    private void setMessageStruct(MessageStruct messageStruct, Object msg) {
-        messageStruct.setData(new Object[]{msg});
-        setMetadata(getRequestContext(), msg, messageStruct);
-        //set mtom threshold value to
-        Object mtomThreshold = getRequestContext().get(BindingProviderProperties.MTOM_THRESHOLOD_VALUE);
-        messageStruct.setMetaData(BindingProviderProperties.MTOM_THRESHOLOD_VALUE, mtomThreshold);
-
-        // Set MTOM processing for XML requests only
-        String bindingId =
-            (getBinding() instanceof SOAPBinding)?
-                ((SOAPBindingImpl)binding).getBindingId().toString():HTTPBinding.HTTP_BINDING;
-        if (bindingId.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)||
-        bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))
-           messageStruct.setMetaData("com.sun.xml.internal.ws.mtom.enabled", ((SOAPBindingImpl)getBinding()).isMTOMEnabled());
-
-        // Initialize content negotiation property
-        ContentNegotiation.initialize(getRequestContext(), messageStruct);
-    }
-
-    private void updateResponseContext(MessageStruct messageStruct) {
-        ResponseContext responseContext = (ResponseContext)
-            messageStruct.getMetaData(BindingProviderProperties.JAXWS_RESPONSE_CONTEXT_PROPERTY);
-        setResponseContext(responseContext);
-    }
-
-    private void setMetadata(Map jaxwsContext, Object obj, MessageStruct messageStruct) {
-
-        jaxwsContext.put(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY, this);
-
-        if (jaxwsContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY) == null)
-            jaxwsContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, _portInfo.getTargetEndpoint());
-
-        jaxwsContext.put(BindingProviderProperties.BINDING_ID_PROPERTY, _getBindingId().toString());
-        if (_jaxbContext != null)
-            jaxwsContext.put(BindingProviderProperties.JAXB_CONTEXT_PROPERTY, _jaxbContext);
-        messageStruct.setMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY,
-            jaxwsContext);
-
-        messageStruct.setMetaData(DispatchContext.DISPATCH_MESSAGE_MODE, _mode);
-        if (_clazz != null)
-            messageStruct.setMetaData(DispatchContext.DISPATCH_MESSAGE_CLASS, _clazz);
-
-        DispatchContext context = setDispatchContext(jaxwsContext, obj, _mode);
-        messageStruct.setMetaData(BindingProviderProperties.DISPATCH_CONTEXT, context);
-    }
-
-    public Binding getBinding() {
-        return (Binding) binding;
-    }
-
-    public void _setBinding(BindingImpl binding) {
-        this.binding = binding;
-    }
-
-    // default for now is soap binding
-    public String _getBindingId() {
-        _bindingId = _portInfo.getBindingId();
-        if (_bindingId == null) {
-            _bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-        }
-        return _bindingId;
-    }
-
-
-    /**
-     * Get the jaxwsContext that is used in processing request messages.
-     * <p/>
-     * Modifications to the request context do not affect asynchronous
-     * operations that have already been started.
-     *
-     * @return The jaxwsContext that is used in processing request messages.
-     */
-    public Map getRequestContext() {
-        if (_requestContext == null)
-            _requestContext = new RequestContext(this);
-
-        return _requestContext;
-    }
-
-    private void setResponseContext(ResponseContext context) {
-        _responseContext = context;
-    }
-
-    /**
-     * Get the jaxwsContext that resulted from processing a response message.
-     * <p/>
-     * The returned context is for the most recently completed synchronous
-     * operation. Subsequent synchronous operation invocations overwrite the
-     * response context. Asynchronous operations return their response context
-     * via the Response interface.
-     *
-     * @return The jaxwsContext that is used in processing request messages.
-     */
-    public Map getResponseContext() {
-        if (_responseContext == null)
-            _responseContext = new ResponseContext(this);
-        return _responseContext;
-    }
-
-    public DispatchContext setDispatchContext(Map jaxwsContext, Object obj, Service.Mode mode) {
-
-        DispatchContext context = new DispatchContext();
-        context.setProperty(DispatchContext.DISPATCH_MESSAGE_MODE, mode);
-
-        if (obj != null) {
-            if (obj instanceof Source) {
-                context.setProperty(DispatchContext.DISPATCH_MESSAGE_CLASS,
-                    DispatchContext.MessageClass.SOURCE);
-            } else if (obj instanceof SOAPMessage) {
-                context.setProperty(DispatchContext.DISPATCH_MESSAGE_CLASS,
-                    DispatchContext.MessageClass.SOAPMESSAGE);
-            } else if ((obj instanceof DataSource) &&
-                _getBindingId().toString().equals(HTTPBinding.HTTP_BINDING)) {
-                context.setProperty(DispatchContext.DISPATCH_MESSAGE_CLASS,
-                    DispatchContext.MessageClass.DATASOURCE);
-
-            } else if (_jaxbContext != null) {
-                context.setProperty(DispatchContext.DISPATCH_MESSAGE_CLASS,
-                    DispatchContext.MessageClass.JAXBOBJECT);
-            } else {
-                if (!_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING))
-                    throw new WebServiceException("Object is not a javax.xml.transform.Source or there is no JAXB Context");
-            }
-        }
-
-        if (_clazz != null) {
-            if (_clazz.isAssignableFrom(Source.class)) {
-                if (mode == PAYLOAD) {
-                    if (_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING))
-                        context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_SOURCE_PAYLOAD);
-                    else
-                        context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.SOURCE_PAYLOAD);
-                } else if (mode == MESSAGE) {
-                    if (_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING))
-                        context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_SOURCE_MESSAGE);
-                    else
-                        context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.SOURCE_MESSAGE);
-                }
-            } else if (_clazz.isAssignableFrom(SOAPMessage.class)) {
-                if (mode == PAYLOAD) {
-                    throw new WebServiceException("SOAPMessages must be Service.Mode.MESSAGE. ");
-                } else if (mode == MESSAGE)
-                    context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.SOAPMESSAGE_MESSAGE);
-            } else if (_clazz.isAssignableFrom(DataSource.class)) {
-                if (mode == PAYLOAD)
-                    throw new WebServiceException("Can not have a Datahandler class with mode PAYLOAD");
-                    //context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_DATASOURCE_PAYLOAD);
-                else if (mode == MESSAGE)
-                    context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_DATASOURCE_MESSAGE);
-            } else {
-                context.setProperty(DispatchContext.DISPATCH_MESSAGE_CLASS, _clazz);
-            }
-        } else if (hasJAXBContext(obj, null)) {
-            if (mode == PAYLOAD) {
-                if (_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING))
-                    context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_JAXB_PAYLOAD);
-                else
-                    context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.JAXB_PAYLOAD);
-            } else if (mode == MESSAGE) {
-                if (_getBindingId().toString().equals(HTTPBinding.HTTP_BINDING))
-                    throw new WebServiceException(" Can not have a JAXB object with mode MESSAGE");
-                    //context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.HTTP_JAXB_MESSAGE);
-                else
-                    context.setProperty(DispatchContext.DISPATCH_MESSAGE, DispatchContext.MessageType.JAXB_MESSAGE);
-            }
-        }
-
-        return context;
-    }
-
-    Executor getCurrentExecutor() {
-        return _service.getExecutor();
-    }
-
-    public QName getServiceName() {
-        if (_service != null)
-            return _service.getServiceName();
-        return null;
-    }
-
-    public QName getPortName() {
-        if (_portInfo != null)
-            return _portInfo.getName();
-        return null;
-    }
-
-    private boolean isValidNullParameter(Object msg) {
-        if (msg != null)
-            return true;
-
-        String method = (String) getRequestContext().get(MessageContext.HTTP_REQUEST_METHOD);
-        if (method == null)
-            method = "POST";
-
-        String bindingId = _getBindingId().toString();
-        if (("POST".equalsIgnoreCase(method))) {
-
-            if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                        throw new WebServiceException("SOAP 1.1 Binding with null invocation parameter is not allowed with HTTP POST Request Method in MESSAGE mode");
-                        //return false;
-                    case PAYLOAD:
-                        return true;
-                }
-            } else if (HTTPBinding.HTTP_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                    case PAYLOAD:
-                        throw new WebServiceException("XML/HTTP Binding with null invocation parameter is not allowed with HTTP POST Request Method in MESSAGE or PAYLOAD mode");
-                }
-
-            } else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                        throw new WebServiceException("SOAP 1.2 Binding with null invocation parameter is not allowed with HTTP POST Request Method in MESSAGE mode");
-                        //return false;
-                    case PAYLOAD:
-                        return true;
-                }
-            }
-
-        } else if ("GET".equalsIgnoreCase(method)) {
-
-            if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                        //return false;
-                        throw new WebServiceException("SOAP 1.2 Binding with null invocation parameter is not allowed with HTTP GET Request Method in MESAGE mode.");
-                    case PAYLOAD:
-                        return true;
-                }
-            } else if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                    case PAYLOAD:
-                        throw new WebServiceException("SOAP 1.1 Binding with null invocation parameter is not allowed with HTTP GET Request Method in either PAYLOAD or MESAGE mode.");
-                        //return false;
-                }
-            } else if (HTTPBinding.HTTP_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                    case PAYLOAD:
-                        return true;
-                }
-            }
-
-        } else if ("DELETE".equalsIgnoreCase(method) || "HEAD".equalsIgnoreCase(method)) {
-
-            if (HTTPBinding.HTTP_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                    case PAYLOAD:
-                        return true;
-                }
-            } else if (SOAPBinding.SOAP12HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId)) {
-                switch (_mode) {
-                    case MESSAGE:
-                        //return false;
-                        throw new WebServiceException("SOAP 1.2 Binding with null invocation parameter is not allowed with HTTP " + method + " Request Method in MESAGE mode.");
-                    case PAYLOAD:
-                        return true;
-                }
-            } else if (SOAPBinding.SOAP11HTTP_BINDING.equals(bindingId) ||
-                SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId)) {
-                //return false;
-                throw new WebServiceException("SOAP 1.1 Binding with null invocation parameter is not allowed with HTTP " + method + " Request Method in either PAYLOAD or MESAGE mode.");
-                //return false;
-            }
-
-        }
-        return false;
-    }
-
-    private static ClientTransportFactory defaultTransportFactory = null;
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-
-    protected Map _requestContext;
-    protected Map _responseContext;
-    protected Service.Mode _mode;
-    protected WSServiceDelegate _service;
-    protected Class _clazz;
-    protected JAXBContext _jaxbContext;
-
-    protected Delegate _delegate = null;
-    protected PortInfoBase _portInfo = null;
-
-    protected String _bindingId = null;
-    protected BindingImpl binding;
-
-    private ClientTransportFactory _transportFactory;
-    private Lock _lock;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchContext.java
deleted file mode 100644
index 6c13d79..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchContext.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client.dispatch;
-
-import java.util.HashMap;
-
-/**
- * $author: JAXWS Development Team
- */
-public class DispatchContext {
-
-    private HashMap dprops = null;
-
-    public DispatchContext() {
-        dprops = new HashMap();
-    }
-
-    public void setProperty(String name, Object value) {
-        dprops.put(name, value);
-    }
-
-    public Object getProperty(String name) {
-        return dprops.get(name);
-    }
-
-    public void removeProperty(String name) {
-        dprops.remove(name);
-    }
-
-    public void clearProperties() {
-        dprops.clear();
-    }
-
-    public static final String DISPATCH_MESSAGE =
-        "com.sun.xml.internal.ws.rt.client.dispatch.messagetype";
-    public static final String DISPATCH_MESSAGE_MODE =
-        "com.sun.xml.internal.ws.rt.client.dispatch.mode";
-    public static final String DISPATCH_MESSAGE_CLASS =
-        "com.sun.xml.internal.ws.rt.client.dispatch.messageclass";
-
-    public enum MessageClass {
-        SOURCE ,JAXBOBJECT, SOAPMESSAGE, DATASOURCE
-    }
-
-    public enum MessageType {
-        JAXB_PAYLOAD,             //SOAP Binding
-        SOURCE_PAYLOAD,
-        JAXB_MESSAGE,
-        SOURCE_MESSAGE ,
-        SOAPMESSAGE_MESSAGE,
-        //HTTP_DATASOURCE_PAYLOAD,  //HTTP Binding
-        HTTP_DATASOURCE_MESSAGE,
-        HTTP_SOURCE_MESSAGE, //can be allowed with an HTTP GET method
-        HTTP_SOURCE_PAYLOAD,
-        HTTP_JAXB_PAYLOAD,
-        //HTTP_JAXB_MESSAGE
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java
new file mode 100644
index 0000000..71ee098
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java
@@ -0,0 +1,457 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.AsyncInvoker;
+import com.sun.xml.internal.ws.client.AsyncResponseImpl;
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContext;
+import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+import com.sun.xml.internal.ws.client.Stub;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+import com.sun.xml.internal.ws.resources.DispatchMessages;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * The <code>DispatchImpl</code> abstract class provides support
+ * for the dynamic invocation of a service endpoint operation using XML
+ * constructs, JAXB objects or <code>SOAPMessage</code>. The <code>javax.xml.ws.Service</code>
+ * interface acts as a factory for the creation of <code>DispatchImpl</code>
+ * instances.
+ *
+ * @author WS Development Team
+ * @version 1.0
+ */
+public abstract class DispatchImpl<T> extends Stub implements Dispatch<T> {
+
+    final Service.Mode mode;
+    final QName portname;
+    final SOAPVersion soapVersion;
+    static final long AWAIT_TERMINATION_TIME = 800L;
+
+    /**
+     *
+     * @param port    dispatch instance is asssociated with this wsdl port qName
+     * @param mode    Service.mode associated with this Dispatch instance - Service.mode.MESSAGE or Service.mode.PAYLOAD
+     * @param owner   Service that created the Dispatch
+     * @param pipe    Master pipe for the pipeline
+     * @param binding Binding of this Dispatch instance, current one of SOAP/HTTP or XML/HTTP
+     */
+    protected DispatchImpl(QName port, Service.Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, @Nullable WSEndpointReference epr) {
+        super(owner, pipe, binding, (owner.getWsdlService() != null)? owner.getWsdlService().get(port) : null , owner.getEndpointAddress(port), epr);
+        this.portname = port;
+        this.mode = mode;
+        this.soapVersion = binding.getSOAPVersion();
+    }
+
+    /**
+     * Abstract method that is implemented by each concrete Dispatch class
+     * @param msg  message passed in from the client program on the invocation
+     * @return  The Message created returned as the Interface in actuallity a
+     *          concrete Message Type
+     */
+    abstract Packet createPacket(T msg);
+
+    /**
+     * Obtains the value to return from the response message.
+     */
+    abstract T toReturnValue(Packet response);
+
+    public final Response<T> invokeAsync(T param) {
+        AsyncInvoker invoker = new DispatchAsyncInvoker(param);
+        AsyncResponseImpl<T> ft = new AsyncResponseImpl<T>(invoker,null);
+        invoker.setReceiver(ft);
+        // TODO: Do we set this executor on Engine and run the AsyncInvoker in this thread ?
+        owner.getExecutor().execute(ft);
+        return ft;
+    }
+
+    public final Future<?> invokeAsync(T param, AsyncHandler<T> asyncHandler) {
+        AsyncInvoker invoker = new DispatchAsyncInvoker(param);
+        AsyncResponseImpl<T> ft = new AsyncResponseImpl<T>(invoker,asyncHandler);
+        invoker.setReceiver(ft);
+
+        // temp needed so that unit tests run and complete otherwise they may
+        //not. Need a way to put this in the test harness or other way to do this
+        //todo: as above
+        ExecutorService exec = (ExecutorService) owner.getExecutor();
+        try {
+            exec.awaitTermination(AWAIT_TERMINATION_TIME, TimeUnit.MICROSECONDS);
+        } catch (InterruptedException e) {
+            throw new WebServiceException(e);
+        }
+        exec.execute(ft);
+        return ft;
+    }
+
+    /**
+     * Synchronously invokes a service.
+     *
+     * See {@link #process(Packet, RequestContext, ResponseContextReceiver)} on
+     * why it takes a {@link RequestContext} and {@link ResponseContextReceiver} as a parameter.
+     */
+    public final T doInvoke(T in, RequestContext rc, ResponseContextReceiver receiver){
+        Packet response;
+        try {
+            checkNullAllowed(in, rc, binding, mode);
+
+            Packet message = createPacket(in);
+            resolveEndpointAddress(message, rc);
+            setProperties(message,true);
+            response = process(message,rc,receiver);
+            Message msg = response.getMessage();
+
+            if(msg != null && msg.isFault()) {
+                SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
+                // passing null means there is no checked excpetion we're looking for all
+                // it will get back to us is a protocol exception
+                throw (SOAPFaultException)faultBuilder.createException(null);
+            }
+        } catch (JAXBException e) {
+            //TODO: i18nify
+            throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e);
+        } catch(RuntimeException e){
+            //it could be a WebServiceException or a ProtocolException or any RuntimeException
+            // resulting due to some internal bug.
+            throw e;
+        } catch(Throwable e){
+            //its some other exception resulting from user error, wrap it in
+            // WebServiceException
+            throw new WebServiceException(e);
+        }
+
+        return toReturnValue(response);
+    }
+
+    public final T invoke(T in) {
+        return doInvoke(in,requestContext,this);
+    }
+
+    public final void invokeOneWay(T in) {
+
+        checkNullAllowed(in, requestContext, binding, mode);
+
+        Packet request = createPacket(in);
+        setProperties(request,false);
+        Packet response = process(request,requestContext,this);
+    }
+
+    void setProperties(Packet packet, boolean expectReply) {
+        packet.expectReply = expectReply;
+    }
+
+    static boolean isXMLHttp(@NotNull WSBinding binding) {
+        return binding.getBindingId().equals(BindingID.XML_HTTP);
+    }
+
+    static boolean isPAYLOADMode(@NotNull Service.Mode mode) {
+           return mode == Service.Mode.PAYLOAD;
+    }
+
+    static void checkNullAllowed(@Nullable Object in, RequestContext rc, WSBinding binding, Service.Mode mode) {
+
+        if (in != null)
+            return;
+
+        //With HTTP Binding a null invocation parameter can not be used
+        //with HTTP Request Method == POST
+        if (isXMLHttp(binding)){
+            if (methodNotOk(rc))
+                throw new WebServiceException(DispatchMessages.INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(HTTP_REQUEST_METHOD_POST, HTTP_REQUEST_METHOD_GET));
+        } else { //soapBinding
+              if (mode == Service.Mode.MESSAGE )
+                   throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
+        }
+    }
+
+    static boolean methodNotOk(@NotNull RequestContext rc) {
+        String requestMethod = (String)rc.get(MessageContext.HTTP_REQUEST_METHOD);
+        String request = (requestMethod == null)? HTTP_REQUEST_METHOD_POST: requestMethod;
+        // if method == post or put with a null invocation parameter in xml/http binding this is not ok
+        return HTTP_REQUEST_METHOD_POST.equalsIgnoreCase(request) || HTTP_REQUEST_METHOD_PUT.equalsIgnoreCase(request);
+    }
+
+    public static void checkValidSOAPMessageDispatch(WSBinding binding, Service.Mode mode) {
+        // Dispatch<SOAPMessage> is only valid for soap binding and in Service.Mode.MESSAGE
+        if (DispatchImpl.isXMLHttp(binding))
+            throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_BINDING(HTTPBinding.HTTP_BINDING, SOAPBinding.SOAP11HTTP_BINDING + " or " + SOAPBinding.SOAP12HTTP_BINDING));
+        if (DispatchImpl.isPAYLOADMode(mode))
+            throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
+    }
+
+    public static void checkValidDataSourceDispatch(WSBinding binding, Service.Mode mode) {
+        // Dispatch<DataSource> is only valid with xml/http binding and in Service.Mode.MESSAGE
+        if (!DispatchImpl.isXMLHttp(binding))
+            throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_BINDING("SOAP/HTTP", HTTPBinding.HTTP_BINDING));
+        if (DispatchImpl.isPAYLOADMode(mode))
+            throw new WebServiceException(DispatchMessages.INVALID_DATASOURCE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
+    }
+
+    protected final @NotNull QName getPortName() {
+        return portname;
+    }
+
+
+    void resolveEndpointAddress(@NotNull Packet message, @NotNull RequestContext requestContext) {
+        //resolve endpoint look for query parameters, pathInfo
+        String endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        if (endpoint == null)
+            endpoint = message.endpointAddress.toString();
+
+        String pathInfo = null;
+        String queryString = null;
+        if (requestContext.get(MessageContext.PATH_INFO) != null)
+            pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
+
+        if (requestContext.get(MessageContext.QUERY_STRING) != null)
+            queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
+
+
+        String resolvedEndpoint = null;
+        if (pathInfo != null || queryString != null) {
+            pathInfo = checkPath(pathInfo);
+            queryString = checkQuery(queryString);
+            if (endpoint != null) {
+                try {
+                    final URI endpointURI = new URI(endpoint);
+                    resolvedEndpoint = resolveURI(endpointURI, pathInfo, queryString);
+                } catch (URISyntaxException e) {
+                    throw new WebServiceException(DispatchMessages.INVALID_URI(endpoint));
+                }
+            }
+            requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, resolvedEndpoint);
+            //message.endpointAddress = EndpointAddress.create(resolvedEndpoint);
+        }
+    }
+
+    protected @NotNull String resolveURI(@NotNull URI endpointURI, @Nullable String pathInfo, @Nullable String queryString) {
+        String query = null;
+        String fragment = null;
+        if (queryString != null) {
+            final URI result;
+            try {
+                URI tp = new URI(null, null, endpointURI.getPath(), queryString, null);
+                result = endpointURI.resolve(tp);
+            } catch (URISyntaxException e) {
+                throw new WebServiceException(DispatchMessages.INVALID_QUERY_STRING(queryString));
+            }
+            query = result.getQuery();
+            fragment = result.getFragment();
+        }
+
+        final String path = (pathInfo != null) ? pathInfo : endpointURI.getPath();
+        try {
+            final URI temp = new URI(null, null, path, query, fragment);
+            return endpointURI.resolve(temp).toURL().toExternalForm();
+        } catch (URISyntaxException e) {
+            throw new WebServiceException(DispatchMessages.INVALID_URI_PATH_QUERY(path ,query));
+        } catch (MalformedURLException e) {
+            throw new WebServiceException(DispatchMessages.INVALID_URI_RESOLUTION(path));
+        }
+    }
+
+    private static String checkPath(@Nullable String path) {
+        //does it begin with /
+        return (path == null || path.startsWith("/")) ? path : "/" + path;
+    }
+
+    private static String checkQuery(@Nullable String query) {
+        if (query == null) return null;
+
+        if (query.indexOf('?') == 0)
+           throw new WebServiceException(DispatchMessages.INVALID_QUERY_LEADING_CHAR(query));
+        return query;
+    }
+
+
+    protected AttachmentSet setOutboundAttachments() {
+        HashMap<String, DataHandler> attachments = (HashMap<String, DataHandler>)
+                getRequestContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+
+        if (attachments != null) {
+            List<Attachment> alist = new ArrayList();
+            for (Map.Entry<String, DataHandler> att : attachments.entrySet()) {
+                DataHandlerAttachment dha = new DataHandlerAttachment(att.getKey(), att.getValue());
+                alist.add(dha);
+            }
+            return new AttachmentSetImpl(alist);
+        }
+        return new AttachmentSetImpl();
+    }
+
+   /* private void getInboundAttachments(Message msg) {
+        AttachmentSet attachments = msg.getAttachments();
+        if (!attachments.isEmpty()) {
+            Map<String, DataHandler> in = new HashMap<String, DataHandler>();
+            for (Attachment attachment : attachments)
+                in.put(attachment.getContentId(), attachment.asDataHandler());
+            getResponseContext().put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, in);
+        }
+
+    }
+    */
+
+
+    /**
+     * Calls {@link DispatchImpl#doInvoke(Object,RequestContext,ResponseContextReceiver)}.
+     */
+    private class Invoker implements Callable {
+        private final T param;
+        // snapshot the context now. this is necessary to avoid concurrency issue,
+        // and is required by the spec
+        private final RequestContext rc = requestContext.copy();
+
+        /**
+         * Because of the object instantiation order,
+         * we can't take this as a constructor parameter.
+         */
+        private ResponseContextReceiver receiver;
+
+        Invoker(T param) {
+            this.param = param;
+        }
+
+        public T call() throws Exception {
+            return doInvoke(param,rc,receiver);
+        }
+
+        void setReceiver(ResponseContextReceiver receiver) {
+            this.receiver = receiver;
+        }
+    }
+
+    /**
+     *
+     */
+    private class DispatchAsyncInvoker extends AsyncInvoker {
+        private final T param;
+        // snapshot the context now. this is necessary to avoid concurrency issue,
+        // and is required by the spec
+        private final RequestContext rc = requestContext.copy();
+
+        DispatchAsyncInvoker(T param) {
+            this.param = param;
+        }
+
+        public void run () {
+            checkNullAllowed(param, rc, binding, mode);
+            Packet message = createPacket(param);
+            resolveEndpointAddress(message, rc);
+            setProperties(message,true);
+            Fiber.CompletionCallback callback = new Fiber.CompletionCallback() {
+                public void onCompletion(@NotNull Packet response) {
+                    Message msg = response.getMessage();
+                    try {
+                        if(msg != null && msg.isFault()) {
+                            SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
+                            // passing null means there is no checked excpetion we're looking for all
+                            // it will get back to us is a protocol exception
+                            throw (SOAPFaultException)faultBuilder.createException(null);
+                        }
+                        responseImpl.setResponseContext(new ResponseContext(response));
+                        responseImpl.set(toReturnValue(response), null);
+                    } catch (JAXBException e) {
+                        //TODO: i18nify
+                        responseImpl.set(null, new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e));
+                    } catch(RuntimeException e){
+                        //it could be a WebServiceException or a ProtocolException or any RuntimeException
+                        // resulting due to some internal bug.
+                        responseImpl.set(null, e);
+                    } catch(Throwable e){
+                        //its some other exception resulting from user error, wrap it in
+                        // WebServiceException
+                        responseImpl.set(null, new WebServiceException(e));
+                    }
+                }
+                public void onCompletion(@NotNull Throwable error) {
+                    responseImpl.set(null, error);
+                }
+            };
+            processAsync(message,rc, callback);
+        }
+    }
+
+    public void setOutboundHeaders(Object... headers) {
+        throw new UnsupportedOperationException();
+    }
+
+    static final String HTTP_REQUEST_METHOD_GET="GET";
+    static final String HTTP_REQUEST_METHOD_POST="POST";
+    static final String HTTP_REQUEST_METHOD_PUT="PUT";
+
+    public static Dispatch<Source> createSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        if(isXMLHttp(binding))
+            return new RESTSourceDispatch(port,mode,owner,pipe,binding,epr);
+        else
+            return new SOAPSourceDispatch(port,mode,owner,pipe,binding,epr);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/JAXBDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/JAXBDispatch.java
new file mode 100644
index 0000000..51f9cf4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/JAXBDispatch.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Headers;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * The <code>JAXBDispatch</code> class provides support
+ * for the dynamic invocation of a service endpoint operation using
+ * JAXB objects. The <code>javax.xml.ws.Service</code>
+ * interface acts as a factory for the creation of <code>JAXBDispatch</code>
+ * instances.
+ *
+ * @author WS Development Team
+ * @version 1.0
+ */
+public class JAXBDispatch extends DispatchImpl<Object> {
+
+    private final JAXBContext jaxbcontext;
+
+    public JAXBDispatch(QName port, JAXBContext jc, Service.Mode mode, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        super(port, mode, service, pipe, binding, epr);
+        this.jaxbcontext = jc;
+    }
+
+
+    Object toReturnValue(Packet response) {
+        try {
+            Unmarshaller unmarshaller = jaxbcontext.createUnmarshaller();
+            Message msg = response.getMessage();
+            switch (mode) {
+                case PAYLOAD:
+                    return msg.<Object>readPayloadAsJAXB(unmarshaller);
+                case MESSAGE:
+                    Source result = msg.readEnvelopeAsSource();
+                    return unmarshaller.unmarshal(result);
+                default:
+                    throw new WebServiceException("Unrecognized dispatch mode");
+            }
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+
+    Packet createPacket(Object msg) {
+        assert jaxbcontext != null;
+
+        try {
+            Marshaller marshaller = jaxbcontext.createMarshaller();
+            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
+
+            Message message = (msg == null) ? Messages.createEmpty(soapVersion): Messages.create(marshaller, msg, soapVersion);
+            return new Packet(message);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public void setOutboundHeaders(Object... headers) {
+        if(headers==null)
+            throw new IllegalArgumentException();
+        Header[] hl = new Header[headers.length];
+        for( int i=0; i<hl.length; i++ ) {
+            if(headers[i]==null)
+                throw new IllegalArgumentException();
+            // TODO: handle any JAXBContext.
+            hl[i] = Headers.create((JAXBRIContext)jaxbcontext,headers[i]);
+        }
+        super.setOutboundHeaders(hl);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java
new file mode 100644
index 0000000..bda8342
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service.Mode;
+
+/**
+ * {@link Dispatch} implementation for {@link Message}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1.1
+ */
+public class MessageDispatch extends DispatchImpl<Message> {
+
+    public MessageDispatch(QName port, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        super(port, Mode.MESSAGE, service, pipe, binding, epr);
+    }
+
+    @Override
+    Message toReturnValue(Packet response) {
+        return response.getMessage();
+    }
+
+    @Override
+    Packet createPacket(Message msg) {
+        return new Packet(msg);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java
new file mode 100644
index 0000000..58478dc
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
+import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service.Mode;
+import java.io.IOException;
+
+/**
+ * {@link Dispatch} implementation for {@link Source} and XML/HTTP binding.
+ *
+ * @author Kathy Walsh
+ * @author Kohsuke Kawaguchi
+ * @see SOAPSourceDispatch
+ */
+final class RESTSourceDispatch extends DispatchImpl<Source> {
+
+    public RESTSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        super(port, mode, owner, pipe, binding, epr);
+        assert isXMLHttp(binding);
+    }
+
+    @Override
+    Source toReturnValue(Packet response) {
+        Message msg = response.getMessage();
+        try {
+            return new StreamSource(XMLMessage.getDataSource(msg).getInputStream());
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    Packet createPacket(Source msg) {
+        Message message;
+
+        if(msg==null)
+            message = Messages.createEmpty(soapVersion);
+        else
+            message = new PayloadSourceMessage(null, msg, setOutboundAttachments(), soapVersion);
+
+        return new Packet(message);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/ResponseImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/ResponseImpl.java
deleted file mode 100644
index b7beeef..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/ResponseImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client.dispatch;
-
-import com.sun.xml.internal.ws.client.AsyncHandlerService;
-import com.sun.xml.internal.ws.client.ResponseContext;
-
-import javax.xml.ws.Response;
-import java.rmi.server.UID;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.logging.Logger;
-
-/**
- * The <code>Response</code> interface provides methods used to obtain the
- * payload and context a message sent in response to an operation invocation.
- * For asynchronous operation invocations it provides additional methods to
- * check the status of the request.
- *
- * @author JAXWS Development Team
- */
-
-
-public class ResponseImpl<T> extends FutureTask<T> implements Response<T> {
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-    private UID uid;
-    private Lock _lock;
-    private AsyncHandlerService _handlerService;
-    private ResponseContext _responseContext;
-    private boolean handler;
-
-    public ResponseImpl(Callable<T> callable) {
-        super(callable);
-        _lock = new ReentrantLock();
-    }
-
-    public ResponseImpl(Runnable runable, T result) {
-        super(runable, result);
-        _lock = new ReentrantLock();
-    }
-
-    //protected method need to overide
-    public void setException(Exception ex) {
-        _lock.lock();
-        try {
-            super.setException(ex);
-        } catch (Exception e) {
-        } finally {
-            _lock.unlock();
-        }
-    }
-
-    public void set(T result) {
-        _lock.lock();
-        try {
-            super.set(result);
-        } catch (Exception e) {
-        } finally {
-            _lock.unlock();
-        }
-    }
-
-    /**
-     * Gets the contained response context.
-     *
-     * @return The contained response context. May be <code>null</code> if a
-     *         response is not yet available.
-     */
-    public Map<String, Object> getContext() {
-        if (!isDone()) {
-            return null;
-        } else {
-            return (_responseContext);
-        }
-    }
-
-    public void setResponseContext(Map context) {
-        _responseContext = (ResponseContext) context;
-    }
-
-    public synchronized void setUID(UID id) {
-        uid = id;
-    }
-
-    public synchronized UID getUID() {
-        return uid;
-    }
-
-    public void setHandlerService(AsyncHandlerService handlerService) {
-        _handlerService = handlerService;
-    }
-
-    //got to lock
-
-    public void done() {
-        _lock.lock();
-        try {
-            if (!isCancelled())
-                _handlerService.executeWSFuture();
-
-        } catch (Exception e) {
-        } finally {
-            _lock.unlock();
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java
new file mode 100644
index 0000000..ac2405e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.message.saaj.SAAJMessage;
+import com.sun.xml.internal.ws.resources.DispatchMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The <code>SOAPMessageDispatch</code> class provides support
+ * for the dynamic invocation of a service endpoint operation using
+ * the <code>SOAPMessage</code> class. The <code>javax.xml.ws.Service</code>
+ * interface acts as a factory for the creation of <code>SOAPMessageDispatch</code>
+ * instances.
+ *
+ * @author WS Development Team
+ * @version 1.0
+ */
+public class SOAPMessageDispatch extends com.sun.xml.internal.ws.client.dispatch.DispatchImpl<SOAPMessage> {
+    public SOAPMessageDispatch(QName port, Service.Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        super(port, mode, owner, pipe, binding, epr);
+    }
+
+    Packet createPacket(SOAPMessage arg) {
+
+        if (arg == null && !isXMLHttp(binding))
+           throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
+
+        MimeHeaders mhs = arg.getMimeHeaders();
+        // TODO: these two lines seem dangerous. It should be left up to the transport and codec
+        // to decide how they are sent. remove after 2.1 FCS - KK.
+        mhs.addHeader("Content-Type", "text/xml");
+        mhs.addHeader("Content-Transfer-Encoding", "binary");
+        Map<String, List<String>> ch = new HashMap<String, List<String>>();
+        for (Iterator iter = arg.getMimeHeaders().getAllHeaders(); iter.hasNext();)
+        {
+            MimeHeader mh = (MimeHeader) iter.next();
+            List<String> h = new ArrayList<String>();
+            h.add(mh.getValue());
+            ch.put(mh.getName(), h);
+        }
+
+        Packet packet = new Packet(new SAAJMessage(arg));
+        packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS,ch);
+        return packet;
+    }
+
+    SOAPMessage toReturnValue(Packet response) {
+        try {
+
+            //not sure if this is the correct way to deal with this.
+            if ( response ==null || response.getMessage() == null )
+                     throw new WebServiceException(DispatchMessages.INVALID_RESPONSE());
+            else
+                return response.getMessage().readAsSOAPMessage();
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPSourceDispatch.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPSourceDispatch.java
new file mode 100644
index 0000000..16ac3c8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPSourceDispatch.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.dispatch;
+
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceException;
+
+
+/**
+ * The <code>SOAPSourceDispatch</code> class provides support
+ * for the dynamic invocation of a service endpoint operation using XML
+ * constructs. The <code>javax.xml.ws.Service</code>
+ * interface acts as a factory for the creation of <code>SOAPSourceDispatch</code>
+ * instances.
+ *
+ * @author WS Development Team
+ * @version 1.0
+ * @see RESTSourceDispatch
+ */
+final class SOAPSourceDispatch extends DispatchImpl<Source> {
+
+    public SOAPSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
+        super(port, mode, owner, pipe, binding, epr);
+        assert !isXMLHttp(binding);
+    }
+
+    Source toReturnValue(Packet response) {
+        Message msg = response.getMessage();
+
+        switch (mode) {
+        case PAYLOAD:
+            return msg.readPayloadAsSource();
+        case MESSAGE:
+            return msg.readEnvelopeAsSource();
+        default:
+            throw new WebServiceException("Unrecognized dispatch mode");
+        }
+    }
+
+    @Override
+    Packet createPacket(Source msg) {
+
+        final Message message;
+
+        if (msg == null)
+            message = Messages.createEmpty(soapVersion);
+        else {
+            switch (mode) {
+            case PAYLOAD:
+                message = new PayloadSourceMessage(null, msg, setOutboundAttachments(), soapVersion);
+                break;
+            case MESSAGE:
+                message = Messages.create(msg, soapVersion);
+                break;
+            default:
+                throw new WebServiceException("Unrecognized message mode");
+            }
+        }
+
+        return new Packet(message);
+    }
+
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchContactInfoList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchContactInfoList.java
deleted file mode 100644
index a5deb7d..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchContactInfoList.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.client.dispatch.impl;
-
-import java.util.ArrayList;
-
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-import com.sun.xml.internal.ws.pept.ept.ContactInfoList;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoListIterator;
-import com.sun.xml.internal.ws.client.ContactInfoBase;
-import com.sun.xml.internal.ws.client.ContactInfoListIteratorBase;
-import com.sun.xml.internal.ws.client.dispatch.impl.protocol.MessageDispatcherHelper;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLDecoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLEncoder;
-import com.sun.xml.internal.ws.protocol.xml.client.XMLMessageDispatcher;
-
-/**
- * @author: WS Development Team
- */
-public class DispatchContactInfoList implements ContactInfoList {
-
-    public ContactInfoListIterator iterator() {
-        ArrayList<Object> arrayList = new ArrayList<Object>();
-
-        arrayList.add(new ContactInfoBase(null,
-            new MessageDispatcherHelper(),
-            new SOAPXMLEncoder(),
-            new SOAPXMLDecoder(),SOAPBinding.SOAP11HTTP_BINDING));
-        arrayList.add(new ContactInfoBase(null,
-            new MessageDispatcherHelper(),
-            new SOAP12XMLEncoder(),
-            new SOAP12XMLDecoder(), SOAPBinding.SOAP12HTTP_BINDING));
-        arrayList.add(new ContactInfoBase(null,
-                new XMLMessageDispatcher(),
-                new XMLEncoder(),
-                new XMLDecoder(), HTTPBinding.HTTP_BINDING));
-        /*arrayList.add(new DispatchContactInfo(null,
-                new MessageDispatcherHelper(new DispatchEncoderDecoderUtil()),
-                new SOAPFastEncoder(new DispatchEncoderDecoderUtil()),
-                new SOAPFastDecoder(new DispatchEncoderDecoderUtil())));
-          */
-        return new ContactInfoListIteratorBase(arrayList);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchDelegate.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchDelegate.java
deleted file mode 100644
index bb26dba..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/DispatchDelegate.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client.dispatch.impl;
-
-import com.sun.xml.internal.ws.pept.ept.ContactInfo;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoList;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoListIterator;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase;
-import com.sun.xml.internal.ws.client.*;
-
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-
-/**
- * @author WS Development Team
- */
-public class DispatchDelegate extends DelegateBase {
-
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-
-    public DispatchDelegate() {
-    }
-
-    public DispatchDelegate(ContactInfoList contactInfoList) {
-        this.contactInfoList = contactInfoList;
-    }
-
-    public void send(MessageStruct messageStruct) {
-        MessageInfo messageInfo = (MessageInfo) messageStruct;
-
-        ContextMap properties = (ContextMap)
-                messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        BindingProvider dispatch = (BindingProvider)properties.get(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-
-        if (!contactInfoList.iterator().hasNext())
-            throw new WebServiceException("can't pickup message encoder/decoder, no ContactInfo!");
-
-
-        BindingImpl bi = (BindingImpl)dispatch.getBinding();
-        String bindingId = bi.getBindingId();
-        ContactInfo contactInfo = getContactInfo(contactInfoList, bindingId);
-        messageInfo.setEPTFactory(contactInfo);
-        messageInfo.setConnection(contactInfo.getConnection(messageInfo));
-
-        MessageDispatcher messageDispatcher =
-            contactInfo.getMessageDispatcher(messageInfo);
-        messageDispatcher.send(messageInfo);
-    }
-
-     private ContactInfo getContactInfo(ContactInfoList cil, String bindingId){
-        ContactInfoListIterator iter = cil.iterator();
-        while(iter.hasNext()){
-            ContactInfoBase cib = (ContactInfoBase)iter.next();
-            if(cib.getBindingId().equals(bindingId))
-                return cib;
-        }
-        //return the first one
-        return cil.iterator().next();
-    }
-    /*private ContactInfo getContactInfo(ContactInfoListIterator iterator, MessageStruct messageStruct) {
-        if (!iterator.hasNext())
-            throw new RuntimeException("no next");
-
-        ContactInfo contactInfo = iterator.next();
-        //Todo: use Map
-        //if fast encoding go to next
-         if (isFastEncoding((RequestContext)
-                 messageStruct.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY))) {
-             if (iterator.hasNext())
-                 contactInfo = iterator.next();
-             else {
-                 if (logger.isLoggable(Level.INFO))     //needs localicalization
-                     logger.info("Defaulting to XML Encoding. ");
-                 setDefaultEncoding((RequestContext)
-                         messageStruct.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY));
-             }
-         } else
-             setDefaultEncoding((RequestContext)
-                     messageStruct.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY));
-
-        return contactInfo;
-    }
- */
-
-     private void setDefaultEncoding(RequestContext requestContext) {
-         requestContext.put(BindingProviderProperties.ACCEPT_ENCODING_PROPERTY,
-                 BindingProviderProperties.XML_ENCODING_VALUE);
-     }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchSerializer.java
deleted file mode 100644
index e38177d..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchSerializer.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.client.dispatch.impl.encoding;
-
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.streaming.Attributes;
-import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import static javax.xml.stream.XMLStreamConstants.*;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.WebServiceException;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.logging.Logger;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-
-/**
- * @author WS Development Team
- */
-public final class DispatchSerializer {
-
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-
-    private final QName bodyTagName;
-
-    /**
-     * For SOAP 1.0.
-     */
-    public static final DispatchSerializer SOAP_1_0 = new DispatchSerializer(SOAPConstants.QNAME_SOAP_BODY);
-
-    /**
-     * For SOAP 1.2.
-     */
-    public static final DispatchSerializer SOAP_1_2 = new DispatchSerializer(SOAP12Constants.QNAME_SOAP_BODY);
-
-
-    private DispatchSerializer(QName soapBodyTagName) {
-        bodyTagName = soapBodyTagName;
-    }
-
-    public void serialize(Object obj, XMLStreamWriter writer, JAXBContext context) {
-        if (obj instanceof Source)
-            serializeSource(obj, writer);
-        else if (obj instanceof JAXBBeanInfo) {
-            ((JAXBBeanInfo) obj).writeTo(writer);
-        } else
-            throw new WebServiceException("Unable to serialize object type " + obj.getClass().getName());
-        //should not happen
-    }
-
-
-    private static String convertNull(String s) {
-        return (s != null) ? s : "";
-    }
-
-    // this is very very inefficient.
-    //kw-needs lots of cleanup
-    //kw-modifying this in any way will cause dispatch tests sqe failures
-    public Source deserializeSource(XMLStreamReader reader, DispatchUtil dispatchUtil) {
-
-        ByteArrayBuffer baos = new ByteArrayBuffer();
-        XMLStreamWriter writer = XMLStreamWriterFactory.createXMLStreamWriter(baos);
-        dispatchUtil.populatePrefixes(writer);
-        try {
-            while (reader.hasNext()) {
-                int state = reader.getEventType();
-                switch (state) {
-                    case START_ELEMENT:
-
-                        String uri = reader.getNamespaceURI();
-                        String rprefix = reader.getPrefix();
-                        String nlocal = reader.getLocalName();
-                        setWriterPrefixes(rprefix, uri, writer);
-
-                        String prefix = null;
-                        String wprefix = writer.getNamespaceContext().getPrefix(uri);
-                        if ((wprefix != null && !"".equals(wprefix)) && wprefix.length() > 0){
-                            prefix = wprefix;
-                        } else
-                        if ((rprefix != null && !"".equals(rprefix)) && (uri != null && !"null".equals(uri))){
-                            prefix = setWriterPrefixes(reader, uri, writer);
-                        } else {
-                            prefix = convertNull(prefix);
-                            uri = convertNull(uri);
-                        }
-
-                        writer.writeStartElement(prefix, nlocal, uri);
-                        writer.writeNamespace(prefix, uri);
-
-                        Attributes atts = XMLStreamReaderUtil.getAttributes(reader);
-                        writer.flush();
-                        writeAttributes(atts, writer, prefix, uri);
-                        break;
-                    case END_ELEMENT:
-                        writer.writeEndElement();
-                        break;
-                    case CHARACTERS:
-                        writer.writeCharacters(reader.getText());
-
-                }
-                state = XMLStreamReaderUtil.next(reader);
-                if ((reader.getEventType() == END_ELEMENT) && (reader.getName().equals(bodyTagName)))
-                    break;
-            }
-            writer.flush();
-            writer.close();
-            reader.close();
-        } catch (XMLStreamException ex) {
-            ex.printStackTrace();
-        }
-
-        return new StreamSource(baos.newInputStream());
-    }
-
-    private void writeAttributes(Attributes atts, XMLStreamWriter writer, String prefix, String uri) throws XMLStreamException {
-        for (int i = 0; i < atts.getLength(); i++) {
-
-            String value = atts.getValue(i);
-            String localName = atts.getName(i).getLocalPart();
-            String aprefix = atts.getPrefix(i);
-            String auri = atts.getURI(i);
-
-            setWriterPrefix(localName, value, aprefix, writer);
-            if (atts.isNamespaceDeclaration(i)) {
-                writeAttrNamespace(aprefix, auri, writer, localName, prefix, uri, value);
-            } else {
-                writeAttribute(atts, i, writer);
-            }
-        }
-    }
-
-    private void setWriterPrefix(String localName, String value, String aprefix, XMLStreamWriter writer) throws XMLStreamException {
-        if (localName.equals("xsi") &&
-            value.equals("http://www.w3.org/2001/XMLSchema-instance") &&
-            aprefix.equals("xmlns")) {
-            //kw was aa prefix
-            writer.setPrefix(localName, value);
-        }
-    }
-
-    private String setWriterPrefixes(XMLStreamReader reader, String nuri, XMLStreamWriter writer) {
-
-        String prefix = reader.getNamespaceContext().getPrefix(nuri);
-        if (prefix == null)
-            prefix = convertNull(prefix);
-        if (prefix != null && prefix.length() > 0 && nuri != null && !prefix.equals("xmlns"))        {
-            try {
-                writer.setPrefix(prefix, nuri);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        return prefix;
-    }
-
-    private void setWriterPrefixes(String npre, String nuri, XMLStreamWriter writer) throws XMLStreamException {
-        if ((npre != null && npre.length() > 0) && (nuri.length() > 0 && nuri != null))
-        {
-            if ((npre.equals("null") || nuri.equals("null"))) {
-                writer.setPrefix(npre, nuri);
-            }
-        }
-    }
-
-    private void writeAttrNamespace(String aprefix, String auri, XMLStreamWriter writer, String localName, String prefix, String nuri, String value) throws XMLStreamException {
-        if (aprefix == null || !aprefix.equals("") || (aprefix.equals("xmlns")))
-        {
-            String temp = aprefix;
-            if (auri != null) {
-                String wprefix = writer.getNamespaceContext().getPrefix(auri);
-                if (aprefix.equals("xmlns") && !(localName.equals("xsi"))){
-                    aprefix = prefix;
-                    auri = nuri;
-                } else {
-                    if (wprefix != null && !wprefix.equals("xmlns")) {
-                        aprefix = wprefix;
-                    }
-                }
-                if (aprefix == null)
-                    convertNull(aprefix);
-            }
-
-            writeNamespace(aprefix, prefix, auri, nuri, writer);
-            writeXSINamspece(localName, value, temp, writer, aprefix, auri);
-        }
-    }
-
-    private void writeNamespace(String aprefix, String prefix, String auri, String nuri, XMLStreamWriter writer) throws XMLStreamException {
-        if (!(aprefix.equals(prefix) && auri.equals(nuri))){
-            if (!aprefix.equals("xmlns")) {
-                writer.writeNamespace(aprefix, auri);
-            }
-        }
-    }
-
-    private void writeXSINamspece(String localName, String value, String temp, XMLStreamWriter writer, String aprefix, String auri) throws XMLStreamException {
-        if (localName.equals("xsi") &&
-            value.equals("http://www.w3.org/2001/XMLSchema-instance") &&
-            temp.equals("xmlns")) {
-            writer.setPrefix(localName, value);
-            writer.writeAttribute(aprefix, auri, localName, value);
-        }
-    }
-
-    private void writeAttribute(Attributes atts, int i, XMLStreamWriter writer) throws XMLStreamException {
-        if ((atts.getURI(i) == null) && (atts.getPrefix(i) != null))        {
-            String ns = writer.getNamespaceContext().getNamespaceURI(atts.getURI(i));
-            writer.writeAttribute(atts.getPrefix(i), ns, atts.getLocalName(i),
-                atts.getValue(i));
-        }
-        writer.writeAttribute(atts.getPrefix(i), atts.getURI(i), atts.getLocalName(i), atts.getValue(i));
-    }
-
-    void serializeSource(Object source, XMLStreamWriter writer) {
-        try {
-            XMLStreamReader reader = SourceReaderFactory.createSourceReader((Source) source, true);
-
-            int state;
-            do {
-                state = XMLStreamReaderUtil.next(reader);
-                switch (state) {
-                    case START_ELEMENT:
-                        QName elementName = reader.getName();
-                        String localPart = elementName.getLocalPart();
-                        String namespaceURI = elementName.getNamespaceURI();
-                        String prefix = elementName.getPrefix();
-
-                        writer.writeStartElement(prefix, localPart, namespaceURI);
-
-                        Attributes atts = XMLStreamReaderUtil.getAttributes(reader);
-                        writer.flush();
-                        for (int i = 0; i < atts.getLength(); i++) {
-                            if (atts.isNamespaceDeclaration(i)) {
-                                String value = atts.getValue(i);
-                                String localName = atts.getName(i).getLocalPart();
-                                writer.setPrefix(localName, value);
-                                writer.writeNamespace(localName, value);
-                            } else {
-                                writer.writeAttribute(atts.getPrefix(i), atts.getURI(i),
-                                    atts.getLocalName(i), atts.getValue(i));
-                            }
-                        }
-                        break;
-                    case END_ELEMENT:
-                        writer.writeEndElement();
-                        break;
-                    case CHARACTERS:
-                        writer.writeCharacters(reader.getText());
-                }
-            } while (state != END_DOCUMENT);
-        } catch (XMLStreamException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-//    private void displayDOM(Node node, java.io.OutputStream ostream) {
-//        try {
-//            System.out.println("\n====\n");
-//            javax.xml.transform.TransformerFactory.newInstance().newTransformer().transform(new javax.xml.transform.dom.DOMSource(node),
-//                new javax.xml.transform.stream.StreamResult(ostream));
-//            System.out.println("\n====\n");
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-
-//    private String sourceToXMLString(Source result) {
-//        String xmlResult = null;
-//        try {
-//            TransformerFactory factory = TransformerFactory.newInstance();
-//            Transformer transformer = factory.newTransformer();
-//            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-//            transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-//            OutputStream out = new ByteArrayOutputStream();
-//            StreamResult streamResult = new StreamResult();
-//            streamResult.setOutputStream(out);
-//            transformer.transform(result, streamResult);
-//            xmlResult = streamResult.getOutputStream().toString();
-//        } catch (TransformerException e) {
-//            e.printStackTrace();
-//        }
-//        return xmlResult;
-//    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchUtil.java
deleted file mode 100644
index a67f27a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/encoding/DispatchUtil.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.client.dispatch.impl.encoding;
-
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.namespace.QName;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-
-public class DispatchUtil {
-
-    private Map<String, String> namespacePrefixMap;
-
-    public void clearNPMap() {
-        namespacePrefixMap.clear();
-    }
-
-    public void populatePrefixes(XMLStreamWriter writer) {
-        if (!namespacePrefixMap.isEmpty()) {
-            Set<Map.Entry<String, String>> entrys = namespacePrefixMap.entrySet();
-            for (Map.Entry<String, String> entry : entrys) {
-                try {
-                    writer.setPrefix(entry.getValue(), entry.getKey());
-                } catch (XMLStreamException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-
-    public void collectPrefixes(XMLStreamReader reader) {
-        if (namespacePrefixMap == null)
-            namespacePrefixMap = new HashMap<String, String>();
-
-        int i = reader.getNamespaceCount();
-        for (int j = 0; j < i; j++){
-            String prefix = reader.getNamespacePrefix(j);
-            String namespace = reader.getNamespaceURI(j);
-            if (prefix.length() > 0 && namespace != null) {
-                namespacePrefixMap.put(namespace, prefix);
-            }
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/protocol/MessageDispatcherHelper.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/protocol/MessageDispatcherHelper.java
deleted file mode 100644
index dfab855..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/impl/protocol/MessageDispatcherHelper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.client.dispatch.impl.protocol;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.client.ContextMap;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher;
-
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import java.util.logging.Logger;
-
-/**
- * @author WS Development Team
- */
-public class MessageDispatcherHelper extends SOAPMessageDispatcher
-    implements BindingProviderProperties {
-
-    private static final Logger logger =
-        Logger.getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch").toString());
-
-    public MessageDispatcherHelper() {
-        super();
-    }
-
-    @Override
-    protected void setResponseType(Throwable e, MessageInfo messageInfo) {
-        if (e instanceof RuntimeException) {
-            //leave for now- fix later
-            if (e instanceof WebServiceException)
-                messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-            else
-                messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-        } else {
-            messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-        }
-    }
-
-    @Override
-    protected HandlerChainCaller getHandlerChainCaller(MessageInfo messageInfo) {
-        ContextMap context = (ContextMap)
-            messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        BindingProvider provider = (BindingProvider)
-            context.get(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-        BindingImpl binding = (BindingImpl) provider.getBinding();
-        return binding.getHandlerChainCaller();
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/package-info.java
index 7bf1258..89d5227 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,132 +24,17 @@
  */
 
 /**
- *  <h1>JAX-WS 2.0 Client Runtime</h1>
+ *  <h1>JAX-WS 2.0.1 Client Runtime</h1>
  * <P>This document describes the architecture of client side
- * JAX-WS 2.0 runtime.
+ * JAX-WS 2.0.1 runtime.
  *
- * <h3>JAX-WS 2.0 Server Client Sequence Diagram</h3>
- * {@SequenceDiagram
- *    pobject(U,"user");
- *   object(A,"EndpointIFInvocationHandler");
- *   object(B,"DelegateBase");
- *   object(C,"MessageDispatcher");
- *   object(D,"Encoder/Decoder");
- *   object(F,"WSConnection");
- *   step();
- *
- *   message(U,A,"invoke Web Service");
- *   active(A);
- *   message(A,A,"invoke");
- *   active(A);
- *   step();
- *   inactive(A);
- *#    step();
- *
- *   message(A,A,"implementSEIMethod");
- *   active(A);
- *   step();
- *   inactive(A);
- *
- *   message(A,B,"send");
- *   active(B);
- *
- *   message(B,B,"getContactInfo");
- *   active(B);
- *   step();
- *   inactive(B);
- *
- *   message(B,B,"getMessageDispatcher");
- *   active(B);
- *   step();
- *  inactive(B);
- *
- *   message(B,C,"send");
- *   active(C);
- *#    step();
- *#    inactive(B);
- *
- *#    message(C,C,"doSend");
- *#    active(C);
- *#    step();
- *#    inactive(C);
- *
- *#    active(C);
- *   message(C,D,"toInternalMessage");
- *   active(D);
- *   step();
- *   inactive(D);
- *
- *   message(C,D,"toSOAPMessage");
- *   active(D);
- *   step();
- *   inactive(D);
- *
- *   message(C,C,"invokeHandlers");
- *   active(C);
- *   step();
- *   inactive(C);
- *
- *   message(C,F,"setHeaders");
- *   active(F);
- *   step();
- *   inactive(F);
- *
- *   message(C,F,"getOutput");
- *   active(F);
- *   step();
- *   inactive(F);
- *
- *   message(C,F,"writeTo");
- *   active(F);
- *   step();
- *   inactive(F);
- *
- *#    message(C,C,"receive");
- *#    active(C);
- *#    step();
- *#    inactive(C);
- *
- *   message(C,F,"readSOAPMessage");
- *   active(F);
- *   step();
- *   inactive(F);
- *
- *   message(C,C,"mustUnderstand");
- *   active(C);
- *   step();
- *   inactive(C);
- *
- *  message(C,C,"invokeHandlers");
- *  active(C);
- *  step();
- *  inactive(C);
- *
- *  message(C,D,"toInternalMessage");
- *  active(D);
- *  step();
- *  inactive(D);
- *
- *#    message(C,C,"doSendAsync");
- *#    active(C);
- *#    step();
- *#    inactive(C);
- *
- *#    message(C,C,"sendAsyncReceive");
- *#    active(C);
- *#    step();
- *#    inactive(C);
- *
- *   rmessage(C,B,"response");
- *   inactive(C);
- *
- *   rmessage(B,A,"response");
- *   inactive(B);
- *
- *   rmessage(A,U,"response");
- *   complete(A);
- * }
- *
+ * <h3>JAX-WS 2.0.1 Client Sequence Diagram</h3>
+ * <img src='../../../../../jaxws/basic-client.seq.png'>
+  * <h3>JAX-WS 2.0.1 Asynchronous Invocation Sequence Diagram</h3>
+ * <img src='../../../../../jaxws/client-async.seq.png'>
+  * <h3>JAX-WS 2.0.1 Dispatch Invocation Sequence Diagram</h3>
+ * <img src='../../../../../jaxws/dispatch.seq.png'>
+
  * <H3>Message Flow</H3>
  * {@link com.sun.xml.internal.ws.client.WebService} provides client view of a Web service.
  * WebService.getPort returns an instance of {@link com.sun.xml.internal.ws.client.EndpointIFInvocationHandler}
@@ -166,7 +51,7 @@
  * {@link javax.xml.ws.BindingProvider} and sets it on the MessageInfo. After the
  * Delegate obtains a specific ContactInfo it uses that ContactInfo to obtain a
  * protocol-specific {@link com.sun.pept.protocol.MessageDispatcher}. There will be
- * two types of client-side MessageDispatchers for JAX-WS 2.0 FCS,
+ * two types of client-side MessageDispatchers for JAX-WS 2.0.1,
  * {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher} and
  * {@link com.sun.xml.internal.ws.protocol.xml.client.XMLMessageDispatcher}. The Delegate
  * then invokes {@link com.sun.pept.protocol.MessageDispatcher#send}. The
@@ -177,12 +62,12 @@
  * The MessageDispatcher uses ContactInfo to obtain
  * a {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder} which converts
  * the MessageInfo to {@link com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage}.
- * There will be two types of client-side SOAPXMLEncoder for JAX-WS 2.0 FCS,
+ * There will be two types of client-side SOAPXMLEncoder for JAX-WS 2.0.1,
  * SOAPXMEncoder for SOAP 1.1 and {@link com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder}
  * for SOAP 1.2. The MessageDispatcher invokes configured handlers and use the
- * encoder to convert the InternalMessage to a {@link javax.xml.soap.SOAPMessage}.
+ * codec to convert the InternalMessage to a {@link javax.xml.soap.SOAPMessage}.
  * The metadata from the MessageInfo is classified into {@link javax.xml.soap.MimeHeaders}
- * of this SOAPMessage and context information for {@link com.sun.xml.internal.ws.spi.runtime.WSConnection}.
+ * of this SOAPMessage and context information for {@link com.sun.xml.internal.ws.api.server.WSConnection}.
  * The SOAPMessge is then written to the output stream of the WSConnection
  * obtained from MessageInfo.
  *<P></P>
@@ -192,7 +77,7 @@
  * of any handlers. The MessageDispatcher uses ContactInfo to obtain a
  * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder} which converts the SOAPMessage
  * to InternalMessage and then InternalMessage to MessageInfo. There will be two types of
- * client-side SOAPXMLDecoder for JAX-WS 2.0 FCS, SOAPXMLDencoder for SOAP 1.1 and
+ * client-side SOAPXMLDecoder for JAX-WS 2.0.1, SOAPXMLDencoder for SOAP 1.1 and
  * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLDecoder} for SOAP 1.2. The
  * response is returned back to the client code via Delegate.
  *
@@ -264,7 +149,6 @@
 
 import com.sun.xml.internal.bind.api.BridgeContext;
 
-import javax.xml.ws.Binding;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
 import javax.xml.stream.XMLStreamReader;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncBuilder.java
new file mode 100644
index 0000000..1a9d937
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncBuilder.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.RawAccessor;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import java.util.Collection;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+
+/**
+ * Builds Async bean
+ *
+ * @see MessageFiller
+ * @author Jitendra Kotamraju
+ */
+abstract class AsyncBuilder {
+
+    abstract Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean);
+
+    /**
+     * Used to create a payload JAXB object just by taking
+     * one of the parameters.
+     */
+    final static class Bare extends AsyncBuilder {
+        /**
+         * The index of the method invocation parameters that goes into the payload.
+         */
+        private final int methodPos;
+        private final ValueGetter getter;
+        private final RawAccessor accessor;
+
+        /**
+         * Creates a {@link BodyBuilder} from a bare parameter.
+         */
+        Bare(Class wrapper, ParameterImpl p) {
+            this.methodPos = p.getIndex();
+            this.getter = ValueGetter.get(p);
+            QName name = p.getName();
+            try {
+                accessor = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+            } catch (JAXBException e) {
+                throw new WebServiceException(  // TODO: i18n
+                    wrapper+" do not have a property of the name "+name,e);
+            }
+        }
+
+        /**
+         * Picks up an object from the method arguments and uses it.
+         */
+        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+            try {
+                accessor.set(bean, obj);
+            } catch (Exception e) {
+                throw new WebServiceException(e);    // TODO:i18n
+            }
+            return bean;
+        }
+    }
+
+    final static class Filler extends AsyncBuilder {
+        /**
+         * The index of the method invocation parameters that goes into the payload.
+         */
+        private final int methodPos;
+        private final ValueGetter getter;
+
+        /**
+         * Creates a {@link BodyBuilder} from a bare parameter.
+         */
+        Filler(ParameterImpl p) {
+            this.methodPos = p.getIndex();
+            this.getter = ValueGetter.get(p);
+        }
+
+        /**
+         * Picks up an object from the method arguments and uses it.
+         */
+        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+            return (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+        }
+    }
+
+    public static AsyncBuilder NONE = new None();
+
+    static final class None extends AsyncBuilder {
+        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+            return bean;
+        }
+    }
+
+    static final class Composite extends AsyncBuilder {
+        private final AsyncBuilder[] builders;
+        private final Class beanClass;
+
+        public Composite(AsyncBuilder[] builders, Class beanClass) {
+            this.builders = builders;
+            this.beanClass = beanClass;
+        }
+
+
+        public Composite(Collection<? extends AsyncBuilder> builders, Class beanClass) {
+            this(builders.toArray(new AsyncBuilder[builders.size()]), beanClass);
+        }
+
+        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+            try {
+                bean = beanClass.newInstance();
+            } catch (Exception ex) {
+                throw new WebServiceException(ex);
+            }
+            for (AsyncBuilder builder : builders) {
+                builder.fillAsyncBean(methodArgs, returnValue, bean);
+            }
+            return bean;
+        }
+    }
+
+
+    /**
+     * Used to handle a 'wrapper' style request.
+     * Common part of rpc/lit and doc/lit.
+     */
+    abstract static class Wrapped extends AsyncBuilder {
+
+        /**
+         * Where in the method argument list do they come from?
+         */
+        protected final int[] indices;
+
+        /**
+         * Abstracts away the {@link Holder} handling when touching method arguments.
+         */
+        protected final ValueGetter[] getters;
+
+        protected Wrapped(WrapperParameter wp) {
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            indices = new int[children.size()];
+            getters = new ValueGetter[children.size()];
+            for( int i=0; i<indices.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                indices[i] = p.getIndex();
+                getters[i] = ValueGetter.get(p);
+            }
+        }
+    }
+
+    /**
+     * Used to create a payload JAXB object by wrapping
+     * multiple parameters into one "wrapper bean".
+     */
+    final static class DocLit extends Wrapped {
+        /**
+         * How does each wrapped parameter binds to XML?
+         */
+        private final RawAccessor[] accessors;
+
+        /**
+         * Wrapper bean.
+         */
+        private final Class wrapper;
+
+        /**
+         * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+         */
+        DocLit(Class wrapper, WrapperParameter wp) {
+            super(wp);
+            this.wrapper = wrapper;
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            accessors = new RawAccessor[children.size()];
+            for( int i=0; i<accessors.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                QName name = p.getName();
+                try {
+                    accessors[i] = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+                } catch (JAXBException e) {
+                    throw new WebServiceException(  // TODO: i18n
+                        wrapper+" do not have a property of the name "+name,e);
+                }
+            }
+
+        }
+
+        /**
+         * Packs a bunch of arguments into a {@link CompositeStructure}.
+         */
+        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+            try {
+                // fill in wrapped parameters from methodArgs
+                for( int i=indices.length-1; i>=0; i-- ) {
+                    Object obj = (indices[i] == -1) ? returnValue : methodArgs[indices[i]];
+                    accessors[i].set(bean,getters[i].get(obj));
+                }
+            } catch (Exception e) {
+                throw new WebServiceException(e);    // TODO:i18n
+            }
+            return bean;
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java
new file mode 100644
index 0000000..8910ef9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+//import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
+
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+import com.sun.xml.internal.ws.client.ResponseImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/**
+ * Common part between {@link CallbackMethodHandler} and {@link PollingMethodHandler}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+abstract class AsyncMethodHandler extends MethodHandler {
+
+    private final JavaMethodImpl jm;
+    private final AsyncBuilder asyncBuilder;
+    private final SyncMethodHandler core;
+    /**
+     * Async Wrapper bean.
+     */
+    //private final Class wrapper;
+
+    protected AsyncMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core) {
+        super(owner);
+        this.jm = jm;
+        this.core = core;
+
+        List<ParameterImpl> rp = jm.getResponseParameters();
+
+
+
+        Class tempWrap = null;
+        for(ParameterImpl param : rp) {
+            if (param.isWrapperStyle()) {
+                WrapperParameter wrapParam = (WrapperParameter)param;
+                if (core.getJavaMethod().getBinding().getStyle() == Style.DOCUMENT) {
+                    // doc/wrapper style
+                    tempWrap = (Class)wrapParam.getTypeReference().type;
+                    break;
+                }
+                for(ParameterImpl p : wrapParam.getWrapperChildren()) {
+                    if (p.getIndex() == -1) {
+                        tempWrap = (Class)p.getTypeReference().type;
+                        break;
+                    }
+                }
+                if (tempWrap != null) {
+                    break;
+                }
+            } else {
+                if (param.getIndex() == -1) {
+                    tempWrap = (Class)param.getTypeReference().type;
+                    break;
+                }
+            }
+        }
+        Class wrapper = tempWrap;
+
+        rp = core.getJavaMethod().getResponseParameters();
+        int size = 0;
+        for( ParameterImpl param : rp ) {
+            if (param.isWrapperStyle()) {
+                WrapperParameter wrapParam = (WrapperParameter)param;
+                size += wrapParam.getWrapperChildren().size();
+                if (core.getJavaMethod().getBinding().getStyle() == Style.DOCUMENT) {
+                    // doc/wrapper - wrapper bean is in async signature
+                    // Add 2 so that it is considered as async bean case
+                    size += 2;
+                }
+            } else {
+                ++size;
+            }
+        }
+
+        List<AsyncBuilder> builders = new ArrayList<AsyncBuilder>();
+        if (size == 0) {
+            // no mapping
+        } else if (size == 1) {
+            ParameterImpl single = null;
+            for( ParameterImpl param : rp ) {
+                if (param.isWrapperStyle()) {
+                    WrapperParameter wrapParam = (WrapperParameter)param;
+                    for(ParameterImpl p : wrapParam.getWrapperChildren()) {
+                        single = p;
+                        break;
+                    }
+                    if (single != null)
+                        break;
+                } else {
+                    single = param;
+                    break;
+                }
+            }
+            assert single != null;
+            builders.add(new AsyncBuilder.Filler(single));
+        } else {
+            for( ParameterImpl param : rp ) {
+                switch(param.getOutBinding().kind) {
+                case BODY:
+                    if(param.isWrapperStyle()) {
+                        if(param.getParent().getBinding().isRpcLit())
+                            builders.add(new AsyncBuilder.DocLit(wrapper, (WrapperParameter)param));
+                        else
+                            builders.add(new AsyncBuilder.DocLit(wrapper, (WrapperParameter)param));
+                    } else {
+                        builders.add(new AsyncBuilder.Bare(wrapper, param));
+                    }
+                    break;
+                case HEADER:
+                    builders.add(new AsyncBuilder.Bare(wrapper, param));
+                    break;
+                case ATTACHMENT:
+                    builders.add(new AsyncBuilder.Bare(wrapper, param));
+                    break;
+                case UNBOUND:
+                    /*
+                    builders.add(new AsyncBuilder.NullSetter(setter,
+                        ResponseBuilder.getVMUninitializedValue(param.getTypeReference().type)));
+                     */
+                    break;
+                default:
+                    throw new AssertionError();
+                }
+            }
+
+        }
+        switch(size) {      // Use size, since Composite is creating async bean
+        case 0:
+            asyncBuilder = AsyncBuilder.NONE;
+            break;
+        case 1:
+            asyncBuilder = builders.get(0);
+            break;
+        default:
+            asyncBuilder = new AsyncBuilder.Composite(builders, wrapper);
+        }
+
+    }
+
+    protected final Response<Object> doInvoke(Object proxy, Object[] args, AsyncHandler handler) {
+
+        AsyncMethodHandler.Invoker invoker = new Invoker(proxy, args);
+        ResponseImpl<Object> ft = new ResponseImpl<Object>(invoker,handler);
+        invoker.setReceiver(ft);
+
+        owner.getExecutor().execute(ft);
+        return ft;
+    }
+
+    private class Invoker implements Callable<Object> {
+        private final Object proxy;
+        private final Object[] args;
+        // need to take a copy. required by the spec
+        private final RequestContext snapshot = owner.requestContext.copy();
+        /**
+         * Because of the object instantiation order,
+         * we can't take this as a constructor parameter.
+         */
+        private ResponseContextReceiver receiver;
+
+        public Invoker(Object proxy, Object[] args) {
+            this.proxy = proxy;
+            this.args = args;
+        }
+
+        public Object call() throws Exception {
+            assert receiver!=null;
+            try {
+                // TODO: Calling the sync method has this overhead
+                Object[] newArgs;
+                Method method = core.getJavaMethod().getMethod();
+                int noOfArgs = method.getParameterTypes().length;
+                newArgs = new Object[noOfArgs];
+                for(int i=0; i < noOfArgs; i++) {
+                    if (method.getParameterTypes()[i].isAssignableFrom(Holder.class)) {
+                        Holder holder = new Holder();
+                        if (i < args.length) {
+                            holder.value = args[i];
+                        }
+                        newArgs[i] = holder;
+                    } else {
+                        newArgs[i] = args[i];
+                    }
+                }
+                Object returnValue = core.invoke(proxy,newArgs,snapshot,receiver);
+                return asyncBuilder.fillAsyncBean(newArgs, returnValue, null);
+            } catch (Throwable t) {
+                if (t instanceof RuntimeException) {
+                    if (t instanceof WebServiceException) {
+                        throw (WebServiceException)t;
+                    }
+                }  else if (t instanceof Exception) {
+                    throw (Exception)t;
+                }
+                throw new WebServiceException(t);
+            }
+        }
+
+        void setReceiver(ResponseContextReceiver receiver) {
+            this.receiver = receiver;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java
new file mode 100644
index 0000000..8aab945
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.RawAccessor;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+
+/**
+ * Builds a JAXB object that represents the payload.
+ *
+ * @see MessageFiller
+ * @author Kohsuke Kawaguchi
+ */
+abstract class BodyBuilder {
+    abstract Message createMessage(Object[] methodArgs);
+
+    static final BodyBuilder EMPTY_SOAP11 = new Empty(SOAPVersion.SOAP_11);
+    static final BodyBuilder EMPTY_SOAP12 = new Empty(SOAPVersion.SOAP_12);
+
+    private static final class Empty extends BodyBuilder {
+        private final SOAPVersion soapVersion;
+
+        public Empty(SOAPVersion soapVersion) {
+            this.soapVersion = soapVersion;
+        }
+
+        Message createMessage(Object[] methodArgs) {
+            return Messages.createEmpty(soapVersion);
+        }
+    }
+
+    /**
+     * Base class for those {@link BodyBuilder}s that build a {@link Message}
+     * from JAXB objects.
+     */
+    private static abstract class JAXB extends BodyBuilder {
+        /**
+         * This object determines the binding of the object returned
+         * from {@link #build(Object[])}.
+         */
+        private final Bridge bridge;
+        private final SOAPVersion soapVersion;
+
+        protected JAXB(Bridge bridge, SOAPVersion soapVersion) {
+            assert bridge!=null;
+            this.bridge = bridge;
+            this.soapVersion = soapVersion;
+        }
+
+        final Message createMessage(Object[] methodArgs) {
+            return JAXBMessage.create( bridge, build(methodArgs), soapVersion );
+        }
+
+        /**
+         * Builds a JAXB object that becomes the payload.
+         */
+        abstract Object build(Object[] methodArgs);
+    }
+
+    /**
+     * Used to create a payload JAXB object just by taking
+     * one of the parameters.
+     */
+    final static class Bare extends JAXB {
+        /**
+         * The index of the method invocation parameters that goes into the payload.
+         */
+        private final int methodPos;
+
+        private final ValueGetter getter;
+
+        /**
+         * Creates a {@link BodyBuilder} from a bare parameter.
+         */
+        Bare(ParameterImpl p, SOAPVersion soapVersion) {
+            super(p.getBridge(), soapVersion);
+            this.methodPos = p.getIndex();
+            this.getter = ValueGetter.get(p);
+        }
+
+        /**
+         * Picks up an object from the method arguments and uses it.
+         */
+        Object build(Object[] methodArgs) {
+            return getter.get(methodArgs[methodPos]);
+        }
+    }
+
+
+    /**
+     * Used to handle a 'wrapper' style request.
+     * Common part of rpc/lit and doc/lit.
+     */
+    abstract static class Wrapped extends JAXB {
+
+        /**
+         * Where in the method argument list do they come from?
+         */
+        protected final int[] indices;
+
+        /**
+         * Abstracts away the {@link Holder} handling when touching method arguments.
+         */
+        protected final ValueGetter[] getters;
+
+        protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp.getBridge(), soapVersion);
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            indices = new int[children.size()];
+            getters = new ValueGetter[children.size()];
+            for( int i=0; i<indices.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                indices[i] = p.getIndex();
+                getters[i] = ValueGetter.get(p);
+            }
+        }
+    }
+
+    /**
+     * Used to create a payload JAXB object by wrapping
+     * multiple parameters into one "wrapper bean".
+     */
+    final static class DocLit extends Wrapped {
+        /**
+         * How does each wrapped parameter binds to XML?
+         */
+        private final RawAccessor[] accessors;
+
+        /**
+         * Wrapper bean.
+         */
+        private final Class wrapper;
+
+        /**
+         * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+         */
+        DocLit(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp, soapVersion);
+
+            wrapper = (Class)wp.getBridge().getTypeReference().type;
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            accessors = new RawAccessor[children.size()];
+            for( int i=0; i<accessors.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                QName name = p.getName();
+                try {
+                    accessors[i] = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+                } catch (JAXBException e) {
+                    throw new WebServiceException(  // TODO: i18n
+                        wrapper+" do not have a property of the name "+name,e);
+                }
+            }
+
+        }
+
+        /**
+         * Packs a bunch of arguments into a {@link CompositeStructure}.
+         */
+        Object build(Object[] methodArgs) {
+            try {
+                Object bean = wrapper.newInstance();
+
+                // fill in wrapped parameters from methodArgs
+                for( int i=indices.length-1; i>=0; i-- ) {
+                    accessors[i].set(bean,getters[i].get(methodArgs[indices[i]]));
+                }
+
+                return bean;
+            } catch (InstantiationException e) {
+                // this is irrecoverable
+                Error x = new InstantiationError(e.getMessage());
+                x.initCause(e);
+                throw x;
+            } catch (IllegalAccessException e) {
+                // this is irrecoverable
+                Error x = new IllegalAccessError(e.getMessage());
+                x.initCause(e);
+                throw x;
+            } catch (AccessorException e) {
+                // this can happen when the set method throw a checked exception or something like that
+                throw new WebServiceException(e);    // TODO:i18n
+            }
+        }
+    }
+
+
+    /**
+     * Used to create a payload JAXB object by wrapping
+     * multiple parameters into a {@link CompositeStructure}.
+     *
+     * <p>
+     * This is used for rpc/lit, as we don't have a wrapper bean for it.
+     * (TODO: Why don't we have a wrapper bean for this, when doc/lit does!?)
+     */
+    final static class RpcLit extends Wrapped {
+        /**
+         * How does each wrapped parameter binds to XML?
+         */
+        private final Bridge[] parameterBridges;
+
+        /**
+         * List of Parameters packed in the body.
+         * Only used for error diagnostics.
+         */
+        private final List<ParameterImpl> children;
+
+        /**
+         * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+         */
+        RpcLit(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp, soapVersion);
+            // we'll use CompositeStructure to pack requests
+            assert wp.getTypeReference().type==CompositeStructure.class;
+
+            this.children = wp.getWrapperChildren();
+
+            parameterBridges = new Bridge[children.size()];
+            for( int i=0; i<parameterBridges.length; i++ )
+                parameterBridges[i] = children.get(i).getBridge();
+        }
+
+        /**
+         * Packs a bunch of arguments intoa {@link CompositeStructure}.
+         */
+        CompositeStructure build(Object[] methodArgs) {
+            CompositeStructure cs = new CompositeStructure();
+            cs.bridges = parameterBridges;
+            cs.values = new Object[parameterBridges.length];
+
+            // fill in wrapped parameters from methodArgs
+            for( int i=indices.length-1; i>=0; i-- ) {
+                Object arg = getters[i].get(methodArgs[indices[i]]);
+                if(arg==null) {
+                    throw new WebServiceException("Method Parameter: "+
+                        children.get(i).getName()+" cannot be null. This is BP 1.1 R2211 violation.");
+                }
+                cs.values[i] = arg;
+            }
+
+            return cs;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java
new file mode 100644
index 0000000..db8ec11
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.WebServiceException;
+import java.util.concurrent.Future;
+
+/**
+ * {@link MethodHandler} that uses {@link AsyncHandler}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class CallbackMethodHandler extends AsyncMethodHandler {
+
+    /**
+     * Position of the argument that takes {@link AsyncHandler}.
+     */
+    private final int handlerPos;
+
+    public CallbackMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core, int handlerPos) {
+        super(owner,jm,core);
+        this.handlerPos = handlerPos;
+    }
+
+    public Future<?> invoke(Object proxy, Object[] args) throws WebServiceException {
+        // the spec requires the last argument
+        final AsyncHandler handler = (AsyncHandler)args[handlerPos];
+
+        return doInvoke(proxy, args, handler);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java
new file mode 100644
index 0000000..eb4f4ba
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.Headers;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.message.ByteArrayAttachment;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+import com.sun.xml.internal.ws.message.JAXBAttachment;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.UUID;
+import javax.activation.DataHandler;
+import javax.xml.transform.Source;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Puts a non-payload message parameter to {@link Message}.
+ *
+ * <p>
+ * Instance of this class is used to handle header parameters and attachment parameters.
+ * They add things to {@link Message}.
+ *
+ * @see BodyBuilder
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+abstract class MessageFiller {
+
+    /**
+     * The index of the method invocation parameters that this object looks for.
+     */
+    protected final int methodPos;
+
+    protected MessageFiller( int methodPos) {
+        this.methodPos = methodPos;
+    }
+
+    /**
+     * Moves an argument of a method invocation into a {@link Message}.
+     */
+    abstract void fillIn(Object[] methodArgs, Message msg);
+
+    /**
+     * Adds a parameter as an MIME attachment to {@link Message}.
+     */
+    static abstract class AttachmentFiller extends MessageFiller {
+        protected final ParameterImpl param;
+        protected final ValueGetter getter;
+        protected final String mimeType;
+        private final String contentIdPart;
+
+        protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
+            super(param.getIndex());
+            this.param = param;
+            this.getter = getter;
+            mimeType = param.getBinding().getMimeType();
+            try {
+                contentIdPart = URLEncoder.encode(param.getPartName(), "UTF-8")+'=';
+            } catch (UnsupportedEncodingException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Creates an MessageFiller based on the parameter type
+         *
+         * @param param
+         *      runtime Parameter that abstracts the annotated java parameter
+         * @param getter
+         *      Gets a value from an object that represents a parameter passed
+         *      as a method argument.
+         */
+        public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
+            Class type = (Class)param.getTypeReference().type;
+            if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
+                return new DataHandlerFiller(param, getter);
+            } else if (byte[].class==type) {
+                return new ByteArrayFiller(param, getter);
+            } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                return new JAXBFiller(param, getter);
+            } else {
+                return new DataHandlerFiller(param, getter);
+            }
+        }
+
+        String getContentId() {
+            return contentIdPart+UUID.randomUUID()+"@jaxws.sun.com";
+        }
+    }
+
+    private static class ByteArrayFiller extends AttachmentFiller {
+        protected ByteArrayFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Message msg) {
+            String contentId = getContentId();
+            Object obj = getter.get(methodArgs[methodPos]);
+            Attachment att = new ByteArrayAttachment(contentId,(byte[])obj,mimeType);
+            msg.getAttachments().add(att);
+        }
+    }
+
+    private static class DataHandlerFiller extends AttachmentFiller {
+        protected DataHandlerFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Message msg) {
+            String contentId = getContentId();
+            Object obj = getter.get(methodArgs[methodPos]);
+            DataHandler dh = (obj instanceof DataHandler) ? (DataHandler)obj : new DataHandler(obj,mimeType);
+            Attachment att = new DataHandlerAttachment(contentId, dh);
+            msg.getAttachments().add(att);
+        }
+    }
+
+    private static class JAXBFiller extends AttachmentFiller {
+        protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Message msg) {
+            String contentId = getContentId();
+            Object obj = getter.get(methodArgs[methodPos]);
+            Attachment att = new JAXBAttachment(contentId, obj, param.getBridge(), mimeType);
+            msg.getAttachments().add(att);
+        }
+    }
+
+    /**
+     * Adds a parameter as an header.
+     */
+    static final class Header extends MessageFiller {
+        private final Bridge bridge;
+        private final ValueGetter getter;
+
+        protected Header(int methodPos, Bridge bridge, ValueGetter getter) {
+            super(methodPos);
+            this.bridge = bridge;
+            this.getter = getter;
+        }
+
+        void fillIn(Object[] methodArgs, Message msg) {
+            Object value = getter.get(methodArgs[methodPos]);
+            msg.getHeaders().add(Headers.create(bridge,value));
+        }
+    }
+
+    private static boolean isXMLMimeType(String mimeType){
+        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java
new file mode 100644
index 0000000..6dce5a8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Handles an invocation of a method.
+ *
+ * <p>
+ * Each instance of {@link MethodHandler} has an implicit knowledge of
+ * a particular method that it handles.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class MethodHandler {
+
+    protected final SEIStub owner;
+
+    protected MethodHandler(SEIStub owner) {
+        this.owner = owner;
+    }
+
+    /**
+     * Performs the method invocation.
+     *
+     * @param proxy
+     *      The proxy object exposed to the user. Must not be null.
+     * @param args
+     *      The method invocation arguments. To handle asynchroonus method invocations
+     *      without array reallocation, this aray is allowed to be longer than the
+     *      actual number of arguments to the method. Additional array space should be
+     *      simply ignored.
+     * @return
+     *      a return value from the method invocation. may be null.
+     *
+     * @throws WebServiceException
+     *      If used on the client side, a {@link WebServiceException} signals an error
+     *      during the service invocation.
+     * @throws Throwable
+     *      some faults are reported in terms of checked exceptions.
+     */
+    public abstract Object invoke(Object proxy, Object[] args) throws WebServiceException, Throwable;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java
new file mode 100644
index 0000000..3830a19
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * {@link MethodHandler} that handles asynchronous invocations through {@link Response}.
+ * @author Kohsuke Kawaguchi
+ */
+final class PollingMethodHandler extends AsyncMethodHandler {
+
+    public PollingMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core) {
+        super(owner, jm, core);
+    }
+
+    public Response<?> invoke(Object proxy, Object[] args) throws WebServiceException {
+        return doInvoke(proxy,args,null);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java
new file mode 100644
index 0000000..a5539c8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java
@@ -0,0 +1,649 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.RawAccessor;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+
+import javax.activation.DataHandler;
+import javax.imageio.ImageIO;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.awt.Image;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Reads a response {@link Message}, disassembles it, and moves obtained Java values
+ * to the expected places.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+abstract class ResponseBuilder {
+    /**
+     * Reads a response {@link Message}, disassembles it, and moves obtained Java values
+     * to the expected places.
+     *
+     * @param reply
+     *      The reply {@link Message} to be de-composed.
+     * @param args
+     *      The Java arguments given to the SEI method invocation.
+     *      Some parts of the reply message may be set to {@link Holder}s in the arguments.
+     * @return
+     *      If a part of the reply message is returned as a return value from
+     *      the SEI method, this method returns that value. Otherwise null.
+     * @throws JAXBException
+     *      if there's an error during unmarshalling the reply message.
+     * @throws XMLStreamException
+     *      if there's an error during unmarshalling the reply message.
+     */
+    abstract Object readResponse(Message reply, Object[] args) throws JAXBException, XMLStreamException;
+
+    static final class None extends ResponseBuilder {
+        private None(){
+        }
+        public Object readResponse(Message msg, Object[] args) {
+            msg.consume();
+            return null;
+        }
+    }
+
+    /**
+     * The singleton instance that produces null return value.
+     * Used for operations that doesn't have any output.
+     */
+    public static ResponseBuilder NONE = new None();
+
+    /**
+     * Returns the 'uninitialized' value for the given type.
+     *
+     * <p>
+     * For primitive types, it's '0', and for reference types, it's null.
+     */
+    public static Object getVMUninitializedValue(Type type) {
+        // if this map returns null, that means the 'type' is a reference type,
+        // in which case 'null' is the correct null value, so this code is correct.
+        return primitiveUninitializedValues.get(type);
+    }
+
+    private static final Map<Class,Object> primitiveUninitializedValues = new HashMap<Class, Object>();
+
+    static {
+        Map<Class, Object> m = primitiveUninitializedValues;
+        m.put(int.class,(int)0);
+        m.put(char.class,(char)0);
+        m.put(byte.class,(byte)0);
+        m.put(short.class,(short)0);
+        m.put(long.class,(long)0);
+        m.put(float.class,(float)0);
+        m.put(double.class,(double)0);
+    }
+
+    /**
+     * {@link ResponseBuilder} that sets the VM uninitialized value to the type.
+     */
+    static final class NullSetter extends ResponseBuilder {
+        private final ValueSetter setter;
+        private final Object nullValue;
+
+        public NullSetter(ValueSetter setter, Object nullValue){
+            assert setter!=null;
+            this.nullValue = nullValue;
+            this.setter = setter;
+        }
+        public Object readResponse(Message msg, Object[] args) {
+            return setter.put(nullValue, args);
+        }
+    }
+
+    /**
+     * {@link ResponseBuilder} that is a composition of multiple
+     * {@link ResponseBuilder}s.
+     *
+     * <p>
+     * Sometimes we need to look at multiple parts of the reply message
+     * (say, two header params, one body param, and three attachments, etc.)
+     * and that's when this object is used to combine multiple {@link ResponseBuilder}s
+     * (that each responsible for handling one part).
+     *
+     * <p>
+     * The model guarantees that only at most one {@link ResponseBuilder} will
+     * return a value as a return value (and everything else has to go to
+     * {@link Holder}s.)
+     */
+    static final class Composite extends ResponseBuilder {
+        private final ResponseBuilder[] builders;
+
+        public Composite(ResponseBuilder... builders) {
+            this.builders = builders;
+        }
+
+        public Composite(Collection<? extends ResponseBuilder> builders) {
+            this(builders.toArray(new ResponseBuilder[builders.size()]));
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            Object retVal = null;
+            for (ResponseBuilder builder : builders) {
+                Object r = builder.readResponse(msg,args);
+                // there's only at most one ResponseBuilder that returns a value.
+                if(r!=null) {
+                    assert retVal==null;
+                    retVal = r;
+                }
+            }
+            return retVal;
+        }
+    }
+
+    /**
+     * Reads an Attachment into a Java parameter.
+     */
+    static abstract class AttachmentBuilder extends ResponseBuilder {
+        protected final ValueSetter setter;
+        protected final ParameterImpl param;
+        private final String pname;
+        private final String pname1;
+
+        AttachmentBuilder(ParameterImpl param, ValueSetter setter) {
+            this.setter = setter;
+            this.param = param;
+            this.pname = param.getPartName();
+            this.pname1 = "<"+pname;
+        }
+
+        /**
+         * Creates an AttachmentBuilder based on the parameter type
+         *
+         * @param param
+         *      runtime Parameter that abstracts the annotated java parameter
+         * @param setter
+         *      specifies how the obtained value is set into the argument. Takes
+         *      care of Holder arguments.
+         */
+        public static ResponseBuilder createAttachmentBuilder(ParameterImpl param, ValueSetter setter) {
+            Class type = (Class)param.getTypeReference().type;
+            if (DataHandler.class.isAssignableFrom(type)) {
+                return new DataHandlerBuilder(param, setter);
+            } else if (byte[].class==type) {
+                return new ByteArrayBuilder(param, setter);
+            } else if(Source.class.isAssignableFrom(type)) {
+                return new SourceBuilder(param, setter);
+            } else if(Image.class.isAssignableFrom(type)) {
+                return new ImageBuilder(param, setter);
+            } else if(InputStream.class==type) {
+                return new InputStreamBuilder(param, setter);
+            } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                return new JAXBBuilder(param, setter);
+            } else {
+                throw new UnsupportedOperationException("Attachment is not mapped");
+            }
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            // TODO not to loop
+            for (Attachment att : msg.getAttachments()) {
+                String part = getWSDLPartName(att);
+                if (part == null) {
+                    continue;
+                }
+                if(part.equals(pname) || part.equals(pname1)){
+                    return mapAttachment(att, args);
+                }
+            }
+            return null;
+        }
+
+        abstract Object mapAttachment(Attachment att, Object[] args) throws JAXBException;
+    }
+
+    private static final class DataHandlerBuilder extends AttachmentBuilder {
+        DataHandlerBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) {
+            return setter.put(att.asDataHandler(), args);
+        }
+    }
+
+    private static final class ByteArrayBuilder extends AttachmentBuilder {
+        ByteArrayBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) {
+            return setter.put(att.asByteArray(), args);
+        }
+    }
+
+    private static final class SourceBuilder extends AttachmentBuilder {
+        SourceBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) {
+            return setter.put(att.asSource(), args);
+        }
+    }
+
+    private static final class ImageBuilder extends AttachmentBuilder {
+        ImageBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) {
+            Image image;
+            try {
+                image = ImageIO.read(att.asInputStream());
+            } catch(IOException ioe) {
+                throw new WebServiceException(ioe);
+            }
+            return setter.put(image, args);
+        }
+    }
+
+    private static final class InputStreamBuilder extends AttachmentBuilder {
+        InputStreamBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) {
+            return setter.put(att.asInputStream(), args);
+        }
+    }
+
+    private static final class JAXBBuilder extends AttachmentBuilder {
+        JAXBBuilder(ParameterImpl param, ValueSetter setter) {
+            super(param, setter);
+        }
+
+        Object mapAttachment(Attachment att, Object[] args) throws JAXBException {
+            Object obj = param.getBridge().unmarshal(att.asInputStream());
+            return setter.put(obj, args);
+        }
+    }
+
+    /**
+     * Gets the WSDL part name of this attachment.
+     *
+     * <p>
+     * According to WSI AP 1.0
+     * <PRE>
+     * 3.8 Value-space of Content-Id Header
+     *   Definition: content-id part encoding
+     *   The "content-id part encoding" consists of the concatenation of:
+     * The value of the name attribute of the wsdl:part element referenced by the mime:content, in which characters disallowed in content-id headers (non-ASCII characters as represented by code points above 0x7F) are escaped as follows:
+     *     o Each disallowed character is converted to UTF-8 as one or more bytes.
+     *     o Any bytes corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
+     *     o The original character is replaced by the resulting character sequence.
+     * The character '=' (0x3D).
+     * A globally unique value such as a UUID.
+     * The character '@' (0x40).
+     * A valid domain name under the authority of the entity constructing the message.
+     * </PRE>
+     *
+     * So a wsdl:part fooPart will be encoded as:
+     *      <fooPart=somereallybignumberlikeauuid@example.com>
+     *
+     * @return null
+     *      if the parsing fails.
+     */
+    public static final String getWSDLPartName(com.sun.xml.internal.ws.api.message.Attachment att){
+        String cId = att.getContentId();
+
+        int index = cId.lastIndexOf('@', cId.length());
+        if(index == -1){
+            return null;
+        }
+        String localPart = cId.substring(0, index);
+        index = localPart.lastIndexOf('=', localPart.length());
+        if(index == -1){
+            return null;
+        }
+        try {
+            return java.net.URLDecoder.decode(localPart.substring(0, index), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+
+    /**
+     * Reads a header into a JAXB object.
+     */
+    static final class Header extends ResponseBuilder {
+        private final Bridge<?> bridge;
+        private final ValueSetter setter;
+        private final QName headerName;
+        private final SOAPVersion soapVersion;
+
+        /**
+         * @param soapVersion
+         *      SOAP1.1 or 1.2
+         * @param name
+         *      The name of the header element.
+         * @param bridge
+         *      specifies how to unmarshal a header into a JAXB object.
+         * @param setter
+         *      specifies how the obtained value is returned to the client.
+         */
+        public Header(SOAPVersion soapVersion, QName name, Bridge<?> bridge, ValueSetter setter) {
+            this.soapVersion = soapVersion;
+            this.headerName = name;
+            this.bridge = bridge;
+            this.setter = setter;
+        }
+
+        public Header(SOAPVersion soapVersion, ParameterImpl param, ValueSetter setter) {
+            this(soapVersion,
+                param.getTypeReference().tagName,
+                param.getBridge(),
+                setter);
+            assert param.getOutBinding()== ParameterBinding.HEADER;
+        }
+
+        private SOAPFaultException createDuplicateHeaderException() {
+            try {
+                SOAPFault fault = soapVersion.saajSoapFactory.createFault(
+                        ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName), soapVersion.faultCodeServer);
+                return new SOAPFaultException(fault);
+            } catch(SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException {
+            com.sun.xml.internal.ws.api.message.Header header = null;
+            Iterator<com.sun.xml.internal.ws.api.message.Header> it =
+                msg.getHeaders().getHeaders(headerName,true);
+            if (it.hasNext()) {
+                header = it.next();
+                if (it.hasNext()) {
+                    throw createDuplicateHeaderException();
+                }
+            }
+
+            if(header!=null)
+                return setter.put( header.readAsJAXB(bridge), args );
+            else
+                // header not found.
+                return null;
+        }
+    }
+
+    /**
+     * Reads the whole payload into a single JAXB bean.
+     */
+    static final class Body extends ResponseBuilder {
+        private final Bridge<?> bridge;
+        private final ValueSetter setter;
+
+        /**
+         * @param bridge
+         *      specifies how to unmarshal the payload into a JAXB object.
+         * @param setter
+         *      specifies how the obtained value is returned to the client.
+         */
+        public Body(Bridge<?> bridge, ValueSetter setter) {
+            this.bridge = bridge;
+            this.setter = setter;
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException {
+            return setter.put( msg.readPayloadAsJAXB(bridge), args );
+        }
+    }
+
+    /**
+     * Treats a payload as multiple parts wrapped into one element,
+     * and processes all such wrapped parts.
+     */
+    static final class DocLit extends ResponseBuilder {
+        /**
+         * {@link PartBuilder} keyed by the element name (inside the wrapper element.)
+         */
+        private final PartBuilder[] parts;
+
+        private final Bridge wrapper;
+
+        private final QName wrapperName;
+
+        public DocLit(WrapperParameter wp) {
+            wrapperName = wp.getName();
+            wrapper = wp.getBridge();
+            Class wrapperType = (Class) wrapper.getTypeReference().type;
+
+            List<PartBuilder> parts = new ArrayList<PartBuilder>();
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+            for (ParameterImpl p : children) {
+                if(p.isIN())
+                    continue;
+                QName name = p.getName();
+                try {
+                    parts.add( new PartBuilder(
+                        wp.getOwner().getJAXBContext().getElementPropertyAccessor(
+                            wrapperType,
+                            name.getNamespaceURI(),
+                            p.getName().getLocalPart()),
+                        ValueSetter.get(p)
+                    ));
+                    // wrapper parameter itself always bind to body, and
+                    // so do all its children
+                    assert p.getBinding()== ParameterBinding.BODY;
+                } catch (JAXBException e) {
+                    throw new WebServiceException(  // TODO: i18n
+                        wrapperType+" do not have a property of the name "+name,e);
+                }
+            }
+
+            this.parts = parts.toArray(new PartBuilder[parts.size()]);
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            Object retVal = null;
+
+            if(parts.length>0) {
+                XMLStreamReader reader = msg.readPayload();
+                XMLStreamReaderUtil.verifyTag(reader,wrapperName);
+                Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
+                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);
+
+                try {
+                    for (PartBuilder part : parts) {
+                        Object o = part.readResponse(args,wrapperBean);
+                        // there's only at most one ResponseBuilder that returns a value.
+                        // TODO: reorder parts so that the return value comes at the end.
+                        if(o!=null) {
+                            assert retVal==null;
+                            retVal = o;
+                        }
+                    }
+                } catch (AccessorException e) {
+                    // this can happen when the set method throw a checked exception or something like that
+                    throw new WebServiceException(e);    // TODO:i18n
+                }
+
+                // we are done with the body
+                reader.close();
+                XMLStreamReaderFactory.recycle(reader);
+            }
+
+            return retVal;
+        }
+
+        /**
+         * Unmarshals each wrapped part into a JAXB object and moves it
+         * to the expected place.
+         */
+        static final class PartBuilder {
+            private final RawAccessor accessor;
+            private final ValueSetter setter;
+
+            /**
+             * @param accessor
+             *      specifies which portion of the wrapper bean to obtain the value from.
+             * @param setter
+             *      specifies how the obtained value is returned to the client.
+             */
+            public PartBuilder(RawAccessor accessor, ValueSetter setter) {
+                this.accessor = accessor;
+                this.setter = setter;
+                assert accessor!=null && setter!=null;
+            }
+
+            final Object readResponse( Object[] args, Object wrapperBean ) throws AccessorException {
+                Object obj = accessor.get(wrapperBean);
+                return setter.put(obj,args);
+            }
+
+
+        }
+    }
+
+    /**
+     * Treats a payload as multiple parts wrapped into one element,
+     * and processes all such wrapped parts.
+     */
+    static final class RpcLit extends ResponseBuilder {
+        /**
+         * {@link PartBuilder} keyed by the element name (inside the wrapper element.)
+         */
+        private final Map<QName,PartBuilder> parts = new HashMap<QName,PartBuilder>();
+
+        private QName wrapperName;
+
+        public RpcLit(WrapperParameter wp) {
+            assert wp.getTypeReference().type== CompositeStructure.class;
+
+            wrapperName = wp.getName();
+            List<ParameterImpl> children = wp.getWrapperChildren();
+            for (ParameterImpl p : children) {
+                parts.put( p.getName(), new PartBuilder(
+                    p.getBridge(), ValueSetter.get(p)
+                ));
+                // wrapper parameter itself always bind to body, and
+                // so do all its children
+                assert p.getBinding()== ParameterBinding.BODY;
+            }
+        }
+
+        public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            Object retVal = null;
+
+            XMLStreamReader reader = msg.readPayload();
+            if (!reader.getName().equals(wrapperName))
+                throw new WebServiceException( // TODO: i18n
+                    "Unexpected response element "+reader.getName()+" expected: "+wrapperName);
+            reader.nextTag();
+
+            while(reader.getEventType()==XMLStreamReader.START_ELEMENT) {
+                // TODO: QName has a performance issue
+                PartBuilder part = parts.get(reader.getName());
+                if(part==null) {
+                    // no corresponding part found. ignore
+                    XMLStreamReaderUtil.skipElement(reader);
+                    reader.nextTag();
+                } else {
+                    Object o = part.readResponse(args,reader, msg.getAttachments());
+                    // there's only at most one ResponseBuilder that returns a value.
+                    if(o!=null) {
+                        assert retVal==null;
+                        retVal = o;
+                    }
+                }
+            }
+
+            // we are done with the body
+            reader.close();
+            XMLStreamReaderFactory.recycle(reader);
+
+            return retVal;
+        }
+
+        /**
+         * Unmarshals each wrapped part into a JAXB object and moves it
+         * to the expected place.
+         */
+        static final class PartBuilder {
+            private final Bridge bridge;
+            private final ValueSetter setter;
+
+            /**
+             * @param bridge
+             *      specifies how the part is unmarshalled.
+             * @param setter
+             *      specifies how the obtained value is returned to the client.
+             */
+            public PartBuilder(Bridge bridge, ValueSetter setter) {
+                this.bridge = bridge;
+                this.setter = setter;
+            }
+
+            final Object readResponse(Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException {
+                Object obj = bridge.unmarshal(r, (att != null)?new AttachmentUnmarshallerImpl(att):null);
+                return setter.put(obj,args);
+            }
+
+
+        }
+    }
+
+    private static boolean isXMLMimeType(String mimeType){
+        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIStub.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIStub.java
new file mode 100644
index 0000000..56dc2d1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIStub.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Headers;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.MEP;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+import com.sun.xml.internal.ws.client.Stub;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.SOAPSEIModel;
+
+import javax.xml.namespace.QName;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * {@link Stub} that handles method invocations
+ * through a strongly-typed endpoint interface.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class SEIStub extends Stub implements InvocationHandler {
+    public SEIStub(WSServiceDelegate owner, BindingImpl binding, SOAPSEIModel seiModel, Tube master, WSEndpointReference epr) {
+        super(owner,master, binding, seiModel.getPort(), seiModel.getPort().getAddress(),epr);
+        this.seiModel = seiModel;
+        this.soapVersion = binding.getSOAPVersion();
+
+        Map<WSDLBoundOperation, SyncMethodHandler> syncs = new HashMap<WSDLBoundOperation, SyncMethodHandler>();
+
+        // fill in methodHandlers.
+        // first fill in sychronized versions
+        for (JavaMethodImpl m : seiModel.getJavaMethods()) {
+            if (!m.getMEP().isAsync) {
+                SyncMethodHandler handler = new SyncMethodHandler(this, m);
+                syncs.put(m.getOperation(), handler);
+                methodHandlers.put(m.getMethod(), handler);
+            }
+        }
+
+        for (JavaMethodImpl jm : seiModel.getJavaMethods()) {
+            SyncMethodHandler sync = syncs.get(jm.getOperation());
+            if (jm.getMEP() == MEP.ASYNC_CALLBACK) {
+                Method m = jm.getMethod();
+                CallbackMethodHandler handler = new CallbackMethodHandler(
+                        this, jm, sync, m.getParameterTypes().length - 1);
+                methodHandlers.put(m, handler);
+            }
+            if (jm.getMEP() == MEP.ASYNC_POLL) {
+                Method m = jm.getMethod();
+                PollingMethodHandler handler = new PollingMethodHandler(this, jm, sync);
+                methodHandlers.put(m, handler);
+            }
+        }
+    }
+
+    public final SOAPSEIModel seiModel;
+
+    public final SOAPVersion soapVersion;
+
+
+    /**
+     * For each method on the port interface we have
+     * a {@link MethodHandler} that processes it.
+     */
+    private final Map<Method, MethodHandler> methodHandlers = new HashMap<Method, MethodHandler>();
+
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+        MethodHandler handler = methodHandlers.get(method);
+        if (handler != null) {
+            return handler.invoke(proxy, args);
+        } else {
+            // we handle the other method invocations by ourselves
+            try {
+                return method.invoke(this, args);
+            } catch (IllegalAccessException e) {
+                // impossible
+                throw new AssertionError(e);
+            } catch (IllegalArgumentException e) {
+                throw new AssertionError(e);
+            } catch (InvocationTargetException e) {
+                throw e.getCause();
+            }
+        }
+    }
+
+    public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) {
+        return super.process(request, rc, receiver);
+    }
+
+    protected final @NotNull QName getPortName() {
+        return wsdlPort.getName();
+    }
+
+
+    public void setOutboundHeaders(Object... headers) {
+        if(headers==null)
+            throw new IllegalArgumentException();
+        Header[] hl = new Header[headers.length];
+        for( int i=0; i<hl.length; i++ ) {
+            if(headers[i]==null)
+                throw new IllegalArgumentException();
+            hl[i] = Headers.create(seiModel.getJAXBContext(),headers[i]);
+        }
+        super.setOutboundHeaders(hl);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java
new file mode 100644
index 0000000..3c35974
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.client.RequestContext;
+import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * {@link MethodHandler} that handles synchronous method invocations.
+ *
+ * <p>
+ * This class mainly performs the following two tasks:
+ * <ol>
+ *  <li>Accepts Object[] that represents arguments for a Java method,
+ *      and creates {@link JAXBMessage} that represents a request message.
+ *  <li>Takes a {@link Message] that represents a response,
+ *      and extracts the return value (and updates {@link Holder}s.)
+ * </ol>
+ *
+ * <h2>Creating {@link JAXBMessage}</h2>
+ * <p>
+ * At the construction time, we prepare {@link BodyBuilder} and {@link MessageFiller}s
+ * that know how to move arguments into a {@link Message}.
+ * Some arguments go to the payload, some go to headers, still others go to attachments.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class SyncMethodHandler extends MethodHandler {
+
+    // these objects together create a message from method parameters
+    private final BodyBuilder bodyBuilder;
+    private final MessageFiller[] inFillers;
+
+    private final String soapAction;
+
+    private final boolean isOneWay;
+
+    private final JavaMethodImpl javaMethod;
+
+    /**
+     * Used to get a value from method invocation parameter.
+     *
+     * valueGetters[i] is for methodArgs[i], and so on.
+     */
+    /*package*/ final ValueGetter[] valueGetters;
+
+    private final ResponseBuilder responseBuilder;
+    private final Map<QName, CheckedExceptionImpl> checkedExceptions;
+
+    public SyncMethodHandler(SEIStub owner, JavaMethodImpl method) {
+        super(owner);
+
+        //keep all the CheckedException model for the detail qname
+        this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
+        for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
+            checkedExceptions.put(ce.getBridge().getTypeReference().tagName, ce);
+        }
+        //If a non-"" soapAction is specified, wsa:action the SOAPAction
+        if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
+            this.soapAction = method.getInputAction();
+        } else {
+            this.soapAction = method.getBinding().getSOAPAction();
+        }
+        this.javaMethod = method;
+
+        {// prepare objects for creating messages
+            List<ParameterImpl> rp = method.getRequestParameters();
+
+            BodyBuilder bodyBuilder = null;
+            List<MessageFiller> fillers = new ArrayList<MessageFiller>();
+            valueGetters = new ValueGetter[rp.size()];
+
+            for (ParameterImpl param : rp) {
+                ValueGetter getter = ValueGetter.get(param);
+
+                switch(param.getInBinding().kind) {
+                case BODY:
+                    if(param.isWrapperStyle()) {
+                        if(param.getParent().getBinding().isRpcLit())
+                            bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion);
+                        else
+                            bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion);
+                    } else {
+                        bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion);
+                    }
+                    break;
+                case HEADER:
+                    fillers.add(new MessageFiller.Header(
+                        param.getIndex(),
+                        param.getBridge(),
+                        getter ));
+                    break;
+                case ATTACHMENT:
+                    fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
+                    break;
+                case UNBOUND:
+                    break;
+                default:
+                    throw new AssertionError(); // impossible
+                }
+            }
+
+            if(bodyBuilder==null) {
+                // no parameter binds to body. we create an empty message
+                switch(owner.soapVersion) {
+                case SOAP_11:
+                    bodyBuilder = BodyBuilder.EMPTY_SOAP11;
+                    break;
+                case SOAP_12:
+                    bodyBuilder = BodyBuilder.EMPTY_SOAP12;
+                    break;
+                default:
+                    throw new AssertionError();
+                }
+            }
+
+            this.bodyBuilder = bodyBuilder;
+            this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
+        }
+
+        {// prepare objects for processing response
+            List<ParameterImpl> rp = method.getResponseParameters();
+            List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();
+
+            for( ParameterImpl param : rp ) {
+                ValueSetter setter = ValueSetter.get(param);
+                switch(param.getOutBinding().kind) {
+                case BODY:
+                    if(param.isWrapperStyle()) {
+                        if(param.getParent().getBinding().isRpcLit())
+                            builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param));
+                        else
+                            builders.add(new ResponseBuilder.DocLit((WrapperParameter)param));
+                    } else {
+                        builders.add(new ResponseBuilder.Body(param.getBridge(),setter));
+                    }
+                    break;
+                case HEADER:
+                    builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
+                    break;
+                case ATTACHMENT:
+                    builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
+                    break;
+                case UNBOUND:
+                    builders.add(new ResponseBuilder.NullSetter(setter,
+                        ResponseBuilder.getVMUninitializedValue(param.getTypeReference().type)));
+                    break;
+                default:
+                    throw new AssertionError();
+                }
+            }
+
+            switch(builders.size()) {
+            case 0:
+                responseBuilder = ResponseBuilder.NONE;
+                break;
+            case 1:
+                responseBuilder = builders.get(0);
+                break;
+            default:
+                responseBuilder = new ResponseBuilder.Composite(builders);
+            }
+        }
+        this.isOneWay = method.getMEP().isOneWay();
+    }
+
+    public JavaMethodImpl getJavaMethod() {
+        return javaMethod;
+    }
+
+    public Object invoke(Object proxy, Object[] args) throws Throwable {
+        return invoke(proxy,args,owner.requestContext,owner);
+    }
+
+    /**
+     * Invokes synchronously, but with the given {@link RequestContext}
+     * and {@link ResponseContextReceiver}.
+     *
+     * @param rc
+     *      This {@link RequestContext} is used for invoking this method.
+     *      We take this as a separate parameter because of the async invocation
+     *      handling, which requires a separate copy.
+     */
+    public Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
+        Packet req = new Packet(createRequestMessage(args));
+
+        req.soapAction = soapAction;
+        req.expectReply = !isOneWay;
+        req.getMessage().assertOneWay(isOneWay);
+
+        // process the message
+        Packet reply = owner.doProcess(req,rc,receiver);
+
+        Message msg = reply.getMessage();
+        if(msg ==null)
+            // no reply. must have been one-way
+            return null;
+
+        try {
+            if(msg.isFault()) {
+                SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
+                throw faultBuilder.createException(checkedExceptions);
+            } else {
+                return responseBuilder.readResponse(msg,args);
+            }
+        } catch (JAXBException e) {
+            throw new DeserializationException("failed.to.read.response",e);
+        } catch (XMLStreamException e) {
+            throw new DeserializationException("failed.to.read.response",e);
+        }
+    }
+
+    /**
+     * Creates a request {@link JAXBMessage} from method arguments.
+     *
+     */
+    private Message createRequestMessage(Object[] args) {
+        Message msg = bodyBuilder.createMessage(args);
+
+        for (MessageFiller filler : inFillers)
+            filler.fillIn(args,msg);
+
+        return msg;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java
new file mode 100644
index 0000000..d76da3e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.ws.model.ParameterImpl;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.ws.Holder;
+
+/**
+ * Gets a value from an object that represents a parameter passed
+ * as a method argument.
+ *
+ * <p>
+ * This abstraction hides the handling of {@link Holder}.
+ *
+ * <p>
+ * {@link ValueGetter} is a stateless behavior encapsulation.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+enum ValueGetter {
+    /**
+     * {@link ValueGetter} that works for {@link Mode#IN}  parameter.
+     *
+     * <p>
+     * Since it's the IN mode, the parameter is not a {@link Holder},
+     * therefore the parameter itself is a value.
+     */
+    PLAIN() {
+        Object get(Object parameter) {
+            return parameter;
+        }
+    },
+    /**
+     * Creates {@link ValueGetter} that works for {@link Holder},
+     * which is  {@link Mode#INOUT} or  {@link Mode#OUT}.
+     *
+     * <p>
+     * In those {@link Mode}s, the parameter is a {@link Holder},
+     * so the value to be sent is obtained by getting the value of the holder.
+     */
+    HOLDER() {
+        Object get(Object parameter) {
+            if(parameter==null)
+                // the user is allowed to pass in null where a Holder is expected.
+                return null;
+            return ((Holder)parameter).value;
+        }
+    };
+
+    /**
+     * Gets the value to be sent, from a parameter given as a method argument.
+     */
+    abstract Object get(Object parameter);
+
+    /**
+     * Returns a {@link ValueGetter} suitable for the given {@link Parameter}.
+     */
+    static ValueGetter get(ParameterImpl p) {
+        // return value is always PLAIN
+        if(p.getMode()== Mode.IN || p.getIndex() == -1)
+            return PLAIN;
+        else
+            return HOLDER;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java
new file mode 100644
index 0000000..7533178
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.client.sei;
+
+import com.sun.xml.internal.ws.api.model.Parameter;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+
+import javax.xml.ws.Holder;
+
+/**
+ * Moves a Java value unmarshalled from a response message
+ * to the right place.
+ *
+ * <p>
+ * Sometimes values are returned as a return value, and
+ * others are returned in the {@link Holder} value. Instances
+ * of this interface abstracts this detail.
+ *
+ * <p>
+ * {@link ValueSetter} is a stateless behavior encapsulation.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class ValueSetter {
+    private ValueSetter() {}
+
+    /**
+     * Moves the value to the expected place.
+     *
+     * @param obj
+     *      The unmarshalled object.
+     * @param args
+     *      The arguments given to the Java method invocation. If <tt>obj</tt>
+     *      is supposed to be returned as a {@link Holder} value, a suitable
+     *      {@link Holder} is obtained from this argument list and <tt>obj</tt>
+     *      is set.
+     *
+     * @return
+     *      if <tt>obj</tt> is supposed to be returned as a return value
+     *      from the method, this method returns <tt>obj</tt>. Otherwise null.
+     */
+    abstract Object put(Object obj, Object[] args);
+
+    /**
+     * Singleton instance.
+     */
+    private static final ValueSetter RETURN_VALUE = new ReturnValue();
+    /**
+     * {@link Param}s with small index numbers are used often,
+     * so we pool them to reduce the footprint.
+     */
+    private static final ValueSetter[] POOL = new ValueSetter[16];
+
+    static {
+        for( int i=0; i<POOL.length; i++ )
+            POOL[i] = new Param(i);
+    }
+
+    /**
+     * Returns a {@link ValueSetter} suitable for the given {@link Parameter}.
+     */
+    public static ValueSetter get(ParameterImpl p) {
+        int idx = p.getIndex();
+
+        if(idx==-1)
+            return RETURN_VALUE;
+        if(idx<POOL.length)
+            return POOL[idx];
+        else
+            return new Param(idx);
+    }
+
+    private static final class ReturnValue extends ValueSetter {
+        Object put(Object obj, Object[] args) {
+            return obj;
+        }
+    }
+
+    static final class Param extends ValueSetter {
+        /**
+         * Index of the argument to put the value to.
+         */
+        private final int idx;
+
+        public Param(int idx) {
+            this.idx = idx;
+        }
+
+        Object put(Object obj, Object[] args) {
+            Object arg = args[idx];
+            if(arg!=null) {
+                // we build model in such a way that this is guaranteed
+                assert arg instanceof Holder;
+                ((Holder)arg).value = obj;
+            }
+            // else {
+            //   if null is given as a Holder, there's no place to return
+            //   the value, so just ignore.
+            // }
+
+            // no value to return
+            return null;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/package-info.java
new file mode 100644
index 0000000..4187434
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * {@link SEIStub} and its supporting code.
+ */
+package com.sun.xml.internal.ws.client.sei;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/EPRRecipe.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/EPRRecipe.java
new file mode 100644
index 0000000..01283d6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/EPRRecipe.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Headers;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents additional data to be added to EPRs
+ * created from {@link StatefulWebServiceManager} (for advanced users).
+ *
+ * <p>
+ * Occasionally it is convenient to be able to control the data to be
+ * present on {@link EndpointReference}s created by {@link StatefulWebServiceManager}.
+ * You can do so by using this class like this:
+ *
+ * <pre>
+ * statefulWebServiceManager.export({@link W3CEndpointReference}.class,myObject,
+ *   new EPRRecipe().addReferenceParameter({@link Headers}.create(...))
+ *                  .addReferenceParameter({@link Headers}.create(...)));
+ * </pre>
+ *
+ * <p>
+ * The methods on this class follows <a href="http://www.martinfowler.com/bliki/FluentInterface.html">
+ * the fluent interface design</a> to allow construction without using a variable.
+ *
+ *
+ * <p>
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/#eprinfomodel">
+ * WS-Addressing EPR information model</a> for more details.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1.1
+ * @see StatefulWebServiceManager
+ * @see Headers
+ */
+public final class EPRRecipe {
+    private final List<Header> referenceParameters = new ArrayList<Header>();
+    private final List<Source> metadata = new ArrayList<Source>();
+
+    /**
+     * Gets all the reference parameters added so far.
+     */
+    public @NotNull List<Header> getReferenceParameters() {
+        return referenceParameters;
+    }
+
+    /**
+     * Gets all the metadata added so far.
+     */
+    public @NotNull List<Source> getMetadata() {
+        return metadata;
+    }
+
+    /**
+     * Adds a new reference parameter.
+     */
+    public EPRRecipe addReferenceParameter(Header h) {
+        if(h==null) throw new IllegalArgumentException();
+        referenceParameters.add(h);
+        return this;
+    }
+
+    /**
+     * Adds all the headers as reference parameters.
+     */
+    public EPRRecipe addReferenceParameters(Header... headers) {
+        for (Header h : headers)
+            addReferenceParameter(h);
+        return this;
+    }
+
+    /**
+     * Adds all the headers as reference parameters.
+     */
+    public EPRRecipe addReferenceParameters(Iterable<? extends Header> headers) {
+        for (Header h : headers)
+            addReferenceParameter(h);
+        return this;
+    }
+
+    /**
+     * Adds a new metadata.
+     */
+    public EPRRecipe addMetadata(Source source) {
+        if(source==null)    throw new IllegalArgumentException();
+        metadata.add(source);
+        return this;
+    }
+
+    public EPRRecipe addMetadata(Source... sources) {
+        for (Source s : sources)
+            addMetadata(s);
+        return this;
+    }
+
+    public EPRRecipe addMetadata(Iterable<? extends Source> sources) {
+        for (Source s : sources)
+            addMetadata(s);
+        return this;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java
index 9dfca16..058ed0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,11 +24,81 @@
  */
 package com.sun.xml.internal.ws.developer;
 
+import com.sun.xml.internal.ws.api.message.HeaderList;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceContext;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.HostnameVerifier;
+import java.net.HttpURLConnection;
+
 public interface JAXWSProperties {
-        // Some values are split into two strings so that package renaming for
-        // mustang doesn't alter the values. So do not combine them
     // Content negotiation property: values "none", "pessimistic" and "optimistic"
-    public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun."+ "xml.ws.client.ContentNegotiation";
+    // It is split into two strings so that package renaming for
+    // Java SE 6 doesn't alter the value. So do not combine them
+    @Deprecated
+    public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun."+"xml.ws.client.ContentNegotiation";
     public static final String MTOM_THRESHOLOD_VALUE =  "com.sun.xml.internal.ws.common.MtomThresholdValue";
     public static final String HTTP_EXCHANGE = "com.sun.xml.internal.ws.http.exchange";
+
+    /**
+     * Set this property on the {@link BindingProvider#getRequestContext()} to
+     * enable {@link HttpURLConnection#setChunkedStreamingMode(int)}
+     *
+     *<p>
+     * int chunkSize = ...;
+     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
+     * ctxt.put(HTTP_CLIENT_STREAMING_CHUNK_SIZE, chunkSize);
+     */
+    public static final String HTTP_CLIENT_STREAMING_CHUNK_SIZE = "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size";
+
+
+    /**
+     * Set this property on the {@link BindingProvider#getRequestContext()} to
+     * enable {@link HttpsURLConnection#setHostnameVerifier(HostnameVerifier)}}. The property
+     * is set as follows:
+     *
+     * <p>
+     * HostNameVerifier hostNameVerifier = ...;
+     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
+     * ctxt.put(HOSTNAME_VERIFIER, hostNameVerifier);
+     *
+     * <p>
+     * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
+     */
+    public static final String HOSTNAME_VERIFIER = "com.sun.xml.internal.ws.transport.https.client.hostname.verifier";
+
+    /**
+     * Set this property on the {@link BindingProvider#getRequestContext()} to
+     * enable {@link HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory)}. The property is set
+     * as follows:
+     *
+     * <p>
+     * SSLSocketFactory sslFactory = ...;
+     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
+     * ctxt.put(SSL_SOCKET_FACTORY, sslFactory);
+     *
+     * <p>
+     * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
+     */
+    public static final String SSL_SOCKET_FACTORY = "com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory";
+
+    /**
+     * Acccess the list of SOAP headers in the SOAP message.
+     *
+     * <p>
+     * On {@link WebServiceContext}, this property returns a {@link HeaderList} object
+     * that represents SOAP headers in the request message that was received.
+     * On {@link BindingProvider#getResponseContext()}, this property returns a
+     * {@link HeaderList} object that represents SOAP headers in the response message from the server.
+     *
+     * <p>
+     * The property is read-only, and please do not modify the returned {@link HeaderList}
+     * as that may break the JAX-WS RI in some unexpected way.
+     *
+     * <p>
+     * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
+     */
+    public static final String INBOUND_HEADER_LIST_PROPERTY = "com.sun.xml.internal.ws.api.message.HeaderList";
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java
new file mode 100644
index 0000000..24f2fff
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.developer;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+/**
+ * This feature represents the use of WS-Addressing with either
+ * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding.  Using this feature
+ * with any other binding is NOT required.
+ * <p>
+ * Enabling this feature will result in the
+ * <code>wsaw:UsingAddressing</code> element being added to the
+ * <code>wsdl:Binding</code> for
+ * the endpoint and in the runtime being capable of responding to
+ * WS-Addressing headers.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, Addressing will be enabled.
+ *       If there is not a WSDL associated with the Endpoint and
+ *       a WSDL is to be generated, it MUST be generated with the
+ *       wsaw:UsingAddressing element. At runtime, Addressing headers
+ *       MUST be consumed by the receiver and generated by the
+ *       sender even if the WSDL declares otherwise. The
+ *       mustUnderstand="0" attribute MUST be used on the Addressing
+ *       headers.
+ *  <li> DISABLED: In this Mode, Addressing will be disabled
+ *       even if an associated WSDL specifies otherwise. At runtime,
+ *       Addressing headers MUST NOT be used.
+ * </ul>
+ * <p>
+ * The {@link #required} property can be used to
+ * specify if the <code>required</code> attribute on the
+ * <code>wsaw:UsingAddressing</code> element should
+ * be <code>true</code> or <code>false</code>.  By default the
+ * <code>wsdl:required</code> parameter is <code>false</code>.
+ *
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">WS-Addressing</a>
+ * for more information on WS-Addressing.
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a> for more information on <code>wsaw:UsingAddressing</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@WebServiceFeatureAnnotation(id= MemberSubmissionAddressingFeature.ID,bean=MemberSubmissionAddressingFeature.class)
+public @interface MemberSubmissionAddressing {
+    /**
+     * Specifies if this feature is enabled or disabled.
+     */
+    boolean enabled() default true;
+
+    /**
+     * Property to determine the value of the
+     * <code>wsdl:required</code> attribute on
+     * <code>wsaw:UsingAddressing</code> element in the WSDL.
+     */
+    boolean required() default false;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java
new file mode 100644
index 0000000..4e85d51
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Addressing Feature representing MemberSubmission Version.
+ *
+ * @author Rama Pulavarthi
+ */
+
+public class MemberSubmissionAddressingFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the MemberSubmissionAddressingFeature
+     */
+    public static final String ID = "http://java.sun.com/xml/ns/jaxws/2004/08/addressing";
+
+    /**
+     * Constant ID for the <code>required</code> feature parameter
+     */
+    public static final String IS_REQUIRED = "ADDRESSING_IS_REQUIRED";
+
+    private boolean required;
+
+    /**
+     * Create an MemberSubmissionAddressingFeature
+     * The instance created will be enabled.
+     */
+    public MemberSubmissionAddressingFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Create an MemberSubmissionAddressingFeature
+     *
+     * @param enabled specifies whether this feature should
+     *                be enabled or not.
+     */
+    public MemberSubmissionAddressingFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * Create an <code>MemberSubmissionAddressingFeature</code>
+     *
+     * @param enabled specifies whether this feature should
+     * be enabled or not.
+     * @param required specifies the value that will be used
+     * for the <code>required</code> attribute on the
+     * <code>wsaw:UsingAddressing</code> element.
+     */
+    @FeatureConstructor({"enabled","required"})
+    public MemberSubmissionAddressingFeature(boolean enabled, boolean required) {
+        this.enabled = enabled;
+        this.required = required;
+    }
+
+    public String getID() {
+        return ID;
+    }
+
+    public boolean isRequired() {
+        return required;
+    }
+
+    public void setRequired(boolean required) {
+        this.required = required;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java
new file mode 100644
index 0000000..bc36da9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants;
+import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Data model for Member Submission WS-Addressing specification. This is modeled after the
+ * member submission schema at:
+ *
+ *  http://schemas.xmlsoap.org/ws/2004/08/addressing/
+ *
+ * @author Kathy Walsh
+ * @author Vivek Pandey
+ */
+
+@XmlRootElement(name = "EndpointReference", namespace = MemberSubmissionEndpointReference.MSNS)
+@XmlType(name = "EndpointReferenceType", namespace = MemberSubmissionEndpointReference.MSNS)
+public class MemberSubmissionEndpointReference extends EndpointReference implements MemberSubmissionAddressingConstants {
+
+    private final static JAXBContext msjc = MemberSubmissionEndpointReference.getMSJaxbContext();
+
+    public MemberSubmissionEndpointReference() {
+    }
+
+    /**
+     * construct an EPR from infoset representation
+     *
+     * @param source A source object containing valid XmlInfoset
+     *               instance consistent with the Member Submission WS-Addressing
+     * @throws javax.xml.ws.WebServiceException
+     *                              if the source does not contain a valid W3C WS-Addressing
+     *                              EndpointReference.
+     * @throws WebServiceException if the <code>null</code> <code>source</code> value is given
+     */
+    public MemberSubmissionEndpointReference(@NotNull Source source) {
+
+        if (source == null)
+            throw new WebServiceException("Source parameter can not be null on constructor");
+
+        try {
+            Unmarshaller unmarshaller = MemberSubmissionEndpointReference.msjc.createUnmarshaller();
+            MemberSubmissionEndpointReference epr = unmarshaller.unmarshal(source,MemberSubmissionEndpointReference.class).getValue();
+
+            this.addr = epr.addr;
+            this.referenceProperties = epr.referenceProperties;
+            this.referenceParameters = epr.referenceParameters;
+            this.portTypeName = epr.portTypeName;
+            this.serviceName = epr.serviceName;
+            this.attributes = epr.attributes;
+            this.elements = epr.elements;
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error unmarshalling MemberSubmissionEndpointReference ", e);
+        } catch (ClassCastException e) {
+            throw new WebServiceException("Source did not contain MemberSubmissionEndpointReference", e);
+        }
+    }
+
+    public void writeTo(Result result) {
+        try {
+            Marshaller marshaller = MemberSubmissionEndpointReference.msjc.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+            marshaller.marshal(this, result);
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
+        }
+    }
+
+    /**
+     * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
+     *
+     * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
+     */
+    public Source toWSDLSource() {
+        Element wsdlElement = null;
+
+        for (Element elem : elements) {
+            if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
+                    elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
+                wsdlElement = elem;
+            }
+        }
+
+        return new DOMSource(wsdlElement);
+    }
+
+
+    private static JAXBContext getMSJaxbContext() {
+        try {
+            return JAXBContext.newInstance(MemberSubmissionEndpointReference.class);
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error creating JAXBContext for MemberSubmissionEndpointReference. ", e);
+        }
+    }
+
+    @XmlElement(name = "Address", namespace = MemberSubmissionEndpointReference.MSNS)
+    public Address addr;
+
+    @XmlElement(name = "ReferenceProperties", namespace = MemberSubmissionEndpointReference.MSNS)
+    public Elements referenceProperties;
+
+    @XmlElement(name = "ReferenceParameters", namespace = MemberSubmissionEndpointReference.MSNS)
+    public Elements referenceParameters;
+
+    @XmlElement(name = "PortType", namespace = MemberSubmissionEndpointReference.MSNS)
+    public AttributedQName portTypeName;
+
+    @XmlElement(name = "ServiceName", namespace = MemberSubmissionEndpointReference.MSNS)
+    public ServiceNameType serviceName;
+
+    @XmlAnyAttribute
+    public Map<QName,String> attributes;
+
+    @XmlAnyElement
+    public List<Element> elements;
+
+    public static class Address {
+        public Address() {
+        }
+
+        @XmlValue
+        public String uri;
+        @XmlAnyAttribute
+        public Map<QName, String> attributes;
+    }
+
+    public static class Elements {
+        public Elements() {}
+
+        @XmlAnyElement
+        public List<Element> elements;
+    }
+
+
+    public static class AttributedQName {
+        public AttributedQName() {
+        }
+
+        @XmlValue
+        public QName name;
+        @XmlAnyAttribute
+        public Map<QName, String> attributes;
+    }
+
+    public static class ServiceNameType extends AttributedQName{
+        public ServiceNameType() {
+        }
+
+        @XmlAttribute(name="PortName")
+        public String portName;
+    }
+
+    protected static final String MSNS = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/ServerSideException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/ServerSideException.java
new file mode 100644
index 0000000..258eb0f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/ServerSideException.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+/**
+ * Represents the exception that has occurred on the server side.
+ *
+ * <p>
+ * When an exception occurs on the server, JAX-WS RI sends the stack
+ * trace of that exception to the client. On the client side,
+ * instances of this class are used to represent such stack trace.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1
+ */
+public class ServerSideException extends Exception {
+    private final String className;
+
+    public ServerSideException(String className, String message) {
+        super(message);
+        this.className = className;
+    }
+
+    public String toString() {
+        String s = className;
+        String message = getLocalizedMessage();
+        return (message != null) ? (s + ": " + message) : s;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/Stateful.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/Stateful.java
new file mode 100644
index 0000000..a5756e8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/Stateful.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.xml.internal.ws.api.server.InstanceResolverAnnotation;
+import com.sun.xml.internal.ws.server.StatefulInstanceResolver;
+
+import javax.jws.WebService;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Designates a stateful {@link WebService}.
+ *
+ * <p>
+ * A service class that has this feature on will behave as a stateful web service.
+ * See {@link StatefulWebServiceManager} for more about stateful web service.
+ *
+ * @since 2.1
+ * @ses StatefulWebServiceManager
+ */
+@Retention(RUNTIME)
+@Target(TYPE)
+@Documented
+@WebServiceFeatureAnnotation(id = StatefulFeature.ID, bean = StatefulFeature.class)
+@InstanceResolverAnnotation(StatefulInstanceResolver.class)
+public @interface Stateful {
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulFeature.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulFeature.java
new file mode 100644
index 0000000..5552c47
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulFeature.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.xml.internal.ws.api.FeatureConstructor;
+
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Designates a stateful {@link WebService}.
+ * A service class that has this feature on will behave as a stateful web service.
+ *
+ * @since 2.1
+ * @see StatefulWebServiceManager
+ */
+public class StatefulFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the StatefulFeature
+     */
+    public static final String ID = "http://jax-ws.dev.java.net/features/stateful";
+
+    /**
+     * Create an <code>StatefulFeature</code>.
+     * The instance created will be enabled.
+     */
+    @FeatureConstructor
+    public StatefulFeature() {
+        this.enabled = true;
+    }
+
+    public String getID() {
+        return ID;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulWebServiceManager.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulWebServiceManager.java
new file mode 100644
index 0000000..335b0f9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulWebServiceManager.java
@@ -0,0 +1,381 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.api.server.AsyncProviderCallback;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Stateful web service support in the JAX-WS RI.
+ *
+ * <h2>Usage</h2>
+ * <p>
+ * Application service implementation classes (or providers) who'd like
+ * to use the stateful web service support must declare {@link Stateful}
+ * annotation on a class. It should also have a <b>public static</b> method/field
+ * that takes {@link StatefulWebServiceManager}.
+ *
+ * <pre>
+ * &#64;{@link Stateful} &#64;{@link WebService}
+ * class BankAccount {
+ *     protected final int id;
+ *     private int balance;
+ *
+ *     BankAccount(int id) { this.id = id; }
+ *     &#64;{@link WebMethod}
+ *     public synchronized void deposit(int amount) { balance+=amount; }
+ *
+ *     // either via a public static field
+ *     <font color=red>
+ *     public static {@link StatefulWebServiceManager}&lt;BankAccount> manager;
+ *     </font>
+ *     // ... or  via a public static method (the method name could be anything)
+ *     <font color=red>
+ *     public static void setManager({@link StatefulWebServiceManager}&lt;BankAccount> manager) {
+ *        ...
+ *     }
+ *     </font>
+ * }
+ * </pre>
+ *
+ * <p>
+ * After your service is deployed but before you receive a first request,
+ * the resource injection occurs on the field or the method.
+ *
+ * <p>
+ * A stateful web service class does not need to have a default constructor.
+ * In fact, most of the time you want to define a constructor that takes
+ * some arguments, so that each instance carries certain state (as illustrated
+ * in the above example.)
+ *
+ * <p>
+ * Each instance of a stateful web service class is identified by an unique
+ * {@link EndpointReference}. Your application creates an instance of
+ * a class, then you'll have the JAX-WS RI assign this unique EPR for the
+ * instance as follows:
+ *
+ * <pre>
+ * &#64;{@link WebService}
+ * class Bank { // this is ordinary stateless service
+ *     &#64;{@link WebMethod}
+ *     public synchronized W3CEndpointReference login(int accountId, int pin) {
+ *         if(!checkPin(pin))
+ *             throw new AuthenticationFailedException("invalid pin");
+ *         BankAccount acc = new BankAccount(accountId);
+ *         return BankAccount.manager.{@link #export export}(acc);
+ *     }
+ * }
+ * </pre>
+ *
+ * <p>
+ * Typically you then pass this EPR to remote systems. When they send
+ * messages to this EPR, the JAX-WS RI makes sure that the particular exported
+ * instance associated with that EPR will receive a service invocation.
+ *
+ * <h2>Things To Consider</h2>
+ * <p>
+ * When you no longer need to tie an instance to the EPR,
+ * use {@link #unexport(Object)} so that the object can be GC-ed
+ * (or else you'll leak memory.) You may choose to do so explicitly,
+ * or you can rely on the time out by using {@link #setTimeout(long, Callback)}.
+ *
+ * <p>
+ * {@link StatefulWebServiceManager} is thread-safe. It can be safely
+ * invoked from multiple threads concurrently.
+ *
+ * @author Kohsuke Kawaguchi
+ * @see StatefulFeature
+ * @since 2.1
+ */
+public interface StatefulWebServiceManager<T> {
+    /**
+     * Exports an object.
+     *
+     * <p>
+     * This method works like {@link #export(Object)} except that
+     * you can obtain the EPR in your choice of addressing version,
+     * by passing in the suitable <tt>epr</tt> parameter.
+     *
+     * @param epr
+     *      Either {@link W3CEndpointReference} or {@link MemberSubmissionEndpointReference}.
+     *      If other types are specified, this method throws an {@link WebServiceException}.
+     * @return
+     *      {@link EndpointReference}-subclass that identifies this exported
+     *      object.
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> epr, T o);
+
+    /**
+     * Exports an object.
+     *
+     * <p>
+     * This method works like {@link #export(Object)} except that
+     * you can obtain the EPR in your choice of addressing version,
+     * by passing in the suitable <tt>epr</tt> parameter.
+     *
+     * @param epr
+     *      Either {@link W3CEndpointReference} or {@link MemberSubmissionEndpointReference}.
+     *      If other types are specified, this method throws an {@link WebServiceException}.
+     * @param o
+     *      The object to be exported, whose identity be referenced by the returned EPR.
+     * @param recipe
+     *      The additional data to be put into EPR. Can be null.
+     * @return
+     *      {@link EndpointReference}-subclass that identifies this exported
+     *      object.
+     * @since 2.1.1
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> epr, T o, @Nullable EPRRecipe recipe );
+
+    /**
+     * Exports an object.
+     *
+     * <p>
+     * JAX-WS RI assigns an unique EPR to the exported object,
+     * and from now on, messages that are sent to this EPR will
+     * be routed to the given object.
+     *
+     * <p>
+     * The object will be locked in memory, so be sure to
+     * {@link #unexport(Object) unexport} it when it's no longer needed.
+     *
+     * <p>
+     * Notice that the obtained EPR contains the address of the service,
+     * which depends on the currently processed request. So invoking
+     * this method multiple times with the same object may return
+     * different EPRs, if such multiple invocations are done while
+     * servicing different requests. (Of course all such EPRs point
+     * to the same object, so messages sent to those EPRs will be
+     * served by the same instance.)
+     *
+     * @return
+     *      {@link W3CEndpointReference} that identifies this exported
+     *      object. Always non-null.
+     */
+    @NotNull W3CEndpointReference export(T o);
+
+    /**
+     * Exports an object (for {@link AsyncProvider asynchronous web services}.)
+     *
+     * <p>
+     * This method works like {@link #export(Class,Object)} but it
+     * takes an extra {@link WebServiceContext} that represents the request currently
+     * being processed by the caller (the JAX-WS RI remembers this when the service
+     * processing is synchronous, and that's why this parameter is only needed for
+     * asynchronous web services.)
+     *
+     * <h3>Why {@link WebServiceContext} is needed?</h3>
+     * <p>
+     * The obtained EPR contains address, such as host name. The server does not
+     * know what its own host name is (or there are more than one of them),
+     * so this value is determined by what the current client thinks the server name is.
+     * This is why we need to take {@link WebServiceContext}. Pass in the
+     * object given to {@link AsyncProvider#invoke(Object, AsyncProviderCallback,WebServiceContext)}.
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> eprType, @NotNull WebServiceContext context, T o);
+
+    /**
+     * Exports an object.
+     *
+     * <p>
+     * <b>This method is not meant for application code.</b>
+     * This is for {@link Tube}s that wish to use stateful web service support.
+     *
+     * @param currentRequest
+     *      The request that we are currently processing. This is used to infer the address in EPR.
+     * @see #export(Class, WebServiceContext, Object)
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> eprType, @NotNull Packet currentRequest, T o);
+
+    /**
+     * The same as {@link #export(Class, Packet, Object)} except
+     * that it takes {@link EPRRecipe}.
+     *
+     * @param recipe
+     *      See {@link #export(Class, Object, EPRRecipe)}.
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> eprType, @NotNull Packet currentRequest, T o, EPRRecipe recipe);
+
+    /**
+     * Exports an object.
+     *
+     * @deprecated
+     *      This method is provided as a temporary workaround, and we'll eventually try to remove it.
+     *
+     * @param endpointAddress
+     *      The endpoint address URL. Normally, this information is determined by other inputs,
+     *      like {@link Packet} or {@link WebServiceContext}.
+     */
+    @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> eprType, String endpointAddress, T o);
+
+    /**
+     * Unexports the given instance.
+     *
+     * <p>
+     * JAX-WS will release a strong reference to unexported objects,
+     * and they will never receive further requests (requests targeted
+     * for those unexported objects will be served by the fallback object.)
+     *
+     * @param o
+     *      if null, this method will be no-op.
+     */
+    void unexport(@Nullable T o);
+
+    /**
+     * Checks if the given EPR represents an object that has been exported from this manager.
+     *
+     * <p>
+     * This method can be used to have two endpoints in the same application communicate
+     * locally.
+     *
+     * @return null if the EPR is not exported from this manager.
+     */
+    @Nullable T resolve(@NotNull EndpointReference epr);
+
+    /**
+     * Sets the "fallback" instance.
+     *
+     * <p>
+     * When the incoming request does not have the necessary header to
+     * distinguish instances of <tt>T</tt>, or when the header is present
+     * but its value does not correspond with any of the active exported
+     * instances known to the JAX-WS, then the JAX-WS RI will try to
+     * route the request to the fallback instance.
+     *
+     * <p>
+     * This provides the application an opportunity to perform application
+     * specific error recovery.
+     *
+     * <p>
+     * If no fallback instance is provided, then the JAX-WS RI will
+     * send back the fault. By default, no fallback instance is set.
+     *
+     * <p>
+     * This method can be invoked any time, but most often you'd like to
+     * use one instance at the get-go. The following code example
+     * illustrates how to do this:
+     *
+     * <pre>
+     * &#64;{@link WebService}
+     * class BankAccount {
+     *     ... continuting from the example in class javadoc ...
+     *
+     *     &#64;{@link Resource} static void setManager({@link StatefulWebServiceManager} manager) {
+     *        manager.setFallbackInstance(new BankAccount(0) {
+     *            &#64;{@link Override}
+     *            void deposit(int amount) {
+     *                putToAuditRecord(id);
+     *                if(thisLooksBad())   callPolice();
+     *                throw new {@link WebServiceException}("No such bank account exists");
+     *            }
+     *        });
+     *     }
+     * }
+     * </pre>
+     *
+     * @param o
+     *      Can be null.
+     */
+    void setFallbackInstance(T o);
+
+    /**
+     * Configures timeout for exported instances.
+     *
+     * <p>
+     * When configured, the JAX-WS RI will internally use a timer
+     * so that exported objects that have not received any request
+     * for the given amount of minutes will be automatically unexported.
+     *
+     * <p>
+     * At some point after the time out has occurred for an instance,
+     * the JAX-WS RI will invoke the {@link Callback} to notify the application
+     * that the time out has reached. Application then has a choice of
+     * either let the object go unexported, or {@link #touch(Object) touch}
+     * let the object live for another round of timer interval.
+     *
+     * <p>
+     * If no callback is set, the expired object will automatically unexported.
+     *
+     * <p>
+     * When you call this method multiple times, its effect on existing
+     * instances are unspecified, although deterministic.
+     *
+     * @param milliseconds
+     *      The time out interval. Specify 0 to cancel the timeout timer.
+     *      Note that this only guarantees that time out does not occur
+     *      at least until this amount of time has elapsed. It does not
+     *      guarantee that the time out will always happen right after
+     *      the timeout is reached.
+     * @param callback
+     *      application may choose to install a callback to control the
+     *      timeout behavior.
+     */
+    void setTimeout(long milliseconds, @Nullable Callback<T> callback);
+
+    /**
+     * Resets the time out timer for the given instance.
+     *
+     * <p>
+     * If the object is null, not exported, or already unexported, this
+     * method will be no-op.
+     */
+    void touch(T o);
+
+    /**
+     * Used by {@link StatefulWebServiceManager#setTimeout(long, Callback)}
+     * to determine what to do when the time out is reached.
+     */
+    interface Callback<T> {
+        /**
+         * Application has a chance to decide if the object should be unexported,
+         * or kept alive.
+         *
+         * <p>
+         * The application should either unexport the object, or touch the object
+         * from within this callback.
+         * If no action is taken, the object will remain exported until it is
+         * manually unexported.
+         *
+         * @param timedOutObject
+         *      The object that reached the time out.
+         * @param manager
+         *      The manager instance that you exported the object to.
+         */
+        void onTimeout(@NotNull T timedOutObject, @NotNull StatefulWebServiceManager<T> manager);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java
new file mode 100644
index 0000000..ba92903
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.developer;
+
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Headers;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import java.util.List;
+
+/**
+ * {@link BindingProvider} with JAX-WS RI's extension methods.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ * @since 2.1EA3
+ */
+public interface WSBindingProvider extends BindingProvider {
+    /**
+     * Sets the out-bound headers to be added to messages sent from
+     * this {@link BindingProvider}.
+     *
+     * <p>
+     * Calling this method would discard any out-bound headers
+     * that were previously set.
+     *
+     * <p>
+     * A new {@link Header} object can be created by using
+     * one of the methods on {@link Headers}.
+     *
+     * @param headers
+     *      The headers to be added to the future request messages.
+     *      To clear the outbound headers, pass in either null
+     *      or empty list.
+     * @throws IllegalArgumentException
+     *      if the list contains null item.
+     */
+    void setOutboundHeaders(List<Header> headers);
+
+    /**
+     * Sets the out-bound headers to be added to messages sent from
+     * this {@link BindingProvider}.
+     *
+     * <p>
+     * Works like {@link #setOutboundHeaders(List)} except
+     * that it accepts a var arg array.
+     *
+     * @param headers
+     *      Can be null or empty.
+     */
+    void setOutboundHeaders(Header... headers);
+
+    /**
+     * Sets the out-bound headers to be added to messages sent from
+     * this {@link BindingProvider}.
+     *
+     * <p>
+     * Each object must be a JAXB-bound object that is understood
+     * by the {@link JAXBContext} object known by this {@link WSBindingProvider}
+     * (that is, if this is a {@link Dispatch} with JAXB, then
+     * {@link JAXBContext} given to {@link Service#createDispatch(QName,JAXBContext,Mode)}
+     * and if this is a typed proxy, then {@link JAXBContext}
+     * implicitly created by the JAX-WS RI.)
+     *
+     * @param headers
+     *      Can be null or empty.
+     * @throws UnsupportedOperationException
+     *      If this {@lini WSBindingProvider} is a {@link Dispatch}
+     *      that does not use JAXB.
+     */
+    void setOutboundHeaders(Object... headers);
+
+    List<Header> getInboundHeaders();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/package-info.java
new file mode 100644
index 0000000..b8bba5ff
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * JAX-WS RI vendor extension features that are available to the JAX-WS RI users.
+ */
+package com.sun.xml.internal.ws.developer;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/AbstractXMLStreamWriterExImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/AbstractXMLStreamWriterExImpl.java
new file mode 100644
index 0000000..09524d8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/AbstractXMLStreamWriterExImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.istack.internal.XMLStreamException2;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+
+import javax.activation.DataHandler;
+import javax.xml.stream.XMLStreamException;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Partial default implementation of {@link XMLStreamWriterEx}.
+ *
+ * TODO: find a good home for this class.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractXMLStreamWriterExImpl implements XMLStreamWriterEx {
+
+    private StreamImpl stream;
+
+    public void writeBinary(DataHandler data) throws XMLStreamException {
+        try {
+            StreamImpl stream = _writeBinary(data.getContentType());
+            stream.write(data.getInputStream());
+            stream.close();
+        } catch (IOException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+    public OutputStream writeBinary(String contentType) throws XMLStreamException {
+        return _writeBinary(contentType);
+    }
+
+    private StreamImpl _writeBinary(String contentType) {
+        if(stream==null)
+            stream = new StreamImpl();
+        else
+            stream.reset();
+        stream.contentType = contentType;
+        return stream;
+    }
+
+    private final class StreamImpl extends ByteArrayBuffer {
+        private String contentType;
+        public void close() throws IOException {
+            super.close();
+            try {
+                writeBinary(buf,0,size(),contentType);
+            } catch (XMLStreamException e) {
+                IOException x = new IOException();
+                x.initCause(e);
+                throw x;
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java
new file mode 100644
index 0000000..8d75ec4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class ContentTypeImpl implements ContentType {
+    private final String contentType;
+    private final String soapAction;
+    private final String accept;
+
+    public ContentTypeImpl(String contentType) {
+        this.contentType = contentType;
+        this.soapAction = null;
+        this.accept = null;
+    }
+
+    public ContentTypeImpl(String contentType, String soapAction) {
+        this.contentType = contentType;
+        this.soapAction = getQuotedSOAPAction(soapAction);
+        this.accept = null;
+    }
+
+    public ContentTypeImpl(String contentType, String soapAction, String accept) {
+        this.contentType = contentType;
+        this.accept = accept;
+        this.soapAction = getQuotedSOAPAction(soapAction);
+    }
+
+    /** BP 1.1 R1109 requires SOAPAction too be a quoted value **/
+    private String getQuotedSOAPAction(String soapAction){
+        if(soapAction == null || soapAction.length() == 0){
+            return "\"\"";
+        }else if(soapAction.charAt(0) != '"' && soapAction.charAt(soapAction.length() -1) != '"'){
+            //surround soapAction by double quotes for BP R1109
+            return "\"" + soapAction + "\"";
+        }else{
+            return soapAction;
+        }
+    }
+
+    public String getContentType() {
+        return contentType;
+    }
+
+    public String getSOAPActionHeader() {
+        return soapAction;
+    }
+
+    public String getAcceptHeader() {
+        return accept;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/EncoderDecoderBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/EncoderDecoderBase.java
deleted file mode 100644
index 386f41c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/EncoderDecoderBase.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.AccessorException;
-import com.sun.xml.internal.bind.api.JAXBRIContext;
-import com.sun.xml.internal.bind.api.RawAccessor;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-
-import javax.xml.bind.JAXBException;
-import java.util.Map;
-
-/**
- * @author Vivek Pandey
- *
- * Base Abstract class to be used for encoding-decoding a given binding.
- */
-public abstract class EncoderDecoderBase {
-    /**
-     * Creates an internal message based thats binding dependent.
-     *
-     * @param messageInfo
-     * @return the internal message given a messageInfo
-     */
-    public Object toInternalMessage(MessageInfo messageInfo) {
-        throw new UnsupportedOperationException("Not Implementated!");
-    }
-
-    /**
-     * Fills in MessageInfo from binding dependent internal message.
-     *
-     * @param internalMessage
-     * @param messageInfo
-     */
-    public void toMessageInfo(Object internalMessage, MessageInfo messageInfo) {
-        throw new UnsupportedOperationException("Not Implementated!");
-    }
-
-    /**
-     * Get the wrapper child value from a jaxb style wrapper bean.
-     *
-     * @param context
-     *            RuntimeContext to be passed by the encoder/decoder processing
-     *            SOAP message during toMessageInfo()
-     * @param wrapperBean
-     *            The wrapper bean instance
-     * @param nsURI
-     *            namespace of the wrapper child property
-     * @param localName
-     *            local name of the wrapper child property
-     * @return The wrapper child
-     *
-     */
-    protected Object getWrapperChildValue(RuntimeContext context, Object wrapperBean, String nsURI,
-            String localName) {
-        if (wrapperBean == null)
-            return null;
-
-        RawAccessor ra = getRawAccessor(context, wrapperBean.getClass(), nsURI, localName);
-        try {
-            return ra.get(wrapperBean);
-        } catch (AccessorException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * Set the wrapper child value from a jaxb style wrapper bean.
-     *
-     * @param context
-     *            context RuntimeContext to be passed by the encoder/decoder
-     *            processing SOAP message during toMessageInfo()
-     * @param wrapperBean
-     *            The wrapper bean instance
-     * @param value
-     *            value of the wrapper child property
-     * @param nsURI
-     *            namespace of the wrapper child property
-     * @param localName
-     *            localName local name of the wrapper child property
-     */
-    protected void setWrapperChildValue(RuntimeContext context, Object wrapperBean, Object value,
-            String nsURI, String localName) {
-        if (wrapperBean == null)
-            return;
-        RawAccessor ra = getRawAccessor(context, wrapperBean.getClass(), nsURI, localName);
-        try {
-            ra.set(wrapperBean, value);
-        } catch (AccessorException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    private RawAccessor getRawAccessor(RuntimeContext context, Class wrapperBean, String nsURI, String localName){
-        RuntimeModel model = context.getModel();
-        Map<Integer, RawAccessor> map = model.getRawAccessorMap();
-        int id  = getHashCode(wrapperBean, nsURI, localName);
-        RawAccessor ra = map.get(id);
-        if(ra == null){
-            JAXBRIContext jaxbContext = model.getJAXBContext();
-            try {
-                ra = jaxbContext.getElementPropertyAccessor(wrapperBean, nsURI,
-                        localName);
-                map.put(id, ra);
-            } catch (JAXBException e) {
-                throw new SerializationException(e);
-            }
-        }
-        return ra;
-    }
-
-    private int getHashCode(Class bean, String uri, String pfix){
-        return bean.hashCode()+uri.hashCode()+pfix.hashCode();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentMarshaller.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentMarshaller.java
deleted file mode 100644
index c95354a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentMarshaller.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding;
-
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.spi.runtime.MtomCallback;
-import com.sun.xml.internal.ws.util.ByteArrayDataSource;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.MessageContext;
-import java.io.ByteArrayInputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * @author WS Development Team
- *
- *
- */
-public class JAXWSAttachmentMarshaller extends AttachmentMarshaller {
-
-    public JAXWSAttachmentMarshaller(boolean isXOP){
-        this.isXOP = isXOP;
-    }
-
-    public boolean isXOPPackage() {
-        return isXOP;
-    }
-
-    /**
-     * set the XOP package if the incoming SOAP envelope is a XOP package
-     * @param isXOP
-     */
-    public void setXOPPackage(boolean isXOP){
-        this.isXOP = isXOP;
-    }
-
-    /*
-     * @see AttachmentMarshaller#addMtomAttachment(DataHandler, String, String)
-     */
-    public String addMtomAttachment(DataHandler data, String elementNamespace, String elementName) {
-        if(!isXOP)
-            return null;
-        String cid = encodeCid(elementNamespace);
-        if(cid != null){
-            String cidBracket = '<' + cid + '>';
-            attachments.put(cidBracket, AttachmentBlock.fromDataHandler(cidBracket,data));
-            addToMessageContext(cidBracket, data);
-            if(mtomCallback != null)
-                mtomCallback.addedMtomAttachment(cidBracket, data, elementNamespace, elementName);
-            isXopped = true;
-            cid = "cid:"+cid;
-        }
-        return cid;
-    }
-
-    /**
-     * <p>Consider binary <code>data</code> for optimized binary storage as an attachment.
-     * <p/>
-     * <p>Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".</p>
-     * <p/>
-     * <p/>
-     * The <code>elementNamespace</code> and <code>elementLocalName</code>
-     * parameters provide the
-     * context that contains the binary data. This information could
-     * be used by the MIME-based package processor to determine if the
-     * binary data should be inlined or optimized as an attachment.
-     *
-     * @param data             represents the data to be attached. Must be non-null. The actual data region is
-     *                         specified by <tt>(data,offset,len)</tt> tuple.
-     * @param mimeType         If the data has an associated MIME type known to JAXB, that is passed
-     *                         as this parameter. If none is known, "application/octet-stream".
-     *                         This parameter may never be null.
-     * @param elementNamespace the namespace URI of the element that encloses the base64Binary data.
-     *                         Can be empty but never null.
-     * @param elementLocalName The local name of the element. Always a non-null valid string.
-     * @return content-id URI, cid, to the attachment containing
-     *         <code>data</code> or null if data should be inlined.
-     * @see #addMtomAttachment(javax.activation.DataHandler, String, String)
-     */
-    public String addMtomAttachment(byte[] data, int offset, int len, String mimeType, String elementNamespace, String elementLocalName) {
-        if(!isXOP)
-            return null;
-
-        //TODO: With performance results we need to find out what length would need optimization
-        if(len < mtomThresholdValue)
-            return null;
-
-        //this will not be needed if saaj exposes api that takes
-        //byte[] actualData = getActualData(data, offset, len);
-
-        String cid = encodeCid(elementNamespace);
-        if(cid != null){
-            String cidBracket = '<' + cid + '>';
-            DataHandler dh = new DataHandler(new ByteArrayDataSource(data, offset, len, "application/octet-stream"));
-            attachments.put(cidBracket, AttachmentBlock.fromDataHandler(cidBracket,dh));
-            addToMessageContext(cidBracket, dh);
-            if(mtomCallback != null)
-                mtomCallback.addedMtomAttachment(cidBracket, dh, elementNamespace, elementLocalName);
-            isXopped = true;
-            cid = "cid:"+cid;
-        }
-        return cid;
-
-    }
-
-    /*
-     * @see AttachmentMarshaller#addSwaRefAttachment(DataHandler)
-     */
-    public String addSwaRefAttachment(DataHandler data) {
-        String cid = encodeCid(null);
-        if(cid != null){
-            String cidBracket = '<' + cid + '>';
-            attachments.put(cidBracket, AttachmentBlock.fromDataHandler("<"+cid+">", data));
-            addToMessageContext(cidBracket, data);
-            isXopped = false;
-            cid = "cid:"+cid;
-        }
-        return cid;
-    }
-
-    private void addToMessageContext(String cid, DataHandler dh){
-        if(hc == null)
-            return;
-        MessageContext ctxt = hc.getMessageContext();
-        if(ctxt == null)
-            return;
-        MessageContextUtil.addMessageAttachment(ctxt, cid, dh);
-    }
-
-    /**
-     *
-     * @param ns
-     * @return
-     */
-    private String encodeCid(String ns){
-        String cid="example.jaxws.sun.com";
-        String name = UUID.randomUUID()+"@";
-        if(ns != null && (ns.length() > 0)){
-            try {
-                URI uri = new URI(ns);
-                String host = uri.toURL().getHost();
-                cid = host;
-            } catch (URISyntaxException e) {
-                e.printStackTrace();
-                return null;
-            } catch (MalformedURLException e) {
-                try {
-                    cid = URLEncoder.encode(ns, "UTF-8");
-                } catch (UnsupportedEncodingException e1) {
-                    throw new WebServiceException(e);
-                }
-            }
-        }
-        return name + cid;
-    }
-
-    /**
-     * Must be called before marshalling any data.
-     * @param attachments Reference to Map from InternalMessage
-     */
-    public void setAttachments(Map<String, AttachmentBlock> attachments){
-        this.attachments = attachments;
-        isXopped = false;
-    }
-
-    public void setHandlerContaxt(HandlerContext hc){
-        this.hc = hc;
-    }
-
-    /**
-     *
-     * @return true if Xopped, false otherwise
-     */
-    public boolean isXopped() {
-        return isXopped;
-    }
-
-    public void setMtomThresholdValue(Integer mtomThresholdValue) {
-        if((mtomThresholdValue != null) && (mtomThresholdValue >=0))
-            this.mtomThresholdValue = mtomThresholdValue;
-    }
-
-    public void setMtomCallback(MtomCallback mtomCallback){
-        this.mtomCallback = mtomCallback;
-    }
-
-    private MtomCallback mtomCallback;
-    private boolean isXOP;
-    private boolean isXopped;
-    private Map<String, AttachmentBlock> attachments;
-    private HandlerContext hc;
-    private int mtomThresholdValue = 1000;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentUnmarshaller.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentUnmarshaller.java
deleted file mode 100644
index b7b8964..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/JAXWSAttachmentUnmarshaller.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding;
-
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.util.ASCIIUtility;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-import javax.xml.ws.WebServiceException;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.net.URLDecoder;
-
-/**
- * @author Vivek Pandey
- *
- * AttachmentUnmarshaller, will be called by jaxb unmarshaller to process xop package.
- */
-public class JAXWSAttachmentUnmarshaller extends AttachmentUnmarshaller {
-
-    /**
-     *
-     */
-    public JAXWSAttachmentUnmarshaller(){
-    }
-
-    /**
-     *
-     * @param cid
-     * @return a <code>DataHandler</code> for the attachment
-     */
-    public DataHandler getAttachmentAsDataHandler(String cid) {
-        AttachmentBlock ab = attachments.get(decodeCid(cid));
-        if(ab == null)
-            //TODO localize exception message
-            throw new IllegalArgumentException("Attachment corresponding to "+cid+ " not found!");
-        return ab.asDataHandler();
-    }
-
-    /**
-     *
-     * @param cid
-     * @return the attachment as a <code>byte[]</code>
-     */
-    public byte[] getAttachmentAsByteArray(String cid) {
-        AttachmentBlock ab = attachments.get(decodeCid(cid));
-        if(ab == null)
-            throw new IllegalArgumentException("Attachment corresponding to "+cid+ " not found!");
-        return ab.asByteArray();
-    }
-
-    /**
-     *
-     * @return true if XOPPackage
-     */
-    public boolean isXOPPackage() {
-        return isXOP;
-    }
-
-    /**
-     * set the XOP package if the incoming SOAP envelope is a XOP package
-     * @param isXOP
-     */
-    public void setXOPPackage(boolean isXOP){
-        this.isXOP = isXOP;
-    }
-
-    /**
-     * Must be called before marshalling any data.
-     * @param attachments Reference to Map from InternalMessage
-     */
-    public void setAttachments(Map<String, AttachmentBlock> attachments){
-        this.attachments = attachments;
-    }
-
-    /**
-     *
-     * @param cid
-     * @return
-     */
-    private String decodeCid(String cid){
-        if(cid.startsWith("cid:"))
-            cid = cid.substring(4, cid.length());
-//        try {       // Added fix for CR 6456442
-            //return "<"+URLDecoder.decode(cid, "UTF-8")+">";
-            return "<"+cid+">";
-//        } catch (UnsupportedEncodingException e) {
-//            throw new WebServiceException(e);
-//        }
-    }
-
-    private Map<String, AttachmentBlock> attachments;
-    private boolean isXOP;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeCodec.java
new file mode 100644
index 0000000..7a48125
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeCodec.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.channels.ReadableByteChannel;
+import java.util.UUID;
+
+/**
+ * {@link Codec}s that uses the MIME multipart as the underlying format.
+ *
+ * <p>
+ * When the runtime needs to dynamically choose a {@link Codec}, and
+ * when there are more than one {@link Codec}s that use MIME multipart,
+ * it is often impossible to determine the right {@link Codec} unless
+ * you parse the multipart message to some extent.
+ *
+ * <p>
+ * By having all such {@link Codec}s extending from this class,
+ * the "sniffer" can decode a multipart message partially, and then
+ * pass the partial parse result to the ultimately-responsible {@link Codec}.
+ * This improves the performance.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class MimeCodec implements Codec {
+    public static final String MULTIPART_RELATED_MIME_TYPE = "multipart/related";
+
+    private String boundary;
+    private String messageContentType;
+    private boolean hasAttachments;
+    protected Codec rootCodec;
+    protected final SOAPVersion version;
+
+    protected MimeCodec(SOAPVersion version) {
+        this.version = version;
+    }
+
+    public String getMimeType() {
+        return MULTIPART_RELATED_MIME_TYPE;
+    }
+
+    // TODO: preencode String literals to byte[] so that they don't have to
+    // go through char[]->byte[] conversion at runtime.
+    public ContentType encode(Packet packet, OutputStream out) throws IOException {
+        Message msg = packet.getMessage();
+        if (msg == null) {
+            return null;
+        }
+
+        if (hasAttachments) {
+            OutputUtil.writeln("--"+boundary, out);
+            OutputUtil.writeln("Content-Type: " + rootCodec.getMimeType(), out);
+            OutputUtil.writeln(out);
+        }
+        ContentType primaryCt = rootCodec.encode(packet, out);
+
+        if (hasAttachments) {
+            OutputUtil.writeln(out);
+            // Encode all the attchments
+            for (Attachment att : msg.getAttachments()) {
+                OutputUtil.writeln("--"+boundary, out);
+                //SAAJ's AttachmentPart.getContentId() returns content id already enclosed with
+                //angle brackets. For now put angle bracket only if its not there
+                String cid = att.getContentId();
+                if(cid != null && cid.length() >0 && cid.charAt(0) != '<')
+                    cid = '<' + cid + '>';
+                OutputUtil.writeln("Content-Id:" + cid, out);
+                OutputUtil.writeln("Content-Type: " + att.getContentType(), out);
+                OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+                OutputUtil.writeln(out);                    // write \r\n
+                att.writeTo(out);
+                OutputUtil.writeln(out);                    // write \r\n
+            }
+            OutputUtil.writeAsAscii("--"+boundary, out);
+            OutputUtil.writeAsAscii("--", out);
+        }
+        // TODO not returing correct multipart/related type(no boundary)
+        return hasAttachments ? new ContentTypeImpl(messageContentType, packet.soapAction, null) : primaryCt;
+    }
+
+    public ContentType getStaticContentType(Packet packet) {
+        Message msg = packet.getMessage();
+        hasAttachments = !msg.getAttachments().isEmpty();
+
+        if (hasAttachments) {
+            boundary = "uuid:" + UUID.randomUUID().toString();
+            String boundaryParameter = "boundary=\"" + boundary + "\"";
+            // TODO use primaryEncoder to get type
+            messageContentType =  MULTIPART_RELATED_MIME_TYPE +
+                    "; type=\"" + rootCodec.getMimeType() + "\"; " +
+                    boundaryParameter;
+            return new ContentTypeImpl(messageContentType, packet.soapAction, null);
+        } else {
+            return rootCodec.getStaticContentType(packet);
+        }
+    }
+
+    /**
+     * Copy constructor.
+     */
+    protected MimeCodec(MimeCodec that) {
+        this.version = that.version;
+    }
+
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        MimeMultipartParser parser = new MimeMultipartParser(in, contentType);
+        decode(parser,packet);
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet packet) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Parses a {@link Packet} from a {@link MimeMultipartParser}.
+     */
+    protected abstract void decode(MimeMultipartParser mpp, Packet packet) throws IOException;
+
+    public abstract MimeCodec copy();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java
new file mode 100644
index 0000000..6e63cd0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java
@@ -0,0 +1,480 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.InternetHeaders;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ParseException;
+import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+import com.sun.xml.internal.ws.util.ASCIIUtility;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+
+import javax.xml.ws.WebServiceException;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Parses Mime multipart message into primary part and attachment parts. It
+ * parses the stream lazily as and when required.
+ *
+ * TODO need a list to keep all the attachments so that even if Content-Id is
+ * not there it is accounted
+ *
+ * @author Vivek Pandey
+ * @author Jitendra Kotamraju
+ */
+public final class MimeMultipartParser {
+
+    private final InputStream in;
+    private final String start;
+    private final byte[] boundaryBytes;
+
+    private final BitSet lastPartFound = new BitSet(1);
+    // current stream position, set to -1 on EOF
+    private int b = 0;
+    private final int[] bcs = new int[256];
+    private int[] gss;
+    private static final int BUFFER_SIZE = 4096;
+    private byte[] buffer = new byte[BUFFER_SIZE];
+    private byte[] prevBuffer = new byte[BUFFER_SIZE];
+    private boolean firstPart = true;
+
+    private final Map<String, StreamAttachment> attachments = new HashMap<String, StreamAttachment>();
+    private StreamAttachment root;
+
+    private int cidCounter = 0;
+
+    public MimeMultipartParser(InputStream in, String contentType) {
+        try {
+            ContentType ct = new ContentType(contentType);
+            String boundary = ct.getParameter("boundary");
+            if (boundary == null || boundary.equals("")) {
+                throw new WebServiceException("MIME boundary parameter not found" + contentType);
+            }
+            String bnd = "--" + boundary;
+            boundaryBytes = ASCIIUtility.getBytes(bnd);
+            start = ct.getParameter("start");
+        } catch (ParseException e) {
+            throw new WebServiceException(e);
+        }
+
+        //InputStream MUST support mark()
+        if (!in.markSupported()) {
+            this.in = new BufferedInputStream(in);
+        } else {
+            this.in = in;
+        }
+    }
+
+    /**
+     * Parses the stream and returns the root part. If start parameter is
+     * present in Content-Type, it is used to determine the root part, otherwise
+     * root part is the first part.
+     *
+     * @return StreamAttachment for root part
+     *         null if root part cannot be found
+     *
+     */
+    public @Nullable StreamAttachment getRootPart() {
+        if (root != null) {
+            return root;
+        }
+        while(!lastBodyPartFound() && (b != -1) && root == null) {
+            getNextPart();
+        }
+        return root;
+    }
+
+    /**
+     * Parses the entire stream and returns all MIME parts except root MIME part.
+     *
+     * @return Map<String, StreamAttachment> for all attachment parts
+     */
+    public @NotNull Map<String, StreamAttachment> getAttachmentParts() {
+        while(!lastBodyPartFound() && (b != -1)) {
+            getNextPart();
+        }
+        return attachments;
+    }
+
+    /**
+     * This method can be called to get a matching MIME attachment part for the
+     * given contentId. It parses the stream until it finds a matching part.
+     *
+     * @return StreamAttachment attachment for contentId
+     *         null if there is no attachment for contentId
+     */
+    public @Nullable StreamAttachment getAttachmentPart(String contentId) throws IOException {
+        //first see if this attachment is already parsed, if so return it
+        StreamAttachment streamAttach = attachments.get(contentId);
+        if (streamAttach != null) {
+            return streamAttach;
+        }
+        //else parse the MIME parts till we get what we want
+        while (!lastBodyPartFound() && (b != -1)) {
+            streamAttach = getNextPart();
+            String newContentId = streamAttach.getContentId();
+            if (newContentId != null && newContentId.equals(contentId)){
+                return streamAttach;
+            }
+        }
+        return null;            // Attachment is not found
+    }
+
+    /**
+     * Parses the stream and returns next available MIME part. This shouldn't
+     * be called if there are no MIME parts in the stream. Attachment
+     * part(not root part) is cached in the {@link Map}<{@link String},{@link StreamAttachment}>
+     * before returning the MIME part. It also finds the root part of the MIME
+     * package and assigns root variable.
+     *
+     * @return StreamAttachment next available MIME part
+     *
+     */
+    private StreamAttachment getNextPart() {
+        assert !lastBodyPartFound();
+
+        try {
+            if (firstPart) {
+                compileBoundaryPattern();
+                // skip the first boundary of the MIME package
+                if (!skipPreamble()) {
+                    throw new WebServiceException("Missing Start Boundary, or boundary does not start on a new line");
+                }
+            }
+            InternetHeaders ih = new InternetHeaders(in);
+            String[] contentTypes = ih.getHeader("content-type");
+            String contentType = (contentTypes != null) ? contentTypes[0] : "application/octet-stream";
+            String [] contentIds = ih.getHeader("content-id");
+            String mimeContentId = (contentIds != null) ? contentIds[0] : null;
+            String contentId = mimeContentId;
+            if(mimeContentId!=null && mimeContentId.length()>2) {
+                if(contentId.charAt(0)=='<')   contentId=mimeContentId.substring(1,mimeContentId.length()-1);
+            }
+
+            ByteArrayBuffer bos = new ByteArrayBuffer();
+            b = readBody(bos);
+            StreamAttachment as = new StreamAttachment(bos, contentId, contentType);
+            if (start == null && firstPart) {
+                root = as;      // Taking first part as root part
+            } else if (mimeContentId != null && start != null && start.equals(mimeContentId)) {
+                root = as;      // root part as identified by start parameter
+            } else if (contentId != null) {
+                attachments.put(contentId, as);     // Attachment part
+            } else {
+                ++cidCounter;
+                attachments.put(""+cidCounter, as);
+            }
+            firstPart = false;
+            return as;
+        } catch(IOException ioe) {
+            throw new WebServiceException(ioe);
+        } catch(MessagingException me) {
+            throw new WebServiceException(me);
+        }
+    }
+
+    private int readBody(ByteArrayBuffer baos) throws IOException {
+        if (!findMimeBody(baos)) {
+            //TODO: i18n
+            throw new WebServiceException("Missing boundary delimitier ");
+        }
+        return b;
+    }
+
+    private boolean findMimeBody(ByteArrayBuffer out) throws IOException {
+        int i;
+        int l = boundaryBytes.length;
+        int lx = l - 1;
+        int bufferLength;
+        int s = 0;
+        byte[] tmp;
+
+        boolean first = true;
+        BitSet eof = new BitSet(1);
+
+        while (true) {
+            in.mark(l);
+            if (!first) {
+                tmp = prevBuffer;
+                prevBuffer = buffer;
+                buffer = tmp;
+            }
+            bufferLength = readNext(in, l, eof);
+
+            if (bufferLength == -1) {
+                b = -1;
+                if ((s == l)) {
+                    out.write(prevBuffer, 0, s);
+                }
+                return true;
+            }
+
+            if (bufferLength < l) {
+                out.write(buffer, 0, bufferLength);
+                b = -1;
+                return true;
+            }
+
+            for (i = lx; i >= 0; i--) {
+                if (buffer[i] != boundaryBytes[i]) {
+                    break;
+                }
+            }
+
+            if (i < 0) {
+                if (s > 0) {
+                    // so if s == 1 : it must be an LF
+                    // if s == 2 : it must be a CR LF
+                    if (s <= 2) {
+                        String crlf = new String(prevBuffer, 0, s);
+                        if (!"\n".equals(crlf) && !"\r\n".equals(crlf)) {
+                            throw new WebServiceException(
+                                    "Boundary characters encountered in part Body " +
+                                            "without a preceeding CRLF");
+                        }
+                    } else if (s > 2) {
+                        if ((prevBuffer[s - 2] == '\r') && (prevBuffer[s - 1] == '\n')) {
+                            out.write(prevBuffer, 0, s - 2);
+                        } else if (prevBuffer[s - 1] == '\n') {
+                            out.write(prevBuffer, 0, s - 1);
+                        } else {
+                            throw new WebServiceException(
+                                    "Boundary characters encountered in part Body " +
+                                            "without a preceeding CRLF");
+                        }
+                    }
+                }
+                // found the boundary, skip *LWSP-char and CRLF
+                if (!skipLWSPAndCRLF(in)) {
+                    //throw new Exception(
+                    //   "Boundary does not terminate with CRLF");
+                }
+                return true;
+            }
+
+            if ((s > 0)) {
+                if (prevBuffer[s - 1] == (byte) 13) {
+                    // if buffer[0] == (byte)10
+                    if (buffer[0] == (byte) 10) {
+                        int j;
+                        for (j = lx - 1; j > 0; j--) {
+                            if (buffer[j + 1] != boundaryBytes[j]) {
+                                break;
+                            }
+                        }
+                        if (j == 0) {
+                            // matched the boundaryBytes excluding the last char of the boundaryBytes
+                            // so dont write the CR into stream
+                            out.write(prevBuffer, 0, s - 1);
+                        } else {
+                            out.write(prevBuffer, 0, s);
+                        }
+                    } else {
+                        out.write(prevBuffer, 0, s);
+                    }
+                } else {
+                    out.write(prevBuffer, 0, s);
+                }
+            }
+
+            s = Math.max(i + 1 - bcs[buffer[i] & 0x7f], gss[i]);
+            in.reset();
+            in.skip(s);
+            if (first) {
+                first = false;
+            }
+        }
+    }
+
+
+    private boolean lastBodyPartFound() {
+        return lastPartFound.get(0);
+    }
+
+    private void compileBoundaryPattern() {
+        int l = boundaryBytes.length;
+
+        int i;
+        int j;
+
+        // Copied from J2SE 1.4 regex code
+        // java.util.regex.Pattern.java
+
+        // Initialise Bad Character Shift table
+        for (i = 0; i < l; i++) {
+            bcs[boundaryBytes[i]] = i + 1;
+        }
+
+        // Initialise Good Suffix Shift table
+        gss = new int[l];
+
+        NEXT:
+        for (i = l; i > 0; i--) {
+            // j is the beginning index of suffix being considered
+            for (j = l - 1; j >= i; j--) {
+                // Testing for good suffix
+                if (boundaryBytes[j] == boundaryBytes[j - i]) {
+                    // boundaryBytes[j..len] is a good suffix
+                    gss[j - 1] = i;
+                } else {
+                    // No match. The array has already been
+                    // filled up with correct values before.
+                    continue NEXT;
+                }
+            }
+            while (j > 0) {
+                gss[--j] = i;
+            }
+        }
+        gss[l - 1] = 1;
+    }
+
+    private boolean skipPreamble() throws IOException {
+        if (!findBoundary()) {
+            return false;
+        }
+        if (lastPartFound.get(0)) {
+            throw new WebServiceException("Found closing boundary delimiter while trying to skip preamble");
+        }
+        return true;
+    }
+
+    private boolean findBoundary() throws IOException {
+        int i;
+        int l = boundaryBytes.length;
+        int lx = l - 1;
+        BitSet eof = new BitSet(1);
+
+        while (true) {
+            in.mark(l);
+            readNext(in, l, eof);
+            if (eof.get(0)) {
+                // End of stream
+                return false;
+            }
+
+            for (i = lx; i >= 0; i--) {
+                if (buffer[i] != boundaryBytes[i]) {
+                    break;
+                }
+            }
+
+            if (i < 0) {
+                // found the boundary, skip *LWSP-char and CRLF
+                if (!skipLWSPAndCRLF(in)) {
+                    throw new WebServiceException("Boundary does not terminate with CRLF");
+                }
+                return true;
+            }
+
+            int s = Math.max(i + 1 - bcs[buffer[i] & 0x7f], gss[i]);
+            in.reset();
+            in.skip(s);
+        }
+    }
+
+    private boolean skipLWSPAndCRLF(InputStream is) throws IOException {
+
+        b = is.read();
+        //looks like old impl allowed just a \n as well
+        if (b == '\n') {
+            return true;
+        }
+
+        if (b == '\r') {
+            b = is.read();
+            if (b == '\n') {
+                return true;
+            } else {
+                throw new WebServiceException(
+                        "transport padding after a Mime Boundary  should end in a CRLF, found CR only");
+            }
+        }
+
+        if (b == '-') {
+            b = is.read();
+            if (b != '-') {
+                throw new WebServiceException(
+                        "Unexpected singular '-' character after Mime Boundary");
+            } else {
+                lastPartFound.flip(0);
+                // read the next char
+                b = is.read();
+            }
+        }
+
+        while ((b != -1) && ((b == ' ') || (b == '\t'))) {
+            b = is.read();
+            if (b == '\r') {
+                b = is.read();
+                if (b == '\n') {
+                    return true;
+                }
+            }
+        }
+
+        if (b == -1) {
+            // the last boundary need not have CRLF
+            if (!lastPartFound.get(0)) {
+                throw new WebServiceException(
+                        "End of Multipart Stream before encountering  closing boundary delimiter");
+            }
+            return true;
+        }
+        return false;
+    }
+
+
+    private int readNext(InputStream is, int patternLength, BitSet eof) throws IOException {
+        int bufferLength = is.read(buffer, 0, patternLength);
+        if (bufferLength == -1) {
+            eof.flip(0);
+        } else if (bufferLength < patternLength) {
+            //repeatedly read patternLength - bufferLength
+            int temp ;
+            int i = bufferLength;
+            for (; i < patternLength; i++) {
+                temp = is.read();
+                if (temp == -1) {
+                    eof.flip(0);
+                    break;
+                }
+                buffer[i] = (byte) temp;
+            }
+            bufferLength = i;
+        }
+        return bufferLength;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MtomCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MtomCodec.java
new file mode 100644
index 0000000..b53d61b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MtomCodec.java
@@ -0,0 +1,560 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.DatatypeConverterImpl;
+import com.sun.xml.internal.bind.v2.runtime.output.Encoded;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.message.MimeAttachmentSet;
+import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+import com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter;
+import com.sun.xml.internal.ws.util.xml.XMLStreamWriterFilter;
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+import com.sun.xml.internal.org.jvnet.staxex.NamespaceContextEx;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+
+import javax.activation.DataHandler;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.MTOMFeature;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.nio.channels.WritableByteChannel;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * Mtom messge Codec. It can be used even for non-soap message's mtom encoding.
+ *
+ * @author Vivek Pandey
+ */
+public class MtomCodec extends MimeCodec {
+    public static final String XOP_XML_MIME_TYPE = "application/xop+xml";
+
+    private final StreamSOAPCodec codec;
+
+    // encoding related parameters
+    private String boundary;
+    private final String soapXopContentType;
+    private String messageContentType;
+    private final MTOMFeature mtomFeature;
+
+    //This is the mtom attachment stream, we should write it just after the root part for decoder
+    private final List<ByteArrayBuffer> mtomAttachmentStream = new ArrayList<ByteArrayBuffer>();
+
+    MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WebServiceFeature mtomFeature){
+        super(version);
+        this.codec = codec;
+        createConteTypeHeader();
+        this.soapXopContentType = XOP_XML_MIME_TYPE +";charset=utf-8;type=\""+version.contentType+"\"";
+        if(mtomFeature == null)
+            this.mtomFeature = new MTOMFeature();
+        else
+            this.mtomFeature = (MTOMFeature) mtomFeature;
+    }
+
+    private void createConteTypeHeader(){
+        boundary = "uuid:" + UUID.randomUUID().toString();
+        String boundaryParameter = "boundary=\"" + boundary +"\"";
+        messageContentType = MULTIPART_RELATED_MIME_TYPE +
+                ";type=\"" + XOP_XML_MIME_TYPE + "\";" +
+                boundaryParameter +
+                ";start-info=\"" + version.contentType + "\"";
+    }
+
+    /**
+     * Return the soap 1.1 and soap 1.2 specific XOP packaged ContentType
+     *
+     * @return A non-null content type for soap11 or soap 1.2 content type
+     */
+    public ContentType getStaticContentType(Packet packet) {
+        return getContentType(packet);
+    }
+
+    private ContentType getContentType(Packet packet){
+        switch(version){
+            case SOAP_11:
+                return new ContentTypeImpl(messageContentType, (packet.soapAction == null)?"":packet.soapAction, null);
+            case SOAP_12:
+                if(packet.soapAction != null){
+                    messageContentType += ";action=\""+packet.soapAction+"\"";
+                }
+                return new ContentTypeImpl(messageContentType, null, null);
+        }
+        //never happens
+        return null;
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) throws IOException {
+        //get the current boundary thaat will be reaturned from this method
+        mtomAttachmentStream.clear();
+        ContentType contentType = getContentType(packet);
+
+        if(packet.getMessage() != null){
+            try {
+                OutputUtil.writeln("--"+boundary, out);
+                OutputUtil.writeln("Content-Type: "+ soapXopContentType,  out);
+                OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+                OutputUtil.writeln(out);
+                MtomStreamWriter writer = new MtomStreamWriter(XMLStreamWriterFactory.create(out),out);
+                packet.getMessage().writeTo(writer);
+                XMLStreamWriterFactory.recycle(writer);
+                OutputUtil.writeln(out);
+
+                for(ByteArrayBuffer bos : mtomAttachmentStream){
+                    bos.write(out);
+                }
+
+                //now write out the attachments in the message
+                writeAttachments(packet.getMessage().getAttachments(),out);
+
+                //write out the end boundary
+                OutputUtil.writeAsAscii("--"+boundary, out);
+                OutputUtil.writeAsAscii("--", out);
+
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+        }
+        //now create the boundary for next encode() call
+        createConteTypeHeader();
+        return contentType;
+    }
+
+    private class ByteArrayBuffer{
+        final String contentId;
+
+        private DataHandler dh;
+
+        ByteArrayBuffer(@NotNull DataHandler dh) {
+            this.dh = dh;
+            this.contentId = encodeCid();
+        }
+
+        void write(OutputStream os) throws IOException {
+            //build attachment frame
+            OutputUtil.writeln("--"+boundary, os);
+            writeMimeHeaders(dh.getContentType(), contentId, os);
+            dh.writeTo(os);
+            OutputUtil.writeln(os);
+        }
+    }
+
+    private void writeMimeHeaders(String contentType, String contentId, OutputStream out) throws IOException {
+        OutputUtil.writeln("Content-Type: " + contentType, out);
+        String cid = contentId;
+        if(cid != null && cid.length() >0 && cid.charAt(0) != '<')
+            cid = '<' + cid + '>';
+        OutputUtil.writeln("Content-Id: " + cid, out);
+        OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+        OutputUtil.writeln(out);
+    }
+
+    private void writeAttachments(AttachmentSet attachments, OutputStream out) throws IOException {
+        for(Attachment att : attachments){
+            //build attachment frame
+            OutputUtil.writeln("--"+boundary, out);
+            writeMimeHeaders(att.getContentType(), att.getContentId(), out);
+            att.writeTo(out);
+            OutputUtil.writeln(out);                    // write \r\n
+        }
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        throw new UnsupportedOperationException();
+    }
+
+    public MtomCodec copy() {
+        return new MtomCodec(version, (StreamSOAPCodec)codec.copy(), mtomFeature);
+    }
+
+    private String encodeCid(){
+        String cid="example.jaxws.sun.com";
+        String name = UUID.randomUUID()+"@";
+        return name + cid;
+    }
+
+    @Override
+    protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+        // we'd like to reuse those reader objects but unfortunately decoder may be reused
+        // before the decoded message is completely used.
+
+        XMLStreamReader mtomReader = new MtomXMLStreamReaderEx( mpp,
+            XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), true)
+        );
+
+        //TODO: remove this code after {@link StreamSOAPCodec#decode} is modified to
+        //take AttachmentSet.
+        if(codec instanceof com.sun.xml.internal.ws.encoding.StreamSOAPCodec){
+            packet.setMessage(((com.sun.xml.internal.ws.encoding.StreamSOAPCodec)codec).decode(mtomReader, new MimeAttachmentSet(mpp)));
+        }else{
+            packet.setMessage(codec.decode(mtomReader));
+        }
+    }
+
+    private class MtomStreamWriter extends XMLStreamWriterFilter implements XMLStreamWriterEx {
+        private final OutputStream out;
+        private final Encoded encoded = new Encoded();
+
+        public MtomStreamWriter(XMLStreamWriter w, OutputStream out) {
+            super(w);
+            this.out = out;
+        }
+
+        public void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException {
+            //check threshold and if less write as base64encoded value
+            if(mtomFeature.getThreshold() > len){
+                writeCharacters(DatatypeConverterImpl._printBase64Binary(data, start, len));
+                return;
+            }
+            ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, start, len, contentType)));
+            writeBinary(bab);
+        }
+
+        public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
+            Base64Data data  = new Base64Data();
+            data.set(dataHandler);
+            writeBinary(new ByteArrayBuffer(data.getDataHandler()));
+        }
+
+        public OutputStream writeBinary(String contentType) throws XMLStreamException {
+            throw new UnsupportedOperationException();
+        }
+
+        public void writePCDATA(CharSequence data) throws XMLStreamException {
+            if(data == null)
+                return;
+            if(data instanceof Base64Data){
+                Base64Data binaryData = (Base64Data)data;
+                writeBinary(binaryData.getDataHandler());
+                return;
+            }
+            writeCharacters(data.toString());
+        }
+
+        private void writeBinary(ByteArrayBuffer bab) {
+            try {
+                mtomAttachmentStream.add(bab);
+
+                writer.writeCharacters("");   // Force completion of open elems
+                writer.flush();
+                //flush the underlying writer to write-out any cached data to the underlying
+                // stream before writing directly to it
+                //write out the xop reference
+                out.write(XOP_PREF);
+                encoded.set(bab.contentId);
+                out.write(encoded.buf,0,encoded.len);
+                out.write(XOP_SUFF);
+            } catch (IOException e) {
+                throw new WebServiceException(e);
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        private class MtomNamespaceContextEx implements NamespaceContextEx {
+            private NamespaceContext nsContext;
+
+            public MtomNamespaceContextEx(NamespaceContext nsContext) {
+                this.nsContext = nsContext;
+            }
+
+            public Iterator<Binding> iterator() {
+                throw new UnsupportedOperationException();
+            }
+
+            public String getNamespaceURI(String prefix) {
+                return nsContext.getNamespaceURI(prefix);
+            }
+
+            public String getPrefix(String namespaceURI) {
+                return nsContext.getPrefix(namespaceURI);
+            }
+
+            public Iterator getPrefixes(String namespaceURI) {
+                return nsContext.getPrefixes(namespaceURI);
+            }
+        }
+
+        public NamespaceContextEx getNamespaceContext() {
+            NamespaceContext nsContext = writer.getNamespaceContext();
+            return new MtomNamespaceContextEx(nsContext);
+        }
+    }
+
+    private static class MtomXMLStreamReaderEx extends XMLStreamReaderFilter implements XMLStreamReaderEx {
+        /**
+         * The parser for the outer MIME 'shell'.
+         */
+        private final MimeMultipartParser mimeMP;
+
+        private boolean xopReferencePresent = false;
+        private Base64Data base64AttData;
+
+        //values that will set to whether mtom or not as caller can call getPcData or getTextCharacters
+        private int textLength;
+        private int textStart;
+
+        //To be used with #getTextCharacters
+        private char[] base64EncodedText;
+
+        public MtomXMLStreamReaderEx(MimeMultipartParser mimeMP, XMLStreamReader reader) {
+            super(reader);
+            this.mimeMP = mimeMP;
+        }
+
+        public CharSequence getPCDATA() throws XMLStreamException {
+            if(xopReferencePresent){
+                return base64AttData;
+            }
+            return reader.getText();
+        }
+
+        public NamespaceContextEx getNamespaceContext() {
+            NamespaceContext nsContext = reader.getNamespaceContext();
+            return new MtomNamespaceContextEx(nsContext);
+
+
+        }
+
+        public String getElementTextTrim() throws XMLStreamException {
+            throw new UnsupportedOperationException();
+        }
+
+        private class MtomNamespaceContextEx implements NamespaceContextEx {
+            private NamespaceContext nsContext;
+
+            public MtomNamespaceContextEx(NamespaceContext nsContext) {
+                this.nsContext = nsContext;
+            }
+
+            public Iterator<Binding> iterator() {
+                throw new UnsupportedOperationException();
+            }
+
+            public String getNamespaceURI(String prefix) {
+                return nsContext.getNamespaceURI(prefix);
+            }
+
+            public String getPrefix(String namespaceURI) {
+                return nsContext.getPrefix(namespaceURI);
+            }
+
+            public Iterator getPrefixes(String namespaceURI) {
+                return nsContext.getPrefixes(namespaceURI);
+            }
+
+        }
+
+        public int getTextLength() {
+            if (xopReferencePresent)
+                return textLength;
+            return reader.getTextLength();
+        }
+
+        public int getTextStart() {
+            //TODO: check if this is correct
+            if (xopReferencePresent)
+                return 0;
+            return reader.getTextStart();
+        }
+
+        public int getEventType() {
+            if(xopReferencePresent)
+                return XMLStreamConstants.CHARACTERS;
+            return super.getEventType();
+        }
+
+        public int next() throws XMLStreamException {
+            int event = reader.next();
+            if ((event == XMLStreamConstants.START_ELEMENT) && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI))
+            {
+                //its xop reference, take the URI reference
+                String href = reader.getAttributeValue(null, "href");
+                try {
+                    StreamAttachment att = getAttachment(href);
+                    if(att != null){
+                        base64AttData = att.asBase64Data();
+                        textLength = base64AttData.getDataLen();
+                    }
+                    textStart = 0;
+                    xopReferencePresent = true;
+                } catch (IOException e) {
+                    throw new WebServiceException(e);
+                }
+                //move to the </xop:Include>
+                try {
+                    reader.next();
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(e);
+                }
+                return XMLStreamConstants.CHARACTERS;
+            }
+            if(xopReferencePresent){
+                xopReferencePresent = false;
+                textStart = 0;
+                textLength = 0;
+                base64EncodedText = null;
+            }
+            return event;
+        }
+
+        private String decodeCid(String cid) {
+            try {
+                cid = URLDecoder.decode(cid, "utf-8");
+            } catch (UnsupportedEncodingException e) {
+                //on recceiving side lets not fail now, try to look for it
+                return cid;
+            }
+            return cid;
+        }
+
+        private boolean needToDecode(String cid){
+            int numChars = cid.length();
+            int i=0;
+            char c;
+            while (i < numChars) {
+                c = cid.charAt(i++);
+                switch (c) {
+                    case '%':
+                        return true;
+                }
+            }
+            return false;
+        }
+
+
+        private StreamAttachment getAttachment(String cid) throws IOException {
+            if (cid.startsWith("cid:"))
+                cid = cid.substring(4, cid.length());
+            StreamAttachment att = mimeMP.getAttachmentPart(cid);
+            if(att == null && needToDecode(cid)){
+                //try not be url decoding it - this is required for Indigo interop, they write content-id without escaping
+                cid = decodeCid(cid);
+                return mimeMP.getAttachmentPart(cid);
+            }
+            return att;
+        }
+
+        public char[] getTextCharacters() {
+            if (xopReferencePresent) {
+                char[] chars = new char[base64AttData.length()];
+                base64AttData.writeTo(chars, 0);
+                textLength = chars.length;
+                return chars;
+            }
+            return reader.getTextCharacters();
+        }
+
+        public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
+            if(xopReferencePresent){
+                int event = reader.getEventType();
+                if(event != XMLStreamConstants.CHARACTERS){
+                    //its invalid state - delegate it to underlying reader to throw the corrrect exception so that user
+                    // always sees the uniform exception from the XMLStreamReader
+                    throw new XMLStreamException("Invalid state: Expected CHARACTERS found :");
+                }
+                if(target == null){
+                    throw new NullPointerException("target char array can't be null") ;
+                }
+
+                if(targetStart < 0 || length < 0 || sourceStart < 0 || targetStart >= target.length ||
+                        (targetStart + length ) > target.length) {
+                    throw new IndexOutOfBoundsException();
+                }
+
+                if(base64EncodedText != null){
+                    base64EncodedText = new char[base64AttData.length()];
+                    base64AttData.writeTo(base64EncodedText, 0);
+                    textLength = base64EncodedText.length;
+                    textStart = 0;
+                }
+
+                if((textStart + sourceStart) > textLength)
+                    throw new IndexOutOfBoundsException();
+
+                int available = textLength - sourceStart;
+                if(available < 0){
+                    throw new IndexOutOfBoundsException("sourceStart is greater than" +
+                            "number of characters associated with this event");
+                }
+
+                int copiedLength = Math.min(available,length);
+
+                System.arraycopy(base64EncodedText, getTextStart() + sourceStart , target, targetStart, copiedLength);
+                textStart = sourceStart;
+                return copiedLength;
+            }
+            return reader.getTextCharacters(sourceStart, target, targetStart, length);
+        }
+
+        public String getText() {
+            if (xopReferencePresent) {
+                String text =  base64AttData.toString();
+                textLength = text.length();
+            }
+            return reader.getText();
+        }
+    }
+
+    private static final byte[] XOP_PREF = encode("<Include xmlns=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:");
+
+    private static byte[] encode(String str) {
+        try {
+            return str.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new Error(e);
+        }
+    }
+
+    private static final byte[] XOP_SUFF = encode("\"/>");
+    private static final String XOP_LOCALNAME = "Include";
+    private static final String XOP_NAMESPACEURI = "http://www.w3.org/2004/08/xop/include";
+
+
+    private static final Charset UTF8 = Charset.forName("UTF-8");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java
new file mode 100644
index 0000000..e69b35d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java
@@ -0,0 +1,439 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.MTOMFeature;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.client.SelectOptimalEncodingFeature;
+import com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.api.pipe.Codecs;
+import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+import com.sun.xml.internal.ws.client.ContentNegotiation;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.resources.StreamingMessages;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.server.UnsupportedMediaException;
+import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
+
+/**
+ * SOAP binding {@link Codec} that can handle MTOM, SwA, and SOAP messages
+ * encoded using XML or Fast Infoset.
+ *
+ * <p>
+ * This is used when we need to determine the encoding from what we received (for decoding)
+ * and from configuration and {@link Message} contents (for encoding)
+ *
+ * <p>
+ * TODO: Split this Codec into two, one that supports FI and one that does not.
+ * Then further split the FI Codec into two, one for client and one for
+ * server. This will simplify the logic and make it easier to understand/maintain.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
+public class SOAPBindingCodec extends MimeCodec implements com.sun.xml.internal.ws.api.pipe.SOAPBindingCodec {
+    /**
+     * Base HTTP Accept request-header.
+     */
+    private static final String BASE_ACCEPT_VALUE =
+            "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
+
+    /**
+     * True if Fast Infoset functionality has been
+     * configured to be disabled, or the Fast Infoset
+     * runtime is not available.
+     */
+    private boolean isFastInfosetDisabled;
+
+    /**
+     * True if the Fast Infoset codec should be used for encoding.
+     */
+    private boolean useFastInfosetForEncoding;
+
+    /**
+     * True if the content negotiation property should
+     * be ignored by the client. This will be used in
+     * the case of Fast Infoset being configured to be
+     * disabled or automatically selected.
+     */
+    private boolean ignoreContentNegotiationProperty;
+
+    // The XML SOAP codec
+    private final StreamSOAPCodec xmlSoapCodec;
+
+    // The Fast Infoset SOAP codec
+    private final Codec fiSoapCodec;
+
+    // The XML MTOM codec
+    private final MimeCodec xmlMtomCodec;
+
+    // The XML SWA codec
+    private final MimeCodec xmlSwaCodec;
+
+    // The Fast Infoset SWA codec
+    private final MimeCodec fiSwaCodec;
+
+    private final SOAPBindingImpl binding;
+
+    /**
+     * The XML SOAP MIME type
+     */
+    private final String xmlMimeType;
+
+    /**
+     * The Fast Infoset SOAP MIME type
+     */
+    private final String fiMimeType;
+
+    /**
+     * The Accept header for XML encodings
+     */
+    private final String xmlAccept;
+
+    /**
+     * The Accept header for Fast Infoset and XML encodings
+     */
+    private final String connegXmlAccept;
+
+    public StreamSOAPCodec getXMLCodec() {
+        return xmlSoapCodec;
+    }
+
+    private class AcceptContentType implements ContentType {
+        private ContentType _c;
+        private String _accept;
+
+        public AcceptContentType set(Packet p, ContentType c) {
+            if (!ignoreContentNegotiationProperty && p.contentNegotiation != ContentNegotiation.none) {
+                _accept = connegXmlAccept;
+            } else {
+                _accept = xmlAccept;
+            }
+            _c = c;
+            return this;
+        }
+
+        public String getContentType() {
+            return _c.getContentType();
+        }
+
+        public String getSOAPActionHeader() {
+            return _c.getSOAPActionHeader();
+        }
+
+        public String getAcceptHeader() {
+            return _accept;
+        }
+    }
+
+    private AcceptContentType _adaptingContentType = new AcceptContentType();
+
+    public SOAPBindingCodec(WSBinding binding) {
+        this(binding, Codecs.createSOAPEnvelopeXmlCodec(binding.getSOAPVersion()));
+    }
+
+    public SOAPBindingCodec(WSBinding binding, StreamSOAPCodec xmlSoapCodec) {
+        super(binding.getSOAPVersion());
+
+        this.xmlSoapCodec = xmlSoapCodec;
+        xmlMimeType = xmlSoapCodec.getMimeType();
+
+        xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, binding.getFeature(MTOMFeature.class));
+
+        xmlSwaCodec = new SwACodec(version, xmlSoapCodec);
+
+        String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
+                xmlMtomCodec.getMimeType() + ", " +
+                BASE_ACCEPT_VALUE;
+
+        WebServiceFeature fi = binding.getFeature(FastInfosetFeature.class);
+        isFastInfosetDisabled = (fi != null && !fi.isEnabled());
+        if (!isFastInfosetDisabled) {
+            fiSoapCodec = getFICodec(xmlSoapCodec, version);
+            if (fiSoapCodec != null) {
+                fiMimeType = fiSoapCodec.getMimeType();
+                fiSwaCodec = new SwACodec(version, fiSoapCodec);
+                connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
+
+                /**
+                 * This feature will only be present on the client side.
+                 *
+                 * Fast Infoset is enabled on the client if the service
+                 * explicitly supports Fast Infoset.
+                 */
+                WebServiceFeature select = binding.getFeature(SelectOptimalEncodingFeature.class);
+                if (select != null) { // if the client FI feature is set - ignore negotiation property
+                    ignoreContentNegotiationProperty = true;
+                    if (select.isEnabled()) {
+                        // If the client's FI encoding feature is enabled, and server's is not disabled
+                        if (fi != null) {  // if server's FI feature also enabled
+                            useFastInfosetForEncoding = true;
+                        }
+
+                        clientAcceptedContentTypes = connegXmlAccept;
+                    } else {  // If client FI feature is disabled
+                        isFastInfosetDisabled = true;
+                    }
+                }
+            } else {
+                // Fast Infoset could not be loaded by the runtime
+                isFastInfosetDisabled = true;
+                fiSwaCodec = null;
+                fiMimeType = "";
+                connegXmlAccept = clientAcceptedContentTypes;
+                ignoreContentNegotiationProperty = true;
+            }
+        } else {
+            // Fast Infoset is explicitly not supported by the service
+            fiSoapCodec = fiSwaCodec = null;
+            fiMimeType = "";
+            connegXmlAccept = clientAcceptedContentTypes;
+            ignoreContentNegotiationProperty = true;
+        }
+
+        xmlAccept = clientAcceptedContentTypes;
+
+        this.binding = (SOAPBindingImpl)binding;
+    }
+
+    public String getMimeType() {
+        return null;
+    }
+
+    public ContentType getStaticContentType(Packet packet) {
+        ContentType toAdapt = getEncoder(packet).getStaticContentType(packet);
+        return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null;
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) throws IOException {
+        return _adaptingContentType.set(packet, getEncoder(packet).encode(packet, out));
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        return _adaptingContentType.set(packet, getEncoder(packet).encode(packet, buffer));
+    }
+
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        if (contentType == null) {
+            throw new UnsupportedMediaException();
+        }
+
+        /**
+         * Reset the encoding state when on the server side for each
+         * decode/encode step.
+         */
+        if (packet.contentNegotiation == null)
+            useFastInfosetForEncoding = false;
+
+        if(isMultipartRelated(contentType))
+            // parse the multipart portion and then decide whether it's MTOM or SwA
+            super.decode(in, contentType, packet);
+        else if(isFastInfoset(contentType)) {
+            if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none)
+                throw noFastInfosetForDecoding();
+
+            useFastInfosetForEncoding = true;
+            fiSoapCodec.decode(in, contentType, packet);
+        } else
+            xmlSoapCodec.decode(in, contentType, packet);
+
+        if (!useFastInfosetForEncoding) {
+            useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+        }
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet packet) {
+        if (contentType == null) {
+            throw new UnsupportedMediaException();
+        }
+        /**
+         * Reset the encoding state when on the server side for each
+         * decode/encode step.
+         */
+        if (packet.contentNegotiation == null)
+            useFastInfosetForEncoding = false;
+
+        if(isMultipartRelated(contentType))
+            super.decode(in, contentType, packet);
+        else if(isFastInfoset(contentType)) {
+            if (packet.contentNegotiation == ContentNegotiation.none)
+                throw noFastInfosetForDecoding();
+
+            useFastInfosetForEncoding = true;
+            fiSoapCodec.decode(in, contentType, packet);
+        } else
+            xmlSoapCodec.decode(in, contentType, packet);
+
+//        checkDuplicateKnownHeaders(packet);
+        if (!useFastInfosetForEncoding) {
+            useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+        }
+    }
+
+    public SOAPBindingCodec copy() {
+        return new SOAPBindingCodec(binding, (StreamSOAPCodec)xmlSoapCodec.copy());
+    }
+
+    @Override
+    protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+        // is this SwA or XOP?
+        final String rootContentType = mpp.getRootPart().getContentType();
+
+        if(isApplicationXopXml(rootContentType))
+            xmlMtomCodec.decode(mpp,packet);
+        else if (isFastInfoset(rootContentType)) {
+            if (packet.contentNegotiation == ContentNegotiation.none)
+                throw noFastInfosetForDecoding();
+
+            useFastInfosetForEncoding = true;
+            fiSwaCodec.decode(mpp,packet);
+        } else if (isXml(rootContentType))
+            xmlSwaCodec.decode(mpp,packet);
+        else {
+            // TODO localize exception
+            throw new IOException("");
+        }
+//        checkDuplicateKnownHeaders(packet);
+    }
+
+    private boolean isMultipartRelated(String contentType) {
+        return compareStrings(contentType, MimeCodec.MULTIPART_RELATED_MIME_TYPE);
+    }
+
+    private boolean isApplicationXopXml(String contentType) {
+        return compareStrings(contentType, MtomCodec.XOP_XML_MIME_TYPE);
+    }
+
+    private boolean isXml(String contentType) {
+        return compareStrings(contentType, xmlMimeType);
+    }
+
+    private boolean isFastInfoset(String contentType) {
+        if (isFastInfosetDisabled) return false;
+
+        return compareStrings(contentType, fiMimeType);
+    }
+
+    private boolean compareStrings(String a, String b) {
+        return a.length() >= b.length() &&
+                b.equalsIgnoreCase(
+                a.substring(0,
+                b.length()));
+    }
+
+    private boolean isFastInfosetAcceptable(String accept) {
+        if (accept == null || isFastInfosetDisabled) return false;
+
+        StringTokenizer st = new StringTokenizer(accept, ",");
+        while (st.hasMoreTokens()) {
+            final String token = st.nextToken().trim();
+            if (token.equalsIgnoreCase(fiMimeType)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Determines the encoding codec.
+     */
+    private Codec getEncoder(Packet p) {
+        /**
+         * The following logic is only for outbound packets
+         * to be encoded by a client.
+         * For a server the p.contentNegotiation == null.
+         */
+        if (!ignoreContentNegotiationProperty) {
+            if (p.contentNegotiation == ContentNegotiation.none) {
+                // The client may have changed the negotiation property from
+                // pessismistic to none between invocations
+                useFastInfosetForEncoding = false;
+            } else if (p.contentNegotiation == ContentNegotiation.optimistic) {
+                // Always encode using Fast Infoset if in optimisitic mode
+                useFastInfosetForEncoding = true;
+            }
+        }
+
+        // Override the MTOM binding for now
+        // Note: Using FI with MTOM does not make sense
+        if (useFastInfosetForEncoding) {
+            final Message m = p.getMessage();
+            if(m==null || m.getAttachments().isEmpty() || binding.isFeatureEnabled(MTOMFeature.class))
+                return fiSoapCodec;
+            else
+                return fiSwaCodec;
+        }
+
+        if(binding.isFeatureEnabled(MTOMFeature.class))
+            return xmlMtomCodec;
+
+        Message m = p.getMessage();
+        if(m==null || m.getAttachments().isEmpty())
+            return xmlSoapCodec;
+        else
+            return xmlSwaCodec;
+    }
+
+    private RuntimeException noFastInfosetForDecoding() {
+        return new RuntimeException(StreamingMessages.FASTINFOSET_DECODING_NOT_ACCEPTED());
+    }
+
+    /**
+     * Obtain an FI SOAP codec instance using reflection.
+     */
+    private static Codec getFICodec(StreamSOAPCodec soapCodec, SOAPVersion version) {
+        try {
+            Class c = Class.forName("com.sun.xml.internal.ws.encoding.fastinfoset.FastInfosetStreamSOAPCodec");
+            Method m = c.getMethod("create", StreamSOAPCodec.class, SOAPVersion.class);
+            return (Codec)m.invoke(null, soapCodec, version);
+        } catch (Exception e) {
+            // TODO Log that FI cannot be loaded
+            return null;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java
new file mode 100644
index 0000000..3d24ee2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.ws.message.stream.StreamHeader11;
+
+import javax.xml.stream.XMLStreamReader;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * {@link StreamSOAPCodec} for SOAP 1.1.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final class StreamSOAP11Codec extends StreamSOAPCodec {
+    public static final String SOAP11_MIME_TYPE = "text/xml";
+    public static final String SOAP11_CONTENT_TYPE = SOAP11_MIME_TYPE+"; charset=utf-8";
+
+    private static final List<String> expectedContentTypes = Collections.singletonList(SOAP11_MIME_TYPE);
+
+    /*package*/  StreamSOAP11Codec() {
+        super(SOAPVersion.SOAP_11);
+    }
+
+    public String getMimeType() {
+        return SOAP11_MIME_TYPE;
+    }
+
+    @Override
+    protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+        return new StreamHeader11(reader, mark);
+    }
+
+    public static final ContentTypeImpl defaultContentType =
+            new ContentTypeImpl(SOAP11_CONTENT_TYPE, "");
+
+    @Override
+    protected ContentType getContentType(String soapAction) {
+        return new ContentTypeImpl(SOAP11_CONTENT_TYPE, soapAction);
+    }
+
+    protected List<String> getExpectedContentTypes() {
+        return expectedContentTypes;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java
new file mode 100644
index 0000000..4c69ca0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.ws.message.stream.StreamHeader12;
+
+import javax.xml.stream.XMLStreamReader;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * {@link StreamSOAPCodec} for SOAP 1.2.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final class StreamSOAP12Codec extends StreamSOAPCodec {
+    public static final String SOAP12_MIME_TYPE = "application/soap+xml";
+    public static final String SOAP12_CONTENT_TYPE = SOAP12_MIME_TYPE+"; charset=utf-8";
+
+    private static final List<String> expectedContentTypes = Collections.singletonList(SOAP12_MIME_TYPE);
+
+    /*package*/ StreamSOAP12Codec() {
+        super(SOAPVersion.SOAP_12);
+    }
+
+    public String getMimeType() {
+        return SOAP12_MIME_TYPE;
+    }
+
+    @Override
+    protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+        return new StreamHeader12(reader, mark);
+    }
+
+    public static final ContentTypeImpl defaultContentType =
+            new ContentTypeImpl(SOAP12_CONTENT_TYPE);
+
+    @Override
+    protected ContentType getContentType(String soapAction) {
+        // TODO: set accept header
+        if (soapAction == null) {
+            return defaultContentType;
+        } else {
+            return new ContentTypeImpl(SOAP12_CONTENT_TYPE + ";action=\""+soapAction+"\"");
+        }
+    }
+
+    protected List<String> getExpectedContentTypes() {
+        return expectedContentTypes;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java
new file mode 100644
index 0000000..9c297de
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java
@@ -0,0 +1,304 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferMark;
+import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferCreator;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.ws.message.stream.StreamMessage;
+import com.sun.xml.internal.ws.protocol.soap.VersionMismatchException;
+import com.sun.xml.internal.ws.server.UnsupportedMediaException;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A stream SOAP codec.
+ *
+ * @author Paul Sandoz
+ */
+@SuppressWarnings({"StringEquality"})
+public abstract class StreamSOAPCodec implements com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec {
+
+    private static final String SOAP_ENVELOPE = "Envelope";
+    private static final String SOAP_HEADER = "Header";
+    private static final String SOAP_BODY = "Body";
+
+    private final String SOAP_NAMESPACE_URI;
+    private final SOAPVersion soapVersion;
+
+    /*package*/ StreamSOAPCodec(SOAPVersion soapVersion) {
+        SOAP_NAMESPACE_URI = soapVersion.nsUri;
+        this.soapVersion = soapVersion;
+    }
+
+    // consider caching
+    // private final XMLStreamReader reader;
+
+    // consider caching
+    // private final MutableXMLStreamBuffer buffer;
+
+    public ContentType getStaticContentType(Packet packet) {
+        return getContentType(packet.soapAction);
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) {
+        if (packet.getMessage() != null) {
+            XMLStreamWriter writer = XMLStreamWriterFactory.create(out);
+            try {
+                packet.getMessage().writeTo(writer);
+                writer.flush();
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+            XMLStreamWriterFactory.recycle(writer);
+        }
+        return getContentType(packet.soapAction);
+    }
+
+    protected abstract ContentType getContentType(String soapAction);
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        //TODO: not yet implemented
+        throw new UnsupportedOperationException();
+    }
+
+    protected abstract List<String> getExpectedContentTypes();
+
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        List<String> expectedContentTypes = getExpectedContentTypes();
+        if (contentType != null && !isContentTypeSupported(contentType,expectedContentTypes)) {
+            throw new UnsupportedMediaException(contentType, expectedContentTypes);
+        }
+        // TODO: we should definitely let Decode owns one XMLStreamReader instance
+        // instead of going to this generic factory
+        XMLStreamReader reader = new TidyXMLStreamReader(XMLStreamReaderFactory.create(null, in, true), in);
+        packet.setMessage(decode(reader));
+    }
+
+    /*
+     * Checks against expected Content-Type headers that is handled by a codec
+     *
+     * @param ct the Content-Type of the request
+     * @param expected expected Content-Types for a codec
+     * @return true if the codec supports this Content-Type
+     *         false otherwise
+     */
+    private static boolean isContentTypeSupported(String ct, List<String> expected) {
+        for(String contentType : expected) {
+            if (ct.indexOf(contentType) != -1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Decodes a message from {@link XMLStreamReader} that points to
+     * the beginning of a SOAP infoset.
+     *
+     * @param reader
+     *      can point to the start document or the start element.
+     */
+    public final @NotNull Message decode(@NotNull XMLStreamReader reader) {
+        return decode(reader,new AttachmentSetImpl());
+    }
+
+    /**
+     * Decodes a message from {@link XMLStreamReader} that points to
+     * the beginning of a SOAP infoset.
+     *
+     * @param reader
+     *      can point to the start document or the start element.
+     * @param attachmentSet
+     *      {@link StreamSOAPCodec} can take attachments parsed outside,
+     *      so that this codec can be used as a part of a biggre codec
+     *      (like MIME multipart codec.)
+     */
+    public final Message decode(XMLStreamReader reader, @NotNull AttachmentSet attachmentSet) {
+
+        // Move to soap:Envelope and verify
+        if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT)
+            XMLStreamReaderUtil.nextElementContent(reader);
+        XMLStreamReaderUtil.verifyReaderState(reader,XMLStreamConstants.START_ELEMENT);
+        if (SOAP_ENVELOPE.equals(reader.getLocalName()) && !SOAP_NAMESPACE_URI.equals(reader.getNamespaceURI())) {
+            throw new VersionMismatchException(soapVersion, SOAP_NAMESPACE_URI, reader.getNamespaceURI());
+        }
+        XMLStreamReaderUtil.verifyTag(reader, SOAP_NAMESPACE_URI, SOAP_ENVELOPE);
+
+        TagInfoset envelopeTag = new TagInfoset(reader);
+
+        // Collect namespaces on soap:Envelope
+        Map<String,String> namespaces = new HashMap<String,String>();
+
+        // Move to next element
+        XMLStreamReaderUtil.nextElementContent(reader);
+        XMLStreamReaderUtil.verifyReaderState(reader,
+                javax.xml.stream.XMLStreamConstants.START_ELEMENT);
+
+        HeaderList headers = null;
+        TagInfoset headerTag = null;
+
+        if (reader.getLocalName().equals(SOAP_HEADER)
+                && reader.getNamespaceURI().equals(SOAP_NAMESPACE_URI)) {
+            headerTag = new TagInfoset(reader);
+
+            // Collect namespaces on soap:Header
+            for(int i=0; i< reader.getNamespaceCount();i++){
+                namespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+            }
+            // skip <soap:Header>
+            XMLStreamReaderUtil.nextElementContent(reader);
+
+            // If SOAP header blocks are present (i.e. not <soap:Header/>)
+            if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
+                headers = new HeaderList();
+
+                try {
+                    // Cache SOAP header blocks
+                    cacheHeaders(reader, namespaces, headers);
+                } catch (XMLStreamException e) {
+                    // TODO need to throw more meaningful exception
+                    throw new WebServiceException(e);
+                }
+            }
+
+            // Move to soap:Body
+            XMLStreamReaderUtil.nextElementContent(reader);
+        }
+
+        // Verify that <soap:Body> is present
+        XMLStreamReaderUtil.verifyTag(reader, SOAP_NAMESPACE_URI, SOAP_BODY);
+        TagInfoset bodyTag = new TagInfoset(reader);
+
+        XMLStreamReaderUtil.nextElementContent(reader);
+        return new StreamMessage(envelopeTag,headerTag,attachmentSet,headers,bodyTag,reader,soapVersion);
+        // when there's no payload,
+        // it's tempting to use EmptyMessageImpl, but it doesn't presere the infoset
+        // of <envelope>,<header>, and <body>, so we need to stick to StreamMessage.
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet packet ) {
+        throw new UnsupportedOperationException();
+    }
+
+    public final StreamSOAPCodec copy() {
+        return this;
+    }
+
+    private XMLStreamBuffer cacheHeaders(XMLStreamReader reader,
+            Map<String, String> namespaces, HeaderList headers) throws XMLStreamException {
+        MutableXMLStreamBuffer buffer = createXMLStreamBuffer();
+        StreamReaderBufferCreator creator = new StreamReaderBufferCreator();
+        creator.setXMLStreamBuffer(buffer);
+
+        // Reader is positioned at the first header block
+        while(reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT) {
+            Map<String,String> headerBlockNamespaces = namespaces;
+
+            // Collect namespaces on SOAP header block
+            if (reader.getNamespaceCount() > 0) {
+                headerBlockNamespaces = new HashMap<String,String>(namespaces);
+                for (int i = 0; i < reader.getNamespaceCount(); i++) {
+                    headerBlockNamespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+                }
+            }
+
+            // Mark
+            XMLStreamBuffer mark = new XMLStreamBufferMark(headerBlockNamespaces, creator);
+            // Create Header
+            headers.add(createHeader(reader, mark));
+
+
+            // Cache the header block
+            // After caching Reader will be positioned at next header block or
+            // the end of the </soap:header>
+            creator.createElementFragment(reader, false);
+            if (reader.getEventType() != XMLStreamConstants.START_ELEMENT &&
+                    reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
+                XMLStreamReaderUtil.nextElementContent(reader);
+            }
+        }
+
+        return buffer;
+    }
+
+    protected abstract StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark);
+
+    private MutableXMLStreamBuffer createXMLStreamBuffer() {
+        // TODO: Decode should own one MutableXMLStreamBuffer for reuse
+        // since it is more efficient. ISSUE: possible issue with
+        // lifetime of information in the buffer if accessed beyond
+        // the pipe line.
+        return new MutableXMLStreamBuffer();
+    }
+
+
+
+
+    /**
+     * Creates a new {@link StreamSOAPCodec} instance.
+     */
+    public static StreamSOAPCodec create(SOAPVersion version) {
+        if(version==null)
+            // this decoder is for SOAP, not for XML/HTTP
+            throw new IllegalArgumentException();
+        switch(version) {
+            case SOAP_11:
+                return new StreamSOAP11Codec();
+            case SOAP_12:
+                return new StreamSOAP12Codec();
+            default:
+                throw new AssertionError();
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SwACodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SwACodec.java
new file mode 100644
index 0000000..e5c8059
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SwACodec.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+
+import java.io.IOException;
+import java.nio.channels.WritableByteChannel;
+import java.util.Map;
+
+/**
+ * {@link Codec} that uses MIME/multipart as the base format.
+ *
+ * @author Jitendra Kotamraju
+ */
+public final class SwACodec extends MimeCodec {
+
+    public SwACodec(SOAPVersion version, Codec rootCodec) {
+        super(version);
+        this.rootCodec = rootCodec;
+    }
+
+    private SwACodec(SwACodec that) {
+        super(that);
+        this.rootCodec = that.rootCodec.copy();
+    }
+
+    @Override
+    protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+        // TODO: handle attachments correctly
+        StreamAttachment root = mpp.getRootPart();
+        rootCodec.decode(root.asInputStream(),root.getContentType(),packet);
+        Map<String, StreamAttachment> atts = mpp.getAttachmentParts();
+        for(Map.Entry<String, StreamAttachment> att : atts.entrySet()) {
+            packet.getMessage().getAttachments().add(att.getValue());
+        }
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        //TODO: not yet implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public SwACodec copy() {
+        return new SwACodec(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/TagInfoset.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/TagInfoset.java
new file mode 100644
index 0000000..a6d07fa
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/TagInfoset.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamException;
+
+import com.sun.xml.internal.ws.message.stream.StreamMessage;
+import com.sun.xml.internal.ws.encoding.StreamSOAPCodec;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+
+/**
+ * Complete infoset about a start tag.
+ *
+ * <p>
+ * This is used between {@link StreamMessage} and {@link StreamSOAPCodec}
+ * to capture the infoset of the s:Envelope, s:Header, and s:Body elements.
+ *
+ *
+ * <h3>Design Note</h3>
+ * <p>
+ * Since StAX and SAX uses different null vs empty string convention, one has
+ * to choose which format we store things. It can go either way, but I'm assuming
+ * that we'll be using StAX more in JAX-WS, so things are kept in the StAX style
+ * in this class.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class TagInfoset {
+    /**
+     * Namespace declarations on this tag. Read-only.
+     *
+     * URIs/prefixes can be null (StAX-style)
+     */
+    public final @NotNull String[] ns;
+    /**
+     * Attributes on this tag. Read-only.
+     */
+    public final @NotNull AttributesImpl atts;
+
+    /**
+     * Prefix of the start tag in stax-style.
+     */
+    public final @Nullable String prefix;
+
+    /**
+     * Namespace URI of the start tag in stax-style.
+     */
+    public final @Nullable String nsUri;
+
+    /**
+     * Local name of the start tag.
+     */
+    public final @NotNull String localName;
+
+    /**
+     * Lazily computed QName (i.e., "foo:bar")
+     */
+    private @Nullable String qname;
+
+    public TagInfoset(String nsUri, String localName, String prefix, AttributesImpl atts, String... ns) {
+        this.nsUri = nsUri;
+        this.prefix = prefix;
+        this.localName = localName;
+        this.atts = atts;
+        this.ns = ns;
+    }
+
+    /**
+     * Fills a {@link TagInfoset} object by the current element
+     * that the reader points to.
+     */
+    public TagInfoset(XMLStreamReader reader) {
+        prefix = reader.getPrefix();
+        nsUri = reader.getNamespaceURI();
+        localName = reader.getLocalName();
+
+        int nsc = reader.getNamespaceCount();
+        if(nsc>0) {
+            ns = new String[nsc*2];
+            for(int i=0; i<nsc; i++){
+                ns[i*2  ] = fixNull(reader.getNamespacePrefix(i));
+                ns[i*2+1] = fixNull(reader.getNamespaceURI(i));
+            }
+        } else {
+            ns = EMPTY_ARRAY;
+        }
+
+        int ac = reader.getAttributeCount();
+        if(ac>0) {
+            atts = new AttributesImpl();
+            StringBuilder sb = new StringBuilder();
+            for(int i=0; i< ac;i++){
+                sb.setLength(0);
+                String prefix = reader.getAttributePrefix(i);
+                String localName = reader.getAttributeLocalName(i);
+
+                String qname;
+                if(prefix != null && prefix.length()!=0){
+                    sb.append(prefix);
+                    sb.append(":");
+                    sb.append(localName);
+                    qname = sb.toString();
+                } else {
+                    qname = localName;
+                }
+
+                atts.addAttribute(
+                    fixNull(reader.getAttributeNamespace(i)),
+                    localName,
+                    qname,
+                    reader.getAttributeType(i),
+                    reader.getAttributeValue(i));
+            }
+        } else {
+            atts = EMPTY_ATTRIBUTES;
+        }
+    }
+
+    /**
+     * Writes the start element event.
+     */
+    public void writeStart(ContentHandler contentHandler) throws SAXException {
+        for( int i=0; i<ns.length; i+=2 )
+            contentHandler.startPrefixMapping(fixNull(ns[i]),fixNull(ns[i+1]));
+        contentHandler.startElement(fixNull(nsUri), localName ,getQName(), atts);
+    }
+
+    /**
+     * Writes the end element event.
+     */
+    public void writeEnd(ContentHandler contentHandler) throws SAXException{
+        contentHandler.endElement(fixNull(nsUri),localName,getQName());
+        for( int i=ns.length-2; i>=0; i-=2 ) {
+            contentHandler.endPrefixMapping(fixNull(ns[i]));
+        }
+    }
+
+    /**
+     * Writes the start element event.
+     */
+    public void writeStart(XMLStreamWriter w) throws XMLStreamException {
+        // write start tag. Arrrgggghhh!!
+        if(prefix==null) {
+            if(nsUri==null)
+                w.writeStartElement(localName);
+            else
+                w.writeStartElement(nsUri,localName);
+        } else {
+            w.writeStartElement(prefix,localName,nsUri);
+        }
+
+        for( int i=0; i<ns.length; i+=2 ) {
+            w.writeNamespace(ns[i],ns[i+1]);
+        }
+
+        for( int i=0; i<atts.getLength(); i++ ) {
+            String nsUri = atts.getURI(i);
+            if(nsUri==null || nsUri.length() ==0) {
+                w.writeAttribute(atts.getLocalName(i),atts.getValue(i));
+            } else {
+                String rawName = atts.getQName(i);
+                String prefix = rawName.substring(0,rawName.indexOf(':'));
+                w.writeAttribute(prefix,nsUri,atts.getLocalName(i),atts.getValue(i));
+            }
+        }
+    }
+
+    private String getQName() {
+        if(qname!=null) return qname;
+
+        StringBuilder sb = new StringBuilder();
+        if(prefix!=null){
+            sb.append(prefix);
+            sb.append(':');
+            sb.append(localName);
+            qname = sb.toString();
+        } else {
+            qname = localName;
+        }
+        return qname;
+    }
+    private static String fixNull(String s) {
+        if(s==null) return "";
+        else        return s;
+    }
+
+    private static final String[] EMPTY_ARRAY = new String[0];
+    private static final AttributesImpl EMPTY_ATTRIBUTES = new AttributesImpl();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java
new file mode 100644
index 0000000..59c51bd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java
@@ -0,0 +1,363 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding;
+
+import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.client.ContentNegotiation;
+import com.sun.xml.internal.ws.encoding.xml.XMLCodec;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage.MessageDataSource;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage.UnknownContent;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage.XMLMultiPart;
+import com.sun.xml.internal.ws.resources.StreamingMessages;
+
+import javax.activation.DataSource;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.nio.channels.WritableByteChannel;
+import java.util.StringTokenizer;
+
+/**
+ * XML (infoset) over HTTP binding {@link Codec}.
+ * <p>
+ * TODO: Support FI for multipart/related
+ *       Support FI for MessageDataSource
+ *
+ * @author Jitendra Kotamraju
+ */
+public final class XMLHTTPBindingCodec extends MimeCodec {
+    /**
+     * Base HTTP Accept request-header.
+     */
+    private static final String BASE_ACCEPT_VALUE =
+        "*";
+
+    /**
+     * Fast Infoset MIME type.
+     */
+    private static final String APPLICATION_FAST_INFOSET_MIME_TYPE =
+        "application/fastinfoset";
+
+    /**
+     * True if the Fast Infoset codec should be used
+     */
+    private boolean useFastInfosetForEncoding;
+
+    /**
+     * The XML codec
+     */
+    private final Codec xmlCodec;
+
+    /**
+     * The FI codec
+     */
+    private final Codec fiCodec;
+
+    /**
+     * The Accept header for XML encodings
+     */
+    private final String xmlAccept;
+
+    /**
+     * The Accept header for Fast Infoset and XML encodings
+     */
+    private final String fiXmlAccept;
+
+    private class AcceptContentType implements ContentType {
+        private ContentType _c;
+        private String _accept;
+
+        public AcceptContentType set(Packet p, ContentType c) {
+            // TODO: need to compose based on underlying codecs
+            if (p.contentNegotiation == ContentNegotiation.optimistic
+                    || p.contentNegotiation == ContentNegotiation.pessimistic) {
+                _accept = fiXmlAccept;
+            } else {
+                _accept = xmlAccept;
+            }
+            _c = c;
+            return this;
+        }
+
+        public String getContentType() {
+            return _c.getContentType();
+        }
+
+        public String getSOAPActionHeader() {
+            return _c.getSOAPActionHeader();
+        }
+
+        public String getAcceptHeader() {
+            return _accept;
+        }
+    }
+
+    private AcceptContentType _adaptingContentType = new AcceptContentType();
+
+    public XMLHTTPBindingCodec() {
+        super(SOAPVersion.SOAP_11);
+
+        xmlCodec = new XMLCodec();
+
+        fiCodec = getFICodec();
+
+        xmlAccept = null;
+
+        fiXmlAccept = APPLICATION_FAST_INFOSET_MIME_TYPE + ", " +
+                BASE_ACCEPT_VALUE;
+    }
+
+    public String getMimeType() {
+        return null;
+    }
+
+    @Override
+    public ContentType getStaticContentType(Packet packet) {
+        setRootCodec(packet);
+
+        ContentType ct = null;
+        if (packet.getMessage() instanceof MessageDataSource) {
+            final MessageDataSource mds = (MessageDataSource)packet.getMessage();
+            if (mds.hasUnconsumedDataSource()) {
+                ct = getStaticContentType(mds);
+                return (ct != null)
+                    ? _adaptingContentType.set(packet, ct)
+                    : null;
+            }
+        }
+
+        ct = super.getStaticContentType(packet);
+        return (ct != null)
+            ? _adaptingContentType.set(packet, ct)
+            : null;
+    }
+
+    @Override
+    public ContentType encode(Packet packet, OutputStream out) throws IOException {
+        setRootCodec(packet);
+
+        if (packet.getMessage() instanceof MessageDataSource) {
+            final MessageDataSource mds = (MessageDataSource)packet.getMessage();
+            if (mds.hasUnconsumedDataSource())
+                return _adaptingContentType.set(packet, encode(mds, out));
+        }
+
+        return _adaptingContentType.set(packet, super.encode(packet, out));
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        /**
+         * Reset the encoding state when on the server side for each
+         * decode/encode step.
+         */
+        if (packet.contentNegotiation == null)
+            useFastInfosetForEncoding = false;
+
+        if (contentType == null) {
+            xmlCodec.decode(in, contentType, packet);
+        } else if (isMultipartRelated(contentType)) {
+            packet.setMessage(new XMLMultiPart(contentType, in));
+        } else if(isFastInfoset(contentType)) {
+            if (fiCodec == null) {
+                throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
+            }
+
+            useFastInfosetForEncoding = true;
+            fiCodec.decode(in, contentType, packet);
+        } else if (isXml(contentType)) {
+            xmlCodec.decode(in, contentType, packet);
+        } else {
+            packet.setMessage(new UnknownContent(contentType, in));
+        }
+
+        if (!useFastInfosetForEncoding) {
+            useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+        }
+    }
+
+    protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+        // This method will never be invoked
+    }
+
+    public MimeCodec copy() {
+        return new XMLHTTPBindingCodec();
+    }
+
+    private boolean isMultipartRelated(String contentType) {
+        return compareStrings(contentType, MimeCodec.MULTIPART_RELATED_MIME_TYPE);
+    }
+
+    private boolean isApplicationXopXml(String contentType) {
+        return compareStrings(contentType, MtomCodec.XOP_XML_MIME_TYPE);
+    }
+
+    private boolean isXml(String contentType) {
+        return compareStrings(contentType, XMLCodec.XML_APPLICATION_MIME_TYPE)
+                || compareStrings(contentType, XMLCodec.XML_TEXT_MIME_TYPE)
+                || (compareStrings(contentType, "application/")&&(contentType.toLowerCase().indexOf("+xml") != -1));
+    }
+
+    private boolean isFastInfoset(String contentType) {
+        return compareStrings(contentType, APPLICATION_FAST_INFOSET_MIME_TYPE);
+    }
+
+    private boolean compareStrings(String a, String b) {
+        return a.length() >= b.length() &&
+                b.equalsIgnoreCase(
+                    a.substring(0,
+                        b.length()));
+    }
+
+    private boolean isFastInfosetAcceptable(String accept) {
+        if (accept == null) return false;
+
+        StringTokenizer st = new StringTokenizer(accept, ",");
+        while (st.hasMoreTokens()) {
+            final String token = st.nextToken().trim();
+            if (token.equalsIgnoreCase(APPLICATION_FAST_INFOSET_MIME_TYPE)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private ContentType getStaticContentType(MessageDataSource mds) {
+        final String contentType = mds.getDataSource().getContentType();
+        final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);
+
+        if (!requiresTransformationOfDataSource(isFastInfoset,
+                useFastInfosetForEncoding)) {
+            return new ContentTypeImpl(contentType);
+        } else {
+            return null;
+        }
+    }
+
+    private ContentType encode(MessageDataSource mds, OutputStream out) {
+        try {
+            final boolean isFastInfoset = XMLMessage.isFastInfoset(
+                    mds.getDataSource().getContentType());
+            DataSource ds = transformDataSource(mds.getDataSource(),
+                    isFastInfoset, useFastInfosetForEncoding);
+
+            InputStream is = ds.getInputStream();
+            byte[] buf = new byte[1024];
+            int count;
+            while((count=is.read(buf)) != -1) {
+                out.write(buf, 0, count);
+            }
+            return new ContentTypeImpl(ds.getContentType());
+        } catch(IOException ioe) {
+            throw new WebServiceException(ioe);
+        }
+    }
+
+    private void setRootCodec(Packet p) {
+        /**
+         * The following logic is only for outbound packets
+         * to be encoded by client.
+         * On the server the p.contentNegotiation == null.
+         */
+        if (p.contentNegotiation == ContentNegotiation.none) {
+            // The client may have changed the negotiation property from
+            // pessismistic to none between invocations
+            useFastInfosetForEncoding = false;
+        } else if (p.contentNegotiation == ContentNegotiation.optimistic) {
+            // Always encode using Fast Infoset if in optimisitic mode
+            useFastInfosetForEncoding = true;
+        }
+
+        rootCodec = (useFastInfosetForEncoding && fiCodec != null)
+            ? fiCodec : xmlCodec;
+    }
+
+    public static boolean requiresTransformationOfDataSource(
+            boolean isFastInfoset, boolean useFastInfoset) {
+        return (isFastInfoset && !useFastInfoset) || (!isFastInfoset && useFastInfoset);
+    }
+
+    public static DataSource transformDataSource(DataSource in,
+            boolean isFastInfoset, boolean useFastInfoset) {
+        try {
+            if (isFastInfoset && !useFastInfoset) {
+                // Convert from Fast Infoset to XML
+                Codec codec = new XMLHTTPBindingCodec();
+                Packet p = new Packet();
+                codec.decode(in.getInputStream(), in.getContentType(), p);
+
+                p.getMessage().getAttachments();
+                codec.getStaticContentType(p);
+
+                ByteOutputStream bos = new ByteOutputStream();
+                ContentType ct = codec.encode(p, bos);
+                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
+            } else if (!isFastInfoset && useFastInfoset) {
+                // Convert from XML to Fast Infoset
+                Codec codec = new XMLHTTPBindingCodec();
+                Packet p = new Packet();
+                codec.decode(in.getInputStream(), in.getContentType(), p);
+
+                p.contentNegotiation = ContentNegotiation.optimistic;
+                p.getMessage().getAttachments();
+                codec.getStaticContentType(p);
+
+                ByteOutputStream bos = new ByteOutputStream();
+                com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.encode(p, bos);
+                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
+            }
+        } catch(Exception ex) {
+            throw new WebServiceException(ex);
+        }
+
+        return in;
+    }
+
+    /**
+     * Obtain an FI SOAP codec instance using reflection.
+     */
+    private static Codec getFICodec() {
+        try {
+            Class c = Class.forName("com.sun.xml.internal.ws.encoding.fastinfoset.FastInfosetCodec");
+            Method m = c.getMethod("create");
+            return (Codec)m.invoke(null);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java
new file mode 100644
index 0000000..aac4518
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer;
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
+import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary;
+import com.sun.xml.internal.fastinfoset.vocab.SerializerVocabulary;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+import java.io.BufferedInputStream;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.nio.channels.WritableByteChannel;
+import java.nio.channels.ReadableByteChannel;
+import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource;
+import com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader;
+
+/**
+ * A codec for encoding/decoding XML infosets to/from fast
+ * infoset documents.
+ *
+ * @author Paul Sandoz
+ */
+public class FastInfosetCodec implements Codec {
+    private static final int DEFAULT_INDEXED_STRING_SIZE_LIMIT = 32;
+    private static final int DEFAULT_INDEXED_STRING_MEMORY_LIMIT = 4 * 1024 * 1024; //4M limit
+
+    private StAXDocumentParser _parser;
+
+    private StAXDocumentSerializer _serializer;
+
+    private final boolean _retainState;
+
+    private final ContentType _contentType;
+
+    /* package */ FastInfosetCodec(boolean retainState) {
+        _retainState = retainState;
+        _contentType = (retainState) ? new ContentTypeImpl(FastInfosetMIMETypes.STATEFUL_INFOSET) :
+            new ContentTypeImpl(FastInfosetMIMETypes.INFOSET);
+    }
+
+    public String getMimeType() {
+        return _contentType.getContentType();
+    }
+
+    public Codec copy() {
+        return new FastInfosetCodec(_retainState);
+    }
+
+    public ContentType getStaticContentType(Packet packet) {
+        return _contentType;
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) {
+        Message message = packet.getMessage();
+        if (message != null && message.hasPayload()) {
+            final XMLStreamWriter writer = getXMLStreamWriter(out);
+            try {
+                writer.writeStartDocument();
+                packet.getMessage().writePayloadTo(writer);
+                writer.writeEndDocument();
+                writer.flush();
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        return _contentType;
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        //TODO: not yet implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        /* Implements similar logic as the XMLMessage.create(String, InputStream).
+         * But it's faster, as we know the InputStream has FastInfoset content*/
+        Message message = null;
+        in = hasSomeData(in);
+        if (in != null) {
+            message = Messages.createUsingPayload(new FastInfosetSource(in),
+                    SOAPVersion.SOAP_11);
+        } else {
+            message = Messages.createEmpty(SOAPVersion.SOAP_11);
+        }
+
+        packet.setMessage(message);
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet response) {
+        throw new UnsupportedOperationException();
+    }
+
+    private XMLStreamWriter getXMLStreamWriter(OutputStream out) {
+        if (_serializer != null) {
+            _serializer.setOutputStream(out);
+            return _serializer;
+        } else {
+            return _serializer = createNewStreamWriter(out, _retainState);
+        }
+    }
+
+    private XMLStreamReader getXMLStreamReader(InputStream in) {
+        if (_parser != null) {
+            _parser.setInputStream(in);
+            return _parser;
+        } else {
+            return _parser = createNewStreamReader(in, _retainState);
+        }
+    }
+
+    /**
+     * Creates a new {@link FastInfosetCodec} instance.
+     *
+     * @return a new {@link FastInfosetCodec} instance.
+     */
+    public static FastInfosetCodec create() {
+        return create(false);
+    }
+
+    /**
+     * Creates a new {@link FastInfosetCodec} instance.
+     *
+     * @param retainState if true the Codec should retain the state of
+     *        vocabulary tables for multiple encode/decode invocations.
+     * @return a new {@link FastInfosetCodec} instance.
+     */
+    public static FastInfosetCodec create(boolean retainState) {
+        return new FastInfosetCodec(retainState);
+    }
+
+    /**
+     * Create a new (@link StAXDocumentSerializer} instance.
+     *
+     * @param in the OutputStream to serialize to.
+     * @param retainState if true the serializer should retain the state of
+     *        vocabulary tables for multiple serializations.
+     * @return a new {@link StAXDocumentSerializer} instance.
+     */
+    /* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out, boolean retainState) {
+        return createNewStreamWriter(out, retainState, DEFAULT_INDEXED_STRING_SIZE_LIMIT, DEFAULT_INDEXED_STRING_MEMORY_LIMIT);
+    }
+
+    /**
+     * Create a new (@link StAXDocumentSerializer} instance.
+     *
+     * @param in the OutputStream to serialize to.
+     * @param retainState if true the serializer should retain the state of
+     *        vocabulary tables for multiple serializations.
+     * @return a new {@link StAXDocumentSerializer} instance.
+     */
+    /* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
+            boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
+        StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
+        if (retainState) {
+            /**
+             * Create a serializer vocabulary external to the serializer.
+             * This will ensure that the vocabulary will never be cleared
+             * for each serialization and will be retained (and will grow)
+             * for each serialization
+             */
+            SerializerVocabulary vocabulary = new SerializerVocabulary();
+            serializer.setVocabulary(vocabulary);
+            serializer.setAttributeValueSizeLimit(indexedStringSizeLimit);
+            serializer.setCharacterContentChunkSizeLimit(indexedStringSizeLimit);
+            serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
+            serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
+        }
+        return serializer;
+    }
+
+    /**
+     * Create a new (@link StAXDocumentParser} instance.
+     *
+     * @param in the InputStream to parse from.
+     * @param retainState if true the parser should retain the state of
+     *        vocabulary tables for multiple parses.
+     * @return a new {@link StAXDocumentParser} instance.
+     */
+    /* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
+        StAXDocumentParser parser = new StAXDocumentParser(in);
+        parser.setStringInterning(true);
+        if (retainState) {
+            /**
+             * Create a parser vocabulary external to the parser.
+             * This will ensure that the vocabulary will never be cleared
+             * for each parse and will be retained (and will grow)
+             * for each parse.
+             */
+            ParserVocabulary vocabulary = new ParserVocabulary();
+            parser.setVocabulary(vocabulary);
+        }
+        return parser;
+    }
+
+    /**
+     * Create a new (@link StAXDocumentParser} recyclable instance.
+     *
+     * @param in the InputStream to parse from.
+     * @param retainState if true the parser should retain the state of
+     *        vocabulary tables for multiple parses.
+     * @return a new recyclable {@link StAXDocumentParser} instance.
+     */
+    /* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
+        StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
+        parser.setStringInterning(true);
+        parser.setForceStreamClose(true);
+        if (retainState) {
+            /**
+             * Create a parser vocabulary external to the parser.
+             * This will ensure that the vocabulary will never be cleared
+             * for each parse and will be retained (and will grow)
+             * for each parse.
+             */
+            ParserVocabulary vocabulary = new ParserVocabulary();
+            parser.setVocabulary(vocabulary);
+        }
+        return parser;
+    }
+
+    /**
+     * Method is copied from com.sun.xml.internal.ws.encoding.xml.XMLMessage
+     * @TODO method should be public in some util package?
+     *
+     * Finds if the stream has some content or not
+     *
+     * @return null if there is no data
+     *         else stream to be used
+     */
+    private static InputStream hasSomeData(InputStream in) throws IOException {
+        if (in != null) {
+            if (in.available() < 1) {
+                if (!in.markSupported()) {
+                    in = new BufferedInputStream(in);
+                }
+                in.mark(1);
+                if (in.read() != -1) {
+                    in.reset();
+                } else {
+                    in = null;          // No data
+                }
+            }
+        }
+        return in;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java
new file mode 100644
index 0000000..352a945
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+/**
+ * MIME types for Infosets encoded as fast infoset documents.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+public final class FastInfosetMIMETypes {
+    /**
+     * MIME type for a generic Infoset encoded as a fast infoset document.
+     */
+    static public final String INFOSET = "application/fastinfoset";
+    /**
+     * MIME type for a SOAP 1.1 Infoset encoded as a fast infoset document.
+     */
+    static public final String SOAP_11 = "application/fastinfoset";
+    /**
+     * MIME type for a SOAP 1.2 Infoset encoded as a fast infoset document.
+     */
+    static public final String SOAP_12 = "application/soap+fastinfoset";
+
+    /**
+     * MIME type for a generic Infoset encoded as a stateful fast infoset document.
+     */
+    static public final String STATEFUL_INFOSET = "application/vnd.sun.stateful.fastinfoset";
+    /**
+     * MIME type for a SOAP 1.1 Infoset encoded as a stateful fast infoset document.
+     */
+    static public final String STATEFUL_SOAP_11 = "application/vnd.sun.stateful.fastinfoset";
+    /**
+     * MIME type for a SOAP 1.2 Infoset encoded as a stateful fast infoset document.
+     */
+    static public final String STATEFUL_SOAP_12 = "application/vnd.sun.stateful.soap+fastinfoset";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java
new file mode 100644
index 0000000..2651af6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import java.io.InputStream;
+import java.io.Reader;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Alexey Stashok
+ */
+public final class FastInfosetStreamReaderFactory extends XMLStreamReaderFactory {
+    private static final FastInfosetStreamReaderFactory factory = new FastInfosetStreamReaderFactory();
+
+    private ThreadLocal<StAXDocumentParser> pool = new ThreadLocal<StAXDocumentParser>();
+
+    public static FastInfosetStreamReaderFactory getInstance() {
+        return factory;
+    }
+
+    public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+        StAXDocumentParser parser = fetch();
+        if (parser == null) {
+            return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
+        }
+
+        parser.setInputStream(in);
+        return parser;
+    }
+
+    public XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs) {
+        throw new UnsupportedOperationException();
+    }
+
+    private StAXDocumentParser fetch() {
+        StAXDocumentParser parser = pool.get();
+        pool.set(null);
+        return parser;
+    }
+
+    public void doRecycle(XMLStreamReader r) {
+        if (r instanceof StAXDocumentParser) {
+            pool.set((StAXDocumentParser) r);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java
new file mode 100644
index 0000000..c95607b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import java.io.InputStream;
+
+/**
+ * @author Alexey Stashok
+ */
+public final class FastInfosetStreamReaderRecyclable extends StAXDocumentParser implements XMLStreamReaderFactory.RecycleAware {
+    private static final FastInfosetStreamReaderFactory READER_FACTORY = FastInfosetStreamReaderFactory.getInstance();
+
+    public FastInfosetStreamReaderRecyclable() {
+        super();
+    }
+
+    public FastInfosetStreamReaderRecyclable(InputStream in) {
+        super(in);
+    }
+
+    public void onRecycled() {
+        READER_FACTORY.doRecycle(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java
new file mode 100644
index 0000000..8b02038
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.ws.message.stream.StreamHeader11;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * A codec that converts SOAP 1.1 messages infosets to fast infoset
+ * documents.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final class FastInfosetStreamSOAP11Codec extends FastInfosetStreamSOAPCodec {
+    /*package*/ FastInfosetStreamSOAP11Codec(StreamSOAPCodec soapCodec, boolean retainState) {
+        super(soapCodec, SOAPVersion.SOAP_11, retainState,
+                (retainState) ? FastInfosetMIMETypes.STATEFUL_SOAP_11 : FastInfosetMIMETypes.SOAP_11);
+    }
+
+    private FastInfosetStreamSOAP11Codec(FastInfosetStreamSOAP11Codec that) {
+        super(that);
+    }
+
+    public Codec copy() {
+        return new FastInfosetStreamSOAP11Codec(this);
+    }
+
+    protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+        return new StreamHeader11(reader, mark);
+    }
+
+    protected ContentType getContentType(String soapAction) {
+        if (soapAction == null || soapAction.length() == 0) {
+            return _defaultContentType;
+        } else {
+            return new ContentTypeImpl(_defaultContentType.getContentType(), soapAction);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java
new file mode 100644
index 0000000..14be9ef
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.ws.message.stream.StreamHeader12;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * A codec that converts SOAP 1.2 messages infosets to fast infoset
+ * documents.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+final class FastInfosetStreamSOAP12Codec extends FastInfosetStreamSOAPCodec {
+    /*package*/ FastInfosetStreamSOAP12Codec(StreamSOAPCodec soapCodec, boolean retainState) {
+        super(soapCodec, SOAPVersion.SOAP_12, retainState,
+                (retainState) ? FastInfosetMIMETypes.STATEFUL_SOAP_12 : FastInfosetMIMETypes.SOAP_12);
+    }
+
+    private FastInfosetStreamSOAP12Codec(FastInfosetStreamSOAPCodec that) {
+        super(that);
+    }
+
+    public Codec copy() {
+        return new FastInfosetStreamSOAP12Codec(this);
+    }
+
+    protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+        return new StreamHeader12(reader, mark);
+    }
+
+    protected ContentType getContentType(String soapAction) {
+        if (soapAction == null) {
+            return _defaultContentType;
+        } else {
+            return new ContentTypeImpl(
+                    _defaultContentType.getContentType() + ";action=\""+soapAction+"\"");
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java
new file mode 100644
index 0000000..704d8b6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.encoding.fastinfoset;
+
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer;
+import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.message.stream.StreamHeader;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.nio.channels.WritableByteChannel;
+import java.nio.channels.ReadableByteChannel;
+
+/**
+ * A stream SOAP codec for handling SOAP message infosets to fast
+ * infoset documents.
+ *
+ * <p>
+ * This implementation currently defers to {@link StreamSOAPCodec} for the decoding
+ * using {@link XMLStreamReader}.
+ *
+ * @author Paul Sandoz
+ */
+public abstract class FastInfosetStreamSOAPCodec implements Codec {
+    private static final FastInfosetStreamReaderFactory READER_FACTORY = FastInfosetStreamReaderFactory.getInstance();
+
+    private StAXDocumentParser _statefulParser;
+    private StAXDocumentSerializer _serializer;
+
+    private final StreamSOAPCodec _soapCodec;
+
+    private final boolean _retainState;
+
+    protected final ContentType _defaultContentType;
+
+    /* package */ FastInfosetStreamSOAPCodec(StreamSOAPCodec soapCodec, SOAPVersion soapVersion, boolean retainState, String mimeType) {
+//        _soapCodec = StreamSOAPCodec.create(soapVersion);
+        _soapCodec = soapCodec;
+        _retainState = retainState;
+        _defaultContentType = new ContentTypeImpl(mimeType);
+    }
+
+    /* package */ FastInfosetStreamSOAPCodec(FastInfosetStreamSOAPCodec that) {
+        this._soapCodec = (StreamSOAPCodec) that._soapCodec.copy();
+        this._retainState = that._retainState;
+        this._defaultContentType = that._defaultContentType;
+    }
+
+    public String getMimeType() {
+        return _defaultContentType.getContentType();
+    }
+
+    public ContentType getStaticContentType(Packet packet) {
+        return getContentType(packet.soapAction);
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) {
+        if (packet.getMessage() != null) {
+            final XMLStreamWriter writer = getXMLStreamWriter(out);
+            try {
+                packet.getMessage().writeTo(writer);
+                writer.flush();
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);
+            }
+        }
+        return getContentType(packet.soapAction);
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        //TODO: not yet implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public void decode(InputStream in, String contentType, Packet response) throws IOException {
+        response.setMessage(
+                _soapCodec.decode(getXMLStreamReader(in)));
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet response) {
+        throw new UnsupportedOperationException();
+    }
+
+    protected abstract StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark);
+
+    protected abstract ContentType getContentType(String soapAction);
+
+    private XMLStreamWriter getXMLStreamWriter(OutputStream out) {
+        if (_serializer != null) {
+            _serializer.setOutputStream(out);
+            return _serializer;
+        } else {
+            return _serializer = FastInfosetCodec.createNewStreamWriter(out, _retainState);
+        }
+    }
+
+    private XMLStreamReader getXMLStreamReader(InputStream in) {
+        // If the _retainState is true (FI stateful) then pick up Codec assiciated XMLStreamReader
+        if (_retainState) {
+            if (_statefulParser != null) {
+                _statefulParser.setInputStream(in);
+                return _statefulParser;
+            } else {
+                return _statefulParser = FastInfosetCodec.createNewStreamReader(in, _retainState);
+            }
+        }
+
+        // Otherwise thread assiciated XMLStreamReader
+        return READER_FACTORY.doCreate(null, in, false);
+    }
+
+    /**
+     * Creates a new {@link FastInfosetStreamSOAPCodec} instance.
+     *
+     * @param version the SOAP version of the codec.
+     * @return a new {@link FastInfosetStreamSOAPCodec} instance.
+     */
+    public static FastInfosetStreamSOAPCodec create(StreamSOAPCodec soapCodec, SOAPVersion version) {
+        return create(soapCodec, version, false);
+    }
+
+    /**
+     * Creates a new {@link FastInfosetStreamSOAPCodec} instance.
+     *
+     * @param version the SOAP version of the codec.
+     * @param retainState if true the Codec should retain the state of
+     *        vocabulary tables for multiple encode/decode invocations.
+     * @return a new {@link FastInfosetStreamSOAPCodec} instance.
+     */
+    public static FastInfosetStreamSOAPCodec create(StreamSOAPCodec soapCodec,
+            SOAPVersion version, boolean retainState) {
+        if(version==null)
+            // this decoder is for SOAP, not for XML/HTTP
+            throw new IllegalArgumentException();
+        switch(version) {
+            case SOAP_11:
+                return new FastInfosetStreamSOAP11Codec(soapCodec, retainState);
+            case SOAP_12:
+                return new FastInfosetStreamSOAP12Codec(soapCodec, retainState);
+            default:
+                throw new AssertionError();
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/internal/InternalEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/internal/InternalEncoder.java
deleted file mode 100644
index 49ce608..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/internal/InternalEncoder.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.internal;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * Payload is converted from one form to the other
- */
-public interface InternalEncoder {
-    public void toMessageInfo(Object intMessage, MessageInfo mi);
-    public Object toInternalMessage(MessageInfo mi);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBeanInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBeanInfo.java
deleted file mode 100644
index 87b6c96..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBeanInfo.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.jaxb;
-
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.bind.api.BridgeContext;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.Source;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamReader;
-import java.io.OutputStream;
-
-/**
- * XML infoset represented as a JAXB object.
- *
- * @author WS Development Team
- */
-public final class JAXBBeanInfo {
-    private final Object jaxbBean;
-    private JAXBContext jaxbContext;
-    private BridgeContext bc;
-    private Marshaller marshaller;
-    private Unmarshaller unmarshaller;
-
-    public JAXBBeanInfo(Object payload, JAXBContext jaxbContext) {
-        this.jaxbBean = payload;
-        this.jaxbContext = jaxbContext;
-    }
-
-    public static JAXBBeanInfo fromSource(Source source, JAXBContext context) {
-        Object obj = JAXBTypeSerializer.deserialize(source, context);
-        return new JAXBBeanInfo(obj, context);
-    }
-
-    public static JAXBBeanInfo fromStAX(XMLStreamReader reader, JAXBContext context) {
-
-        Object obj = JAXBTypeSerializer.deserialize(reader, context);
-        return new JAXBBeanInfo(obj, context);
-    }
-
-    public static JAXBBeanInfo fromStAX(XMLStreamReader reader, JAXBContext context, Unmarshaller um) {
-
-        Object obj = JAXBTypeSerializer.deserialize(reader, context, um);
-        return new JAXBBeanInfo(obj, context);
-    }
-
-
-
-    public Object getBean() {
-        return jaxbBean;
-    }
-
-    public JAXBContext getJAXBContext() {
-        return jaxbContext;
-    }
-
-    /**
-     * Creates a {@link DOMSource} from this JAXB bean.
-     */
-    public DOMSource toDOMSource() {
-        return JAXBTypeSerializer.serialize(jaxbBean,jaxbContext);
-    }
-
-    /**
-     * Writes this bean to StAX.
-     */
-        public void writeTo(XMLStreamWriter w) {
-            if (marshaller != null)
-                JAXBTypeSerializer.serialize(jaxbBean, w, jaxbContext, marshaller);
-            else
-            JAXBTypeSerializer.serialize(jaxbBean, w, jaxbContext);
-        }
-
-        public void writeTo(OutputStream os) {
-            if (marshaller != null)
-                JAXBTypeSerializer.serialize(jaxbBean, os, jaxbContext, marshaller);
-            else
-             JAXBTypeSerializer.serialize(jaxbBean,os,jaxbContext);
-        }
-
-    public void setMarshallers(Marshaller m, Unmarshaller u) {
-        this.marshaller = m;
-        this.unmarshaller = u;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBridgeInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBridgeInfo.java
deleted file mode 100644
index 64c6d4f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBBridgeInfo.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.jaxb;
-
-import com.sun.xml.internal.bind.api.Bridge;
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.transform.Source;
-import java.io.OutputStream;
-import java.io.InputStream;
-
-import org.w3c.dom.Node;
-
-/**
- * XML infoset represented as a JAXB object and {@link Bridge}.
- *
- * @author WS Development Team
- */
-public final class JAXBBridgeInfo {
-    private final Bridge bridge;
-    private Object value;
-
-    public JAXBBridgeInfo(Bridge bridge) {
-        this.bridge = bridge;
-    }
-
-    public JAXBBridgeInfo(Bridge bridge, Object value) {
-        this(bridge);
-        this.value = value;
-    }
-
-    public QName getName() {
-        return bridge.getTypeReference().tagName;
-    }
-
-    public TypeReference getType(){
-        return bridge.getTypeReference();
-    }
-
-    public Bridge getBridge() {
-        return bridge;
-    }
-
-    public Object getValue() {
-        return value;
-    }
-
-    public static JAXBBridgeInfo copy(JAXBBridgeInfo payload) {
-        return new JAXBBridgeInfo(payload.getBridge(), payload.getValue());
-    }
-
-    /**
-     * JAXB object is serialized. Note that the BridgeContext is cached per
-     * thread, and JAXBBridgeInfo should contain correct BridgeContext for the
-     * current thread.
-     */
-    public void serialize(BridgeContext bridgeContext, OutputStream os, NamespaceContext nsContext) {
-        try {
-            bridge.marshal(bridgeContext, value, os, nsContext);
-        } catch (JAXBException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * Serialize to StAX.
-     */
-    public void serialize(BridgeContext bridgeContext, XMLStreamWriter writer) {
-        try {
-            bridge.marshal(bridgeContext, value, writer);
-        } catch (JAXBException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * Serialize to DOM.
-     */
-    public void serialize(BridgeContext bridgeContext, Node node) {
-        try {
-            bridge.marshal(bridgeContext, value, node);
-        } catch (JAXBException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    public void deserialize(Source source, BridgeContext bridgeContext) {
-        try {
-            value = bridge.unmarshal(bridgeContext, source);
-        } catch (JAXBException e) {
-            throw new DeserializationException(e);
-        }
-    }
-
-    public void deserialize(InputStream stream, BridgeContext bridgeContext) {
-        try {
-            value = bridge.unmarshal(bridgeContext, stream);
-        } catch (JAXBException e) {
-            throw new DeserializationException(e);
-        }
-    }
-
-    /*
-    * JAXB object is deserialized and is set in JAXBBridgeInfo. Note that
-    * the BridgeContext is cached per thread, and JAXBBridgeInfo should contain
-    * correct BridgeContext for the current thread.
-    */
-    public void deserialize(XMLStreamReader reader, BridgeContext bridgeContext)  {
-        try {
-            value = bridge.unmarshal(bridgeContext, reader);
-
-            // reader could be left on CHARS token rather than </body>
-            if (reader.getEventType() == XMLStreamConstants.CHARACTERS &&
-                    reader.isWhiteSpace()) {
-                XMLStreamReaderUtil.nextContent(reader);
-            }
-        } catch (JAXBException e) {
-            throw new DeserializationException(e);
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBTypeSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBTypeSerializer.java
deleted file mode 100644
index dc56229..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/JAXBTypeSerializer.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.jaxb;
-
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
-import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import java.io.OutputStream;
-
-/**
- * @author Vivek Pandey
- */
-public final class JAXBTypeSerializer {
-    private JAXBTypeSerializer() {
-    }    // no instanciation please
-
-    public static void serialize(Object obj, XMLStreamWriter writer, JAXBContext context) {
-
-        try {
-            Marshaller marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            marshaller.marshal(obj, writer);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    public static void serialize(Object obj, XMLStreamWriter writer,
-                                 JAXBContext context, Marshaller marshaller) {
-
-        try {
-            if (marshaller == null)
-                marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            marshaller.marshal(obj, writer);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new SerializationException(e);
-        }
-    }
-
-
-    /* for FI, it will be a whole document, not fragment
-     * called by setPayload and writeTo methods in XMLMessage class
-     */
-    public static void serializeDocument(Object obj, XMLStreamWriter writer, JAXBContext context) {
-        try {
-            Marshaller marshaller = context.createMarshaller();
-            marshaller.marshal(obj, writer);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    public static void serialize(Object obj, OutputStream os,
-                                 JAXBContext context, Marshaller marshaller) {
-
-        try {
-            if (marshaller == null)
-                marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            marshaller.marshal(obj, os);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    public static void serialize(Object obj, OutputStream os, JAXBContext context) {
-
-        try {
-            Marshaller marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            marshaller.marshal(obj, os);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /*
-    * Marshalls arbitrary type object with the given tag name
-    */
-    public static DOMSource serialize(Object bean, JAXBContext context) {
-        try {
-            Marshaller marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            DOMResult domResult = new DOMResult();
-            marshaller.marshal(bean, domResult);
-            return new DOMSource(domResult.getNode());
-        } catch (JAXBException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /*
-    * @see JAXBTypeSerializerIf#deserialize(XMLStreamReader,JAXBContext)
-    */
-    public static Object deserialize(XMLStreamReader reader, JAXBContext context) {
-        Object obj = null;
-        try {
-            Unmarshaller unmarshaller = context.createUnmarshaller();
-            if (reader.getEventType() == XMLStreamConstants.START_ELEMENT)
-                obj = unmarshaller.unmarshal(reader);
-
-            // reader could be left on CHARS token rather than </body>
-            if (reader.getEventType() == XMLStreamConstants.CHARACTERS
-                && reader.isWhiteSpace()) {
-                XMLStreamReaderUtil.nextContent(reader);
-            }
-            return obj;
-
-        } catch (DeserializationException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new DeserializationException(e);
-        }
-    }
-
-    public static Object deserialize(XMLStreamReader reader, JAXBContext context, Unmarshaller bc) {
-        Object obj = null;
-        try {
-            Unmarshaller unmarshaller = context.createUnmarshaller();
-            if (bc != null)
-                unmarshaller.setAttachmentUnmarshaller(bc.getAttachmentUnmarshaller());
-
-            if (reader.getEventType() == XMLStreamConstants.START_ELEMENT)
-                obj = unmarshaller.unmarshal(reader);
-
-            // reader could be left on CHARS token rather than </body>
-            if (reader.getEventType() == XMLStreamConstants.CHARACTERS
-                && reader.isWhiteSpace()) {
-                XMLStreamReaderUtil.nextContent(reader);
-            }
-            return obj;
-
-        } catch (DeserializationException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new DeserializationException(e);
-        }
-    }
-
-    /*
-     * convert JAXB bean as a Source
-     *
-    public static Object toSource(Object obj, JAXBContext context) {
-        try {
-            // Use ctxt to marshall the object
-            ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            Marshaller marshaller = context.createMarshaller();
-            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
-            marshaller.marshal(obj, bos);
-            ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-            return new StreamSource(bis);
-        } catch (JAXBException e) {
-            throw new DeserializationException(new LocalizableExceptionAdapter(
-                    e));
-        }
-    }
-    */
-
-    /*
-    * Convert Source object as a JAXB bean
-    */
-    public static Object deserialize(Source source, JAXBContext context) {
-        try {
-            Unmarshaller unmarshaller = context.createUnmarshaller();
-            return unmarshaller.unmarshal(source);
-        } catch (JAXBException e) {
-            throw new DeserializationException(e);
-        }
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayload.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayload.java
deleted file mode 100644
index 48bfeb7..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayload.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.jaxb;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-public class RpcLitPayload {
-    private QName operation;
-    private List<JAXBBridgeInfo> bridgeParameters;
-
-    public RpcLitPayload(QName operation) {
-        this.operation = operation;
-        this.bridgeParameters = new ArrayList<JAXBBridgeInfo>();
-    }
-
-    /* Same as the above one. Need to remove the above constructor.
-    public RpcLitPayload(QName operation, List<JAXBBridgeInfo> parameters) {
-        this.operation = operation;
-        this.bridgeParameters = parameters;
-    }
-     */
-
-    public QName getOperation() {
-        return operation;
-    }
-
-    public List<JAXBBridgeInfo> getBridgeParameters() {
-        return bridgeParameters;
-    }
-
-    public static RpcLitPayload copy(RpcLitPayload payload) {
-        RpcLitPayload newPayload = new RpcLitPayload(payload.getOperation());
-        for(JAXBBridgeInfo param: payload.getBridgeParameters()) {
-            JAXBBridgeInfo newParam = JAXBBridgeInfo.copy(param);
-            newPayload.addParameter(newParam);
-        }
-        return newPayload;
-    }
-
-    public JAXBBridgeInfo getBridgeParameterByName(String name){
-        for(JAXBBridgeInfo param : bridgeParameters) {
-                if (param.getName().getLocalPart().equals(name)) {
-                        return param;
-            }
-        }
-        return null;
-    }
-
-    public void addParameter(JAXBBridgeInfo parameter) {
-        bridgeParameters.add(parameter);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayloadSerializer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayloadSerializer.java
deleted file mode 100644
index 94505b0..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/jaxb/RpcLitPayloadSerializer.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.jaxb;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.JAXB_OUTPUTSTREAM;
-import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-
-public class RpcLitPayloadSerializer {
-
-    /*
-     * Uses BridgeContext to serialize the rpc/lit payload. First it writes
-     * the operation, and then it serializes each parameter
-     */
-    public static void serialize(RpcLitPayload obj, BridgeContext bridgeContext,
-        MessageInfo messageInfo, XMLStreamWriter writer)
-    {
-        try {
-            QName op = obj.getOperation();
-            String opURI = op.getNamespaceURI();
-
-            writer.writeStartElement("ans", op.getLocalPart(), opURI);
-            writer.setPrefix("ans", opURI);
-            writer.writeNamespace("ans", opURI);
-
-
-            // Pass output stream directly to JAXB when available
-            OutputStream os = (OutputStream) messageInfo.getMetaData(JAXB_OUTPUTSTREAM);
-            if (os != null) {
-                /*
-                 * Make sure that current element is closed before passing the
-                 * output stream to JAXB. Using Zephyr, it suffices to write
-                 * an empty string (TODO: other StAX impls?).
-                 */
-                writer.writeCharacters("");
-
-                // Flush output of StAX serializer
-                writer.flush();
-
-                NamespaceContext nsc = writer.getNamespaceContext();
-
-                // Let JAXB serialize each param to the output stream
-                for (JAXBBridgeInfo param : obj.getBridgeParameters()) {
-                    param.serialize(bridgeContext, os, nsc);
-                }
-            }
-            else {
-                // Otherwise, use a StAX writer
-                for (JAXBBridgeInfo param : obj.getBridgeParameters()) {
-                    param.serialize(bridgeContext, writer);
-                }
-            }
-
-            writer.writeEndElement();            // </ans:operation>
-        }
-        catch (XMLStreamException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    public static void serialize(RpcLitPayload obj, BridgeContext bridgeContext, OutputStream writer) {
-        QName op = obj.getOperation();
-        String opURI = op.getNamespaceURI();
-        String startElm = "<ans:"+op.getLocalPart()+" xmlns:ans=\""+opURI+"\">";
-        String endElm="</ans:"+op.getLocalPart()+">";
-        try {
-            writer.write(startElm.getBytes());
-            for (JAXBBridgeInfo param : obj.getBridgeParameters()) {
-                param.serialize(bridgeContext,writer,null);
-            }
-            writer.write(endElm.getBytes());
-        } catch (IOException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /*
-     * Uses BridgeContext to deserialize the rpc/lit payload. First it reads
-     * the operation element, and then it deserializes each parameter. If the
-     * expected parameter is not found, it throws an exception
-     */
-    public static void deserialize(XMLStreamReader reader, RpcLitPayload payload,
-        BridgeContext bridgeContext)
-    {
-        XMLStreamReaderUtil.nextElementContent(reader);     // </operation> or <partName>
-        for (JAXBBridgeInfo param: payload.getBridgeParameters()) {
-            // throw exception if the part accessor name is not what we expect
-            QName partName = reader.getName();
-            if (!partName.equals(param.getName())) {
-                throw new DeserializationException("xsd.unexpectedElementName",
-                        new Object[]{param.getName(), partName});
-            }
-            param.deserialize(reader, bridgeContext);
-
-            // reader could be left on CHARS token rather than <partName>
-            if (reader.getEventType() == XMLStreamConstants.CHARACTERS &&
-                    reader.isWhiteSpace()) {
-                XMLStreamReaderUtil.nextContent(reader);
-            }
-        }
-        XMLStreamReaderUtil.nextElementContent(reader);     // </env:body>
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/EncoderUtils.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/EncoderUtils.java
deleted file mode 100644
index d8af9ba..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/EncoderUtils.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.simpletype;
-
-/**
- *
- * @author WS Development Team
- */
-public class EncoderUtils {
-    public static boolean needsCollapsing(String str) {
-        int len = str.length();
-        int spanLen = 0;
-
-        for (int idx = 0; idx < len; ++idx) {
-            if (Character.isWhitespace(str.charAt(idx))) {
-                ++spanLen;
-            } else if (spanLen > 0) {
-                if (spanLen == idx) {
-                    // leading whitespace
-                    return true;
-                } else {
-                    // non-leading, non-trailing whitespace
-                    if (str.charAt(idx - spanLen) != ' ') {
-                        // first whitespace character is not a space
-                        return true;
-                    }
-                    if (spanLen > 1) {
-                        // there is a span of multiple whitespace characters
-                        return true;
-                    }
-                }
-
-                spanLen = 0;
-            }
-        }
-
-        if (spanLen > 0) {
-            // trailing whitespace
-            return true;
-        }
-
-        return false;
-    }
-
-    public static String collapseWhitespace(String str) {
-        if (!needsCollapsing(str)) {
-            return str;
-        }
-
-        // the assumption is that most strings will not need to be collapsed,
-        // so the code below will usually not be reached
-
-        int len = str.length();
-        char[] buf = new char[len];
-        str.getChars(0, len, buf, 0);
-
-        int leadingWSLen = 0;
-        int trailingWSLen = 0;
-        int spanLen = 0;
-
-        for (int idx = 0; idx < len; ++idx) {
-            if (Character.isWhitespace(buf[idx])) {
-                ++spanLen;
-            } else if (spanLen > 0) {
-                if (spanLen == idx) {
-                    // leading whitespace
-                    leadingWSLen = spanLen;
-                } else {
-                    // non-leading, non-trailing whitespace
-
-                    // ensure that the first whitespace character is a space
-                    int firstWSIdx = idx - spanLen;
-                    buf[firstWSIdx] = ' ';
-
-                    if (spanLen > 1) {
-                        // remove all but the first whitespace character
-                        System.arraycopy(
-                            buf,
-                            idx,
-                            buf,
-                            firstWSIdx + 1,
-                            len - idx);
-                        len -= (spanLen - 1);
-                        idx = firstWSIdx + 1;
-                    }
-                }
-
-                spanLen = 0;
-            }
-        }
-
-        if (spanLen > 0) {
-            // trailing whitespace
-            trailingWSLen = spanLen;
-        }
-
-        return new String(
-            buf,
-            leadingWSLen,
-            len - leadingWSLen - trailingWSLen);
-    }
-
-    public static String removeWhitespace(String str) {
-        int len = str.length();
-        StringBuffer buf = new StringBuffer();
-        int firstNonWS = 0;
-        int idx = 0;
-        for (; idx < len; ++idx) {
-            if (Character.isWhitespace(str.charAt(idx))) {
-                if (firstNonWS < idx)
-                    buf.append(str.substring(firstNonWS, idx));
-                firstNonWS = idx + 1;
-            }
-        }
-        if (firstNonWS < idx)
-            buf.append(str.substring(firstNonWS, idx));
-        return buf.toString();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/SimpleTypeConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/SimpleTypeConstants.java
deleted file mode 100644
index 5012dc2..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/simpletype/SimpleTypeConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-
-package com.sun.xml.internal.ws.encoding.simpletype;
-
-import javax.xml.namespace.QName;
-
-import com.sun.xml.internal.ws.encoding.soap.SerializerConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-
-/**
- *
- * @author WS Development Team
- */
-public interface SimpleTypeConstants extends SerializerConstants {
-
-    public static final String URI_XSI = SOAPNamespaceConstants.XSI;
-    public static final String URI_XSD = SOAPNamespaceConstants.XSD;
-
-    public static final QName QNAME_XSI_TYPE = new QName(URI_XSI, "type");
-    public static final QName QNAME_XSI_NIL = new QName(URI_XSI, "nil");
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ClientEncoderDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ClientEncoderDecoder.java
deleted file mode 100644
index fa0067c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ClientEncoderDecoder.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.client.RequestContext;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultReasonText;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAP12FaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.model.CheckedException;
-import com.sun.xml.internal.ws.model.ExceptionType;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.Parameter;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.model.WrapperParameter;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.util.StringUtils;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.ws.handler.MessageContext;
-import javax.activation.DataHandler;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Vivek Pandey
- *
- * SOAP Client side encoder/decoder.
- */
-public class ClientEncoderDecoder extends EncoderDecoder implements InternalEncoder {
-    public ClientEncoderDecoder() {
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.EncoderDecoderBase#toMessageInfo(java.lang.Object, com.sun.pept.ept.MessageInfo)
-     */
-    public void toMessageInfo(Object intMessage, MessageInfo mi) {
-        InternalMessage im = (InternalMessage) intMessage;
-        BodyBlock bodyBlock = im.getBody();
-        RuntimeContext rtContext = (RuntimeContext) mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        JavaMethod jm = rtContext.getModel().getJavaMethod(mi.getMethod());
-        mi.setMEP(jm.getMEP());
-
-        Object bodyValue  = (bodyBlock == null) ? null : bodyBlock.getValue();
-
-        if(bodyValue instanceof SOAPFaultInfo){
-            SOAPFaultInfo sfi = (SOAPFaultInfo)bodyValue;
-            Object detail = sfi.getDetail();
-            if(detail == null || detail instanceof javax.xml.soap.Detail) {
-                SOAPFaultException sfe = new SOAPFaultException(sfi.getSOAPFault());
-                mi.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-                mi.setResponse(sfe);
-                return;
-            }
-            JAXBBridgeInfo bi = (JAXBBridgeInfo)detail;
-            CheckedException ce = jm.getCheckedException(bi.getType());
-            Exception ex = createCheckedException(sfi.getString(), ce, bi.getValue());
-            mi.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-            mi.setResponse(ex);
-            return;
-        }
-
-        if(bodyValue instanceof SOAP12FaultInfo){
-            SOAP12FaultInfo sfi = (SOAP12FaultInfo)bodyValue;
-            Object detail = sfi.getDetail();
-            if(detail == null || detail instanceof javax.xml.soap.Detail) {
-//                javax.xml.soap.Detail sfeDetail = null;
-//                if(detail != null)
-//                    sfeDetail = (javax.xml.soap.Detail)detail;
-//                String reason = null;
-//                List<FaultReasonText> frt = sfi.getReasons().getFaultReasonTexts();
-//
-//                //for now we pickup onkly the first Reason Text
-//                if(frt != null && !frt.isEmpty())
-//                    reason = frt.get(0).getValue();
-
-                SOAPFaultException sfe = new SOAPFaultException(sfi.getSOAPFault());
-                mi.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-                mi.setResponse(sfe);
-                return;
-            }
-            JAXBBridgeInfo bi = (JAXBBridgeInfo)detail;
-            CheckedException ce = jm.getCheckedException(bi.getType());
-            String reason = null;
-            List<FaultReasonText> frt = sfi.getReasons().getFaultReasonTexts();
-            //for now we pickup onkly the first Reason Text
-            if(frt != null && !frt.isEmpty())
-                reason = frt.get(0).getValue();
-            Exception ex = createCheckedException(reason, ce, bi.getValue());
-            mi.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-            mi.setResponse(ex);
-            return;
-        }
-
-        // process body/headers/attachments
-        List<HeaderBlock> headers = im.getHeaders();
-        Map<String, AttachmentBlock> attachments = im.getAttachments();
-        Object[] data = mi.getData();
-        SOAPBinding soapBinding = (SOAPBinding)jm.getBinding();
-
-        // TODO: why is the binding determined by the instance?
-        //what happens when client receives unsolicited headers?
-        int bBlocks = (bodyValue != null)?1:0;
-        int hBlocks = (im.getHeaders() != null)?im.getHeaders().size():0;
-        int mBlocks = (im.getAttachments() != null)?im.getAttachments().size():0;
-
-        boolean isResponseAsynWrapper = (bBlocks + hBlocks + mBlocks) > 1;
-
-        //for rpclit there could be more than one parts but only one bodyblock
-        // so we use different rule for rpclit
-        if((bodyValue instanceof RpcLitPayload) && !isResponseAsynWrapper){
-            isResponseAsynWrapper = (((RpcLitPayload)bodyValue).getBridgeParameters().size() > 1);
-        }
-
-        if(jm.isAsync() && isResponseAsynWrapper){
-            Object asyncWrapper = createAsyncResponseClass(jm.getResponseParameters().get(0));
-            if(bodyValue instanceof RpcLitPayload){
-                RpcLitPayload payload = (RpcLitPayload)bodyValue;
-                for(JAXBBridgeInfo bi : payload.getBridgeParameters()){
-                    setAsyncResponseWrapperValue(rtContext, asyncWrapper, bi.getValue(), bi.getType().tagName);
-                }
-            }else {
-                JAXBBridgeInfo value = (JAXBBridgeInfo)bodyValue;
-                setAsyncResponseWrapperValue(rtContext, asyncWrapper, value.getValue(), value.getType().tagName);
-            }
-
-            if(im.getHeaders() != null) {
-                for(HeaderBlock hb : im.getHeaders()){
-                    JAXBBridgeInfo value = (JAXBBridgeInfo)hb.getValue();
-                    setAsyncResponseWrapperValue(rtContext, asyncWrapper, value.getValue(), value.getType().tagName);
-                }
-            }else if(attachments != null){
-                for(String id : attachments.keySet()){
-                    AttachmentBlock ab = attachments.get(id);
-                    if(ab == null)
-                        return;
-                    String part = ab.getWSDLPartName();
-
-                    // TODO: this isn't correct
-                    setAsyncResponseWrapperValue(rtContext, asyncWrapper, ab.asDataHandler(), new QName("", part));
-                }
-            }
-            mi.setResponse(asyncWrapper);
-            return;
-        }else if(jm.isAsync() && ((bBlocks+hBlocks+mBlocks) == 1)){
-            //there is only 1 response part
-            Object value = null;
-            if(bodyValue instanceof RpcLitPayload){
-                RpcLitPayload payload = (RpcLitPayload)bodyValue;
-                for(JAXBBridgeInfo bi:payload.getBridgeParameters()){
-                    value = bi.getValue();
-                    break;
-                }
-            }else{
-                value = ((JAXBBridgeInfo)bodyValue).getValue();
-            }
-
-            if(value != null){
-                mi.setResponse(value);
-                return;
-            }
-
-            if(headers != null){
-                for(HeaderBlock hb : headers){
-                    value = ((JAXBBridgeInfo)hb.getValue()).getValue();
-                    if(value != null){
-                        mi.setResponse(value);
-                        return;
-                    }
-                }
-            }
-
-            if(attachments != null){
-                for(String id:attachments.keySet()){
-                    AttachmentBlock ab = attachments.get(id);
-                    if(ab == null)      continue;
-
-                    // TODO: this isn't correct
-                    mi.setResponse(ab.asDataHandler());
-                    return;
-                }
-            }
-
-            // bBlocks+hBlocks+mBlocks==1, so we shall never get here
-            assert false;
-        }
-
-
-        for (Parameter param : jm.getResponseParameters()) {
-            Object obj = null;
-            ParameterBinding paramBinding = param.getOutBinding();
-            if (paramBinding.isBody()) {
-                //TODO: check if the bodyValue qname is the one we expect!
-                obj = bodyValue;
-            } else if (headers != null && paramBinding.isHeader()) {
-                HeaderBlock header = getHeaderBlock(param.getName(), headers);
-                obj = (header != null) ? header.getValue() : null;
-            } else if (paramBinding.isAttachment()) {
-                obj = getAttachment(rtContext, attachments, param, paramBinding);
-            }
-            Object resp = fillData(rtContext, param, obj, data, soapBinding, paramBinding);
-            if (param.isResponse()) {
-                mi.setResponse(resp);
-            }
-        }
-    }
-
-    private void setAsyncResponseWrapperValue(RuntimeContext rtContext, Object bean, Object value, QName tag){
-        if(value != null){
-            setWrapperChildValue(rtContext, bean, value, tag.getNamespaceURI(), tag.getLocalPart());
-        }
-    }
-
-    private Object createAsyncResponseClass(Parameter parameter) {
-        Class asyncWrapper = (Class)parameter.getTypeReference().type;
-        if(RpcLitPayload.class.isAssignableFrom(asyncWrapper)){
-            WrapperParameter wp = (WrapperParameter)parameter;
-            if(wp.getWrapperChildren().size() > 0){
-                Parameter p = wp.getWrapperChildren().get(0);
-                asyncWrapper = (Class) p.getTypeReference().type;
-            }
-        }
-
-        try {
-            return asyncWrapper.newInstance();
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    private Exception createCheckedException(String message, CheckedException ce, Object detail) {
-        if(ce.getExceptionType().equals(ExceptionType.UserDefined)){
-            return createUserDefinedException(message, ce, detail);
-
-        }
-        Class exceptionClass = ce.getExcpetionClass();
-        try {
-            Constructor constructor = exceptionClass.getConstructor(new Class[]{String.class, (Class) ce.getDetailType().type});
-            Object exception = constructor.newInstance(new Object[]{message, detail});
-            return (Exception)exception;
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * @param message
-     * @param ce
-     * @param detail
-     */
-    private Exception createUserDefinedException(String message, CheckedException ce, Object detail) {
-        Class exceptionClass = ce.getExcpetionClass();
-        try {
-            Constructor constructor = exceptionClass.getConstructor(new Class[]{String.class});
-            Object exception = constructor.newInstance(new Object[]{message});
-            Field[] fields = detail.getClass().getFields();
-            for(Field f : fields){
-                Method m = exceptionClass.getMethod(getWriteMethod(f));
-                m.invoke(exception, new Object[]{f.get(detail)});
-            }
-            return (Exception)exception;
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * @param f
-     */
-    private String getWriteMethod(Field f){
-        return "set" + StringUtils.capitalize(f.getName());
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.EncoderDecoderBase#toInternalMessage(com.sun.pept.ept.MessageInfo)
-     */
-    public InternalMessage toInternalMessage(MessageInfo mi) {
-        RuntimeContext rtContext = (RuntimeContext) mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        RuntimeModel model = rtContext.getModel();
-
-        JavaMethod jm = model.getJavaMethod(mi.getMethod());
-        Object[] data = mi.getData();
-        InternalMessage im = new InternalMessage();
-        //copy the attachments from the outbound attachments to InternalMessage
-        RequestContext ctxt = (RequestContext)mi.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        copyAttachmentProperty(ctxt, im);
-        Iterator<Parameter> iter = jm.getRequestParameters().iterator();
-        SOAPBinding soapBinding = (SOAPBinding)jm.getBinding();
-        while (iter.hasNext()) {
-            Parameter param = iter.next();
-            ParameterBinding paramBinding = param.getInBinding();
-            Object obj = createPayload(rtContext, param, data, null, soapBinding, paramBinding);
-            if (paramBinding.isBody()) {
-                im.setBody(new BodyBlock(obj));
-            } else if (paramBinding.isHeader()) {
-                im.addHeader(new HeaderBlock((JAXBBridgeInfo)obj));
-            } else if (paramBinding.isAttachment()) {
-                addAttachmentPart(rtContext, im, obj, param);
-            }
-        }
-        return im;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java
index 585eaaf..d6c9e9d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("nestedDeserializationError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.encoding";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/EncoderDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/EncoderDecoder.java
deleted file mode 100644
index ebbfb4f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/EncoderDecoder.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.ws.encoding.EncoderDecoderBase;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.model.*;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.client.RequestContext;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.WebServiceException;
-import java.awt.Image;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Type;
-import java.net.URLEncoder;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * @author Vivek Pandey
- *
- * Base SOAP encoder decoder class.
- */
-public abstract class EncoderDecoder extends EncoderDecoderBase {
-
-    /**
-     * Fills the data[] which is ordered list of java method parameters.
-     *
-     * @param context
-     *            will be used if needed
-     * @param obj
-     * @param data
-     * @return if the parameter is a return
-     */
-    protected Object fillData(RuntimeContext context, Parameter param, Object obj, Object[] data,
-                              SOAPBinding binding, ParameterBinding paramBinding) {
-        if (param.isWrapperStyle()) {
-            Object resp = null;
-            for (Parameter p : ((WrapperParameter) param).getWrapperChildren()) {
-                QName name = p.getName();
-                Object value = null;
-                if (binding.isDocLit()){
-                    value = super.getWrapperChildValue(context, ((JAXBBridgeInfo)obj).getValue(),
-                                name.getNamespaceURI(), name.getLocalPart());
-                }else if (binding.isRpcLit()){
-                    value = getWrapperChildValue(context, obj, name.getNamespaceURI(), name
-                            .getLocalPart());
-                    if(value == null)
-                        value = setIfPrimitive(p.getTypeReference().type);
-                }
-                if (p.isResponse())
-                    resp = value;
-                else {
-                    if (data[p.getIndex()] != null) {
-                        Parameter.setHolderValue(data[p.getIndex()], value);
-                    } else {
-                        data[p.getIndex()] = p.createHolderValue(value);
-                    }
-                }
-            }
-            return resp;
-        }
-
-        if(!paramBinding.isAttachment()){
-            if(paramBinding.isUnbound())
-                obj = setIfPrimitive(param.getTypeReference().type);
-            else
-                obj = (obj != null)?((JAXBBridgeInfo)obj).getValue():null;
-        }
-        if (param.isResponse()) {
-            if(paramBinding.isUnbound())
-                return setIfPrimitive(param.getTypeReference().type);
-            return obj;
-        } else if (data[param.getIndex()] != null) {
-            Parameter.setHolderValue(data[param.getIndex()], obj);
-        } else {
-            data[param.getIndex()] = param.createHolderValue(obj);
-        }
-        return null;
-    }
-
-    /**
-     * Returns the default values of primitive types. To be called when the object referene by this type is null.
-     * @param type
-     * @return default values of primitive types if type is primitive else null
-     */
-    private Object setIfPrimitive(Type type) {
-        if(type instanceof Class){
-            Class cls = (Class)type;
-            if(cls.isPrimitive()){
-                if(cls.getName().equals(boolean.class.getName())){
-                    return false;
-                }
-                return 0;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * creates the payload to be serilized over the wire. It can be constructed
-     * from the parameters in data[] or from the result.
-     *
-     * @param context
-     *            runtime context. It can be used to get access to the
-     *            JAXBContext.
-     * @param data
-     *            parameters
-     * @param result
-     *            it could be null if there are no response object,for example
-     *            incase of outgoing client message.
-     * @return Payload - decided by the binding used
-     */
-    protected Object createPayload(RuntimeContext context, Parameter param, Object[] data,
-                                   Object result, SOAPBinding binding, ParameterBinding paramBinding) {
-        if(paramBinding.isAttachment()){
-            Object obj = null;
-            if(param.isResponse())
-                obj = result;
-            else
-                obj = param.getHolderValue(data[param.getIndex()]);
-            return obj;
-        }
-        if (binding.isRpcLit() && paramBinding.isBody()) {
-            return createRpcLitPayload(context, (WrapperParameter) param, data, result);
-        }
-        Object obj = createDocLitPayloadValue(context, param, data, result);
-        RuntimeModel model = context.getModel();
-        return new JAXBBridgeInfo(model.getBridge(param.getTypeReference()), obj);
-    }
-
-    /*
-     * Returns the value corresponding to the localName or part accessor from
-     * rpclit structure.
-     *
-     * @see EncoderDecoderBase#getWrapperChildValue(RuntimeContext,
-     *      Object, String, String)
-     */
-    @Override
-    protected Object getWrapperChildValue(RuntimeContext context, Object obj, String nsURI,
-                                          String localName) {
-        RpcLitPayload payload = (RpcLitPayload) obj;
-        JAXBBridgeInfo rpcParam = payload.getBridgeParameterByName(localName);
-        if(rpcParam != null)
-            return rpcParam.getValue();
-        return null;
-    }
-
-    /**
-     * Gives the binding specific object to be serialized.
-     *
-     * @param context
-     * @param data
-     * @param result
-     */
-    private Object createDocLitPayloadValue(RuntimeContext context, Parameter param, Object[] data, Object result) {
-        if (param.isWrapperStyle()) {
-            return createJAXBBeanPayload(context, (WrapperParameter) param, data, result);
-        }
-        return getBarePayload(param, data, result);
-    }
-
-    /**
-     * Gets the HeaderBlock corresponding to the given QName.
-     *
-     * @param name
-     * @param headers
-     * @return the <code>HeaderBlock</code> corresponding to the given
-     * <code>QName name</code>
-     */
-    protected HeaderBlock getHeaderBlock(QName name, List<HeaderBlock> headers) {
-        for (HeaderBlock header : headers) {
-            if (name.equals(header.getName()))
-                return header;
-        }
-        return null;
-    }
-
-    /**
-     * Returns either the value corresponding to the parameter or result.
-     *
-     * @param param
-     * @param data
-     * @param result
-     * @return Either the value of response of the parameter corresponding to
-     *         the parameter index, takes care of Holder.value.
-     *
-     */
-    private Object getBarePayload(Parameter param, Object[] data, Object result) {
-        Object obj = null;
-        if (param.isResponse()) {
-            obj = result;
-        } else {
-            obj = param.getHolderValue(data[param.getIndex()]);
-        }
-        return obj;
-    }
-
-    /**
-     * Creates JAXB style wrapper bean from the parameters or result.
-     *
-     * @param context
-     * @param param
-     *            WrapperParameter
-     * @param data
-     * @param result
-     * @return non-null JAXB style bean.
-     */
-    private Object createJAXBBeanPayload(RuntimeContext context, WrapperParameter param,
-                                         Object[] data, Object result) {
-        Class bean = (Class) param.getTypeReference().type;
-        try {
-            Object obj = bean.newInstance();
-            for( Parameter p : param.getWrapperChildren() ) {
-                Object value;
-                if (p.isResponse())
-                    value = result;
-                else
-                    value = p.getHolderValue(data[p.getIndex()]);
-                QName name = p.getName();
-                setWrapperChildValue(context, obj, value,
-                    name.getNamespaceURI(), name.getLocalPart());
-            }
-            return obj;
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * Creates RpcLitPayload from the parameters or response.
-     *
-     * @param context
-     * @param param
-     * @param data
-     * @param result
-     * @return non-null RpcLitPayload
-     */
-    private Object createRpcLitPayload(RuntimeContext context, WrapperParameter param,
-                                       Object[] data, Object result) {
-        RpcLitPayload payload = new RpcLitPayload(param.getName());
-
-        for  (Parameter p : param.getWrapperChildren()) {
-            if(p.getBinding().isUnbound())
-                continue;
-            Object value = null;
-            if (p.isResponse())
-                value = result;
-            else
-                value = p.getHolderValue(data[p.getIndex()]);
-            checkRPCLitNullableParameter(p, value);
-            RuntimeModel model = context.getModel();
-            JAXBBridgeInfo bi = new JAXBBridgeInfo(model.getBridge(p.getTypeReference()), value);
-            payload.addParameter(bi);
-        }
-        return payload;
-    }
-
-    protected Object getAttachment(RuntimeContext rtContext, Map<String, AttachmentBlock> attachments,
-                                   Parameter param, ParameterBinding paramBinding){
-        try {
-            for (Map.Entry<String,AttachmentBlock> entry : attachments.entrySet()) {
-                AttachmentBlock ab = entry.getValue();
-                String part = ab.getWSDLPartName();
-                // part can be null if the Content-Id is not encoded as per AP 1.0 R2933. Which is ok since there could be attachments
-                // other than WSDL MIME bound
-                if(part == null)
-                    continue;
-
-                if(part.equals(param.getPartName()) || part.equals("<"+param.getPartName())){
-                    Class type = (Class)param.getTypeReference().type;
-
-                    if(DataHandler.class.isAssignableFrom(type))
-                        return ab.asDataHandler();
-                    if(byte[].class==type)
-                        return ab.asByteArray();
-                    if(Source.class.isAssignableFrom(type))
-                        return ab.asSource();
-                    if(Image.class.isAssignableFrom(type))
-                        return ab.asImage();
-                    if(InputStream.class==type)
-                        return ab.asDataHandler().getInputStream();
-                    if(isXMLMimeType(paramBinding.getMimeType())) {
-                        JAXBBridgeInfo bi = (JAXBBridgeInfo)rtContext.getDecoderInfo(param.getName());
-                        ab.deserialize(rtContext.getBridgeContext(),bi);
-                        return bi.getValue();
-                    }
-                }
-            }
-            return null;
-        } catch (IOException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    protected void addAttachmentPart(RuntimeContext rtContext, InternalMessage im, Object obj, Parameter mimeParam){
-        if(obj == null)
-            return;
-        RuntimeModel model = rtContext.getModel();
-        String mimeType = mimeParam.getBinding().getMimeType();
-        String contentId;
-        try {
-            contentId = URLEncoder.encode(mimeParam.getPartName(), "UTF-8")+ '=' +UUID.randomUUID()+"@jaxws.sun.com";
-            contentId="<"+contentId+">";
-        } catch (UnsupportedEncodingException e) {
-            throw new SerializationException(e);
-        }
-
-        AttachmentBlock ab;
-
-        if(obj instanceof DataHandler)
-            ab = AttachmentBlock.fromDataHandler(contentId,(DataHandler)obj);
-        else
-        if(obj instanceof Source)
-            // this is potentially broken, as there's no guarantee this will work.
-            // we should have our own AttachmentBlock implementation for this.
-            ab = AttachmentBlock.fromDataHandler(contentId, new DataHandler(obj,mimeType));
-        else
-        if(obj instanceof byte[])
-            ab = AttachmentBlock.fromByteArray(contentId,(byte[])obj,mimeType);
-        else
-        if(isXMLMimeType(mimeType))
-            ab = AttachmentBlock.fromJAXB(contentId,
-                    new JAXBBridgeInfo(model.getBridge(mimeParam.getTypeReference()), obj),
-                    rtContext, mimeType );
-        else
-            // this is also broken, as there's no guarantee that the object type and the MIME type
-            // matches. But most of the time it matches, so it mostly works.
-            ab = AttachmentBlock.fromDataHandler(contentId,new DataHandler(obj,mimeType));
-
-        //populate the attachment map in the message context
-        HandlerContext hc = rtContext.getHandlerContext();
-        if(hc != null){
-            MessageContext mc = hc.getMessageContext();
-            if(mc != null){
-                MessageContextUtil.addMessageAttachment(mc, ab.getId(), ab.asDataHandler());
-            }
-        }
-
-        im.addAttachment(ab);
-    }
-
-    protected void copyAttachmentProperty(Map<String, Object> ctxt, InternalMessage im) {
-        if(ctxt == null)
-            return;
-        Map<String, DataHandler> attMap = (Map<String, DataHandler>) ctxt.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-        if (attMap == null)
-            return;
-        for (Map.Entry<String, DataHandler> att : attMap.entrySet()) {
-            im.addAttachment(AttachmentBlock.fromDataHandler(att.getKey(), att.getValue()));
-        }
-    }
-
-    private boolean isXMLMimeType(String mimeType){
-        if(mimeType.equals("text/xml") || mimeType.equals("application/xml"))
-            return true;
-        return false;
-    }
-
-    /**
-     * Checks rpclit body parts for nullability
-     */
-    void checkRPCLitNullableParameter(Parameter param, Object value) {
-        if(value == null)
-            throw new WebServiceException("Method Parameter: "+param.getName() +" cannot be null. This is BP 1.1 R2211 violation.");
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java
index 1518021..b8858c8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,10 +24,10 @@
  */
 package com.sun.xml.internal.ws.encoding.soap;
 
-import javax.xml.namespace.QName;
-
 import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
 
+import javax.xml.namespace.QName;
+
 /**
  *
  * @author WS Development Team
@@ -67,8 +67,6 @@
 
 
     //fault codes
-    public final static QName FAULT_CODE_CLIENT            = new QName(URI_ENVELOPE, "Sender");
-    public final static QName FAULT_CODE_SERVER            = new QName(URI_ENVELOPE, "Receiver");
     public final static QName FAULT_CODE_MUST_UNDERSTAND   = new QName(URI_ENVELOPE, "MustUnderstand");
     public final static QName FAULT_CODE_MISUNDERSTOOD   = new QName(URI_ENVELOPE, "Misunderstood");
     public final static QName FAULT_CODE_VERSION_MISMATCH  = new QName(URI_ENVELOPE, "VersionMismatch");
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java
index 900b4b0..1ad0b54 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,10 @@
 
 package com.sun.xml.internal.ws.encoding.soap;
 
-import javax.xml.namespace.QName;
-
 import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
 
+import javax.xml.namespace.QName;
+
 /**
  *
  * @author WS Development Team
@@ -52,8 +52,6 @@
     public final static QName QNAME_SOAP_FAULT_STRING             = new QName("", "faultstring");
     public final static QName QNAME_SOAP_FAULT_ACTOR             = new QName("", "faultactor");
     public final static QName QNAME_SOAP_FAULT_DETAIL             = new QName("", "detail");
-    public final static QName FAULT_CODE_CLIENT            = new QName(URI_ENVELOPE, "Client");
-    public final static QName FAULT_CODE_SERVER            = new QName(URI_ENVELOPE, "Server");
     public final static QName FAULT_CODE_MUST_UNDERSTAND   = new QName(URI_ENVELOPE, "MustUnderstand");
 
     public final static QName FAULT_CODE_VERSION_MISMATCH  = new QName(URI_ENVELOPE, "VersionMismatch");
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPDecoder.java
deleted file mode 100644
index dc3f09e..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPDecoder.java
+++ /dev/null
@@ -1,680 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ParseException;
-import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentUnmarshaller;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayloadSerializer;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLReaderException;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderException;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import com.sun.xml.internal.ws.client.dispatch.impl.encoding.DispatchUtil;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.util.FastInfosetReflection;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import static javax.xml.stream.XMLStreamReader.*;
-import javax.xml.bind.Unmarshaller;
-
-/**
- * @author WS Development Team
- */
-public abstract class SOAPDecoder implements Decoder {
-
-    public final static String NOT_UNDERSTOOD_HEADERS =
-        "not-understood soap headers";
-
-    protected static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".soap.decoder");
-
-    protected final static String MUST_UNDERSTAND_FAULT_MESSAGE_STRING =
-        "SOAP must understand error";
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.encoding.Decoder#decode(com.sun.pept.ept.MessageInfo)
-     */
-    public void decode(MessageInfo arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.encoding.Decoder#receieveAndDecode(com.sun.pept.ept.MessageInfo)
-     */
-    public void receiveAndDecode(MessageInfo arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * parses and binds headers, body from SOAPMessage.
-     *
-     * @param soapMessage
-     * @return the <code>InternalMessage</code> for the <code>soapMessage</code>
-     */
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage,
-                                             MessageInfo messageInfo) {
-        return null;
-    }
-
-    /**
-     * Returns the roles required for the type of binding. Returns
-     * an empty set if there are none.
-     */
-    public Set<String> getRequiredRoles() {
-        return new HashSet<String>();
-    }
-
-    /**
-     * Parses and binds headers from SOAPMessage.
-     *
-     * @param soapMessage
-     * @param internalMessage
-     * @param messageInfo
-     * @return the InternalMessage representation of the SOAPMessage
-     */
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage,
-                                             InternalMessage internalMessage, MessageInfo messageInfo) {
-        return null;
-    }
-
-    public SOAPMessage toSOAPMessage(MessageInfo messageInfo) {
-        return null;
-    }
-
-    public void toMessageInfo(InternalMessage internalMessage, MessageInfo messageInfo) {
-    }
-
-    protected QName getEnvelopeTag() {
-        return SOAPConstants.QNAME_SOAP_ENVELOPE;
-    }
-
-    protected QName getBodyTag() {
-        return SOAPConstants.QNAME_SOAP_BODY;
-    }
-
-    protected QName getHeaderTag() {
-        return SOAPConstants.QNAME_SOAP_HEADER;
-    }
-
-    protected QName getMUAttrQName() {
-        return SOAPConstants.QNAME_MUSTUNDERSTAND;
-    }
-
-    protected QName getRoleAttrQName() {
-        return SOAPConstants.QNAME_ROLE;
-    }
-
-    protected QName getFaultTag() {
-        return SOAPConstants.QNAME_SOAP_FAULT;
-    }
-
-    protected QName getFaultDetailTag() {
-        return SOAPConstants.QNAME_SOAP_FAULT_DETAIL;
-    }
-
-
-    protected void skipBody(XMLStreamReader reader) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-        XMLStreamReaderUtil.skipElement(reader);    // Moves to </Body>
-        XMLStreamReaderUtil.nextElementContent(reader);
-    }
-
-    protected void skipHeader(XMLStreamReader reader, MessageInfo messageInfo) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        if (!isDispatch(messageInfo))
-            return;
-
-        if (!SOAPNamespaceConstants.TAG_HEADER.equals(reader.getLocalName())) {
-            return;
-        }
-
-        //XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-
-        dispatchUtil.collectPrefixes(reader);
-
-        XMLStreamReaderUtil.skipElement(reader);    // Moves to </Header>
-
-        try {
-            reader.next();
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    protected boolean skipHeader(MessageInfo messageInfo) {
-        if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) ==
-            Service.Mode.PAYLOAD) {
-            return true;
-        }
-        return false;
-    }
-
-    /*
-    * skipBody is true, the body is skipped during parsing.
-    */
-    protected void decodeEnvelope(XMLStreamReader reader, InternalMessage request,
-                                  boolean skipBody, MessageInfo messageInfo) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-        if (skipHeader(messageInfo))
-            skipHeader(reader, messageInfo);
-        else
-            decodeHeader(reader, messageInfo, request);
-
-
-        if (skipBody) {
-            skipBody(reader);
-        } else {
-            decodeBody(reader, request, messageInfo);
-        }
-
-
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_DOCUMENT);
-    }
-
-    protected void decodeHeader(XMLStreamReader reader, MessageInfo messageInfo,
-                                InternalMessage request) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-
-
-        if (!SOAPNamespaceConstants.TAG_HEADER.equals(reader.getLocalName())) {
-            return;
-        }
-        XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-        if (isDispatch(messageInfo))
-            dispatchUtil.collectPrefixes(reader);
-        XMLStreamReaderUtil.nextElementContent(reader);
-        while (true) {
-            if (reader.getEventType() == START_ELEMENT) {
-                decodeHeaderElement(reader, messageInfo, request);
-            } else {
-                break;
-            }
-        }
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-    }
-
-/*
-* If JAXB can deserialize a header, deserialize it.
-* Otherwise, just ignore the header
-*/
-
-    protected void decodeHeaderElement(XMLStreamReader reader, MessageInfo messageInfo,
-                                       InternalMessage msg) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        if (rtCtxt == null) {
-
-            XMLStreamReaderUtil.skipElement(reader);           // Moves to END state
-            XMLStreamReaderUtil.nextElementContent(reader);
-            return;
-        }
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        Set<QName> knownHeaders = ((SOAPRuntimeModel) rtCtxt.getModel()).getKnownHeaders();
-        QName name = reader.getName();
-        if (knownHeaders != null && knownHeaders.contains(name)) {
-            QName headerName = reader.getName();
-            if (msg.isHeaderPresent(name)) {
-                // More than one instance of header whose QName is mapped to a
-                // method parameter. Generates a runtime error.
-                raiseFault(getSenderFaultCode(), DUPLICATE_HEADER + headerName);
-            }
-            Object decoderInfo = rtCtxt.getDecoderInfo(name);
-            if (decoderInfo != null && decoderInfo instanceof JAXBBridgeInfo) {
-                JAXBBridgeInfo bridgeInfo = (JAXBBridgeInfo) decoderInfo;
-// JAXB leaves on </env:Header> or <nextHeaderElement>
-                bridgeInfo.deserialize(reader, bridgeContext);
-                HeaderBlock headerBlock = new HeaderBlock(bridgeInfo);
-                msg.addHeader(headerBlock);
-            }
-        } else {
-            XMLStreamReaderUtil.skipElement(reader);           // Moves to END state
-            XMLStreamReaderUtil.nextElementContent(reader);
-        }
-    }
-
-    protected void decodeBody(XMLStreamReader reader, InternalMessage response,
-                              MessageInfo messageInfo) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-        int state = XMLStreamReaderUtil.nextElementContent(reader);
-        decodeBodyContent(reader, response, messageInfo);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-    }
-
-    protected void decodeBodyContent(XMLStreamReader reader, InternalMessage response,
-                                     MessageInfo messageInfo) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        decodeDispatchMethod(reader, response, messageInfo);
-        if (reader.getEventType() == START_ELEMENT) {
-            QName name = reader.getName(); // Operation name
-            if (name.getNamespaceURI().equals(getEnvelopeTag().getNamespaceURI()) &&
-                name.getLocalPart().equals(SOAPNamespaceConstants.TAG_FAULT)) {
-                SOAPFaultInfo soapFaultInfo = decodeFault(reader, response, messageInfo);
-                BodyBlock responseBody = new BodyBlock(soapFaultInfo);
-                response.setBody(responseBody);
-            } else {
-                Object decoderInfo = rtCtxt.getDecoderInfo(name);
-                if (decoderInfo != null && decoderInfo instanceof JAXBBridgeInfo)
-                {
-                    JAXBBridgeInfo bridgeInfo = (JAXBBridgeInfo) decoderInfo;
-                    bridgeInfo.deserialize(reader, bridgeContext);
-                    BodyBlock responseBody = new BodyBlock(bridgeInfo);
-                    response.setBody(responseBody);
-                } else
-                if (decoderInfo != null && decoderInfo instanceof RpcLitPayload)
-                {
-                    RpcLitPayload rpcLitPayload = (RpcLitPayload) decoderInfo;
-                    RpcLitPayloadSerializer.deserialize(reader, rpcLitPayload, bridgeContext);
-                    BodyBlock responseBody = new BodyBlock(rpcLitPayload);
-                    response.setBody(responseBody);
-                }
-            }
-        }
-    }
-
-    public void decodeDispatchMethod(XMLStreamReader reader, InternalMessage request, MessageInfo messageInfo) {
-    }
-
-    protected SOAPFaultInfo decodeFault(XMLStreamReader reader, InternalMessage internalMessage,
-                                        MessageInfo messageInfo) {
-        return null;
-    }
-
-/*
-*
-*/
-
-    protected void convertBodyBlock(InternalMessage request, MessageInfo messageInfo) {
-        BodyBlock bodyBlock = request.getBody();
-        if (bodyBlock != null) {
-            Object value = bodyBlock.getValue();
-            if (value instanceof JAXBBridgeInfo || value instanceof RpcLitPayload)
-            {
-                // Nothing to do
-            } else if (value instanceof Source) {
-                Source source = (Source) value;
-                XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true);
-                XMLStreamReaderUtil.nextElementContent(reader);
-                decodeBodyContent(reader, request, messageInfo);
-            } else {
-                throw new WebServiceException("Shouldn't happen. Unknown type in BodyBlock =" + value.getClass());
-            }
-        }
-    }
-
-    /**
-     * @param mi
-     * @param im
-     * @param message
-     * @throws SOAPException
-     * @throws ParseException
-     */
-    protected void processAttachments(MessageInfo mi, InternalMessage im, SOAPMessage message) throws SOAPException, ParseException, IOException {
-        Iterator iter = message.getAttachments();
-        if (iter.hasNext()) {
-            JAXWSAttachmentUnmarshaller au = null;
-            if (MessageInfoUtil.getRuntimeContext(mi) != null)
-                au = (JAXWSAttachmentUnmarshaller) MessageInfoUtil.getRuntimeContext(mi).getBridgeContext().getAttachmentUnmarshaller();
-            else {
-                //for dispatch
-                Unmarshaller m = (Unmarshaller)mi.getMetaData(BindingProviderProperties.DISPATCH_UNMARSHALLER);
-                if (m != null)
-                    au = (JAXWSAttachmentUnmarshaller) m.getAttachmentUnmarshaller();
-            }
-            if (au != null){
-                au.setXOPPackage(isXOPPackage(message));
-                au.setAttachments(im.getAttachments());
-            }
-        }
-
-        while (iter.hasNext()) {
-            AttachmentPart ap = (AttachmentPart) iter.next();
-            im.addAttachment(AttachmentBlock.fromSAAJ(ap));
-        }
-    }
-
-    /**
-     * From the SOAP message header find out if its a XOP package.
-     *
-     * @param sm
-     * @return
-     * @throws ParseException
-     */
-    private boolean isXOPPackage(SOAPMessage sm) throws ParseException {
-        String ct = getContentType(sm.getSOAPPart());
-        ContentType contentType = new ContentType(ct);
-        String primary = contentType.getPrimaryType();
-        String sub = contentType.getSubType();
-        if (primary.equalsIgnoreCase("application") && sub.equalsIgnoreCase("xop+xml"))
-        {
-            String type = contentType.getParameter("type");
-            if (type.toLowerCase().startsWith("text/xml") || type.toLowerCase().startsWith("application/soap+xml"))
-                return true;
-        }
-        return false;
-    }
-
-    private String getContentType(SOAPPart part) {
-        String[] values = part.getMimeHeader("Content-Type");
-        if (values == null)
-            return null;
-        else
-            return values[0];
-    }
-
-/*
-* It does mustUnderstand processing, and does best guess of MEP
-*
-* Avoids SAAJ call that create DOM.
-*
-*/
-
-    public boolean doMustUnderstandProcessing(SOAPMessage soapMessage,
-                                              MessageInfo mi, HandlerContext handlerContext, boolean getMEP)
-        throws SOAPException, IOException {
-        try {
-            boolean oneway = false;
-            Source source = soapMessage.getSOAPPart().getContent();
-            ByteInputStream bis = null;
-
-            if (source instanceof StreamSource) {
-                StreamSource streamSource = (StreamSource) source;
-                InputStream is = streamSource.getInputStream();
-                if (is != null && is instanceof ByteInputStream) {
-                    bis = ((ByteInputStream) is);
-                } else {
-                    logger.fine("SAAJ StreamSource doesn't have ByteInputStream " + is);
-                }
-            } else if (FastInfosetReflection.isFastInfosetSource(source)) {
-                try {
-                    bis = (ByteInputStream) FastInfosetReflection.
-                            FastInfosetSource_getInputStream(source);
-                }
-                catch (Exception e) {
-                    throw new XMLReaderException("fastinfoset.noImplementation");
-                }
-            } else {
-                logger.fine("Inefficient Use - SOAPMessage is already parsed");
-            }
-
-            XMLStreamReader reader =
-                SourceReaderFactory.createSourceReader(source, true);
-            XMLStreamReaderUtil.nextElementContent(reader);
-            checkMustUnderstandHeaders(reader, mi, handlerContext);
-
-            if (getMEP) {
-                oneway = isOneway(reader, mi);
-            }
-            XMLStreamReaderUtil.close(reader);
-            if (bis != null) {
-                bis.close();            // resets stream; SAAJ has whole stream
-            }
-
-            return oneway;
-        } catch (XMLStreamReaderException xe) {
-            raiseBadXMLFault(handlerContext);
-            throw xe;
-        }
-    }
-
-/*
-* returns Oneway or not. reader is on <Body>
-*
-* Peek into the body and make a best guess as to whether the request
-* is one-way or not. Assume request-response if it cannot be determined.
-*
-*/
-
-    private boolean isOneway(XMLStreamReader reader, MessageInfo mi) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());    // <Body>
-        int state = XMLStreamReaderUtil.nextElementContent(reader);
-        QName operationName = null;
-        if (state == START_ELEMENT) {   // handles empty Body i.e. <Body/>
-            operationName = reader.getName();
-        }
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-        rtCtxt.setMethodAndMEP(operationName, mi);
-        return (mi.getMEP() == MessageStruct.ONE_WAY_MEP);
-    }
-
-    /*
-     * Does MU processing. reader is on <Envelope>, at the end of this method
-     * leaves it on <Body>. Once the roles and understood headers are
-     * known, this calls a separate method to check the message headers
-     * since a different behavior is expected with different bindings.
-     *
-     * Also assume handler chain caller is null unless one is found.
-     */
-    private void checkMustUnderstandHeaders(XMLStreamReader reader,
-                                            MessageInfo mi, HandlerContext context) {
-
-        // Decode envelope
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        QName got = reader.getName();
-        QName exp = getEnvelopeTag();
-        if (got.getLocalPart().equals(exp.getLocalPart())) {
-            if (!got.getNamespaceURI().equals(exp.getNamespaceURI())) {
-                raiseFault(getVersionMismatchFaultCode(),
-                    "Invalid SOAP envelope version");
-            }
-        }
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-
-
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        if (!SOAPNamespaceConstants.TAG_HEADER.equals(reader.getLocalName())) {
-            return;             // No Header, no MU processing
-        }
-        XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-
-        // start with just the endpoint roles
-        Set<String> roles = new HashSet<String>();
-        roles.addAll(getRequiredRoles());
-        HandlerChainCaller hcCaller = MessageInfoUtil.getHandlerChainCaller(mi);
-        if (hcCaller != null) {
-            roles.addAll(hcCaller.getRoles());
-        }
-
-        if (logger.isLoggable(Level.FINEST)) {
-            logger.finest("roles:");
-            for (String r : roles) {
-                logger.finest("\t\"" + r + "\"");
-            }
-        }
-
-        // keep set=null if there are no understood headers
-        Set<QName> understoodHeaders = null;
-        if (rtCtxt != null) {
-            SOAPRuntimeModel model = (SOAPRuntimeModel) rtCtxt.getModel();
-            if (model != null && model.getKnownHeaders() != null) {
-                understoodHeaders = new HashSet<QName>(
-                    ((SOAPRuntimeModel) rtCtxt.getModel()).getKnownHeaders());
-            }
-        }
-        if (understoodHeaders == null) {
-            if (hcCaller != null) {
-                understoodHeaders = hcCaller.getUnderstoodHeaders();
-            }
-        } else {
-            if (hcCaller != null) {
-                understoodHeaders.addAll(hcCaller.getUnderstoodHeaders());
-            }
-        }
-
-        if (logger.isLoggable(Level.FINEST)) {
-            logger.finest("understood headers:");
-            if (understoodHeaders == null || understoodHeaders.isEmpty()) {
-                logger.finest("\tnone");
-            } else {
-                for (QName nameX : understoodHeaders) {
-                    logger.finest("\t" + nameX.toString());
-                }
-            }
-        }
-
-        checkHeadersAgainstKnown(reader, roles, understoodHeaders, mi);
-
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-    }
-
-    /*
-     * This method is overridden for other bindings
-     */
-    protected void checkHeadersAgainstKnown(XMLStreamReader reader,
-                                            Set<String> roles, Set<QName> understoodHeaders, MessageInfo mi) {
-
-        while (true) {
-            if (reader.getEventType() == START_ELEMENT) {
-                // check MU header for each role
-                QName qName = reader.getName();
-                String mu = reader.getAttributeValue(
-                    getMUAttrQName().getNamespaceURI(),
-                    getMUAttrQName().getLocalPart());
-                if (mu != null && (mu.equals("1") ||
-                    mu.equalsIgnoreCase("true"))) {
-                    String role = reader.getAttributeValue(
-                        getRoleAttrQName().getNamespaceURI(),
-                        getRoleAttrQName().getLocalPart());
-                    if (role != null && roles.contains(role)) {
-                        logger.finest("Element=" + qName +
-                            " targeted at=" + role);
-                        if (understoodHeaders == null ||
-                            !understoodHeaders.contains(qName)) {
-                            logger.finest("Element not understood=" + qName);
-
-                            SOAPFault sf = SOAPUtil.createSOAPFault(
-                                MUST_UNDERSTAND_FAULT_MESSAGE_STRING,
-                                SOAPConstants.FAULT_CODE_MUST_UNDERSTAND,
-                                role, null, SOAPBinding.SOAP11HTTP_BINDING);
-                            throw new SOAPFaultException(sf);
-                        }
-                    }
-                }
-                XMLStreamReaderUtil.skipElement(reader);   // Moves to END state
-                XMLStreamReaderUtil.nextElementContent(reader);
-            } else {
-                break;
-            }
-        }
-    }
-
-    protected boolean isDispatch(MessageInfo messageInfo) {
-
-        DispatchContext context = (DispatchContext)
-            messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        if (context != null)
-            return true;
-        return false;
-    }
-
-    protected String getSOAPMessageCharsetEncoding(SOAPMessage sm) throws SOAPException {
-        String charset = (String) sm.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
-        return (charset != null) ? charset : "UTF-8";
-    }
-
-    protected final void raiseFault(QName faultCode, String faultString) {
-        throw new SOAPFaultException(SOAPUtil.createSOAPFault(faultString, faultCode, null, null, getBindingId()));
-    }
-
-    protected void raiseBadXMLFault(HandlerContext ctxt) {
-    }
-
-    protected abstract QName getSenderFaultCode();
-
-    protected abstract QName getReceiverFaultCode();
-
-    protected abstract QName getVersionMismatchFaultCode();
-
-    public abstract String getBindingId();
-
-    private final static String DUPLICATE_HEADER =
-        "Duplicate Header in the message:";
-
-    public DispatchUtil getDispatchUtil() {
-        return dispatchUtil;
-    }
-
-    protected DispatchUtil dispatchUtil = new DispatchUtil();
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEPTFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEPTFactory.java
deleted file mode 100644
index 112c49f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEPTFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.jaxb.*;
-
-/**
- * Change the name of this class to JaxwsEPTFactory or something else. OR
- * split into multiple factories.
- */
-public interface SOAPEPTFactory {
-    public InternalEncoder getInternalEncoder();
-
-        /**
-         * @return the SOAPEncoder
-         */
-        public SOAPEncoder getSOAPEncoder();
-        /**
-         * @return the SOAPDecoder
-         */
-        public SOAPDecoder getSOAPDecoder();
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEncoder.java
deleted file mode 100644
index 9db33bd..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPEncoder.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.bind.api.JAXBRIContext;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.JAXB_OUTPUTSTREAM;
-import com.sun.xml.internal.ws.client.ContextMap;
-import com.sun.xml.internal.ws.client.RequestContext;
-import com.sun.xml.internal.ws.developer.JAXWSProperties;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentUnmarshaller;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayloadSerializer;
-import com.sun.xml.internal.ws.encoding.soap.internal.*;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.handler.SOAPHandlerContext;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.spi.runtime.InternalSoapEncoder;
-import com.sun.xml.internal.ws.spi.runtime.MtomCallback;
-import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.DOMUtil;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import org.w3c.dom.Document;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author WS Development Team
- */
-public abstract class SOAPEncoder implements Encoder, InternalSoapEncoder {
-
-    /*
-     * @see Encoder#encodeAndSend(MessageInfo)
-     */
-    public void encodeAndSend(MessageInfo messageInfo) {
-        throw new UnsupportedOperationException();
-    }
-
-    /*
-     * @see Encoder#encode(MessageInfo)
-     */
-    public ByteBuffer encode(MessageInfo messageInfo) {
-        throw new UnsupportedOperationException();
-    }
-
-    public InternalMessage toInternalMessage(MessageInfo messageInfo) {
-        return null;
-    }
-
-    public DOMSource toDOMSource(JAXBBridgeInfo bridgeInfo, MessageInfo messageInfo) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        Document doc = DOMUtil.createDom();
-        bridgeInfo.serialize(bridgeContext, doc);
-        return new DOMSource(doc);
-    }
-
-    public DOMSource toDOMSource(RpcLitPayload rpcLitPayload, MessageInfo messageInfo) {
-        try {
-            ByteArrayBuffer baos = new ByteArrayBuffer();
-            XMLStreamWriter writer = XMLStreamWriterFactory.createXMLStreamWriter(baos);
-            writeRpcLitPayload(rpcLitPayload, messageInfo, writer);
-            writer.close();
-            baos.close();
-            Transformer transformer = XmlUtil.newTransformer();
-            StreamSource source = new StreamSource(baos.newInputStream());
-            DOMResult domResult = new DOMResult();
-            transformer.transform(source, domResult);
-            return new DOMSource(domResult.getNode());
-        } catch (TransformerException te) {
-            throw new WebServiceException(te);
-        } catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    public DOMSource toDOMSource(SOAPFaultInfo faultInfo, MessageInfo messageInfo) {
-        try {
-            ByteArrayBuffer baos = new ByteArrayBuffer();
-            XMLStreamWriter writer = XMLStreamWriterFactory.createXMLStreamWriter(baos);
-            writeFault(faultInfo, messageInfo, writer);
-            writer.writeEndDocument();
-            writer.close();
-            baos.close();
-            Transformer transformer = XmlUtil.newTransformer();
-            StreamSource source = new StreamSource(baos.newInputStream());
-            DOMResult domResult = new DOMResult();
-            transformer.transform(source, domResult);
-            return new DOMSource(domResult.getNode());
-        }
-        catch (TransformerException te) {
-            throw new WebServiceException(te);
-        }
-        catch (XMLStreamException xe) {
-            throw new WebServiceException(xe);
-        }
-    }
-
-    protected void writeRpcLitPayload(RpcLitPayload rpcLitPayload, MessageInfo messageInfo,
-                                      XMLStreamWriter writer) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        RpcLitPayloadSerializer.serialize(rpcLitPayload, bridgeContext, messageInfo, writer);
-    }
-
-    protected void writeRpcLitPayload(RpcLitPayload rpcLitPayload, MessageInfo messageInfo,
-                                      OutputStream writer) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        RpcLitPayloadSerializer.serialize(rpcLitPayload, bridgeContext, writer);
-    }
-    protected JAXBContext getJAXBContext(MessageInfo messageInfo) {
-            JAXBContext jc = null;
-            RequestContext context = (RequestContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-            if (context != null)
-                jc = (JAXBContext) context.get(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-
-            return jc;
-        }
-
-    private void writeJAXBBeanInfo(JAXBBeanInfo beanInfo, MessageInfo messageInfo,
-                                   XMLStreamWriter writer) {
-        // Pass output stream directly to JAXB when available
-        OutputStream os = (OutputStream) messageInfo.getMetaData(JAXB_OUTPUTSTREAM);
-
-        Marshaller m = (Marshaller) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_MARSHALLER);
-        Unmarshaller u = (Unmarshaller) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_UNMARSHALLER);
-        beanInfo.setMarshallers(m, u);
-
-        if (os != null) {
-            try {
-                /*
-                 * Make sure that current element is closed before passing the
-                 * output stream to JAXB. Using Zephyr, it suffices to write
-                 * an empty string (TODO: other StAX impls?).
-                 */
-                writer.writeCharacters("");
-
-                // Flush output of StAX serializer
-                writer.flush();
-            }
-            catch (XMLStreamException e) {
-                throw new WebServiceException(e);
-            }
-
-            beanInfo.writeTo(os);
-
-        } else {
-
-            beanInfo.writeTo(writer);
-        }
-    }
-
-    private void writeJAXBBeanInfo(JAXBBeanInfo beanInfo, OutputStream writer) {
-        beanInfo.writeTo(writer);
-    }
-
-    /*
-    protected void writeJAXBTypeInfo(JAXBTypeInfo typeInfo, XMLStreamWriter writer) {
-        QName name = typeInfo.getName();
-        Object value = typeInfo.getType();
-        writeJAXBTypeInfo(name, value, writer);
-    }
-
-
-    protected void writeJAXBTypeInfo(QName name, Object value, XMLStreamWriter writer) {
-        JAXBContext jaxbContext = encoderDecoderUtil.getJAXBContext();
-        Map<QName, Class> typeMapping = encoderDecoderUtil.getTypeMapping();
-        Class type = typeMapping.get(name);
-        JAXBTypeSerializer.getInstance().serialize(name, type, value,
-                writer, jaxbContext);
-    }
-     */
-
-    protected void writeJAXBBridgeInfo(JAXBBridgeInfo bridgeInfo,
-                                       MessageInfo messageInfo, XMLStreamWriter writer) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-
-        // Pass output stream directly to JAXB when available
-        OutputStream os = (OutputStream) messageInfo.getMetaData(JAXB_OUTPUTSTREAM);
-        if (os != null) {
-            try {
-                /*
-                 * Make sure that current element is closed before passing the
-                 * output stream to JAXB. Using Zephyr, it suffices to write
-                 * an empty string (TODO: other StAX impls?).
-                 */
-                writer.writeCharacters("");
-
-                // Flush output of StAX serializer
-                writer.flush();
-            }
-            catch (XMLStreamException e) {
-                throw new WebServiceException(e);
-            }
-
-            bridgeInfo.serialize(bridgeContext, os, writer.getNamespaceContext());
-        } else {
-            bridgeInfo.serialize(bridgeContext, writer);
-        }
-    }
-
-    protected void writeJAXBBridgeInfo(JAXBBridgeInfo bridgeInfo,
-                                       MessageInfo messageInfo, OutputStream writer) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-        bridgeInfo.serialize(bridgeContext, writer, null);
-    }
-
-
-    public SOAPMessage toSOAPMessage(InternalMessage internalMessage, MessageInfo messageInfo) {
-        return null;
-    }
-
-    /*
-     * Replace the body in SOAPMessage with the BodyBlock of InternalMessage
-     */
-    public SOAPMessage toSOAPMessage(InternalMessage internalMessage,
-                                     SOAPMessage soapMessage) {
-        try {
-            BodyBlock bodyBlock = internalMessage.getBody();
-            if (bodyBlock == null)
-                return soapMessage;
-            Object value = bodyBlock.getValue();
-            if (value == null) {
-                return soapMessage;
-            }
-            if (value instanceof Source) {
-                Source source = (Source) value;
-                SOAPBody body = soapMessage.getSOAPBody();
-                body.removeContents();
-
-                Transformer transformer = XmlUtil.newTransformer();
-                transformer.transform(source, new DOMResult(body));
-            } else {
-                throw new UnsupportedOperationException("Unknown object in BodyBlock:" + value.getClass());
-            }
-            return soapMessage;
-        } catch (Exception e) {
-            throw new ServerRtException("soapencoder.err", new Object[]{e});
-        }
-    }
-
-    public static void serializeReader(XMLStreamReader reader, XMLStreamWriter writer) {
-        try {
-            int state;
-            do {
-                state = reader.next();
-                switch (state) {
-                    case XMLStreamConstants.START_ELEMENT:
-                        /*
-                         * TODO: Is this necessary, shouldn't zephyr return "" instead of
-                         * null for getNamespaceURI() and getPrefix()?
-                         */
-                        String uri = reader.getNamespaceURI();
-                        String prefix = reader.getPrefix();
-                        String localName = reader.getLocalName();
-
-                        if (prefix == null) {
-                            if (uri == null) {
-                                writer.writeStartElement(localName);
-                            } else {
-                                writer.writeStartElement(uri, localName);
-                            }
-                        } else {
-                            assert uri != null;
-
-                            if (prefix.length() > 0) {
-                                /**
-                                 * Before we write the
-                                 */
-                                String writerURI = null;
-                                if (writer.getNamespaceContext() != null)
-                                    writerURI = writer.getNamespaceContext().getNamespaceURI(prefix);
-                                String writerPrefix = writer.getPrefix(uri);
-                                if (declarePrefix(prefix, uri, writerPrefix, writerURI))
-                                {
-                                    writer.writeStartElement(prefix, localName, uri);
-                                    writer.setPrefix(prefix, uri != null ? uri : "");
-                                    writer.writeNamespace(prefix, uri);
-                                } else {
-                                    writer.writeStartElement(prefix, localName, uri);
-                                }
-                            } else {
-                                writer.writeStartElement(prefix, localName, uri);
-                            }
-                        }
-
-                        int n = reader.getNamespaceCount();
-                        // Write namespace declarations
-                        for (int i = 0; i < n; i++) {
-                            String nsPrefix = reader.getNamespacePrefix(i);
-                            if (nsPrefix == null) nsPrefix = "";
-                            // StAX returns null for default ns
-                            String writerURI = null;
-                            if (writer.getNamespaceContext() != null)
-                                writerURI = writer.getNamespaceContext().getNamespaceURI(nsPrefix);
-
-                            // Zephyr: Why is this returning null?
-                            // Compare nsPrefix with prefix because of [1] (above)
-                            String readerURI = reader.getNamespaceURI(i);
-
-                            /**
-                             * write the namespace in 3 conditions
-                             *  - when the namespace URI is not bound to the prefix in writer(writerURI == 0)
-                             *  - when the readerPrefix and writerPrefix are ""
-                             *  - when readerPrefix and writerPrefix are not equal and the URI bound to them
-                             *    are different
-                             */
-                            if (writerURI == null || ((nsPrefix.length() == 0) || (prefix.length() == 0)) ||
-                                (!nsPrefix.equals(prefix) && !writerURI.equals(readerURI)))
-                            {
-                                writer.setPrefix(nsPrefix, readerURI != null ? readerURI : "");
-                                writer.writeNamespace(nsPrefix, readerURI != null ? readerURI : "");
-                            }
-                        }
-
-                        // Write attributes
-                        n = reader.getAttributeCount();
-                        for (int i = 0; i < n; i++) {
-                            String attrPrefix = reader.getAttributePrefix(i);
-                            String attrURI = reader.getAttributeNamespace(i);
-
-                            writer.writeAttribute(attrPrefix != null ? attrPrefix : "",
-                                attrURI != null ? attrURI : "",
-                                reader.getAttributeLocalName(i),
-                                reader.getAttributeValue(i));
-                            // if the attribute prefix is undeclared in current writer scope then declare it
-                            setUndeclaredPrefix(attrPrefix, attrURI, writer);
-                        }
-                        break;
-                    case XMLStreamConstants.END_ELEMENT:
-                        writer.writeEndElement();
-                        break;
-                    case XMLStreamConstants.CHARACTERS:
-                        writer.writeCharacters(reader.getText());
-                }
-            } while (state != XMLStreamConstants.END_DOCUMENT);
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /**
-     * sets undeclared prefixes on the writer
-     *
-     * @param prefix
-     * @param writer
-     * @throws XMLStreamException
-     */
-    private static void setUndeclaredPrefix(String prefix, String readerURI, XMLStreamWriter writer) throws XMLStreamException {
-        String writerURI = null;
-        if (writer.getNamespaceContext() != null)
-            writerURI = writer.getNamespaceContext().getNamespaceURI(prefix);
-
-        if (writerURI == null) {
-            writer.setPrefix(prefix, readerURI != null ? readerURI : "");
-            writer.writeNamespace(prefix, readerURI != null ? readerURI : "");
-        }
-    }
-
-    /**
-     * check if we need to declare
-     *
-     * @param rPrefix
-     * @param rUri
-     * @param wPrefix
-     * @param wUri
-     * @return
-     */
-    private static boolean declarePrefix(String rPrefix, String rUri, String wPrefix, String wUri) {
-        if (wUri == null || ((wPrefix != null) && !rPrefix.equals(wPrefix)) ||
-            (rUri != null && !wUri.equals(rUri)))
-            return true;
-        return false;
-    }
-
-    protected void serializeSource(Source source, XMLStreamWriter writer) {
-        try {
-            XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true);
-            serializeReader(reader, writer);
-            reader.close();
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    protected void serializeSource(Source source, OutputStream writer) {
-        try {
-            Transformer t = XmlUtil.newTransformer();
-            t.transform(source, new StreamResult(writer));
-        }
-        catch (Exception e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /*
-     * writes start tag of envelope: <env:Envelope>
-     */
-    protected void startEnvelope(XMLStreamWriter writer) {
-        try {
-            //write SOAP Envelope
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_ENVELOPE, SOAPNamespaceConstants.ENVELOPE);
-            writer.setPrefix(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.ENVELOPE);
-            writer.writeNamespace(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.ENVELOPE);
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /*
-     * write the known namespace declaration to the envelope
-     */
-    protected void writeEnvelopeNamespaces(XMLStreamWriter writer, MessageInfo messageInfo)
-        throws XMLStreamException {
-
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        if (rtCtxt != null && rtCtxt.getModel() != null) {
-            writer.setPrefix("xsd", SOAPNamespaceConstants.XSD);
-            writer.writeNamespace("xsd", SOAPNamespaceConstants.XSD);
-            int i = 1;
-            String prefix;
-            for (String namespace : rtCtxt.getModel().getKnownNamespaceURIs()) {
-                prefix = "ns" + i++;
-                writer.setPrefix(prefix, namespace);
-                writer.writeNamespace(prefix, namespace);
-            }
-            writer.writeCharacters("");
-        }
-    }
-
-    /*
-    * writes start tag of Body: <env:Body>
-    */
-    protected void startBody(XMLStreamWriter writer) {
-        try {
-            //write SOAP Body
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_BODY, SOAPNamespaceConstants.ENVELOPE);
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /*
-     * writes start tag of Header: <env:Header>
-     */
-    protected void startHeader(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_HEADER, SOAPNamespaceConstants.ENVELOPE); // <env:Header>
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /*
-     * writes multiple header elements in <env:Header> ... </env:Header>
-     */
-    protected void writeHeaders(XMLStreamWriter writer, InternalMessage response,
-                                MessageInfo messageInfo) {
-        try {
-            List<HeaderBlock> headerBlocks = response.getHeaders();
-            if (headerBlocks == null || headerBlocks.isEmpty()) {
-                return;
-            }
-            startHeader(writer); // <env:Header>
-            for (HeaderBlock headerBlock : headerBlocks) {
-                Object value = headerBlock.getValue();
-                if (value != null) {
-                    if (value instanceof JAXBBridgeInfo) {
-                        writeJAXBBridgeInfo((JAXBBridgeInfo) value,
-                            messageInfo, writer);
-                    } else {
-                        throw new SerializationException("unknown.object",
-                            value.getClass().getName());
-                    }
-                } else {
-                    // currently only in soap 1.2
-                    if (headerBlock instanceof SOAP12NotUnderstoodHeaderBlock) {
-                        ((SOAP12NotUnderstoodHeaderBlock) headerBlock).write(
-                            writer);
-                    }
-                }
-            }
-            writer.writeEndElement();                                // </env:Header>
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /*
-     * writes <env:Body> ... </env:Body>
-     */
-    protected void writeBody(XMLStreamWriter writer, InternalMessage response,
-                             MessageInfo messageInfo) {
-        try {
-            startBody(writer);
-            BodyBlock bodyBlock = response.getBody();
-            // BodyBlock can be null if there is no part in wsdl:message
-            if (bodyBlock != null) {
-                Object value = bodyBlock.getValue();
-                if (value instanceof JAXBBridgeInfo) {
-                    writeJAXBBridgeInfo((JAXBBridgeInfo) value, messageInfo, writer);
-                } else if (value instanceof RpcLitPayload) {
-                    writeRpcLitPayload((RpcLitPayload) value, messageInfo, writer);
-                } else if (value instanceof Source) {
-                    serializeSource((Source) value, writer);
-                } else if (value instanceof SOAPFaultInfo) {
-                    writeFault((SOAPFaultInfo) value, messageInfo, writer);
-                } else if (value instanceof JAXBBeanInfo) {
-
-                       if (((JAXBBeanInfo)value).getBean() != null && (DispatchContext)
-                    messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT) != null)
-                       writeJAXBBeanInfo((JAXBBeanInfo) value, messageInfo, writer);
-                } else if (value == null && (DispatchContext)
-                    messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT) != null) {
-                    //bug 6400596  -Dispatch and null invocation parameter payload mode
-                    //can skip this here as we want to write and empty SOAPBody
-                    //writeJAXBBeanInfo((JAXBBeanInfo) value, messageInfo, writer);
-                } else {
-                    throw new SerializationException("unknown.object",
-                        value.getClass().getName());
-                }
-            }
-            writer.writeEndElement();                // </env:body>
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /**
-     * Pass reference of attachments Map from InternalMessage to JAXWSAttachmentMarshaller.
-     *
-     * @param mi
-     * @param im
-     */
-    public void setAttachmentsMap(MessageInfo mi, InternalMessage im) {
-        Object rtc = mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtc != null) {
-            BridgeContext bc = ((RuntimeContext) rtc).getBridgeContext();
-            if (bc == null)
-                return;
-            JAXWSAttachmentMarshaller am = (JAXWSAttachmentMarshaller) bc.getAttachmentMarshaller();
-            am.setAttachments(im.getAttachments());
-            am.setHandlerContaxt(((RuntimeContext) rtc).getHandlerContext());
-
-            HandlerContext hc = ((RuntimeContext) rtc).getHandlerContext();
-            Object mtomThreshold;
-            if (hc == null) {
-                //to be removed when client guarantees handlerContext
-                mtomThreshold = mi.getMetaData(JAXWSProperties.MTOM_THRESHOLOD_VALUE);
-            } else {
-                mtomThreshold = hc.getMessageContext().get(JAXWSProperties.MTOM_THRESHOLOD_VALUE);
-            }
-            if (mtomThreshold != null)
-                am.setMtomThresholdValue((Integer) mtomThreshold);
-        } else if (mi.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT) != null){
-            ContextMap map = (ContextMap) mi.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-            BindingProvider provider = (BindingProvider)
-                map.get(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-
-            JAXBContext jc = (JAXBContext) map.get(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-
-            if (jc != null) {
-                try {
-                    Marshaller m = jc.createMarshaller();
-                    Unmarshaller um = jc.createUnmarshaller();
-                    JAXWSAttachmentMarshaller am =
-                        new JAXWSAttachmentMarshaller(((SOAPBinding) provider.getBinding()).isMTOMEnabled());
-                    JAXWSAttachmentUnmarshaller uam = new JAXWSAttachmentUnmarshaller();
-                    am.setAttachments(im.getAttachments());
-                    m.setAttachmentMarshaller(am);
-                    um.setAttachmentUnmarshaller(uam);
-                    mi.setMetaData(BindingProviderProperties.DISPATCH_MARSHALLER, m);
-                    mi.setMetaData(BindingProviderProperties.DISPATCH_UNMARSHALLER, um);
-                    //set handlerContext
-                    am.setHandlerContaxt((SOAPHandlerContext)
-                    mi.getMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY));
-
-                    HandlerContext hc =
-                        (HandlerContext)mi.getMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY);
-                    //set XOP optimization to true for jaxb
-                    am.setXOPPackage(((SOAPBinding)provider.getBinding()).isMTOMEnabled());
-                    uam.setXOPPackage(((SOAPBinding)provider.getBinding()).isMTOMEnabled());
-
-                    Object mtomThreshold;
-                    if (hc == null) {
-                        //to be removed when client guarantees handlerContext
-                        mtomThreshold = mi.getMetaData(JAXWSProperties.MTOM_THRESHOLOD_VALUE);
-                    } else {
-                        mtomThreshold = hc.getMessageContext().get(JAXWSProperties.MTOM_THRESHOLOD_VALUE);
-                    }
-                    if (mtomThreshold != null)
-                        am.setMtomThresholdValue((Integer) mtomThreshold);
-                } catch (Exception e) {
-                    throw new WebServiceException(e);
-                }
-
-            }
-
-        }
-    }
-
-    /**
-     * Add all the attachments in the InternalMessage to the SOAPMessage
-     *
-     * @param im
-     * @param msg
-     */
-    protected void processAttachments(InternalMessage im, SOAPMessage msg) throws SOAPException {
-        for (Map.Entry<String, AttachmentBlock> e : im.getAttachments().entrySet()) {
-            AttachmentBlock block = e.getValue();
-            block.addTo(msg);
-        }
-    }
-
-    /*
-    * writes end tag of envelope: </env:Envelope>
-    */
-    protected void endEnvelope(XMLStreamWriter writer) {
-        try {
-            writer.writeEndElement();
-        }
-        catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    protected void writeFault(SOAPFaultInfo instance, MessageInfo messageInfo, XMLStreamWriter writer) {
-        throw new UnsupportedOperationException();
-    }
-
-    protected void writeFault(SOAPFaultInfo instance, MessageInfo messageInfo, OutputStream out) {
-        XMLStreamWriter writer = XMLStreamWriterFactory.createXMLStreamWriter(out);
-        writeFault(instance, messageInfo, writer);
-    }
-
-
-    public void write(Object value, Object obj, OutputStream writer, MtomCallback mtomCallback) {
-        if (!(obj instanceof MessageInfo))
-            throw new SerializationException("incorrect.messageinfo", obj.getClass().getName());
-        MessageInfo mi = (MessageInfo) obj;
-        Object rtc = mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtc != null) {
-            BridgeContext bc = ((RuntimeContext) rtc).getBridgeContext();
-            if (bc != null) {
-                JAXWSAttachmentMarshaller am = (JAXWSAttachmentMarshaller)
-                        ((RuntimeContext) rtc).getBridgeContext().getAttachmentMarshaller();
-                am.setMtomCallback(mtomCallback);
-            }
-        } else {
-            //dispatch
-            Marshaller m = (Marshaller)mi.getMetaData(BindingProviderProperties.DISPATCH_MARSHALLER);
-            if (m != null) {
-                JAXWSAttachmentMarshaller am = (JAXWSAttachmentMarshaller)m.getAttachmentMarshaller();
-                am.setMtomCallback(mtomCallback);
-            }
-        }
-        if (value instanceof JAXBBridgeInfo) {
-            writeJAXBBridgeInfo((JAXBBridgeInfo) value, mi, writer);
-        } else if (value instanceof RpcLitPayload) {
-            writeRpcLitPayload((RpcLitPayload) value, mi, writer);
-        } else if (value instanceof Source) {
-            serializeSource((Source) value, writer);
-        } else if (value instanceof SOAPFaultInfo) {
-            writeFault((SOAPFaultInfo) value, mi, writer);
-        } else if (value instanceof JAXBBeanInfo) {
-            writeJAXBBeanInfo((JAXBBeanInfo) value, writer);
-        } else {
-            throw new SerializationException("unknown.object", value.getClass().getName());
-        }
-    }
-
-    public void write(Object value, Object obj, XMLStreamWriter writer, MtomCallback mtomCallback) {
-        if (!(obj instanceof MessageInfo))
-            throw new SerializationException("incorrect.messageinfo", obj.getClass().getName());
-        MessageInfo mi = (MessageInfo) obj;
-        Object rtc = mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtc != null) {
-            BridgeContext bc = ((RuntimeContext) rtc).getBridgeContext();
-            if (bc != null) {
-                JAXWSAttachmentMarshaller am = (JAXWSAttachmentMarshaller) ((RuntimeContext) rtc).getBridgeContext().getAttachmentMarshaller();
-                am.setMtomCallback(mtomCallback);
-            }
-        } else {
-            //dispatch
-            Marshaller m = (Marshaller)mi.getMetaData(BindingProviderProperties.DISPATCH_MARSHALLER);
-            if (m != null) {
-                JAXWSAttachmentMarshaller am = (JAXWSAttachmentMarshaller)m.getAttachmentMarshaller();
-                am.setMtomCallback(mtomCallback);
-            }
-        }
-        if (value instanceof JAXBBridgeInfo) {
-            writeJAXBBridgeInfo((JAXBBridgeInfo) value, mi, writer);
-        } else if (value instanceof RpcLitPayload) {
-            writeRpcLitPayload((RpcLitPayload) value, mi, writer);
-        } else if (value instanceof Source) {
-            serializeSource((Source) value, writer);
-        } else if (value instanceof SOAPFaultInfo) {
-            writeFault((SOAPFaultInfo) value, mi, writer);
-        } else if (value instanceof JAXBBeanInfo) {
-            writeJAXBBeanInfo((JAXBBeanInfo) value, mi, writer);
-        } else {
-            throw new SerializationException("unknown.object", value.getClass().getName());
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPVersion.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPVersion.java
deleted file mode 100644
index dc6b152..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAPVersion.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap;
-
-import javax.xml.ws.soap.SOAPBinding;
-
-
-/**
- * @author WS Development Team
- */
-
-public class SOAPVersion {
-
-    private final String version;
-
-    private SOAPVersion(String ver) {
-        this.version = ver;
-    }
-
-    public String toString() {
-        return this.version;
-    }
-
-    public boolean equals(String strVersion) {
-        return version.equals(strVersion);
-    }
-
-    public static final SOAPVersion SOAP_11 = new SOAPVersion(SOAPBinding.SOAP11HTTP_BINDING);
-    public static final SOAPVersion SOAP_12 = new SOAPVersion(SOAPBinding.SOAP12HTTP_BINDING);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java
index da58eb1..f3df20a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
         super(throwable);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.encoding";
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java
index e6b7cd7..29a8a44 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializerConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ServerEncoderDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ServerEncoderDecoder.java
deleted file mode 100644
index 309ebc1..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/ServerEncoderDecoder.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.model.CheckedException;
-import com.sun.xml.internal.ws.model.ExceptionType;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.Parameter;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.model.WrapperParameter;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.StringUtils;
-
-import javax.xml.ws.Holder;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Vivek Pandey
- *
- * Server SOAP encoder decoder
- */
-public class ServerEncoderDecoder extends EncoderDecoder implements InternalEncoder {
-    public ServerEncoderDecoder() {
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see com.sun.xml.internal.ws.encoding.util.EncoderDecoderBase#toMessageInfo(java.lang.Object,
-     *      com.sun.pept.ept.MessageInfo)
-     */
-    public void toMessageInfo(Object intMessage, MessageInfo mi) {
-        InternalMessage im = (InternalMessage) intMessage;
-        RuntimeContext rtContext = (RuntimeContext) mi.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-
-        BodyBlock bodyBlock = im.getBody();
-        JavaMethod jm = rtContext.getModel().getJavaMethod(mi.getMethod());
-        mi.setMEP(jm.getMEP());
-        List<HeaderBlock> headers = im.getHeaders();
-        Map<String, AttachmentBlock> attachments = im.getAttachments();
-
-        Iterator<Parameter> iter = jm.getRequestParameters().iterator();
-        Object bodyValue = (bodyBlock == null) ? null :  bodyBlock.getValue();
-
-        int numInputParams = jm.getInputParametersCount();
-        Object data[] = new Object[numInputParams];
-        SOAPBinding soapBinding = (SOAPBinding)jm.getBinding();
-        while (iter.hasNext()) {
-            Parameter param = iter.next();
-            ParameterBinding paramBinding = param.getInBinding();
-            Object obj = null;
-            if (paramBinding.isBody()) {
-                obj = bodyValue;
-            } else if (headers != null && paramBinding.isHeader()) {
-                HeaderBlock header = getHeaderBlock(param.getName(), headers);
-                obj = (header != null)?header.getValue():null;
-            } else if (paramBinding.isAttachment()) {
-              obj = getAttachment(rtContext, attachments, param, paramBinding);
-            }
-            fillData(rtContext, param, obj, data, soapBinding, paramBinding);
-        }
-        Iterator<Parameter> resIter = jm.getResponseParameters().iterator();
-        while(resIter.hasNext()){
-            Parameter p = resIter.next();
-            createOUTHolders(p, data);
-        }
-        mi.setData(data);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see com.sun.xml.internal.ws.encoding.util.EncoderDecoderBase#toInternalMessage(com.sun.pept.ept.MessageInfo)
-     */
-    public Object toInternalMessage(MessageInfo mi) {
-        RuntimeContext rtContext = MessageInfoUtil.getRuntimeContext(mi);
-        RuntimeModel model = rtContext.getModel();
-        JavaMethod jm = model.getJavaMethod(mi.getMethod());
-        Object[] data = mi.getData();
-        Object result = mi.getResponse();
-        InternalMessage im = new InternalMessage();
-        if(rtContext.getHandlerContext() != null){
-            copyAttachmentProperty(rtContext.getHandlerContext().getMessageContext(), im);
-        }
-        BindingImpl bindingImpl =
-            (BindingImpl)rtContext.getRuntimeEndpointInfo().getBinding();
-        String bindingId = bindingImpl.getBindingId();
-
-        switch (mi.getResponseType()) {
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-                if(!(result instanceof java.lang.Exception)){
-                    throw new SerializationException("exception.incorrectType", result.getClass().toString());
-                }
-                CheckedException ce = jm.getCheckedException(result.getClass());
-                if(ce == null){
-                    throw new SerializationException("exception.notfound", result.getClass().toString());
-                }
-                Object detail = getDetail(jm.getCheckedException(result.getClass()), result);
-                JAXBBridgeInfo di = new JAXBBridgeInfo(model.getBridge(ce.getDetailType()), detail);
-
-                if (bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)) {
-                    SOAPRuntimeModel.createFaultInBody(result, null, di, im);
-                } else if (bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)){
-                    SOAPRuntimeModel.createSOAP12FaultInBody(result, null, null, di, im);
-                }
-
-                return im;
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                if (bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING))
-                    SOAPRuntimeModel.createFaultInBody(result, getActor(), null, im);
-                else if (bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING))
-                    SOAPRuntimeModel.createSOAP12FaultInBody(result, null, null, null, im);
-                return im;
-        }
-
-        SOAPBinding soapBinding = (SOAPBinding)jm.getBinding();
-        Iterator<Parameter> iter = jm.getResponseParameters().iterator();
-        while (iter.hasNext()) {
-            Parameter param = iter.next();
-            ParameterBinding paramBinding = param.getOutBinding();
-            Object obj = createPayload(rtContext, param, data, result, soapBinding, paramBinding);
-            if (paramBinding.isBody()) {
-                im.setBody(new BodyBlock(obj));
-            } else if (paramBinding.isHeader()) {
-                im.addHeader(new HeaderBlock((JAXBBridgeInfo)obj));
-            } else if (paramBinding.isAttachment()) {
-                addAttachmentPart(rtContext, im, obj, param);
-            }
-        }
-        return im;
-    }
-
-    private Object getDetail(CheckedException ce, Object exception) {
-        if(ce.getExceptionType().equals(ExceptionType.UserDefined)){
-            return createDetailFromUserDefinedException(ce, exception);
-        }
-        try {
-            Method m = exception.getClass().getMethod("getFaultInfo");
-            return m.invoke(exception);
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    private Object createDetailFromUserDefinedException(CheckedException ce, Object exception) {
-        Class detailBean = ce.getDetailBean();
-        Field[] fields = detailBean.getDeclaredFields();
-        try {
-            Object detail = detailBean.newInstance();
-            for(Field f : fields){
-                Method em = exception.getClass().getMethod(getReadMethod(f));
-                Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType());
-                sm.invoke(detail, em.invoke(exception));
-            }
-            return detail;
-        } catch(Exception e){
-            throw new SerializationException(e);
-        }
-    }
-
-    private String getReadMethod(Field f){
-        if(f.getType().isAssignableFrom(boolean.class))
-            return "is" + StringUtils.capitalize(f.getName());
-        return "get" + StringUtils.capitalize(f.getName());
-    }
-
-    private String getWriteMethod(Field f){
-        return "set" + StringUtils.capitalize(f.getName());
-    }
-
-    /**
-     * @return the actor
-     */
-    public String getActor() {
-        return null;
-    }
-
-    /**
-     * To be used by the incoming message on the server side to set the OUT
-     * holders with Holder instance.
-     *
-     * @param data
-     */
-    private void createOUTHolders(Parameter param, Object[] data) {
-        if(param.isWrapperStyle()){
-            for(Parameter p : ((WrapperParameter)param).getWrapperChildren()){
-                if(!p.isResponse() && p.isOUT())
-                    data[p.getIndex()] = new Holder();
-            }
-            return;
-        }
-        //its BARE
-        if (!param.isResponse() && param.isOUT())
-            data[param.getIndex()] = new Holder();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLDecoder.java
deleted file mode 100644
index 427e783..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLDecoder.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.client;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.simpletype.EncoderUtils;
-import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultCode;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultCodeEnum;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultReason;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultReasonText;
-import com.sun.xml.internal.ws.encoding.soap.message.FaultSubcode;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAP12FaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.xml.internal.ws.client.dispatch.impl.encoding.DispatchSerializer;
-
-import javax.xml.namespace.QName;
-import static javax.xml.stream.XMLStreamConstants.*;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.ws.soap.SOAPBinding;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- * @author WS Development Team
- */
-public class SOAP12XMLDecoder extends SOAPXMLDecoder {
-
-    //needs further cleanup
-    private static final Logger logger =
-        Logger.getLogger (new StringBuffer ().append (com.sun.xml.internal.ws.util.Constants.LoggingDomain).append (".client.dispatch").toString ());
-
-    public SOAP12XMLDecoder () {
-    }
-
-    protected DispatchSerializer getSerializerInstance (){
-        return DispatchSerializer.SOAP_1_2;
-    }
-
-    /*
-     *
-     * @see SOAPXMLDecoder#decodeFault(XMLStreamReader, InternalMessage, MessageInfo)
-     */
-    @Override
-    protected SOAPFaultInfo decodeFault (XMLStreamReader reader, InternalMessage internalMessage, MessageInfo messageInfo) {
-        XMLStreamReaderUtil.verifyReaderState (reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_SOAP_FAULT);
-
-        // env:Code
-        XMLStreamReaderUtil.nextElementContent (reader);
-        XMLStreamReaderUtil.verifyReaderState (reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_CODE);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        //env:Value
-        QName faultcode = readFaultValue (reader);
-        FaultCodeEnum codeValue = FaultCodeEnum.get (faultcode);
-        if(codeValue == null)
-            throw new DeserializationException ("unknown fault code:", faultcode.toString ());
-
-
-        //Subcode
-        FaultSubcode subcode = null;
-        if(reader.getEventType () == START_ELEMENT)
-            subcode = readFaultSubcode (reader);
-        FaultCode code = new FaultCode (codeValue, subcode);
-
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_CODE);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        FaultReason reason = readFaultReason (reader);
-        String node = null;
-        String role = null;
-        Object detail = null;
-
-        QName name = reader.getName ();
-        if(name.equals (SOAP12Constants.QNAME_FAULT_NODE)){
-            node = reader.getText ();
-        }
-
-        if(name.equals (SOAP12Constants.QNAME_FAULT_ROLE)){
-            XMLStreamReaderUtil.nextContent (reader);
-            role = reader.getText ();
-            XMLStreamReaderUtil.nextElementContent (reader);
-            XMLStreamReaderUtil.nextElementContent (reader);
-        }
-
-        if(name.equals (SOAP12Constants.QNAME_FAULT_DETAIL)){
-            //TODO: process encodingStyle attribute information item
-            XMLStreamReaderUtil.nextElementContent (reader);
-            detail = readFaultDetail (reader, messageInfo);
-            XMLStreamReaderUtil.nextElementContent (reader);
-        }
-
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_SOAP_FAULT);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        return new SOAP12FaultInfo (code, reason, node, role, detail);
-    }
-
-    protected QName readFaultValue (XMLStreamReader reader){
-        XMLStreamReaderUtil.verifyReaderState (reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_VALUE);
-
-        XMLStreamReaderUtil.nextContent (reader);
-
-        String tokens = reader.getText ();
-
-        XMLStreamReaderUtil.next (reader);
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_VALUE);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        String uri = "";
-        tokens = EncoderUtils.collapseWhitespace (tokens);
-        String prefix = XmlUtil.getPrefix (tokens);
-        if (prefix != null) {
-            uri = reader.getNamespaceURI (prefix);
-            if (uri == null) {
-                throw new DeserializationException ("xsd.unknownPrefix", prefix);
-            }
-        }
-        String localPart = XmlUtil.getLocalPart (tokens);
-        return new QName (uri, localPart);
-    }
-
-    protected FaultSubcode readFaultSubcode (XMLStreamReader reader){
-        FaultSubcode code = null;
-        QName name = reader.getName ();
-        if(name.equals (SOAP12Constants.QNAME_FAULT_SUBCODE)){
-            XMLStreamReaderUtil.nextElementContent (reader);
-            QName faultcode = readFaultValue (reader);
-            FaultSubcode subcode = null;
-            if(reader.getEventType () == START_ELEMENT)
-                subcode = readFaultSubcode (reader);
-            code = new FaultSubcode (faultcode, subcode);
-            XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-            XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_SUBCODE);
-            XMLStreamReaderUtil.nextElementContent (reader);
-        }
-        return code;
-    }
-
-    protected FaultReason readFaultReason (XMLStreamReader reader){
-        XMLStreamReaderUtil.verifyReaderState (reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_REASON);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        //soapenv:Text
-        List<FaultReasonText> texts = new ArrayList<FaultReasonText>();
-        readFaultReasonTexts (reader, texts);
-
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_REASON);
-        XMLStreamReaderUtil.nextElementContent (reader);
-
-        FaultReasonText[] frt = texts.toArray (new FaultReasonText[0]);
-        return new FaultReason (frt);
-    }
-
-    protected void readFaultReasonTexts (XMLStreamReader reader, List<FaultReasonText> texts) {
-        QName name = reader.getName ();
-        if (!name.equals (SOAP12Constants.QNAME_FAULT_REASON_TEXT)) {
-            return;
-        }
-        String lang = reader.getAttributeValue (SOAP12NamespaceConstants.XML_NS, "lang");
-        //lets be more forgiving, if its null lets assume its 'en'
-        if(lang == null)
-            lang = "en";
-
-        //TODO: what to do when the lang is other than 'en', for example clingon?
-
-        //get the text value
-        XMLStreamReaderUtil.nextContent (reader);
-        String text = null;
-        if (reader.getEventType () == CHARACTERS) {
-            text = reader.getText ();
-            XMLStreamReaderUtil.next (reader);
-        }
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, SOAP12Constants.QNAME_FAULT_REASON_TEXT);
-        XMLStreamReaderUtil.nextElementContent (reader);
-        Locale loc = new Locale(lang);
-
-        texts.add (new FaultReasonText (text, loc));
-
-        //call again to see if there are more soapenv:Text elements
-        readFaultReasonTexts (reader, texts);
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#decodeHeader(com.sun.xml.internal.ws.streaming.XMLStreamReader, com.sun.pept.ept.MessageInfo, com.sun.xml.internal.ws.soap.internal.InternalMessage)
-     */
-    @Override
-    protected void decodeHeader (XMLStreamReader reader, MessageInfo messageInfo, InternalMessage request) {
-        XMLStreamReaderUtil.verifyReaderState (reader, START_ELEMENT);
-        if (!SOAPNamespaceConstants.TAG_HEADER.equals (reader.getLocalName ())) {
-            return;
-        }
-        XMLStreamReaderUtil.verifyTag (reader, getHeaderTag ());
-        XMLStreamReaderUtil.nextElementContent (reader);
-        while (true) {
-            if (reader.getEventType () == START_ELEMENT) {
-                decodeHeaderElement (reader, messageInfo, request);
-            } else {
-                break;
-            }
-        }
-        XMLStreamReaderUtil.verifyReaderState (reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag (reader, getHeaderTag ());
-        XMLStreamReaderUtil.nextElementContent (reader);
-    }
-
-    /*
-     * If JAXB can deserialize a header, deserialize it.
-     * Otherwise, just ignore the header
-     */
-    protected void decodeHeaderElement (XMLStreamReader reader, MessageInfo messageInfo,
-        InternalMessage msg) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext (messageInfo);
-        BridgeContext bridgeContext = rtCtxt.getBridgeContext ();
-        Set<QName> knownHeaders = ((SOAPRuntimeModel) rtCtxt.getModel ()).getKnownHeaders ();
-        QName name = reader.getName ();
-        if (knownHeaders != null && knownHeaders.contains (name)) {
-            QName headerName = reader.getName ();
-            if (msg.isHeaderPresent (name)) {
-                // More than one instance of header whose QName is mapped to a
-                // method parameter. Generates a runtime error.
-                raiseFault (getSenderFaultCode(), "Duplicate Header" + headerName);
-            }
-            Object decoderInfo = rtCtxt.getDecoderInfo (name);
-            if (decoderInfo != null && decoderInfo instanceof JAXBBridgeInfo) {
-                JAXBBridgeInfo bridgeInfo = (JAXBBridgeInfo) decoderInfo;
-                // JAXB leaves on </env:Header> or <nextHeaderElement>
-                bridgeInfo.deserialize(reader,bridgeContext);
-                HeaderBlock headerBlock = new HeaderBlock (bridgeInfo);
-                msg.addHeader (headerBlock);
-            }
-        } else {
-            XMLStreamReaderUtil.skipElement (reader);                 // Moves to END state
-            XMLStreamReaderUtil.nextElementContent (reader);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getFaultTag()
-     */
-    @Override
-    protected QName getFaultTag (){
-        return SOAP12Constants.QNAME_SOAP_FAULT;
-    }
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getBodyTag()
-     */
-    @Override
-    protected QName getBodyTag () {
-        return SOAP12Constants.QNAME_SOAP_BODY;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getEnvelopeTag()
-     */
-    @Override
-    protected QName getEnvelopeTag () {
-        return SOAP12Constants.QNAME_SOAP_ENVELOPE;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getHeaderTag()
-     */
-    @Override
-    protected QName getHeaderTag () {
-        return SOAP12Constants.QNAME_SOAP_HEADER;
-    }
-
-    @Override
-    protected QName getMUAttrQName (){
-        return SOAP12Constants.QNAME_MUSTUNDERSTAND;
-    }
-
-    @Override
-    protected QName getRoleAttrQName (){
-        return SOAP12Constants.QNAME_ROLE;
-    }
-
-    @Override
-    protected QName getFaultDetailTag() {
-        return SOAP12Constants.QNAME_FAULT_DETAIL;
-    }
-
-    @Override
-    public String getBindingId() {
-        return SOAPBinding.SOAP12HTTP_BINDING;
-    }
-
-    @Override
-    protected QName getSenderFaultCode() {
-        return SOAP12Constants.FAULT_CODE_SERVER;
-    }
-
-    @Override
-    protected QName getReceiverFaultCode() {
-        return SOAP12Constants.FAULT_CODE_CLIENT;
-    }
-
-    @Override
-    protected QName getVersionMismatchFaultCode() {
-        return SOAP12Constants.FAULT_CODE_VERSION_MISMATCH;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLEncoder.java
deleted file mode 100644
index 7f6c360..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAP12XMLEncoder.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.client;
-
-import static java.util.logging.Logger.getLogger;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.JAXWS_CONTEXT_PROPERTY;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.bind.JAXBContext;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-import com.sun.xml.internal.ws.client.SenderException;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-
-import java.util.logging.Logger;
-import java.util.List;
-import java.io.ByteArrayOutputStream;
-import java.nio.ByteBuffer;
-import java.lang.reflect.Method;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-
-/**
- * @author WS Development Team
- */
-public class SOAP12XMLEncoder extends SOAPXMLEncoder {
-
-
-    private static final Logger logger =
-           getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch.util").toString());
-
-    /*
-     * @see SOAPEncoder#startEnvelope(XMLStreamWriter)
-     */
-    @Override
-    protected void startEnvelope(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_ENVELOPE, SOAP12NamespaceConstants.ENVELOPE);
-            writer.setPrefix(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                             SOAP12NamespaceConstants.ENVELOPE);
-            writer.writeNamespace(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                                  SOAP12NamespaceConstants.ENVELOPE);
-        } catch (XMLStreamException e) {
-            throw new SenderException(e);
-        }
-    }
-
-    /*
-     * @see SOAPEncoder#startBody(XMLStreamWriter)
-     */
-    @Override
-    protected void startBody(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_BODY, SOAP12NamespaceConstants.ENVELOPE);
-        } catch (XMLStreamException e) {
-            throw new SenderException(e);
-        }
-    }
-
-    /*
-     * @see SOAPEncoder#startHeader(XMLStreamWriter)
-     */
-    @Override
-    protected void startHeader(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_HEADER,
-                SOAP12NamespaceConstants.ENVELOPE);     // <env:Header>
-        } catch (XMLStreamException e) {
-            throw new SenderException(e);
-        }
-    }
-
-    protected String getContentType(MessageInfo messageInfo,
-        JAXWSAttachmentMarshaller marshaller)
-    {
-        String contentNegotiation = (String)
-            messageInfo.getMetaData(BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY);
-
-        if (marshaller == null) {
-            marshaller = MessageInfoUtil.getAttachmentMarshaller(messageInfo);
-        }
-
-        if (marshaller != null && marshaller.isXopped()) {
-            return XOP_SOAP12_XML_TYPE_VALUE;
-        }
-        else {
-            return (contentNegotiation == "optimistic") ?
-                FAST_INFOSET_TYPE_SOAP12 : SOAP12_XML_CONTENT_TYPE_VALUE;
-        }
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     * @return the BindingID associated with this encoder
-     */
-    @Override
-    protected String getBindingId (){
-        return SOAPBinding.SOAP12HTTP_BINDING;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLDecoder.java
deleted file mode 100644
index 98296ee..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLDecoder.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.client;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.client.RequestContext;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import com.sun.xml.internal.ws.client.dispatch.impl.encoding.DispatchSerializer;
-import com.sun.xml.internal.ws.client.dispatch.impl.encoding.DispatchUtil;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.simpletype.EncoderUtils;
-import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.streaming.Attributes;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPConnectionUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.xml.StAXSource;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.xml.internal.bind.api.BridgeContext;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import static javax.xml.stream.XMLStreamConstants.*;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author WS Development Team
- */
-
-public class SOAPXMLDecoder extends SOAPDecoder {
-    public SOAPXMLDecoder() {
-    }
-
-    protected DispatchSerializer getSerializerInstance() {
-        return DispatchSerializer.SOAP_1_0;
-    }
-
-    @Override
-    public SOAPMessage toSOAPMessage(MessageInfo messageInfo) {
-        WSConnection connection = (WSConnection) messageInfo.getConnection();
-        return SOAPConnectionUtil.getSOAPMessage(connection, messageInfo, getBindingId());
-    }
-
-    /*protected void decodeBody(XMLStreamReader reader, InternalMessage response,
-                              MessageInfo messageInfo) {
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-        int state = XMLStreamReaderUtil.nextElementContent(reader);
-        decodeBodyContent(reader, response, messageInfo);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-    }
-    */
-
-
-    /*
-    * skipBody is true, the body is skipped during parsing.
-    */
-    protected void decodeEnvelope(XMLStreamReader reader, InternalMessage request,
-                                  boolean skipBody, MessageInfo messageInfo) {
-
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        //XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        if (isDispatch(messageInfo))
-           dispatchUtil.collectPrefixes(reader);
-
-        XMLStreamReaderUtil.nextElementContent(reader);
-
-        if (skipHeader(messageInfo)) {
-            //System.out.println("Skipping header");
-            skipHeader(reader, messageInfo);
-        } else {
-            //System.out.println("Decoding header");
-            decodeHeader(reader, messageInfo, request);
-        }
-
-        if (skipBody) {
-            //System.out.println("Skipping body");
-            skipBody(reader);
-        } else {
-            //System.out.println("Decodong body");
-            decodeBody(reader, request, messageInfo);
-        }
-
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_DOCUMENT);
-    }
-
-    private static String convertNull(String s) {
-        return (s != null) ? s : "";
-    }
-
-    //@Override
-    protected void decodeBody(XMLStreamReader reader, InternalMessage response, MessageInfo messageInfo) {
-        DispatchContext context = (DispatchContext) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        if (context != null) {
-            //System.out.println("Dispatch context not null");
-            XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-            XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-            int state = XMLStreamReaderUtil.nextElementContent(reader);
-            // if Body is not empty, then deserialize the Body
-            if (state != END_ELEMENT) {
-                BodyBlock responseBody;
-                QName responseBodyName = reader.getName();   // Operation name
-
-                if (responseBodyName.equals(getFaultTag())) {
-                    SOAPFaultInfo soapFaultInfo = decodeFault(reader, response, messageInfo);
-                    responseBody = new BodyBlock(soapFaultInfo);
-                } else {
-                   // System.out.println("Deserializing body");
-                    JAXBContext jaxbContext = getJAXBContext(messageInfo);
-                    if (jaxbContext == null) {
-                        //System.out.println("JAXBContext == null");
-                        responseBody = new BodyBlock(getSerializerInstance().deserializeSource(reader, dispatchUtil));
-                    } else {
-                        //jaxb will leave reader on ending </body> element
-                        //System.out.println("Doing a jaxb bean");
-                        JAXBBeanInfo jaxBean = null;
-                        Unmarshaller um = (Unmarshaller)messageInfo.getMetaData(BindingProviderProperties.DISPATCH_UNMARSHALLER);
-                        if (um != null)
-                            jaxBean = JAXBBeanInfo.fromStAX(reader, jaxbContext, um);
-                        else
-                            jaxBean = JAXBBeanInfo.fromStAX(reader, jaxbContext);
-
-                        responseBody = new BodyBlock(jaxBean);
-                    }
-                }
-                response.setBody(responseBody);
-            }
-
-            XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-            XMLStreamReaderUtil.verifyTag(reader, getBodyTag());
-            XMLStreamReaderUtil.nextElementContent(reader);
-        } //else
-        else super.decodeBody(reader, response, messageInfo);
-    }
-
-    @Override
-    //Todo:kw 102505
-    public void toMessageInfo(InternalMessage internalMessage, MessageInfo messageInfo) {
-
-        RuntimeContext rtContext =
-            (RuntimeContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtContext != null) {
-            SOAPEPTFactory eptf = (SOAPEPTFactory) messageInfo.getEPTFactory();
-            InternalEncoder encoder = eptf.getInternalEncoder();
-            encoder.toMessageInfo(internalMessage, messageInfo);
-
-        } else {  //here we need to set attachments in response context
-            if (internalMessage != null && internalMessage.getBody() != null) {
-                if (internalMessage.getBody().getValue() instanceof SOAPFaultInfo)
-                {
-                    messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-                    messageInfo.setResponse(internalMessage.getBody().getValue());
-                } else
-                if (internalMessage.getBody().getValue() instanceof Exception) {
-                    messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-                    messageInfo.setResponse(internalMessage.getBody().getValue());
-                } else {
-                    messageInfo.setResponseType(MessageStruct.NORMAL_RESPONSE);
-                    setAttachments(internalMessage, messageInfo);
-                    //unfortunately we must do this
-                    if (internalMessage.getBody().getValue() instanceof JAXBBeanInfo)
-                        messageInfo.setResponse(((JAXBBeanInfo) internalMessage.getBody().getValue()).getBean());
-                    else
-                        messageInfo.setResponse(internalMessage.getBody().getValue());
-                }
-            } else
-                messageInfo.setResponseType(MessageStruct.NORMAL_RESPONSE);
-        }
-    }
-
-    private void setAttachments(InternalMessage internalMessage, MessageInfo messageInfo) {
-
-    }
-
-    protected void decodeEnvelope(XMLStreamReader reader, MessageInfo messageInfo) {
-        InternalMessage im = decodeInternalMessage(reader, messageInfo);
-        toMessageInfo(im, messageInfo);
-    }
-
-    protected InternalMessage decodeInternalMessage(XMLStreamReader reader, MessageInfo messageInfo) {
-        InternalMessage response = new InternalMessage();
-
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-        decodeHeader(reader, messageInfo, response);
-        decodeBody(reader, response, messageInfo);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, getEnvelopeTag());
-        XMLStreamReaderUtil.nextElementContent(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_DOCUMENT);
-
-        return response;
-    }
-
-    @Override
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage, MessageInfo messageInfo) {
-        // TODO handle exceptions, attachments
-        XMLStreamReader reader = null;
-        try {
-            InternalMessage response = new InternalMessage();
-            processAttachments(messageInfo, response, soapMessage);
-            Source source = soapMessage.getSOAPPart().getContent();
-            reader = SourceReaderFactory.createSourceReader(source, true, getSOAPMessageCharsetEncoding(soapMessage));
-            XMLStreamReaderUtil.nextElementContent(reader);
-            decodeEnvelope(reader, response, false, messageInfo);
-            return response;
-        } catch (DeserializationException e) {
-            //e.printStackTrace();
-            throw new WebServiceException(e.getCause());
-        } catch (Exception e) {
-            //e.printStackTrace();
-            throw new WebServiceException(e);
-        } finally {
-            if (reader != null) {
-                XMLStreamReaderUtil.close(reader);
-            }
-        }
-    }
-
-    @Override
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage,
-                                             InternalMessage response, MessageInfo messageInfo) {
-        // TODO handle exceptions, attachments
-        XMLStreamReader reader = null;
-        try {
-            processAttachments(messageInfo, response, soapMessage);
-            Source source = soapMessage.getSOAPPart().getContent();
-            reader = SourceReaderFactory.createSourceReader(source, true, getSOAPMessageCharsetEncoding(soapMessage));
-            XMLStreamReaderUtil.nextElementContent(reader);
-            decodeEnvelope(reader, response, !isDispatch(messageInfo), messageInfo);
-
-            if (!isDispatch(messageInfo))
-                convertBodyBlock(response, messageInfo);
-
-        } catch (DeserializationException e) {
-            //e.printStackTrace();
-            throw new WebServiceException(e.getCause());
-        } catch (Exception e) {
-            //e.printStackTrace();
-            throw new WebServiceException(e);
-        } finally {
-            if (reader != null) {
-                XMLStreamReaderUtil.close(reader);
-            }
-        }
-        return response;
-
-    }
-
-    /**
-     * @return Returns the soap binding - SOAP 1.1 namespace.
-     */
-    public String getSOAPBindingId() {
-        return SOAPConstants.NS_WSDL_SOAP;
-    }
-
-    @Override
-    protected SOAPFaultInfo decodeFault(XMLStreamReader reader, InternalMessage internalMessage,
-                                        MessageInfo messageInfo) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT);
-        Method methodName = messageInfo.getMethod();
-
-        // faultcode
-        XMLStreamReaderUtil.nextElementContent(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT_CODE);
-        XMLStreamReaderUtil.nextContent(reader);
-        QName faultcode;
-        String tokens = reader.getText();
-        String uri = "";
-        tokens = EncoderUtils.collapseWhitespace(tokens);
-        String prefix = XmlUtil.getPrefix(tokens);
-        if (prefix != null) {
-            uri = reader.getNamespaceURI(prefix);
-            if (uri == null) {
-                throw new DeserializationException("xsd.unknownPrefix", prefix);
-            }
-        }
-        String localPart = XmlUtil.getLocalPart(tokens);
-        faultcode = new QName(uri, localPart);
-        XMLStreamReaderUtil.next(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT_CODE);
-
-        // faultstring
-        XMLStreamReaderUtil.nextElementContent(reader);
-        XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT_STRING);
-        XMLStreamReaderUtil.nextContent(reader);
-        String faultstring = "";
-        //reader may give more than one char events so coalesc them all.
-        if (reader.getEventType() == CHARACTERS) {
-            do  {
-               faultstring += reader.getText();
-               XMLStreamReaderUtil.next(reader);
-            }while(reader.getEventType() == CHARACTERS);
-        }
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT_STRING);
-
-        String faultactor = null;
-        Object faultdetail = null;
-        QName faultName;
-        if (XMLStreamReaderUtil.nextElementContent(reader) == START_ELEMENT) {
-            QName elementName = reader.getName();
-            // faultactor
-            if (elementName.equals(SOAPConstants.QNAME_SOAP_FAULT_ACTOR)) {
-                XMLStreamReaderUtil.nextContent(reader);
-                // faultactor may be empty
-                if (reader.getEventType() == CHARACTERS) {
-                    faultactor = reader.getText();
-                    XMLStreamReaderUtil.next(reader);
-                }
-                XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-                XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT_ACTOR);
-                XMLStreamReaderUtil.nextElementContent(reader);
-                elementName = reader.getName();
-            }
-
-            // faultdetail
-            if (elementName.equals(SOAPConstants.QNAME_SOAP_FAULT_DETAIL)) {
-                //skip <detail/>
-                if(XMLStreamReaderUtil.nextContent(reader) == START_ELEMENT){
-                    if (messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT) == null)
-                        faultdetail = readFaultDetail(reader, messageInfo);
-                    else {
-                        XMLStreamReaderUtil.skipElement(reader);
-                        XMLStreamReaderUtil.next(reader);
-                    }
-                }
-                // move from </detail> to </Fault>.
-                XMLStreamReaderUtil.nextContent(reader);
-            } else {
-                if (internalMessage.getHeaders() != null) {
-                    boolean isHeaderFault = false;
-                    // could be a header fault or a protocol exception with no detail
-                    for (HeaderBlock headerBlock : internalMessage.getHeaders())
-                    {
-                        if (rtCtxt.getModel().isKnownFault(headerBlock.getName(), methodName))
-                        {
-                            isHeaderFault = true;
-                            faultdetail = headerBlock.getValue();
-                        }
-                    }
-
-                    // if not a header fault, then it is a protocol exception with no detail
-                    if (!isHeaderFault) {
-                        faultdetail = null;
-                    }
-                    XMLStreamReaderUtil.next(reader);
-                }
-            }
-        } else {
-            // a header fault (with no faultactor)
-            if (internalMessage.getHeaders() != null) {
-                for (HeaderBlock headerBlock : internalMessage.getHeaders()) {
-                    if (rtCtxt.getModel().isKnownFault(headerBlock.getName(), methodName))
-                    {
-                        faultdetail = headerBlock.getValue();
-                    }
-                }
-            }
-        }
-
-
-        SOAPFaultInfo soapFaultInfo = new SOAPFaultInfo(faultstring, faultcode, faultactor, faultdetail, getBindingId());
-
-        // reader could be left on CHARS token rather than </fault>
-        if (reader.getEventType() == CHARACTERS && reader.isWhiteSpace()) {
-            XMLStreamReaderUtil.nextContent(reader);
-        }
-
-        XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-        XMLStreamReaderUtil.verifyTag(reader, SOAPConstants.QNAME_SOAP_FAULT);
-        XMLStreamReaderUtil.nextElementContent(reader);
-
-        return soapFaultInfo;
-    }
-
-    /**
-     * Decodes the fault &lt;detail> into a {@link Detail} object or a JAXB object.
-     * <p/>
-     * Upon entry the cursor must be at the start tag of the first child element of &lt;detail>.
-     * Upon a successful completion, the cursor is left at &lt;/detail>.
-     */
-    protected final Object readFaultDetail(XMLStreamReader reader, MessageInfo mi) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-        if (rtCtxt == null){
-            XMLStreamReaderUtil.skipElement(reader);
-            XMLStreamReaderUtil.nextElementContent(reader);
-            return null;
-        }
-        QName faultName = reader.getName();
-        if (rtCtxt.getModel().isKnownFault(faultName, mi.getMethod())) {
-            Object decoderInfo = rtCtxt.getDecoderInfo(faultName);
-            if (decoderInfo != null && decoderInfo instanceof JAXBBridgeInfo) {
-                JAXBBridgeInfo bridgeInfo = (JAXBBridgeInfo) decoderInfo;
-                // JAXB leaves on </env:Header> or <nextHeaderElement>
-                bridgeInfo.deserialize(reader, rtCtxt.getBridgeContext());
-
-                // skip other detail entries
-                int event = reader.getEventType();
-                if (!(event == START_ELEMENT || event == END_ELEMENT)) {
-                    XMLStreamReaderUtil.nextElementContent(reader);
-                }
-                while(reader.getEventType() == START_ELEMENT) {
-                    XMLStreamReaderUtil.skipElement(reader);
-                    XMLStreamReaderUtil.nextElementContent(reader);
-                }
-
-                XMLStreamReaderUtil.verifyReaderState(reader, END_ELEMENT);
-                XMLStreamReaderUtil.verifyTag(reader, getFaultDetailTag());
-                return bridgeInfo;
-            }
-        }
-
-        return decodeFaultDetail(reader);
-    }
-
-    /**
-     * Decodes the fault &lt;detail> into a {@link Detail} object.
-     * <p/>
-     * Upon entry the cursor must be at the start tag of the first child element of &lt;detail>.
-     * Upon a successful completion, the cursor is left at &lt;/detail>.
-     */
-    protected Detail decodeFaultDetail(XMLStreamReader reader) {
-        try {
-            // parse the current element that the reader is pointing to
-            Transformer trans = XmlUtil.newTransformer();
-
-            MessageFactory messageFactory = MessageFactory.newInstance();
-            SOAPMessage soapMessage = messageFactory.createMessage();
-            Detail detail = soapMessage.getSOAPBody().addFault().addDetail();
-
-            // repeatedly copy all the child elements of <detail>.
-            do {
-                trans.transform(new StAXSource(reader, true), new DOMResult(detail));
-            } while (XMLStreamReaderUtil.nextContent(reader) == START_ELEMENT);
-
-            // now we should be at </detail>.
-            return detail;
-        } catch (SOAPException e) {
-            throw new WebServiceException("sender.response.cannotDecodeFaultDetail", e);
-        } catch (TransformerException e) {
-            throw new WebServiceException("sender.response.cannotDecodeFaultDetail", e);
-        } catch (TransformerFactoryConfigurationError e) {
-            throw new WebServiceException("sender.response.cannotDecodeFaultDetail", e);
-        }
-    }
-
-   /* protected static String getCurrentPrefix(XMLStreamReader reader, String tokens, String namespaceURI) {
-        tokens = reader.getText();
-        String uri = "";
-        tokens = EncoderUtils.collapseWhitespace(tokens);
-        String prefix = XmlUtil.getPrefix(tokens);
-        if (prefix != null) {
-            uri = reader.getNamespaceURI(prefix);
-            if (uri == null) {
-                throw new DeserializationException("xsd.unknownPrefix", prefix);
-            }
-        }
-        String localPart = XmlUtil.getLocalPart(tokens);
-        return prefix;
-    }
-    */
-
-    protected JAXBContext getJAXBContext(MessageInfo messageInfo) {
-        JAXBContext jc = null;
-
-        RequestContext requestContext = (RequestContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        if (requestContext != null)
-            // TODO: does this really need to be copied?
-            jc = (JAXBContext) requestContext.copy().get(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-        return jc;
-    }
-
-    protected String getBindingId(MessageInfo messageInfo) {
-        RequestContext requestContext = (RequestContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        if (requestContext != null) {
-            String bindingId = (String) requestContext.get(BindingProviderProperties.BINDING_ID_PROPERTY);
-            if (bindingId != null)
-                return bindingId;
-        }
-        return getBindingId();
-    }
-
-
-    @Override
-    public String getBindingId() {
-        return SOAPBinding.SOAP11HTTP_BINDING;
-    }
-
-    @Override
-    protected QName getSenderFaultCode() {
-        return SOAPConstants.FAULT_CODE_SERVER;
-    }
-
-    @Override
-    protected QName getReceiverFaultCode() {
-        return SOAPConstants.FAULT_CODE_CLIENT;
-    }
-
-    @Override
-    protected QName getVersionMismatchFaultCode() {
-        return SOAPConstants.FAULT_CODE_VERSION_MISMATCH;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLEncoder.java
deleted file mode 100644
index b88045f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/client/SOAPXMLEncoder.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.client;
-
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-import com.sun.xml.internal.ws.client.RequestContext;
-import com.sun.xml.internal.ws.client.SenderException;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-import javax.activation.DataHandler;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Source;
-import javax.xml.ws.Service;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.IOException;
-import java.util.Map;
-import java.util.logging.Logger;
-import static java.util.logging.Logger.getLogger;
-
-/**
- * @author WS Development Team
- */
-public class SOAPXMLEncoder extends SOAPEncoder {
-
-    private static final Logger logger =
-        getLogger(new StringBuffer().append(com.sun.xml.internal.ws.util.Constants.LoggingDomain).append(".client.dispatch.util").toString());
-
-    public SOAPXMLEncoder() {
-    }
-    /* moved to super
-    protected JAXBContext getJAXBContext(MessageInfo messageInfo) {
-        JAXBContext jc = null;
-        RequestContext context = (RequestContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        if (context != null)
-            jc = (JAXBContext) context.get(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-
-        return jc;
-    }
-    */
-    protected boolean skipHeader(MessageInfo messageInfo) {
-        if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) ==
-            Service.Mode.PAYLOAD) {
-            return true;
-        }
-        return false;
-    }
-
-    protected QName getHeaderTag() {
-        return SOAPConstants.QNAME_SOAP_HEADER;
-    }
-
-    protected void skipHeader(XMLStreamReader writer) {
-        //XMLStreamReaderUtil.verifyReaderState(reader, START_ELEMENT);
-        //if (!SOAPNamespaceConstants.TAG_HEADER.equals(reader.getLocalName())) {
-        //  return;
-        //}
-        //XMLStreamReaderUtil.verifyTag(reader, getHeaderTag());
-        //XMLStreamReaderUtil.skipElement(reader);    // Moves to </Header>
-        //XMLStreamReaderUtil.nextElementContent(reader);
-    }
-
-    @Override
-    public InternalMessage toInternalMessage(MessageInfo messageInfo) {
-        InternalMessage internalMessage = new InternalMessage();
-        DispatchContext context = (DispatchContext) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        if (context != null) {
-            DispatchContext.MessageType type =
-                (DispatchContext.MessageType) context.getProperty(DispatchContext.DISPATCH_MESSAGE);
-            Object[] data = messageInfo.getData();
-            BodyBlock bodyBlock = null;
-            switch (type) {
-                case JAXB_MESSAGE:
-                    break;
-                case JAXB_PAYLOAD:
-                    JAXBBeanInfo jaxbInfo = new JAXBBeanInfo(data[0], getJAXBContext(messageInfo));
-                    bodyBlock = new BodyBlock(jaxbInfo);
-                    break;
-                case SOURCE_PAYLOAD:
-                    data = messageInfo.getData();
-                    bodyBlock = new BodyBlock((Source) data[0]);
-                    break;
-                default:
-            }
-            if (bodyBlock != null)
-                internalMessage.setBody(bodyBlock);
-
-            //look for attachments here
-            Map<String, DataHandler> attMap = (Map<String, DataHandler>) ((Map<String, Object>)
-                messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY)).get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-
-            if (attMap != null)
-                for (Map.Entry<String, DataHandler> att : attMap.entrySet()) {
-                    internalMessage.addAttachment(AttachmentBlock.fromDataHandler(att.getKey(), att.getValue()));
-                }
-
-        } else {
-            SOAPEPTFactory eptf = (SOAPEPTFactory) messageInfo.getEPTFactory();
-            InternalEncoder internalEncoder = eptf.getInternalEncoder();
-            //processProperties(messageInfo);
-            return (InternalMessage) internalEncoder.toInternalMessage(messageInfo);
-        }
-        return internalMessage;
-    }
-
-    @Override
-    public SOAPMessage toSOAPMessage(InternalMessage internalMessage,
-                                     MessageInfo messageInfo) {
-        SOAPMessage message = null;
-        XMLStreamWriter writer = null;
-        JAXWSAttachmentMarshaller marshaller = null;
-        boolean xopEnabled = false;
-
-        try {
-            setAttachmentsMap(messageInfo, internalMessage);
-            ByteArrayBuffer bab = new ByteArrayBuffer();
-
-            if (messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic")
-            {
-                writer = XMLStreamWriterFactory.createFIStreamWriter(bab);
-
-                // Turn XOP off for FI
-                marshaller = MessageInfoUtil.getAttachmentMarshaller(messageInfo);
-                if (marshaller != null) {
-                    xopEnabled = marshaller.isXOPPackage();     // last value
-                    marshaller.setXOPPackage(false);
-                }
-
-            } else {
-                // Store output stream to use in JAXB bridge (not with FI)
-                messageInfo.setMetaData(JAXB_OUTPUTSTREAM, bab);
-                writer = XMLStreamWriterFactory.createXMLStreamWriter(bab);
-            }
-
-            writer.writeStartDocument();
-            startEnvelope(writer);
-            writeEnvelopeNamespaces(writer, messageInfo);
-            if (!skipHeader(messageInfo))
-                writeHeaders(writer, internalMessage, messageInfo);
-            writeBody(writer, internalMessage, messageInfo);
-            endEnvelope(writer);
-            writer.writeEndDocument();
-            writer.close();
-
-            // TODO: Copy the mime headers from messageInfo.METADATA
-            MimeHeaders mh = new MimeHeaders();
-            mh.addHeader("Content-Type", getContentType(messageInfo, marshaller));
-            message = SOAPUtil.createMessage(mh, bab.newInputStream(), getBindingId());
-            processAttachments(internalMessage, message);
-
-            // Restore default XOP processing before returning
-            if (marshaller != null) {
-                marshaller.setXOPPackage(xopEnabled);
-            }
-        }
-        catch (IOException e) {
-            throw new SenderException("sender.request.messageNotReady", e);
-        }
-        catch (SOAPException e) {
-            throw new SenderException(e);
-        }
-        catch (XMLStreamException e) {
-            throw new SenderException(e);
-        }
-        finally {
-            if (writer != null) {
-                try {
-                    writer.close();
-                }
-                catch (XMLStreamException e) {
-                    throw new SenderException(e);
-                }
-            }
-        }
-
-        return message;
-    }
-
-    public InternalMessage createInternalMessage(MessageInfo messageInfo) {
-
-        InternalMessage internalMessage = new InternalMessage();
-        Object response = messageInfo.getResponse();
-
-        BodyBlock bodyBlock = null;
-        if (getJAXBContext(messageInfo) != null) {
-            JAXBBeanInfo jaxbBean = new JAXBBeanInfo(response, getJAXBContext(messageInfo));
-            bodyBlock = new BodyBlock(jaxbBean);
-        } else if (response instanceof Source) {
-            bodyBlock = new BodyBlock((Source) response);
-        }
-
-        internalMessage.setBody(bodyBlock);
-        return internalMessage;
-    }
-
-    protected String getContentType(MessageInfo messageInfo,
-                                    JAXWSAttachmentMarshaller marshaller) {
-        String contentNegotiation = (String)
-            messageInfo.getMetaData(BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY);
-
-        if (marshaller == null) {
-            marshaller = MessageInfoUtil.getAttachmentMarshaller(messageInfo);
-        }
-
-        if (marshaller != null && marshaller.isXopped()) {
-            return XOP_SOAP11_XML_TYPE_VALUE;
-        } else {
-            return (contentNegotiation == "optimistic") ?
-                FAST_INFOSET_TYPE_SOAP11 : XML_CONTENT_TYPE_VALUE;
-        }
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     *
-     * @return the BindingID associated with this encoder
-     */
-    protected String getBindingId() {
-        return SOAPBinding.SOAP11HTTP_BINDING;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/AttachmentBlock.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/AttachmentBlock.java
deleted file mode 100644
index 951f2ca..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/AttachmentBlock.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.soap.SerializationException;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.util.ASCIIUtility;
-import com.sun.xml.internal.ws.util.ByteArrayDataSource;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.imageio.ImageIO;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.WebServiceException;
-import java.awt.Image;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-/**
- * Attachment of {@link InternalMessage}.
- *
- * <p>
- * The key idea behind this class is to hide the actual data representation.
- * The producer of the object may choose the best format it wants, and then
- * various accessor methods provide the rest of the stack to chose the format
- * it wants.
- *
- * <p>
- * When receiving from a network, this allows an {@link AttachmentBlock} object
- * to be constructed without actually even parsing the attachment. When
- * sending to a network, this allows the conversion to the byte image to happen
- * lazily, and directly to the network.
- *
- * <p>
- * Even though most of the data access methods have default implementation,
- * Implementation classes of this class should override them
- * so that they can run faster, whenever possible. In particular, the default
- * implementation of {@link #asInputStream()} and {@link #writeTo(OutputStream)}
- * has a circular dependency, so at least one must be overridden.
- *
- * TODO:
- *   in the performance critical path of mapping an attachment to a Java type,
- *   most of the type the Java type to which it binds to is known in advance.
- *   for this reason, it's better to prepare an 'accessor' object for each
- *   kind of conversion. In that way we can avoid the computation of this
- *   in the pritical path, which is redundant.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class AttachmentBlock {
-
-    public static AttachmentBlock fromDataHandler(String cid,DataHandler dh) {
-        return new DataHandlerImpl(cid,dh);
-    }
-
-    public static AttachmentBlock fromSAAJ(AttachmentPart part) {
-        return new SAAJImpl(part);
-    }
-
-    public static AttachmentBlock fromByteArray(String cid,byte[] data, int start, int len, String mimeType ) {
-        return new ByteArrayImpl(cid,data,start,len,mimeType);
-    }
-
-    public static AttachmentBlock fromByteArray(String cid,byte[] data, String mimeType) {
-        return new ByteArrayImpl(cid,data,0,data.length,mimeType);
-    }
-
-    public static AttachmentBlock fromJAXB(String cid, JAXBBridgeInfo bridgeInfo, RuntimeContext rtContext, String mimeType) {
-        return new JAXBImpl(cid,bridgeInfo,rtContext,mimeType);
-    }
-
-    /**
-     * No derived class outside this class.
-     */
-    private AttachmentBlock() {}
-
-    /**
-     * Content ID of the attachment. Uniquely identifies an attachment.
-     */
-    public abstract String getId();
-
-    /**
-     * Gets the WSDL part name of this attachment.
-     *
-     * <p>
-     * According to WSI AP 1.0
-     * <PRE>
-     * 3.8 Value-space of Content-Id Header
-     *   Definition: content-id part encoding
-     *   The "content-id part encoding" consists of the concatenation of:
-     * The value of the name attribute of the wsdl:part element referenced by the mime:content, in which characters disallowed in content-id headers (non-ASCII characters as represented by code points above 0x7F) are escaped as follows:
-     *     o Each disallowed character is converted to UTF-8 as one or more bytes.
-     *     o Any bytes corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
-     *     o The original character is replaced by the resulting character sequence.
-     * The character '=' (0x3D).
-     * A globally unique value such as a UUID.
-     * The character '@' (0x40).
-     * A valid domain name under the authority of the entity constructing the message.
-     * </PRE>
-     *
-     * So a wsdl:part fooPart will be encoded as:
-     *      <fooPart=somereallybignumberlikeauuid@example.com>
-     *
-     * @return null
-     *      if the parsing fails.
-     */
-    public final String getWSDLPartName(){
-        String cId = getId();
-
-        int index = cId.lastIndexOf('@', cId.length());
-        if(index == -1){
-            return null;
-        }
-        String localPart = cId.substring(0, index);
-        index = localPart.lastIndexOf('=', localPart.length());
-        if(index == -1){
-            return null;
-        }
-        try {
-            return java.net.URLDecoder.decode(localPart.substring(0, index), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            throw new SerializationException(e);
-        }
-    }
-
-    /**
-     * Gets the MIME content-type of this attachment.
-     */
-    public abstract String getContentType();
-
-    /**
-     * Gets the attachment as an exact-length byte array.
-     */
-    // not so fast but useful default implementation
-    public byte[] asByteArray() {
-        try {
-            return ASCIIUtility.getBytes(asInputStream());
-        } catch (IOException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    /**
-     * Gets the attachment as a {@link DataHandler}.
-     */
-    public abstract DataHandler asDataHandler();
-
-    /**
-     * Gets the attachment as a {@link Source}.
-     * Note that there's no guarantee that the attachment is actually an XML.
-     */
-    public Source asSource() {
-        return new StreamSource(asInputStream());
-    }
-
-    /**
-     * Obtains this attachment as an {@link InputStream}.
-     */
-    // not-so-efficient but useful default implementation.
-    public InputStream asInputStream() {
-        ByteOutputStream bos = new ByteOutputStream();
-        try {
-            writeTo(bos);
-        } catch (IOException e) {
-            throw new WebServiceException(e);
-        }
-        return bos.newInputStream();
-    }
-
-    /**
-     * Deserializes this attachment by using JAXB into {@link JAXBBridgeInfo}.
-     *
-     * TODO: this abstraction is wrong.
-     */
-    public final void deserialize(BridgeContext bc, JAXBBridgeInfo bi) {
-        bi.deserialize(asInputStream(),bc);
-    }
-
-    /**
-     * Adds this attachment as an {@link AttachmentPart} into the given {@link SOAPMessage}.
-     */
-    // not so fast but useful default
-    public void addTo(SOAPMessage msg) throws SOAPException {
-        AttachmentPart part = msg.createAttachmentPart(asDataHandler());
-        part.setContentId(getId());
-        //it may be safe to say the encoding is binary meaning the bytes are not subjected any
-        //specific encoding.
-        part.setMimeHeader("Content-transfer-encoding", "binary");
-        msg.addAttachmentPart(part);
-    }
-
-    /**
-     * Writes the contents of the attachment into the given stream.
-     */
-    // not so fast but useful default
-    public void writeTo(OutputStream os) throws IOException {
-        ASCIIUtility.copyStream(asInputStream(),os);
-    }
-
-    /**
-     * Deserializes this attachment into an {@link Image}.
-     *
-     * @return null if the decoding fails.
-     */
-    public final Image asImage() throws IOException {
-        // technically we should check the MIME type here, but
-        // normally images can be content-sniffed.
-        // so the MIME type check will only make us slower and draconian, both of which
-        // JAXB 2.0 isn't interested.
-        return ImageIO.read(asInputStream());
-    }
-
-
-    /**
-     * {@link AttachmentBlock} stored as SAAJ {@link AttachmentPart}.
-     */
-    private static final class SAAJImpl extends AttachmentBlock {
-        private final AttachmentPart ap;
-
-        public SAAJImpl(AttachmentPart part) {
-            this.ap = part;
-        }
-
-        public String getId() {
-            return ap.getContentId();
-        }
-
-        public String getContentType() {
-            return ap.getContentType();
-        }
-
-        public byte[] asByteArray() {
-            try {
-                return ap.getRawContentBytes();
-            } catch (SOAPException e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public DataHandler asDataHandler() {
-            try {
-                return ap.getDataHandler();
-            } catch (SOAPException e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public Source asSource() {
-            try {
-                return new StreamSource(ap.getRawContent());
-            } catch (SOAPException e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public InputStream asInputStream() {
-            try {
-                return ap.getRawContent();
-            } catch (SOAPException e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public void addTo(SOAPMessage msg) {
-            msg.addAttachmentPart(ap);
-        }
-    }
-
-    /**
-     * {@link AttachmentBlock} stored as a {@link DataHandler}.
-     */
-    private static final class DataHandlerImpl extends AttachmentBlock {
-        private final String cid;
-        private final DataHandler dh;
-
-        public DataHandlerImpl(String cid, DataHandler dh) {
-            this.cid = cid;
-            this.dh = dh;
-        }
-
-        public String getId() {
-            return cid;
-        }
-
-        public String getContentType() {
-            return dh.getContentType();
-        }
-
-        public DataHandler asDataHandler() {
-            return dh;
-        }
-
-        public InputStream asInputStream() {
-            try {
-                return dh.getInputStream();
-            } catch (IOException e) {
-                throw new WebServiceException(e);
-            }
-        }
-    }
-
-    private static final class ByteArrayImpl extends AttachmentBlock {
-        private final String cid;
-        private byte[] data;
-        private int start;
-        private int len;
-        private final String mimeType;
-
-        public ByteArrayImpl(String cid, byte[] data, int start, int len, String mimeType) {
-            this.cid = cid;
-            this.data = data;
-            this.start = start;
-            this.len = len;
-            this.mimeType = mimeType;
-        }
-
-        public String getId() {
-            return cid;
-        }
-
-        public String getContentType() {
-            return mimeType;
-        }
-
-        public byte[] asByteArray() {
-            if(start!=0 || len!=data.length) {
-                // if our buffer isn't exact, switch to the exact one
-                byte[] exact = new byte[len];
-                System.arraycopy(data,start,exact,0,len);
-                start = 0;
-                data = exact;
-            }
-            return data;
-        }
-
-        public DataHandler asDataHandler() {
-            return new DataHandler(new ByteArrayDataSource(data,start,len,getContentType()));
-        }
-
-        public InputStream asInputStream() {
-            return new ByteArrayInputStream(data,start,len);
-        }
-
-        public void addTo(SOAPMessage msg) throws SOAPException {
-            AttachmentPart part = msg.createAttachmentPart();
-            part.setRawContentBytes(data,start,len,getContentType());
-            part.setContentId(getId());
-            msg.addAttachmentPart(part);
-        }
-
-        public void writeTo(OutputStream os) throws IOException {
-            os.write(data,start,len);
-        }
-    }
-
-    /**
-     * {@link AttachmentPart} that stores the value as a JAXB object.
-     *
-     * TODO: if it's common for an attahchment to be written more than once,
-     * it's better to cache the marshalled result, as it is expensive operation.
-     */
-    private static final class JAXBImpl extends AttachmentBlock implements DataSource {
-        private final String id;
-        private final JAXBBridgeInfo bridgeInfo;
-        private final RuntimeContext rtContext;
-        private final String type;
-
-        public JAXBImpl(String id, JAXBBridgeInfo bridgeInfo, RuntimeContext rtContext, String type) {
-            this.id = id;
-            this.bridgeInfo = bridgeInfo;
-            this.rtContext = rtContext;
-            this.type = type;
-        }
-
-        public String getId() {
-            return id;
-        }
-
-        public String getContentType() {
-            return type;
-        }
-
-        public DataHandler asDataHandler() {
-            return new DataHandler(this);
-        }
-
-        public InputStream getInputStream() {
-            return asInputStream();
-        }
-
-        public String getName() {
-            return null;
-        }
-
-        public OutputStream getOutputStream() {
-            throw new UnsupportedOperationException();
-        }
-
-        public void writeTo(OutputStream os) {
-            bridgeInfo.serialize(rtContext.getBridgeContext(),os,null);
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/BodyBlock.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/BodyBlock.java
deleted file mode 100644
index 655486f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/BodyBlock.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import javax.xml.transform.Source;
-
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAP12FaultInfo;
-
-/**
- * @author WS Development Team
- */
-public class BodyBlock {
-
-    private Object value;
-
-    public BodyBlock(Object value) {
-        this.value = value;
-    }
-
-    public BodyBlock(JAXBBeanInfo beanInfo) {
-        this.value = beanInfo;
-    }
-
-    public BodyBlock(JAXBBridgeInfo bridgeInfo) {
-        this.value = bridgeInfo;
-    }
-
-    public BodyBlock(Source source) {
-        setSource(source);
-    }
-
-    public BodyBlock(SOAPFaultInfo faultInfo) {
-        setFaultInfo(faultInfo);
-    }
-
-    public BodyBlock(RpcLitPayload rpcLoad) {
-        this.value = rpcLoad;
-    }
-
-    public void setSource(Source source) {
-        this.value = source;
-    }
-
-    public void setFaultInfo(SOAPFaultInfo faultInfo) {
-        this.value = faultInfo;
-    }
-
-    /**
-     * There is no need to have so many setter to set to an Object. Just setValue is all that we need?
-     * @param value
-     */
-    public void setValue(Object value){
-        this.value = value;
-    }
-    public Object getValue() {
-        return value;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/DelegateBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/DelegateBase.java
deleted file mode 100644
index 41f81ee..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/DelegateBase.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import com.sun.xml.internal.ws.pept.Delegate;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.ContactInfo;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoList;
-import com.sun.xml.internal.ws.pept.ept.ContactInfoListIterator;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.client.ContextMap;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.ContactInfoBase;
-import com.sun.xml.internal.ws.client.ContactInfoListImpl;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.client.WSServiceDelegate;
-
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service;
-import java.util.Iterator;
-
-/**
- * @author WS Development Team
- */
-public class DelegateBase implements Delegate {
-    protected ContactInfoList contactInfoList;
-    protected WSServiceDelegate service;
-
-    public DelegateBase() {
-    }
-
-    public DelegateBase(ContactInfoList contactInfoList) {
-        this.contactInfoList = contactInfoList;
-    }
-
-    public DelegateBase(ContactInfoList cil, WSServiceDelegate service) {
-       this(cil);
-       this.service = service;
-    }
-
-    public MessageStruct getMessageStruct() {
-        return new MessageInfoBase();
-    }
-
-    public void send(MessageStruct messageStruct) {
-        MessageInfo messageInfo = (MessageInfo) messageStruct;
-
-        // ContactInfoListIterator iterator = contactInfoList.iterator();
-        if (!contactInfoList.iterator().hasNext())
-            throw new RuntimeException("can't pickup message encoder/decoder, no ContactInfo!");
-
-        ContextMap properties = (ContextMap)
-                messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        BindingProvider stub = (BindingProvider)properties.get(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-
-        BindingImpl bi = (BindingImpl)stub.getBinding();
-        String bindingId = bi.getBindingId();
-        ContactInfo contactInfo = getContactInfo(contactInfoList, bindingId);
-
-        messageInfo.setEPTFactory(contactInfo);
-        MessageDispatcher messageDispatcher = contactInfo.getMessageDispatcher(messageInfo);
-        messageDispatcher.send(messageInfo);
-    }
-
-    private ContactInfo getContactInfo(ContactInfoList cil, String bindingId){
-        ContactInfoListIterator iter = cil.iterator();
-        while(iter.hasNext()){
-            ContactInfoBase cib = (ContactInfoBase)iter.next();
-            if(cib.getBindingId().equals(bindingId))
-                return cib;
-        }
-        //return the first one
-        return cil.iterator().next();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/HeaderBlock.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/HeaderBlock.java
deleted file mode 100644
index cb24f7a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/HeaderBlock.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import javax.xml.namespace.QName;
-
-/**
- * @author WS Development Team
- */
-public class HeaderBlock {
-
-    private JAXBBridgeInfo value;
-
-    public HeaderBlock(JAXBBridgeInfo bridgeInfo) {
-        this.value = bridgeInfo;
-    }
-
-    public Object getValue() {
-        return value;
-    }
-
-    public QName getName() {
-        return value.getName();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/InternalMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/InternalMessage.java
deleted file mode 100644
index f1eeee8..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/InternalMessage.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Represents a SOAP message with headers, a body, and attachments.
- *
- * @author WS Development Team
- */
-public class InternalMessage {
-    private List<HeaderBlock> headers;
-    private Set<QName> headerSet;
-    private BodyBlock body;
-    private final Map<String,AttachmentBlock> attachments = new HashMap<String, AttachmentBlock>();
-
-    /**
-     * @return the <code>BodyBlock</code> for this message
-     */
-    public BodyBlock getBody() {
-        return body;
-    }
-
-    public void addHeader(HeaderBlock headerBlock) {
-        if (headers == null) {
-            headers = new ArrayList<HeaderBlock>();
-            headerSet = new HashSet<QName>();
-        }
-        headers.add(headerBlock);
-        headerSet.add(headerBlock.getName());
-    }
-
-    /*
-     * Checks if a header is already present
-     */
-    public boolean isHeaderPresent(QName name) {
-        if (headerSet == null) {
-            return false;
-        }
-        return headerSet.contains(name);
-    }
-
-    /**
-     * @return a <code>List</code> of <code>HeaderBlocks</code associated
-     * with this message
-     */
-    public List<HeaderBlock> getHeaders() {
-        return headers;
-    }
-
-    /**
-     * @param body
-     */
-    public void setBody(BodyBlock body) {
-        this.body = body;
-    }
-
-    public void addAttachment(AttachmentBlock attachment){
-        attachments.put(attachment.getId(),attachment);
-    }
-
-    public AttachmentBlock getAttachment(String contentId){
-        return attachments.get(contentId);
-    }
-
-    /**
-     * @return a <code>Map</code> of contentIds to attachments
-     */
-    public Map<String, AttachmentBlock> getAttachments() {
-        return attachments;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageBlock.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageBlock.java
deleted file mode 100644
index f52633a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageBlock.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author WS Development Team
- */
-public class MessageBlock {
-    protected QName _name;
-    protected Object _value;
-
-    public MessageBlock() {
-    }
-
-    public MessageBlock(QName name, Object value) {
-        _name = name;
-        _value = value;
-    }
-
-    public MessageBlock(QName name) {
-        _name = name;
-    }
-
-    /**
-     * @return the value of this block
-     */
-    public Object getValue() {
-        return _value;
-    }
-
-    /**
-     * @param element
-     */
-    public void setValue(Object element) {
-        _value = element;
-    }
-
-    /**
-     * @return the <code>QName</code> of this block
-     */
-    public QName getName() {
-        return _name;
-    }
-
-    /**
-     * @param name
-     */
-    public void setName(QName name) {
-        _name = name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageInfoBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageInfoBase.java
deleted file mode 100644
index 0828b3f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/MessageInfoBase.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-/**
- * @author WS Development Team
- */
-public class MessageInfoBase implements MessageInfo {
-
-    protected Object[] _data;
-    protected Method _method;
-    protected Map _metadata;
-    protected int _messagePattern;
-    protected Object _response;
-    protected int _responseType;
-    protected EPTFactory _eptFactory;
-    protected MessageDispatcher _messageDispatcher;
-    protected Encoder _encoder;
-    protected Decoder _decoder;
-    protected WSConnection _connection;
-
-    public void setData(Object[] data) {
-        _data = data;
-    }
-
-    public Object[] getData() {
-        return _data;
-    }
-
-    public void setMethod(Method method) {
-        _method = method;
-    }
-
-    public Method getMethod() {
-        return _method;
-    }
-
-    public void setMetaData(Object name, Object value) {
-        if (_metadata == null)
-           _metadata = new HashMap();
-        _metadata.put(name, value);
-    }
-
-    public Object getMetaData(Object name) {
-        Object value = null;
-
-        if ((name != null) && (_metadata != null)) {
-             value = _metadata.get(name);
-        }
-        return value;
-    }
-
-    public int getMEP() {
-        return _messagePattern;
-    }
-
-    public void setMEP(int messagePattern) {
-        _messagePattern = messagePattern;
-    }
-
-    public int getResponseType() {
-        return _responseType;
-    }
-
-    public void setResponseType(int responseType) {
-        _responseType = responseType;
-    }
-
-    public Object getResponse() {
-        return _response;
-    }
-
-    public void setResponse(Object response) {
-        _response = response;
-    }
-
-    public EPTFactory getEPTFactory() {
-        return _eptFactory;
-    }
-
-    public void setEPTFactory(EPTFactory eptFactory) {
-        _eptFactory = eptFactory;
-    }
-
-    /*
-     * @see MessageInfo#getMessageDispatcher()
-     */
-    public MessageDispatcher getMessageDispatcher() {
-        return _messageDispatcher;
-    }
-
-    /*
-     * @see MessageInfo#getEncoder()
-     */
-    public Encoder getEncoder() {
-        return _encoder;
-    }
-
-    /*
-     * @see MessageInfo#getDecoder()
-     */
-    public Decoder getDecoder() {
-        return _decoder;
-    }
-
-    /*
-     * @see MessageInfo#getConnection()
-     */
-    public WSConnection getConnection() {
-        return _connection;
-    }
-
-    /*
-     * @see MessageInfo#setMessageDispatcher(MessageDispatcher)
-     */
-    public void setMessageDispatcher(MessageDispatcher arg0) {
-        this._messageDispatcher = arg0;
-    }
-
-    /*
-     * @see MessageInfo#setEncoder(Encoder)
-     */
-    public void setEncoder(Encoder encoder) {
-        this._encoder = encoder;
-    }
-
-    /*
-     * @see MessageInfo#setDecoder(Decoder)
-     */
-    public void setDecoder(Decoder decoder) {
-        this._decoder = decoder;
-    }
-
-    /*
-     * @see MessageInfo#setConnection(Connection)
-     */
-    public void setConnection(WSConnection connection) {
-        this._connection = connection;
-    }
-
-    public static MessageInfo copy(MessageInfo mi){
-        MessageInfoBase mib = (MessageInfoBase)mi;
-        MessageInfoBase newMi = new MessageInfoBase();
-        if(newMi._data != null){
-            Object[] data = new Object[mib._data.length];
-            int i = 0;
-            for(Object o : mib._data){
-                data[i++] = o;
-            }
-            newMi._data = data;
-        }
-        newMi.setConnection(mi.getConnection());
-        newMi.setMethod(mi.getMethod());
-        newMi.setDecoder(mi.getDecoder());
-        newMi.setEncoder(mi.getEncoder());
-        newMi.setEPTFactory(mi.getEPTFactory());
-        newMi.setMEP(mi.getMEP());
-        newMi._messageDispatcher = mib._messageDispatcher;
-        newMi._metadata = new HashMap(mib._metadata);
-        return (MessageInfo)newMi;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/SOAP12NotUnderstoodHeaderBlock.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/SOAP12NotUnderstoodHeaderBlock.java
deleted file mode 100644
index 76d174f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/internal/SOAP12NotUnderstoodHeaderBlock.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.internal;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.ws.WebServiceException;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-
-/**
- * SOAP 1.2 version of NotUnderstoodHeaderBlock.
- *
- * @author WS Development Team
- */
-public class SOAP12NotUnderstoodHeaderBlock extends HeaderBlock {
-
-    private QName nuHeader;
-
-    // super(null) is a hack in this case
-    public SOAP12NotUnderstoodHeaderBlock(QName header) {
-        super(null);
-        nuHeader = header;
-    }
-
-    public QName getName() {
-        return new QName(SOAP12NamespaceConstants.ENVELOPE,
-            SOAP12NamespaceConstants.TAG_NOT_UNDERSTOOD);
-    }
-
-    public void write(XMLStreamWriter writer) {
-        try {
-            String prefix = "t"; // should not have been used before <header>
-            writer.writeStartElement(
-                SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAP12NamespaceConstants.TAG_NOT_UNDERSTOOD,
-                SOAP12NamespaceConstants.ENVELOPE);
-            writer.writeAttribute(
-                SOAP12NamespaceConstants.ATTR_NOT_UNDERSTOOD_QNAME,
-                prefix + ":" + nuHeader.getLocalPart());
-            writer.writeNamespace(prefix, nuHeader.getNamespaceURI());
-            writer.writeEndElement();
-        } catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCode.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCode.java
deleted file mode 100644
index a1342ac..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-
-/**
- * SOAP 1.2 soapenv:Code
- *
- * <soapenv:Fault>
- *  <soapenv:Code>
- *      <soapenv:Value>soapenv:Sender</soapenv:Value>
- *      <soapenv:Subcode>
- *          <soapenv:Value>ns1:incorectRequest</Value>
- *          <soapenv:Subcode>
- *          ...
- *      </soapenv:Subcode>
- *  </soapenv:Code>
- * </soapenv:Fault>
- *
- * @author Vivek Pandey
- */
-public class FaultCode {
-    private FaultCodeEnum value;
-    private FaultSubcode subcode;
-
-    public FaultCode(FaultCodeEnum value, FaultSubcode subcode) {
-        this.value = value;
-        this.subcode = subcode;
-    }
-
-    public FaultCode(FaultCodeEnum value, Iterator<QName> subcodes) {
-        this.value = value;
-        if(subcodes.hasNext()){
-            subcode = new FaultSubcode(subcodes.next(), subcodes);
-        }
-    }
-
-    public FaultCodeEnum getValue() {
-        return value;
-    }
-
-    public FaultSubcode getSubcode() {
-        return subcode;
-    }
-
-    void write(XMLStreamWriter writer) throws XMLStreamException {
-        // <soapenv:Code>
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-            SOAP12Constants.QNAME_FAULT_CODE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-
-        // <soapenv:Value>
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-            SOAP12Constants.QNAME_FAULT_VALUE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-
-        writer.writeCharacters(value.getPrefix()+":"+value.getLocalPart());
-        writer.writeEndElement(); // </soapenv:Value>
-
-        // <soapenv:Subcode>...</soapenv:Subcode>
-        if(subcode != null)
-            subcode.write(writer);
-        writer.writeEndElement(); // </soapenv:Code>
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCodeEnum.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCodeEnum.java
deleted file mode 100644
index d5b331e..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultCodeEnum.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-
-import javax.xml.namespace.QName;
-
-public enum FaultCodeEnum {
-    VersionMismatch(new QName(SOAP12NamespaceConstants.ENVELOPE, "VersionMismatch", SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE)),
-    MustUnderstand(new QName(SOAP12NamespaceConstants.ENVELOPE, "MustUnderstand", SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE)),
-    DataEncodingUnknown(new QName(SOAP12NamespaceConstants.ENVELOPE, "DataEncodingUnknown", SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE)),
-    Sender(new QName(SOAP12NamespaceConstants.ENVELOPE, "Sender", SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE)),
-    Receiver(new QName(SOAP12NamespaceConstants.ENVELOPE, "Receiver", SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE));
-
-    private FaultCodeEnum(QName code){
-        this.code = code;
-    }
-
-    public QName value(){
-        return code;
-    }
-
-    public String getLocalPart(){
-        return code.getLocalPart();
-    }
-
-    public String getNamespaceURI(){
-        return code.getNamespaceURI();
-    }
-
-    public String getPrefix(){
-        return code.getPrefix();
-    }
-
-    public static FaultCodeEnum get(QName soapFaultCode){
-        if(VersionMismatch.code.equals(soapFaultCode))
-            return VersionMismatch;
-        else if(MustUnderstand.code.equals(soapFaultCode))
-            return MustUnderstand;
-        else if(DataEncodingUnknown.code.equals(soapFaultCode))
-            return DataEncodingUnknown;
-        else if(Sender.code.equals(soapFaultCode))
-            return Sender;
-        else if(Receiver.code.equals(soapFaultCode))
-            return Receiver;
-        return null;
-    }
-
-    private final QName code;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReason.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReason.java
deleted file mode 100644
index 30ff364..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReason.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Arrays;
-
-/**
- * SOAP 1.2 Fault Reason
- *  <soapenv:Reason>
- *      <soapenv:Text xml:lang="en">...</soapenv:Text>
- *  </soapenv:Reason>
- *
- * @author Vivek Pandey
- */
-public class FaultReason {
-    private List<FaultReasonText> texts;
-
-    public FaultReason(FaultReasonText... texts) {
-        assert(texts == null);
-        this.texts = Arrays.asList(texts);
-    }
-
-    public FaultReason(List<FaultReasonText> textList) {
-        texts = textList;
-    }
-
-    public List<FaultReasonText> getFaultReasonTexts(){
-        return texts;
-    }
-
-    void write(XMLStreamWriter writer) throws XMLStreamException {
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-            SOAP12Constants.QNAME_FAULT_REASON.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-        for(FaultReasonText text:texts){
-            text.write(writer);
-        }
-        writer.writeEndElement();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReasonText.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReasonText.java
deleted file mode 100644
index cb28c76..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultReasonText.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import java.util.Locale;
-
-/**
- * <soapenv:Text xmlns:lang="en">
- * ...
- * </soapenv:Text>
- *
- * @author Vivek Pandey
- */
-public class FaultReasonText {
-    private Locale language = Locale.getDefault();
-    private String value;
-
-    public FaultReasonText(String value, Locale lang) {
-        if(language != null && !language.equals(""))
-            this.language = lang;
-        this.value = value;
-    }
-
-    public Locale getLanguage() {
-        return language;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    void write(XMLStreamWriter writer) throws XMLStreamException {
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAP12Constants.QNAME_FAULT_REASON_TEXT.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-
-        //for now we only generate "en" language
-        writer.writeAttribute("xml", SOAP12NamespaceConstants.XML_NS, "lang", language.getLanguage());
-        writer.writeCharacters(value);
-        writer.writeEndElement();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultSubcode.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultSubcode.java
deleted file mode 100644
index 65aca59..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/FaultSubcode.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import java.util.Iterator;
-
-/**
- * SOAP 1.2 soapenv:Code
- *
- * <soapenv:Fault>
- *  <soapenv:Code>
- *      <soapenv:Value>soapenv:Sender</soapenv:Value>
- *      <soapenv:Subcode>
- *          <soapenv:Value>ns1:incorectRequest</Value>
- *          <soapenv:Subcode>
- *          ...
- *      </soapenv:Subcode>
- *  </soapenv:Code>
- * </soapenv:Fault>
- *
- * @author Vivek Pandey
- */
-public class FaultSubcode {
-    private QName value;
-    private FaultSubcode subcode;
-
-    public FaultSubcode(QName value, FaultSubcode subcode) {
-        this.value = value;
-        this.subcode = subcode;
-    }
-
-    public FaultSubcode(QName value, Iterator<QName> subcodes) {
-        this.value = value;
-        if(subcodes.hasNext()){
-            subcode = new FaultSubcode(subcodes.next(), subcodes);
-        }
-    }
-
-    public QName getValue() {
-        return value;
-    }
-
-    public FaultSubcode getSubcode() {
-        return subcode;
-    }
-
-    public FaultSubcode setSubCode(FaultSubcode sc){
-        this.subcode = sc;
-        return subcode;
-    }
-
-    void write(XMLStreamWriter writer) throws XMLStreamException {
-        // <soapenv:Subcode>
-        if(value == null)
-            return;
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-            SOAP12Constants.QNAME_FAULT_SUBCODE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-
-        // <soapenv:Value>
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-            SOAP12Constants.QNAME_FAULT_VALUE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-
-        writer.setPrefix(value.getPrefix(), value.getNamespaceURI());
-        if(value.getPrefix().equals(""))
-            writer.writeCharacters(value.getLocalPart());
-        else
-            writer.writeCharacters(value.getPrefix()+":"+value.getLocalPart());
-        writer.writeEndElement(); // </soapenv:Value>
-        if(subcode != null)
-            subcode.write(writer);
-        writer.writeEndElement(); // </soapenv:Subcode>
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAP12FaultInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAP12FaultInfo.java
deleted file mode 100644
index 1dec8d3..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAP12FaultInfo.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.streaming.DOMStreamReader;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPBinding;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Locale;
-
-import org.w3c.dom.Node;
-
-/**
- * SOAP 1.2 soap soapFault info class
- */
-public class SOAP12FaultInfo extends SOAPFaultInfo {
-    private FaultCode code;
-    private FaultReason reason;
-    private String node;
-    private String role;
-    private Object detail;
-
-    public SOAP12FaultInfo(FaultCode code, FaultReason reason, String node, String role, Object detail) {
-        this.code = code;
-        this.reason = reason;
-        this.node = node;
-        this.role = role;
-        this.detail = detail;
-
-        soapFault = SOAPUtil.createSOAPFault(SOAPBinding.SOAP12HTTP_BINDING);
-        setFaultCode();
-        setFaultReason();
-        setFaultNode();
-        setFaultRole();
-        if((detail != null) && (detail instanceof Detail)){
-            Node n = soapFault.getOwnerDocument().importNode((Detail)detail, true);
-            soapFault.appendChild(n);
-        }else{
-            faultBean = (detail != null)?(JAXBBridgeInfo)detail:null;
-        }
-    }
-
-    public SOAP12FaultInfo(SOAPFault fault) {
-        this.soapFault = fault;
-
-        //fault code
-        QName fc = soapFault.getFaultCodeAsQName();
-        Iterator iter = soapFault.getFaultSubcodes();
-        code = new FaultCode(FaultCodeEnum.get(fc), iter);
-
-        try {
-            //fault reason
-            List<FaultReasonText> texts = new ArrayList<FaultReasonText>();
-            iter = soapFault.getFaultReasonLocales();
-            while(iter.hasNext()){
-                Locale lang = (Locale)iter.next();
-                String text = soapFault.getFaultReasonText(lang);
-                texts.add(new FaultReasonText(text, lang));
-            }
-            reason = new FaultReason(texts);
-
-            //node
-            node = soapFault.getFaultNode();
-
-            //role
-            role = soapFault.getFaultRole();
-
-            //detail
-            detail = soapFault.getDetail();
-        } catch (SOAPException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
-    }
-
-    public FaultCode getFaultCode() {
-        return code;
-    }
-
-    public FaultReason getReasons() {
-        return reason;
-    }
-
-    public String getNode() {
-        return node;
-    }
-
-    public String getRole() {
-        return role;
-    }
-
-    private void setFaultRole() {
-        if (soapFault == null || role == null)
-            return;
-        try {
-            soapFault.setFaultRole(role);
-        } catch (SOAPException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    private void setFaultNode() {
-        if (soapFault == null || node == null)
-            return;
-        try {
-            soapFault.setFaultNode(node);
-        } catch (SOAPException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    private void setFaultReason() {
-        if (soapFault == null || reason == null)
-            return;
-        List<FaultReasonText> texts = reason.getFaultReasonTexts();
-        for (FaultReasonText text : texts) {
-            try {
-                soapFault.addFaultReasonText(text.getValue(), text.getLanguage());
-            } catch (SOAPException e) {
-                throw new WebServiceException(e);
-            }
-        }
-    }
-
-    /**
-     * add SOAP 1.2 Fault Code/Subcodes to javax.xml.soap.SOAPFault
-     */
-    private void setFaultCode() {
-        if (soapFault == null || code == null)
-            return;
-        try {
-            soapFault.setFaultCode(code.getValue().value());
-            FaultSubcode fsc = code.getSubcode();
-            while (fsc != null) {
-                soapFault.appendFaultSubcode(fsc.getValue());
-                fsc = fsc.getSubcode();
-            }
-        } catch (SOAPException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-
-    public void write(XMLStreamWriter writer, MessageInfo mi) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                    SOAP12Constants.QNAME_SOAP_FAULT.getLocalPart(),
-                    SOAP12Constants.QNAME_SOAP_FAULT.getNamespaceURI());
-            // Writing NS since this may be called without writing envelope
-            writer.writeNamespace(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                    SOAP12Constants.QNAME_SOAP_FAULT.getNamespaceURI());
-
-            code.write(writer); //<soapenv:Code> ... </soapenv:Code>
-            reason.write(writer);
-
-
-            //<soapenv:Node>...</soapenv:Node>
-            if (node != null) {
-                writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                        SOAP12Constants.QNAME_FAULT_NODE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-                writer.writeCharacters(node);
-                writer.writeEndElement();
-            }
-
-            //<soapenv:Role>...</soapenv:Role>
-            if (role != null) {
-                writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                        SOAP12Constants.QNAME_FAULT_ROLE.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-                writer.writeCharacters(role);
-                writer.writeEndElement();
-            }
-
-            //<soapenv:Detail>...</soapenv:Detail>
-            if (detail != null) {
-                // Not RuntimeException, Not header soapFault
-                if (detail instanceof Detail) {
-                    // SOAPFaultException
-                    SOAPEncoder.serializeReader(new DOMStreamReader((Detail) detail), writer);
-                } else if (detail instanceof JAXBBridgeInfo) {
-                    // Service specific exception
-                    startDetailElement(writer);     // <soapenv:Detail>
-                    RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-                    BridgeContext bridgeContext = rtCtxt.getBridgeContext();
-                    ((JAXBBridgeInfo) detail).serialize(bridgeContext, writer);
-                    writer.writeEndElement();  // </soapenv:Detail>
-                }
-            }
-            writer.writeEndElement();                // </soapenv:Fault>
-        } catch (XMLStreamException e) {
-            throw new ServerRtException(e);
-        }
-    }
-
-    private void startDetailElement(XMLStreamWriter writer) throws XMLStreamException {
-        writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAP12Constants.QNAME_FAULT_DETAIL.getLocalPart(), SOAP12NamespaceConstants.ENVELOPE);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPFaultInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPFaultInfo.java
deleted file mode 100644
index 4252846..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPFaultInfo.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.Detail;
-import javax.xml.ws.soap.SOAPBinding;
-
-/**
- * @author WS Development Team
- */
-public class SOAPFaultInfo {
-
-    public SOAPFaultInfo(){}
-    /**
-     * create SOAPFaultInfo with SOAPFault
-     *
-     * @param fault
-     */
-    public SOAPFaultInfo(SOAPFault fault) {
-        this.soapFault = fault;
-    }
-
-    /**
-     * Accessor method to get the fault bean
-     *
-     * @return the JAXBBidgeInfo for this fault
-     */
-    public JAXBBridgeInfo getFaultBean() {
-        return faultBean;
-    }
-
-    /**
-     * creates SOAPFaultInfo, could be SOAP 1.1 or SOAP 1.2 fault.
-     *
-     * @param string
-     * @param code
-     * @param actor
-     * @param detail
-     * @param bindingId
-     */
-    public SOAPFaultInfo(String string, QName code, String actor, Object detail, String bindingId) {
-        if (detail == null || detail instanceof Detail) {
-            Detail det = (detail != null) ? (Detail) detail : null;
-            soapFault = SOAPUtil.createSOAPFault(string, code, actor, det, bindingId);
-        } else {
-            soapFault = SOAPUtil.createSOAPFault(string, code, actor, null, bindingId);
-            faultBean = (JAXBBridgeInfo) detail;
-        }
-    }
-
-    public QName getCode() {
-        return soapFault.getFaultCodeAsQName();
-    }
-
-    public String getString() {
-        return soapFault.getFaultString();
-    }
-
-    public String getActor() {
-        return soapFault.getFaultActor();
-    }
-
-    public Object getDetail() {
-        if (faultBean != null)
-            return faultBean;
-
-        return soapFault.getDetail();
-    }
-
-    public SOAPFault getSOAPFault() {
-        return soapFault;
-    }
-
-    protected SOAPFault soapFault;
-    protected JAXBBridgeInfo faultBean;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgCreateException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgCreateException.java
deleted file mode 100644
index 72f4cd1..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgCreateException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-
-/**
- * @author WS Development Team
- */
-public class SOAPMsgCreateException extends JAXWSExceptionBase {
-
-    public SOAPMsgCreateException(String key, Object... args) {
-        super(key, args);
-    }
-
-    public String getResourceBundleName() {
-        return "com.sun.xml.internal.ws.resources.soap";
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgFactoryCreateException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgFactoryCreateException.java
deleted file mode 100644
index 63c77c3..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/message/SOAPMsgFactoryCreateException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.message;
-
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-
-/**
- * @author WS Development Team
- */
-public class SOAPMsgFactoryCreateException extends JAXWSExceptionBase {
-
-    public SOAPMsgFactoryCreateException(String key, Object... args) {
-        super(key, args);
-    }
-
-    public String getResourceBundleName() {
-        return "com.sun.xml.internal.ws.resources.soap";
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/ProviderSED.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/ProviderSED.java
deleted file mode 100644
index 2aded47..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/ProviderSED.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.server;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import javax.xml.transform.Source;
-import javax.xml.ws.soap.SOAPBinding;
-
-public class ProviderSED implements InternalEncoder {
-
-    public void toMessageInfo(Object internalMessage, MessageInfo messageInfo) {
-        throw new UnsupportedOperationException();
-    }
-
-    /*
-     * Sets Source in InternalMessage's BodyBlock. If there is an exception
-     * in MessageInfo, it is set as fault in BodyBlock
-     *
-     */
-    public InternalMessage toInternalMessage(MessageInfo messageInfo) {
-        InternalMessage internalMessage = new InternalMessage();
-        switch(messageInfo.getResponseType()) {
-            case MessageStruct.NORMAL_RESPONSE :
-                Object obj = messageInfo.getResponse();
-                if (obj instanceof Source) {
-                    BodyBlock bodyBlock = new BodyBlock((Source)obj);
-                    internalMessage.setBody(bodyBlock);
-                } else {
-                    throw new UnsupportedOperationException();
-                }
-                break;
-
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE :
-                // invoke() doesn't throw any checked exception
-                // Fallthrough
-
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE :
-                RuntimeContext rtContext = MessageInfoUtil.getRuntimeContext(messageInfo);
-                BindingImpl bindingImpl =
-                    (BindingImpl)rtContext.getRuntimeEndpointInfo().getBinding();
-                String bindingId = bindingImpl.getBindingId();
-                if (bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING)) {
-                    SOAPRuntimeModel.createFaultInBody(messageInfo.getResponse(),
-                            null, null, internalMessage);
-                } else if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
-                    SOAPRuntimeModel.createSOAP12FaultInBody(messageInfo.getResponse(),
-                            null, null, null, internalMessage);
-                }
-                break;
-        }
-        return internalMessage;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLDecoder.java
deleted file mode 100644
index 0666137..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLDecoder.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.server;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPFault;
-import javax.xml.stream.XMLStreamReader;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.SOAP12NotUnderstoodHeaderBlock;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import static javax.xml.stream.XMLStreamReader.*;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.streaming.XMLReader;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.server.*;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-/**
- * @author WS Development Team
- */
-public class SOAP12XMLDecoder extends SOAPXMLDecoder {
-
-    private static final Set<String> requiredRoles = new HashSet<String>();
-
-    public SOAP12XMLDecoder() {
-        requiredRoles.add("http://www.w3.org/2003/05/soap-envelope/role/next");
-        requiredRoles.add("http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#decodeHeader(com.sun.xml.internal.ws.streaming.XMLReader, com.sun.pept.ept.MessageInfo, com.sun.xml.internal.ws.soap.internal.InternalMessage)
-     */
-    @Override
-    protected void decodeHeader(XMLStreamReader reader, MessageInfo messageInfo, InternalMessage request) {
-        // TODO Auto-generated method stub
-        super.decodeHeader(reader, messageInfo, request);
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getBodyTag()
-     */
-    @Override
-    protected QName getBodyTag() {
-        return SOAP12Constants.QNAME_SOAP_BODY;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getEnvelopeTag()
-     */
-    @Override
-    protected QName getEnvelopeTag() {
-        return SOAP12Constants.QNAME_SOAP_ENVELOPE;
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.encoding.soap.SOAPDecoder#getHeaderTag()
-     */
-    @Override
-    protected QName getHeaderTag() {
-        return SOAP12Constants.QNAME_SOAP_HEADER;
-    }
-
-    @Override
-    protected QName getMUAttrQName(){
-        return SOAP12Constants.QNAME_MUSTUNDERSTAND;
-    }
-
-    @Override
-    protected QName getRoleAttrQName(){
-        return SOAP12Constants.QNAME_ROLE;
-    }
-
-    public Set<String> getRequiredRoles() {
-        return requiredRoles;
-    }
-
-    /*
-     * Keep track of all not-understood headers to return
-     * with fault to client. In soap 1.1, the check fails
-     * on the first not-understood header.
-     */
-    @Override
-    protected void checkHeadersAgainstKnown(XMLStreamReader reader,
-        Set<String> roles, Set<QName> understoodHeaders, MessageInfo mi) {
-
-        Set<QName> notUnderstoodHeaders = new HashSet<QName>();
-
-        while (true) {
-            if (reader.getEventType() == START_ELEMENT) {
-                // check MU header for each role
-                QName qName = reader.getName();
-                String mu = reader.getAttributeValue(
-                    getMUAttrQName().getNamespaceURI(),
-                    getMUAttrQName().getLocalPart());
-                if (mu != null && (mu.equals("1") ||
-                    mu.equalsIgnoreCase("true"))) {
-                    String role = reader.getAttributeValue(
-                        getRoleAttrQName().getNamespaceURI(),
-                        getRoleAttrQName().getLocalPart());
-                    if (role != null && roles.contains(role)) {
-                        logger.finest("Element=" + qName +
-                            " targeted at=" + role);
-                        if (understoodHeaders == null ||
-                            !understoodHeaders.contains(qName)) {
-                            logger.finest("Element not understood=" + qName);
-                            notUnderstoodHeaders.add(qName);
-                        }
-                    }
-                }
-                XMLStreamReaderUtil.skipElement(reader);   // Moves to END state
-                XMLStreamReaderUtil.nextElementContent(reader);
-            } else {
-                break;
-            }
-        }
-
-        if (notUnderstoodHeaders.isEmpty()) {
-            return;
-        }
-
-        // need to add headers to fault
-        SOAPFault sf = SOAPUtil.createSOAPFault(
-            MUST_UNDERSTAND_FAULT_MESSAGE_STRING,
-            SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND,
-            null, null, SOAPBinding.SOAP12HTTP_BINDING);
-        Set<HeaderBlock> nuHeaderBlocks = new HashSet<HeaderBlock>();
-        for (QName headerName : notUnderstoodHeaders) {
-            nuHeaderBlocks.add(new SOAP12NotUnderstoodHeaderBlock(headerName));
-        }
-        MessageInfoUtil.setNotUnderstoodHeaders(mi, nuHeaderBlocks);
-        throw new SOAPFaultException(sf);
-    }
-
-    @Override
-    public String getBindingId() {
-        return SOAPBinding.SOAP12HTTP_BINDING;
-    }
-
-    @Override
-    protected QName getSenderFaultCode() {
-        return SOAP12Constants.FAULT_CODE_CLIENT;
-
-    }
-
-    @Override
-    protected QName getReceiverFaultCode() {
-        return SOAP12Constants.FAULT_CODE_SERVER;
-
-    }
-
-    @Override
-    protected QName getVersionMismatchFaultCode() {
-        return SOAP12Constants.FAULT_CODE_VERSION_MISMATCH;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLEncoder.java
deleted file mode 100644
index 3612f11..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAP12XMLEncoder.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.server;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.ws.soap.SOAPBinding;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAP12FaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.server.*;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import javax.xml.ws.handler.MessageContext;
-
-public class SOAP12XMLEncoder extends SOAPXMLEncoder {
-    /*
-     * @see SOAPEncoder#startEnvelope(XMLStreamWriter)
-     */
-    @Override
-    protected void startEnvelope(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_ENVELOPE, SOAP12NamespaceConstants.ENVELOPE);
-            writer.setPrefix(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                             SOAP12NamespaceConstants.ENVELOPE);
-            writer.writeNamespace(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                                  SOAP12NamespaceConstants.ENVELOPE);
-        }
-        catch (XMLStreamException e) {
-            throw new ServerRtException(e);
-        }
-    }
-
-    /*
-     * @see SOAPEncoder#startBody(XMLStreamWriter)
-     */
-    @Override
-    protected void startBody(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_BODY, SOAP12NamespaceConstants.ENVELOPE);
-        }
-        catch (XMLStreamException e) {
-            throw new ServerRtException(e);
-        }
-    }
-
-    /*
-     * @see SOAPEncoder#startHeader(XMLStreamWriter)
-     */
-    @Override
-    protected void startHeader(XMLStreamWriter writer) {
-        try {
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPNamespaceConstants.TAG_HEADER, SOAP12NamespaceConstants.ENVELOPE); // <env:Header>
-        }
-        catch (XMLStreamException e) {
-            throw new ServerRtException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.xml.internal.ws.rt.server.SOAPXMLEncoder#writeFault(com.sun.xml.internal.ws.soap.message.SOAPFaultInfo, com.sun.pept.ept.MessageInfo, com.sun.xml.internal.ws.streaming.XMLStreamWriter)
-     */
-    @Override
-    protected void writeFault(SOAPFaultInfo faultInfo, MessageInfo messageInfo, XMLStreamWriter writer) {
-        if(!(faultInfo instanceof SOAP12FaultInfo))
-            return;
-        // Set a status code for Fault
-        MessageContext ctxt = MessageInfoUtil.getMessageContext(messageInfo);
-        if (MessageContextUtil.getHttpStatusCode(ctxt) == null) {
-            MessageContextUtil.setHttpStatusCode(ctxt, WSConnection.INTERNAL_ERR);
-        }
-
-        ((SOAP12FaultInfo)faultInfo).write(writer, messageInfo);
-    }
-
-    protected String getContentType(MessageInfo messageInfo,
-        JAXWSAttachmentMarshaller marshaller)
-    {
-        String contentNegotiation = (String)
-            messageInfo.getMetaData(BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY);
-
-        if (marshaller == null) {
-            marshaller = getAttachmentMarshaller(messageInfo);
-        }
-
-        if (marshaller != null && marshaller.isXopped()) {
-            return XOP_SOAP12_XML_TYPE_VALUE;
-        }
-        else {
-            return (contentNegotiation == "optimistic") ?
-                FAST_INFOSET_TYPE_SOAP12 : SOAP12_XML_CONTENT_TYPE_VALUE;
-        }
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     * @return the BindingID associated with this encoder
-     */
-    protected String getBindingId(){
-        return SOAPBinding.SOAP12HTTP_BINDING;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLDecoder.java
deleted file mode 100644
index 7c3c149..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLDecoder.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.soap.server;
-
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
-import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-import com.sun.xml.internal.ws.server.*;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderException;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.ws.handler.MessageContext;
-
-
-/**
- * @author WS Development Team
- */
-public class SOAPXMLDecoder extends SOAPDecoder {
-
-    private static final Set<String> requiredRoles = new HashSet<String>();
-    private static final QName emptyBodyName = new QName("");
-
-    public SOAPXMLDecoder() {
-        requiredRoles.add("http://schemas.xmlsoap.org/soap/actor/next");
-        requiredRoles.add("");
-    }
-
-    /*
-     *
-     * @throws ServerRtException
-     * @see SOAPDecoder#toInternalMessage(SOAPMessage)
-     */
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage, MessageInfo messageInfo) {
-        // TODO handle exceptions, attachments
-        XMLStreamReader reader = null;
-        try {
-            InternalMessage request = new InternalMessage();
-            processAttachments(messageInfo, request, soapMessage);
-            Source source = soapMessage.getSOAPPart().getContent();
-            reader = SourceReaderFactory.createSourceReader(source, true,getSOAPMessageCharsetEncoding(soapMessage));
-            XMLStreamReaderUtil.nextElementContent(reader);
-            decodeEnvelope(reader, request, false, messageInfo);
-            return request;
-        } catch(Exception e) {
-            if (isBadXML(e)) {
-                RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-                HandlerContext handlerCtxt = rtCtxt.getHandlerContext();
-                raiseBadXMLFault(handlerCtxt);
-            }
-            throw new ServerRtException("soapdecoder.err", new Object[]{e});
-        } finally {
-            if (reader != null) {
-                XMLStreamReaderUtil.close(reader);
-            }
-        }
-    }
-
-    protected boolean isBadXML(Exception e) {
-        while (e != null) {
-            if (e instanceof XMLStreamException) {
-                return true;
-            }
-            e = (e.getCause() instanceof Exception) ? (Exception)e.getCause() : null;
-        }
-        return false;
-    }
-
-
-    /*
-     * Headers from SOAPMesssage are mapped to HeaderBlocks in InternalMessage
-     * Body from SOAPMessage is skipped
-     * BodyBlock in InternalMessage is converted to JAXBTypeInfo or RpcLitPayload
-     *
-     * @throws ServerRtException
-     * @see SOAPDecoder#toInternalMessage(SOAPMessage, InternalMessage)
-     */
-    public InternalMessage toInternalMessage(SOAPMessage soapMessage,
-            InternalMessage request, MessageInfo messageInfo) {
-
-        // TODO handle exceptions, attachments
-        XMLStreamReader reader = null;
-        try {
-            processAttachments(messageInfo, request, soapMessage);
-            Source source = soapMessage.getSOAPPart().getContent();
-            reader = SourceReaderFactory.createSourceReader(source, true,getSOAPMessageCharsetEncoding(soapMessage));
-            XMLStreamReaderUtil.nextElementContent(reader);
-            decodeEnvelope(reader, request, true, messageInfo);
-            convertBodyBlock(request, messageInfo);
-        } catch(Exception e) {
-            if (isBadXML(e)) {
-                RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-                HandlerContext handlerCtxt = rtCtxt.getHandlerContext();
-                raiseBadXMLFault(handlerCtxt);
-            }
-            throw new ServerRtException("soapdecoder.err", new Object[]{e});
-        } finally {
-            if (reader != null) {
-                XMLStreamReaderUtil.close(reader);
-            }
-        }
-        return request;
-    }
-
-    @Override
-    public void decodeDispatchMethod(XMLStreamReader reader, InternalMessage request, MessageInfo messageInfo) {
-        // Operation's QName. takes care of <body/>
-        QName name = (reader.getEventType() == XMLStreamConstants.START_ELEMENT) ? reader.getName() : emptyBodyName;
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeModel rtModel = rtCtxt.getModel();
-        JavaMethod javaMethod = rtModel.getJavaMethod(name);
-        Method method = (javaMethod == null) ? null : javaMethod.getMethod();
-        if (method == null) {
-            raiseFault(getSenderFaultCode(), "Cannot find the dispatch method");
-        }
-        MessageContext msgCtxt = MessageInfoUtil.getMessageContext(messageInfo);
-        if (msgCtxt != null) {
-            String opNsUri = rtModel.getPortTypeName().getNamespaceURI();
-            String opName = javaMethod.getOperationName();
-            MessageContextUtil.setWsdlOperation(msgCtxt, new QName(opNsUri, opName));
-        }
-        messageInfo.setMethod(method);
-    }
-
-    protected SOAPFaultInfo decodeFault(XMLStreamReader reader, InternalMessage internalMessage,
-        MessageInfo messageInfo) {
-        raiseFault(getSenderFaultCode(), "Server cannot handle fault message");
-        return null;
-    }
-
-    @Override
-    protected void raiseBadXMLFault(HandlerContext ctxt) {
-        MessageContextUtil.setHttpStatusCode(ctxt.getMessageContext(), 400);
-        raiseFault(getSenderFaultCode(), "Bad request");
-    }
-
-    public Set<String> getRequiredRoles() {
-        return requiredRoles;
-    }
-
-    @Override
-    public String getBindingId() {
-        return SOAPBinding.SOAP11HTTP_BINDING;
-    }
-
-    @Override
-    protected QName getSenderFaultCode() {
-        return SOAPConstants.FAULT_CODE_CLIENT;
-    }
-
-    @Override
-    protected QName getReceiverFaultCode() {
-        return SOAPConstants.FAULT_CODE_SERVER;
-    }
-
-    @Override
-    protected QName getVersionMismatchFaultCode() {
-        return SOAPConstants.FAULT_CODE_VERSION_MISMATCH;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLEncoder.java
deleted file mode 100644
index c7268a8..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/server/SOAPXMLEncoder.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.soap.server;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.streaming.DOMStreamReader;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.soap.SOAPBinding;
-
-/**
- * @author WS Development Team
- */
-public class SOAPXMLEncoder extends SOAPEncoder {
-
-    protected static final String FAULTCODE_NAME   = "faultcode";
-    protected static final String FAULTSTRING_NAME = "faultstring";
-    protected static final String FAULTACTOR_NAME  = "faultactor";
-    protected static final String DETAIL_NAME      = "detail";
-
-    public SOAPXMLEncoder() {
-    }
-
-    public SOAPMessage toSOAPMessage(InternalMessage response, MessageInfo messageInfo) {
-        XMLStreamWriter writer = null;
-        JAXWSAttachmentMarshaller marshaller = null;
-        boolean xopEnabled = false;
-
-        try {
-            setAttachmentsMap(messageInfo, response);
-            ByteArrayBuffer bab = new ByteArrayBuffer();
-
-            if (messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic") {
-                writer = XMLStreamWriterFactory.createFIStreamWriter(bab);
-
-                // Turn XOP off for FI
-                marshaller = getAttachmentMarshaller(messageInfo);
-                if (marshaller != null) {
-                    xopEnabled = marshaller.isXOPPackage();     // last value
-                    marshaller.setXOPPackage(false);
-                }
-            }
-            else {
-                // Store output stream to use in JAXB bridge (not with FI)
-                messageInfo.setMetaData(JAXB_OUTPUTSTREAM, bab);
-                writer = XMLStreamWriterFactory.createXMLStreamWriter(bab);
-            }
-
-            writer.writeStartDocument();
-            startEnvelope(writer);
-            writeEnvelopeNamespaces(writer, messageInfo);
-            writeHeaders(writer, response, messageInfo);
-            writeBody(writer, response, messageInfo);
-            endEnvelope(writer);
-            writer.writeEndDocument();
-            writer.close();
-
-            MimeHeaders mh = new MimeHeaders();
-            mh.addHeader("Content-Type", getContentType(messageInfo, marshaller));
-            SOAPMessage msg = SOAPUtil.createMessage(mh, bab.newInputStream(), getBindingId());
-            processAttachments(response, msg);
-
-            // Restore default XOP processing before returning
-            if (marshaller != null) {
-                marshaller.setXOPPackage(xopEnabled);
-            }
-
-            return msg;
-        }
-        catch (Exception e) {
-            throw new ServerRtException("soapencoder.err", new Object[]{e});
-        }
-        finally {
-            if (writer != null) {
-                try {
-                    writer.close();
-                }
-                catch (XMLStreamException e) {
-                    throw new ServerRtException(e);
-                }
-            }
-        }
-    }
-
-    protected JAXWSAttachmentMarshaller getAttachmentMarshaller(MessageInfo messageInfo) {
-        Object rtc = messageInfo.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtc != null) {
-            BridgeContext bc = ((RuntimeContext) rtc).getBridgeContext();
-            if (bc != null) {
-                return (JAXWSAttachmentMarshaller) bc.getAttachmentMarshaller();
-            }
-        }
-        return null;
-    }
-
-    protected String getContentType(MessageInfo messageInfo,
-        JAXWSAttachmentMarshaller marshaller)
-    {
-        String contentNegotiation = (String)
-            messageInfo.getMetaData(BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY);
-
-        if (marshaller == null) {
-            marshaller = getAttachmentMarshaller(messageInfo);
-        }
-
-        if (marshaller != null && marshaller.isXopped()) {
-            return XOP_SOAP11_XML_TYPE_VALUE;
-        }
-        else {
-            return (contentNegotiation == "optimistic") ?
-                FAST_INFOSET_TYPE_SOAP11 : XML_CONTENT_TYPE_VALUE;
-        }
-    }
-
-    /*
-     * writes <env:Fault> ... </env:Fault>. JAXB serializes the contents
-     * in the <detail> for service specific exceptions. We serialize protocol
-     * specific exceptions ourselves
-     */
-    protected void writeFault(SOAPFaultInfo instance, MessageInfo messageInfo, XMLStreamWriter writer) {
-        try {
-            // Set a status code for Fault
-            MessageContext ctxt = MessageInfoUtil.getMessageContext(messageInfo);
-            if (MessageContextUtil.getHttpStatusCode(ctxt) == null) {
-                MessageContextUtil.setHttpStatusCode(ctxt, WSConnection.INTERNAL_ERR);
-            }
-
-            writer.writeStartElement(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                SOAPConstants.QNAME_SOAP_FAULT.getLocalPart(),
-                SOAPConstants.QNAME_SOAP_FAULT.getNamespaceURI());
-            // Writing NS since this may be called without writing envelope
-            writer.writeNamespace(SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE,
-                    SOAPConstants.QNAME_SOAP_FAULT.getNamespaceURI());
-
-            writer.writeStartElement(FAULTCODE_NAME);   // <faultcode>
-            String prefix = SOAPNamespaceConstants.NSPREFIX_SOAP_ENVELOPE;
-            QName faultCode = instance.getCode();
-            String nsURI = faultCode.getNamespaceURI();
-            if (!nsURI.equals(SOAPNamespaceConstants.ENVELOPE)) {
-                    // Need to add namespace declaration for this custom fault code
-                if (nsURI.equals(XMLConstants.NULL_NS_URI)) {
-                    prefix = XMLConstants.DEFAULT_NS_PREFIX;
-                } else {
-                    prefix = faultCode.getPrefix();
-                    if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                        prefix = "ans";
-                    }
-                    writer.setPrefix(prefix, nsURI);
-                    writer.writeNamespace(prefix, nsURI);
-                }
-            }
-            if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                writer.writeCharacters(instance.getCode().getLocalPart());
-            } else {
-                    writer.writeCharacters(prefix+":"+instance.getCode().getLocalPart());
-            }
-            writer.writeEndElement();                    // </faultcode>
-
-            writer.writeStartElement(FAULTSTRING_NAME);
-            writer.writeCharacters(instance.getString());
-            writer.writeEndElement();
-
-            if (instance.getActor() != null) {
-                writer.writeStartElement(FAULTACTOR_NAME);
-                writer.writeCharacters(instance.getActor());
-                writer.writeEndElement();
-            }
-
-            Object detail = instance.getDetail();
-            if (detail != null) {
-                // Not RuntimeException, Not header fault
-                if (detail instanceof Detail) {
-                    // SOAPFaultException
-                    encodeDetail((Detail)detail, writer);
-                } else if (detail instanceof JAXBBridgeInfo) {
-                    // Service specific exception
-                    writer.writeStartElement(DETAIL_NAME);
-                    writeJAXBBridgeInfo((JAXBBridgeInfo)detail, messageInfo, writer);
-                    writer.writeEndElement();        // </detail>
-                }
-            }
-
-            writer.writeEndElement();                // </env:Fault>
-        }
-        catch (XMLStreamException e) {
-            throw new ServerRtException(e);
-        }
-    }
-
-    /*
-     * Serializes javax.xml.soap.Detail. Detail is of type SOAPElement.
-     * XmlTreeReader is used to traverse the SOAPElement/DOM Node and serializes
-     * the XML.
-     */
-    protected void encodeDetail(Detail detail, XMLStreamWriter writer) {
-        serializeReader(new DOMStreamReader(detail), writer);
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     * @return the BindingID associated with this encoder
-     */
-    protected String getBindingId(){
-        return SOAPBinding.SOAP11HTTP_BINDING;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java
index bfd7375..6563b5c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java
index f349c9b..f37ac36 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java
new file mode 100644
index 0000000..f8bf5ab
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.encoding.xml;
+
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+
+public final class XMLCodec implements Codec {
+    public static final String XML_APPLICATION_MIME_TYPE = "application/xml";
+
+    public static final String XML_TEXT_MIME_TYPE = "text/xml";
+
+    private static final ContentType contentType = new ContentTypeImpl(XML_TEXT_MIME_TYPE);
+
+    public String getMimeType() {
+        return XML_APPLICATION_MIME_TYPE;
+    }
+
+    public ContentType getStaticContentType(Packet packet) {
+        return contentType;
+    }
+
+    public ContentType encode(Packet packet, OutputStream out) {
+        XMLStreamWriter writer = XMLStreamWriterFactory.create(out);
+        try {
+            if (packet.getMessage().hasPayload()){
+                packet.getMessage().writePayloadTo(writer);
+                writer.flush();
+            }
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+        return contentType;
+    }
+
+    public ContentType encode(Packet packet, WritableByteChannel buffer) {
+        //TODO: not yet implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public Codec copy() {
+        return this;
+    }
+
+    public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+        Message message = XMLMessage.create(contentType, in);
+        packet.setMessage(message);
+    }
+
+    public void decode(ReadableByteChannel in, String contentType, Packet packet) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLDecoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLDecoder.java
deleted file mode 100644
index 2298bd9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLDecoder.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.encoding.xml;
-import javax.xml.stream.XMLStreamReader;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.*;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-
-import static javax.xml.stream.XMLStreamReader.*;
-import javax.xml.soap.SOAPMessage;
-import java.util.logging.Logger;
-
-
-
-/**
- * @author WS Development Team
- */
-public class XMLDecoder implements Decoder {
-
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".xml.decoder");
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.encoding.Decoder#decode(com.sun.pept.ept.MessageInfo)
-     */
-    public void decode(MessageInfo arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    /* (non-Javadoc)
-     * @see com.sun.pept.encoding.Decoder#receieveAndDecode(com.sun.pept.ept.MessageInfo)
-     */
-    public void receiveAndDecode(MessageInfo arg0) {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * parses and binds body from xmlMessage.
-     * @param xmlMessage
-     * @param messageInfo
-     * @return InternalMessage representation of xmlMessage
-     */
-    public InternalMessage toInternalMessage(XMLMessage xmlMessage,
-                    MessageInfo messageInfo) {
-            return null;
-    }
-
-    /**
-     * Parses and binds xmlMessage.
-     * @param xmlMessage
-     * @param internalMessage
-     * @param messageInfo
-     *
-     */
-    public InternalMessage toInternalMessage(XMLMessage xmlMessage,
-            InternalMessage internalMessage, MessageInfo messageInfo) {
-        return null;
-    }
-
-    public SOAPMessage toSOAPMessage(MessageInfo messageInfo) {
-        return null;
-    }
-
-    public void toMessageInfo(InternalMessage internalMessage, MessageInfo messageInfo) { }
-
-    public void decodeDispatchMethod(XMLStreamReader reader, InternalMessage request, MessageInfo messageInfo) {
-    }
-
-
-    /*
-    *
-    */
-   protected void convertBodyBlock(InternalMessage request, MessageInfo messageInfo) {
-       BodyBlock bodyBlock = request.getBody();
-       if (bodyBlock != null) {
-           Object value = bodyBlock.getValue();
-           if (value instanceof JAXBBeanInfo) {
-               System.out.println("******* NOT HANDLED JAXBBeanInfo ***********");
-           } else if (value instanceof XMLMessage) {
-               XMLMessage xmlMessage = (XMLMessage)value;
-               //XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true);
-               //XMLStreamReaderUtil.nextElementContent(reader);
-               //decodeBodyContent(reader, request, messageInfo);
-           } else {
-               System.out.println("****** Unknown type in BodyBlock ***** "+value.getClass());
-           }
-       }
-   }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEPTFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEPTFactory.java
deleted file mode 100644
index 00ca611..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEPTFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.xml;
-
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-
-/**
- * Change the name of this class to JaxwsEPTFactory or something else. OR
- * split into multiple factories.
- */
-public interface XMLEPTFactory extends EPTFactory {
-    public InternalEncoder getInternalEncoder();
-    public XMLEncoder getXMLEncoder();
-    public XMLDecoder getXMLDecoder();
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEncoder.java
deleted file mode 100644
index f14b2d3..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLEncoder.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.encoding.xml;
-import java.nio.ByteBuffer;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.server.ServerRtException;
-
-
-
-/**
- * @author WS Development Team
- */
-public class XMLEncoder implements Encoder {
-
-    /*
-     * @see com.sun.pept.encoding.Encoder#encodeAndSend(com.sun.pept.ept.MessageInfo)
-     */
-    public void encodeAndSend(MessageInfo messageInfo) {
-        throw new UnsupportedOperationException();
-    }
-
-    /*
-     * @see com.sun.pept.encoding.Encoder#encode(com.sun.pept.ept.MessageInfo)
-     */
-    public ByteBuffer encode(MessageInfo messageInfo) {
-        throw new UnsupportedOperationException();
-    }
-
-    public InternalMessage toInternalMessage(MessageInfo messageInfo) {
-        return null;
-    }
-
-    public XMLMessage toXMLMessage(InternalMessage internalMessage, MessageInfo messageInfo) {
-        return null;
-    }
-
-    /*
-     * Replace the body in SOAPMessage with the BodyBlock of InternalMessage
-     */
-    public XMLMessage toXMLMessage(InternalMessage internalMessage,
-            XMLMessage xmlMessage) {
-        try {
-            BodyBlock bodyBlock = internalMessage.getBody();
-            Object value = bodyBlock.getValue();
-            if (value == null) {
-                return xmlMessage;
-            }
-            if (value instanceof XMLMessage) {
-                return (XMLMessage)value;
-            } else {
-                throw new UnsupportedOperationException("Unknown object in BodyBlock:"+value.getClass());
-            }
-        } catch(Exception e) {
-            throw new ServerRtException("xmlencoder.err", new Object[]{e});
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java
index a2fa69d..691a0e7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,53 +25,51 @@
 
 package com.sun.xml.internal.ws.encoding.xml;
 
-import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
+import com.sun.istack.internal.NotNull;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.InternetHeaders;
-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart;
 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeMultipart;
-import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
 import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer;
-import com.sun.xml.internal.ws.protocol.xml.XMLMessageException;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.streaming.XMLStreamWriterFactory;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.FastInfosetReflection;
-import com.sun.xml.internal.ws.util.FastInfosetUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import java.io.BufferedInputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import javax.activation.DataHandler;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.encoding.MimeMultipartParser;
+import com.sun.xml.internal.ws.encoding.XMLHTTPBindingCodec;
+import com.sun.xml.internal.ws.message.AbstractMessageImpl;
+import com.sun.xml.internal.ws.message.EmptyMessageImpl;
+import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
 
 import javax.activation.DataSource;
-import javax.xml.bind.JAXBContext;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.transform.OutputKeys;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.http.HTTPException;
-import java.io.ByteArrayInputStream;
+import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.logging.Logger;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  *
- * @author WS Developement Team
+ * @author Jitendra Kotamraju
  */
 public final class XMLMessage {
 
-    private static final Logger log = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".protocol.xml");
-
     // So that SAAJ registers DCHs for MIME types
     static {
         new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
@@ -81,27 +79,6 @@
     private static final int MIME_MULTIPART_FLAG = 2;       // 00010
     private static final int FI_ENCODED_FLAG     = 16;      // 10000
 
-    private final DataRepresentation data;
-
-    /**
-     * Indicates when Fast Infoset should be used to serialize
-     * this message.
-     */
-    protected boolean useFastInfoset = false;
-
-    /**
-     * Construct a message from an input stream. When messages are
-     * received, there's two parts -- the transport headers and the
-     * message content in a transport specific stream.
-     */
-    public XMLMessage(MimeHeaders headers, final InputStream in) {
-        String ct = null;
-        if (headers != null) {
-            ct = getContentType(headers);
-        }
-        this.data = getData(ct, in);
-        // TODO should headers be set on the data?
-    }
 
     /**
      * Finds if the stream has some content or not
@@ -109,7 +86,7 @@
      * @return null if there is no data
      *         else stream to be used
      */
-    private InputStream hasSomeData(InputStream in) throws IOException {
+    private static InputStream hasSomeData(InputStream in) throws IOException {
         if (in != null) {
             if (in.available() < 1) {
                 if (!in.markSupported()) {
@@ -126,26 +103,32 @@
         return in;
     }
 
-    private DataRepresentation getData(final String ct, InputStream in) {
-        DataRepresentation data;
+
+    /**
+     * Construct a message given a content type and an input stream.
+     */
+    public static Message create(final String ct, InputStream in) {
+        Message data;
         try {
             in = hasSomeData(in);
             if (in == null) {
-                return new NullContent();
+                data = Messages.createEmpty(SOAPVersion.SOAP_11);
+                return data;
             }
+
             if (ct != null) {
-                ContentType contentType = new ContentType(ct);
-                int contentTypeId = identifyContentType(contentType);
-                boolean isFastInfoset = (contentTypeId & FI_ENCODED_FLAG) > 0;
+                final ContentType contentType = new ContentType(ct);
+                final int contentTypeId = identifyContentType(contentType);
                 if ((contentTypeId & MIME_MULTIPART_FLAG) != 0) {
-                    data = new XMLMultiPart(ct, in, isFastInfoset);
-                } else if ((contentTypeId & PLAIN_XML_FLAG) != 0 || (contentTypeId & FI_ENCODED_FLAG) != 0) {
-                    data = new XMLSource(in, isFastInfoset);
+                    data = new XMLMultiPart(ct, in);
+                } else if ((contentTypeId & PLAIN_XML_FLAG) != 0) {
+                    data = Messages.createUsingPayload(new StreamSource(in),
+                            SOAPVersion.SOAP_11);
                 } else {
                     data = new UnknownContent(ct, in);
                 }
             } else {
-                data = new NullContent();
+                data = Messages.createEmpty(SOAPVersion.SOAP_11);
             }
         } catch(Exception ex) {
             throw new WebServiceException(ex);
@@ -154,106 +137,43 @@
     }
 
 
-    public XMLMessage(Source source, boolean useFastInfoset) {
-        this.data = (source == null) ? new NullContent() : new XMLSource(source);
-        this.useFastInfoset = useFastInfoset;
-
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            useFastInfoset ? "application/fastinfoset" : "text/xml");
+    public static Message create(Source source) {
+        return (source == null) ?
+            Messages.createEmpty(SOAPVersion.SOAP_11) :
+            Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
     }
 
-    public XMLMessage(Exception err, boolean useFastInfoset) {
-        this.data = new XMLErr(err);
-        this.useFastInfoset = useFastInfoset;
-
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            useFastInfoset ? "application/fastinfoset" : "text/xml");
-    }
-
-    public XMLMessage(DataSource ds, boolean useFastInfoset) {
-        this.useFastInfoset = useFastInfoset;
+    public static Message create(DataSource ds) {
         try {
-            this.data = (ds == null) ? new NullContent() : getData(ds.getContentType(), ds.getInputStream());
+            return (ds == null) ?
+                Messages.createEmpty(SOAPVersion.SOAP_11) :
+                create(ds.getContentType(), ds.getInputStream());
         } catch(IOException ioe) {
             throw new WebServiceException(ioe);
         }
-
-        String contentType = (ds != null) ? ds.getContentType() : null;
-        contentType =  (contentType == null) ? contentType = "text/xml": contentType;
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            !useFastInfoset ? contentType
-                : contentType.replaceFirst("text/xml", "application/fastinfoset"));
     }
 
-    public XMLMessage(Object object, JAXBContext context, boolean useFastInfoset) {
-        this.data = (object == null) ? new NullContent() : new XMLJaxb(object, context);
-        this.useFastInfoset = useFastInfoset;
-
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            useFastInfoset ? "application/fastinfoset" : "text/xml");
+    public static Message create(Exception e) {
+        return new FaultMessage(SOAPVersion.SOAP_11);
     }
 
-
-    public XMLMessage(Source source, Map<String, DataHandler> attachments, boolean useFastInfoset) {
-        if (attachments == null) {
-            this.data = (source == null) ? new NullContent() : new XMLSource(source);
-        } else {
-            if (source == null) {
-                this.data = new UnknownContent(attachments);
-            } else {
-                this.data = new XMLMultiPart(source, attachments, useFastInfoset);
-            }
+    /**
+     * Get the content type ID from the content type.
+     */
+    private static int getContentId(String ct) {
+        try {
+            final ContentType contentType = new ContentType(ct);
+            return identifyContentType(contentType);
+        } catch(Exception ex) {
+            throw new WebServiceException(ex);
         }
-
-        this.useFastInfoset = useFastInfoset;
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            useFastInfoset ? "application/fastinfoset" : "text/xml");
-    }
-
-    public XMLMessage(Object object, JAXBContext context, Map<String, DataHandler> attachments, boolean useFastInfoset) {
-        if (attachments == null) {
-            this.data = (object == null) ? new NullContent() : new XMLJaxb(object, context);
-        } else {
-            if (object == null) {
-                this.data = new UnknownContent(attachments);
-            } else {
-                this.data = new XMLMultiPart(JAXBTypeSerializer.serialize(object, context), attachments, useFastInfoset);
-            }
-        }
-
-        this.useFastInfoset = useFastInfoset;
-        this.data.getMimeHeaders().addHeader("Content-Type",
-            useFastInfoset ? "application/fastinfoset" : "text/xml");
     }
 
     /**
-     * Returns true if the underlying encoding of this message is FI.
+     * Return true if the content uses fast infoset.
      */
-    public boolean isFastInfoset() {
-        return data.isFastInfoset();
-    }
-
-    /**
-     * Returns true if the FI encoding should be used.
-     */
-    public boolean useFastInfoset() {
-        return useFastInfoset;
-    }
-
-    /**
-     * Returns true if the sender of this message accepts FI. Slow, but
-     * should only be called once.
-     */
-    public boolean acceptFastInfoset() {
-        return FastInfosetUtil.isFastInfosetAccepted(getMimeHeaders().getHeader("Accept"));
-    }
-
-    public Source getSource() {
-        return data.getSource();
-    }
-
-    public DataSource getDataSource() {
-        return data.getDataSource();
+    public static boolean isFastInfoset(String ct) {
+        return (getContentId(ct) & FI_ENCODED_FLAG) != 0;
     }
 
     /**
@@ -266,7 +186,7 @@
      * FI_ENCODED_FLAG
      *
      */
-    private static int identifyContentType(ContentType contentType) {
+    public static int identifyContentType(ContentType contentType) {
         String primary = contentType.getPrimaryType();
         String sub = contentType.getSubType();
 
@@ -288,13 +208,17 @@
         return 0;
     }
 
-    protected static boolean isXMLType(String primary, String sub) {
-        return (primary.equalsIgnoreCase("text") || primary.equalsIgnoreCase("application")) && sub.equalsIgnoreCase("xml");
+    protected static boolean isXMLType(@NotNull String primary, @NotNull String sub) {
+        return (primary.equalsIgnoreCase("text") && sub.equalsIgnoreCase("xml"))
+                || (primary.equalsIgnoreCase("application") && sub.equalsIgnoreCase("xml"))
+                || (primary.equalsIgnoreCase("application") && sub.toLowerCase().endsWith("+xml"));
     }
 
     protected static boolean isXMLType(String type) {
-        return type.toLowerCase().startsWith("text/xml") ||
-            type.toLowerCase().startsWith("application/xml");
+        String lowerType = type.toLowerCase();
+        return lowerType.startsWith("text/xml")
+                || lowerType.startsWith("application/xml")
+                || (lowerType.startsWith("application/") && (lowerType.indexOf("+xml") != -1));
     }
 
     protected static boolean isFastInfosetType(String primary, String sub) {
@@ -305,598 +229,189 @@
         return type.toLowerCase().startsWith("application/fastinfoset");
     }
 
+
     /**
-     * Ideally this should be called just before writing the message
+     * Access a {@link Message} as a {@link DataSource}.
+     * <p>
+     * A {@link Message} implementation will implement this if the
+     * messages is to be access as data source.
+     * <p>
+     * TODO: consider putting as part of the API.
      */
-    public MimeHeaders getMimeHeaders() {
-        return data.getMimeHeaders();
-    }
-
-    private static String getContentType(MimeHeaders headers) {
-        String[] values = headers.getHeader("Content-Type");
-        return (values == null) ? null : values[0];
-    }
-
-    public int getStatus() {
-        return data.getStatus();
-    }
-
-    public void writeTo(OutputStream out) throws IOException {
-        data.writeTo(out,useFastInfoset);
-    }
-
-    public Source getPayload() {
-        return data.getPayload();
-    }
-
-    public Map<String, DataHandler> getAttachments() {
-        return data.getAttachments();
-    }
-
-    public Object getPayload(JAXBContext context) {
-        // Get a copy of Source using getPayload() and use it to deserialize
-        // to JAXB object
-        return JAXBTypeSerializer.deserialize(getPayload(), context);
-    }
-
-    /**
-     * Defines operations available regardless of the actual in-memory data representation.
-     */
-    private static abstract class DataRepresentation {
+    public static interface MessageDataSource {
         /**
-         * Can be called multiple times. Typically from XMLLogicalMessageImpl
+         * Check if the data source has been consumed.
+         * @return true of the data source has been consumed, otherwise false.
          */
-        abstract Source getPayload();
+        boolean hasUnconsumedDataSource();
 
         /**
-         * Should be called only once. Once this is called, don't use this object anymore
+         * Get the data source.
+         * @return the data source.
          */
-        abstract void writeTo(OutputStream out,boolean useFastInfoset) throws IOException;
-        /**
-         * Returns true whenever the underlying representation of this message
-         * is a Fast Infoset stream.
-         */
-        abstract boolean isFastInfoset();
-
-        /**
-         * Should be called only once. Once this is called, don't use this object anymore
-         */
-        abstract Source getSource();
-
-        /**
-         * Should be called only once. Once this is called, don't use this object anymore
-         */
-        abstract DataSource getDataSource();
-
-        /**
-         * Should be called only once. Once this is called, don't use this object anymore
-         */
-        abstract Map<String, DataHandler> getAttachments();
-
-        /**
-         * Should contain Content-Type for this message.
-         */
-        abstract MimeHeaders getMimeHeaders();
-        int getStatus() {
-            return WSConnection.OK;
-        }
+        DataSource getDataSource();
     }
 
 
     /**
-     * Data represented as a multi-part MIME message. It also has XML as
-     * root part
+     * Data represented as a multi-part MIME message.
+     * <p>
+     * The root part may be an XML or an FI document.
      *
      * This class parses {@link MimeMultipart} lazily.
      */
-    private static final class XMLMultiPart extends DataRepresentation {
-        private DataSource dataSource;
-        private MimeMultipart multipart;
-        private XMLSource xmlSource;
-        private boolean isFastInfoset;
-        private final MimeHeaders headers = new MimeHeaders();
+    public static final class XMLMultiPart extends AbstractMessageImpl implements MessageDataSource {
+        private final DataSource dataSource;
+        private MimeMultipartParser mpp;
 
-        public XMLMultiPart(final String contentType, final InputStream is, boolean isFastInfoset) {
-            this.isFastInfoset = isFastInfoset;
-            dataSource = new DataSource() {
-                public InputStream getInputStream() {
-                    return is;
-                }
-
-                public OutputStream getOutputStream() {
-                    return null;
-                }
-
-                public String getContentType() {
-                    return contentType;
-                }
-
-                public String getName() {
-                    return "";
-                }
-            };
+        public XMLMultiPart(final String contentType, final InputStream is) {
+            super(SOAPVersion.SOAP_11);
+            dataSource = createDataSource(contentType, is);
         }
 
-        public XMLMultiPart(Source source, final Map<String, DataHandler> atts, boolean isFastInfoset) {
-            this.isFastInfoset = isFastInfoset;
-            multipart = new MimeMultipart("related");
-            multipart.getContentType().setParameter("type", "text/xml");
-
-            // Creates Primary part
-            ByteOutputStream bos = new ByteOutputStream();
-            new XMLSource(source).writeTo(bos, isFastInfoset);
-            InternetHeaders headers = new InternetHeaders();
-            headers.addHeader("Content-Type",
-                isFastInfoset ? "application/fastinfoset" : "text/xml");
-            MimeBodyPart rootPart = new MimeBodyPart(headers, bos.getBytes(),bos.getCount());
-            multipart.addBodyPart(rootPart, 0);
-
-            for(Map.Entry<String, DataHandler> e : atts.entrySet()) {
-                MimeBodyPart part = new MimeBodyPart();
-                part.setDataHandler(e.getValue());
-                multipart.addBodyPart(part);
-            }
-        }
-
-        public XMLMultiPart(DataSource dataSource, boolean isFastInfoset) {
+        public XMLMultiPart(DataSource dataSource) {
+            super(SOAPVersion.SOAP_11);
             this.dataSource = dataSource;
-            this.isFastInfoset = isFastInfoset;
-        }
-
-        public boolean isFastInfoset() {
-            return isFastInfoset;
         }
 
         public DataSource getDataSource() {
-            if (dataSource != null) {
-                return dataSource;
-            }
-            else if (multipart != null) {
-                return new DataSource() {
-                    public InputStream getInputStream() {
-                        try {
-                            if (xmlSource != null) {
-                                replaceRootPart(false);
-                            }
-                            ByteOutputStream bos = new ByteOutputStream();
-                            multipart.writeTo(bos);
-                            return bos.newInputStream();
-                        } catch(MessagingException me) {
-                            throw new XMLMessageException("xml.get.ds.err",me);
-                        } catch(IOException ioe) {
-                            throw new XMLMessageException("xml.get.ds.err",ioe);
-                        }
-                    }
-
-                    public OutputStream getOutputStream() {
-                        return null;
-                    }
-
-                    public String getContentType() {
-                        return multipart.getContentType().toString();
-                    }
-
-                    public String getName() {
-                        return "";
-                    }
-                };
-            }
-            return null;
+            assert dataSource != null;
+            return dataSource;
         }
 
-        private MimeBodyPart getRootPart() {
-            try {
-                convertToMultipart();
-                ContentType contentType = multipart.getContentType();
-                String startParam = contentType.getParameter("start");
-                MimeBodyPart sourcePart = (startParam == null)
-                    ? (MimeBodyPart)multipart.getBodyPart(0)
-                    : (MimeBodyPart)multipart.getBodyPart(startParam);
-                return sourcePart;
-            }
-            catch (MessagingException ex) {
-                throw new XMLMessageException("xml.get.source.err",ex);
-            }
-        }
-
-        private void replaceRootPart(boolean useFastInfoset) {
-            if (xmlSource == null) {
-                return;
-            }
-            try {
-                MimeBodyPart sourcePart = getRootPart();
-                String ctype = sourcePart.getContentType();
-                multipart.removeBodyPart(sourcePart);
-
-                ByteOutputStream bos = new ByteOutputStream();
-                xmlSource.writeTo(bos, useFastInfoset);
-                InternetHeaders headers = new InternetHeaders();
-                headers.addHeader("Content-Type",
-                    useFastInfoset ? "application/fastinfoset" : ctype);
-
-                sourcePart = new MimeBodyPart(headers, bos.getBytes(),bos.getCount());
-                multipart.addBodyPart(sourcePart, 0);
-            }
-            catch (MessagingException ex) {
-                throw new XMLMessageException("xml.get.source.err",ex);
-            }
-        }
-
-        private void convertToMultipart() {
-            if (dataSource != null) {
+        private void convertDataSourceToMessage() {
+            if (mpp == null) {
                 try {
-                    multipart = new MimeMultipart(dataSource,null);
-                    dataSource = null;
-                } catch (MessagingException ex) {
-                    throw new XMLMessageException("xml.get.source.err",ex);
+                    mpp = new MimeMultipartParser(
+                            dataSource.getInputStream(),
+                            dataSource.getContentType());
+                } catch(IOException ioe) {
+                    throw new WebServiceException(ioe);
                 }
             }
         }
 
-        /**
-         * Returns root part of the MIME message
-         */
-        public Source getSource() {
-            try {
-                // If there is an XMLSource, return that
-                if (xmlSource != null) {
-                    return xmlSource.getPayload();
-                }
-
-                // Otherwise, parse MIME package and find root part
-                convertToMultipart();
-                MimeBodyPart sourcePart = getRootPart();
-                ContentType ctype = new ContentType(sourcePart.getContentType());
-                String baseType = ctype.getBaseType();
-
-                // Return a StreamSource or FastInfosetSource depending on type
-                if (isXMLType(baseType)) {
-                    return new StreamSource(sourcePart.getInputStream());
-                }
-                else if (isFastInfosetType(baseType)) {
-                    return FastInfosetReflection.FastInfosetSource_new(
-                        sourcePart.getInputStream());
-                }
-                else {
-                    throw new XMLMessageException(
-                            "xml.root.part.invalid.Content-Type",
-                            new Object[] {baseType});
-                }
-            } catch (MessagingException ex) {
-                throw new XMLMessageException("xml.get.source.err",ex);
-            } catch (Exception ioe) {
-                throw new XMLMessageException("xml.get.source.err",ioe);
-            }
-        }
-
-        public Source getPayload() {
-            return getSource();
-        }
-
-        public void writeTo(OutputStream out, boolean useFastInfoset) {
-            try {
-                // If a source has been set, ensure MIME parsing
-                if (xmlSource != null) {
-                    convertToMultipart();
-                }
-
-                // Try to use dataSource whenever possible
-                if (dataSource != null) {
-                    // If already encoded correctly, just copy the bytes
-                    if (isFastInfoset == useFastInfoset) {
-                        InputStream is = dataSource.getInputStream();
-                        byte[] buf = new byte[1024];
-                        int len;
-                        while ((len = is.read(buf)) != -1) {
-                            out.write(buf, 0, len);
-                        }
-                        return;     // we're done
-                    }
-                    else {
-                        // Parse MIME and create source for root part
-                        xmlSource = new XMLSource(getSource());
-                    }
-                }
-
-                // Finally, possibly re-encode root part and write it out
-                replaceRootPart(useFastInfoset);
-                multipart.writeTo(out);
-            }
-            catch(Exception e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public Map<String, DataHandler> getAttachments() {
-            // If a source has been set, ensure MIME parsing
-            if (xmlSource != null) {
-                convertToMultipart();
-            }
-            try {
-                MimeBodyPart rootPart = getRootPart();
-                Map<String, DataHandler> map = new HashMap<String, DataHandler>();
-                int count = multipart.getCount();
-                for(int i=0; i < count; i++) {
-                    MimeBodyPart part = multipart.getBodyPart(i);
-                    if (part != rootPart) {
-                        map.put(part.getContentID(), part.getDataHandler());
-                    }
-                }
-                return map;
-            } catch (MessagingException ex) {
-                throw new XMLMessageException("xml.get.source.err",ex);
-            }
-        }
-
-        MimeHeaders getMimeHeaders() {
-            headers.removeHeader("Content-Type");
-            if (dataSource != null) {
-                headers.addHeader("Content-Type", dataSource.getContentType());
-            } else {
-                if (multipart != null ) {
-                    headers.addHeader("Content-Type", multipart.getContentType().toString());
-                }
-            }
-            return headers;
-        }
-
-    }
-
-    /**
-     * Data represented as {@link Source}.
-     */
-    public static class XMLSource extends DataRepresentation {
-
-        private Source source;
-        private boolean isFastInfoset;
-        private final MimeHeaders headers = new MimeHeaders();
-
-        public XMLSource(InputStream in, boolean isFastInfoset) throws Exception {
-            this.source = isFastInfoset ?
-                FastInfosetReflection.FastInfosetSource_new(in)
-                : new StreamSource(in);
-            this.isFastInfoset = isFastInfoset;
-        }
-
-        public XMLSource(Source source) {
-            this.source = source;
-            this.isFastInfoset =
-                ((source != null)?(source.getClass() == FastInfosetReflection.fiFastInfosetSource):false);
-        }
-
-        public boolean isFastInfoset() {
-           return isFastInfoset;
-        }
-
-        /*
-         * If there is a ByteInputStream available, then write it to the output
-         * stream. Otherwise, use Transformer to write Source to output stream.
-         */
-        public void writeTo(OutputStream out, boolean useFastInfoset) {
-            try {
-                InputStream is = null;
-                boolean canAvoidTransform = false;
-                if (source instanceof StreamSource) {
-                    is = ((StreamSource)source).getInputStream();
-                    // If use of FI is requested, need to transcode
-                    canAvoidTransform = !useFastInfoset;
-                }
-                else if (source.getClass() == FastInfosetReflection.fiFastInfosetSource) {
-                    is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
-                    // If use of FI is not requested, need to transcode
-                    canAvoidTransform = useFastInfoset;
-                }
-
-                if (canAvoidTransform && is != null && is instanceof ByteInputStream) {
-                    ByteInputStream bis = (ByteInputStream)is;
-                    // Reset the stream
-                    byte[] buf = bis.getBytes();
-                    out.write(buf);
-                    bis.close();
-                    return;
-                }
-
-                // TODO: Use an efficient transformer from SAAJ that knows how to optimally
-                // write to FI results
-                Transformer transformer = XmlUtil.newTransformer();
-                transformer.transform(source,
-                    useFastInfoset ? FastInfosetReflection.FastInfosetResult_new(out)
-                                   : new StreamResult(out));
-            }
-            catch (Exception e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public Source getSource() {
-            return source;
-        }
-
-        DataSource getDataSource() {
-            return new DataSource() {
-                public InputStream getInputStream() {
-                    try {
-                        InputStream is = null;
-                        if (source instanceof StreamSource) {
-                            is = ((StreamSource)source).getInputStream();
-                        } else if (source.getClass() == FastInfosetReflection.fiFastInfosetSource) {
-                            is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
-                        }
-                        if (is != null) {
-                            return is;
-                        }
-                        // Copy source to result respecting desired encoding
-                        ByteArrayBuffer bab = new ByteArrayBuffer();
-                        Transformer transformer = XmlUtil.newTransformer();
-                        transformer.transform(source, isFastInfoset() ?
-                            FastInfosetReflection.FastInfosetResult_new(bab)
-                            : new StreamResult(bab));
-                        bab.close();
-                        return bab.newInputStream();
-                    } catch(Exception e) {
-                        throw new WebServiceException(e);
-                    }
-                }
-
-                public OutputStream getOutputStream() {
-                    return null;
-                }
-
-                public String getContentType() {
-                    return isFastInfoset() ? "application/fastinfoset" : "text/xml";
-                }
-
-                public String getName() {
-                    return "";
-                }
-            };
-
-        }
-
-        /*
-        * Usually called from logical handler
-        * If there is a DOMSource, return that. Otherwise, return a copy of
-        * the existing source.
-        */
-        public Source getPayload() {
-            try {
-
-                if (source instanceof DOMSource) {
-                    return source;
-                }
-
-                InputStream is = null;
-
-                if (source instanceof StreamSource) {
-                    is = ((StreamSource)source).getInputStream();
-                }
-                else if (source.getClass() == FastInfosetReflection.fiFastInfosetSource) {
-                    is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
-                }
-
-                if (is != null && is instanceof ByteInputStream) {
-                    ByteInputStream bis = (ByteInputStream)is;
-                                  // Reset the stream
-                    byte[] buf = bis.getBytes();
-
-                    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
-                     bis.close();
-                    return isFastInfoset ?
-                        FastInfosetReflection.FastInfosetSource_new(is)
-                    : new StreamSource(bais);
-
-                }
-
-                // Copy source to result respecting desired encoding
-                ByteArrayBuffer bab = new ByteArrayBuffer();
-                Transformer transformer = XmlUtil.newTransformer();
-                // Adding this to work with empty source. Is it JAXP bug ?
-                Properties oprops = new Properties();
-                oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
-                transformer.setOutputProperties(oprops);
-                transformer.transform(source, isFastInfoset ?
-                    FastInfosetReflection.FastInfosetResult_new(bab)
-                    : new StreamResult(bab));
-                bab.close();
-
-                // Set internal source
-                InputStream bis = (bab.size() == 0) ? null : bab.newInputStream();
-                source = isFastInfoset ?
-                    FastInfosetReflection.FastInfosetSource_new(bis)
-                    : new StreamSource(bis);
-
-                // Return fresh source back to handler
-                bis = bab.newInputStream();
-                return isFastInfoset ?
-                    FastInfosetReflection.FastInfosetSource_new(bis)
-                    : new StreamSource(bis);
-            }
-            catch (Exception e) {
-                throw new WebServiceException(e);
-            }
-        }
-
-        public Map<String, DataHandler> getAttachments() {
-            return null;
-        }
-
-        MimeHeaders getMimeHeaders() {
-            return headers;
-        }
-
-    }
-
-    /**
-     * Data represented as a JAXB object.
-     */
-    public static class XMLJaxb extends DataRepresentation {
-        private final Object object;
-        private final JAXBContext jaxbContext;
-        private final MimeHeaders headers = new MimeHeaders();
-
-        public XMLJaxb(Object object, JAXBContext jaxbContext) {
-            this.object = object;
-            this.jaxbContext = jaxbContext;
-        }
-
-        public void writeTo(OutputStream out, boolean useFastInfoset) {
-            if (useFastInfoset) {
-                JAXBTypeSerializer.serializeDocument(object,
-                    XMLStreamWriterFactory.createFIStreamWriter(out),
-                    jaxbContext);
-            }
-            else {
-                JAXBTypeSerializer.serialize(object, out, jaxbContext);
-            }
-        }
-
-        boolean isFastInfoset() {
+        @Override
+        public boolean isOneWay(@NotNull WSDLPort port) {
             return false;
         }
 
-        public Source getSource() {
-            return JAXBTypeSerializer.serialize(object, jaxbContext);
+        public boolean isFault() {
+            return false;
         }
 
-        DataSource getDataSource() {
-            return new DataSource() {
-                public InputStream getInputStream() {
-                    ByteOutputStream bos = new ByteOutputStream();
-                    JAXBTypeSerializer.serialize(object, bos, jaxbContext);
-                    return bos.newInputStream();
-                }
-
-                public OutputStream getOutputStream() {
-                    return null;
-                }
-
-                public String getContentType() {
-                    return isFastInfoset() ? "application/fastinfoset" : "text/xml";
-                }
-
-                public String getName() {
-                    return "";
-                }
-            };
+        public boolean hasHeaders() {
+            return false;
         }
 
-        /*
-        * Usually called from logical handler
-        * If there is a DOMSource, return that. Otherwise, return a copy of
-        * the existing source.
-        */
-        public Source getPayload() {
-            return getSource();
+        public HeaderList getHeaders() {
+            return new HeaderList();
         }
 
-        public Map<String, DataHandler> getAttachments() {
-            return null;
+        @Override
+        public AttachmentSet getAttachments() {
+            convertDataSourceToMessage();
+            return new XMLAttachmentSet(mpp);
         }
 
-        MimeHeaders getMimeHeaders() {
-            return headers;
+        public String getPayloadLocalPart() {
+            throw new UnsupportedOperationException();
         }
 
+        public String getPayloadNamespaceURI() {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasPayload() {
+            return true;
+        }
+
+        public Source readPayloadAsSource() {
+            convertDataSourceToMessage();
+            return mpp.getRootPart().asSource();
+        }
+
+        public XMLStreamReader readPayload() throws XMLStreamException {
+            convertDataSourceToMessage();
+            return XMLStreamReaderFactory.create( null,
+                    mpp.getRootPart().asInputStream(), true);
+        }
+
+        public void writePayloadTo(XMLStreamWriter sw) {
+            XMLStreamReaderToXMLStreamWriter c = new XMLStreamReaderToXMLStreamWriter();
+            try {
+                XMLStreamReader r = readPayload();
+                c.bridge(r, sw);
+                XMLStreamReaderFactory.recycle(r);
+            } catch(Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        protected void writePayloadTo(ContentHandler contentHandler,
+                ErrorHandler errorHandler, boolean fragment){
+            throw new UnsupportedOperationException();
+        }
+
+        public Message copy() {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasUnconsumedDataSource() {
+            return mpp == null;
+        }
+
+    }
+
+    private static final class XMLAttachmentSet implements AttachmentSet {
+
+        private final Map<String, Attachment> attMap;
+
+        public XMLAttachmentSet(MimeMultipartParser mpp) {
+            // TODO
+            attMap = new HashMap<String, Attachment>();
+            attMap.putAll(mpp.getAttachmentParts());
+        }
+
+        /**
+         * Gets the attachment by the content ID.
+         *
+         * @return null
+         *         if no such attachment exist.
+         */
+        public Attachment get(String contentId) {
+            return attMap.get(contentId);
+        }
+
+        public boolean isEmpty() {
+            return attMap.isEmpty();
+        }
+
+        /**
+         * Returns an iterator over a set of elements of type T.
+         *
+         * @return an Iterator.
+         */
+        public Iterator<Attachment> iterator() {
+            return attMap.values().iterator();
+        }
+
+        public void add(Attachment att) {
+            attMap.put(att.getContentId(), att);
+        }
+
+    }
+
+    private static class FaultMessage extends EmptyMessageImpl {
+
+        public FaultMessage(SOAPVersion version) {
+            super(version);
+        }
+
+        @Override
+        public boolean isFault() {
+            return true;
+        }
     }
 
 
@@ -906,199 +421,132 @@
      *
      * This could be used to represent image/jpeg etc
      */
-    public static class UnknownContent extends DataRepresentation {
-        private final String ct;
-        private final InputStream in;
-        private final MimeMultipart multipart;
-        private final MimeHeaders headers = new MimeHeaders();
+    public static class UnknownContent extends AbstractMessageImpl implements MessageDataSource {
+        private final DataSource ds;
+        private final HeaderList headerList;
 
-        public UnknownContent(String ct, InputStream in) {
-            this.ct = ct;
-            this.in = in;
-            this.multipart = null;
+        public UnknownContent(final String ct, final InputStream in) {
+            this(createDataSource(ct,in));
         }
 
-        public UnknownContent(Map<String, DataHandler> atts) {
-            this.in = null;
-            multipart = new MimeMultipart("mixed");
-            for(Map.Entry<String, DataHandler> e : atts.entrySet()) {
-                MimeBodyPart part = new MimeBodyPart();
-                part.setDataHandler(e.getValue());
-                multipart.addBodyPart(part);
-            }
-            this.ct = multipart.getContentType().toString();
+        public UnknownContent(DataSource ds) {
+            super(SOAPVersion.SOAP_11);
+            this.ds = ds;
+            this.headerList = new HeaderList();
         }
 
-        public void writeTo(OutputStream out, boolean useFastInfoset) {
-            try {
-                if (multipart != null) {
-                    multipart.writeTo(out);
-                }
-                byte[] buf = new byte[1024];
-                int len;
-                while ((len = in.read(buf)) != -1) {
-                    out.write(buf, 0, len);
-                }
-            } catch (Exception ex) {
-                throw new WebServiceException(ex);
-            }
+        /**
+         * Copy constructor.
+         */
+        private UnknownContent(UnknownContent that) {
+            super(that.soapVersion);
+            this.ds = that.ds;
+            this.headerList = HeaderList.copy(that.headerList);
         }
 
-        boolean isFastInfoset() {
+        public boolean hasUnconsumedDataSource() {
+            return true;
+        }
+
+        public DataSource getDataSource() {
+            assert ds != null;
+            return ds;
+        }
+
+        protected void writePayloadTo(ContentHandler contentHandler,
+                ErrorHandler errorHandler, boolean fragment) throws SAXException {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasHeaders() {
             return false;
         }
 
-        /**
-         * NO XML content so return null
-         */
-        public Source getSource() {
+        public boolean isFault() {
+            return false;
+        }
+
+        public HeaderList getHeaders() {
+            return headerList;
+        }
+
+        public String getPayloadLocalPart() {
+            throw new UnsupportedOperationException();
+        }
+
+        public String getPayloadNamespaceURI() {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasPayload() {
+            return false;
+        }
+
+        public Source readPayloadAsSource() {
             return null;
         }
 
-        DataSource getDataSource() {
-            return new DataSource() {
-                public InputStream getInputStream() {
-                    if (multipart != null) {
-                        try {
-                            ByteOutputStream bos = new ByteOutputStream();
-                            multipart.writeTo(bos);
-                            return bos.newInputStream();
-                        } catch(Exception ioe) {
-                            throw new WebServiceException(ioe);
-                        }
-                    }
-                    return in;
-                }
-
-                public OutputStream getOutputStream() {
-                    return null;
-                }
-
-                public String getContentType() {
-                    assert ct != null;
-                    return ct;
-                }
-
-                public String getName() {
-                    return "";
-                }
-            };
+        public XMLStreamReader readPayload() throws XMLStreamException {
+            throw new WebServiceException("There isn't XML payload. Shouldn't come here.");
         }
 
-        /**
-         * NO XML content so return null
-         */
-        public Source getPayload() {
-            return null;
+        public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+            // No XML. Nothing to do
         }
 
-        /**
-         * JAXWS doesn't know about this conent. So we treate the whole content
-         * as one payload.
-         */
-        public Map<String, DataHandler> getAttachments() {
-            return null;
-        }
-
-        MimeHeaders getMimeHeaders() {
-            headers.removeHeader("Content-Type");
-            headers.addHeader("Content-Type", ct);
-            return headers;
+        public Message copy() {
+            return new UnknownContent(this);
         }
 
     }
 
-    /**
-     * Represents HTTPException or anyother exception
-     */
-    private static final class XMLErr extends DataRepresentation {
-        private final Exception err;
-        private final MimeHeaders headers = new MimeHeaders();
+    public static DataSource getDataSource(Message msg) {
+        if (msg instanceof MessageDataSource) {
+            return ((MessageDataSource)msg).getDataSource();
+        } else {
+            AttachmentSet atts = msg.getAttachments();
+            if (atts != null && !atts.isEmpty()) {
+                final ByteOutputStream bos = new ByteOutputStream();
+                try {
+                    Codec codec = new XMLHTTPBindingCodec();
+                    com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.getStaticContentType(new Packet(msg));
+                    codec.encode(new Packet(msg), bos);
+                    return createDataSource(ct.getContentType(), bos.newInputStream());
+                } catch(IOException ioe) {
+                    throw new WebServiceException(ioe);
+                }
 
-        XMLErr(Exception err) {
-            this.err = err;
-        }
-
-        public Source getPayload() {
-            return null;
-        }
-
-        public Map<String, DataHandler> getAttachments() {
-            return null;
-        }
-
-        public void writeTo(OutputStream out, boolean useFastInfoset) throws IOException {
-            String msg = err.getMessage();
-            if (msg == null) {
-                msg = err.toString();
-            }
-            msg = "<err>"+msg+"</err>";
-
-            if (useFastInfoset) {
-                FastInfosetUtil.transcodeXMLStringToFI(msg, out);
             } else {
-                out.write(msg.getBytes());
+                final ByteOutputStream bos = new ByteOutputStream();
+                XMLStreamWriter writer = XMLStreamWriterFactory.create(bos);
+                try {
+                    msg.writePayloadTo(writer);
+                    writer.flush();
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(e);
+                }
+                return XMLMessage.createDataSource("text/xml", bos.newInputStream());
             }
         }
-
-        boolean isFastInfoset() {
-            return false;
-        }
-
-        Source getSource() {
-            return null;
-        }
-
-        DataSource getDataSource() {
-            return null;
-        }
-
-        @Override
-        int getStatus() {
-            if (err instanceof HTTPException) {
-                return ((HTTPException)err).getStatusCode();
-            }
-            return WSConnection.INTERNAL_ERR;
-        }
-
-        MimeHeaders getMimeHeaders() {
-            return headers;
-        }
     }
 
+    public static DataSource createDataSource(final String contentType, final InputStream is) {
+        return new DataSource() {
+            public InputStream getInputStream() {
+                return is;
+            }
 
-    /**
-     * There is no content to write.
-     */
-    private static final class NullContent extends DataRepresentation {
-        private final MimeHeaders headers = new MimeHeaders();
+            public OutputStream getOutputStream() {
+                return null;
+            }
 
-        public Source getPayload() {
-            return null;
-        }
+            public String getContentType() {
+                return contentType;
+            }
 
-        public Map<String, DataHandler> getAttachments() {
-            return null;
-        }
-
-        public void writeTo(OutputStream out, boolean useFastInfoset) throws IOException {
-            // Nothing to do
-        }
-
-        boolean isFastInfoset() {
-            return false;
-        }
-
-        Source getSource() {
-            return null;
-        }
-
-        DataSource getDataSource() {
-            return null;
-        }
-
-        MimeHeaders getMimeHeaders() {
-            return headers;
-        }
+            public String getName() {
+                return "";
+            }
+        };
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/CodeType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/CodeType.java
new file mode 100644
index 0000000..f419141
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/CodeType.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.namespace.QName;
+
+/**
+ * <pre>
+ *  &lt;env:Code>
+ *       &lt;env:Value>env:Sender&lt;/env:Value>
+ *       &lt;env:Subcode>
+ *           &lt;env:Value>m:MessageTimeout1&lt;/env:Value>
+ *           &lt;env:Subcode>
+ *               &lt;env:Value>m:MessageTimeout2&lt;/env:Value>
+ *           &lt;/env:Subcode>
+ *       &lt;/env:Subcode>
+ *  &lt;/env:Code>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CodeType", namespace = "http://www.w3.org/2003/05/soap-envelope", propOrder = {
+    "Value",
+    "Subcode"
+})
+class CodeType {
+    @XmlTransient
+    private static final String ns="http://www.w3.org/2003/05/soap-envelope";
+
+    /**
+     * mandatory, minOccurs=1
+     */
+    @XmlElement(namespace = ns)
+    private QName Value;
+
+    /**
+     * optional, minOcccurs=0, maxOccurs="1"
+     */
+    @XmlElement(namespace = ns)
+    private SubcodeType Subcode;
+
+    CodeType(QName value) {
+        Value = value;
+    }
+
+    CodeType() {
+    }
+
+    QName getValue(){
+        return Value;
+    }
+
+    SubcodeType getSubcode(){
+        return Subcode;
+    }
+
+    void setSubcode(SubcodeType subcode) {
+        Subcode = subcode;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/DetailType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/DetailType.java
new file mode 100644
index 0000000..26b8ddf
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/DetailType.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * &lt;env:Detail>
+ *     &lt;m:MaxTime>P5M</m:MaxTime>
+ * &lt;/env:Detail>
+ */
+class DetailType {
+    /**
+     * The detail entry could be 0 or more elements. Perhaps some elements may be
+     * known to JAXB while others can be handled using DOMHandler.
+     *
+     * Even though the jaxbContext is aware of the detail jaxbBean but we get the list of
+     * {@link org.w3c.dom.Node}s.
+     *
+     * this is because since we unmarshall using {@link com.sun.xml.internal.bind.api.Bridge} all we're
+     * going to get during unmarshalling is {@link org.w3c.dom.Node} and not the jaxb bean instances.
+     *
+     * TODO: For now detailEntry would be List of Node isntead of Object and it needs to be changed to
+     * {@link Object} once we have better solution that working thru {@link com.sun.xml.internal.bind.api.Bridge}
+     */
+    @XmlAnyElement
+    private final List<Element> detailEntry = new ArrayList<Element>();
+
+    @NotNull
+    List<Element> getDetails() {
+        return detailEntry;
+    }
+
+    /**
+     * Gets the n-th detail object, or null if no such item exists.
+     */
+    @Nullable
+    Node getDetail(int n) {
+        if(n < detailEntry.size())
+            return detailEntry.get(n);
+        else
+            return null;
+    }
+
+    DetailType(Element detailObject) {
+        if(detailObject != null)
+            detailEntry.add(detailObject);
+    }
+
+    DetailType() {
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ExceptionBean.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ExceptionBean.java
new file mode 100644
index 0000000..fcdb83f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ExceptionBean.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;
+import com.sun.xml.internal.ws.developer.ServerSideException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * JAXB-bound bean that captures the exception and its call stack.
+ *
+ * <p>
+ * This is used to capture the stack trace of the server side error and
+ * send that over to the client.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+@XmlRootElement(namespace=ExceptionBean.NS,name=ExceptionBean.LOCAL_NAME)
+final class ExceptionBean {
+    /**
+     * Converts the given {@link Throwable} into an XML representation
+     * and put that as a DOM tree under the given node.
+     */
+    public static void marshal( Throwable t, Node parent ) throws JAXBException {
+        Marshaller m = JAXB_CONTEXT.createMarshaller();
+        m.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper",nsp);
+        m.marshal(new ExceptionBean(t), parent );
+    }
+
+    /**
+     * Does the reverse operation of {@link #marshal(Throwable, Node)}. Constructs an
+     * {@link Exception} object from the XML.
+     */
+    public static ServerSideException unmarshal( Node xml ) throws JAXBException {
+        ExceptionBean e = (ExceptionBean) JAXB_CONTEXT.createUnmarshaller().unmarshal(xml);
+        return e.toException();
+    }
+
+    @XmlAttribute(name="class")
+    public String className;
+    @XmlElement
+    public String message;
+    @XmlElementWrapper(namespace=NS,name="stackTrace")
+    @XmlElement(namespace=NS,name="frame")
+    public List<StackFrame> stackTrace = new ArrayList<StackFrame>();
+    @XmlElement(namespace=NS,name="cause")
+    public ExceptionBean cause;
+
+    // so that people noticed this fragment can turn it off
+    @XmlAttribute
+    public String note = "To disable this feature, set "+SOAPFaultBuilder.CAPTURE_STACK_TRACE_PROPERTY+" system property to false";
+
+    ExceptionBean() {// for JAXB
+    }
+
+    /**
+     * Creates an {@link ExceptionBean} tree that represents the given {@link Throwable}.
+     */
+    private ExceptionBean(Throwable t) {
+        this.className = t.getClass().getName();
+        this.message = t.getMessage();
+
+        for (StackTraceElement f : t.getStackTrace()) {
+            stackTrace.add(new StackFrame(f));
+        }
+
+        Throwable cause = t.getCause();
+        if(t!=cause && cause!=null)
+            this.cause = new ExceptionBean(cause);
+    }
+
+    private ServerSideException toException() {
+        ServerSideException e = new ServerSideException(className,message);
+        if(stackTrace!=null) {
+            StackTraceElement[] ste = new StackTraceElement[stackTrace.size()];
+            for( int i=0; i<stackTrace.size(); i++ )
+                ste[i] = stackTrace.get(i).toStackTraceElement();
+            e.setStackTrace(ste);
+        }
+        if(cause!=null)
+            e.initCause(cause.toException());
+        return e;
+    }
+
+    /**
+     * Captures one stack frame.
+     */
+    static final class StackFrame {
+        @XmlAttribute(name="class")
+        public String declaringClass;
+        @XmlAttribute(name="method")
+        public String methodName;
+        @XmlAttribute(name="file")
+        public String fileName;
+        @XmlAttribute(name="line")
+        public String lineNumber;
+
+        StackFrame() {// for JAXB
+        }
+
+        public StackFrame(StackTraceElement ste) {
+            this.declaringClass = ste.getClassName();
+            this.methodName = ste.getMethodName();
+            this.fileName = ste.getFileName();
+            this.lineNumber = box(ste.getLineNumber());
+        }
+
+        private String box(int i) {
+            if(i>=0) return String.valueOf(i);
+            if(i==-2)   return "native";
+            return "unknown";
+        }
+
+        private int unbox(String v) {
+            try {
+                return Integer.parseInt(v);
+            } catch (NumberFormatException e) {
+                if(v.equals("native"))  return -2;
+                return -1;
+            }
+        }
+
+        private StackTraceElement toStackTraceElement() {
+            return new StackTraceElement(declaringClass,methodName,fileName,unbox(lineNumber));
+        }
+    }
+
+    /**
+     * Checks if the given element is the XML representation of {@link ExceptionBean}.
+     */
+    public static boolean isStackTraceXml(Element n) {
+        return n.getLocalName().equals(LOCAL_NAME) && n.getNamespaceURI().equals(NS);
+    }
+
+    private static final JAXBContext JAXB_CONTEXT;
+
+    /**
+     * Namespace URI.
+     */
+    /*package*/ static final String NS = "http://jax-ws.dev.java.net/";
+
+    /*package*/ static final String LOCAL_NAME = "exception";
+
+    static {
+        try {
+            JAXB_CONTEXT = JAXBContext.newInstance(ExceptionBean.class);
+        } catch (JAXBException e) {
+            // this must be a bug in our code
+            throw new Error(e);
+        }
+    }
+
+    private static final NamespacePrefixMapper nsp = new NamespacePrefixMapper() {
+        public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
+            if(namespaceUri.equals(NS)) return "";
+            return suggestion;
+        }
+    };
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ReasonType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ReasonType.java
new file mode 100644
index 0000000..a89e937
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/ReasonType.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <pre>
+ * &lt;env:Reason>
+ *     &lt;env:Text xml:lang="en">Sender Timeout</env:Text>
+ * &lt;/env:Reason>
+ * </pre>
+ */
+class ReasonType {
+    ReasonType() {
+    }
+
+    ReasonType(String txt) {
+        text.add(new TextType(txt));
+    }
+
+
+
+    /**
+     * minOccurs=1 maxOccurs=unbounded
+     */
+    @XmlElements(@XmlElement(name = "Text", namespace = "http://www.w3.org/2003/05/soap-envelope", type = TextType.class))
+    private final List<TextType> text = new ArrayList<TextType>();
+
+    List<TextType> texts() {
+        return text;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java
new file mode 100644
index 0000000..7536c37
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+
+/**
+ * This class represents SOAP1.1 Fault. This class will be used to marshall/unmarshall a soap fault using JAXB.
+ * <p/>
+ * <pre>
+ * Example:
+ * <p/>
+ *     &lt;soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
+ *         &lt;faultcode>soap:Client&lt;/faultcode>
+ *         &lt;faultstring>Invalid message format&lt;/faultstring>
+ *         &lt;faultactor>http://example.org/someactor&lt;/faultactor>
+ *         &lt;detail>
+ *             &lt;m:msg xmlns:m='http://example.org/faults/exceptions'>
+ *                 Test message
+ *             &lt;/m:msg>
+ *         &lt;/detail>
+ *     &lt;/soap:Fault>
+ * <p/>
+ * Above, m:msg, if a known fault (described in the WSDL), IOW, if m:msg is known by JAXBContext it should be unmarshalled into a
+ * Java object otherwise it should be deserialized as {@link javax.xml.soap.Detail}
+ * </pre>
+ * <p/>
+ *
+ * @author Vivek Pandey
+ */
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+        "faultcode",
+        "faultstring",
+        "faultactor",
+        "detail"
+        })
+@XmlRootElement(name = "Fault", namespace = "http://schemas.xmlsoap.org/soap/envelope/")
+class SOAP11Fault extends SOAPFaultBuilder {
+    @XmlElement(namespace = "")
+    private QName faultcode;
+
+    @XmlElement(namespace = "")
+    private String faultstring;
+
+    @XmlElement(namespace = "")
+    private String faultactor;
+
+    @XmlElement(namespace = "")
+    private DetailType detail;
+
+    SOAP11Fault() {
+    }
+
+    /**
+     * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
+     * or a java object that can be marshalled/unmarshalled by JAXB.
+     *
+     * @param code
+     * @param reason
+     * @param actor
+     * @param detailObject
+     */
+    SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
+        this.faultcode = code;
+        this.faultstring = reason;
+        this.faultactor = actor;
+        if (detailObject != null) {
+            if(detailObject.getNamespaceURI().equals("") && detailObject.getLocalName().equals("detail")){
+                detail = new DetailType();
+                for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
+                    detail.getDetails().add(detailEntry);
+                }
+            }else{
+                detail = new DetailType(detailObject);
+            }
+        }
+    }
+
+    SOAP11Fault(SOAPFault fault) {
+        this.faultcode = fault.getFaultCodeAsQName();
+        this.faultstring = fault.getFaultString();
+        this.faultactor = fault.getFaultActor();
+        if (fault.getDetail() != null) {
+            detail = new DetailType(fault.getDetail());
+        }
+    }
+
+    QName getFaultcode() {
+        return faultcode;
+    }
+
+    void setFaultcode(QName faultcode) {
+        this.faultcode = faultcode;
+    }
+
+    @Override
+    String getFaultString() {
+        return faultstring;
+    }
+
+    void setFaultstring(String faultstring) {
+        this.faultstring = faultstring;
+    }
+
+    String getFaultactor() {
+        return faultactor;
+    }
+
+    void setFaultactor(String faultactor) {
+        this.faultactor = faultactor;
+    }
+
+    /**
+     * returns the object that represents detail.
+     */
+    @Override
+    DetailType getDetail() {
+        return detail;
+    }
+
+    void setDetail(DetailType detail) {
+        this.detail = detail;
+    }
+
+    protected Throwable getProtocolException() {
+        try {
+            SOAPFault fault = SOAPVersion.SOAP_11.saajSoapFactory.createFault(faultstring, faultcode);
+            if(detail != null && detail.getDetail(0) != null) {
+                Node n = fault.getOwnerDocument().importNode(detail.getDetail(0), true);
+                Detail d = fault.addDetail();
+                d.appendChild(n);
+            }
+            fault.setFaultActor(faultactor);
+            return new SOAPFaultException(fault);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java
new file mode 100644
index 0000000..1b4c697
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.util.Iterator;
+
+/**
+ * SOAP 1.2 Fault class that can be marshalled/unmarshalled by JAXB
+ * <p/>
+ * <pre>
+ * Example:
+ * &lt;env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ *            xmlns:m="http://www.example.org/timeouts"
+ *            xmlns:xml="http://www.w3.org/XML/1998/namespace">
+ * &lt;env:Body>
+ *     &lt;env:Fault>
+ *         &lt;env:Code>
+ *             &lt;env:Value>env:Sender* &lt;/env:Value>
+ *             &lt;env:Subcode>
+ *                 &lt;env:Value>m:MessageTimeout* &lt;/env:Value>
+ *             &lt;/env:Subcode>
+ *         &lt;/env:Code>
+ *         &lt;env:Reason>
+ *             &lt;env:Text xml:lang="en">Sender Timeout* &lt;/env:Text>
+ *         &lt;/env:Reason>
+ *         &lt;env:Detail>
+ *             &lt;m:MaxTime>P5M* &lt;/m:MaxTime>
+ *         &lt;/env:Detail>
+ *     &lt;/env:Fault>
+ * &lt;/env:Body>
+ * &lt;/env:Envelope>
+ * </pre>
+ *
+ * @author Vivek Pandey
+ */
+@XmlRootElement(name = "Fault", namespace = "http://www.w3.org/2003/05/soap-envelope")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "code",
+    "reason",
+    "node",
+    "role",
+    "detail"
+})
+class SOAP12Fault extends SOAPFaultBuilder {
+    @XmlTransient
+    private static final String ns = "http://www.w3.org/2003/05/soap-envelope";
+
+    @XmlElement(namespace=ns, name="Code")
+    private CodeType code;
+
+    @XmlElement(namespace=ns, name="Reason")
+    private ReasonType reason;
+
+    @XmlElement(namespace=ns, name="Node")
+    private String node;
+
+    @XmlElement(namespace=ns, name="Role")
+    private String role;
+
+    @XmlElement(namespace=ns, name="Detail")
+    private DetailType detail;
+
+    SOAP12Fault() {
+    }
+
+    SOAP12Fault(CodeType code, ReasonType reason, String node, String role, DetailType detail) {
+        this.code = code;
+        this.reason = reason;
+        this.node = node;
+        this.role = role;
+        this.detail = detail;
+    }
+
+    SOAP12Fault(SOAPFault fault) {
+        code = new CodeType(fault.getFaultCodeAsQName());
+        try {
+            fillFaultSubCodes(fault);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+
+        reason = new ReasonType(fault.getFaultString());
+        role = fault.getFaultRole();
+        detail = new DetailType(fault.getDetail());
+    }
+
+    SOAP12Fault(QName code, String reason, Element detailObject) {
+        this.code = new CodeType(code);
+        this.reason = new ReasonType(reason);
+        if(detailObject != null)
+            detail = new DetailType(detailObject);
+    }
+
+    CodeType getCode() {
+        return code;
+    }
+
+    ReasonType getReason() {
+        return reason;
+    }
+
+    String getNode() {
+        return node;
+    }
+
+    String getRole() {
+        return role;
+    }
+
+    @Override
+    DetailType getDetail() {
+        return detail;
+    }
+
+    @Override
+    void setDetail(DetailType detail) {
+        this.detail = detail;
+    }
+
+    @Override
+    String getFaultString() {
+        return reason.texts().get(0).getText();
+    }
+
+     protected Throwable getProtocolException() {
+        try {
+            SOAPFault fault = SOAPVersion.SOAP_12.saajSoapFactory.createFault(reason.texts().get(0).getText(), (code != null)? code.getValue():null);
+            if(detail != null && detail.getDetail(0) != null){
+                javax.xml.soap.Detail detail = fault.addDetail();
+                for(Node obj: this.detail.getDetails()){
+                    Node n = fault.getOwnerDocument().importNode(obj, true);
+                    detail.appendChild(n);
+                }
+            }
+            if(code != null)
+                fillFaultSubCodes(fault, code.getSubcode());
+
+            return new SOAPFaultException(fault);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * Recursively populate the Subcodes
+     */
+    private void fillFaultSubCodes(SOAPFault fault, SubcodeType subcode) throws SOAPException {
+        if(subcode != null){
+            fault.appendFaultSubcode(subcode.getValue());
+            fillFaultSubCodes(fault, subcode.getSubcode());
+        }
+    }
+
+    /**
+     * Adds Fault subcodes from {@link SOAPFault} to {@link #code}
+     */
+    private void fillFaultSubCodes(SOAPFault fault) throws SOAPException {
+        Iterator subcodes = fault.getFaultSubcodes();
+        SubcodeType firstSct = null;
+        while(subcodes.hasNext()){
+            QName subcode = (QName)subcodes.next();
+            if(firstSct == null){
+                firstSct = new SubcodeType(subcode);
+                code.setSubcode(firstSct);
+                continue;
+            }
+            SubcodeType nextSct = new SubcodeType(subcode);
+            firstSct.setSubcode(nextSct);
+            firstSct = nextSct;
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java
new file mode 100644
index 0000000..8cff652
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java
@@ -0,0 +1,496 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.model.CheckedException;
+import com.sun.xml.internal.ws.api.model.ExceptionType;
+import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
+import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
+import com.sun.xml.internal.ws.encoding.soap.SerializationException;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import com.sun.xml.internal.ws.util.StringUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Base class that represents SOAP 1.1 or SOAP 1.2 fault. This class can be used by the invocation handlers to create
+ * an Exception from a received messge.
+ *
+ * @author Vivek Pandey
+ */
+public abstract class SOAPFaultBuilder {
+
+    /**
+     * Gives the {@link DetailType} for a Soap 1.1 or Soap 1.2 message that can be used to create either a checked exception or
+     * a protocol specific exception
+     */
+    abstract DetailType getDetail();
+
+    abstract void setDetail(DetailType detailType);
+
+    /**
+     * gives the fault string that can be used to create an {@link Exception}
+     */
+    abstract String getFaultString();
+
+    /**
+     * This should be called from the client side to throw an {@link Exception} for a given soap mesage
+     */
+    public Throwable createException(Map<QName, CheckedExceptionImpl> exceptions) throws JAXBException {
+        DetailType dt = getDetail();
+        Node detail = null;
+        if(dt != null)  detail = dt.getDetail(0);
+
+        //return ProtocolException if the detail is not present or there is no checked exception
+        if(detail == null || exceptions == null){
+            // No soap detail, doesnt look like its a checked exception
+            // throw a protocol exception
+            return attachServerException(getProtocolException());
+        }
+
+        //check if the detail is a checked exception, if not throw a ProtocolException
+        QName detailName = new QName(detail.getNamespaceURI(), detail.getLocalName());
+        CheckedExceptionImpl ce = exceptions.get(detailName);
+        if (ce == null) {
+            //No Checked exception for the received detail QName, throw a SOAPFault exception
+            return attachServerException(getProtocolException());
+
+        }
+
+        if (ce.getExceptionType().equals(ExceptionType.UserDefined)) {
+            return attachServerException(createUserDefinedException(ce));
+
+        }
+        Class exceptionClass = ce.getExceptionClass();
+        try {
+            Constructor constructor = exceptionClass.getConstructor(String.class, (Class) ce.getDetailType().type);
+            Exception exception = (Exception) constructor.newInstance(getFaultString(), getJAXBObject(detail, ce));
+            return attachServerException(exception);
+        } catch (Exception e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * To be called to convert a  {@link ProtocolException} and faultcode for a given {@link SOAPVersion} in to a {@link Message}.
+     *
+     * @param soapVersion {@link SOAPVersion#SOAP_11} or {@link SOAPVersion#SOAP_12}
+     * @param ex a ProtocolException
+     * @param faultcode soap faultcode. Its ignored if the {@link ProtocolException} instance is {@link SOAPFaultException} and it has a
+     * faultcode present in the underlying {@link SOAPFault}.
+     * @return {@link Message} representing SOAP fault
+     */
+    public static @NotNull Message createSOAPFaultMessage(@NotNull SOAPVersion soapVersion, @NotNull ProtocolException ex, @Nullable QName faultcode){
+        Object detail = getFaultDetail(null, ex);
+        if(soapVersion == SOAPVersion.SOAP_12)
+            return createSOAP12Fault(soapVersion, ex, detail, null, faultcode);
+        return createSOAP11Fault(soapVersion, ex, detail, null, faultcode);
+    }
+
+    /**
+     * To be called by the server runtime in the situations when there is an Exception that needs to be transformed in
+     * to a soapenv:Fault payload.
+     *
+     * @param ceModel     {@link CheckedExceptionImpl} model that provides useful informations such as the detail tagname
+     *                    and the Exception associated with it. Caller of this constructor should get the CheckedException
+     *                    model by calling {@link JavaMethodImpl#getCheckedException(Class)}, where
+     *                    Class is t.getClass().
+     *                    <p>
+     *                    If its null then this is not a checked exception  and in that case the soap fault will be
+     *                    serialized only from the exception as described below.
+     * @param ex          Exception that needs to be translated into soapenv:Fault, always non-null.
+     *                    <ul>
+     *                    <li>If t is instance of {@link SOAPFaultException} then its serilaized as protocol exception.
+     *                    <li>If t.getCause() is instance of {@link SOAPFaultException} and t is a checked exception then
+     *                    the soap fault detail is serilaized from t and the fault actor/string/role is taken from t.getCause().
+     *                    </ul>
+     * @param soapVersion non-null
+     */
+    public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex) {
+        Object detail = getFaultDetail(ceModel, ex);
+        if(soapVersion == SOAPVersion.SOAP_12)
+            return createSOAP12Fault(soapVersion, ex, detail, ceModel, null);
+        return createSOAP11Fault(soapVersion, ex, detail, ceModel, null);
+    }
+
+    /**
+     * Server runtime will call this when there is some internal error not resulting from an exception.
+     *
+     * @param soapVersion {@link SOAPVersion#SOAP_11} or {@link SOAPVersion#SOAP_12}
+     * @param faultString must be non-null
+     * @param faultCode   For SOAP 1.1, it must be one of
+     *                    <ul>
+     *                    <li>{@link SOAPVersion#faultCodeClient}
+     *                    <li>{@link SOAPVersion#faultCodeServer}
+     *                    <li>{@link SOAPConstants#FAULT_CODE_MUST_UNDERSTAND}
+     *                    <li>{@link SOAPConstants#FAULT_CODE_VERSION_MISMATCH}
+     *                    </ul>
+     *
+     *                    For SOAP 1.2
+     *                    <ul>
+     *                    <li>{@link SOAPVersion#faultCodeClient}
+     *                    <li>{@link SOAPVersion#faultCodeServer}
+     *                    <li>{@link SOAP12Constants#FAULT_CODE_MUST_UNDERSTAND}
+     *                    <li>{@link SOAP12Constants#FAULT_CODE_VERSION_MISMATCH}
+     *                    <li>{@link SOAP12Constants#FAULT_CODE_DATA_ENCODING_UNKNOWN}
+     *                    </ul>
+     * @return non-null {@link Message}
+     */
+    public static Message createSOAPFaultMessage(SOAPVersion soapVersion, String faultString, QName faultCode) {
+        if (faultCode == null)
+            faultCode = getDefaultFaultCode(soapVersion);
+        return createSOAPFaultMessage(soapVersion, faultString, faultCode, null);
+    }
+
+    public static Message createSOAPFaultMessage(SOAPVersion soapVersion, SOAPFault fault) {
+        switch (soapVersion) {
+            case SOAP_11:
+                return JAXBMessage.create(JAXB_CONTEXT, new SOAP11Fault(fault), soapVersion);
+            case SOAP_12:
+                return JAXBMessage.create(JAXB_CONTEXT, new SOAP12Fault(fault), soapVersion);
+            default:
+                throw new AssertionError();
+        }
+    }
+
+    private static Message createSOAPFaultMessage(SOAPVersion soapVersion, String faultString, QName faultCode, Element detail) {
+        switch (soapVersion) {
+            case SOAP_11:
+                return JAXBMessage.create(JAXB_CONTEXT, new SOAP11Fault(faultCode, faultString, null, detail), soapVersion);
+            case SOAP_12:
+                return JAXBMessage.create(JAXB_CONTEXT, new SOAP12Fault(faultCode, faultString, detail), soapVersion);
+            default:
+                throw new AssertionError();
+        }
+    }
+
+    /**
+     * Creates a DOM node that represents the complete stack trace of the exception,
+     * and attach that to {@link DetailType}.
+     */
+    final void captureStackTrace(@Nullable Throwable t) {
+        if(t==null)     return;
+        if(!captureStackTrace)  return;     // feature disabled
+
+        try {
+            Document d = DOMUtil.createDom();
+            ExceptionBean.marshal(t,d);
+
+            DetailType detail = getDetail();
+            if(detail==null)
+            setDetail(detail=new DetailType());
+
+            detail.getDetails().add(d.getDocumentElement());
+        } catch (JAXBException e) {
+            // this should never happen
+            logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e);
+        }
+    }
+
+    /**
+     * Initialize the cause of this exception by attaching the server side exception.
+     */
+    private <T extends Throwable> T attachServerException(T t) {
+        DetailType detail = getDetail();
+        if(detail==null)        return t;   // no details
+
+        for (Element n : detail.getDetails()) {
+            if(ExceptionBean.isStackTraceXml(n)) {
+                try {
+                    t.initCause(ExceptionBean.unmarshal(n));
+                } catch (JAXBException e) {
+                    // perhaps incorrectly formatted XML.
+                    logger.log(Level.WARNING, "Unable to read the capture stack trace in the fault",e);
+                }
+                return t;
+            }
+        }
+
+        return t;
+    }
+
+    abstract protected Throwable getProtocolException();
+
+    private Object getJAXBObject(Node jaxbBean, CheckedException ce) throws JAXBException {
+        Bridge bridge = ce.getBridge();
+        return bridge.unmarshal(jaxbBean);
+    }
+
+    private Exception createUserDefinedException(CheckedExceptionImpl ce) {
+        Class exceptionClass = ce.getExceptionClass();
+        try {
+            Constructor constructor = exceptionClass.getConstructor(String.class);
+            Object exception = constructor.newInstance(getFaultString());
+            Node detail = getDetail().getDetails().get(0);
+            Object jaxbDetail = getJAXBObject(detail, ce);
+            Field[] fields = jaxbDetail.getClass().getFields();
+            for (Field f : fields) {
+                Method m = exceptionClass.getMethod(getWriteMethod(f));
+                m.invoke(exception, f.get(jaxbDetail));
+            }
+            throw (Exception) exception;
+        } catch (Exception e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    private static String getWriteMethod(Field f) {
+        return "set" + StringUtils.capitalize(f.getName());
+    }
+
+    private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) {
+        if (ce == null)
+            return null;
+        if (ce.getExceptionType().equals(ExceptionType.UserDefined)) {
+            return createDetailFromUserDefinedException(ce, exception);
+        }
+        try {
+            Method m = exception.getClass().getMethod("getFaultInfo");
+            return m.invoke(exception);
+        } catch (Exception e) {
+            throw new SerializationException(e);
+        }
+    }
+
+    private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) {
+        Class detailBean = ce.getDetailBean();
+        Field[] fields = detailBean.getDeclaredFields();
+        try {
+            Object detail = detailBean.newInstance();
+            for (Field f : fields) {
+                Method em = exception.getClass().getMethod(getReadMethod(f));
+                Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType());
+                sm.invoke(detail, em.invoke(exception));
+            }
+            return detail;
+        } catch (Exception e) {
+            throw new SerializationException(e);
+        }
+    }
+
+    private static String getReadMethod(Field f) {
+        if (f.getType().isAssignableFrom(boolean.class))
+            return "is" + StringUtils.capitalize(f.getName());
+        return "get" + StringUtils.capitalize(f.getName());
+    }
+
+    private static Message createSOAP11Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
+        SOAPFaultException soapFaultException = null;
+        String faultString = null;
+        String faultActor = null;
+        Throwable cause = e.getCause();
+        if (e instanceof SOAPFaultException) {
+            soapFaultException = (SOAPFaultException) e;
+        } else if (cause != null && cause instanceof SOAPFaultException) {
+            soapFaultException = (SOAPFaultException) e.getCause();
+        }
+        if (soapFaultException != null) {
+            QName soapFaultCode = soapFaultException.getFault().getFaultCodeAsQName();
+            if(soapFaultCode != null)
+                faultCode = soapFaultCode;
+
+            faultString = soapFaultException.getFault().getFaultString();
+            faultActor = soapFaultException.getFault().getFaultActor();
+        }
+
+        if (faultCode == null) {
+            faultCode = getDefaultFaultCode(soapVersion);
+        }
+
+        if (faultString == null) {
+            faultString = e.getMessage();
+            if (faultString == null) {
+                faultString = e.toString();
+            }
+        }
+        Element detailNode = null;
+        if (detail == null && soapFaultException != null) {
+            detailNode = soapFaultException.getFault().getDetail();
+        } else if(ce != null){
+            try {
+                DOMResult dr = new DOMResult();
+                ce.getBridge().marshal(detail,dr);
+                detailNode = (Element)dr.getNode().getFirstChild();
+            } catch (JAXBException e1) {
+                //Should we throw Internal Server Error???
+                faultString = e.getMessage();
+                faultCode = getDefaultFaultCode(soapVersion);
+            }
+        }
+        SOAP11Fault soap11Fault = new SOAP11Fault(faultCode, faultString, faultActor, detailNode);
+        soap11Fault.captureStackTrace(e);
+
+        return JAXBMessage.create(JAXB_CONTEXT, soap11Fault, soapVersion);
+    }
+
+    private static Message createSOAP12Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
+        SOAPFaultException soapFaultException = null;
+        CodeType code = null;
+        String faultString = null;
+        String faultRole = null;
+        Throwable cause = e.getCause();
+        if (e instanceof SOAPFaultException) {
+            soapFaultException = (SOAPFaultException) e;
+        } else if (cause != null && cause instanceof SOAPFaultException) {
+            soapFaultException = (SOAPFaultException) e.getCause();
+        }
+        if (soapFaultException != null) {
+            SOAPFault fault = soapFaultException.getFault();
+            QName soapFaultCode = fault.getFaultCodeAsQName();
+            if(soapFaultCode != null){
+                faultCode = soapFaultCode;
+                code = new CodeType(faultCode);
+                Iterator iter = fault.getFaultSubcodes();
+                boolean first = true;
+                SubcodeType subcode = null;
+                while(iter.hasNext()){
+                    QName value = (QName)iter.next();
+                    if(first){
+                        SubcodeType sct = new SubcodeType(value);
+                        code.setSubcode(sct);
+                        subcode = sct;
+                        first = false;
+                        continue;
+                    }
+                    subcode = fillSubcodes(subcode, value);
+                }
+            }
+            faultString = soapFaultException.getFault().getFaultString();
+            faultRole = soapFaultException.getFault().getFaultActor();
+        }
+
+        if (faultCode == null) {
+            faultCode = getDefaultFaultCode(soapVersion);
+            code = new CodeType(faultCode);
+        }else if(code == null){
+            code = new CodeType(faultCode);
+        }
+
+        if (faultString == null) {
+            faultString = e.getMessage();
+            if (faultString == null) {
+                faultString = e.toString();
+            }
+        }
+
+        ReasonType reason = new ReasonType(faultString);
+        Element detailNode = null;
+        if (detail == null && soapFaultException != null) {
+            detailNode = soapFaultException.getFault().getDetail();
+        } else if(detail != null){
+            try {
+                DOMResult dr = new DOMResult();
+                ce.getBridge().marshal(detail, dr);
+                detailNode = (Element)dr.getNode().getFirstChild();
+            } catch (JAXBException e1) {
+                //Should we throw Internal Server Error???
+                faultString = e.getMessage();
+                faultCode = getDefaultFaultCode(soapVersion);
+            }
+        }
+        DetailType detailType = null;
+        if(detailNode != null)
+            detailType = new DetailType(detailNode);
+        SOAP12Fault soap12Fault = new SOAP12Fault(code, reason, null, faultRole, detailType);
+        soap12Fault.captureStackTrace(e);
+
+        return JAXBMessage.create(JAXB_CONTEXT, soap12Fault, soapVersion);
+    }
+
+    private static SubcodeType fillSubcodes(SubcodeType parent, QName value){
+        SubcodeType newCode = new SubcodeType(value);
+        parent.setSubcode(newCode);
+        return newCode;
+    }
+
+    private static QName getDefaultFaultCode(SOAPVersion soapVersion) {
+        return soapVersion.faultCodeServer;
+    }
+
+    /**
+     * Parses a fault {@link Message} and returns it as a {@link SOAPFaultBuilder}.
+     *
+     * @return always non-null valid object.
+     * @throws JAXBException if the parsing fails.
+     */
+    public static SOAPFaultBuilder create(Message msg) throws JAXBException {
+        return msg.readPayloadAsJAXB(JAXB_CONTEXT.createUnmarshaller());
+    }
+
+    /**
+     * This {@link JAXBContext} can handle SOAP 1.1/1.2 faults.
+     */
+    private static final JAXBRIContext JAXB_CONTEXT;
+
+    private static final Logger logger = Logger.getLogger(SOAPFaultBuilder.class.getName());
+
+    /**
+     * Set to false if you don't want the generated faults to have stack trace in it.
+     */
+    public static boolean captureStackTrace;
+
+    /*package*/ static final String CAPTURE_STACK_TRACE_PROPERTY = SOAPFaultBuilder.class.getName()+".disableCaptureStackTrace";
+
+    static {
+        try {
+            captureStackTrace = System.getProperty(CAPTURE_STACK_TRACE_PROPERTY)==null;
+        } catch (SecurityException e) {
+            // ignore
+        }
+
+        try {
+            JAXB_CONTEXT = (JAXBRIContext)JAXBContext.newInstance(SOAP11Fault.class, SOAP12Fault.class);
+        } catch (JAXBException e) {
+            throw new Error(e); // this must be a bug in our code
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SubcodeType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SubcodeType.java
new file mode 100644
index 0000000..f378263
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SubcodeType.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.namespace.QName;
+
+/**
+ * <pre>
+ *      &lt;env:Subcode>
+ *          &lt;env:Value>m:MessageTimeout1&lt;/env:Value>
+ *          &lt;env:Subcode>
+ *              &lt;env:Value>m:MessageTimeout2&lt;/env:Value>
+ *          &lt;/env:Subcode>
+ *      &lt;/env:Subcode>
+ *  </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SubcodeType", namespace = "http://www.w3.org/2003/05/soap-envelope", propOrder = {
+    "Value",
+    "Subcode"
+        })
+class SubcodeType {
+    @XmlTransient
+    private static final String ns="http://www.w3.org/2003/05/soap-envelope";
+    /**
+     * mandatory, minOccurs=1
+     */
+    @XmlElement(namespace = ns)
+    private QName Value;
+
+    /**
+     * optional, minOcccurs=0
+     */
+    @XmlElements(@XmlElement(namespace = ns))
+    private SubcodeType Subcode;
+
+    public SubcodeType(QName value) {
+        Value = value;
+    }
+
+    public SubcodeType() {
+    }
+
+    QName getValue() {
+        return Value;
+    }
+
+    SubcodeType getSubcode() {
+        return Subcode;
+    }
+
+    void setSubcode(SubcodeType subcode) {
+        Subcode = subcode;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/TextType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/TextType.java
new file mode 100644
index 0000000..ddc76c0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/TextType.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.fault;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.XmlAttribute;
+import java.util.Locale;
+
+/**
+ * <pre>
+ *    &lt;env:Text xml:lang="en">Sender Timeout</env:Text>
+ * </pre>
+ */
+@XmlType(name = "TextType", namespace = "http://www.w3.org/2003/05/soap-envelope")
+class TextType {
+    private @XmlValue String text;
+
+    /**
+     * xml:lang attribute. What should be value of namespace for "xml"
+     */
+    @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace", required = true)
+    private String lang;
+
+    TextType() {
+    }
+
+    TextType(String text) {
+        this.text = text;
+        this.lang = Locale.getDefault().getLanguage();
+    }
+
+    String getText(){
+        return text;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java
new file mode 100644
index 0000000..5f36209
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ClientLogicalHandlerTube extends HandlerTube {
+
+    private WSBinding binding;
+    private List<LogicalHandler> logicalHandlers;
+
+    /**
+     * Creates a new instance of LogicalHandlerTube
+     */
+    public ClientLogicalHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
+        super(next, port);
+        this.binding = binding;
+    }
+
+    /**
+     * This constructor is used on client-side where, SOAPHandlerTube is created
+     * first and then a LogicalHandlerTube is created with a handler to that
+     * SOAPHandlerTube.
+     * With this handle, LogicalHandlerTube can call
+     * SOAPHandlerTube.closeHandlers()
+     */
+    public ClientLogicalHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+        super(next, cousinTube);
+        this.binding = binding;
+    }
+
+    /**
+     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
+     */
+
+    private ClientLogicalHandlerTube(ClientLogicalHandlerTube that, TubeCloner cloner) {
+        super(that, cloner);
+        this.binding = that.binding;
+    }
+
+    boolean isHandlerChainEmpty() {
+        return logicalHandlers.isEmpty();
+    }
+
+    /**
+     * Close SOAPHandlers first and then LogicalHandlers on Client
+     * Close LogicalHandlers first and then SOAPHandlers on Server
+     */
+    public void close(MessageContext msgContext) {
+        //assuming cousinTube is called if requestProcessingSucessful is true
+        if (requestProcessingSucessful) {
+            //cousinTube is null in XML/HTTP Binding
+            if (cousinTube != null) {
+                // Close SOAPHandlerTube
+                cousinTube.closeCall(msgContext);
+            }
+        }
+        if (processor != null)
+            closeLogicalHandlers(msgContext);
+
+    }
+
+    /**
+     * This is called from cousinTube.
+     * Close this Tubes's handlers.
+     */
+    public void closeCall(MessageContext msgContext) {
+        closeLogicalHandlers(msgContext);
+    }
+
+    //TODO:
+    private void closeLogicalHandlers(MessageContext msgContext) {
+        if (processor == null)
+            return;
+        if (remedyActionTaken) {
+            //Close only invoked handlers in the chain
+
+            //CLIENT-SIDE
+            processor.closeHandlers(msgContext, processor.getIndex(), 0);
+            processor.setIndex(-1);
+            //reset remedyActionTaken
+            remedyActionTaken = false;
+        } else {
+            //Close all handlers in the chain
+
+            //CLIENT-SIDE
+            processor.closeHandlers(msgContext, logicalHandlers.size() - 1, 0);
+
+        }
+    }
+
+    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+        return new ClientLogicalHandlerTube(this, cloner);
+    }
+
+    void setUpProcessor() {
+        // Take a snapshot, User may change chain after invocation, Same chain
+        // should be used for the entire MEP
+        logicalHandlers = new ArrayList<LogicalHandler>();
+        List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
+        if (!logicalSnapShot.isEmpty()) {
+            logicalHandlers.addAll(logicalSnapShot);
+            if (binding.getSOAPVersion() == null) {
+                processor = new XMLHandlerProcessor(this, binding,
+                        logicalHandlers);
+            } else {
+                processor = new SOAPHandlerProcessor(true, this, binding,
+                        logicalHandlers);
+            }
+        }
+    }
+
+
+    MessageUpdatableContext getContext(Packet packet) {
+        return new LogicalMessageContextImpl(binding, packet);
+    }
+
+    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
+
+        boolean handlerResult;
+        try {
+
+            //CLIENT-SIDE
+            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.OUTBOUND, context, !isOneWay);
+        } catch (WebServiceException wse) {
+            remedyActionTaken = true;
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+            remedyActionTaken = true;
+
+            throw new WebServiceException(re);
+
+        }
+        if (!handlerResult) {
+            remedyActionTaken = true;
+        }
+        return handlerResult;
+    }
+
+    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
+        try {
+
+            //CLIENT-SIDE
+            processor.callHandlersResponse(HandlerProcessor.Direction.INBOUND, context, handleFault);
+
+        } catch (WebServiceException wse) {
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+
+            throw new WebServiceException(re);
+
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java
new file mode 100644
index 0000000..718b644
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.WebServiceException;
+import javax.activation.DataHandler;
+import java.util.*;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ClientSOAPHandlerTube extends HandlerTube {
+
+    private WSBinding binding;
+    private List<SOAPHandler> soapHandlers;
+    private Set<String> roles;
+
+    /**
+     * Creates a new instance of SOAPHandlerTube
+     */
+    public ClientSOAPHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
+        super(next, port);
+        if (binding.getSOAPVersion() != null) {
+            // SOAPHandlerTube should n't be used for bindings other than SOAP.
+            // TODO: throw Exception
+        }
+        this.binding = binding;
+    }
+
+    // Handle to LogicalHandlerTube means its used on SERVER-SIDE
+
+    /**
+     * This constructor is used on client-side where, LogicalHandlerTube is created
+     * first and then a SOAPHandlerTube is created with a handler to that
+     * LogicalHandlerTube.
+     * With this handle, SOAPHandlerTube can call LogicalHandlerTube.closeHandlers()
+     */
+    public ClientSOAPHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+        super(next, cousinTube);
+        this.binding = binding;
+    }
+
+    /**
+     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
+     */
+    private ClientSOAPHandlerTube(ClientSOAPHandlerTube that, TubeCloner cloner) {
+        super(that, cloner);
+        this.binding = that.binding;
+    }
+
+    boolean isHandlerChainEmpty() {
+        return soapHandlers.isEmpty();
+    }
+
+    /**
+     * Close SOAPHandlers first and then LogicalHandlers on Client
+     * Close LogicalHandlers first and then SOAPHandlers on Server
+     */
+    public void close(MessageContext msgContext) {
+
+    }
+
+    /**
+     * This is called from cousinTube.
+     * Close this Tube's handlers.
+     */
+    public void closeCall(MessageContext msgContext) {
+        closeSOAPHandlers(msgContext);
+    }
+
+    //TODO:
+    private void closeSOAPHandlers(MessageContext msgContext) {
+        if (processor == null)
+            return;
+        if (remedyActionTaken) {
+            //Close only invoked handlers in the chain
+
+            //CLIENT-SIDE
+            processor.closeHandlers(msgContext, processor.getIndex(), 0);
+            processor.setIndex(-1);
+            //reset remedyActionTaken
+            remedyActionTaken = false;
+        } else {
+            //Close all handlers in the chain
+
+            //CLIENT-SIDE
+            processor.closeHandlers(msgContext, soapHandlers.size() - 1, 0);
+        }
+    }
+
+    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+        return new ClientSOAPHandlerTube(this, cloner);
+    }
+
+    void setUpProcessor() {
+        // Take a snapshot, User may change chain after invocation, Same chain
+        // should be used for the entire MEP
+        soapHandlers = new ArrayList<SOAPHandler>();
+        HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
+        List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
+        if (!soapSnapShot.isEmpty()) {
+            soapHandlers.addAll(soapSnapShot);
+            roles = new HashSet<String>();
+            roles.addAll(handlerConfig.getRoles());
+            processor = new SOAPHandlerProcessor(true, this, binding, soapHandlers);
+        }
+    }
+
+    MessageUpdatableContext getContext(Packet packet) {
+        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet);
+        context.setRoles(roles);
+        return context;
+    }
+
+    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
+
+        boolean handlerResult;
+        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
+        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+        AttachmentSet attSet = packet.getMessage().getAttachments();
+        for(String cid : atts.keySet()){
+            Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
+            attSet.add(att);
+        }
+
+        try {
+            //CLIENT-SIDE
+            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.OUTBOUND, context, !isOneWay);
+        } catch (WebServiceException wse) {
+            remedyActionTaken = true;
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+            remedyActionTaken = true;
+
+            throw new WebServiceException(re);
+
+        }
+        if (!handlerResult) {
+            remedyActionTaken = true;
+        }
+        return handlerResult;
+    }
+
+    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
+        try {
+
+            //CLIENT-SIDE
+            processor.callHandlersResponse(HandlerProcessor.Direction.INBOUND, context, handleFault);
+
+        } catch (WebServiceException wse) {
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+            throw new WebServiceException(re);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainCaller.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainCaller.java
deleted file mode 100644
index 224a329..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainCaller.java
+++ /dev/null
@@ -1,1064 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.LogicalMessage;
-import javax.xml.ws.ProtocolException;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-import javax.xml.ws.http.HTTPException;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-
-/**
- * The class stores the actual "chain" of handlers that is called
- * during a request or response. On the client side, it is created
- * by a {@link com.sun.xml.internal.ws.binding.BindingImpl} class when a
- * binding provider is created. On the server side, where a Binding
- * object may be passed from an outside source, the handler chain
- * caller may be created by the message dispatcher classes.
- *
- * <p>When created, a java.util.List of Handlers is passed in. This list
- * is sorted into logical and protocol handlers, so the handler order
- * that is returned from getHandlerChain() may be different from the
- * original that was passed in.
- *
- * <p>At runtime, one of the callHandlers() methods is invoked by the
- * soap or xml message dispatchers, passing in a {@link HandlerContext}
- * or {@link XMLHandlerContext} object along with other information
- * about the current message that is required for proper handler flow.
- *
- * <p>Exceptions are logged in many cases here before being rethrown. This
- * is to help primarily with server side handlers.
- *
- * <p>Currently, the handler chain caller checks for a null soap
- * message context to see if the binding in use is XML/HTTP.
- *
- * @see com.sun.xml.internal.ws.binding.BindingImpl
- * @see com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher
- * @see com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher
- * @see com.sun.xml.internal.ws.protocol.xml.server.XMLMessageDispatcher
- *
- * @author WS Development Team
- */
-public class HandlerChainCaller {
-
-    public static final String HANDLER_CHAIN_CALLER = "handler_chain_caller";
-    public static final String IGNORE_FAULT_PROPERTY =
-        "ignore fault in message";
-
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".handler");
-
-    // need request or response for Handle interface
-    public enum RequestOrResponse { REQUEST, RESPONSE }
-    public enum Direction { OUTBOUND, INBOUND }
-
-    private Set<QName> understoodHeaders;
-    private List<Handler> handlers; // may be logical/soap mixed
-
-    private List<LogicalHandler> logicalHandlers;
-    private List<SOAPHandler> soapHandlers;
-
-    private Set<String> roles;
-
-    /**
-     * The handlers that are passed in will be sorted into
-     * logical and soap handlers. During this sorting, the
-     * understood headers are also obtained from any soap
-     * handlers.
-     *
-     * @param chain A list of handler objects, which can
-     * be protocol or logical handlers.
-     */
-    public HandlerChainCaller(List<Handler> chain) {
-        if (chain == null) { // should only happen in testing
-            chain = new ArrayList<Handler>();
-        }
-        handlers = chain;
-        logicalHandlers = new ArrayList<LogicalHandler>();
-        soapHandlers = new ArrayList<SOAPHandler>();
-        understoodHeaders = new HashSet<QName>();
-        sortHandlers();
-    }
-
-    /**
-     * This list may be different than the chain that is passed
-     * in since the logical and protocol handlers must be separated.
-     *
-     * @return The list of handlers, sorted by logical and then protocol.
-     */
-    public List<Handler> getHandlerChain() {
-        return handlers;
-    }
-
-    public boolean hasHandlers() {
-        return (handlers.size() != 0);
-    }
-
-    /**
-     * These are set by the SOAPBindingImpl when it creates the
-     * HandlerChainCaller or when new roles are set on the binding.
-     *
-     * @param roles A set of roles strings.
-     */
-    public void setRoles(Set<String> roles) {
-        this.roles = roles;
-    }
-
-    /**
-     * Returns the roles that were passed in by the binding
-     * in the case of soap binding.
-     */
-    public Set<String> getRoles() {
-        return roles;
-    }
-
-    /**
-     * Returns the headers understood by the handlers. This set
-     * is created when the handler chain caller is instantiated and
-     * the handlers are sorted. The set is comprised of headers
-     * returned from SOAPHandler.getHeaders() method calls.
-     *
-     * @return The set of all headers that the handlers declare
-     * that they understand.
-     */
-    public Set<QName> getUnderstoodHeaders() {
-        return understoodHeaders;
-    }
-
-    /**
-     * This method separates the logical and protocol handlers. When
-     * this method returns, the original "handlers" List has been
-     * resorted.
-     */
-    private void sortHandlers() {
-        for (Handler handler : handlers) {
-            if (LogicalHandler.class.isAssignableFrom(handler.getClass())) {
-                logicalHandlers.add((LogicalHandler) handler);
-            } else if (SOAPHandler.class.isAssignableFrom(handler.getClass())) {
-                soapHandlers.add((SOAPHandler) handler);
-                Set<QName> headers = ((SOAPHandler) handler).getHeaders();
-                if (headers != null) {
-                    understoodHeaders.addAll(headers);
-                }
-            } else if (Handler.class.isAssignableFrom(handler.getClass())) {
-                throw new HandlerException(
-                    "cannot.extend.handler.directly",
-                    handler.getClass().toString());
-            } else {
-                throw new HandlerException("handler.not.valid.type",
-                    handler.getClass().toString());
-            }
-        }
-        handlers.clear();
-        handlers.addAll(logicalHandlers);
-        handlers.addAll(soapHandlers);
-    }
-
-    /**
-     * Replace the message in the given message context with a
-     * fault message. If the context already contains a fault
-     * message, then return without changing it.
-     * Also sets the HTTP_RESPONSE_CODE in the context on Server-side.
-     */
-    private void insertFaultMessage(ContextHolder holder,
-        ProtocolException exception) {
-        try {
-            SOAPMessageContext context = holder.getSMC();
-            if (context == null) { // non-soap case
-                LogicalMessageContext lmc = holder.getLMC();
-                LogicalMessage msg = lmc.getMessage();
-                if (msg != null) {
-                    msg.setPayload(null);
-                }
-                //Set Status Code only if it is on server
-                if((Boolean)lmc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)){
-                    if (exception instanceof HTTPException) {
-                        lmc.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
-                    } else {
-                        lmc.put(MessageContext.HTTP_RESPONSE_CODE,WSConnection.INTERNAL_ERR);
-                    }
-                }
-                return;
-            }
-            //Set Status Code only if it is on server
-            if((Boolean)context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)){
-                context.put(MessageContext.HTTP_RESPONSE_CODE,WSConnection.INTERNAL_ERR);
-            }
-            SOAPMessage message = context.getMessage();
-            SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
-            SOAPBody body = envelope.getBody();
-            if (body.hasFault()) {
-                return;
-            }
-            if (envelope.getHeader() != null) {
-                envelope.getHeader().detachNode();
-            }
-
-            body.removeContents();
-            SOAPFault fault = body.addFault();
-            String envelopeNamespace = envelope.getNamespaceURI();
-
-            if (exception instanceof SOAPFaultException) {
-                SOAPFaultException sfe = (SOAPFaultException) exception;
-                SOAPFault userFault = sfe.getFault();
-
-                QName faultCode = userFault.getFaultCodeAsQName();
-                if (faultCode == null) {
-                    faultCode = determineFaultCode(context);
-                }
-                fault.setFaultCode(faultCode);
-
-                String faultString = userFault.getFaultString();
-                if (faultString == null) {
-                    if (sfe.getMessage() != null) {
-                        faultString = sfe.getMessage();
-                    } else {
-                        faultString = sfe.toString();
-                    }
-                }
-                fault.setFaultString(faultString);
-
-                String faultActor = userFault.getFaultActor();
-                if (faultActor == null) {
-                    faultActor = "";
-                }
-                fault.setFaultActor(faultActor);
-
-                if (userFault.getDetail() != null) {
-                    fault.addChildElement(userFault.getDetail());
-                }
-            } else {
-                fault.setFaultCode(determineFaultCode(context));
-                if (exception.getMessage() != null) {
-                    fault.setFaultString(exception.getMessage());
-                } else {
-                    fault.setFaultString(exception.toString());
-                }
-            }
-        } catch (Exception e) {
-            // severe since this is from runtime and not handler
-            logger.log(Level.SEVERE,
-                "exception while creating fault message in handler chain", e);
-            throw new RuntimeException(e);
-        }
-    }
-
-
-
-    /**
-     * <p>The expectation of the rest of the code is that,
-     * if a ProtocolException is thrown from the handler chain,
-     * the message contents reflect the protocol exception.
-     * However, if a new ProtocolException is thrown from
-     * the handleFault method, then the fault should be
-     * ignored and the new exception should be dispatched.
-     *
-     * <p>This method simply sets a property that is checked
-     * by the client and server code when a ProtocolException
-     * is caught. The property can be checked with
-     * {@link MessageContextUtil#ignoreFaultInMessage}
-     */
-    private void addIgnoreFaultProperty(ContextHolder holder) {
-        LogicalMessageContext context = holder.getLMC();
-        context.put(IGNORE_FAULT_PROPERTY, Boolean.TRUE);
-    }
-
-    /**
-     * <p>Figure out if the fault code local part is client,
-     * server, sender, receiver, etc. This is called by
-     * insertFaultMessage.
-     *
-     * <p>This method should only be called when there is a ProtocolException
-     * during request. Reverse the Message direction first,
-     * So this method can use the MESSAGE_OUTBOUND_PROPERTY
-     * to determine whether it is being called on the client
-     * or the server side. If this changes in the spec, then
-     * something else will need to be passed to the method
-     * to determine whether the fault code is client or server.
-     *
-     * <p>For determining soap version, start checking with the
-     * latest version and default to soap 1.1.
-     */
-    private QName determineFaultCode(SOAPMessageContext context)
-        throws SOAPException {
-
-        SOAPEnvelope envelope =
-            context.getMessage().getSOAPPart().getEnvelope();
-        String uri = envelope.getNamespaceURI();
-
-        // client case
-        if (!(Boolean) context.get(
-            MessageContext.MESSAGE_OUTBOUND_PROPERTY)) {
-            if (uri.equals(SOAP12NamespaceConstants.ENVELOPE)) {
-                return SOAP12Constants.FAULT_CODE_CLIENT;
-            }
-            return SOAPConstants.FAULT_CODE_CLIENT;
-        }
-
-        //server case
-        if (uri.equals(SOAP12NamespaceConstants.ENVELOPE)) {
-            return SOAP12Constants.FAULT_CODE_SERVER;
-        }
-        return SOAPConstants.FAULT_CODE_SERVER;
-    }
-
-    /**
-     * <p>Method used to call handlers with a HandlerContext that
-     * may contain logical and protocol handlers. This is the
-     * main entry point for calling the handlers in the case
-     * of SOAP binding. Before calling the handlers, the
-     * handler chain caller will set the outbound property and
-     * the roles on the message context.
-     *
-     * <p>Besides the context object passed in, the other information
-     * is used to control handler execution and closing. See the
-     * handler section of the spec for the rules concering handlers
-     * returning false, throwing exceptions, etc.
-     *
-     * @param direction Inbound or outbound.
-     * @param messageType Request or response.
-     * @param context A soap handler context containing the message.
-     * @param responseExpected A boolean indicating whether or not
-     * a response is expected to the current message (should be false
-     * for responses or one-way requests).
-     *
-     * @return True in the normal case, false if a handler
-     * returned false. This normally means that the runtime
-     * should reverse direction if called during a request.
-     */
-    public boolean callHandlers(Direction direction,
-        RequestOrResponse messageType,
-        SOAPHandlerContext context,
-        boolean responseExpected) {
-
-        return internalCallHandlers(direction, messageType,
-            new ContextHolder(context), responseExpected);
-    }
-
-    /**
-     * Method used to call handlers with a HandlerContext that
-     * may contain logical handlers only. This is the
-     * main entry point for calling the handlers in the case
-     * of http binding. Before calling the handlers, the
-     * handler chain caller will set the outbound property on
-     * the message context.
-     *
-     * <p>Besides the context object passed in, the other information
-     * is used to control handler execution and closing. See the
-     * handler section of the spec for the rules concering handlers
-     * returning false, throwing exceptions, etc.
-     *
-     * @param direction Inbound or outbound.
-     * @param messageType Request or response.
-     * @param context A soap handler context containing the message.
-     * @param responseExpected A boolean indicating whether or not
-     * a response is expected to the current message (should be false
-     * for responses or one-way requests).
-     *
-     * @return True in the normal case, false if a handler
-     * returned false. This normally means that the runtime
-     * should reverse direction if called during a request.
-     */
-    public boolean callHandlers(Direction direction,
-        RequestOrResponse messageType,
-        XMLHandlerContext context,
-        boolean responseExpected) {
-
-        return internalCallHandlers(direction, messageType,
-            new ContextHolder(context), responseExpected);
-    }
-
-    /**
-     * Main runtime method, called internally by the callHandlers()
-     * methods that may be called with HandlerContext or
-     * XMLHandlerContext objects.
-     *
-     * The boolean passed in is whether or not a response is required
-     * for the current message. See section 5.3.2. (todo: this section
-     * is going to change).
-     *
-     * The callLogicalHandlers and callProtocolHandlers methods will
-     * take care of execution once called and return true or false or
-     * throw an exception.
-     */
-    private boolean internalCallHandlers(Direction direction,
-        RequestOrResponse messageType,
-        ContextHolder ch,
-        boolean responseExpected) {
-
-        // set outbound property
-        ch.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,
-            (direction == Direction.OUTBOUND));
-
-        // if there is as soap message context, set roles
-        if (ch.getSMC() != null) {
-            ((SOAPMessageContextImpl) ch.getSMC()).setRoles(getRoles());
-        }
-
-        // call handlers
-        if (direction == Direction.OUTBOUND) {
-            if (callLogicalHandlers(ch, direction, messageType,
-                    responseExpected) == false) {
-                return false;
-            }
-            if (callProtocolHandlers(ch, direction, messageType,
-                    responseExpected) == false) {
-                return false;
-            }
-        } else {
-            if (callProtocolHandlers(ch, direction, messageType,
-                    responseExpected) == false) {
-                return false;
-            }
-            if (callLogicalHandlers(ch, direction, messageType,
-                    responseExpected) == false) {
-                return false;
-            }
-        }
-
-        /*
-         * Close if MEP finished. Server code responsible for closing
-         * handlers if it determines that an incoming request is a
-         * one way message.
-         */
-                if (!responseExpected) {
-            if (messageType == RequestOrResponse.REQUEST) {
-                if (direction == Direction.INBOUND) {
-                    closeHandlersServer(ch);
-                } else {
-                    closeHandlersClient(ch);
-                }
-            } else {
-                if (direction == Direction.INBOUND) {
-                    closeHandlersClient(ch);
-                } else {
-                    closeHandlersServer(ch);
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
-     * This method called by the server when an endpoint has thrown
-     * an exception. This method calls handleFault on the handlers
-     * and closes them. Because this method is called only during
-     * a response after the endpoint has been reached, all of the
-     * handlers have been called during the request and so all are
-     * closed.
-     */
-    public boolean callHandleFault(SOAPHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-        ch.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, true);
-        ((SOAPMessageContextImpl) ch.getSMC()).setRoles(getRoles());
-
-        int i = 0; // counter for logical handlers
-        int j = 0; // counter for protocol handlers
-        try {
-            while (i < logicalHandlers.size()) {
-                if (logicalHandlers.get(i).handleFault(ch.getLMC()) == false) {
-                    return false;
-                }
-                i++;
-            }
-            while (j < soapHandlers.size()) {
-                if (soapHandlers.get(j).handleFault(ch.getSMC()) == false) {
-                    return false;
-                }
-                j++;
-            }
-        } catch (RuntimeException re) {
-            logger.log(Level.FINER, "exception in handler chain", re);
-            throw re;
-        } finally {
-            closeHandlersServer(ch); // this is always called on server side
-        }
-        return true;
-    }
-
-    /**
-     * This method called by the client when it sees a SOAPFault message.
-     * This method calls handleFault on the handlers and closes them. Because
-     * this method is called only during a response, all of the handlers have
-     * been called during the request and so all are closed.
-     */
-    public boolean callHandleFaultOnClient(SOAPHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-        ch.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
-        ((SOAPMessageContextImpl) ch.getSMC()).setRoles(getRoles());
-
-        try {
-            for (int i=soapHandlers.size()-1; i>=0; i--) {
-                if (soapHandlers.get(i).handleFault(ch.getSMC()) == false) {
-                    return false;
-                }
-            }
-            for (int i=logicalHandlers.size()-1; i>=0; i--) {
-                if (logicalHandlers.get(i).handleFault(ch.getLMC()) == false) {
-                    return false;
-                }
-            }
-        } catch (RuntimeException re) {
-            logger.log(Level.FINER, "exception in handler chain", re);
-            throw re;
-        } finally {
-            closeHandlersClient(ch);
-        }
-        return true;
-    }
-
-
-    /**
-     * Called from the main callHandlers() method.
-     * Logical message context updated before this method is called.
-     */
-    private boolean callLogicalHandlers(ContextHolder holder,
-        Direction direction, RequestOrResponse type, boolean responseExpected) {
-
-        if (direction == Direction.OUTBOUND) {
-            int i = 0;
-            try {
-                while (i < logicalHandlers.size()) {
-                    if (logicalHandlers.get(i).
-                        handleMessage(holder.getLMC()) == false) {
-                        if (responseExpected) {
-                            // reverse and call handle message
-                            holder.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,false);
-                            callLogicalHandleMessage(holder, i-1, 0);
-                        }
-                        if (type == RequestOrResponse.RESPONSE) {
-                            closeHandlersServer(holder);
-                        } else {
-                            closeLogicalHandlers(holder, i, 0);
-                        }
-                        return false;
-                    }
-                    i++;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER, "exception in handler chain", re);
-                if (responseExpected && re instanceof ProtocolException) {
-                    // reverse direction and handle fault
-                    holder.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,false);
-                    insertFaultMessage(holder, (ProtocolException) re);
-                    if (i>0) {
-                        try {
-                            callLogicalHandleFault(holder, i-1, 0);
-                        } catch (ProtocolException re1) {
-                            addIgnoreFaultProperty(holder);
-                            re = re1;
-                        } catch (RuntimeException re2) {
-                            re = re2;
-                        }
-                    }
-                }
-                if (type == RequestOrResponse.RESPONSE) {
-                    closeHandlersServer(holder);
-                } else {
-                    closeLogicalHandlers(holder, i, 0);
-                }
-                throw re;
-            }
-        } else { // inbound case, H(x) -> H(x-1) -> ... H(1) -> H(0)
-            int i = logicalHandlers.size()-1;
-            try {
-                while (i >= 0) {
-                    if (logicalHandlers.get(i).
-                        handleMessage(holder.getLMC()) == false) {
-
-                        if (responseExpected) {
-                            // reverse and call handle message/response
-                            holder.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,true);
-                            callLogicalHandleMessage(holder, i+1,
-                                logicalHandlers.size()-1);
-                            callProtocolHandleMessage(holder, 0,
-                                soapHandlers.size()-1);
-                        }
-                        if (type == RequestOrResponse.RESPONSE) {
-                            closeHandlersClient(holder);
-                        } else {
-                            closeLogicalHandlers(holder, i,
-                                logicalHandlers.size()-1);
-                            closeProtocolHandlers(holder, 0,
-                                soapHandlers.size()-1);
-                        }
-                        return false;
-                    }
-                    i--;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER, "exception in handler chain", re);
-                if (responseExpected && re instanceof ProtocolException) {
-                    // reverse direction and handle fault
-                    holder.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,true);
-                    insertFaultMessage(holder, (ProtocolException) re);
-
-                    try {
-                        // if i==size-1, no more logical handlers to call
-                        if (i == logicalHandlers.size()-1 ||
-                            callLogicalHandleFault(holder, i+1,
-                                logicalHandlers.size()-1)) {
-                            callProtocolHandleFault(holder, 0,
-                                soapHandlers.size()-1);
-                        }
-                    } catch (ProtocolException re1) {
-                        addIgnoreFaultProperty(holder);
-                        re = re1;
-                    } catch (RuntimeException re2) {
-                        re = re2;
-                    }
-                }
-                if (type == RequestOrResponse.RESPONSE) {
-                    closeHandlersClient(holder);
-                } else {
-                    closeLogicalHandlers(holder, i, logicalHandlers.size()-1);
-                    closeProtocolHandlers(holder, 0, soapHandlers.size()-1);
-                }
-                throw re;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Called from the main callHandlers() method.
-     * SOAP message context updated before this method is called.
-     */
-    private boolean callProtocolHandlers(ContextHolder holder,
-        Direction direction, RequestOrResponse type, boolean responseExpected) {
-
-        if (direction == Direction.OUTBOUND) {
-            int i = 0;
-            try {
-                while (i<soapHandlers.size()) {
-                    if (soapHandlers.get(i).
-                        handleMessage(holder.getSMC()) == false) {
-
-                        if (responseExpected) {
-                            // reverse and call handle message/response
-                            holder.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,false);
-                            if (i>0) {
-                                callProtocolHandleMessage(holder, i-1, 0);
-                            }
-                            callLogicalHandleMessage(holder,
-                                logicalHandlers.size()-1, 0);
-                        }
-                        if (type == RequestOrResponse.RESPONSE) {
-                            closeHandlersServer(holder);
-                        } else {
-                            closeProtocolHandlers(holder, i, 0);
-                            closeLogicalHandlers(holder,
-                                logicalHandlers.size()-1 , 0);
-                        }
-                        return false;
-                    }
-                    i++;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER, "exception in handler chain", re);
-                if (responseExpected && re instanceof ProtocolException) {
-                    // reverse direction and handle fault
-                    holder.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,false);
-                    insertFaultMessage(holder, (ProtocolException) re);
-                    try {
-                        if (i == 0 || // still on first handler
-                            callProtocolHandleFault(holder, i-1, 0)) {
-                            callLogicalHandleFault(holder,
-                                logicalHandlers.size()-1, 0);
-                        }
-                    } catch (ProtocolException re1) {
-                        addIgnoreFaultProperty(holder);
-                        re = re1;
-                    } catch (RuntimeException re2) {
-                        re = re2;
-                    }
-                }
-                if (type == RequestOrResponse.RESPONSE) {
-                    closeHandlersServer(holder);
-                } else {
-                    closeProtocolHandlers(holder, i, 0);
-                    closeLogicalHandlers(holder, logicalHandlers.size()-1, 0);
-                }
-                throw re;
-            }
-        } else { // inbound case, H(x) -> H(x-1) -> ... H(1) -> H(0)
-            int i = soapHandlers.size()-1;
-            try {
-                while (i >= 0) {
-                    if (soapHandlers.get(i).
-                        handleMessage(holder.getSMC()) == false) {
-
-                        // reverse and call handle message/response
-                        holder.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,true);
-                        if (responseExpected && i != soapHandlers.size()-1) {
-                            callProtocolHandleMessage(holder, i+1,
-                                soapHandlers.size()-1);
-                        }
-                        if (type == RequestOrResponse.RESPONSE) {
-                            closeHandlersClient(holder);
-                        } else {
-                            closeProtocolHandlers(holder, i,
-                                soapHandlers.size()-1);
-                        }
-                        return false;
-                    }
-                    i--;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER, "exception in handler chain", re);
-                if (responseExpected && re instanceof ProtocolException) {
-                    // reverse direction and handle fault
-                    holder.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,true);
-                    insertFaultMessage(holder, (ProtocolException) re);
-                    try {
-                        if (i < soapHandlers.size()-1) {
-                            callProtocolHandleFault(holder, i+1,
-                                soapHandlers.size()-1);
-                        }
-                    } catch (ProtocolException re1) {
-                        addIgnoreFaultProperty(holder);
-                        re = re1;
-                    } catch (RuntimeException re2) {
-                        re = re2;
-                    }
-                }
-                if (type == RequestOrResponse.RESPONSE) {
-                    closeHandlersClient(holder);
-                } else {
-                    closeProtocolHandlers(holder, i, soapHandlers.size()-1);
-                }
-                throw re;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Method called for abnormal processing (for instance, as the
-     * result of a handler returning false during normal processing).
-     * Start and end indices are inclusive.
-     */
-    private void callLogicalHandleMessage(ContextHolder holder,
-            int start, int end) {
-
-        if (logicalHandlers.isEmpty() ||
-            start == -1 ||
-            start == logicalHandlers.size()) {
-            return;
-        }
-        callGenericHandleMessage(logicalHandlers,holder.getLMC(),start,end);
-
-    }
-
-    /**
-     * Method called for abnormal processing (for instance, as the
-     * result of a handler returning false during normal processing).
-     * Start and end indices are inclusive.
-     */
-    private void callProtocolHandleMessage(ContextHolder holder,
-        int start, int end) {
-
-        if (soapHandlers.isEmpty()) {
-            return;
-        }
-        callGenericHandleMessage(soapHandlers,holder.getSMC(),start,end);
-    }
-
-    /**
-     * Utility method for calling handleMessage during abnormal processing(for
-     * instance, as the result of a handler returning false during normal
-     * processing). Start and end indices are inclusive.
-     */
-
-    private <C extends MessageContext> void callGenericHandleMessage(List<? extends Handler> handlerList,
-        C context, int start, int end) {
-        if (handlerList.isEmpty()) {
-            return ;
-        }
-        int i = start;
-        if (start > end) {
-            try {
-                while (i >= end) {
-                    if (handlerList.get(i).handleMessage(context) == false)
-                        return;
-                    i--;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER,
-                    "exception in handler chain", re);
-                throw re;
-            }
-        } else {
-            try {
-                while (i <= end) {
-                    if (handlerList.get(i).handleMessage(context) == false)
-                        return ;
-                    i++;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER,
-                    "exception in handler chain", re);
-                throw re;
-            }
-        }
-        return;
-    }
-
-    /*
-     * Calls handleFault on the logical handlers. Indices are
-     * inclusive. Exceptions get passed up the chain, and an
-     * exception or return of 'false' ends processing.
-     */
-    private boolean callLogicalHandleFault(ContextHolder holder,
-            int start, int end) {
-
-        return callGenericHandleFault(logicalHandlers,
-            holder.getLMC(), start, end);
-    }
-
-    /**
-     * Calls handleFault on the protocol handlers. Indices are
-     * inclusive. Exceptions get passed up the chain, and an
-     * exception or return of 'false' ends processing.
-     */
-    private boolean callProtocolHandleFault(ContextHolder holder,
-        int start, int end) {
-
-        return callGenericHandleFault(soapHandlers,
-            holder.getSMC(), start, end);
-    }
-
-    /*
-     * Used by callLogicalHandleFault and callProtocolHandleFault.
-     */
-    private <C extends MessageContext> boolean callGenericHandleFault(List<? extends Handler> handlerList,
-        C context, int start, int end) {
-
-        if (handlerList.isEmpty()) {
-            return true;
-        }
-        int i = start;
-        if (start > end) {
-            try {
-                while (i >= end) {
-                    if (handlerList.get(i).
-                            handleFault(context) == false) {
-
-                        return false;
-                    }
-                    i--;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER,
-                    "exception in handler chain", re);
-                throw re;
-            }
-        } else {
-            try {
-                while (i <= end) {
-                    if (handlerList.get(i).
-                        handleFault(context) == false) {
-
-                        return false;
-                    }
-                    i++;
-                }
-            } catch (RuntimeException re) {
-                logger.log(Level.FINER,
-                    "exception in handler chain", re);
-                throw re;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Method that closes protocol handlers and then
-     * logical handlers.
-     */
-    private void closeHandlersClient(ContextHolder holder) {
-        closeProtocolHandlers(holder, soapHandlers.size()-1, 0);
-        closeLogicalHandlers(holder, logicalHandlers.size()-1, 0);
-    }
-
-    /**
-     * Method that closes logical handlers and then
-     * protocol handlers.
-     */
-    private void closeHandlersServer(ContextHolder holder) {
-        closeLogicalHandlers(holder, 0, logicalHandlers.size()-1);
-        closeProtocolHandlers(holder, 0, soapHandlers.size()-1);
-    }
-
-    /**
-     * This version is called by the server code once it determines
-     * that an incoming message is a one-way request.
-     */
-    public void forceCloseHandlersOnServer(SOAPHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-        // only called after an inbound request
-        ch.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
-        ((SOAPMessageContextImpl) ch.getSMC()).setRoles(getRoles());
-        closeHandlersServer(ch);
-    }
-
-    /**
-     * It is called by the client when an MU fault occurs since the handlerchain
-     * never gets invoked. The direction is an inbound message.
-     */
-    public void forceCloseHandlersOnClient(SOAPHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-
-        // only called after an inbound request
-        ch.getSMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
-        ((SOAPMessageContextImpl) ch.getSMC()).setRoles(getRoles());
-        closeHandlersClient(ch);
-    }
-
-    /**
-     * Version of forceCloseHandlers(HandlerContext) that is used
-     * by XML binding.
-     */
-    public void forceCloseHandlersOnServer(XMLHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-        // only called after an inbound request
-        ch.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
-        closeHandlersServer(ch);
-    }
-
-    /**
-     * Version of forceCloseHandlers(HandlerContext) that is used
-     * by XML binding.
-     */
-    public void forceCloseHandlersOnClient(XMLHandlerContext context) {
-        ContextHolder ch = new ContextHolder(context);
-        // only called after an inbound request
-        ch.getLMC().put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
-        closeHandlersClient(ch);
-    }
-
-    private void closeProtocolHandlers(ContextHolder holder,
-        int start, int end) {
-
-        closeGenericHandlers(soapHandlers, holder.getSMC(), start, end);
-    }
-
-    private void closeLogicalHandlers(ContextHolder holder,
-        int start, int end) {
-
-        closeGenericHandlers(logicalHandlers, holder.getLMC(), start, end);
-    }
-
-    /**
-     * Calls close on the handlers from the starting
-     * index through the ending index (inclusive). Made indices
-     * inclusive to allow both directions more easily.
-     */
-    private void closeGenericHandlers(List<? extends Handler> handlerList,
-        MessageContext context, int start, int end) {
-
-        if (handlerList.isEmpty()) {
-            return;
-        }
-        if (start > end) {
-            for (int i=start; i>=end; i--) {
-                try {
-                    handlerList.get(i).close(context);
-                } catch (RuntimeException re) {
-                    logger.log(Level.INFO,
-                        "Exception ignored during close", re);
-                }
-            }
-        } else {
-            for (int i=start; i<=end; i++) {
-                try {
-                    handlerList.get(i).close(context);
-                } catch (RuntimeException re) {
-                    logger.log(Level.INFO,
-                        "Exception ignored during close", re);
-                }
-            }
-        }
-    }
-
-    /**
-     * Used to hold the context objects that are used to get
-     * and set the current message.
-     *
-     * If a HandlerContext is passed in, both logical and soap
-     * handlers are used. If XMLHandlerContext is passed in,
-     * only logical handlers are assumed to be present.
-     */
-    static class ContextHolder {
-
-        boolean logicalOnly;
-        SOAPHandlerContext context;
-        XMLHandlerContext xmlContext;
-
-        ContextHolder(SOAPHandlerContext context) {
-            this.context = context;
-            logicalOnly = false;
-        }
-
-        ContextHolder(XMLHandlerContext xmlContext) {
-            this.xmlContext = xmlContext;
-            logicalOnly = true;
-        }
-
-        LogicalMessageContext getLMC() {
-            return (logicalOnly ? xmlContext.getLogicalMessageContext() :
-                context.getLogicalMessageContext());
-        }
-
-        SOAPMessageContext getSMC() {
-            return (logicalOnly ? null : context.getSOAPMessageContext());
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java
index 1e9680a..84bb2f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
 
 package com.sun.xml.internal.ws.handler;
 
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
 import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.transport.http.DeploymentDescriptorParser;
 import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
 import com.sun.xml.internal.ws.util.JAXWSUtils;
 import com.sun.xml.internal.ws.util.UtilException;
@@ -36,10 +39,12 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.PortInfo;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
 import java.lang.reflect.Method;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
 import java.util.logging.Logger;
 
 
@@ -47,26 +52,26 @@
     private static final Logger logger = Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".util");
 
-    protected Class annotatedClass;
-    protected List<HandlerChainType> handlerChains;
-    protected String id;
+    private Class annotatedClass;
+    private List<HandlerChainType> handlerChains;
+    private String id;
     /** Creates a new instance of HandlerChains */
-    public HandlerChainsModel(Class annotatedClass) {
+    private HandlerChainsModel(Class annotatedClass) {
         this.annotatedClass = annotatedClass;
     }
 
-    public List<HandlerChainType> getHandlerChain() {
+    private List<HandlerChainType> getHandlerChain() {
         if (handlerChains == null) {
             handlerChains = new ArrayList<HandlerChainType>();
         }
         return handlerChains;
     }
 
-    public java.lang.String getId() {
+    public String getId() {
         return id;
     }
 
-    public void setId(java.lang.String value) {
+    public void setId(String value) {
         this.id = value;
     }
     /**
@@ -108,7 +113,7 @@
                 XMLStreamReaderUtil.nextContent(reader);
                 if (reader.getName().equals(QNAME_HANDLER_NAME)) {
                     String handlerName =
-                            XMLStreamReaderUtil.getElementText(reader);
+                            XMLStreamReaderUtil.getElementText(reader).trim();
                     handler.setHandlerName(handlerName);
                     XMLStreamReaderUtil.nextContent(reader);
                 }
@@ -116,7 +121,7 @@
                 // handler class
                 ensureProperName(reader, QNAME_HANDLER_CLASS);
                 String handlerClass =
-                        XMLStreamReaderUtil.getElementText(reader);
+                        XMLStreamReaderUtil.getElementText(reader).trim();
                 handler.setHandlerClass(handlerClass);
                 XMLStreamReaderUtil.nextContent(reader);
 
@@ -156,17 +161,21 @@
     /**
      * <p>This method is called internally by HandlerAnnotationProcessor,
      * and by
-     * {@link com.sun.xml.internal.ws.transport.http.servlet.RuntimeEndpointInfoParser}
+     * {@link com.sun.xml.internal.ws.transport.http.DeploymentDescriptorParser}
      * directly when it reaches the handler chains element in the
      * descriptor file it is parsing.
-     *
+     * @param reader should be on <handler-chains> element
      * @return A HandlerAnnotationInfo object that stores the
      * handlers and roles.
      */
+
+
+
     public static HandlerAnnotationInfo parseHandlerFile(XMLStreamReader reader,
             ClassLoader classLoader, QName serviceName, QName portName,
-            String bindingId) {
+            WSBinding wsbinding) {
         ensureProperName(reader,QNAME_HANDLER_CHAINS);
+        String bindingId = wsbinding.getBindingId().toString();
         HandlerAnnotationInfo info = new HandlerAnnotationInfo();
 
         XMLStreamReaderUtil.nextElementContent(reader);
@@ -201,11 +210,12 @@
                 List<String> bindingList = new ArrayList<String>();
                 while(stk.hasMoreTokens()) {
                     String tokenOrURI = stk.nextToken();
-                    String binding = tokenBindingMap.get(tokenOrURI);
-                    if(binding == null) {
-                        //Unknown binding or Unknown token, Put it as it is
-                        binding = tokenOrURI;
-                    }
+                    /*
+                    Convert short-form tokens to API's binding ids
+                    Unknown token, Put it as it is
+                    */
+                    tokenOrURI = DeploymentDescriptorParser.getBindingIdForToken(tokenOrURI);
+                    String binding = BindingID.parse(tokenOrURI).toString();
                     bindingList.add(binding);
                 }
                 if(bindingList.contains(bindingId)){
@@ -234,7 +244,7 @@
 
             // process all <handler> elements
             while (reader.getName().equals(QNAME_HANDLER)) {
-                Handler handler = null;
+                Handler handler;
 
                 XMLStreamReaderUtil.nextContent(reader);
                 if (reader.getName().equals(QNAME_HANDLER_NAME)) {
@@ -245,7 +255,7 @@
                 ensureProperName(reader, QNAME_HANDLER_CLASS);
                 try {
                     handler = (Handler) loadClass(classLoader,
-                            XMLStreamReaderUtil.getElementText(reader)).newInstance();
+                            XMLStreamReaderUtil.getElementText(reader).trim()).newInstance();
                 } catch (InstantiationException ie){
                     throw new RuntimeException(ie);
                 } catch (IllegalAccessException e) {
@@ -339,7 +349,7 @@
 
     }
 
-    static Class loadClass(ClassLoader loader, String name) {
+    private static Class loadClass(ClassLoader loader, String name) {
         try {
             return Class.forName(name, true, loader);
         } catch (ClassNotFoundException e) {
@@ -349,7 +359,7 @@
         }
     }
 
-    static void callHandlerPostConstruct(Object handlerClass) {
+    private static void callHandlerPostConstruct(Object handlerClass) {
         // call @PostConstruct method on handler if present
         for (Method method : handlerClass.getClass().getMethods()) {
             if (method.getAnnotation(PostConstruct.class) == null) {
@@ -364,20 +374,20 @@
         }
     }
 
-    static void skipChain(XMLStreamReader reader) {
+    private static void skipChain(XMLStreamReader reader) {
         while (XMLStreamReaderUtil.nextContent(reader) !=
                 XMLStreamConstants.END_ELEMENT ||
                 !reader.getName().equals(QNAME_HANDLER_CHAIN)) {}
         XMLStreamReaderUtil.nextElementContent(reader);
     }
 
-    static void skipTextElement(XMLStreamReader reader) {
+    private static void skipTextElement(XMLStreamReader reader) {
         XMLStreamReaderUtil.nextContent(reader);
         XMLStreamReaderUtil.nextElementContent(reader);
         XMLStreamReaderUtil.nextElementContent(reader);
     }
 
-    static void skipInitParamElement(XMLStreamReader reader) {
+    private static void skipInitParamElement(XMLStreamReader reader) {
         int state;
         do {
             state = XMLStreamReaderUtil.nextContent(reader);
@@ -386,7 +396,7 @@
         XMLStreamReaderUtil.nextElementContent(reader);
     }
 
-    static void ensureProperName(XMLStreamReader reader,
+    private static void ensureProperName(XMLStreamReader reader,
             QName expectedName) {
 
         if (!reader.getName().equals(expectedName)) {
@@ -402,13 +412,12 @@
         }
     }
 
-    static void failWithLocalName(String key,
+    private static void failWithLocalName(String key,
             XMLStreamReader reader, String arg) {
         throw new UtilException(key,
-                new Object[] {
             Integer.toString(reader.getLocation().getLineNumber()),
             reader.getLocalName(),
-            arg });
+            arg );
     }
 
     public static final String PROTOCOL_SOAP11_TOKEN = "##SOAP11_HTTP";
@@ -443,28 +452,18 @@
             new QName(NS_109, "soap-header");
     public static final QName QNAME_HANDLER_ROLE =
             new QName(NS_109, "soap-role");
-    protected static final Map<String,String> tokenBindingMap;
-    //Populate the token map
-    static {
-        tokenBindingMap = new HashMap<String,String>();
-        tokenBindingMap.put("##SOAP11_HTTP",SOAPBinding.SOAP11HTTP_BINDING);
-        tokenBindingMap.put("##SOAP11_HTTP_MTOM",SOAPBinding.SOAP11HTTP_MTOM_BINDING);
-        tokenBindingMap.put("##SOAP12_HTTP",SOAPBinding.SOAP12HTTP_BINDING);
-        tokenBindingMap.put("##SOAP12_HTTP_MTOM",SOAPBinding.SOAP12HTTP_MTOM_BINDING);
-        tokenBindingMap.put("##XML_HTTP",HTTPBinding.HTTP_BINDING);
-    }
 
     static class HandlerChainType {
         //constraints
-        protected QName serviceNamePattern;
-        protected QName portNamePattern;
-        protected List<String> protocolBindings;
+        QName serviceNamePattern;
+        QName portNamePattern;
+        List<String> protocolBindings;
 
         // This flag is set if one of the above constraint is set on handler chain
-        protected boolean constraintSet = false;
+        boolean constraintSet = false;
 
-        protected List<HandlerType> handlers;
-        protected String id;
+        List<HandlerType> handlers;
+        String id;
 
 
         /** Creates a new instance of HandlerChain */
@@ -494,12 +493,13 @@
             return this.protocolBindings;
         }
 
-        public void addProtocolBinding(String tokenorURI){
-            String binding = tokenBindingMap.get(tokenorURI);
-            if(binding == null) {
-                //Unknown binding or Unknown token, Put it as it is
-                binding = tokenorURI;
-            }
+        public void addProtocolBinding(String tokenOrURI){
+            /*
+            Convert short-form tokens to API's binding ids
+            Unknown token, Put it as it is
+            */
+            tokenOrURI = DeploymentDescriptorParser.getBindingIdForToken(tokenOrURI);
+            String binding = BindingID.parse(tokenOrURI).toString();
             protocolBindings.add(binding);
             constraintSet = true;
         }
@@ -524,11 +524,11 @@
     }
 
     static class HandlerType {
-        protected String handlerName;
-        protected String handlerClass;
-        protected List<String> soapRoles;
+        String handlerName;
+        String handlerClass;
+        List<String> soapRoles;
 
-        protected java.lang.String id;
+        java.lang.String id;
 
         /** Creates a new instance of HandlerComponent */
         public HandlerType() {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerContext.java
deleted file mode 100644
index 4c5351a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerContext.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-import javax.xml.ws.handler.MessageContext;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.spi.runtime.InternalSoapEncoder;
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * The HandlerContext is used in the client and server runtime
- * in {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher} and
- * {@link com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher} to hold
- * information about the current message.
- *
- * <p>It stores a {@link com.sun.xml.internal.ws.pept.ept.MessageInfo} and
- * {@link com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage}
- * which are used by the rest of the runtime, and provides a bridge
- * between these and the soap and logical message contexts that
- * are used by the handlers.
- *
- * @see LogicalMessageContextImpl
- * @see MessageContextImpl
- * @see SOAPMessageContextImpl
- *
- * @author WS Development Team
- */
-public class HandlerContext {
-
-    private MessageInfo messageInfo;
-    private InternalMessage internalMessage;
-    private MessageContext msgContext;
-
-    private Method method;
-    private Invoker invoker;
-    private String algorithm;
-    private String bindingId;
-
-    public HandlerContext(MessageInfo messageInfo,
-                          InternalMessage internalMessage) {
-        this.messageInfo = messageInfo;
-        this.internalMessage = internalMessage;
-        this.msgContext = new MessageContextImpl();
-        //populateAttachmentMap();
-    }
-
-    /**
-     * @return Returns the soapMessage.
-     */
-    public MessageContext getMessageContext() {
-        return msgContext;
-    }
-
-    public void setMessageContext(MessageContext msgContext) {
-        this.msgContext = msgContext;
-    }
-
-    public InternalMessage getInternalMessage() {
-        return internalMessage;
-    }
-
-    /**
-    * @param internalMessage The internalMessage to set.
-    */
-    public void setInternalMessage(InternalMessage internalMessage) {
-        this.internalMessage = internalMessage;
-        populateAttachmentMap();
-    }
-
-    public MessageInfo getMessageInfo() {
-        return messageInfo;
-    }
-
-    /**
-    * @param messageInfo The messageInfo to set.
-    */
-    public void setMessageInfo(MessageInfo messageInfo) {
-        this.messageInfo = messageInfo;
-    }
-
-    /*
-     * Returns the invocation method
-     */
-    public Method getMethod() {
-        return method;
-    }
-
-    public void setMethod(Method method) {
-        this.method = method;
-    }
-
-    /*
-    * Returns InternalMessage's BodyBlock value. It can be null for empty body.
-    */
-    public Object getBody() {
-        return (internalMessage == null) ? null : ((internalMessage.getBody() == null)?null:internalMessage.getBody().getValue());
-    }
-
-    /*
-    * Returns InternalMessage's HeaderBlock values
-    */
-    public List getHeaders() {
-        List<HeaderBlock> headerBlocks =
-            (internalMessage == null) ? null : internalMessage.getHeaders();
-        if (headerBlocks != null) {
-             List headers = new ArrayList();
-             for (HeaderBlock headerBlock : headerBlocks) {
-                if (headerBlock.getValue() != null) {
-                    headers.add(headerBlock.getValue());
-                }
-             }
-             return headers;
-        }
-        return null;
-    }
-
-    public String getBindingId() {
-        return bindingId;
-    }
-
-    public void setBindingId(String bindingID) {
-        bindingId = bindingID;
-    }
-
-    public void setCanonicalization(String algorithm) {
-        this.algorithm = algorithm;
-    }
-
-    public Invoker getInvoker() {
-        return invoker;
-    }
-
-    public void setInvoker(Invoker invoker) {
-        this.invoker = invoker;
-    }
-
-    public void populateAttachmentMap(){
-        //populate the attachment map
-        if(internalMessage != null){
-            for(AttachmentBlock ab: internalMessage.getAttachments().values()){
-                MessageContextUtil.addMessageAttachment(msgContext, ab.getId(), ab.asDataHandler());
-            }
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerException.java
index dc07d00..4cd11e9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("handler.nestedError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.handler";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java
new file mode 100644
index 0000000..ed340cd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java
@@ -0,0 +1,411 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * @author WS Development Team
+ */
+abstract class HandlerProcessor<C extends MessageUpdatableContext> {
+
+    boolean isClient;
+    static final Logger logger = Logger.getLogger(
+            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".handler");
+
+    // need request or response for Handle interface
+    public enum RequestOrResponse {
+        REQUEST, RESPONSE }
+
+    public enum Direction {
+        OUTBOUND, INBOUND }
+
+    private List<? extends Handler> handlers; // may be logical/soap mixed
+
+    WSBinding binding;
+    private int index = -1;
+    private HandlerTube owner;
+
+    /**
+     * The handlers that are passed in will be sorted into
+     * logical and soap handlers. During this sorting, the
+     * understood headers are also obtained from any soap
+     * handlers.
+     *
+     * @param chain A list of handler objects, which can
+     *              be protocol or logical handlers.
+     */
+    protected HandlerProcessor(HandlerTube owner, WSBinding binding, List<? extends Handler> chain) {
+        this.owner = owner;
+        if (chain == null) { // should only happen in testing
+            chain = new ArrayList<Handler>();
+        }
+        handlers = chain;
+        this.binding = binding;
+    }
+
+    /**
+     * Gives index of the handler in the chain to know what handlers in the chain
+     * are invoked
+     */
+    int getIndex() {
+        return index;
+    }
+
+    /**
+     * This is called when a handler returns false or throws a RuntimeException
+     */
+    void setIndex(int i) {
+        index = i;
+    }
+
+    /**
+     * TODO: Just putting thoughts,
+     * Current contract: This is Called during Request Processing.
+     * return true, if all handlers in the chain return true
+     * Current Pipe can call nextPipe.process();
+     * return false, One of the handlers has returned false or thrown a
+     * RuntimeException. Remedy Actions taken:
+     * 1) In this case, The processor will setIndex()to track what
+     * handlers are invoked until that point.
+     * 2) Previously invoked handlers are again invoked (handleMessage()
+     * or handleFault()) to take remedy action.
+     * CurrentPipe should NOT call nextPipe.process()
+     * While closing handlers, check getIndex() to get the invoked
+     * handlers.
+     * @throws RuntimeException this happens when a RuntimeException occurs during
+     * handleMessage during Request processing or
+     * during remedy action 2)
+     * CurrentPipe should NOT call nextPipe.process() and throw the
+     * exception to the previous Pipe
+     * While closing handlers, check getIndex() to get the invoked
+     * handlers.
+     */
+    public boolean callHandlersRequest(Direction direction,
+                                       C context,
+                                       boolean responseExpected) {
+        setDirection(direction, context);
+        boolean result;
+        // call handlers
+        try {
+            if (direction == Direction.OUTBOUND) {
+                result = callHandleMessage(context, 0, handlers.size() - 1);
+            } else {
+                result = callHandleMessage(context, handlers.size() - 1, 0);
+            }
+        } catch (ProtocolException pe) {
+            logger.log(Level.FINER, "exception in handler chain", pe);
+            if (responseExpected) {
+                //insert fault message if its not a fault message
+                insertFaultMessage(context, pe);
+                // reverse direction
+                reverseDirection(direction, context);
+                //Set handleFault so that cousinTube is aware of fault
+                setHandleFaultProperty();
+                // call handle fault
+                if (direction == Direction.OUTBOUND) {
+                    callHandleFault(context, getIndex() - 1, 0);
+                } else {
+                    callHandleFault(context, getIndex() + 1, handlers.size() - 1);
+                }
+                return false;
+            }
+            throw pe;
+        } catch (RuntimeException re) {
+            logger.log(Level.FINER, "exception in handler chain", re);
+            throw re;
+        }
+
+        if (!result) {
+            if (responseExpected) {
+                // reverse direction
+                reverseDirection(direction, context);
+                // call handle message
+                if (direction == Direction.OUTBOUND) {
+                    callHandleMessageReverse(context, getIndex() - 1, 0);
+                } else {
+                    callHandleMessageReverse(context, getIndex() + 1, handlers.size() - 1);
+                }
+            } else {
+                // Set handleFalse so that cousinTube is aware of false processing
+                // Oneway, dispatch the message
+                // cousinTube should n't call handleMessage() anymore.
+                setHandleFalseProperty();
+            }
+            return false;
+        }
+
+        return result;
+    }
+
+
+    /**
+     * TODO: Just putting thoughts,
+     * Current contract: This is Called during Response Processing.
+     * Runs all handlers until handle returns false or throws a RuntimeException
+     * CurrentPipe should close all the handlers in the chain.
+     * throw RuntimeException, this happens when a RuntimeException occurs during
+     * normal Response processing or remedy action 2) taken
+     * during callHandlersRequest().
+     * CurrentPipe should close all the handlers in the chain.     *
+     */
+    public void callHandlersResponse(Direction direction,
+                                     C context, boolean isFault) {
+        setDirection(direction, context);
+        try {
+            if (isFault) {
+                // call handleFault on handlers
+                if (direction == Direction.OUTBOUND) {
+                    callHandleFault(context, 0, handlers.size() - 1);
+                } else {
+                    callHandleFault(context, handlers.size() - 1, 0);
+                }
+            } else {
+                // call handleMessage on handlers
+                if (direction == Direction.OUTBOUND) {
+                    callHandleMessageReverse(context, 0, handlers.size() - 1);
+                } else {
+                    callHandleMessageReverse(context, handlers.size() - 1, 0);
+                }
+            }
+        } catch (RuntimeException re) {
+            logger.log(Level.FINER, "exception in handler chain", re);
+            throw re;
+        }
+    }
+
+
+    /**
+     * Reverses the Message Direction.
+     * MessageContext.MESSAGE_OUTBOUND_PROPERTY is changed.
+     */
+    private void reverseDirection(Direction origDirection, C context) {
+        if (origDirection == Direction.OUTBOUND) {
+            context.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
+        } else {
+            context.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, true);
+        }
+    }
+
+    /**
+     * Sets the Message Direction.
+     * MessageContext.MESSAGE_OUTBOUND_PROPERTY is changed.
+     */
+    private void setDirection(Direction direction, C context) {
+        if (direction == Direction.OUTBOUND) {
+            context.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, true);
+        } else {
+            context.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, false);
+        }
+    }
+
+    /**
+     * When this property is set HandlerPipes can call handleFault() on the
+     * message
+     */
+    private void setHandleFaultProperty() {
+        owner.setHandleFault();
+    }
+
+    /**
+     * When this property is set HandlerPipes will not call
+     * handleMessage() during Response processing.
+     */
+    private void setHandleFalseProperty() {
+        owner.setHandleFalse();
+    }
+
+    /**
+     * When a ProtocolException is thrown, this is called.
+     * If it's XML/HTTP Binding, clear the the message
+     * If its SOAP/HTTP Binding, put right SOAP Fault version
+     */
+    abstract void insertFaultMessage(C context,
+                                     ProtocolException exception);
+
+    /*
+    * Calls handleMessage on the handlers. Indices are
+    * inclusive. Exceptions get passed up the chain, and an
+    * exception or return of 'false' ends processing.
+    */
+    private boolean callHandleMessage(C context, int start, int end) {
+        /* Do we need this check?
+        if (handlers.isEmpty() ||
+                start == -1 ||
+                start == handlers.size()) {
+            return false;
+        }
+         */
+        int i = start;
+        try {
+            if (start > end) {
+                while (i >= end) {
+                    if (!handlers.get(i).handleMessage(context)) {
+                        setIndex(i);
+                        return false;
+                    }
+                    i--;
+                }
+            } else {
+                while (i <= end) {
+                    if (!handlers.get(i).handleMessage(context)) {
+                        setIndex(i);
+                        return false;
+                    }
+                    i++;
+                }
+            }
+        } catch (RuntimeException e) {
+            setIndex(i);
+            throw e;
+        }
+        return true;
+    }
+
+    /*
+    * Calls handleMessage on the handlers. Indices are
+    * inclusive. Exceptions get passed up the chain, and an
+    * exception (or)
+    * return of 'false' calls addHandleFalseProperty(context) and
+    * ends processing.
+    * setIndex() is not called.
+    *
+    */
+    private boolean callHandleMessageReverse(C context, int start, int end) {
+
+        if (handlers.isEmpty() ||
+                start == -1 ||
+                start == handlers.size()) {
+            return false;
+        }
+
+        int i = start;
+
+        if (start > end) {
+            while (i >= end) {
+                if (!handlers.get(i).handleMessage(context)) {
+                    // Set handleFalse so that cousinTube is aware of false processing
+                    setHandleFalseProperty();
+                    return false;
+                }
+                i--;
+            }
+        } else {
+            while (i <= end) {
+                if (!handlers.get(i).handleMessage(context)) {
+                    // Set handleFalse so that cousinTube is aware of false processing
+                    setHandleFalseProperty();
+                    return false;
+                }
+                i++;
+            }
+        }
+        return true;
+    }
+
+    /*
+    * Calls handleFault on the handlers. Indices are
+    * inclusive. Exceptions get passed up the chain, and an
+    * exception or return of 'false' ends processing.
+    */
+
+    private boolean callHandleFault(C context, int start, int end) {
+
+        if (handlers.isEmpty() ||
+                start == -1 ||
+                start == handlers.size()) {
+            return false;
+        }
+
+        int i = start;
+        if (start > end) {
+            try {
+                while (i >= end) {
+                    if (!handlers.get(i).handleFault(context)) {
+                        return false;
+                    }
+                    i--;
+                }
+            } catch (RuntimeException re) {
+                logger.log(Level.FINER,
+                        "exception in handler chain", re);
+                throw re;
+            }
+        } else {
+            try {
+                while (i <= end) {
+                    if (!handlers.get(i).handleFault(context)) {
+                        return false;
+                    }
+                    i++;
+                }
+            } catch (RuntimeException re) {
+                logger.log(Level.FINER,
+                        "exception in handler chain", re);
+                throw re;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Calls close on the handlers from the starting
+     * index through the ending index (inclusive). Made indices
+     * inclusive to allow both directions more easily.
+     */
+    void closeHandlers(MessageContext context, int start, int end) {
+        if (handlers.isEmpty() ||
+                start == -1) {
+            return;
+        }
+        if (start > end) {
+            for (int i = start; i >= end; i--) {
+                try {
+                    handlers.get(i).close(context);
+                } catch (RuntimeException re) {
+                    logger.log(Level.INFO,
+                            "Exception ignored during close", re);
+                }
+            }
+        } else {
+            for (int i = start; i <= end; i++) {
+                try {
+                    handlers.get(i).close(context);
+                } catch (RuntimeException re) {
+                    logger.log(Level.INFO,
+                            "Exception ignored during close", re);
+                }
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerResolverImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerResolverImpl.java
deleted file mode 100644
index ed9e253..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerResolverImpl.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import com.sun.xml.internal.ws.client.ServiceContext;
-import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
-import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.handler.PortInfo;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * <p>Implementation class of HandlerResolver. This class is a simple
- * map of PortInfo objects to handler chains. It is used by a
- * {@link com.sun.xml.internal.ws.client.ServiceContext} object, and can
- * be replaced by user code with a different class implementing
- * HandlerResolver. This class is only used on the client side, and
- * it includes a lot of logging to help when there are issues since
- * it deals with port names, service names, and bindings. All three
- * must match when getting a handler chain from the map.
- *
- * <p>It is created by the {@link com.sun.xml.internal.ws.client.ServiceContextBuilder}
- * class and set on the ServiceContext. The ServiceContextBuilder uses
- * the {@link com.sun.xml.internal.ws.util.HandlerAnnotationProcessor} to create
- * a handler chain and then it sets the chains on this class and they
- * are put into the map. The ServiceContext uses the map to set handler
- * chains on bindings when they are created.
- *
- * @see com.sun.xml.internal.ws.client.ServiceContext
- * @see com.sun.xml.internal.ws.handler.PortInfoImpl
- *
- * @author WS Development Team
- */
-public class HandlerResolverImpl implements HandlerResolver {
-    private HandlerChainsModel handlerModel;
-    private Map<PortInfo, List<Handler>> chainMap;
-    private ServiceContext serviceContext;
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".handler");
-
-    public HandlerResolverImpl(ServiceContext serviceContext) {
-        this.serviceContext = serviceContext;
-        handlerModel = HandlerAnnotationProcessor.buildHandlerChainsModel(serviceContext.getServiceClass());
-        chainMap = new HashMap<PortInfo, List<Handler>>();
-    }
-
-    /**
-     * API method to return the correct handler chain for a given
-     * PortInfo class.
-     *
-     * @param info A PortInfo object.
-     * @return A list of handler objects. If there is no handler chain
-     * found, it will return an empty list rather than null.
-     */
-    public List<Handler> getHandlerChain(PortInfo info) {
-        //Check in cache first
-        List<Handler> chain = chainMap.get(info);
-
-        if(chain != null)
-            return chain;
-        if(handlerModel != null) {
-            HandlerAnnotationInfo chainInfo = handlerModel.getHandlersForPortInfo(info);
-            if(chainInfo != null) {
-                chain = chainInfo.getHandlers();
-                serviceContext.setRoles(info.getPortName(),chainInfo.getRoles());
-            }
-        }
-        if (chain == null) {
-            if (logger.isLoggable(Level.FINE)) {
-                logGetChain(info);
-            }
-            chain = new ArrayList<Handler>();
-        }
-        // Put it in cache
-        chainMap.put(info,chain);
-        return chain;
-    }
-
-    // logged at fine level
-    private void logGetChain(PortInfo info) {
-        logger.fine("No handler chain found for port info:");
-        logPortInfo(info, Level.FINE);
-        logger.fine("Existing handler chains:");
-        if (chainMap.isEmpty()) {
-            logger.fine("none");
-        } else {
-            for (PortInfo key : chainMap.keySet()) {
-                logger.fine(chainMap.get(key).size() +
-                    " handlers for port info ");
-                logPortInfo(key, Level.FINE);
-            }
-        }
-    }
-
-    private void logPortInfo(PortInfo info, Level level) {
-        logger.log(level, "binding: " + info.getBindingID() +
-            "\nservice: " + info.getServiceName() +
-            "\nport: " + info.getPortName());
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerTube.java
new file mode 100644
index 0000000..1cc19e7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerTube.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.*;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * @author WS Development team
+ */
+
+public abstract class HandlerTube extends AbstractFilterTubeImpl {
+
+    /**
+     * handle hold reference to other Tube for inter-tube communication
+     */
+    HandlerTube cousinTube;
+    HandlerProcessor processor;
+    boolean remedyActionTaken = false;
+    private final @Nullable WSDLPort port;
+    // flag used to decide whether to call close on cousinTube
+    boolean requestProcessingSucessful = false;
+
+    // TODO: For closing in Exceptions this is needed
+    // This is used for creating MessageContext in #close
+    Packet packet;
+
+    public HandlerTube(Tube next, WSDLPort port) {
+        super(next);
+        this.port = port;
+    }
+
+    public HandlerTube(Tube next, HandlerTube cousinTube) {
+        super(next);
+        this.cousinTube = cousinTube;
+        if(cousinTube != null) {
+            this.port = cousinTube.port;
+        } else {
+            this.port = null;
+        }
+    }
+
+    /**
+     * Copy constructor for {@link Tube#copy(TubeCloner)}.
+     */
+    protected HandlerTube(HandlerTube that, TubeCloner cloner) {
+        super(that,cloner);
+        if(that.cousinTube != null) {
+            this.cousinTube = cloner.copy(that.cousinTube);
+        }
+        this.port = that.port;
+    }
+
+    @Override
+    public NextAction processRequest(Packet request) {
+        this.packet = request;
+        setupExchange();
+        // This check is done to cover handler returning false in Oneway request
+        if (isHandleFalse()) {
+            // Cousin HandlerTube returned false during Oneway Request processing.
+            // Don't call handlers and dispatch the message.
+            remedyActionTaken = true;
+            return doInvoke(super.next, packet);
+        }
+
+        // This is done here instead of the constructor, since User can change
+        // the roles and handlerchain after a stub/proxy is created.
+        setUpProcessor();
+
+        MessageUpdatableContext context = getContext(packet);
+        boolean isOneWay = checkOneWay(packet);
+        try {
+            if (!isHandlerChainEmpty()) {
+                // Call handlers on Request
+                boolean handlerResult = callHandlersOnRequest(context, isOneWay);
+                //Update Packet with user modifications
+                context.updatePacket();
+                // two-way case where no message is sent
+                if (!isOneWay && !handlerResult) {
+                    return doReturnWith(packet);
+                }
+            }
+            requestProcessingSucessful = true;
+            // Call next Tube
+            return doInvoke(super.next, packet);
+        } catch (RuntimeException re) {
+            if(isOneWay) {
+                //Eat the exception, its already logged and close the transportBackChannel
+                if(packet.transportBackChannel != null ) {
+                    packet.transportBackChannel.close();
+                }
+                packet.setMessage(null);
+                return doReturnWith(packet);
+            } else
+                throw re;
+        } finally {
+            if(!requestProcessingSucessful) {
+                cleanUpState(context.getMessageContext());
+            }
+        }
+
+    }
+
+    @Override
+    public NextAction processResponse(Packet response) {
+        this.packet = response;
+        MessageUpdatableContext context = getContext(packet);
+        try {
+            if (isHandleFalse() || (packet.getMessage() == null)) {
+                // Cousin HandlerTube returned false during Response processing.
+                // or it is oneway request
+                // or handler chain is empty
+                // Don't call handlers.
+                return doReturnWith(packet);
+            }
+            boolean isFault = isHandleFault(packet);
+            if (!isHandlerChainEmpty()) {
+                // Call handlers on Response
+                callHandlersOnResponse(context, isFault);
+            }
+        } finally {
+            cleanUpState(context.getMessageContext());
+        }
+        //Update Packet with user modifications
+        context.updatePacket();
+
+        return doReturnWith(packet);
+
+    }
+
+    @Override
+    public NextAction processException(Throwable t) {
+        try {
+            return doThrow(t);
+        } finally {
+            MessageUpdatableContext context = getContext(packet);
+            cleanUpState(context.getMessageContext());
+            /* TODO revisit: commented this out as the modified packet is no longer used
+                    In future if the message is propagated even when an exception
+                    occurs, then uncomment context.updatePacket();
+            */
+            //Update Packet with user modifications
+            //context.updatePacket();
+
+
+        }
+    }
+
+    /**
+     * Calls close on previously invoked handlers.
+     * Also, Cleans up any state left over in the Tube instance from the current
+     * invocation, as Tube instances can be reused after the completion of MEP.
+     *
+     */
+    private void cleanUpState(MessageContext mc) {
+        close(mc);
+        // Clean up the exchange for next invocation.
+        exchange = null;
+        requestProcessingSucessful = false;
+    }
+
+    abstract void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault);
+
+    abstract boolean callHandlersOnRequest(MessageUpdatableContext context, boolean oneWay);
+
+    private boolean checkOneWay(Packet packet) {
+        if (port != null) {
+            /* we can determine this value from WSDL */
+            return packet.getMessage().isOneWay(port);
+        } else {
+            /*
+              otherwise use this value as an approximation, since this carries
+              the appliation's intention --- whether it was invokeOneway vs invoke,etc.
+             */
+            return (packet.expectReply != null && packet.expectReply);
+        }
+    }
+
+    abstract void setUpProcessor();
+    abstract boolean isHandlerChainEmpty();
+    abstract MessageUpdatableContext getContext(Packet p);
+
+    /**
+     * Close SOAPHandlers first and then LogicalHandlers on Client
+     * Close LogicalHandlers first and then SOAPHandlers on Server
+     */
+    protected abstract void close(MessageContext msgContext);
+
+    /**
+     * This is called from cousinTube.
+     * Close this Tube's handlers.
+     */
+    protected abstract void closeCall(MessageContext msgContext);
+
+    private boolean isHandleFault(Packet packet) {
+        if (cousinTube != null) {
+            return exchange.isHandleFault();
+        } else {
+            boolean isFault = packet.getMessage().isFault();
+            exchange.setHandleFault(isFault);
+            return isFault;
+        }
+    }
+
+    final void setHandleFault() {
+        exchange.setHandleFault(true);
+    }
+
+    private boolean isHandleFalse() {
+        return exchange.isHandleFalse();
+    }
+
+    final void setHandleFalse() {
+        exchange.setHandleFalse();
+    }
+
+    private void setupExchange() {
+        if(exchange == null) {
+            exchange = new HandlerTubeExchange();
+            if(cousinTube != null) {
+                cousinTube.exchange = exchange;
+            }
+        }
+    }
+    private HandlerTubeExchange exchange;
+
+    /**
+     * This class is used primarily to exchange information or status between
+     * LogicalHandlerTube and SOAPHandlerTube
+     */
+    static final class HandlerTubeExchange {
+        private boolean handleFalse;
+        private boolean handleFault;
+
+        boolean isHandleFault() {
+            return handleFault;
+        }
+
+        void setHandleFault(boolean isFault) {
+            this.handleFault = isFault;
+        }
+
+        public boolean isHandleFalse() {
+            return handleFalse;
+        }
+
+        void setHandleFalse() {
+            this.handleFalse = true;
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java
index fba7539..b1c86db 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,102 +24,71 @@
  */
 package com.sun.xml.internal.ws.handler;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.message.EmptyMessageImpl;
+import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+import javax.xml.transform.Source;
 
 import javax.xml.ws.LogicalMessage;
 import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-import javax.xml.ws.handler.MessageContext;
 
 /**
  * Implementation of LogicalMessageContext. This class is used at runtime
  * to pass to the handlers for processing logical messages.
  *
- * <p>Class has to defer information to HandlerContext so that properties
- * are shared between this and SOAPMessageContext.
+ * <p>This Class delegates most of the fuctionality to Packet
  *
- * @see MessageContextImpl
+ * @see Packet
  *
  * @author WS Development Team
  */
-public class LogicalMessageContextImpl implements LogicalMessageContext {
+class LogicalMessageContextImpl extends MessageUpdatableContext implements LogicalMessageContext {
+    private LogicalMessageImpl lm;
+    private WSBinding binding;
 
-    SOAPHandlerContext handlerCtxt;
-    MessageContext ctxt;
-
-    public LogicalMessageContextImpl(SOAPHandlerContext handlerCtxt) {
-        this.handlerCtxt = handlerCtxt;
-        ctxt = handlerCtxt.getMessageContext();
-    }
-
-    public HandlerContext getHandlerContext() {
-        return handlerCtxt;
+    public LogicalMessageContextImpl(WSBinding binding, Packet packet) {
+        super(packet);
+        this.binding = binding;
     }
 
     public LogicalMessage getMessage() {
-        return new LogicalMessageImpl(handlerCtxt);
+        if(lm == null)
+            lm = new LogicalMessageImpl(packet);
+        return lm;
     }
 
-    public void setScope(String name, Scope scope) {
-        ctxt.setScope(name, scope);
+    void setPacketMessage(Message newMessage){
+        if(newMessage != null) {
+            packet.setMessage(newMessage);
+            lm = null;
+        }
     }
 
-    public Scope getScope(String name) {
-        return ctxt.getScope(name);
-    }
 
-    /* java.util.Map methods below here */
+    protected void updateMessage() {
+        //If LogicalMessage is not acccessed, its not modified.
+        if(lm != null) {
+            //Check if LogicalMessageImpl has changed, if so construct new one
+            //TODO: Attachments are not used
+            // Packet are handled through MessageContext
+            if(lm.isPayloadModifed()){
+                Message msg = packet.getMessage();
+                HeaderList headers = msg.getHeaders();
+                AttachmentSet attachments = msg.getAttachments();
+                Source modifiedPayload = lm.getModifiedPayload();
+                if(modifiedPayload == null){
+                    packet.setMessage(new EmptyMessageImpl(headers,attachments,binding.getSOAPVersion()));
+                } else {
+                    packet.setMessage(new PayloadSourceMessage(headers,modifiedPayload, attachments, binding.getSOAPVersion()));
+                }
+            }
+            lm = null;
+        }
 
-    public void clear() {
-        ctxt.clear();
-    }
-
-    public boolean containsKey(Object obj) {
-        return ctxt.containsKey(obj);
-    }
-
-    public boolean containsValue(Object obj) {
-        return ctxt.containsValue(obj);
-    }
-
-    public Set<Entry<String, Object>> entrySet() {
-        return ctxt.entrySet();
-    }
-
-    public Object get(Object obj) {
-        return ctxt.get(obj);
-    }
-
-    public boolean isEmpty() {
-        return ctxt.isEmpty();
-    }
-
-    public Set<String> keySet() {
-        return ctxt.keySet();
-    }
-
-    public Object put(String str, Object obj) {
-        return ctxt.put(str, obj);
-    }
-
-    public void putAll(Map<? extends String, ? extends Object> map) {
-        ctxt.putAll(map);
-    }
-
-    public Object remove(Object obj) {
-        return ctxt.remove(obj);
-    }
-
-    public int size() {
-        return ctxt.size();
-    }
-
-    public Collection<Object> values() {
-        return ctxt.values();
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java
index 8f412de..0ff3747 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,26 +22,17 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.ws.handler;
 
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.Message;
 import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import java.util.Iterator;
-import javax.xml.soap.SOAPElement;
-import org.w3c.dom.Node;
 
 import javax.xml.bind.JAXBContext;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerException;
@@ -51,159 +42,141 @@
 import javax.xml.ws.WebServiceException;
 
 /**
- * Implementation of LogicalMessage. This class implements the methods
+ * Implementation of {@link LogicalMessage}. This class implements the methods
  * used by LogicalHandlers to get/set the request or response either
  * as a JAXB object or as javax.xml.transform.Source.
  *
- * <p>The {@link HandlerContext} that is passed into the constructor
+ * <p>The {@link Message} that is passed into the constructor
  * is used to retrieve the payload of the request or response.
  *
- * @see HandlerContext
+ * @see Message
  * @see LogicalMessageContextImpl
  *
  * @author WS Development Team
  */
-public class LogicalMessageImpl implements LogicalMessage {
+/**
+* TODO: Take care of variations in behavior wrt to vaious sources.
+* DOMSource : changes made should be reflected, StreamSource or SAXSource, Give copy
+*/
+class LogicalMessageImpl implements LogicalMessage {
+    private Packet packet;
+    // This holds the (modified)payload set by User
+    private Source payloadSrc = null;
+    // Flag to check if the PayloadSrc is accessed/modified
+    private boolean payloadModifed = false;
 
-    private SOAPHandlerContext ctxt;
-
-    public LogicalMessageImpl(SOAPHandlerContext ctxt) {
-        this.ctxt = ctxt;
+    /** Creates a new instance of LogicalMessageImplRearch */
+    public LogicalMessageImpl(Packet packet) {
+        // don't create extract payload until Users wants it.
+        this.packet = packet;
     }
 
-    /*
-     * If the payload is DOMSource, return it
-     * If the payload is Source/SOAPFaultInfo/JAXBBridgeInfo/JAXBBeanInfo,
-     * convert to DOMSource and return it. DOMSource is also stored in BodyBlock
-     */
+    boolean isPayloadModifed(){
+        return payloadModifed;
+    }
+    Source getModifiedPayload(){
+        if(!payloadModifed)
+            throw new RuntimeException("Payload not modified.");
+        return payloadSrc;
+
+    }
     public Source getPayload() {
-        try {
-            InternalMessage internalMessage = ctxt.getInternalMessage();
-            if (internalMessage == null) {
-                SOAPMessage soapMessage = ctxt.getSOAPMessage();
-                if (soapMessage == null) {
-                    return null;
-                } else {
-                    Iterator it = soapMessage.getSOAPBody().getChildElements();
-                    SOAPElement elem = null;
-                    while(it.hasNext()) {
-                        Node child = (Node)it.next();
-                        if (child instanceof SOAPElement) {
-                            elem = (SOAPElement)child;
-                            break;
-                        }
-                    }
-                    if (elem != null) {
-                        setSource(new DOMSource(elem));
-                    } else {
-                        return null;
-                    }
-                }
-            }
-            internalMessage = ctxt.getInternalMessage();
-            BodyBlock bodyBlock = internalMessage.getBody();
-            if (bodyBlock == null) {
-                return null;
-            } else {
-                Object obj = bodyBlock.getValue();
-                if (obj instanceof DOMSource) {
-                    return (Source)obj;
-                } else if (obj instanceof Source) {
-                    Source source = (Source)obj;
-                    Transformer transformer = XmlUtil.newTransformer();
-                    DOMResult domResult = new DOMResult();
-                    transformer.transform(source, domResult);
-                    DOMSource domSource = new DOMSource(domResult.getNode());
-                    bodyBlock.setSource(domSource);
-                    return domSource;
-                } else if (obj instanceof JAXBBridgeInfo) {
-                    MessageInfo messageInfo = ctxt.getMessageInfo();
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPEncoder encoder = eptf.getSOAPEncoder();
-                    DOMSource domSource = encoder.toDOMSource((JAXBBridgeInfo)obj, messageInfo);
-                    bodyBlock.setSource(domSource);
-                    return domSource;
-                } else if (obj instanceof JAXBBeanInfo) {
-                    DOMSource domSource = ((JAXBBeanInfo)obj).toDOMSource();
-                    bodyBlock.setSource(domSource);
-                    return domSource;
-                } else if (obj instanceof RpcLitPayload) {
-                    MessageInfo messageInfo = ctxt.getMessageInfo();
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPEncoder encoder = eptf.getSOAPEncoder();
-                    DOMSource domSource = encoder.toDOMSource((RpcLitPayload)obj, messageInfo);
-                    bodyBlock.setSource(domSource);
-                    return domSource;
-                } else if (obj instanceof SOAPFaultInfo) {
-                    MessageInfo messageInfo = ctxt.getMessageInfo();
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPEncoder encoder = eptf.getSOAPEncoder();
-                    DOMSource domSource = encoder.toDOMSource((SOAPFaultInfo)obj, messageInfo);
-                    bodyBlock.setSource(domSource);
-                    return domSource;
-                } else {
-                    throw new WebServiceException("Unknown type "+obj.getClass()+" in BodyBlock");
-                }
-            }
-        } catch(TransformerException te) {
-            throw new WebServiceException(te);
-        } catch(SOAPException se) {
-            throw new WebServiceException(se);
+        if(!payloadModifed) {
+            payloadSrc = packet.getMessage().readPayloadAsSource();
+            payloadModifed = true;
         }
+        if (payloadSrc == null)
+            return null;
+        if(payloadSrc instanceof DOMSource){
+            return payloadSrc;
+        } else {
+            try {
+            Transformer transformer = XmlUtil.newTransformer();
+            DOMResult domResult = new DOMResult();
+            transformer.transform(payloadSrc, domResult);
+            payloadSrc = new DOMSource(domResult.getNode());
+            return payloadSrc;
+            } catch(TransformerException te) {
+                throw new WebServiceException(te);
+            }
+        }
+        /*
+        Source copySrc;
+        if(payloadSrc instanceof DOMSource){
+            copySrc = payloadSrc;
+        } else {
+            copySrc = copy(payloadSrc);
+        }
+        return copySrc;
+         */
     }
 
-    /*
-     * Sets the Source as payload in the BodyBlock of InternalMessage.
-     */
-    public void setPayload(Source source) {
-        setSource(source);
+    public void setPayload(Source payload) {
+        payloadModifed = true;
+        payloadSrc = payload;
     }
-
     /*
-     * Converts to DOMSource and keeps it in BodyBlock. Then it unmarshalls this
-     * DOMSource to a jaxb object. Any changes done in jaxb object are lost if
+     * Converts to DOMSource and then it unmarshalls this  DOMSource
+     * to a jaxb object. Any changes done in jaxb object are lost if
      * the object isn't set again.
      */
-    public Object getPayload(JAXBContext jaxbContext) {
-        return JAXBTypeSerializer.deserialize(getPayload(), jaxbContext);
-    }
-
-    /*
-     * The object is marshalled into DOMSource and stored in BodyBlock. If an
-     * error occurs when using the supplied JAXBContext to marshall the
-     * payload, it throws a JAXWSException.
-     */
-    public void setPayload(Object bean, JAXBContext jaxbContext) {
-        Source source;
+    public Object getPayload(JAXBContext context) {
         try {
-            source = JAXBTypeSerializer.serialize(bean,jaxbContext);
-        } catch(Exception e) {
+            Source payloadSrc = getPayload();
+            if(payloadSrc == null)
+                return null;
+            Unmarshaller unmarshaller = context.createUnmarshaller();
+            return unmarshaller.unmarshal(payloadSrc);
+        } catch (JAXBException e){
             throw new WebServiceException(e);
         }
-        setSource(source);              // set Source in BodyBlock
     }
 
-    public HandlerContext getHandlerContext() {
-        return ctxt;
+    public void setPayload(Object payload, JAXBContext context) {
+        payloadModifed = true;
+        try {
+            Marshaller marshaller = context.createMarshaller();
+            marshaller.setProperty("jaxb.fragment", true);
+            DOMResult domResult = new DOMResult();
+            marshaller.marshal(payload, domResult);
+            payloadSrc = new DOMSource(domResult.getNode());
+        } catch(JAXBException e) {
+            throw new WebServiceException(e);
+        }
     }
-
     /*
-     * It stores Source in the BodyBlock. If necessary, it creates
-     * InternalMessage, and BodyBlock
-     */
-    private void setSource(Source source) {
-        InternalMessage internalMessage = ctxt.getInternalMessage();
-        if (internalMessage == null) {
-            internalMessage = new InternalMessage();
-            ctxt.setInternalMessage(internalMessage);
+    private Source copy(Source src) {
+        if(src instanceof StreamSource){
+            StreamSource origSrc = (StreamSource)src;
+            byte[] payloadbytes;
+            try {
+                payloadbytes = ASCIIUtility.getBytes(origSrc.getInputStream());
+            } catch (IOException e) {
+                throw new WebServiceException(e);
+            }
+            ByteArrayInputStream bis = new ByteArrayInputStream(payloadbytes);
+            origSrc.setInputStream(new ByteArrayInputStream(payloadbytes));
+            StreamSource copySource = new StreamSource(bis, src.getSystemId());
+            return copySource;
+        } else if(src instanceof SAXSource){
+            SAXSource saxSrc = (SAXSource)src;
+            try {
+                XMLStreamBuffer xsb = new XMLStreamBuffer();
+                XMLReader reader = saxSrc.getXMLReader();
+                if(reader == null)
+                    reader = new SAXBufferProcessor();
+                saxSrc.setXMLReader(reader);
+                reader.setContentHandler(new SAXBufferCreator(xsb));
+                reader.parse(saxSrc.getInputSource());
+                src = new XMLStreamBufferSource(xsb);
+                return new XMLStreamBufferSource(xsb);
+            } catch (IOException e) {
+                throw new WebServiceException(e);
+            } catch (SAXException e) {
+                throw new WebServiceException(e);
+            }
         }
-        BodyBlock bodyBlock = internalMessage.getBody();
-        if (bodyBlock == null) {
-            bodyBlock = new BodyBlock(source);
-            internalMessage.setBody(bodyBlock);
-        } else {
-            bodyBlock.setSource(source);
-        }
+        throw new WebServiceException("Copy is not needed for this Source");
     }
-
+     */
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java
index 10006c9..7e7f266 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,44 +22,200 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+
 package com.sun.xml.internal.ws.handler;
 
-import java.util.HashMap;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.util.ReadOnlyPropertyException;
 
+import javax.activation.DataHandler;
 import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
 /**
- * Implementation of MessageContext. This class holds properties as
- * well as keeping track of their scope.
  *
  * @author WS Development Team
  */
-public class MessageContextImpl extends HashMap<String, Object>
-    implements MessageContext {
 
-    private HashMap<String, Scope> propertyScopes =
-        new HashMap<String, Scope>();
+class MessageContextImpl implements MessageContext {
+    private Map<String,Object> fallbackMap = null;
+    private Set<String> handlerScopeProps;
+    Packet packet;
 
 
+    void fallback() {
+        if(fallbackMap == null) {
+            fallbackMap = new HashMap<String,Object>();
+            fallbackMap.putAll(packet.createMapView());
+            fallbackMap.putAll(packet.invocationProperties);
+        }
+    }
+    /** Creates a new instance of MessageContextImpl */
+    public MessageContextImpl(Packet packet) {
+        this.packet = packet;
+        handlerScopeProps =  packet.getHandlerScopePropertyNames(false);
+    }
+    protected void updatePacket() {
+        throw new UnsupportedOperationException("wrong call");
+    }
+
     public void setScope(String name, Scope scope) {
-        if (!this.containsKey(name)) {
-            throw new IllegalArgumentException("Illegal use of setScope() on " +
-                    "non-existant property :"+ name);
+        if(!containsKey(name))
+            throw new IllegalArgumentException("Property " + name + " does not exist.");
+        if(scope == Scope.APPLICATION) {
+            handlerScopeProps.remove(name);
+        } else {
+            handlerScopeProps.add(name);
+
         }
-        propertyScopes.put(name, scope);
     }
 
     public Scope getScope(String name) {
-        if (!this.containsKey(name)) {
-            throw new IllegalArgumentException("Illegal use of getScope() on " +
-                    "non-existant property :"+ name);
+        if(!containsKey(name))
+            throw new IllegalArgumentException("Property " + name + " does not exist.");
+        if(handlerScopeProps.contains(name)) {
+            return Scope.HANDLER;
+        } else {
+            return Scope.APPLICATION;
         }
-        Scope scope = propertyScopes.get(name);
-        if (scope == null) {
-            scope = Scope.HANDLER; // the default
+    }
+
+    public int size() {
+        fallback();
+        return fallbackMap.size();
+    }
+
+    public boolean isEmpty() {
+        fallback();
+        return fallbackMap.isEmpty();
+    }
+
+    public boolean containsKey(Object key) {
+        if(fallbackMap == null) {
+            if(packet.supports(key))
+                return true;
+            return packet.invocationProperties.containsKey(key);
+        } else {
+            fallback();
+            return fallbackMap.containsKey(key);
         }
-        return scope;
+    }
+
+    public boolean containsValue(Object value) {
+        fallback();
+        return fallbackMap.containsValue(value);
+    }
+
+    public Object put(String key, Object value) {
+        if (fallbackMap == null) {
+            if (packet.supports(key)) {
+                return packet.put(key, value);     // strongly typed
+            }
+            if (!packet.invocationProperties.containsKey(key)) {
+                //New property, default to Scope.HANDLER
+                handlerScopeProps.add(key);
+            }
+            return packet.invocationProperties.put(key, value);
+
+        } else {
+            fallback();
+            if (!fallbackMap.containsKey(key)) {
+                //new property, default to Scope.HANDLER
+                handlerScopeProps.add(key);
+            }
+            return fallbackMap.put(key, value);
+        }
+    }
+    public Object get(Object key) {
+        if(key == null)
+            return null;
+        Object value;
+        if(fallbackMap == null) {
+            if (packet.supports(key)) {
+                value =  packet.get(key);    // strongly typed
+            } else {
+                value = packet.invocationProperties.get(key);
+            }
+        } else {
+            fallback();
+            value = fallbackMap.get(key);
+        }
+        //add the attachments from the Message to the corresponding attachment property
+        if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) ||
+            key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){
+            Map<String, DataHandler> atts = (Map<String, DataHandler>) value;
+            if(atts == null)
+                atts = new HashMap<String, DataHandler>();
+            AttachmentSet attSet = packet.getMessage().getAttachments();
+            for(Attachment att : attSet){
+                atts.put(att.getContentId(), att.asDataHandler());
+            }
+            return atts;
+        }
+        return value;
+    }
+
+    public void putAll(Map<? extends String, ? extends Object> t) {
+        fallback();
+        for(String key: t.keySet()) {
+            if(!fallbackMap.containsKey(key)) {
+                //new property, default to Scope.HANDLER
+                handlerScopeProps.add(key);
+            }
+        }
+        fallbackMap.putAll(t);
+    }
+
+    public void clear() {
+        fallback();
+        fallbackMap.clear();
+    }
+    public Object remove(Object key){
+        fallback();
+        handlerScopeProps.remove(key);
+        return fallbackMap.remove(key);
+    }
+    public Set<String> keySet() {
+        fallback();
+        return fallbackMap.keySet();
+    }
+    public Set<Map.Entry<String, Object>> entrySet(){
+        fallback();
+        return fallbackMap.entrySet();
+    }
+    public Collection<Object> values() {
+        fallback();
+        return fallbackMap.values();
+    }
+
+
+    /**
+     * Fill a {@link Packet} with values of this {@link MessageContext}.
+     */
+    void fill(Packet packet) {
+        if(fallbackMap != null) {
+            for (Entry<String, Object> entry : fallbackMap.entrySet()) {
+                String key = entry.getKey();
+                if (packet.supports(key)) {
+                    try {
+                        packet.put(key, entry.getValue());
+                    } catch (ReadOnlyPropertyException e) {
+                        // Nothing to do
+                    }
+                } else {
+                    packet.invocationProperties.put(key, entry.getValue());
+                }
+            }
+
+            //Remove properties which are removed by user.
+            packet.createMapView().keySet().retainAll(fallbackMap.keySet());
+            packet.invocationProperties.keySet().retainAll(fallbackMap.keySet());
+        }
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextUtil.java
deleted file mode 100644
index f19f0e4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageContextUtil.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.xml.internal.ws.developer.JAXWSProperties;
-import com.sun.xml.internal.ws.encoding.soap.internal.AttachmentBlock;
-import com.sun.xml.internal.ws.util.ByteArrayDataSource;
-
-import static com.sun.xml.internal.ws.handler.HandlerChainCaller.IGNORE_FAULT_PROPERTY;
-
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
-import javax.activation.DataHandler;
-
-
-/**
- * Utility to manipulate MessageContext properties
- *
- * @author WS Development Team
- */
-public class MessageContextUtil {
-
-    public static Integer getHttpStatusCode(MessageContext ctxt) {
-        return (Integer)ctxt.get(MessageContext.HTTP_RESPONSE_CODE);
-    }
-
-    public static void setHttpStatusCode(MessageContext ctxt, Integer code) {
-        ctxt.put(MessageContext.HTTP_RESPONSE_CODE, code);
-        ctxt.setScope(MessageContext.HTTP_RESPONSE_CODE, Scope.APPLICATION);
-    }
-
-    public static void setQueryString(MessageContext ctxt, String queryString) {
-        ctxt.put(MessageContext.QUERY_STRING, queryString);
-        ctxt.setScope(MessageContext.QUERY_STRING, Scope.APPLICATION);
-    }
-
-    public static void setPathInfo(MessageContext ctxt, String pathInfo) {
-        ctxt.put(MessageContext.PATH_INFO, pathInfo);
-        ctxt.setScope(MessageContext.PATH_INFO, Scope.APPLICATION);
-    }
-
-    public static void setHttpExchange(MessageContext ctxt, HttpExchange exch) {
-        ctxt.put(JAXWSProperties.HTTP_EXCHANGE, exch);
-        ctxt.setScope(JAXWSProperties.HTTP_EXCHANGE, Scope.APPLICATION);
-    }
-
-    public static HttpExchange getHttpExchange(MessageContext ctxt) {
-        return (HttpExchange)ctxt.get(JAXWSProperties.HTTP_EXCHANGE);
-    }
-
-    public static void setHttpRequestMethod(MessageContext ctxt, String method) {
-        ctxt.put(MessageContext.HTTP_REQUEST_METHOD, method);
-        ctxt.setScope(MessageContext.HTTP_REQUEST_METHOD, Scope.APPLICATION);
-    }
-
-    public static void setHttpRequestHeaders(MessageContext ctxt,
-            Map<String, List<String>> headers) {
-        ctxt.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
-        ctxt.setScope(MessageContext.HTTP_REQUEST_HEADERS, Scope.APPLICATION);
-    }
-
-    public static void setHttpResponseHeaders(MessageContext ctxt,
-            Map<String, List<String>> headers) {
-        ctxt.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
-        ctxt.setScope(MessageContext.HTTP_RESPONSE_HEADERS, Scope.APPLICATION);
-    }
-
-    public static Map<String, List<String>> getHttpResponseHeaders(MessageContext ctxt) {
-        return (Map<String, List<String>>)ctxt.get(MessageContext.HTTP_RESPONSE_HEADERS);
-    }
-
-    public static void setWsdlOperation(MessageContext ctxt, QName name) {
-        ctxt.put(MessageContext.WSDL_OPERATION, name);
-        ctxt.setScope(MessageContext.WSDL_OPERATION, Scope.APPLICATION);
-    }
-
-    private static Map<String, DataHandler> getMessageAttachments(MessageContext ctxt) {
-        String property = MessageContext.INBOUND_MESSAGE_ATTACHMENTS;
-        Boolean out = (Boolean)ctxt.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
-        if (out != null && out) {
-            property = MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS;
-        }
-
-        Object att = ctxt.get(property);
-        if(att == null){
-            Map<String, DataHandler> attMap = new HashMap<String, DataHandler>();
-            ctxt.put(property, attMap);
-            ctxt.setScope(property, Scope.APPLICATION);
-            return attMap;
-        }
-        return (Map<String, DataHandler>)att;
-    }
-
-    public static void copyInboundMessageAttachments(MessageContext ctxt, Iterator<AttachmentPart> attachments) throws SOAPException {
-        Map<String, DataHandler> attachMap = getMessageAttachments(ctxt);
-        while(attachments.hasNext()){
-            AttachmentPart ap = attachments.next();
-            DataHandler dh = new DataHandler(new ByteArrayDataSource(ap.getRawContentBytes(), ap.getContentType()));
-            attachMap.put(ap.getContentId(), dh);
-        }
-    }
-
-    public static void addMessageAttachment(MessageContext ctxt, String cid, DataHandler dh){
-        Map<String, DataHandler> attachMap = getMessageAttachments(ctxt);
-        attachMap.put(cid, dh);
-    }
-
-    /*
-     * See HandlerChainCaller for full details. When a ProtocolException
-     * is caught from the handler chain, this method is used to tell
-     * the runtime whether to use the fault in the current message or
-     * use the exception and create a new message.
-     */
-    public static boolean ignoreFaultInMessage(MessageContext context) {
-        if (context.get(IGNORE_FAULT_PROPERTY) == null) {
-            return false;
-        }
-        return (Boolean) context.get(IGNORE_FAULT_PROPERTY);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java
new file mode 100644
index 0000000..c1ea7ff
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * The class represents a MessageContext(Properties) and also allows the Message to be modified.
+ * This is extended by SOAPMessageContextImpl and LogicalMessageContextImpl.
+ *
+ * @author WS Development Team
+ */
+public abstract class MessageUpdatableContext implements MessageContext {
+    final Packet packet;
+    private MessageContextImpl ctxt;
+    /** Creates a new instance of MessageUpdatableContext */
+    public MessageUpdatableContext(Packet packet) {
+        ctxt = new MessageContextImpl(packet);
+        this.packet = packet;
+    }
+
+    /**
+     * Fill a {@link Packet} with values of this {@link MessageContext}.
+     */
+    private void fill(Packet packet) {
+        ctxt.fill(packet);
+    }
+    /**
+     * Updates Message in the packet with user modifications
+     */
+    abstract void updateMessage();
+
+    /**
+     * Updates Message in the packet with user modifications
+     * returns the new packet's message
+     */
+    Message getPacketMessage(){
+        updateMessage();
+        return packet.getMessage();
+    }
+
+    /**
+     * Sets Message in the packet
+     * Any user modifications done on previous Message are lost.
+     */
+    abstract void setPacketMessage(Message newMessage);
+
+    /**
+     * Updates the complete packet with user modfications to the message and
+     * properties cahnges in MessageContext
+     */
+    final void updatePacket() {
+        updateMessage();
+        fill(packet);
+    }
+
+    MessageContextImpl getMessageContext() {
+        return ctxt;
+    }
+
+    public void setScope(String name, Scope scope) {
+        ctxt.setScope(name, scope);
+    }
+
+    public Scope getScope(String name) {
+        return ctxt.getScope(name);
+    }
+
+    /* java.util.Map methods below here */
+
+    public void clear() {
+        ctxt.clear();
+    }
+
+    public boolean containsKey(Object obj) {
+        return ctxt.containsKey(obj);
+    }
+
+    public boolean containsValue(Object obj) {
+        return ctxt.containsValue(obj);
+    }
+
+    public Set<Entry<String, Object>> entrySet() {
+        return ctxt.entrySet();
+    }
+
+    public Object get(Object obj) {
+        return ctxt.get(obj);
+    }
+
+    public boolean isEmpty() {
+        return ctxt.isEmpty();
+    }
+
+    public Set<String> keySet() {
+        return ctxt.keySet();
+    }
+
+    public Object put(String str, Object obj) {
+        return ctxt.put(str, obj);
+    }
+
+    public void putAll(Map<? extends String, ? extends Object> map) {
+        ctxt.putAll(map);
+    }
+
+    public Object remove(Object obj) {
+        return ctxt.remove(obj);
+    }
+
+    public int size() {
+        return ctxt.size();
+    }
+
+    public Collection<Object> values() {
+        return ctxt.values();
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java
index eb4cbb7..4bf0422 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,9 @@
  */
 package com.sun.xml.internal.ws.handler;
 
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.handler.PortInfo;
 
@@ -34,21 +37,20 @@
  * is only used on the client side.
  *
  * <p>An instance is created by
- * {@link com.sun.xml.internal.ws.client.ServiceContextBuilder} when used to
+ * {@link WSServiceDelegate} when used to
  * place a handler chain into the HandlerResolver map. Another is
  * created later by
  * {@link com.sun.xml.internal.ws.client.WSServiceDelegate} to retrieve the
  * necessary handler chain to set on a binding instance.
  *
- * @see com.sun.xml.internal.ws.client.ServiceContextBuilder
- * @see com.sun.xml.internal.ws.client.WSServiceDelegate
- * @see HandlerResolverImpl
+ * @see WSServiceDelegate
+ * @see com.sun.xml.internal.ws.client.HandlerResolverImpl
  *
  * @author WS Development Team
  */
 public class PortInfoImpl implements PortInfo {
 
-    private String bindingId;
+    private BindingID bindingId;
     private QName portName;
     private QName serviceName;
 
@@ -60,7 +62,7 @@
      * @param portName The QName of the port.
      * @param serviceName The QName of the service.
      */
-    public PortInfoImpl(String bindingId, QName portName, QName serviceName) {
+    public PortInfoImpl(BindingID bindingId, QName portName, QName serviceName) {
         if (bindingId == null) {
             throw new RuntimeException("bindingId cannot be null");
         }
@@ -76,7 +78,7 @@
     }
 
     public String getBindingID() {
-        return bindingId;
+        return bindingId.toString();
     }
 
     public QName getPortName() {
@@ -100,7 +102,7 @@
     public boolean equals(Object obj) {
         if (obj instanceof PortInfo) {
             PortInfo info = (PortInfo) obj;
-            if (bindingId.equals(info.getBindingID()) &&
+            if (bindingId.toString().equals(info.getBindingID()) &&
                 portName.equals(info.getPortName()) &&
                 serviceName.equals(info.getServiceName())) {
                 return true;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SHDSOAPMessageContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SHDSOAPMessageContext.java
deleted file mode 100644
index 1d6a8f0..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SHDSOAPMessageContext.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-import java.util.List;
-import com.sun.xml.internal.ws.spi.runtime.MessageContext;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.spi.runtime.InternalSoapEncoder;
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-
-import java.lang.reflect.Method;
-
-/**
- * Implementation of SOAPMessageContext. This class is used at runtime
- * to pass to the handlers for processing soap messages.
- *
- * @see MessageContextImpl
- *
- * @author WS Development Team
- */
-public class SHDSOAPMessageContext extends SOAPMessageContextImpl implements com.sun.xml.internal.ws.spi.runtime.SOAPMessageContext {
-
-    SOAPHandlerContext handlerCtxt;
-
-    public SHDSOAPMessageContext(SOAPHandlerContext handlerCtxt) {
-        super(handlerCtxt);
-        this.handlerCtxt = handlerCtxt;
-    }
-
-    /**
-     * If there is a SOAPMessage already, use getSOAPMessage(). Ignore all other
-     * methods
-     */
-    public boolean isAlreadySoap() {
-        return handlerCtxt.getSOAPMessage() != null;
-    }
-
-    /*
-     * Returns InternalMessage's BodyBlock value
-     */
-    public Object getBody() {
-        return handlerCtxt.getBody();
-    }
-
-    /*
-     * Returns InternalMessage's HeaderBlock values
-     */
-    public List getHeaders() {
-        return handlerCtxt.getHeaders();
-    }
-
-    /*
-     * Use this MessageInfo to pass to InternalSoapEncoder write methods
-     */
-    public Object getMessageInfo() {
-        return handlerCtxt.getMessageInfo();
-    }
-
-    /*
-     * Encoder to marshall all JAXWS objects: RpcLitPayload, JAXBBridgeInfo etc
-     */
-    public InternalSoapEncoder getEncoder() {
-        return (InternalSoapEncoder)((SOAPEPTFactory)handlerCtxt.getMessageInfo().getEPTFactory()).getSOAPEncoder();
-    }
-
-    public String getBindingId() {
-        return handlerCtxt.getBindingId();
-    }
-
-    public Method getMethod() {
-        return handlerCtxt.getMethod();
-    }
-
-    public void setCanonicalization(String algorithm) {
-        handlerCtxt.setCanonicalization(algorithm);
-    }
-
-    public Invoker getInvoker() {
-        return handlerCtxt.getInvoker();
-    }
-
-    /**
-     * Returns if MTOM is anbled
-     *
-     * @return true if MTOM is enabled otherwise returns false;
-     */
-    public boolean isMtomEnabled() {
-        JAXWSAttachmentMarshaller am = MessageInfoUtil.getAttachmentMarshaller(handlerCtxt.getMessageInfo());
-        return (am != null)?am.isXOPPackage():false;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerContext.java
deleted file mode 100644
index 123cd2d..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerContext.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.soap.SOAPMessage;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-/**
- * The HandlerContext is used in the client and server runtime
- * in {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher} and
- * {@link com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher} to hold
- * information about the current message.
- *
- * <p>It stores a {@link com.sun.xml.internal.ws.pept.ept.MessageInfo} and
- * {@link com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage}
- * which are used by the rest of the runtime, and provides a bridge
- * between these and the soap and logical message contexts that
- * are used by the handlers.
- *
- * @see LogicalMessageContextImpl
- * @see MessageContextImpl
- * @see SOAPMessageContextImpl
- *
- * @author WS Development Team
- */
-public class SOAPHandlerContext extends HandlerContext {
-
-    private SOAPMessage soapMessage;
-    private SOAPMessageContext soapContext;
-    private SHDSOAPMessageContext shdsoapContext;
-    private LogicalMessageContext logicalContext;
-
-    public SOAPHandlerContext(MessageInfo messageInfo,
-            InternalMessage internalMessage,
-            SOAPMessage soapMessage) {
-        super(messageInfo, internalMessage);
-        this.soapMessage = soapMessage;
-    }
-
-    public SOAPMessageContext getSOAPMessageContext() {
-        if (soapContext == null) {
-            soapContext = new SOAPMessageContextImpl(this);
-        }
-        return soapContext;
-    }
-
-    public SHDSOAPMessageContext getSHDSOAPMessageContext() {
-        if (shdsoapContext == null) {
-            shdsoapContext = new SHDSOAPMessageContext(this);
-        }
-        return shdsoapContext;
-    }
-
-    public LogicalMessageContext getLogicalMessageContext() {
-        if (logicalContext == null) {
-            logicalContext = new LogicalMessageContextImpl(this);
-        }
-        return logicalContext;
-    }
-
-
-    /**
-     * @return Returns the soapMessage.
-     */
-    public SOAPMessage getSOAPMessage() {
-        return soapMessage;
-    }
-
-
-    /**
-     * @param soapMessage The soapMessage to set.
-     */
-    public void setSOAPMessage(SOAPMessage soapMessage) {
-        this.soapMessage = soapMessage;
-    }
-
-    /**
-     * If there is a SOAPMessage already, use getSOAPMessage(). Ignore all other
-     * methods
-     */
-    public boolean isAlreadySoap() {
-        return getSOAPMessage() != null;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java
new file mode 100644
index 0000000..0ad1228
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * SOAPHandlerProcessor.java
+ *
+ * Created on February 8, 2006, 5:43 PM
+ *
+ *
+ */
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
+import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
+import java.util.List;
+import java.util.logging.Level;
+import javax.xml.namespace.QName;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.handler.Handler;
+
+/**
+ *
+ * @author WS Development Team
+ */
+final class SOAPHandlerProcessor<C extends MessageUpdatableContext> extends HandlerProcessor<C> {
+
+    /**
+     * Creates a new instance of SOAPHandlerProcessor
+     */
+    public SOAPHandlerProcessor(boolean isClient, HandlerTube owner, WSBinding binding, List<? extends Handler> chain) {
+        super(owner, binding, chain);
+        this.isClient = isClient;
+    }
+
+    /**
+     * Replace the message in the given message context with a
+     * fault message. If the context already contains a fault
+     * message, then return without changing it.
+     *
+     * <p>This method should only be called during a request,
+     * because during a response an exception from a handler
+     * is dispatched rather than replacing the message with
+     * a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
+     * to determine whether it is being called on the client
+     * or the server side. If this changes in the spec, then
+     * something else will need to be passed to the method
+     * to determine whether the fault code is client or server.
+     */
+    final void insertFaultMessage(C context,
+        ProtocolException exception) {
+        try {
+            if(!context.getPacketMessage().isFault()) {
+                Message faultMessage = Messages.create(binding.getSOAPVersion(),
+                        exception,determineFaultCode(binding.getSOAPVersion()));
+                context.setPacketMessage(faultMessage);
+            }
+        } catch (Exception e) {
+            // severe since this is from runtime and not handler
+            logger.log(Level.SEVERE,
+                "exception while creating fault message in handler chain", e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * <p>Figure out if the fault code local part is client,
+     * server, sender, receiver, etc. This is called by
+     * insertFaultMessage.
+     */
+    private QName determineFaultCode(SOAPVersion soapVersion) {
+        return isClient ? soapVersion.faultCodeClient : soapVersion.faultCodeServer;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java
index 44c9996..5ceb07a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,118 +23,96 @@
  * have any questions.
  */
 package com.sun.xml.internal.ws.handler;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBeanInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.message.saaj.SAAJMessage;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
-import org.xml.sax.InputSource;
-
 /**
- * Implementation of SOAPMessageContext. This class is used at runtime
+ * Implementation of {@link SOAPMessageContext}. This class is used at runtime
  * to pass to the handlers for processing soap messages.
  *
  * @see MessageContextImpl
  *
  * @author WS Development Team
  */
-public class SOAPMessageContextImpl implements SOAPMessageContext {
+class SOAPMessageContextImpl extends MessageUpdatableContext implements SOAPMessageContext {
 
-    private SOAPHandlerContext handlerCtxt;
-    private MessageContext ctxt;
     private Set<String> roles;
-    private static Map<String, Class> allowedTypes = null;
-    private boolean failure;
+    private SOAPMessage soapMsg = null;
+    private WSBinding binding;
 
-    public SOAPMessageContextImpl(SOAPHandlerContext handlerCtxt) {
-        this.handlerCtxt = handlerCtxt;
-        this.ctxt = handlerCtxt.getMessageContext();
-        if (allowedTypes == null) {
-            allowedTypes = new HashMap<String, Class>();
-            allowedTypes.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, Map.class);
-            allowedTypes.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, Map.class);
-            allowedTypes.put(MessageContext.WSDL_DESCRIPTION, InputSource.class);
-            allowedTypes.put(MessageContext.WSDL_SERVICE, QName.class);
-            allowedTypes.put(MessageContext.WSDL_PORT, QName.class);
-            allowedTypes.put(MessageContext.WSDL_INTERFACE, QName.class);
-            allowedTypes.put(MessageContext.WSDL_OPERATION, QName.class);
-            allowedTypes.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.class);
-        }
+    public SOAPMessageContextImpl(WSBinding binding, Packet packet) {
+        super(packet);
+        this.binding = binding;
     }
 
     public SOAPMessage getMessage() {
-        SOAPMessage soap = handlerCtxt.getSOAPMessage();
-        InternalMessage intr = handlerCtxt.getInternalMessage();
-        if (intr == null && soap != null) {
-            // Not much to do
-        } else if (intr != null && soap != null) {
-            // Overlay BodyBlock of InternalMessage on top of existing SOAPMessage
-            MessageInfo messageInfo = handlerCtxt.getMessageInfo();
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            soap = eptf.getSOAPEncoder().toSOAPMessage(intr, soap);
-            setMessage(soap);        // It also sets InernalMessage to null
-        } else if (intr != null && soap == null) {
-            // Convert InternalMessage to a SOAPMessage
-            MessageInfo messageInfo = handlerCtxt.getMessageInfo();
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            soap = eptf.getSOAPEncoder().toSOAPMessage(intr, messageInfo);
-            setMessage(soap);        // It also sets InernalMessage to null
-        } else {
-            throw new WebServiceException("Don't have SOAPMessage");
+        if(soapMsg == null) {
+            try {
+                soapMsg = packet.getMessage().readAsSOAPMessage();
+            } catch (SOAPException e) {
+                throw new WebServiceException(e);
+            }
         }
-        return soap;
+        return soapMsg;
     }
 
-    public void setMessage(SOAPMessage soapMessage) {
-        handlerCtxt.setSOAPMessage(soapMessage);
-        // current InternalMessage is not valid anymore. So reset it.
-        handlerCtxt.setInternalMessage(null);
+    public void setMessage(SOAPMessage soapMsg) {
+        try {
+            this.soapMsg = soapMsg;
+        } catch(Exception e) {
+            throw new WebServiceException(e);
+        }
     }
 
+    void setPacketMessage(Message newMessage){
+        if(newMessage != null) {
+            packet.setMessage(newMessage);
+            soapMsg = null;
+        }
+    }
+
+    protected void updateMessage() {
+        //Check if SOAPMessage has changed, if so construct new one,
+        // Packet are handled through MessageContext
+        if(soapMsg != null) {
+            packet.setMessage(new SAAJMessage(soapMsg));
+            soapMsg = null;
+        }
+    }
 
     public Object[] getHeaders(QName header, JAXBContext jaxbContext, boolean allRoles) {
+        SOAPVersion soapVersion = binding.getSOAPVersion();
+
+        List<Object> beanList = new ArrayList<Object>();
         try {
-            List beanList = new ArrayList();
-            SOAPMessage msg = getMessage();
-            SOAPHeader sHeader = msg.getSOAPHeader();
-            if (sHeader == null) {
-                return new Object[0];
-            }
-            Iterator i = sHeader.getChildElements(header);
-            while(i.hasNext()) {
-                SOAPHeaderElement child = (SOAPHeaderElement)i.next();
-                if(allRoles) {
-                    //If allRoles is true, add all headers
-                    Source source = new DOMSource(child);
-                    beanList.add(JAXBTypeSerializer.deserialize(source, jaxbContext));
-                } else {
-                    //If allRoles is false, add only headers with matching roles and headers with no role
-                    if( (child.getActor() == null)||
-                        (getRoles().contains(child.getActor()))  ) {
-                        Source source = new DOMSource(child);
-                        beanList.add(JAXBTypeSerializer.deserialize(source, jaxbContext));
+            Iterator<Header> itr = packet.getMessage().getHeaders().getHeaders(header,false);
+            if(allRoles) {
+                while(itr.hasNext()) {
+                    beanList.add(itr.next().readAsJAXB(jaxbContext.createUnmarshaller()));
+                }
+            } else {
+                while(itr.hasNext()) {
+                    Header soapHeader = itr.next();
+                    //Check if the role is one of the roles on this Binding
+                    String role = soapHeader.getRole(soapVersion);
+                    if(getRoles().contains(role)) {
+                        beanList.add(soapHeader.readAsJAXB(jaxbContext.createUnmarshaller()));
                     }
                 }
             }
@@ -151,74 +129,4 @@
     void setRoles(Set<String> roles) {
         this.roles = roles;
     }
-
-    private boolean validateProperty(String name, Object value) {
-        if (allowedTypes.containsKey(name)) {
-            Class clazz = allowedTypes.get(name);
-            if (!(clazz.isInstance(value)))
-                throw new HandlerException("handler.messageContext.invalid.class",
-                        new Object[] { value, name });
-        }
-
-        return true;
-    }
-
-    public void setScope(String name, Scope scope) {
-        ctxt.setScope(name, scope);
-    }
-
-    public Scope getScope(String name) {
-        return ctxt.getScope(name);
-    }
-
-    /* java.util.Map methods below here */
-
-    public void clear() {
-        ctxt.clear();
-    }
-
-    public boolean containsKey(Object obj) {
-        return ctxt.containsKey(obj);
-    }
-
-    public boolean containsValue(Object obj) {
-        return ctxt.containsValue(obj);
-    }
-
-    public Set<Entry<String, Object>> entrySet() {
-        return ctxt.entrySet();
-    }
-
-    public Object get(Object obj) {
-        return ctxt.get(obj);
-    }
-
-    public boolean isEmpty() {
-        return ctxt.isEmpty();
-    }
-
-    public Set<String> keySet() {
-        return ctxt.keySet();
-    }
-
-    public Object put(String str, Object obj) {
-        return ctxt.put(str, obj);
-    }
-
-    public void putAll(Map<? extends String, ? extends Object> map) {
-        ctxt.putAll(map);
-    }
-
-    public Object remove(Object obj) {
-        return ctxt.remove(obj);
-    }
-
-    public int size() {
-        return ctxt.size();
-    }
-
-    public Collection<Object> values() {
-        return ctxt.values();
-    }
-
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java
new file mode 100644
index 0000000..8188321
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.WebServiceException;
+import javax.activation.DataHandler;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ServerLogicalHandlerTube extends HandlerTube {
+
+    private WSBinding binding;
+    private List<LogicalHandler> logicalHandlers;
+
+    /**
+     * Creates a new instance of LogicalHandlerTube
+     */
+    public ServerLogicalHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
+        super(next, port);
+        this.binding = binding;
+        setUpProcessorOnce();
+    }
+
+    /**
+     * This constructor is used on client-side where, SOAPHandlerTube is created
+     * first and then a LogicalHandlerTube is created with a handler to that
+     * SOAPHandlerTube.
+     * With this handle, LogicalHandlerTube can call
+     * SOAPHandlerTube.closeHandlers()
+     */
+    public ServerLogicalHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+        super(next, cousinTube);
+        this.binding = binding;
+        setUpProcessorOnce();
+    }
+
+    /**
+     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
+     */
+
+    private ServerLogicalHandlerTube(ServerLogicalHandlerTube that, TubeCloner cloner) {
+        super(that, cloner);
+        this.binding = that.binding;
+        setUpProcessorOnce();
+    }
+
+    boolean isHandlerChainEmpty() {
+        return logicalHandlers.isEmpty();
+    }
+
+    /**
+     * Close SOAPHandlers first and then LogicalHandlers on Client
+     * Close LogicalHandlers first and then SOAPHandlers on Server
+     */
+    public void close(MessageContext msgContext) {
+
+        if (binding.getSOAPVersion() != null) {
+            //SOAPHandlerTube will drive the closing of LogicalHandlerTube
+        } else {
+            if (processor != null)
+                closeLogicalHandlers(msgContext);
+        }
+
+    }
+
+    /**
+     * This is called from cousinTube.
+     * Close this Tube's handlers.
+     */
+    public void closeCall(MessageContext msgContext) {
+        closeLogicalHandlers(msgContext);
+    }
+
+    //TODO:
+    private void closeLogicalHandlers(MessageContext msgContext) {
+        if (processor == null)
+            return;
+        if (remedyActionTaken) {
+            //Close only invoked handlers in the chain
+            //SERVER-SIDE
+            processor.closeHandlers(msgContext, processor.getIndex(), logicalHandlers.size() - 1);
+            processor.setIndex(-1);
+            //reset remedyActionTaken
+            remedyActionTaken = false;
+        } else {
+            //Close all handlers in the chain
+            //SERVER-SIDE
+            processor.closeHandlers(msgContext, 0, logicalHandlers.size() - 1);
+
+        }
+    }
+
+    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+        return new ServerLogicalHandlerTube(this, cloner);
+    }
+
+    private void setUpProcessorOnce() {
+        logicalHandlers = new ArrayList<LogicalHandler>();
+        List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
+        if (!logicalSnapShot.isEmpty()) {
+            logicalHandlers.addAll(logicalSnapShot);
+            if (binding.getSOAPVersion() == null) {
+                processor = new XMLHandlerProcessor(this, binding,
+                        logicalHandlers);
+            } else {
+                processor = new SOAPHandlerProcessor(false, this, binding,
+                        logicalHandlers);
+            }
+        }
+    }
+
+    void setUpProcessor() {
+     // Do nothing, Processor is setup in the constructor.
+    }
+
+    MessageUpdatableContext getContext(Packet packet) {
+        return new LogicalMessageContextImpl(binding, packet);
+    }
+
+    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
+
+        boolean handlerResult;
+        try {
+            //SERVER-SIDE
+            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.INBOUND, context, !isOneWay);
+
+        } catch (RuntimeException re) {
+            remedyActionTaken = true;
+            throw re;
+        }
+        if (!handlerResult) {
+            remedyActionTaken = true;
+        }
+        return handlerResult;
+    }
+
+    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
+        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
+        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+        AttachmentSet attSet = packet.getMessage().getAttachments();
+        for(String cid : atts.keySet()){
+            Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
+            attSet.add(att);
+        }
+
+        try {
+            //SERVER-SIDE
+            processor.callHandlersResponse(HandlerProcessor.Direction.OUTBOUND, context, handleFault);
+
+        } catch (WebServiceException wse) {
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+            throw re;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java
new file mode 100644
index 0000000..069ddaf
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.WebServiceException;
+import javax.activation.DataHandler;
+import java.util.*;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ServerSOAPHandlerTube extends HandlerTube {
+
+    private WSBinding binding;
+    private List<SOAPHandler> soapHandlers;
+    private Set<String> roles;
+
+    /**
+     * Creates a new instance of SOAPHandlerTube
+     */
+    public ServerSOAPHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
+        super(next, port);
+        if (binding.getSOAPVersion() != null) {
+            // SOAPHandlerTube should n't be used for bindings other than SOAP.
+            // TODO: throw Exception
+        }
+        this.binding = binding;
+        setUpProcessorOnce();
+    }
+
+    // Handle to LogicalHandlerTube means its used on SERVER-SIDE
+
+    /**
+     * This constructor is used on client-side where, LogicalHandlerTube is created
+     * first and then a SOAPHandlerTube is created with a handler to that
+     * LogicalHandlerTube.
+     * With this handle, SOAPHandlerTube can call LogicalHandlerTube.closeHandlers()
+     */
+    public ServerSOAPHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+        super(next, cousinTube);
+        this.binding = binding;
+        setUpProcessorOnce();
+    }
+
+    /**
+     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
+     */
+    private ServerSOAPHandlerTube(ServerSOAPHandlerTube that, TubeCloner cloner) {
+        super(that, cloner);
+        this.binding = that.binding;
+        setUpProcessorOnce();
+    }
+
+    boolean isHandlerChainEmpty() {
+        return soapHandlers.isEmpty();
+    }
+
+    /**
+     * Close SOAPHandlers first and then LogicalHandlers on Client
+     * Close LogicalHandlers first and then SOAPHandlers on Server
+     */
+    public void close(MessageContext msgContext) {
+        //assuming cousinTube is called if requestProcessingSucessful is true
+        if (requestProcessingSucessful) {
+            if (cousinTube != null) {
+                // Close LogicalHandlerTube
+                cousinTube.closeCall(msgContext);
+            }
+        }
+        if (processor != null)
+            closeSOAPHandlers(msgContext);
+
+    }
+
+    /**
+     * This is called from cousinTube.
+     * Close this Tube's handlers.
+     */
+    public void closeCall(MessageContext msgContext) {
+        closeSOAPHandlers(msgContext);
+    }
+
+    //TODO:
+    private void closeSOAPHandlers(MessageContext msgContext) {
+        if (processor == null)
+            return;
+        if (remedyActionTaken) {
+            //Close only invoked handlers in the chain
+            //SERVER-SIDE
+            processor.closeHandlers(msgContext, processor.getIndex(), soapHandlers.size() - 1);
+            processor.setIndex(-1);
+            //reset remedyActionTaken
+            remedyActionTaken = false;
+        } else {
+            //Close all handlers in the chain
+            //SERVER-SIDE
+            processor.closeHandlers(msgContext, 0, soapHandlers.size() - 1);
+
+        }
+    }
+
+    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+        return new ServerSOAPHandlerTube(this, cloner);
+    }
+
+    private void setUpProcessorOnce() {
+        soapHandlers = new ArrayList<SOAPHandler>();
+        HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
+        List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
+        if (!soapSnapShot.isEmpty()) {
+            soapHandlers.addAll(soapSnapShot);
+            roles = new HashSet<String>();
+            roles.addAll(handlerConfig.getRoles());
+            processor = new SOAPHandlerProcessor(false, this, binding, soapHandlers);
+        }
+    }
+
+    void setUpProcessor() {
+        // Do nothing, Processor is setup in the constructor.
+    }
+    MessageUpdatableContext getContext(Packet packet) {
+        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet);
+        context.setRoles(roles);
+        return context;
+    }
+
+    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
+
+        boolean handlerResult;
+        try {
+            //SERVER-SIDE
+            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.INBOUND, context, !isOneWay);
+
+        } catch (RuntimeException re) {
+            remedyActionTaken = true;
+            throw re;
+
+        }
+        if (!handlerResult) {
+            remedyActionTaken = true;
+        }
+        return handlerResult;
+    }
+
+    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
+
+        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
+        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+        AttachmentSet attSet = packet.getMessage().getAttachments();
+        for(String cid : atts.keySet()){
+            Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
+            attSet.add(att);
+        }
+
+        try {
+            //SERVER-SIDE
+            processor.callHandlersResponse(HandlerProcessor.Direction.OUTBOUND, context, handleFault);
+
+        } catch (WebServiceException wse) {
+            //no rewrapping
+            throw wse;
+        } catch (RuntimeException re) {
+            throw re;
+
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerContext.java
deleted file mode 100644
index bd6d48c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerContext.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import javax.xml.ws.handler.LogicalMessageContext;
-import com.sun.xml.internal.ws.spi.runtime.MessageContext;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-import java.lang.reflect.Method;
-
-
-/**
- * Version of {@link HandlerContext} for XML/HTTP binding that
- * only deals with logical messages.
- *
- * <p>Class has to defer information to HandlerContext so that properties
- * are shared between this and SOAPMessageContext.
- *
- * @see HandlerContext
- *
- * @author WS Development Team
- * @author WS Development Team
- */
-public class XMLHandlerContext extends HandlerContext {
-
-    private XMLMessage xmlMessage;
-    private LogicalMessageContext logicalContext;
-    private SHDXMLMessageContext shdXmlContext;
-
-    public XMLHandlerContext(MessageInfo messageInfo,
-            InternalMessage internalMessage,
-            XMLMessage xmlMessage) {
-        super(messageInfo, internalMessage);
-        this.xmlMessage = xmlMessage;
-    }
-
-    public LogicalMessageContext getLogicalMessageContext() {
-        if (logicalContext == null) {
-            logicalContext = new XMLLogicalMessageContextImpl(this);
-        }
-        return logicalContext;
-    }
-
-    /**
-     * @return Returns XMLMessage
-     */
-    public XMLMessage getXMLMessage() {
-        return xmlMessage;
-    }
-
-    /**
-     * @param xmlMessage The xmlMessage to set.
-     */
-    public void setXMLMessage(XMLMessage xmlMessage) {
-        this.xmlMessage = xmlMessage;
-    }
-
-    public SHDXMLMessageContext getSHDXMLMessageContext() {
-        if (shdXmlContext == null) {
-            shdXmlContext = new SHDXMLMessageContext(this);
-        }
-        return shdXmlContext;
-    }
-
-    private static class SHDXMLMessageContext extends XMLLogicalMessageContextImpl implements com.sun.xml.internal.ws.spi.runtime.MessageContext {
-
-        XMLHandlerContext handlerCtxt;
-
-        public SHDXMLMessageContext(XMLHandlerContext handlerCtxt) {
-            super(handlerCtxt);
-            this.handlerCtxt = handlerCtxt;
-        }
-
-        public String getBindingId() {
-            return handlerCtxt.getBindingId();
-        }
-
-        public Method getMethod() {
-            return handlerCtxt.getMethod();
-        }
-
-        public void setCanonicalization(String algorithm) {
-            handlerCtxt.setCanonicalization(algorithm);
-        }
-
-        public Invoker getInvoker() {
-            return handlerCtxt.getInvoker();
-        }
-
-        public boolean isMtomEnabled() {
-            return false;
-        }
-
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java
new file mode 100644
index 0000000..c2b4521
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * LogicalHandlerProcessor.java
+ *
+ * Created on February 8, 2006, 5:40 PM
+ *
+ */
+
+package com.sun.xml.internal.ws.handler;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Messages;
+import java.util.List;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.http.HTTPException;
+
+/**
+ * This is used only for XML/HTTP binding
+ * @author WS Development Team
+ */
+final class XMLHandlerProcessor<C extends MessageUpdatableContext> extends HandlerProcessor<C> {
+
+    /**
+     * Creates a new instance of LogicalHandlerProcessor
+     */
+    public XMLHandlerProcessor(HandlerTube owner, WSBinding binding, List<? extends Handler> chain) {
+        super(owner, binding, chain);
+    }
+
+    /*
+     * TODO: This is valid only for XML/HTTP binding
+     * Empty the XML message
+     */
+    final void insertFaultMessage(C context,
+            ProtocolException exception) {
+        if(exception instanceof HTTPException) {
+            context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
+        }
+        if (context != null) {
+            // non-soap case
+            context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageContextImpl.java
deleted file mode 100644
index d9708a8..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageContextImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.xml.ws.LogicalMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * Implementation of LogicalMessageContext that is used in
- * the XML/HTTP binding. It is similar to LogicalMessageContextImpl
- * except that the message impl class it uses is a
- * {@link XMLLogicalMessageImpl} rather than a
- * {@link LogicalMessageImpl}.
- *
- * <p>Class has to defer information to HandlerContext so that properties
- * are shared between this and SOAPMessageContext.
- *
- * @see LogicalMessageImpl
- * @see XMLHandlerContext
- * @see XMLLogicalMessageImpl
- *
- * @author WS Development Team
- */
-public class XMLLogicalMessageContextImpl implements LogicalMessageContext {
-
-    private MessageContext ctxt;
-    private XMLHandlerContext handlerCtxt;
-
-    public XMLLogicalMessageContextImpl(XMLHandlerContext handlerCtxt) {
-        this.handlerCtxt = handlerCtxt;
-        ctxt = handlerCtxt.getMessageContext();
-    }
-
-    public XMLHandlerContext getHandlerContext() {
-        return handlerCtxt;
-    }
-
-    public LogicalMessage getMessage() {
-        return new XMLLogicalMessageImpl(handlerCtxt);
-    }
-
-    public void setScope(String name, Scope scope) {
-        ctxt.setScope(name, scope);
-    }
-
-    public Scope getScope(String name) {
-        return ctxt.getScope(name);
-    }
-
-    /* java.util.Map methods below here */
-
-    public void clear() {
-        ctxt.clear();
-    }
-
-    public boolean containsKey(Object obj) {
-        return ctxt.containsKey(obj);
-    }
-
-    public boolean containsValue(Object obj) {
-        return ctxt.containsValue(obj);
-    }
-
-    public Set<Entry<String, Object>> entrySet() {
-        return ctxt.entrySet();
-    }
-
-    public Object get(Object obj) {
-        return ctxt.get(obj);
-    }
-
-    public boolean isEmpty() {
-        return ctxt.isEmpty();
-    }
-
-    public Set<String> keySet() {
-        return ctxt.keySet();
-    }
-
-    public Object put(String str, Object obj) {
-        return ctxt.put(str, obj);
-    }
-
-    public void putAll(Map<? extends String, ? extends Object> map) {
-        ctxt.putAll(map);
-    }
-
-    public Object remove(Object obj) {
-        return ctxt.remove(obj);
-    }
-
-    public int size() {
-        return ctxt.size();
-    }
-
-    public Collection<Object> values() {
-        return ctxt.values();
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageImpl.java
deleted file mode 100644
index 1d89e5f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLLogicalMessageImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.handler;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.ws.LogicalMessage;
-import javax.xml.transform.Source;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-
-/**
- * Implementation of LogicalMessage that is used in the
- * XML/HTTP binding. It is similar to LogicalMessageImpl
- * except that the context object passed in is an
- * {@link XMLHandlerContext} rather than a {@link HandlerContext}.
- *
- * @see LogicalMessageImpl
- * @see XMLHandlerContext
- * @see XMLLogicalMessageContextImpl
- *
- * @author WS Development Team
- */
-public class XMLLogicalMessageImpl implements LogicalMessage {
-
-    private XMLHandlerContext ctxt;
-
-    public XMLLogicalMessageImpl(XMLHandlerContext ctxt) {
-        this.ctxt = ctxt;
-    }
-
-    /*
-     * Gets the source from XMLMessage. XMLMessage gives a copy of existing
-     * data
-     */
-    public Source getPayload() {
-        XMLMessage xmlMessage = ctxt.getXMLMessage();
-        return xmlMessage.getPayload();
-    }
-
-    /*
-     * Sets the Source as payload in XMLMessage
-     */
-    public void setPayload(Source source) {
-        XMLMessage xmlMessage = ctxt.getXMLMessage();
-        xmlMessage = new XMLMessage(source, xmlMessage.getAttachments(), xmlMessage.useFastInfoset());
-        ctxt.setXMLMessage(xmlMessage);
-    }
-
-    /*
-     * Gets XMLMessage data as JAXB bean
-     */
-    public Object getPayload(JAXBContext jaxbContext) {
-        XMLMessage xmlMessage = ctxt.getXMLMessage();
-        return xmlMessage.getPayload(jaxbContext);
-    }
-
-    /*
-     * Sets JAXB bean into XMLMessage
-     */
-    public void setPayload(Object bean, JAXBContext jaxbContext) {
-        XMLMessage xmlMessage = ctxt.getXMLMessage();
-        xmlMessage = new XMLMessage(bean, jaxbContext, xmlMessage.getAttachments(), xmlMessage.useFastInfoset());
-        ctxt.setXMLMessage(xmlMessage);
-    }
-
-    public XMLHandlerContext getHandlerContext() {
-        return ctxt;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/package-info.java
deleted file mode 100644
index 945c7cd..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/package-info.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/**
- * <h1>JAX-WS 2.0 Handler Runtime</h1>
- * <p>This document describes the architecture of the handler code
- * in the JAX-WS 2.0 runtime.
- *
- * <p>Handlers may be specified by the deployment descriptor on the
- * server side, or by a wsdl customization or Java annotation. In the
- * case of a wsdl customization, wsimport will create the Java interface
- * with the handler chain annotation and will create a handler xml file
- * to which the annotation points. At runtime, thus, only deployment
- * descriptors and handler files pointed to by annotations are parsed.
- * The schema in all cases is the same, and  @HandlerChainAnnotation is
- * processed by {@link com.sun.xml.internal.ws.util.HandlerAnnotationProcessor}, which
- * delegates the parsing of handler configuartion file to
- * {@link com.sun.xml.internal.ws.handler.HandlerChainsModel} .
- *
- * <h3>Server side handler creation</h3>
- *
- * <p>The deployment descriptor is first parsed, and
- * {@link com.sun.xml.internal.ws.transport.http.servlet.RuntimeEndpointInfoParser#setHandlersAndRoles}
- * parses the handler chains xml in the deployment descriptor if present.
- * It then sets the handlers and roles on the Binding object that has
- * already been created. Setting the handler chain on the binding does
- * not automatically create a handler chain caller.
- *
- * <p>Later, when
- * {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo#init} is parsing the
- * annotations it checks for handlers on the binding. If there are handlers
- * already, it skips any further handler processing. In this way, the deployment
- * descriptor overrides any other handlers. If there are no handlers on
- * the binding at this point, RuntimeEndpointInfo has the
- * HandlerAnnotationProcessor parse the handler chain file and then
- * sets the handlers and roles on the binding.
- *
- * <h3>Client side handler creation</h3>
- *
- * <p>On the client side, the @HandlerChain annotation on generated Service
- * class is processed by {@link com.sun.xml.internal.ws.client.ServiceContextBuilder#build}.
- * If there is @HandlerChain on service class, the ServiceContextBuilder creates
- * HandlerResolverImpl from that handler file and sets it on the
- * {@link com.sun.xml.internal.ws.client.ServiceContext}. @HandlerChain annotations on
- * the SEIs are ignored on the client-side.
- *
- * <p>Unlike the server side, there is no binding object already
- * created when the handlers are parsed. When a binding provider is created, the
- * {@link com.sun.xml.internal.ws.client.WSServiceDelegate} will use the handler
- * registry (which may be the HandlerResolverImpl or another handler
- * resolver set on the service by the user code) to get the handlers to
- * set on the binding. It will get the roles from the service context and
- * set those on the binding if it is a soap binding. The relevant method is
- * {@link com.sun.xml.internal.ws.client.WSServiceDelegate#setBindingOnProvider}
- *
- * <h3>Calling the handlers</h3>
- *
- * <p>During a request or response, a
- * {@link com.sun.xml.internal.ws.handler.HandlerChainCaller} is
- * created by the binding or may be created by a message dispatcher on the
- * server side (this happens in the http binding right now). In the binding
- * objects, the handler caller is not created until needed, and it sets
- * the handlers and roles (if present) on the handler chain caller then.
- * See {@link com.sun.xml.internal.ws.binding.BindingImpl#getHandlerChainCaller}
- * and {@link com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl#getHandlerChainCaller}
- * for more details.
- *
- * <p>The handler chain caller does the handler invocation and controls the
- * flow of the handlers. For details of the code that calls the handler
- * chain caller, see
- * {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher}
- * on the client side and
- * {@link com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher} and
- * {@link com.sun.xml.internal.ws.protocol.xml.server.XMLMessageDispatcher} on the
- * server side.
- *
- * @ArchitectureDocument
- */
-package com.sun.xml.internal.ws.handler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractHeaderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractHeaderImpl.java
new file mode 100644
index 0000000..fdd9b71
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractHeaderImpl.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.BridgeContext;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import org.xml.sax.helpers.AttributesImpl;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.util.Set;
+
+/**
+ * Partial default implementation of {@link Header}.
+ *
+ * <p>
+ * This is meant to be a convenient base class
+ * for {@link Header}-derived classes.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractHeaderImpl implements Header {
+
+    protected AbstractHeaderImpl() {
+    }
+
+    /**
+     * @deprecated
+     */
+    public final <T> T readAsJAXB(Bridge<T> bridge, BridgeContext context) throws JAXBException {
+        return readAsJAXB(bridge);
+    }
+
+    public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        try {
+            return (T)unmarshaller.unmarshal(readHeader());
+        } catch (Exception e) {
+            throw new JAXBException(e);
+        }
+    }
+
+    public <T> T readAsJAXB(Bridge<T> bridge) throws JAXBException {
+        try {
+            return bridge.unmarshal(readHeader());
+        } catch (XMLStreamException e) {
+            throw new JAXBException(e);
+        }
+    }
+
+    /**
+     * Default implementation that copies the infoset. Not terribly efficient.
+     */
+    public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException {
+        XMLStreamReader xsr = readHeader();
+        WSEndpointReference epr = new WSEndpointReference(xsr, expected);
+        XMLStreamReaderFactory.recycle(xsr);
+        return epr;
+    }
+
+    public boolean isIgnorable(@NotNull SOAPVersion soapVersion, @NotNull Set<String> roles) {
+        // check mustUnderstand
+        String v = getAttribute(soapVersion.nsUri, "mustUnderstand");
+        if(v==null || !parseBool(v)) return true;
+
+        // now role
+        return !roles.contains(getRole(soapVersion));
+    }
+
+    public @NotNull String getRole(@NotNull SOAPVersion soapVersion) {
+        String v = getAttribute(soapVersion.nsUri, soapVersion.roleAttributeName);
+        if(v==null)
+            v = soapVersion.implicitRole;
+        return v;
+    }
+
+    public boolean isRelay() {
+        String v = getAttribute(SOAPVersion.SOAP_12.nsUri,"relay");
+        if(v==null) return false;   // on SOAP 1.1 message there shouldn't be such an attribute, so this works fine
+        return parseBool(v);
+    }
+
+    public String getAttribute(QName name) {
+        return getAttribute(name.getNamespaceURI(),name.getLocalPart());
+    }
+
+    /**
+     * Parses a string that looks like <tt>xs:boolean</tt> into boolean.
+     *
+     * This method assumes that the whilespace normalization has already taken place.
+     */
+    protected final boolean parseBool(String value) {
+        if(value.length()==0)
+            return false;
+
+        char ch = value.charAt(0);
+        return ch=='t' || ch=='1';
+    }
+
+    public String getStringContent() {
+        try {
+            XMLStreamReader xsr = readHeader();
+            xsr.nextTag();
+            return xsr.getElementText();
+        } catch (XMLStreamException e) {
+            return null;
+        }
+    }
+
+    protected static final AttributesImpl EMPTY_ATTS = new AttributesImpl();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java
new file mode 100644
index 0000000..7c35a85
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AbstractMessageImpl.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import javax.xml.soap.AttachmentPart;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.MimeHeader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Partial {@link Message} implementation.
+ *
+ * <p>
+ * This class implements some of the {@link Message} methods.
+ * The idea is that those implementations may be non-optimal but
+ * it may save effort in implementing {@link Message} and reduce
+ * the code size.
+ *
+ * <p>
+ * {@link Message} classes that are used more commonly should
+ * examine carefully which method can be implemented faster,
+ * and override them accordingly.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractMessageImpl extends Message {
+    /**
+     * SOAP version of this message.
+     * Used to implement some of the methods, but nothing more than that.
+     *
+     * <p>
+     * So if you aren't using those methods that use this field,
+     * this can be null.
+     */
+    protected final SOAPVersion soapVersion;
+
+    protected AbstractMessageImpl(SOAPVersion soapVersion) {
+        this.soapVersion = soapVersion;
+    }
+
+    /**
+     * Copy constructor.
+     */
+    protected AbstractMessageImpl(AbstractMessageImpl that) {
+        this.soapVersion = that.soapVersion;
+    }
+
+    public Source readEnvelopeAsSource() {
+        return new SAXSource(new XMLReaderImpl(this), XMLReaderImpl.THE_SOURCE);
+    }
+
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        if(hasAttachments())
+            unmarshaller.setAttachmentUnmarshaller(new AttachmentUnmarshallerImpl(getAttachments()));
+        try {
+            return (T) unmarshaller.unmarshal(readPayloadAsSource());
+        } finally{
+            unmarshaller.setAttachmentUnmarshaller(null);
+        }
+    }
+
+    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+        return bridge.unmarshal(readPayloadAsSource(),
+            hasAttachments()? new AttachmentUnmarshallerImpl(getAttachments()) : null );
+    }
+
+    /**
+     * Default implementation that relies on {@link #writePayloadTo(XMLStreamWriter)}
+     */
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        String soapNsUri = soapVersion.nsUri;
+        w.writeStartDocument();
+        w.writeStartElement("S","Envelope",soapNsUri);
+        w.writeNamespace("S",soapNsUri);
+        if(hasHeaders()) {
+            w.writeStartElement("S","Header",soapNsUri);
+            HeaderList headers = getHeaders();
+            int len = headers.size();
+            for( int i=0; i<len; i++ ) {
+                headers.get(i).writeTo(w);
+            }
+            w.writeEndElement();
+        }
+        // write the body
+        w.writeStartElement("S","Body",soapNsUri);
+
+        writePayloadTo(w);
+
+        w.writeEndElement();
+        w.writeEndElement();
+        w.writeEndDocument();
+    }
+
+    /**
+     * Writes the whole envelope as SAX events.
+     */
+    public void writeTo( ContentHandler contentHandler, ErrorHandler errorHandler ) throws SAXException {
+        String soapNsUri = soapVersion.nsUri;
+
+        contentHandler.setDocumentLocator(NULL_LOCATOR);
+        contentHandler.startDocument();
+        contentHandler.startPrefixMapping("S",soapNsUri);
+        contentHandler.startElement(soapNsUri,"Envelope","S:Envelope",EMPTY_ATTS);
+        if(hasHeaders()) {
+            contentHandler.startElement(soapNsUri,"Header","S:Header",EMPTY_ATTS);
+            HeaderList headers = getHeaders();
+            int len = headers.size();
+            for( int i=0; i<len; i++ ) {
+                // shouldn't JDK be smart enough to use array-style indexing for this foreach!?
+                headers.get(i).writeTo(contentHandler,errorHandler);
+            }
+            contentHandler.endElement(soapNsUri,"Header","S:Header");
+        }
+        // write the body
+        contentHandler.startElement(soapNsUri,"Body","S:Body",EMPTY_ATTS);
+        writePayloadTo(contentHandler,errorHandler, true);
+        contentHandler.endElement(soapNsUri,"Body","S:Body");
+        contentHandler.endElement(soapNsUri,"Envelope","S:Envelope");
+    }
+
+    /**
+     * Writes the payload to SAX events.
+     *
+     * @param fragment
+     *      if true, this method will fire SAX events without start/endDocument events,
+     *      suitable for embedding this into a bigger SAX event sequence.
+     *      if false, this method generaets a completely SAX event sequence on its own.
+     */
+    protected abstract void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException;
+
+    /**
+     * Default implementation that uses {@link #writeTo(ContentHandler, ErrorHandler)}
+     */
+    public SOAPMessage readAsSOAPMessage() throws SOAPException {
+        SOAPMessage msg = soapVersion.saajMessageFactory.createMessage();
+        SAX2DOMEx s2d = new SAX2DOMEx(msg.getSOAPPart());
+        try {
+            writeTo(s2d, XmlUtil.DRACONIAN_ERROR_HANDLER);
+        } catch (SAXException e) {
+            throw new SOAPException(e);
+        }
+        for(Attachment att : getAttachments()) {
+            AttachmentPart part = msg.createAttachmentPart();
+            part.setDataHandler(att.asDataHandler());
+            part.setContentId('<'+att.getContentId()+'>');
+            msg.addAttachmentPart(part);
+        }
+        return msg;
+    }
+
+    /**
+     *
+     */
+    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
+        SOAPMessage msg = readAsSOAPMessage();
+        Map<String, List<String>> headers = null;
+        String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS;
+        if (packet.supports(key)) {
+            headers = (Map<String, List<String>>)packet.get(key);
+        }
+        if (headers != null) {
+            for(Map.Entry<String, List<String>> e : headers.entrySet()) {
+                if (!e.getKey().equalsIgnoreCase("Content-Type")) {
+                    for(String value : e.getValue()) {
+                        msg.getMimeHeaders().addHeader(e.getKey(), value);
+                    }
+                }
+            }
+        }
+        msg.saveChanges();
+        return msg;
+    }
+
+
+    protected static final AttributesImpl EMPTY_ATTS = new AttributesImpl();
+    protected static final LocatorImpl NULL_LOCATOR = new LocatorImpl();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java
new file mode 100644
index 0000000..79aa67e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Default dumb {@link AttachmentSet} implementation backed by {@link ArrayList}.
+ *
+ * <p>
+ * The assumption here is that the number of attachments are small enough to
+ * justify linear search in {@link #get(String)}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class AttachmentSetImpl implements AttachmentSet {
+
+    private final ArrayList<Attachment> attList = new ArrayList<Attachment>();
+
+    /**
+     * Creates an empty {@link AttachmentSet}.
+     */
+    public AttachmentSetImpl() {
+    }
+
+    /**
+     * Creates an {@link AttachmentSet} by copying contents from another.
+     */
+    public AttachmentSetImpl(Iterable<Attachment> base) {
+        for (Attachment a : base)
+            add(a);
+    }
+
+    public Attachment get(String contentId) {
+        for( int i=attList.size()-1; i>=0; i-- ) {
+            Attachment a = attList.get(i);
+            if(a.getContentId().equals(contentId))
+                return a;
+        }
+        return null;
+    }
+
+    public boolean isEmpty() {
+        return attList.isEmpty();
+    }
+
+    public void add(Attachment att) {
+        attList.add(att);
+    }
+
+    public Iterator<Attachment> iterator() {
+        return attList.iterator();
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java
new file mode 100644
index 0000000..206b218
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.encoding.MimeMultipartParser;
+import com.sun.xml.internal.ws.resources.EncodingMessages;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Implementation of {@link AttachmentUnmarshaller} that uses
+ * loads attachments from {@link AttachmentSet} directly.
+ *
+ * @author Vivek Pandey
+ * @see MimeMultipartParser
+ */
+public final class AttachmentUnmarshallerImpl extends AttachmentUnmarshaller {
+
+    private final AttachmentSet attachments;
+
+    public AttachmentUnmarshallerImpl(AttachmentSet attachments) {
+        this.attachments = attachments;
+    }
+
+    @Override
+    public DataHandler getAttachmentAsDataHandler(String cid) {
+        Attachment a = attachments.get(stripScheme(cid));
+        if(a==null)
+            throw new WebServiceException(EncodingMessages.NO_SUCH_CONTENT_ID(cid));
+        return a.asDataHandler();
+    }
+
+    @Override
+    public byte[] getAttachmentAsByteArray(String cid) {
+        Attachment a = attachments.get(stripScheme(cid));
+        if(a==null)
+            throw new WebServiceException(EncodingMessages.NO_SUCH_CONTENT_ID(cid));
+        return a.asByteArray();
+    }
+
+    /**
+     * The CID reference has 'cid:' prefix, so get rid of it.
+     */
+    private String stripScheme(String cid) {
+        if(cid.startsWith("cid:")) // work defensively, in case the input is wrong
+            cid = cid.substring(4);
+        return cid;
+    }
+
+    // TODO fix the hack
+    // So that SAAJ registers DCHs for MIME types
+    static {
+        new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java
new file mode 100644
index 0000000..46562bf
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+import java.io.ByteArrayInputStream;
+
+import javax.activation.DataHandler;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+public final class ByteArrayAttachment implements Attachment {
+
+    private final String contentId;
+    private byte[] data;
+    private int start;
+    private final int len;
+    private final String mimeType;
+
+    public ByteArrayAttachment(@NotNull String contentId, byte[] data, int start, int len, String mimeType) {
+        this.contentId = contentId;
+        this.data = data;
+        this.start = start;
+        this.len = len;
+        this.mimeType = mimeType;
+    }
+
+    public ByteArrayAttachment(@NotNull String contentId, byte[] data, String mimeType) {
+        this(contentId, data, 0, data.length, mimeType);
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public String getContentType() {
+        return mimeType;
+    }
+
+    public byte[] asByteArray() {
+        if(start!=0 || len!=data.length) {
+            // if our buffer isn't exact, switch to the exact one
+            byte[] exact = new byte[len];
+            System.arraycopy(data,start,exact,0,len);
+            start = 0;
+            data = exact;
+        }
+        return data;
+    }
+
+    public DataHandler asDataHandler() {
+        return new DataHandler(new ByteArrayDataSource(data,start,len,getContentType()));
+    }
+
+    public Source asSource() {
+        return new StreamSource(asInputStream());
+    }
+
+    public InputStream asInputStream() {
+         return new ByteArrayInputStream(data,start,len);
+    }
+
+    public void writeTo(OutputStream os) throws IOException {
+        os.write(asByteArray());
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        AttachmentPart part = saaj.createAttachmentPart();
+        part.setDataHandler(asDataHandler());
+        part.setContentId(contentId);
+        saaj.addAttachmentPart(part);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMHeader.java
new file mode 100644
index 0000000..d06f3ef
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMHeader.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.BridgeContext;
+import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+import com.sun.xml.internal.messaging.saaj.packaging.mime.Header;
+import com.sun.xml.internal.ws.streaming.DOMStreamReader;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * {@link Header} implementation for a DOM.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class DOMHeader<N extends Element> extends AbstractHeaderImpl {
+    protected final N node;
+
+    private final String nsUri;
+    private final String localName;
+
+    public DOMHeader(N node) {
+        assert node!=null;
+        this.node = node;
+
+        this.nsUri = fixNull(node.getNamespaceURI());
+        this.localName = node.getLocalName();
+    }
+
+
+    public String getNamespaceURI() {
+        return nsUri;
+    }
+
+    public String getLocalPart() {
+        return localName;
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        DOMStreamReader r = new DOMStreamReader(node);
+        r.nextTag();    // move ahead to the start tag
+        return r;
+    }
+
+    public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        return (T) unmarshaller.unmarshal(node);
+    }
+
+    public <T> T readAsJAXB(Bridge<T> bridge) throws JAXBException {
+        return bridge.unmarshal(node);
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        DOMUtil.serializeNode(node, w);
+    }
+
+    private static String fixNull(String s) {
+        if(s!=null)     return s;
+        else            return "";
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        DOMScanner ds = new DOMScanner();
+        ds.setContentHandler(contentHandler);
+        ds.scan(node);
+    }
+
+    public String getAttribute(String nsUri, String localName) {
+        if(nsUri.length()==0)   nsUri=null; // DOM wants null, not "".
+        return node.getAttributeNS(nsUri,localName);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        SOAPHeader header = saaj.getSOAPHeader();
+        Node clone = header.getOwnerDocument().importNode(node,true);
+        header.appendChild(clone);
+    }
+
+    @Override
+    public String getStringContent() {
+        return node.getTextContent();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMMessage.java
new file mode 100644
index 0000000..d8edc59
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMMessage.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.FragmentContentHandler;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.streaming.DOMStreamReader;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.Element;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * {@link Message} backed by a DOM {@link Element} that represents the payload.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class DOMMessage extends AbstractMessageImpl {
+    private HeaderList headers;
+    private final Element payload;
+
+    public DOMMessage(SOAPVersion ver, Element payload) {
+        this(ver,null,payload);
+    }
+
+    public DOMMessage(SOAPVersion ver, HeaderList headers, Element payload) {
+        super(ver);
+        this.headers = headers;
+        this.payload = payload;
+        assert payload!=null;
+    }
+
+    /**
+     * This constructor is a convenience and called by the {@link #copy}
+     */
+    private DOMMessage(DOMMessage that) {
+        super(that);
+        this.headers = HeaderList.copy(that.headers);
+        this.payload = that.payload;
+    }
+
+    public boolean hasHeaders() {
+        return getHeaders().size() > 0;
+    }
+
+    public HeaderList getHeaders() {
+        if (headers == null)
+            headers = new HeaderList();
+
+        return headers;
+    }
+
+    public String getPayloadLocalPart() {
+        return payload.getLocalName();
+    }
+
+    public String getPayloadNamespaceURI() {
+        return payload.getNamespaceURI();
+    }
+
+    public boolean hasPayload() {
+        return true;
+    }
+
+    public Source readPayloadAsSource() {
+        return new DOMSource(payload);
+    }
+
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        if(hasAttachments())
+            unmarshaller.setAttachmentUnmarshaller(new AttachmentUnmarshallerImpl(getAttachments()));
+        try {
+            return (T)unmarshaller.unmarshal(payload);
+        } finally{
+            unmarshaller.setAttachmentUnmarshaller(null);
+        }
+    }
+
+    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+        return bridge.unmarshal(payload,
+            hasAttachments()? new AttachmentUnmarshallerImpl(getAttachments()) : null);
+    }
+
+    public XMLStreamReader readPayload() throws XMLStreamException {
+        DOMStreamReader dss = new DOMStreamReader();
+        dss.setCurrentNode(payload);
+        dss.nextTag();
+        assert dss.getEventType()==XMLStreamReader.START_ELEMENT;
+        return dss;
+    }
+
+    public void writePayloadTo(XMLStreamWriter sw) {
+        try {
+            if (payload != null)
+                DOMUtil.serializeNode(payload, sw);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        if(fragment)
+            contentHandler = new FragmentContentHandler(contentHandler);
+        DOMScanner ds = new DOMScanner();
+        ds.setContentHandler(contentHandler);
+        ds.scan(payload);
+    }
+
+    public Message copy() {
+        return new DOMMessage(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java
new file mode 100644
index 0000000..7153b44
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+
+import javax.activation.DataHandler;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.ByteArrayOutputStream;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+public final class DataHandlerAttachment implements Attachment {
+    // TODO fix the hack
+    // So that SAAJ registers DCHs for MIME types
+    static {
+        new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
+    }
+
+    private final DataHandler dh;
+    private final String contentId;
+
+    /**
+     * This will be constructed by {@link AttachmentMarshallerImpl}
+     */
+    public DataHandlerAttachment(@NotNull String contentId, @NotNull DataHandler dh) {
+        this.dh = dh;
+        this.contentId = contentId;
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public String getContentType() {
+        return dh.getContentType();
+    }
+
+    public byte[] asByteArray() {
+        try {
+            ByteArrayOutputStream os = new ByteArrayOutputStream();
+            dh.writeTo(os);
+            return os.toByteArray();
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public DataHandler asDataHandler() {
+        return dh;
+    }
+
+    public Source asSource() {
+        try {
+            return new StreamSource(dh.getInputStream());
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public InputStream asInputStream() {
+        try {
+            return dh.getInputStream();
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public void writeTo(OutputStream os) throws IOException {
+        os.write(asByteArray());
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        AttachmentPart part = saaj.createAttachmentPart();
+        part.setDataHandler(dh);
+        part.setContentId(contentId);
+        saaj.addAttachmentPart(part);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java
new file mode 100644
index 0000000..272bc98
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+
+/**
+ * {@link Message} that has no body.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class EmptyMessageImpl extends AbstractMessageImpl {
+
+    /**
+     * If a message has no payload, it's more likely to have
+     * some header, so we create it eagerly here.
+     */
+    private final HeaderList headers;
+    private final AttachmentSet attachmentSet;
+
+    public EmptyMessageImpl(SOAPVersion version) {
+        super(version);
+        this.headers = new HeaderList();
+        this.attachmentSet = new AttachmentSetImpl();
+    }
+
+    public EmptyMessageImpl(HeaderList headers, @NotNull AttachmentSet attachmentSet, SOAPVersion version){
+        super(version);
+        if(headers==null)
+            headers = new HeaderList();
+        this.attachmentSet = attachmentSet;
+        this.headers = headers;
+    }
+
+    /**
+     * Copy constructor.
+     */
+    private EmptyMessageImpl(EmptyMessageImpl that) {
+        super(that);
+        this.headers = new HeaderList(that.headers);
+        this.attachmentSet = that.attachmentSet;
+    }
+
+    public boolean hasHeaders() {
+        return !headers.isEmpty();
+    }
+
+    @Override
+    public @NotNull AttachmentSet getAttachments() {
+        return attachmentSet;
+    }
+
+    public HeaderList getHeaders() {
+        return headers;
+    }
+
+    public String getPayloadLocalPart() {
+        return null;
+    }
+
+    public String getPayloadNamespaceURI() {
+        return null;
+    }
+
+    public boolean hasPayload() {
+        return false;
+    }
+
+    public Source readPayloadAsSource() {
+        return null;
+    }
+
+    public XMLStreamReader readPayload() throws XMLStreamException {
+        return null;
+    }
+
+    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+        // noop
+    }
+
+    public void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        // noop
+    }
+
+    public Message copy() {
+        return new EmptyMessageImpl(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/FaultDetailHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/FaultDetailHeader.java
new file mode 100644
index 0000000..0c1d687
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/FaultDetailHeader.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.namespace.QName;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Arun Gupta
+ */
+public class FaultDetailHeader extends AbstractHeaderImpl {
+
+    private AddressingVersion av;
+    private String wrapper;
+    private String problemValue = null;
+
+    public FaultDetailHeader(AddressingVersion av, String wrapper, QName problemHeader) {
+        this.av = av;
+        this.wrapper = wrapper;
+        this.problemValue = problemHeader.toString();
+    }
+
+    public FaultDetailHeader(AddressingVersion av, String wrapper, String problemValue) {
+        this.av = av;
+        this.wrapper = wrapper;
+        this.problemValue = problemValue;
+    }
+
+    public
+    @NotNull
+    String getNamespaceURI() {
+        return av.nsUri;
+    }
+
+    public
+    @NotNull
+    String getLocalPart() {
+        return av.faultDetailTag.getLocalPart();
+    }
+
+    @Nullable
+    public String getAttribute(@NotNull String nsUri, @NotNull String localName) {
+        return null;
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        MutableXMLStreamBuffer buf = new MutableXMLStreamBuffer();
+        XMLStreamWriter w = buf.createFromXMLStreamWriter();
+        writeTo(w);
+        return buf.readAsXMLStreamReader();
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        w.writeStartElement("", av.faultDetailTag.getLocalPart(), av.faultDetailTag.getNamespaceURI());
+        w.writeDefaultNamespace(av.nsUri);
+        w.writeStartElement("", wrapper, av.nsUri);
+        w.writeCharacters(problemValue);
+        w.writeEndElement();
+        w.writeEndElement();
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        SOAPHeader header = saaj.getSOAPHeader();
+        SOAPHeaderElement she = header.addHeaderElement(av.faultDetailTag);
+        she = header.addHeaderElement(new QName(av.nsUri, wrapper));
+        she.addTextNode(problemValue);
+    }
+
+    public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
+        String nsUri = av.nsUri;
+        String ln = av.faultDetailTag.getLocalPart();
+
+        h.startPrefixMapping("",nsUri);
+        h.startElement(nsUri,ln,ln,EMPTY_ATTS);
+        h.startElement(nsUri,wrapper,wrapper,EMPTY_ATTS);
+        h.characters(problemValue.toCharArray(),0,problemValue.length());
+        h.endElement(nsUri,wrapper,wrapper);
+        h.endElement(nsUri,ln,ln);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/JAXBAttachment.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/JAXBAttachment.java
new file mode 100644
index 0000000..48c874c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/JAXBAttachment.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.util.ASCIIUtility;
+import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+import java.io.ByteArrayInputStream;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.bind.JAXBException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+public final class JAXBAttachment implements Attachment, DataSource {
+
+    private final String contentId;
+    private final String mimeType;
+    private final Object jaxbObject;
+    private final Bridge bridge;
+
+    public JAXBAttachment(@NotNull String contentId, Object jaxbObject, Bridge bridge, String mimeType) {
+        this.contentId = contentId;
+        this.jaxbObject = jaxbObject;
+        this.bridge = bridge;
+        this.mimeType = mimeType;
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public String getContentType() {
+        return mimeType;
+    }
+
+    public byte[] asByteArray() {
+        try {
+            return ASCIIUtility.getBytes(asInputStream());
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public DataHandler asDataHandler() {
+        return new DataHandler(this);
+    }
+
+    public Source asSource() {
+        return new StreamSource(asInputStream());
+    }
+
+    public InputStream asInputStream() {
+        ByteOutputStream bos = new ByteOutputStream();
+        try {
+            writeTo(bos);
+        } catch (IOException e) {
+            throw new WebServiceException(e);
+        }
+        return bos.newInputStream();
+    }
+
+    public void writeTo(OutputStream os) throws IOException {
+        try {
+            bridge.marshal(jaxbObject, os, null);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        AttachmentPart part = saaj.createAttachmentPart();
+        part.setDataHandler(asDataHandler());
+        part.setContentId(contentId);
+        saaj.addAttachmentPart(part);
+    }
+
+    public InputStream getInputStream() throws IOException {
+        return asInputStream();
+    }
+
+    public OutputStream getOutputStream() throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    public String getName() {
+        return null;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java
new file mode 100644
index 0000000..fba308a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.encoding.MimeMultipartParser;
+import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+import com.sun.xml.internal.ws.resources.EncodingMessages;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.ws.WebServiceException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.IOException;
+
+/**
+ * {@link AttachmentSet} backed by {@link com.sun.xml.internal.ws.encoding.MimeMultipartParser}
+ *
+ * @author Vivek Pandey
+ */
+public final class MimeAttachmentSet implements AttachmentSet {
+    private final MimeMultipartParser mpp;
+    private Map<String, Attachment> atts = new HashMap<String, Attachment>();
+
+
+    public MimeAttachmentSet(MimeMultipartParser mpp) {
+        this.mpp = mpp;
+    }
+
+    @Nullable
+    public Attachment get(String contentId) {
+        Attachment att;
+        /**
+         * First try to get the Attachment from internal map, maybe this attachment
+         * is added by the user.
+         */
+        att = atts.get(contentId);
+        if(att != null)
+            return att;
+        try {
+            /**
+             * Attachment is not found in the internal map, now do look in
+             * the mpp, if found add to the internal Attachment map.
+             */
+            att = mpp.getAttachmentPart(contentId);
+            if(att != null){
+                atts.put(contentId, att);
+            }
+        } catch (IOException e) {
+            throw new WebServiceException(EncodingMessages.NO_SUCH_CONTENT_ID(contentId), e);
+        }
+        return att;
+    }
+
+    /**
+     * This is expensive operation, its going to to read all the underlying
+     * attachments in {@link MimeMultipartParser}.
+     */
+    public boolean isEmpty() {
+        return atts.size() <= 0 && mpp.getAttachmentParts().isEmpty();
+    }
+
+    public void add(Attachment att) {
+        atts.put(att.getContentId(), att);
+    }
+
+    /**
+     * Expensive operation.
+     */
+    public Iterator<Attachment> iterator() {
+        /**
+         * Browse thru all the attachments in the mpp, add them to #atts,
+         * then return whether its empty.
+         */
+        Map<String, StreamAttachment> attachments = mpp.getAttachmentParts();
+        for(Map.Entry<String, StreamAttachment> att : attachments.entrySet()) {
+            if(atts.get(att.getKey()) == null){
+                atts.put(att.getKey(), att.getValue());
+            }
+        }
+
+        return atts.values().iterator();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ProblemActionHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ProblemActionHeader.java
new file mode 100644
index 0000000..1ee768a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ProblemActionHeader.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Header;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * {@link Header} that represents &lt;wsa:ProblemAction>
+ * @author Arun Gupta
+ */
+public class ProblemActionHeader extends AbstractHeaderImpl {
+    protected @NotNull String action;
+    protected String soapAction;
+    protected @NotNull AddressingVersion av;
+
+    private static final String actionLocalName = "Action";
+    private static final String soapActionLocalName = "SoapAction";
+
+    public ProblemActionHeader(@NotNull String action, @NotNull AddressingVersion av) {
+        this(action,null,av);
+    }
+
+    public ProblemActionHeader(@NotNull String action, String soapAction, @NotNull AddressingVersion av) {
+        assert action!=null;
+        assert av!=null;
+        this.action = action;
+        this.soapAction = soapAction;
+        this.av = av;
+    }
+
+    public
+    @NotNull
+    String getNamespaceURI() {
+        return av.nsUri;
+    }
+
+    public
+    @NotNull
+    String getLocalPart() {
+        return "ProblemAction";
+    }
+
+    @Nullable
+    public String getAttribute(@NotNull String nsUri, @NotNull String localName) {
+        return null;
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        MutableXMLStreamBuffer buf = new MutableXMLStreamBuffer();
+        XMLStreamWriter w = buf.createFromXMLStreamWriter();
+        writeTo(w);
+        return buf.readAsXMLStreamReader();
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        w.writeStartElement("", getLocalPart(), getNamespaceURI());
+        w.writeDefaultNamespace(getNamespaceURI());
+        w.writeStartElement(actionLocalName);
+        w.writeCharacters(action);
+        w.writeEndElement();
+        if (soapAction != null) {
+            w.writeStartElement(soapActionLocalName);
+            w.writeCharacters(soapAction);
+            w.writeEndElement();
+        }
+        w.writeEndElement();
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        SOAPHeader header = saaj.getSOAPHeader();
+        SOAPHeaderElement she = header.addHeaderElement(new QName(getNamespaceURI(), getLocalPart()));
+        she.addChildElement(actionLocalName);
+        she.addTextNode(action);
+        if (soapAction != null) {
+            she.addChildElement(soapActionLocalName);
+            she.addTextNode(soapAction);
+        }
+    }
+
+    public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
+        String nsUri = getNamespaceURI();
+        String ln = getLocalPart();
+
+        h.startPrefixMapping("",nsUri);
+        h.startElement(nsUri,ln,ln,EMPTY_ATTS);
+        h.startElement(nsUri,actionLocalName,actionLocalName,EMPTY_ATTS);
+        h.characters(action.toCharArray(),0,action.length());
+        h.endElement(nsUri,actionLocalName,actionLocalName);
+        if (soapAction != null) {
+            h.startElement(nsUri,soapActionLocalName,soapActionLocalName,EMPTY_ATTS);
+            h.characters(soapAction.toCharArray(),0,soapAction.length());
+            h.endElement(nsUri,soapActionLocalName,soapActionLocalName);
+        }
+        h.endElement(nsUri,ln,ln);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RelatesToHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RelatesToHeader.java
new file mode 100644
index 0000000..901fba4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RelatesToHeader.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * WS-Addressing &lt;RelatesTo> header.
+ *
+ * Used for outbound only.
+ *
+ * @author Arun Gupta
+ */
+public final class RelatesToHeader extends StringHeader {
+    protected String type;
+    private final QName typeAttributeName;
+
+    public RelatesToHeader(QName name, String messageId, String type) {
+        super(name, messageId);
+        this.type = type;
+        this.typeAttributeName = new QName(name.getNamespaceURI(), "type");
+    }
+
+    public RelatesToHeader(QName name, String mid) {
+        super(name, mid);
+        this.typeAttributeName = new QName(name.getNamespaceURI(), "type");
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    @Override
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        w.writeStartElement("", name.getLocalPart(), name.getNamespaceURI());
+        w.writeDefaultNamespace(name.getNamespaceURI());
+        if (type != null)
+            w.writeAttribute("type", type);
+        w.writeCharacters(value);
+        w.writeEndElement();
+    }
+
+    @Override
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        SOAPHeader header = saaj.getSOAPHeader();
+        SOAPHeaderElement she = header.addHeaderElement(name);
+
+        if (type != null)
+            she.addAttribute(typeAttributeName, type);
+        she.addTextNode(value);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RootElementSniffer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RootElementSniffer.java
new file mode 100644
index 0000000..95fd3a9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RootElementSniffer.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * Sniffs the root element name and its attributes from SAX events.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class RootElementSniffer extends DefaultHandler {
+    private String nsUri = "##error";
+    private String localName = "##error";
+    private Attributes atts;
+
+    private final boolean parseAttributes;
+
+    public RootElementSniffer(boolean parseAttributes) {
+        this.parseAttributes = parseAttributes;
+    }
+
+    public RootElementSniffer() {
+        this(true);
+    }
+
+    public void startElement(String uri, String localName, String qName, Attributes a) throws SAXException {
+        this.nsUri = uri;
+        this.localName = localName;
+
+        if(parseAttributes) {
+            if(a.getLength()==0)    // often there's no attribute
+                this.atts = EMPTY_ATTRIBUTES;
+            else
+                this.atts = new AttributesImpl(a);
+        }
+
+        // no need to parse any further.
+        throw aSAXException;
+    }
+
+    public String getNsUri() {
+        return nsUri;
+    }
+
+    public String getLocalName() {
+        return localName;
+    }
+
+    public Attributes getAttributes() {
+        return atts;
+    }
+
+    private static final SAXException aSAXException = new SAXException();
+    private static final Attributes EMPTY_ATTRIBUTES = new AttributesImpl();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/StringHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/StringHeader.java
new file mode 100644
index 0000000..0bddd28
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/StringHeader.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.ws.api.message.Header;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * {@link Header} that has a single text value in it
+ * (IOW, of the form &lt;foo>text&lt;/foo>.)
+ *
+ * @author Arun Gupta
+ */
+public class StringHeader extends AbstractHeaderImpl {
+    /**
+     * Tag name.
+     */
+    protected final QName name;
+    /**
+     * Header value.
+     */
+    protected final String value;
+
+    public StringHeader(QName name, String value) {
+        assert name != null;
+
+        this.name = name;
+        this.value = value;
+    }
+
+    public @NotNull String getNamespaceURI() {
+        return name.getNamespaceURI();
+    }
+
+    public @NotNull String getLocalPart() {
+        return name.getLocalPart();
+    }
+
+    @Nullable public String getAttribute(@NotNull String nsUri, @NotNull String localName) {
+        return null;
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        MutableXMLStreamBuffer buf = new MutableXMLStreamBuffer();
+        XMLStreamWriter w = buf.createFromXMLStreamWriter();
+        writeTo(w);
+        return buf.readAsXMLStreamReader();
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        w.writeStartElement("", name.getLocalPart(), name.getNamespaceURI());
+        w.writeDefaultNamespace(name.getNamespaceURI());
+        w.writeCharacters(value);
+        w.writeEndElement();
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        SOAPHeader header = saaj.getSOAPHeader();
+        SOAPHeaderElement she = header.addHeaderElement(name);
+        she.addTextNode(value);
+    }
+
+    public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
+        String nsUri = name.getNamespaceURI();
+        String ln = name.getLocalPart();
+
+        h.startPrefixMapping("",nsUri);
+        h.startElement(nsUri,ln,ln,EMPTY_ATTS);
+        h.characters(value.toCharArray(),0,value.length());
+        h.endElement(nsUri,ln,ln);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/Util.java
new file mode 100644
index 0000000..f4bccd2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/Util.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.Message;
+
+/**
+ * Utility code for the {@link Message} implementation.
+ */
+public abstract class Util {
+    /**
+     * Parses a stringthat represents a boolean into boolean.
+     * This method assumes that the whilespace normalization has already taken place.
+     *
+     * @param value
+     */
+    public static boolean parseBool(String value) {
+        if(value.length()==0)
+            return false;
+
+        char ch = value.charAt(0);
+        return ch=='t' || ch=='1';
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/XMLReaderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/XMLReaderImpl.java
new file mode 100644
index 0000000..7804985
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/XMLReaderImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.Message;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.transform.sax.SAXSource;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+final class XMLReaderImpl extends XMLFilterImpl {
+
+    private final Message msg;
+
+    XMLReaderImpl(Message msg) {
+        this.msg = msg;
+    }
+
+    public void parse(String systemId) {
+        reportError();
+    }
+
+    private void reportError() {
+        // TODO: i18n
+        throw new IllegalStateException(
+            "This is a special XMLReader implementation that only works with the InputSource given in SAXSource.");
+    }
+
+    public void parse(InputSource input) throws SAXException {
+        if(input!=THE_SOURCE)
+            reportError();
+        msg.writeTo(this,this);
+    }
+
+    @Override
+    public ContentHandler getContentHandler() {
+        if(super.getContentHandler()==DUMMY)   return null;
+        return super.getContentHandler();
+    }
+
+    @Override
+    public void setContentHandler(ContentHandler contentHandler) {
+        if(contentHandler==null)    contentHandler = DUMMY;
+        super.setContentHandler(contentHandler);
+    }
+
+    private static final ContentHandler DUMMY = new DefaultHandler();
+
+    /**
+     * Special {@link InputSource} instance that we use to pass to {@link SAXSource}.
+     */
+    protected static final InputSource THE_SOURCE = new InputSource();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java
new file mode 100644
index 0000000..29fe887
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/AttachmentMarshallerImpl.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.ws.WebServiceException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.util.UUID;
+
+/**
+ * Implementation of {@link AttachmentMarshaller}, its used from JAXBMessage to marshall swaref type
+ *
+ * @author Vivek Pandey
+ * @see JAXBMessage
+ */
+final class AttachmentMarshallerImpl extends AttachmentMarshaller {
+    private AttachmentSetImpl attachments;
+
+    public AttachmentMarshallerImpl(AttachmentSetImpl attachemnts) {
+        this.attachments = attachemnts;
+    }
+
+    /**
+     * Release a reference to user objects to avoid keeping it in memory.
+     */
+    void cleanup() {
+        attachments = null;
+    }
+
+    public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) {
+        // We don't use JAXB for handling XOP
+        throw new IllegalStateException();
+    }
+
+    public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) {
+        // We don't use JAXB for handling XOP
+        throw new IllegalStateException();
+    }
+
+    public String addSwaRefAttachment(DataHandler data) {
+        String cid = encodeCid(null);
+        Attachment att = new DataHandlerAttachment(cid, data);
+        attachments.add(att);
+        cid = "cid:" + cid;
+        return cid;
+    }
+
+    private String encodeCid(String ns) {
+        String cid = "example.jaxws.sun.com";
+        String name = UUID.randomUUID() + "@";
+        if (ns != null && (ns.length() > 0)) {
+            try {
+                URI uri = new URI(ns);
+                cid = uri.toURL().getHost();
+            } catch (URISyntaxException e) {
+                e.printStackTrace();
+                return null;
+            } catch (MalformedURLException e) {
+                try {
+                    cid = URLEncoder.encode(ns, "UTF-8");
+                } catch (UnsupportedEncodingException e1) {
+                    throw new WebServiceException(e);
+                }
+            }
+        }
+        return name + cid;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBBridgeSource.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBBridgeSource.java
new file mode 100644
index 0000000..3893293
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBBridgeSource.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import org.xml.sax.*;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+
+/**
+ * Wraps a bridge and JAXB object into a pseudo-{@link Source}.
+ * @author Kohsuke Kawaguchi
+ */
+final class JAXBBridgeSource extends SAXSource {
+
+    public JAXBBridgeSource( Bridge bridge, Object contentObject ) {
+        this.bridge = bridge;
+        this.contentObject = contentObject;
+
+        super.setXMLReader(pseudoParser);
+        // pass a dummy InputSource. We don't care
+        super.setInputSource(new InputSource());
+    }
+
+    private final Bridge bridge;
+    private final Object contentObject;
+
+    // this object will pretend as an XMLReader.
+    // no matter what parameter is specified to the parse method,
+    // it just parse the contentObject.
+    private final XMLReader pseudoParser = new XMLFilterImpl() {
+        public boolean getFeature(String name) throws SAXNotRecognizedException {
+            if(name.equals("http://xml.org/sax/features/namespaces"))
+                return true;
+            if(name.equals("http://xml.org/sax/features/namespace-prefixes"))
+                return false;
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
+            if(name.equals("http://xml.org/sax/features/namespaces") && value)
+                return;
+            if(name.equals("http://xml.org/sax/features/namespace-prefixes") && !value)
+                return;
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public Object getProperty(String name) throws SAXNotRecognizedException {
+            if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+                return lexicalHandler;
+            }
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public void setProperty(String name, Object value) throws SAXNotRecognizedException {
+            if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+                this.lexicalHandler = (LexicalHandler)value;
+                return;
+            }
+            throw new SAXNotRecognizedException(name);
+        }
+
+        private LexicalHandler lexicalHandler;
+
+        public void parse(InputSource input) throws SAXException {
+            parse();
+        }
+
+        public void parse(String systemId) throws  SAXException {
+            parse();
+        }
+
+        public void parse() throws SAXException {
+            // parses a content object by using the given bridge
+            // SAX events will be sent to the repeater, and the repeater
+            // will further forward it to an appropriate component.
+            try {
+                startDocument();
+                // this method only writes a fragment, so need start/end document
+                bridge.marshal( contentObject, this );
+                endDocument();
+            } catch( JAXBException e ) {
+                // wrap it to a SAXException
+                SAXParseException se =
+                    new SAXParseException( e.getMessage(),
+                        null, null, -1, -1, e );
+
+                // if the consumer sets an error handler, it is our responsibility
+                // to notify it.
+                fatalError(se);
+
+                // this is a fatal error. Even if the error handler
+                // returns, we will abort anyway.
+                throw se;
+            }
+        }
+    };
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java
new file mode 100644
index 0000000..579341a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.XMLStreamException2;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.message.AbstractHeaderImpl;
+import com.sun.xml.internal.ws.message.RootElementSniffer;
+import com.sun.xml.internal.ws.streaming.XMLStreamWriterUtil;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.util.JAXBResult;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.OutputStream;
+import java.util.Map;
+
+/**
+ * {@link Header} whose physical data representation is a JAXB bean.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class JAXBHeader extends AbstractHeaderImpl {
+
+    /**
+     * The JAXB object that represents the header.
+     */
+    private final Object jaxbObject;
+
+    private final Bridge bridge;
+
+    // information about this header. lazily obtained.
+    private String nsUri;
+    private String localName;
+    private Attributes atts;
+
+    /**
+     * Once the header is turned into infoset,
+     * this buffer keeps it.
+     */
+    private XMLStreamBuffer infoset;
+
+    public JAXBHeader(JAXBRIContext context, Object jaxbObject) {
+        this.jaxbObject = jaxbObject;
+        this.bridge = new MarshallerBridge(context);
+
+        if (jaxbObject instanceof JAXBElement) {
+            JAXBElement e = (JAXBElement) jaxbObject;
+            this.nsUri = e.getName().getNamespaceURI();
+            this.localName = e.getName().getLocalPart();
+        }
+    }
+
+    public JAXBHeader(Bridge bridge, Object jaxbObject) {
+        this.jaxbObject = jaxbObject;
+        this.bridge = bridge;
+
+        QName tagName = bridge.getTypeReference().tagName;
+        this.nsUri = tagName.getNamespaceURI();
+        this.localName = tagName.getLocalPart();
+    }
+
+    /**
+     * Lazily parse the first element to obtain attribute values on it.
+     */
+    private void parse() {
+        RootElementSniffer sniffer = new RootElementSniffer();
+        try {
+            bridge.marshal(jaxbObject,sniffer);
+        } catch (JAXBException e) {
+            // if it's due to us aborting the processing after the first element,
+            // we can safely ignore this exception.
+            //
+            // if it's due to error in the object, the same error will be reported
+            // when the readHeader() method is used, so we don't have to report
+            // an error right now.
+            nsUri = sniffer.getNsUri();
+            localName = sniffer.getLocalName();
+            atts = sniffer.getAttributes();
+        }
+    }
+
+
+    public @NotNull String getNamespaceURI() {
+        if(nsUri==null)
+            parse();
+        return nsUri;
+    }
+
+    public @NotNull String getLocalPart() {
+        if(localName==null)
+            parse();
+        return localName;
+    }
+
+    public String getAttribute(String nsUri, String localName) {
+        if(atts==null)
+            parse();
+        return atts.getValue(nsUri,localName);
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        try {
+            if(infoset==null) {
+                XMLStreamBufferResult sbr = new XMLStreamBufferResult();
+                bridge.marshal(jaxbObject,sbr);
+                infoset = sbr.getXMLStreamBuffer();
+            }
+            return infoset.readAsXMLStreamReader();
+        } catch (JAXBException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        JAXBResult r = new JAXBResult(unmarshaller);
+        bridge.marshal(jaxbObject,r);
+        return (T)r.getResult();
+    }
+
+    public <T> T readAsJAXB(Bridge<T> bridge) throws JAXBException {
+        return bridge.unmarshal(new JAXBBridgeSource(this.bridge,jaxbObject));
+    }
+
+    public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
+        try {
+            // Get output stream and use JAXB UTF-8 writer
+            OutputStream os = XMLStreamWriterUtil.getOutputStream(sw);
+            if (os != null) {
+                bridge.marshal(jaxbObject, os, sw.getNamespaceContext());
+            } else {
+                bridge.marshal(jaxbObject,sw);
+            }
+        } catch (JAXBException e) {
+            throw new XMLStreamException2(e);
+        }
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        try {
+            bridge.marshal(jaxbObject,saaj.getSOAPHeader());
+        } catch (JAXBException e) {
+            throw new SOAPException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        try {
+            bridge.marshal(jaxbObject,contentHandler);
+        } catch (JAXBException e) {
+            SAXParseException x = new SAXParseException(e.getMessage(),null,null,-1,-1,e);
+            errorHandler.fatalError(x);
+            throw x;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java
new file mode 100644
index 0000000..f623226
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java
@@ -0,0 +1,313 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.istack.internal.FragmentContentHandler;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.message.AbstractMessageImpl;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.RootElementSniffer;
+import com.sun.xml.internal.ws.message.stream.StreamMessage;
+import com.sun.xml.internal.ws.streaming.XMLStreamWriterUtil;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.util.JAXBResult;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.ws.WebServiceException;
+import java.io.OutputStream;
+import java.util.Map;
+
+/**
+ * {@link Message} backed by a JAXB bean.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class JAXBMessage extends AbstractMessageImpl {
+    private HeaderList headers;
+
+    /**
+     * The JAXB object that represents the header.
+     */
+    private final Object jaxbObject;
+
+    private final AttachmentSetImpl attachmentSet;
+
+    private final Bridge bridge;
+
+    /**
+     * Lazily sniffed payload element name
+     */
+    private String nsUri,localName;
+
+    /**
+     * If we have the infoset representation for the payload, this field is non-null.
+     */
+    private XMLStreamBuffer infoset;
+
+    /**
+     * Creates a {@link Message} backed by a JAXB bean.
+     *
+     * @param context
+     *      The JAXBContext to be used for marshalling.
+     * @param jaxbObject
+     *      The JAXB object that represents the payload. must not be null. This object
+     *      must be bound to an element (which means it either is a {@link JAXBElement} or
+     *      an instanceof a class with {@link XmlRootElement}).
+     * @param soapVersion
+     *      The SOAP version of the message. Must not be null.
+     */
+    public static Message create(JAXBRIContext context, Object jaxbObject, SOAPVersion soapVersion) {
+        if(!context.hasSwaRef()) {
+            return new JAXBMessage(context,jaxbObject,soapVersion);
+        }
+
+        // If we have swaRef, then that means we might have attachments.
+        // to comply with the packet API, we need to eagerly turn the JAXB object into infoset
+        // to correctly find out about attachments.
+
+        try {
+            MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+
+            Marshaller m = context.createMarshaller();
+            AttachmentSetImpl attachments = new AttachmentSetImpl();
+            AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachments);
+            m.setAttachmentMarshaller(am);
+            am.cleanup();
+            m.marshal(jaxbObject,xsb.createFromXMLStreamWriter());
+
+            // any way to reuse this XMLStreamBuffer in StreamMessage?
+            return new StreamMessage(null,attachments,xsb.readAsXMLStreamReader(),soapVersion);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    private JAXBMessage( JAXBRIContext context, Object jaxbObject, SOAPVersion soapVer ) {
+        super(soapVer);
+        this.bridge = new MarshallerBridge(context);
+        this.jaxbObject = jaxbObject;
+        this.attachmentSet = new AttachmentSetImpl();
+    }
+
+    /**
+     * Creates a {@link Message} backed by a JAXB bean.
+     *
+     * @param bridge
+     *      Specify the payload tag name and how <tt>jaxbObject</tt> is bound.
+     * @param jaxbObject
+     */
+    public static Message create(Bridge bridge, Object jaxbObject, SOAPVersion soapVer) {
+        if(!bridge.getContext().hasSwaRef()) {
+            return new JAXBMessage(bridge,jaxbObject,soapVer);
+        }
+
+        // If we have swaRef, then that means we might have attachments.
+        // to comply with the packet API, we need to eagerly turn the JAXB object into infoset
+        // to correctly find out about attachments.
+
+        try {
+            MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+
+            AttachmentSetImpl attachments = new AttachmentSetImpl();
+            AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachments);
+            bridge.marshal(jaxbObject,xsb.createFromXMLStreamWriter(), am);
+            am.cleanup();
+
+            // any way to reuse this XMLStreamBuffer in StreamMessage?
+            return new StreamMessage(null,attachments,xsb.readAsXMLStreamReader(),soapVer);
+        } catch (JAXBException e) {
+            throw new WebServiceException(e);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    private JAXBMessage(Bridge bridge, Object jaxbObject, SOAPVersion soapVer) {
+        super(soapVer);
+        // TODO: think about a better way to handle BridgeContext
+        this.bridge = bridge;
+        this.jaxbObject = jaxbObject;
+        QName tagName = bridge.getTypeReference().tagName;
+        this.nsUri = tagName.getNamespaceURI();
+        this.localName = tagName.getLocalPart();
+        this.attachmentSet = new AttachmentSetImpl();
+    }
+
+    /**
+     * Copy constructor.
+     */
+    public JAXBMessage(JAXBMessage that) {
+        super(that);
+        this.headers = that.headers;
+        if(this.headers!=null)
+            this.headers = new HeaderList(this.headers);
+        this.attachmentSet = that.attachmentSet;
+
+        this.jaxbObject = that.jaxbObject;
+        this.bridge = that.bridge;
+    }
+
+    @Override
+    public @NotNull AttachmentSet getAttachments() {
+        return attachmentSet;
+    }
+
+    public boolean hasHeaders() {
+        return headers!=null && !headers.isEmpty();
+    }
+
+    public HeaderList getHeaders() {
+        if(headers==null)
+            headers = new HeaderList();
+        return headers;
+    }
+
+    public String getPayloadLocalPart() {
+        if(localName==null)
+            sniff();
+        return localName;
+    }
+
+    public String getPayloadNamespaceURI() {
+        if(nsUri==null)
+            sniff();
+        return nsUri;
+    }
+
+    public boolean hasPayload() {
+        return true;
+    }
+
+    /**
+     * Obtains the tag name of the root element.
+     */
+    private void sniff() {
+        RootElementSniffer sniffer = new RootElementSniffer(false);
+        try {
+            bridge.marshal(jaxbObject,sniffer);
+        } catch (JAXBException e) {
+            // if it's due to us aborting the processing after the first element,
+            // we can safely ignore this exception.
+            //
+            // if it's due to error in the object, the same error will be reported
+            // when the readHeader() method is used, so we don't have to report
+            // an error right now.
+            nsUri = sniffer.getNsUri();
+            localName = sniffer.getLocalName();
+        }
+    }
+
+    public Source readPayloadAsSource() {
+        return new JAXBBridgeSource(bridge,jaxbObject);
+    }
+
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        JAXBResult out = new JAXBResult(unmarshaller);
+        // since the bridge only produces fragments, we need to fire start/end document.
+        try {
+            out.getHandler().startDocument();
+            bridge.marshal(jaxbObject,out);
+            out.getHandler().endDocument();
+        } catch (SAXException e) {
+            throw new JAXBException(e);
+        }
+        return (T)out.getResult();
+    }
+
+    public XMLStreamReader readPayload() throws XMLStreamException {
+       try {
+            if(infoset==null) {
+                XMLStreamBufferResult sbr = new XMLStreamBufferResult();
+                bridge.marshal(jaxbObject,sbr);
+                infoset = sbr.getXMLStreamBuffer();
+            }
+            return infoset.readAsXMLStreamReader();
+        } catch (JAXBException e) {
+           // bug 6449684, spec 4.3.4
+           throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * Writes the payload as SAX events.
+     */
+    protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        try {
+            if(fragment)
+                contentHandler = new FragmentContentHandler(contentHandler);
+            AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachmentSet);
+            bridge.marshal(jaxbObject,contentHandler, am);
+            am.cleanup();
+        } catch (JAXBException e) {
+            // this is really more helpful but spec compliance
+            // errorHandler.fatalError(new SAXParseException(e.getMessage(),NULL_LOCATOR,e));
+            // bug 6449684, spec 4.3.4
+            throw new WebServiceException(e.getMessage(),e);
+        }
+    }
+
+    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+        try {
+            AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachmentSet);
+            // Get output stream and use JAXB UTF-8 writer
+            OutputStream os = XMLStreamWriterUtil.getOutputStream(sw);
+            if (os != null) {
+                bridge.marshal(jaxbObject, os, sw.getNamespaceContext(),am);
+            } else {
+                bridge.marshal(jaxbObject,sw,am);
+            }
+            am.cleanup();
+        } catch (JAXBException e) {
+            // bug 6449684, spec 4.3.4
+            throw new WebServiceException(e);
+        }
+    }
+
+    public Message copy() {
+        return new JAXBMessage(this);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java
new file mode 100644
index 0000000..d41d155
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Used to adapt {@link Marshaller} into a {@link Bridge}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class MarshallerBridge extends Bridge {
+    public MarshallerBridge(JAXBRIContext context) {
+        super((JAXBContextImpl)context);
+    }
+
+    public void marshal(Marshaller m, Object object, XMLStreamWriter output) throws JAXBException {
+        m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+        try {
+            m.marshal(object,output);
+        } finally {
+            m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+        }
+    }
+
+    public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException {
+        m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+        try {
+            m.marshal(object,output);
+        } finally {
+            m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+        }
+    }
+
+    public void marshal(Marshaller m, Object object, Node output) throws JAXBException {
+        m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+        try {
+            m.marshal(object,output);
+        } finally {
+            m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+        }
+    }
+
+    public void marshal(Marshaller m, Object object, ContentHandler contentHandler) throws JAXBException {
+        m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+        try {
+            m.marshal(object,contentHandler);
+        } finally {
+            m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+        }
+    }
+
+    public void marshal(Marshaller m, Object object, Result result) throws JAXBException {
+        m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+        try {
+            m.marshal(object,result);
+        } finally {
+            m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+        }
+    }
+
+    public Object unmarshal(Unmarshaller u, XMLStreamReader in) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Object unmarshal(Unmarshaller u, Source in) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Object unmarshal(Unmarshaller u, InputStream in) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Object unmarshal(Unmarshaller u, Node n) {
+        throw new UnsupportedOperationException();
+    }
+
+    public TypeReference getTypeReference() {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/package-info.java
new file mode 100644
index 0000000..d958689
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/package-info.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * {@link com.sun.xml.internal.ws.api.message.Message} implementation for JAXB.
+ *
+ * <pre>
+ * TODO:
+ *      Because a producer of a message doesn't generally know
+ *      when a message is consumed, it's difficult for
+ *      the caller to do a proper instance caching. Perhaps
+ *      there should be a layer around JAXBContext that does that?
+ * </pre>
+ */
+package com.sun.xml.internal.ws.message.jaxb;
+
+import com.sun.xml.internal.ws.api.message.Message;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/package-info.java
new file mode 100644
index 0000000..4676f5b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * {@link Message} implementations.
+ */
+package com.sun.xml.internal.ws.message;
+
+import com.sun.xml.internal.ws.api.message.Message;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJHeader.java
new file mode 100644
index 0000000..b522963
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJHeader.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.saaj;
+
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.message.DOMHeader;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.soap.SOAPHeaderElement;
+
+/**
+ * {@link Header} for {@link SOAPHeaderElement}.
+ *
+ * @author Vivek Pandey
+ */
+public final class SAAJHeader extends DOMHeader<SOAPHeaderElement> {
+    public SAAJHeader(SOAPHeaderElement header) {
+        // we won't rely on any of the super class method that uses SOAPVersion,
+        // so we can just pass in a dummy version
+        super(header);
+    }
+
+    public
+    @NotNull
+    String getRole(@NotNull SOAPVersion soapVersion) {
+        String v = getAttribute(soapVersion.nsUri, soapVersion.roleAttributeName);
+        if(v==null || v.equals(""))
+            v = soapVersion.implicitRole;
+        return v;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java
new file mode 100644
index 0000000..cdb198e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java
@@ -0,0 +1,504 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.saaj;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.XMLStreamException2;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl;
+import com.sun.xml.internal.ws.streaming.DOMStreamReader;
+import com.sun.xml.internal.ws.util.DOMUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * {@link Message} implementation backed by {@link SOAPMessage}.
+ *
+ * @author Vivek Pandey
+ */
+public class SAAJMessage extends Message {
+    private final SOAPMessage sm;
+    private HeaderList headers;
+    private String payloadLocalName;
+    private String payloadNamspace;
+    private List<Element> bodyParts;
+    private Element payload;
+
+    private boolean parsedHeader;
+
+    public SAAJMessage(SOAPMessage sm) {
+        this.sm = sm;
+
+        try {
+            Node body = sm.getSOAPBody();
+            //cature all the body elements
+            bodyParts = DOMUtil.getChildElements(body);
+
+            //we treat payload as the first body part
+            payload = bodyParts.size() > 0? bodyParts.get(0):null;
+            // hope this is correct. Caching the localname and namespace of the payload should be fine
+            // but what about if a Handler replaces the payload with something else? Weel, may be it
+            // will be error condition anyway
+            if (payload != null) {
+                payloadLocalName = payload.getLocalName();
+                payloadNamspace = payload.getNamespaceURI();
+            }
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * This constructor is a convenience and called by the {@link #copy}
+     * @param headers
+     * @param sm
+     */
+    private SAAJMessage(HeaderList headers, AttachmentSet as, SOAPMessage sm) {
+        this(sm);
+        this.headers = headers;
+        this.attachmentSet = as;
+    }
+
+    public boolean hasHeaders() {
+        return getHeaders().size() > 0;
+    }
+
+    /**
+     * Gets all the headers of this message.
+     *
+     * @return always return the same non-null object.
+     */
+    public HeaderList getHeaders() {
+        if (parsedHeader)
+            return headers;
+
+        if (headers == null)
+            headers = new HeaderList();
+
+        try {
+            SOAPHeader header = sm.getSOAPHeader();
+            if(header!=null) {
+                Iterator iter = header.examineAllHeaderElements();
+                while (iter.hasNext()) {
+                    headers.add(new SAAJHeader((SOAPHeaderElement) iter.next()));
+                }
+            }
+            parsedHeader = true;
+        } catch (SOAPException e) {
+            e.printStackTrace();
+        }
+        return headers;
+    }
+
+    /**
+     * Gets the attachments of this message
+     * (attachments live outside a message.)
+     */
+    @Override
+    @NotNull
+    public AttachmentSet getAttachments() {
+        if (attachmentSet == null)
+            attachmentSet = new SAAJAttachmentSet(sm);
+        return attachmentSet;
+    }
+
+    protected boolean hasAttachments() {
+        return !getAttachments().isEmpty();
+    }
+
+    /**
+     * Gets the local name of the payload element.
+     */
+    public String getPayloadLocalPart() {
+        return payloadLocalName;
+    }
+
+    /**
+     * Gets the namespace URI of the payload element.
+     */
+    public String getPayloadNamespaceURI() {
+        return payloadNamspace;
+    }
+
+    public boolean hasPayload() {
+        return payloadNamspace!=null;
+    }
+
+    /**
+     * Consumes this message including the envelope.
+     * returns it as a {@link javax.xml.transform.Source} object.
+     */
+    public Source readEnvelopeAsSource() {
+        try {
+            SOAPEnvelope se = sm .getSOAPPart().getEnvelope();
+            return new DOMSource(se);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * Returns the payload as a {@link javax.xml.transform.Source} object.
+     *
+     * Can't really give all the body parts inside soapenv:Body as Source
+     * cant take only one part.
+     *
+     * <p/>
+     * This consumes the message.
+     */
+    public Source readPayloadAsSource() {
+        return (payload != null) ? new DOMSource(payload) : null;
+    }
+
+    /**
+     * Creates the equivalent {@link javax.xml.soap.SOAPMessage} from this message.
+     * <p/>
+     * This consumes the message.
+     */
+    public SOAPMessage readAsSOAPMessage() {
+        return sm;
+    }
+
+    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
+        return sm;
+    }
+
+    /**
+     * Reads the payload as a JAXB object by using the given unmarshaller.
+     * <p/>
+     * This consumes the message.
+     */
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        try {
+            Node pn = sm.getSOAPBody().getFirstChild();
+            if (pn != null)
+                return (T) unmarshaller.unmarshal(pn);
+            return null;
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+        try {
+            Node pn = sm.getSOAPBody().getFirstChild();
+            if (pn != null)
+                return bridge.unmarshal(pn,
+                    new AttachmentUnmarshallerImpl(getAttachments()));
+            return null;
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * Reads the payload as a {@link javax.xml.stream.XMLStreamReader}
+     * <p/>
+     * This consumes the message.
+     */
+    public XMLStreamReader readPayload() throws XMLStreamException {
+        if(payload==null)
+            return null;
+
+        DOMStreamReader dss = new DOMStreamReader();
+        dss.setCurrentNode(payload);
+        dss.nextTag();
+        assert dss.getEventType()==XMLStreamReader.START_ELEMENT;
+        return dss;
+    }
+
+    /**
+     * Writes the payload to StAX.
+     * <p/>
+     * This method writes just the payload of the message to the writer.
+     * This consumes the message.
+     */
+    public void writePayloadTo(XMLStreamWriter sw) {
+        try {
+            for(Element part: bodyParts)
+                DOMUtil.serializeNode(part, sw);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        DOMScanner ds = new DOMScanner();
+        ds.setContentHandler(contentHandler);
+        ds.scan(sm.getSOAPPart());
+    }
+
+    /**
+     * Creates a copy of a {@link com.sun.xml.internal.ws.api.message.Message}.
+     * <p/>
+     * <p/>
+     * This method creates a new {@link com.sun.xml.internal.ws.api.message.Message} whose header/payload/attachments/properties
+     * are identical to this {@link com.sun.xml.internal.ws.api.message.Message}. Once created, the created {@link com.sun.xml.internal.ws.api.message.Message}
+     * and the original {@link com.sun.xml.internal.ws.api.message.Message} behaves independently --- adding header/
+     * attachment to one {@link com.sun.xml.internal.ws.api.message.Message} doesn't affect another {@link com.sun.xml.internal.ws.api.message.Message}
+     * at all.
+     * <p/>
+     * <h3>Design Rationale</h3>
+     * <p/>
+     * Since a {@link com.sun.xml.internal.ws.api.message.Message} body is read-once, sometimes
+     * (such as when you do fail-over, or WS-RM) you need to
+     * create an idential copy of a {@link com.sun.xml.internal.ws.api.message.Message}.
+     * <p/>
+     * <p/>
+     * The actual copy operation depends on the layout
+     * of the data in memory, hence it's best to be done by
+     * the {@link com.sun.xml.internal.ws.api.message.Message} implementation itself.
+     */
+    public Message copy() {
+        try {
+            SOAPBody sb = sm.getSOAPPart().getEnvelope().getBody();
+            SOAPMessage msg = SOAPVersion.fromNsUri(sb.getNamespaceURI()).saajMessageFactory.createMessage();
+            SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody();
+            for(Element part: bodyParts){
+                Node n = newBody.getOwnerDocument().importNode(part, true);
+                newBody.appendChild(n);
+            }
+            return new SAAJMessage(getHeaders(), getAttachments(), msg);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+
+    private class SAAJAttachment implements Attachment {
+
+        AttachmentPart ap;
+
+        public SAAJAttachment(AttachmentPart part) {
+            this.ap = part;
+        }
+
+        /**
+         * Content ID of the attachment. Uniquely identifies an attachment.
+         */
+        public String getContentId() {
+            return ap.getContentId();
+        }
+
+        /**
+         * Gets the MIME content-type of this attachment.
+         */
+        public String getContentType() {
+            return ap.getContentType();
+        }
+
+        /**
+         * Gets the attachment as an exact-length byte array.
+         */
+        public byte[] asByteArray() {
+            try {
+                return ap.getRawContentBytes();
+            } catch (SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Gets the attachment as a {@link javax.activation.DataHandler}.
+         */
+        public DataHandler asDataHandler() {
+            try {
+                return ap.getDataHandler();
+            } catch (SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Gets the attachment as a {@link javax.xml.transform.Source}.
+         * Note that there's no guarantee that the attachment is actually an XML.
+         */
+        public Source asSource() {
+            try {
+                return new StreamSource(ap.getRawContent());
+            } catch (SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Obtains this attachment as an {@link java.io.InputStream}.
+         */
+        public InputStream asInputStream() {
+            try {
+                return ap.getRawContent();
+            } catch (SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Writes the contents of the attachment into the given stream.
+         */
+        public void writeTo(OutputStream os) throws IOException {
+            os.write(asByteArray());
+        }
+
+        /**
+         * Writes this attachment to the given {@link javax.xml.soap.SOAPMessage}.
+         */
+        public void writeTo(SOAPMessage saaj) {
+            saaj.addAttachmentPart(ap);
+        }
+
+        AttachmentPart asAttachmentPart(){
+            return ap;
+        }
+    }
+
+    /**
+     * {@link AttachmentSet} for SAAJ.
+     *
+     * SAAJ wants '&lt;' and '>' for the content ID, but {@link AttachmentSet}
+     * doesn't. S this class also does the conversion between them.
+     */
+    private class SAAJAttachmentSet implements AttachmentSet {
+
+        private Map<String, Attachment> attMap;
+        private Iterator attIter;
+
+        public SAAJAttachmentSet(SOAPMessage sm) {
+            attIter = sm.getAttachments();
+        }
+
+        /**
+         * Gets the attachment by the content ID.
+         *
+         * @return null
+         *         if no such attachment exist.
+         */
+        public Attachment get(String contentId) {
+            // if this is the first time then create the attachment Map
+            if (attMap == null) {
+                if (!attIter.hasNext())
+                    return null;
+                attMap = createAttachmentMap();
+            }
+            if(contentId.charAt(0) != '<'){
+                return attMap.get('<'+contentId+'>');
+            }
+            return attMap.get(contentId);
+        }
+
+        public boolean isEmpty() {
+            if(attMap!=null)
+                return attMap.isEmpty();
+            else
+                return !attIter.hasNext();
+        }
+
+        /**
+         * Returns an iterator over a set of elements of type T.
+         *
+         * @return an Iterator.
+         */
+        public Iterator<Attachment> iterator() {
+            if (attMap == null) {
+                attMap = createAttachmentMap();
+            }
+            return attMap.values().iterator();
+        }
+
+        private Map<String, Attachment> createAttachmentMap() {
+            HashMap<String, Attachment> map = new HashMap<String, Attachment>();
+            while (attIter.hasNext()) {
+                AttachmentPart ap = (AttachmentPart) attIter.next();
+                map.put(ap.getContentId(), new SAAJAttachment(ap));
+            }
+            return map;
+        }
+
+        public void add(Attachment att) {
+            attMap.put('<'+att.getContentId()+'>', att);
+        }
+    }
+
+
+    public void writeTo( XMLStreamWriter writer ) throws XMLStreamException {
+        try {
+            writer.writeStartDocument();
+            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
+            DOMUtil.writeTagWithAttributes(env, writer);
+            if(hasHeaders()) {
+                writer.writeStartElement(env.getPrefix(),"Header",env.getNamespaceURI());
+                int len = headers.size();
+                for( int i=0; i<len; i++ ) {
+                    headers.get(i).writeTo(writer);
+                }
+                writer.writeEndElement();
+            }
+
+            DOMUtil.serializeNode(sm.getSOAPBody(),writer);
+            writer.writeEndElement();
+            writer.writeEndDocument();
+            writer.flush();
+        } catch (SOAPException ex) {
+            throw new XMLStreamException2(ex);
+            //for now. ask jaxws team what to do.
+        }
+
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java
new file mode 100644
index 0000000..581edc7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.source;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.xml.internal.ws.message.stream.PayloadStreamReaderMessage;
+import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
+
+import javax.xml.transform.Source;
+
+/**
+ * {@link Message} backed by {@link Source} as payload
+ *
+ * @author Vivek Pandey
+ */
+public class PayloadSourceMessage extends PayloadStreamReaderMessage {
+
+    public PayloadSourceMessage(@Nullable HeaderList headers,
+        @NotNull Source payload, @NotNull AttachmentSet attSet,
+        @NotNull SOAPVersion soapVersion) {
+
+        super(headers, SourceReaderFactory.createSourceReader(payload, true),
+                attSet, soapVersion);
+    }
+
+    public PayloadSourceMessage(Source s, SOAPVersion soapVer) {
+        this(null, s, new AttachmentSetImpl(), soapVer);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/ProtocolSourceMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/ProtocolSourceMessage.java
new file mode 100644
index 0000000..dfb26ee
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/ProtocolSourceMessage.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.source;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.pipe.Codecs;
+import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+
+/**
+ * Implementation of {@link Message} backed by {@link Source} where the Source
+ * represents the complete message such as a SOAP envelope. It uses
+ * {@link StreamSOAPCodec} to create a {@link Message} and uses it as a
+ * delegate for all the methods.
+ *
+ * @author Vivek Pandey
+ * @author Jitendra Kotamraju
+ */
+public class ProtocolSourceMessage extends Message {
+    private final Message sm;
+
+    public ProtocolSourceMessage(Source source, SOAPVersion soapVersion) {
+        XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true);
+        com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec codec = Codecs.createSOAPEnvelopeXmlCodec(soapVersion);
+        sm = codec.decode(reader);
+    }
+
+    public boolean hasHeaders() {
+        return sm.hasHeaders();
+    }
+
+    public HeaderList getHeaders() {
+        return sm.getHeaders();
+    }
+
+    public String getPayloadLocalPart() {
+        return sm.getPayloadLocalPart();
+    }
+
+    public String getPayloadNamespaceURI() {
+        return sm.getPayloadNamespaceURI();
+    }
+
+    public boolean hasPayload() {
+        return sm.hasPayload();
+    }
+
+    public Source readPayloadAsSource() {
+        return sm.readPayloadAsSource();
+    }
+
+    public XMLStreamReader readPayload() throws XMLStreamException {
+        return sm.readPayload();
+    }
+
+    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+        sm.writePayloadTo(sw);
+    }
+
+    public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
+        sm.writeTo(sw);
+    }
+
+    public Message copy() {
+        return sm.copy();
+    }
+
+    public Source readEnvelopeAsSource() {
+        return sm.readEnvelopeAsSource();
+    }
+
+    public SOAPMessage readAsSOAPMessage() throws SOAPException {
+        return sm.readAsSOAPMessage();
+    }
+
+    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
+        return sm.readAsSOAPMessage(packet, inbound);
+    }
+
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        return (T)sm.readPayloadAsJAXB(unmarshaller);
+    }
+
+    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+        return sm.readPayloadAsJAXB(bridge);
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        sm.writeTo(contentHandler, errorHandler);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/SourceUtils.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/SourceUtils.java
new file mode 100644
index 0000000..8cdc7a4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/SourceUtils.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.source;
+
+import com.sun.xml.internal.ws.message.RootElementSniffer;
+import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.WebServiceException;
+
+/**
+ *
+ * @author Vivek Pandey
+ */
+final class SourceUtils {
+
+    int srcType;
+
+    private final int domSource = 1;
+    private final int streamSource = 2;
+    private final int saxSource=4;
+
+    public SourceUtils(Source src) {
+        if(src instanceof StreamSource){
+            srcType = streamSource;
+        }else if(src instanceof DOMSource){
+            srcType = domSource;
+        }else if(src instanceof SAXSource){
+            srcType = saxSource;
+        }
+    }
+
+    public boolean isDOMSource(){
+        return (srcType&domSource) == domSource;
+    }
+
+    public boolean isStreamSource(){
+        return (srcType&streamSource) == streamSource;
+    }
+
+    public boolean isSaxSource(){
+        return (srcType&saxSource) == saxSource;
+    }
+
+    /**
+     * This would peek into the Source (DOMSource and SAXSource) for the localName and NamespaceURI
+     * of the top-level element.
+     * @param src
+     * @return QName of the payload
+     */
+    public QName sniff(Source src) {
+        return sniff(src, new RootElementSniffer());
+    }
+
+    public QName sniff(Source src, RootElementSniffer sniffer){
+        String localName = null;
+        String namespaceUri = null;
+
+        if(isDOMSource()){
+            DOMSource domSource = (DOMSource)src;
+            Node n = domSource.getNode();
+            if(n.getNodeType()== Node.DOCUMENT_NODE) {
+                n = ((Document)n).getDocumentElement();
+            }
+            localName = n.getLocalName();
+            namespaceUri = n.getNamespaceURI();
+        }else if(isSaxSource()){
+            SAXSource saxSrc = (SAXSource)src;
+            SAXResult saxResult = new SAXResult(sniffer);
+            try {
+                Transformer tr = XmlUtil.newTransformer();
+                tr.transform(saxSrc, saxResult);
+            } catch (TransformerConfigurationException e) {
+                throw new WebServiceException(e);
+            } catch (TransformerException e) {
+                // if it's due to aborting the processing after the first element,
+                // we can safely ignore this exception.
+                //
+                // if it's due to error in the object, the same error will be reported
+                // when the readHeader() method is used, so we don't have to report
+                // an error right now.
+                localName = sniffer.getLocalName();
+                namespaceUri = sniffer.getNsUri();
+            }
+        }
+        return new QName(namespaceUri, localName);
+    }
+
+    public static void serializeSource(Source src, XMLStreamWriter writer) throws XMLStreamException {
+        XMLStreamReader reader = SourceReaderFactory.createSourceReader(src, true);
+        int state;
+        do {
+            state = reader.next();
+            switch (state) {
+                case XMLStreamConstants.START_ELEMENT:
+                    /*
+                     * TODO: Is this necessary, shouldn't zephyr return "" instead of
+                     * null for getNamespaceURI() and getPrefix()?
+                     */
+                    String uri = reader.getNamespaceURI();
+                    String prefix = reader.getPrefix();
+                    String localName = reader.getLocalName();
+
+                    if (prefix == null) {
+                        if (uri == null) {
+                            writer.writeStartElement(localName);
+                        } else {
+                            writer.writeStartElement(uri, localName);
+                        }
+                    } else {
+                        assert uri != null;
+
+                        if(prefix.length() > 0){
+                            /**
+                             * Before we write the
+                             */
+                            String writerURI = null;
+                            if (writer.getNamespaceContext() != null)
+                                writerURI = writer.getNamespaceContext().getNamespaceURI(prefix);
+                            String writerPrefix = writer.getPrefix(uri);
+                            if(declarePrefix(prefix, uri, writerPrefix, writerURI)){
+                                writer.writeStartElement(prefix, localName, uri);
+                                writer.setPrefix(prefix, uri != null ? uri : "");
+                                writer.writeNamespace(prefix, uri);
+                            }else{
+                                writer.writeStartElement(prefix, localName, uri);
+                            }
+                        }else{
+                            writer.writeStartElement(prefix, localName, uri);
+                        }
+                    }
+
+                    int n = reader.getNamespaceCount();
+                    // Write namespace declarations
+                    for (int i = 0; i < n; i++) {
+                        String nsPrefix = reader.getNamespacePrefix(i);
+                        if (nsPrefix == null) nsPrefix = "";
+                        // StAX returns null for default ns
+                        String writerURI = null;
+                        if (writer.getNamespaceContext() != null)
+                            writerURI = writer.getNamespaceContext().getNamespaceURI(nsPrefix);
+
+                        // Zephyr: Why is this returning null?
+                        // Compare nsPrefix with prefix because of [1] (above)
+                        String readerURI = reader.getNamespaceURI(i);
+
+                        /**
+                         * write the namespace in 3 conditions
+                         *  - when the namespace URI is not bound to the prefix in writer(writerURI == 0)
+                         *  - when the readerPrefix and writerPrefix are ""
+                         *  - when readerPrefix and writerPrefix are not equal and the URI bound to them
+                         *    are different
+                         */
+                        if (writerURI == null || ((nsPrefix.length() == 0) || (prefix.length() == 0)) ||
+                                (!nsPrefix.equals(prefix) && !writerURI.equals(readerURI))) {
+                            writer.setPrefix(nsPrefix, readerURI != null ? readerURI : "");
+                            writer.writeNamespace(nsPrefix, readerURI != null ? readerURI : "");
+                        }
+                    }
+
+                    // Write attributes
+                    n = reader.getAttributeCount();
+                    for (int i = 0; i < n; i++) {
+                        String attrPrefix = reader.getAttributePrefix(i);
+                        String attrURI = reader.getAttributeNamespace(i);
+
+                        writer.writeAttribute(attrPrefix != null ? attrPrefix : "",
+                            attrURI != null ? attrURI : "",
+                            reader.getAttributeLocalName(i),
+                            reader.getAttributeValue(i));
+                        // if the attribute prefix is undeclared in current writer scope then declare it
+                        setUndeclaredPrefix(attrPrefix, attrURI, writer);
+                    }
+                    break;
+                case XMLStreamConstants.END_ELEMENT:
+                    writer.writeEndElement();
+                    break;
+                case XMLStreamConstants.CHARACTERS:
+                    writer.writeCharacters(reader.getText());
+            }
+        } while (state != XMLStreamConstants.END_DOCUMENT);
+        reader.close();
+    }
+
+    /**
+     * sets undeclared prefixes on the writer
+     * @param prefix
+     * @param writer
+     * @throws XMLStreamException
+     */
+    private static void setUndeclaredPrefix(String prefix, String readerURI, XMLStreamWriter writer) throws XMLStreamException {
+        String writerURI = null;
+        if (writer.getNamespaceContext() != null)
+            writerURI = writer.getNamespaceContext().getNamespaceURI(prefix);
+
+        if (writerURI == null) {
+            writer.setPrefix(prefix, readerURI != null ? readerURI : "");
+            writer.writeNamespace(prefix, readerURI != null ? readerURI : "");
+        }
+    }
+
+    /**
+     * check if we need to declare
+     * @param rPrefix
+     * @param rUri
+     * @param wPrefix
+     * @param wUri
+     */
+    private static boolean declarePrefix(String rPrefix, String rUri, String wPrefix, String wUri){
+        if (wUri == null ||((wPrefix != null) && !rPrefix.equals(wPrefix))||
+                (rUri != null && !wUri.equals(rUri)))
+            return true;
+        return false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/OutboundStreamHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/OutboundStreamHeader.java
new file mode 100644
index 0000000..8dbfc8f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/OutboundStreamHeader.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferException;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.message.AbstractHeaderImpl;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * Used to represent outbound header created from {@link XMLStreamBuffer}.
+ *
+ * <p>
+ * This is optimized for outbound use, so it implements some of the methods lazily,
+ * in a slow way.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class OutboundStreamHeader extends AbstractHeaderImpl {
+    private final XMLStreamBuffer infoset;
+    private final String nsUri,localName;
+
+    /**
+     * The attributes on the header element.
+     * Lazily parsed.
+     * Null if not parsed yet.
+     */
+    private FinalArrayList<Attribute> attributes;
+
+    public OutboundStreamHeader(XMLStreamBuffer infoset, String nsUri, String localName) {
+        this.infoset = infoset;
+        this.nsUri = nsUri;
+        this.localName = localName;
+    }
+
+    public @NotNull String getNamespaceURI() {
+        return nsUri;
+    }
+
+    public @NotNull String getLocalPart() {
+        return localName;
+    }
+
+    public String getAttribute(String nsUri, String localName) {
+        if(attributes==null)
+            parseAttributes();
+        for(int i=attributes.size()-1; i>=0; i-- ) {
+            Attribute a = attributes.get(i);
+            if(a.localName.equals(localName) && a.nsUri.equals(nsUri))
+                return a.value;
+        }
+        return null;
+    }
+
+    /**
+     * We don't really expect this to be used, but just to satisfy
+     * the {@link Header} contract.
+     *
+     * So this is rather slow.
+     */
+    private void parseAttributes() {
+        try {
+            XMLStreamReader reader = readHeader();
+
+            attributes = new FinalArrayList<Attribute>();
+
+            for (int i = 0; i < reader.getAttributeCount(); i++) {
+                final String localName = reader.getAttributeLocalName(i);
+                final String namespaceURI = reader.getAttributeNamespace(i);
+                final String value = reader.getAttributeValue(i);
+
+                attributes.add(new Attribute(namespaceURI,localName,value));
+            }
+        } catch (XMLStreamException e) {
+            throw new WebServiceException("Unable to read the attributes for {"+nsUri+"}"+localName+" header",e);
+        }
+    }
+
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        return infoset.readAsXMLStreamReader();
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        infoset.writeToXMLStreamWriter(w,true);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        try {
+            infoset.writeTo(saaj.getSOAPHeader());
+        } catch (XMLStreamBufferException e) {
+            throw new SOAPException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        infoset.writeTo(contentHandler,errorHandler);
+    }
+
+
+    /**
+     * Keep the information about an attribute on the header element.
+     */
+    static final class Attribute {
+        /**
+         * Can be empty but never null.
+         */
+        final String nsUri;
+        final String localName;
+        final String value;
+
+        public Attribute(String nsUri, String localName, String value) {
+            this.nsUri = fixNull(nsUri);
+            this.localName = localName;
+            this.value = value;
+        }
+
+        /**
+         * Convert null to "".
+         */
+        private static String fixNull(String s) {
+            if(s==null) return "";
+            else        return s;
+        }
+    }
+
+    /**
+     * We the performance paranoid people in the JAX-WS RI thinks
+     * saving three bytes is worth while...
+     */
+    private static final String TRUE_VALUE = "1";
+    private static final String IS_REFERENCE_PARAMETER = "IsReferenceParameter";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java
new file mode 100644
index 0000000..949e190
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.message.AbstractMessageImpl;
+import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+
+/**
+ * {@link Message} backed by {@link XMLStreamReader} as payload
+ *
+ * @author Jitendra Kotamraju
+ */
+public class PayloadStreamReaderMessage extends AbstractMessageImpl {
+    private final StreamMessage message;
+
+    public PayloadStreamReaderMessage(XMLStreamReader reader, SOAPVersion soapVer) {
+        this(null, reader,new AttachmentSetImpl(), soapVer);
+    }
+
+    public PayloadStreamReaderMessage(@Nullable HeaderList headers, @NotNull XMLStreamReader reader,
+                                      @NotNull AttachmentSet attSet, @NotNull SOAPVersion soapVersion) {
+        super(soapVersion);
+        message = new StreamMessage(headers, attSet, reader, soapVersion);
+    }
+
+    public boolean hasHeaders() {
+        return message.hasHeaders();
+    }
+
+    public HeaderList getHeaders() {
+        return message.getHeaders();
+    }
+
+    public AttachmentSet getAttachments() {
+        return message.getAttachments();
+    }
+
+    public String getPayloadLocalPart() {
+        return message.getPayloadLocalPart();
+    }
+
+    public String getPayloadNamespaceURI() {
+        return message.getPayloadNamespaceURI();
+    }
+
+    public boolean hasPayload() {
+        return true;
+    }
+
+    public Source readPayloadAsSource() {
+        return message.readPayloadAsSource();
+    }
+
+    public XMLStreamReader readPayload() throws XMLStreamException {
+        return message.readPayload();
+    }
+
+    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+        message.writePayloadTo(sw);
+    }
+
+    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        return (T) message.readPayloadAsJAXB(unmarshaller);
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        message.writeTo(contentHandler, errorHandler);
+    }
+
+    protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        message.writePayloadTo(contentHandler, errorHandler, fragment);
+    }
+
+    public Message copy() {
+        return message.copy();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java
new file mode 100644
index 0000000..777d93b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+
+import com.sun.xml.internal.org.jvnet.staxex.Base64Data;
+
+/**
+ * Attachment created from raw bytes.
+ *
+ * @author Vivek Pandey
+ */
+public class StreamAttachment implements Attachment {
+    private final String contentId;
+    private final String contentType;
+    private final ByteArrayBuffer byteArrayBuffer;
+    private final byte[] data;
+    private final int len;
+
+    public StreamAttachment(ByteArrayBuffer buffer, String contentId, String contentType) {
+        this.contentId = contentId;
+        this.contentType = contentType;
+        this.byteArrayBuffer = buffer;
+        this.data = byteArrayBuffer.getRawData();
+        this.len = byteArrayBuffer.size();
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public String getContentType() {
+        return contentType;
+    }
+
+
+    public byte[] asByteArray() {
+        //we got to reallocate and give the exact byte[]
+        return byteArrayBuffer.toByteArray();
+    }
+
+    public DataHandler asDataHandler() {
+        return new DataHandler(new ByteArrayDataSource(data,0,len,getContentType()));
+    }
+
+    public Source asSource() {
+        return new StreamSource(new ByteArrayInputStream(data,0,len));
+    }
+
+    public InputStream asInputStream() {
+        return byteArrayBuffer.newInputStream();
+    }
+
+    public Base64Data asBase64Data(){
+        Base64Data base64Data = new Base64Data();
+        base64Data.set(data, len, contentType);
+        return base64Data;
+    }
+
+    public void writeTo(OutputStream os) throws IOException {
+        byteArrayBuffer.writeTo(os);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        AttachmentPart part = saaj.createAttachmentPart();
+        part.setRawContentBytes(data,0,len,getContentType());
+        part.setContentId(contentId);
+        saaj.addAttachmentPart(part);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java
new file mode 100644
index 0000000..49ff578
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferSource;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.message.AbstractHeaderImpl;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * {@link Header} whose physical data representation is an XMLStreamBuffer.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+public abstract class StreamHeader extends AbstractHeaderImpl {
+    protected final XMLStreamBuffer _mark;
+
+    protected boolean _isMustUnderstand;
+
+    /**
+     * Role or actor value.
+     */
+    protected @NotNull String _role;
+
+    protected boolean _isRelay;
+
+    protected String _localName;
+
+    protected String _namespaceURI;
+
+    /**
+     * Keep the information about an attribute on the header element.
+     *
+     * TODO: this whole attribute handling could be done better, I think.
+     */
+    protected static final class Attribute {
+        /**
+         * Can be empty but never null.
+         */
+        final String nsUri;
+        final String localName;
+        final String value;
+
+        public Attribute(String nsUri, String localName, String value) {
+            this.nsUri = fixNull(nsUri);
+            this.localName = localName;
+            this.value = value;
+        }
+    }
+
+    /**
+     * The attributes on the header element.
+     * We expect there to be only a small number of them,
+     * so the use of {@link List} would be justified.
+     *
+     * Null if no attribute is present.
+     */
+    private final FinalArrayList<Attribute> attributes;
+
+    /**
+     * Creates a {@link StreamHeader}.
+     *
+     * @param reader
+     *      The parser pointing at the start of the mark.
+     *      Technically this information is redundant,
+     *      but it achieves a better performance.
+     * @param mark
+     *      The start of the buffered header content.
+     */
+    protected StreamHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+        assert reader!=null && mark!=null;
+        _mark = mark;
+        _localName = reader.getLocalName();
+        _namespaceURI = reader.getNamespaceURI();
+        attributes = processHeaderAttributes(reader);
+    }
+
+    /**
+     * Creates a {@link StreamHeader}.
+     *
+     * @param reader
+     *      The parser that points to the start tag of the header.
+     *      By the end of this method, the parser will point at
+     *      the end tag of this element.
+     */
+    protected StreamHeader(XMLStreamReader reader) throws XMLStreamException {
+        _localName = reader.getLocalName();
+        _namespaceURI = reader.getNamespaceURI();
+        attributes = processHeaderAttributes(reader);
+        // cache the body
+        _mark = XMLStreamBuffer.createNewBufferFromXMLStreamReader(reader);
+    }
+
+    public final boolean isIgnorable(@NotNull SOAPVersion soapVersion, @NotNull Set<String> roles) {
+        // check mustUnderstand
+        if(!_isMustUnderstand) return true;
+
+        if (roles == null)
+            return true;
+
+        // now role
+        return !roles.contains(_role);
+    }
+
+    public @NotNull String getRole(@NotNull SOAPVersion soapVersion) {
+        assert _role!=null;
+        return _role;
+    }
+
+    public boolean isRelay() {
+        return _isRelay;
+    }
+
+    public @NotNull String getNamespaceURI() {
+        return _namespaceURI;
+    }
+
+    public @NotNull String getLocalPart() {
+        return _localName;
+    }
+
+    public String getAttribute(String nsUri, String localName) {
+        if(attributes!=null) {
+            for(int i=attributes.size()-1; i>=0; i-- ) {
+                Attribute a = attributes.get(i);
+                if(a.localName.equals(localName) && a.nsUri.equals(nsUri))
+                    return a.value;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Reads the header as a {@link XMLStreamReader}
+     */
+    public XMLStreamReader readHeader() throws XMLStreamException {
+        return _mark.readAsXMLStreamReader();
+    }
+
+    public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+        // TODO what about in-scope namespaces
+        _mark.writeToXMLStreamWriter(w);
+    }
+
+    public void writeTo(SOAPMessage saaj) throws SOAPException {
+        try {
+            // TODO what about in-scope namespaces
+            // Not very efficient consider implementing a stream buffer
+            // processor that produces a DOM node from the buffer.
+            TransformerFactory tf = TransformerFactory.newInstance();
+            Transformer t = tf.newTransformer();
+            XMLStreamBufferSource source = new XMLStreamBufferSource(_mark);
+            DOMResult result = new DOMResult();
+            t.transform(source, result);
+            Node d = result.getNode();
+            if(d.getNodeType() == Node.DOCUMENT_NODE)
+                d = d.getFirstChild();
+            SOAPHeader header = saaj.getSOAPHeader();
+            Node node = header.getOwnerDocument().importNode(d, true);
+            header.appendChild(node);
+        } catch (Exception e) {
+            throw new SOAPException(e);
+        }
+    }
+
+    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
+        _mark.writeTo(contentHandler);
+    }
+
+    /**
+     * Creates an EPR without copying infoset.
+     *
+     * This is the most common implementation on which {@link Header#readAsEPR(AddressingVersion)}
+     * is invoked on.
+     */
+    @Override @NotNull
+    public WSEndpointReference readAsEPR(AddressingVersion expected) throws XMLStreamException {
+        return new WSEndpointReference(_mark,expected);
+    }
+
+    protected abstract FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader);
+
+    /**
+     * Convert null to "".
+     */
+    private static String fixNull(String s) {
+        if(s==null) return "";
+        else        return s;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java
new file mode 100644
index 0000000..9fd530f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.message.Util;
+
+import javax.xml.soap.SOAPConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * {@link StreamHeader} for SOAP 1.1.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+@SuppressWarnings({"StringEquality"})
+public class StreamHeader11 extends StreamHeader {
+    protected static final String SOAP_1_1_MUST_UNDERSTAND = "mustUnderstand";
+
+    protected static final String SOAP_1_1_ROLE = "actor";
+
+    public StreamHeader11(XMLStreamReader reader, XMLStreamBuffer mark) {
+        super(reader, mark);
+    }
+
+    public StreamHeader11(XMLStreamReader reader) throws XMLStreamException {
+        super(reader);
+    }
+
+    protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
+        FinalArrayList<Attribute> atts = null;
+
+        _role = SOAPConstants.URI_SOAP_ACTOR_NEXT;
+
+        for (int i = 0; i < reader.getAttributeCount(); i++) {
+            final String localName = reader.getAttributeLocalName(i);
+            final String namespaceURI = reader.getAttributeNamespace(i);
+            final String value = reader.getAttributeValue(i);
+
+            if (namespaceURI == SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE) {
+                if (localName == SOAP_1_1_MUST_UNDERSTAND) {
+                    _isMustUnderstand = Util.parseBool(value);
+                } else if (localName == SOAP_1_1_ROLE) {
+                    if (value != null && value.length() > 0) {
+                        _role = value;
+                    }
+                }
+            }
+
+            if(atts==null) {
+                atts = new FinalArrayList<Attribute>();
+            }
+            atts.add(new Attribute(namespaceURI,localName,value));
+        }
+
+        return atts;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java
new file mode 100644
index 0000000..7d8bc4a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+import com.sun.xml.internal.ws.message.Util;
+import com.sun.istack.internal.FinalArrayList;
+
+import javax.xml.soap.SOAPConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * {@link StreamHeader} for SOAP 1.2.
+ *
+ * @author Paul.Sandoz@Sun.Com
+ */
+@SuppressWarnings({"StringEquality"})
+public class StreamHeader12 extends StreamHeader {
+    protected static final String SOAP_1_2_MUST_UNDERSTAND = "mustUnderstand";
+
+    protected static final String SOAP_1_2_ROLE = "role";
+
+    protected static final String SOAP_1_2_RELAY = "relay";
+
+    public StreamHeader12(XMLStreamReader reader, XMLStreamBuffer mark) {
+        super(reader, mark);
+    }
+
+    public StreamHeader12(XMLStreamReader reader) throws XMLStreamException {
+        super(reader);
+    }
+
+    protected final FinalArrayList<Attribute> processHeaderAttributes(XMLStreamReader reader) {
+        FinalArrayList<Attribute> atts = null;
+
+        _role = SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER;
+
+        for (int i = 0; i < reader.getAttributeCount(); i++) {
+            final String localName = reader.getAttributeLocalName(i);
+            final String namespaceURI = reader.getAttributeNamespace(i);
+            final String value = reader.getAttributeValue(i);
+
+            if (namespaceURI == SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE) {
+                if (localName == SOAP_1_2_MUST_UNDERSTAND) {
+                    _isMustUnderstand = Util.parseBool(value);
+                } else if (localName == SOAP_1_2_ROLE) {
+                    if (value != null && value.length() > 0) {
+                        _role = value;
+                    }
+                } else if (localName == SOAP_1_2_RELAY) {
+                    _isRelay = Util.parseBool(value);
+                }
+            }
+
+            if(atts==null) {
+                atts = new FinalArrayList<Attribute>();
+            }
+            atts.add(new Attribute(namespaceURI,localName,value));
+        }
+
+        return atts;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java
new file mode 100644
index 0000000..2659fad
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java
@@ -0,0 +1,446 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.message.stream;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.XMLStreamReaderToContentHandler;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.stax.StreamReaderBufferCreator;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.encoding.TagInfoset;
+import com.sun.xml.internal.ws.message.AbstractMessageImpl;
+import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.xml.DummyLocation;
+import com.sun.xml.internal.ws.util.xml.StAXSource;
+import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamConstants;
+import static javax.xml.stream.XMLStreamConstants.START_DOCUMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Source;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * {@link Message} implementation backed by {@link XMLStreamReader}.
+ *
+ * TODO: we need another message class that keeps {@link XMLStreamReader} that points
+ * at the start of the envelope element.
+ */
+public final class StreamMessage extends AbstractMessageImpl {
+    /**
+     * The reader will be positioned at
+     * the first child of the SOAP body
+     */
+    private @NotNull XMLStreamReader reader;
+
+    // lazily created
+    private @Nullable HeaderList headers;
+
+    private final String payloadLocalName;
+
+    private final String payloadNamespaceURI;
+
+    /**
+     * infoset about the SOAP envelope, header, and body.
+     *
+     * <p>
+     * If the creater of this object didn't care about those,
+     * we use stock values.
+     */
+    private /*almost final*/ @NotNull TagInfoset envelopeTag,headerTag,bodyTag;
+
+    /**
+     * Creates a {@link StreamMessage} from a {@link XMLStreamReader}
+     * that points at the start element of the payload, and headers.
+     *
+     * <p>
+     * This method creaets a {@link Message} from a payload.
+     *
+     * @param headers
+     *      if null, it means no headers. if non-null,
+     *      it will be owned by this message.
+     * @param reader
+     *      points at the start element/document of the payload (or the end element of the &lt;s:Body>
+     *      if there's no payload)
+     */
+    public StreamMessage(@Nullable HeaderList headers, @NotNull AttachmentSet attachmentSet, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) {
+        super(soapVersion);
+        this.headers = headers;
+        this.attachmentSet = attachmentSet;
+        this.reader = reader;
+
+        if(reader.getEventType()== START_DOCUMENT)
+            XMLStreamReaderUtil.nextElementContent(reader);
+
+        //if the reader is pointing to the end element </soapenv:Body> then its empty message
+        // or no payload
+        if(reader.getEventType() == XMLStreamConstants.END_ELEMENT){
+            String body = reader.getLocalName();
+            String nsUri = reader.getNamespaceURI();
+            assert body != null;
+            assert nsUri != null;
+            //if its not soapenv:Body then throw exception, we received malformed stream
+            if(body.equals("Body") && nsUri.equals(soapVersion.nsUri)){
+                this.payloadLocalName = null;
+                this.payloadNamespaceURI = null;
+            }else{ //TODO: i18n and also we should be throwing better message that this
+                throw new WebServiceException("Malformed stream: {"+nsUri+"}"+body);
+            }
+        }else{
+            this.payloadLocalName = reader.getLocalName();
+            this.payloadNamespaceURI = reader.getNamespaceURI();
+        }
+
+        // use the default infoset representation for headers
+        int base = soapVersion.ordinal()*3;
+        this.envelopeTag = DEFAULT_TAGS[base];
+        this.headerTag = DEFAULT_TAGS[base+1];
+        this.bodyTag = DEFAULT_TAGS[base+2];
+    }
+
+    /**
+     * Creates a {@link StreamMessage} from a {@link XMLStreamReader}
+     * and the complete infoset of the SOAP envelope.
+     *
+     * <p>
+     * See {@link #StreamMessage(HeaderList, AttachmentSet, XMLStreamReader, SOAPVersion)} for
+     * the description of the basic parameters.
+     *
+     * @param headerTag
+     *      Null if the message didn't have a header tag.
+     *
+     */
+    public StreamMessage(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable HeaderList headers, @NotNull TagInfoset bodyTag, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) {
+        this(headers,attachmentSet,reader,soapVersion);
+        assert envelopeTag!=null && bodyTag!=null;
+        this.envelopeTag = envelopeTag;
+        this.headerTag = headerTag!=null ? headerTag :
+            new TagInfoset(envelopeTag.nsUri,"Header",envelopeTag.prefix,EMPTY_ATTS);
+        this.bodyTag = bodyTag;
+    }
+
+    public boolean hasHeaders() {
+        return headers!=null && !headers.isEmpty();
+    }
+
+    public HeaderList getHeaders() {
+        if (headers == null) {
+            headers = new HeaderList();
+        }
+        return headers;
+    }
+
+    @Override
+    public @NotNull AttachmentSet getAttachments() {
+        return attachmentSet;
+    }
+
+    public String getPayloadLocalPart() {
+        return payloadLocalName;
+    }
+
+    public String getPayloadNamespaceURI() {
+        return payloadNamespaceURI;
+    }
+
+    public boolean hasPayload() {
+        return payloadLocalName!=null;
+    }
+
+    public Source readPayloadAsSource() {
+        if(hasPayload()) {
+            assert unconsumed();
+            return new StAXSource(reader, true);
+        } else
+            return null;
+    }
+
+    public Object readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+        if(!hasPayload())
+            return null;
+        assert unconsumed();
+        // TODO: How can the unmarshaller process this as a fragment?
+        if(hasAttachments())
+            unmarshaller.setAttachmentUnmarshaller(new AttachmentUnmarshallerImpl(getAttachments()));
+        try {
+            return unmarshaller.unmarshal(reader);
+        } finally{
+            unmarshaller.setAttachmentUnmarshaller(null);
+            XMLStreamReaderUtil.close(reader);
+            XMLStreamReaderFactory.recycle(reader);
+        }
+    }
+
+    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+        if(!hasPayload())
+            return null;
+        assert unconsumed();
+        T r = bridge.unmarshal(reader,
+            hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
+        XMLStreamReaderUtil.close(reader);
+        XMLStreamReaderFactory.recycle(reader);
+        return r;
+    }
+
+    @Override
+    public void consume() {
+        assert unconsumed();
+        XMLStreamReaderFactory.recycle(reader);
+    }
+
+    public XMLStreamReader readPayload() {
+        // TODO: What about access at and beyond </soap:Body>
+        assert unconsumed();
+        return this.reader;
+    }
+
+    public void writePayloadTo(XMLStreamWriter writer)throws XMLStreamException {
+        if(payloadLocalName==null)
+            return; // no body
+        assert unconsumed();
+        XMLStreamReaderToXMLStreamWriter conv = new XMLStreamReaderToXMLStreamWriter();
+        while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT){
+            String name = reader.getLocalName();
+            String nsUri = reader.getNamespaceURI();
+
+            //after previous conv.bridge() call the cursor will be at
+            //END_ELEMENT. Check if its not soapenv:Body then move to next
+            // ELEMENT
+            if(reader.getEventType() == XMLStreamConstants.END_ELEMENT){
+                if(!name.equals("Body") || !nsUri.equals(soapVersion.nsUri)){
+                    XMLStreamReaderUtil.nextElementContent(reader);
+                    if(reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
+                        break;
+                    name = reader.getLocalName();
+                    nsUri = reader.getNamespaceURI();
+                }
+            }
+            if(name.equals("Body") && nsUri.equals(soapVersion.nsUri) || (reader.getEventType() == XMLStreamConstants.END_DOCUMENT))
+                break;
+            conv.bridge(reader,writer);
+        }
+        reader.close();
+        XMLStreamReaderFactory.recycle(reader);
+    }
+
+    public void writeTo(XMLStreamWriter sw) throws XMLStreamException{
+        writeEnvelope(sw);
+    }
+
+    /**
+     * This method should be called when the StreamMessage is created with a payload
+     * @param writer
+     */
+    private void writeEnvelope(XMLStreamWriter writer) throws XMLStreamException {
+        writer.writeStartDocument();
+        envelopeTag.writeStart(writer);
+
+        //write headers
+        HeaderList hl = getHeaders();
+        if(hl.size() > 0){
+            headerTag.writeStart(writer);
+            for(Header h:hl){
+                h.writeTo(writer);
+            }
+            writer.writeEndElement();
+        }
+        bodyTag.writeStart(writer);
+        if(hasPayload())
+            writePayloadTo(writer);
+        writer.writeEndElement();
+        writer.writeEndElement();
+        writer.writeEndDocument();
+    }
+
+    public void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
+        assert unconsumed();
+        try {
+            if(payloadLocalName==null)
+                return; // no body
+
+            XMLStreamReaderToContentHandler conv =
+                new XMLStreamReaderToContentHandler(reader,contentHandler,true,fragment);
+
+            while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT){
+                String name = reader.getLocalName();
+                String nsUri = reader.getNamespaceURI();
+
+                //after previous conv.bridge() call the cursor will be at
+                //END_ELEMENT. Check if its not soapenv:Body then move to next
+                // ELEMENT
+                if(reader.getEventType() == XMLStreamConstants.END_ELEMENT){
+                    if(!name.equals("Body") || !nsUri.equals(soapVersion.nsUri)){
+                        XMLStreamReaderUtil.nextElementContent(reader);
+                        if(reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
+                            break;
+                        name = reader.getLocalName();
+                        nsUri = reader.getNamespaceURI();
+                    }
+                }
+                if(name.equals("Body") && nsUri.equals(soapVersion.nsUri) || (reader.getEventType() == XMLStreamConstants.END_DOCUMENT))
+                    break;
+
+                conv.bridge();
+            }
+            reader.close();
+            XMLStreamReaderFactory.recycle(reader);
+        } catch (XMLStreamException e) {
+            Location loc = e.getLocation();
+            if(loc==null)   loc = DummyLocation.INSTANCE;
+
+            SAXParseException x = new SAXParseException(
+                e.getMessage(),loc.getPublicId(),loc.getSystemId(),loc.getLineNumber(),loc.getColumnNumber(),e);
+            errorHandler.error(x);
+        }
+    }
+
+    public Message copy() {
+        try {
+            // copy the payload
+            XMLStreamReader clone;
+            if(hasPayload()) {
+                assert unconsumed();
+                consumedAt = null; // but we don't want to mark it as consumed
+                MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+
+                //the boolean value tells the first body part is written.
+                //based on this we do the right thing
+                StreamReaderBufferCreator c = new StreamReaderBufferCreator(xsb);
+                while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT){
+                    String name = reader.getLocalName();
+                    String nsUri = reader.getNamespaceURI();
+                    if(name.equals("Body") && nsUri.equals(soapVersion.nsUri) || (reader.getEventType() == XMLStreamConstants.END_DOCUMENT))
+                        break;
+                    c.create(reader);
+                }
+                XMLStreamReaderFactory.recycle(reader);
+
+                reader = xsb.readAsXMLStreamReader();
+                clone = xsb.readAsXMLStreamReader();
+                // advance to the start tag of the first element
+                proceedToRootElement(reader);
+                proceedToRootElement(clone);
+            } else {
+                // it's tempting to use EmptyMessageImpl, but it doesn't presere the infoset
+                // of <envelope>,<header>, and <body>, so we need to stick to StreamMessage.
+                clone = reader;
+            }
+
+            return new StreamMessage(envelopeTag, headerTag, attachmentSet, HeaderList.copy(headers), bodyTag, clone, soapVersion);
+        } catch (XMLStreamException e) {
+            throw new WebServiceException("Failed to copy a message",e);
+        }
+    }
+
+    private void proceedToRootElement(XMLStreamReader xsr) throws XMLStreamException {
+        assert xsr.getEventType()==START_DOCUMENT;
+        xsr.nextTag();
+        assert xsr.getEventType()==START_ELEMENT;
+    }
+
+    public void writeTo( ContentHandler contentHandler, ErrorHandler errorHandler ) throws SAXException {
+        contentHandler.setDocumentLocator(NULL_LOCATOR);
+        contentHandler.startDocument();
+        envelopeTag.writeStart(contentHandler);
+        headerTag.writeStart(contentHandler);
+        if(hasHeaders()) {
+            HeaderList headers = getHeaders();
+            int len = headers.size();
+            for( int i=0; i<len; i++ ) {
+                // shouldn't JDK be smart enough to use array-style indexing for this foreach!?
+                headers.get(i).writeTo(contentHandler,errorHandler);
+            }
+        }
+        headerTag.writeEnd(contentHandler);
+        bodyTag.writeStart(contentHandler);
+        writePayloadTo(contentHandler,errorHandler, true);
+        bodyTag.writeEnd(contentHandler);
+        envelopeTag.writeEnd(contentHandler);
+
+    }
+
+    /**
+     * Used for an assertion. Returns true when the message is unconsumed,
+     * or otherwise throw an exception.
+     *
+     * <p>
+     * Calling this method also marks the stream as 'consumed'
+     */
+    private boolean unconsumed() {
+        if(payloadLocalName==null)
+            return true;    // no payload. can be consumed multiple times.
+
+        if(reader.getEventType()!=XMLStreamReader.START_ELEMENT) {
+            AssertionError error = new AssertionError("StreamMessage has been already consumed. See the nested exception for where it's consumed");
+            error.initCause(consumedAt);
+            throw error;
+        }
+        consumedAt = new Exception().fillInStackTrace();
+        return true;
+    }
+
+    /**
+     * Used only for debugging. This records where the message was consumed.
+     */
+    private Throwable consumedAt;
+
+    /**
+     * Default s:Envelope, s:Header, and s:Body tag infoset definitions.
+     *
+     * We need 3 for SOAP 1.1, 3 for SOAP 1.2.
+     */
+    private static final TagInfoset[] DEFAULT_TAGS;
+
+    static {
+        DEFAULT_TAGS = new TagInfoset[6];
+        create(SOAPVersion.SOAP_11);
+        create(SOAPVersion.SOAP_12);
+    }
+
+    private static void create(SOAPVersion v) {
+        int base = v.ordinal()*3;
+        DEFAULT_TAGS[base  ] = new TagInfoset(v.nsUri,"Envelope","S",EMPTY_ATTS,"S",v.nsUri);
+        DEFAULT_TAGS[base+1] = new TagInfoset(v.nsUri,"Header","S",EMPTY_ATTS);
+        DEFAULT_TAGS[base+2] = new TagInfoset(v.nsUri,"Body","S",EMPTY_ATTS);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/AbstractSEIModelImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/AbstractSEIModelImpl.java
new file mode 100644
index 0000000..8a52414
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/AbstractSEIModelImpl.java
@@ -0,0 +1,490 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPartImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.resources.ModelerMessages;
+import com.sun.xml.internal.ws.util.Pool;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.*;
+
+/**
+ * model of the web service.  Used by the runtime marshall/unmarshall
+ * web service invocations
+ *
+ * $author: JAXWS Development Team
+ */
+public abstract class AbstractSEIModelImpl implements SEIModel {
+
+    void postProcess() {
+        // should be called only once.
+        if (jaxbContext != null)
+            return;
+        populateMaps();
+        createJAXBContext();
+    }
+
+    /**
+     * Link {@link SEIModel} to {@link WSDLModel}.
+     * Merge it with {@link #postProcess()}.
+     */
+    public void freeze(WSDLPortImpl port) {
+        this.port = port;
+        for (JavaMethodImpl m : javaMethods) {
+            m.freeze(port);
+        }
+    }
+
+    /**
+     * Populate methodToJM and nameToJM maps.
+     */
+    abstract protected void populateMaps();
+
+    public Pool.Marshaller getMarshallerPool() {
+        return marshallers;
+    }
+
+    /**
+     * @return the <code>JAXBRIContext</code>
+     */
+    public JAXBRIContext getJAXBContext() {
+        return jaxbContext;
+    }
+
+    /**
+     * @return the known namespaces from JAXBRIContext
+     */
+    public List<String> getKnownNamespaceURIs() {
+        return knownNamespaceURIs;
+    }
+
+    /**
+     * @return the <code>Bridge</code> for the <code>type</code>
+     */
+    public final Bridge getBridge(TypeReference type) {
+        Bridge b = bridgeMap.get(type);
+        assert b!=null; // we should have created Bridge for all TypeReferences known to this model
+        return b;
+    }
+
+    private JAXBRIContext createJAXBContext() {
+        final List<TypeReference> types = getAllTypeReferences();
+        final Class[] cls = new Class[types.size() + additionalClasses.size()];
+        int i = 0;
+        for(Class additionalClass:additionalClasses){
+            cls[i++] = additionalClass;
+        }
+
+        for (TypeReference type : types) {
+            cls[i++] = (Class) type.type;
+        }
+
+        try {
+            //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
+            // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
+            jaxbContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBRIContext>() {
+                public JAXBRIContext run() throws Exception {
+                    return JAXBRIContext.newInstance(cls, types, null, targetNamespace, false, null);
+                }
+            });
+            createBridgeMap(types);
+        } catch (PrivilegedActionException e) {
+            throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
+        }
+        knownNamespaceURIs = new ArrayList<String>();
+        for (String namespace : jaxbContext.getKnownNamespaceURIs()) {
+            if (namespace.length() > 0) {
+                if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
+                    knownNamespaceURIs.add(namespace);
+            }
+        }
+
+        marshallers = new Pool.Marshaller(jaxbContext);
+
+        return jaxbContext;
+    }
+
+    /**
+     * @return returns non-null list of TypeReference
+     */
+    private List<TypeReference> getAllTypeReferences() {
+        List<TypeReference> types = new ArrayList<TypeReference>();
+        Collection<JavaMethodImpl> methods = methodToJM.values();
+        for (JavaMethodImpl m : methods) {
+            m.fillTypes(types);
+        }
+        return types;
+    }
+
+    private void createBridgeMap(List<TypeReference> types) {
+        for (TypeReference type : types) {
+            Bridge bridge = jaxbContext.createBridge(type);
+            bridgeMap.put(type, bridge);
+        }
+    }
+
+    /**
+     * @return the <code>Method</code> for a given WSDLOperation <code>qname</code>
+     */
+    public Method getDispatchMethod(QName qname) {
+        //handle the empty body
+        if (qname == null)
+            qname = emptyBodyName;
+        JavaMethodImpl jm = getJavaMethod(qname);
+        if (jm != null) {
+            return jm.getMethod();
+        }
+        return null;
+    }
+
+    /**
+     * @return true if <code>name</code> is the name
+     * of a known fault name for the <code>Method method</code>
+     */
+    public boolean isKnownFault(QName name, Method method) {
+        JavaMethodImpl m = getJavaMethod(method);
+        for (CheckedExceptionImpl ce : m.getCheckedExceptions()) {
+            if (ce.getDetailType().tagName.equals(name))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * @return true if <code>ex</code> is a Checked Exception
+     * for <code>Method m</code>
+     */
+    public boolean isCheckedException(Method m, Class ex) {
+        JavaMethodImpl jm = getJavaMethod(m);
+        for (CheckedExceptionImpl ce : jm.getCheckedExceptions()) {
+            if (ce.getExceptionClass().equals(ex))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * @return the <code>JavaMethod</code> representing the <code>method</code>
+     */
+    public JavaMethodImpl getJavaMethod(Method method) {
+        return methodToJM.get(method);
+    }
+
+    /**
+     * @return the <code>JavaMethod</code> associated with the
+     * operation named name
+     */
+    public JavaMethodImpl getJavaMethod(QName name) {
+        return nameToJM.get(name);
+    }
+
+    /**
+     * @return the <code>QName</code> associated with the
+     * JavaMethod jm
+     */
+    public QName getQNameForJM(JavaMethodImpl jm) {
+        for (QName key : nameToJM.keySet()) {
+            JavaMethodImpl jmethod = nameToJM.get(key);
+            if (jmethod.getOperationName().equals(jm.getOperationName())){
+               return key;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @return a <code>Collection</code> of <code>JavaMethods</code>
+     * associated with this <code>RuntimeModel</code>
+     */
+    public final Collection<JavaMethodImpl> getJavaMethods() {
+        return Collections.unmodifiableList(javaMethods);
+    }
+
+    void addJavaMethod(JavaMethodImpl jm) {
+        if (jm != null)
+            javaMethods.add(jm);
+    }
+
+    /**
+     * Used from {@link WSServiceDelegate}
+     * to apply the binding information from WSDL after the model is created frm SEI class on the client side. On the server
+     * side all the binding information is available before modeling and this method is not used.
+     *
+     * @deprecated To be removed once client side new architecture is implemented
+     */
+    public void applyParameterBinding(WSDLBoundPortTypeImpl wsdlBinding){
+        if(wsdlBinding == null)
+            return;
+
+        for(JavaMethodImpl method : javaMethods){
+            if(method.isAsync())
+                continue;
+            QName opName = new QName(wsdlBinding.getPortTypeName().getNamespaceURI(), method.getOperationName());
+
+            //patch the soapaction correctly from the WSDL
+            WSDLBoundOperationImpl bo = wsdlBinding.get(opName);
+            String action = bo.getSOAPAction();
+            method.getBinding().setSOAPAction(action);
+
+            boolean isRpclit = method.getBinding().isRpcLit();
+            List<ParameterImpl> reqParams = method.requestParams;
+            List<ParameterImpl> reqAttachParams = null;
+            for(ParameterImpl param:reqParams){
+                if(param.isWrapperStyle()){
+                    if(isRpclit){
+                        WrapperParameter reqParam = (WrapperParameter)param;
+                        if(bo.getRequestNamespace() != null){
+                            patchRpclitNamespace(bo.getRequestNamespace(), reqParam);
+                        }
+                        reqAttachParams = applyRpcLitParamBinding(method, (WrapperParameter)param, wsdlBinding, Mode.IN);
+                    }
+                    continue;
+                }
+                String partName = param.getPartName();
+                if(partName == null)
+                    continue;
+                ParameterBinding paramBinding = wsdlBinding.getBinding(opName, partName, Mode.IN);
+                if(paramBinding != null)
+                    param.setInBinding(paramBinding);
+            }
+
+            List<ParameterImpl> resAttachParams = null;
+            List<ParameterImpl> resParams = method.responseParams;
+            for(ParameterImpl param:resParams){
+                if(param.isWrapperStyle()){
+                    if(isRpclit){
+                        WrapperParameter respParam = (WrapperParameter)param;
+                        if(bo.getResponseNamespace() != null){
+                            patchRpclitNamespace(bo.getResponseNamespace(), respParam);
+                        }
+                        resAttachParams = applyRpcLitParamBinding(method, (WrapperParameter)param, wsdlBinding, Mode.OUT);
+                    }
+                    continue;
+                }
+                //if the parameter is not inout and its header=true then dont get binding from WSDL
+//                if(!param.isINOUT() && param.getBinding().isHeader())
+//                    continue;
+                String partName = param.getPartName();
+                if(partName == null)
+                    continue;
+                ParameterBinding paramBinding = wsdlBinding.getBinding(opName,
+                        partName, Mode.OUT);
+                if(paramBinding != null)
+                    param.setOutBinding(paramBinding);
+            }
+            if(reqAttachParams != null){
+                for(ParameterImpl p : reqAttachParams){
+                    method.addRequestParameter(p);
+                }
+            }
+            if(resAttachParams != null){
+                for(ParameterImpl p : resAttachParams){
+                    method.addResponseParameter(p);
+                }
+            }
+
+        }
+    }
+
+    /**
+     * For rpclit wrapper element inside <soapenv:Body>, the targetNamespace should be taked from
+     * the soapbind:body@namespace value. Since no annotations on SEI/impl class captures it so we
+     * need to get it from WSDL and patch it.     *
+     */
+    private void patchRpclitNamespace(String namespace, WrapperParameter param){
+        TypeReference type = param.getTypeReference();
+        TypeReference newType = new TypeReference(new QName(namespace, type.tagName.getLocalPart()), type.type, type.annotations);
+        param.setTypeReference(newType);
+    }
+
+    /**
+     * Applies binding related information to the RpcLitPayload. The payload map is populated correctl
+     * @return
+     * Returns attachment parameters if/any.
+     */
+    private List<ParameterImpl> applyRpcLitParamBinding(JavaMethodImpl method, WrapperParameter wrapperParameter, WSDLBoundPortTypeImpl boundPortType, Mode mode) {
+        QName opName = new QName(boundPortType.getPortTypeName().getNamespaceURI(), method.getOperationName());
+        WSDLBoundOperationImpl bo = boundPortType.get(opName);
+        Map<Integer, ParameterImpl> bodyParams = new HashMap<Integer, ParameterImpl>();
+        List<ParameterImpl> unboundParams = new ArrayList<ParameterImpl>();
+        List<ParameterImpl> attachParams = new ArrayList<ParameterImpl>();
+        for(ParameterImpl param : wrapperParameter.wrapperChildren){
+            String partName = param.getPartName();
+            if(partName == null)
+                continue;
+
+            ParameterBinding paramBinding = boundPortType.getBinding(opName,
+                    partName, mode);
+            if(paramBinding != null){
+                if(mode == Mode.IN)
+                    param.setInBinding(paramBinding);
+                else if(mode == Mode.OUT || mode == Mode.INOUT)
+                    param.setOutBinding(paramBinding);
+
+                if(paramBinding.isUnbound()){
+                        unboundParams.add(param);
+                } else if(paramBinding.isAttachment()){
+                    attachParams.add(param);
+                }else if(paramBinding.isBody()){
+                    if(bo != null){
+                        WSDLPartImpl p = bo.getPart(param.getPartName(), mode);
+                        if(p != null)
+                            bodyParams.put(p.getIndex(), param);
+                        else
+                            bodyParams.put(bodyParams.size(), param);
+                    }else{
+                        bodyParams.put(bodyParams.size(), param);
+                    }
+                }
+            }
+
+        }
+        wrapperParameter.clear();
+        for(int i = 0; i <  bodyParams.size();i++){
+            ParameterImpl p = bodyParams.get(i);
+            wrapperParameter.addWrapperChild(p);
+        }
+
+        //add unbounded parts
+        for(ParameterImpl p:unboundParams){
+            wrapperParameter.addWrapperChild(p);
+        }
+        return attachParams;
+    }
+
+
+    void put(QName name, JavaMethodImpl jm) {
+        nameToJM.put(name, jm);
+    }
+
+    void put(Method method, JavaMethodImpl jm) {
+        methodToJM.put(method, jm);
+    }
+
+    public String getWSDLLocation() {
+        return wsdlLocation;
+    }
+
+    void setWSDLLocation(String location) {
+        wsdlLocation = location;
+    }
+
+    public QName getServiceQName() {
+        return serviceName;
+    }
+
+    public WSDLPort getPort() {
+        return port;
+    }
+
+    public QName getPortName() {
+        return portName;
+    }
+
+    public QName getPortTypeName() {
+        return portTypeName;
+    }
+
+    void setServiceQName(QName name) {
+        serviceName = name;
+    }
+
+    void setPortName(QName name) {
+        portName = name;
+    }
+
+    void setPortTypeName(QName name) {
+        portTypeName = name;
+    }
+
+    /**
+     * This is the targetNamespace for the WSDL containing the PortType
+     * definition
+     */
+    void setTargetNamespace(String namespace) {
+        targetNamespace = namespace;
+    }
+
+    /**
+     * This is the targetNamespace for the WSDL containing the PortType
+     * definition
+     */
+    public String getTargetNamespace() {
+        return targetNamespace;
+    }
+
+    @NotNull
+    public QName getBoundPortTypeName() {
+        assert portName != null;
+        return new QName(portName.getNamespaceURI(), portName.getLocalPart()+"Binding");
+    }
+
+    /**
+     * Sets additional classes obtained from {@link javax.xml.bind.annotation.XmlSeeAlso} annotation. In starting
+     * from wsdl case these classes would most likely be JAXB ObjectFactory that references other classes.
+     */
+    public void setAdditionalClasses(Class[] additionalClasses) {
+        for(Class cls:additionalClasses){
+            this.additionalClasses.add(cls);
+        }
+    }
+
+    private List<Class> additionalClasses = new ArrayList<Class>();
+
+    private Pool.Marshaller marshallers;
+    protected JAXBRIContext jaxbContext;
+    private String wsdlLocation;
+    private QName serviceName;
+    private QName portName;
+    private QName portTypeName;
+    private Map<Method,JavaMethodImpl> methodToJM = new HashMap<Method, JavaMethodImpl>();
+    private Map<QName,JavaMethodImpl> nameToJM = new HashMap<QName, JavaMethodImpl>();
+    private List<JavaMethodImpl> javaMethods = new ArrayList<JavaMethodImpl>();
+    private final Map<TypeReference, Bridge> bridgeMap = new HashMap<TypeReference, Bridge>();
+    protected final QName emptyBodyName = new QName("");
+    private String targetNamespace = "";
+    private List<String> knownNamespaceURIs = null;
+    private WSDLPortImpl port;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedException.java
deleted file mode 100644
index ada952c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedException.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.model;
-
-import com.sun.xml.internal.bind.api.TypeReference;
-import java.lang.reflect.Type;
-
-/**
- * CheckedException class. Holds the exception class - class that has public
- * constructor
- *
- * <code>public WrapperException()String message, FaultBean){}</code>
- *
- * and method
- *
- * <code>public FaultBean getFaultInfo();</code>
- *
- * @author Vivek Pandey
- */
-
-public class CheckedException {
-    /**
-     * @param exceptionClass
-     *            Userdefined or WSDL exception class that extends
-     *            java.lang.Exception.
-     * @param detail
-     *            detail or exception bean's TypeReference
-     * @param exceptionType
-     *            either ExceptionType.UserDefined or
-     *            ExceptionType.WSDLException
-     */
-    public CheckedException(Class exceptionClass, TypeReference detail, ExceptionType exceptionType) {
-        this.detail = detail;
-        this.exceptionType = exceptionType;
-        this.exceptionClass = exceptionClass;
-    }
-
-    /**
-     * @return the <code>Class</clode> for this object
-     *
-     */
-    public Class getExcpetionClass() {
-        return exceptionClass;
-    }
-
-    public Class getDetailBean() {
-        return (Class) detail.type;
-    }
-
-    public TypeReference getDetailType() {
-        return detail;
-    }
-
-    public ExceptionType getExceptionType() {
-        return exceptionType;
-    }
-
-    public void setHeaderFault(boolean hf) {
-        this.headerFault = hf;
-    }
-
-    public boolean isHeaderFault() {
-        return headerFault;
-    }
-
-    public void setMessageName(String messageName) {
-        this.messageName = messageName;
-    }
-
-    public String getMessageName() {
-        return messageName;
-    }
-
-    private Class exceptionClass;
-
-    private TypeReference detail;
-
-    private ExceptionType exceptionType;
-
-    private boolean headerFault = false;
-
-    private String messageName;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java
new file mode 100644
index 0000000..0da3db7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model;
+
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.model.CheckedException;
+import com.sun.xml.internal.ws.api.model.ExceptionType;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+
+/**
+ * CheckedException class. Holds the exception class - class that has public
+ * constructor
+ *
+ * <code>public WrapperException()String message, FaultBean){}</code>
+ *
+ * and method
+ *
+ * <code>public FaultBean getFaultInfo();</code>
+ *
+ * @author Vivek Pandey
+ */
+public final class CheckedExceptionImpl implements CheckedException {
+    private final Class exceptionClass;
+    private final TypeReference detail;
+    private final ExceptionType exceptionType;
+    private final JavaMethodImpl javaMethod;
+    private String messageName;
+    private String faultAction;
+
+    /**
+     * @param jm {@link JavaMethodImpl} that throws this exception
+     * @param exceptionClass
+     *            Userdefined or WSDL exception class that extends
+     *            java.lang.Exception.
+     * @param detail
+     *            detail or exception bean's TypeReference
+     * @param exceptionType
+     *            either ExceptionType.UserDefined or
+     */
+    public CheckedExceptionImpl(JavaMethodImpl jm, Class exceptionClass, TypeReference detail, ExceptionType exceptionType) {
+        this.detail = detail;
+        this.exceptionType = exceptionType;
+        this.exceptionClass = exceptionClass;
+        this.javaMethod = jm;
+    }
+
+    public AbstractSEIModelImpl getOwner() {
+        return javaMethod.owner;
+    }
+
+    public JavaMethod getParent() {
+        return javaMethod;
+    }
+
+    /**
+     * @return the <code>Class</clode> for this object
+     *
+     */
+    public Class getExceptionClass() {
+        return exceptionClass;
+    }
+
+    public Class getDetailBean() {
+        return (Class) detail.type;
+    }
+
+    public Bridge getBridge() {
+        return getOwner().getBridge(detail);
+    }
+
+    public TypeReference getDetailType() {
+        return detail;
+    }
+
+    public ExceptionType getExceptionType() {
+        return exceptionType;
+    }
+
+    public String getMessageName() {
+        return messageName;
+    }
+
+    public void setMessageName(String messageName) {
+        this.messageName = messageName;
+    }
+
+    public String getFaultAction() {
+        return faultAction;
+    }
+
+    public void setFaultAction(String faultAction) {
+        this.faultAction = faultAction;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java
deleted file mode 100644
index ff7d1eb..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ExceptionType.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model;
-/**
- * Type of java exception
- *
- * @author Vivek Pandey
- */
-public enum ExceptionType {
-    WSDLException(0), UserDefined(1);
-
-    ExceptionType(int exceptionType){
-        this.exceptionType = exceptionType;
-    }
-
-    public int value() {
-        return exceptionType;
-    }
-    private final int exceptionType;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethod.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethod.java
deleted file mode 100644
index f4e998a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethod.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-
-/**
- * Build this runtime model using java SEI and annotations
- *
- * @author Vivek Pandey
- */
-public class JavaMethod {
-    /**
-     *
-     */
-    public JavaMethod(Method method) {
-        this.method = method;
-    }
-
-    /**
-     * @return Returns the method.
-     */
-    public Method getMethod() {
-        return method;
-    }
-
-    /**
-     * @return Returns the mep.
-     */
-    public int getMEP() {
-        return mep;
-    }
-
-    /**
-     * @param mep
-     *            The mep to set.
-     */
-    public void setMEP(int mep) {
-        this.mep = mep;
-    }
-
-    /**
-     * @return the Binding object
-     */
-    public Object getBinding() {
-        if (binding == null)
-            return new SOAPBinding();
-        return binding;
-    }
-
-    /**
-     * @param binding
-     */
-    public void setBinding(Object binding) {
-        this.binding = binding;
-    }
-
-
-    public void setOperationName(String operationName) {
-        this.operationName = operationName;
-    }
-
-    public String getOperationName() {
-        return operationName;
-    }
-
-
-
-    /**
-     * @return returns unmodifiable list of request parameters
-     */
-    public List<Parameter> getRequestParameters() {
-        return unmReqParams;
-    }
-
-    /**
-     * @return returns unmodifiable list of response parameters
-     */
-    public List<Parameter> getResponseParameters() {
-        return unmResParams;
-    }
-
-    /**
-     * @param p
-     */
-    public void addParameter(Parameter p) {
-        if (p.isIN() || p.isINOUT()) {
-            if (requestParams.contains(p)) {
-                // TODO throw exception
-            }
-            requestParams.add(p);
-        }
-
-        if (p.isOUT() || p.isINOUT()) {
-            // this check is only for out parameters
-            if (requestParams.contains(p)) {
-                // TODO throw exception
-            }
-            responseParams.add(p);
-        }
-    }
-
-    public void addRequestParameter(Parameter p){
-        if (p.isIN() || p.isINOUT()) {
-            requestParams.add(p);
-        }
-    }
-
-    public void addResponseParameter(Parameter p){
-        if (p.isOUT() || p.isINOUT()) {
-            responseParams.add(p);
-        }
-    }
-
-    /**
-     * @return Returns number of java method parameters - that will be all the
-     *         IN, INOUT and OUT holders
-     */
-    public int getInputParametersCount() {
-        int count = 0;
-        for (Parameter param : requestParams) {
-            if (param.isWrapperStyle()) {
-                count += ((WrapperParameter) param).getWrapperChildren().size();
-            } else {
-                count++;
-            }
-        }
-
-        for (Parameter param : responseParams) {
-            if (param.isWrapperStyle()) {
-                for (Parameter wc : ((WrapperParameter) param).getWrapperChildren()) {
-                    if (!wc.isResponse() && wc.isOUT()) {
-                        count++;
-                    }
-                }
-            } else if (!param.isResponse() && param.isOUT()) {
-                count++;
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * @param ce
-     */
-    public void addException(CheckedException ce) {
-        if (!exceptions.contains(ce))
-            exceptions.add(ce);
-    }
-
-    /**
-     * @param exceptionClass
-     * @return CheckedException corresponding to the exceptionClass. Returns
-     *         null if not found.
-     */
-    public CheckedException getCheckedException(Class exceptionClass) {
-        for (CheckedException ce : exceptions) {
-            if (ce.getExcpetionClass().equals(exceptionClass))
-                return ce;
-        }
-        return null;
-    }
-
-    /**
-     * @return a list of checked Exceptions thrown by this method
-     */
-    public List<CheckedException> getCheckedExceptions(){
-        return Collections.unmodifiableList(exceptions);
-    }
-    /**
-     * @param detailType
-     * @return Gets the CheckedException corresponding to detailType. Returns
-     *         null if no CheckedExcpetion with the detailType found.
-     */
-    public CheckedException getCheckedException(TypeReference detailType) {
-        for (CheckedException ce : exceptions) {
-            TypeReference actual = ce.getDetailType();
-            if (actual.tagName.equals(detailType.tagName)
-                    && actual.type.getClass().getName()
-                            .equals(detailType.type.getClass().getName())) {
-                return ce;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns if the java method MEP is async
-     * @return if this is an Asynch MEP
-     */
-    public boolean isAsync(){
-        return mep == MessageStruct.ASYNC_CALLBACK_MEP || mep == MessageStruct.ASYNC_POLL_MEP;
-    }
-
-    private List<CheckedException> exceptions = new ArrayList<CheckedException>();
-    private Method method;
-    private final List<Parameter> requestParams = new ArrayList<Parameter>();
-    private final List<Parameter> responseParams = new ArrayList<Parameter>();
-    private final List<Parameter> unmReqParams =
-            Collections.unmodifiableList(requestParams);
-    private final List<Parameter> unmResParams =
-            Collections.unmodifiableList(responseParams);
-    private Object binding;
-    private int mep;
-    private String operationName;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java
new file mode 100644
index 0000000..127ee87
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java
@@ -0,0 +1,326 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model;
+
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.MEP;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.model.soap.SOAPBindingImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Action;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Build this runtime model using java SEI and annotations
+ *
+ * @author Vivek Pandey
+ */
+public final class JavaMethodImpl implements JavaMethod {
+    private String inputAction;
+    private String outputAction;
+    private final List<CheckedExceptionImpl> exceptions = new ArrayList<CheckedExceptionImpl>();
+    private final Method method;
+    /*package*/ final List<ParameterImpl> requestParams = new ArrayList<ParameterImpl>();
+    /*package*/ final List<ParameterImpl> responseParams = new ArrayList<ParameterImpl>();
+    private final List<ParameterImpl> unmReqParams = Collections.unmodifiableList(requestParams);
+    private final List<ParameterImpl> unmResParams = Collections.unmodifiableList(responseParams);
+    private SOAPBindingImpl binding;
+    private MEP mep;
+    private String operationName;
+    private WSDLBoundOperationImpl wsdlOperation;
+    /*package*/ final AbstractSEIModelImpl owner;
+    private final Method seiMethod;
+
+    /**
+     * @param owner
+     * @param method : Implementation class method
+     * @param seiMethod : corresponding SEI Method.
+     *                  Is there is no SEI, it should be Implementation class method
+     */
+    public JavaMethodImpl(AbstractSEIModelImpl owner, Method method, Method seiMethod) {
+        this.owner = owner;
+        this.method = method;
+        this.seiMethod = seiMethod;
+        Action action = method.getAnnotation(Action.class);
+        if(action != null) {
+            inputAction = action.input();
+            outputAction = action.output();
+        }
+    }
+
+    public SEIModel getOwner() {
+        return owner;
+    }
+
+    /**
+     * @see {@link JavaMethod}
+     *
+     * @return Returns the method.
+     */
+    public Method getMethod() {
+        return method;
+    }
+
+    /**
+     * @see {@link JavaMethod}
+     *
+     * @return Returns the SEI method where annotations are present
+     */
+    public Method getSEIMethod() {
+        return seiMethod;
+    }
+
+    /**
+     * @return Returns the mep.
+     */
+    public MEP getMEP() {
+        return mep;
+    }
+
+    /**
+     * @param mep
+     *            The mep to set.
+     */
+    void setMEP(MEP mep) {
+        this.mep = mep;
+    }
+
+    /**
+     * @return the Binding object
+     */
+    public SOAPBindingImpl getBinding() {
+        if (binding == null)
+            return new SOAPBindingImpl();
+        return binding;
+    }
+
+    /**
+     * @param binding
+     */
+    void setBinding(SOAPBindingImpl binding) {
+        this.binding = binding;
+    }
+
+    /**
+     * Returns the {@link WSDLBoundOperation} Operation associated with {@link this}
+     * operation.
+     *
+     * @return the WSDLBoundOperation for this JavaMethod
+     */
+    public @NotNull WSDLBoundOperation getOperation() {
+        assert wsdlOperation != null;
+        return wsdlOperation;
+    }
+
+    public void setOperationName(String name) {
+        this.operationName = name;
+    }
+
+    public String getOperationName() {
+        return operationName;
+    }
+
+    public String getRequestMessageName() {
+        return operationName;
+    }
+
+    public String getResponseMessageName() {
+        if(mep.isOneWay())
+            return null;
+        return operationName+"Response";
+    }
+
+    /**
+     * @return returns unmodifiable list of request parameters
+     */
+    public List<ParameterImpl> getRequestParameters() {
+        return unmReqParams;
+    }
+
+    /**
+     * @return returns unmodifiable list of response parameters
+     */
+    public List<ParameterImpl> getResponseParameters() {
+        return unmResParams;
+    }
+
+    void addParameter(ParameterImpl p) {
+        if (p.isIN() || p.isINOUT()) {
+            assert !requestParams.contains(p);
+            requestParams.add(p);
+        }
+
+        if (p.isOUT() || p.isINOUT()) {
+            // this check is only for out parameters
+            assert !responseParams.contains(p);
+            responseParams.add(p);
+        }
+    }
+
+    void addRequestParameter(ParameterImpl p){
+        if (p.isIN() || p.isINOUT()) {
+            requestParams.add(p);
+        }
+    }
+
+    void addResponseParameter(ParameterImpl p){
+        if (p.isOUT() || p.isINOUT()) {
+            responseParams.add(p);
+        }
+    }
+
+    /**
+     * @return Returns number of java method parameters - that will be all the
+     *         IN, INOUT and OUT holders
+     *
+     * @deprecated no longer use in the new architecture
+     */
+    public int getInputParametersCount() {
+        int count = 0;
+        for (ParameterImpl param : requestParams) {
+            if (param.isWrapperStyle()) {
+                count += ((WrapperParameter) param).getWrapperChildren().size();
+            } else {
+                count++;
+            }
+        }
+
+        for (ParameterImpl param : responseParams) {
+            if (param.isWrapperStyle()) {
+                for (ParameterImpl wc : ((WrapperParameter) param).getWrapperChildren()) {
+                    if (!wc.isResponse() && wc.isOUT()) {
+                        count++;
+                    }
+                }
+            } else if (!param.isResponse() && param.isOUT()) {
+                count++;
+            }
+        }
+
+        return count;
+    }
+
+    /**
+     * @param ce
+     */
+    void addException(CheckedExceptionImpl ce) {
+        if (!exceptions.contains(ce))
+            exceptions.add(ce);
+    }
+
+    /**
+     * @param exceptionClass
+     * @return CheckedException corresponding to the exceptionClass. Returns
+     *         null if not found.
+     */
+    public CheckedExceptionImpl getCheckedException(Class exceptionClass) {
+        for (CheckedExceptionImpl ce : exceptions) {
+            if (ce.getExceptionClass()==exceptionClass)
+                return ce;
+        }
+        return null;
+    }
+
+    public QName getPayloadName(){
+        if(payloadName != null)
+            return payloadName;
+        payloadName = wsdlOperation.getPayloadName();
+        return payloadName;
+    }
+
+    private QName payloadName;
+
+    /**
+     * @return a list of checked Exceptions thrown by this method
+     */
+    public List<CheckedExceptionImpl> getCheckedExceptions(){
+        return Collections.unmodifiableList(exceptions);
+    }
+
+    public String getInputAction() {
+        return inputAction;
+    }
+
+    public String getOutputAction() {
+        return outputAction;
+    }
+
+    /**
+     * @param detailType
+     * @return Gets the CheckedException corresponding to detailType. Returns
+     *         null if no CheckedExcpetion with the detailType found.
+     */
+    public CheckedExceptionImpl getCheckedException(TypeReference detailType) {
+        for (CheckedExceptionImpl ce : exceptions) {
+            TypeReference actual = ce.getDetailType();
+            if (actual.tagName.equals(detailType.tagName) && actual.type==detailType.type) {
+                return ce;
+            }
+        }
+        return null;
+    }
+
+
+
+    /**
+     * Returns if the java method  is async
+     * @return if this is an Asynch
+     */
+    public boolean isAsync(){
+        return mep.isAsync;
+    }
+
+    /*package*/ void freeze(WSDLPortImpl portType) {
+        this.wsdlOperation = portType.getBinding().get(new QName(portType.getBinding().getPortType().getName().getNamespaceURI(),operationName));
+        // TODO: replace this with proper error handling
+        if(wsdlOperation ==null)
+            throw new Error("Undefined operation name "+operationName);
+    }
+
+    final void fillTypes(List<TypeReference> types) {
+        fillTypes(requestParams, types);
+        fillTypes(responseParams, types);
+
+        for (CheckedExceptionImpl ce : exceptions) {
+            types.add(ce.getDetailType());
+        }
+    }
+
+    private void fillTypes(List<ParameterImpl> params, List<TypeReference> types) {
+        for (ParameterImpl p : params) {
+            p.fillTypes(types);
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java
deleted file mode 100644
index 3691fce..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Mode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.model;
-
-/**
- * Defines parameter mode, IN, OUT or INOUT
- *
- * @author Vivek Pandey
- */
-
-public enum Mode {
-    IN(0), OUT(1), INOUT(2);
-
-    private Mode(int mode){
-        this.mode = mode;
-    }
-    private final int mode;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Parameter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Parameter.java
deleted file mode 100644
index b02643a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Parameter.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.model;
-
-import com.sun.xml.internal.bind.api.TypeReference;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Holder;
-
-/**
- * runtime Parameter that abstracts the annotated java parameter
- *
- * @author Vivek Pandey
- */
-
-public class Parameter {
-    /**
-     *
-     */
-    public Parameter(TypeReference type, Mode mode, int index) {
-        this.typeReference = type;
-        this.name = type.tagName;
-        this.mode = mode;
-        this.index = index;
-    }
-
-    /**
-     * @return Returns the name.
-     */
-    public QName getName() {
-        return name;
-    }
-
-    /**
-     * @return Returns the TypeReference associated with this Parameter
-     */
-    public TypeReference getTypeReference() {
-        return typeReference;
-    }
-
-    /**
-     * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit
-     * @see RuntimeModel#applyParameterBinding(com.sun.xml.internal.ws.wsdl.parser.Binding)
-     */
-
-    void setTypeReference(TypeReference type){
-        typeReference = type;
-        name = type.tagName;
-    }
-
-    /**
-     * @return Returns the mode.
-     */
-    public Mode getMode() {
-        return mode;
-    }
-
-    /**
-     * @return Returns the index.
-     */
-    public int getIndex() {
-        return index;
-    }
-
-    /**
-     * @return WrapperStyle == true
-     */
-    public boolean isWrapperStyle() {
-        return false;
-    }
-
-    /**
-     * @return the Binding for this Parameter
-     */
-    public ParameterBinding getBinding() {
-        if(binding == null)
-            return ParameterBinding.BODY;
-        return binding;
-    }
-
-    /**
-     * @param binding
-     */
-    public void setBinding(ParameterBinding binding) {
-        this.binding = binding;
-    }
-
-    public void setInBinding(ParameterBinding binding){
-        this.binding = binding;
-    }
-
-    public void setOutBinding(ParameterBinding binding){
-        this.outBinding = binding;
-    }
-
-    public ParameterBinding getInBinding(){
-        return binding;
-    }
-
-    public ParameterBinding getOutBinding(){
-        if(outBinding == null)
-            return binding;
-        return outBinding;
-    }
-
-    public boolean isIN() {
-        return mode==Mode.IN;
-    }
-
-    public boolean isOUT() {
-        return mode==Mode.OUT;
-    }
-
-    public boolean isINOUT() {
-        return mode==Mode.INOUT;
-    }
-
-    public boolean isResponse() {
-        return index == -1;
-    }
-
-    /**
-     * Creates a holder if applicable else gives the object as it is. To be
-     * called on the inbound message.
-     *
-     * @param value
-     * @return the non-holder value if its Response or IN otherwise creates a
-     *         holder with the passed value and returns it back.
-     *
-     */
-    public Object createHolderValue(Object value) {
-        if (isResponse() || isIN()) {
-            return value;
-        }
-        return new Holder(value);
-    }
-
-    /**
-     * Gets the holder value if applicable. To be called for inbound client side
-     * message.
-     *
-     * @param obj
-     * @return the holder value if applicable.
-     */
-    public Object getHolderValue(Object obj) {
-        if (obj != null && obj instanceof Holder)
-            return ((Holder) obj).value;
-        return obj;
-    }
-
-    public static void setHolderValue(Object obj, Object value) {
-        if (obj instanceof Holder)
-            ((Holder) obj).value = value;
-        else
-            // TODO: this can't be correct
-            obj = value;
-    }
-
-    public String getPartName() {
-        if(partName == null)
-            return name.getLocalPart();
-        return partName;
-    }
-
-    public void setPartName(String partName) {
-        this.partName = partName;
-    }
-
-    protected ParameterBinding binding;
-    protected ParameterBinding outBinding;
-    protected int index;
-    protected Mode mode;
-    protected TypeReference typeReference;
-    protected QName name;
-    protected String partName;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterBinding.java
deleted file mode 100644
index ddc3fbb..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterBinding.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model;
-
-/**
- * Denotes the binding of a parameter.
- *
- * <p>
- * This is somewhat like an enumeration (but it is <b>NOT</b> an enumeration.)
- *
- * <p>
- * The possible values are
- * BODY, HEADER, UNBOUND, and ATTACHMENT. BODY, HEADER, and UNBOUND
- * has a singleton semantics, but there are multiple ATTACHMENT instances
- * as it carries additional MIME type parameter.
- *
- * <p>
- * So don't use '==' for testing the equality.
- */
-public final class ParameterBinding {
-    /**
-     * Singleton instance that represents 'BODY'
-     */
-    public static final ParameterBinding BODY = new ParameterBinding("BODY",null);
-    /**
-     * Singleton instance that represents 'HEADER'
-     */
-    public static final ParameterBinding HEADER = new ParameterBinding("HEADER",null);
-    /**
-     * Singleton instance that represents 'UNBOUND',
-     * meaning the parameter doesn't have a representation in a SOAP message.
-     */
-    public static final ParameterBinding UNBOUND = new ParameterBinding("UNBOUND",null);
-    /**
-     * Creates an instance that represents the attachment
-     * with a given MIME type.
-     *
-     * <p>
-     * TODO: shall we consider givint the singleton semantics by using
-     * a cache? It's more elegant to do so, but
-     * no where in JAX-WS RI two {@link ParameterBinding}s are compared today,
-     */
-    public static ParameterBinding createAttachment(String mimeType) {
-        return new ParameterBinding("ATTACHMENT",mimeType);
-    }
-
-
-    private String mimeType;
-    private final String name;
-
-    private ParameterBinding(String name,String mimeType) {
-        this.name = name;
-        this.mimeType = mimeType;
-    }
-
-
-
-    public String toString() {
-        return name;
-    }
-
-    /**
-     * Returns the MIME type associated with this binding.
-     *
-     * @throws IllegalStateException
-     *      if this binding doesn't represent an attachment.
-     *      IOW, if {@link #isAttachment()} returns false.
-     * @return
-     *      Can be null, if the MIME type is not known.
-     */
-    public String getMimeType() {
-        if(!isAttachment())
-            throw new IllegalStateException();
-        return mimeType;
-    }
-
-    public boolean isBody(){
-        return this==BODY;
-    }
-
-    public boolean isHeader(){
-        return this==HEADER;
-    }
-
-    public boolean isUnbound(){
-        return this==UNBOUND;
-    }
-
-    public boolean isAttachment(){
-        return name=="ATTACHMENT";
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterImpl.java
new file mode 100644
index 0000000..ac69d12
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterImpl.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.Parameter;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * runtime Parameter that abstracts the annotated java parameter
+ *
+ * <p>
+ * A parameter may be bound to a header, a body, or an attachment.
+ * Note that when it's bound to a body, it's bound to a body,
+ * it binds to the whole payload.
+ *
+ * <p>
+ * Sometimes multiple Java parameters are packed into the payload,
+ * in which case the subclass {@link WrapperParameter} is used.
+ *
+ * @author Vivek Pandey
+ */
+public class ParameterImpl implements Parameter {
+
+    private ParameterBinding binding;
+    private ParameterBinding outBinding;
+    private String partName;
+    private final int index;
+    private final Mode mode;
+    private TypeReference typeReference;
+    private QName name;
+    private final JavaMethodImpl parent;
+
+    public ParameterImpl(JavaMethodImpl parent, TypeReference type, Mode mode, int index) {
+        assert type != null;
+
+        this.typeReference = type;
+        this.name = type.tagName;
+        this.mode = mode;
+        this.index = index;
+        this.parent = parent;
+    }
+
+    //public ParameterImpl(TypeReference type, Mode mode, int index) {
+    //    this(null, type, mode, index);
+    //}
+
+    public AbstractSEIModelImpl getOwner() {
+        return parent.owner;
+    }
+
+    public JavaMethod getParent() {
+        return parent;
+    }
+
+    /**
+     * @return Returns the name.
+     */
+    public QName getName() {
+        return name;
+    }
+
+    public Bridge getBridge() {
+        return getOwner().getBridge(typeReference);
+    }
+
+    protected Bridge getBridge(TypeReference typeRef) {
+        return getOwner().getBridge(typeRef);
+    }
+
+    /**
+     * TODO: once the model gets JAXBContext, shouldn't {@link Bridge}s
+     * be made available from model objects?
+     *
+     * @return Returns the TypeReference associated with this Parameter
+     */
+    public TypeReference getTypeReference() {
+        return typeReference;
+    }
+
+    /**
+     * Sometimes we need to overwrite the typeReferenc, such as during patching for rpclit
+     * @see AbstractSEIModelImpl#applyParameterBinding(com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl)
+     */
+    void setTypeReference(TypeReference type){
+        typeReference = type;
+        name = type.tagName;
+    }
+
+
+    public Mode getMode() {
+        return mode;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    /**
+     * @return true if <tt>this instanceof {@link WrapperParameter}</tt>.
+     */
+    public boolean isWrapperStyle() {
+        return false;
+    }
+
+    public boolean isReturnValue() {
+        return index==-1;
+    }
+
+    /**
+     * @return the Binding for this Parameter
+     */
+    public ParameterBinding getBinding() {
+        if(binding == null)
+            return ParameterBinding.BODY;
+        return binding;
+    }
+
+    /**
+     * @param binding
+     */
+    public void setBinding(ParameterBinding binding) {
+        this.binding = binding;
+    }
+
+    public void setInBinding(ParameterBinding binding){
+        this.binding = binding;
+    }
+
+    public void setOutBinding(ParameterBinding binding){
+        this.outBinding = binding;
+    }
+
+    public ParameterBinding getInBinding(){
+        return binding;
+    }
+
+    public ParameterBinding getOutBinding(){
+        if(outBinding == null)
+            return binding;
+        return outBinding;
+    }
+
+    public boolean isIN() {
+        return mode==Mode.IN;
+    }
+
+    public boolean isOUT() {
+        return mode==Mode.OUT;
+    }
+
+    public boolean isINOUT() {
+        return mode==Mode.INOUT;
+    }
+
+    /**
+     * If true, this parameter maps to the return value of a method invocation.
+     *
+     * <p>
+     * {@link JavaMethodImpl#getResponseParameters()} is guaranteed to have
+     * at most one such {@link ParameterImpl}. Note that there coule be none,
+     * in which case the method returns <tt>void</tt>.
+     */
+    public boolean isResponse() {
+        return index == -1;
+    }
+
+    /**
+     * Creates a holder if applicable else gives the object as it is. To be
+     * called on the inbound message.
+     *
+     * @param value
+     * @return the non-holder value if its Response or IN otherwise creates a
+     *         holder with the passed value and returns it back.
+     *
+     */
+    public Object createHolderValue(Object value) {
+        if (isResponse() || isIN()) {
+            return value;
+        }
+        return new Holder(value);
+    }
+
+    /**
+     * Gets the holder value if applicable. To be called for inbound client side
+     * message.
+     *
+     * @param obj
+     * @return the holder value if applicable.
+     */
+    public Object getHolderValue(Object obj) {
+        if (obj != null && obj instanceof Holder)
+            return ((Holder) obj).value;
+        return obj;
+    }
+
+    public static void setHolderValue(Object obj, Object value) {
+        if (obj instanceof Holder)
+            ((Holder) obj).value = value;
+        else
+            // TODO: this can't be correct
+            obj = value;
+    }
+
+    public String getPartName() {
+        if(partName == null)
+            return name.getLocalPart();
+        return partName;
+    }
+
+    public void setPartName(String partName) {
+        this.partName = partName;
+    }
+
+
+    void fillTypes(List<TypeReference> types) {
+        types.add(getTypeReference());
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModel.java
deleted file mode 100644
index 888b233..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModel.java
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.Bridge;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.bind.api.JAXBRIContext;
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.bind.api.RawAccessor;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentUnmarshaller;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.wsdl.parser.Binding;
-import com.sun.xml.internal.ws.wsdl.parser.Part;
-import com.sun.xml.internal.ws.wsdl.parser.BindingOperation;
-import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
-
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * model of the web service.  Used by the runtime marshall/unmarshall
- * web service invocations
- *
- * $author: JAXWS Development Team
- */
-public abstract class RuntimeModel {
-
-    /**
-     *
-     */
-    public RuntimeModel() {
-        super();
-        // TODO Auto-generated constructor stub
-    }
-
-    public void postProcess() {
-        // should be called only once.
-        if (jaxbContext != null)
-            return;
-        populateMaps();
-        populateAsyncExceptions();
-        createJAXBContext();
-        createDecoderInfo();
-    }
-
-    /**
-     * Populate methodToJM and nameToJM maps.
-     */
-    protected void populateMaps() {
-        for (JavaMethod jm : getJavaMethods()) {
-            put(jm.getMethod(), jm);
-            for (Parameter p : jm.getRequestParameters()) {
-                put(p.getName(), jm);
-            }
-        }
-    }
-
-    protected void populateAsyncExceptions() {
-        for (JavaMethod jm : getJavaMethods()) {
-            int mep = jm.getMEP();
-            if (mep == MessageInfo.ASYNC_CALLBACK_MEP || mep == MessageInfo.ASYNC_POLL_MEP) {
-                String opName = jm.getOperationName();
-                Method m = jm.getMethod();
-                Class[] params = m.getParameterTypes();
-                if (mep == MessageInfo.ASYNC_CALLBACK_MEP) {
-                    params = new Class[params.length-1];
-                    System.arraycopy(m.getParameterTypes(), 0, params, 0, m.getParameterTypes().length-1);
-                }
-                try {
-                    Method om = m.getDeclaringClass().getMethod(opName, params);
-                    JavaMethod jm2 = getJavaMethod(om);
-                    for (CheckedException ce : jm2.getCheckedExceptions()) {
-                        jm.addException(ce);
-                    }
-                } catch (NoSuchMethodException ex) {
-                }
-            }
-        }
-    }
-
-    /**
-     * @return the <code>BridgeContext</code> for this <code>RuntimeModel</code>
-     */
-    public BridgeContext getBridgeContext() {
-        if (jaxbContext == null)
-            return null;
-        BridgeContext bc = bridgeContext.get();
-        if (bc == null) {
-            bc = jaxbContext.createBridgeContext();
-            bc.setAttachmentMarshaller(new JAXWSAttachmentMarshaller(enableMtom));
-            bc.setAttachmentUnmarshaller(new JAXWSAttachmentUnmarshaller());
-            bridgeContext.set(bc);
-        }
-        return bc;
-    }
-
-    /**
-     * @return the <code>JAXBRIContext</code>
-     */
-    public JAXBRIContext getJAXBContext() {
-        return jaxbContext;
-    }
-
-    /**
-     * @return the known namespaces from JAXBRIContext
-     */
-    public List<String> getKnownNamespaceURIs() {
-        return knownNamespaceURIs;
-    }
-
-    /**
-     * @param type
-     * @return the <code>Bridge</code> for the <code>type</code>
-     */
-    public Bridge getBridge(TypeReference type) {
-        return bridgeMap.get(type);
-    }
-
-    /**
-     * @param name
-     * @return either a <code>RpcLitpayload</code> or a <code>JAXBBridgeInfo</code> for
-     * an operation named <code>name</code>
-     */
-    public Object getDecoderInfo(QName name) {
-        Object obj = payloadMap.get(name);
-        if (obj instanceof RpcLitPayload) {
-            return RpcLitPayload.copy((RpcLitPayload) obj);
-        } else if (obj instanceof JAXBBridgeInfo) {
-            return JAXBBridgeInfo.copy((JAXBBridgeInfo) obj);
-        }
-        return null;
-    }
-
-    /**
-     * @param name
-     * @param payload
-     */
-    public void addDecoderInfo(QName name, Object payload) {
-        payloadMap.put(name, payload);
-    }
-
-    /**
-     * @return
-     */
-    private JAXBRIContext createJAXBContext() {
-        final List<TypeReference> types = getAllTypeReferences();
-        final Class[] cls = new Class[types.size()];
-        final String ns = targetNamespace;
-        int i = 0;
-        for (TypeReference type : types) {
-            cls[i++] = (Class) type.type;
-        }
-        try {
-            //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
-            // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
-            jaxbContext = (JAXBRIContext)
-                 AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                     public java.lang.Object run() throws Exception {
-                         return JAXBRIContext.newInstance(cls, types, ns, false);
-                     }
-                 });
-            createBridgeMap(types);
-        } catch (PrivilegedActionException e) {
-            throw new WebServiceException(e.getMessage(), e.getException());
-        }
-        knownNamespaceURIs = new ArrayList<String>();
-        for (String namespace : jaxbContext.getKnownNamespaceURIs()) {
-            if (namespace.length() > 0) {
-                if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
-                    knownNamespaceURIs.add(namespace);
-            }
-        }
-
-        return jaxbContext;
-    }
-
-    /**
-     * @return returns non-null list of TypeReference
-     */
-    public List<TypeReference> getAllTypeReferences() {
-        List<TypeReference> types = new ArrayList<TypeReference>();
-        Collection<JavaMethod> methods = methodToJM.values();
-        for (JavaMethod m : methods) {
-            fillTypes(m, types);
-            fillFaultDetailTypes(m, types);
-        }
-        return types;
-    }
-
-    private void fillFaultDetailTypes(JavaMethod m, List<TypeReference> types) {
-        for (CheckedException ce : m.getCheckedExceptions()) {
-            types.add(ce.getDetailType());
-//            addGlobalType(ce.getDetailType());
-        }
-    }
-
-    protected void fillTypes(JavaMethod m, List<TypeReference> types) {
-        addTypes(m.getRequestParameters(), types);
-        addTypes(m.getResponseParameters(), types);
-    }
-
-    private void addTypes(List<Parameter> params, List<TypeReference> types) {
-        for (Parameter p : params) {
-            types.add(p.getTypeReference());
-        }
-    }
-
-    private void createBridgeMap(List<TypeReference> types) {
-        for (TypeReference type : types) {
-            Bridge bridge = jaxbContext.createBridge(type);
-            bridgeMap.put(type, bridge);
-        }
-    }
-
-    /**
-     * @param qname
-     * @return the <code>Method</code> for a given Operation <code>qname</code>
-     */
-    public Method getDispatchMethod(QName qname) {
-        //handle the empty body
-        if (qname == null)
-            qname = emptyBodyName;
-        JavaMethod jm = getJavaMethod(qname);
-        if (jm != null) {
-            return jm.getMethod();
-        }
-        return null;
-    }
-
-    /**
-     * @param name
-     * @param method
-     * @return true if <code>name</code> is the name
-     * of a known fault name for the <code>Method method</code>
-     */
-    public boolean isKnownFault(QName name, Method method) {
-        JavaMethod m = getJavaMethod(method);
-        for (CheckedException ce : m.getCheckedExceptions()) {
-            if (ce.getDetailType().tagName.equals(name))
-                return true;
-        }
-        return false;
-    }
-
-    /**
-     * @param m
-     * @param ex
-     * @return true if <code>ex</code> is a Checked Exception
-     * for <code>Method m</code>
-     */
-    public boolean isCheckedException(Method m, Class ex) {
-        JavaMethod jm = getJavaMethod(m);
-        for (CheckedException ce : jm.getCheckedExceptions()) {
-            if (ce.getExcpetionClass().equals(ex))
-                return true;
-        }
-        return false;
-    }
-
-    /**
-     * @param method
-     * @return the <code>JavaMethod</code> representing the <code>method</code>
-     */
-    public JavaMethod getJavaMethod(Method method) {
-        return methodToJM.get(method);
-    }
-
-    /**
-     * @param name
-     * @return the <code>JavaMethod</code> associated with the
-     * operation named name
-     */
-    public JavaMethod getJavaMethod(QName name) {
-        return nameToJM.get(name);
-    }
-
-    /**
-     * @param jm
-     * @return the <code>QName</code> associated with the
-     * JavaMethod jm
-     */
-    public QName getQNameForJM(JavaMethod jm) {
-        Set<QName> set = nameToJM.keySet();
-        Iterator iter = set.iterator();
-        while (iter.hasNext()){
-            QName key = (QName) iter.next();
-            JavaMethod jmethod = (JavaMethod) nameToJM.get(key);
-            if (jmethod.getOperationName().equals(jm.getOperationName())){
-               return key;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * @return a <code>Collection</code> of <code>JavaMethods</code>
-     * associated with this <code>RuntimeModel</code>
-     */
-    public Collection<JavaMethod> getJavaMethods() {
-        return Collections.unmodifiableList(javaMethods);
-    }
-
-    public void addJavaMethod(JavaMethod jm) {
-        if (jm != null)
-            javaMethods.add(jm);
-    }
-
-    public void applyParameterBinding(Binding wsdlBinding){
-        if(wsdlBinding == null)
-            return;
-        wsdlBinding.finalizeBinding();
-        for(JavaMethod method : javaMethods){
-            if(method.isAsync())
-                continue;
-            boolean isRpclit = ((SOAPBinding)method.getBinding()).isRpcLit();
-            List<Parameter> reqParams = method.getRequestParameters();
-            List<Parameter> reqAttachParams = null;
-            for(Parameter param:reqParams){
-                if(param.isWrapperStyle()){
-                    if(isRpclit){
-                        WrapperParameter reqParam = (WrapperParameter)param;
-                        BindingOperation bo = wsdlBinding.get(method.getOperationName());
-                        if(bo != null && bo.getRequestNamespace() != null){
-                            patchRpclitNamespace(bo.getRequestNamespace(), reqParam);
-                        }
-                        reqAttachParams = applyRpcLitParamBinding(method, reqParam, wsdlBinding, Mode.IN);
-                    }
-                    continue;
-                }
-                String partName = param.getPartName();
-                if(partName == null)
-                    continue;
-                ParameterBinding paramBinding = wsdlBinding.getBinding(method.getOperationName(),
-                        partName, Mode.IN);
-                if(paramBinding != null)
-                    param.setInBinding(paramBinding);
-            }
-
-            List<Parameter> resAttachParams = null;
-            List<Parameter> resParams = method.getResponseParameters();
-            for(Parameter param:resParams){
-                if(param.isWrapperStyle()){
-                    if(isRpclit){
-                        WrapperParameter respParam = (WrapperParameter)param;
-                        BindingOperation bo = wsdlBinding.get(method.getOperationName());
-                        if(bo != null && bo.getResponseNamespace() != null){
-                            patchRpclitNamespace(bo.getResponseNamespace(), respParam);
-                        }
-                        resAttachParams = applyRpcLitParamBinding(method, respParam, wsdlBinding, Mode.OUT);
-                    }
-                    continue;
-                }
-                //if the parameter is not inout and its header=true then dont get binding from WSDL
-//                if(!param.isINOUT() && param.getBinding().isHeader())
-//                    continue;
-                String partName = param.getPartName();
-                if(partName == null)
-                    continue;
-                ParameterBinding paramBinding = wsdlBinding.getBinding(method.getOperationName(),
-                        partName, Mode.OUT);
-                if(paramBinding != null)
-                    param.setOutBinding(paramBinding);
-            }
-            if(reqAttachParams != null){
-                for(Parameter p : reqAttachParams){
-                    method.addRequestParameter(p);
-                }
-            }
-            if(resAttachParams != null){
-                for(Parameter p : resAttachParams){
-                    method.addResponseParameter(p);
-                }
-            }
-
-        }
-    }
-
-    /**
-     * For rpclit wrapper element inside <soapenv:Body>, the targetNamespace should be taked from
-     * the soapbind:body@namespace value. Since no annotations on SEI/impl class captures it so we
-     * need to get it from WSDL and patch it.     *
-     */
-    private void patchRpclitNamespace(String namespace, WrapperParameter param){
-        TypeReference type = param.getTypeReference();
-        TypeReference newType = new TypeReference(
-                new QName(namespace, type.tagName.getLocalPart()), type.type, type.annotations);
-
-        param.setTypeReference(newType);
-    }
-
-
-
-    /**
-     * Applies binding related information to the RpcLitPayload. The payload map is populated correctly.
-     * @param method
-     * @param wrapperParameter
-     * @param wsdlBinding
-     * @param mode
-     * @return
-     *
-     * Returns attachment parameters if/any.
-     */
-    private List<Parameter> applyRpcLitParamBinding(JavaMethod method, WrapperParameter wrapperParameter, Binding wsdlBinding, Mode mode) {
-        String opName = method.getOperationName();
-        RpcLitPayload payload = new RpcLitPayload(wrapperParameter.getName());
-        BindingOperation bo = wsdlBinding.get(opName);
-
-        Map<Integer, Parameter> bodyParams = new HashMap<Integer, Parameter>();
-        List<Parameter> unboundParams = new ArrayList<Parameter>();
-        List<Parameter> attachParams = new ArrayList<Parameter>();
-        for(Parameter param:wrapperParameter.getWrapperChildren()){
-            String partName = param.getPartName();
-            if(partName == null)
-                continue;
-
-            ParameterBinding paramBinding = wsdlBinding.getBinding(opName,
-                    partName, mode);
-            if(paramBinding != null){
-                if(mode == Mode.IN)
-                    param.setInBinding(paramBinding);
-                else if(mode == Mode.OUT)
-                    param.setOutBinding(paramBinding);
-
-                if(paramBinding.isUnbound()){
-                        unboundParams.add(param);
-                } else if(paramBinding.isAttachment()){
-                    attachParams.add(param);
-                }else if(paramBinding.isBody()){
-                    if(bo != null){
-                        Part p = bo.getPart(param.getPartName(), mode);
-                        if(p != null)
-                            bodyParams.put(p.getIndex(), param);
-                        else
-                            bodyParams.put(bodyParams.size(), param);
-                    }else{
-                        bodyParams.put(bodyParams.size(), param);
-                    }
-                }
-            }
-
-        }
-        wrapperParameter.clear();
-        for(int i = 0; i <  bodyParams.size();i++){
-            Parameter p = bodyParams.get(i);
-            wrapperParameter.addWrapperChild(p);
-            if(((mode == Mode.IN) && p.getInBinding().isBody())||
-                    ((mode == Mode.OUT) && p.getOutBinding().isBody())){
-                JAXBBridgeInfo bi = new JAXBBridgeInfo(getBridge(p.getTypeReference()), null);
-                payload.addParameter(bi);
-            }
-        }
-
-        for(Parameter p : attachParams){
-            JAXBBridgeInfo bi = new JAXBBridgeInfo(getBridge(p.getTypeReference()), null);
-            payloadMap.put(p.getName(), bi);
-        }
-
-        //add unbounded parts
-        for(Parameter p:unboundParams){
-            wrapperParameter.addWrapperChild(p);
-        }
-        payloadMap.put(wrapperParameter.getName(), payload);
-        return attachParams;
-    }
-
-
-    /**
-     * @param name
-     * @param jm
-     */
-    protected void put(QName name, JavaMethod jm) {
-        nameToJM.put(name, jm);
-    }
-
-    /**
-     * @param method
-     * @param jm
-     */
-    protected void put(Method method, JavaMethod jm) {
-        methodToJM.put(method, jm);
-    }
-
-    public String getWSDLLocation() {
-        return wsdlLocation;
-    }
-
-    public void setWSDLLocation(String location) {
-        wsdlLocation = location;
-    }
-
-    public QName getServiceQName() {
-        return serviceName;
-    }
-
-    public QName getPortName() {
-        return portName;
-    }
-
-    public QName getPortTypeName() {
-        return portTypeName;
-    }
-
-    public void setServiceQName(QName name) {
-        serviceName = name;
-    }
-
-    public void setPortName(QName name) {
-        portName = name;
-    }
-
-    public void setPortTypeName(QName name) {
-        portTypeName = name;
-    }
-
-    /**
-     * This is the targetNamespace for the WSDL containing the PortType
-     * definition
-     */
-    public void setTargetNamespace(String namespace) {
-        targetNamespace = namespace;
-    }
-
-    /**
-     * This is the targetNamespace for the WSDL containing the PortType
-     * definition
-     */
-    public String getTargetNamespace() {
-        return targetNamespace;
-    }
-
-    /**
-     * Add a global type.  Global types will be used to generate global
-     * elements in the generated schema's
-     * @param typeReference
-     */
-/*    public void addGlobalType(TypeReference typeReference) {
-
-    }*/
-
-    /**
-     * Add a global type.  Global types will be used to generate global
-     * elements in the generated schema's
-     * @return
-     */
-/*    public Collection<TypeReference> getGlobalTypes() {
-        return globalTypes;
-    }*/
-
-
-    /**
-     * Mtom processing is disabled by default. To enable it the RuntimeModel creator must call it to enable it.
-     * @param enableMtom
-     */
-    public void enableMtom(boolean enableMtom){
-        this.enableMtom = enableMtom;
-    }
-
-    public Map<Integer, RawAccessor> getRawAccessorMap() {
-        return rawAccessorMap;
-    }
-
-    protected abstract void createDecoderInfo();
-
-    private boolean enableMtom = false;
-    private ThreadLocal<BridgeContext> bridgeContext = new ThreadLocal<BridgeContext>();
-    protected JAXBRIContext jaxbContext;
-    private String wsdlLocation;
-    private QName serviceName;
-    private QName portName;
-    private QName portTypeName;
-    private Map<Method, JavaMethod> methodToJM = new HashMap<Method, JavaMethod>();
-    private Map<QName, JavaMethod> nameToJM = new HashMap<QName, JavaMethod>();
-    private List<JavaMethod> javaMethods = new ArrayList<JavaMethod>();
-    private final Map<TypeReference, Bridge> bridgeMap = new HashMap<TypeReference, Bridge>();
-    private final Map<QName, Object> payloadMap = new HashMap<QName, Object>();
-    protected final QName emptyBodyName = new QName("");
-    private String targetNamespace = "";
-    private final Map<Integer, RawAccessor> rawAccessorMap = new HashMap<Integer, RawAccessor>();
-    private List<String> knownNamespaceURIs = null;
-//    protected Collection<TypeReference> globalTypes = new ArrayList<TypeReference>();
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
new file mode 100644
index 0000000..9502b5e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
@@ -0,0 +1,1330 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.model.ExceptionType;
+import com.sun.xml.internal.ws.api.model.MEP;
+import com.sun.xml.internal.ws.api.model.Parameter;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLInputImpl;
+import com.sun.xml.internal.ws.resources.ModelerMessages;
+import com.sun.xml.internal.ws.util.localization.Localizable;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Action;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.Holder;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.Response;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.rmi.RemoteException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+import java.util.concurrent.Future;
+
+/**
+ * Creates a runtime model of a SEI (portClass).
+ *
+ * @author WS Developement Team
+ */
+public class RuntimeModeler {
+    private BindingID bindingId;
+    private Class portClass;
+    private AbstractSEIModelImpl model;
+    private com.sun.xml.internal.ws.model.soap.SOAPBindingImpl defaultBinding;
+    // can be empty but never null
+    private String packageName;
+    private String targetNamespace;
+    private boolean isWrapped = true;
+    private boolean usesWebMethod = false;
+    private ClassLoader classLoader = null;
+    //private Object implementor;
+    private final WSDLPortImpl binding;
+    private QName serviceName;
+    private QName portName;
+    private Map<Class, Boolean> classUsesWebMethod = new HashMap<Class, Boolean>();
+
+    /**
+     *
+     */
+    public static final String PD_JAXWS_PACKAGE_PD  = ".jaxws.";
+    /**
+     *
+     */
+    public static final String JAXWS_PACKAGE_PD     = "jaxws.";
+    public static final String RESPONSE             = "Response";
+    public static final String RETURN               = "return";
+    public static final String BEAN                 = "Bean";
+    public static final String SERVICE              = "Service";
+    public static final String PORT                 = "Port";
+    public static final Class HOLDER_CLASS = Holder.class;
+    public static final Class<RemoteException> REMOTE_EXCEPTION_CLASS = RemoteException.class;
+
+    /**
+     * creates an instance of RunTimeModeler given a <code>portClass</code> and <code>bindingId</code>
+     * @param portClass The SEI class to be modeled.
+     * @param serviceName The ServiceName to use instead of one calculated from the implementation class
+     * @param bindingId The binding identifier to be used when modeling the <code>portClass</code>.
+     */
+    public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull BindingID bindingId) {
+        this.portClass = portClass;
+        this.serviceName = serviceName;
+        this.binding = null;
+        this.bindingId = bindingId;
+    }
+
+    /**
+     *
+     * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
+     * @param sei The SEI class to be modeled.
+     * @param serviceName The ServiceName to use instead of one calculated from the implementation class
+     * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
+     */
+    public RuntimeModeler(@NotNull Class sei, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort){
+        this.portClass = sei;
+        this.serviceName = serviceName;
+        this.bindingId = wsdlPort.getBinding().getBindingId();
+
+        //If the bindingId is null lets default to SOAP 1.1 binding id. As it looks like this bindingId
+        //is used latter on from model to generate binding on the WSDL. So defaulting to SOAP 1.1 maybe
+        // safe to do.
+        if(this.bindingId == null)
+            this.bindingId = BindingID.SOAP11_HTTP;
+
+        this.binding = wsdlPort;
+    }
+
+    /**
+     * sets the classloader to be used when loading classes by the <code>RuntimeModeler</code>.
+     * @param classLoader ClassLoader used to load classes
+     */
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    /**
+     * sets the PortName to be used by the <code>RuntimeModeler</code>.
+     * @param portName The PortName to be used instead of the PortName
+     * retrieved via annotations
+     */
+    public void setPortName(QName portName) {
+        this.portName = portName;
+    }
+
+    private static <T extends Annotation> T getPrivClassAnnotation(final Class<?> clazz, final Class<T> T) {
+        return AccessController.doPrivileged(new PrivilegedAction<T>() {
+           public T run() {
+               return clazz.getAnnotation(T);
+           }
+        });
+    }
+
+    private static <T extends Annotation> T getPrivMethodAnnotation(final Method method, final Class<T> T) {
+        return AccessController.doPrivileged(new PrivilegedAction<T>() {
+           public T run() {
+               return method.getAnnotation(T);
+           }
+        });
+    }
+
+    private static Annotation[][] getPrivParameterAnnotations(final Method method) {
+        return AccessController.doPrivileged(new PrivilegedAction<Annotation[][]>() {
+           public Annotation[][] run() {
+               return method.getParameterAnnotations();
+           }
+        });
+    }
+
+    //currently has many local vars which will be eliminated after debugging issues
+    //first draft
+    /**
+     * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>.
+     * @return the runtime model for the <code>portClass</code>.
+     */
+    public AbstractSEIModelImpl buildRuntimeModel() {
+        model = new SOAPSEIModel();
+        Class clazz = portClass;
+        WebService webService = getPrivClassAnnotation(portClass, WebService.class);
+        if (webService == null) {
+            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
+                portClass.getCanonicalName());
+        }
+        if (webService.endpointInterface().length() > 0) {
+            clazz = getClass(webService.endpointInterface(), ModelerMessages.localizableRUNTIME_MODELER_CLASS_NOT_FOUND(webService.endpointInterface()));
+            WebService seiService = getPrivClassAnnotation(clazz, WebService.class);
+            if (seiService == null) {
+                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
+                    webService.endpointInterface());
+            }
+        }
+        if (serviceName == null)
+            serviceName = getServiceName(portClass);
+        model.setServiceQName(serviceName);
+
+        String portLocalName  = portClass.getSimpleName()+PORT;
+        if (webService.portName().length() >0) {
+            portLocalName = webService.portName();
+        } else if (webService.name().length() >0) {
+            portLocalName = webService.name()+PORT;
+        }
+
+        if (portName == null)
+            portName = new QName(serviceName.getNamespaceURI(), portLocalName);
+        if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) {
+            throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch",
+                serviceName, portName);
+        }
+        model.setPortName(portName);
+
+        processClass(clazz);
+        if (model.getJavaMethods().size() == 0)
+            throw new RuntimeModelerException("runtime.modeler.no.operations",
+                    portClass.getName());
+        model.postProcess();
+
+        // TODO: this needs to be fixed properly --
+        // when we are building RuntimeModel first before building WSDLModel,
+        // we still need to do this correctyl
+        if(binding!=null)
+            model.freeze(binding);
+
+        return model;
+    }
+
+    /**
+     * utility method to load classes
+     * @param className the name of the class to load
+     * @param errorMessage
+     *      Error message to use when the resolution fails.
+     * @return the class specified by <code>className</code>
+     */
+    private Class getClass(String className, Localizable errorMessage) {
+        try {
+            if (classLoader == null)
+                return Thread.currentThread().getContextClassLoader().loadClass(className);
+            else
+                return classLoader.loadClass(className);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeModelerException(errorMessage);
+        }
+    }
+
+    protected void setUsesWebMethod(Class clazz, Boolean usesWebMethod) {
+//        System.out.println("class: "+clazz.getName()+" uses WebMethod: "+usesWebMethod);
+        classUsesWebMethod.put(clazz, usesWebMethod);
+    }
+
+    protected void determineWebMethodUse(Class clazz) {
+        if (clazz == null)
+            return;
+        if (clazz.isInterface()) {
+            setUsesWebMethod(clazz, false);
+        }
+        else {
+            WebMethod webMethod;
+            boolean hasWebMethod = false;
+            for (Method method : clazz.getMethods()) {
+                if (method.getDeclaringClass()!=clazz)
+                    continue;
+                webMethod = getPrivMethodAnnotation(method, WebMethod.class);
+                if (webMethod != null &&
+                    !webMethod.exclude()) {
+                    hasWebMethod = true;
+                    break;
+                }
+            }
+            setUsesWebMethod(clazz, hasWebMethod);
+        }
+        determineWebMethodUse(clazz.getSuperclass());
+    }
+
+    void processClass(Class clazz) {
+        determineWebMethodUse(clazz);
+        WebService webService = getPrivClassAnnotation(clazz, WebService.class);
+        String portTypeLocalName  = clazz.getSimpleName();
+        if (webService.name().length() >0)
+            portTypeLocalName = webService.name();
+
+
+        targetNamespace = webService.targetNamespace();
+        packageName = "";
+        if (clazz.getPackage() != null)
+            packageName = clazz.getPackage().getName();
+        if (targetNamespace.length() == 0) {
+            targetNamespace = getNamespace(packageName);
+        }
+        model.setTargetNamespace(targetNamespace);
+        QName portTypeName = new QName(targetNamespace, portTypeLocalName);
+        model.setPortTypeName(portTypeName);
+        model.setWSDLLocation(webService.wsdlLocation());
+
+        javax.jws.soap.SOAPBinding soapBinding = getPrivClassAnnotation(clazz, javax.jws.soap.SOAPBinding.class);
+        if (soapBinding != null) {
+            isWrapped = soapBinding.parameterStyle().equals(
+                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
+        }
+        defaultBinding = createBinding(soapBinding);
+        /*
+         * if clazz != portClass then there is an SEI.  If there is an
+         * SEI, then all methods should be processed.  However, if there is
+         * no SEI, and the implementation class uses at least one
+         * WebMethod annotation, then only methods with this annotation
+         * will be processed.
+         */
+/*        if (clazz == portClass) {
+            WebMethod webMethod;
+            for (Method method : clazz.getMethods()) {
+                webMethod = getPrivMethodAnnotation(method, WebMethod.class);
+                if (webMethod != null &&
+                    !webMethod.exclude()) {
+                    usesWebMethod = true;
+                    break;
+                }
+            }
+        }*/
+
+        for (Method method : clazz.getMethods()) {
+            if (method.getDeclaringClass()==Object.class ||
+                !isWebMethod(method, clazz)) {
+                continue;
+            }
+            // TODO: binding can be null. We need to figure out how to post-process
+            // RuntimeModel to link to WSDLModel
+            processMethod(method, webService);
+        }
+        //Add additional jaxb classes referenced by {@link XmlSeeAlso}
+        XmlSeeAlso xmlSeeAlso = getPrivClassAnnotation(clazz, XmlSeeAlso.class);
+        if(xmlSeeAlso != null)
+            model.setAdditionalClasses(xmlSeeAlso.value());
+    }
+
+    protected boolean isWebMethod(Method method, Class clazz) {
+        if (clazz.isInterface()) {
+            return true;
+        }
+        Class declClass = method.getDeclaringClass();
+        boolean declHasWebService = getPrivClassAnnotation(declClass, WebService.class) != null;
+        WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
+        if (webMethod != null && !webMethod.exclude() &&
+            declHasWebService) {
+            return true;
+        }
+        return declHasWebService &&
+                !classUsesWebMethod.get(declClass);
+    }
+
+    /**
+     * creates a runtime model <code>SOAPBinding</code> from a <code>javax.jws.soap.SOAPBinding</code> object
+     * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
+     * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
+     */
+    protected com.sun.xml.internal.ws.model.soap.SOAPBindingImpl createBinding(javax.jws.soap.SOAPBinding soapBinding) {
+        com.sun.xml.internal.ws.model.soap.SOAPBindingImpl rtSOAPBinding =
+            new com.sun.xml.internal.ws.model.soap.SOAPBindingImpl();
+        Style style = soapBinding!=null ? soapBinding.style() : Style.DOCUMENT;
+        rtSOAPBinding.setStyle(style);
+        assert bindingId != null;
+        SOAPVersion soapVersion = bindingId.getSOAPVersion();
+        rtSOAPBinding.setSOAPVersion(soapVersion);
+        return rtSOAPBinding;
+    }
+
+    /**
+     * gets the namespace <code>String</code> for a given <code>packageName</code>
+     * @param packageName the name of the package used to find a namespace.
+     *      can be empty.
+     * @return the namespace for the specified <code>packageName</code>
+     */
+    public static String getNamespace(@NotNull String packageName) {
+        if (packageName.length() == 0)
+            return null;
+
+        StringTokenizer tokenizer = new StringTokenizer(packageName, ".");
+        String[] tokens;
+        if (tokenizer.countTokens() == 0) {
+            tokens = new String[0];
+        } else {
+            tokens = new String[tokenizer.countTokens()];
+            for (int i=tokenizer.countTokens()-1; i >= 0; i--) {
+                tokens[i] = tokenizer.nextToken();
+            }
+        }
+        StringBuilder namespace = new StringBuilder("http://");
+        for (int i=0; i<tokens.length; i++) {
+            if (i!=0)
+                namespace.append('.');
+            namespace.append(tokens[i]);
+        }
+        namespace.append('/');
+        return namespace.toString();
+    }
+
+    /**
+     * creates the runtime model for a method on the <code>portClass</code>
+     * @param method the method to model
+     * @param webService the instance of the <code>WebService</code> annotation on the <code>portClass</code>
+     */
+    protected void processMethod(Method method, WebService webService) {
+        int mods = method.getModifiers();
+        if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) {
+            if(method.getAnnotation(WebMethod.class)!=null) {
+                // if the user put @WebMethod on these non-qualifying method,
+                // it's an error
+                if(Modifier.isStatic(mods))
+                    throw new RuntimeModelerException(ModelerMessages.localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(method));
+                else
+                    throw new RuntimeModelerException(ModelerMessages.localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(method));
+            }
+            return;
+        }
+
+        WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
+        if (webMethod != null && webMethod.exclude())
+            return;
+
+        // If one WebMethod is used, then only methods with WebMethod will be
+        // processed.
+        if (usesWebMethod && webMethod == null) {
+            return;
+        }
+
+        JavaMethodImpl javaMethod;
+        //Class implementorClass = portClass;
+        if (method.getDeclaringClass()==portClass) {
+            javaMethod = new JavaMethodImpl(model,method,method);
+        } else {
+            try {
+                Method tmpMethod = portClass.getMethod(method.getName(),
+                    method.getParameterTypes());
+                javaMethod = new JavaMethodImpl(model,tmpMethod,method);
+            } catch (NoSuchMethodException e) {
+                throw new RuntimeModelerException("runtime.modeler.method.not.found",
+                    method.getName(), portClass.getName());
+            }
+        }
+
+        String methodName = method.getName();
+
+        //set MEP -oneway, async, req/resp
+        MEP mep = getMEP(method);
+        javaMethod.setMEP(mep);
+
+        String action = null;
+
+
+        String operationName = method.getName();
+        if (webMethod != null ) {
+            action = webMethod.action();
+            operationName = webMethod.operationName().length() > 0 ?
+                webMethod.operationName() :
+                operationName;
+        }
+
+        //override the @WebMethod.action value by the one from the WSDL
+        if(binding != null){
+            WSDLBoundOperationImpl bo = binding.getBinding().get(new QName(targetNamespace, operationName));
+            if(bo != null){
+                WSDLInputImpl wsdlInput = bo.getOperation().getInput();
+                String wsaAction = wsdlInput.getAction();
+                if(wsaAction != null && !wsdlInput.isDefaultAction())
+                    action = wsaAction;
+                else
+                    action = bo.getSOAPAction();
+            }
+        }
+
+        javaMethod.setOperationName(operationName);
+        SOAPBinding methodBinding =
+            method.getAnnotation(SOAPBinding.class);
+        if (methodBinding == null && !method.getDeclaringClass().equals(portClass)) {
+            if (!method.getDeclaringClass().isInterface()) {
+                methodBinding = method.getDeclaringClass().getAnnotation(SOAPBinding.class);
+            }
+        }
+        boolean methodIsWrapped = isWrapped;
+        Style style = defaultBinding.getStyle();
+        if (methodBinding != null) {
+            com.sun.xml.internal.ws.model.soap.SOAPBindingImpl mySOAPBinding = createBinding(methodBinding);
+            style = mySOAPBinding.getStyle();
+            if (action != null)
+                mySOAPBinding.setSOAPAction(action);
+            methodIsWrapped = methodBinding.parameterStyle().equals(
+                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
+            javaMethod.setBinding(mySOAPBinding);
+        } else {
+            com.sun.xml.internal.ws.model.soap.SOAPBindingImpl sb = new com.sun.xml.internal.ws.model.soap.SOAPBindingImpl(defaultBinding);
+            if (action != null)
+                sb.setSOAPAction(action);
+            else
+                sb.setSOAPAction("");
+            javaMethod.setBinding(sb);
+        }
+        if (!methodIsWrapped) {
+            processDocBareMethod(javaMethod, methodName, webMethod, operationName,
+                method, webService);
+        } else if (style.equals(Style.DOCUMENT)) {
+            processDocWrappedMethod(javaMethod, methodName, webMethod, operationName,
+                method, webService);
+        } else {
+            processRpcMethod(javaMethod, methodName, webMethod, operationName,
+                method, webService);
+        }
+        model.addJavaMethod(javaMethod);
+    }
+
+    private MEP getMEP(Method m){
+        if (m.isAnnotationPresent(Oneway.class)) {
+            return MEP.ONE_WAY;
+        }
+        if(Response.class.isAssignableFrom(m.getReturnType())){
+            return MEP.ASYNC_POLL;
+        }else if(Future.class.isAssignableFrom(m.getReturnType())){
+            return MEP.ASYNC_CALLBACK;
+        }
+        return MEP.REQUEST_RESPONSE;
+    }
+
+    /**
+     * models a document/literal wrapped method
+     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
+     * @param methodName the runtime model <code>JavaMethod</code> instance being created
+     * @param webMethod the runtime model <code>JavaMethod</code> instance being created
+     * @param operationName the runtime model <code>JavaMethod</code> instance being created
+     * @param method the <code>method</code> to model
+     * @param webService The <code>WebService</code> annotation instance on the <code>portClass</code>
+     */
+    protected void processDocWrappedMethod(JavaMethodImpl javaMethod, String methodName,
+                                           WebMethod webMethod, String operationName, Method method, WebService webService) {
+        boolean isOneway = method.isAnnotationPresent(Oneway.class);
+        RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
+        ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
+        String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
+        if (packageName == null || (packageName != null && packageName.length() == 0))
+            beanPackage = JAXWS_PACKAGE_PD;
+        String requestClassName;
+        if(reqWrapper != null && reqWrapper.className().length()>0){
+            requestClassName = reqWrapper.className();
+        }else{
+            requestClassName = beanPackage + capitalize(method.getName());
+        }
+
+
+        String responseClassName;
+        if(resWrapper != null && resWrapper.className().length()>0){
+            responseClassName = resWrapper.className();
+        }else{
+            responseClassName = beanPackage + capitalize(method.getName()) + RESPONSE;
+        }
+
+        Class requestClass = getClass(requestClassName, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(requestClassName));
+
+        String reqName = operationName;
+        String reqNamespace = targetNamespace;
+        if (reqWrapper != null) {
+            if (reqWrapper.targetNamespace().length() > 0)
+                reqNamespace = reqWrapper.targetNamespace();
+            if (reqWrapper.localName().length() > 0)
+                reqName = reqWrapper.localName();
+        }
+        QName reqElementName = new QName(reqNamespace, reqName);
+
+        Class responseClass = null;
+        String resName = operationName+"Response";
+        String resNamespace = targetNamespace;
+        if (!isOneway) {
+            responseClass = getClass(responseClassName, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(responseClassName));
+            if (resWrapper != null) {
+                if (resWrapper.targetNamespace().length() > 0)
+                    resNamespace = resWrapper.targetNamespace();
+                if (resWrapper.localName().length() > 0)
+                    resName = resWrapper.localName();
+            }
+        }
+        QName resElementName = new QName(resNamespace, resName);
+
+        TypeReference typeRef =
+                new TypeReference(reqElementName, requestClass);
+        WrapperParameter requestWrapper = new WrapperParameter(javaMethod, typeRef,
+            Mode.IN, 0);
+        requestWrapper.setBinding(ParameterBinding.BODY);
+        javaMethod.addParameter(requestWrapper);
+        WrapperParameter responseWrapper = null;
+        if (!isOneway) {
+            typeRef = new TypeReference(resElementName, responseClass);
+            responseWrapper = new WrapperParameter(javaMethod, typeRef, Mode.OUT, -1);
+            javaMethod.addParameter(responseWrapper);
+            responseWrapper.setBinding(ParameterBinding.BODY);
+        }
+
+        // return value
+        String resultName = RETURN;
+        String resultTNS = "";
+        QName resultQName = null;
+        WebResult webResult = method.getAnnotation(WebResult.class);
+        Class returnType = method.getReturnType();
+        boolean isResultHeader = false;
+        if (webResult != null) {
+            if (webResult.name().length() > 0)
+                resultName = webResult.name();
+            resultTNS = webResult.targetNamespace();
+            isResultHeader = webResult.header();
+            if (resultTNS.length() == 0 && webResult.header()) {
+                // headers must have a namespace
+                resultTNS = targetNamespace;
+            }
+            resultQName = new QName(resultTNS, resultName);
+        } else if (!isOneway && !returnType.getName().equals("void") && !javaMethod.isAsync()) {
+            if(resultQName == null){
+                resultQName = new QName(resultTNS, RETURN);
+            }
+        }
+
+        if(javaMethod.isAsync()){
+            returnType = getAsyncReturnType(method, returnType);
+            resultQName = new QName(RETURN);
+        }
+
+        if (!isOneway && (returnType != null) && (!returnType.getName().equals("void"))) {
+            Annotation[] rann = method.getAnnotations();
+            if (resultQName.getLocalPart() != null) {
+                TypeReference rTypeReference = new TypeReference(resultQName, returnType, rann);
+                ParameterImpl returnParameter = new ParameterImpl(javaMethod, rTypeReference, Mode.OUT, -1);
+                if (isResultHeader) {
+                    returnParameter.setBinding(ParameterBinding.HEADER);
+                    javaMethod.addParameter(returnParameter);
+                } else {
+                    returnParameter.setBinding(ParameterBinding.BODY);
+                    responseWrapper.addWrapperChild(returnParameter);
+                }
+            }
+        }
+
+        //get WebParam
+        Class<?>[] parameterTypes = method.getParameterTypes();
+        Type[] genericParameterTypes = method.getGenericParameterTypes();
+        Annotation[][] pannotations = getPrivParameterAnnotations(method);
+        int pos = 0;
+        for (Class clazzType : parameterTypes) {
+            String partName=null;
+            String paramName = "arg"+pos;
+            String paramNamespace = "";
+            boolean isHeader = false;
+
+            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
+                continue;
+            }
+
+            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
+            //set the actual type argument of Holder in the TypeReference
+            if (isHolder) {
+                if(clazzType==Holder.class){
+                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
+                }
+            }
+            Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
+            for (Annotation annotation : pannotations[pos]) {
+                if (annotation.annotationType() == WebParam.class) {
+                    WebParam webParam = (WebParam) annotation;
+                    if (webParam.name().length() > 0)
+                        paramName = webParam.name();
+                    isHeader = webParam.header();
+                    if(webParam.partName().length() > 0)
+                        partName = webParam.partName();
+                    else
+                        partName = paramName;
+                    if (isHeader) // headers cannot be in empty namespace
+                        paramNamespace = targetNamespace;
+                    if (!webParam.targetNamespace().equals("")) {
+                        paramNamespace = webParam.targetNamespace();
+                    }
+                    paramMode = webParam.mode();
+                    if (isHolder && paramMode == Mode.IN)
+                        paramMode = Mode.INOUT;
+                    break;
+                }
+            }
+            QName paramQName = new QName(paramNamespace, paramName);
+            typeRef =
+                new TypeReference(paramQName, clazzType, pannotations[pos]);
+            ParameterImpl param = new ParameterImpl(javaMethod, typeRef, paramMode, pos++);
+
+            if (isHeader) {
+                param.setBinding(ParameterBinding.HEADER);
+                javaMethod.addParameter(param);
+                param.setPartName(partName);
+            } else {
+                param.setBinding(ParameterBinding.BODY);
+                if (paramMode!=Mode.OUT) {
+                    requestWrapper.addWrapperChild(param);
+                }
+                if (paramMode!=Mode.IN) {
+                    if (isOneway) {
+                        throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters",
+                            portClass.getCanonicalName(), methodName);
+                    }
+                    responseWrapper.addWrapperChild(param);
+                }
+            }
+        }
+        processExceptions(javaMethod, method);
+    }
+
+
+    /**
+     * models a rpc/literal method
+     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
+     * @param methodName the name of the <code>method</code> being modeled.
+     * @param webMethod the <code>WebMethod</code> annotations instance on the <code>method</code>
+     * @param operationName the WSDL operation name for this <code>method</code>
+     * @param method the runtime model <code>JavaMethod</code> instance being created
+     * @param webService the runtime model <code>JavaMethod</code> instance being created
+     */
+    protected void processRpcMethod(JavaMethodImpl javaMethod, String methodName,
+                                    WebMethod webMethod, String operationName, Method method, WebService webService) {
+        boolean isOneway = method.isAnnotationPresent(Oneway.class);
+
+        // use Map to build parameters in the part order when they are known.
+        // if part is unbound, we just put them at the end, and for that we
+        // use a large index (10000+) to avoid colliding with ordered ones.
+        // this assumes that there's no operation with # of parameters > 10000,
+        // but I think it's a pretty safe assumption - KK.
+        Map<Integer, ParameterImpl> resRpcParams = new TreeMap<Integer, ParameterImpl>();
+        Map<Integer, ParameterImpl> reqRpcParams = new TreeMap<Integer, ParameterImpl>();
+
+        //Lets take the service namespace and overwrite it with the one we get it from wsdl
+        String reqNamespace = targetNamespace;
+        String respNamespace = targetNamespace;
+
+        if(binding != null && binding.getBinding().isRpcLit()){
+            QName opQName = new QName(binding.getBinding().getPortTypeName().getNamespaceURI(), operationName);
+            WSDLBoundOperationImpl op = binding.getBinding().get(opQName);
+            if(op != null){
+                //it cant be null, but lets not fail and try to work with service namespce
+                if(op.getRequestNamespace() != null){
+                    reqNamespace = op.getRequestNamespace();
+                }
+
+                //it cant be null, but lets not fail and try to work with service namespce
+                if(op.getResponseNamespace() != null){
+                    respNamespace = op.getResponseNamespace();
+                }
+            }
+        }
+
+        QName reqElementName = new QName(reqNamespace, operationName);
+        QName resElementName = null;
+        if (!isOneway) {
+            resElementName = new QName(respNamespace, operationName+RESPONSE);
+        }
+
+        Class wrapperType = CompositeStructure.class;
+        TypeReference typeRef = new TypeReference(reqElementName, wrapperType);
+        WrapperParameter requestWrapper = new WrapperParameter(javaMethod, typeRef, Mode.IN, 0);
+        requestWrapper.setInBinding(ParameterBinding.BODY);
+        javaMethod.addParameter(requestWrapper);
+        WrapperParameter responseWrapper = null;
+        if (!isOneway) {
+            typeRef = new TypeReference(resElementName, wrapperType);
+            responseWrapper = new WrapperParameter(javaMethod, typeRef, Mode.OUT, -1);
+            responseWrapper.setOutBinding(ParameterBinding.BODY);
+            javaMethod.addParameter(responseWrapper);
+        }
+
+        Class returnType = method.getReturnType();
+        String resultName = RETURN;
+        String resultTNS = targetNamespace;
+        String resultPartName = resultName;
+        boolean isResultHeader = false;
+        WebResult webResult = method.getAnnotation(WebResult.class);
+
+        if (webResult != null) {
+            isResultHeader = webResult.header();
+            if (webResult.name().length() > 0)
+                resultName = webResult.name();
+            if (webResult.partName().length() > 0) {
+                resultPartName = webResult.partName();
+                if (!isResultHeader)
+                    resultName = resultPartName;
+            } else
+                resultPartName = resultName;
+            if (webResult.targetNamespace().length() > 0)
+                resultTNS = webResult.targetNamespace();
+            isResultHeader = webResult.header();
+        }
+        QName resultQName;
+        if (isResultHeader)
+            resultQName = new QName(resultTNS, resultName);
+        else
+            resultQName = new QName(resultName);
+
+        if(javaMethod.isAsync()){
+            returnType = getAsyncReturnType(method, returnType);
+        }
+
+        if (!isOneway && returnType!=null && returnType!=void.class) {
+            Annotation[] rann = method.getAnnotations();
+            TypeReference rTypeReference = new TypeReference(resultQName, returnType, rann);
+            ParameterImpl returnParameter = new ParameterImpl(javaMethod, rTypeReference, Mode.OUT, -1);
+            returnParameter.setPartName(resultPartName);
+            if(isResultHeader){
+                returnParameter.setBinding(ParameterBinding.HEADER);
+                javaMethod.addParameter(returnParameter);
+            }else{
+                ParameterBinding rb = getBinding(operationName, resultPartName, false, Mode.OUT);
+                returnParameter.setBinding(rb);
+                if(rb.isBody()){
+                    WSDLPart p = getPart(new QName(targetNamespace,operationName), resultPartName, Mode.OUT);
+                    if(p == null)
+                        resRpcParams.put(resRpcParams.size()+10000, returnParameter);
+                    else
+                        resRpcParams.put(p.getIndex(), returnParameter);
+                }else{
+                    javaMethod.addParameter(returnParameter);
+                }
+            }
+        }
+
+        //get WebParam
+        Class<?>[] parameterTypes = method.getParameterTypes();
+        Type[] genericParameterTypes = method.getGenericParameterTypes();
+        Annotation[][] pannotations = getPrivParameterAnnotations(method);
+        int pos = 0;
+        for (Class clazzType : parameterTypes) {
+            String paramName = "";
+            String paramNamespace = "";
+            String partName = "";
+            boolean isHeader = false;
+
+            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
+                continue;
+            }
+
+            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
+            //set the actual type argument of Holder in the TypeReference
+            if (isHolder) {
+                if (clazzType==Holder.class)
+                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
+            }
+            Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
+            for (Annotation annotation : pannotations[pos]) {
+                if (annotation.annotationType() == javax.jws.WebParam.class) {
+                    javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
+                    paramName = webParam.name();
+                    partName = webParam.partName();
+                    isHeader = webParam.header();
+                    WebParam.Mode mode = webParam.mode();
+                    paramNamespace = webParam.targetNamespace();
+                    if (isHolder && mode == Mode.IN)
+                        mode = Mode.INOUT;
+                    paramMode = mode;
+                    break;
+                }
+            }
+
+            if (paramName.length() == 0) {
+                paramName = "arg"+pos;
+            }
+            if (partName.length() == 0) {
+                partName = paramName;
+            } else if (!isHeader) {
+                paramName = partName;
+            }
+            if (partName.length() == 0) {
+                partName = paramName;
+            }
+
+            QName paramQName;
+            if (!isHeader) {
+                //its rpclit body param, set namespace to ""
+                paramQName = new QName("", paramName);
+            } else {
+                if (paramNamespace.length() == 0)
+                    paramNamespace = targetNamespace;
+                paramQName = new QName(paramNamespace, paramName);
+            }
+            typeRef =
+                new TypeReference(paramQName, clazzType, pannotations[pos]);
+
+            ParameterImpl param = new ParameterImpl(javaMethod, typeRef, paramMode, pos++);
+            param.setPartName(partName);
+
+            if(paramMode == Mode.INOUT){
+                ParameterBinding pb = getBinding(operationName, partName, isHeader, Mode.IN);
+                param.setInBinding(pb);
+                pb = getBinding(operationName, partName, isHeader, Mode.OUT);
+                param.setOutBinding(pb);
+            }else{
+                if (isHeader) {
+                    param.setBinding(ParameterBinding.HEADER);
+                } else {
+                    ParameterBinding pb = getBinding(operationName, partName, false, paramMode);
+                    param.setBinding(pb);
+                }
+            }
+            if(param.getInBinding().isBody()){
+                if(!param.isOUT()){
+                    WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.IN);
+                    if(p == null)
+                        reqRpcParams.put(reqRpcParams.size()+10000, param);
+                    else
+                        reqRpcParams.put(p.getIndex(), param);
+                }
+
+                if(!param.isIN()){
+                    if (isOneway) {
+                            throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters",
+                                portClass.getCanonicalName(), methodName);
+                    }
+                    WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.OUT);
+                    if(p == null)
+                        resRpcParams.put(resRpcParams.size()+10000, param);
+                    else
+                        resRpcParams.put(p.getIndex(), param);
+                }
+            }else{
+                javaMethod.addParameter(param);
+            }
+        }
+        for (ParameterImpl p : reqRpcParams.values())
+            requestWrapper.addWrapperChild(p);
+        for (ParameterImpl p : resRpcParams.values())
+            responseWrapper.addWrapperChild(p);
+        processExceptions(javaMethod, method);
+    }
+
+    /**
+     * models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
+     * runtime model object
+     * @param javaMethod the runtime model object to add the exception model objects to
+     * @param method the <code>method</code> from which to find the exceptions to model
+     */
+    protected void processExceptions(JavaMethodImpl javaMethod, Method method) {
+        Action actionAnn = method.getAnnotation(Action.class);
+        FaultAction[] faultActions = {};
+        if(actionAnn != null)
+            faultActions = actionAnn.fault();
+        for (Class<?> exception : method.getExceptionTypes()) {
+            if (REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
+                continue;
+            Class exceptionBean;
+            Annotation[] anns;
+            WebFault webFault = getPrivClassAnnotation(exception, WebFault.class);
+            Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
+            ExceptionType exceptionType = ExceptionType.WSDLException;
+            String namespace = targetNamespace;
+            String name = exception.getSimpleName();
+            String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
+            if (packageName.length() == 0)
+                beanPackage = JAXWS_PACKAGE_PD;
+            String className = beanPackage+ name + BEAN;
+            if (webFault != null) {
+                if (webFault.faultBean().length()>0)
+                    className = webFault.faultBean();
+                if (webFault.name().length()>0)
+                    name = webFault.name();
+                if (webFault.targetNamespace().length()>0)
+                    namespace = webFault.targetNamespace();
+            }
+            if (faultInfoMethod == null)  {
+                exceptionBean = getClass(className, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(className));
+                exceptionType = ExceptionType.UserDefined;
+                anns = exceptionBean.getAnnotations();
+            } else {
+                exceptionBean = faultInfoMethod.getReturnType();
+                anns = faultInfoMethod.getAnnotations();
+            }
+            QName faultName = new QName(namespace, name);
+            TypeReference typeRef = new TypeReference(faultName, exceptionBean, anns);
+            CheckedExceptionImpl checkedException =
+                new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
+            checkedException.setMessageName(exception.getSimpleName());
+            for(FaultAction fa: faultActions) {
+                if(fa.className().equals(exception) && !fa.value().equals("")) {
+                    checkedException.setFaultAction(fa.value());
+                    break;
+                }
+            }
+            javaMethod.addException(checkedException);
+        }
+    }
+
+    /**
+     * returns the method that corresponds to "getFaultInfo".  Returns null if this is not an
+     * exception generated from a WSDL
+     * @param exception the class to search for the "getFaultInfo" method
+     * @return the method named "getFaultInfo" if this is an exception generated from WSDL or an
+     * exception that contains the <code>WebFault</code> annotation.  Otherwise it returns null
+     */
+    protected Method getWSDLExceptionFaultInfo(Class exception) {
+        if (!exception.isAnnotationPresent(WebFault.class))
+            return null;
+        try {
+            return exception.getMethod("getFaultInfo");
+        } catch (NoSuchMethodException e) {
+            return null;
+        }
+    }
+
+    /**
+     * models a document/literal bare method
+     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
+     * @param methodName the runtime model <code>JavaMethod</code> instance being created
+     * @param webMethod the runtime model <code>JavaMethod</code> instance being created
+     * @param operationName the runtime model <code>JavaMethod</code> instance being created
+     * @param method the runtime model <code>JavaMethod</code> instance being created
+     * @param webService the runtime model <code>JavaMethod</code> instance being created
+     */
+    protected void processDocBareMethod(JavaMethodImpl javaMethod, String methodName,
+                                        WebMethod webMethod, String operationName, Method method, WebService webService) {
+
+        String resultName = operationName+RESPONSE;
+        String resultTNS = targetNamespace;
+        String resultPartName = null;
+        boolean isResultHeader = false;
+        WebResult webResult = method.getAnnotation(WebResult.class);
+        if (webResult != null) {
+            if (webResult.name().length() > 0)
+                resultName = webResult.name();
+            if (webResult.targetNamespace().length() > 0)
+                resultTNS = webResult.targetNamespace();
+            resultPartName = webResult.partName();
+            isResultHeader = webResult.header();
+        }
+
+        Class returnType = method.getReturnType();
+
+        if(javaMethod.isAsync()){
+            returnType = getAsyncReturnType(method, returnType);
+        }
+
+        if ((returnType != null) && (!returnType.getName().equals("void"))) {
+            Annotation[] rann = method.getAnnotations();
+            if (resultName != null) {
+                QName responseQName = new QName(resultTNS, resultName);
+                TypeReference rTypeReference = new TypeReference(responseQName, returnType, rann);
+                ParameterImpl returnParameter = new ParameterImpl(javaMethod, rTypeReference, Mode.OUT, -1);
+
+                if(resultPartName == null || (resultPartName.length() == 0)){
+                    resultPartName = resultName;
+                }
+                returnParameter.setPartName(resultPartName);
+                if(isResultHeader){
+                    returnParameter.setBinding(ParameterBinding.HEADER);
+                }else{
+                    ParameterBinding rb = getBinding(operationName, resultPartName, false, Mode.OUT);
+                    returnParameter.setBinding(rb);
+                }
+                javaMethod.addParameter(returnParameter);
+            }
+        }
+
+        //get WebParam
+        Class<?>[] parameterTypes = method.getParameterTypes();
+        Type[] genericParameterTypes = method.getGenericParameterTypes();
+        Annotation[][] pannotations = getPrivParameterAnnotations(method);
+        int pos = 0;
+        for (Class clazzType : parameterTypes) {
+            String paramName = operationName; //method.getName();
+            String partName = null;
+            String requestNamespace = targetNamespace;
+            boolean isHeader = false;
+
+            //async
+            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
+                continue;
+            }
+
+            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
+            //set the actual type argument of Holder in the TypeReference
+            if (isHolder) {
+                if (clazzType==Holder.class)
+                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
+            }
+
+            Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
+            for (Annotation annotation : pannotations[pos]) {
+                if (annotation.annotationType() == javax.jws.WebParam.class) {
+                    javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
+                    if (webParam.name().length() > 0)
+                        paramName = webParam.name();
+                    partName = webParam.partName();
+                    if (!webParam.targetNamespace().equals("")) {
+                        requestNamespace = webParam.targetNamespace();
+                    }
+                    isHeader = webParam.header();
+                    paramMode = webParam.mode();
+                    if (isHolder && paramMode == Mode.IN)
+                        paramMode = Mode.INOUT;
+                    break;
+                }
+            }
+
+            QName requestQName = new QName(requestNamespace, paramName);
+            //doclit/wrapped
+            TypeReference typeRef = //operationName with upper 1 char
+                new TypeReference(requestQName, clazzType,
+                    pannotations[pos]);
+
+            ParameterImpl param = new ParameterImpl(javaMethod, typeRef, paramMode, pos++);
+            if(partName == null || (partName.length() == 0)){
+                partName = paramName;
+            }
+            param.setPartName(partName);
+            if(paramMode == Mode.INOUT){
+                ParameterBinding pb = getBinding(operationName, partName, isHeader, Mode.IN);
+                param.setInBinding(pb);
+                pb = getBinding(operationName, partName, isHeader, Mode.OUT);
+                param.setOutBinding(pb);
+            }else{
+                if (isHeader){
+                    param.setBinding(ParameterBinding.HEADER);
+                }else{
+                    ParameterBinding pb = getBinding(operationName, partName, false, paramMode);
+                    param.setBinding(pb);
+                }
+            }
+            javaMethod.addParameter(param);
+        }
+        validateDocBare(javaMethod);
+        processExceptions(javaMethod, method);
+    }
+
+    private void validateDocBare(JavaMethodImpl javaMethod) {
+        int numInBodyBindings = 0;
+        for(Parameter param : javaMethod.getRequestParameters()){
+            if(param.getBinding().equals(ParameterBinding.BODY) && param.isIN()){
+                numInBodyBindings++;
+            }
+            if(numInBodyBindings > 1){
+                throw new RuntimeModelerException(ModelerMessages.localizableNOT_A_VALID_BARE_METHOD(portClass.getName(), javaMethod.getMethod().getName()));
+            }
+        }
+    }
+
+    private Class getAsyncReturnType(Method method, Class returnType) {
+        if(Response.class.isAssignableFrom(returnType)){
+            Type ret = method.getGenericReturnType();
+            return Navigator.REFLECTION.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]);
+        }else{
+            Type[] types = method.getGenericParameterTypes();
+            Class[] params = method.getParameterTypes();
+            int i = 0;
+            for(Class cls : params){
+                if(AsyncHandler.class.isAssignableFrom(cls)){
+                    return Navigator.REFLECTION.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]);
+                }
+                i++;
+            }
+        }
+        return returnType;
+    }
+
+    /**
+     * utility to capitalize the first letter in a string
+     * @param name the string to capitalize
+     * @return the capitalized string
+     */
+    public static String capitalize(String name) {
+        if (name == null || name.length() == 0) {
+            return name;
+        }
+        char chars[] = name.toCharArray();
+        chars[0] = Character.toUpperCase(chars[0]);
+        return new String(chars);
+    }
+
+    /*
+    * Return service QName
+    */
+    /**
+     * gets the <code>wsdl:serviceName</code> for a given implementation class
+     * @param implClass the implementation class
+     * @return the <code>wsdl:serviceName</code> for the <code>implClass</code>
+     */
+    public static QName getServiceName(Class<?> implClass) {
+        if (implClass.isInterface()) {
+            throw new RuntimeModelerException("runtime.modeler.cannot.get.serviceName.from.interface",
+                                    implClass.getCanonicalName());
+        }
+
+        String name = implClass.getSimpleName()+SERVICE;
+        String packageName = "";
+        if (implClass.getPackage() != null)
+            packageName = implClass.getPackage().getName();
+
+        WebService webService = implClass.getAnnotation(WebService.class);
+        if (webService == null) {
+            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
+                implClass.getCanonicalName());
+        }
+        if (webService.serviceName().length() > 0) {
+            name = webService.serviceName();
+        }
+        String targetNamespace = getNamespace(packageName);
+        if (webService.targetNamespace().length() > 0) {
+            targetNamespace = webService.targetNamespace();
+        } else if (targetNamespace == null) {
+            throw new RuntimeModelerException("runtime.modeler.no.package",
+                implClass.getName());
+        }
+
+
+
+        return new QName(targetNamespace, name);
+    }
+
+    /**
+     * gets the <code>wsdl:portName</code> for a given implementation class
+     * @param implClass the implementation class
+     * @param targetNamespace Namespace URI for service name
+     * @return the <code>wsdl:portName</code> for the <code>implClass</code>
+     */
+    public static QName getPortName(Class<?> implClass, String targetNamespace) {
+        WebService webService = implClass.getAnnotation(WebService.class);
+        if (webService == null) {
+            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
+                implClass.getCanonicalName());
+        }
+        String name;
+        if (webService.portName().length() > 0) {
+            name = webService.portName();
+        } else if (webService.name().length() > 0) {
+            name = webService.name()+PORT;
+        } else {
+            name = implClass.getSimpleName()+PORT;
+        }
+
+        if (targetNamespace == null) {
+            if (webService.targetNamespace().length() > 0) {
+                targetNamespace = webService.targetNamespace();
+            } else {
+                String packageName = null;
+                if (implClass.getPackage() != null) {
+                    packageName = implClass.getPackage().getName();
+                }
+                targetNamespace = getNamespace(packageName);
+                if (targetNamespace == null) {
+                    throw new RuntimeModelerException("runtime.modeler.no.package",
+                        implClass.getName());
+                }
+            }
+
+        }
+
+        return new QName(targetNamespace, name);
+    }
+
+    /**
+     * Gives portType QName from implementatorClass or SEI
+     * @param  implOrSeiClass cant be null
+     * @return  <code>wsdl:portType@name</code>, null if it could not find the annotated class.
+     */
+    public static QName getPortTypeName(Class<?> implOrSeiClass){
+        assert(implOrSeiClass != null);
+        Class<?> clazz = implOrSeiClass;
+        if (!implOrSeiClass.isAnnotationPresent(WebService.class))
+                throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
+                                           implOrSeiClass.getCanonicalName());
+
+        if (!implOrSeiClass.isInterface()) {
+            WebService webService = implOrSeiClass.getAnnotation(WebService.class);
+            String epi = webService.endpointInterface();
+            if (epi.length() > 0) {
+                try {
+                    clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
+                } catch (ClassNotFoundException e) {
+                    throw new RuntimeModelerException("runtime.modeler.class.not.found", epi);
+                }
+                if (!clazz.isAnnotationPresent(javax.jws.WebService.class)) {
+                    throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
+                                        webService.endpointInterface());
+                }
+            }
+        }
+
+        WebService webService = clazz.getAnnotation(WebService.class);
+        String name = webService.name();
+        if(name.length() == 0){
+            name = clazz.getSimpleName();
+        }
+
+        String tns = webService.targetNamespace();
+        if (tns.length() == 0)
+            tns = getNamespace(clazz.getPackage().getName());
+        if (tns == null) {
+            throw new RuntimeModelerException("runtime.modeler.no.package", clazz.getName());
+        }
+        return new QName(tns, name);
+    }
+
+    private ParameterBinding getBinding(String operation, String part, boolean isHeader, Mode mode){
+        if(binding == null){
+            if(isHeader)
+                return ParameterBinding.HEADER;
+            else
+                return ParameterBinding.BODY;
+        }
+        QName opName = new QName(binding.getBinding().getPortType().getName().getNamespaceURI(), operation);
+        return binding.getBinding().getBinding(opName, part, mode);
+    }
+
+    private WSDLPart getPart(QName opName, String partName, Mode mode){
+        if(binding != null){
+            WSDLBoundOperationImpl bo = binding.getBinding().get(opName);
+            if(bo != null)
+                return bo.getPart(partName, mode);
+        }
+        return null;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java
new file mode 100644
index 0000000..9dcd960
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model;
+import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
+import com.sun.xml.internal.ws.util.localization.Localizable;
+
+/**
+ * RuntimeModelerException represents an exception that occurred while
+ * serializing a Java value as XML.
+ *
+ * @see JAXWSExceptionBase
+ *
+ * @author WS Development Team
+ */
+public class RuntimeModelerException extends JAXWSExceptionBase {
+
+    public RuntimeModelerException(String key, Object... args) {
+        super(key, args);
+    }
+
+    public RuntimeModelerException(Throwable throwable) {
+        super(throwable);
+    }
+
+    public RuntimeModelerException(Localizable arg) {
+        super("nestedModelerError", arg);
+    }
+
+    public String getDefaultResourceBundleName() {
+        return "com.sun.xml.internal.ws.resources.modeler";
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java
new file mode 100644
index 0000000..6ae27f4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model;
+
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.namespace.QName;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Creates SOAP specific RuntimeModel
+ *
+ * @author Vivek Pandey
+ */
+public class SOAPSEIModel extends AbstractSEIModelImpl {
+
+    @Override
+    protected void populateMaps() {
+        int emptyBodyCount = 0;
+        for(JavaMethodImpl jm : getJavaMethods()){
+            put(jm.getMethod(), jm);
+            boolean bodyFound = false;
+            for(ParameterImpl p:jm.getRequestParameters()){
+                ParameterBinding binding = p.getBinding();
+                if(binding.isBody()){
+                    put(p.getName(), jm);
+                    bodyFound = true;
+                }
+            }
+            if(!bodyFound){
+                put(emptyBodyName, jm);
+//                System.out.println("added empty body for: "+jm.getMethod().getName());
+                emptyBodyCount++;
+            }
+        }
+        if(emptyBodyCount > 1){
+            //TODO throw exception
+//            System.out.println("Error: Unqiue signature violation - more than 1 empty body!");
+        }
+    }
+
+    public Set<QName> getKnownHeaders() {
+        Set<QName> headers = new HashSet<QName>();
+        for (JavaMethodImpl method : getJavaMethods()) {
+            // fill in request headers
+            Iterator<ParameterImpl> params = method.getRequestParameters().iterator();
+            fillHeaders(params, headers, Mode.IN);
+
+            // fill in response headers
+            params = method.getResponseParameters().iterator();
+            fillHeaders(params, headers, Mode.OUT);
+        }
+        return headers;
+    }
+
+    /**
+     * @param params
+     * @param headers
+     */
+    private void fillHeaders(Iterator<ParameterImpl> params, Set<QName> headers, Mode mode) {
+        while (params.hasNext()) {
+            ParameterImpl param = params.next();
+            ParameterBinding binding = (mode == Mode.IN)?param.getInBinding():param.getOutBinding();
+            QName name = param.getName();
+            if (binding.isHeader() && !headers.contains(name)) {
+                headers.add(name);
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java
index fb5a8ac..ff619c5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,26 +24,44 @@
  */
 package com.sun.xml.internal.ws.model;
 
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.TypeReference;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+
+import javax.jws.WebParam.Mode;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
-import com.sun.xml.internal.bind.api.TypeReference;
-
 /**
- * Models Wrapper parameter
+ * {@link ParameterImpl} that represents a wrapper,
+ * which is a parameter that consists of multiple nested {@link ParameterImpl}s
+ * within, which together form a body part.
+ *
+ * <p>
+ * Java method parameters represented by nested {@link ParameterImpl}s will be
+ * packed into a "wrapper bean" and it becomes the {@link ParameterImpl} for the
+ * body.
+ *
+ * <p>
+ * This parameter is only used for the {@link ParameterBinding#BODY} binding.
+ * Other parameters that bind to other parts (such as headers or unbound)
+ * will show up directly under {@link JavaMethod}.
  *
  * @author Vivek Pandey
  */
-public class WrapperParameter extends Parameter{
-    public WrapperParameter(TypeReference type, Mode mode, int index) {
-        super(type, mode, index);
+public class WrapperParameter extends ParameterImpl {
+    protected final List<ParameterImpl> wrapperChildren = new ArrayList<ParameterImpl>();
+
+    // TODO: wrapper parameter doesn't use 'typeRef' --- it only uses tag name.
+    public WrapperParameter(JavaMethodImpl parent, TypeReference typeRef, Mode mode, int index) {
+        super(parent, typeRef, mode, index);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
      *
-     * @see com.sun.xml.internal.ws.rt.model.Parameter#isWrapperStyle()
+     * @deprecated
+     *      Why are you calling a method that always return true?
      */
     @Override
     public boolean isWrapperStyle() {
@@ -53,36 +71,34 @@
     /**
      * @return Returns the wrapperChildren.
      */
-    public List<Parameter> getWrapperChildren() {
-        return Collections.unmodifiableList(wrapperChildren);
+    public List<ParameterImpl> getWrapperChildren() {
+        return wrapperChildren;
     }
 
     /**
-     * @param wrapperChildren
-     *            The wrapperChildren to set.
-     */
-    public void addWrapperChildren(List<Parameter> wrapperChildren) {
-        this.wrapperChildren.addAll(wrapperChildren);
-    }
-
-    /**
+     * Adds a new child parameter.
+     *
      * @param wrapperChild
      */
-    public void addWrapperChild(Parameter wrapperChild) {
+    public void addWrapperChild(ParameterImpl wrapperChild) {
         wrapperChildren.add(wrapperChild);
-    }
-
-    /**
-     * removes the wrapper child from the given index
-     * @param index
-     * @return
-     */
-    public Parameter removeWrapperChild(int index){
-        return wrapperChildren.remove(index);
+        // must bind to body. see class javadoc
+        assert wrapperChild.getBinding()== ParameterBinding.BODY;
     }
 
     public void clear(){
         wrapperChildren.clear();
     }
-    protected final List<Parameter> wrapperChildren = new ArrayList<Parameter>();
+
+    @Override
+    void fillTypes(List<TypeReference> types) {
+        super.fillTypes(types);
+        if(getParent().getBinding().isRpcLit()) {
+            // for rpc/lit, we need to individually marshal/unmarshal wrapped values,
+            // so their TypeReference needs to be collected
+            assert getTypeReference().type==CompositeStructure.class;
+            for (ParameterImpl p : wrapperChildren)
+                p.fillTypes(types);
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBinding.java
deleted file mode 100644
index 7421be6..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBinding.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model.soap;
-
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-
-/**
- * Binding object that represents soap:binding
- *
-  * @author Vivek Pandey
- */
-public class SOAPBinding {
-    public SOAPBinding() {
-    }
-
-    public SOAPBinding(SOAPBinding sb){
-        this.use = sb.use;
-        this.style = sb.style;
-        this.soapVersion = sb.soapVersion;
-        this.soapAction = sb.soapAction;
-    }
-
-    /**
-     * @return Returns the use.
-     */
-    public Use getUse() {
-        return use;
-    }
-
-    /**
-     * @param use
-     *            The use to set.
-     */
-    public void setUse(Use use) {
-        this.use = use;
-    }
-
-    /**
-     * @return Returns the style.
-     */
-    public Style getStyle() {
-        return style;
-    }
-
-    /**
-     * @param style
-     *            The style to set.
-     */
-    public void setStyle(Style style) {
-        this.style = style;
-    }
-
-    /**
-     * @param version
-     */
-    public void setSOAPVersion(SOAPVersion version) {
-        this.soapVersion = version;
-    }
-
-    /**
-     * @return the SOAPVersion of this SOAPBinding
-     */
-    public SOAPVersion getSOAPVersion() {
-        return soapVersion;
-    }
-
-    /**
-     * @return true if this is a document/literal SOAPBinding
-     */
-    public boolean isDocLit() {
-        return style.equals(Style.DOCUMENT) && use.equals(Use.LITERAL);
-    }
-
-    /**
-     * @return true if this is a rpc/literal SOAPBinding
-     */
-    public boolean isRpcLit() {
-        return style.equals(Style.RPC) && use.equals(Use.LITERAL);
-    }
-
-    /**
-     * @return the soapAction header value. It's always non-null. soap
-     *         message serializer needs to generated SOAPAction HTTP header with
-     *         the return of this method enclosed in quotes("").
-     */
-    public String getSOAPAction() {
-        if (soapAction == null)
-            return "";
-        return soapAction;
-    }
-
-    /**
-     * @param soapAction
-     *            The soapAction to set.
-     */
-    public void setSOAPAction(String soapAction) {
-        this.soapAction = soapAction;
-    }
-
-    private Style style = Style.DOCUMENT;
-
-    private Use use = Use.LITERAL;
-
-    private SOAPVersion soapVersion = SOAPVersion.SOAP_11;
-
-    private String soapAction;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBindingImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBindingImpl.java
new file mode 100644
index 0000000..aa07c9e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPBindingImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.soap;
+
+import com.sun.xml.internal.ws.api.model.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+
+/**
+ * A wsdl:opeartion binding object that represents soap:binding. This can be
+ * the return of {@link com.sun.xml.internal.ws.api.model.JavaMethod#getBinding()}.
+ * <p/>
+ * the default values are always document/literal and SoapVersion is SOAP 1.1.
+ *
+ * @author Vivek Pandey
+ */
+public class SOAPBindingImpl extends SOAPBinding {
+    public SOAPBindingImpl() {
+    }
+
+    public SOAPBindingImpl(SOAPBinding sb) {
+        this.use = sb.getUse();
+        this.style = sb.getStyle();
+        this.soapVersion = sb.getSOAPVersion();
+        this.soapAction = sb.getSOAPAction();
+    }
+
+    /**
+     * @param style The style to set.
+     */
+    public void setStyle(Style style) {
+        this.style = style;
+    }
+
+    /**
+     * @param version
+     */
+    public void setSOAPVersion(SOAPVersion version) {
+        this.soapVersion = version;
+    }
+
+    /**
+     * @param soapAction The soapAction to set.
+     */
+    public void setSOAPAction(String soapAction) {
+        this.soapAction = soapAction;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPRuntimeModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPRuntimeModel.java
deleted file mode 100644
index 58405b5..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/SOAPRuntimeModel.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model.soap;
-
-import com.sun.xml.internal.bind.api.RawAccessor;
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.messaging.saaj.soap.SOAPVersionMismatchException;
-import com.sun.xml.internal.ws.encoding.jaxb.JAXBBridgeInfo;
-import com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.internal.BodyBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.*;
-import com.sun.xml.internal.ws.model.*;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.soap.SOAPFault;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-
-/**
- * Creates SOAP specific RuntimeModel
- *
- * @author Vivek Pandey
- */
-public class SOAPRuntimeModel extends RuntimeModel {
-
-    protected void createDecoderInfo() {
-        Collection<JavaMethod> methods = getJavaMethods();
-        for (JavaMethod m : methods) {
-            if(m.isAsync())
-                continue;
-            SOAPBinding binding = (SOAPBinding) m.getBinding();
-            setDecoderInfo(m.getRequestParameters(), binding, Mode.IN);
-            setDecoderInfo(m.getResponseParameters(), binding, Mode.OUT);
-            for(CheckedException ce:m.getCheckedExceptions()){
-                JAXBBridgeInfo bi = new JAXBBridgeInfo(getBridge(ce.getDetailType()));
-                addDecoderInfo(ce.getDetailType().tagName, bi);
-            }
-        }
-
-    }
-
-    private void setDecoderInfo(List<Parameter> params, SOAPBinding binding, Mode mode){
-        for (Parameter param : params) {
-            ParameterBinding paramBinding = (mode == Mode.IN)?param.getInBinding():param.getOutBinding();
-            if (paramBinding.isBody() && binding.isRpcLit()) {
-                RpcLitPayload payload = new RpcLitPayload(param.getName());
-                WrapperParameter wp = (WrapperParameter) param;
-                for (Parameter p : wp.getWrapperChildren()) {
-                    if(p.getBinding().isUnbound())
-                        continue;
-                    JAXBBridgeInfo bi = new JAXBBridgeInfo(getBridge(p.getTypeReference()),
-                        null);
-                    payload.addParameter(bi);
-                }
-                addDecoderInfo(param.getName(), payload);
-            } else {
-                JAXBBridgeInfo bi = new JAXBBridgeInfo(getBridge(param.getTypeReference()),
-                    null);
-                addDecoderInfo(param.getName(), bi);
-            }
-        }
-    }
-
-    /*
-     * @see RuntimeModel#populateMaps()
-     */
-    @Override
-    protected void populateMaps() {
-        int emptyBodyCount = 0;
-        for(JavaMethod jm:getJavaMethods()){
-            put(jm.getMethod(), jm);
-            boolean bodyFound = false;
-            for(Parameter p:jm.getRequestParameters()){
-                ParameterBinding binding = p.getBinding();
-                if(binding.isBody()){
-                    put(p.getName(), jm);
-                    bodyFound = true;
-                }
-            }
-            if(!bodyFound){
-                put(emptyBodyName, jm);
-//                System.out.println("added empty body for: "+jm.getMethod().getName());
-                emptyBodyCount++;
-            }
-        }
-        if(emptyBodyCount > 1){
-            //TODO throw exception
-//            System.out.println("Error: Unqiue signature violation - more than 1 empty body!");
-        }
-    }
-
-
-    /*
-     * @see RuntimeModel#fillTypes(JavaMethod, List)
-     */
-    @Override
-    protected void fillTypes(JavaMethod m, List<TypeReference> types) {
-        if(!(m.getBinding() instanceof SOAPBinding)){
-            //TODO throws exception
-            System.out.println("Error: Wrong Binding!");
-            return;
-        }
-        if(((SOAPBinding)m.getBinding()).isDocLit()){
-            super.fillTypes(m, types);
-            return;
-        }
-
-        //else is rpclit
-        addTypes(m.getRequestParameters(), types, Mode.IN);
-        addTypes(m.getResponseParameters(), types, Mode.OUT);
-    }
-
-    /**
-     * @param params
-     * @param types
-     * @param mode
-     */
-    private void addTypes(List<Parameter> params, List<TypeReference> types, Mode mode) {
-        for(Parameter p:params){
-            ParameterBinding binding = (mode == Mode.IN)?p.getInBinding():p.getOutBinding();
-            if(!p.isWrapperStyle()){
-                types.add(p.getTypeReference());
-            }else if(binding.isBody()){
-                List<Parameter> wcParams = ((WrapperParameter)p).getWrapperChildren();
-                for(Parameter wc:wcParams){
-                    types.add(wc.getTypeReference());
-                }
-            }
-        }
-    }
-
-
-    public Set<QName> getKnownHeaders() {
-        Set<QName> headers = new HashSet<QName>();
-        Iterator<JavaMethod> methods = getJavaMethods().iterator();
-        while (methods.hasNext()) {
-            JavaMethod method = methods.next();
-            // fill in request headers
-            Iterator<Parameter> params = method.getRequestParameters().iterator();
-            fillHeaders(params, headers, Mode.IN);
-
-            // fill in response headers
-            params = method.getResponseParameters().iterator();
-            fillHeaders(params, headers, Mode.OUT);
-        }
-        return headers;
-    }
-
-    /**
-     * @param params
-     * @param headers
-     */
-    private void fillHeaders(Iterator<Parameter> params, Set<QName> headers, Mode mode) {
-        while (params.hasNext()) {
-            Parameter param = params.next();
-            ParameterBinding binding = (mode == Mode.IN)?param.getInBinding():param.getOutBinding();
-            QName name = param.getName();
-            if (binding.isHeader() && !headers.contains(name)) {
-                headers.add(name);
-            }
-        }
-    }
-
-    /**
-     * Called by server
-     *
-     * @param obj
-     * @param actor
-     * @param detail
-     * @param internalMsg
-     * @return the InternalMessage for a fault
-     */
-    public static InternalMessage createFaultInBody(Object obj, String actor,
-            Object detail, InternalMessage internalMsg) {
-        SOAPFaultInfo faultInfo;
-        if (obj instanceof SOAPFaultInfo) {
-            faultInfo = (SOAPFaultInfo)obj;
-        } else if (obj instanceof ServerRtException) {
-            Throwable cause = ((ServerRtException)obj).getCause();
-            Throwable th = (cause == null) ? (ServerRtException)obj : cause;
-            faultInfo = createSOAPFaultInfo(th, actor, detail);
-
-        } else if (obj instanceof SOAPFaultException) {
-            SOAPFaultException e = (SOAPFaultException)obj;
-            faultInfo = new SOAPFaultInfo(e.getFault());
-        } else if (obj instanceof SOAPVersionMismatchException) {
-            QName faultCode = SOAPConstants.FAULT_CODE_VERSION_MISMATCH;
-            String faultString = "SOAP envelope version mismatch";
-            faultInfo =
-                new SOAPFaultInfo(faultString, faultCode, actor, null, javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING);
-        } else if (obj instanceof Exception) {
-            faultInfo = createSOAPFaultInfo((Exception)obj, actor, detail);
-        } else {
-            QName faultCode = SOAPConstants.FAULT_CODE_SERVER;
-            String faultString = "Unknown fault type:"+obj.getClass();
-            faultInfo =
-                new SOAPFaultInfo(faultString, faultCode, actor, null,javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING);
-        }
-
-        if (internalMsg == null) {
-            internalMsg = new InternalMessage();
-        }
-
-        BodyBlock bodyBlock = internalMsg.getBody();
-        if (bodyBlock == null) {
-            bodyBlock = new BodyBlock(faultInfo);
-            internalMsg.setBody(bodyBlock);
-        } else {
-            bodyBlock.setFaultInfo(faultInfo);
-        }
-
-        return internalMsg;
-    }
-
-    public static InternalMessage createSOAP12FaultInBody(Object obj, String role, String node, Object detail, InternalMessage im) {
-        SOAP12FaultInfo faultInfo;
-        if (obj instanceof SOAP12FaultInfo) {
-            faultInfo = (SOAP12FaultInfo)obj;
-        } else if (obj instanceof ServerRtException) {
-            Throwable cause = ((ServerRtException)obj).getCause();
-            Throwable th = (cause == null) ? (ServerRtException)obj : cause;
-            faultInfo = createSOAP12FaultInfo(th, role, node, detail);
-
-        } else if (obj instanceof SOAPFaultException) {
-            SOAPFaultException e = (SOAPFaultException)obj;
-            faultInfo = new SOAP12FaultInfo(e.getFault());
-        } else if (obj instanceof SOAPVersionMismatchException) {
-            String faultString = "SOAP envelope version mismatch";
-            FaultCode code = new FaultCode(FaultCodeEnum.VersionMismatch, (FaultSubcode) null);
-            FaultReason reason = new FaultReason(new FaultReasonText(faultString, Locale.getDefault()));
-            faultInfo = new SOAP12FaultInfo(code, reason, null, null, null);
-        } else if (obj instanceof Exception) {
-            faultInfo = createSOAP12FaultInfo((Exception)obj, role, node, detail);
-        } else {
-            String faultString = "Unknown fault type:"+obj.getClass();
-            FaultCode code = new FaultCode(FaultCodeEnum.Receiver, (FaultSubcode) null);
-            FaultReason reason = new FaultReason(new FaultReasonText(faultString, Locale.getDefault()));
-            faultInfo = new SOAP12FaultInfo(code, reason, null, null, null);
-        }
-        if (im == null) {
-            im = new InternalMessage();
-        }
-        BodyBlock bodyBlock = im.getBody();
-        if (bodyBlock == null) {
-            bodyBlock = new BodyBlock(faultInfo);
-            im.setBody(bodyBlock);
-        } else {
-            bodyBlock.setValue(faultInfo);
-        }
-        return im;
-    }
-
-    // currently adds not understood header blocks if there are any
-    public static void addHeaders(InternalMessage message, MessageInfo mi) {
-        Set<HeaderBlock> notUnderstoodHeaders =
-            MessageInfoUtil.getNotUnderstoodHeaders(mi);
-        if (notUnderstoodHeaders != null) {
-            for (HeaderBlock block : notUnderstoodHeaders) {
-                message.addHeader(block);
-            }
-        }
-    }
-
-    private static SOAP12FaultInfo createSOAP12FaultInfo(Throwable e, String role, String node, Object detail) {
-        SOAPFaultException soapFaultException = null;
-        FaultCode code = null;
-        FaultReason reason = null;
-        String faultRole = null;
-        String faultNode = null;
-        Throwable cause = e.getCause();
-        if (e instanceof SOAPFaultException) {
-            soapFaultException = (SOAPFaultException)e;
-        } else if (cause != null && cause instanceof SOAPFaultException) {
-            soapFaultException = (SOAPFaultException)e.getCause();
-        }
-        if (soapFaultException != null) {
-            SOAPFault soapFault =  soapFaultException.getFault();
-            code = new FaultCode(FaultCodeEnum.get(soapFault.getFaultCodeAsQName()), (FaultSubcode) null);
-            reason = new FaultReason(new FaultReasonText(soapFault.getFaultString(),
-                    soapFault.getFaultStringLocale()));
-            faultRole = soapFault.getFaultRole();
-            if(faultRole == null)
-                faultRole = role;
-            faultNode = soapFault.getFaultNode();
-            if(faultNode == null)
-                faultNode = node;
-        }
-
-        if (code == null || ((code != null) && code.getValue() == null)) {
-            code = new FaultCode(FaultCodeEnum.Receiver, (FaultSubcode) null);
-        }
-
-        if(reason == null){
-            String faultString = e.getMessage();
-            if (faultString == null) {
-                faultString = e.toString();
-            }
-
-            reason = new FaultReason(new FaultReasonText(faultString, Locale.getDefault()));
-        }
-
-        if ((detail == null) && (soapFaultException != null)) {
-            detail = soapFaultException.getFault().getDetail();
-        }
-
-        return new SOAP12FaultInfo(code, reason, faultRole, faultNode, detail);
-    }
-
-    //TODO: createSOAP12HeaderFault()
-
-
-    /**
-     * @param obj
-     * @param actor
-     * @param detailBlock
-     * @param internalMsg
-     * @return the <code>InteralMessage</code> for a HeaderFault
-     */
-    public static InternalMessage createHeaderFault(Object obj, String actor, JAXBBridgeInfo detailBlock, InternalMessage internalMsg){
-        //its headerfault so, create body fault with no detail. detail object goes as a header block
-        internalMsg = createFaultInBody(obj, actor, null, internalMsg);
-        HeaderBlock hdrBlock = new HeaderBlock(detailBlock);
-        internalMsg.addHeader(hdrBlock);
-        return internalMsg;
-    }
-
-    /**
-     * @param e
-     * @param actor
-     * @param detail
-     * @return
-     */
-    private static SOAPFaultInfo createSOAPFaultInfo(Throwable e, String actor,
-            Object detail) {
-//        e.printStackTrace();
-        SOAPFaultException soapFaultException = null;
-        QName faultCode = null;
-        String faultString = null;
-        String faultActor = null;
-        Throwable cause = e.getCause();
-        if (e instanceof SOAPFaultException) {
-            soapFaultException = (SOAPFaultException)e;
-        } else if (cause != null && cause instanceof SOAPFaultException) {
-            soapFaultException = (SOAPFaultException)e.getCause();
-        }
-        if (soapFaultException != null) {
-            faultCode = soapFaultException.getFault().getFaultCodeAsQName();
-            faultString = soapFaultException.getFault().getFaultString();
-            faultActor = soapFaultException.getFault().getFaultActor();
-        }
-
-        if (faultCode == null) {
-            faultCode = SOAPConstants.FAULT_CODE_SERVER;
-        }
-
-        if (faultString == null) {
-            faultString = e.getMessage();
-            if (faultString == null) {
-                faultString = e.toString();
-            }
-        }
-
-        if (faultActor == null) {
-            faultActor = actor;
-        }
-
-        if (detail == null && soapFaultException != null) {
-            detail = soapFaultException.getFault().getDetail();
-        }
-
-        return new SOAPFaultInfo(faultString, faultCode, faultActor, detail, javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Style.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Style.java
deleted file mode 100644
index bd5c20c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Style.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model.soap;
-
-/**
- * @author Vivek Pandey
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public enum Style {
-    DOCUMENT(0), RPC(1);
-
-    private Style(int style){
-        this.style = style;
-    }
-
-    public int value() {
-        return style;
-    }
-    private final int style;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Use.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Use.java
deleted file mode 100644
index b99847c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/soap/Use.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.model.soap;
-
-/**
- * @author Vivek Pandey
- *
- */
-public enum Use {
-    LITERAL(0), ENCODED(1);
-
-    private Use(int use){
-        this.use = use;
-    }
-
-    public int value() {
-        return use;
-    }
-    private final int use;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java
new file mode 100644
index 0000000..834ef37
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject;
+import com.sun.xml.internal.ws.resources.UtilMessages;
+import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.Location;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
+
+/**
+ * All the WSDL 1.1 elements that are extensible should subclass from this abstract implementation of
+ * {@link WSDLExtensible} interface.
+ *
+ * @author Vivek Pandey
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractExtensibleImpl extends AbstractObjectImpl implements WSDLExtensible {
+    protected final Set<WSDLExtension> extensions = new HashSet<WSDLExtension>();
+    // this captures any wsdl extensions that are not understood by WSDLExtensionParsers
+    // and have wsdl:required=true
+    protected List<UnknownWSDLExtension> notUnderstoodExtensions =
+            new ArrayList<UnknownWSDLExtension>();
+
+    protected AbstractExtensibleImpl(XMLStreamReader xsr) {
+        super(xsr);
+    }
+
+    protected AbstractExtensibleImpl(String systemId, int lineNumber) {
+        super(systemId, lineNumber);
+    }
+
+    public final Iterable<WSDLExtension> getExtensions() {
+        return extensions;
+    }
+
+    public final <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type) {
+        // TODO: this is a rather stupid implementation
+        List<T> r = new ArrayList<T>(extensions.size());
+        for (WSDLExtension e : extensions) {
+            if(type.isInstance(e))
+                r.add(type.cast(e));
+        }
+        return r;
+    }
+
+    public <T extends WSDLExtension> T getExtension(Class<T> type) {
+        for (WSDLExtension e : extensions) {
+            if(type.isInstance(e))
+                return type.cast(e);
+        }
+        return null;
+    }
+
+    public void addExtension(WSDLExtension ex) {
+        if(ex==null)
+            // I don't trust plugins. So let's always check it, instead of making this an assertion
+            throw new IllegalArgumentException();
+        extensions.add(ex);
+    }
+
+    /**
+     * This can be used if a WSDL extension element that has wsdl:required=true
+     * is not understood
+     * @param extnEl
+     * @param locator
+     */
+    public void addNotUnderstoodExtension(QName extnEl, Locator locator) {
+        notUnderstoodExtensions.add(new UnknownWSDLExtension(extnEl, locator));
+    }
+
+    protected class UnknownWSDLExtension implements WSDLExtension, WSDLObject {
+        private final QName extnEl;
+        private final Locator locator;
+        public UnknownWSDLExtension(QName extnEl, Locator locator) {
+            this.extnEl = extnEl;
+            this.locator = locator;
+        }
+        public QName getName() {
+            return extnEl;
+        }
+        @NotNull public Locator getLocation() {
+            return locator;
+        }
+        public String toString(){
+           return extnEl + " "+ UtilMessages.UTIL_LOCATION( locator.getLineNumber(), locator.getSystemId());
+       }
+    }
+
+    /**
+     * This method should be called after freezing the WSDLModel
+     * @return true if all wsdl required extensions on Port and Binding are understood
+     */
+    public boolean areRequiredExtensionsUnderstood() {
+        if (notUnderstoodExtensions.size() != 0) {
+            StringBuilder buf = new StringBuilder("Unknown WSDL extensibility elements:");
+            for (UnknownWSDLExtension extn : notUnderstoodExtensions)
+                buf.append('\n').append(extn.toString());
+            throw new WebServiceException(buf.toString());
+        }
+        return true;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractFeaturedObjectImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractFeaturedObjectImpl.java
new file mode 100644
index 0000000..69527b2d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractFeaturedObjectImpl.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractFeaturedObjectImpl extends AbstractExtensibleImpl implements WSDLFeaturedObject {
+    protected WebServiceFeatureList features;
+
+    protected AbstractFeaturedObjectImpl(XMLStreamReader xsr) {
+        super(xsr);
+    }
+    protected AbstractFeaturedObjectImpl(String systemId, int lineNumber) {
+        super(systemId, lineNumber);
+    }
+
+    public final void addFeature(WebServiceFeature feature) {
+        if (features == null)
+            features = new WebServiceFeatureList();
+
+        features.add(feature);
+    }
+
+    public @NotNull WebServiceFeatureList getFeatures() {
+        if(features == null)
+            return new WebServiceFeatureList();
+        return features;
+    }
+
+    public final WebServiceFeature getFeature(String id) {
+        if (features != null) {
+            for (WebServiceFeature f : features) {
+                if (f.getID().equals(id))
+                    return f;
+            }
+        }
+
+        return null;
+    }
+
+    @Nullable
+    public <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType) {
+        if(features==null)
+            return null;
+        else
+            return features.get(featureType);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractObjectImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractObjectImpl.java
new file mode 100644
index 0000000..02c4711
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractObjectImpl.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject;
+import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractObjectImpl implements WSDLObject {
+    // source location information
+    private final int lineNumber;
+    private final String systemId;
+
+
+    /*package*/ AbstractObjectImpl(XMLStreamReader xsr) {
+        Location loc = xsr.getLocation();
+        this.lineNumber = loc.getLineNumber();
+        this.systemId = loc.getSystemId();
+    }
+
+    /*package*/ AbstractObjectImpl(String systemId, int lineNumber) {
+        this.systemId = systemId;
+        this.lineNumber = lineNumber;
+    }
+
+    public final @NotNull Locator getLocation() {
+        LocatorImpl loc = new LocatorImpl();
+        loc.setSystemId(systemId);
+        loc.setLineNumber(lineNumber);
+        return loc;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java
new file mode 100644
index 0000000..2d54c35
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java
@@ -0,0 +1,382 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+
+import javax.jws.WebParam.Mode;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Implementation of {@link WSDLBoundOperation}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements WSDLBoundOperation {
+    private final QName name;
+
+    // map of wsdl:part to the binding
+    private final Map<String, ParameterBinding> inputParts;
+    private final Map<String, ParameterBinding> outputParts;
+    private final Map<String, ParameterBinding> faultParts;
+    private final Map<String, String> inputMimeTypes;
+    private final Map<String, String> outputMimeTypes;
+    private final Map<String, String> faultMimeTypes;
+
+    private boolean explicitInputSOAPBodyParts = false;
+    private boolean explicitOutputSOAPBodyParts = false;
+    private boolean explicitFaultSOAPBodyParts = false;
+
+    private Boolean emptyInputBody;
+    private Boolean emptyOutputBody;
+    private Boolean emptyFaultBody;
+
+    private final Map<String, WSDLPartImpl> inParts;
+    private final Map<String, WSDLPartImpl> outParts;
+    private final Map<String, WSDLPartImpl> fltParts;
+    private WSDLOperationImpl operation;
+    private String soapAction;
+    private ANONYMOUS anonymous;
+
+    private final WSDLBoundPortTypeImpl owner;
+
+    /**
+     *
+     * @param name wsdl:operation name qualified value
+     */
+    public WSDLBoundOperationImpl(XMLStreamReader xsr, WSDLBoundPortTypeImpl owner, QName name) {
+        super(xsr);
+        this.name = name;
+        inputParts = new HashMap<String, ParameterBinding>();
+        outputParts = new HashMap<String, ParameterBinding>();
+        faultParts = new HashMap<String, ParameterBinding>();
+        inputMimeTypes = new HashMap<String, String>();
+        outputMimeTypes = new HashMap<String, String>();
+        faultMimeTypes = new HashMap<String, String>();
+        inParts = new HashMap<String, WSDLPartImpl>();
+        outParts = new HashMap<String, WSDLPartImpl>();
+        fltParts = new HashMap<String, WSDLPartImpl>();
+        this.owner = owner;
+    }
+
+    public QName getName(){
+        return name;
+    }
+
+    public String getSOAPAction() {
+        return soapAction;
+    }
+
+    public void setSoapAction(String soapAction) {
+        this.soapAction = soapAction!=null?soapAction:"";
+    }
+
+    /**
+     * Gets {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPart} for the given wsdl:input or wsdl:output part
+     *
+     * @param partName must be non-null
+     * @param mode     must be non-null
+     * @return null if no part is found
+     */
+    public WSDLPartImpl getPart(String partName, Mode mode){
+        if(mode==Mode.IN){
+            return inParts.get(partName);
+        }else if(mode==Mode.OUT){
+            return outParts.get(partName);
+        }
+        return null;
+    }
+
+    public void addPart(WSDLPartImpl part, Mode mode){
+        if(mode==Mode.IN)
+            inParts.put(part.getName(), part);
+        else if(mode==Mode.OUT)
+            outParts.put(part.getName(), part);
+    }
+
+    /**
+     * Map of wsdl:input part name and the binding as {@link ParameterBinding}
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, ParameterBinding> getInputParts() {
+        return inputParts;
+    }
+
+    /**
+     * Map of wsdl:output part name and the binding as {@link ParameterBinding}
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, ParameterBinding> getOutputParts() {
+        return outputParts;
+    }
+
+    /**
+     * Map of wsdl:fault part name and the binding as {@link ParameterBinding}
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, ParameterBinding> getFaultParts() {
+        return faultParts;
+    }
+
+    /**
+     * Map of mime:content@part and the mime type from mime:content@type for wsdl:output
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, String> getInputMimeTypes() {
+        return inputMimeTypes;
+    }
+
+    /**
+     * Map of mime:content@part and the mime type from mime:content@type for wsdl:output
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, String> getOutputMimeTypes() {
+        return outputMimeTypes;
+    }
+
+    /**
+     * Map of mime:content@part and the mime type from mime:content@type for wsdl:fault
+     *
+     * @return empty Map if there is no parts
+     */
+    public Map<String, String> getFaultMimeTypes() {
+        return faultMimeTypes;
+    }
+
+    /**
+     * Gets {@link ParameterBinding} for a given wsdl part in wsdl:input
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public ParameterBinding getInputBinding(String part){
+        if(emptyInputBody == null){
+            if(inputParts.get(" ") != null)
+                emptyInputBody = true;
+            else
+                emptyInputBody = false;
+        }
+        ParameterBinding block = inputParts.get(part);
+        if(block == null){
+            if(explicitInputSOAPBodyParts || emptyInputBody)
+                return ParameterBinding.UNBOUND;
+            return ParameterBinding.BODY;
+        }
+
+        return block;
+    }
+
+    /**
+     * Gets {@link ParameterBinding} for a given wsdl part in wsdl:output
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public ParameterBinding getOutputBinding(String part){
+        if(emptyOutputBody == null){
+            if(outputParts.get(" ") != null)
+                emptyOutputBody = true;
+            else
+                emptyOutputBody = false;
+        }
+        ParameterBinding block = outputParts.get(part);
+        if(block == null){
+            if(explicitOutputSOAPBodyParts || emptyOutputBody)
+                return ParameterBinding.UNBOUND;
+            return ParameterBinding.BODY;
+        }
+
+        return block;
+    }
+
+    /**
+     * Gets {@link ParameterBinding} for a given wsdl part in wsdl:fault
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public ParameterBinding getFaultBinding(String part){
+        if(emptyFaultBody == null){
+            if(faultParts.get(" ") != null)
+                emptyFaultBody = true;
+            else
+                emptyFaultBody = false;
+        }
+        ParameterBinding block = faultParts.get(part);
+        if(block == null){
+            if(explicitFaultSOAPBodyParts || emptyFaultBody)
+                return ParameterBinding.UNBOUND;
+            return ParameterBinding.BODY;
+        }
+
+        return block;
+    }
+
+    /**
+     * Gets the MIME type for a given wsdl part in wsdl:input
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public String getMimeTypeForInputPart(String part){
+        return inputMimeTypes.get(part);
+    }
+
+    /**
+     * Gets the MIME type for a given wsdl part in wsdl:output
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public String getMimeTypeForOutputPart(String part){
+        return outputMimeTypes.get(part);
+    }
+
+    /**
+     * Gets the MIME type for a given wsdl part in wsdl:fault
+     *
+     * @param part Name of wsdl:part, must be non-null
+     * @return null if the part is not found.
+     */
+    public String getMimeTypeForFaultPart(String part){
+        return faultMimeTypes.get(part);
+    }
+
+    public WSDLOperationImpl getOperation() {
+        return operation;
+    }
+
+    public void setInputExplicitBodyParts(boolean b) {
+        explicitInputSOAPBodyParts = b;
+    }
+
+    public void setOutputExplicitBodyParts(boolean b) {
+        explicitOutputSOAPBodyParts = b;
+    }
+
+    public void setFaultExplicitBodyParts(boolean b) {
+        explicitFaultSOAPBodyParts = b;
+    }
+
+    private Style style = Style.DOCUMENT;
+    public void setStyle(Style style){
+        this.style = style;
+    }
+
+    public @Nullable QName getPayloadName() {
+        if(style.equals(Style.RPC)){
+            return name;
+        }else{
+            if(emptyPayload)
+                return null;
+
+            if(payloadName != null)
+                return payloadName;
+
+            QName inMsgName = operation.getInput().getMessage().getName();
+            WSDLMessageImpl message = messages.get(inMsgName);
+            for(WSDLPartImpl part:message.parts()){
+                ParameterBinding binding = getInputBinding(part.getName());
+                if(binding.isBody()){
+                    payloadName = part.getDescriptor().name();
+                    return payloadName;
+                }
+            }
+
+            //Its empty payload
+            emptyPayload = true;
+        }
+        //empty body
+        return null;
+    }
+
+    private String reqNamespace;
+    private String respNamespace;
+
+    /**
+     * For rpclit gives namespace value on soapbinding:body@namespace
+     *
+     * @return   non-null for rpclit and null for doclit
+     * @see com.sun.xml.internal.ws.model.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethodImpl, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService)
+     */
+    public String getRequestNamespace(){
+        return reqNamespace;
+    }
+
+    public void setRequestNamespace(String ns){
+        reqNamespace = ns;
+    }
+
+
+    /**
+     * For rpclit gives namespace value on soapbinding:body@namespace
+     *
+     * @return   non-null for rpclit and null for doclit
+     *      * @see com.sun.xml.internal.ws.modeler.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethod, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService)
+     */
+    public String getResponseNamespace(){
+        return respNamespace;
+    }
+
+    public void setResponseNamespace(String ns){
+        respNamespace = ns;
+    }
+
+    WSDLBoundPortTypeImpl getOwner(){
+        return owner;
+    }
+
+    private QName payloadName;
+    private boolean emptyPayload;
+    private Map<QName, WSDLMessageImpl> messages;
+
+    void freeze(WSDLModelImpl parent) {
+        messages = parent.getMessages();
+        operation = owner.getPortType().get(name.getLocalPart());
+    }
+
+    public void setAnonymous(ANONYMOUS anonymous) {
+        this.anonymous = anonymous;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public ANONYMOUS getAnonymous() {
+        return anonymous;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java
new file mode 100644
index 0000000..d249696
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.util.QNameMap;
+import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+
+import javax.jws.WebParam.Mode;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.soap.MTOMFeature;
+
+/**
+ * Implementation of {@link WSDLBoundPortType}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl implements WSDLBoundPortType {
+    private final QName name;
+    private final QName portTypeName;
+    private WSDLPortTypeImpl portType;
+    private BindingID bindingId;
+    private final @NotNull WSDLModelImpl owner;
+    private boolean finalized = false;
+    private final QNameMap<WSDLBoundOperationImpl> bindingOperations = new QNameMap<WSDLBoundOperationImpl>();
+
+    /**
+     * Operations keyed by the payload tag name.
+     */
+    private QNameMap<WSDLBoundOperationImpl> payloadMap;
+    /**
+     * {@link #payloadMap} doesn't allow null key, so we store the value for it here.
+     */
+    private WSDLBoundOperationImpl emptyPayloadOperation;
+
+
+
+    public WSDLBoundPortTypeImpl(XMLStreamReader xsr,@NotNull WSDLModelImpl owner, QName name, QName portTypeName) {
+        super(xsr);
+        this.owner = owner;
+        this.name = name;
+        this.portTypeName = portTypeName;
+        owner.addBinding(this);
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public @NotNull WSDLModelImpl getOwner() {
+        return owner;
+    }
+
+    public WSDLBoundOperationImpl get(QName operationName) {
+        return bindingOperations.get(operationName);
+    }
+
+    /**
+     * Populates the Map that holds operation name as key and {@link WSDLBoundOperation} as the value.
+     *
+     * @param opName Must be non-null
+     * @param ptOp   Must be non-null
+     * @throws NullPointerException if either opName or ptOp is null
+     */
+    public void put(QName opName, WSDLBoundOperationImpl ptOp) {
+        bindingOperations.put(opName,ptOp);
+    }
+
+    public QName getPortTypeName() {
+        return portTypeName;
+    }
+
+    public WSDLPortTypeImpl getPortType() {
+        return portType;
+    }
+
+    public Iterable<WSDLBoundOperationImpl> getBindingOperations() {
+        return bindingOperations.values();
+    }
+
+    public BindingID getBindingId() {
+        //Should the default be SOAP1.1/HTTP binding? For now lets keep it for
+        //JBI bug 6509800
+        return (bindingId==null)?BindingID.SOAP11_HTTP:bindingId;
+    }
+
+    public void setBindingId(BindingID bindingId) {
+        this.bindingId = bindingId;
+    }
+
+    /**
+     * sets whether the {@link WSDLBoundPortType} is rpc or lit
+     */
+    private Style style = Style.DOCUMENT;
+    public void setStyle(Style style){
+        this.style = style;
+    }
+
+    public SOAPBinding.Style getStyle() {
+        return style;
+    }
+
+    public boolean isRpcLit(){
+        return Style.RPC==style;
+    }
+
+    public boolean isDoclit(){
+        return Style.DOCUMENT==style;
+    }
+
+
+    /**
+     * Gets the {@link ParameterBinding} for a given operation, part name and the direction - IN/OUT
+     *
+     * @param operation wsdl:operation@name value. Must be non-null.
+     * @param part      wsdl:part@name such as value of soap:header@part. Must be non-null.
+     * @param mode      {@link Mode#IN} or {@link Mode@OUT}. Must be non-null.
+     * @return null if the binding could not be resolved for the part.
+     */
+    public ParameterBinding getBinding(QName operation, String part, Mode mode) {
+        WSDLBoundOperationImpl op = get(operation);
+        if (op == null) {
+            //TODO throw exception
+            return null;
+        }
+        if ((Mode.IN == mode) || (Mode.INOUT == mode))
+            return op.getInputBinding(part);
+        else
+            return op.getOutputBinding(part);
+    }
+
+    /**
+     * Gets mime:content@part value which is the MIME type for a given operation, part and {@link Mode}.
+     *
+     * @param operation wsdl:operation@name value. Must be non-null.
+     * @param part      wsdl:part@name such as value of soap:header@part. Must be non-null.
+     * @param mode      {@link Mode#IN} or {@link Mode@OUT}. Must be non-null.
+     * @return null if the binding could not be resolved for the part.
+     */
+    public String getMimeType(QName operation, String part, Mode mode) {
+        WSDLBoundOperationImpl op = get(operation);
+        if (Mode.IN == mode)
+            return op.getMimeTypeForInputPart(part);
+        else
+            return op.getMimeTypeForOutputPart(part);
+    }
+
+    public WSDLBoundOperationImpl getOperation(String namespaceUri, String localName) {
+        if(namespaceUri==null && localName == null)
+            return emptyPayloadOperation;
+        else{
+            return payloadMap.get((namespaceUri==null)?"":namespaceUri,localName);
+        }
+    }
+
+    public void enableMTOM() {
+        features.add(new MTOMFeature());
+    }
+
+    public boolean isMTOMEnabled() {
+        return features.isEnabled(MTOMFeature.class);
+    }
+
+    public SOAPVersion getSOAPVersion(){
+        return getBindingId().getSOAPVersion();
+    }
+
+    void freeze() {
+        portType = owner.getPortType(portTypeName);
+        if(portType == null){
+            throw new LocatableWebServiceException(
+                    ClientMessages.UNDEFINED_PORT_TYPE(portTypeName), getLocation());
+        }
+        portType.freeze();
+
+        for (WSDLBoundOperationImpl op : bindingOperations.values()) {
+            op.freeze(owner);
+        }
+
+        freezePayloadMap();
+        if(style == Style.RPC){
+            owner.finalizeRpcLitBinding(this);
+        }
+    }
+
+    private void freezePayloadMap() {
+        if(style== Style.RPC) {
+            // If the style is rpc then the tag name should be
+            // same as operation name so return the operation that matches the tag name.
+            payloadMap = bindingOperations;
+        } else {
+            payloadMap = new QNameMap<WSDLBoundOperationImpl>();
+            // For doclit The tag will be the operation that has the same input part descriptor value
+            for(WSDLBoundOperationImpl op : bindingOperations.values()){
+                QName name = op.getPayloadName();
+                if(name == null){
+                    //empty payload
+                    emptyPayloadOperation = op;
+                    continue;
+                }
+
+                payloadMap.put(name, op);
+            }
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java
new file mode 100644
index 0000000..c5f0fe5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLFault {
+    private final String name;
+    private final QName messageName;
+    private WSDLMessageImpl message;
+
+    public WSDLFaultImpl(XMLStreamReader xsr,String name, QName messageName) {
+        super(xsr);
+        this.name = name;
+        this.messageName = messageName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public WSDLMessageImpl getMessage() {
+        return message;
+    }
+
+    void freeze(WSDLModelImpl root){
+        message = root.getMessage(messageName);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java
new file mode 100644
index 0000000..e66dcd6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLInput {
+    private String name;
+    private QName messageName;
+    private WSDLOperationImpl operation;
+    private WSDLMessageImpl message;
+    private String action;
+    private boolean defaultAction = true;
+
+    public WSDLInputImpl(XMLStreamReader xsr,String name, QName messageName, WSDLOperationImpl operation) {
+        super(xsr);
+        this.name = name;
+        this.messageName = messageName;
+        this.operation = operation;
+    }
+
+    public String getName() {
+        if(name != null)
+            return name;
+
+        return (operation.isOneWay())?operation.getName().getLocalPart():operation.getName().getLocalPart()+"Request";
+    }
+
+    public WSDLMessage getMessage() {
+        return message;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    public boolean isDefaultAction() {
+        return defaultAction;
+    }
+
+    public void setDefaultAction(boolean defaultAction) {
+        this.defaultAction = defaultAction;
+    }
+
+    void freeze(WSDLModelImpl parent) {
+        message = parent.getMessage(messageName);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java
new file mode 100644
index 0000000..43f0a0f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.util.ArrayList;
+
+/**
+ * Provides abstraction for wsdl:message
+ * @author Vivek Pandey
+ */
+public final class WSDLMessageImpl extends AbstractExtensibleImpl implements WSDLMessage {
+    private final QName name;
+    private final ArrayList<WSDLPartImpl> parts;
+
+    /**
+     * @param name wsdl:message name attribute value
+     */
+    public WSDLMessageImpl(XMLStreamReader xsr,QName name) {
+        super(xsr);
+        this.name = name;
+        this.parts = new ArrayList<WSDLPartImpl>();
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public void add(WSDLPartImpl part){
+        parts.add(part);
+    }
+
+    Iterable<WSDLPartImpl> parts(){
+        return parts;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java
new file mode 100644
index 0000000..62b3623
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java
@@ -0,0 +1,233 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Implementation of {@link WSDLModel}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLModel {
+    private final Map<QName, WSDLMessageImpl> messages = new HashMap<QName, WSDLMessageImpl>();
+    private final Map<QName, WSDLPortTypeImpl> portTypes = new HashMap<QName, WSDLPortTypeImpl>();
+    private final Map<QName, WSDLBoundPortTypeImpl> bindings = new HashMap<QName, WSDLBoundPortTypeImpl>();
+    private final Map<QName, WSDLServiceImpl> services = new LinkedHashMap<QName, WSDLServiceImpl>();
+
+    private final Map<QName,WSDLBoundPortType> unmBindings
+        = Collections.<QName,WSDLBoundPortType>unmodifiableMap(bindings);
+
+
+    public WSDLModelImpl(@NotNull String systemId) {
+        super(systemId,-1);
+    }
+
+    /**
+     * To create {@link WSDLModelImpl} from WSDL that doesn't have a system ID.
+     */
+    public WSDLModelImpl() {
+        super(null,-1);
+    }
+
+    public void addMessage(WSDLMessageImpl msg){
+        messages.put(msg.getName(), msg);
+    }
+
+    public WSDLMessageImpl getMessage(QName name){
+        return messages.get(name);
+    }
+
+    public void addPortType(WSDLPortTypeImpl pt){
+        portTypes.put(pt.getName(), pt);
+    }
+
+    public WSDLPortTypeImpl getPortType(QName name){
+        return portTypes.get(name);
+    }
+
+    public void addBinding(WSDLBoundPortTypeImpl boundPortType){
+        assert !bindings.containsValue(boundPortType);
+        bindings.put(boundPortType.getName(), boundPortType);
+    }
+
+    public WSDLBoundPortTypeImpl getBinding(QName name){
+        return bindings.get(name);
+    }
+
+    public void addService(WSDLServiceImpl svc){
+        services.put(svc.getName(), svc);
+    }
+
+    public WSDLServiceImpl getService(QName name){
+        return services.get(name);
+    }
+
+    public Map<QName, WSDLMessageImpl> getMessages() {
+        return messages;
+    }
+
+    public @NotNull Map<QName, WSDLPortTypeImpl> getPortTypes() {
+        return portTypes;
+    }
+
+    public @NotNull Map<QName, WSDLBoundPortType> getBindings() {
+        return unmBindings;
+    }
+
+    public @NotNull Map<QName, WSDLServiceImpl> getServices(){
+        return services;
+    }
+
+    /**
+     * Returns the first service QName from insertion order
+     */
+    public QName getFirstServiceName(){
+        if(services.isEmpty())
+            return null;
+        return services.values().iterator().next().getName();
+    }
+
+    /**
+     * Returns first port QName from first service as per the insertion order
+     */
+    public QName getFirstPortName(){
+        WSDLPort fp = getFirstPort();
+        if(fp==null)
+            return null;
+        else
+            return fp.getName();
+    }
+
+    private WSDLPort getFirstPort(){
+        if(services.isEmpty())
+            return null;
+        WSDLService service = services.values().iterator().next();
+        Iterator<? extends WSDLPort> iter = service.getPorts().iterator();
+        WSDLPort port = iter.hasNext()?iter.next():null;
+        return port;
+    }
+
+    /**
+    * gets the first port in the wsdl which matches the serviceName and portType
+    */
+    public WSDLPortImpl getMatchingPort(QName serviceName, QName portType){
+        return getService(serviceName).getMatchingPort(portType);
+    }
+
+    /**
+     *
+     * @param serviceName non-null service QName
+     * @param portName    non-null port QName
+     * @return
+     *          WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null
+     */
+    public WSDLBoundPortTypeImpl getBinding(QName serviceName, QName portName){
+        WSDLServiceImpl service = services.get(serviceName);
+        if(service != null){
+            WSDLPortImpl port = service.get(portName);
+            if(port != null)
+                return port.getBinding();
+        }
+        return null;
+    }
+
+    void finalizeRpcLitBinding(WSDLBoundPortTypeImpl boundPortType){
+        assert(boundPortType != null);
+        QName portTypeName = boundPortType.getPortTypeName();
+        if(portTypeName == null)
+            return;
+        WSDLPortType pt = portTypes.get(portTypeName);
+        if(pt == null)
+            return;
+        for (WSDLBoundOperationImpl bop : boundPortType.getBindingOperations()) {
+            WSDLOperation pto = pt.get(bop.getName().getLocalPart());
+            WSDLMessage inMsgName = pto.getInput().getMessage();
+            if(inMsgName == null)
+                continue;
+            WSDLMessageImpl inMsg = messages.get(inMsgName.getName());
+            int bodyindex = 0;
+            if(inMsg != null){
+                for(WSDLPartImpl part:inMsg.parts()){
+                    String name = part.getName();
+                    ParameterBinding pb = bop.getInputBinding(name);
+                    if(pb.isBody()){
+                        part.setIndex(bodyindex++);
+                        part.setBinding(pb);
+                        bop.addPart(part, Mode.IN);
+                    }
+                }
+            }
+            bodyindex=0;
+            if(pto.isOneWay())
+                continue;
+            WSDLMessage outMsgName = pto.getOutput().getMessage();
+            if(outMsgName == null)
+                continue;
+            WSDLMessageImpl outMsg = messages.get(outMsgName.getName());
+            if(outMsg!= null){
+                for(WSDLPartImpl part:outMsg.parts()){
+                    String name = part.getName();
+                    ParameterBinding pb = bop.getOutputBinding(name);
+                    if(pb.isBody()){
+                        part.setIndex(bodyindex++);
+                        part.setBinding(pb);
+                        bop.addPart(part, Mode.OUT);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Invoked at the end of the model construction to fix up references, etc.
+     */
+    public void freeze() {
+        for (WSDLServiceImpl service : services.values()) {
+            service.freeze(this);
+        }
+        for (WSDLBoundPortTypeImpl bp : bindings.values()) {
+            bp.freeze();
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java
new file mode 100644
index 0000000..116ccb3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+import com.sun.xml.internal.ws.util.QNameMap;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Implementaiton of {@link WSDLOperation}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLOperationImpl extends AbstractExtensibleImpl implements WSDLOperation {
+    private final QName name;
+    private String parameterOrder;
+    private WSDLInputImpl input;
+    private WSDLOutputImpl output;
+    private final List<WSDLFaultImpl> faults;
+    private final QNameMap<WSDLFaultImpl> faultMap;
+    protected Iterable<WSDLMessageImpl> messages;
+    private final WSDLPortType owner;
+    private final Map<String,String> faultActionMap;
+
+    public WSDLOperationImpl(XMLStreamReader xsr,WSDLPortTypeImpl owner, QName name) {
+        super(xsr);
+        this.name = name;
+        this.faults = new ArrayList<WSDLFaultImpl>();
+        this.faultMap = new QNameMap<WSDLFaultImpl>();
+        this.faultActionMap = new HashMap<String,String>();
+        this.owner = owner;
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public String getParameterOrder() {
+        return parameterOrder;
+    }
+
+    public void setParameterOrder(String parameterOrder) {
+        this.parameterOrder = parameterOrder;
+    }
+
+    public WSDLInputImpl getInput() {
+        return input;
+    }
+
+    public void setInput(WSDLInputImpl input) {
+        this.input = input;
+    }
+
+    public WSDLOutputImpl getOutput() {
+        return output;
+    }
+
+    public boolean isOneWay() {
+        return output == null;
+    }
+
+    public void setOutput(WSDLOutputImpl output) {
+        this.output = output;
+    }
+
+    public Iterable<WSDLFaultImpl> getFaults() {
+        return faults;
+    }
+
+    public WSDLFault getFault(QName faultDetailName) {
+        WSDLFaultImpl fault = faultMap.get(faultDetailName);
+        if(fault != null)
+            return fault;
+
+        for(WSDLFaultImpl fi:faults){
+            assert fi.getMessage().parts().iterator().hasNext();
+            WSDLPartImpl part = fi.getMessage().parts().iterator().next();
+            if(part.getDescriptor().name().equals(faultDetailName)){
+                faultMap.put(faultDetailName, fi);
+                return fi;
+            }
+        }
+        return null;
+    }
+
+    public Map<String,String> getFaultActionMap() {
+        return faultActionMap;
+    }
+
+    WSDLPortType getOwner() {
+        return owner;
+    }
+
+    @NotNull
+    public QName getPortTypeName() {
+        return owner.getName();
+    }
+
+    public void addFault(WSDLFaultImpl fault) {
+        faults.add(fault);
+    }
+
+    public void freez(WSDLModelImpl root) {
+        assert input != null;
+        input.freeze(root);
+        if(output != null)
+            output.freeze(root);
+        for(WSDLFaultImpl fault : faults){
+            fault.freeze(root);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java
new file mode 100644
index 0000000..c2cff55
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class WSDLOutputImpl extends AbstractExtensibleImpl implements WSDLOutput {
+    private String name;
+    private QName messageName;
+    private WSDLOperationImpl operation;
+    private WSDLMessageImpl message;
+    private String action;
+
+    public WSDLOutputImpl(XMLStreamReader xsr,String name, QName messageName, WSDLOperationImpl operation) {
+        super(xsr);
+        this.name = name;
+        this.messageName = messageName;
+        this.operation = operation;
+    }
+
+    public String getName() {
+        return (name == null)?operation.getName().getLocalPart()+"Response":name;
+    }
+
+    public WSDLMessage getMessage() {
+        return message;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    void freeze(WSDLModelImpl root) {
+        message = root.getMessage(messageName);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartDescriptorImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartDescriptorImpl.java
new file mode 100644
index 0000000..aad2f76
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartDescriptorImpl.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPartDescriptor;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Vivek Pandey
+ */
+public final class WSDLPartDescriptorImpl extends AbstractObjectImpl implements WSDLPartDescriptor {
+    private QName name;
+    private WSDLDescriptorKind type;
+
+    public WSDLPartDescriptorImpl(XMLStreamReader xsr,QName name, WSDLDescriptorKind kind) {
+        super(xsr);
+        this.name = name;
+        this.type = kind;
+    }
+
+    public QName name() {
+        return name;
+    }
+
+    public WSDLDescriptorKind type() {
+        return type;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java
new file mode 100644
index 0000000..061d416
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPartDescriptor;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Implementation of {@link WSDLPart}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLPartImpl extends AbstractObjectImpl implements WSDLPart {
+    private final String name;
+    private ParameterBinding binding;
+    private int index;
+    private final WSDLPartDescriptor descriptor;
+
+    public WSDLPartImpl(XMLStreamReader xsr, String partName, int index, WSDLPartDescriptor descriptor) {
+        super(xsr);
+        this.name = partName;
+        this.binding = ParameterBinding.UNBOUND;
+        this.index = index;
+        this.descriptor = descriptor;
+
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public ParameterBinding getBinding() {
+        return binding;
+    }
+
+    public void setBinding(ParameterBinding binding) {
+        this.binding = binding;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    //need to set the index in case of rpclit to reorder the body parts
+    public void setIndex(int index){
+        this.index = index;
+    }
+
+    boolean isBody(){
+        return binding.isBody();
+    }
+
+    public WSDLPartDescriptor getDescriptor() {
+        return descriptor;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java
new file mode 100644
index 0000000..ca4fba3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Implementation of {@link WSDLPort}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements WSDLPort {
+    private final QName name;
+    private EndpointAddress address;
+    private final QName bindingName;
+    private final WSDLServiceImpl owner;
+    private WSEndpointReference epr;
+
+    /**
+     * To be set after the WSDL parsing is complete.
+     */
+    private WSDLBoundPortTypeImpl boundPortType;
+
+    public WSDLPortImpl(XMLStreamReader xsr,WSDLServiceImpl owner, QName name, QName binding) {
+        super(xsr);
+        this.owner = owner;
+        this.name = name;
+        this.bindingName = binding;
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public QName getBindingName() {
+        return bindingName;
+    }
+
+    public EndpointAddress getAddress() {
+        return address;
+    }
+
+    public WSDLServiceImpl getOwner() {
+        return owner;
+    }
+
+    /**
+     * Only meant for {@link RuntimeWSDLParser} to call.
+     */
+    public void setAddress(EndpointAddress address) {
+        assert address!=null;
+        this.address = address;
+    }
+
+    /**
+     * Only meant for {@link RuntimeWSDLParser} to call.
+     */
+    public void setEPR(@NotNull WSEndpointReference epr) {
+        assert epr!=null;
+        this.epr = epr;
+    }
+
+    public @Nullable WSEndpointReference getEPR() {
+        return epr;
+    }
+    public WSDLBoundPortTypeImpl getBinding() {
+        return boundPortType;
+    }
+
+    public SOAPVersion getSOAPVersion(){
+        return boundPortType.getSOAPVersion();
+    }
+
+    void freeze(WSDLModelImpl root) {
+        boundPortType = root.getBinding(bindingName);
+        if(boundPortType==null) {
+            throw new LocatableWebServiceException(
+                ClientMessages.UNDEFINED_BINDING(bindingName), getLocation());
+        }
+        if(features == null)
+            features =  new WebServiceFeatureList();
+        features.setParentFeaturedObject(boundPortType);
+        notUnderstoodExtensions.addAll(boundPortType.notUnderstoodExtensions);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java
new file mode 100644
index 0000000..45f7e7a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.util.Hashtable;
+import java.util.Map;
+
+/**
+ * Provides implementation of {@link WSDLPortType}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLPortTypeImpl  extends AbstractExtensibleImpl implements WSDLPortType {
+    private QName name;
+    private final Map<String, WSDLOperationImpl> portTypeOperations;
+    private WSDLModelImpl owner;
+
+    public WSDLPortTypeImpl(XMLStreamReader xsr,WSDLModelImpl owner, QName name) {
+        super(xsr);
+        this.name = name;
+        this.owner = owner;
+        portTypeOperations = new Hashtable<String, WSDLOperationImpl>();
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public WSDLOperationImpl get(String operationName) {
+        return portTypeOperations.get(operationName);
+    }
+
+    public Iterable<WSDLOperationImpl> getOperations() {
+        return portTypeOperations.values();
+    }
+
+    /**
+     * Populates the Map that holds operation name as key and {@link WSDLOperation} as the value.
+     * @param opName Must be non-null
+     * @param ptOp  Must be non-null
+     * @throws NullPointerException if either opName or ptOp is null
+     */
+    public void put(String opName, WSDLOperationImpl ptOp){
+        portTypeOperations.put(opName, ptOp);
+    }
+
+    WSDLModelImpl getOwner(){
+        return owner;
+    }
+
+    void freeze() {
+        for(WSDLOperationImpl op : portTypeOperations.values()){
+            op.freez(owner);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java
new file mode 100644
index 0000000..518df29
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * Properties exposed from {@link WSDLPort} for {@link MessageContext}.
+ * Donot add this satellite if {@link WSDLPort} is null.
+ *
+ * @author Jitendra Kotamraju
+ */
+public final class WSDLProperties extends PropertySet {
+
+    private static final PropertyMap model;
+    static {
+        model = parse(WSDLProperties.class);
+    }
+
+    private final @NotNull WSDLPort port;
+
+    public WSDLProperties(@NotNull WSDLPort port) {
+        this.port = port;
+    }
+
+    @Property(MessageContext.WSDL_SERVICE)
+    public QName getWSDLService() {
+        return port.getOwner().getName();
+    }
+
+    @Property(MessageContext.WSDL_PORT)
+    public QName getWSDLPort() {
+        return port.getName();
+    }
+
+    @Property(MessageContext.WSDL_INTERFACE)
+    public QName getWSDLPortType() {
+        return port.getBinding().getPortTypeName();
+    }
+
+    @Override
+    protected PropertyMap getPropertyMap() {
+        return model;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java
new file mode 100644
index 0000000..910652d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.model.wsdl;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Implementation of {@link WSDLService}
+ *
+ * @author Vivek Pandey
+ */
+public final class WSDLServiceImpl extends AbstractExtensibleImpl implements WSDLService {
+    private final QName name;
+    private final Map<QName, WSDLPortImpl> ports;
+    private final WSDLModelImpl parent;
+
+    public WSDLServiceImpl(XMLStreamReader xsr,WSDLModelImpl parent, QName name) {
+        super(xsr);
+        this.parent = parent;
+        this.name = name;
+        ports = new LinkedHashMap<QName,WSDLPortImpl>();
+    }
+
+    public @NotNull
+    WSDLModelImpl getParent() {
+        return parent;
+    }
+
+    public QName getName() {
+        return name;
+    }
+
+    public WSDLPortImpl get(QName portName) {
+        return ports.get(portName);
+    }
+
+    public WSDLPort getFirstPort() {
+        if(ports.isEmpty())
+            return null;
+        else
+            return ports.values().iterator().next();
+    }
+
+    public Iterable<WSDLPortImpl> getPorts(){
+        return ports.values();
+    }
+
+    /**
+    * gets the first port in this service which matches the portType
+    */
+    public @Nullable
+    WSDLPortImpl getMatchingPort(QName portTypeName){
+        for(WSDLPortImpl port : getPorts()){
+            QName ptName = port.getBinding().getPortTypeName();
+            assert (ptName != null);
+            if(ptName.equals(portTypeName))
+                return port;
+        }
+        return null;
+    }
+
+    /**
+     * Populates the Map that holds port name as key and {@link WSDLPort} as the value.
+     *
+     * @param portName Must be non-null
+     * @param port     Must be non-null
+     * @throws NullPointerException if either opName or ptOp is null
+     */
+    public void put(QName portName, WSDLPortImpl port) {
+        if (portName == null || port == null)
+            throw new NullPointerException();
+        ports.put(portName, port);
+    }
+
+    void freeze(WSDLModelImpl root) {
+        for (WSDLPortImpl port : ports.values()) {
+            port.freeze(root);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModeler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModeler.java
deleted file mode 100644
index 63a2e4f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModeler.java
+++ /dev/null
@@ -1,1370 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.modeler;
-
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.bind.api.TypeReference;
-import com.sun.xml.internal.bind.v2.model.nav.Navigator;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.Mode;
-import com.sun.xml.internal.ws.model.CheckedException;
-import com.sun.xml.internal.ws.model.ExceptionType;
-import com.sun.xml.internal.ws.model.Parameter;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.model.WrapperParameter;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.model.soap.Style;
-import com.sun.xml.internal.ws.wsdl.parser.BindingOperation;
-import com.sun.xml.internal.ws.wsdl.parser.Part;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Holder;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.Response;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.rmi.RemoteException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.concurrent.Future;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.http.HTTPBinding;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Creates a runtime model of a SEI (portClass).
- *
- * @author WS Developement Team
- */
-public class RuntimeModeler {
-    private String bindingId;
-    private Class portClass;
-    private RuntimeModel runtimeModel;
-    private com.sun.xml.internal.ws.model.soap.SOAPBinding defaultBinding;
-    private String packageName;
-    private String targetNamespace;
-    private boolean isWrapped = true;
-    private boolean usesWebMethod = false;
-    private ClassLoader classLoader = null;
-    private Object implementor;
-    private com.sun.xml.internal.ws.wsdl.parser.Binding binding;
-    private QName serviceName;
-    private QName portName;
-    private Map<Class, Boolean> classUsesWebMethod = new HashMap<Class, Boolean>();
-
-    /**
-     *
-     */
-    public static final String PD_JAXWS_PACKAGE_PD  = ".jaxws.";
-    /**
-     *
-     */
-    public static final String JAXWS_PACKAGE_PD     = "jaxws.";
-    public static final String RESPONSE             = "Response";
-    public static final String RETURN               = "return";
-    public static final String BEAN                 = "Bean";
-    public static final String SERVICE              = "Service";
-    public static final String PORT                 = "Port";
-    public static final Class HOLDER_CLASS = Holder.class;
-    public static final Class REMOTE_EXCEPTION_CLASS = RemoteException.class;
-    public static final Class RPC_LIT_PAYLOAD_CLASS = com.sun.xml.internal.ws.encoding.jaxb.RpcLitPayload.class;
-
-    /**
-     * creates an instance of RunTimeModeler given a <code>portClass</code> and <code>bindingId</code>
-     * @param portClass The SEI class to be modeled.
-     * @param serviceName The ServiceName to use instead of one calculated from the implementation class
-     * @param bindingId The binding identifier to be used when modeling the <code>portClass</code>.
-     */
-    public RuntimeModeler(Class portClass, QName serviceName, String bindingId) {
-        this.portClass = portClass;
-        this.serviceName = serviceName;
-        this.bindingId = bindingId;
-    }
-
-    /**
-     *
-     * creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
-     * @param sei The SEI class to be modeled.
-     * @param serviceName The ServiceName to use instead of one calculated from the implementation class
-     * @param binding The Binding representing WSDL Binding for the given port to be used when modeling the
-     * <code>sei</code>.
-     */
-    public RuntimeModeler(Class sei, QName serviceName, com.sun.xml.internal.ws.wsdl.parser.Binding binding){
-        this.portClass = sei;
-        this.serviceName = serviceName;
-        this.bindingId = binding.getBindingId();
-        this.binding = binding;
-    }
-
-    /**
-     * creates an instance of RunTimeModeler given a <code>portClass</code> and <code>bindingId</code>
-     * implementor object's class may not be portClass, as it could be proxy to
-     * portClass webmethods.
-     *
-     * @param portClass The SEI class to be modeled.
-     * @param implementor The object on which service methods are invoked
-     * @param serviceName The ServiceName to use instead of one calculated from the implementation class
-     * @param bindingId The binding identifier to be used when modeling the <code>portClass</code>.
-     */
-    public RuntimeModeler(Class portClass, Object implementor, QName serviceName, String bindingId) {
-        this(portClass, serviceName, bindingId);
-        this.implementor = implementor;
-    }
-
-    /**
-     * creates an instance of RunTimeModeler given a <code>sei</code> class and <code>binding</code>
-     * implementor object's class may not be sei Class, as it could be proxy to
-     * sei webmethods.
-     *
-     * @param portClass The SEI class to be modeled.
-     * @param implementor The object on which service methods are invoked
-     * @param binding The Binding representing WSDL Binding for the given port to be used when modeling the
-     * <code>sei</code>.
-     */
-    public RuntimeModeler(Class portClass, Object implementor, QName serviceName, com.sun.xml.internal.ws.wsdl.parser.Binding binding) {
-        this(portClass, serviceName, binding);
-        this.implementor = implementor;
-    }
-
-
-    /**
-     * sets the classloader to be used when loading classes by the <code>RuntimeModeler</code>.
-     * @param classLoader ClassLoader used to load classes
-     */
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
-    /**
-     * sets the PortName to be used by the <code>RuntimeModeler</code>.
-     * @param portName The PortName to be used instead of the PortName
-     * retrieved via annotations
-     */
-    public void setPortName(QName portName) {
-        this.portName = portName;
-    }
-
-    private static <T> T getPrivClassAnnotation(final Class clazz, final Class T) {
-        return (T)AccessController.doPrivileged(new PrivilegedAction() {
-           public Object run() {
-               return clazz.getAnnotation(T);
-           }
-        });
-    }
-
-    private static <T> T getPrivMethodAnnotation(final Method method, final Class T) {
-        return (T)AccessController.doPrivileged(new PrivilegedAction() {
-           public Object run() {
-               return method.getAnnotation(T);
-           }
-        });
-    }
-
-    private static Annotation[][] getPrivParameterAnnotations(final Method method) {
-        return (Annotation[][])AccessController.doPrivileged(new PrivilegedAction() {
-           public Object run() {
-               return method.getParameterAnnotations();
-           }
-        });
-    }
-
-    //currently has many local vars which will be eliminated after debugging issues
-    //first draft
-    /**
-     * builds the runtime model from the <code>portClass</code> using the binding ID <code>bindingId</code>.
-     * @return the runtime model for the <code>portClass</code>.
-     */
-    public RuntimeModel buildRuntimeModel() {
-        runtimeModel = new SOAPRuntimeModel();
-        Class clazz = portClass;
-        WebService webService = getPrivClassAnnotation(portClass, WebService.class);
-        if (webService == null) {
-            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
-                                       new Object[] {portClass.getCanonicalName()});
-        }
-        if (webService.endpointInterface().length() > 0) {
-            clazz = getClass(webService.endpointInterface());
-            WebService seiService = getPrivClassAnnotation(clazz, WebService.class);
-            if (seiService == null) {
-                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
-                                    new Object[] {webService.endpointInterface()});
-            }
-        }
-        if (serviceName == null)
-            serviceName = getServiceName(portClass);
-        runtimeModel.setServiceQName(serviceName);
-
-        String portLocalName  = portClass.getSimpleName()+PORT;
-        if (webService.portName().length() >0) {
-            portLocalName = webService.portName();
-        } else if (webService.name().length() >0) {
-            portLocalName = webService.name()+PORT;
-        }
-
-        if (portName == null)
-            portName = new QName(serviceName.getNamespaceURI(), portLocalName);
-
-        if (!portName.getNamespaceURI().equals(serviceName.getNamespaceURI())) {
-            throw new RuntimeModelerException("runtime.modeler.portname.servicename.namespace.mismatch",
-                    new Object[] {serviceName, portName});
-        }
-        runtimeModel.setPortName(portName);
-
-        processClass(clazz);
-        if (runtimeModel.getJavaMethods().size() == 0)
-            throw new RuntimeModelerException("runtime.modeler.no.operations",
-                    new Object[] {portClass.getName().toString()});
-        runtimeModel.postProcess();
-        return runtimeModel;
-    }
-
-    /**
-     * utility method to load classes
-     * @param className the name of the class to load
-     * @return the class specified by <code>className</code>
-     */
-    protected Class getClass(String className) {
-        try {
-            if (classLoader == null)
-                return Thread.currentThread().getContextClassLoader().loadClass(className);
-            else
-                return classLoader.loadClass(className);
-        } catch (ClassNotFoundException e) {
-            throw new RuntimeModelerException("runtime.modeler.class.not.found",
-                             new Object[] {className});
-        }
-    }
-
-    protected void setUsesWebMethod(Class clazz, Boolean usesWebMethod) {
-//        System.out.println("class: "+clazz.getName()+" uses WebMethod: "+usesWebMethod);
-        classUsesWebMethod.put(clazz, usesWebMethod);
-    }
-
-    protected void determineWebMethodUse(Class clazz) {
-        if (clazz == null)
-            return;
-        if (clazz.isInterface()) {
-            setUsesWebMethod(clazz, false);
-        }
-        else {
-            WebMethod webMethod;
-            boolean hasWebMethod = false;
-            for (Method method : clazz.getMethods()) {
-                if (!method.getDeclaringClass().equals(clazz))
-                    continue;
-                webMethod = getPrivMethodAnnotation(method, WebMethod.class);
-                if (webMethod != null &&
-                    !webMethod.exclude()) {
-                    hasWebMethod = true;
-                    break;
-                }
-            }
-            setUsesWebMethod(clazz, hasWebMethod);
-        }
-        determineWebMethodUse(clazz.getSuperclass());
-    }
-
-    void processClass(Class clazz) {
-        determineWebMethodUse(clazz);
-        WebService webService = getPrivClassAnnotation(clazz, WebService.class);
-        String portTypeLocalName  = clazz.getSimpleName();
-        if (webService.name().length() >0)
-            portTypeLocalName = webService.name();
-
-
-        targetNamespace = webService.targetNamespace();
-        packageName = null;
-        if (clazz.getPackage() != null)
-            packageName = clazz.getPackage().getName();
-        if (targetNamespace.length() == 0) {
-            targetNamespace = getNamespace(packageName);
-        }
-        runtimeModel.setTargetNamespace(targetNamespace);
-        QName portTypeName = new QName(targetNamespace, portTypeLocalName);
-        runtimeModel.setPortTypeName(portTypeName);
-        runtimeModel.setWSDLLocation(webService.wsdlLocation());
-
-        javax.jws.soap.SOAPBinding soapBinding = getPrivClassAnnotation(clazz, javax.jws.soap.SOAPBinding.class);
-        if (soapBinding != null) {
-            isWrapped = soapBinding.parameterStyle().equals(
-                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
-        }
-        defaultBinding = createBinding(soapBinding);
-        /*
-         * if clazz != portClass then there is an SEI.  If there is an
-         * SEI, then all methods should be processed.  However, if there is
-         * no SEI, and the implementation class uses at least one
-         * WebMethod annotation, then only methods with this annotation
-         * will be processed.
-         */
-/*        if (clazz == portClass) {
-            WebMethod webMethod;
-            for (Method method : clazz.getMethods()) {
-                webMethod = getPrivMethodAnnotation(method, WebMethod.class);
-                if (webMethod != null &&
-                    !webMethod.exclude()) {
-                    usesWebMethod = true;
-                    break;
-                }
-            }
-        }*/
-
-        for (Method method : clazz.getMethods()) {
-            if (method.getDeclaringClass().equals(Object.class) ||
-                !isWebMethod(method, clazz)) {
-                continue;
-            }
-            processMethod(method, webService);
-        }
-    }
-
-    protected boolean isWebMethod(Method method, Class clazz) {
-        if (clazz.isInterface()) {
-            return true;
-        }
-        Class declClass = method.getDeclaringClass();
-        boolean declHasWebService = getPrivClassAnnotation(declClass, WebService.class) != null;
-        WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
-        if (webMethod != null &&
-            webMethod.exclude() == false &&
-            declHasWebService) {
-            return true;
-        }
-        if (declHasWebService &&
-            !classUsesWebMethod.get(declClass)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * creates a runtime model <code>SOAPBinding</code> from a <code>javax.jws.soap.SOAPBinding</code> object
-     * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
-     * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
-     */
-    protected com.sun.xml.internal.ws.model.soap.SOAPBinding createBinding(javax.jws.soap.SOAPBinding soapBinding) {
-        com.sun.xml.internal.ws.model.soap.SOAPBinding rtSOAPBinding =
-            new com.sun.xml.internal.ws.model.soap.SOAPBinding();
-        Style style = (soapBinding == null ||
-            soapBinding.style().equals(javax.jws.soap.SOAPBinding.Style.DOCUMENT)) ?
-            Style.DOCUMENT : Style.RPC;
-        rtSOAPBinding.setStyle(style);
-        //default soap version is 1.1, change it to soap 1.2 if the binding id says so
-        if(SOAPVersion.SOAP_12.equals(bindingId))
-            rtSOAPBinding.setSOAPVersion(SOAPVersion.SOAP_12);
-        return rtSOAPBinding;
-    }
-
-    /**
-     * gets the namespace <code>String</code> for a given <code>packageName</code>
-     * @param packageName the name of the package used to find a namespace
-     * @return the namespace for the specified <code>packageName</code>
-     */
-    public static String getNamespace(String packageName) {
-        if (packageName == null || packageName.length() == 0)
-            return null;
-
-        StringTokenizer tokenizer = new StringTokenizer(packageName, ".");
-        String[] tokens;
-        if (tokenizer.countTokens() == 0) {
-            tokens = new String[0];
-        } else {
-            tokens = new String[tokenizer.countTokens()];
-            for (int i=tokenizer.countTokens()-1; i >= 0; i--) {
-                tokens[i] = tokenizer.nextToken();
-            }
-        }
-        StringBuffer namespace = new StringBuffer("http://");
-        String dot = "";
-        for (int i=0; i<tokens.length; i++) {
-            if (i==1)
-                dot = ".";
-            namespace.append(dot+tokens[i]);
-        }
-        namespace.append('/');
-        return namespace.toString();
-    }
-
-    /**
-     * creates the runtime model for a method on the <code>portClass</code>
-     * @param method the method to model
-     * @param webService the instance of the <code>WebService</code> annotation on the <code>portClass</code>
-     */
-    protected void processMethod(Method method, WebService webService) {
-        if (!Modifier.isPublic(method.getModifiers())) {
-            return;
-        }
-
-        WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
-        if (webMethod != null && webMethod.exclude())
-            return;
-
-        // If one WebMethod is used, then only methods with WebMethod will be
-        // processed.
-        if (usesWebMethod && webMethod == null) {
-            return;
-        }
-
-        // Use implementor to find the exact invocation method as implementor
-        // could be a proxy to portClass object
-        JavaMethod javaMethod;
-        Class implementorClass = (implementor != null)
-            ? implementor.getClass() : portClass;
-        if (method.getDeclaringClass().equals(implementorClass)) {
-            javaMethod = new JavaMethod(method);
-        } else {
-            try {
-                Method tmpMethod = implementorClass.getMethod(method.getName(),
-                    method.getParameterTypes());
-                javaMethod = new JavaMethod(tmpMethod);
-            } catch (NoSuchMethodException e) {
-                throw new RuntimeModelerException("runtime.modeler.method.not.found",
-                    new Object[] {method.getName(), portClass.getName()});
-            }
-        }
-        String methodName = method.getName();
-        int modifier = method.getModifiers();
-        //use for checking
-
-        //set MEP -oneway, async, req/resp
-        int mep = getMEP(method);
-        javaMethod.setMEP(mep);
-
-        String action = null;
-        String operationName = method.getName();
-        if (webMethod != null ) {
-            action = webMethod.action();
-            operationName = webMethod.operationName().length() > 0 ?
-                webMethod.operationName() :
-                operationName;
-        }
-        javaMethod.setOperationName(operationName);
-        SOAPBinding methodBinding =
-            method.getAnnotation(SOAPBinding.class);
-        if (methodBinding == null && !method.getDeclaringClass().equals(portClass)) {
-            if (!method.getDeclaringClass().isInterface()) {
-                methodBinding = method.getDeclaringClass().getAnnotation(SOAPBinding.class);
-            }
-        }
-        boolean methodIsWrapped = isWrapped;
-        Style style = defaultBinding.getStyle();
-        if (methodBinding != null) {
-            com.sun.xml.internal.ws.model.soap.SOAPBinding mySOAPBinding = createBinding(methodBinding);
-            style = mySOAPBinding.getStyle();
-            if (action != null)
-                mySOAPBinding.setSOAPAction(action);
-            methodIsWrapped = methodBinding.parameterStyle().equals(
-                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
-            javaMethod.setBinding(mySOAPBinding);
-        } else {
-            com.sun.xml.internal.ws.model.soap.SOAPBinding sb = new com.sun.xml.internal.ws.model.soap.SOAPBinding(defaultBinding);
-            if (action != null)
-                sb.setSOAPAction(action);
-            else
-                sb.setSOAPAction("");
-            javaMethod.setBinding(sb);
-        }
-        if (!methodIsWrapped) {
-            processDocBareMethod(javaMethod, methodName, webMethod, operationName,
-                method, webService);
-        } else if (style.equals(Style.DOCUMENT)) {
-            processDocWrappedMethod(javaMethod, methodName, webMethod, operationName,
-                method, webService);
-        } else {
-            processRpcMethod(javaMethod, methodName, webMethod, operationName,
-                method, webService);
-        }
-        runtimeModel.addJavaMethod(javaMethod);
-    }
-
-    private int getMEP(Method m){
-        if (m.isAnnotationPresent(Oneway.class)) {
-            return MessageStruct.ONE_WAY_MEP;
-        }
-        if(Response.class.isAssignableFrom(m.getReturnType())){
-            return MessageStruct.ASYNC_POLL_MEP;
-        }else if(Future.class.isAssignableFrom(m.getReturnType())){
-            return MessageStruct.ASYNC_CALLBACK_MEP;
-        }
-        return MessageStruct.REQUEST_RESPONSE_MEP;
-    }
-
-    /**
-     * models a document/literal wrapped method
-     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
-     * @param methodName the runtime model <code>JavaMethod</code> instance being created
-     * @param webMethod the runtime model <code>JavaMethod</code> instance being created
-     * @param operationName the runtime model <code>JavaMethod</code> instance being created
-     * @param method the <code>method</code> to model
-     * @param webService The <code>WebService</code> annotation instance on the <code>portClass</code>
-     */
-    protected void processDocWrappedMethod(JavaMethod javaMethod, String methodName,
-                                           WebMethod webMethod, String operationName, Method method, WebService webService) {
-        boolean isOneway = method.isAnnotationPresent(Oneway.class);
-        RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
-        ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
-        String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
-        if (packageName == null || (packageName != null && packageName.length() == 0))
-            beanPackage = JAXWS_PACKAGE_PD;
-        String requestClassName = null;
-        if(reqWrapper != null && reqWrapper.className().length()>0){
-            requestClassName = reqWrapper.className();
-        }else{
-            requestClassName = beanPackage + capitalize(method.getName());
-        }
-
-
-        String responseClassName = null;
-        if(resWrapper != null && resWrapper.className().length()>0){
-            responseClassName = resWrapper.className();
-        }else{
-            responseClassName = beanPackage + capitalize(method.getName()) + RESPONSE;
-        }
-
-        Class requestClass = getClass(requestClassName);
-
-        String reqName = operationName;
-        String reqNamespace = targetNamespace;
-        if (reqWrapper != null) {
-            if (reqWrapper.targetNamespace().length() > 0)
-                reqNamespace = reqWrapper.targetNamespace();
-            if (reqWrapper.localName().length() > 0)
-                reqName = reqWrapper.localName();
-        }
-        QName reqElementName = new QName(reqNamespace, reqName);
-
-        Class responseClass = null;
-        QName resElementName = null;
-        String resName = operationName+"Response";
-        String resNamespace = targetNamespace;
-        if (!isOneway) {
-            responseClass = getClass(responseClassName);
-            if (resWrapper != null) {
-                if (resWrapper.targetNamespace().length() > 0)
-                    resNamespace = resWrapper.targetNamespace();
-                if (resWrapper.localName().length() > 0)
-                    resName = resWrapper.localName();
-            }
-        }
-        resElementName = new QName(resNamespace, resName);
-
-        TypeReference typeRef =
-                new TypeReference(reqElementName, requestClass, new Annotation[0]);
-        WrapperParameter requestWrapper = new WrapperParameter(typeRef,
-            com.sun.xml.internal.ws.model.Mode.IN, 0);
-        requestWrapper.setBinding(ParameterBinding.BODY);
-        javaMethod.addParameter(requestWrapper);
-        WrapperParameter responseWrapper = null;
-        if (!isOneway) {
-            typeRef = new TypeReference(resElementName, responseClass,
-                                        new Annotation[0]);
-            responseWrapper = new WrapperParameter(typeRef,
-                com.sun.xml.internal.ws.model.Mode.OUT, -1);
-            javaMethod.addParameter(responseWrapper);
-            responseWrapper.setBinding(ParameterBinding.BODY);
-        }
-
-        // return value
-        String resultName = null;
-        String resultTNS = "";
-        QName resultQName = null;
-        WebResult webResult = method.getAnnotation(WebResult.class);
-        Class returnType = method.getReturnType();
-        boolean isResultHeader = false;
-        if (webResult != null) {
-            if (webResult.name().length() > 0)
-                resultName = webResult.name();
-            else
-                resultName = RETURN;
-            resultTNS = webResult.targetNamespace();
-            isResultHeader = webResult.header();
-            if (resultTNS.length() == 0 && webResult.header()) {
-                // headers must have a namespace
-                resultTNS = targetNamespace;
-            }
-            resultQName = new QName(resultTNS, resultName);
-        } else if (!isOneway && !returnType.getName().equals("void") && !javaMethod.isAsync()) {
-            if(resultQName == null){
-                resultQName = new QName(resultTNS, RETURN);
-            }
-        }
-
-        if(javaMethod.isAsync()){
-            returnType = getAsyncReturnType(method, returnType);
-            resultQName = new QName(RETURN);
-        }
-
-        if (!isOneway && (returnType != null) && (!returnType.getName().equals("void"))) {
-            Class returnClazz = returnType;
-            Annotation[] rann = method.getAnnotations();
-            if (resultQName.getLocalPart() != null) {
-                TypeReference rTypeReference = new TypeReference(resultQName, returnType, rann);
-                Parameter returnParameter = new Parameter(rTypeReference, com.sun.xml.internal.ws.model.Mode.OUT, -1);
-                if (isResultHeader) {
-                    returnParameter.setBinding(ParameterBinding.HEADER);
-                    javaMethod.addParameter(returnParameter);
-                } else {
-                    returnParameter.setBinding(ParameterBinding.BODY);
-                    responseWrapper.addWrapperChild(returnParameter);
-                }
-            }
-        }
-
-        //get WebParam
-        Class<?>[] parameterTypes = method.getParameterTypes();
-        Type[] genericParameterTypes = method.getGenericParameterTypes();
-        Annotation[][] pannotations = getPrivParameterAnnotations(method);
-        int pos = 0;
-        QName paramQName = null;
-        for (Class clazzType : parameterTypes) {
-            String partName=null;
-            Parameter param = null;
-            String paramName = "arg"+pos;
-            String paramNamespace = "";
-            boolean isHeader = false;
-
-            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
-                continue;
-            }
-
-            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
-            //set the actual type argument of Holder in the TypeReference
-            if (isHolder) {
-                if(clazzType.getName().equals(Holder.class.getName())){
-                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
-                }
-            }
-            com.sun.xml.internal.ws.model.Mode paramMode = isHolder ?
-                com.sun.xml.internal.ws.model.Mode.INOUT :
-                com.sun.xml.internal.ws.model.Mode.IN;
-            for (Annotation annotation : pannotations[pos]) {
-                if (annotation.annotationType() == javax.jws.WebParam.class) {
-                    javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
-                    if (webParam.name().length() > 0)
-                        paramName = webParam.name();
-                    isHeader = webParam.header();
-                    if(webParam.partName().length() > 0)
-                        partName = webParam.partName();
-                    else
-                        partName = paramName;
-                    if (isHeader) // headers cannot be in empty namespace
-                        paramNamespace = targetNamespace;
-                    if (!webParam.targetNamespace().equals("")) {
-                        paramNamespace = webParam.targetNamespace();
-                    }
-                    WebParam.Mode mode = webParam.mode();
-                    if (isHolder && mode == javax.jws.WebParam.Mode.IN)
-                        mode = javax.jws.WebParam.Mode.INOUT;
-                    paramMode = (mode == javax.jws.WebParam.Mode.IN) ? com.sun.xml.internal.ws.model.Mode.IN :
-                        (mode == javax.jws.WebParam.Mode.INOUT) ? com.sun.xml.internal.ws.model.Mode.INOUT :
-                        com.sun.xml.internal.ws.model.Mode.OUT;
-                    break;
-                }
-            }
-            paramQName = new QName(paramNamespace, paramName);
-            typeRef =
-                new TypeReference(paramQName, clazzType, pannotations[pos]);
-            param = new Parameter(typeRef, paramMode, pos++);
-            if (isHeader) {
-                param.setBinding(ParameterBinding.HEADER);
-                javaMethod.addParameter(param);
-                param.setPartName(partName);
-            } else {
-                param.setBinding(ParameterBinding.BODY);
-                if (!paramMode.equals(com.sun.xml.internal.ws.model.Mode.OUT)) {
-                    requestWrapper.addWrapperChild(param);
-                }
-                if (!paramMode.equals(com.sun.xml.internal.ws.model.Mode.IN)) {
-                    if (isOneway) {
-                        throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters",
-                                new Object[] {portClass.getCanonicalName(), methodName});
-                    }
-                    responseWrapper.addWrapperChild(param);
-                }
-            }
-        }
-        processExceptions(javaMethod, method);
-    }
-
-
-    /**
-     * models a rpc/literal method
-     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
-     * @param methodName the name of the <code>method</code> being modeled.
-     * @param webMethod the <code>WebMethod</code> annotations instance on the <code>method</code>
-     * @param operationName the WSDL operation name for this <code>method</code>
-     * @param method the runtime model <code>JavaMethod</code> instance being created
-     * @param webService the runtime model <code>JavaMethod</code> instance being created
-     */
-    protected void processRpcMethod(JavaMethod javaMethod, String methodName,
-                                    WebMethod webMethod, String operationName, Method method, WebService webService) {
-        boolean isOneway = method.isAnnotationPresent(Oneway.class);
-        //build ordered list
-        Map<Integer, Parameter> resRpcParams = new HashMap<Integer, Parameter>();
-        Map<Integer, Parameter> reqRpcParams = new HashMap<Integer, Parameter>();
-
-        //Lets take the service namespace and overwrite it with the one we get it from wsdl
-        String reqNamespace = targetNamespace;
-        String respNamespace = targetNamespace;
-        if(binding != null){
-            binding.finalizeBinding();
-            BindingOperation op = binding.get(operationName);
-            if(op != null){
-                //it cant be null, but lets not fail and try to work with service namespce
-                if(op.getRequestNamespace() != null){
-                    reqNamespace = op.getRequestNamespace();
-                }
-
-                //it cant be null, but lets not fail and try to work with service namespce
-                if(op.getResponseNamespace() != null){
-                    respNamespace = op.getResponseNamespace();
-                }
-            }
-        }
-
-        QName reqElementName = new QName(reqNamespace, operationName);
-        QName resElementName = null;
-        if (!isOneway) {
-            resElementName = new QName(respNamespace, operationName+RESPONSE);
-        }
-
-        TypeReference typeRef =
-                new TypeReference(reqElementName, RPC_LIT_PAYLOAD_CLASS, new Annotation[0]);
-        WrapperParameter requestWrapper = new WrapperParameter(typeRef,
-            com.sun.xml.internal.ws.model.Mode.IN, 0);
-        requestWrapper.setInBinding(ParameterBinding.BODY);
-        javaMethod.addParameter(requestWrapper);
-        WrapperParameter responseWrapper = null;
-        if (!isOneway) {
-            typeRef = new TypeReference(resElementName, RPC_LIT_PAYLOAD_CLASS,
-                                        new Annotation[0]);
-            responseWrapper = new WrapperParameter(typeRef,
-                com.sun.xml.internal.ws.model.Mode.OUT, -1);
-            responseWrapper.setOutBinding(ParameterBinding.BODY);
-            javaMethod.addParameter(responseWrapper);
-        }
-
-        Class returnType = method.getReturnType();
-        String resultName = RETURN;
-        String resultTNS = targetNamespace;
-        String resultPartName = resultName;
-        QName resultQName = null;
-        boolean isResultHeader = false;
-        WebResult webResult = method.getAnnotation(WebResult.class);
-
-        if (webResult != null) {
-            isResultHeader = webResult.header();
-            if (webResult.name().length() > 0)
-                resultName = webResult.name();
-            else
-                resultName = RETURN;
-            if (webResult.partName().length() > 0) {
-                resultPartName = webResult.partName();
-                if (!isResultHeader)
-                    resultName = resultPartName;
-            } else
-                resultPartName = resultName;
-            if (webResult.targetNamespace().length() > 0)
-                resultTNS = webResult.targetNamespace();
-            isResultHeader = webResult.header();
-        }
-        if (isResultHeader)
-            resultQName = new QName(resultTNS, resultName);
-        else
-            resultQName = new QName(resultName);
-
-        if(javaMethod.isAsync()){
-            returnType = getAsyncReturnType(method, returnType);
-        }
-
-        if (!isOneway && (returnType != null) && (!returnType.getName().equals("void"))) {
-            Class returnClazz = returnType;
-            Annotation[] rann = method.getAnnotations();
-            TypeReference rTypeReference = new TypeReference(resultQName, returnType, rann);
-            Parameter returnParameter = new Parameter(rTypeReference, com.sun.xml.internal.ws.model.Mode.OUT, -1);
-            returnParameter.setPartName(resultPartName);
-            if(isResultHeader){
-                returnParameter.setBinding(ParameterBinding.HEADER);
-                javaMethod.addParameter(returnParameter);
-            }else{
-                ParameterBinding rb = getBinding(binding, operationName, resultPartName, false, com.sun.xml.internal.ws.model.Mode.OUT);
-                returnParameter.setBinding(rb);
-                if(rb.isBody() || rb.isUnbound()){
-                    Part p = getPart(operationName, resultPartName, Mode.OUT);
-                    if(p == null)
-                        resRpcParams.put(resRpcParams.size(), returnParameter);
-                    else
-                        resRpcParams.put(p.getIndex(), returnParameter);
-                    //responseWrapper.addWrapperChild(returnParameter);
-                }else{
-                    javaMethod.addParameter(returnParameter);
-                }
-            }
-        }
-
-        //get WebParam
-        Class<?>[] parameterTypes = method.getParameterTypes();
-        Type[] genericParameterTypes = method.getGenericParameterTypes();
-        Annotation[][] pannotations = getPrivParameterAnnotations(method);
-        int pos = 0;
-        QName paramQName = null;
-        for (Class clazzType : parameterTypes) {
-            Parameter param = null;
-            String paramName = "";
-            String paramNamespace = "";
-            String partName = "";
-            boolean isHeader = false;
-
-            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
-                continue;
-            }
-
-            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
-            //set the actual type argument of Holder in the TypeReference
-            if (isHolder) {
-                if (clazzType.getName().equals(Holder.class.getName()))
-                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
-            }
-            com.sun.xml.internal.ws.model.Mode paramMode = isHolder ?
-                com.sun.xml.internal.ws.model.Mode.INOUT :
-                com.sun.xml.internal.ws.model.Mode.IN;
-            for (Annotation annotation : pannotations[pos]) {
-                if (annotation.annotationType() == javax.jws.WebParam.class) {
-                    javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
-                    paramName = webParam.name();
-                    partName = webParam.partName();
-                    isHeader = webParam.header();
-                    WebParam.Mode mode = webParam.mode();
-                    paramNamespace = webParam.targetNamespace();
-                    if (isHolder && mode == javax.jws.WebParam.Mode.IN)
-                        mode = javax.jws.WebParam.Mode.INOUT;
-                    paramMode = (mode == javax.jws.WebParam.Mode.IN) ? com.sun.xml.internal.ws.model.Mode.IN :
-                        (mode == javax.jws.WebParam.Mode.INOUT) ? com.sun.xml.internal.ws.model.Mode.INOUT :
-                        com.sun.xml.internal.ws.model.Mode.OUT;
-                    break;
-                }
-            }
-
-            if (paramName.length() == 0) {
-                paramName = "arg"+pos;
-            }
-            if (partName.length() == 0) {
-                partName = paramName;
-            } else if (!isHeader) {
-                paramName = partName;
-            }
-            if (partName.length() == 0) {
-                partName = paramName;
-            }
-
-            if (!isHeader) {
-                //its rpclit body param, set namespace to ""
-                paramQName = new QName("", paramName);
-            } else {
-                if (paramNamespace.length() == 0)
-                    paramNamespace = targetNamespace;
-                paramQName = new QName(paramNamespace, paramName);
-            }
-            typeRef =
-                new TypeReference(paramQName, clazzType, pannotations[pos]);
-
-            param = new Parameter(typeRef, paramMode, pos++);
-            param.setPartName(partName);
-
-            if(paramMode == Mode.INOUT){
-                ParameterBinding pb = getBinding(binding, operationName, partName, isHeader, Mode.IN);
-                param.setInBinding(pb);
-                pb = getBinding(binding, operationName, partName, isHeader, Mode.OUT);
-                param.setOutBinding(pb);
-            }else{
-                if (isHeader) {
-                    param.setBinding(ParameterBinding.HEADER);
-                } else {
-                    ParameterBinding pb = getBinding(binding, operationName, partName, false, paramMode);
-                    param.setBinding(pb);
-                }
-            }
-            if(param.getInBinding().isBody()){
-                if(!param.isOUT()){
-                    Part p = getPart(operationName, partName, Mode.IN);
-                    if(p == null)
-                        reqRpcParams.put(reqRpcParams.size(), param);
-                    else
-                        reqRpcParams.put(p.getIndex(), param);
-                    //requestWrapper.addWrapperChild(param);
-                }
-
-                if(!param.isIN()){
-                    if (isOneway) {
-                            throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters",
-                                    new Object[] {portClass.getCanonicalName(), methodName});
-                    }
-                    Part p = getPart(operationName, partName, Mode.OUT);
-                    if(p == null)
-                        resRpcParams.put(resRpcParams.size(), param);
-                    else
-                        resRpcParams.put(p.getIndex(), param);
-//                        responseWrapper.addWrapperChild(param);
-                }
-            }else{
-                javaMethod.addParameter(param);
-            }
-        }
-        for(int i = 0; i < reqRpcParams.size();i++)
-            requestWrapper.addWrapperChild(reqRpcParams.get(i));
-        for(int i = 0; i < resRpcParams.size();i++)
-            responseWrapper.addWrapperChild(resRpcParams.get(i));
-        processExceptions(javaMethod, method);
-    }
-
-    /**
-     * models the exceptions thrown by <code>method</code> and adds them to the <code>javaMethod</code>
-     * runtime model object
-     * @param javaMethod the runtime model object to add the exception model objects to
-     * @param method the <code>method</code> from which to find the exceptions to model
-     */
-    protected void processExceptions(JavaMethod javaMethod, Method method) {
-        for (Type exception : method.getGenericExceptionTypes()) {
-            if (REMOTE_EXCEPTION_CLASS.isAssignableFrom((Class)exception))
-                continue;
-            Class exceptionBean;
-            Annotation[] anns;
-            WebFault webFault = getPrivClassAnnotation((Class)exception, WebFault.class);
-            Method faultInfoMethod = getWSDLExceptionFaultInfo((Class)exception);
-            ExceptionType exceptionType = ExceptionType.WSDLException;
-            String namespace = targetNamespace;
-            String name = ((Class)exception).getSimpleName();
-            String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
-            String className = beanPackage+ name + BEAN;
-            if (webFault != null) {
-                if (webFault.faultBean().length()>0)
-                    className = webFault.faultBean();
-                if (webFault.name().length()>0)
-                    name = webFault.name();
-                if (webFault.targetNamespace().length()>0)
-                    namespace = webFault.targetNamespace();
-            }
-            if (faultInfoMethod == null)  {
-                exceptionBean = getClass(className);
-                exceptionType = ExceptionType.UserDefined;
-                anns = exceptionBean.getAnnotations();
-
-            } else {
-                exceptionBean = faultInfoMethod.getReturnType();
-                anns = faultInfoMethod.getAnnotations();
-            }
-            QName faultName = new QName(namespace, name);
-            TypeReference typeRef = new TypeReference(faultName, exceptionBean,
-                anns);
-            CheckedException checkedException =
-                new CheckedException((Class)exception, typeRef, exceptionType);
-            checkedException.setMessageName(((Class)exception).getSimpleName());
-            javaMethod.addException(checkedException);
-        }
-    }
-
-    /**
-     * returns the method that corresponds to "getFaultInfo".  Returns null if this is not an
-     * exception generated from a WSDL
-     * @param exception the class to search for the "getFaultInfo" method
-     * @return the method named "getFaultInfo" if this is an exception generated from WSDL or an
-     * exception that contains the <code>WebFault</code> annotation.  Otherwise it returns null
-     */
-    protected Method getWSDLExceptionFaultInfo(Class exception) {
-        if (getPrivClassAnnotation(exception, WebFault.class) == null)
-            return null;
-        try {
-            Method getFaultInfo = exception.getMethod("getFaultInfo", new Class[0]);
-            return getFaultInfo;
-        } catch (NoSuchMethodException e) {
-            return null;
-        }
-    }
-
-    /**
-     * models a document/literal bare method
-     * @param javaMethod the runtime model <code>JavaMethod</code> instance being created
-     * @param methodName the runtime model <code>JavaMethod</code> instance being created
-     * @param webMethod the runtime model <code>JavaMethod</code> instance being created
-     * @param operationName the runtime model <code>JavaMethod</code> instance being created
-     * @param method the runtime model <code>JavaMethod</code> instance being created
-     * @param webService the runtime model <code>JavaMethod</code> instance being created
-     */
-    protected void processDocBareMethod(JavaMethod javaMethod, String methodName,
-                                        WebMethod webMethod, String operationName, Method method, WebService webService) {
-
-        String resultName = operationName+RESPONSE;
-        String resultTNS = targetNamespace;
-        String resultPartName = null;
-        boolean isResultHeader = false;
-        WebResult webResult = method.getAnnotation(WebResult.class);
-        if (webResult != null) {
-            if (webResult.name().length() > 0)
-                resultName = webResult.name();
-            if (webResult.targetNamespace().length() > 0)
-                resultTNS = webResult.targetNamespace();
-            resultPartName = webResult.partName();
-            isResultHeader = webResult.header();
-        }
-        Class returnType = method.getReturnType();
-
-        if(javaMethod.isAsync()){
-            returnType = getAsyncReturnType(method, returnType);
-        }
-
-        QName responseQName = null;
-        if ((returnType != null) && (!returnType.getName().equals("void"))) {
-            Class returnClazz = returnType;
-            Annotation[] rann = method.getAnnotations();
-            QName rqname = null;
-            if (resultName != null) {
-                responseQName = new QName(resultTNS, resultName);
-                TypeReference rTypeReference = new TypeReference(responseQName, returnType, rann);
-                Parameter returnParameter = new Parameter(rTypeReference, com.sun.xml.internal.ws.model.Mode.OUT, -1);
-
-                if(resultPartName == null || (resultPartName.length() == 0)){
-                    resultPartName = resultName;
-                }
-                returnParameter.setPartName(resultPartName);
-                if(isResultHeader){
-                    returnParameter.setBinding(ParameterBinding.HEADER);
-                }else{
-                    ParameterBinding rb = getBinding(binding, operationName, resultPartName, false, com.sun.xml.internal.ws.model.Mode.OUT);
-                    returnParameter.setBinding(rb);
-                }
-                javaMethod.addParameter(returnParameter);
-            }
-        }
-
-        //get WebParam
-        Class<?>[] parameterTypes = method.getParameterTypes();
-        Type[] genericParameterTypes = method.getGenericParameterTypes();
-        Annotation[][] pannotations = getPrivParameterAnnotations(method);
-        QName requestQName = null;
-        int pos = 0;
-        for (Class clazzType : parameterTypes) {
-            Parameter param = null;
-            String paramName = operationName; //method.getName();
-            String partName = null;
-            String requestNamespace = targetNamespace;
-            boolean isHeader = false;
-
-            //async
-            if(javaMethod.isAsync() && AsyncHandler.class.isAssignableFrom(clazzType)){
-                continue;
-            }
-
-            boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
-            //set the actual type argument of Holder in the TypeReference
-            if (isHolder) {
-                if (clazzType.getName().equals(Holder.class.getName()))
-                    clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
-            }
-
-            com.sun.xml.internal.ws.model.Mode paramMode = isHolder ?
-                com.sun.xml.internal.ws.model.Mode.INOUT :
-                com.sun.xml.internal.ws.model.Mode.IN;
-            for (Annotation annotation : pannotations[pos]) {
-                if (annotation.annotationType() == javax.jws.WebParam.class) {
-                    javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
-                    if (webParam.name().length() > 0)
-                        paramName = webParam.name();
-                    partName = webParam.partName();
-                    if (!webParam.targetNamespace().equals("")) {
-                        requestNamespace = webParam.targetNamespace();
-                    }
-                    isHeader = webParam.header();
-                    WebParam.Mode mode = webParam.mode();
-                    if (isHolder && mode == javax.jws.WebParam.Mode.IN)
-                        mode = javax.jws.WebParam.Mode.INOUT;
-                    paramMode = (mode == javax.jws.WebParam.Mode.IN) ? com.sun.xml.internal.ws.model.Mode.IN :
-                        (mode == javax.jws.WebParam.Mode.INOUT) ? com.sun.xml.internal.ws.model.Mode.INOUT :
-                        com.sun.xml.internal.ws.model.Mode.OUT;
-                    break;
-                }
-            }
-
-            requestQName = new QName(requestNamespace, paramName);
-            //doclit/wrapped
-            TypeReference typeRef = //operationName with upper 1 char
-                new TypeReference(requestQName, clazzType,
-                    pannotations[pos]);
-
-            param = new Parameter(typeRef, paramMode, pos++);
-            if(partName == null || (partName.length() == 0)){
-                    partName = paramName;
-            }
-            param.setPartName(partName);
-            if(paramMode == com.sun.xml.internal.ws.model.Mode.INOUT){
-                ParameterBinding pb = getBinding(binding, operationName, partName, isHeader, com.sun.xml.internal.ws.model.Mode.IN);
-                param.setInBinding(pb);
-                pb = getBinding(binding, operationName, partName, isHeader, com.sun.xml.internal.ws.model.Mode.OUT);
-                param.setOutBinding(pb);
-            }else{
-                if (isHeader){
-                    param.setBinding(ParameterBinding.HEADER);
-                }else{
-                    ParameterBinding pb = getBinding(binding, operationName, partName, false, paramMode);
-                    param.setBinding(pb);
-                }
-            }
-            javaMethod.addParameter(param);
-        }
-        processExceptions(javaMethod, method);
-    }
-
-    private Class getAsyncReturnType(Method method, Class returnType) {
-        if(Response.class.isAssignableFrom(returnType)){
-            Type ret = method.getGenericReturnType();
-            return Navigator.REFLECTION.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]);
-        }else{
-            Type[] types = method.getGenericParameterTypes();
-            Class[] params = method.getParameterTypes();
-            int i = 0;
-            for(Class cls : params){
-                if(AsyncHandler.class.isAssignableFrom(cls)){
-                    return Navigator.REFLECTION.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]);
-                }
-                i++;
-            }
-        }
-        return returnType;
-    }
-
-    /**
-     * utility to capitalize the first letter in a string
-     * @param name the string to capitalize
-     * @return the capitalized string
-     */
-    public static String capitalize(String name) {
-        if (name == null || name.length() == 0) {
-            return name;
-        }
-        char chars[] = name.toCharArray();
-        chars[0] = Character.toUpperCase(chars[0]);
-        return new String(chars);
-    }
-
-    /*
-    * Return service QName
-    */
-    /**
-     * gets the <code>wsdl:serviceName</code> for a given implementation class
-     * @param implClass the implementation class
-     * @return the <code>wsdl:serviceName</code> for the <code>implClass</code>
-     */
-    public static QName getServiceName(Class implClass) {
-        if (implClass.isInterface()) {
-            throw new RuntimeModelerException("runtime.modeler.cannot.get.serviceName.from.interface",
-                                    new Object[] {implClass.getCanonicalName()});
-        }
-
-        String name = implClass.getSimpleName()+SERVICE;
-        String packageName = null;
-        if (implClass.getPackage() != null)
-            packageName = implClass.getPackage().getName();
-
-        WebService webService =
-            (WebService)implClass.getAnnotation(WebService.class);
-        if (webService == null) {
-            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
-                                    new Object[] {implClass.getCanonicalName()});
-        }
-        if (webService.serviceName().length() > 0) {
-            name = webService.serviceName();
-        }
-        String targetNamespace = getNamespace(packageName);
-        if (webService.targetNamespace().length() > 0) {
-            targetNamespace = webService.targetNamespace();
-        } else if (targetNamespace == null) {
-            throw new RuntimeModelerException("runtime.modeler.no.package",
-                             new Object[] {implClass.getName()});
-        }
-
-
-
-        return new QName(targetNamespace, name);
-    }
-
-    /**
-     * gets the <code>wsdl:portName</code> for a given implementation class
-     * @param implClass the implementation class
-     * @param targetNamespace Namespace URI for service name
-     * @return the <code>wsdl:portName</code> for the <code>implClass</code>
-     */
-    public static QName getPortName(Class implClass, String targetNamespace) {
-        WebService webService =
-            (WebService)implClass.getAnnotation(WebService.class);
-        if (webService == null) {
-            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
-                new Object[] {implClass.getCanonicalName()});
-        }
-        String name = null;
-        if (webService.portName().length() > 0) {
-            name = webService.portName();
-        } else if (webService.name().length() > 0) {
-            name = webService.name()+PORT;
-        } else {
-            name = implClass.getSimpleName()+PORT;
-        }
-
-        if (targetNamespace == null) {
-            if (webService.targetNamespace().length() > 0) {
-                targetNamespace = webService.targetNamespace();
-            } else {
-                String packageName = null;
-                if (implClass.getPackage() != null) {
-                    packageName = implClass.getPackage().getName();
-                }
-                targetNamespace = getNamespace(packageName);
-                if (targetNamespace == null) {
-                    throw new RuntimeModelerException("runtime.modeler.no.package",
-                        new Object[] {implClass.getName()});
-                }
-            }
-
-        }
-
-        return new QName(targetNamespace, name);
-    }
-
-    /**
-     * Gives portType QName from implementatorClass or SEI
-     * @param  implOrSeiClass cant be null
-     * @return  <code>wsdl:portType@name</code>, null if it could not find the annotated class.
-     */
-    public static QName getPortTypeName(Class implOrSeiClass){
-        assert(implOrSeiClass != null);
-        Class clazz = implOrSeiClass;
-        WebService webService = null;
-        if (!implOrSeiClass.isAnnotationPresent(javax.jws.WebService.class))
-                throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
-                                           new Object[] {implOrSeiClass.getCanonicalName()});
-
-        if (!implOrSeiClass.isInterface()) {
-            webService = (WebService) implOrSeiClass.getAnnotation(WebService.class);
-            String epi = webService.endpointInterface();
-            if (epi.length() > 0) {
-                try {
-                    clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
-                } catch (ClassNotFoundException e) {
-                    throw new RuntimeModelerException("runtime.modeler.class.not.found",
-                                 new Object[] {epi});
-                }
-                if (!clazz.isAnnotationPresent(javax.jws.WebService.class)) {
-                    throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
-                                        new Object[] {webService.endpointInterface()});
-                }
-            }
-        }
-
-        webService = (WebService) clazz.getAnnotation(WebService.class);
-        String name = webService.name();
-        if(name.length() == 0){
-            name = clazz.getSimpleName();
-        }
-
-        String tns = webService.targetNamespace();
-        if (tns.length() == 0)
-            tns = getNamespace(clazz.getPackage().getName());
-        if (tns == null) {
-            throw new RuntimeModelerException("runtime.modeler.no.package",
-                new Object[] {clazz.getName()});
-        }
-        return new QName(tns, name);
-    }
-
-    public static String getBindingId(Class implClass) {
-        BindingType bindingType =
-            (BindingType)implClass.getAnnotation(BindingType.class);
-        if (bindingType != null) {
-            String bindingId = bindingType.value();
-            if (bindingId.length() > 0) {
-                if (!bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
-                    && !bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
-                    && !bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
-                    && !bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
-                    && !bindingId.equals(HTTPBinding.HTTP_BINDING)
-                    && !bindingId.equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
-                    throw new IllegalArgumentException("Wrong binding id "+bindingId+" in @BindingType");
-                }
-                return bindingId;
-            }
-        }
-        return null;
-    }
-
-    private ParameterBinding getBinding(com.sun.xml.internal.ws.wsdl.parser.Binding binding, String operation, String part, boolean isHeader, Mode mode){
-        if(binding == null){
-            if(isHeader)
-                return ParameterBinding.HEADER;
-            else
-                return ParameterBinding.BODY;
-        }
-        BindingOperation bo = binding.get(operation);
-
-        //if the binding Operation corresponding to the operation is not found in the WSDL then
-        //throw the exception
-        if(bo == null){
-            throw new RuntimeModelerException("runtime.operation.noBinding", operation, portName);
-        }
-
-        return binding.getBinding(bo, part, mode);
-    }
-
-    private Part getPart(String opName, String partName, Mode mode){
-        if(binding != null){
-            BindingOperation bo = binding.get(opName);
-            if(bo != null)
-                return bo.getPart(partName, mode);
-        }
-        return null;
-    }
-
-
-    public String getBindingId() {
-        return bindingId;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModelerException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModelerException.java
deleted file mode 100644
index b91227a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/modeler/RuntimeModelerException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.modeler;
-import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-
-/**
- * RuntimeModelerException represents an exception that occurred while
- * serializing a Java value as XML.
- *
- * @see JAXWSExceptionBase
- *
- * @author WS Development Team
- */
-public class RuntimeModelerException extends JAXWSExceptionBase {
-
-    public RuntimeModelerException(String key, Object... args) {
-        super(key, args);
-    }
-
-    public RuntimeModelerException(Throwable throwable) {
-        super(throwable);
-    }
-
-    public RuntimeModelerException(Localizable arg) {
-        super("nestedModelerError", arg);
-    }
-
-    public String getResourceBundleName() {
-        return "com.sun.xml.internal.ws.resources.modeler";
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/package-info.java
index 33128e3..2778340 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,16 +33,6 @@
  * attachment support with SOAP messages and to allow handler developers
  * to gain access to the SOAP message via a standard interface. Fast
  * Infoset is a binary encoding of XML that can improve performance.</P>
- * <P>JAX-WS 2.0 was originally called JAX-RPC 2.0 and was hence
- * developed from the JAX-RPC 1.1 code base. JAX-WS has been
- * significanlty rearchitected to for extensibility going forward by
- * incorporating and implementing concepts from <A HREF="pept.html">PEPT</A>.
- * PEPT presents four main components presentation, encoding, protocol
- * and transport. Ideally each of these components would not be
- * dependent on another, however, due to time constraints an optimal
- * PEPT implementation was not possible and thus some of the PEPT
- * boundaries have been blurred. Future versions of JAX-WS may sharpen
- * these boundaries when possible.</P>
  * <P>The remainder of this document will describe the JAX-WS runtime
  * architecture from the client and server perspectives.</P>
  *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/Delegate.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/Delegate.java
deleted file mode 100644
index 2bcced9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/Delegate.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Delegate.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept;
-
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Delegate {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageStruct with ...
- * </p>
- */
-    public MessageStruct getMessageStruct();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param message ...
- * </p>
- */
-    public void send(MessageStruct message);
-
-} // end Delegate
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Decoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Decoder.java
deleted file mode 100644
index 3f30243..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Decoder.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Decoder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.encoding;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Decoder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void decode(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void receiveAndDecode(MessageInfo messageInfo);
-
-} // end Decoder
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Encoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Encoder.java
deleted file mode 100644
index cf3e0a4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/encoding/Encoder.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Encoder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.encoding;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import java.nio.ByteBuffer;
-
-/**
- * <p>
- *
- * @author Arun Gupta
- * </p>
- */
-public interface Encoder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void encodeAndSend(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ByteBuffer with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public ByteBuffer encode(MessageInfo messageInfo);
-
-} // end Encoder
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/Acceptor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/Acceptor.java
deleted file mode 100644
index ffcaa40..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/Acceptor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Acceptor.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Acceptor extends EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p>
- */
-    public void accept();
-
-} // end Acceptor
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfo.java
deleted file mode 100644
index e89ff0b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfo.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "ContactInfo.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfo extends EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Connection with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public WSConnection getConnection(MessageInfo messageInfo);
-
-} // end ContactInfo
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoList.java
deleted file mode 100644
index b1e3868..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoList.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "ContactInfoList.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfoList {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ContactInfoListIterator with ...
- * </p>
- */
-    public ContactInfoListIterator iterator();
-
-} // end ContactInfoList
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoListIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoListIterator.java
deleted file mode 100644
index 2810db6..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/ContactInfoListIterator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "ContactInfoListIterator.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface ContactInfoListIterator {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a boolean with ...
- * </p>
- */
-    public boolean hasNext();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a ContactInfo with ...
- * </p>
- */
-    public ContactInfo next();
-
-} // end ContactInfoListIterator
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/EPTFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/EPTFactory.java
deleted file mode 100644
index 44fc0b4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/EPTFactory.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "EPTFactory.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.protocol.Interceptors;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface EPTFactory {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageDispatcher with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public MessageDispatcher getMessageDispatcher(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Encoder with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public Encoder getEncoder(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Decoder with ...
- * </p><p>
- * @param messageInfo ...
- * </p>
- */
-    public Decoder getDecoder(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Interceptors with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public Interceptors getInterceptors(MessageInfo x);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a TargetFinder with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public TargetFinder getTargetFinder(MessageInfo x);
-
-} // end EPTFactory
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/MessageInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/MessageInfo.java
deleted file mode 100644
index af6d518..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/ept/MessageInfo.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "MessageInfo.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.ept;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageInfo extends MessageStruct {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a EPTFactory with ...
- * </p>
- */
-    public EPTFactory getEPTFactory();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a MessageDispatcher with ...
- * </p>
- */
-    public MessageDispatcher getMessageDispatcher();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Encoder with ...
- * </p>
- */
-    public Encoder getEncoder();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Decoder with ...
- * </p>
- */
-    public Decoder getDecoder();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Connection with ...
- * </p>
- */
-    public WSConnection getConnection();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param eptFactory ...
- * </p>
- */
-    public void setEPTFactory(EPTFactory eptFactory);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageDispatcher ...
- * </p>
- */
-    public void setMessageDispatcher(MessageDispatcher messageDispatcher);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param encoder ...
- * </p>
- */
-    public void setEncoder(Encoder encoder);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param decoder ...
- * </p>
- */
-    public void setDecoder(Decoder decoder);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param connection ...
- * </p>
- */
-    public void setConnection(WSConnection connection);
-
-} // end MessageInfo
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/MessageStruct.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/MessageStruct.java
deleted file mode 100644
index 58021ba..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/MessageStruct.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "MessageStruct.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.presentation;
-
-import java.lang.reflect.Method;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageStruct {
-
-  ///////////////////////////////////////
-  //attributes
-
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int NORMAL_RESPONSE = 0;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int CHECKED_EXCEPTION_RESPONSE = 1;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int UNCHECKED_EXCEPTION_RESPONSE = 2;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int REQUEST_RESPONSE_MEP = 1;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ONE_WAY_MEP = 2;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ASYNC_POLL_MEP = 3;
-
-/**
- * <p>
- * Represents ...
- * </p>
- */
-    public static final int ASYNC_CALLBACK_MEP = 4;
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @param data ...
- * </p><p>
- *
- * </p>
- */
-    public void setData(Object[] data);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object[] with ...
- * </p>
- */
-    public Object[] getData();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param name ...
- * </p><p>
- * @param value ...
- * </p>
- */
-    public void setMetaData(Object name, Object value);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p><p>
- * @param name ...
- * </p>
- */
-    public Object getMetaData(Object name);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageExchangePattern ...
- * </p>
- */
-    public void setMEP(int messageExchangePattern);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a int with ...
- * </p>
- */
-    public int getMEP();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a int with ...
- * </p>
- */
-    public int getResponseType();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param responseType ...
- * </p>
- */
-    public void setResponseType(int responseType);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p>
- */
-    public Object getResponse();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param response ...
- * </p>
- */
-    public void setResponse(Object response);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param method ...
- * </p>
- */
-    public void setMethod(Method method);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Method with ...
- * </p>
- */
-    public Method getMethod();
-
-} // end MessageStruct
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Stub.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Stub.java
deleted file mode 100644
index 2667efb..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Stub.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Stub.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.presentation;
-
-import com.sun.xml.internal.ws.pept.Delegate;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Stub {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param delegate ...
- * </p>
- */
-    public void _setDelegate(Delegate delegate);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Delegate with ...
- * </p>
- */
-    public Delegate _getDelegate();
-
-} // end Stub
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/TargetFinder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/TargetFinder.java
deleted file mode 100644
index c1dbe94..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/TargetFinder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "TargetFinder.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.presentation;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface TargetFinder {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Tie with ...
- * </p><p>
- * @param x ...
- * </p>
- */
-    public Tie findTarget(MessageInfo x);
-
-} // end TargetFinder
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Tie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Tie.java
deleted file mode 100644
index 217e77a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/presentation/Tie.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Tie.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.presentation;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Tie {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param servant ...
- * </p>
- */
-    public void _setServant(Object servant);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * @return a Object with ...
- * </p>
- */
-    public Object _getServant();
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void _invoke(MessageInfo messageInfo);
-
-} // end Tie
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/Interceptors.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/Interceptors.java
deleted file mode 100644
index d03f86e..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/Interceptors.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "Interceptors.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.protocol;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface Interceptors {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void interceptMessage(MessageInfo messageInfo);
-
-} // end Interceptors
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/MessageDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/MessageDispatcher.java
deleted file mode 100644
index 7a48dee..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/pept/protocol/MessageDispatcher.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-/** Java interface "MessageDispatcher.java" generated from Poseidon for UML.
- *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
- *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
- */
-package com.sun.xml.internal.ws.pept.protocol;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-
-/**
- * <p>
- *
- * @author Dr. Harold Carr
- * </p>
- */
-public interface MessageDispatcher {
-
-  ///////////////////////////////////////
-  // operations
-
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void send(MessageInfo messageInfo);
-/**
- * <p>
- * Does ...
- * </p><p>
- *
- * </p><p>
- *
- * @param messageInfo ...
- * </p>
- */
-    public void receive(MessageInfo messageInfo);
-
-} // end MessageDispatcher
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ClientMUTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ClientMUTube.java
new file mode 100644
index 0000000..264b45e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ClientMUTube.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.protocol.soap;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Performs soap mustUnderstand processing for clients.
+ *
+ * @author Rama Pulavarthi
+ */
+public class ClientMUTube extends MUTube {
+
+    public ClientMUTube(WSBinding binding, Tube next) {
+        super(binding, next);
+    }
+
+    protected ClientMUTube(ClientMUTube that, TubeCloner cloner) {
+        super(that,cloner);
+    }
+
+    /**
+     * Do MU Header Processing on incoming message (response)
+     *
+     * @return
+     *         if all the headers in the packet are understood, returns an action to
+     *         call the previous pipes with response packet
+     * @throws SOAPFaultException
+     *         if all the headers in the packet are not understood, throws SOAPFaultException
+     */
+    @Override @NotNull
+    public NextAction processResponse(Packet response) {
+        if (response.getMessage() == null) {
+            return super.processResponse(response);
+        }
+        HandlerConfiguration handlerConfig = response.handlerConfig;
+        Set<QName> knownHeaders;
+        Set<String> roles;
+        if (handlerConfig != null) {
+            knownHeaders = handlerConfig.getKnownHeaders();
+            roles = handlerConfig.getRoles();
+        } else {
+            roles = soapVersion.implicitRoleSet;
+            knownHeaders = new HashSet<QName>();
+        }
+        Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(
+                response.getMessage().getHeaders(), roles,
+                knownHeaders);
+        if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
+            return super.processResponse(response);
+        }
+        throw createMUSOAPFaultException(misUnderstoodHeaders);
+    }
+
+    public ClientMUTube copy(TubeCloner cloner) {
+        return new ClientMUTube(this,cloner);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java
new file mode 100644
index 0000000..16fa82e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.protocol.soap;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import static com.sun.xml.internal.ws.api.SOAPVersion.SOAP_11;
+import static com.sun.xml.internal.ws.api.SOAPVersion.SOAP_12;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.message.DOMHeader;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+/**
+ * @author Rama Pulavarthi
+ */
+
+abstract class MUTube extends AbstractFilterTubeImpl {
+
+    private static final String MU_FAULT_DETAIL_LOCALPART = "NotUnderstood";
+    private final static QName MU_HEADER_DETAIL = new QName(SOAPVersion.SOAP_12.nsUri, MU_FAULT_DETAIL_LOCALPART);
+    //TODO: change
+    protected static final Logger logger = Logger.getLogger(
+            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".soap.decoder");
+    private final static String MUST_UNDERSTAND_FAULT_MESSAGE_STRING =
+            "One or more mandatory SOAP header blocks not understood";
+
+    protected final SOAPVersion soapVersion;
+    private final AddressingVersion addressingVersion;
+
+    protected MUTube(WSBinding binding, Tube next) {
+        super(next);
+        // MUPipe should n't be used for bindings other than SOAP.
+        if (!(binding instanceof SOAPBinding)) {
+            throw new WebServiceException(
+                    "MUPipe should n't be used for bindings other than SOAP.");
+        }
+        this.soapVersion = binding.getSOAPVersion();
+        this.addressingVersion = binding.getAddressingVersion();
+    }
+
+    protected MUTube(MUTube that, TubeCloner cloner) {
+        super(that, cloner);
+        soapVersion = that.soapVersion;
+        addressingVersion = that.addressingVersion;
+    }
+
+    /**
+     * @param headers      HeaderList that needs MU processing
+     * @param roles        Roles configured on the Binding. Required Roles supposed to be assumbed a by a
+     *                     SOAP Binding implementation are added.
+     * @param knownHeaders Set of headers that this binding understands
+     * @return returns the headers that have mustUnderstand attribute and are not understood
+     *         by the binding.
+     */
+    protected final Set<QName> getMisUnderstoodHeaders(HeaderList headers, Set<String> roles, Set<QName> knownHeaders) {
+        Set<QName> notUnderstoodHeaders = null;
+
+        understandAddressingHeaders(knownHeaders);
+
+        for (int i = 0; i < headers.size(); i++) {
+            if (!headers.isUnderstood(i)) {
+                Header header = headers.get(i);
+                if (!header.isIgnorable(soapVersion, roles)) {
+                    QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
+                    if (! knownHeaders.contains(qName)) {
+                        logger.finest("Element not understood=" + qName);
+                        if (notUnderstoodHeaders == null)
+                            notUnderstoodHeaders = new HashSet<QName>();
+                        notUnderstoodHeaders.add(qName);
+                    }
+                }
+            }
+        }
+        return notUnderstoodHeaders;
+    }
+
+    /**
+     * Understand WS-Addressing headers if WS-Addressing is enabled
+     *
+     * @param knownHeaders Set of headers that this binding understands
+     */
+    private void understandAddressingHeaders(Set<QName> knownHeaders) {
+        if (addressingVersion != null) {
+            knownHeaders.add(addressingVersion.actionTag);
+            knownHeaders.add(addressingVersion.faultToTag);
+            knownHeaders.add(addressingVersion.fromTag);
+            knownHeaders.add(addressingVersion.messageIDTag);
+            knownHeaders.add(addressingVersion.relatesToTag);
+            knownHeaders.add(addressingVersion.replyToTag);
+            knownHeaders.add(addressingVersion.toTag);
+        }
+    }
+
+    /**
+     * @param notUnderstoodHeaders
+     * @return SOAPfaultException with SOAPFault representing the MustUnderstand SOAP Fault.
+     *         notUnderstoodHeaders are added in the fault detail.
+     */
+    final SOAPFaultException createMUSOAPFaultException(Set<QName> notUnderstoodHeaders) {
+        try {
+            SOAPFault fault = createMUSOAPFault();
+            setMUFaultString(fault, notUnderstoodHeaders);
+            return new SOAPFaultException(fault);
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    /**
+     * This should be used only in ServerMUPipe
+     *
+     * @param notUnderstoodHeaders
+     * @return Message representing a SOAPFault
+     *         In SOAP 1.1, notUnderstoodHeaders are added in the fault Detail
+     *         in SOAP 1.2, notUnderstoodHeaders are added as the SOAP Headers
+     */
+
+    final Message createMUSOAPFaultMessage(Set<QName> notUnderstoodHeaders) {
+        try {
+            SOAPFault fault = createMUSOAPFault();
+            if (soapVersion == SOAP_11) {
+                setMUFaultString(fault, notUnderstoodHeaders);
+            }
+            Message muFaultMessage = Messages.create(fault);
+            if (soapVersion == SOAP_12) {
+                addHeader(muFaultMessage, notUnderstoodHeaders);
+            }
+            return muFaultMessage;
+        } catch (SOAPException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    private void setMUFaultString(SOAPFault fault, Set<QName> notUnderstoodHeaders) throws SOAPException {
+        fault.setFaultString("MustUnderstand headers:" +
+                notUnderstoodHeaders + " are not understood");
+    }
+
+    private static void addHeader(Message m, Set<QName> notUnderstoodHeaders) throws SOAPException {
+        for (QName qname : notUnderstoodHeaders) {
+            SOAPElement soapEl = SOAP_12.saajSoapFactory.createElement(MU_HEADER_DETAIL);
+            soapEl.addNamespaceDeclaration("abc", qname.getNamespaceURI());
+            soapEl.setAttribute("qname", "abc:" + qname.getLocalPart());
+            Header header = new DOMHeader<Element>(soapEl);
+            m.getHeaders().add(header);
+        }
+    }
+
+    private SOAPFault createMUSOAPFault() throws SOAPException {
+        return soapVersion.saajSoapFactory.createFault(
+                MUST_UNDERSTAND_FAULT_MESSAGE_STRING,
+                soapVersion.faultCodeMustUnderstand);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java
new file mode 100644
index 0000000..c250afe
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.protocol.soap;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.*;
+import com.sun.xml.internal.ws.client.HandlerConfiguration;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import javax.xml.namespace.QName;
+import java.util.Set;
+
+/**
+ * @author Rama Pulavarthi
+ */
+
+public class ServerMUTube extends MUTube {
+
+    private HandlerConfiguration handlerConfig;
+
+    public ServerMUTube(WSBinding binding, Tube next) {
+        super(binding, next);
+        //On Server, HandlerConfiguration does n't change after publish.
+        handlerConfig = ((BindingImpl)binding).getHandlerConfig();
+    }
+
+    protected ServerMUTube(ServerMUTube that, TubeCloner cloner) {
+        super(that,cloner);
+        handlerConfig = that.handlerConfig;
+    }
+
+    /**
+     * Do MU Header Processing on incoming message (request)
+     * @return
+     *      if all the headers in the packet are understood, returns action such that
+     *      next pipe will be inovked.
+     *      if all the headers in the packet are not understood, returns action such that
+     *      SOAPFault Message is sent to previous pipes.
+     */
+    @Override
+    public NextAction processRequest(Packet request) {
+        Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),
+                handlerConfig.getRoles(),handlerConfig.getKnownHeaders());
+        if((misUnderstoodHeaders == null)  || misUnderstoodHeaders.isEmpty()) {
+            return doInvoke(super.next, request);
+        }
+        return doReturnWith(request.createResponse(createMUSOAPFaultMessage(misUnderstoodHeaders)));
+    }
+
+    public ServerMUTube copy(TubeCloner cloner) {
+        return new ServerMUTube(this,cloner);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/VersionMismatchException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/VersionMismatchException.java
new file mode 100644
index 0000000..dd592c9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/VersionMismatchException.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.protocol.soap;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
+import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This is used to represent SOAP VersionMismatchFault. Use
+ * this when the received soap envelope is in a different namespace
+ * than what the specified Binding says.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class VersionMismatchException extends ExceptionHasMessage {
+
+    private final SOAPVersion soapVersion;
+
+    public VersionMismatchException(SOAPVersion soapVersion, Object... args) {
+        super("soap.version.mismatch.err", args);
+        this.soapVersion = soapVersion;
+    }
+
+    public String getDefaultResourceBundleName() {
+        return "com.sun.xml.internal.ws.resources.soap";
+    }
+
+    public Message getFaultMessage() {
+        QName faultCode = (soapVersion == SOAPVersion.SOAP_11)
+            ? SOAPConstants.FAULT_CODE_VERSION_MISMATCH
+            : SOAP12Constants.FAULT_CODE_VERSION_MISMATCH;
+        return SOAPFaultBuilder.createSOAPFaultMessage(
+                soapVersion, getLocalizedMessage(), faultCode);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/client/SOAPMessageDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/client/SOAPMessageDispatcher.java
deleted file mode 100644
index 9e1b960..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/client/SOAPMessageDispatcher.java
+++ /dev/null
@@ -1,1012 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.soap.client;
-
-import com.sun.xml.internal.messaging.saaj.soap.MessageImpl;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.AsyncHandlerService;
-import com.sun.xml.internal.ws.client.ContextMap;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-import com.sun.xml.internal.ws.client.EndpointIFInvocationHandler;
-import com.sun.xml.internal.ws.client.EndpointIFContext;
-import com.sun.xml.internal.ws.client.RequestContext;
-import com.sun.xml.internal.ws.client.ResponseContext;
-import com.sun.xml.internal.ws.client.WSFuture;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import com.sun.xml.internal.ws.client.dispatch.ResponseImpl;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.internal.MessageInfoBase;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.Direction;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.RequestOrResponse;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.handler.SOAPHandlerContext;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.transport.http.client.HttpClientTransportFactory;
-import com.sun.xml.internal.ws.util.Base64Util;
-import com.sun.xml.internal.ws.util.FastInfosetUtil;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPConnectionUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import com.sun.xml.internal.ws.wsdl.parser.BindingOperation;
-import javax.activation.DataHandler;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.ProtocolException;
-import javax.xml.ws.Service;
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-import static javax.xml.ws.BindingProvider.PASSWORD_PROPERTY;
-import static javax.xml.ws.BindingProvider.USERNAME_PROPERTY;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * Client-side SOAP protocol-specific {@link com.sun.pept.protocol.MessageDispatcher}
- *
- * @author WS Development Team
- */
-public class SOAPMessageDispatcher implements MessageDispatcher {
-
-    protected static final int MAX_THREAD_POOL_SIZE = 3;
-
-    protected static final long AWAIT_TERMINATION_TIME = 10L;
-
-    protected ExecutorService executorService;
-
-    private final static String MUST_UNDERSTAND_FAULT_MESSAGE_STRING = "SOAP must understand error";
-
-    /**
-     * Default constructor
-     */
-    public SOAPMessageDispatcher() {
-    }
-
-    /*
-     * Invokes doSendAsync method if the message exchange pattern is asynchronous, otherwise
-     * invokes doSend method.
-     *
-     * @see com.sun.pept.protocol.MessageDispatcher#send(com.sun.pept.ept.MessageInfo)
-     */
-    public void send(MessageInfo messageInfo) {
-        if (isAsync(messageInfo)) {
-            doSendAsync(messageInfo);
-        } else {
-            doSend(messageInfo);
-        }
-    }
-
-    /**
-     * Orchestrates the sending of a synchronous request
-     */
-    protected SOAPMessage doSend(MessageInfo messageInfo) {
-        //change from LogicalEPTFactory to ContactInfoBase - should be changed back when we have things working
-        EPTFactory contactInfo = messageInfo.getEPTFactory();
-        SOAPXMLEncoder encoder = (SOAPXMLEncoder) contactInfo.getEncoder(messageInfo);
-        SOAPMessage sm = null;
-        boolean handlerResult = true;
-        boolean isRequestResponse = (messageInfo.getMEP() == MessageStruct.REQUEST_RESPONSE_MEP);
-
-        try {
-            if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE)
-            {
-                sm = (SOAPMessage) messageInfo.getData()[0];
-                // Ensure supplied message is encoded according to conneg
-                FastInfosetUtil.ensureCorrectEncoding(messageInfo, sm);
-            }
-
-            SOAPHandlerContext handlerContext = null;
-            InternalMessage im = encoder.toInternalMessage(messageInfo);
-
-            HandlerChainCaller caller = getHandlerChainCaller(messageInfo);
-            if (caller.hasHandlers()) {
-                im = preHandlerOutboundHook(sm, im);
-                handlerContext = new SOAPHandlerContext(messageInfo, im, sm);
-
-                //this is needed so that attachments are compied from RESPONSE_MESSAGE_ATTACHMEMTN PROPERTY
-                handlerContext.getMessageContext().put(
-                    MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-
-                encoder.setAttachmentsMap(messageInfo, im);
-                updateMessageContext(messageInfo, handlerContext);
-
-                //now that the MESSAGE_OUTBOUND_PROPERTY is set so populate the attachemnts
-                handlerContext.populateAttachmentMap();
-
-                JAXWSAttachmentMarshaller am = MessageInfoUtil.getAttachmentMarshaller(messageInfo);
-                boolean isXopped = false;
-                //there are handlers so disable Xop encoding if enabled, so that they dont
-                // see xop:Include reference
-                if ((am != null) && am.isXOPPackage()) {
-                    isXopped = am.isXOPPackage();
-                    am.setXOPPackage(false);
-                }
-                handlerResult = callHandlersOnRequest(handlerContext);
-                // now put back the old value
-                if ((am != null)) {
-                    am.setXOPPackage(isXopped);
-                }
-
-                sm = handlerContext.getSOAPMessage();
-                postHandlerOutboundHook(messageInfo, handlerContext, sm);
-                if (sm == null) {
-                    sm = encoder.toSOAPMessage(handlerContext.getInternalMessage(), messageInfo);
-                }
-
-                // the only case where no message is sent
-                if (isRequestResponse && !handlerResult) {
-                    SOAPXMLDecoder decoder = (SOAPXMLDecoder) contactInfo.getDecoder(messageInfo);
-                    im = decoder.toInternalMessage(sm, messageInfo);
-                    decoder.toMessageInfo(im, messageInfo);
-                    return sm;
-                }
-            }
-
-            // Setting encoder here is necessary for calls to getBindingId()
-            messageInfo.setEncoder(encoder);
-
-            SystemHandlerDelegate systemHandlerDelegate =
-                ((com.sun.xml.internal.ws.spi.runtime.Binding) getBinding(messageInfo)).
-                    getSystemHandlerDelegate();
-            if (systemHandlerDelegate != null) {
-                if (handlerContext == null) {
-                    handlerContext = new SOAPHandlerContext(messageInfo, im, sm);
-                    //this is needed so that attachments are compied from RESPONSE_MESSAGE_ATTACHMEMTN PROPERTY
-                    handlerContext.getMessageContext().put(
-                        MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-
-                    //now that the MESSAGE_OUTBOUND_PROPERTY is set so populate the attachemnts
-                    handlerContext.populateAttachmentMap();
-
-                    updateMessageContext(messageInfo, handlerContext);
-                }
-
-                encoder.setAttachmentsMap(messageInfo, im);
-                //already used im, we can set that to null
-                if ((sm != null) && (im != null))
-                    handlerContext.setInternalMessage(null);
-
-
-                handlerContext.getBindingId();
-                systemHandlerDelegate.processRequest(
-                    handlerContext.getSHDSOAPMessageContext());
-                sm = handlerContext.getSOAPMessage();
-            }
-
-            if (sm == null){
-                sm = encoder.toSOAPMessage(im, messageInfo);
-                if (handlerContext == null)
-                    handlerContext = new SOAPHandlerContext(messageInfo, im, sm);
-                updateMessageContext(messageInfo, handlerContext);
-            }
-
-
-            Map<String, Object> context = processMetadata(messageInfo, sm);
-
-            setConnection(messageInfo, context);
-
-            if (!isAsync(messageInfo)) {
-                WSConnection connection = (WSConnection) messageInfo.getConnection();
-
-                logRequestMessage(sm, messageInfo);
-                SOAPConnectionUtil.sendResponse(connection, sm);
-            }
-
-            if (isRequestResponse) {
-                receive(messageInfo);
-            } else if (isOneway(messageInfo)) {
-                checkReturnStatus(messageInfo);
-            }
-        } catch (WebServiceException wse) {
-            setResponseType(wse, messageInfo);
-            messageInfo.setResponse(wse);
-        } catch (Throwable e) {
-            RuntimeException ex = (RuntimeException) e;
-            setResponseType(ex, messageInfo);
-            messageInfo.setResponse(ex);
-        }
-        return sm;
-    }
-
-
-    private boolean isOneway(MessageInfo messageInfo) {
-        return messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP ? true : false;
-    }
-
-    /**
-     * Process and classify the metadata in MIME headers or message context. <String,String> data
-     * is copied into MIME headers and the remaining metadata is passed in message context to the
-     * transport layer.
-     *
-     * @param messageInfo
-     * @param soapMessage
-     */
-    protected Map<String, Object> processMetadata(MessageInfo messageInfo, SOAPMessage soapMessage) {
-        Map<String, Object> messageContext = new HashMap<String, Object>();
-        List<String> header = new ArrayList<String>();
-
-        ContextMap properties = (ContextMap) messageInfo.getMetaData(JAXWS_CONTEXT_PROPERTY);
-
-        if (messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP)
-            messageContext.put(ONE_WAY_OPERATION, "true");
-
-        String soapAction = null;
-        boolean useSoapAction = false;
-
-        // process the properties
-        if (properties != null) {
-            for (Iterator names = properties.getPropertyNames(); names.hasNext();)
-            {
-                String propName = (String) names.next();
-
-                // consume PEPT-specific properties
-                if (propName.equals(ClientTransportFactory.class.getName())) {
-                    messageContext.put(CLIENT_TRANSPORT_FACTORY, (ClientTransportFactory) properties.get(propName));
-                } else if (propName.equals(USERNAME_PROPERTY)) {
-                    String credentials = (String) properties.get(USERNAME_PROPERTY);
-                    if (credentials != null) {
-                        credentials += ":";
-                        String password = (String) properties.get(PASSWORD_PROPERTY);
-                        if (password != null)
-                            credentials += password;
-
-                        try {
-                            credentials = Base64Util.encode(credentials.getBytes());
-                        } catch (Exception ex) {
-                            throw new WebServiceException(ex);
-                        }
-                        soapMessage.getMimeHeaders().addHeader("Authorization", "Basic " + credentials);
-                    }
-                } else
-                if (propName.equals(BindingProvider.SOAPACTION_USE_PROPERTY)) {
-                    useSoapAction = ((Boolean)
-                        properties.get(BindingProvider.SOAPACTION_USE_PROPERTY)).booleanValue();
-                    if (useSoapAction)
-                        soapAction = (String)
-                            properties.get(BindingProvider.SOAPACTION_URI_PROPERTY);
-                } else {
-                    messageContext.put(propName, properties.get(propName));
-                }
-            }
-        }
-
-        // Set accept header depending on content negotiation property
-        String contentNegotiation = (String) messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-
-        String bindingId = getBindingId(messageInfo);
-        if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING) || bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))
-        {
-            soapMessage.getMimeHeaders().setHeader(ACCEPT_PROPERTY,
-                contentNegotiation != "none" ? SOAP12_XML_FI_ACCEPT_VALUE : SOAP12_XML_ACCEPT_VALUE);
-        } else {
-            soapMessage.getMimeHeaders().setHeader(ACCEPT_PROPERTY,
-                contentNegotiation != "none" ? XML_FI_ACCEPT_VALUE : XML_ACCEPT_VALUE);
-        }
-
-        messageContext.put(BINDING_ID_PROPERTY, bindingId);
-
-        // SOAPAction: MIME header
-        RuntimeContext runtimeContext = (RuntimeContext) messageInfo.getMetaData(JAXWS_RUNTIME_CONTEXT);
-        if (runtimeContext != null) {
-            JavaMethod javaMethod = runtimeContext.getModel().getJavaMethod(messageInfo.getMethod());
-            if (javaMethod != null) {
-                soapAction = ((com.sun.xml.internal.ws.model.soap.SOAPBinding) javaMethod.getBinding()).getSOAPAction();
-                header.clear();
-                if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING) || bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))
-                {
-                    if ((soapAction != null) && (soapAction.length() > 0)) {
-                        ((MessageImpl) soapMessage).setAction(soapAction);
-                    }
-                } else {
-                    if (soapAction == null) {
-                        soapMessage.getMimeHeaders().addHeader("SOAPAction", "\"\"");
-                    } else {
-                        soapMessage.getMimeHeaders().addHeader("SOAPAction", "\"" + soapAction + "\"");
-                    }
-                }
-            }
-        } else
-        if (messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT) != null)
-        {
-            //bug fix 6344358
-            header.clear();
-            if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING) || bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING))
-            {
-                if ((soapAction != null) && (soapAction.length() > 0)) {
-                    ((MessageImpl) soapMessage).setAction(soapAction);
-                }
-            } else {
-                if (soapAction == null) {
-                    soapMessage.getMimeHeaders().addHeader("SOAPAction", "\"\"");
-                } else {
-                    soapMessage.getMimeHeaders().addHeader("SOAPAction", "\"" + soapAction + "\"");
-                }
-            }
-        }
-
-        return messageContext;
-    }
-
-    protected void setConnection(MessageInfo messageInfo, Map<String, Object> context) {
-        ClientTransportFactory clientTransportFactory = (ClientTransportFactory) context.get(CLIENT_TRANSPORT_FACTORY);
-        WSConnection connection = null;
-        if (clientTransportFactory == null) {
-            clientTransportFactory = new HttpClientTransportFactory();
-            context.put(CLIENT_TRANSPORT_FACTORY, clientTransportFactory);
-        }
-        connection = clientTransportFactory.create(context);
-        messageInfo.setConnection(connection);
-    }
-
-    protected void setResponseType(Throwable e, MessageInfo messageInfo) {
-        if (e instanceof RuntimeException) {
-            messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-        } else {
-            messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-        }
-        messageInfo.setResponse(e);
-    }
-
-    public void checkReturnStatus(MessageInfo messageInfo) {
-        WSConnection connection = (WSConnection) messageInfo.getConnection();
-        Map<String, List<String>> headers = connection.getHeaders();
-        if (connection.getStatus() != 202 && connection.getStatus() != 200) {
-            Logger.getAnonymousLogger().log(Level.SEVERE, "HTTP status code for oneway: expected 202 or 200, got " + connection.getStatus());
-//            System.out.println("status: "+connection.getStatus());
-        }
-    }
-
-    /*
-    * Orchestrates the receiving of a synchronous response
-    *
-    * @see com.sun.pept.protocol.MessageDispatcher#receive(com.sun.pept.ept.MessageInfo)
-    *
-    * todo: exception handling with possible saaj error below
-    */
-    public void receive(MessageInfo messageInfo) {
-        // change from LogicalEPTFactory to ContactInfoBase - should be changed back when we have things working
-        EPTFactory contactInfo = messageInfo.getEPTFactory();
-        //LogicalEPTFactory contactInfo = (LogicalEPTFactory) messageInfo.getEPTFactory();
-
-        SOAPXMLDecoder decoder = (SOAPXMLDecoder) contactInfo.getDecoder(messageInfo);
-
-
-        SOAPMessage sm = null;
-        try {
-            sm = decoder.toSOAPMessage(messageInfo);
-        } catch (RuntimeException e) {
-            //if there is a transport error HTTP status code and response Headers
-            //need to be populated into messageContext and requestContext
-            //bug 6373688
-            setContexts(messageInfo, sm);
-            throw e;
-        }
-        // Content negotiation logic
-        String contentNegotiationType = (String) messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-        // If XML request
-        if (contentNegotiationType == "pessimistic") {
-            try {
-                if (((com.sun.xml.internal.messaging.saaj.soap.MessageImpl) sm).isFastInfoset())
-                {
-                    Map requestContext = (Map) messageInfo.getMetaData(JAXWS_CONTEXT_PROPERTY);
-                    // Further requests will be send using FI
-                    requestContext.put(CONTENT_NEGOTIATION_PROPERTY, "optimistic");
-                }
-            }
-            catch (ClassCastException e) {
-                // Content negotiation fails
-            }
-        }
-
-        try {
-            logResponseMessage(sm, messageInfo);
-        } catch (Exception ex) {
-            throw new RuntimeException(ex);
-        }
-        SOAPHandlerContext handlerContext = getInboundHandlerContext(messageInfo, sm);
-        WSConnection con = (WSConnection) messageInfo.getConnection();
-        MessageContextUtil.setHttpStatusCode(handlerContext.getMessageContext(),
-            con.getStatus());
-        MessageContextUtil.setHttpResponseHeaders(handlerContext.getMessageContext(),
-            con.getHeaders());
-
-        //set the handlerContext to RuntimeContext
-        RuntimeContext rtContext = MessageInfoUtil.getRuntimeContext(messageInfo);
-        if (rtContext != null)
-            rtContext.setHandlerContext(handlerContext);
-
-        handlerContext.getMessageContext().put(
-            MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.FALSE);
-        //set MESSAGE_ATTACHMENTS property
-        MessageContext msgCtxt = MessageInfoUtil.getMessageContext(messageInfo);
-        if (msgCtxt != null) {
-            try {
-                //clear the attMap on this messageContext, its from request
-                Map<String, DataHandler> attMap = (Map<String, DataHandler>) msgCtxt.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-                if (attMap != null)
-                    attMap.clear();
-                MessageContextUtil.copyInboundMessageAttachments(msgCtxt, sm.getAttachments());
-            } catch (SOAPException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        SystemHandlerDelegate systemHandlerDelegate =
-            ((com.sun.xml.internal.ws.spi.runtime.Binding) getBinding(messageInfo)).
-                getSystemHandlerDelegate();
-        if (systemHandlerDelegate != null) {
-//            handlerContext.getMessageContext().put(
-//                MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.FALSE);
-            try {
-                systemHandlerDelegate.processResponse(handlerContext.getSHDSOAPMessageContext());
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        try {
-            MessageInfoUtil.setHandlerChainCaller(messageInfo,
-                getHandlerChainCaller(messageInfo));
-            decoder.doMustUnderstandProcessing(sm, messageInfo, handlerContext, false);
-        } catch (SOAPException se) { // unusual saaj error
-            throw new RuntimeException(se);
-        } catch (IOException ie) { // unusual saaj error
-            throw new RuntimeException(ie);
-        } catch (SOAPFaultException sfe) {
-            closeAllHandlers(handlerContext);
-            throw sfe;
-        }
-
-        HandlerChainCaller caller = getHandlerChainCaller(messageInfo);
-        if (caller.hasHandlers()) {
-            callHandlersOnResponse(handlerContext);
-            postHandlerInboundHook(messageInfo, handlerContext, sm);
-        }
-
-        SOAPXMLEncoder encoder = (SOAPXMLEncoder) contactInfo.getEncoder(messageInfo);
-
-        InternalMessage im = handlerContext.getInternalMessage();
-        if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE)
-            im = null;
-        if (im == null) {
-            im = decoder.toInternalMessage(sm, messageInfo);
-        } else {
-            im = decoder.toInternalMessage(sm, im, messageInfo);
-        }
-        decoder.toMessageInfo(im, messageInfo);
-        updateResponseContext(messageInfo, handlerContext);
-        if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE)
-        {
-            messageInfo.setResponse(sm);
-            postReceiveAndDecodeHook(messageInfo);
-        }
-    }
-
-    private void setContexts(MessageInfo messageInfo, SOAPMessage sm) {
-        WSConnection con = (WSConnection) messageInfo.getConnection();
-        SOAPHandlerContext handlerContext = getInboundHandlerContext(messageInfo, sm);
-        MessageContextUtil.setHttpStatusCode(handlerContext.getMessageContext(),
-            con.getStatus());
-        updateResponseContext(messageInfo, handlerContext);
-    }
-
-
-    private SOAPHandlerContext getInboundHandlerContext(MessageInfo messageInfo, SOAPMessage sm) {
-        SOAPHandlerContext handlerContext = (SOAPHandlerContext) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY);
-        if (handlerContext != null) {
-            handlerContext.setSOAPMessage(sm);
-            handlerContext.setInternalMessage(null);
-        } else
-            handlerContext = new SOAPHandlerContext(messageInfo, null, sm);
-        return handlerContext;
-    }
-
-    /**
-     * Orchestrates the sending of an asynchronous request
-     */
-    protected void doSendAsync(final MessageInfo messageInfo) {
-        try { // should have already been caught
-            preSendHook(messageInfo);
-            SOAPMessage sm = doSend(messageInfo);
-            postSendHook(messageInfo);
-
-            //pass a copy of MessageInfo to the future task,so that no conflicts
-            //due to threading happens
-            Response r = sendAsyncReceive(MessageInfoBase.copy(messageInfo), sm);
-            if (executorService == null) {
-                executorService =
-                    Executors.newFixedThreadPool(MAX_THREAD_POOL_SIZE, new DaemonThreadFactory());
-            }
-
-            AsyncHandlerService service = (AsyncHandlerService) messageInfo
-                .getMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER);
-            WSFuture wsfuture = null;
-            if (service != null) {
-                wsfuture = service.setupAsyncCallback(r);
-                ((ResponseImpl) r).setUID(service.getUID());
-                ((ResponseImpl) r).setHandlerService(service);
-            }
-
-            executorService.execute((FutureTask) r);
-            if (service == null)
-                messageInfo.setResponse(r);
-            else
-                messageInfo.setResponse(wsfuture);
-        } catch (Throwable e) {
-            messageInfo.setResponse(e);
-        }
-    }
-
-    /**
-     * Orchestrates the receiving of an asynchronous response
-     */
-    protected Response<Object> sendAsyncReceive(final MessageInfo messageInfo, final SOAPMessage sm) {
-
-        final AsyncHandlerService handler = (AsyncHandlerService) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER);
-        final boolean callback = (messageInfo.getMEP() == MessageStruct.ASYNC_CALLBACK_MEP) ? true
-            : false;
-        if (callback && (handler == null))
-            throw new WebServiceException("Asynchronous callback invocation, but no handler - AsyncHandler required");
-
-        final Response r = new ResponseImpl<Object>(new Callable<Object>() {
-
-            public Object call() throws Exception {
-                // get connection and do http.invoke()
-                try {
-                    final WSConnection connection = (WSConnection) messageInfo.getConnection();
-                    logRequestMessage(sm, messageInfo);
-                    SOAPConnectionUtil.sendResponse(connection, sm);
-                } catch (Throwable t) {
-                    messageInfo.setResponse(t);
-                    messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-                }
-                // receive response
-                preReceiveHook(messageInfo);
-                try {
-                    receive(messageInfo);
-                } catch (Exception ex) {
-                    messageInfo.setResponse(ex);
-                }
-                postReceiveHook(messageInfo);
-
-                if (messageInfo.getResponse() instanceof Exception)
-                    throw (Exception) messageInfo.getResponse();
-                return messageInfo.getResponse();
-            }
-        });
-        messageInfo.setMetaData(JAXWS_CLIENT_ASYNC_RESPONSE_CONTEXT, r);
-        return r;
-    }
-
-
-    protected boolean callHandlersOnRequest(SOAPHandlerContext handlerContext) {
-        try {
-            HandlerChainCaller caller = getHandlerChainCaller(handlerContext.getMessageInfo());
-            boolean responseExpected = (handlerContext.getMessageInfo().getMEP() != MessageStruct.ONE_WAY_MEP);
-            return caller.callHandlers(Direction.OUTBOUND, RequestOrResponse.REQUEST, handlerContext,
-                responseExpected);
-        } catch (ProtocolException pe) {
-            if (MessageContextUtil.ignoreFaultInMessage(
-                handlerContext.getMessageContext())) {
-                // Ignore fault in this case and use exception.
-                throw pe;
-            } else
-                return false;
-        } catch (WebServiceException wse) {
-            throw wse;
-        } catch (RuntimeException re) {
-            // handlers are expected to be able to throw RE
-            throw new WebServiceException(re);
-        }
-    }
-
-    /*
-     * User's handler can throw RuntimeExceptions
-     * (e.g., a ProtocolException).
-     * Need to wrap any RuntimeException (other than WebServiceException) in
-     * WebServiceException.
-     */
-    protected boolean callHandlersOnResponse(SOAPHandlerContext handlerContext) {
-        HandlerChainCaller caller =
-            getHandlerChainCaller(handlerContext.getMessageInfo());
-        try {
-            int httpResponseCode = (Integer) handlerContext.getMessageContext().get(
-                    MessageContext.HTTP_RESPONSE_CODE);
-            if(httpResponseCode != 200 && httpResponseCode != 202) {
-                //Check if it is a fault message
-                SOAPMessage sm = handlerContext.getSOAPMessage();
-                if((sm != null) && sm.getSOAPBody().hasFault())
-                    return caller.callHandleFaultOnClient(handlerContext);
-            }
-
-            return caller.callHandlers(Direction.INBOUND,
-                RequestOrResponse.RESPONSE, handlerContext, false);
-        } catch (SOAPException se) {
-            throw new WebServiceException(se);
-        } catch (WebServiceException wse) {
-            throw wse;
-        } catch (RuntimeException re) {
-            // handlers are expected to be able to throw RE
-            throw new WebServiceException(re);
-        }
-    }
-
-    protected Binding getBinding(MessageInfo messageInfo) {
-        ContextMap context = (ContextMap) ((MessageInfoBase) messageInfo)
-            .getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        BindingProvider provider = (BindingProvider) context
-            .get(JAXWS_CLIENT_HANDLE_PROPERTY);
-        return provider.getBinding();
-    }
-
-    protected HandlerChainCaller getHandlerChainCaller(MessageInfo messageInfo) {
-        BindingImpl binding = (BindingImpl) getBinding(messageInfo);
-        return binding.getHandlerChainCaller();
-    }
-
-    private void updateSOAPMessage(Object value, SOAPMessage sm) {
-        try {
-            if (value instanceof Source) {
-                SOAPBody sb = sm.getSOAPPart().getEnvelope().getBody();
-                sb.removeContents();
-                XmlUtil.newTransformer().transform((Source) value, new DOMResult(sb));
-                sm.saveChanges();
-            }
-        } catch (SOAPException e) {
-            throw new RuntimeException(e);
-        } catch (TransformerException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    protected void updateMessageContext(MessageInfo messageInfo, SOAPHandlerContext context) {
-        SOAPMessageContext messageContext = context.getSOAPMessageContext();
-        messageInfo.setMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY, context);
-        RequestContext ctxt = (RequestContext) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        Iterator i = ctxt.copy().getPropertyNames();
-        while (i.hasNext()) {
-            String name = (String) i.next();
-            Object value = ctxt.get(name);
-            messageContext.put(name, value);
-        }
-
-        BindingProvider provider = (BindingProvider) context.getMessageContext()
-            .get(JAXWS_CLIENT_HANDLE_PROPERTY);
-
-        QName portTypeQName = null;
-        if (provider != null) {
-            if (Proxy.isProxyClass(provider.getClass())) {
-
-                EndpointIFInvocationHandler invocationHandler = (EndpointIFInvocationHandler) Proxy.getInvocationHandler(provider);
-                EndpointIFContext endpointContext = invocationHandler.getEndpointContext();
-                portTypeQName = invocationHandler.getWSDLPortTypeQName();
-
-                messageContext.put(MessageContext.WSDL_SERVICE, invocationHandler.getServiceQName());
-                messageContext.put(MessageContext.WSDL_PORT, endpointContext.getPortName());
-
-                context.setBindingId(endpointContext.getBindingID().toString());
-
-                RuntimeContext rtContext = (RuntimeContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-                if (rtContext != null) {   //should never be
-                    RuntimeModel model = rtContext.getModel();
-                    JavaMethod javaMethod = model.getJavaMethod(messageInfo.getMethod());
-                    String opname = javaMethod.getOperationName();
-                    if (portTypeQName != null) {
-                        String tns = portTypeQName.getNamespaceURI();
-                        messageContext.put(MessageContext.WSDL_OPERATION, new QName(tns,opname));
-                    }
-                }
-                //set handlerContext
-                rtContext.setHandlerContext(context);
-            }
-        }
-
-        //now get value for ContentNegotiation
-        Object prop = messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-        if (prop != null) {
-            messageContext.put(CONTENT_NEGOTIATION_PROPERTY, prop);
-        }
-    }
-
-    protected void updateResponseContext(MessageInfo messageInfo,
-                                         SOAPHandlerContext context) {
-        SOAPMessageContext messageContext = context.getSOAPMessageContext();
-        RequestContext rc = (RequestContext) messageInfo.getMetaData(JAXWS_CONTEXT_PROPERTY);
-        BindingProvider provider = (BindingProvider) rc.get(JAXWS_CLIENT_HANDLE_PROPERTY);
-        ResponseContext responseContext = new ResponseContext(provider);
-        for (String name : messageContext.keySet()) {
-            MessageContext.Scope scope = messageContext.getScope(name);
-            if (MessageContext.Scope.APPLICATION == scope) {
-                Object value = messageContext.get(name);
-                responseContext.put(name, value);
-            }
-        }
-        ResponseImpl asyncResponse = (ResponseImpl) messageInfo.getMetaData(
-            JAXWS_CLIENT_ASYNC_RESPONSE_CONTEXT);
-        if (asyncResponse != null) {
-            asyncResponse.setResponseContext(responseContext.copy());
-        } else {
-            messageInfo.setMetaData(JAXWS_RESPONSE_CONTEXT_PROPERTY,
-                responseContext.copy());
-        }
-    }
-
-    /**
-     * @return true if message exchange pattern indicates asynchronous, otherwise returns false
-     */
-    protected boolean isAsync(MessageInfo messageInfo) {
-        if ((messageInfo.getMEP() == MessageStruct.ASYNC_POLL_MEP)
-            || (messageInfo.getMEP() == MessageStruct.ASYNC_CALLBACK_MEP)) {
-            return true;
-        }
-        return false;
-    }
-
-    private void preSendHook(MessageInfo messageInfo) {
-    }
-
-    private void preReceiveHook(MessageInfo messageInfo) {
-    }
-
-    private void postSendHook(MessageInfo messageInfo) {
-        if (messageInfo.getResponseType() != MessageStruct.NORMAL_RESPONSE) {
-            postReceiveHook(messageInfo);
-            throw (WebServiceException) messageInfo.getResponse();
-        }
-    }
-
-    private void postReceiveAndDecodeHook(MessageInfo messageInfo) {
-        DispatchContext dispatchContext = (DispatchContext) messageInfo
-            .getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        if ((messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE)
-            && (dispatchContext.getProperty(DispatchContext.DISPATCH_MESSAGE) == DispatchContext.MessageType.SOURCE_MESSAGE))
-        {
-            Object response = messageInfo.getResponse();
-            if (response instanceof SOAPMessage) {
-                SOAPPart part = ((SOAPMessage) response).getSOAPPart();
-                try {
-                    messageInfo.setResponse(part.getContent());
-                } catch (SOAPException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
-    }
-
-    private void postReceiveHook(MessageInfo messageInfo) {
-        // postReceiveHook exaimines the result for an exception
-        // or SOAPFaultInfo - it will set appropriate
-        // asynchronous exceptions
-        Object response = messageInfo.getResponse();
-        switch (messageInfo.getResponseType()) {
-            case MessageStruct.NORMAL_RESPONSE:
-                // not sure where this belongs yet - but for now-
-                return;
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof SOAPFaultInfo) {
-                    SOAPFaultInfo soapFaultInfo = (SOAPFaultInfo) response;
-                    JAXBException jbe = null;
-                    if (soapFaultInfo.getString().contains("javax.xml.bind")) {
-                        jbe = new JAXBException(soapFaultInfo.getString());
-                        // do I need to put this in a jaxws exception
-                    }
-                    SOAPFaultException sfe = new SOAPFaultException(soapFaultInfo.getSOAPFault());
-                    if (jbe != null)
-                        sfe.initCause(jbe);
-                    messageInfo.setResponse((SOAPFaultException) sfe);
-                }
-                return;
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof SOAPFaultException) {
-                    messageInfo.setResponse((SOAPFaultException) response);
-                } else {
-
-                    if (response instanceof Exception) {
-                        RuntimeException jex = (RuntimeException) response;
-                        messageInfo.setResponse(jex);
-                    }
-                }
-                return;
-            default:
-                messageInfo.setResponse(response);
-        }
-    }
-
-    private InternalMessage preHandlerOutboundHook(SOAPMessage sm, InternalMessage im) {
-        if ((sm != null) && (im != null))
-            im = null;
-        return im;
-    }
-
-    private void postHandlerOutboundHook(MessageInfo messageInfo, SOAPHandlerContext handlerContext, SOAPMessage sm) {
-        if (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE)
-        {
-            InternalMessage im = handlerContext.getInternalMessage();
-            if (im != null) {
-                Object value = im.getBody().getValue();
-                updateSOAPMessage(value, sm);
-                im = null;
-            } else
-                try {
-                    sm.saveChanges();
-                } catch (SOAPException e) {
-                    throw new RuntimeException(e);
-                }
-        }
-    }
-
-    private void postHandlerInboundHook(MessageInfo messageInfo, SOAPHandlerContext handlerContext, SOAPMessage sm) {
-        if ((messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.MESSAGE) ||
-            (messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_MODE) == Service.Mode.PAYLOAD))
-        {
-            InternalMessage im = handlerContext.getInternalMessage();
-            if (im != null) {
-                Object value = im.getBody().getValue();
-                updateSOAPMessage(value, sm);
-                im = null;
-            } else
-                try {
-                    sm.saveChanges();
-                } catch (SOAPException e) {
-                    throw new RuntimeException(e);
-                }
-        }
-    }
-
-
-    private void closeAllHandlers(SOAPHandlerContext context) {
-        HandlerChainCaller caller = getHandlerChainCaller(context.getMessageInfo());
-        if (caller != null && caller.hasHandlers()) {
-            caller.forceCloseHandlersOnClient(context);
-        }
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     *
-     * @return the BindingId associated with messageInfo
-     */
-    protected String getBindingId(MessageInfo messageInfo) {
-        SOAPEncoder encoder = (SOAPEncoder) messageInfo.getEncoder();
-        if (encoder instanceof SOAP12XMLEncoder)
-            return SOAPBinding.SOAP12HTTP_BINDING;
-        else
-            return SOAPBinding.SOAP11HTTP_BINDING;
-    }
-
-    /**
-     * Logs the SOAP request message
-     */
-    protected void logRequestMessage(SOAPMessage soapMessage, MessageInfo messageInfo)
-        throws IOException, SOAPException {
-
-        OutputStream out = ((WSConnection) messageInfo.getConnection()).getDebug();
-
-        if (out != null) {
-            String s = "******************\nRequest\n";
-            out.write(s.getBytes());
-            for (Iterator iter =
-                soapMessage.getMimeHeaders().getAllHeaders();
-                 iter.hasNext();
-                ) {
-                MimeHeader header = (MimeHeader) iter.next();
-                s = header.getName() + ": " + header.getValue() + "\n";
-                out.write(s.getBytes());
-            }
-            out.flush();
-            soapMessage.writeTo(out);
-            s = "\n";
-            out.write(s.getBytes());
-            out.flush();
-        }
-    }
-
-    /**
-     * Logs the SOAP response message
-     */
-    protected void logResponseMessage(SOAPMessage response, MessageInfo messageInfo)
-        throws IOException, SOAPException {
-
-        OutputStream out = ((WSConnection) messageInfo.getConnection()).getDebug();
-        if (out != null) {
-            String s = "Response\n";
-            out.write(s.getBytes());
-            s =
-                "Http Status Code: "
-                    + ((WSConnection) messageInfo.getConnection()).getStatus()
-                    + "\n\n";
-            out.write(s.getBytes());
-            for (Iterator iter =
-                response.getMimeHeaders().getAllHeaders();
-                 iter.hasNext();
-                ) {
-                MimeHeader header = (MimeHeader) iter.next();
-                s = header.getName() + ": " + header.getValue() + "\n";
-                out.write(s.getBytes());
-            }
-            out.flush();
-            response.writeTo(out);
-            s = "******************\n\n";
-            out.write(s.getBytes());
-        }
-    }
-
-    class DaemonThreadFactory implements ThreadFactory {
-        public Thread newThread(Runnable r) {
-            Thread daemonThread = new Thread(r);
-            daemonThread.setDaemon(Boolean.TRUE);
-            return daemonThread;
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/ProviderSOAPMD.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/ProviderSOAPMD.java
deleted file mode 100644
index 17db072..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/ProviderSOAPMD.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.soap.server;
-
-import javax.xml.ws.Service;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.handler.SOAPHandlerContext;
-import com.sun.xml.internal.ws.handler.LogicalMessageImpl;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPUtil;
-import com.sun.xml.internal.ws.util.FastInfosetUtil;
-
-import static com.sun.xml.internal.ws.developer.JAXWSProperties.*;
-import com.sun.xml.internal.ws.server.provider.ProviderModel;
-import com.sun.xml.internal.ws.server.provider.ProviderPeptTie;
-
-public class ProviderSOAPMD extends SOAPMessageDispatcher {
-
-    /*
-     * Fill the parameters, method in MessageInfo for Provider interface.
-     * invoke(Source, HandlerContext) to Object[]
-     * invoke(SOAPMessage, HandlerContext) to Object[]
-     */
-    @Override
-    protected void toMessageInfo(MessageInfo messageInfo, SOAPHandlerContext context) {
-        Object[] data = new Object[1];
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Class providerClass = endpointInfo.getImplementorClass();
-        ProviderModel model = endpointInfo.getProviderModel();
-        boolean isSource = model.isSource();
-        Service.Mode mode = model.getServiceMode();
-
-        if (mode == Service.Mode.PAYLOAD) {
-            if (isSource) {
-                data[0] = new LogicalMessageImpl(context).getPayload();
-            }
-            // else doesn't happen and it is checked while creating the model
-        } else {
-            InternalMessage internalMessage = context.getInternalMessage();
-            SOAPMessage soapMessage = context.getSOAPMessage();
-            try {
-                if (internalMessage != null) {
-                    // SOAPMessage's body is replaced by InternalMessage's BodyBlock
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPEncoder encoder = eptf.getSOAPEncoder();
-                    soapMessage = encoder.toSOAPMessage(internalMessage, soapMessage);
-                }
-                if (isSource) {
-                    // Get SOAPMessage's SOAPPart as Source
-                    data[0]= soapMessage.getSOAPPart().getContent();
-                } else {
-                    data[0] = soapMessage;
-                }
-            } catch(Exception e) {
-                messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-                messageInfo.setResponse(e);
-            }
-        }
-        messageInfo.setData(data);
-        messageInfo.setMethod(ProviderPeptTie.invoke_Method);
-    }
-
-    /*
-     * MessageInfo contains the endpoint invocation results. If the endpoint
-     * returns a SOAPMessage, just set the object in HandlerContext. If the
-     * endpoint returns a Source in Mode.MESSAGE, it is converted to SOAPMessage
-     * and set in HandlerContext. If the endpoint returns a Source in
-     * Mode.PAYLOAD, it is set in InternalMessage, and InternalMessage is set
-     * in HandlerContext
-     */
-    @Override
-    protected void setResponseInContext(MessageInfo messageInfo,
-            SOAPHandlerContext context)
-    {
-        Object obj = messageInfo.getResponse();
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Class providerClass = endpointInfo.getImplementorClass();
-        ProviderModel model = endpointInfo.getProviderModel();
-        Service.Mode mode = model.getServiceMode();
-
-        if (messageInfo.getResponseType() == MessageInfo.NORMAL_RESPONSE &&
-                mode == Service.Mode.MESSAGE) {
-            SOAPMessage soapMessage = null;
-            if (obj instanceof SOAPMessage) {
-                soapMessage = (SOAPMessage)obj;
-            } else {
-                // put Source into SOAPPart of SOAPMessage
-                try {
-                    Source source = (Source)obj;
-                    String bindingId = ((BindingImpl)endpointInfo.getBinding()).getBindingId();
-                    soapMessage = SOAPUtil.createMessage(bindingId);
-                    soapMessage.getSOAPPart().setContent(source);
-                } catch(SOAPException e) {
-                    throw new ServerRtException("soapencoder.err", new Object[]{e});
-                }
-            }
-
-            // Ensure message is encoded according to conneg
-            FastInfosetUtil.ensureCorrectEncoding(messageInfo, soapMessage);
-
-            context.setSOAPMessage(soapMessage);
-            context.setInternalMessage(null);
-        }
-        else {
-            // set Source or any Exception in InternalMessage's BodyBlock
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            InternalEncoder ine = eptf.getInternalEncoder();
-            InternalMessage internalMessage =
-                (InternalMessage)ine.toInternalMessage(messageInfo);
-            // set handler context
-            context.setInternalMessage(internalMessage);
-            context.setSOAPMessage(null);
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/SOAPMessageDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/SOAPMessageDispatcher.java
deleted file mode 100644
index 7eb6b9c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/server/SOAPMessageDispatcher.java
+++ /dev/null
@@ -1,632 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.soap.server;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.presentation.Tie;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPFaultInfo;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.Direction;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.RequestOrResponse;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.handler.SOAPHandlerContext;
-import com.sun.xml.internal.ws.model.soap.SOAPRuntimeModel;
-import com.sun.xml.internal.ws.server.AppMsgContextImpl;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.util.FastInfosetUtil;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.util.SOAPConnectionUtil;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Binding;
-import javax.xml.ws.ProtocolException;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.SOAPFaultException;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-public class SOAPMessageDispatcher implements MessageDispatcher {
-
-    private static final String[] contentTypes = {
-            "text/xml", "application/soap+xml", "application/xop+xml",
-            "application/fastinfoset", "application/soap+fastinfoset" };
-
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.soapmd");
-
-    public SOAPMessageDispatcher() {
-    }
-
-    public void send(MessageInfo messageInfo) {
-        // Not required for server
-        throw new UnsupportedOperationException();
-    }
-
-    public void receive(MessageInfo messageInfo) {
-        // Checks the Content-Type to send unsupported media error
-        try {
-            checkContentType(messageInfo);
-        } catch(ServerRtException e) {
-            SOAPConnectionUtil.sendKnownError(messageInfo,
-                    WSConnection.UNSUPPORTED_MEDIA);
-            return;
-        }
-
-        // Gets request stream from WSConnection and creates SOAP message
-        SOAPMessage soapMessage = null;
-        try {
-            soapMessage = getSOAPMessage(messageInfo);
-        } catch(Exception e) {
-            sendResponseError(messageInfo, e);
-            return;
-        }
-
-        // Set it before response is sent on transport. If transport creates
-        // any exception, this can be used not to send again
-        boolean sent = false;
-        try {
-
-            // Content negotiation logic
-            try {
-                // If FI is accepted by client, set property to optimistic
-                if (((com.sun.xml.internal.messaging.saaj.soap.MessageImpl) soapMessage).acceptFastInfoset()) {
-                    messageInfo.setMetaData(CONTENT_NEGOTIATION_PROPERTY, "optimistic");
-                }
-            }
-            catch (ClassCastException e) {
-                // Content negotiation fails
-            }
-
-            // context holds MessageInfo, InternalMessage, SOAPMessage
-            SOAPHandlerContext context = new SOAPHandlerContext(messageInfo, null,
-                soapMessage);
-            // WebServiceContext's MessageContext is set into HandlerContext
-            updateHandlerContext(messageInfo, context);
-            context.getMessageContext().put(
-                    MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.FALSE);
-            //set MESSAGE_ATTACHMENTS property
-            MessageContext msgCtxt = MessageInfoUtil.getMessageContext(messageInfo);
-            if (msgCtxt != null) {
-                MessageContextUtil.copyInboundMessageAttachments(msgCtxt, soapMessage.getAttachments());
-            }
-            SystemHandlerDelegate shd = getSystemHandlerDelegate(messageInfo);
-            SoapInvoker implementor = new SoapInvoker(messageInfo, soapMessage,
-                context, shd);
-            try {
-                if (shd == null) {
-                    // Invokes request handler chain, endpoint, response handler chain
-                    implementor.invoke();
-                } else {
-                    context.setInvoker(implementor);
-                    if (shd.processRequest(context.getSHDSOAPMessageContext())) {
-                        implementor.invoke();
-                        context.getMessageContext().put(
-                            MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-                        shd.processResponse(context.getSHDSOAPMessageContext());
-                    }
-                }
-            } finally {
-                sent = implementor.isSent();    // response is sent or not
-            }
-            if (!isOneway(messageInfo)) {
-                makeSOAPMessage(messageInfo, context);
-                sent = true;
-                sendResponse(messageInfo, context);
-            } else if (!sent) {
-                // Oneway and request handler chain reversed the execution direction
-                sent = true;
-                sendResponseOneway(messageInfo);
-            }
-        } catch(Exception e) {
-            e.printStackTrace();
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            if (!sent) {
-                sendResponseError(messageInfo, e);
-            }
-        }
-        assert sent;            // Make sure response is sent
-    }
-
-    /*
-     * This decodes the SOAPMessage into InternalMessage. Then InternalMessage
-     * is converted to java method and parameters and populates them into
-     * MessageInfo.
-     *
-     */
-    protected void toMessageInfo(MessageInfo messageInfo, SOAPHandlerContext context) {
-        InternalMessage internalMessage = context.getInternalMessage();
-        try {
-            SOAPMessage soapMessage = context.getSOAPMessage();
-            if (internalMessage == null) {
-                // Bind headers, body from SOAPMessage
-                SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                SOAPDecoder decoder = eptf.getSOAPDecoder();
-                internalMessage = decoder.toInternalMessage(soapMessage, messageInfo);
-            } else {
-                // Bind headers from SOAPMessage
-                SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                SOAPDecoder decoder = eptf.getSOAPDecoder();
-                internalMessage = decoder.toInternalMessage(soapMessage, internalMessage, messageInfo);
-            }
-            //setup JAXWSAttachmentMarshaller for outgoing attachments
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            SOAPEncoder encoder = eptf.getSOAPEncoder();
-            encoder.setAttachmentsMap(messageInfo, internalMessage);
-
-        } catch(Exception e) {
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-            messageInfo.setResponse(e);
-        }
-        // InternalMessage to MessageInfo
-        if (!isFailure(messageInfo)) {
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            eptf.getInternalEncoder().toMessageInfo(internalMessage, messageInfo);
-            Binding binding = MessageInfoUtil.getRuntimeContext(messageInfo).getRuntimeEndpointInfo().getBinding();
-            String bindingId = (binding != null)?((SOAPBindingImpl)binding).getBindingId():SOAPBinding.SOAP11HTTP_BINDING;
-
-            if (messageInfo.getMethod() == null) {
-                messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-                SOAPFaultInfo faultInfo = new SOAPFaultInfo(
-                            "Cannot find dispatch method",
-                            SOAPConstants.FAULT_CODE_SERVER,
-                            null, null, bindingId);
-                messageInfo.setResponse(faultInfo);
-            }
-        }
-    }
-
-    /*
-     * Creates SOAPMessage from the connection's request stream
-     */
-    private SOAPMessage getSOAPMessage(MessageInfo messageInfo) {
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        return SOAPConnectionUtil.getSOAPMessage(con, messageInfo, null);
-    }
-
-    /*
-     * Checks against known Content-Type headers
-     */
-    private void checkContentType(MessageInfo mi) {
-        WSConnection con = (WSConnection)mi.getConnection();
-        Map<String, List<String>> headers = con.getHeaders();
-        List<String> cts = headers.get("Content-Type");
-        if (cts != null && cts.size() > 0) {
-            String ct = cts.get(0);
-            for(String contentType : contentTypes) {
-                if (ct.indexOf(contentType) != -1) {
-                    return;
-                }
-            }
-        }
-        throw new ServerRtException("Incorrect Content-Type="+cts);
-    }
-
-    /*
-     * Sets the WebServiceContext with correct MessageContext which contains
-     * APPLICATION scope properties
-     */
-    protected void updateWebServiceContext(MessageInfo messageInfo, SOAPHandlerContext hc) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        //rtCtxt.setHandlerContext(hc);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-        hc.getMessageContext().put(CONTENT_NEGOTIATION_PROPERTY,
-                messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY));
-        hc.getMessageContext().setScope(CONTENT_NEGOTIATION_PROPERTY, Scope.APPLICATION);
-        if (wsContext != null) {
-            AppMsgContextImpl appCtxt = new AppMsgContextImpl(hc.getMessageContext());
-            wsContext.setMessageContext(appCtxt);
-        }
-    }
-
-    /*
-     * Invokes the endpoint. For Provider endpoints, whether the operation is
-     * oneway or not known only after the endpoint is invoked. ProviderSOAPMD
-     * overrides this and sends the response message on transport for oneway
-     * operations.
-     *
-     * @return true if response is sent on transport
-     */
-    protected void invokeEndpoint(MessageInfo messageInfo, SOAPHandlerContext hc) {
-        TargetFinder targetFinder =
-            messageInfo.getEPTFactory().getTargetFinder(messageInfo);
-        Tie tie = targetFinder.findTarget(messageInfo);
-        tie._invoke(messageInfo);
-    }
-
-    /**
-     * Converts java method parameters, and return value to InternalMessage.
-     * It calls response handlers. At the end, the context has either
-     * InternalMessage or SOAPMessage
-     *
-     */
-    protected void getResponse(MessageInfo messageInfo, SOAPHandlerContext context) {
-        setResponseInContext(messageInfo, context);
-        try {
-            HandlerChainCaller handlerCaller =
-                getCallerFromMessageInfo(messageInfo);
-            if (handlerCaller != null && handlerCaller.hasHandlers()) {
-                int messageType = messageInfo.getResponseType();
-                if (messageType == MessageInfo.CHECKED_EXCEPTION_RESPONSE ||
-                    messageType == MessageInfo.UNCHECKED_EXCEPTION_RESPONSE) {
-
-                    callHandleFault(handlerCaller, context);
-                } else {
-                    //there are handlers so disable Xop encoding if enabled, so that they dont
-                    // see xop:Include reference
-                    JAXWSAttachmentMarshaller am = MessageInfoUtil.getAttachmentMarshaller(messageInfo);
-                    boolean isXopped = false;
-                    if((am != null) && am.isXOPPackage()){
-                        isXopped = am.isXOPPackage();
-                        am.setXOPPackage(false);
-                    }
-                    callHandlersOnResponse(handlerCaller, context);
-                    // now put back the old value
-                    if((am != null)){
-                        am.setXOPPackage(isXopped);
-                    }
-                }
-            }
-        } catch(Exception e) {
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            createInternalMessageForException(messageInfo, e, context);
-        }
-    }
-
-    /*
-     *
-     *
-     *
-     */
-    private boolean createInternalMessageForException(MessageInfo messageInfo,
-            Exception e, SOAPHandlerContext context) {
-        boolean soap12 = false;
-        RuntimeEndpointInfo rei = MessageInfoUtil.getRuntimeContext(
-            messageInfo).getRuntimeEndpointInfo();
-        String id = ((SOAPBindingImpl)rei.getBinding()).getBindingId();
-        InternalMessage internalMessage = null;
-        if (id.equals(SOAPBinding.SOAP11HTTP_BINDING)) {
-            internalMessage = SOAPRuntimeModel.createFaultInBody(
-                e, null, null, null);
-        } else if (id.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
-            internalMessage = SOAPRuntimeModel.createSOAP12FaultInBody(
-                e, null, null, null, null);
-            soap12 = true;
-        }
-        context.setInternalMessage(internalMessage);
-        context.setSOAPMessage(null);
-        return soap12;
-    }
-
-    private void makeSOAPMessage(MessageInfo messageInfo, SOAPHandlerContext context) {
-        InternalMessage internalMessage = context.getInternalMessage();
-        if (internalMessage != null) {
-            SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-            SOAPEncoder encoder = eptf.getSOAPEncoder();
-            SOAPMessage soapMesage = encoder.toSOAPMessage(internalMessage, messageInfo);
-            context.setSOAPMessage(soapMesage);
-            context.setInternalMessage(null);
-        }
-    }
-
-    /*
-     * MessageInfo contains the endpoint invocation results. The information
-     * is converted to InternalMessage or SOAPMessage and set in HandlerContext
-     */
-    protected void setResponseInContext(MessageInfo messageInfo,
-            SOAPHandlerContext context) {
-        // MessageInfo to InternalMessage
-        SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-        InternalMessage internalMessage = (InternalMessage)eptf.getInternalEncoder().toInternalMessage(
-                messageInfo);
-        // set handler context
-        context.setInternalMessage(internalMessage);
-        context.setSOAPMessage(null);
-    }
-
-    /*
-     * Sends SOAPMessage response on the connection
-     */
-    private void sendResponse(MessageInfo messageInfo, SOAPHandlerContext ctxt) {
-        SOAPMessage soapMessage = ctxt.getSOAPMessage();
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        Integer status = MessageContextUtil.getHttpStatusCode(ctxt.getMessageContext());
-        int statusCode = (status == null) ? WSConnection.OK : status;
-        SOAPConnectionUtil.setStatus(con, statusCode);
-        SOAPConnectionUtil.sendResponse(con, soapMessage);
-    }
-
-    protected void sendResponseOneway(MessageInfo messageInfo) {
-        SOAPConnectionUtil.sendResponseOneway(messageInfo);
-    }
-
-    private void sendResponseError(MessageInfo messageInfo, Exception e) {
-        e.printStackTrace();
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        Binding binding = MessageInfoUtil.getRuntimeContext(messageInfo).getRuntimeEndpointInfo().getBinding();
-        String bindingId = ((SOAPBindingImpl)binding).getBindingId();
-        SOAPConnectionUtil.sendResponseError(con, bindingId);
-    }
-
-    /*
-     * Calls inbound handlers. It also calls outbound handlers incase flow is
-     * reversed. If the handler throws a ProtocolException, SOAP message is
-     * already set in the context. Otherwise, it creates InternalMessage,
-     * and that is used to create SOAPMessage.
-     *
-     * returns whether to invoke endpoint or not.
-     */
-    private boolean callHandlersOnRequest(MessageInfo messageInfo,
-        SOAPHandlerContext context, boolean responseExpected) {
-
-        boolean skipEndpoint = false;
-        HandlerChainCaller handlerCaller =
-            getCallerFromMessageInfo(messageInfo);
-
-        if (handlerCaller != null && handlerCaller.hasHandlers()) {
-            try {
-                skipEndpoint = !handlerCaller.callHandlers(Direction.INBOUND,
-                    RequestOrResponse.REQUEST, context, responseExpected);
-            } catch(ProtocolException pe) {
-                skipEndpoint = true;
-                if (MessageContextUtil.ignoreFaultInMessage(
-                    context.getMessageContext())) {
-                    // don't use the fault, use the exception
-                    createInternalMessageForException(messageInfo, pe, context);
-                }
-            } catch(RuntimeException re) {
-                skipEndpoint = true;
-                createInternalMessageForException(messageInfo, re, context);
-            }
-        }
-        return skipEndpoint;
-    }
-
-    private HandlerChainCaller getCallerFromMessageInfo(MessageInfo info) {
-        RuntimeContext context = (RuntimeContext) info.getMetaData(
-                BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        BindingImpl binding = (BindingImpl)context.getRuntimeEndpointInfo().getBinding();
-        if (binding.hasHandlers()) {
-            HandlerChainCaller caller = binding.getHandlerChainCaller();
-            MessageInfoUtil.setHandlerChainCaller(info, caller);
-            return caller;
-        }
-        return null;
-    }
-
-    /**
-     *
-     * Invokes response handler chain
-     */
-    protected boolean callHandlersOnResponse(HandlerChainCaller caller,
-        SOAPHandlerContext context) {
-
-        return caller.callHandlers(Direction.OUTBOUND,
-            RequestOrResponse.RESPONSE, context, false);
-    }
-
-    /**
-     * Used when the endpoint throws an exception. HandleFault is called
-     * on the server handlers rather than handleMessage.
-     */
-    protected boolean  callHandleFault(HandlerChainCaller caller, SOAPHandlerContext context) {
-        return caller.callHandleFault(context);
-    }
-
-    /**
-     * Server does not know if a message is one-way until after
-     * the handler chain has finished processing the request. If
-     * it is a one-way message, have the handler chain caller
-     * call close on the handlers.
-     */
-    private void closeHandlers(MessageInfo info, SOAPHandlerContext context) {
-        HandlerChainCaller handlerCaller = getCallerFromMessageInfo(info);
-        if (handlerCaller != null && handlerCaller.hasHandlers()) {
-            handlerCaller.forceCloseHandlersOnServer(context);
-        }
-    }
-
-    private static boolean isFailure(MessageInfo messageInfo) {
-        return (messageInfo.getResponseType() == MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-    }
-
-    public static boolean isOneway(MessageInfo messageInfo) {
-        return (messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP);
-    }
-
-
-    /**
-     * Sets MessageContext into HandlerContext and sets HandlerContext in
-     * RuntimeContext
-     */
-    private void updateHandlerContext(MessageInfo messageInfo,
-            SOAPHandlerContext context) {
-        MessageInfoUtil.getRuntimeContext(messageInfo).setHandlerContext(context);
-        RuntimeEndpointInfo endpointInfo =
-            MessageInfoUtil.getRuntimeContext(messageInfo).getRuntimeEndpointInfo();
-        context.setBindingId(((BindingImpl)endpointInfo.getBinding()).getActualBindingId());
-        WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-        if (wsContext != null) {
-            context.setMessageContext(wsContext.getMessageContext());
-        }
-    }
-
-    /**
-     * Gets SystemHandlerDelegate from endpoint's Binding
-     */
-    private SystemHandlerDelegate getSystemHandlerDelegate(MessageInfo mi) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        return endpointInfo.getBinding().getSystemHandlerDelegate();
-    }
-
-    /**
-     * Invokes request handler chain, endpoint and response handler chain.
-     * Separated as a separate class, so that SHD can call this in doPriv()
-     * block.
-     */
-    private class SoapInvoker implements Invoker {
-
-        MessageInfo messageInfo;
-        SOAPMessage soapMessage;
-        SOAPHandlerContext context;
-        boolean skipEndpoint;
-        SystemHandlerDelegate shd;
-        boolean sent;
-
-        SoapInvoker(MessageInfo messageInfo, SOAPMessage soapMessage,
-                SOAPHandlerContext context, SystemHandlerDelegate shd) {
-            this.messageInfo = messageInfo;
-            this.soapMessage = soapMessage;
-            this.context = context;
-            this.shd = shd;
-        }
-
-        public void invoke() throws Exception {
-            boolean peekOneWay = false;
-            if (!skipEndpoint) {
-                try {
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPDecoder decoder = eptf.getSOAPDecoder();
-
-                    // add handler chain caller to message info
-                    getCallerFromMessageInfo(messageInfo);
-                    peekOneWay = decoder.doMustUnderstandProcessing(soapMessage,
-                            messageInfo, context, true);
-                    context.setMethod(messageInfo.getMethod());
-                } catch (SOAPFaultException e) {
-                    skipEndpoint = true;
-                    boolean soap12 = createInternalMessageForException(messageInfo, e, context);
-                    SOAPRuntimeModel.addHeaders(context.getInternalMessage(),
-                            messageInfo);
-                }
-            }
-
-            // Call inbound handlers. It also calls outbound handlers incase of
-            // reversal of flow.
-            if (!skipEndpoint) {
-                skipEndpoint = callHandlersOnRequest(
-                    messageInfo, context, !peekOneWay);
-            }
-
-            if (skipEndpoint) {
-                soapMessage = context.getSOAPMessage();
-                if (soapMessage == null) {
-                    InternalMessage internalMessage = context.getInternalMessage();
-                    SOAPEPTFactory eptf = (SOAPEPTFactory)messageInfo.getEPTFactory();
-                    SOAPEncoder encoder = eptf.getSOAPEncoder();
-                    soapMessage = encoder.toSOAPMessage(internalMessage, messageInfo);
-                }
-
-                // Ensure message is encoded according to conneg
-                FastInfosetUtil.ensureCorrectEncoding(messageInfo, soapMessage);
-
-                context.setSOAPMessage(soapMessage);
-                context.setInternalMessage(null);
-            } else {
-                toMessageInfo(messageInfo, context);
-
-                if (isOneway(messageInfo)) {
-                    sent = true;
-                    sendResponseOneway(messageInfo);
-                    if (!peekOneWay) { // handler chain didn't already clos
-                        closeHandlers(messageInfo, context);
-                    }
-                }
-
-                if (!isFailure(messageInfo)) {
-                    if (shd != null) {
-                        shd.preInvokeEndpointHook(context.getSHDSOAPMessageContext());
-                    }
-                    updateWebServiceContext(messageInfo, context);
-                    invokeEndpoint(messageInfo, context);
-                    // For Provider endpoints Oneway is known only after executing endpoint
-                    if (!sent && isOneway(messageInfo)) {
-                        sent = true;
-                        sendResponseOneway(messageInfo);
-                    }
-                    context.getMessageContext().put(
-                        MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-                }
-
-                if (isOneway(messageInfo)) {
-                    if (isFailure(messageInfo)) {
-                        // Just log the error. Not much to do
-                    }
-                } else {
-                    getResponse(messageInfo, context);
-                }
-            }
-        }
-
-        /**
-         * Gets the dispatch method in the endpoint for the payload's QName
-         *
-         * @return dispatch method
-         */
-        public Method getMethod(QName name) {
-            RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-            return rtCtxt.getDispatchMethod(name, messageInfo);
-        }
-
-        /*
-         * Is the message sent on transport. Happens when the operation is oneway
-         *
-         * @return true if the message is sent
-         *        false otherwise
-         */
-        public boolean isSent() {
-            return sent;
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java
index e1ec8b7..f0a0937 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/XMLMessageException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
         super("server.rt.err", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.xmlmessage";
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/client/XMLMessageDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/client/XMLMessageDispatcher.java
deleted file mode 100644
index 489a75c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/client/XMLMessageDispatcher.java
+++ /dev/null
@@ -1,976 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.xml.client;
-
-import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.client.*;
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-import com.sun.xml.internal.ws.client.dispatch.DispatchContext;
-import com.sun.xml.internal.ws.client.dispatch.ResponseImpl;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.MessageInfoBase;
-import com.sun.xml.internal.ws.encoding.xml.XMLEncoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.Direction;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.RequestOrResponse;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.handler.XMLHandlerContext;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.transport.http.client.HttpClientTransportFactory;
-import com.sun.xml.internal.ws.util.Base64Util;
-import com.sun.xml.internal.ws.util.XMLConnectionUtil;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-import javax.activation.DataSource;
-import javax.activation.DataHandler;
-import javax.xml.bind.JAXBContext;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.*;
-import static javax.xml.ws.BindingProvider.PASSWORD_PROPERTY;
-import static javax.xml.ws.BindingProvider.USERNAME_PROPERTY;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.http.HTTPException;
-import javax.xml.ws.soap.SOAPBinding;
-import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * Client-side XML-based message dispatcher {@link com.sun.xml.internal.ws.pept.protocol.MessageDispatcher}
- *
- * @author WS Development Team
- */
-public class XMLMessageDispatcher implements MessageDispatcher {
-
-    protected static final int MAX_THREAD_POOL_SIZE = 3;
-    protected static final long AWAIT_TERMINATION_TIME = 10L;
-
-    protected ExecutorService executorService = null;
-
-
-    /**
-     * Default constructor
-     */
-
-    public XMLMessageDispatcher() {
-    }
-
-    /*
-     * Invokes doSendAsync method if the message exchange pattern is asynchronous, otherwise
-     * invokes doSend method.
-     *
-     * @see com.sun.pept.protocol.MessageDispatcher#send(com.sun.pept.ept.MessageInfo)
-     */
-    public void send(MessageInfo messageInfo) {
-        if (isAsync(messageInfo)) {
-            doSendAsync(messageInfo);
-        } else {
-            doSend(messageInfo);
-        }
-    }
-
-    /**
-     * Orchestrates the sending of a synchronous request
-     */
-    protected XMLMessage doSend(MessageInfo messageInfo) {
-        //change from LogicalEPTFactory to ContactInfoBase - should be changed back when we have things working
-        EPTFactory contactInfo = messageInfo.getEPTFactory();
-        XMLEncoder encoder = (XMLEncoder) contactInfo.getEncoder(messageInfo);
-
-        boolean handlerResult = true;
-        boolean isRequestResponse = (messageInfo.getMEP() == MessageStruct.REQUEST_RESPONSE_MEP);
-
-        DispatchContext dispatchContext = (DispatchContext) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-
-        if (!isHTTPMessageType(dispatchContext)) {
-            throw new WebServiceException("Mode not allowed with HTTP Binding. Must use other Service.mode");
-        }
-
-        XMLMessage xm = makeXMLMessage(messageInfo);
-
-        try {
-            HandlerChainCaller caller = getHandlerChainCaller(messageInfo);
-            if (caller.hasHandlers()) {
-                XMLHandlerContext handlerContext = new XMLHandlerContext(
-                    messageInfo, null, xm);
-                updateMessageContext(messageInfo, handlerContext);
-                handlerResult = callHandlersOnRequest(handlerContext);
-                updateXMLMessage(handlerContext);
-                xm = handlerContext.getXMLMessage();
-                if (xm == null) {
-                    xm = encoder.toXMLMessage(
-                        handlerContext.getInternalMessage(), messageInfo);
-                }
-
-                // the only case where no message is sent
-                if (isRequestResponse && !handlerResult) {
-                    return xm;
-                }
-            }
-
-            // Setting encoder here is necessary for calls to getBindingId()
-//            messageInfo.setEncoder(encoder);
-            Map<String, Object> context = processMetadata(messageInfo, xm);
-
-            // set the MIME headers on connection headers
-            Map<String, List<String>> ch = new HashMap<String, List<String>>();
-            for (Iterator iter = xm.getMimeHeaders().getAllHeaders(); iter.hasNext();)
-            {
-                List<String> h = new ArrayList<String>();
-                MimeHeader mh = (MimeHeader) iter.next();
-
-                h.clear();
-                h.add(mh.getValue());
-                ch.put(mh.getName(), h);
-            }
-
-            setConnection(messageInfo, context);
-            ((WSConnection) messageInfo.getConnection()).setHeaders(ch);
-
-            if (!isAsync(messageInfo)) {
-                WSConnection connection = (WSConnection) messageInfo.getConnection();
-                //logRequestMessage(xm, messageInfo);
-                XMLConnectionUtil.sendResponse(connection, xm);
-            }
-
-            // if handlerResult is false, the receive has already happened
-            if (isRequestResponse && handlerResult) {
-                receive(messageInfo);
-                postReceiveHook(messageInfo);
-            }
-        } catch (Throwable e) {
-            setResponseType(e, messageInfo);
-            messageInfo.setResponse(e);
-        }
-        return xm;
-    }
-
-    /**
-     * Process and classify the metadata in MIME headers or message context. <String,String> data
-     * is copied into MIME headers and the remaining metadata is passed in message context to the
-     * transport layer.
-     *
-     * @param messageInfo
-     * @param xm
-     */
-    protected Map<String, Object> processMetadata(MessageInfo messageInfo, XMLMessage xm) {
-        Map<String, Object> messageContext = new HashMap<String, Object>();
-        List<String> header = new ArrayList<String>();
-
-        ContextMap properties = (ContextMap)
-            messageInfo.getMetaData(JAXWS_CONTEXT_PROPERTY);
-        DispatchContext dcontext = (DispatchContext)
-            messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        if (isHTTPMessageType(dcontext)) {
-            setHTTPContext(messageContext, dcontext, properties);
-        }
-
-        if (messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP)
-            messageContext.put(ONE_WAY_OPERATION, "true");
-
-        // process the properties
-        if (properties != null) {
-            for (Iterator names = properties.getPropertyNames(); names.hasNext();)
-            {
-                String propName = (String) names.next();
-
-                // consume PEPT-specific properties
-                if (propName.equals(ClientTransportFactory.class.getName())) {
-                    messageContext.put(CLIENT_TRANSPORT_FACTORY, (ClientTransportFactory) properties.get(propName));
-                } else if (propName.equals(USERNAME_PROPERTY)) {
-                    String credentials = (String) properties.get(USERNAME_PROPERTY);
-                    if (credentials != null) {
-                        credentials += ":";
-                        String password = (String) properties.get(PASSWORD_PROPERTY);
-                        if (password != null)
-                            credentials += password;
-
-                        try {
-                            credentials = Base64Util.encode(credentials.getBytes());
-                        } catch (Exception ex) {
-                            throw new WebServiceException(ex);
-                        }
-                        xm.getMimeHeaders().addHeader("Authorization", "Basic " + credentials);
-                    }
-                } else
-                if (propName.equals(BindingProvider.SESSION_MAINTAIN_PROPERTY))
-                {
-                    Object maintainSession = properties.get(BindingProvider.SESSION_MAINTAIN_PROPERTY);
-                    if (maintainSession != null && maintainSession.equals(Boolean.TRUE))
-                    {
-                        Object cookieJar = properties.get(HTTP_COOKIE_JAR);
-                        if (cookieJar != null)
-                            messageContext.put(HTTP_COOKIE_JAR, cookieJar);
-                    }
-                } else {
-                    messageContext.put(propName, properties.get(propName));
-                }
-            }
-        }
-
-        // Set accept header depending on content negotiation property
-        String contentNegotiation = (String)
-            messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-
-        String bindingId = getBindingId(messageInfo);
-
-        if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
-            xm.getMimeHeaders().addHeader(ACCEPT_PROPERTY,
-                contentNegotiation != "none" ? SOAP12_XML_FI_ACCEPT_VALUE : SOAP12_XML_ACCEPT_VALUE);
-        } else {
-            xm.getMimeHeaders().addHeader(ACCEPT_PROPERTY,
-                contentNegotiation != "none" ? XML_FI_ACCEPT_VALUE : XML_ACCEPT_VALUE);
-        }
-
-        //setRequestHeaders
-        Map<String, List<String>> requestHeaders = (Map)
-            properties.get(MessageContext.HTTP_REQUEST_HEADERS);
-        //requestHeaders.
-        setMimeHeaders(requestHeaders, xm);
-
-        messageContext.put(BINDING_ID_PROPERTY, bindingId);
-
-        // SOAPAction: MIME header
-        RuntimeContext runtimeContext = (RuntimeContext) messageInfo.getMetaData(JAXWS_RUNTIME_CONTEXT);
-        if (runtimeContext != null) {
-            JavaMethod javaMethod = runtimeContext.getModel().getJavaMethod(messageInfo.getMethod());
-            if (javaMethod != null) {
-                String soapAction = ((com.sun.xml.internal.ws.model.soap.SOAPBinding) javaMethod.getBinding()).getSOAPAction();
-                header.clear();
-                if (soapAction == null) {
-                    xm.getMimeHeaders().addHeader("SOAPAction", "\"\"");
-                } else {
-                    xm.getMimeHeaders().addHeader("SOAPAction", soapAction);
-                }
-            }
-        }
-
-        return messageContext;
-    }
-
-
-
-    protected void setConnection(MessageInfo messageInfo, Map<String, Object> context) {
-        ClientTransportFactory clientTransportFactory = (ClientTransportFactory) context.get(CLIENT_TRANSPORT_FACTORY);
-        WSConnection connection = null;
-        if (clientTransportFactory == null) {
-            clientTransportFactory = new HttpClientTransportFactory();
-        }
-        connection = clientTransportFactory.create(context);
-        messageInfo.setConnection(connection);
-    }
-
-    protected void setResponseType(Throwable e, MessageInfo messageInfo) {
-        //e.printStackTrace();
-        if (e instanceof RuntimeException) {
-            messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-            if (e instanceof ClientTransportException) {
-                Throwable temp = e;
-                e = new WebServiceException(temp.getMessage(), temp);
-            }
-        } else {
-            messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-        }
-        messageInfo.setResponse(e);
-    }
-
-    /*
-     * Orchestrates the receiving of a synchronous response
-     *
-     * @see com.sun.pept.protocol.MessageDispatcher#receive(com.sun.pept.ept.MessageInfo)
-     *
-     * todo: exception handling with possible saaj error below
-     */
-    public void receive(MessageInfo messageInfo) {
-        // change from LogicalEPTFactory to ContactInfoBase - should be changed back when we have things working
-        EPTFactory contactInfo = messageInfo.getEPTFactory();
-
-        XMLMessage xm = getXMLMessage(messageInfo);
-
-        // Content negotiation logic
-        String contentNegotiation = (String) messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-        // If XML request
-        if (contentNegotiation == "pessimistic") {
-            try {
-                if (xm.isFastInfoset()) {
-                    Map requestContext = (Map) messageInfo.getMetaData(JAXWS_CONTEXT_PROPERTY);
-                    // Further requests will be send using FI
-                    requestContext.put(CONTENT_NEGOTIATION_PROPERTY, "optimistic");
-                }
-            }
-            catch (ClassCastException e) {
-                // Content negotiation fails
-            }
-        }
-
-        try {
-            //logResponseMessage(xm, messageInfo);
-        } catch (Exception ex) {
-            throw new WebServiceException(ex);
-        }
-
-        XMLHandlerContext handlerContext =
-            getInboundHandlerContext(messageInfo, xm);
-
-        HandlerChainCaller caller = getHandlerChainCaller(messageInfo);
-        if (caller.hasHandlers()) {
-            callHandlersOnResponse(handlerContext);
-            xm = handlerContext.getXMLMessage();
-        }
-
-        //set messageInfo response with appropriate result
-        //at same time sets ResponseContext
-        setResponse(messageInfo, xm, handlerContext);
-    }
-
-    private void setResponse(MessageInfo messageInfo, XMLMessage xm, HandlerContext handlerContext) {
-
-        Map<String, DataHandler> attachments = getAttachments(handlerContext, xm);
-
-        updateResponseContext(messageInfo, (XMLHandlerContext)handlerContext, attachments);
-
-        DispatchContext dispatchContext = (DispatchContext) messageInfo.getMetaData(BindingProviderProperties.DISPATCH_CONTEXT);
-        DispatchContext.MessageType msgtype = (DispatchContext.MessageType) dispatchContext.getProperty(DispatchContext.DISPATCH_MESSAGE);
-        if (msgtype != null) {
-            switch ((DispatchContext.MessageType) msgtype) {
-                case HTTP_SOURCE_MESSAGE:
-                    messageInfo.setResponse(xm.getSource());
-                    break;
-                case HTTP_SOURCE_PAYLOAD:
-                    messageInfo.setResponse(xm.getSource());
-                    break;
-                case HTTP_JAXB_PAYLOAD:
-                    messageInfo.setResponse(xm.getPayload(getJAXBContext(messageInfo)));
-                    break;
-                case HTTP_DATASOURCE_MESSAGE:
-                    if (xm.getDataSource() != null)
-                        messageInfo.setResponse(xm.getDataSource());
-                    break;
-                default:
-                    throw new WebServiceException("Unknown invocation return object ");
-            }
-        } else {
-            //tbd just assume source for now
-            throw new WebServiceException("Unknown invocation return object");
-        }
-
-    }
-
-    private Map<String, DataHandler> getAttachments(HandlerContext handlerContext, XMLMessage xm) {
-        //are there attachments on the MessageContext properties ? Handlers
-        Map<String, DataHandler> attmc = (Map<String, DataHandler>)
-            handlerContext.getMessageContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
-        //can we get it from XMLMessage as well?
-        Map<String, DataHandler> attxm = xm.getAttachments();
-
-        Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
-        if (attxm != null && attmc != null) {
-            attachments.putAll(attxm);
-            attachments.putAll(attmc);
-        } else if (attxm != null) {
-            attachments.putAll(attxm);
-        } else if (attmc != null)
-            attachments.putAll(attmc);
-        else {
-            attachments = null; //gc it
-            return null;
-        }
-        return attachments;
-    }
-
-    private XMLHandlerContext getInboundHandlerContext(
-        MessageInfo messageInfo, XMLMessage xm) {
-        XMLHandlerContext handlerContext = (XMLHandlerContext) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY);
-        if (handlerContext != null) {
-            handlerContext.setXMLMessage(xm);
-            handlerContext.setInternalMessage(null);
-        } else {
-            handlerContext = new XMLHandlerContext(messageInfo, null, xm);
-        }
-        return handlerContext;
-    }
-
-    /**
-     * Orchestrates the sending of an asynchronous request
-     */
-    protected void doSendAsync(final MessageInfo messageInfo) {
-        try { // should have already been caught
-            preSendHook(messageInfo);
-            XMLMessage xm = doSend(messageInfo);
-            postSendHook(messageInfo);
-
-            //pass a copy of MessageInfo to the future task,so that no conflicts
-            //due to threading happens
-            Response r = sendAsyncReceive(MessageInfoBase.copy(messageInfo), xm);
-            if (executorService == null) {
-                executorService =
-                    Executors.newFixedThreadPool(MAX_THREAD_POOL_SIZE, new DaemonThreadFactory());
-            }
-
-            AsyncHandlerService service = (AsyncHandlerService) messageInfo
-                .getMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER);
-            WSFuture wsfuture = null;
-            if (service != null) {
-                wsfuture = service.setupAsyncCallback(r);
-                ((ResponseImpl) r).setUID(service.getUID());
-                ((ResponseImpl) r).setHandlerService(service);
-            }
-            executorService.execute((FutureTask) r);
-            if (service == null)
-                messageInfo.setResponse(r);
-            else
-                messageInfo.setResponse(wsfuture);
-
-        } catch (Throwable e) {
-            messageInfo.setResponse(e);
-        }
-    }
-
-    /**
-     * Orchestrates the receiving of an asynchronous response
-     */
-    protected Response<Object> sendAsyncReceive(final MessageInfo messageInfo, final XMLMessage xm) {
-
-        final AsyncHandlerService handler = (AsyncHandlerService) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_CLIENT_ASYNC_HANDLER);
-        final boolean callback = (messageInfo.getMEP() == MessageStruct.ASYNC_CALLBACK_MEP) ? true
-            : false;
-        if (callback && (handler == null))
-            throw new WebServiceException("Asynchronous callback invocation, but no handler - AsyncHandler required");
-
-        final Response r = new ResponseImpl<Object>(new Callable<Object>() {
-
-            public Object call() throws Exception {
-                // get connection and do http.invoke()
-                try {
-                    final WSConnection connection = (WSConnection) messageInfo.getConnection();
-                    //logRequestMessage(xm, messageInfo);
-                    XMLConnectionUtil.sendResponse(connection, xm);
-                } catch (Throwable t) {
-                    messageInfo.setResponse(t);
-                    messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-                }
-                // receive response
-                preReceiveHook(messageInfo);
-                try {
-                    receive(messageInfo);
-                } catch (Exception ex) {
-                    messageInfo.setResponse(ex);
-                }
-                postReceiveHook(messageInfo);
-
-                if (messageInfo.getResponse() instanceof Exception)
-                    throw (Exception) messageInfo.getResponse();
-                return messageInfo.getResponse();
-            }
-        });
-        messageInfo.setMetaData(JAXWS_CLIENT_ASYNC_RESPONSE_CONTEXT, r);
-        return r;
-    }
-
-    protected boolean callHandlersOnRequest(XMLHandlerContext handlerContext) {
-
-        HandlerChainCaller caller = getHandlerChainCaller(
-            handlerContext.getMessageInfo());
-        boolean responseExpected = (handlerContext.getMessageInfo().getMEP() !=
-            MessageStruct.ONE_WAY_MEP);
-        try {
-            return caller.callHandlers(Direction.OUTBOUND,
-                RequestOrResponse.REQUEST, handlerContext, responseExpected);
-        } catch (ProtocolException pe) {
-            if (MessageContextUtil.ignoreFaultInMessage(
-                handlerContext.getMessageContext())) {
-                // Ignore fault in this case and use exception.
-                throw pe;
-            } else
-                return false;
-        } catch (WebServiceException wse) {
-            throw wse;
-        } catch (RuntimeException re) {
-            // handlers are expected to be able to throw RE
-            throw new WebServiceException(re);
-        }
-    }
-
-    /*
-    * User's handler can throw a RuntimeExceptions
-    * (e.g., a ProtocolException).
-    * Need to wrap any RuntimeException (other than WebServiceException) in
-    * WebServiceException.
-    */
-    protected boolean callHandlersOnResponse(XMLHandlerContext handlerContext) {
-        HandlerChainCaller caller = getHandlerChainCaller(
-            handlerContext.getMessageInfo());
-        try {
-            return caller.callHandlers(Direction.INBOUND,
-                RequestOrResponse.RESPONSE, handlerContext, false);
-        } catch (WebServiceException wse) {
-            throw wse;
-        } catch (RuntimeException re) {
-            // handlers are expected to be able to throw RE
-            throw new WebServiceException(re);
-        }
-    }
-
-    protected Binding getBinding(MessageInfo messageInfo) {
-        ContextMap context = (ContextMap) ((MessageInfoBase) messageInfo)
-            .getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        BindingProvider provider = (BindingProvider) context
-            .get(BindingProviderProperties.JAXWS_CLIENT_HANDLE_PROPERTY);
-        return provider.getBinding();
-    }
-
-    protected HandlerChainCaller getHandlerChainCaller(MessageInfo messageInfo) {
-        BindingImpl binding = (BindingImpl) getBinding(messageInfo);
-        return binding.getHandlerChainCaller();
-    }
-
-    protected void updateMessageContext(MessageInfo messageInfo,
-                                        XMLHandlerContext context) {
-
-        MessageContext messageContext = context.getMessageContext();
-        messageInfo.setMetaData(
-            BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY, context);
-        RequestContext ctxt = (RequestContext) messageInfo
-            .getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        Iterator i = ctxt.copy().getPropertyNames();
-        while (i.hasNext()) {
-            String name = (String) i.next();
-            Object value = ctxt.get(name);
-            messageContext.put(name, value);
-        }
-    }
-
-    protected void updateResponseContext(MessageInfo messageInfo,
-                                         XMLHandlerContext context, Map<String, DataHandler> attachments) {
-
-
-        MessageContext messageContext = context.getMessageContext();
-        BindingProvider provider = (BindingProvider)
-            messageContext.get(JAXWS_CLIENT_HANDLE_PROPERTY);
-        ResponseContext responseContext = new ResponseContext(provider);
-        for (String name : messageContext.keySet()) {
-            MessageContext.Scope scope = messageContext.getScope(name);
-            if (MessageContext.Scope.APPLICATION == scope) {
-                Object value = messageContext.get(name);
-                responseContext.put(name, value);
-            }
-        }
-
-        //let's update status code
-        MessageContext mc =  context.getMessageContext();
-        WSConnection con = messageInfo.getConnection();
-        Map<String, List<String>> headers = con.getHeaders();
-
-        responseContext.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
-        responseContext.put(MessageContext.HTTP_RESPONSE_CODE, con.getStatus());
-
-        //attachments for ResponseContext
-        if (attachments != null)
-           responseContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, attachments);
-
-        ResponseImpl asyncResponse = (ResponseImpl) messageInfo.getMetaData(
-            JAXWS_CLIENT_ASYNC_RESPONSE_CONTEXT);
-        if (asyncResponse != null) {
-            asyncResponse.setResponseContext(responseContext.copy());
-        } else {
-            messageInfo.setMetaData(JAXWS_RESPONSE_CONTEXT_PROPERTY,
-                responseContext.copy());
-        }
-    }
-
-    /**
-     * @return true if message exchange pattern indicates asynchronous, otherwise returns false
-     */
-    protected boolean isAsync(MessageInfo messageInfo) {
-        if ((messageInfo.getMEP() == MessageStruct.ASYNC_POLL_MEP)
-            || (messageInfo.getMEP() == MessageStruct.ASYNC_CALLBACK_MEP)) {
-            return true;
-        }
-        return false;
-    }
-
-    private void preSendHook(MessageInfo messageInfo) {
-    }
-
-    private void preReceiveHook(MessageInfo messageInfo) {
-    }
-
-    private void postSendHook(MessageInfo messageInfo) {
-        if (messageInfo.getResponseType() != MessageStruct.NORMAL_RESPONSE) {
-            postReceiveHook(messageInfo);
-            throw (WebServiceException) messageInfo.getResponse();
-        }
-    }
-
-    private void postReceiveAndDecodeHook(MessageInfo messageInfo) {
-    }
-
-    private void postReceiveHook(MessageInfo messageInfo) {
-
-        if (messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP)
-            return;
-        Object response = messageInfo.getResponse();
-        if (response instanceof StreamSource) {
-            InputStream is = ((StreamSource) response).getInputStream();
-
-            Transformer transformer = XmlUtil.newTransformer();
-            try {
-                ByteArrayOutputStream out = new ByteArrayOutputStream(is.available());
-                if (out.size() > 0) {
-                    transformer.transform((StreamSource) response,
-                        new StreamResult(out));
-                    byte[] bytes = out.toByteArray();
-                    //could do to string
-                    if (new String(bytes).indexOf("HTTPException") > -1)
-                        throw new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
-                    else {
-                        InputStream bis = new ByteArrayInputStream(bytes);
-                        messageInfo.setResponse(new StreamSource(bis));
-                    }
-                }
-            } catch (TransformerException e) {
-                throw new WebServiceException(e);
-            } catch (IOException e) {
-                throw new WebServiceException(e);
-            }
-        }
-        switch (messageInfo.getResponseType()) {
-            case MessageStruct.NORMAL_RESPONSE:
-                // not sure where this belongs yet - but for now-
-                return;
-            case MessageStruct.CHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof Exception) {
-                    throw new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
-                }
-                return;
-            case MessageStruct.UNCHECKED_EXCEPTION_RESPONSE:
-                if (response instanceof ProtocolException) {
-                    throw new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
-                } else {
-                    WebServiceException jex = null;
-                    if (response instanceof Exception) {
-                        throw new WebServiceException((Exception) response);
-                    }
-                    messageInfo.setResponse(response);
-                }
-                return;
-            default:
-                messageInfo.setResponse(response);
-        }
-    }
-
-    private void closeAllHandlers(XMLHandlerContext context) {
-        HandlerChainCaller caller = getHandlerChainCaller(
-            context.getMessageInfo());
-        if (caller != null && caller.hasHandlers()) {
-            caller.forceCloseHandlersOnClient(context);
-        }
-    }
-
-    /**
-     * This method is used to create the appropriate SOAPMessage (1.1 or 1.2 using SAAJ api).
-     *
-     * @return the BindingId associated with messageInfo
-     */
-    protected String getBindingId(MessageInfo messageInfo) {
-        SOAPEncoder encoder = (SOAPEncoder) messageInfo.getEncoder();
-        if (encoder instanceof SOAPXMLEncoder)
-            return SOAPBinding.SOAP11HTTP_BINDING;
-        else if (encoder instanceof SOAP12XMLEncoder)
-            return SOAPBinding.SOAP12HTTP_BINDING;
-        else
-            return HTTPBinding.HTTP_BINDING;
-    }
-
-    /**
-     * Logs the SOAP request message
-     */
-    protected void logRequestMessage(XMLMessage request, MessageInfo messageInfo)
-        throws IOException, MessagingException, TransformerException {
-
-        OutputStream out = ((WSConnection) messageInfo.getConnection()).getDebug();
-
-        if (out != null) {
-            String s = "******************\nRequest\n";
-            out.write(s.getBytes());
-            for (Iterator iter =
-                request.getMimeHeaders().getAllHeaders();
-                 iter.hasNext();
-                ) {
-                MimeHeader header = (MimeHeader) iter.next();
-                s = header.getName() + ": " + header.getValue() + "\n";
-                out.write(s.getBytes());
-            }
-            out.flush();
-            request.writeTo(out);
-            s = "\n";
-            out.write(s.getBytes());
-            out.flush();
-        }
-    }
-
-    /**
-     * Logs the SOAP response message
-     */
-    protected void logResponseMessage(XMLMessage response, MessageInfo messageInfo)
-        throws IOException, MessagingException, TransformerException {
-
-        OutputStream out = ((WSConnection) messageInfo.getConnection()).getDebug();
-
-        if (out != null) {
-            String s = "Response\n";
-            out.write(s.getBytes());
-            s =
-                "Http Status Code: "
-                    + ((WSConnection) messageInfo.getConnection()).getStatus()
-                    + "\n\n";
-            out.write(s.getBytes());
-            for (Iterator iter =
-                response.getMimeHeaders().getAllHeaders();
-                 iter.hasNext();
-                ) {
-                MimeHeader header = (MimeHeader) iter.next();
-                s = header.getName() + ": " + header.getValue() + "\n";
-                out.write(s.getBytes());
-            }
-            out.flush();
-            response.writeTo(out);
-            s = "******************\n\n";
-            out.write(s.getBytes());
-        }
-    }
-
-    /*
-    * Gets XMLMessage from the connection
-    */
-    private XMLMessage getXMLMessage(MessageInfo messageInfo) {
-        WSConnection con = (WSConnection) messageInfo.getConnection();
-        return XMLConnectionUtil.getXMLMessage(con, messageInfo);
-    }
-
-    protected JAXBContext getJAXBContext(MessageInfo messageInfo) {
-        JAXBContext jc = null;
-        RequestContext context = (RequestContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        if (context != null)
-            jc = (JAXBContext) context.get(BindingProviderProperties.JAXB_CONTEXT_PROPERTY);
-
-        return jc;
-    }
-
-    public void setHTTPContext(Map<String, Object> messageContext, DispatchContext dispatchContext, Map requestContext) {
-
-        if (requestContext.get(MessageContext.HTTP_REQUEST_METHOD) != null)
-            messageContext.put(MessageContext.HTTP_REQUEST_METHOD, requestContext.get(MessageContext.HTTP_REQUEST_METHOD));
-        if (requestContext.get(MessageContext.HTTP_REQUEST_HEADERS) != null)
-            messageContext.put(MessageContext.HTTP_REQUEST_HEADERS, requestContext.get(MessageContext.HTTP_REQUEST_HEADERS));
-
-        //resolve endpoint look for query parameters, pathInfo
-        String origEndpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
-
-        String pathInfo = null;
-        String queryString = null;
-        if (requestContext.get(MessageContext.PATH_INFO) != null) {
-            pathInfo = (String) requestContext.get(MessageContext.PATH_INFO);
-        }
-        if (requestContext.get(MessageContext.QUERY_STRING) != null) {
-            queryString = (String) requestContext.get(MessageContext.QUERY_STRING);
-        }
-
-        String resolvedEndpoint = null;
-        if (pathInfo != null || queryString != null) {
-            pathInfo = checkPath(pathInfo);
-            queryString = checkQuery(queryString);
-            if (origEndpoint != null) {
-                try {
-                    URI endpointURI = new URI(origEndpoint);
-                    resolvedEndpoint = resolveURI(endpointURI, pathInfo, queryString);
-                } catch (URISyntaxException e) {
-                    resolvedEndpoint = origEndpoint;
-                }
-            }
-
-            requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, resolvedEndpoint);
-            messageContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, resolvedEndpoint);
-        }
-    }
-
-    protected String resolveURI(URI endpointURI, String pathInfo, String queryString) {
-        String query = null;
-        String fragment = null;
-        if (queryString != null) {
-            URI result = endpointURI.resolve(queryString);
-            query = result.getQuery();
-            fragment = result.getFragment();
-        }
-        //String path = (pathInfo != null) ? endpointURI.getPath() + pathInfo : endpointURI.getPath();
-        String path = (pathInfo != null) ? pathInfo : endpointURI.getPath();
-        try {
-            URI temp = new URI(null, null, path, query, fragment);
-            return endpointURI.resolve(temp).toString();
-        } catch (URISyntaxException e) {
-            e.printStackTrace();
-        }
-        return endpointURI.toString();
-    }
-
-    private String checkPath(String path) {
-        //does it begin with /
-        return (path == null || path.startsWith("/")) ? path : "/" + path;
-    }
-
-    private String checkQuery(String query) {
-        //does it begin with ?
-        return (query == null || query.startsWith("?")) ? query : "?" + query;
-    }
-
-    protected boolean isHTTPMessageType(DispatchContext dispatchContext) {
-
-        DispatchContext.MessageType type = (DispatchContext.MessageType)
-            dispatchContext.getProperty(DispatchContext.DISPATCH_MESSAGE);
-
-        if ((type == DispatchContext.MessageType.HTTP_DATASOURCE_MESSAGE) ||
-            //(type == DispatchContext.MessageType.HTTP_DATASOURCE_PAYLOAD) ||
-            (type == DispatchContext.MessageType.HTTP_SOURCE_MESSAGE) ||
-            (type == DispatchContext.MessageType.HTTP_SOURCE_PAYLOAD) ||
-            //(type == DispatchContext.MessageType.HTTP_JAXB_MESSAGE) ||
-            (type == DispatchContext.MessageType.HTTP_JAXB_PAYLOAD))
-            return true;
-
-        return false;
-    }
-
-    protected XMLMessage makeXMLMessage
-        (MessageInfo
-            messageInfo) {
-
-        XMLMessage xm = null;
-
-        Class clazz = (Class)
-            messageInfo.getMetaData(DispatchContext.DISPATCH_MESSAGE_CLASS);
-
-        Map<String, Object> context = (Map<String, Object>)
-            messageInfo.getMetaData(BindingProviderProperties.JAXWS_CONTEXT_PROPERTY);
-        Map<String, DataHandler> attachments = (context != null) ?
-            (Map<String, DataHandler> )context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) : null;
-
-        // Determine if Fast Infoset is to be used
-        boolean useFastInfoset =
-            (messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic");
-
-        Object object = messageInfo.getData()[0];
-
-        if (clazz != null && clazz.isAssignableFrom(Source.class)) {
-            //xm = new XMLMessage((Source) object, useFastInfoset);
-            xm = new XMLMessage((Source) object, attachments, useFastInfoset);
-        } else if (clazz != null && clazz.isAssignableFrom(DataSource.class)) {
-            xm = new XMLMessage((DataSource) object, useFastInfoset);
-        } else {
-            xm = new XMLMessage(object, getJAXBContext(messageInfo), attachments, useFastInfoset);
-            //xm = new XMLMessage(object, getJAXBContext(messageInfo), useFastInfoset);
-        }
-
-        return xm;
-    }
-
-     private void setMimeHeaders(Map<String, List<String>> requestHeaders, XMLMessage xm) {
-
-        if ((requestHeaders != null) && (!requestHeaders.isEmpty())) {
-            Set<Map.Entry<String, List<String>>> headerSet = requestHeaders.entrySet();
-            Iterator<Map.Entry<String, List<String>>> iter = headerSet.iterator();
-            while (iter.hasNext()) {
-                Map.Entry<String,List<String>> entry =iter.next();
-                MimeHeaders headers = xm.getMimeHeaders();
-                String[] values = entry.getValue().toArray(new String[entry.getValue().size()] );;
-                StringBuffer buf = new StringBuffer(250);
-                if (values.length > 0)
-                   buf.append(values[0]);
-                else break;
-                for (int i = 1; i < values.length - 1; i++){
-                    buf.append(values[i]);
-                }
-
-                headers.addHeader(entry.getKey(), buf.toString());
-            }
-        }
-    }
-
-    private XMLMessage updateXMLMessage(XMLHandlerContext context) {
-    // Create a new XMLMessage from existing message and OUTBOUND attachments property
-        MessageContext msgCtxt = context.getMessageContext();
-        Map<String, DataHandler> atts = (Map<String, DataHandler>)msgCtxt.get(
-                MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-        if (atts != null) {
-            XMLMessage xmlMessage = context.getXMLMessage();
-            if (xmlMessage != null) {
-                Map<String, DataHandler> allAtts = xmlMessage.getAttachments();
-                if (allAtts != null) {
-                    allAtts.putAll(atts);
-                } else {
-                    allAtts = atts;
-                }
-                context.setXMLMessage(new XMLMessage(xmlMessage.getSource(), allAtts,
-                    xmlMessage.isFastInfoset()));
-            } else {
-                //can I make a message w/o src
-            }
-
-        }
-        return context.getXMLMessage();
-    }
-
-
-    class DaemonThreadFactory implements ThreadFactory {
-        public Thread newThread(Runnable r) {
-            Thread daemonThread = new Thread(r);
-            daemonThread.setDaemon(Boolean.TRUE);
-            return daemonThread;
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/ProviderXMLMD.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/ProviderXMLMD.java
deleted file mode 100644
index 5254777..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/ProviderXMLMD.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.xml.server;
-
-import com.sun.xml.internal.ws.server.provider.ProviderModel;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.transform.Source;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-import com.sun.xml.internal.ws.handler.XMLHandlerContext;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.server.provider.ProviderPeptTie;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import javax.activation.DataSource;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
-
-/**
- * @author WS Development Team
- *
- */
-
-public class ProviderXMLMD extends XMLMessageDispatcher {
-
-    /*
-     * Fill the parameters, method in MessageInfo for Provider interface.
-     * invoke(Source, XMLHandlerContext) to Object[]
-     * invoke(SOAPMessage, XMLHandlerContext) to Object[]
-     */
-    @Override
-    protected void toMessageInfo(MessageInfo messageInfo, XMLHandlerContext context) {
-        Object[] data = new Object[1];
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Provider provider = (Provider)endpointInfo.getImplementor();
-        Class providerClass = provider.getClass();
-        ProviderModel model = endpointInfo.getProviderModel();
-        boolean isSource = model.isSource();
-        Service.Mode mode = model.getServiceMode();
-        XMLMessage xmlMessage = context.getXMLMessage();
-        try {
-            if (isSource) {
-                data[0] = xmlMessage.getSource();
-            } else {
-                data[0] = xmlMessage.getDataSource();
-            }
-        } catch(Exception e) {
-            messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-            messageInfo.setResponse(e);
-        }
-        messageInfo.setData(data);
-        messageInfo.setMethod(ProviderPeptTie.invoke_Method);
-    }
-
-    /*
-     * MessageInfo contains the endpoint invocation results. If the endpoint
-     * returns a SOAPMessage, just set the object in HandlerContext. If the
-     * endpoint returns a Source in Mode.MESSAGE, it is converted to SOAPMessage
-     * and set in HandlerContext. If the endpoint returns a Source in
-     * Mode.PAYLOAD, it is set in InternalMessage, and InternalMessage is set
-     * in HandlerContext
-     */
-    @Override
-    protected void setResponseInContext(MessageInfo messageInfo,
-            XMLHandlerContext context) {
-        Object obj = messageInfo.getResponse();
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Provider provider = (Provider)endpointInfo.getImplementor();
-        Class providerClass = provider.getClass();
-
-        boolean useFastInfoset =
-            messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic";
-
-        XMLMessage xmlMessage = null;
-        if (messageInfo.getResponseType() == MessageInfo.NORMAL_RESPONSE) {
-            xmlMessage = (obj instanceof DataSource)
-                ? new XMLMessage((DataSource)obj, useFastInfoset)
-                : new XMLMessage((Source)obj, useFastInfoset);
-        } else {
-            xmlMessage = new XMLMessage((Exception)obj, useFastInfoset);
-        }
-        context.setXMLMessage(xmlMessage);
-        context.setInternalMessage(null);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/XMLMessageDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/XMLMessageDispatcher.java
deleted file mode 100644
index ec7fd59..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/xml/server/XMLMessageDispatcher.java
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.protocol.xml.server;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.presentation.Tie;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.Direction;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller.RequestOrResponse;
-import com.sun.xml.internal.ws.handler.XMLHandlerContext;
-import com.sun.xml.internal.ws.server.provider.ProviderModel;
-import com.sun.xml.internal.ws.server.provider.ProviderPeptTie;
-import com.sun.xml.internal.ws.spi.runtime.Invoker;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.ws.Binding;
-import javax.xml.ws.handler.MessageContext;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import com.sun.xml.internal.ws.server.*;
-import com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.util.XMLConnectionUtil;
-import javax.xml.ws.handler.MessageContext.Scope;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-/**
- * @author WS Development Team
- *
- */
-public abstract class XMLMessageDispatcher implements MessageDispatcher {
-
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.xmlmd");
-
-    public XMLMessageDispatcher() {
-    }
-
-    public void send(MessageInfo messageInfo) {
-        // Not required for server
-        throw new UnsupportedOperationException();
-    }
-
-    // TODO: need to work the exception logic
-    public void receive(MessageInfo messageInfo) {
-        XMLMessage xmlMessage = null;
-        try {
-            xmlMessage = getXMLMessage(messageInfo);
-        } catch(Exception e) {
-            sendResponseError(messageInfo, e);
-            return;
-        }
-        // Set it before response is sent on transport. If transport creates
-        // any exception, this can be used not to send again
-        boolean sent = false;
-        try {
-
-            // If FI is accepted by client, set property to optimistic
-            if (xmlMessage.acceptFastInfoset()) {
-                messageInfo.setMetaData(CONTENT_NEGOTIATION_PROPERTY, "optimistic");
-            }
-
-            XMLHandlerContext context = new XMLHandlerContext(messageInfo, null,
-                xmlMessage);
-            updateHandlerContext(messageInfo, context);
-
-
-            SystemHandlerDelegate shd = getSystemHandlerDelegate(messageInfo);
-            XmlInvoker implementor = new XmlInvoker(messageInfo, xmlMessage,
-                context, shd);
-            try {
-                if (shd == null) {
-                    // Invokes request handler chain, endpoint, response handler chain
-                    implementor.invoke();
-                } else {
-                    context.setInvoker(implementor);
-                    if (shd.processRequest(context.getSHDXMLMessageContext())) {
-                        implementor.invoke();
-                        context.getMessageContext().put(
-                            MessageContext.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-                        shd.processResponse(context.getSHDXMLMessageContext());
-                    }
-                }
-            } finally {
-                sent = implementor.isSent();    // response is sent or not
-            }
-            if (!isOneway(messageInfo)) {
-                sent = true;
-                sendResponse(messageInfo, context);
-            } else if (!sent) {
-                // Oneway and request handler chain reversed the execution direction
-                sent = true;
-                sendResponseOneway(messageInfo);
-            }
-        } catch(Exception e) {
-            e.printStackTrace();
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            if (!sent) {
-                sendResponseError(messageInfo, e);
-            }
-        }
-        assert sent;            // Make sure response is sent
-    }
-
-    protected abstract void toMessageInfo(MessageInfo messageInfo, XMLHandlerContext context);
-
-    /*
-     * Gets XMLMessage from the connection
-     */
-    private XMLMessage getXMLMessage(MessageInfo messageInfo) {
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        return XMLConnectionUtil.getXMLMessage(con, messageInfo);
-    }
-
-    /**
-     * Invokes the endpoint
-     *
-     * In this case, Oneway is known only after invoking the endpoint. For other
-     * endpoints, the HTTP response code is sent before invoking the endpoint.
-     * This is taken care here after invoking the endpoint.
-     */
-    private void invokeEndpoint(MessageInfo messageInfo, XMLHandlerContext hc) {
-        TargetFinder targetFinder =
-            messageInfo.getEPTFactory().getTargetFinder(messageInfo);
-        Tie tie = targetFinder.findTarget(messageInfo);
-        tie._invoke(messageInfo);
-    }
-
-    protected XMLMessage getResponse(MessageInfo messageInfo, XMLHandlerContext context) {
-        setResponseInContext(messageInfo, context);
-        try {
-            HandlerChainCaller handlerCaller =
-                getCallerFromMessageInfo(messageInfo);
-            if (handlerCaller != null && handlerCaller.hasHandlers()) {
-                int messageType = messageInfo.getResponseType();
-                if (messageType == MessageInfo.CHECKED_EXCEPTION_RESPONSE ||
-                    messageType == MessageInfo.UNCHECKED_EXCEPTION_RESPONSE) {
-
-                    callHandleFault(handlerCaller, context);
-                } else {
-                    callHandlersOnResponse(handlerCaller, context);
-                }
-            }
-        } catch(Exception e) {
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            boolean useFastInfoset =
-                messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic";
-            XMLMessage xmlMessage = new XMLMessage(e, useFastInfoset);
-            context.setXMLMessage(xmlMessage);
-        }
-        // Create a new XMLMessage from existing message and OUTBOUND attachments property
-        MessageContext msgCtxt = context.getMessageContext();
-        Map<String, DataHandler> atts = (Map<String, DataHandler>)msgCtxt.get(
-                MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
-        if (atts != null) {
-            XMLMessage xmlMessage = context.getXMLMessage();
-            Map<String, DataHandler> allAtts = xmlMessage.getAttachments();
-            if (allAtts != null) {
-                allAtts.putAll(atts);
-            } else {
-                allAtts = atts;
-            }
-            xmlMessage = new XMLMessage(xmlMessage.getSource(), allAtts,
-                    xmlMessage.isFastInfoset());
-            context.setXMLMessage(xmlMessage);
-        }
-        return context.getXMLMessage();
-    }
-
-    /*
-     * MessageInfo contains the endpoint invocation results. The information
-     * is converted to XMLMessage and is set in HandlerContext
-     */
-    protected abstract void setResponseInContext(MessageInfo messageInfo,
-            XMLHandlerContext context);
-
-    /**
-     * Sends XMLMessage response on the connection
-     */
-    private void sendResponse(MessageInfo messageInfo, XMLHandlerContext ctxt)
-    throws IOException {
-        XMLMessage xmlMessage = ctxt.getXMLMessage();
-        MessageContext msgCtxt = ctxt.getMessageContext();
-        WSConnection con = messageInfo.getConnection();
-
-        // See if MessageContext.HTTP_STATUS_CODE is present
-        Integer status = MessageContextUtil.getHttpStatusCode(msgCtxt);
-        int statusCode = (status == null) ? xmlMessage.getStatus() : status;
-
-
-        Map<String, List<String>> headers = new HashMap<String, List<String>>();
-
-        // put all headers from MessageContext.HTTP_RESPONSE_HEADERS
-        Map<String, List<String>> ctxtHdrs = MessageContextUtil.getHttpResponseHeaders(msgCtxt);
-        if (ctxtHdrs != null) {
-            headers.putAll(ctxtHdrs);
-        }
-        // put all headers from XMLMessage
-        MimeHeaders mhs = xmlMessage.getMimeHeaders();
-        Iterator i = mhs.getAllHeaders();
-        while (i.hasNext()) {
-            MimeHeader mh = (MimeHeader) i.next();
-            String name = mh.getName();
-            List<String> values = headers.get(name);
-            if (values == null) {
-                values = new ArrayList<String>();
-                headers.put(name, values);
-            }
-            values.add(mh.getValue());
-        }
-
-        // Set HTTP status code
-        con.setStatus(statusCode);
-        // put response headers on the connection
-        con.setHeaders(headers);
-        // Write contents on the connection
-        xmlMessage.writeTo(con.getOutput());
-        con.closeOutput();
-    }
-
-    protected void sendResponseOneway(MessageInfo messageInfo) {
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        XMLConnectionUtil.sendResponseOneway(con);
-    }
-
-    private void sendResponseError(MessageInfo messageInfo, Exception e) {
-        logger.log(Level.SEVERE, e.getMessage(), e);
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        XMLConnectionUtil.sendResponseError(con, messageInfo);
-    }
-
-
-
-    /**
-     * Calls inbound handlers. It also calls outbound handlers incase flow is
-     * reversed. If the handler throws a ProtocolException, SOAP message is
-     * already set in the context. Otherwise, it creates InternalMessage,
-     * and that is used to create SOAPMessage.
-     *
-     * returns whether to invoke endpoint or not.
-     */
-    private boolean callHandlersOnRequest(MessageInfo messageInfo,
-        XMLHandlerContext context, boolean responseExpected) {
-
-        boolean skipEndpoint = false;
-        HandlerChainCaller handlerCaller =
-            getCallerFromMessageInfo(messageInfo);
-
-        if (handlerCaller != null && handlerCaller.hasHandlers()) {
-            skipEndpoint = !handlerCaller.callHandlers(Direction.INBOUND,
-                RequestOrResponse.REQUEST, context, responseExpected);
-        }
-        return skipEndpoint;
-    }
-
-    /**
-     * Use this to find out if handlers are there in the execution path or not
-     *
-     * @return true if there are handlers in execution path
-     *         falst otherwise
-     */
-    private boolean hasHandlers(MessageInfo messageInfo) {
-        HandlerChainCaller handlerCaller =
-            getCallerFromMessageInfo(messageInfo);
-        return (handlerCaller != null && handlerCaller.hasHandlers()) ? true : false;
-    }
-
-    private HandlerChainCaller getCallerFromMessageInfo(MessageInfo info) {
-        HandlerChainCaller caller = MessageInfoUtil.getHandlerChainCaller(info);
-        if (caller == null) {
-            RuntimeContext context = (RuntimeContext)
-                info.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-            Binding binding = context.getRuntimeEndpointInfo().getBinding();
-            caller = new HandlerChainCaller(binding.getHandlerChain());
-            MessageInfoUtil.setHandlerChainCaller(info, caller);
-        }
-        return caller;
-    }
-
-    protected boolean callHandlersOnResponse(HandlerChainCaller caller,
-        XMLHandlerContext context) {
-
-        return caller.callHandlers(Direction.OUTBOUND,
-            RequestOrResponse.RESPONSE, context, false);
-    }
-
-    /*
-     * Used when the endpoint throws an exception. HandleFault is called
-     * on the server handlers rather than handleMessage.
-     */
-    protected boolean  callHandleFault(HandlerChainCaller caller, XMLHandlerContext context) {
-        /*
-        return caller.callHandleFault(context);
-         */
-        return false;
-    }
-
-    /*
-     * Server does not know if a message is one-way until after
-     * the handler chain has finished processing the request. If
-     * it is a one-way message, have the handler chain caller
-     * call close on the handlers.
-     */
-    private void closeHandlers(MessageInfo info, XMLHandlerContext context) {
-        HandlerChainCaller handlerCaller = getCallerFromMessageInfo(info);
-        if (handlerCaller != null && handlerCaller.hasHandlers()) {
-            handlerCaller.forceCloseHandlersOnServer(context);
-        }
-    }
-
-    private static boolean isFailure(MessageInfo messageInfo) {
-        return (messageInfo.getResponseType() == MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-    }
-
-    public static boolean isOneway(MessageInfo messageInfo) {
-        return (messageInfo.getMEP() == MessageStruct.ONE_WAY_MEP);
-    }
-
-    /*
-     * Sets the WebServiceContext with correct MessageContext which contains
-     * APPLICATION scope properties
-     */
-    protected void updateWebServiceContext(MessageInfo messageInfo, XMLHandlerContext hc) {
-        RuntimeEndpointInfo endpointInfo =
-            MessageInfoUtil.getRuntimeContext(messageInfo).getRuntimeEndpointInfo();
-        WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-        if (wsContext != null) {
-            AppMsgContextImpl appCtxt = new AppMsgContextImpl(hc.getMessageContext());
-            wsContext.setMessageContext(appCtxt);
-        }
-    }
-
-    /**
-     * copy from message info to handler context
-     */
-    private void updateHandlerContext(MessageInfo messageInfo,
-            XMLHandlerContext context) {
-
-        RuntimeEndpointInfo endpointInfo =
-            MessageInfoUtil.getRuntimeContext(messageInfo).getRuntimeEndpointInfo();
-        WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-        if (wsContext != null) {
-            context.setMessageContext(wsContext.getMessageContext());
-        }
-    }
-
-    private SystemHandlerDelegate getSystemHandlerDelegate(MessageInfo mi) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        return endpointInfo.getBinding().getSystemHandlerDelegate();
-    }
-
-    /**
-     * This breaks the XMLMessage into source and attachments. A new XMLMessage
-     * is created with source and is set in XMLHandlerContext. The attachments
-     * are set in MessageContext as INBOUND attachments.
-     */
-    private void setInboundAttachments(MessageInfo messageInfo, XMLHandlerContext context) {
-        if (hasHandlers(messageInfo)) {
-            XMLMessage xmlMessage = context.getXMLMessage();
-            Map<String, DataHandler> atts = xmlMessage.getAttachments();
-            if (atts != null) {
-                MessageContext msgCtxt = context.getMessageContext();
-                msgCtxt.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, atts);
-                msgCtxt.setScope(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, MessageContext.Scope.APPLICATION);
-                xmlMessage = new XMLMessage(xmlMessage.getSource(), xmlMessage.isFastInfoset());
-                context.setXMLMessage(xmlMessage);
-            }
-        }
-    }
-
-    /**
-     * This creates a new XMLMessage from existing source and inbound attachments.
-     * inbound attachements cannot be there if there are no handlers.
-     * If the endpoint is Provider<Source>, it doesn't create a new message.
-     */
-    private void processInboundAttachments(MessageInfo messageInfo, XMLHandlerContext context) {
-        if (hasHandlers(messageInfo)) {
-            RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-            RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-            ProviderModel model = endpointInfo.getProviderModel();
-            boolean isSource = model.isSource();
-            if (!isSource) {
-                XMLMessage xmlMessage = context.getXMLMessage();
-                MessageContext msgCtxt = context.getMessageContext();
-                Map<String, DataHandler> atts = (Map<String, DataHandler>)
-                    msgCtxt.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
-                xmlMessage = new XMLMessage(xmlMessage.getSource(), atts, xmlMessage.isFastInfoset());
-                context.setXMLMessage(xmlMessage);
-            }
-        }
-    }
-
-    /**
-     * Invokes request handler chain, endpoint and response handler chain.
-     * Separated as a separate class, so that SHD can call this in doPriv()
-     * block.
-     */
-    private class XmlInvoker implements Invoker {
-
-        MessageInfo messageInfo;
-        XMLMessage xmlMessage;
-        XMLHandlerContext context;
-        SystemHandlerDelegate shd;
-        boolean sent;
-
-        XmlInvoker(MessageInfo messageInfo, XMLMessage xmlMessage,
-                XMLHandlerContext context, SystemHandlerDelegate shd) {
-            this.messageInfo = messageInfo;
-            this.xmlMessage = xmlMessage;
-            this.context = context;
-            this.shd = shd;
-        }
-
-        public void invoke() throws Exception {
-            boolean skipEndpoint = false;
-
-            // Sets INBOUND_MESSAGE_ATTACHMENTS in MessageContext
-            setInboundAttachments(messageInfo, context);
-            // Call inbound handlers. It also calls outbound handlers incase of
-            // reversal of flow.
-            skipEndpoint = callHandlersOnRequest(messageInfo, context, true);
-
-            if (!skipEndpoint) {
-                // new XMLMessage is created using INBOUND_MESSAGE_ATTACHMENTS
-                // in MessageContext
-                processInboundAttachments(messageInfo, context);
-                toMessageInfo(messageInfo, context);
-                if (!isFailure(messageInfo)) {
-                    if (shd != null) {
-                        shd.preInvokeEndpointHook(context.getSHDXMLMessageContext());
-                    }
-                    updateWebServiceContext(messageInfo, context);
-                    invokeEndpoint(messageInfo, context);
-                     // For Provider endpoints Oneway is known only after executing endpoint
-                    if (!sent && isOneway(messageInfo)) {
-                        sent = true;
-                        sendResponseOneway(messageInfo);
-                    }
-                }
-
-                if (isOneway(messageInfo)) {
-                    if (isFailure(messageInfo)) {
-                        // Just log the error. Not much to do
-                    }
-                } else {
-                    updateHandlerContext(messageInfo, context);
-                    xmlMessage = getResponse(messageInfo, context);
-                    context.setXMLMessage(xmlMessage);
-                }
-            }
-        }
-
-        /**
-         * Gets the dispatch method in the endpoint for the payload's QName
-         *
-         * @return dispatch method
-         */
-        public Method getMethod(QName name) {
-            return ProviderPeptTie.invoke_Method;
-        }
-
-        /*
-         * Is the message sent on transport. Happens when the operation is oneway
-         *
-         * @return true if the message is sent
-         *        false otherwise
-         */
-        public boolean isSent() {
-            return sent;
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/AddressingMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/AddressingMessages.java
new file mode 100644
index 0000000..26f60cc
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/AddressingMessages.java
@@ -0,0 +1,341 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class AddressingMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.addressing");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableNON_ANONYMOUS_RESPONSE_ONEWAY() {
+        return messageFactory.getMessage("nonAnonymous.response.oneway");
+    }
+
+    /**
+     * Ignoring non-anonymous response for one-way message
+     *
+     */
+    public static String NON_ANONYMOUS_RESPONSE_ONEWAY() {
+        return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_ONEWAY());
+    }
+
+    public static Localizable localizableNULL_WSA_HEADERS() {
+        return messageFactory.getMessage("null.wsa.headers");
+    }
+
+    /**
+     * No WS-Addressing headers found processing the server inbound request
+     *
+     */
+    public static String NULL_WSA_HEADERS() {
+        return localizer.localize(localizableNULL_WSA_HEADERS());
+    }
+
+    public static Localizable localizableUNKNOWN_WSA_HEADER() {
+        return messageFactory.getMessage("unknown.wsa.header");
+    }
+
+    /**
+     * Unknown WS-Addressing header
+     *
+     */
+    public static String UNKNOWN_WSA_HEADER() {
+        return localizer.localize(localizableUNKNOWN_WSA_HEADER());
+    }
+
+    public static Localizable localizableNULL_ACTION() {
+        return messageFactory.getMessage("null.action");
+    }
+
+    /**
+     * Populating request Addressing headers and found null Action
+     *
+     */
+    public static String NULL_ACTION() {
+        return localizer.localize(localizableNULL_ACTION());
+    }
+
+    public static Localizable localizableINVALID_WSAW_ANONYMOUS(Object arg0) {
+        return messageFactory.getMessage("invalid.wsaw.anonymous", arg0);
+    }
+
+    /**
+     * Invalid value obtained from wsaw:Anonymous: "{0}"
+     *
+     */
+    public static String INVALID_WSAW_ANONYMOUS(Object arg0) {
+        return localizer.localize(localizableINVALID_WSAW_ANONYMOUS(arg0));
+    }
+
+    public static Localizable localizableNULL_SOAP_VERSION() {
+        return messageFactory.getMessage("null.soap.version");
+    }
+
+    /**
+     * Unexpected null SOAP version
+     *
+     */
+    public static String NULL_SOAP_VERSION() {
+        return localizer.localize(localizableNULL_SOAP_VERSION());
+    }
+
+    public static Localizable localizableWSDL_BOUND_OPERATION_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("wsdlBoundOperation.notFound", arg0);
+    }
+
+    /**
+     * Cannot find an operation in wsdl:binding for "{0}"
+     *
+     */
+    public static String WSDL_BOUND_OPERATION_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWSDL_BOUND_OPERATION_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableNON_ANONYMOUS_RESPONSE() {
+        return messageFactory.getMessage("nonAnonymous.response");
+    }
+
+    /**
+     * Sending 202 and processing non-anonymous response
+     *
+     */
+    public static String NON_ANONYMOUS_RESPONSE() {
+        return localizer.localize(localizableNON_ANONYMOUS_RESPONSE());
+    }
+
+    public static Localizable localizableVALIDATION_SERVER_NULL_ACTION() {
+        return messageFactory.getMessage("validation.server.nullAction");
+    }
+
+    /**
+     * Validating inbound Addressing headers on server and found null Action
+     *
+     */
+    public static String VALIDATION_SERVER_NULL_ACTION() {
+        return localizer.localize(localizableVALIDATION_SERVER_NULL_ACTION());
+    }
+
+    public static Localizable localizableFAULT_TO_CANNOT_PARSE() {
+        return messageFactory.getMessage("faultTo.cannot.parse");
+    }
+
+    /**
+     * FaultTo header cannot be parsed
+     *
+     */
+    public static String FAULT_TO_CANNOT_PARSE() {
+        return localizer.localize(localizableFAULT_TO_CANNOT_PARSE());
+    }
+
+    public static Localizable localizableVALIDATION_CLIENT_NULL_ACTION() {
+        return messageFactory.getMessage("validation.client.nullAction");
+    }
+
+    /**
+     * Validating inbound Addressing headers on client and found null Action
+     *
+     */
+    public static String VALIDATION_CLIENT_NULL_ACTION() {
+        return localizer.localize(localizableVALIDATION_CLIENT_NULL_ACTION());
+    }
+
+    public static Localizable localizableNULL_MESSAGE() {
+        return messageFactory.getMessage("null.message");
+    }
+
+    /**
+     * Null message found when processing the server inbound request and WS-Addressing is required
+     *
+     */
+    public static String NULL_MESSAGE() {
+        return localizer.localize(localizableNULL_MESSAGE());
+    }
+
+    public static Localizable localizableNON_ANONYMOUS_RESPONSE_NULL_HEADERS(Object arg0) {
+        return messageFactory.getMessage("nonAnonymous.response.nullHeaders", arg0);
+    }
+
+    /**
+     * No response headers found in non-anonymous response from "{0}"
+     *
+     */
+    public static String NON_ANONYMOUS_RESPONSE_NULL_HEADERS(Object arg0) {
+        return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_NULL_HEADERS(arg0));
+    }
+
+    public static Localizable localizableNON_ANONYMOUS_RESPONSE_SENDING(Object arg0) {
+        return messageFactory.getMessage("nonAnonymous.response.sending", arg0);
+    }
+
+    /**
+     * Sending non-anonymous reply to "{0}"
+     *
+     */
+    public static String NON_ANONYMOUS_RESPONSE_SENDING(Object arg0) {
+        return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_SENDING(arg0));
+    }
+
+    public static Localizable localizableREPLY_TO_CANNOT_PARSE() {
+        return messageFactory.getMessage("replyTo.cannot.parse");
+    }
+
+    /**
+     * ReplyTo header cannot be parsed
+     *
+     */
+    public static String REPLY_TO_CANNOT_PARSE() {
+        return localizer.localize(localizableREPLY_TO_CANNOT_PARSE());
+    }
+
+    public static Localizable localizableWSAW_ANONYMOUS_PROHIBITED() {
+        return messageFactory.getMessage("wsaw.anonymousProhibited");
+    }
+
+    /**
+     * Operation has "prohibited" value for wsaw:anonymous in the WSDL, Addressing must be disabled and SOAP message need to be hand-crafted
+     *
+     */
+    public static String WSAW_ANONYMOUS_PROHIBITED() {
+        return localizer.localize(localizableWSAW_ANONYMOUS_PROHIBITED());
+    }
+
+    public static Localizable localizableNULL_WSDL_PORT() {
+        return messageFactory.getMessage("null.wsdlPort");
+    }
+
+    /**
+     * Populating request Addressing headers and found null WSDLPort
+     *
+     */
+    public static String NULL_WSDL_PORT() {
+        return localizer.localize(localizableNULL_WSDL_PORT());
+    }
+
+    public static Localizable localizableNULL_ADDRESSING_VERSION() {
+        return messageFactory.getMessage("null.addressing.version");
+    }
+
+    /**
+     * Unexpected null Addressing version
+     *
+     */
+    public static String NULL_ADDRESSING_VERSION() {
+        return localizer.localize(localizableNULL_ADDRESSING_VERSION());
+    }
+
+    public static Localizable localizableNULL_PACKET() {
+        return messageFactory.getMessage("null.packet");
+    }
+
+    /**
+     * Populating request Addressing headers and found null Packet
+     *
+     */
+    public static String NULL_PACKET() {
+        return localizer.localize(localizableNULL_PACKET());
+    }
+
+    public static Localizable localizableWRONG_ADDRESSING_VERSION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("wrong.addressing.version", arg0, arg1);
+    }
+
+    /**
+     * Expected "{0}" version of WS-Addressing but found "{1}"
+     *
+     */
+    public static String WRONG_ADDRESSING_VERSION(Object arg0, Object arg1) {
+        return localizer.localize(localizableWRONG_ADDRESSING_VERSION(arg0, arg1));
+    }
+
+    public static Localizable localizableADDRESSING_NOT_ENABLED(Object arg0) {
+        return messageFactory.getMessage("addressing.notEnabled", arg0);
+    }
+
+    /**
+     * Addressing is not enabled, {0} should not be included in the pipeline"
+     *
+     */
+    public static String ADDRESSING_NOT_ENABLED(Object arg0) {
+        return localizer.localize(localizableADDRESSING_NOT_ENABLED(arg0));
+    }
+
+    public static Localizable localizableNON_ANONYMOUS_UNKNOWN_PROTOCOL(Object arg0) {
+        return messageFactory.getMessage("nonAnonymous.unknown.protocol", arg0);
+    }
+
+    /**
+     * Unknown protocol: "{0}"
+     *
+     */
+    public static String NON_ANONYMOUS_UNKNOWN_PROTOCOL(Object arg0) {
+        return localizer.localize(localizableNON_ANONYMOUS_UNKNOWN_PROTOCOL(arg0));
+    }
+
+    public static Localizable localizableNON_ANONYMOUS_RESPONSE_NULL_MESSAGE(Object arg0) {
+        return messageFactory.getMessage("nonAnonymous.response.nullMessage", arg0);
+    }
+
+    /**
+     * No message for non-anonymous response from "{0}"
+     *
+     */
+    public static String NON_ANONYMOUS_RESPONSE_NULL_MESSAGE(Object arg0) {
+        return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_NULL_MESSAGE(arg0));
+    }
+
+    public static Localizable localizableNULL_HEADERS() {
+        return messageFactory.getMessage("null.headers");
+    }
+
+    /**
+     * No headers found when processing the server inbound request and WS-Addressing is required
+     *
+     */
+    public static String NULL_HEADERS() {
+        return localizer.localize(localizableNULL_HEADERS());
+    }
+
+    public static Localizable localizableNULL_BINDING() {
+        return messageFactory.getMessage("null.binding");
+    }
+
+    /**
+     * Populating request Addressing headers and found null Binding
+     *
+     */
+    public static String NULL_BINDING() {
+        return localizer.localize(localizableNULL_BINDING());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ClientMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ClientMessages.java
new file mode 100644
index 0000000..cb6c43a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ClientMessages.java
@@ -0,0 +1,369 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ClientMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.client");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableFAILED_TO_PARSE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("failed.to.parse", arg0, arg1);
+    }
+
+    /**
+     * Failed to access the WSDL at: {0}. It failed with:
+     *  {1}.
+     *
+     */
+    public static String FAILED_TO_PARSE(Object arg0, Object arg1) {
+        return localizer.localize(localizableFAILED_TO_PARSE(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_BINDING_ID(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.binding.id", arg0, arg1);
+    }
+
+    /**
+     * Invalid binding id: {0}. Must be: {1}
+     *
+     */
+    public static String INVALID_BINDING_ID(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_BINDING_ID(arg0, arg1));
+    }
+
+    public static Localizable localizableEPR_WITHOUT_ADDRESSING_ON() {
+        return messageFactory.getMessage("epr.without.addressing.on");
+    }
+
+    /**
+     * EPR is specified without enabling WS-Addressing support.
+     *
+     */
+    public static String EPR_WITHOUT_ADDRESSING_ON() {
+        return localizer.localize(localizableEPR_WITHOUT_ADDRESSING_ON());
+    }
+
+    public static Localizable localizableINVALID_SERVICE_NO_WSDL(Object arg0) {
+        return messageFactory.getMessage("invalid.service.no.wsdl", arg0);
+    }
+
+    /**
+     * No wsdl metadata for service: {0}, can't create proxy! Try creating Service by providing a WSDL URL
+     *
+     */
+    public static String INVALID_SERVICE_NO_WSDL(Object arg0) {
+        return localizer.localize(localizableINVALID_SERVICE_NO_WSDL(arg0));
+    }
+
+    public static Localizable localizableINVALID_SOAP_ROLE_NONE() {
+        return messageFactory.getMessage("invalid.soap.role.none");
+    }
+
+    /**
+     * Cannot set SOAP 1.2 role "none"
+     *
+     */
+    public static String INVALID_SOAP_ROLE_NONE() {
+        return localizer.localize(localizableINVALID_SOAP_ROLE_NONE());
+    }
+
+    public static Localizable localizableUNDEFINED_BINDING(Object arg0) {
+        return messageFactory.getMessage("undefined.binding", arg0);
+    }
+
+    /**
+     * Undefined binding: {0}
+     *
+     */
+    public static String UNDEFINED_BINDING(Object arg0) {
+        return localizer.localize(localizableUNDEFINED_BINDING(arg0));
+    }
+
+    public static Localizable localizableHTTP_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("http.not.found", arg0);
+    }
+
+    /**
+     * HTTP Status-Code 404: Not Found - {0}
+     *
+     */
+    public static String HTTP_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableHTTP_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableHTTP_CLIENT_CANNOT_CONNECT(Object arg0) {
+        return messageFactory.getMessage("http.client.cannot.connect", arg0);
+    }
+
+    /**
+     * cannot connect to server: {0}
+     *
+     */
+    public static String HTTP_CLIENT_CANNOT_CONNECT(Object arg0) {
+        return localizer.localize(localizableHTTP_CLIENT_CANNOT_CONNECT(arg0));
+    }
+
+    public static Localizable localizableINVALID_EPR_PORT_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.epr.port.name", arg0, arg1);
+    }
+
+    /**
+     * Endpoint Name specified in EPR {0}  is not a WSDL port QName, valid Ports are {1}
+     *
+     */
+    public static String INVALID_EPR_PORT_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_EPR_PORT_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableFAILED_TO_PARSE_WITH_MEX(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("failed.to.parseWithMEX", arg0, arg1, arg2);
+    }
+
+    /**
+     * Failed to access the WSDL at: {0}. It failed with:
+     *  {1}.
+     * Retrying with MEX gave:
+     *  {2}
+     *
+     */
+    public static String FAILED_TO_PARSE_WITH_MEX(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableFAILED_TO_PARSE_WITH_MEX(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableHTTP_STATUS_CODE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("http.status.code", arg0, arg1);
+    }
+
+    /**
+     * The server sent HTTP status code {0}: {1}
+     *
+     */
+    public static String HTTP_STATUS_CODE(Object arg0, Object arg1) {
+        return localizer.localize(localizableHTTP_STATUS_CODE(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_ADDRESS(Object arg0) {
+        return messageFactory.getMessage("invalid.address", arg0);
+    }
+
+    /**
+     * Invalid address: {0}
+     *
+     */
+    public static String INVALID_ADDRESS(Object arg0) {
+        return localizer.localize(localizableINVALID_ADDRESS(arg0));
+    }
+
+    public static Localizable localizableUNDEFINED_PORT_TYPE(Object arg0) {
+        return messageFactory.getMessage("undefined.portType", arg0);
+    }
+
+    /**
+     * Undefined port type: {0}
+     *
+     */
+    public static String UNDEFINED_PORT_TYPE(Object arg0) {
+        return localizer.localize(localizableUNDEFINED_PORT_TYPE(arg0));
+    }
+
+    public static Localizable localizableINVALID_SOAP_ACTION() {
+        return messageFactory.getMessage("invalid.soap.action");
+    }
+
+    /**
+     * A valid SOAPAction should be set in the RequestContext when Addressing is enabled, Use BindingProvider.SOAPACTION_URI_PROPERTY to set it.
+     *
+     */
+    public static String INVALID_SOAP_ACTION() {
+        return localizer.localize(localizableINVALID_SOAP_ACTION());
+    }
+
+    public static Localizable localizableNON_LOGICAL_HANDLER_SET(Object arg0) {
+        return messageFactory.getMessage("non.logical.handler.set", arg0);
+    }
+
+    /**
+     * Cannot set {0} on binding. Handler must be a LogicalHandler.
+     *
+     */
+    public static String NON_LOGICAL_HANDLER_SET(Object arg0) {
+        return localizer.localize(localizableNON_LOGICAL_HANDLER_SET(arg0));
+    }
+
+    public static Localizable localizableLOCAL_CLIENT_FAILED(Object arg0) {
+        return messageFactory.getMessage("local.client.failed", arg0);
+    }
+
+    /**
+     * local transport error: {0}
+     *
+     */
+    public static String LOCAL_CLIENT_FAILED(Object arg0) {
+        return localizer.localize(localizableLOCAL_CLIENT_FAILED(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_WSDLPARSER_INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return messageFactory.getMessage("runtime.wsdlparser.invalidWSDL", arg0, arg1, arg2, arg3);
+    }
+
+    /**
+     * Invalid WSDL {0}, expected {1} found {2} at (line{3})
+     *
+     */
+    public static String RUNTIME_WSDLPARSER_INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
+        return localizer.localize(localizableRUNTIME_WSDLPARSER_INVALID_WSDL(arg0, arg1, arg2, arg3));
+    }
+
+    public static Localizable localizableWSDL_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("wsdl.not.found", arg0);
+    }
+
+    /**
+     * WSDL url {0} is not accessible.
+     *
+     */
+    public static String WSDL_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableWSDL_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableHTTP_CLIENT_FAILED(Object arg0) {
+        return messageFactory.getMessage("http.client.failed", arg0);
+    }
+
+    /**
+     * HTTP transport error: {0}
+     *
+     */
+    public static String HTTP_CLIENT_FAILED(Object arg0) {
+        return localizer.localize(localizableHTTP_CLIENT_FAILED(arg0));
+    }
+
+    public static Localizable localizableHTTP_CLIENT_CANNOT_CREATE_MESSAGE_FACTORY() {
+        return messageFactory.getMessage("http.client.cannotCreateMessageFactory");
+    }
+
+    /**
+     * cannot create message factory
+     *
+     */
+    public static String HTTP_CLIENT_CANNOT_CREATE_MESSAGE_FACTORY() {
+        return localizer.localize(localizableHTTP_CLIENT_CANNOT_CREATE_MESSAGE_FACTORY());
+    }
+
+    public static Localizable localizableINVALID_SERVICE_NAME_NULL(Object arg0) {
+        return messageFactory.getMessage("invalid.service.name.null", arg0);
+    }
+
+    /**
+     * {0} is not a valid service
+     *
+     */
+    public static String INVALID_SERVICE_NAME_NULL(Object arg0) {
+        return localizer.localize(localizableINVALID_SERVICE_NAME_NULL(arg0));
+    }
+
+    public static Localizable localizableINVALID_WSDL_URL(Object arg0) {
+        return messageFactory.getMessage("invalid.wsdl.url", arg0);
+    }
+
+    /**
+     * Invalid WSDL URL: {0}
+     *
+     */
+    public static String INVALID_WSDL_URL(Object arg0) {
+        return localizer.localize(localizableINVALID_WSDL_URL(arg0));
+    }
+
+    public static Localizable localizableHTTP_CLIENT_UNAUTHORIZED(Object arg0) {
+        return messageFactory.getMessage("http.client.unauthorized", arg0);
+    }
+
+    /**
+     * request requires HTTP authentication: {0}
+     *
+     */
+    public static String HTTP_CLIENT_UNAUTHORIZED(Object arg0) {
+        return localizer.localize(localizableHTTP_CLIENT_UNAUTHORIZED(arg0));
+    }
+
+    public static Localizable localizableINVALID_PORT_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.port.name", arg0, arg1);
+    }
+
+    /**
+     * {0} is not a valid port. Valid ports are: {1}
+     *
+     */
+    public static String INVALID_PORT_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_PORT_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_SERVICE_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.service.name", arg0, arg1);
+    }
+
+    /**
+     * {0} is not a valid service. Valid services are: {1}
+     *
+     */
+    public static String INVALID_SERVICE_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_SERVICE_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableUNSUPPORTED_OPERATION(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("unsupported.operation", arg0, arg1, arg2);
+    }
+
+    /**
+     * {0} not supported with {1}. Must be: {2}
+     *
+     */
+    public static String UNSUPPORTED_OPERATION(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableUNSUPPORTED_OPERATION(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableFAILED_TO_PARSE_EPR(Object arg0) {
+        return messageFactory.getMessage("failed.to.parse.epr", arg0);
+    }
+
+    /**
+     * Failed to parse EPR: {0}
+     *
+     */
+    public static String FAILED_TO_PARSE_EPR(Object arg0) {
+        return localizer.localize(localizableFAILED_TO_PARSE_EPR(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/DispatchMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/DispatchMessages.java
new file mode 100644
index 0000000..20ab87b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/DispatchMessages.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class DispatchMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.dispatch");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableINVALID_NULLARG_XMLHTTP_REQUEST_METHOD(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.nullarg.xmlhttp.request.method", arg0, arg1);
+    }
+
+    /**
+     * A XML/HTTP request using MessageContext.HTTP_REQUEST_METHOD equals {0} with a Null invocation Argument is not allowed. Must be: {1}
+     *
+     */
+    public static String INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_NULLARG_XMLHTTP_REQUEST_METHOD(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_SOAPMESSAGE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.soapmessage.dispatch.msgmode", arg0, arg1);
+    }
+
+    /**
+     * Can not create Dispatch<SOAPMessage> of {0}. Must be {1}.
+     *
+     */
+    public static String INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_SOAPMESSAGE_DISPATCH_MSGMODE(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_RESPONSE_DESERIALIZATION() {
+        return messageFactory.getMessage("invalid.response.deserialization");
+    }
+
+    /**
+     * Failed to deserialize the response.
+     *
+     */
+    public static String INVALID_RESPONSE_DESERIALIZATION() {
+        return localizer.localize(localizableINVALID_RESPONSE_DESERIALIZATION());
+    }
+
+    public static Localizable localizableINVALID_QUERY_LEADING_CHAR(Object arg0) {
+        return messageFactory.getMessage("invalid.query.leading.char", arg0);
+    }
+
+    /**
+     * Leading '?' of MessageContext.QUERY_STRING: {0} is not valid. Remove '?' and run again.
+     *
+     */
+    public static String INVALID_QUERY_LEADING_CHAR(Object arg0) {
+        return localizer.localize(localizableINVALID_QUERY_LEADING_CHAR(arg0));
+    }
+
+    public static Localizable localizableINVALID_QUERY_STRING(Object arg0) {
+        return messageFactory.getMessage("invalid.query.string", arg0);
+    }
+
+    /**
+     * Unable to resolve endpoint address using the supplied query string: {0}.
+     *
+     */
+    public static String INVALID_QUERY_STRING(Object arg0) {
+        return localizer.localize(localizableINVALID_QUERY_STRING(arg0));
+    }
+
+    public static Localizable localizableDUPLICATE_PORT(Object arg0) {
+        return messageFactory.getMessage("duplicate.port", arg0);
+    }
+
+    /**
+     * WSDLPort {0} already exists. Can not create a port of the same QName.
+     *
+     */
+    public static String DUPLICATE_PORT(Object arg0) {
+        return localizer.localize(localizableDUPLICATE_PORT(arg0));
+    }
+
+    public static Localizable localizableINVALID_DATASOURCE_DISPATCH_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.datasource.dispatch.binding", arg0, arg1);
+    }
+
+    /**
+     * Can not create Dispatch<DataSource> with {0}. Must be: {1}
+     *
+     */
+    public static String INVALID_DATASOURCE_DISPATCH_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_DATASOURCE_DISPATCH_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_DATASOURCE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.datasource.dispatch.msgmode", arg0, arg1);
+    }
+
+    /**
+     * Can not create Dispatch<DataSource> of Service.Mode.PAYLOAD{0}. Must be: {1}
+     *
+     */
+    public static String INVALID_DATASOURCE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_DATASOURCE_DISPATCH_MSGMODE(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_NULLARG_SOAP_MSGMODE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.nullarg.soap.msgmode", arg0, arg1);
+    }
+
+    /**
+     * SOAP/HTTP Binding in {0} is not allowed with a null invocation argument. Must be: {1}
+     *
+     */
+    public static String INVALID_NULLARG_SOAP_MSGMODE(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_NULLARG_SOAP_MSGMODE(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_URI(Object arg0) {
+        return messageFactory.getMessage("invalid.uri", arg0);
+    }
+
+    /**
+     * Endpoint String: {0} is and invalid URI.
+     *
+     */
+    public static String INVALID_URI(Object arg0) {
+        return localizer.localize(localizableINVALID_URI(arg0));
+    }
+
+    public static Localizable localizableINVALID_SOAPMESSAGE_DISPATCH_BINDING(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.soapmessage.dispatch.binding", arg0, arg1);
+    }
+
+    /**
+     * Can not create Dispatch<SOAPMessage> with {0} Binding. Must be: {1} Binding.
+     *
+     */
+    public static String INVALID_SOAPMESSAGE_DISPATCH_BINDING(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_SOAPMESSAGE_DISPATCH_BINDING(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_URI_PATH_QUERY(Object arg0, Object arg1) {
+        return messageFactory.getMessage("invalid.uri.path.query", arg0, arg1);
+    }
+
+    /**
+     * Unable to construct a URI with this path info {0} and this query string {1}.
+     *
+     */
+    public static String INVALID_URI_PATH_QUERY(Object arg0, Object arg1) {
+        return localizer.localize(localizableINVALID_URI_PATH_QUERY(arg0, arg1));
+    }
+
+    public static Localizable localizableINVALID_RESPONSE() {
+        return messageFactory.getMessage("invalid.response");
+    }
+
+    /**
+     * No response returned.
+     *
+     */
+    public static String INVALID_RESPONSE() {
+        return localizer.localize(localizableINVALID_RESPONSE());
+    }
+
+    public static Localizable localizableINVALID_URI_RESOLUTION(Object arg0) {
+        return messageFactory.getMessage("invalid.uri.resolution", arg0);
+    }
+
+    /**
+     * Unable to resolve endpoint address using the supplied path: {0}.
+     *
+     */
+    public static String INVALID_URI_RESOLUTION(Object arg0) {
+        return localizer.localize(localizableINVALID_URI_RESOLUTION(arg0));
+    }
+
+    public static Localizable localizableINVALID_URI_DECODE() {
+        return messageFactory.getMessage("invalid.uri.decode");
+    }
+
+    /**
+     * Unable to decode the resolved endpoint using UTF-8 encoding.
+     *
+     */
+    public static String INVALID_URI_DECODE() {
+        return localizer.localize(localizableINVALID_URI_DECODE());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/EncodingMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/EncodingMessages.java
new file mode 100644
index 0000000..ee51a35
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/EncodingMessages.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class EncodingMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.encoding");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableFAILED_TO_READ_RESPONSE(Object arg0) {
+        return messageFactory.getMessage("failed.to.read.response", arg0);
+    }
+
+    /**
+     * Failed to read a response: {0}
+     *
+     */
+    public static String FAILED_TO_READ_RESPONSE(Object arg0) {
+        return localizer.localize(localizableFAILED_TO_READ_RESPONSE(arg0));
+    }
+
+    public static Localizable localizableEXCEPTION_INCORRECT_TYPE(Object arg0) {
+        return messageFactory.getMessage("exception.incorrectType", arg0);
+    }
+
+    /**
+     * incorrect type. Expected java.lang.Exception, found {0}
+     *
+     */
+    public static String EXCEPTION_INCORRECT_TYPE(Object arg0) {
+        return localizer.localize(localizableEXCEPTION_INCORRECT_TYPE(arg0));
+    }
+
+    public static Localizable localizableEXCEPTION_NOTFOUND(Object arg0) {
+        return messageFactory.getMessage("exception.notfound", arg0);
+    }
+
+    /**
+     * exception class: {0} not found in the model!
+     *
+     */
+    public static String EXCEPTION_NOTFOUND(Object arg0) {
+        return localizer.localize(localizableEXCEPTION_NOTFOUND(arg0));
+    }
+
+    public static Localizable localizableXSD_UNEXPECTED_ELEMENT_NAME(Object arg0, Object arg1) {
+        return messageFactory.getMessage("xsd.unexpectedElementName", arg0, arg1);
+    }
+
+    /**
+     * unexpected element name: expected={0}, actual: {1}
+     *
+     */
+    public static String XSD_UNEXPECTED_ELEMENT_NAME(Object arg0, Object arg1) {
+        return localizer.localize(localizableXSD_UNEXPECTED_ELEMENT_NAME(arg0, arg1));
+    }
+
+    public static Localizable localizableNESTED_DESERIALIZATION_ERROR(Object arg0) {
+        return messageFactory.getMessage("nestedDeserializationError", arg0);
+    }
+
+    /**
+     * deserialization error: {0}
+     *
+     */
+    public static String NESTED_DESERIALIZATION_ERROR(Object arg0) {
+        return localizer.localize(localizableNESTED_DESERIALIZATION_ERROR(arg0));
+    }
+
+    public static Localizable localizableXSD_UNKNOWN_PREFIX(Object arg0) {
+        return messageFactory.getMessage("xsd.unknownPrefix", arg0);
+    }
+
+    /**
+     * unknown prefix "{0}"
+     *
+     */
+    public static String XSD_UNKNOWN_PREFIX(Object arg0) {
+        return localizer.localize(localizableXSD_UNKNOWN_PREFIX(arg0));
+    }
+
+    public static Localizable localizableNESTED_ENCODING_ERROR(Object arg0) {
+        return messageFactory.getMessage("nestedEncodingError", arg0);
+    }
+
+    /**
+     * encoding error: {0}
+     *
+     */
+    public static String NESTED_ENCODING_ERROR(Object arg0) {
+        return localizer.localize(localizableNESTED_ENCODING_ERROR(arg0));
+    }
+
+    public static Localizable localizableUNKNOWN_OBJECT() {
+        return messageFactory.getMessage("unknown.object");
+    }
+
+    /**
+     * don't know how to write object: {0}
+     *
+     */
+    public static String UNKNOWN_OBJECT() {
+        return localizer.localize(localizableUNKNOWN_OBJECT());
+    }
+
+    public static Localizable localizableINCORRECT_MESSAGEINFO() {
+        return messageFactory.getMessage("incorrect.messageinfo");
+    }
+
+    /**
+     * can't write object! unexpected type: {0}
+     *
+     */
+    public static String INCORRECT_MESSAGEINFO() {
+        return localizer.localize(localizableINCORRECT_MESSAGEINFO());
+    }
+
+    public static Localizable localizableNESTED_SERIALIZATION_ERROR(Object arg0) {
+        return messageFactory.getMessage("nestedSerializationError", arg0);
+    }
+
+    /**
+     * serialization error: {0}
+     *
+     */
+    public static String NESTED_SERIALIZATION_ERROR(Object arg0) {
+        return localizer.localize(localizableNESTED_SERIALIZATION_ERROR(arg0));
+    }
+
+    public static Localizable localizableNO_SUCH_CONTENT_ID(Object arg0) {
+        return messageFactory.getMessage("noSuchContentId", arg0);
+    }
+
+    /**
+     * There''s no attachment for the content ID "{0}"
+     *
+     */
+    public static String NO_SUCH_CONTENT_ID(Object arg0) {
+        return localizer.localize(localizableNO_SUCH_CONTENT_ID(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HandlerMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HandlerMessages.java
new file mode 100644
index 0000000..ec090e9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HandlerMessages.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class HandlerMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.handler");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableHANDLER_MESSAGE_CONTEXT_INVALID_CLASS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("handler.messageContext.invalid.class", arg0, arg1);
+    }
+
+    /**
+     * "{0}" is not an allowed value for the property "{1}"
+     *
+     */
+    public static String HANDLER_MESSAGE_CONTEXT_INVALID_CLASS(Object arg0, Object arg1) {
+        return localizer.localize(localizableHANDLER_MESSAGE_CONTEXT_INVALID_CLASS(arg0, arg1));
+    }
+
+    public static Localizable localizableCANNOT_EXTEND_HANDLER_DIRECTLY(Object arg0) {
+        return messageFactory.getMessage("cannot.extend.handler.directly", arg0);
+    }
+
+    /**
+     * Handler {0} must implement LogicalHandler or SOAPHandler.
+     *
+     */
+    public static String CANNOT_EXTEND_HANDLER_DIRECTLY(Object arg0) {
+        return localizer.localize(localizableCANNOT_EXTEND_HANDLER_DIRECTLY(arg0));
+    }
+
+    public static Localizable localizableHANDLER_NOT_VALID_TYPE(Object arg0) {
+        return messageFactory.getMessage("handler.not.valid.type", arg0);
+    }
+
+    /**
+     * {0} does not implement one of the handler interfaces.
+     *
+     */
+    public static String HANDLER_NOT_VALID_TYPE(Object arg0) {
+        return localizer.localize(localizableHANDLER_NOT_VALID_TYPE(arg0));
+    }
+
+    public static Localizable localizableCANNOT_INSTANTIATE_HANDLER(Object arg0, Object arg1) {
+        return messageFactory.getMessage("cannot.instantiate.handler", arg0, arg1);
+    }
+
+    /**
+     * Unable to instantiate handler: {0} because: {1}
+     *
+     */
+    public static String CANNOT_INSTANTIATE_HANDLER(Object arg0, Object arg1) {
+        return localizer.localize(localizableCANNOT_INSTANTIATE_HANDLER(arg0, arg1));
+    }
+
+    public static Localizable localizableHANDLER_CHAIN_CONTAINS_HANDLER_ONLY(Object arg0) {
+        return messageFactory.getMessage("handler.chain.contains.handler.only", arg0);
+    }
+
+    /**
+     * A HandlerChain can only contain Handler instances: {0}
+     *
+     */
+    public static String HANDLER_CHAIN_CONTAINS_HANDLER_ONLY(Object arg0) {
+        return localizer.localize(localizableHANDLER_CHAIN_CONTAINS_HANDLER_ONLY(arg0));
+    }
+
+    public static Localizable localizableHANDLER_NESTED_ERROR(Object arg0) {
+        return messageFactory.getMessage("handler.nestedError", arg0);
+    }
+
+    /**
+     * handler error: {0}
+     *
+     */
+    public static String HANDLER_NESTED_ERROR(Object arg0) {
+        return localizer.localize(localizableHANDLER_NESTED_ERROR(arg0));
+    }
+
+    public static Localizable localizableHANDLER_PREDESTROY_IGNORE(Object arg0) {
+        return messageFactory.getMessage("handler.predestroy.ignore", arg0);
+    }
+
+    /**
+     * Exception ignored from invoking handler @PreDestroy method: {0}
+     *
+     */
+    public static String HANDLER_PREDESTROY_IGNORE(Object arg0) {
+        return localizer.localize(localizableHANDLER_PREDESTROY_IGNORE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java
new file mode 100644
index 0000000..236c4d8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class HttpserverMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.httpserver");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableUNEXPECTED_HTTP_METHOD(Object arg0) {
+        return messageFactory.getMessage("unexpected.http.method", arg0);
+    }
+
+    /**
+     * Cannot handle HTTP method: {0}
+     *
+     */
+    public static String UNEXPECTED_HTTP_METHOD(Object arg0) {
+        return localizer.localize(localizableUNEXPECTED_HTTP_METHOD(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ModelerMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ModelerMessages.java
new file mode 100644
index 0000000..a8e9169
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ModelerMessages.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ModelerMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.modeler");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableNESTED_MODELER_ERROR(Object arg0) {
+        return messageFactory.getMessage("nestedModelerError", arg0);
+    }
+
+    /**
+     * runtime modeler error: {0}
+     *
+     */
+    public static String NESTED_MODELER_ERROR(Object arg0) {
+        return localizer.localize(localizableNESTED_MODELER_ERROR(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.wsfeature.no.ftrconstructor", arg0, arg1);
+    }
+
+    /**
+     * Annotation {0} is not recognizable, atleast one constructor of {1} should be marked with @FeatureConstructor
+     *
+     */
+    public static String RUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.webmethod.must.be.public", arg0);
+    }
+
+    /**
+     * @WebMethod is not allowed on a non-public method {0}
+     *
+     */
+    public static String RUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.wrapper.not.found", arg0);
+    }
+
+    /**
+     * Wrapper class {0} is not found. Have you run APT to generate them?
+     *
+     */
+    public static String RUNTIME_MODELER_WRAPPER_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_MTOM_CONFLICT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.mtom.conflict", arg0, arg1);
+    }
+
+    /**
+     * Error in  @BindingType: MTOM Configuration in binding identifier {0} conflicts with feature @MTOM {1}
+     *
+     */
+    public static String RUNTIME_MODELER_MTOM_CONFLICT(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_MTOM_CONFLICT(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_FEATURE_CONFLICT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.feature.conflict", arg0, arg1);
+    }
+
+    /**
+     * Feature {0} in implementation conflicts with {1} in WSDL configuration
+     *
+     */
+    public static String RUNTIME_MODELER_FEATURE_CONFLICT(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_FEATURE_CONFLICT(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.wsfeature.morethanone.ftrconstructor", arg0, arg1);
+    }
+
+    /**
+     * Annotation {0} is illegal, Only one constructor of {1} can be marked as @FeatureConstructor
+     *
+     */
+    public static String RUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(arg0, arg1));
+    }
+
+    public static Localizable localizableNOT_A_VALID_BARE_METHOD(Object arg0, Object arg1) {
+        return messageFactory.getMessage("not.a.valid.bare.method", arg0, arg1);
+    }
+
+    /**
+     * SEI {0} has method {1} annotated as BARE but it has more than one parameter bound to body. This is invalid. Please annotate the method with annotation: @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
+     *
+     */
+    public static String NOT_A_VALID_BARE_METHOD(Object arg0, Object arg1) {
+        return localizer.localize(localizableNOT_A_VALID_BARE_METHOD(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_NO_PACKAGE(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.no.package", arg0);
+    }
+
+    /**
+     * A @WebService.targetNamespace must be specified on classes with no package.  Class: {0}
+     *
+     */
+    public static String RUNTIME_MODELER_NO_PACKAGE(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_NO_PACKAGE(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.no.webservice.annotation", arg0);
+    }
+
+    /**
+     * A WebService annotation is not present on class: {0}
+     *
+     */
+    public static String RUNTIME_MODELER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_NO_WEBSERVICE_ANNOTATION(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.oneway.operation.no.out.parameters", arg0, arg1);
+    }
+
+    /**
+     * oneway operation should not have out parameters class: {0} method: {1}
+     *
+     */
+    public static String RUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(arg0, arg1));
+    }
+
+    public static Localizable localizableUNABLE_TO_CREATE_JAXB_CONTEXT() {
+        return messageFactory.getMessage("unable.to.create.JAXBContext");
+    }
+
+    /**
+     * Unable to create JAXBContext due to the security restriction
+     *
+     */
+    public static String UNABLE_TO_CREATE_JAXB_CONTEXT() {
+        return localizer.localize(localizableUNABLE_TO_CREATE_JAXB_CONTEXT());
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_NO_OPERATIONS(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.no.operations", arg0);
+    }
+
+    /**
+     * The web service defined by the class {0} does not contain any valid WebMethods.
+     *
+     */
+    public static String RUNTIME_MODELER_NO_OPERATIONS(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_NO_OPERATIONS(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.webmethod.must.be.nonstatic", arg0);
+    }
+
+    /**
+     * @WebMethod is not allowed on a static method {0}
+     *
+     */
+    public static String RUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_METHOD_NOT_FOUND(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.method.not.found", arg0, arg1);
+    }
+
+    /**
+     * method: {0} could not be found on class: {1}
+     *
+     */
+    public static String RUNTIME_MODELER_METHOD_NOT_FOUND(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_METHOD_NOT_FOUND(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.class.not.found", arg0);
+    }
+
+    /**
+     * class: {0} could not be found
+     *
+     */
+    public static String RUNTIME_MODELER_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_CANNOT_GET_SERVICE_NAME_FROM_INTERFACE(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.cannot.get.serviceName.from.interface", arg0);
+    }
+
+    /**
+     * The serviceName cannot be retrieved from an interface.  class {0}
+     *
+     */
+    public static String RUNTIME_MODELER_CANNOT_GET_SERVICE_NAME_FROM_INTERFACE(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_CANNOT_GET_SERVICE_NAME_FROM_INTERFACE(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+        return messageFactory.getMessage("runtime.modeler.endpoint.interface.no.webservice", arg0);
+    }
+
+    /**
+     * The Endpoint Interface: {0} does not have WebService Annotation
+     *
+     */
+    public static String RUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+        return localizer.localize(localizableRUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.portname.servicename.namespace.mismatch", arg0, arg1);
+    }
+
+    /**
+     * The namespace of the serviceName "{0}" and the namespace of the portName "{1}" must match
+     *
+     */
+    public static String RUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.modeler.wsfeature.illegal.ftrconstructor", arg0, arg1);
+    }
+
+    /**
+     * Annotation {0} is illegal, In {1} @FeatureConstructor value does n't match the constructor parameters
+     *
+     */
+    public static String RUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(arg0, arg1));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java
new file mode 100644
index 0000000..b44e93a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ProviderApiMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.providerApi");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableNULL_ADDRESS_SERVICE_ENDPOINT() {
+        return messageFactory.getMessage("null.address.service.endpoint");
+    }
+
+    /**
+     * Address in an EPR cannot be null, when serviceName or portName is null
+     *
+     */
+    public static String NULL_ADDRESS_SERVICE_ENDPOINT() {
+        return localizer.localize(localizableNULL_ADDRESS_SERVICE_ENDPOINT());
+    }
+
+    public static Localizable localizableNULL_SERVICE() {
+        return messageFactory.getMessage("null.service");
+    }
+
+    /**
+     * serviceName can't be null when portName is specified
+     *
+     */
+    public static String NULL_SERVICE() {
+        return localizer.localize(localizableNULL_SERVICE());
+    }
+
+    public static Localizable localizableNULL_ADDRESS() {
+        return messageFactory.getMessage("null.address");
+    }
+
+    /**
+     * Address in an EPR cannot be null
+     *
+     */
+    public static String NULL_ADDRESS() {
+        return localizer.localize(localizableNULL_ADDRESS());
+    }
+
+    public static Localizable localizableNULL_PORTNAME() {
+        return messageFactory.getMessage("null.portname");
+    }
+
+    /**
+     * EPR does n't have EndpointName in the Metadata
+     *
+     */
+    public static String NULL_PORTNAME() {
+        return localizer.localize(localizableNULL_PORTNAME());
+    }
+
+    public static Localizable localizableNOTFOUND_SERVICE_IN_WSDL(Object arg0, Object arg1) {
+        return messageFactory.getMessage("notfound.service.in.wsdl", arg0, arg1);
+    }
+
+    /**
+     * Service: {0} not found in WSDL: {1}
+     *
+     */
+    public static String NOTFOUND_SERVICE_IN_WSDL(Object arg0, Object arg1) {
+        return localizer.localize(localizableNOTFOUND_SERVICE_IN_WSDL(arg0, arg1));
+    }
+
+    public static Localizable localizableNULL_EPR() {
+        return messageFactory.getMessage("null.epr");
+    }
+
+    /**
+     * EndpointReference is null
+     *
+     */
+    public static String NULL_EPR() {
+        return localizer.localize(localizableNULL_EPR());
+    }
+
+    public static Localizable localizableNULL_WSDL() {
+        return messageFactory.getMessage("null.wsdl");
+    }
+
+    /**
+     * EPR does n't have WSDL Metadata which is needed for the current operation
+     *
+     */
+    public static String NULL_WSDL() {
+        return localizer.localize(localizableNULL_WSDL());
+    }
+
+    public static Localizable localizableNOTFOUND_PORT_IN_WSDL(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("notfound.port.in.wsdl", arg0, arg1, arg2);
+    }
+
+    /**
+     * Port: {0} not a valid port in Service: {1} in WSDL: {2}
+     *
+     */
+    public static String NOTFOUND_PORT_IN_WSDL(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableNOTFOUND_PORT_IN_WSDL(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableERROR_WSDL(Object arg0) {
+        return messageFactory.getMessage("error.wsdl", arg0);
+    }
+
+    /**
+     * Error in parsing WSDL: {0}
+     *
+     */
+    public static String ERROR_WSDL(Object arg0) {
+        return localizer.localize(localizableERROR_WSDL(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SenderMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SenderMessages.java
new file mode 100644
index 0000000..c942aa1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SenderMessages.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class SenderMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.sender");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableSENDER_REQUEST_ILLEGAL_VALUE_FOR_CONTENT_NEGOTIATION(Object arg0) {
+        return messageFactory.getMessage("sender.request.illegalValueForContentNegotiation", arg0);
+    }
+
+    /**
+     * illegal value for content negotiation property "{0}"
+     *
+     */
+    public static String SENDER_REQUEST_ILLEGAL_VALUE_FOR_CONTENT_NEGOTIATION(Object arg0) {
+        return localizer.localize(localizableSENDER_REQUEST_ILLEGAL_VALUE_FOR_CONTENT_NEGOTIATION(arg0));
+    }
+
+    public static Localizable localizableSENDER_RESPONSE_CANNOT_DECODE_FAULT_DETAIL() {
+        return messageFactory.getMessage("sender.response.cannotDecodeFaultDetail");
+    }
+
+    /**
+     * fault detail cannot be decoded
+     *
+     */
+    public static String SENDER_RESPONSE_CANNOT_DECODE_FAULT_DETAIL() {
+        return localizer.localize(localizableSENDER_RESPONSE_CANNOT_DECODE_FAULT_DETAIL());
+    }
+
+    public static Localizable localizableSENDER_NESTED_ERROR(Object arg0) {
+        return messageFactory.getMessage("sender.nestedError", arg0);
+    }
+
+    /**
+     * sender error: {0}
+     *
+     */
+    public static String SENDER_NESTED_ERROR(Object arg0) {
+        return localizer.localize(localizableSENDER_NESTED_ERROR(arg0));
+    }
+
+    public static Localizable localizableSENDER_REQUEST_MESSAGE_NOT_READY() {
+        return messageFactory.getMessage("sender.request.messageNotReady");
+    }
+
+    /**
+     * message not ready to be sent
+     *
+     */
+    public static String SENDER_REQUEST_MESSAGE_NOT_READY() {
+        return localizer.localize(localizableSENDER_REQUEST_MESSAGE_NOT_READY());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ServerMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ServerMessages.java
new file mode 100644
index 0000000..017e62b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ServerMessages.java
@@ -0,0 +1,697 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class ServerMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.server");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableRUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE() {
+        return messageFactory.getMessage("runtime.parser.missing.attribute.no.line");
+    }
+
+    /**
+     * missing attribute "{2}" in element "{1}" of runtime descriptor
+     *
+     */
+    public static String RUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE() {
+        return localizer.localize(localizableRUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE());
+    }
+
+    public static Localizable localizableSTATEFUL_COOKIE_HEADER_INCORRECT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("stateful.cookie.header.incorrect", arg0, arg1);
+    }
+
+    /**
+     * Invalid/expired {0} header value: {1}
+     *
+     */
+    public static String STATEFUL_COOKIE_HEADER_INCORRECT(Object arg0, Object arg1) {
+        return localizer.localize(localizableSTATEFUL_COOKIE_HEADER_INCORRECT(arg0, arg1));
+    }
+
+    public static Localizable localizableNOT_IMPLEMENT_PROVIDER(Object arg0) {
+        return messageFactory.getMessage("not.implement.provider", arg0);
+    }
+
+    /**
+     * "{0}" doesn't implement Provider
+     *
+     */
+    public static String NOT_IMPLEMENT_PROVIDER(Object arg0) {
+        return localizer.localize(localizableNOT_IMPLEMENT_PROVIDER(arg0));
+    }
+
+    public static Localizable localizableSTATEFUL_REQURES_ADDRESSING(Object arg0) {
+        return messageFactory.getMessage("stateful.requres.addressing", arg0);
+    }
+
+    /**
+     * Stateful web service {0} requires the WS-Addressing support to be enabled. Perhaps you are missing @Addressing
+     *
+     */
+    public static String STATEFUL_REQURES_ADDRESSING(Object arg0) {
+        return localizer.localize(localizableSTATEFUL_REQURES_ADDRESSING(arg0));
+    }
+
+    public static Localizable localizableSOAPDECODER_ERR() {
+        return messageFactory.getMessage("soapdecoder.err");
+    }
+
+    /**
+     * Error in decoding SOAP Message
+     *
+     */
+    public static String SOAPDECODER_ERR() {
+        return localizer.localize(localizableSOAPDECODER_ERR());
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_INVALID_READER_STATE(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.invalidReaderState", arg0);
+    }
+
+    /**
+     * error parsing runtime descriptor: {0}
+     *
+     */
+    public static String RUNTIME_PARSER_INVALID_READER_STATE(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_INVALID_READER_STATE(arg0));
+    }
+
+    public static Localizable localizableGENERATE_NON_STANDARD_WSDL() {
+        return messageFactory.getMessage("generate.non.standard.wsdl");
+    }
+
+    /**
+     * Generating non-standard WSDL for the specified binding
+     *
+     */
+    public static String GENERATE_NON_STANDARD_WSDL() {
+        return localizer.localize(localizableGENERATE_NON_STANDARD_WSDL());
+    }
+
+    public static Localizable localizableDISPATCH_CANNOT_FIND_METHOD(Object arg0, Object arg1) {
+        return messageFactory.getMessage("dispatch.cannotFindMethod", arg0, arg1);
+    }
+
+    /**
+     * Cannot find dispatch method for {0} using "{1}"
+     *
+     */
+    public static String DISPATCH_CANNOT_FIND_METHOD(Object arg0, Object arg1) {
+        return localizer.localize(localizableDISPATCH_CANNOT_FIND_METHOD(arg0, arg1));
+    }
+
+    public static Localizable localizableNO_CONTENT_TYPE() {
+        return messageFactory.getMessage("no.contentType");
+    }
+
+    /**
+     * Request doesn't have a Content-Type
+     *
+     */
+    public static String NO_CONTENT_TYPE() {
+        return localizer.localize(localizableNO_CONTENT_TYPE());
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_INVALID_VERSION_NUMBER() {
+        return messageFactory.getMessage("runtime.parser.invalidVersionNumber");
+    }
+
+    /**
+     * unsupported runtime descriptor version: {2}
+     *
+     */
+    public static String RUNTIME_PARSER_INVALID_VERSION_NUMBER() {
+        return localizer.localize(localizableRUNTIME_PARSER_INVALID_VERSION_NUMBER());
+    }
+
+    public static Localizable localizablePROVIDER_INVALID_PARAMETER_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("provider.invalid.parameterType", arg0, arg1);
+    }
+
+    /**
+     * "{0}" implements Provider but its type parameter {1} is incorrect
+     *
+     */
+    public static String PROVIDER_INVALID_PARAMETER_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizablePROVIDER_INVALID_PARAMETER_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableWRONG_NO_PARAMETERS(Object arg0) {
+        return messageFactory.getMessage("wrong.no.parameters", arg0);
+    }
+
+    /**
+     * Incorrect no of arguments for method "{0}"
+     *
+     */
+    public static String WRONG_NO_PARAMETERS(Object arg0) {
+        return localizer.localize(localizableWRONG_NO_PARAMETERS(arg0));
+    }
+
+    public static Localizable localizableANNOTATION_ONLY_ONCE(Object arg0) {
+        return messageFactory.getMessage("annotation.only.once", arg0);
+    }
+
+    /**
+     * Only one method should have the annotation "{0}"
+     *
+     */
+    public static String ANNOTATION_ONLY_ONCE(Object arg0) {
+        return localizer.localize(localizableANNOTATION_ONLY_ONCE(arg0));
+    }
+
+    public static Localizable localizableALREADY_HTTPS_SERVER(Object arg0) {
+        return messageFactory.getMessage("already.https.server", arg0);
+    }
+
+    /**
+     * There is already a HTTPS server at : {0}
+     *
+     */
+    public static String ALREADY_HTTPS_SERVER(Object arg0) {
+        return localizer.localize(localizableALREADY_HTTPS_SERVER(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_XML_READER(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.xmlReader", arg0);
+    }
+
+    /**
+     * error parsing runtime descriptor: {0}
+     *
+     */
+    public static String RUNTIME_PARSER_XML_READER(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_XML_READER(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("runtime.parser.wsdl.incorrectserviceport", arg0, arg1, arg2);
+    }
+
+    /**
+     * could not get binding from WSDL! service: {0} or port {1} not found in the WSDL {2}.
+     * It could be because service and port names do not match WSDL''s wsdl:service and wsdl:port names:
+     *  1. service and port names are not there in deployment descriptor OR
+     *  2. Either there is a typo in deployment descriptor''s service and port names OR
+     *  3. The computed names from @WebService do not match wsdl:service and wsdl:port names
+     * Suggest doing the following:
+     *  1. Add/Correct entries for service and port names in deployment descriptor OR
+     *  2. Specify targetNamespace, serviceName, portName in @WebService on the endpoint class
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableSERVER_RT_ERR(Object arg0) {
+        return messageFactory.getMessage("server.rt.err", arg0);
+    }
+
+    /**
+     * Server Runtime Error: {0}
+     *
+     */
+    public static String SERVER_RT_ERR(Object arg0) {
+        return localizer.localize(localizableSERVER_RT_ERR(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("runtime.parser.invalidAttributeValue", arg0, arg1, arg2);
+    }
+
+    /**
+     * invalid value for attribute "{2}" of element "{1}" in runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableNO_CURRENT_PACKET() {
+        return messageFactory.getMessage("no.current.packet");
+    }
+
+    /**
+     * This thread is not currently processing any web service request.
+     *
+     */
+    public static String NO_CURRENT_PACKET() {
+        return localizer.localize(localizableNO_CURRENT_PACKET());
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_UNEXPECTED_CONTENT(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.unexpectedContent", arg0);
+    }
+
+    /**
+     * unexpected content in runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_UNEXPECTED_CONTENT(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_UNEXPECTED_CONTENT(arg0));
+    }
+
+    public static Localizable localizableSTATEFUL_COOKIE_HEADER_REQUIRED(Object arg0) {
+        return messageFactory.getMessage("stateful.cookie.header.required", arg0);
+    }
+
+    /**
+     * This is a stateful web service and {0} header is required.
+     *
+     */
+    public static String STATEFUL_COOKIE_HEADER_REQUIRED(Object arg0) {
+        return localizer.localize(localizableSTATEFUL_COOKIE_HEADER_REQUIRED(arg0));
+    }
+
+    public static Localizable localizableNULL_IMPLEMENTOR() {
+        return messageFactory.getMessage("null.implementor");
+    }
+
+    /**
+     * Implementor cannot be null
+     *
+     */
+    public static String NULL_IMPLEMENTOR() {
+        return localizer.localize(localizableNULL_IMPLEMENTOR());
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.wsdl", arg0);
+    }
+
+    /**
+     * exception during WSDL parsing: {0}
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL(arg0));
+    }
+
+    public static Localizable localizableSOAPENCODER_ERR() {
+        return messageFactory.getMessage("soapencoder.err");
+    }
+
+    /**
+     * Error in encoding SOAP Message
+     *
+     */
+    public static String SOAPENCODER_ERR() {
+        return localizer.localize(localizableSOAPENCODER_ERR());
+    }
+
+    public static Localizable localizableWSDL_REQUIRED() {
+        return messageFactory.getMessage("wsdl.required");
+    }
+
+    /**
+     * wsdl is required
+     *
+     */
+    public static String WSDL_REQUIRED() {
+        return localizer.localize(localizableWSDL_REQUIRED());
+    }
+
+    public static Localizable localizableNOT_HTTP_CONTEXT_TYPE(Object arg0) {
+        return messageFactory.getMessage("not.HttpContext.type", arg0);
+    }
+
+    /**
+     * Required com.sun.net.httpserver.HttpContext. Got : {0}
+     *
+     */
+    public static String NOT_HTTP_CONTEXT_TYPE(Object arg0) {
+        return localizer.localize(localizableNOT_HTTP_CONTEXT_TYPE(arg0));
+    }
+
+    public static Localizable localizablePORT_NAME_REQUIRED() {
+        return messageFactory.getMessage("port.name.required");
+    }
+
+    /**
+     * Port QName is not found
+     *
+     */
+    public static String PORT_NAME_REQUIRED() {
+        return localizer.localize(localizablePORT_NAME_REQUIRED());
+    }
+
+    public static Localizable localizableWRONG_TNS_FOR_PORT(Object arg0) {
+        return messageFactory.getMessage("wrong.tns.for.port", arg0);
+    }
+
+    /**
+     * Port namespace {0} doesn't match Service namespace {1}
+     *
+     */
+    public static String WRONG_TNS_FOR_PORT(Object arg0) {
+        return localizer.localize(localizableWRONG_TNS_FOR_PORT(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL_MULTIPLEBINDING(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("runtime.parser.wsdl.multiplebinding", arg0, arg1, arg2);
+    }
+
+    /**
+     * multiple bindings found for binding ID {0} for service {1} in WSDL {2}
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL_MULTIPLEBINDING(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL_MULTIPLEBINDING(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableALREADY_HTTP_SERVER(Object arg0) {
+        return messageFactory.getMessage("already.http.server", arg0);
+    }
+
+    /**
+     * There is already a HTTP server at : {0}
+     *
+     */
+    public static String ALREADY_HTTP_SERVER(Object arg0) {
+        return localizer.localize(localizableALREADY_HTTP_SERVER(arg0));
+    }
+
+    public static Localizable localizableCAN_NOT_GENERATE_WSDL(Object arg0) {
+        return messageFactory.getMessage("can.not.generate.wsdl", arg0);
+    }
+
+    /**
+     * Cannot generate WSDL for binding "{0}"
+     *
+     */
+    public static String CAN_NOT_GENERATE_WSDL(Object arg0) {
+        return localizer.localize(localizableCAN_NOT_GENERATE_WSDL(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.parser.invalid.attribute.value", arg0, arg1);
+    }
+
+    /**
+     * invalid attribute value "{1}" in runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("runtime.parser.wrong.element", arg0, arg1, arg2);
+    }
+
+    /**
+     * found element "{1}", expected "{2}" in runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableRUNTIME_PARSER_WRONG_ELEMENT(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL_NOSERVICE() {
+        return messageFactory.getMessage("runtime.parser.wsdl.noservice");
+    }
+
+    /**
+     * can't apply binding! service {0} not found in the WSDL {1}
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL_NOSERVICE() {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOSERVICE());
+    }
+
+    public static Localizable localizableSERVICE_NAME_REQUIRED() {
+        return messageFactory.getMessage("service.name.required");
+    }
+
+    /**
+     * Service QName is not found
+     *
+     */
+    public static String SERVICE_NAME_REQUIRED() {
+        return localizer.localize(localizableSERVICE_NAME_REQUIRED());
+    }
+
+    public static Localizable localizablePROVIDER_NOT_PARAMETERIZED(Object arg0) {
+        return messageFactory.getMessage("provider.not.parameterized", arg0);
+    }
+
+    /**
+     * "{0}" implements Provider but doesn't specify the type parameter
+     *
+     */
+    public static String PROVIDER_NOT_PARAMETERIZED(Object arg0) {
+        return localizer.localize(localizablePROVIDER_NOT_PARAMETERIZED(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_WSDL_PATCHER() {
+        return messageFactory.getMessage("runtime.wsdl.patcher");
+    }
+
+    /**
+     * error while patching WSDL related document
+     *
+     */
+    public static String RUNTIME_WSDL_PATCHER() {
+        return localizer.localize(localizableRUNTIME_WSDL_PATCHER());
+    }
+
+    public static Localizable localizableRUNTIME_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.saxparser.exception", arg0, arg1);
+    }
+
+    /**
+     * {0}
+     * {1}
+     *
+     */
+    public static String RUNTIME_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_SAXPARSER_EXCEPTION(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.wsdl.not.found", arg0);
+    }
+
+    /**
+     * {0} is not found in the WAR file. Package it in the WAR file or correct it in sun-jaxws.xml.
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWRONG_PARAMETER_TYPE(Object arg0) {
+        return messageFactory.getMessage("wrong.parameter.type", arg0);
+    }
+
+    /**
+     * Incorrect argument types for method "{0}"
+     *
+     */
+    public static String WRONG_PARAMETER_TYPE(Object arg0) {
+        return localizer.localize(localizableWRONG_PARAMETER_TYPE(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("runtime.parser.classNotFound", arg0);
+    }
+
+    /**
+     * class not found in runtime descriptor: {0}
+     *
+     */
+    public static String RUNTIME_PARSER_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableRUNTIME_PARSER_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableSTATIC_RESOURCE_INJECTION_ONLY(Object arg0, Object arg1) {
+        return messageFactory.getMessage("static.resource.injection.only", arg0, arg1);
+    }
+
+    /**
+     * Static resource {0} cannot be injected to non-static "{1}"
+     *
+     */
+    public static String STATIC_RESOURCE_INJECTION_ONLY(Object arg0, Object arg1) {
+        return localizer.localize(localizableSTATIC_RESOURCE_INJECTION_ONLY(arg0, arg1));
+    }
+
+    public static Localizable localizableNOT_ZERO_PARAMETERS(Object arg0) {
+        return messageFactory.getMessage("not.zero.parameters", arg0);
+    }
+
+    /**
+     * Method "{0}" shouldn''t have any arguments
+     *
+     */
+    public static String NOT_ZERO_PARAMETERS(Object arg0) {
+        return localizer.localize(localizableNOT_ZERO_PARAMETERS(arg0));
+    }
+
+    public static Localizable localizableDUPLICATE_PRIMARY_WSDL(Object arg0) {
+        return messageFactory.getMessage("duplicate.primary.wsdl", arg0);
+    }
+
+    /**
+     * Metadata has more than one WSDL that has Service definiton for the endpoint. WSDL={0} is one such WSDL.
+     *
+     */
+    public static String DUPLICATE_PRIMARY_WSDL(Object arg0) {
+        return localizer.localize(localizableDUPLICATE_PRIMARY_WSDL(arg0));
+    }
+
+    public static Localizable localizableDUPLICATE_ABSTRACT_WSDL(Object arg0) {
+        return messageFactory.getMessage("duplicate.abstract.wsdl", arg0);
+    }
+
+    /**
+     * Metadata has more than one WSDL that has PortType definiton for the endpoint. WSDL={0} is one such WSDL.
+     *
+     */
+    public static String DUPLICATE_ABSTRACT_WSDL(Object arg0) {
+        return localizer.localize(localizableDUPLICATE_ABSTRACT_WSDL(arg0));
+    }
+
+    public static Localizable localizableSTATEFUL_INVALID_WEBSERVICE_CONTEXT(Object arg0) {
+        return messageFactory.getMessage("stateful.invalid.webservice.context", arg0);
+    }
+
+    /**
+     * Not a WebServiceContext from JAX-WS RI: {0}
+     *
+     */
+    public static String STATEFUL_INVALID_WEBSERVICE_CONTEXT(Object arg0) {
+        return localizer.localize(localizableSTATEFUL_INVALID_WEBSERVICE_CONTEXT(arg0));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_WSDL_NOBINDING() {
+        return messageFactory.getMessage("runtime.parser.wsdl.nobinding");
+    }
+
+    /**
+     * can't apply binding! no binding found for binding ID {0] for service {1} in WSDL {2}
+     *
+     */
+    public static String RUNTIME_PARSER_WSDL_NOBINDING() {
+        return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOBINDING());
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_INVALID_ELEMENT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("runtime.parser.invalidElement", arg0, arg1);
+    }
+
+    /**
+     * invalid element "{1}" in runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_INVALID_ELEMENT(Object arg0, Object arg1) {
+        return localizer.localize(localizableRUNTIME_PARSER_INVALID_ELEMENT(arg0, arg1));
+    }
+
+    public static Localizable localizableRUNTIME_PARSER_MISSING_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("runtime.parser.missing.attribute", arg0, arg1, arg2);
+    }
+
+    /**
+     * missing attribute "{2}" in element "{1}" of runtime descriptor (line {0})
+     *
+     */
+    public static String RUNTIME_PARSER_MISSING_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableRUNTIME_PARSER_MISSING_ATTRIBUTE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWRONG_FIELD_TYPE(Object arg0) {
+        return messageFactory.getMessage("wrong.field.type", arg0);
+    }
+
+    /**
+     * Incorrect type for field "{0}"
+     *
+     */
+    public static String WRONG_FIELD_TYPE(Object arg0) {
+        return localizer.localize(localizableWRONG_FIELD_TYPE(arg0));
+    }
+
+    public static Localizable localizableDUPLICATE_PORT_KNOWN_HEADER(Object arg0) {
+        return messageFactory.getMessage("duplicate.portKnownHeader", arg0);
+    }
+
+    /**
+     * Received SOAP message contains duplicate header: {0} for a bound parameter
+     *
+     */
+    public static String DUPLICATE_PORT_KNOWN_HEADER(Object arg0) {
+        return localizer.localize(localizableDUPLICATE_PORT_KNOWN_HEADER(arg0));
+    }
+
+    public static Localizable localizableUNSUPPORTED_CONTENT_TYPE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("unsupported.contentType", arg0, arg1);
+    }
+
+    /**
+     * Unsupported Content-Type: {0} Supported ones are: {1}
+     *
+     */
+    public static String UNSUPPORTED_CONTENT_TYPE(Object arg0, Object arg1) {
+        return localizer.localize(localizableUNSUPPORTED_CONTENT_TYPE(arg0, arg1));
+    }
+
+    public static Localizable localizableFAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("failed.to.instantiate.instanceResolver", arg0, arg1, arg2);
+    }
+
+    /**
+     * Unable to instantiate {0} (which is specified in {1} on {2})
+     *
+     */
+    public static String FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableFAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableDD_MTOM_CONFLICT(Object arg0, Object arg1) {
+        return messageFactory.getMessage("dd.mtom.conflict", arg0, arg1);
+    }
+
+    /**
+     * Error in Deployment Descriptor : MTOM Configuration in binding {0} conflicts with enable-mtom attribute value {1}
+     *
+     */
+    public static String DD_MTOM_CONFLICT(Object arg0, Object arg1) {
+        return localizer.localize(localizableDD_MTOM_CONFLICT(arg0, arg1));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SoapMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SoapMessages.java
new file mode 100644
index 0000000..84f0b61
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SoapMessages.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class SoapMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.soap");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableSOAP_FAULT_CREATE_ERR(Object arg0) {
+        return messageFactory.getMessage("soap.fault.create.err", arg0);
+    }
+
+    /**
+     * Couldn''t create SOAP Fault due to exception: {0}
+     *
+     */
+    public static String SOAP_FAULT_CREATE_ERR(Object arg0) {
+        return localizer.localize(localizableSOAP_FAULT_CREATE_ERR(arg0));
+    }
+
+    public static Localizable localizableSOAP_MSG_FACTORY_CREATE_ERR(Object arg0) {
+        return messageFactory.getMessage("soap.msg.factory.create.err", arg0);
+    }
+
+    /**
+     * Couldn''t create SOAP message factory due to exception: {0}
+     *
+     */
+    public static String SOAP_MSG_FACTORY_CREATE_ERR(Object arg0) {
+        return localizer.localize(localizableSOAP_MSG_FACTORY_CREATE_ERR(arg0));
+    }
+
+    public static Localizable localizableSOAP_MSG_CREATE_ERR(Object arg0) {
+        return messageFactory.getMessage("soap.msg.create.err", arg0);
+    }
+
+    /**
+     * Couldn''t create SOAP message due to exception: {0}
+     *
+     */
+    public static String SOAP_MSG_CREATE_ERR(Object arg0) {
+        return localizer.localize(localizableSOAP_MSG_CREATE_ERR(arg0));
+    }
+
+    public static Localizable localizableSOAP_FACTORY_CREATE_ERR(Object arg0) {
+        return messageFactory.getMessage("soap.factory.create.err", arg0);
+    }
+
+    /**
+     * Couldn''t create SOAP factory due to exception: {0}
+     *
+     */
+    public static String SOAP_FACTORY_CREATE_ERR(Object arg0) {
+        return localizer.localize(localizableSOAP_FACTORY_CREATE_ERR(arg0));
+    }
+
+    public static Localizable localizableSOAP_PROTOCOL_INVALID_FAULT_CODE(Object arg0) {
+        return messageFactory.getMessage("soap.protocol.invalidFaultCode", arg0);
+    }
+
+    /**
+     * Invalid fault code: {0}
+     *
+     */
+    public static String SOAP_PROTOCOL_INVALID_FAULT_CODE(Object arg0) {
+        return localizer.localize(localizableSOAP_PROTOCOL_INVALID_FAULT_CODE(arg0));
+    }
+
+    public static Localizable localizableSOAP_VERSION_MISMATCH_ERR(Object arg0, Object arg1) {
+        return messageFactory.getMessage("soap.version.mismatch.err", arg0, arg1);
+    }
+
+    /**
+     * Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1}
+     *
+     */
+    public static String SOAP_VERSION_MISMATCH_ERR(Object arg0, Object arg1) {
+        return localizer.localize(localizableSOAP_VERSION_MISMATCH_ERR(arg0, arg1));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/StreamingMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/StreamingMessages.java
new file mode 100644
index 0000000..d35e0d2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/StreamingMessages.java
@@ -0,0 +1,269 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class StreamingMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.streaming");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableFASTINFOSET_DECODING_NOT_ACCEPTED() {
+        return messageFactory.getMessage("fastinfoset.decodingNotAccepted");
+    }
+
+    /**
+     * Fast Infoset decoding is not accepted
+     *
+     */
+    public static String FASTINFOSET_DECODING_NOT_ACCEPTED() {
+        return localizer.localize(localizableFASTINFOSET_DECODING_NOT_ACCEPTED());
+    }
+
+    public static Localizable localizableSTAX_CANT_CREATE() {
+        return messageFactory.getMessage("stax.cantCreate");
+    }
+
+    /**
+     * Unable to create StAX reader or writer
+     *
+     */
+    public static String STAX_CANT_CREATE() {
+        return localizer.localize(localizableSTAX_CANT_CREATE());
+    }
+
+    public static Localizable localizableSTREAMING_IO_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("streaming.ioException", arg0);
+    }
+
+    /**
+     * XML parsing error: {0}
+     *
+     */
+    public static String STREAMING_IO_EXCEPTION(Object arg0) {
+        return localizer.localize(localizableSTREAMING_IO_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableSOURCEREADER_INVALID_SOURCE(Object arg0) {
+        return messageFactory.getMessage("sourcereader.invalidSource", arg0);
+    }
+
+    /**
+     * Unable to create reader from source "{0}"
+     *
+     */
+    public static String SOURCEREADER_INVALID_SOURCE(Object arg0) {
+        return localizer.localize(localizableSOURCEREADER_INVALID_SOURCE(arg0));
+    }
+
+    public static Localizable localizableXMLREADER_UNEXPECTED_STATE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("xmlreader.unexpectedState", arg0, arg1);
+    }
+
+    /**
+     * unexpected XML reader state. expected: {0} but found: {1}
+     *
+     */
+    public static String XMLREADER_UNEXPECTED_STATE(Object arg0, Object arg1) {
+        return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE(arg0, arg1));
+    }
+
+    public static Localizable localizableXMLREADER_IO_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("xmlreader.ioException", arg0);
+    }
+
+    /**
+     * XML reader error: {0}
+     *
+     */
+    public static String XMLREADER_IO_EXCEPTION(Object arg0) {
+        return localizer.localize(localizableXMLREADER_IO_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableFASTINFOSET_NO_IMPLEMENTATION() {
+        return messageFactory.getMessage("fastinfoset.noImplementation");
+    }
+
+    /**
+     * Unable to locate compatible implementation of Fast Infoset in classpath
+     *
+     */
+    public static String FASTINFOSET_NO_IMPLEMENTATION() {
+        return localizer.localize(localizableFASTINFOSET_NO_IMPLEMENTATION());
+    }
+
+    public static Localizable localizableXMLWRITER_IO_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("xmlwriter.ioException", arg0);
+    }
+
+    /**
+     * XML writer error: {0}
+     *
+     */
+    public static String XMLWRITER_IO_EXCEPTION(Object arg0) {
+        return localizer.localize(localizableXMLWRITER_IO_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableXMLREADER_UNEXPECTED_CHARACTER_CONTENT(Object arg0) {
+        return messageFactory.getMessage("xmlreader.unexpectedCharacterContent", arg0);
+    }
+
+    /**
+     * XML reader error: unexpected character content: "{0}"
+     *
+     */
+    public static String XMLREADER_UNEXPECTED_CHARACTER_CONTENT(Object arg0) {
+        return localizer.localize(localizableXMLREADER_UNEXPECTED_CHARACTER_CONTENT(arg0));
+    }
+
+    public static Localizable localizableSTREAMING_PARSE_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("streaming.parseException", arg0);
+    }
+
+    /**
+     * XML parsing error: {0}
+     *
+     */
+    public static String STREAMING_PARSE_EXCEPTION(Object arg0) {
+        return localizer.localize(localizableSTREAMING_PARSE_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableXMLWRITER_NO_PREFIX_FOR_URI(Object arg0) {
+        return messageFactory.getMessage("xmlwriter.noPrefixForURI", arg0);
+    }
+
+    /**
+     * XML writer error: no prefix for URI: "{0}"
+     *
+     */
+    public static String XMLWRITER_NO_PREFIX_FOR_URI(Object arg0) {
+        return localizer.localize(localizableXMLWRITER_NO_PREFIX_FOR_URI(arg0));
+    }
+
+    public static Localizable localizableXMLREADER_NESTED_ERROR(Object arg0) {
+        return messageFactory.getMessage("xmlreader.nestedError", arg0);
+    }
+
+    /**
+     * XML reader error: {0}
+     *
+     */
+    public static String XMLREADER_NESTED_ERROR(Object arg0) {
+        return localizer.localize(localizableXMLREADER_NESTED_ERROR(arg0));
+    }
+
+    public static Localizable localizableSTAXREADER_XMLSTREAMEXCEPTION(Object arg0) {
+        return messageFactory.getMessage("staxreader.xmlstreamexception", arg0);
+    }
+
+    /**
+     * XML stream reader exception: {0}
+     *
+     */
+    public static String STAXREADER_XMLSTREAMEXCEPTION(Object arg0) {
+        return localizer.localize(localizableSTAXREADER_XMLSTREAMEXCEPTION(arg0));
+    }
+
+    public static Localizable localizableXMLWRITER_NESTED_ERROR(Object arg0) {
+        return messageFactory.getMessage("xmlwriter.nestedError", arg0);
+    }
+
+    /**
+     * XML writer error: {0}
+     *
+     */
+    public static String XMLWRITER_NESTED_ERROR(Object arg0) {
+        return localizer.localize(localizableXMLWRITER_NESTED_ERROR(arg0));
+    }
+
+    public static Localizable localizableXMLREADER_ILLEGAL_STATE_ENCOUNTERED(Object arg0) {
+        return messageFactory.getMessage("xmlreader.illegalStateEncountered", arg0);
+    }
+
+    /**
+     * XML reader internal error: illegal state ({0})
+     *
+     */
+    public static String XMLREADER_ILLEGAL_STATE_ENCOUNTERED(Object arg0) {
+        return localizer.localize(localizableXMLREADER_ILLEGAL_STATE_ENCOUNTERED(arg0));
+    }
+
+    public static Localizable localizableXMLREADER_UNEXPECTED_STATE_TAG(Object arg0, Object arg1) {
+        return messageFactory.getMessage("xmlreader.unexpectedState.tag", arg0, arg1);
+    }
+
+    /**
+     * unexpected XML tag. expected: {0} but found: {1}
+     *
+     */
+    public static String XMLREADER_UNEXPECTED_STATE_TAG(Object arg0, Object arg1) {
+        return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE_TAG(arg0, arg1));
+    }
+
+    public static Localizable localizableXMLREADER_UNEXPECTED_STATE_MESSAGE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("xmlreader.unexpectedState.message", arg0, arg1, arg2);
+    }
+
+    /**
+     * unexpected XML reader state. expected: {0} but found: {1}. {2}
+     *
+     */
+    public static String XMLREADER_UNEXPECTED_STATE_MESSAGE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE_MESSAGE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableXMLREADER_PARSE_EXCEPTION(Object arg0) {
+        return messageFactory.getMessage("xmlreader.parseException", arg0);
+    }
+
+    /**
+     * XML parsing error: {0}
+     *
+     */
+    public static String XMLREADER_PARSE_EXCEPTION(Object arg0) {
+        return localizer.localize(localizableXMLREADER_PARSE_EXCEPTION(arg0));
+    }
+
+    public static Localizable localizableXMLRECORDER_RECORDING_ENDED() {
+        return messageFactory.getMessage("xmlrecorder.recording.ended");
+    }
+
+    /**
+     * no more recorded elements available
+     *
+     */
+    public static String XMLRECORDER_RECORDING_ENDED() {
+        return localizer.localize(localizableXMLRECORDER_RECORDING_ENDED());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/UtilMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/UtilMessages.java
new file mode 100644
index 0000000..ea24fa1
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/UtilMessages.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class UtilMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.util");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableUTIL_LOCATION(Object arg0, Object arg1) {
+        return messageFactory.getMessage("util.location", arg0, arg1);
+    }
+
+    /**
+     * at line {0} of {1}
+     *
+     */
+    public static String UTIL_LOCATION(Object arg0, Object arg1) {
+        return localizer.localize(localizableUTIL_LOCATION(arg0, arg1));
+    }
+
+    public static Localizable localizableUTIL_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("util.failed.to.parse.handlerchain.file", arg0, arg1);
+    }
+
+    /**
+     * Could not parse handler chain file {1} for class {0}
+     *
+     */
+    public static String UTIL_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return localizer.localize(localizableUTIL_FAILED_TO_PARSE_HANDLERCHAIN_FILE(arg0, arg1));
+    }
+
+    public static Localizable localizableUTIL_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("util.parser.wrong.element", arg0, arg1, arg2);
+    }
+
+    /**
+     * found element "{1}", expected "{2}" in handler chain configuration (line {0})
+     *
+     */
+    public static String UTIL_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableUTIL_PARSER_WRONG_ELEMENT(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableUTIL_HANDLER_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("util.handler.class.not.found", arg0);
+    }
+
+    /**
+     * "Class: {0} could not be found"
+     *
+     */
+    public static String UTIL_HANDLER_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableUTIL_HANDLER_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableUTIL_HANDLER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+        return messageFactory.getMessage("util.handler.endpoint.interface.no.webservice", arg0);
+    }
+
+    /**
+     * "The Endpoint Interface: {0} does not have WebService Annotation"
+     *
+     */
+    public static String UTIL_HANDLER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+        return localizer.localize(localizableUTIL_HANDLER_ENDPOINT_INTERFACE_NO_WEBSERVICE(arg0));
+    }
+
+    public static Localizable localizableUTIL_HANDLER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return messageFactory.getMessage("util.handler.no.webservice.annotation", arg0);
+    }
+
+    /**
+     * "A WebService annotation is not present on class: {0}"
+     *
+     */
+    public static String UTIL_HANDLER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+        return localizer.localize(localizableUTIL_HANDLER_NO_WEBSERVICE_ANNOTATION(arg0));
+    }
+
+    public static Localizable localizableUTIL_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return messageFactory.getMessage("util.failed.to.find.handlerchain.file", arg0, arg1);
+    }
+
+    /**
+     * Could not find handler chain file {1} for class {0}
+     *
+     */
+    public static String UTIL_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+        return localizer.localize(localizableUTIL_FAILED_TO_FIND_HANDLERCHAIN_FILE(arg0, arg1));
+    }
+
+    public static Localizable localizableUTIL_HANDLER_CANNOT_COMBINE_SOAPMESSAGEHANDLERS() {
+        return messageFactory.getMessage("util.handler.cannot.combine.soapmessagehandlers");
+    }
+
+    /**
+     * You must use HanlderChain annotation, not SOAPMessageHandlers
+     *
+     */
+    public static String UTIL_HANDLER_CANNOT_COMBINE_SOAPMESSAGEHANDLERS() {
+        return localizer.localize(localizableUTIL_HANDLER_CANNOT_COMBINE_SOAPMESSAGEHANDLERS());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java
new file mode 100644
index 0000000..121e285
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class WsdlmodelMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.wsdlmodel");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableWSDL_PORTADDRESS_EPRADDRESS_NOT_MATCH(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("wsdl.portaddress.epraddress.not.match", arg0, arg1, arg2);
+    }
+
+    /**
+     * For Port: {0}, service location {1} does not match address {2} in the EndpointReference
+     *
+     */
+    public static String WSDL_PORTADDRESS_EPRADDRESS_NOT_MATCH(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableWSDL_PORTADDRESS_EPRADDRESS_NOT_MATCH(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableWSDL_IMPORT_SHOULD_BE_WSDL(Object arg0) {
+        return messageFactory.getMessage("wsdl.import.should.be.wsdl", arg0);
+    }
+
+    /**
+     * Import of {0} is violation of BP 1.1 R2001. Proceeding with a warning.
+     * R2001 A DESCRIPTION MUST only use the WSDL "import" statement to import another WSDL description.
+     *
+     */
+    public static String WSDL_IMPORT_SHOULD_BE_WSDL(Object arg0) {
+        return localizer.localize(localizableWSDL_IMPORT_SHOULD_BE_WSDL(arg0));
+    }
+
+    public static Localizable localizableMEX_METADATA_SYSTEMID_NULL() {
+        return messageFactory.getMessage("Mex.metadata.systemid.null");
+    }
+
+    /**
+     * Mex WSDL metadata can not be parsed, the systemId is of the MEX source is null.
+     *
+     */
+    public static String MEX_METADATA_SYSTEMID_NULL() {
+        return localizer.localize(localizableMEX_METADATA_SYSTEMID_NULL());
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsservletMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsservletMessages.java
new file mode 100644
index 0000000..15d440c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsservletMessages.java
@@ -0,0 +1,1913 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class WsservletMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.wsservlet");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableERROR_WSDL_PUBLISHER_CANNOT_READ_CONFIGURATION() {
+        return messageFactory.getMessage("error.wsdlPublisher.cannotReadConfiguration");
+    }
+
+    /**
+     * WSSERVLET46: cannot read configuration
+     *
+     */
+    public static String ERROR_WSDL_PUBLISHER_CANNOT_READ_CONFIGURATION() {
+        return localizer.localize(localizableERROR_WSDL_PUBLISHER_CANNOT_READ_CONFIGURATION());
+    }
+
+    public static Localizable localizableWSSERVLET_22_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET22.diag.check.1");
+    }
+
+    /**
+     * Set endpoint with stub.setTargetEndpoint property
+     *
+     */
+    public static String WSSERVLET_22_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_22_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_33_DIAG_CAUSE_2() {
+        return messageFactory.getMessage("WSSERVLET33.diag.cause.2");
+    }
+
+    /**
+     * When publishing the service wsdl, the http location is patched with the deployed location/endpoint using XSLT transformation. The transformer could not be created to do the transformation.
+     *
+     */
+    public static String WSSERVLET_33_DIAG_CAUSE_2() {
+        return localizer.localize(localizableWSSERVLET_33_DIAG_CAUSE_2());
+    }
+
+    public static Localizable localizableWSSERVLET_33_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET33.diag.cause.1");
+    }
+
+    /**
+     * When publishing the service wsdl, the http location is patched with the deployed location/endpoint using XSLT transformation. The transformer could not be created to do the transformation.
+     *
+     */
+    public static String WSSERVLET_33_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_33_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_DUPLICATE_NAME(Object arg0) {
+        return messageFactory.getMessage("error.implementorRegistry.duplicateName", arg0);
+    }
+
+    /**
+     * WSSERVLET42: duplicate port name: {0}
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_DUPLICATE_NAME(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_DUPLICATE_NAME(arg0));
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_FILE_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("error.implementorRegistry.fileNotFound", arg0);
+    }
+
+    /**
+     * WSSERVLET45: file not found: {0}
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_FILE_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_FILE_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableSERVLET_TRACE_INVOKING_IMPLEMENTOR(Object arg0) {
+        return messageFactory.getMessage("servlet.trace.invokingImplementor", arg0);
+    }
+
+    /**
+     * WSSERVLET21: invoking implementor: {0}
+     *
+     */
+    public static String SERVLET_TRACE_INVOKING_IMPLEMENTOR(Object arg0) {
+        return localizer.localize(localizableSERVLET_TRACE_INVOKING_IMPLEMENTOR(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_17_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET17.diag.cause.1");
+    }
+
+    /**
+     * Two or more endpoints with the same name where found in the jaxrpc-ri.xml runtime descriptor
+     *
+     */
+    public static String WSSERVLET_17_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_17_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableHTML_NON_ROOT_PAGE_BODY_2() {
+        return messageFactory.getMessage("html.nonRootPage.body2");
+    }
+
+    /**
+     * <p>Invalid request URI.</p><p>Please check your deployment information.</p>
+     *
+     */
+    public static String HTML_NON_ROOT_PAGE_BODY_2() {
+        return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_2());
+    }
+
+    public static Localizable localizableHTML_NON_ROOT_PAGE_BODY_1() {
+        return messageFactory.getMessage("html.nonRootPage.body1");
+    }
+
+    /**
+     * <p>A Web Service is installed at this URL.</p>
+     *
+     */
+    public static String HTML_NON_ROOT_PAGE_BODY_1() {
+        return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_1());
+    }
+
+    public static Localizable localizablePUBLISHER_INFO_APPLYING_TRANSFORMATION(Object arg0) {
+        return messageFactory.getMessage("publisher.info.applyingTransformation", arg0);
+    }
+
+    /**
+     * WSSERVLET31: applying transformation with actual address: {0}
+     *
+     */
+    public static String PUBLISHER_INFO_APPLYING_TRANSFORMATION(Object arg0) {
+        return localizer.localize(localizablePUBLISHER_INFO_APPLYING_TRANSFORMATION(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_29_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET29.diag.check.1");
+    }
+
+    /**
+     * Is the port valid? Unzip the war file and make sure the tie and serializers are present
+     *
+     */
+    public static String WSSERVLET_29_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_29_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_TRACE_GOT_REQUEST_FOR_ENDPOINT(Object arg0) {
+        return messageFactory.getMessage("servlet.trace.gotRequestForEndpoint", arg0);
+    }
+
+    /**
+     * WSSERVLET19: got request for endpoint: {0}
+     *
+     */
+    public static String SERVLET_TRACE_GOT_REQUEST_FOR_ENDPOINT(Object arg0) {
+        return localizer.localize(localizableSERVLET_TRACE_GOT_REQUEST_FOR_ENDPOINT(arg0));
+    }
+
+    public static Localizable localizableERROR_SERVLET_INIT_CONFIG_PARAMETER_MISSING(Object arg0) {
+        return messageFactory.getMessage("error.servlet.init.config.parameter.missing", arg0);
+    }
+
+    /**
+     * WSSERVLET47: cannot find configuration parameter: "{0}"
+     *
+     */
+    public static String ERROR_SERVLET_INIT_CONFIG_PARAMETER_MISSING(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_INIT_CONFIG_PARAMETER_MISSING(arg0));
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_FACTORY_SERVANT_INIT_FAILED(Object arg0) {
+        return messageFactory.getMessage("error.implementorFactory.servantInitFailed", arg0);
+    }
+
+    /**
+     * WSSERVLET44: failed to initialize the service implementor for port "{0}"
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_FACTORY_SERVANT_INIT_FAILED(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_SERVANT_INIT_FAILED(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_13_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET13.diag.check.1");
+    }
+
+    /**
+     * Normal web service shutdown
+     *
+     */
+    public static String WSSERVLET_13_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_13_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_31_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET31.diag.cause.1");
+    }
+
+    /**
+     * Transformation being applied
+     *
+     */
+    public static String WSSERVLET_31_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_31_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CHECK_3() {
+        return messageFactory.getMessage("WSSERVLET50.diag.check.3");
+    }
+
+    /**
+     * Check the server.xml file in the domain directory for failures
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CHECK_3() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_3());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_FACTORY_NO_INPUT_STREAM() {
+        return messageFactory.getMessage("error.implementorFactory.noInputStream");
+    }
+
+    /**
+     * WSSERVLET37: no configuration specified
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_FACTORY_NO_INPUT_STREAM() {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NO_INPUT_STREAM());
+    }
+
+    public static Localizable localizableWSSERVLET_24_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET24.diag.cause.1");
+    }
+
+    /**
+     * SOAPFault message is being returned to the client.
+     *
+     */
+    public static String WSSERVLET_24_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_24_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CHECK_2() {
+        return messageFactory.getMessage("WSSERVLET50.diag.check.2");
+    }
+
+    /**
+     * Verify that Application server deployment descriptors are correct in the service war file
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CHECK_2() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_2());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET50.diag.check.1");
+    }
+
+    /**
+     * Verify that sun-jaxws.xml and web.xml are correct in the service war file
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_43_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET43.diag.check.1");
+    }
+
+    /**
+     * Make sure web service is available and public. Examine exception for more details
+     *
+     */
+    public static String WSSERVLET_43_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_43_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_15_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET15.diag.cause.1");
+    }
+
+    /**
+     * Web Services servlet shutdown.
+     *
+     */
+    public static String WSSERVLET_15_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_15_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_27_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET27.diag.check.1");
+    }
+
+    /**
+     * Remove the implicit URL
+     *
+     */
+    public static String WSSERVLET_27_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_27_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_UNKNOWN_NAME(Object arg0) {
+        return messageFactory.getMessage("error.implementorRegistry.unknownName", arg0);
+    }
+
+    /**
+     * WSSERVLET38: unknown port name: {0}
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_UNKNOWN_NAME(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_UNKNOWN_NAME(arg0));
+    }
+
+    public static Localizable localizableSERVLET_HTML_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("servlet.html.notFound", arg0);
+    }
+
+    /**
+     * <h1>404 Not Found: {0}</h1>
+     *
+     */
+    public static String SERVLET_HTML_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableSERVLET_HTML_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_TITLE() {
+        return messageFactory.getMessage("html.rootPage.title");
+    }
+
+    /**
+     * Web Service
+     *
+     */
+    public static String HTML_ROOT_PAGE_TITLE() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_TITLE());
+    }
+
+    public static Localizable localizableWSSERVLET_20_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET20.diag.check.1");
+    }
+
+    /**
+     * Unzip the war, are the tie and serializer classes found?
+     *
+     */
+    public static String WSSERVLET_20_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_20_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableJAXRPCSERVLET_11_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("JAXRPCSERVLET11.diag.cause.1");
+    }
+
+    /**
+     * WSRuntimeInfoParser cauld not parse sun-jaxws.xml runtime descriptor
+     *
+     */
+    public static String JAXRPCSERVLET_11_DIAG_CAUSE_1() {
+        return localizer.localize(localizableJAXRPCSERVLET_11_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_11_DIAG_CHECK_2() {
+        return messageFactory.getMessage("WSSERVLET11.diag.check.2");
+    }
+
+    /**
+     * Please check the jaxrpc-ri.xml file to make sure it is present in the war file
+     *
+     */
+    public static String WSSERVLET_11_DIAG_CHECK_2() {
+        return localizer.localize(localizableWSSERVLET_11_DIAG_CHECK_2());
+    }
+
+    public static Localizable localizableWSSERVLET_11_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET11.diag.check.1");
+    }
+
+    /**
+     * Please check the sun-jaxws.xml file to make sure it is correct
+     *
+     */
+    public static String WSSERVLET_11_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_11_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_22_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET22.diag.cause.1");
+    }
+
+    /**
+     * A request was invoked with no endpoint
+     *
+     */
+    public static String WSSERVLET_22_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_22_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_34_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET34.diag.check.1");
+    }
+
+    /**
+     * Check the log file(s) for more detailed errors/exceptions.
+     *
+     */
+    public static String WSSERVLET_34_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_34_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableERROR_SERVLET_NO_IMPLEMENTOR_FOR_PORT(Object arg0) {
+        return messageFactory.getMessage("error.servlet.noImplementorForPort", arg0);
+    }
+
+    /**
+     * WSSERVLET52: no implementor registered for port: {0}
+     *
+     */
+    public static String ERROR_SERVLET_NO_IMPLEMENTOR_FOR_PORT(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_NO_IMPLEMENTOR_FOR_PORT(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_64_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET64.diag.check.1");
+    }
+
+    /**
+     * Make sure the client request is using text/xml
+     *
+     */
+    public static String WSSERVLET_64_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_64_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_18_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET18.diag.check.1");
+    }
+
+    /**
+     * This may or may not be intentional. If not examine client program for errors.
+     *
+     */
+    public static String WSSERVLET_18_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_18_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_29_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET29.diag.cause.1");
+    }
+
+    /**
+     * A port is specified, but a corresponding service implementation is not found
+     *
+     */
+    public static String WSSERVLET_29_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_29_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableSERVLET_ERROR_NO_RESPONSE_MESSAGE() {
+        return messageFactory.getMessage("servlet.error.noResponseMessage");
+    }
+
+    /**
+     * WSSERVLET23: no response message
+     *
+     */
+    public static String SERVLET_ERROR_NO_RESPONSE_MESSAGE() {
+        return localizer.localize(localizableSERVLET_ERROR_NO_RESPONSE_MESSAGE());
+    }
+
+    public static Localizable localizableSERVLET_HTML_STATUS_ERROR() {
+        return messageFactory.getMessage("servlet.html.status.error");
+    }
+
+    /**
+     * ERROR
+     *
+     */
+    public static String SERVLET_HTML_STATUS_ERROR() {
+        return localizer.localize(localizableSERVLET_HTML_STATUS_ERROR());
+    }
+
+    public static Localizable localizableLISTENER_INFO_INITIALIZE() {
+        return messageFactory.getMessage("listener.info.initialize");
+    }
+
+    /**
+     * WSSERVLET12: JAX-WS context listener initializing
+     *
+     */
+    public static String LISTENER_INFO_INITIALIZE() {
+        return localizer.localize(localizableLISTENER_INFO_INITIALIZE());
+    }
+
+    public static Localizable localizableSERVLET_HTML_NO_INFO_AVAILABLE() {
+        return messageFactory.getMessage("servlet.html.noInfoAvailable");
+    }
+
+    /**
+     * <p>No JAX-WS context information available.</p>
+     *
+     */
+    public static String SERVLET_HTML_NO_INFO_AVAILABLE() {
+        return localizer.localize(localizableSERVLET_HTML_NO_INFO_AVAILABLE());
+    }
+
+    public static Localizable localizableSERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1, Object arg2) {
+        return messageFactory.getMessage("servlet.html.information.table", arg0, arg1, arg2);
+    }
+
+    /**
+     * <table border="0"><tr><td>Address:</td><td>{0}</td></tr><tr><td>WSDL:</td><td><a href="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Port QName:</td><td>{1}</td></tr><tr><td>Implementation class:</td><td>{2}</td></tr></table>
+     *
+     */
+    public static String SERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1, Object arg2) {
+        return localizer.localize(localizableSERVLET_HTML_INFORMATION_TABLE(arg0, arg1, arg2));
+    }
+
+    public static Localizable localizableSERVLET_TRACE_WRITING_FAULT_RESPONSE() {
+        return messageFactory.getMessage("servlet.trace.writingFaultResponse");
+    }
+
+    /**
+     * WSSERVLET24: writing fault response
+     *
+     */
+    public static String SERVLET_TRACE_WRITING_FAULT_RESPONSE() {
+        return localizer.localize(localizableSERVLET_TRACE_WRITING_FAULT_RESPONSE());
+    }
+
+    public static Localizable localizableSERVLET_ERROR_NO_IMPLEMENTOR_FOR_ENDPOINT(Object arg0) {
+        return messageFactory.getMessage("servlet.error.noImplementorForEndpoint", arg0);
+    }
+
+    /**
+     * WSSERVLET20: no implementor for endpoint: {0}
+     *
+     */
+    public static String SERVLET_ERROR_NO_IMPLEMENTOR_FOR_ENDPOINT(Object arg0) {
+        return localizer.localize(localizableSERVLET_ERROR_NO_IMPLEMENTOR_FOR_ENDPOINT(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_13_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET13.diag.cause.1");
+    }
+
+    /**
+     * Context listener shutdown
+     *
+     */
+    public static String WSSERVLET_13_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_13_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CAUSE_3() {
+        return messageFactory.getMessage("WSSERVLET50.diag.cause.3");
+    }
+
+    /**
+     * There may some Application Server initialization problems
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CAUSE_3() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_3());
+    }
+
+    public static Localizable localizableWSSERVLET_32_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET32.diag.check.1");
+    }
+
+    /**
+     * Normal Operation.
+     *
+     */
+    public static String WSSERVLET_32_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_32_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CAUSE_2() {
+        return messageFactory.getMessage("WSSERVLET50.diag.cause.2");
+    }
+
+    /**
+     * Application server deployment descriptors may be incorrect
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CAUSE_2() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_2());
+    }
+
+    public static Localizable localizableWSSERVLET_50_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET50.diag.cause.1");
+    }
+
+    /**
+     * WS runtime sun-jaxws.xml or web.xml may be incorrect
+     *
+     */
+    public static String WSSERVLET_50_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableSERVLET_HTML_STATUS_ACTIVE() {
+        return messageFactory.getMessage("servlet.html.status.active");
+    }
+
+    /**
+     * ACTIVE
+     *
+     */
+    public static String SERVLET_HTML_STATUS_ACTIVE() {
+        return localizer.localize(localizableSERVLET_HTML_STATUS_ACTIVE());
+    }
+
+    public static Localizable localizableWSSERVLET_25_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET25.diag.check.1");
+    }
+
+    /**
+     * Tracing message, normal response.
+     *
+     */
+    public static String WSSERVLET_25_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_25_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_43_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET43.diag.cause.1");
+    }
+
+    /**
+     * Instantiation of the web service failed.
+     *
+     */
+    public static String WSSERVLET_43_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_43_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_27_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET27.diag.cause.1");
+    }
+
+    /**
+     * Implicit URLS are not supported in this realease
+     *
+     */
+    public static String WSSERVLET_27_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_27_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableERROR_SERVLET_CAUGHT_THROWABLE_IN_INIT(Object arg0) {
+        return messageFactory.getMessage("error.servlet.caughtThrowableInInit", arg0);
+    }
+
+    /**
+     * WSSERVLET50: caught throwable during servlet initialization: {0}
+     *
+     */
+    public static String ERROR_SERVLET_CAUGHT_THROWABLE_IN_INIT(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE_IN_INIT(arg0));
+    }
+
+    public static Localizable localizableERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(Object arg0) {
+        return messageFactory.getMessage("error.servlet.caughtThrowableWhileRecovering", arg0);
+    }
+
+    /**
+     * WSSERVLET51: caught throwable while recovering from a previous exception: {0}
+     *
+     */
+    public static String ERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(arg0));
+    }
+
+    public static Localizable localizableNO_SUNJAXWS_XML(Object arg0) {
+        return messageFactory.getMessage("no.sunjaxws.xml", arg0);
+    }
+
+    /**
+     * Runtime descriptor "{0}" is mising
+     *
+     */
+    public static String NO_SUNJAXWS_XML(Object arg0) {
+        return localizer.localize(localizableNO_SUNJAXWS_XML(arg0));
+    }
+
+    public static Localizable localizableSERVLET_HTML_TITLE_2() {
+        return messageFactory.getMessage("servlet.html.title2");
+    }
+
+    /**
+     * <h1>Web Services</h1>
+     *
+     */
+    public static String SERVLET_HTML_TITLE_2() {
+        return localizer.localize(localizableSERVLET_HTML_TITLE_2());
+    }
+
+    public static Localizable localizableLISTENER_INFO_DESTROY() {
+        return messageFactory.getMessage("listener.info.destroy");
+    }
+
+    /**
+     * WSSERVLET13: JAX-WS context listener destroyed
+     *
+     */
+    public static String LISTENER_INFO_DESTROY() {
+        return localizer.localize(localizableLISTENER_INFO_DESTROY());
+    }
+
+    public static Localizable localizableEXCEPTION_TEMPLATE_CREATION_FAILED() {
+        return messageFactory.getMessage("exception.templateCreationFailed");
+    }
+
+    /**
+     * WSSERVLET35: failed to create a template object
+     *
+     */
+    public static String EXCEPTION_TEMPLATE_CREATION_FAILED() {
+        return localizer.localize(localizableEXCEPTION_TEMPLATE_CREATION_FAILED());
+    }
+
+    public static Localizable localizableWSSERVLET_20_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET20.diag.cause.1");
+    }
+
+    /**
+     * Implementation for this service can not be found
+     *
+     */
+    public static String WSSERVLET_20_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_20_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableTRACE_SERVLET_WRITING_FAULT_RESPONSE() {
+        return messageFactory.getMessage("trace.servlet.writingFaultResponse");
+    }
+
+    /**
+     * WSSERVLET61: writing fault response
+     *
+     */
+    public static String TRACE_SERVLET_WRITING_FAULT_RESPONSE() {
+        return localizer.localize(localizableTRACE_SERVLET_WRITING_FAULT_RESPONSE());
+    }
+
+    public static Localizable localizableWSSERVLET_23_DIAG_CHECK_2() {
+        return messageFactory.getMessage("WSSERVLET23.diag.check.2");
+    }
+
+    /**
+     * The request may be malformed and be accepted by the service, yet did not generate a response
+     *
+     */
+    public static String WSSERVLET_23_DIAG_CHECK_2() {
+        return localizer.localize(localizableWSSERVLET_23_DIAG_CHECK_2());
+    }
+
+    public static Localizable localizableWSSERVLET_23_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET23.diag.check.1");
+    }
+
+    /**
+     * If a response was expected, check that a request message was actually sent
+     *
+     */
+    public static String WSSERVLET_23_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_23_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_WARNING_MISSING_CONTEXT_INFORMATION() {
+        return messageFactory.getMessage("servlet.warning.missingContextInformation");
+    }
+
+    /**
+     * WSSERVLET16: missing context information
+     *
+     */
+    public static String SERVLET_WARNING_MISSING_CONTEXT_INFORMATION() {
+        return localizer.localize(localizableSERVLET_WARNING_MISSING_CONTEXT_INFORMATION());
+    }
+
+    public static Localizable localizableWSSERVLET_16_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET16.diag.check.1");
+    }
+
+    /**
+     * Unjar the service war file; check to see that the jaxrpc-ri-runtime.xml file is present
+     *
+     */
+    public static String WSSERVLET_16_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_16_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_34_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET34.diag.cause.1");
+    }
+
+    /**
+     * The location patching on the wsdl failed when attempting to transform.
+     *
+     */
+    public static String WSSERVLET_34_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_34_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableHTML_NON_ROOT_PAGE_TITLE() {
+        return messageFactory.getMessage("html.nonRootPage.title");
+    }
+
+    /**
+     * Web Service
+     *
+     */
+    public static String HTML_NON_ROOT_PAGE_TITLE() {
+        return localizer.localize(localizableHTML_NON_ROOT_PAGE_TITLE());
+    }
+
+    public static Localizable localizableSERVLET_HTML_COLUMN_HEADER_INFORMATION() {
+        return messageFactory.getMessage("servlet.html.columnHeader.information");
+    }
+
+    /**
+     * Information
+     *
+     */
+    public static String SERVLET_HTML_COLUMN_HEADER_INFORMATION() {
+        return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_INFORMATION());
+    }
+
+    public static Localizable localizableWSSERVLET_18_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET18.diag.cause.1");
+    }
+
+    /**
+     * Message sent by client is empty
+     *
+     */
+    public static String WSSERVLET_18_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_18_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_64_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET64.diag.cause.1");
+    }
+
+    /**
+     * Web service requests must be a content type text/xml: WSI BP 1.0
+     *
+     */
+    public static String WSSERVLET_64_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_64_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableINFO_SERVLET_INITIALIZING() {
+        return messageFactory.getMessage("info.servlet.initializing");
+    }
+
+    /**
+     * WSSERVLET56: JAX-WS servlet: init
+     *
+     */
+    public static String INFO_SERVLET_INITIALIZING() {
+        return localizer.localize(localizableINFO_SERVLET_INITIALIZING());
+    }
+
+    public static Localizable localizableSERVLET_INFO_EMPTY_REQUEST_MESSAGE() {
+        return messageFactory.getMessage("servlet.info.emptyRequestMessage");
+    }
+
+    /**
+     * WSSERVLET18: got empty request message
+     *
+     */
+    public static String SERVLET_INFO_EMPTY_REQUEST_MESSAGE() {
+        return localizer.localize(localizableSERVLET_INFO_EMPTY_REQUEST_MESSAGE());
+    }
+
+    public static Localizable localizableSERVLET_ERROR_NO_ENDPOINT_SPECIFIED() {
+        return messageFactory.getMessage("servlet.error.noEndpointSpecified");
+    }
+
+    /**
+     * WSSERVLET22: no endpoint specified
+     *
+     */
+    public static String SERVLET_ERROR_NO_ENDPOINT_SPECIFIED() {
+        return localizer.localize(localizableSERVLET_ERROR_NO_ENDPOINT_SPECIFIED());
+    }
+
+    public static Localizable localizableWSSERVLET_11_DIAG_CAUSE_2() {
+        return messageFactory.getMessage("WSSERVLET11.diag.cause.2");
+    }
+
+    /**
+     * The sun-jaxws.xml runtime deployment descriptor may be missing
+     *
+     */
+    public static String WSSERVLET_11_DIAG_CAUSE_2() {
+        return localizer.localize(localizableWSSERVLET_11_DIAG_CAUSE_2());
+    }
+
+    public static Localizable localizableWSSERVLET_30_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET30.diag.check.1");
+    }
+
+    /**
+     * This could be due to a number of causes. Check the server log file for exceptions.
+     *
+     */
+    public static String WSSERVLET_30_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_30_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableEXCEPTION_CANNOT_CREATE_TRANSFORMER() {
+        return messageFactory.getMessage("exception.cannotCreateTransformer");
+    }
+
+    /**
+     * WSSERVLET33: cannot create transformer
+     *
+     */
+    public static String EXCEPTION_CANNOT_CREATE_TRANSFORMER() {
+        return localizer.localize(localizableEXCEPTION_CANNOT_CREATE_TRANSFORMER());
+    }
+
+    public static Localizable localizableSERVLET_FAULTSTRING_INVALID_SOAP_ACTION() {
+        return messageFactory.getMessage("servlet.faultstring.invalidSOAPAction");
+    }
+
+    /**
+     * WSSERVLET65: Invalid Header SOAPAction required
+     *
+     */
+    public static String SERVLET_FAULTSTRING_INVALID_SOAP_ACTION() {
+        return localizer.localize(localizableSERVLET_FAULTSTRING_INVALID_SOAP_ACTION());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_3_B() {
+        return messageFactory.getMessage("html.rootPage.body3b");
+    }
+
+    /**
+     * '>here.</a></p>
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_3_B() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_3_B());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_3_A() {
+        return messageFactory.getMessage("html.rootPage.body3a");
+    }
+
+    /**
+     * <p>A WSDL description of these ports is available <a href='
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_3_A() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_3_A());
+    }
+
+    public static Localizable localizableWSSERVLET_14_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET14.diag.check.1");
+    }
+
+    /**
+     * Normal Web Service deployment. Deployment of service complete.
+     *
+     */
+    public static String WSSERVLET_14_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_14_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_32_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET32.diag.cause.1");
+    }
+
+    /**
+     * WSDL being generated
+     *
+     */
+    public static String WSSERVLET_32_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_32_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_25_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET25.diag.cause.1");
+    }
+
+    /**
+     * SOAPMessage response is being returned to client
+     *
+     */
+    public static String WSSERVLET_25_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_25_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_44_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET44.diag.check.1");
+    }
+
+    /**
+     * Check the exception for more details. Make sure all the configuration files are correct.
+     *
+     */
+    public static String WSSERVLET_44_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_44_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_28_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET28.diag.check.1");
+    }
+
+    /**
+     * Set target endpoint with stub.setTargetEndpoint() property.
+     *
+     */
+    public static String WSSERVLET_28_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_28_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_INFO_INITIALIZE() {
+        return messageFactory.getMessage("servlet.info.initialize");
+    }
+
+    /**
+     * WSSERVLET14: JAX-WS servlet initializing
+     *
+     */
+    public static String SERVLET_INFO_INITIALIZE() {
+        return localizer.localize(localizableSERVLET_INFO_INITIALIZE());
+    }
+
+    public static Localizable localizableERROR_SERVLET_INIT_CONFIG_FILE_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("error.servlet.init.config.fileNotFound", arg0);
+    }
+
+    /**
+     * WSSERVLET48: config file: "{0}" not found
+     *
+     */
+    public static String ERROR_SERVLET_INIT_CONFIG_FILE_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_INIT_CONFIG_FILE_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableHTML_WSDL_PAGE_TITLE() {
+        return messageFactory.getMessage("html.wsdlPage.title");
+    }
+
+    /**
+     * Web Service
+     *
+     */
+    public static String HTML_WSDL_PAGE_TITLE() {
+        return localizer.localize(localizableHTML_WSDL_PAGE_TITLE());
+    }
+
+    public static Localizable localizableSERVLET_HTML_COLUMN_HEADER_PORT_NAME() {
+        return messageFactory.getMessage("servlet.html.columnHeader.portName");
+    }
+
+    /**
+     * Port Name
+     *
+     */
+    public static String SERVLET_HTML_COLUMN_HEADER_PORT_NAME() {
+        return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_PORT_NAME());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_2_B() {
+        return messageFactory.getMessage("html.rootPage.body2b");
+    }
+
+    /**
+     * </p>
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_2_B() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_2_B());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_2_A() {
+        return messageFactory.getMessage("html.rootPage.body2a");
+    }
+
+    /**
+     * <p>It supports the following ports:
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_2_A() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_2_A());
+    }
+
+    public static Localizable localizableWSSERVLET_21_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET21.diag.check.1");
+    }
+
+    /**
+     * Normal web service invocation.
+     *
+     */
+    public static String WSSERVLET_21_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_21_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableERROR_SERVLET_NO_PORT_SPECIFIED() {
+        return messageFactory.getMessage("error.servlet.noPortSpecified");
+    }
+
+    /**
+     * WSSERVLET53: no port specified in HTTP POST request URL
+     *
+     */
+    public static String ERROR_SERVLET_NO_PORT_SPECIFIED() {
+        return localizer.localize(localizableERROR_SERVLET_NO_PORT_SPECIFIED());
+    }
+
+    public static Localizable localizableINFO_SERVLET_GOT_EMPTY_REQUEST_MESSAGE() {
+        return messageFactory.getMessage("info.servlet.gotEmptyRequestMessage");
+    }
+
+    /**
+     * WSSERVLET55: got empty request message
+     *
+     */
+    public static String INFO_SERVLET_GOT_EMPTY_REQUEST_MESSAGE() {
+        return localizer.localize(localizableINFO_SERVLET_GOT_EMPTY_REQUEST_MESSAGE());
+    }
+
+    public static Localizable localizableWSSERVLET_51_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET51.diag.check.1");
+    }
+
+    /**
+     * Check the server.xml log file for exception information
+     *
+     */
+    public static String WSSERVLET_51_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_51_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_23_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET23.diag.cause.1");
+    }
+
+    /**
+     * The request generated no response from the service
+     *
+     */
+    public static String WSSERVLET_23_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_23_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_16_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET16.diag.cause.1");
+    }
+
+    /**
+     * The jaxrpc-ri.xml file may be missing from the war file
+     *
+     */
+    public static String WSSERVLET_16_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_16_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_35_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET35.diag.check.1");
+    }
+
+    /**
+     * An exception was thrown during creation of the template. View exception and stacktrace for more details.
+     *
+     */
+    public static String WSSERVLET_35_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_35_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_65_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET65.diag.check.1");
+    }
+
+    /**
+     * Add SOAPAction and appropriate value
+     *
+     */
+    public static String WSSERVLET_65_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_65_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableTRACE_SERVLET_HANDING_REQUEST_OVER_TO_IMPLEMENTOR(Object arg0) {
+        return messageFactory.getMessage("trace.servlet.handingRequestOverToImplementor", arg0);
+    }
+
+    /**
+     * WSSERVLET59: handing request over to implementor: {0}
+     *
+     */
+    public static String TRACE_SERVLET_HANDING_REQUEST_OVER_TO_IMPLEMENTOR(Object arg0) {
+        return localizer.localize(localizableTRACE_SERVLET_HANDING_REQUEST_OVER_TO_IMPLEMENTOR(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_19_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET19.diag.check.1");
+    }
+
+    /**
+     * Informational message only. Normal operation.
+     *
+     */
+    public static String WSSERVLET_19_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_19_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizablePUBLISHER_INFO_GENERATING_WSDL(Object arg0) {
+        return messageFactory.getMessage("publisher.info.generatingWSDL", arg0);
+    }
+
+    /**
+     * WSSERVLET32: generating WSDL for endpoint: {0}
+     *
+     */
+    public static String PUBLISHER_INFO_GENERATING_WSDL(Object arg0) {
+        return localizer.localize(localizablePUBLISHER_INFO_GENERATING_WSDL(arg0));
+    }
+
+    public static Localizable localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_URL_PATTERN(Object arg0) {
+        return messageFactory.getMessage("servlet.warning.duplicateEndpointUrlPattern", arg0);
+    }
+
+    /**
+     * WSSERVLET26: duplicate URL pattern in endpoint: {0}
+     *
+     */
+    public static String SERVLET_WARNING_DUPLICATE_ENDPOINT_URL_PATTERN(Object arg0) {
+        return localizer.localize(localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_URL_PATTERN(arg0));
+    }
+
+    public static Localizable localizableHTML_NON_ROOT_PAGE_BODY_3_B() {
+        return messageFactory.getMessage("html.nonRootPage.body3b");
+    }
+
+    /**
+     * '>this page</a> for information about the deployed services.</p>
+     *
+     */
+    public static String HTML_NON_ROOT_PAGE_BODY_3_B() {
+        return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_3_B());
+    }
+
+    public static Localizable localizableWSSERVLET_49_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET49.diag.check.1");
+    }
+
+    /**
+     * Check the server.xml log file for exception information
+     *
+     */
+    public static String WSSERVLET_49_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_49_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableHTML_NON_ROOT_PAGE_BODY_3_A() {
+        return messageFactory.getMessage("html.nonRootPage.body3a");
+    }
+
+    /**
+     * <p>Please refer to <a href='
+     *
+     */
+    public static String HTML_NON_ROOT_PAGE_BODY_3_A() {
+        return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_3_A());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_CANNOT_READ_CONFIGURATION() {
+        return messageFactory.getMessage("error.implementorRegistry.cannotReadConfiguration");
+    }
+
+    /**
+     * WSSERVLET39: cannot read configuration
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_CANNOT_READ_CONFIGURATION() {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_CANNOT_READ_CONFIGURATION());
+    }
+
+    public static Localizable localizableTRACE_SERVLET_GOT_RESPONSE_FROM_IMPLEMENTOR(Object arg0) {
+        return messageFactory.getMessage("trace.servlet.gotResponseFromImplementor", arg0);
+    }
+
+    /**
+     * WSSERVLET60: got response from implementor: {0}
+     *
+     */
+    public static String TRACE_SERVLET_GOT_RESPONSE_FROM_IMPLEMENTOR(Object arg0) {
+        return localizer.localize(localizableTRACE_SERVLET_GOT_RESPONSE_FROM_IMPLEMENTOR(arg0));
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_INCOMPLETE_INFORMATION() {
+        return messageFactory.getMessage("error.implementorRegistry.incompleteInformation");
+    }
+
+    /**
+     * WSSERVLET41: configuration information is incomplete
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_INCOMPLETE_INFORMATION() {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_INCOMPLETE_INFORMATION());
+    }
+
+    public static Localizable localizableWSSERVLET_12_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET12.diag.check.1");
+    }
+
+    /**
+     * Normal web service startup
+     *
+     */
+    public static String WSSERVLET_12_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_12_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_30_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET30.diag.cause.1");
+    }
+
+    /**
+     * There was a server error processing the request
+     *
+     */
+    public static String WSSERVLET_30_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_30_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableHTML_WSDL_PAGE_NO_WSDL() {
+        return messageFactory.getMessage("html.wsdlPage.noWsdl");
+    }
+
+    /**
+     * <p>No WSDL document available for publishing.</p><p>Please check your deployment information.</p>
+     *
+     */
+    public static String HTML_WSDL_PAGE_NO_WSDL() {
+        return localizer.localize(localizableHTML_WSDL_PAGE_NO_WSDL());
+    }
+
+    public static Localizable localizableWSSERVLET_14_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET14.diag.cause.1");
+    }
+
+    /**
+     * Web Services servlet starting up.
+     *
+     */
+    public static String WSSERVLET_14_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_14_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableINFO_SERVLET_DESTROYING() {
+        return messageFactory.getMessage("info.servlet.destroying");
+    }
+
+    /**
+     * WSSERVLET57: JAX-WS servlet: destroy
+     *
+     */
+    public static String INFO_SERVLET_DESTROYING() {
+        return localizer.localize(localizableINFO_SERVLET_DESTROYING());
+    }
+
+    public static Localizable localizableERROR_SERVLET_NO_RESPONSE_WAS_PRODUCED() {
+        return messageFactory.getMessage("error.servlet.noResponseWasProduced");
+    }
+
+    /**
+     * WSSERVLET54: no response was produced (internal error)
+     *
+     */
+    public static String ERROR_SERVLET_NO_RESPONSE_WAS_PRODUCED() {
+        return localizer.localize(localizableERROR_SERVLET_NO_RESPONSE_WAS_PRODUCED());
+    }
+
+    public static Localizable localizableWSSERVLET_26_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET26.diag.check.1");
+    }
+
+    /**
+     * This may cause a problem, please remove duplicate endpoints
+     *
+     */
+    public static String WSSERVLET_26_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_26_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_HTML_TITLE() {
+        return messageFactory.getMessage("servlet.html.title");
+    }
+
+    /**
+     * Web Services
+     *
+     */
+    public static String SERVLET_HTML_TITLE() {
+        return localizer.localize(localizableSERVLET_HTML_TITLE());
+    }
+
+    public static Localizable localizableWSSERVLET_44_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET44.diag.cause.1");
+    }
+
+    /**
+     * The web service was instantiated, however, it could not be initialized
+     *
+     */
+    public static String WSSERVLET_44_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_44_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_63_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET63.diag.check.1");
+    }
+
+    /**
+     * Make sure that your HTTP client is using POST requests, not GET requests
+     *
+     */
+    public static String WSSERVLET_63_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_63_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_28_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET28.diag.cause.1");
+    }
+
+    /**
+     * Target endpoint is null
+     *
+     */
+    public static String WSSERVLET_28_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_28_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_FACTORY_NO_CONFIGURATION() {
+        return messageFactory.getMessage("error.implementorFactory.noConfiguration");
+    }
+
+    /**
+     * WSSERVLET36: no configuration specified
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_FACTORY_NO_CONFIGURATION() {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NO_CONFIGURATION());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_4() {
+        return messageFactory.getMessage("html.rootPage.body4");
+    }
+
+    /**
+     * <p>This endpoint is incorrectly configured. Please check the location and contents of the configuration file.</p>
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_4() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_4());
+    }
+
+    public static Localizable localizableHTML_ROOT_PAGE_BODY_1() {
+        return messageFactory.getMessage("html.rootPage.body1");
+    }
+
+    /**
+     * <p>A Web Service is installed at this URL.</p>
+     *
+     */
+    public static String HTML_ROOT_PAGE_BODY_1() {
+        return localizer.localize(localizableHTML_ROOT_PAGE_BODY_1());
+    }
+
+    public static Localizable localizableEXCEPTION_TRANSFORMATION_FAILED(Object arg0) {
+        return messageFactory.getMessage("exception.transformationFailed", arg0);
+    }
+
+    /**
+     * WSSERVLET34: transformation failed : {0}
+     *
+     */
+    public static String EXCEPTION_TRANSFORMATION_FAILED(Object arg0) {
+        return localizer.localize(localizableEXCEPTION_TRANSFORMATION_FAILED(arg0));
+    }
+
+    public static Localizable localizableSERVLET_HTML_METHOD() {
+        return messageFactory.getMessage("servlet.html.method");
+    }
+
+    /**
+     * WSSERVLET63: must use Post for this type of request
+     *
+     */
+    public static String SERVLET_HTML_METHOD() {
+        return localizer.localize(localizableSERVLET_HTML_METHOD());
+    }
+
+    public static Localizable localizableSERVLET_FAULTSTRING_MISSING_PORT() {
+        return messageFactory.getMessage("servlet.faultstring.missingPort");
+    }
+
+    /**
+     * WSSERVLET28: Missing port information
+     *
+     */
+    public static String SERVLET_FAULTSTRING_MISSING_PORT() {
+        return localizer.localize(localizableSERVLET_FAULTSTRING_MISSING_PORT());
+    }
+
+    public static Localizable localizableWSSERVLET_21_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET21.diag.cause.1");
+    }
+
+    /**
+     * The Web service is being invoked
+     *
+     */
+    public static String WSSERVLET_21_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_21_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableSERVLET_TRACE_WRITING_SUCCESS_RESPONSE() {
+        return messageFactory.getMessage("servlet.trace.writingSuccessResponse");
+    }
+
+    /**
+     * WSSERVLET25: writing success response
+     *
+     */
+    public static String SERVLET_TRACE_WRITING_SUCCESS_RESPONSE() {
+        return localizer.localize(localizableSERVLET_TRACE_WRITING_SUCCESS_RESPONSE());
+    }
+
+    public static Localizable localizableWSSERVLET_33_DIAG_CHECK_2() {
+        return messageFactory.getMessage("WSSERVLET33.diag.check.2");
+    }
+
+    /**
+     * There maybe a tranformation engine may not be supported or compatible. Check the server.xml file for exceptions.
+     *
+     */
+    public static String WSSERVLET_33_DIAG_CHECK_2() {
+        return localizer.localize(localizableWSSERVLET_33_DIAG_CHECK_2());
+    }
+
+    public static Localizable localizableWSSERVLET_33_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET33.diag.check.1");
+    }
+
+    /**
+     * There maybe a tranformation engine being used that is not compatible. Make sure you are using the correct transformer and version.
+     *
+     */
+    public static String WSSERVLET_33_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_33_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_51_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET51.diag.cause.1");
+    }
+
+    /**
+     * Service processing of the request generated an exception; while attempting to return a SOAPPFaultMessage a thowable was again generated
+     *
+     */
+    public static String WSSERVLET_51_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_51_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_24_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET24.diag.check.1");
+    }
+
+    /**
+     * Tracing message fault recorded.
+     *
+     */
+    public static String WSSERVLET_24_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_24_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_17_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET17.diag.check.1");
+    }
+
+    /**
+     * Note that this may cause problems with service deployment
+     *
+     */
+    public static String WSSERVLET_17_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_17_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableWSSERVLET_35_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET35.diag.cause.1");
+    }
+
+    /**
+     * A XSLT stylesheet template is create for the wsdl location patching using transformation. Template create failed.
+     *
+     */
+    public static String WSSERVLET_35_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_35_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_19_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET19.diag.cause.1");
+    }
+
+    /**
+     * Client request for this endpoint arrived
+     *
+     */
+    public static String WSSERVLET_19_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_19_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_65_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET65.diag.cause.1");
+    }
+
+    /**
+     * SOAP Action is required
+     *
+     */
+    public static String WSSERVLET_65_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_65_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableLISTENER_PARSING_FAILED(Object arg0) {
+        return messageFactory.getMessage("listener.parsingFailed", arg0);
+    }
+
+    /**
+     * WSSERVLET11: failed to parse runtime descriptor: {0}
+     *
+     */
+    public static String LISTENER_PARSING_FAILED(Object arg0) {
+        return localizer.localize(localizableLISTENER_PARSING_FAILED(arg0));
+    }
+
+    public static Localizable localizableSERVLET_WARNING_IGNORING_IMPLICIT_URL_PATTERN(Object arg0) {
+        return messageFactory.getMessage("servlet.warning.ignoringImplicitUrlPattern", arg0);
+    }
+
+    /**
+     * WSSERVLET27: unsupported implicit URL pattern in endpoint: {0}
+     *
+     */
+    public static String SERVLET_WARNING_IGNORING_IMPLICIT_URL_PATTERN(Object arg0) {
+        return localizer.localize(localizableSERVLET_WARNING_IGNORING_IMPLICIT_URL_PATTERN(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_49_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET49.diag.cause.1");
+    }
+
+    /**
+     * Service processing of the request generated an exception; while attempting to return a SOAPFaultMessage a thowable was again generated
+     *
+     */
+    public static String WSSERVLET_49_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_49_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(Object arg0) {
+        return messageFactory.getMessage("error.implementorFactory.newInstanceFailed", arg0);
+    }
+
+    /**
+     * WSSERVLET43: failed to instantiate service implementor for port "{0}"
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_12_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET12.diag.cause.1");
+    }
+
+    /**
+     * Context listener starting
+     *
+     */
+    public static String WSSERVLET_12_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_12_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableWSSERVLET_31_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET31.diag.check.1");
+    }
+
+    /**
+     * Normal operation
+     *
+     */
+    public static String WSSERVLET_31_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_31_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_FAULTSTRING_INVALID_CONTENT_TYPE() {
+        return messageFactory.getMessage("servlet.faultstring.invalidContentType");
+    }
+
+    /**
+     * WSSERVLET64: Invalid Content-Type, text/xml required
+     *
+     */
+    public static String SERVLET_FAULTSTRING_INVALID_CONTENT_TYPE() {
+        return localizer.localize(localizableSERVLET_FAULTSTRING_INVALID_CONTENT_TYPE());
+    }
+
+    public static Localizable localizableERROR_SERVLET_CAUGHT_THROWABLE(Object arg0) {
+        return messageFactory.getMessage("error.servlet.caughtThrowable", arg0);
+    }
+
+    /**
+     * WSSERVLET49: caught throwable: {0}
+     *
+     */
+    public static String ERROR_SERVLET_CAUGHT_THROWABLE(Object arg0) {
+        return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE(arg0));
+    }
+
+    public static Localizable localizableTRACE_SERVLET_WRITING_SUCCESS_RESPONSE() {
+        return messageFactory.getMessage("trace.servlet.writingSuccessResponse");
+    }
+
+    /**
+     * WSSERVLET62: writing success response
+     *
+     */
+    public static String TRACE_SERVLET_WRITING_SUCCESS_RESPONSE() {
+        return localizer.localize(localizableTRACE_SERVLET_WRITING_SUCCESS_RESPONSE());
+    }
+
+    public static Localizable localizableERROR_IMPLEMENTOR_REGISTRY_CLASS_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("error.implementorRegistry.classNotFound", arg0);
+    }
+
+    /**
+     * WSSERVLET40: class not found: {0}
+     *
+     */
+    public static String ERROR_IMPLEMENTOR_REGISTRY_CLASS_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_CLASS_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_15_DIAG_CHECK_1() {
+        return messageFactory.getMessage("WSSERVLET15.diag.check.1");
+    }
+
+    /**
+     * Normal Web service undeployment. Undeployment complete.
+     *
+     */
+    public static String WSSERVLET_15_DIAG_CHECK_1() {
+        return localizer.localize(localizableWSSERVLET_15_DIAG_CHECK_1());
+    }
+
+    public static Localizable localizableSERVLET_FAULTSTRING_PORT_NOT_FOUND(Object arg0) {
+        return messageFactory.getMessage("servlet.faultstring.portNotFound", arg0);
+    }
+
+    /**
+     * WSSERVLET29: Port not found ({0})
+     *
+     */
+    public static String SERVLET_FAULTSTRING_PORT_NOT_FOUND(Object arg0) {
+        return localizer.localize(localizableSERVLET_FAULTSTRING_PORT_NOT_FOUND(arg0));
+    }
+
+    public static Localizable localizableSERVLET_INFO_DESTROY() {
+        return messageFactory.getMessage("servlet.info.destroy");
+    }
+
+    /**
+     * WSSERVLET15: JAX-WS servlet destroyed
+     *
+     */
+    public static String SERVLET_INFO_DESTROY() {
+        return localizer.localize(localizableSERVLET_INFO_DESTROY());
+    }
+
+    public static Localizable localizableSERVLET_FAULTSTRING_INTERNAL_SERVER_ERROR(Object arg0) {
+        return messageFactory.getMessage("servlet.faultstring.internalServerError", arg0);
+    }
+
+    /**
+     * WSSERVLET30: Internal server error ({0})
+     *
+     */
+    public static String SERVLET_FAULTSTRING_INTERNAL_SERVER_ERROR(Object arg0) {
+        return localizer.localize(localizableSERVLET_FAULTSTRING_INTERNAL_SERVER_ERROR(arg0));
+    }
+
+    public static Localizable localizableWSSERVLET_26_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET26.diag.cause.1");
+    }
+
+    /**
+     * The endpoint URL is a duplicate
+     *
+     */
+    public static String WSSERVLET_26_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_26_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableSERVLET_HTML_COLUMN_HEADER_STATUS() {
+        return messageFactory.getMessage("servlet.html.columnHeader.status");
+    }
+
+    /**
+     * Status
+     *
+     */
+    public static String SERVLET_HTML_COLUMN_HEADER_STATUS() {
+        return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_STATUS());
+    }
+
+    public static Localizable localizableWSSERVLET_63_DIAG_CAUSE_1() {
+        return messageFactory.getMessage("WSSERVLET63.diag.cause.1");
+    }
+
+    /**
+     * Web service requests must use HTTP POST method: WSI BP 1.0
+     *
+     */
+    public static String WSSERVLET_63_DIAG_CAUSE_1() {
+        return localizer.localize(localizableWSSERVLET_63_DIAG_CAUSE_1());
+    }
+
+    public static Localizable localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_NAME() {
+        return messageFactory.getMessage("servlet.warning.duplicateEndpointName");
+    }
+
+    /**
+     * WSSERVLET17: duplicate endpoint name
+     *
+     */
+    public static String SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME() {
+        return localizer.localize(localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_NAME());
+    }
+
+    public static Localizable localizableTRACE_SERVLET_REQUEST_FOR_PORT_NAMED(Object arg0) {
+        return messageFactory.getMessage("trace.servlet.requestForPortNamed", arg0);
+    }
+
+    /**
+     * WSSERVLET58: got request for port: {0}
+     *
+     */
+    public static String TRACE_SERVLET_REQUEST_FOR_PORT_NAMED(Object arg0) {
+        return localizer.localize(localizableTRACE_SERVLET_REQUEST_FOR_PORT_NAMED(arg0));
+    }
+
+    public static Localizable localizableSERVLET_NO_ADDRESS_AVAILABLE(Object arg0) {
+        return messageFactory.getMessage("servlet.no.address.available", arg0);
+    }
+
+    /**
+     * No address is available for {0}
+     *
+     */
+    public static String SERVLET_NO_ADDRESS_AVAILABLE(Object arg0) {
+        return localizer.localize(localizableSERVLET_NO_ADDRESS_AVAILABLE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java
new file mode 100644
index 0000000..8bbb28f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.resources;
+
+import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
+import com.sun.xml.internal.ws.util.localization.Localizer;
+
+
+/**
+ * Defines string formatting method for each constant in the resource file
+ *
+ */
+public final class XmlmessageMessages {
+
+    private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.xmlmessage");
+    private final static Localizer localizer = new Localizer();
+
+    public static Localizable localizableXML_NULL_HEADERS() {
+        return messageFactory.getMessage("xml.null.headers");
+    }
+
+    /**
+     * Invalid argument. MimeHeaders=null
+     *
+     */
+    public static String XML_NULL_HEADERS() {
+        return localizer.localize(localizableXML_NULL_HEADERS());
+    }
+
+    public static Localizable localizableXML_SET_PAYLOAD_ERR() {
+        return messageFactory.getMessage("xml.set.payload.err");
+    }
+
+    /**
+     * Couldn't set Payload in XMLMessage
+     *
+     */
+    public static String XML_SET_PAYLOAD_ERR() {
+        return localizer.localize(localizableXML_SET_PAYLOAD_ERR());
+    }
+
+    public static Localizable localizableXML_CONTENT_TYPE_MUSTBE_MULTIPART() {
+        return messageFactory.getMessage("xml.content-type.mustbe.multipart");
+    }
+
+    /**
+     * Content-Type needs to be Multipart/Related and with type=text/xml
+     *
+     */
+    public static String XML_CONTENT_TYPE_MUSTBE_MULTIPART() {
+        return localizer.localize(localizableXML_CONTENT_TYPE_MUSTBE_MULTIPART());
+    }
+
+    public static Localizable localizableXML_UNKNOWN_CONTENT_TYPE() {
+        return messageFactory.getMessage("xml.unknown.Content-Type");
+    }
+
+    /**
+     * Unrecognized Content-Type
+     *
+     */
+    public static String XML_UNKNOWN_CONTENT_TYPE() {
+        return localizer.localize(localizableXML_UNKNOWN_CONTENT_TYPE());
+    }
+
+    public static Localizable localizableXML_GET_DS_ERR() {
+        return messageFactory.getMessage("xml.get.ds.err");
+    }
+
+    /**
+     * Couldn't get DataSource
+     *
+     */
+    public static String XML_GET_DS_ERR() {
+        return localizer.localize(localizableXML_GET_DS_ERR());
+    }
+
+    public static Localizable localizableXML_CONTENT_TYPE_PARSE_ERR() {
+        return messageFactory.getMessage("xml.Content-Type.parse.err");
+    }
+
+    /**
+     * Error while parsing MimeHeaders for Content-Type
+     *
+     */
+    public static String XML_CONTENT_TYPE_PARSE_ERR() {
+        return localizer.localize(localizableXML_CONTENT_TYPE_PARSE_ERR());
+    }
+
+    public static Localizable localizableXML_GET_SOURCE_ERR() {
+        return messageFactory.getMessage("xml.get.source.err");
+    }
+
+    /**
+     * Couldn't return Source
+     *
+     */
+    public static String XML_GET_SOURCE_ERR() {
+        return localizer.localize(localizableXML_GET_SOURCE_ERR());
+    }
+
+    public static Localizable localizableXML_CANNOT_INTERNALIZE_MESSAGE() {
+        return messageFactory.getMessage("xml.cannot.internalize.message");
+    }
+
+    /**
+     * Cannot create XMLMessage
+     *
+     */
+    public static String XML_CANNOT_INTERNALIZE_MESSAGE() {
+        return localizer.localize(localizableXML_CANNOT_INTERNALIZE_MESSAGE());
+    }
+
+    public static Localizable localizableXML_NO_CONTENT_TYPE() {
+        return messageFactory.getMessage("xml.no.Content-Type");
+    }
+
+    /**
+     * MimeHeaders doesn't contain Content-Type header
+     *
+     */
+    public static String XML_NO_CONTENT_TYPE() {
+        return localizer.localize(localizableXML_NO_CONTENT_TYPE());
+    }
+
+    public static Localizable localizableXML_ROOT_PART_INVALID_CONTENT_TYPE(Object arg0) {
+        return messageFactory.getMessage("xml.root.part.invalid.Content-Type", arg0);
+    }
+
+    /**
+     * Bad Content-Type for Root Part : {0}
+     *
+     */
+    public static String XML_ROOT_PART_INVALID_CONTENT_TYPE(Object arg0) {
+        return localizer.localize(localizableXML_ROOT_PART_INVALID_CONTENT_TYPE(arg0));
+    }
+
+    public static Localizable localizableXML_INVALID_CONTENT_TYPE(Object arg0) {
+        return messageFactory.getMessage("xml.invalid.content-type", arg0);
+    }
+
+    /**
+     * Invalid Content-Type: {0}
+     *
+     */
+    public static String XML_INVALID_CONTENT_TYPE(Object arg0) {
+        return localizer.localize(localizableXML_INVALID_CONTENT_TYPE(arg0));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/addressing.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/addressing.properties
new file mode 100644
index 0000000..7d1be28
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/addressing.properties
@@ -0,0 +1,53 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+wrong.addressing.version=Expected "{0}" version of WS-Addressing but found "{1}"
+replyTo.cannot.parse=ReplyTo header cannot be parsed
+faultTo.cannot.parse=FaultTo header cannot be parsed
+unknown.wsa.header=Unknown WS-Addressing header
+invalid.wsaw.anonymous=Invalid value obtained from wsaw:Anonymous: "{0}"
+wsaw.anonymousProhibited=Operation has "prohibited" value for wsaw:anonymous in the WSDL, \
+  Addressing must be disabled and SOAP message need to be hand-crafted
+null.addressing.version=Unexpected null Addressing version
+null.soap.version=Unexpected null SOAP version
+wsdlBoundOperation.notFound=Cannot find an operation in wsdl:binding for "{0}"
+null.binding=Populating request Addressing headers and found null Binding
+null.wsdlPort=Populating request Addressing headers and found null WSDLPort
+null.packet=Populating request Addressing headers and found null Packet
+null.action=Populating request Addressing headers and found null Action
+null.message=Null message found when processing the server inbound request and WS-Addressing is required
+null.headers=No headers found when processing the server inbound request and WS-Addressing is required
+null.wsa.headers=No WS-Addressing headers found processing the server inbound request
+addressing.notEnabled=Addressing is not enabled, {0} should not be included in the pipeline"
+validation.client.nullAction=Validating inbound Addressing headers on client and found null Action
+validation.server.nullAction=Validating inbound Addressing headers on server and found null Action
+
+nonAnonymous.response=Sending 202 and processing non-anonymous response
+nonAnonymous.unknown.protocol=Unknown protocol: "{0}"
+nonAnonymous.response.sending=Sending non-anonymous reply to "{0}"
+nonAnonymous.response.nullHeaders=No response headers found in non-anonymous response from "{0}"
+nonAnonymous.response.nullMessage=No message for non-anonymous response from "{0}"
+nonAnonymous.response.oneway=Ignoring non-anonymous response for one-way message
+ 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/client.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/client.properties
index ceb5b87..8fc77d2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/client.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/client.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 http.client.cannot.connect=cannot connect to server: {0}
 http.client.failed=HTTP transport error: {0}
@@ -29,15 +29,26 @@
 http.client.cannotCreateMessageFactory=cannot create message factory
 http.client.unauthorized=request requires HTTP authentication: {0}
 http.not.found=HTTP Status-Code 404: Not Found - {0}
-http.status.code=HTTP Status-Code {0}: {1}
-invalid.port.name={0} is not a valid port. Valid ports:{1}
+http.status.code=The server sent HTTP status code {0}: {1}
+invalid.port.name={0} is not a valid port. Valid ports are: {1}
+invalid.epr.port.name=Endpoint Name specified in EPR {0}  is not a WSDL port QName, valid Ports are {1}
+invalid.service.name={0} is not a valid service. Valid services are: {1}
+invalid.service.name.null={0} is not a valid service
+invalid.service.no.wsdl=No wsdl metadata for service: {0}, can't create proxy! Try creating Service by providing a WSDL URL
 invalid.binding.id=Invalid binding id: {0}. Must be: {1}
 invalid.soap.role.none=Cannot set SOAP 1.2 role "none"
 non.logical.handler.set=Cannot set {0} on binding. Handler must be a LogicalHandler.
-runtime.parser.wsdl.invalidElement=invalid element \"{1}\" in the WSDL (line {0})
-service.noServiceName=Can't create service! Service name must be non-null
-service.noWSDLUrl=No wsdl metadata with the Service, can't create proxy! Try creating Service by providing a WSDL URL
-service.invalidPort=Port {0} is not found in service {1} in the wsdl {2}
-service.noPortName=No corresponding port found for the service interface {0} in {1}
-service.invalidServiceName=Cannot create Service instance, service {0} not found in the WSDL {1}
+runtime.wsdlparser.invalidWSDL=Invalid WSDL {0}, expected {1} found {2} at (line{3})
+undefined.binding=Undefined binding: {0}
+undefined.portType=Undefined port type: {0}
+failed.to.parse.epr=Failed to parse EPR: {0}
+epr.without.addressing.on=EPR is specified without enabling WS-Addressing support.
+invalid.wsdl.url=Invalid WSDL URL: {0}
+wsdl.not.found=WSDL url {0} is not accessible.
+invalid.address=Invalid address: {0}
+unsupported.operation={0} not supported with {1}. Must be: {2}
+invalid.soap.action=A valid SOAPAction should be set in the RequestContext when Addressing is enabled, \
+  Use BindingProvider.SOAPACTION_URI_PROPERTY to set it.
+failed.to.parseWithMEX=Failed to access the WSDL at: {0}. It failed with: \n\t{1}.\nRetrying with MEX gave: \n\t{2}
+failed.to.parse=Failed to access the WSDL at: {0}. It failed with: \n\t{1}.
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties
index 3ab8314..de9e2c9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,5 +21,22 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
+
+invalid.nullarg.soap.msgmode=SOAP/HTTP Binding in {0} is not allowed with a null invocation argument. Must be: {1}
+invalid.nullarg.xmlhttp.request.method=A XML/HTTP request using MessageContext.HTTP_REQUEST_METHOD equals {0} with a Null invocation Argument is not allowed. Must be: {1}
+invalid.response=No response returned.
+invalid.response.deserialization=Failed to deserialize the response.
+invalid.datasource.dispatch.msgmode=Can not create Dispatch<DataSource> of Service.Mode.PAYLOAD{0}. Must be: {1}
+invalid.soapmessage.dispatch.msgmode=Can not create Dispatch<SOAPMessage> of {0}. Must be {1}.
+invalid.datasource.dispatch.binding=Can not create Dispatch<DataSource> with {0}. Must be: {1}
+invalid.soapmessage.dispatch.binding=Can not create Dispatch<SOAPMessage> with {0} Binding. Must be: {1} Binding.
+invalid.query.string=Unable to resolve endpoint address using the supplied query string: {0}.
+invalid.uri.path.query=Unable to construct a URI with this path info {0} and this query string {1}.
+invalid.uri=Endpoint String: {0} is and invalid URI.
+invalid.uri.decode=Unable to decode the resolved endpoint using UTF-8 encoding.
+invalid.uri.resolution=Unable to resolve endpoint address using the supplied path: {0}.
+duplicate.port=WSDLPort {0} already exists. Can not create a port of the same QName.
+invalid.query.leading.char=Leading '?' of MessageContext.QUERY_STRING: {0} is not valid. Remove '?' and run again.
+duplicate.port=WSDLPort {0} already exists. Can not create a port of the same QName.
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties
index f70e8e7..58c1675 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,13 +21,14 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 #nested
 nestedSerializationError=serialization error: {0}
 nestedDeserializationError=deserialization error: {0}
 nestedEncodingError=encoding error: {0}
 
+noSuchContentId=There''s no attachment for the content ID "{0}"
 
 #EncoderDecoder
 exception.notfound=exception class: {0} not found in the model!
@@ -36,5 +37,6 @@
 unknown.object=don\'t know how to write object: {0}
 xsd.unknownPrefix=unknown prefix \"{0}\"
 xsd.unexpectedElementName=unexpected element name: expected={0}, actual: {1}
-mime.contentId.part=Can't associated the Content-ID \"{0}\" to a WSDL part, the Content-Id might not be formatted as per R2933 defined in AP 1.0.  
+
+failed.to.read.response=Failed to read a response: {0}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties
index 407634d..44360c8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 handler.nestedError=handler error: {0}
 handler.chain.contains.handler.only=A HandlerChain can only contain Handler instances: {0}
@@ -29,4 +29,5 @@
 cannot.extend.handler.directly=Handler {0} must implement LogicalHandler or SOAPHandler.
 handler.not.valid.type= {0} does not implement one of the handler interfaces.
 handler.messageContext.invalid.class= \"{0}\" is not an allowed value for the property \"{1}\"
+handler.predestroy.ignore=Exception ignored from invoking handler @PreDestroy method: {0}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties
index c738f31..051ad56 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
-html.title=Web Services
-html.notFound=<h1>404 Not Found: {0}</h1>
 unexpected.http.method=Cannot handle HTTP method: {0}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties
index b5d31b0..e96d514 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,18 +21,29 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
-nestedModelernError=runtime modeler error: {0}
+nestedModelerError=runtime modeler error: {0}
 
 runtime.modeler.no.webservice.annotation=A WebService annotation is not present on class: {0}
 runtime.modeler.endpoint.interface.no.webservice=The Endpoint Interface: {0} does not have WebService Annotation
 runtime.modeler.class.not.found=class: {0} could not be found
+runtime.modeler.wrapper.not.found=Wrapper class {0} is not found. Have you run APT to generate them?
 runtime.modeler.method.not.found=method: {0} could not be found on class: {1}
+runtime.modeler.webmethod.must.be.public=@WebMethod is not allowed on a non-public method {0}
+runtime.modeler.webmethod.must.be.nonstatic=@WebMethod is not allowed on a static method {0}  
 runtime.modeler.oneway.operation.no.out.parameters=oneway operation should not have out parameters class: {0} method: {1}
 runtime.modeler.cannot.get.serviceName.from.interface=The serviceName cannot be retrieved from an interface.  class {0}
 runtime.modeler.portname.servicename.namespace.mismatch=The namespace of the serviceName \"{0}\" and the namespace of the portName \"{1}\" must match
 runtime.modeler.no.package=A @WebService.targetNamespace must be specified on classes with no package.  Class: {0}
 runtime.modeler.no.operations=The web service defined by the class {0} does not contain any valid WebMethods.
-runtime.operation.noBinding=Binding for operation {0} in port {1} not found! Probably WSDL doesn't contain binding for this operation.
+runtime.modeler.mtom.conflict = Error in  @BindingType: MTOM Configuration in binding identifier {0} conflicts with feature @MTOM {1}
+runtime.modeler.feature.conflict= Feature {0} in implementation conflicts with {1} in WSDL configuration 
+
+runtime.modeler.wsfeature.no.ftrconstructor=Annotation {0} is not recognizable, atleast one constructor of {1} should be marked with @FeatureConstructor
+runtime.modeler.wsfeature.morethanone.ftrconstructor=Annotation {0} is illegal, Only one constructor of {1} can be marked as @FeatureConstructor
+runtime.modeler.wsfeature.illegal.ftrconstructor=Annotation {0} is illegal, In {1} @FeatureConstructor value does n't match the constructor parameters
+
+unable.to.create.JAXBContext=Unable to create JAXBContext due to the security restriction
+not.a.valid.bare.method=SEI {0} has method {1} annotated as BARE but it has more than one parameter bound to body. This is invalid. Please annotate the method with annotation: @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/providerApi.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/providerApi.properties
new file mode 100644
index 0000000..6585175
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/providerApi.properties
@@ -0,0 +1,35 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+null.address=Address in an EPR cannot be null
+null.address.service.endpoint=Address in an EPR cannot be null, when serviceName or portName is null
+null.service=serviceName can't be null when portName is specified
+null.portname=EPR does n't have EndpointName in the Metadata
+null.wsdl= EPR does n't have WSDL Metadata which is needed for the current operation
+notfound.service.in.wsdl= Service: {0} not found in WSDL: {1}
+notfound.port.in.wsdl=Port: {0} not a valid port in Service: {1} in WSDL: {2}
+error.wsdl= Error in parsing WSDL: {0}
+null.epr= EndpointReference is null
+ 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties
index 54b039a..8cb8204 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 sender.nestedError=sender error: {0}
 sender.request.messageNotReady=message not ready to be sent
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/server.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/server.properties
index 8aa1529..35e73a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/server.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/server.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 soapdecoder.err=Error in decoding SOAP Message
 server.rt.err=Server Runtime Error: {0}
@@ -40,7 +40,10 @@
 
 runtime.wsdl.patcher=error while patching WSDL related document
 
-not.implement.provider=Class \"{0}\" doesn't implement Provider
+not.implement.provider=\"{0}\" doesn't implement Provider
+provider.not.parameterized=\"{0}\" implements Provider but doesn't specify the type parameter
+provider.invalid.parameterType=\"{0}\" implements Provider but its type parameter {1} is incorrect
+
 wsdl.required=wsdl is required
 service.name.required=Service QName is not found
 port.name.required=Port QName is not found
@@ -50,15 +53,9 @@
 already.https.server=There is already a HTTPS server at : {0}
 not.HttpContext.type=Required com.sun.net.httpserver.HttpContext. Got : {0}
 
-cannot.load.wsdl=WSDL cannot be loaded from given location : {0}
-
-not.primary.wsdl=WSDL specified by wsdlLocation={0} is not a primary WSDL.
 duplicate.primary.wsdl=Metadata has more than one WSDL that has Service definiton for the endpoint. WSDL={0} is one such WSDL.
 duplicate.abstract.wsdl=Metadata has more than one WSDL that has PortType definiton for the endpoint. WSDL={0} is one such WSDL.
-no.ws.annotation=Endpoint implementation {0} doesn''t have @WebService or @WebServiceProvider annotation
-both.ws.annotations=Endpoint implementation {0} cannot have both @WebService and @WebServiceProvider annotations
 
-runtime.parser.wrong.wsdl.location=Incorrect WSDL localtion: {0}. It should start with WEB-INF/wsdl
 runtime.parser.classNotFound=class not found in runtime descriptor: {0}
 runtime.parser.xmlReader=error parsing runtime descriptor: {0}
 runtime.parser.invalidReaderState=error parsing runtime descriptor: {0}
@@ -70,10 +67,36 @@
 runtime.parser.invalid.attribute.value=invalid attribute value \"{1}\" in runtime descriptor (line {0})
 runtime.parser.missing.attribute.no.line=missing attribute \"{2}\" in element \"{1}\" of runtime descriptor
 runtime.parser.wrong.element=found element \"{1}\", expected \"{2}\" in runtime descriptor (line {0})
+runtime.parser.wsdl.not.found={0} is not found in the WAR file. Package it in the WAR file or correct it in sun-jaxws.xml.
 runtime.parser.wsdl=exception during WSDL parsing: {0}
 runtime.saxparser.exception={0}\n{1}
 runtime.parser.wsdl.noservice=can\'t apply binding! service {0} not found in the WSDL {1}
 runtime.parser.wsdl.nobinding=can\'t apply binding! no binding found for binding ID {0] for service {1} in WSDL {2}
 runtime.parser.wsdl.multiplebinding=multiple bindings found for binding ID {0} for service {1} in WSDL {2}
-runtime.parser.wsdl.incorrectserviceport=could not get binding from WSDL! service: {0} or port {1} not found in the WSDL {2}
+runtime.parser.wsdl.incorrectserviceport=could not get binding from WSDL! service: {0} or port {1} not found in the WSDL {2}.\n\
+  It could be because service and port names do not match WSDL''s wsdl:service and wsdl:port names:\n\
+    1. service and port names are not there in deployment descriptor OR\n\
+    2. Either there is a typo in deployment descriptor''s service and port names OR\n\
+    3. The computed names from @WebService do not match wsdl:service and wsdl:port names\n\
+  Suggest doing the following:\n\
+    1. Add/Correct entries for service and port names in deployment descriptor OR \n\
+    2. Specify targetNamespace, serviceName, portName in @WebService on the endpoint class
+
+stateful.cookie.header.required=This is a stateful web service and {0} header is required.
+stateful.cookie.header.incorrect=Invalid/expired {0} header value: {1}
+stateful.invalid.webservice.context=Not a WebServiceContext from JAX-WS RI: {0}
+stateful.requres.addressing=Stateful web service {0} requires the WS-Addressing support to be enabled. Perhaps you are missing @Addressing
+
+no.current.packet=This thread is not currently processing any web service request.
+
+failed.to.instantiate.instanceResolver=Unable to instantiate {0} (which is specified in {1} on {2})
+
+static.resource.injection.only=Static resource {0} cannot be injected to non-static "{1}"
+
+dd.mtom.conflict = Error in Deployment Descriptor : MTOM Configuration in binding {0} conflicts with enable-mtom attribute value {1}
+
+dispatch.cannotFindMethod=Cannot find dispatch method for {0} using "{1}"
+unsupported.contentType=Unsupported Content-Type: {0} Supported ones are: {1}
+no.contentType=Request doesn't have a Content-Type
+duplicate.portKnownHeader=Received SOAP message contains duplicate header: {0} for a bound parameter
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties
index b9aafe4..24298d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,11 +21,12 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 soap.msg.create.err=Couldn''t create SOAP message due to exception: {0}
 soap.msg.factory.create.err=Couldn''t create SOAP message factory due to exception: {0}
 soap.protocol.invalidFaultCode=Invalid fault code: {0}
 soap.factory.create.err=Couldn''t create SOAP factory due to exception: {0}
 soap.fault.create.err=Couldn''t create SOAP Fault due to exception: {0}
+soap.version.mismatch.err=Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1} 
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties
index 59bd9b3..f345b07 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 streaming.ioException=XML parsing error: {0}
 streaming.parseException=XML parsing error: {0}
@@ -44,6 +44,7 @@
 stax.cantCreate=Unable to create StAX reader or writer
 staxreader.xmlstreamexception=XML stream reader exception: {0}
 
+fastinfoset.decodingNotAccepted=Fast Infoset decoding is not accepted
 fastinfoset.noImplementation=Unable to locate compatible implementation of Fast Infoset in classpath
 
 sourcereader.invalidSource=Unable to create reader from source \"{0}\"
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/util.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/util.properties
index 8834ab8..a348963 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/util.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/util.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 util.handler.no.webservice.annotation="A WebService annotation is not present on class: {0}"
 util.handler.endpoint.interface.no.webservice="The Endpoint Interface: {0} does not have WebService Annotation"
@@ -30,4 +30,5 @@
 util.parser.wrong.element=found element \"{1}\", expected \"{2}\" in handler chain configuration (line {0})
 util.failed.to.find.handlerchain.file=Could not find handler chain file {1} for class {0}
 util.failed.to.parse.handlerchain.file=Could not parse handler chain file {1} for class {0}
+util.location=at line {0} of {1}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties
new file mode 100644
index 0000000..bd8d2b2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties
@@ -0,0 +1,31 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+Mex.metadata.systemid.null=Mex WSDL metadata can not be parsed, the systemId is of the MEX source is null.
+wsdl.import.should.be.wsdl=Import of {0} is violation of BP 1.1 R2001. Proceeding with a warning.\n\
+  R2001 A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description.
+wsdl.portaddress.epraddress.not.match= For Port: {0}, service location {1} does not match address {2} \
+  in the EndpointReference
+ 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties
index cf2db70..eb1b4bd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,10 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
-# the following properties are used by the http package
+no.sunjaxws.xml=Runtime descriptor "{0}" is mising
+
 listener.parsingFailed=WSSERVLET11: failed to parse runtime descriptor: {0}
 JAXRPCSERVLET11.diag.cause.1=WSRuntimeInfoParser cauld not parse sun-jaxws.xml runtime descriptor
 WSSERVLET11.diag.check.1=Please check the sun-jaxws.xml file to make sure it is correct
@@ -172,6 +173,8 @@
 WSSERVLET65.diag.cause.1=SOAP Action is required
 WSSERVLET65.diag.check.1=Add SOAPAction and appropriate value
 
+servlet.no.address.available=No address is available for {0}
+
 servlet.html.title= Web Services
 servlet.html.title2=<h1>Web Services</h1>
 servlet.html.noInfoAvailable=<p>No JAX-WS context information available.</p>
@@ -180,7 +183,7 @@
 servlet.html.columnHeader.information=Information
 servlet.html.status.active=ACTIVE
 servlet.html.status.error=ERROR
-servlet.html.information.table=<table border\='0'><tr><td>Address\:</td><td>{0}</td></tr><tr><td>WSDL\:</td><td><a href\="{3}">{3}</a></td></tr><tr><td>Port QName\:</td><td>{1}</td></tr><tr><td>Implementation class\:</td><td>{2}</td></tr></table>
+servlet.html.information.table=<table border=\"0\"><tr><td>Address\:</td><td>{0}</td></tr><tr><td>WSDL\:</td><td><a href\="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Port QName\:</td><td>{1}</td></tr><tr><td>Implementation class\:</td><td>{2}</td></tr></table>
 servlet.html.notFound=<h1>404 Not Found: {0}</h1>
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties
index 177f013..70a418e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 xml.null.headers=Invalid argument. MimeHeaders=null
 xml.no.Content-Type=MimeHeaders doesn't contain Content-Type header
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java
new file mode 100644
index 0000000..1b2ca5f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.ResourceInjector;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.util.localization.Localizable;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Partial implementation of {@link InstanceResolver} with
+ * convenience methods to do the resource injection.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractInstanceResolver<T> extends InstanceResolver<T> {
+
+    /**
+     * Encapsulates which field/method the injection is done,
+     * and performs the injection.
+     */
+    protected static interface InjectionPlan<T,R> {
+        void inject(T instance,R resource);
+        /**
+         * Gets the number of injections to be performed.
+         */
+        int count();
+    }
+
+    /**
+     * Injects to a field.
+     */
+    protected static class FieldInjectionPlan<T,R> implements InjectionPlan<T,R> {
+        private final Field field;
+
+        public FieldInjectionPlan(Field field) {
+            this.field = field;
+        }
+
+        public void inject(final T instance, final R resource) {
+            AccessController.doPrivileged(new PrivilegedAction<Object>() {
+                public Object run() {
+                    try {
+                        if (!field.isAccessible()) {
+                            field.setAccessible(true);
+                        }
+                        field.set(instance,resource);
+                        return null;
+                    } catch (IllegalAccessException e) {
+                        throw new ServerRtException("server.rt.err",e);
+                    }
+                }
+            });
+        }
+
+        public int count() {
+            return 1;
+        }
+    }
+
+    /**
+     * Injects to a method.
+     */
+    protected static class MethodInjectionPlan<T,R> implements InjectionPlan<T,R> {
+        private final Method method;
+
+        public MethodInjectionPlan(Method method) {
+            this.method = method;
+        }
+
+        public void inject(T instance, R resource) {
+            invokeMethod(method, instance, resource);
+        }
+
+        public int count() {
+            return 1;
+        }
+    }
+
+    /**
+     * Combines multiple {@link InjectionPlan}s into one.
+     */
+    private static class Compositor<T,R> implements InjectionPlan<T,R> {
+        private final InjectionPlan<T,R>[] children;
+
+        public Compositor(Collection<InjectionPlan<T,R>> children) {
+            this.children = children.toArray(new InjectionPlan[children.size()]);
+        }
+
+        public void inject(T instance, R res) {
+            for (InjectionPlan<T,R> plan : children)
+                plan.inject(instance,res);
+        }
+
+        public int count() {
+            int r = 0;
+            for (InjectionPlan<T, R> plan : children)
+                r += plan.count();
+            return r;
+        }
+    }
+
+    protected static ResourceInjector getResourceInjector(WSEndpoint endpoint) {
+        ResourceInjector ri = endpoint.getContainer().getSPI(ResourceInjector.class);
+        if(ri==null)
+            ri = ResourceInjector.STANDALONE;
+        return ri;
+    }
+
+    /**
+     * Helper for invoking a method with elevated privilege.
+     */
+    protected static void invokeMethod(final @Nullable Method method, final Object instance, final Object... args) {
+        if(method==null)    return;
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
+                try {
+                    if (!method.isAccessible()) {
+                        method.setAccessible(true);
+                    }
+                    method.invoke(instance,args);
+                } catch (IllegalAccessException e) {
+                    throw new ServerRtException("server.rt.err",e);
+                } catch (InvocationTargetException e) {
+                    throw new ServerRtException("server.rt.err",e);
+                }
+                return null;
+            }
+        });
+    }
+
+    /**
+     * Finds the method that has the given annotation, while making sure that
+     * there's only at most one such method.
+     */
+    protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
+        boolean once = false;
+        Method r = null;
+        for(Method method : clazz.getDeclaredMethods()) {
+            if (method.getAnnotation(annType) != null) {
+                if (once)
+                    throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
+                if (method.getParameterTypes().length != 0)
+                    throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
+                r = method;
+                once = true;
+            }
+        }
+        return r;
+    }
+
+    /**
+     * Creates an {@link InjectionPlan} that injects the given resource type to the given class.
+     *
+     * @param isStatic
+     *      Only look for static field/method
+     *
+     */
+    protected static <T,R>
+    InjectionPlan<T,R> buildInjectionPlan(Class<? extends T> clazz, Class<R> resourceType, boolean isStatic) {
+        List<InjectionPlan<T,R>> plan = new ArrayList<InjectionPlan<T,R>>();
+
+        for(Field field: clazz.getDeclaredFields()) {
+            Resource resource = field.getAnnotation(Resource.class);
+            if (resource != null) {
+                if(isInjectionPoint(resource, field.getType(),
+                    ServerMessages.localizableWRONG_FIELD_TYPE(field.getName()),resourceType)) {
+
+                    if(isStatic && !Modifier.isStatic(field.getModifiers()))
+                        throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,field));
+
+                    plan.add(new FieldInjectionPlan<T,R>(field));
+                }
+            }
+        }
+
+        for(Method method : clazz.getDeclaredMethods()) {
+            Resource resource = method.getAnnotation(Resource.class);
+            if (resource != null) {
+                Class[] paramTypes = method.getParameterTypes();
+                if (paramTypes.length != 1)
+                    throw new ServerRtException(ServerMessages.WRONG_NO_PARAMETERS(method));
+                if(isInjectionPoint(resource,paramTypes[0],
+                    ServerMessages.localizableWRONG_PARAMETER_TYPE(method.getName()),resourceType)) {
+
+                    if(isStatic && !Modifier.isStatic(method.getModifiers()))
+                        throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,method));
+
+                    plan.add(new MethodInjectionPlan<T,R>(method));
+                }
+            }
+        }
+
+        return new Compositor<T,R>(plan);
+    }
+
+    /**
+     * Returns true if the combination of {@link Resource} and the field/method type
+     * are consistent for {@link WebServiceContext} injection.
+     */
+    private static boolean isInjectionPoint(Resource resource, Class fieldType, Localizable errorMessage, Class resourceType ) {
+        Class t = resource.type();
+        if (t.equals(Object.class)) {
+            return fieldType.equals(resourceType);
+        } else if (t.equals(resourceType)) {
+            if (fieldType.isAssignableFrom(resourceType)) {
+                return true;
+            } else {
+                // type compatibility error
+                throw new ServerRtException(errorMessage);
+            }
+        }
+        return false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractMultiInstanceResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractMultiInstanceResolver.java
new file mode 100644
index 0000000..0e70d51
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractMultiInstanceResolver.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.ResourceInjector;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WSWebServiceContext;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.lang.reflect.Method;
+
+/**
+ * Partial implementation of {@link InstanceResolver} with code
+ * to handle multiple instances per server.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class AbstractMultiInstanceResolver<T> extends AbstractInstanceResolver<T> {
+    protected final Class<T> clazz;
+
+    // fields for resource injection.
+    private /*almost final*/ WSWebServiceContext webServiceContext;
+    protected /*almost final*/ WSEndpoint owner;
+    private final Method postConstructMethod;
+    private final Method preDestroyMethod;
+    private /*almost final*/ ResourceInjector resourceInjector;
+
+    public AbstractMultiInstanceResolver(Class<T> clazz) {
+        this.clazz = clazz;
+
+        postConstructMethod = findAnnotatedMethod(clazz, PostConstruct.class);
+        preDestroyMethod = findAnnotatedMethod(clazz, PreDestroy.class);
+    }
+
+    /**
+     * Perform resource injection on the given instance.
+     */
+    protected final void prepare(T t) {
+        // we can only start creating new instances after the start method is invoked.
+        assert webServiceContext!=null;
+
+        resourceInjector.inject(webServiceContext,t);
+        invokeMethod(postConstructMethod,t);
+    }
+
+    /**
+     * Creates a new instance via the default constructor.
+     */
+    protected final T create() {
+        T t = createNewInstance(clazz);
+        prepare(t);
+        return t;
+    }
+
+    @Override
+    public void start(WSWebServiceContext wsc, WSEndpoint endpoint) {
+        resourceInjector = getResourceInjector(endpoint);
+        this.webServiceContext = wsc;
+        this.owner = endpoint;
+    }
+
+    protected final void dispose(T instance) {
+        invokeMethod(preDestroyMethod,instance);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java
new file mode 100644
index 0000000..47f0ac7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WSWebServiceContext;
+import com.sun.istack.internal.NotNull;
+import org.w3c.dom.Element;
+
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.security.Principal;
+
+/**
+ * Partial {@link WSWebServiceContext} implementation. This implementation depends on
+ * {@link Packet} and concrete implementations provide it via
+ * {@link #getRequestPacket()}.
+ *
+ * @see InvokerTube, AsyncProviderInvokerTube
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class AbstractWebServiceContext implements WSWebServiceContext {
+
+    private final WSEndpoint endpoint;
+
+    public AbstractWebServiceContext(@NotNull WSEndpoint endpoint) {
+        this.endpoint = endpoint;
+    }
+
+    public MessageContext getMessageContext() {
+        Packet packet = getRequestPacket();
+        if (packet == null) {
+            throw new IllegalStateException("getMessageContext() can only be called while servicing a request");
+        }
+        return new EndpointMessageContextImpl(packet);
+    }
+
+    public Principal getUserPrincipal() {
+        Packet packet = getRequestPacket();
+        if (packet == null) {
+            throw new IllegalStateException("getUserPrincipal() can only be called while servicing a request");
+        }
+        return packet.webServiceContextDelegate.getUserPrincipal(packet);
+    }
+
+    public boolean isUserInRole(String role) {
+        Packet packet = getRequestPacket();
+        if (packet == null) {
+            throw new IllegalStateException("isUserInRole() can only be called while servicing a request");
+        }
+        return packet.webServiceContextDelegate.isUserInRole(packet,role);
+    }
+
+    public EndpointReference getEndpointReference(Element...referenceParameters) {
+        return getEndpointReference(W3CEndpointReference.class, referenceParameters);
+    }
+
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
+        Packet packet = getRequestPacket();
+        if (packet == null) {
+            throw new IllegalStateException("getEndpointReference() can only be called while servicing a request");
+        }
+        String address = packet.webServiceContextDelegate.getEPRAddress(packet, endpoint);
+        String wsdlAddress = null;
+        if(endpoint.getServiceDefinition() != null) {
+            wsdlAddress = packet.webServiceContextDelegate.getWSDLAddress(packet,endpoint);
+        }
+        return clazz.cast(((WSEndpointImpl)endpoint).getEndpointReference(clazz,address,wsdlAddress, referenceParameters));
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AppMsgContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AppMsgContextImpl.java
deleted file mode 100644
index c49326d..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AppMsgContextImpl.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-import javax.xml.ws.handler.MessageContext;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import javax.xml.ws.handler.MessageContext.Scope;
-
-public class AppMsgContextImpl implements MessageContext {
-
-    private MessageContext ctxt;
-    private Map<String, Object> appContext; // properties in APPLICATION scope
-
-    private void init() {
-        if (appContext == null) {
-            appContext = new HashMap<String, Object>();
-            Iterator<Entry<String, Object>> i = ctxt.entrySet().iterator();
-            while(i.hasNext()) {
-                Entry<String, Object> entry = i.next();
-                if (ctxt.getScope(entry.getKey()) == Scope.APPLICATION) {
-                    appContext.put(entry.getKey(), entry.getValue());
-                }
-            }
-        }
-    }
-
-    public AppMsgContextImpl(MessageContext ctxt) {
-        this.ctxt = ctxt;
-    }
-
-    /* java.util.Map methods below here */
-
-    public void clear() {
-        init();
-        Set<Entry<String, Object>> props = appContext.entrySet();
-        for (Entry<String, Object> prop : props) {
-            ctxt.remove(prop.getKey());
-        }
-        appContext.clear();
-    }
-
-    public boolean containsKey(Object obj) {
-        init();
-        return appContext.containsKey(obj);
-    }
-
-    public boolean containsValue(Object obj) {
-        init();
-        return appContext.containsValue(obj);
-    }
-
-    public Set<Entry<String, Object>> entrySet() {
-        init();
-        return appContext.entrySet();
-    }
-
-    public Object get(Object obj) {
-        init();
-        return appContext.get(obj);
-    }
-
-    public boolean isEmpty() {
-        init();
-        return appContext.isEmpty();
-    }
-
-    public Set<String> keySet() {
-        init();
-        return appContext.keySet();
-    }
-
-    public Object put(String str, Object obj) {
-        init();
-        Scope scope = null;
-        try {
-            scope = ctxt.getScope(str);
-        } catch(IllegalArgumentException ie) {
-            // It's okay, MessageContext didn't have this property
-        }
-        if (scope != null && scope == Scope.HANDLER) {
-            throw new IllegalArgumentException(
-                    "Cannot overwrite property in HANDLER scope");
-        }
-        ctxt.put(str, obj);
-        ctxt.setScope(str, Scope.APPLICATION);
-        return appContext.put(str, obj);
-    }
-
-    public void putAll(Map<? extends String, ? extends Object> map) {
-        init();
-        Set<? extends Entry<? extends String, ? extends Object>> props = map.entrySet();
-        for(Entry<? extends String, ? extends Object> prop : props) {
-            put(prop.getKey(), prop.getValue());
-        }
-    }
-
-    public Object remove(Object key) {
-        init();
-        Scope scope = null;
-        try {
-            scope = ctxt.getScope((String)key);
-        } catch(IllegalArgumentException ie) {
-            // It's okay, MessageContext didn't have this property
-        }
-        if (scope != null && scope == Scope.HANDLER) {
-            throw new IllegalArgumentException(
-                    "Cannot remove property in HANDLER scope");
-        }
-        ctxt.remove(key);
-        return appContext.remove(key);
-    }
-
-    public int size() {
-        init();
-        return appContext.size();
-    }
-
-    public Collection<Object> values() {
-        init();
-        return appContext.values();
-    }
-
-    public void setScope(String name, Scope scope) {
-
-    }
-
-    public Scope getScope(String name) {
-        return null;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java
new file mode 100644
index 0000000..388707b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DefaultResourceInjector.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.server.ResourceInjector;
+import com.sun.xml.internal.ws.api.server.WSWebServiceContext;
+
+import javax.xml.ws.WebServiceContext;
+
+/**
+ * Default {@link ResourceInjector}.
+ *
+ * @see ResourceInjector#STANDALONE
+ * @author Kohsuke Kawaguchi
+ */
+public final class DefaultResourceInjector extends ResourceInjector {
+    public void inject(@NotNull WSWebServiceContext context, @NotNull Object instance) {
+        AbstractInstanceResolver.buildInjectionPlan(
+            instance.getClass(),WebServiceContext.class,false).inject(instance,context);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DocInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DocInfo.java
deleted file mode 100644
index f613999..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DocInfo.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-import com.sun.xml.internal.ws.wsdl.parser.Service;
-import java.io.InputStream;
-import java.net.URL;
-
-
-public interface DocInfo {
-
-    public enum DOC_TYPE { WSDL, SCHEMA, OTHER };
-
-    /*
-     * The implemenation needs to work for multiple invocations of this method
-     */
-    public InputStream getDoc();
-
-    /*
-     * @return wsdl=a, xsd=c etc
-     */
-    public String getQueryString();
-
-    /*
-     * set wsdl=a, xsd=c etc as queryString
-     */
-    public void setQueryString(String queryString);
-
-    /*
-     * Sets document type : WSDL, or Schema ?
-     */
-    public void setDocType(DOC_TYPE docType);
-
-    /*
-     * return document type : WSDL, or Schema ?
-     */
-    public DOC_TYPE getDocType();
-
-    /*
-     * Sets targetNamespace of WSDL, and schema
-     */
-    public void setTargetNamespace(String ns);
-
-    /*
-     * Sets targetNamespace of WSDL, and schema
-     */
-    public String getTargetNamespace();
-
-    /*
-     * Sets if the endpoint service is defined in this document
-     */
-    public void setService(Service service);
-
-    /*
-     * returns true if endpoint service is present in this document
-     */
-    public Service getService();
-
-    /*
-     * Sets if the endpoint Port Type is defined in this document
-     */
-    public void setHavingPortType(boolean portType);
-
-    /*
-     * returns true if endpoint PortType is present in this document
-     */
-    public boolean isHavingPortType();
-
-    /*
-     * @return /WEB-INF/wsdl/xxx.wsdl
-     */
-    public String getPath();
-
-    /*
-     * @return URL for /WEB-INF/wsdl/xxx.wsdl
-     */
-    public URL getUrl();
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryBase.java
deleted file mode 100644
index 845c0bc..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryBase.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.protocol.Interceptors;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEPTFactory;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-
-/**
- * @author WS Development Team
- */
-public class EPTFactoryBase implements EPTFactory, SOAPEPTFactory {
-    private Encoder encoder;
-    private Decoder decoder;
-    private SOAPEncoder soapEncoder;
-    private SOAPDecoder soapDecoder;
-    private InternalEncoder internalEncoder;
-    private TargetFinder targetFinder;
-    private MessageDispatcher messageDispatcher;
-
-    public EPTFactoryBase(Encoder encoder, Decoder decoder,
-            TargetFinder targetFinder, MessageDispatcher messageDispatcher) {
-        this.encoder = encoder;
-        this.decoder = decoder;
-        this.targetFinder = targetFinder;
-        this.messageDispatcher = messageDispatcher;
-    }
-
-    public EPTFactoryBase(SOAPEncoder soapEncoder, SOAPDecoder soapDecoder,
-                          InternalEncoder internalEncoder,
-                          TargetFinder targetFinder, MessageDispatcher messageDispatcher) {
-        this.encoder = null;
-        this.decoder = null;
-        this.soapEncoder = soapEncoder;
-        this.soapDecoder = soapDecoder;
-        this.internalEncoder = internalEncoder;
-        this.targetFinder = targetFinder;
-        this.messageDispatcher = messageDispatcher;
-    }
-
-    public Encoder getEncoder(MessageInfo messageInfo) {
-        messageInfo.setEncoder(encoder);
-        return messageInfo.getEncoder();
-    }
-
-    public Decoder getDecoder(MessageInfo messageInfo) {
-        messageInfo.setDecoder(decoder);
-        return messageInfo.getDecoder();
-    }
-
-    public TargetFinder getTargetFinder(MessageInfo messageInfo) {
-        return targetFinder;
-    }
-
-    public MessageDispatcher getMessageDispatcher(MessageInfo messageInfo) {
-        messageInfo.setMessageDispatcher(messageDispatcher);
-        return messageDispatcher;
-    }
-
-    /*
-     * @see EPTFactory#getInterceptors(com.sun.istack.internal.pept.ept.MessageInfo)
-     */
-    public Interceptors getInterceptors(MessageInfo x) {
-        return null;
-    }
-
-    /*
-     * @see LogicalEPTFactory#getSoapEncoder()
-     */
-    public SOAPEncoder getSOAPEncoder() {
-        return soapEncoder;
-    }
-
-    /*
-     * @see LogicalEPTFactory#getSoapDecoder()
-     */
-    public SOAPDecoder getSOAPDecoder() {
-        return soapDecoder;
-    }
-
-    public InternalEncoder getInternalEncoder() {
-        return internalEncoder;
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryFactoryBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryFactoryBase.java
deleted file mode 100644
index 9b6c129..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EPTFactoryFactoryBase.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.SOAPEncoder;
-import com.sun.xml.internal.ws.encoding.soap.ServerEncoderDecoder;
-import com.sun.xml.internal.ws.protocol.soap.server.ProviderSOAPMD;
-import com.sun.xml.internal.ws.spi.runtime.MessageContext;
-import javax.xml.ws.Provider;
-import javax.xml.ws.soap.SOAPBinding;
-
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.server.provider.ProviderPeptTie;
-import com.sun.xml.internal.ws.encoding.soap.server.ProviderSED;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher;
-import com.sun.xml.internal.ws.encoding.soap.server.SOAP12XMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.server.SOAP12XMLEncoder;
-import com.sun.xml.internal.ws.encoding.soap.server.SOAPXMLDecoder;
-import com.sun.xml.internal.ws.encoding.soap.server.SOAPXMLEncoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLDecoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLEncoder;
-import com.sun.xml.internal.ws.protocol.xml.server.ProviderXMLMD;
-import javax.xml.ws.http.HTTPBinding;
-
-/**
- * factory for creating the appropriate EPTFactory given the BindingId from the EndpointInfo
- * in the RuntimeContext of the MessageInfo
- * Based on MessageInfo data(Binding, Implementor) it selects one the static EPTFactories
- * using Binding information
- * Has a static EPTFactory object for each particular binding.
- * EPTFactories are reused for all the requests.
- * Has static provider EPTFactory objects.
- * The provider EPTFactories are reused for all the requests.
- * The factories reuse encoder, decoder, message dispatcher objects since these objects
- * are Stateless. They are reused for all the requests.
- *
- * @author WS Development Team
- */
-public abstract class EPTFactoryFactoryBase {
-
-    public static final ProviderSOAPMD providerMessageDispatcher =
-        new ProviderSOAPMD();
-    public static final SOAPEncoder soap11Encoder = new SOAPXMLEncoder();
-    public static final SOAPDecoder soap11Decoder = new SOAPXMLDecoder();
-    public static final SOAPEncoder soap12Encoder = new SOAP12XMLEncoder();
-    public static final SOAPDecoder soap12Decoder = new SOAP12XMLDecoder();
-
-    public static final XMLEncoder xmlEncoder = null; //new XMLEncoder();
-    public static final XMLDecoder xmlDecoder = null; //new XMLDecoder();
-
-    public static final SOAPMessageDispatcher soap11MessageDispatcher =
-        new SOAPMessageDispatcher();
-    public static final MessageDispatcher providerXmlMD =
-        new ProviderXMLMD();
-    public static final InternalEncoder internalSED = new ServerEncoderDecoder();
-    public static final InternalEncoder providerSED = new ProviderSED();
-    public static final TargetFinder providerTargetFinder =
-            new TargetFinderImpl(new ProviderPeptTie());
-    public static final TargetFinder targetFinder =
-            new TargetFinderImpl(new PeptTie());
-
-    public static final EPTFactory providerSoap11 =
-            new EPTFactoryBase(soap11Encoder, soap11Decoder,
-                    providerSED, providerTargetFinder,
-                providerMessageDispatcher);
-
-    public static final EPTFactory providerSoap12 =
-            new EPTFactoryBase(soap12Encoder, soap12Decoder,
-                    providerSED, providerTargetFinder,
-                providerMessageDispatcher);
-
-    public static final EPTFactory soap11 =
-            new EPTFactoryBase(
-                soap11Encoder, soap11Decoder,
-                    internalSED, targetFinder,
-                soap11MessageDispatcher);
-
-    public static final EPTFactory soap12 =
-            new EPTFactoryBase(
-                soap12Encoder, soap12Decoder,
-                    internalSED, targetFinder,
-                soap11MessageDispatcher);
-
-    public static final EPTFactory providerXml =
-        new XMLEPTFactoryImpl(
-            xmlEncoder, xmlDecoder,
-                providerSED, providerTargetFinder,
-            providerXmlMD);
-
-    /**
-     * Choose correct EPTFactory. MessageInfo contains all the needed
-     * information like Binding, WSConnection to make that decision.
-     * @param mi the MessageInfo object to obtain the BindingID from.
-     * @return returns the appropriate EPTFactory for the BindingID in the mi
-     */
-    public static EPTFactory getEPTFactory(MessageInfo mi) {
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        String bindingId = ((BindingImpl)endpointInfo.getBinding()).getBindingId();
-        if(bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING)){
-            if (endpointInfo.getImplementor() instanceof Provider) {
-                return providerSoap11;
-            } else {
-                return soap11;
-            }
-        }else if(bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)){
-            if (endpointInfo.getImplementor() instanceof Provider) {
-                return providerSoap12;
-            } else {
-                return soap12;
-            }
-        } else if(bindingId.equals(HTTPBinding.HTTP_BINDING)){
-            if (endpointInfo.getImplementor() instanceof Provider) {
-                return providerXml;
-            }
-        }
-        return null;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointFactory.java
new file mode 100644
index 0000000..8ddc94c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointFactory.java
@@ -0,0 +1,541 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.server.ContainerResolver;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.Invoker;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver.Parser;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+import com.sun.xml.internal.ws.binding.BindingImpl;
+import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.RuntimeModeler;
+import com.sun.xml.internal.ws.model.SOAPSEIModel;
+import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.server.provider.ProviderInvokerTube;
+import com.sun.xml.internal.ws.server.sei.SEIInvokerTube;
+import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
+import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor;
+import com.sun.xml.internal.ws.util.ServiceConfigurationError;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.SAXException;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+/**
+ * Entry point to the JAX-WS RI server-side runtime.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class EndpointFactory {
+
+    /**
+     * Implements {@link WSEndpoint#create}.
+     *
+     * No need to take WebServiceContext implementation. When InvokerPipe is
+     * instantiated, it calls InstanceResolver to set up a WebServiceContext.
+     * We shall only take delegate to getUserPrincipal and isUserInRole from adapter.
+     *
+     * <p>
+     * Nobody else should be calling this method.
+     */
+    public static <T> WSEndpoint<T> createEndpoint(
+        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
+        @Nullable QName serviceName, @Nullable QName portName,
+        @Nullable Container container, @Nullable WSBinding binding,
+        @Nullable SDDocumentSource primaryWsdl,
+        @Nullable Collection<? extends SDDocumentSource> metadata, EntityResolver resolver, boolean isTransportSynchronous) {
+
+        if(implType ==null)
+            throw new IllegalArgumentException();
+
+        verifyImplementorClass(implType);
+
+        if (invoker == null) {
+            invoker = InstanceResolver.createDefault(implType).createInvoker();
+        }
+
+        List<SDDocumentSource> md = new ArrayList<SDDocumentSource>();
+        if(metadata!=null)
+            md.addAll(metadata);
+
+        if(primaryWsdl!=null && !md.contains(primaryWsdl))
+            md.add(primaryWsdl);
+
+        if(container==null)
+            container = ContainerResolver.getInstance().getContainer();
+
+        if(serviceName==null)
+            serviceName = getDefaultServiceName(implType);
+
+        if(portName==null)
+            portName = getDefaultPortName(serviceName,implType);
+
+        {// error check
+            String serviceNS = serviceName.getNamespaceURI();
+            String portNS = portName.getNamespaceURI();
+            if (!serviceNS.equals(portNS)) {
+                throw new ServerRtException("wrong.tns.for.port",portNS, serviceNS);
+            }
+        }
+
+        // setting a default binding
+        if (binding == null)
+            binding = BindingImpl.create(BindingID.parse(implType));
+
+        if (primaryWsdl != null) {
+            verifyPrimaryWSDL(primaryWsdl, serviceName);
+        }
+
+        QName portTypeName = null;
+        if (implType.getAnnotation(WebServiceProvider.class)==null) {
+            portTypeName = RuntimeModeler.getPortTypeName(implType);
+        }
+
+        // Categorises the documents as WSDL, Schema etc
+        List<SDDocumentImpl> docList = categoriseMetadata(md, serviceName, portTypeName);
+        // Finds the primary WSDL and makes sure that metadata doesn't have
+        // two concrete or abstract WSDLs
+        SDDocumentImpl primaryDoc = findPrimary(docList);
+
+        InvokerTube terminal;
+        WSDLPortImpl wsdlPort = null;
+        AbstractSEIModelImpl seiModel = null;
+        // create WSDL model
+        if (primaryDoc != null) {
+            wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName);
+        }
+
+        WebServiceFeatureList features=((BindingImpl)binding).getFeatures();
+        features.parseAnnotations(implType);
+
+        // create terminal pipe that invokes the application
+        if (implType.getAnnotation(WebServiceProvider.class)!=null) {
+            //Provider case: Enable Addressing from WSDL only if it has RespectBindingFeature enabled
+            if (wsdlPort != null)
+                features.mergeFeatures(wsdlPort,true,true);
+            terminal = ProviderInvokerTube.create(implType,binding,invoker);
+        } else {
+            // Create runtime model for non Provider endpoints
+            seiModel = createSEIModel(wsdlPort, implType, serviceName, portName, binding);
+            if(binding instanceof SOAPBindingImpl){
+                //set portKnownHeaders on Binding, so that they can be used for MU processing
+                ((SOAPBindingImpl)binding).setPortKnownHeaders(
+                        ((SOAPSEIModel)seiModel).getKnownHeaders());
+            }
+            // Generate WSDL for SEI endpoints(not for Provider endpoints)
+            if (primaryDoc == null) {
+                primaryDoc = generateWSDL(binding, seiModel, docList, container, implType);
+                // create WSDL model
+                wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName);
+                seiModel.freeze(wsdlPort);
+            }
+            // New Features might have been added in WSDL through Policy.
+            // This sets only the wsdl features that are not already set(enabled/disabled)
+            features.mergeFeatures(wsdlPort, false, true);
+            terminal= new SEIInvokerTube(seiModel,invoker,binding);
+        }
+
+        // Process @HandlerChain, if handler-chain is not set via Deployment Descriptor
+        if (processHandlerAnnotation) {
+            processHandlerAnnotation(binding, implType, serviceName, portName);
+        }
+        // Selects only required metadata for this endpoint from the passed-in metadata
+        if (primaryDoc != null) {
+            docList = findMetadataClosure(primaryDoc, docList);
+        }
+        ServiceDefinitionImpl serviceDefiniton = (primaryDoc != null) ? new ServiceDefinitionImpl(docList, primaryDoc) : null;
+
+        return new WSEndpointImpl<T>(serviceName, portName, binding,container,seiModel,wsdlPort,implType, serviceDefiniton,terminal, isTransportSynchronous);
+    }
+
+    /**
+     * Goes through the original metadata documents and collects the required ones.
+     * This done traversing from primary WSDL and its imports until it builds a
+     * complete set of documents(transitive closure) for the endpoint.
+     *
+     * @param primaryDoc primary WSDL doc
+     * @param docList complete metadata
+     * @return new metadata that doesn't contain extraneous documnets.
+     */
+    private static List<SDDocumentImpl> findMetadataClosure(SDDocumentImpl primaryDoc, List<SDDocumentImpl> docList) {
+        // create a map for old metadata
+        Map<String, SDDocumentImpl> oldMap = new HashMap<String, SDDocumentImpl>();
+        for(SDDocumentImpl doc : docList) {
+            oldMap.put(doc.getSystemId().toString(), doc);
+        }
+        // create a map for new metadata
+        Map<String, SDDocumentImpl> newMap = new HashMap<String, SDDocumentImpl>();
+        newMap.put(primaryDoc.getSystemId().toString(), primaryDoc);
+
+        List<String> remaining = new ArrayList<String>();
+        remaining.addAll(primaryDoc.getImports());
+        while(!remaining.isEmpty()) {
+            String url = remaining.remove(0);
+            SDDocumentImpl doc = oldMap.get(url);
+            if (doc == null) {
+                // old metadata doesn't have this imported doc, may be external
+                continue;
+            }
+            // Check if new metadata already contains this doc
+            if (!newMap.containsKey(url)) {
+                newMap.put(url, doc);
+                remaining.addAll(doc.getImports());
+            }
+        }
+        List<SDDocumentImpl> newMetadata = new ArrayList<SDDocumentImpl>();
+        newMetadata.addAll(newMap.values());
+        return newMetadata;
+    }
+
+    private static <T> void processHandlerAnnotation(WSBinding binding, Class<T> implType, QName serviceName, QName portName) {
+        HandlerAnnotationInfo chainInfo =
+                HandlerAnnotationProcessor.buildHandlerInfo(
+                        implType, serviceName, portName, binding);
+        if (chainInfo != null) {
+            binding.setHandlerChain(chainInfo.getHandlers());
+            if (binding instanceof SOAPBinding) {
+                ((SOAPBinding) binding).setRoles(chainInfo.getRoles());
+            }
+        }
+
+    }
+
+    /**
+     * Verifies if the endpoint implementor class has @WebService or @WebServiceProvider
+     * annotation
+     *
+     * @return
+     *       true if it is a Provider or AsyncProvider endpoint
+     *       false otherwise
+     * @throws java.lang.IllegalArgumentException
+     *      If it doesn't have any one of @WebService or @WebServiceProvider
+     *      If it has both @WebService and @WebServiceProvider annotations
+     */
+    public static boolean verifyImplementorClass(Class<?> clz) {
+        WebServiceProvider wsProvider = clz.getAnnotation(WebServiceProvider.class);
+        WebService ws = clz.getAnnotation(WebService.class);
+        if (wsProvider == null && ws == null) {
+            throw new IllegalArgumentException(clz +" has neither @WebSerivce nor @WebServiceProvider annotation");
+        }
+        if (wsProvider != null && ws != null) {
+            throw new IllegalArgumentException(clz +" has both @WebSerivce and @WebServiceProvider annotations");
+        }
+        if (wsProvider != null) {
+            if (Provider.class.isAssignableFrom(clz) || AsyncProvider.class.isAssignableFrom(clz)) {
+                return true;
+            }
+            throw new IllegalArgumentException(clz +" doesn't implement Provider or AsyncProvider interface");
+        }
+        return false;
+    }
+
+
+    private static AbstractSEIModelImpl createSEIModel(WSDLPort wsdlPort,
+                                                       Class<?> implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding) {
+
+        RuntimeModeler rap;
+        // Create runtime model for non Provider endpoints
+
+        // wsdlPort will be null, means we will generate WSDL. Hence no need to apply
+        // bindings or need to look in the WSDL
+        if(wsdlPort == null){
+            rap = new RuntimeModeler(implType,serviceName, binding.getBindingId());
+        } else {
+            /*
+            This not needed anymore as wsdlFeatures are merged later anyway
+            and so is the MTOMFeature.
+            applyEffectiveMtomSetting(wsdlPort.getBinding(), binding);
+            */
+            //now we got the Binding so lets build the model
+            rap = new RuntimeModeler(implType, serviceName, (WSDLPortImpl)wsdlPort);
+        }
+        rap.setPortName(portName);
+        return rap.buildRuntimeModel();
+    }
+
+    /**
+     *Set the mtom enable setting from wsdl model (mtom policy assertion) on to @link WSBinding} if DD has
+     * not already set it on BindingID. Also check conflicts.
+     */
+    /*
+    private static void applyEffectiveMtomSetting(WSDLBoundPortType wsdlBinding, WSBinding binding){
+        if(wsdlBinding.isMTOMEnabled()){
+            BindingID bindingId = binding.getBindingId();
+            if(bindingId.isMTOMEnabled() == null){
+                binding.setMTOMEnabled(true);
+            }else if (bindingId.isMTOMEnabled() != null && bindingId.isMTOMEnabled() == Boolean.FALSE){
+                //TODO: i18N
+                throw new ServerRtException("Deployment failed! Mtom policy assertion in WSDL is enabled whereas the deplyment descriptor setting wants to disable it!");
+            }
+        }
+    }
+    */
+    /**
+     * If service name is not already set via DD or programmatically, it uses
+     * annotations {@link WebServiceProvider}, {@link WebService} on implementorClass to get PortName.
+     *
+     * @return non-null service name
+     */
+    public static @NotNull QName getDefaultServiceName(Class<?> implType) {
+        QName serviceName;
+        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
+        if (wsProvider!=null) {
+            String tns = wsProvider.targetNamespace();
+            String local = wsProvider.serviceName();
+            serviceName = new QName(tns, local);
+        } else {
+            serviceName = RuntimeModeler.getServiceName(implType);
+        }
+        assert serviceName != null;
+        return serviceName;
+    }
+
+    /**
+     * If portName is not already set via DD or programmatically, it uses
+     * annotations on implementorClass to get PortName.
+     *
+     * @return non-null port name
+     */
+    public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType) {
+        QName portName;
+        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
+        if (wsProvider!=null) {
+            String tns = wsProvider.targetNamespace();
+            String local = wsProvider.portName();
+            portName = new QName(tns, local);
+        } else {
+            portName = RuntimeModeler.getPortName(implType, serviceName.getNamespaceURI());
+        }
+        assert portName != null;
+        return portName;
+    }
+
+    /**
+     * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
+     * wsdlLocation element.
+     *
+     * @param implType
+     *      endpoint implementation class
+     *      make sure that you called {@link #verifyImplementorClass} on it.
+     * @return wsdl if there is wsdlLocation, else null
+     */
+    public static @Nullable String getWsdlLocation(Class<?> implType) {
+        String wsdl;
+        WebService ws = implType.getAnnotation(WebService.class);
+        if (ws != null) {
+            wsdl = ws.wsdlLocation();
+        } else {
+            WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
+            assert wsProvider != null;
+            wsdl = wsProvider.wsdlLocation();
+        }
+        if (wsdl.length() < 1) {
+            wsdl = null;
+        }
+        return wsdl;
+    }
+
+    /**
+     * Generates the WSDL and XML Schema for the endpoint if necessary
+     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
+     */
+    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
+                                               Container container, Class implType) {
+        BindingID bindingId = binding.getBindingId();
+        if (!bindingId.canGenerateWSDL()) {
+            throw new ServerRtException("can.not.generate.wsdl", bindingId);
+        }
+
+        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
+            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
+            logger.warning(msg);
+        }
+
+        // Generate WSDL and schema documents using runtime model
+        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
+        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType,
+                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
+        wsdlGen.doGeneration();
+        return wsdlResolver.updateDocs();
+    }
+
+    /**
+     * Builds {@link SDDocumentImpl} from {@link SDDocumentSource}.
+     */
+    private static List<SDDocumentImpl> categoriseMetadata(
+        List<SDDocumentSource> src, QName serviceName, QName portTypeName) {
+
+        List<SDDocumentImpl> r = new ArrayList<SDDocumentImpl>(src.size());
+        for (SDDocumentSource doc : src) {
+            r.add(SDDocumentImpl.create(doc,serviceName,portTypeName));
+        }
+        return r;
+    }
+
+    /**
+     * Verifies whether the given primaryWsdl contains the given serviceName.
+     * If the WSDL doesn't have the service, it throws an WebServiceException.
+     */
+    private static void verifyPrimaryWSDL(@NotNull SDDocumentSource primaryWsdl, @NotNull QName serviceName) {
+        SDDocumentImpl primaryDoc = SDDocumentImpl.create(primaryWsdl,serviceName,null);
+        if (!(primaryDoc instanceof SDDocument.WSDL)) {
+            throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId());
+        }
+        SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)primaryDoc;
+        if (!wsdlDoc.hasService()) {
+            throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId()+
+                    " since it doesn't have Service "+serviceName);
+        }
+    }
+
+    /**
+     * Finds the primary WSDL document from the list of metadata documents. If
+     * there are two metadata documents that qualify for primary, it throws an
+     * exception. If there are two metadata documents that qualify for porttype,
+     * it throws an exception.
+     *
+     * @return primay wsdl document, null if is not there in the docList
+     *
+     */
+    private static @Nullable SDDocumentImpl findPrimary(@NotNull List<SDDocumentImpl> docList) {
+        SDDocumentImpl primaryDoc = null;
+        boolean foundConcrete = false;
+        boolean foundAbstract = false;
+        for(SDDocumentImpl doc : docList) {
+            if (doc instanceof SDDocument.WSDL) {
+                SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)doc;
+                if (wsdlDoc.hasService()) {
+                    primaryDoc = doc;
+                    if (foundConcrete) {
+                        throw new ServerRtException("duplicate.primary.wsdl", doc.getSystemId() );
+                    }
+                    foundConcrete = true;
+                }
+                if (wsdlDoc.hasPortType()) {
+                    if (foundAbstract) {
+                        throw new ServerRtException("duplicate.abstract.wsdl", doc.getSystemId());
+                    }
+                    foundAbstract = true;
+                }
+            }
+        }
+        return primaryDoc;
+    }
+
+    /**
+     * Parses the primary WSDL and returns the {@link WSDLPort} for the given service and port names
+     *
+     * @param primaryWsdl Primary WSDL
+     * @param metadata it may contain imported WSDL and schema documents
+     * @param serviceName service name in wsdl
+     * @param portName port name in WSDL
+     * @return non-null wsdl port object
+     */
+    private static @NotNull WSDLPortImpl getWSDLPort(SDDocumentSource primaryWsdl, List<? extends SDDocumentSource> metadata,
+                                                     @NotNull QName serviceName, @NotNull QName portName) {
+        URL wsdlUrl = primaryWsdl.getSystemId();
+        try {
+            // TODO: delegate to another entity resolver
+            WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse(
+                new Parser(primaryWsdl), new EntityResolverImpl(metadata),
+                    false, ServiceFinder.find(WSDLParserExtension.class).toArray());
+            WSDLPortImpl wsdlPort = wsdlDoc.getService(serviceName).get(portName);
+            if (wsdlPort == null) {
+                throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(serviceName, portName, wsdlUrl));
+            }
+            return wsdlPort;
+        } catch (IOException e) {
+            throw new ServerRtException("runtime.parser.wsdl", wsdlUrl,e);
+        } catch (XMLStreamException e) {
+            throw new ServerRtException("runtime.saxparser.exception", e.getMessage(), e.getLocation(), e);
+        } catch (SAXException e) {
+            throw new ServerRtException("runtime.parser.wsdl", wsdlUrl,e);
+        } catch (ServiceConfigurationError e) {
+            throw new ServerRtException("runtime.parser.wsdl", wsdlUrl,e);
+        }
+    }
+
+    /**
+     * {@link XMLEntityResolver} that can resolve to {@link SDDocumentSource}s.
+     */
+    private static final class EntityResolverImpl implements XMLEntityResolver {
+        private Map<String,SDDocumentSource> metadata = new HashMap<String,SDDocumentSource>();
+
+        public EntityResolverImpl(List<? extends SDDocumentSource> metadata) {
+            for (SDDocumentSource doc : metadata) {
+                this.metadata.put(doc.getSystemId().toExternalForm(),doc);
+            }
+        }
+
+        public Parser resolveEntity (String publicId, String systemId) throws IOException, XMLStreamException {
+            if (systemId != null) {
+                SDDocumentSource doc = metadata.get(systemId);
+                if (doc != null)
+                    return new Parser(doc);
+            }
+            return null;
+        }
+
+    }
+
+    private static final Logger logger = Logger.getLogger(
+        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointMessageContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointMessageContextImpl.java
new file mode 100644
index 0000000..9faaf1f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointMessageContextImpl.java
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Attachment;
+
+import java.util.*;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.WebServiceContext;
+import javax.activation.DataHandler;
+
+/**
+ * Implements {@link WebServiceContext}'s {@link MessageContext} on top of {@link Packet}.
+ *
+ * <p>
+ * This class creates a {@link Map} view for APPLICATION scoped properties that
+ * gets exposed to endpoint implementations during the invocation
+ * of web methods. The implementations access this map using
+ * WebServiceContext.getMessageContext().
+ *
+ * <p>
+ * Some of the {@link Map} methods requre this class to
+ * build the complete {@link Set} of properties, but we
+ * try to avoid that as much as possible.
+ *
+ *
+ * @author Jitendra Kotamraju
+ */
+@SuppressWarnings({"SuspiciousMethodCalls"})
+public final class EndpointMessageContextImpl extends AbstractMap<String,Object> implements MessageContext {
+
+    /**
+     * Lazily computed.
+     */
+    private Set<Map.Entry<String,Object>> entrySet;
+    private final Packet packet;
+
+    /**
+     * @param packet
+     *      The {@link Packet} to wrap.
+     */
+    public EndpointMessageContextImpl(Packet packet) {
+        this.packet = packet;
+    }
+
+    @Override
+    public Object get(Object key) {
+        if (packet.supports(key)) {
+            return packet.get(key);    // strongly typed
+        }
+        if (packet.getHandlerScopePropertyNames(true).contains(key)) {
+            return null;            // no such application-scope property
+        }
+        Object value =  packet.invocationProperties.get(key);
+
+        //add the attachments from the Message to the corresponding attachment property
+        if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) ||
+                key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){
+            Map<String, DataHandler> atts = (Map<String, DataHandler>) value;
+            if(atts == null)
+                atts = new HashMap<String, DataHandler>();
+            AttachmentSet attSet = packet.getMessage().getAttachments();
+            for(Attachment att : attSet){
+                atts.put(att.getContentId(), att.asDataHandler());
+            }
+            return atts;
+        }
+        return value;
+    }
+
+    @Override
+    public Object put(String key, Object value) {
+        if (packet.supports(key)) {
+            return packet.put(key, value);     // strongly typed
+        }
+        Object old = packet.invocationProperties.get(key);
+        if (old != null) {
+            if (packet.getHandlerScopePropertyNames(true).contains(key)) {
+                throw new IllegalArgumentException("Cannot overwrite property in HANDLER scope");
+            }
+            // Overwrite existing APPLICATION scoped property
+            packet.invocationProperties.put(key, value);
+            return old;
+        }
+        // No existing property. So Add a new property
+        packet.invocationProperties.put(key, value);
+        return null;
+    }
+
+    @Override
+    public Object remove(Object key) {
+         if (packet.supports(key)) {
+             return packet.remove(key);
+        }
+        Object old = packet.invocationProperties.get(key);
+        if (old != null) {
+            if (packet.getHandlerScopePropertyNames(true).contains(key)) {
+                throw new IllegalArgumentException("Cannot remove property in HANDLER scope");
+            }
+            // Remove existing APPLICATION scoped property
+            packet.invocationProperties.remove(key);
+            return old;
+        }
+        // No existing property.
+        return null;
+    }
+
+    public Set<Map.Entry<String, Object>> entrySet() {
+        if (entrySet == null) {
+            entrySet = new EntrySet();
+        }
+        return entrySet;
+    }
+
+    public void setScope(String name, MessageContext.Scope scope) {
+        throw new UnsupportedOperationException(
+                "All the properties in this context are in APPLICATION scope. Cannot do setScope().");
+    }
+
+    public MessageContext.Scope getScope(String name) {
+        throw new UnsupportedOperationException(
+                "All the properties in this context are in APPLICATION scope. Cannot do getScope().");
+    }
+
+    private class EntrySet extends AbstractSet<Map.Entry<String, Object>> {
+
+        public Iterator<Map.Entry<String, Object>> iterator() {
+            final Iterator<Map.Entry<String, Object>> it = createBackupMap().entrySet().iterator();
+
+            return new Iterator<Map.Entry<String, Object>>() {
+                Map.Entry<String, Object> cur;
+
+                public boolean hasNext() {
+                    return it.hasNext();
+                }
+
+                public Map.Entry<String, Object> next() {
+                    cur = it.next();
+                    return cur;
+                }
+
+                public void remove() {
+                    it.remove();
+                    EndpointMessageContextImpl.this.remove(cur.getKey());
+                }
+            };
+        }
+
+        public int size() {
+            return createBackupMap().size();
+        }
+
+    }
+
+    private Map<String, Object> createBackupMap() {
+        Map<String, Object> backupMap = new HashMap<String, Object>();
+        backupMap.putAll(packet.createMapView());
+        Set<String> handlerProps = packet.getHandlerScopePropertyNames(true);
+        for(Map.Entry<String, Object> e : packet.invocationProperties.entrySet()) {
+            if (!handlerProps.contains(e.getKey())) {
+                backupMap.put(e.getKey(), e.getValue());
+            }
+        }
+        return backupMap;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/InvokerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/InvokerTube.java
new file mode 100644
index 0000000..58b1aef
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/InvokerTube.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+import com.sun.xml.internal.ws.api.server.*;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.server.provider.ProviderInvokerTube;
+import com.sun.xml.internal.ws.server.sei.SEIInvokerTube;
+
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Base code for {@link ProviderInvokerTube} and {@link SEIInvokerTube}.
+ *
+ * <p>
+ * This hides {@link InstanceResolver} and performs a set up
+ * necessary for {@link WebServiceContext} to correctly.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class InvokerTube<T> extends AbstractTubeImpl {
+
+    private final Invoker invoker;
+    private WSEndpoint endpoint;
+
+    protected InvokerTube(Invoker invoker) {
+        this.invoker = invoker;
+    }
+
+    public void setEndpoint(WSEndpoint endpoint) {
+        this.endpoint = endpoint;
+        WSWebServiceContext webServiceContext = new AbstractWebServiceContext(endpoint) {
+            public @Nullable Packet getRequestPacket() {
+                Packet p = packets.get();
+                return p;
+            }
+        };
+        invoker.start(webServiceContext,endpoint);
+    }
+
+    protected WSEndpoint getEndpoint() {
+        return endpoint;
+    }
+
+    /**
+     * Returns the application object that serves the request.
+     *
+    public final @NotNull T getServant(Packet request) {
+        // this allows WebServiceContext to find this packet
+        packets.set(request);
+        return invoker.resolve(request);
+    }
+     */
+
+    /**
+     * Returns the {@link Invoker} object that serves the request.
+     */
+    public final @NotNull Invoker getInvoker(Packet request) {
+        return wrapper;
+    }
+
+    /**
+     * processRequest() and processResponse() do not share any instance variables
+     * while processing the request. {@link InvokerTube} is stateless and terminal,
+     * so no need to create copies.
+     */
+    public final AbstractTubeImpl copy(TubeCloner cloner) {
+        cloner.add(this,this);
+        return this;
+    }
+
+    public void preDestroy() {
+        invoker.dispose();
+    }
+
+    /**
+     * Heart of {@link WebServiceContext}.
+     * Remembers which thread is serving which packet.
+     */
+    private static final ThreadLocal<Packet> packets = new ThreadLocal<Packet>();
+
+    /**
+     * This method can be called while the user service is servicing the request
+     * synchronously, to obtain the current request packet.
+     *
+     * <p>
+     * This is primarily designed for {@link StatefulInstanceResolver}. Use with care.
+     */
+    public static @NotNull Packet getCurrentPacket() {
+        Packet packet = packets.get();
+        if(packet==null)
+            throw new WebServiceException(ServerMessages.NO_CURRENT_PACKET());
+        return packet;
+    }
+
+    /**
+     * {@link Invoker} filter that sets and restores the current packet.
+     */
+    private final Invoker wrapper = new Invoker() {
+        @Override
+        public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException {
+            Packet old = set(p);
+            try {
+                return invoker.invoke(p, m, args);
+            } finally {
+                set(old);
+            }
+        }
+
+        @Override
+        public <T>T invokeProvider(Packet p, T arg) throws IllegalAccessException, InvocationTargetException {
+            Packet old = set(p);
+            try {
+                return invoker.invokeProvider(p, arg);
+            } finally {
+                set(old);
+            }
+        }
+
+        @Override
+        public <T>void invokeAsyncProvider(Packet p, T arg, AsyncProviderCallback cbak, WebServiceContext ctxt) throws IllegalAccessException, InvocationTargetException {
+            Packet old = set(p);
+            try {
+                invoker.invokeAsyncProvider(p, arg, cbak, ctxt);
+            } finally {
+                set(old);
+            }
+        }
+
+        private Packet set(Packet p) {
+            Packet old = packets.get();
+            packets.set(p);
+            return old;
+        }
+    };
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/PeptTie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/PeptTie.java
deleted file mode 100644
index ec7fd5f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/PeptTie.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import com.sun.xml.internal.ws.pept.presentation.Tie;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Creates a Stateless Tie object so that it is created only once and reused.
- */
-public class PeptTie implements Tie {
-
-    private static final Logger logger = Logger.getLogger(
-            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.PeptTie");
-
-    public void _setServant(Object servant) {
-        throw new UnsupportedOperationException();
-    }
-
-    public Object _getServant() {
-        throw new UnsupportedOperationException();
-    }
-
-    /*
-     * @see Tie#_invoke(MessageInfo)
-     */
-    public void _invoke(MessageInfo messageInfo) {
-        Object[] oa = messageInfo.getData();
-        Method method = messageInfo.getMethod();
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Object servant = endpointInfo.getImplementor();
-        try {
-            Object ret = method.invoke(servant, oa);
-            messageInfo.setResponseType(MessageStruct.NORMAL_RESPONSE);
-            messageInfo.setResponse(ret);
-        } catch (IllegalArgumentException e) {
-            setRuntimeException(messageInfo, e);
-        } catch (IllegalAccessException e) {
-            setRuntimeException(messageInfo, e);
-        } catch (InvocationTargetException e) {
-            Throwable cause = e.getCause();
-            if (cause != null) {
-                if (!(cause instanceof RuntimeException) && cause instanceof Exception ) {
-                    // Service specific exception
-                    messageInfo.setResponseType(
-                            MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-                    messageInfo.setResponse(cause);
-                } else {
-                    setRuntimeException(messageInfo, cause);
-                }
-            } else {
-                setRuntimeException(messageInfo, e);
-            }
-        }
-    }
-
-    private void setRuntimeException(MessageInfo messageInfo, Throwable e) {
-        logger.log(Level.SEVERE, e.getMessage(), e);
-        messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-        messageInfo.setResponse(e);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeContext.java
deleted file mode 100644
index cd42fc9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeContext.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-
-import java.lang.reflect.Method;
-
-import javax.xml.namespace.QName;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-
-
-
-
-/**
- * $author: WS Development Team
- */
-public class RuntimeContext {
-
-    public RuntimeContext(RuntimeModel model) {
-        this.model = model;
-    }
-
-    /**
-     * @return Returns the model.
-     */
-    public RuntimeModel getModel() {
-        return model;
-    }
-
-    /**
-     * @return Returns info about endpoint
-     */
-    public RuntimeEndpointInfo getRuntimeEndpointInfo() {
-        return endpointInfo;
-    }
-
-    /**
-     * sets info about endpoint
-     */
-    public void setRuntimeEndpointInfo(RuntimeEndpointInfo endpointInfo) {
-        this.endpointInfo = endpointInfo;
-    }
-
-    /**
-     * @param name
-     * @param mi
-     * @return the <code>Method</code> associated with the operation named name
-     */
-    public Method getDispatchMethod(QName name, MessageInfo mi) {
-        return getDispatchMethod(name);
-    }
-
-    /**
-     * @param name
-     * @return the <code>Method</code> associated with the operation named name
-     */
-    public Method getDispatchMethod(QName name){
-        return model.getDispatchMethod(name);
-    }
-
-    /**
-     * @param qname
-     * @param mi
-     */
-    public void setMethodAndMEP(QName qname, MessageInfo mi) {
-        if (model != null) {
-            mi.setMethod(model.getDispatchMethod(qname));
-
-            // if null, default MEP is ok
-            if (qname != null && model.getJavaMethod(qname) != null) {
-                mi.setMEP(model.getJavaMethod(qname).getMEP());
-            }
-        }
-    }
-
-    /**
-     * @param name
-     * @return the decoder Info associated with operation named name
-     */
-    public Object getDecoderInfo(QName name) {
-        return model.getDecoderInfo(name);
-    }
-
-    public BridgeContext getBridgeContext() {
-        return (model != null)?model.getBridgeContext():null;
-    }
-
-    public HandlerContext getHandlerContext() {
-        return handlerContext;
-    }
-
-    public void setHandlerContext(HandlerContext handlerContext) {
-        this.handlerContext = handlerContext;
-    }
-
-    private RuntimeModel model;
-    private HandlerContext handlerContext;
-    private RuntimeEndpointInfo endpointInfo;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeEndpointInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeEndpointInfo.java
deleted file mode 100644
index 229ea69..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/RuntimeEndpointInfo.java
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.server;
-
-import com.sun.xml.internal.ws.server.provider.ProviderModel;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-import java.io.IOException;
-import java.util.Map.Entry;
-import java.util.concurrent.Executor;
-
-import javax.annotation.Resource;
-import javax.jws.WebService;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Provider;
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.transform.Source;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.xml.ws.WebServiceProvider;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.ws.Endpoint;
-
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.binding.soap.SOAPBindingImpl;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.modeler.RuntimeModeler;
-import com.sun.xml.internal.ws.server.DocInfo.DOC_TYPE;
-import com.sun.xml.internal.ws.spi.runtime.Binding;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
-import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
-import com.sun.xml.internal.ws.util.HandlerAnnotationProcessor;
-import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
-import com.sun.xml.internal.ws.wsdl.parser.Service;
-import com.sun.xml.internal.ws.wsdl.parser.WSDLDocument;
-import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.SAXException;
-
-
-
-
-/**
- * modeled after the javax.xml.ws.Endpoint class in API.
- * Contains all the information about Binding, handler chain, Implementor object,
- * WSDL & Schema Metadata
- * @author WS Development Team
- */
-public class RuntimeEndpointInfo implements com.sun.xml.internal.ws.spi.runtime.RuntimeEndpointInfo {
-
-    private String name;
-    private QName portName;
-    private QName serviceName;
-    private String wsdlFileName;
-    private boolean deployed;
-    private String urlPattern;
-    private List<Source> metadata;
-    private Binding binding;
-    private RuntimeModel runtimeModel;
-    private Object implementor;
-    private Class implementorClass;
-    private Map<String, DocInfo> docs;      // /WEB-INF/wsdl/xxx.wsdl -> DocInfo
-    private Map<String, DocInfo> query2Doc;     // (wsdl=a) --> DocInfo
-    private WebServiceContext wsContext;
-    private boolean beginServiceDone;
-    private boolean endServiceDone;
-    private boolean injectedContext;
-    private URL wsdlUrl;
-    private EntityResolver wsdlResolver;
-    private QName portTypeName;
-    private Integer mtomThreshold;
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint");
-    private static final Localizer localizer = new Localizer();
-    private static final LocalizableMessageFactory messageFactory =
-        new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.server");
-    private WebService ws;
-    private WebServiceProvider wsProvider;
-    private ProviderModel providerModel;
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String s) {
-        name = s;
-    }
-
-    public String getWSDLFileName() {
-        return wsdlFileName;
-    }
-
-    public void setWSDLFileName(String s) {
-        wsdlFileName = s;
-    }
-
-    /**
-     * set the URL for primary WSDL, and an EntityResolver to resolve all
-     * imports/references
-     */
-    public void setWsdlInfo(URL wsdlUrl, EntityResolver wsdlResolver) {
-        this.wsdlUrl = wsdlUrl;
-        this.wsdlResolver = wsdlResolver;
-    }
-
-    public EntityResolver getWsdlResolver() {
-        return wsdlResolver;
-    }
-
-    public URL getWsdlUrl() {
-        return wsdlUrl;
-    }
-
-    public boolean isDeployed() {
-        return deployed;
-    }
-
-    public void createProviderModel() {
-        providerModel = new ProviderModel(implementorClass, binding);
-    }
-
-    public void createSEIModel() {
-        // Create runtime model for non Provider endpoints
-
-        // wsdlURL will be null, means we will generate WSDL. Hence no need to apply
-        // bindings or need to look in the WSDL
-        if(wsdlUrl == null){
-            RuntimeModeler rap = new RuntimeModeler(getImplementorClass(),
-                getImplementor(), getServiceName(), ((BindingImpl)binding).getBindingId());
-            if (getPortName() != null) {
-                rap.setPortName(getPortName());
-            }
-            runtimeModel = rap.buildRuntimeModel();
-        }else {
-            try {
-                WSDLDocument wsdlDoc = RuntimeWSDLParser.parse(getWsdlUrl(), getWsdlResolver());
-                com.sun.xml.internal.ws.wsdl.parser.Binding wsdlBinding = null;
-                if(serviceName == null)
-                    serviceName = RuntimeModeler.getServiceName(getImplementorClass());
-                if(getPortName() != null){
-                    wsdlBinding = wsdlDoc.getBinding(getServiceName(), getPortName());
-                    if(wsdlBinding == null)
-                        throw new ServerRtException("runtime.parser.wsdl.incorrectserviceport", new Object[]{serviceName, portName, getWsdlUrl()});
-                }else{
-                    Service service = wsdlDoc.getService(serviceName);
-                    if(service == null)
-                        throw new ServerRtException("runtime.parser.wsdl.noservice", new Object[]{serviceName, getWsdlUrl()});
-
-                    String bindingId = ((BindingImpl)binding).getBindingId();
-                    List<com.sun.xml.internal.ws.wsdl.parser.Binding> bindings = wsdlDoc.getBindings(service, bindingId);
-                    if(bindings.size() == 0)
-                        throw new ServerRtException("runtime.parser.wsdl.nobinding", new Object[]{bindingId, serviceName, getWsdlUrl()});
-
-                    if(bindings.size() > 1)
-                        throw new ServerRtException("runtime.parser.wsdl.multiplebinding", new Object[]{bindingId, serviceName, getWsdlUrl()});
-                }
-                //now we got the Binding so lets build the model
-                RuntimeModeler rap = new RuntimeModeler(getImplementorClass(), getImplementor(), getServiceName(), wsdlBinding);
-                if (getPortName() != null) {
-                    rap.setPortName(getPortName());
-                }
-                runtimeModel = rap.buildRuntimeModel();
-            } catch (IOException e) {
-                throw new ServerRtException("runtime.parser.wsdl", getWsdlUrl().toString());
-            } catch (XMLStreamException e) {
-                throw new ServerRtException("runtime.saxparser.exception",
-                        new Object[]{e.getMessage(), e.getLocation()});
-            } catch (SAXException e) {
-                throw new ServerRtException("runtime.parser.wsdl", getWsdlUrl().toString());
-            }
-        }
-    }
-
-
-    public boolean isProviderEndpoint() {
-        Annotation ann = getImplementorClass().getAnnotation(
-            WebServiceProvider.class);
-        return (ann != null);
-    }
-
-    /*
-     * If serviceName is not already set via DD or programmatically, it uses
-     * annotations on implementorClass to set ServiceName.
-     */
-    public void doServiceNameProcessing() {
-        if (getServiceName() == null) {
-            if (isProviderEndpoint()) {
-                WebServiceProvider wsProvider =
-                    (WebServiceProvider)getImplementorClass().getAnnotation(
-                        WebServiceProvider.class);
-                String tns = wsProvider.targetNamespace();
-                String local = wsProvider.serviceName();
-                // create QName("", ""), if the above values are default
-                setServiceName(new QName(tns, local));
-            } else {
-                setServiceName(RuntimeModeler.getServiceName(getImplementorClass()));
-            }
-        }
-    }
-
-    /*
-     * If portName is not already set via DD or programmatically, it uses
-     * annotations on implementorClass to set PortName.
-     */
-    public void doPortNameProcessing() {
-        if (getPortName() == null) {
-            if (isProviderEndpoint()) {
-                WebServiceProvider wsProvider =
-                    (WebServiceProvider)getImplementorClass().getAnnotation(
-                        WebServiceProvider.class);
-                String tns = wsProvider.targetNamespace();
-                String local = wsProvider.portName();
-                // create QName("", ""), if the above values are default
-                setPortName(new QName(tns, local));
-
-            } else {
-                setPortName(RuntimeModeler.getPortName(getImplementorClass(),
-                    getServiceName().getNamespaceURI()));
-            }
-        } else {
-            String serviceNS = getServiceName().getNamespaceURI();
-            String portNS = getPortName().getNamespaceURI();
-            if (!serviceNS.equals(portNS)) {
-                throw new ServerRtException("wrong.tns.for.port",
-                    new Object[] { portNS, serviceNS });
-
-            }
-        }
-    }
-
-    /*
-     * Sets PortType QName
-     */
-    public void doPortTypeNameProcessing() {
-        if (getPortTypeName() == null) {
-            if (!isProviderEndpoint()) {
-                setPortTypeName(RuntimeModeler.getPortTypeName(getImplementorClass()));
-            }
-        }
-    }
-
-
-    /**
-     * creates a RuntimeModel using @link com.sun.xml.internal.ws.modeler.RuntimeModeler.
-     * The modeler creates the model by reading annotations on ImplementorClassobject.
-     * RuntimeModel is read only and is accessed from multiple threads afterwards.
-
-     */
-    public void init() {
-        if (implementor == null) {
-            throw new ServerRtException("null.implementor");
-        }
-        if (implementorClass == null) {
-            setImplementorClass(getImplementor().getClass());
-        }
-
-        // verify if implementor class has @WebService or @WebServiceProvider
-        verifyImplementorClass();
-
-        // ServiceName processing
-        doServiceNameProcessing();
-
-        // Port Name processing
-        doPortNameProcessing();
-
-        // PortType Name processing
-        //doPortTypeNameProcessing();
-
-        // setting a default binding
-        if (binding == null) {
-            String bindingId = RuntimeModeler.getBindingId(getImplementorClass());
-            setBinding(new SOAPBindingImpl(SOAPBinding.SOAP11HTTP_BINDING));
-        }
-
-        if (isProviderEndpoint()) {
-            checkProvider();
-            createProviderModel();
-        } else {
-            // Create runtime model for non Provider endpoints
-            createSEIModel();
-            if (getServiceName() == null) {
-                setServiceName(runtimeModel.getServiceQName());
-            }
-            if (getPortName() == null) {
-                setPortName(runtimeModel.getPortName());
-            }
-            //set mtom processing
-            if(binding instanceof SOAPBindingImpl){
-                runtimeModel.enableMtom(((SOAPBinding)binding).isMTOMEnabled());
-            }
-        }
-        // Process @HandlerChain, if handler-chain is not set via Deployment
-        // Descriptor
-        if (getBinding().getHandlerChain() == null) {
-                String bindingId = ((BindingImpl) binding).getActualBindingId();
-                HandlerAnnotationInfo chainInfo =
-                    HandlerAnnotationProcessor.buildHandlerInfo(
-                    implementorClass, getServiceName(),
-                    getPortName(), bindingId);
-                if (chainInfo != null) {
-                    getBinding().setHandlerChain(chainInfo.getHandlers());
-                    if (getBinding() instanceof SOAPBinding) {
-                        ((SOAPBinding) getBinding()).setRoles(
-                            chainInfo.getRoles());
-                    }
-                }
-        }
-        deployed = true;
-    }
-
-    public boolean needWSDLGeneration() {
-        if (isProviderEndpoint()) {
-            return false;
-        }
-        return (getWsdlUrl() == null);
-    }
-
-    /*
-     * Generates the WSDL and XML Schema for the endpoint if necessary
-     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
-     */
-    public void generateWSDL() {
-        BindingImpl bindingImpl = (BindingImpl)getBinding();
-        String bindingId = bindingImpl.getActualBindingId();
-        if (!bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING) &&
-            !bindingId.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) &&
-            !bindingId.equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
-            throw new ServerRtException("can.not.generate.wsdl", bindingId);
-        }
-
-        if (bindingId.equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
-            String msg = localizer.localize(
-                messageFactory.getMessage("generate.non.standard.wsdl"));
-            logger.warning(msg);
-        }
-
-        // Generate WSDL and schema documents using runtime model
-        if (getDocMetadata() == null) {
-            setMetadata(new HashMap<String, DocInfo>());
-        }
-        WSDLGenResolver wsdlResolver = new WSDLGenResolver(getDocMetadata());
-        WSDLGenerator wsdlGen = new WSDLGenerator(runtimeModel, wsdlResolver,
-                ((BindingImpl)binding).getBindingId());
-        try {
-            wsdlGen.doGeneration();
-        } catch(Exception e) {
-            throw new ServerRtException("server.rt.err",e);
-        }
-        setWSDLFileName(wsdlResolver.getWSDLFile());
-    }
-
-    /*
-     * Provider endpoint validation
-     */
-    private void checkProvider() {
-        if (!Provider.class.isAssignableFrom(getImplementorClass())) {
-            throw new ServerRtException("not.implement.provider",
-                new Object[] {getImplementorClass()});
-        }
-    }
-
-    public QName getPortName() {
-        return portName;
-    }
-
-    public void setPortName(QName n) {
-        portName = n;
-    }
-
-    public QName getPortTypeName() {
-        return portTypeName;
-    }
-
-    public void setPortTypeName(QName n) {
-        portTypeName = n;
-    }
-
-    public QName getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(QName n) {
-        serviceName = n;
-    }
-
-    public String getUrlPattern() {
-        return urlPattern;
-    }
-
-    public String getUrlPatternWithoutStar() {
-        if (urlPattern.endsWith("/*")) {
-            return urlPattern.substring(0, urlPattern.length() - 2);
-        } else {
-            return urlPattern;
-        }
-    }
-
-
-    public void setUrlPattern(String s) {
-        urlPattern = s;
-    }
-
-    public void setBinding(Binding binding){
-        this.binding = binding;
-    }
-
-    public Binding getBinding() {
-        return binding;
-    }
-
-    public java.util.List<Source> getMetadata() {
-        return metadata;
-    }
-
-    public void setMetadata(java.util.List<Source> metadata) {
-
-        this.metadata = metadata;
-    }
-
-    public RuntimeModel getRuntimeModel() {
-        return runtimeModel;
-    }
-
-    public Object getImplementor() {
-        return implementor;
-    }
-
-    public void setImplementor(Object implementor) {
-        this.implementor = implementor;
-    }
-
-    public Class getImplementorClass() {
-        if (implementorClass == null) {
-            implementorClass = implementor.getClass();
-        }
-        return implementorClass;
-    }
-
-    public void setImplementorClass(Class implementorClass) {
-        this.implementorClass = implementorClass;
-    }
-
-    public void setMetadata(Map<String, DocInfo> docs) {
-        this.docs = docs;
-    }
-
-    private void updateQuery2DocInfo() {
-        // update (wsdl, xsd=1 )-->DocInfo map
-        if (query2Doc != null) {
-            query2Doc.clear();
-        } else {
-            query2Doc = new HashMap<String, DocInfo>();
-        }
-        Set<Map.Entry<String, DocInfo>> entries = docs.entrySet();
-        for(Map.Entry<String, DocInfo> entry : entries) {
-            DocInfo docInfo = entry.getValue();
-            // Check to handle ?WSDL
-            if (docInfo.getQueryString().equals("wsdl")) {
-                query2Doc.put("WSDL", docInfo);
-            }
-            query2Doc.put(docInfo.getQueryString(), docInfo);
-        }
-    }
-
-    public WebServiceContext getWebServiceContext() {
-        return wsContext;
-    }
-
-    public void setWebServiceContext(WebServiceContext wsContext) {
-        this.wsContext = wsContext;
-    }
-
-
-    /*
-     * key - /WEB-INF/wsdl/xxx.wsdl
-     */
-    public Map<String, DocInfo> getDocMetadata() {
-        return docs;
-    }
-
-    /*
-     * path - /WEB-INF/wsdl/xxx.wsdl
-     * return - xsd=a | wsdl | wsdl=b etc
-     */
-    public String getQueryString(URL url) {
-        Set<Entry<String, DocInfo>> entries = getDocMetadata().entrySet();
-        for(Entry<String, DocInfo> entry : entries) {
-            // URLs are not matching. servlet container bug ?
-            if (entry.getValue().getUrl().toString().equals(url.toString())) {
-                return entry.getValue().getQueryString();
-            }
-        }
-        return null;
-    }
-
-    /*
-     * queryString - xsd=a | wsdl | wsdl=b etc
-     * return - /WEB-INF/wsdl/xxx.wsdl
-     */
-    public String getPath(String queryString) {
-        if (query2Doc != null) {
-            DocInfo docInfo = query2Doc.get(queryString);
-            return (docInfo == null) ? null : docInfo.getUrl().toString();
-        }
-        return null;
-    }
-
-    /*
-     * Injects the WebServiceContext. Called from Servlet.init(), or
-     * Endpoint.publish(). Used synchronized because multiple servlet
-     * instances may call this in their init()
-     */
-    public synchronized void injectContext()
-    throws IllegalAccessException, InvocationTargetException {
-        if (injectedContext) {
-            return;
-        }
-        try {
-            doFieldsInjection();
-            doMethodsInjection();
-        } finally {
-            injectedContext = true;
-        }
-    }
-
-    private void doFieldsInjection() {
-        Class c = getImplementorClass();
-        Field[] fields = c.getDeclaredFields();
-        for(final Field field: fields) {
-            Resource resource = field.getAnnotation(Resource.class);
-            if (resource != null) {
-                Class resourceType = resource.type();
-                Class fieldType = field.getType();
-                if (resourceType.equals(Object.class)) {
-                    if (fieldType.equals(javax.xml.ws.WebServiceContext.class)) {
-                        injectField(field);
-                    }
-                } else if (resourceType.equals(javax.xml.ws.WebServiceContext.class)) {
-                    if (fieldType.isAssignableFrom(javax.xml.ws.WebServiceContext.class)) {
-                        injectField(field);
-                    } else {
-                        throw new ServerRtException("wrong.field.type",
-                            field.getName());
-                    }
-                }
-            }
-        }
-    }
-
-    private void doMethodsInjection() {
-        Class c = getImplementorClass();
-        Method[] methods = c.getDeclaredMethods();
-        for(final Method method : methods) {
-            Resource resource = method.getAnnotation(Resource.class);
-            if (resource != null) {
-                Class[] paramTypes = method.getParameterTypes();
-                if (paramTypes.length != 1) {
-                    throw new ServerRtException("wrong.no.parameters",
-                        method.getName());
-                }
-                Class resourceType = resource.type();
-                Class argType = paramTypes[0];
-                if (resourceType.equals(Object.class)
-                    && argType.equals(javax.xml.ws.WebServiceContext.class)) {
-                    invokeMethod(method, new Object[] { wsContext });
-                } else if (resourceType.equals(javax.xml.ws.WebServiceContext.class)) {
-                    if (argType.isAssignableFrom(javax.xml.ws.WebServiceContext.class)) {
-                        invokeMethod(method, new Object[] { wsContext });
-                    } else {
-                        throw new ServerRtException("wrong.parameter.type",
-                            method.getName());
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * injects a resource into a Field
-     */
-    private void injectField(final Field field) {
-        try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws IllegalAccessException,
-                    InvocationTargetException {
-                    if (!field.isAccessible()) {
-                        field.setAccessible(true);
-                    }
-                    field.set(implementor, wsContext);
-                    return null;
-                }
-            });
-        } catch(PrivilegedActionException e) {
-            throw new ServerRtException("server.rt.err",e.getException());
-        }
-    }
-
-    /*
-     * Helper method to invoke a Method
-     */
-    private void invokeMethod(final Method method, final Object[] args) {
-        try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws IllegalAccessException,
-                InvocationTargetException {
-                    if (!method.isAccessible()) {
-                        method.setAccessible(true);
-                    }
-                    method.invoke(implementor, args);
-                    return null;
-                }
-            });
-        } catch(PrivilegedActionException e) {
-            throw new ServerRtException("server.rt.err",e.getException());
-        }
-    }
-
-    /*
-     * Calls the first method in the implementor object that has @BeginService
-     * annotation. Servlet.init(), or Endpoint.publish() may call this. Used
-     * synchronized because multiple servlet instances may call this in their
-     * init()
-     */
-    public synchronized void beginService() {
-        if (beginServiceDone) {
-            return;                 // Already called for this endpoint object
-        }
-        try {
-            invokeOnceMethod(PostConstruct.class);
-        } finally {
-            beginServiceDone = true;
-        }
-    }
-
-    /*
-     * Calls the first method in the implementor object that has @EndService
-     * annotation. Servlet.destory(), or Endpoint.stop() may call this. Used
-     * synchronized because multiple servlet instances may call this in their
-     * destroy()
-     */
-    public synchronized void endService() {
-        if (endServiceDone) {
-            return;                 // Already called for this endpoint object
-        }
-        try {
-            invokeOnceMethod(PreDestroy.class);
-            destroy();
-        } finally {
-            endServiceDone = true;
-        }
-    }
-
-    /*
-     * Helper method to invoke methods which don't take any arguments
-     * Also the annType annotation should be set only on one method
-     */
-    private void invokeOnceMethod(Class annType) {
-        Class c = getImplementorClass();
-        Method[] methods = c.getDeclaredMethods();
-        boolean once = false;
-        for(final Method method : methods) {
-            if (method.getAnnotation(annType) != null) {
-                if (once) {
-                    // Err: Multiple methods have annType annotation
-                    throw new ServerRtException("annotation.only.once",
-                        new Object[] { annType } );
-                }
-                if (method.getParameterTypes().length != 0) {
-                    throw new ServerRtException("not.zero.parameters",
-                        method.getName());
-                }
-                invokeMethod(method, new Object[]{ });
-                once = true;
-            }
-        }
-    }
-
-    /*
-     * Called when the container calls endService(). Used for any
-     * cleanup. Currently calls @PreDestroy method on existing
-     * handlers. This should not throw an exception, but we ignore
-     * it if it happens and continue with the next handler.
-     */
-    public void destroy() {
-        Binding binding = getBinding();
-        if (binding != null) {
-            List<Handler> handlers = binding.getHandlerChain();
-            if (handlers != null) {
-                for (Handler handler : handlers) {
-                    for (Method method : handler.getClass().getMethods()) {
-                        if (method.getAnnotation(PreDestroy.class) == null) {
-                            continue;
-                        }
-                        try {
-                            method.invoke(handler, new Object [0]);
-                        } catch (Exception e) {
-                            logger.warning("exception ignored from handler " +
-                                "@PreDestroy method: " +
-                                e.getMessage());
-                        }
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * @return returns null if no motm-threshold-value is specified in the descriptor
-     */
-
-    public Integer getMtomThreshold() {
-        return mtomThreshold;
-    }
-
-    public void setMtomThreshold(int mtomThreshold) {
-        this.mtomThreshold = mtomThreshold;
-    }
-
-    // Fill DocInfo with document info : WSDL or Schema, targetNS etc.
-    public static void fillDocInfo(RuntimeEndpointInfo endpointInfo)
-    throws XMLStreamException {
-        Map<String, DocInfo> metadata = endpointInfo.getDocMetadata();
-        if (metadata != null) {
-            for(Entry<String, DocInfo> entry: metadata.entrySet()) {
-                RuntimeWSDLParser.fillDocInfo(entry.getValue(),
-                    endpointInfo.getServiceName(),
-                    endpointInfo.getPortTypeName());
-            }
-        }
-    }
-
-    public static void publishWSDLDocs(RuntimeEndpointInfo endpointInfo) {
-        // Set queryString for the documents
-        Map<String, DocInfo> docs = endpointInfo.getDocMetadata();
-        if (docs == null) {
-            return;
-        }
-        Set<Entry<String, DocInfo>> entries = docs.entrySet();
-        List<String> wsdlSystemIds = new ArrayList<String>();
-        List<String> schemaSystemIds = new ArrayList<String>();
-        for(Entry<String, DocInfo> entry : entries) {
-            DocInfo docInfo = (DocInfo)entry.getValue();
-            DOC_TYPE docType = docInfo.getDocType();
-            String query = docInfo.getQueryString();
-            if (query == null && docType != null) {
-                switch(docType) {
-                    case WSDL :
-                        wsdlSystemIds.add(entry.getKey());
-                        break;
-                    case SCHEMA :
-                        schemaSystemIds.add(entry.getKey());
-                        break;
-                    case OTHER :
-                        //(docInfo.getUrl()+" is not a WSDL or Schema file.");
-                }
-            }
-        }
-
-        Collections.sort(wsdlSystemIds);
-        int wsdlnum = 1;
-        for(String wsdlSystemId : wsdlSystemIds) {
-            DocInfo docInfo = docs.get(wsdlSystemId);
-            docInfo.setQueryString("wsdl="+(wsdlnum++));
-        }
-        Collections.sort(schemaSystemIds);
-        int xsdnum = 1;
-        for(String schemaSystemId : schemaSystemIds) {
-            DocInfo docInfo = docs.get(schemaSystemId);
-            docInfo.setQueryString("xsd="+(xsdnum++));
-        }
-        endpointInfo.updateQuery2DocInfo();
-    }
-
-    public void verifyImplementorClass() {
-        if (wsProvider == null) {
-            wsProvider = (WebServiceProvider)implementorClass.getAnnotation(
-                    WebServiceProvider.class);
-        }
-        if (ws == null) {
-            ws = (WebService)implementorClass.getAnnotation(WebService.class);
-        }
-        if (wsProvider == null && ws == null) {
-            throw new ServerRtException("no.ws.annotation", implementorClass);
-
-        }
-        if (wsProvider != null && ws != null) {
-            throw new ServerRtException("both.ws.annotations", implementorClass);
-        }
-    }
-
-    public String getWsdlLocation() {
-        if (wsProvider != null && wsProvider.wsdlLocation().length() > 0) {
-            return wsProvider.wsdlLocation();
-        } else if (ws != null && ws.wsdlLocation().length() > 0) {
-            return ws.wsdlLocation();
-        }
-        return null;
-    }
-
-    public ProviderModel getProviderModel() {
-        return providerModel;
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java
new file mode 100644
index 0000000..a87b457
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
+import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.api.server.SDDocumentFilter;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.wsdl.parser.ParserUtil;
+import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+import com.sun.xml.internal.ws.util.RuntimeVersion;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * {@link SDDocument} implmentation.
+ *
+ * <p>
+ * This extends from {@link SDDocumentSource} so that
+ * JAX-WS server runtime code can use {@link SDDocument}
+ * as {@link SDDocumentSource}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+class SDDocumentImpl extends SDDocumentSource implements SDDocument {
+
+    private static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
+    private static final QName SCHEMA_INCLUDE_QNAME = new QName(NS_XSD, "include");
+    private static final QName SCHEMA_IMPORT_QNAME = new QName(NS_XSD, "import");
+    private static final String VERSION_COMMENT =
+        " Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is "+RuntimeVersion.VERSION+". ";
+
+    /**
+     * Creates {@link SDDocument} from {@link SDDocumentSource}.
+     * @param src WSDL document infoset
+     * @param serviceName wsdl:service name
+     * @param portTypeName
+     *      The information about the port of {@link WSEndpoint} to which this document is built for.
+     *      These values are used to determine which document is the concrete and abstract WSDLs
+     *      for this endpoint.
+     *
+     * @return null
+     *      Always non-null.
+     */
+    public static SDDocumentImpl create(SDDocumentSource src, QName serviceName, QName portTypeName) {
+        URL systemId = src.getSystemId();
+
+        try {
+            // RuntimeWSDLParser parser = new RuntimeWSDLParser(null);
+            XMLStreamReader reader = src.read();
+            try {
+                XMLStreamReaderUtil.nextElementContent(reader);
+
+                QName rootName = reader.getName();
+                if(rootName.equals(WSDLConstants.QNAME_SCHEMA)) {
+                    String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
+                    Set<String> importedDocs = new HashSet<String>();
+                    while (XMLStreamReaderUtil.nextContent(reader) != XMLStreamConstants.END_DOCUMENT) {
+                         if (reader.getEventType() != XMLStreamConstants.START_ELEMENT)
+                            continue;
+                        QName name = reader.getName();
+                        if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name)) {
+                            String importedDoc = reader.getAttributeValue(null, "schemaLocation");
+                            if (importedDoc != null) {
+                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+                            }
+                        }
+                    }
+                    return new SchemaImpl(rootName,systemId,src,tns,importedDocs);
+                } else if (rootName.equals(WSDLConstants.QNAME_DEFINITIONS)) {
+                    String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
+
+                    boolean hasPortType = false;
+                    boolean hasService = false;
+                    Set<String> importedDocs = new HashSet<String>();
+
+                    // if WSDL, parse more
+                    while (XMLStreamReaderUtil.nextContent(reader) != XMLStreamConstants.END_DOCUMENT) {
+                         if(reader.getEventType() != XMLStreamConstants.START_ELEMENT)
+                            continue;
+
+                        QName name = reader.getName();
+                        if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
+                            String pn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
+                            if (portTypeName != null) {
+                                if(portTypeName.getLocalPart().equals(pn)&&portTypeName.getNamespaceURI().equals(tns)) {
+                                    hasPortType = true;
+                                }
+                            }
+                        } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
+                            String sn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
+                            QName sqn = new QName(tns,sn);
+                            if(serviceName.equals(sqn)) {
+                                hasService = true;
+                            }
+                        } else if (WSDLConstants.QNAME_IMPORT.equals(name)) {
+                            String importedDoc = reader.getAttributeValue(null, "location");
+                            if (importedDoc != null) {
+                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+                            }
+                        } else if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name)) {
+                            String importedDoc = reader.getAttributeValue(null, "schemaLocation");
+                            if (importedDoc != null) {
+                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+                            }
+                        }
+                    }
+                    return new WSDLImpl(
+                        rootName,systemId,src,tns,hasPortType,hasService,importedDocs);
+                } else {
+                    return new SDDocumentImpl(rootName,systemId,src);
+                }
+            } finally {
+                reader.close();
+            }
+        } catch (WebServiceException e) {
+            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
+        } catch (IOException e) {
+            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
+        } catch (XMLStreamException e) {
+            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
+        }
+    }
+
+
+    private final QName rootName;
+    private final SDDocumentSource source;
+
+    /**
+     * Set when {@link ServiceDefinitionImpl} is constructed.
+     */
+    /*package*/ ServiceDefinitionImpl owner;
+
+    /**
+     * The original system ID of this document.
+     *
+     * When this document contains relative references to other resources,
+     * this field is used to find which {@link com.sun.xml.internal.ws.server.SDDocumentImpl} it refers to.
+     *
+     * Must not be null.
+     */
+    private final URL url;
+    private final Set<String> imports;
+
+    protected SDDocumentImpl(QName rootName, URL url, SDDocumentSource source) {
+        this(rootName, url, source, new HashSet<String>());
+    }
+
+    protected SDDocumentImpl(QName rootName, URL url, SDDocumentSource source, Set<String> imports) {
+        assert url!=null;
+        this.rootName = rootName;
+        this.source = source;
+        this.url = url;
+        this.imports = imports;
+    }
+
+    public QName getRootName() {
+        return rootName;
+    }
+
+    public boolean isWSDL() {
+        return false;
+    }
+
+    public boolean isSchema() {
+        return false;
+    }
+
+    public URL getURL() {
+        return url;
+    }
+
+    public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
+        return source.read(xif);
+    }
+
+    public XMLStreamReader read() throws IOException, XMLStreamException {
+        return source.read();
+    }
+
+    public URL getSystemId() {
+        return url;
+    }
+
+    public Set<String> getImports() {
+        return imports;
+    }
+
+    public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os) throws IOException {
+        XMLStreamWriter w = null;
+        try {
+            //generate the WSDL with utf-8 encoding and XML version 1.0
+            w = XMLStreamWriterFactory.create(os, "UTF-8");
+            w.writeStartDocument("UTF-8", "1.0");
+            writeTo(portAddressResolver,resolver,w);
+            w.writeEndDocument();
+        } catch (XMLStreamException e) {
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);
+            throw ioe;
+        } finally {
+            try {
+                if (w != null)
+                    w.close();
+            } catch (XMLStreamException e) {
+                IOException ioe = new IOException(e.getMessage());
+                ioe.initCause(e);
+                throw ioe;
+            }
+        }
+    }
+
+    public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out) throws XMLStreamException, IOException {
+        for (SDDocumentFilter f : owner.filters) {
+            out = f.filter(this,out);
+        }
+
+        XMLStreamReader xsr = source.read();
+        try {
+            out.writeComment(VERSION_COMMENT);
+            new WSDLPatcher(owner.owner,this,portAddressResolver,resolver).bridge(xsr,out);
+        } finally {
+            xsr.close();
+        }
+    }
+
+
+    /**
+     * {@link SDDocument.Schema} implementation.
+     *
+     * @author Kohsuke Kawaguchi
+     */
+    private static final class SchemaImpl extends SDDocumentImpl implements SDDocument.Schema {
+        private final String targetNamespace;
+
+        public SchemaImpl(QName rootName, URL url, SDDocumentSource source, String targetNamespace,
+                          Set<String> imports) {
+            super(rootName, url, source, imports);
+            this.targetNamespace = targetNamespace;
+        }
+
+        public String getTargetNamespace() {
+            return targetNamespace;
+        }
+
+        public boolean isSchema() {
+            return true;
+        }
+    }
+
+
+    private static final class WSDLImpl extends SDDocumentImpl implements SDDocument.WSDL {
+        private final String targetNamespace;
+        private final boolean hasPortType;
+        private final boolean hasService;
+
+        public WSDLImpl(QName rootName, URL url, SDDocumentSource source, String targetNamespace, boolean hasPortType,
+                        boolean hasService, Set<String> imports) {
+            super(rootName, url, source, imports);
+            this.targetNamespace = targetNamespace;
+            this.hasPortType = hasPortType;
+            this.hasService = hasService;
+        }
+
+        public String getTargetNamespace() {
+            return targetNamespace;
+        }
+
+        public boolean hasPortType() {
+            return hasPortType;
+        }
+
+        public boolean hasService() {
+            return hasService;
+        }
+
+        public boolean isWSDL() {
+            return true;
+        }
+    }
+
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java
index faf011b..f480518 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerPropertyConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerRtException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerRtException.java
index 9552210..ca973e1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerRtException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerRtException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,10 +44,7 @@
         super("server.rt.err", arg);
     }
 
-    /* (non-Javadoc)
-     * @see JAXWSExceptionBase#getResourceBundleName()
-     */
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.server";
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServiceDefinitionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServiceDefinitionImpl.java
new file mode 100644
index 0000000..8e3fba8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServiceDefinitionImpl.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.api.server.SDDocumentFilter;
+import com.sun.xml.internal.ws.api.server.ServiceDefinition;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * {@link ServiceDefinition} implementation.
+ *
+ * <p>
+ * You construct a {@link ServiceDefinitionImpl} by first constructing
+ * a list of {@link SDDocumentImpl}s.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class ServiceDefinitionImpl implements ServiceDefinition {
+    private final List<SDDocumentImpl> docs;
+
+    private final Map<String,SDDocumentImpl> bySystemId;
+    private final @NotNull SDDocumentImpl primaryWsdl;
+
+    /**
+     * Set when {@link WSEndpointImpl} is created.
+     */
+    /*package*/ WSEndpointImpl<?> owner;
+
+    /*package*/ final List<SDDocumentFilter> filters = new ArrayList<SDDocumentFilter>();
+
+    /**
+     * @param docs
+     *      List of {@link SDDocumentImpl}s to form the description.
+     *      There must be at least one entry.
+     *      The first document is considered {@link #getPrimary() primary}.
+     */
+    public ServiceDefinitionImpl(List<SDDocumentImpl> docs, @NotNull SDDocumentImpl primaryWsdl) {
+        assert docs.contains(primaryWsdl);
+        this.docs = docs;
+        this.primaryWsdl = primaryWsdl;
+
+        this.bySystemId = new HashMap<String, SDDocumentImpl>(docs.size());
+        for (SDDocumentImpl doc : docs) {
+            bySystemId.put(doc.getURL().toExternalForm(),doc);
+
+            assert doc.owner==null;
+            doc.owner = this;
+        }
+    }
+
+    /**
+     * The owner is set when {@link WSEndpointImpl} is created.
+     */
+    /*package*/ void setOwner(WSEndpointImpl<?> owner) {
+        assert owner!=null && this.owner==null;
+        this.owner = owner;
+    }
+
+    public @NotNull SDDocument getPrimary() {
+        return primaryWsdl;
+    }
+
+    public void addFilter(SDDocumentFilter filter) {
+        filters.add(filter);
+    }
+
+    public Iterator<SDDocument> iterator() {
+        return (Iterator)docs.iterator();
+    }
+
+    /**
+     * @see #getBySystemId(String)
+     */
+    public SDDocument getBySystemId(URL systemId) {
+        return getBySystemId(systemId.toString());
+    }
+
+    /**
+     * Gets the {@link SDDocumentImpl} whose {@link SDDocumentImpl#getURL()}
+     * returns the specified value.
+     *
+     * @return
+     *      null if none is found.
+     */
+    public SDDocumentImpl getBySystemId(String systemId) {
+        return bySystemId.get(systemId);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SingletonResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SingletonResolver.java
new file mode 100644
index 0000000..eb67256
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SingletonResolver.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WSWebServiceContext;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+/**
+ * {@link InstanceResolver} that always returns a single instance.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class SingletonResolver<T> extends AbstractInstanceResolver<T> {
+    private final @NotNull T singleton;
+
+    public SingletonResolver(@NotNull T singleton) {
+        this.singleton = singleton;
+    }
+
+    public @NotNull T resolve(Packet request) {
+        return singleton;
+    }
+
+    public void start(WSWebServiceContext wsc, WSEndpoint endpoint) {
+        getResourceInjector(endpoint).inject(wsc,singleton);
+        // notify that we are ready to serve
+        invokeMethod(findAnnotatedMethod(singleton.getClass(),PostConstruct.class),singleton);
+    }
+
+    public void dispose() {
+        invokeMethod(findAnnotatedMethod(singleton.getClass(),PreDestroy.class),singleton);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/StatefulInstanceResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/StatefulInstanceResolver.java
new file mode 100644
index 0000000..6c1fb1f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/StatefulInstanceResolver.java
@@ -0,0 +1,420 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.FragmentContentHandler;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferSource;
+import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferCreator;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.Header;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WSWebServiceContext;
+import com.sun.xml.internal.ws.developer.EPRRecipe;
+import com.sun.xml.internal.ws.developer.StatefulWebServiceManager;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.spi.ProviderImpl;
+import com.sun.xml.internal.ws.util.xml.ContentHandlerToXMLStreamWriter;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * {@link InstanceResolver} that looks at JAX-WS cookie header to
+ * determine the instance to which a message will be routed.
+ *
+ * <p>
+ * See {@link StatefulWebServiceManager} for more about user-level semantics.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class StatefulInstanceResolver<T> extends AbstractMultiInstanceResolver<T> implements StatefulWebServiceManager<T> {
+    /**
+     * This instance is used for serving messages that have no cookie
+     * or cookie value that the server doesn't recognize.
+     */
+    private volatile @Nullable T fallback;
+
+    /**
+     * Maintains the stateful service instance and its time-out timer.
+     */
+    private final class Instance {
+        final @NotNull T instance;
+        TimerTask task;
+
+        public Instance(T instance) {
+            this.instance = instance;
+        }
+
+        /**
+         * Resets the timer.
+         */
+        public synchronized void restartTimer() {
+            cancel();
+            if(timeoutMilliseconds==0)  return; // no timer
+
+            task = new TimerTask() {
+                public void run() {
+                    try {
+                        Callback<T> cb = timeoutCallback;
+                        if(cb!=null) {
+                            cb.onTimeout(instance,StatefulInstanceResolver.this);
+                            return;
+                        }
+                        // default operation is to unexport it.
+                        unexport(instance);
+                    } catch (Throwable e) {
+                        // don't let an error in the code kill the timer thread
+                        logger.log(Level.SEVERE, "time out handler failed", e);
+                    }
+                }
+            };
+            timer.schedule(task,timeoutMilliseconds);
+        }
+
+        /**
+         * Cancels the timer.
+         */
+        public synchronized void cancel() {
+            if(task!=null)
+                task.cancel();
+            task = null;
+        }
+    }
+
+    /**
+     * Maps object ID to instances.
+     */
+    private final Map<String,Instance> instances = Collections.synchronizedMap(new HashMap<String,Instance>());
+    /**
+     * Reverse look up for {@link #instances}.
+     */
+    private final Map<T,String> reverseInstances = Collections.synchronizedMap(new HashMap<T,String>());
+
+    // time out control. 0=disabled
+    private volatile long timeoutMilliseconds = 0;
+    private volatile Callback<T> timeoutCallback;
+
+    public StatefulInstanceResolver(Class<T> clazz) {
+        super(clazz);
+    }
+
+    @Override
+    public @NotNull T resolve(Packet request) {
+        HeaderList headers = request.getMessage().getHeaders();
+        Header header = headers.get(COOKIE_TAG, true);
+        String id=null;
+        if(header!=null) {
+            // find the instance
+            id = header.getStringContent();
+            Instance o = instances.get(id);
+            if(o!=null) {
+                o.restartTimer();
+                return o.instance;
+            }
+
+            // huh? what is this ID?
+            logger.log(Level.INFO,"Request had an unrecognized object ID "+id);
+        }
+
+        // need to fallback
+        T fallback = this.fallback;
+        if(fallback!=null)
+            return fallback;
+
+        if(id==null)
+            throw new WebServiceException(ServerMessages.STATEFUL_COOKIE_HEADER_REQUIRED(COOKIE_TAG));
+        else
+            throw new WebServiceException(ServerMessages.STATEFUL_COOKIE_HEADER_INCORRECT(COOKIE_TAG,id));
+    }
+
+    @Override
+    public void start(WSWebServiceContext wsc, WSEndpoint endpoint) {
+        super.start(wsc,endpoint);
+
+        if(endpoint.getBinding().getAddressingVersion()==null)
+            // addressing is not enabled.
+            throw new WebServiceException(ServerMessages.STATEFUL_REQURES_ADDRESSING(clazz));
+
+            // inject StatefulWebServiceManager.
+        for(Field field: clazz.getDeclaredFields()) {
+            if(field.getType()==StatefulWebServiceManager.class) {
+                if(!Modifier.isStatic(field.getModifiers()))
+                    throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(StatefulWebServiceManager.class,field));
+                new FieldInjectionPlan<T,StatefulWebServiceManager>(field).inject(null,this);
+            }
+        }
+
+        for(Method method : clazz.getDeclaredMethods()) {
+            Class[] paramTypes = method.getParameterTypes();
+            if (paramTypes.length != 1)
+                continue;   // not what we are looking for
+
+            if(paramTypes[0]==StatefulWebServiceManager.class) {
+                if(!Modifier.isStatic(method.getModifiers()))
+                    throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(StatefulWebServiceManager.class,method));
+
+                new MethodInjectionPlan<T,StatefulWebServiceManager>(method).inject(null,this);
+            }
+        }
+    }
+
+    @Override
+    public void dispose() {
+        reverseInstances.clear();
+        synchronized(instances) {
+            for (Instance t : instances.values()) {
+                t.cancel();
+                dispose(t.instance);
+            }
+            instances.clear();
+        }
+        if(fallback!=null)
+            dispose(fallback);
+        fallback = null;
+    }
+
+    @NotNull
+    public W3CEndpointReference export(T o) {
+        return export(W3CEndpointReference.class,o);
+    }
+
+    @NotNull
+    public <EPR extends EndpointReference>EPR export(Class<EPR> epr, T o) {
+        return export(epr,o,null);
+    }
+
+    public <EPR extends EndpointReference> EPR export(Class<EPR> epr, T o, EPRRecipe recipe) {
+        return export(epr, InvokerTube.getCurrentPacket(), o, recipe);
+    }
+
+    @NotNull
+    public <EPR extends EndpointReference>EPR export(Class<EPR> epr, WebServiceContext context, T o) {
+        if (context instanceof WSWebServiceContext) {
+            WSWebServiceContext wswsc = (WSWebServiceContext) context;
+            return export(epr, wswsc.getRequestPacket(), o);
+        }
+
+        throw new WebServiceException(ServerMessages.STATEFUL_INVALID_WEBSERVICE_CONTEXT(context));
+    }
+
+    @NotNull
+    public <EPR extends EndpointReference> EPR export(Class<EPR> adrsVer, @NotNull Packet currentRequest, T o) {
+        return export(adrsVer,currentRequest,o,null);
+    }
+
+    public <EPR extends EndpointReference> EPR export(Class<EPR> adrsVer, @NotNull Packet currentRequest, T o, EPRRecipe recipe) {
+        return export(adrsVer, currentRequest.webServiceContextDelegate.getEPRAddress(currentRequest,owner), o, recipe);
+    }
+
+    @NotNull
+    public <EPR extends EndpointReference> EPR export(Class<EPR> adrsVer, String endpointAddress, T o) {
+        return export(adrsVer,endpointAddress,o,null);
+    }
+
+    @NotNull
+    public <EPR extends EndpointReference> EPR export(Class<EPR> adrsVer, String endpointAddress, T o, EPRRecipe recipe) {
+        if(endpointAddress==null)
+            throw new IllegalArgumentException("No address available");
+
+        String key = reverseInstances.get(o);
+
+        if(key!=null) return createEPR(key, adrsVer, endpointAddress, recipe);
+
+        // not exported yet.
+        synchronized(this) {
+            // double check now in the synchronization block to
+            // really make sure that we can export.
+            key = reverseInstances.get(o);
+            if(key!=null) return createEPR(key, adrsVer, endpointAddress, recipe);
+
+            if(o!=null)
+                prepare(o);
+            key = UUID.randomUUID().toString();
+            Instance instance = new Instance(o);
+            instances.put(key, instance);
+            reverseInstances.put(o,key);
+            if(timeoutMilliseconds!=0)
+                instance.restartTimer();
+        }
+
+        return createEPR(key, adrsVer, endpointAddress, recipe);
+    }
+
+    /**
+     * Creates an EPR that has the right key.
+     */
+    private <EPR extends EndpointReference> EPR createEPR(String key, Class<EPR> eprClass, String address, EPRRecipe recipe) {
+        AddressingVersion adrsVer = AddressingVersion.fromSpecClass(eprClass);
+
+        try {
+            StreamWriterBufferCreator w = new StreamWriterBufferCreator();
+
+            w.writeStartDocument();
+            w.writeStartElement("wsa","EndpointReference", adrsVer.nsUri);
+            w.writeNamespace("wsa",adrsVer.nsUri);
+
+            w.writeStartElement("wsa","Address",adrsVer.nsUri);
+            w.writeCharacters(address);
+            w.writeEndElement();
+
+            w.writeStartElement("wsa","ReferenceParameters",adrsVer.nsUri);
+            w.writeStartElement(COOKIE_TAG.getPrefix(), COOKIE_TAG.getLocalPart(), COOKIE_TAG.getNamespaceURI());
+            w.writeCharacters(key);
+            w.writeEndElement();
+            if(recipe!=null) {
+                for (Header h : recipe.getReferenceParameters())
+                    h.writeTo(w);
+            }
+            w.writeEndElement();
+
+            if(recipe!=null) {
+                List<Source> metadata = recipe.getMetadata();
+                if(!metadata.isEmpty()) {
+                    w.writeStartElement("wsa","Metadata",adrsVer.nsUri);
+                    Transformer t = XmlUtil.newTransformer();
+                    for (Source s : metadata)
+                        try {
+                            t.transform(s,
+                                new SAXResult(new FragmentContentHandler(new ContentHandlerToXMLStreamWriter(w))));
+                        } catch (TransformerException e) {
+                            throw new IllegalArgumentException("Unable to write EPR metadata "+s,e);
+                        }
+                    w.writeEndElement();
+                }
+            }
+
+            w.writeEndElement();
+            w.writeEndDocument();
+
+            // TODO: this can be done better by writing SAX code that produces infoset
+            // and setting that as Source.
+            return eprClass.cast(ProviderImpl.INSTANCE.readEndpointReference(
+                new XMLStreamBufferSource(w.getXMLStreamBuffer())));
+        } catch (XMLStreamException e) {
+            throw new Error(e); // this must be a bug in our code
+        }
+    }
+
+    public void unexport(@Nullable T o) {
+        if(o==null)     return;
+        String key = reverseInstances.get(o);
+        if(key==null)   return; // already unexported
+        instances.remove(key);
+    }
+
+    public T resolve(EndpointReference epr) {
+        class CookieSniffer extends DefaultHandler {
+            StringBuilder buf = new StringBuilder();
+            boolean inCookie = false;
+            public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+                if(localName.equals(COOKIE_TAG.getLocalPart()) && uri.equals(COOKIE_TAG.getNamespaceURI()))
+                    inCookie = true;
+            }
+            public void characters(char ch[], int start, int length) throws SAXException {
+                if(inCookie)
+                    buf.append(ch,start,length);
+            }
+            public void endElement(String uri, String localName, String qName) throws SAXException {
+                inCookie = false;
+            }
+        }
+        CookieSniffer sniffer = new CookieSniffer();
+        epr.writeTo(new SAXResult(sniffer));
+
+        Instance o = instances.get(sniffer.buf.toString());
+        if(o!=null)
+            return o.instance;
+        return null;
+    }
+
+    public void setFallbackInstance(T o) {
+        if(o!=null)
+            prepare(o);
+        this.fallback = o;
+    }
+
+    public void setTimeout(long milliseconds, Callback<T> callback) {
+        if(milliseconds<0)
+            throw new IllegalArgumentException();
+        this.timeoutMilliseconds = milliseconds;
+        this.timeoutCallback = callback;
+        if(timeoutMilliseconds>0)
+            startTimer();
+    }
+
+    public void touch(T o) {
+        String key = reverseInstances.get(o);
+        if(key==null)   return; // already unexported.
+        Instance inst = instances.get(key);
+        if(inst==null)  return;
+        inst.restartTimer();
+    }
+
+    /**
+     * Timer that controls the instance time out. Lazily created.
+     */
+    private static volatile Timer timer;
+
+    private static synchronized void startTimer() {
+        if(timer==null)
+            timer = new Timer("JAX-WS stateful web service timeout timer");
+    }
+
+
+    private static final QName COOKIE_TAG = new QName("http://jax-ws.dev.java.net/xml/ns/","objectId","jaxws");
+
+    private static final Logger logger =
+        Logger.getLogger(com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/TargetFinderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/TargetFinderImpl.java
deleted file mode 100644
index bc6b577..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/TargetFinderImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-//
-// Created       : 2004 Apr 09 (Fri) 06:16:58 by Harold Carr.
-// Last Modified : 2004 May 03 (Mon) 17:28:38 by Harold Carr.
-//
-
-package com.sun.xml.internal.ws.server;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.presentation.Tie;
-
-public class TargetFinderImpl implements TargetFinder {
-
-    private Tie tie;
-
-    public TargetFinderImpl(Tie tie) {
-        this.tie = tie;
-    }
-
-    public Tie findTarget(MessageInfo messageInfo) {
-        return tie;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/Tie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/Tie.java
deleted file mode 100644
index 1357397..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/Tie.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.server;
-
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.MessageContext.Scope;
-import com.sun.xml.internal.ws.pept.Delegate;
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase;
-import com.sun.xml.internal.ws.model.RuntimeModel;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-import com.sun.xml.internal.ws.developer.JAXWSProperties;
-
-/**
- * Entry point for all server requests.
- *
- * @author WS Development Team
- */
-public class Tie implements com.sun.xml.internal.ws.spi.runtime.Tie {
-
-    /**
-     * Common entry point for server runtime. <br>
-     * Creates a MessageInfo for every Request/Response.<br>
-     * Creates a RuntimeContext for every Request/Response and sets that as a metadata in
-     * MessageInfo. Doesn't create any other metadata on MessageInfo. If anything is needed,
-     * that can be created on RuntimeContext<br>
-     * EPTFactoryFactoryBase is used to select a correct EPTFactory<br>
-     * Calls MessageDispatcher.receive(MessageInfo). <br>
-     * MessageDispatcher orchestrates all the flow: reading from WSConnection,
-     * decodes message to parameters, invoking implementor, encodes parameters to message,
-     * and writing to WSConnection
-     *
-     * @param connection encapsulates multiple transports
-     * @param endpoint has all the information about target endpoint
-     * @throws Exception throws Exception if any error occurs
-     */
-    public void handle(WSConnection connection,
-        com.sun.xml.internal.ws.spi.runtime.RuntimeEndpointInfo endpoint)
-    throws Exception {
-
-        // Create MessageInfo. MessageInfo holds all the info for this request
-        Delegate delegate = new DelegateBase();
-        MessageInfo messageInfo = (MessageInfo)delegate.getMessageStruct();
-
-        // Create runtime context, runtime model for dynamic runtime
-        RuntimeEndpointInfo endpointInfo = (RuntimeEndpointInfo)endpoint;
-        RuntimeModel runtimeModel = endpointInfo.getRuntimeModel();
-        RuntimeContext runtimeContext = new RuntimeContext(runtimeModel);
-        runtimeContext.setRuntimeEndpointInfo(endpointInfo);
-
-        // Update MessageContext
-        MessageContext msgCtxt =
-            endpointInfo.getWebServiceContext().getMessageContext();
-        updateMessageContext(endpointInfo, msgCtxt);
-
-        // Set runtime context on MessageInfo
-        MessageInfoUtil.setRuntimeContext(messageInfo, runtimeContext);
-        messageInfo.setConnection(connection);
-
-        // Select EPTFactory based on binding, and transport
-        EPTFactory eptFactory = EPTFactoryFactoryBase.getEPTFactory(messageInfo);
-        messageInfo.setEPTFactory(eptFactory);
-
-        // MessageDispatcher archestrates the flow
-        MessageDispatcher messageDispatcher =
-            messageInfo.getEPTFactory().getMessageDispatcher(messageInfo);
-        messageDispatcher.receive(messageInfo);
-    }
-
-    /**
-     * Updates MessageContext object with Service, and Port QNames
-     */
-    private void updateMessageContext( RuntimeEndpointInfo endpoint,
-        MessageContext ctxt) {
-
-        ctxt.put(MessageContext.WSDL_SERVICE, endpoint.getServiceName());
-        ctxt.setScope(MessageContext.WSDL_SERVICE, Scope.APPLICATION);
-        ctxt.put(MessageContext.WSDL_PORT, endpoint.getPortName());
-        ctxt.setScope(MessageContext.WSDL_PORT, Scope.APPLICATION);
-        ctxt.put(JAXWSProperties.MTOM_THRESHOLOD_VALUE, endpoint.getMtomThreshold());
-        ctxt.setScope(JAXWSProperties.MTOM_THRESHOLOD_VALUE, Scope.APPLICATION);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java
new file mode 100644
index 0000000..515ce69
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+
+import java.util.List;
+
+/**
+ * {@link Codec} throws this exception when it doesn't understand request message's
+ * Content-Type
+ * @author Jitendra Kotamraju
+ */
+public final class UnsupportedMediaException extends JAXWSExceptionBase {
+
+    public UnsupportedMediaException( @NotNull String contentType, List<String> expectedContentTypes) {
+        super(ServerMessages.localizableUNSUPPORTED_CONTENT_TYPE(contentType, expectedContentTypes));
+    }
+
+    public UnsupportedMediaException() {
+        super(ServerMessages.localizableNO_CONTENT_TYPE());
+    }
+
+    public String getDefaultResourceBundleName() {
+        return "com.sun.xml.internal.ws.resources.server";
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java
index 4992bff..4adca8b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,230 +25,173 @@
 
 package com.sun.xml.internal.ws.server;
 
-import com.sun.xml.internal.ws.server.DocInfo.DOC_TYPE;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.wsdl.parser.Service;
-import com.sun.xml.internal.ws.wsdl.writer.WSDLOutputResolver;
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.stream.buffer.MutableXMLStreamBuffer;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver;
 
+import javax.xml.namespace.QName;
 import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
 import javax.xml.ws.Holder;
-import java.io.InputStream;
+import javax.xml.ws.WebServiceException;
 import java.net.URL;
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
 
 /**
- * @author WS Development Team
+ * WSDLGenerator uses WSDLResolver while creating WSDL artifacts. WSDLResolver
+ * is used to control the file names and which artifact to be generated or not.
+ *
+ * @author Jitendra Kotamraju
  */
+final class WSDLGenResolver implements WSDLResolver {
 
-public class WSDLGenResolver implements WSDLOutputResolver {
+    private final List<SDDocumentImpl> docs;
+    private final List<SDDocumentSource> newDocs = new ArrayList<SDDocumentSource>();
+    private SDDocumentSource concreteWsdlSource;
 
-    private Map<String, DocInfo> docs;
-    private DocInfo abstractWsdl;
-    private DocInfo concreteWsdl;
-    private Map<String, List<String>> nsMapping;    // targetNS -> system id list
+    private SDDocumentImpl abstractWsdl;
+    private SDDocumentImpl concreteWsdl;
 
-    public WSDLGenResolver(Map<String, DocInfo> docs) {
+    /**
+     * targetNS -> schema documents.
+     */
+    private final Map<String, List<SDDocumentImpl>> nsMapping = new HashMap<String,List<SDDocumentImpl>>();
+
+    private final QName serviceName;
+    private final QName portTypeName;
+
+    public WSDLGenResolver(@NotNull List<SDDocumentImpl> docs,QName serviceName,QName portTypeName) {
         this.docs = docs;
-        nsMapping = new HashMap<String, List<String>>();
-        Set<Entry<String, DocInfo>> docEntries = docs.entrySet();
-        for(Entry<String, DocInfo> entry : docEntries) {
-            DocInfo docInfo = entry.getValue();
-            if (docInfo.isHavingPortType()) {
-                abstractWsdl = docInfo;
+        this.serviceName = serviceName;
+        this.portTypeName = portTypeName;
+
+        for (SDDocumentImpl doc : docs) {
+            if(doc.isWSDL()) {
+                SDDocument.WSDL wsdl = (SDDocument.WSDL) doc;
+                if(wsdl.hasPortType())
+                    abstractWsdl = doc;
             }
-            if (docInfo.getDocType() == DOC_TYPE.SCHEMA) {
-                List<String> sysIds = nsMapping.get(docInfo.getTargetNamespace());
+            if(doc.isSchema()) {
+                SDDocument.Schema schema = (SDDocument.Schema) doc;
+                List<SDDocumentImpl> sysIds = nsMapping.get(schema.getTargetNamespace());
                 if (sysIds == null) {
-                    sysIds = new ArrayList<String>();
-                    nsMapping.put(docInfo.getTargetNamespace(), sysIds);
+                    sysIds = new ArrayList<SDDocumentImpl>();
+                    nsMapping.put(schema.getTargetNamespace(), sysIds);
                 }
-                sysIds.add(docInfo.getUrl().toString());
+                sysIds.add(doc);
             }
         }
     }
 
-    public String getWSDLFile() {
-        return concreteWsdl.getUrl().toString();
+    /**
+     * Generates the concrete WSDL that contains service element.
+     *
+     * @return Result the generated concrete WSDL
+     */
+    public Result getWSDL(String filename) {
+        URL url = createURL(filename);
+        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+        xsb.setSystemId(url.toExternalForm());
+        concreteWsdlSource = SDDocumentSource.create(url,xsb);
+        newDocs.add(concreteWsdlSource);
+        XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
+        r.setSystemId(filename);
+        return r;
     }
 
-    public Map<String, DocInfo> getDocs() {
-        return docs;
-    }
-
-    /*
-    public Result getWSDLOutput(String suggestedFileName) {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-
-        StreamDocInfo docInfo = new StreamDocInfo(suggestedFileName, bout);
-
-        if (wsdlFile == null) {
-            docInfo.setQueryString("wsdl");
-            wsdlFile = suggestedFileName;
-        } else {
-            docInfo.setQueryString("wsdl="+suggestedFileName);
+    /**
+     * At present, it returns file URL scheme eventhough there is no resource
+     * in the filesystem.
+     *
+     * @return URL of the generated document
+     *
+     */
+    private URL createURL(String filename) {
+        try {
+            return new URL("file:///"+filename);
+        } catch (MalformedURLException e) {
+            // TODO: I really don't think this is the right way to handle this error,
+            // WSDLResolver needs to be documented carefully.
+            throw new WebServiceException(e);
         }
-        docs.put(docInfo.getPath(),  docInfo);
-
-        StreamResult result = new StreamResult();
-        result.setOutputStream(bout);
-        result.setSystemId(suggestedFileName);
-        return result;
-    }
-     */
-
-    public Result getSchemaOutput(String namespaceUri, String suggestedFileName) {
-        ByteArrayBuffer bout = new ByteArrayBuffer();
-
-        StreamDocInfo docInfo = new StreamDocInfo(suggestedFileName, bout);
-        docInfo.setQueryString("xsd="+suggestedFileName);
-        docInfo.setDocType(DOC_TYPE.SCHEMA);
-        docs.put(docInfo.getUrl().toString(),  docInfo);
-
-        StreamResult result = new StreamResult();
-        result.setOutputStream(bout);
-        result.setSystemId(docInfo.getUrl().toString());
-        return result;
     }
 
-    /*
-     * return null if concrete WSDL need not be generated
-     */
-    public Result getWSDLOutput(String filename) {
-        ByteArrayBuffer bout = new ByteArrayBuffer();
-        StreamDocInfo docInfo = new StreamDocInfo(filename, bout);
-        docInfo.setDocType(DOC_TYPE.WSDL);
-        docInfo.setQueryString("wsdl");
-        concreteWsdl = docInfo;
-        docs.put(docInfo.getUrl().toString(),  docInfo);
-        StreamResult result = new StreamResult();
-        result.setOutputStream(bout);
-        result.setSystemId(docInfo.getUrl().toString());
-        return result;
-    }
-
-    /*
+    /**
      * Updates filename if the suggested filename need to be changed in
-     * wsdl:import
+     * wsdl:import. If the metadata already contains abstract wsdl(i.e. a WSDL
+     * which has the porttype), then the abstract wsdl shouldn't be generated
      *
      * return null if abstract WSDL need not be generated
+     *        Result the abstract WSDL
      */
-    public Result getAbstractWSDLOutput(Holder<String> filename) {
+    public Result getAbstractWSDL(Holder<String> filename) {
         if (abstractWsdl != null) {
-            filename.value = abstractWsdl.getUrl().toString();
+            filename.value = abstractWsdl.getURL().toString();
             return null;                // Don't generate abstract WSDL
         }
-        ByteArrayBuffer bout = new ByteArrayBuffer();
-        StreamDocInfo abstractWsdl = new StreamDocInfo(filename.value, bout);
-        abstractWsdl.setDocType(DOC_TYPE.WSDL);
-        //abstractWsdl.setQueryString("wsdl="+filename.value);
-        docs.put(abstractWsdl.getUrl().toString(),  abstractWsdl);
-        StreamResult result = new StreamResult();
-        result.setOutputStream(bout);
-        result.setSystemId(abstractWsdl.getUrl().toString());
-        return result;
+        URL url = createURL(filename.value);
+        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+        xsb.setSystemId(url.toExternalForm());
+        SDDocumentSource abstractWsdlSource = SDDocumentSource.create(url,xsb);
+        newDocs.add(abstractWsdlSource);
+        XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
+        r.setSystemId(filename.value);
+        return r;
     }
 
-    /*
+    /**
      * Updates filename if the suggested filename need to be changed in
-     * xsd:import
+     * xsd:import. If there is already a schema document for the namespace
+     * in the metadata, then it is not generated.
      *
      * return null if schema need not be generated
+     *        Result the generated schema document
      */
     public Result getSchemaOutput(String namespace, Holder<String> filename) {
-        List<String> schemas = nsMapping.get(namespace);
+        List<SDDocumentImpl> schemas = nsMapping.get(namespace);
         if (schemas != null) {
             if (schemas.size() > 1) {
                 throw new ServerRtException("server.rt.err",
                     "More than one schema for the target namespace "+namespace);
             }
-            filename.value = schemas.get(0);
+            filename.value = schemas.get(0).getURL().toExternalForm();
             return null;            // Don't generate schema
         }
-        ByteArrayBuffer bout = new ByteArrayBuffer();
-        StreamDocInfo docInfo = new StreamDocInfo(filename.value, bout);
-        docInfo.setDocType(DOC_TYPE.SCHEMA);
-        //docInfo.setQueryString("xsd="+filename.value);
-        docs.put(docInfo.getUrl().toString(),  docInfo);
-        StreamResult result = new StreamResult();
-        result.setOutputStream(bout);
-        result.setSystemId(docInfo.getUrl().toString());
-        return result;
+
+        URL url = createURL(filename.value);
+        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
+        xsb.setSystemId(url.toExternalForm());
+        SDDocumentSource sd = SDDocumentSource.create(url,xsb);
+        newDocs.add(sd);
+
+        XMLStreamBufferResult r = new XMLStreamBufferResult(xsb);
+        r.setSystemId(filename.value);
+        return r;
     }
 
-    private static class StreamDocInfo implements DocInfo {
-        private ByteArrayBuffer bout;
-        private String resource;
-        private String queryString;
-                private DOC_TYPE docType;
-
-        public StreamDocInfo(String resource, ByteArrayBuffer bout) {
-            this.resource = resource;
-            this.bout = bout;
-        }
-
-        public InputStream getDoc() {
-            bout.close();
-            return bout.newInputStream();
-        }
-
-        public String getPath() {
-            return resource;
-        }
-
-        public URL getUrl() {
-            try {
-                return new URL("file:///"+resource);
-            } catch(Exception e) {
-
+    /**
+     * Converts SDDocumentSource to SDDocumentImpl and updates original docs. It
+     * categories the generated documents into WSDL, Schema types.
+     *
+     * @return the primary WSDL
+     *         null if it is not there in the generated documents
+     *
+     */
+    public SDDocumentImpl updateDocs() {
+        for (SDDocumentSource doc : newDocs) {
+            SDDocumentImpl docImpl = SDDocumentImpl.create(doc,serviceName,portTypeName);
+            if (doc == concreteWsdlSource) {
+                concreteWsdl = docImpl;
             }
-            return null;
+            docs.add(docImpl);
         }
-
-        public String getQueryString() {
-            return queryString;
-        }
-
-        public void setQueryString(String queryString) {
-            this.queryString = queryString;
-        }
-
-        public void setDocType(DOC_TYPE docType) {
-                        this.docType = docType;
-        }
-
-        public DOC_TYPE getDocType() {
-            return docType;
-        }
-
-        public void setTargetNamespace(String ns) {
-
-        }
-
-        public String getTargetNamespace() {
-            return null;
-        }
-
-        public void setService(Service service) {
-
-        }
-
-        public Service getService() {
-            return null;
-        }
-
-        public void setHavingPortType(boolean portType) {
-
-        }
-
-        public boolean isHavingPortType() {
-            return false;
-        }
+        return concreteWsdl;
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java
index 10d6b3e..bb06450 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,282 +22,225 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.ws.server;
+
+import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
 import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
-import java.io.InputStream;
-import java.io.OutputStream;
+import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+import com.sun.istack.internal.Nullable;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
 import java.util.logging.Logger;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventFactory;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.events.XMLEvent;
-public class WSDLPatcher {
+
+/**
+ * Patches WSDL with the correct endpoint address and the relative paths
+ * to other documents.
+ *
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ */
+final class WSDLPatcher extends XMLStreamReaderToXMLStreamWriter {
 
     private static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
-    private static final QName QNAME_SCHEMA = new QName(NS_XSD, "schema");
     private static final QName SCHEMA_INCLUDE_QNAME = new QName(NS_XSD, "include");
     private static final QName SCHEMA_IMPORT_QNAME = new QName(NS_XSD, "import");
-    private static final QName ATTR_NAME_QNAME = new QName("", "name");
-    private static final QName ATTR_TARGETNS_QNAME =
-            new QName("", "targetNamespace");
-    private static final QName WSDL_LOCATION_QNAME = new QName("", "location");
-    private static final QName SCHEMA_LOCATION_QNAME =
-            new QName("", "schemaLocation");
 
-    private static final XMLEventFactory eventFactory =
-            XMLEventFactory.newInstance();
-    private static final XMLOutputFactory outputFactory =
-            XMLOutputFactory.newInstance();
-    private static final XMLInputFactory inputFactory =
-            XMLInputFactory.newInstance();
-
-    private static final Logger logger =
-        Logger.getLogger(
+    private static final Logger logger = Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".wsdl.patcher");
 
-    private DocInfo docInfo;
-    private String baseAddress;
-    private RuntimeEndpointInfo targetEndpoint;
-    private List<RuntimeEndpointInfo> endpoints;
-
-    /*
-     * inPath - /WEB-INF/wsdl/xxx.wsdl
-     * baseAddress - http://host:port/context/
+    /**
+     * {@link WSEndpoint} that owns the WSDL we are patching right now.
      */
-    public WSDLPatcher(DocInfo docInfo, String baseAddress,
-            RuntimeEndpointInfo targetEndpoint,
-            List<RuntimeEndpointInfo> endpoints) {
-        this.docInfo = docInfo;
-        this.baseAddress = baseAddress;
-        this.targetEndpoint = targetEndpoint;
-        this.endpoints = endpoints;
+    private final WSEndpointImpl<?> endpoint;
+
+    /**
+     * Document that is being patched.
+     */
+    private final SDDocumentImpl current;
+
+    private final DocumentAddressResolver resolver;
+    private final PortAddressResolver portAddressResolver;
+
+
+    //
+    // fields accumulated as we parse through documents
+    //
+    private String targetNamespace;
+    private QName serviceName;
+    private QName portName;
+
+    private enum EPR_ADDRESS_STATE {IN, OUT, DONE}
+    private EPR_ADDRESS_STATE eprAddressState = EPR_ADDRESS_STATE.OUT;
+
+    /**
+     * Creates a {@link WSDLPatcher} for patching WSDL.
+     *
+     * @param endpoint
+     *      The endpoint that we are patchinig WSDL for. This object is consulted
+     *      to check other {@link SDDocument}s. Must not be null.
+     * @param current
+     *      The document that we are patching. Must not be null.
+     * @param portAddressResolver
+     *      address of the endpoint is resolved using this resolver.
+     * @param resolver
+     *      Consulted to generate references among  {@link SDDocument}s.
+     *      Must not be null.
+     */
+    public WSDLPatcher(WSEndpointImpl<?> endpoint, SDDocumentImpl current,
+            PortAddressResolver portAddressResolver, DocumentAddressResolver resolver) {
+        this.endpoint = endpoint;
+        this.current = current;
+        this.portAddressResolver = portAddressResolver;
+        this.resolver = resolver;
     }
 
-    /*
-     * import, include, soap:address locations are patched
-     * caller needs to take care of closing of the streams
-     */
-    public void patchDoc(InputStream in, OutputStream out) {
-        XMLEventReader reader = null;
-        XMLEventWriter writer = null;
-        try {
-            reader = inputFactory.createXMLEventReader(in);
-            StartElement start = null;
-            QName serviceName = null;
-            QName portName = null;
-            String targetNamespace = null;
-            while(reader.hasNext()) {
-                XMLEvent event = reader.nextEvent();
-                if (event.isStartDocument()) {
-                    StartDocument sd = (StartDocument)event;
-                    String encoding = sd.encodingSet()
-                        ? sd.getCharacterEncodingScheme()
-                        : null;
-                    writer = (encoding != null)
-                        ? outputFactory.createXMLEventWriter(out, encoding)
-                        : outputFactory.createXMLEventWriter(out);
-               } else if (event.isStartElement()) {
-                    start = event.asStartElement();
-                    QName name = start.getName();
-                    if (name.equals(SCHEMA_INCLUDE_QNAME)) {
-                        event = handleSchemaInclude(start);
-                    } else if (name.equals(SCHEMA_IMPORT_QNAME)) {
-                        event = handleSchemaImport(start);
-                    } else if (name.equals(WSDLConstants.QNAME_IMPORT)) {
-                        event = handleWSDLImport(start);
-                    } else if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
-                            name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {
-                        event = handleSoapAddress(serviceName, portName, start);
-                    } else if (name.equals(WSDLConstants.QNAME_DEFINITIONS)) {
-                        Attribute attr = start.getAttributeByName(ATTR_TARGETNS_QNAME);
-                        if (attr != null) {
-                            targetNamespace = attr.getValue();
-                        }
-                    } else if (name.equals(WSDLConstants.QNAME_SERVICE)) {
-                        Attribute attr = start.getAttributeByName(ATTR_NAME_QNAME);
-                        if (attr != null) {
-                            serviceName = new QName(targetNamespace, attr.getValue());
-                        }
-                    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
-                        Attribute attr = start.getAttributeByName(ATTR_NAME_QNAME);
-                        if (attr != null) {
-                            portName = new QName(targetNamespace, attr.getValue());
-                        }
-                    }
-                } else if (event.isEndElement()) {
-                    start = null;
-                }
-                writer.add(event);
+    @Override
+    protected void handleAttribute(int i) throws XMLStreamException {
+        QName name = in.getName();
+        String attLocalName = in.getAttributeLocalName(i);
+
+        if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
+        || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
+        || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
+            // patch this attribute value.
+
+            String relPath = in.getAttributeValue(i);
+            String actualPath = getPatchedImportLocation(relPath);
+            if (actualPath == null) {
+                return; // skip this attribute to leave it up to "implicit reference".
             }
-        } catch (XMLStreamException e) {
-            throw new ServerRtException("runtime.wsdl.patcher",e);
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch(XMLStreamException e) {
-                    e.printStackTrace();
-                }
-            }
-            if (writer != null) {
-                try {
-                    writer.close();
-                } catch(XMLStreamException e) {
-                    e.printStackTrace();
+
+            logger.fine("Fixing the relative location:"+relPath
+                    +" with absolute location:"+actualPath);
+            writeAttribute(i, actualPath);
+            return;
+        }
+
+        if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
+            name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {
+
+            if(attLocalName.equals("location")) {
+                String value = getAddressLocation();
+                if (value != null) {
+                    logger.fine("Fixing service:"+serviceName+ " port:"+portName
+                            + " address with "+value);
+                    writeAttribute(i, value);
+                    return;
                 }
             }
         }
+
+        super.handleAttribute(i);
     }
 
-    /*
-     * return patchedlocation  null if we don't how to patch this location
+    /**
+     * Writes out an {@code i}-th attribute but with a different value.
+     * @param i attribute index
+     * @param value attribute value
+     * @throws XMLStreamException when an error encountered while writing attribute
      */
-    private String getPatchedImportLocation(String relPath) {
-        try {
-            URL relUrl = new URL(docInfo.getUrl(), relPath);
-            String query = targetEndpoint.getQueryString(relUrl);
-            if (query == null) {
-                return null;
+    private void writeAttribute(int i, String value) throws XMLStreamException {
+        String nsUri = in.getAttributeNamespace(i);
+        if(nsUri!=null)
+            out.writeAttribute( in.getAttributePrefix(i), nsUri, in.getAttributeLocalName(i), value );
+        else
+            out.writeAttribute( in.getAttributeLocalName(i), value );
+    }
+
+    @Override
+    protected void handleStartElement() throws XMLStreamException {
+        QName name = in.getName();
+
+        if (name.equals(WSDLConstants.QNAME_DEFINITIONS)) {
+            //String value = in.getAttributeValue("","targetNamespace");
+            String value = in.getAttributeValue(null,"targetNamespace");
+            if (value != null) {
+                targetNamespace = value;
             }
-            String abs = baseAddress+targetEndpoint.getUrlPatternWithoutStar()+"?"+query;
-            return abs;
+        } else if (name.equals(WSDLConstants.QNAME_SERVICE)) {
+            //String value = in.getAttributeValue("","name");
+            String value = in.getAttributeValue(null,"name");
+            if (value != null) {
+                serviceName = new QName(targetNamespace, value);
+            }
+        } else if (name.equals(WSDLConstants.QNAME_PORT)) {
+            //String value = in.getAttributeValue("","name");
+            String value = in.getAttributeValue(null,"name");
+            if (value != null) {
+                portName = new QName(targetNamespace,value);
+            }
+        } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)) {
+            eprAddressState = EPR_ADDRESS_STATE.IN;
+        }
+        super.handleStartElement();
+    }
+
+    @Override
+    protected void handleEndElement() throws XMLStreamException {
+        QName name = in.getName();
+        if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)) {
+            eprAddressState = EPR_ADDRESS_STATE.OUT;
+        }
+        super.handleEndElement();
+    }
+
+    @Override
+    protected void handleCharacters() throws XMLStreamException {
+        // handleCharacters() may be called multiple times. To take care of this,
+        // EPR_ADDRESS_STATE is used.
+        if (eprAddressState == EPR_ADDRESS_STATE.IN) {
+            String value = getAddressLocation();
+            if (value != null) {
+                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
+                            + " address with "+value);
+                out.writeCharacters(value);
+                eprAddressState = EPR_ADDRESS_STATE.DONE;
+            }
+        }
+        if (eprAddressState != EPR_ADDRESS_STATE.DONE) {
+            super.handleCharacters();
+        }
+    }
+
+    /**
+     * Returns the location to be placed into the generated document.
+     *
+     * @param relPath relative URI to be resolved
+     * @return
+     *      null to leave it to the "implicit reference".
+     */
+    private @Nullable String getPatchedImportLocation(String relPath) {
+        try {
+            ServiceDefinitionImpl def = endpoint.getServiceDefinition();
+            assert def !=null; // this code is only used by ServieDefinitionImpl, so this must not be null.
+
+            URL ref = new URL(current.getURL(), relPath);
+            SDDocument refDoc = def.getBySystemId(ref);
+            if(refDoc==null)
+                return relPath;  // not something we know. just leave it as is.
+
+            return resolver.getRelativeAddressFor(current,refDoc);
         } catch(MalformedURLException mue) {
             return null;
         }
     }
 
-    private XMLEvent patchImport(StartElement startElement, QName location)
-    throws XMLStreamException {
-        Attribute locationAttr = startElement.getAttributeByName(location);
-        if (locationAttr == null) {
-            return startElement;
-        }
-
-        List<Attribute> newAttrs = new ArrayList<Attribute>();
-        Iterator i = startElement.getAttributes();
-        while(i.hasNext()) {
-            Attribute attr = (Attribute)i.next();
-            String file = attr.getValue();
-            if (attr.getName().equals(location)) {
-                String relPath = attr.getValue();
-                //if (isPatchable(relPath)) {
-                    String absPath = getPatchedImportLocation(relPath);
-                    if (absPath == null) {
-                        //logger.warning("Couldn't fix the relative location:"+relPath);
-                        return startElement;        // Not patching
-                    }
-                    logger.fine("Fixing the relative location:"+relPath
-                            +" with absolute location:"+absPath);
-                    Attribute newAttr = eventFactory.createAttribute(
-                        location, absPath);
-                    newAttrs.add(newAttr);
-                    continue;
-                //}
-            }
-            newAttrs.add(attr);
-        }
-        XMLEvent event = eventFactory.createStartElement(
-                startElement.getName().getPrefix(),
-                startElement.getName().getNamespaceURI(),
-                startElement.getName().getLocalPart(),
-                newAttrs.iterator(),
-                startElement.getNamespaces(),
-                startElement.getNamespaceContext());
-        return event;
-    }
-
-    /*
-     * <schema:import> element is patched with correct uri and
-     * returns a new element
-     */
-    private XMLEvent handleSchemaImport(StartElement startElement)
-    throws XMLStreamException {
-        return patchImport(startElement, SCHEMA_LOCATION_QNAME);
-    }
-
-    /*
-     * <schema:include> element is patched with correct uri and
-     * returns a new element
-     */
-    private XMLEvent handleSchemaInclude(StartElement startElement)
-    throws XMLStreamException {
-        return patchImport(startElement, SCHEMA_LOCATION_QNAME);
-    }
-
-    /*
-     * <wsdl:import> element is patched with correct uri and
-     * returns a new element
-     */
-    private XMLEvent handleWSDLImport(StartElement startElement)
-    throws XMLStreamException {
-        return patchImport(startElement, WSDL_LOCATION_QNAME);
-    }
-
-    /*
-     * <soap:address> element is patched with correct endpoint address and
-     * returns a new element
-     */
-    private XMLEvent handleSoapAddress(QName service, QName port,
-            StartElement startElement) throws XMLStreamException {
-
-        List<Attribute> newAttrs = new ArrayList<Attribute>();
-        Iterator i = startElement.getAttributes();
-        while(i.hasNext()) {
-            Attribute attr = (Attribute)i.next();
-            String file = attr.getValue();
-            if (attr.getName().equals(WSDL_LOCATION_QNAME)) {
-                String value = getAddressLocation(service, port);
-                if (value == null) {
-                    return startElement;        // Not patching
-                }
-                logger.fine("Fixing service:"+service+ " port:"+port
-                        + " address with "+value);
-                Attribute newAttr = eventFactory.createAttribute(
-                        WSDL_LOCATION_QNAME, value);
-                newAttrs.add(newAttr);
-                continue;
-            }
-            newAttrs.add(attr);
-        }
-        XMLEvent event = eventFactory.createStartElement(
-                startElement.getName().getPrefix(),
-                startElement.getName().getNamespaceURI(),
-                startElement.getName().getLocalPart(),
-                newAttrs.iterator(),
-                startElement.getNamespaces(),
-                startElement.getNamespaceContext());
-        return event;
-    }
-
-    /*
+    /**
      * For the given service, port names it matches the correct endpoint and
      * reutrns its endpoint address
+     *
+     * @return returns the resolved endpoint address
      */
-    private String getAddressLocation(QName docServiceName, QName docPortName) {
-        for(RuntimeEndpointInfo endpointInfo : endpoints) {
-            QName serviceName = endpointInfo.getServiceName();
-            QName portName = endpointInfo.getPortName();
-            if (serviceName != null && portName != null
-                    && docServiceName != null && docPortName != null
-                    && serviceName.equals(docServiceName)
-                    && docPortName.equals(portName)) {
-                return baseAddress+endpointInfo.getUrlPatternWithoutStar();
-            }
-        }
-        return null;
+    private String getAddressLocation() {
+        return (portAddressResolver == null || portName == null)
+                ? null : portAddressResolver.getAddressFor(serviceName, portName.getLocalPart());
     }
-
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java
new file mode 100644
index 0000000..7ec71db
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java
@@ -0,0 +1,308 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.Engine;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor;
+import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.TubelineAssembler;
+import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.server.EndpointAwareCodec;
+import com.sun.xml.internal.ws.api.server.TransportBackChannel;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.model.wsdl.WSDLProperties;
+import com.sun.xml.internal.ws.resources.HandlerMessages;
+import com.sun.xml.internal.ws.util.Pool;
+import com.sun.xml.internal.ws.util.Pool.TubePool;
+import org.w3c.dom.Element;
+
+import javax.annotation.PreDestroy;
+import javax.xml.namespace.QName;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.handler.Handler;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * {@link WSEndpoint} implementation.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public final class WSEndpointImpl<T> extends WSEndpoint<T> {
+    private final @NotNull QName serviceName;
+    private final @NotNull QName portName;
+    private final WSBinding binding;
+    private final SEIModel seiModel;
+    private final @NotNull Container container;
+    private final WSDLPort port;
+
+    private final Tube masterTubeline;
+    private final ServiceDefinitionImpl serviceDef;
+    private final SOAPVersion soapVersion;
+    private final Engine engine;
+    private final @NotNull Codec masterCodec;
+
+    private final Pool<Tube> tubePool;
+
+    /**
+     * Set to true once we start shutting down this endpoint.
+     * Used to avoid running the clean up processing twice.
+     *
+     * @see #dispose()
+     */
+    private boolean disposed;
+
+    private final Class<T> implementationClass;
+    private final @Nullable WSDLProperties wsdlProperties;
+
+    WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding,
+                   Container container, SEIModel seiModel, WSDLPort port,
+                   Class<T> implementationClass,
+                   @Nullable ServiceDefinitionImpl serviceDef,
+                   InvokerTube terminalTube, boolean isSynchronous) {
+        this.serviceName = serviceName;
+        this.portName = portName;
+        this.binding = binding;
+        this.soapVersion = binding.getSOAPVersion();
+        this.container = container;
+        this.port = port;
+        this.implementationClass = implementationClass;
+        this.serviceDef = serviceDef;
+        this.seiModel = seiModel;
+        if (serviceDef != null) {
+            serviceDef.setOwner(this);
+        }
+
+        TubelineAssembler assembler = TubelineAssemblerFactory.create(
+                Thread.currentThread().getContextClassLoader(), binding.getBindingId(), container);
+        assert assembler!=null;
+
+        ServerTubeAssemblerContext context = new ServerPipeAssemblerContext(seiModel, port, this, terminalTube, isSynchronous);
+        this.masterTubeline = assembler.createServer(context);
+
+        Codec c = context.getCodec();
+        if(c instanceof EndpointAwareCodec) {
+            // create a copy to avoid sharing the codec between multiple endpoints
+            c = c.copy();
+            ((EndpointAwareCodec)c).setEndpoint(this);
+        }
+        this.masterCodec = c;
+
+        tubePool = new TubePool(masterTubeline);
+        terminalTube.setEndpoint(this);
+        engine = new Engine(toString());
+        wsdlProperties = (port==null) ? null : new WSDLProperties(port);
+    }
+
+    public @NotNull Class<T> getImplementationClass() {
+        return implementationClass;
+    }
+
+    public @NotNull WSBinding getBinding() {
+        return binding;
+    }
+
+    public @NotNull Container getContainer() {
+        return container;
+    }
+
+    public WSDLPort getPort() {
+        return port;
+    }
+
+    /**
+     * Gets the {@link SEIModel} that represents the relationship
+     * between WSDL and Java SEI.
+     *
+     * <p>
+     * This method returns a non-null value if and only if this
+     * endpoint is ultimately serving an application through an SEI.
+     *
+     * @return
+     *      maybe null. See above for more discussion.
+     *      Always the same value.
+     */
+    public @Nullable SEIModel getSEIModel() {
+        return seiModel;
+    }
+
+    public void setExecutor(Executor exec) {
+        engine.setExecutor(exec);
+    }
+
+    public void schedule(final Packet request, final CompletionCallback callback, FiberContextSwitchInterceptor interceptor) {
+        request.endpoint = WSEndpointImpl.this;
+        if (wsdlProperties != null) {
+            request.addSatellite(wsdlProperties);
+        }
+        Fiber fiber = engine.createFiber();
+        if (interceptor != null) {
+            fiber.addInterceptor(interceptor);
+        }
+        final Tube tube = tubePool.take();
+        fiber.start(tube, request, new Fiber.CompletionCallback() {
+            public void onCompletion(@NotNull Packet response) {
+                tubePool.recycle(tube);
+                if (callback!=null) {
+                    callback.onCompletion(response);
+                }
+            }
+
+            public void onCompletion(@NotNull Throwable error) {
+                // let's not reuse tubes as they might be in a wrong state, so not
+                // calling tubePool.recycle()
+                error.printStackTrace();
+                // Convert all runtime exceptions to Packet so that transport doesn't
+                // have to worry about converting to wire message
+                // TODO XML/HTTP binding
+                Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
+                        soapVersion, null, error);
+                Packet response = request.createServerResponse(faultMsg, request.endpoint.getPort(), null,
+                        request.endpoint.getBinding());
+                if (callback!=null) {
+                    callback.onCompletion(response);
+                }
+            }
+        });
+    }
+
+    public @NotNull PipeHead createPipeHead() {
+        return new PipeHead() {
+            private final Tube tube = TubeCloner.clone(masterTubeline);
+
+            public @NotNull Packet process(Packet request, WebServiceContextDelegate wscd, TransportBackChannel tbc) {
+                request.webServiceContextDelegate = wscd;
+                request.transportBackChannel = tbc;
+                request.endpoint = WSEndpointImpl.this;
+                if (wsdlProperties != null) {
+                    request.addSatellite(wsdlProperties);
+                }
+                Fiber fiber = engine.createFiber();
+                Packet response;
+                try {
+                    response = fiber.runSync(tube,request);
+                } catch (RuntimeException re) {
+                    // Catch all runtime exceptions so that transport doesn't
+                    // have to worry about converting to wire message
+                    // TODO XML/HTTP binding
+                    re.printStackTrace();
+                    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
+                            soapVersion, null, re);
+                    response = request.createServerResponse(faultMsg, request.endpoint.getPort(), null, request.endpoint.getBinding());
+                }
+                return response;
+            }
+        };
+    }
+
+    public synchronized void dispose() {
+        if(disposed)
+            return;
+        disposed = true;
+
+        masterTubeline.preDestroy();
+
+        for (Handler handler : binding.getHandlerChain()) {
+            for (Method method : handler.getClass().getMethods()) {
+                if (method.getAnnotation(PreDestroy.class) == null) {
+                    continue;
+                }
+                try {
+                    method.invoke(handler);
+                } catch (Exception e) {
+                    logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e);
+                }
+                break;
+            }
+        }
+    }
+
+    public ServiceDefinitionImpl getServiceDefinition() {
+        return serviceDef;
+    }
+
+    private static final Logger logger = Logger.getLogger(
+        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint");
+
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, String address, String wsdlAddress, Element...referenceParameters) {
+        QName portType = null;
+        if(port != null) {
+            portType = port.getBinding().getPortTypeName();
+        }
+        List<Element> refParams = null;
+        if(referenceParameters != null) {
+            refParams = Arrays.asList(referenceParameters);
+        }
+        AddressingVersion av = AddressingVersion.fromSpecClass(clazz);
+        if (av == AddressingVersion.W3C) {
+            // Supress writing ServiceName and EndpointName in W3C EPR,
+            // Until the ns for those metadata elements is resolved.
+            return new WSEndpointReference(
+                    AddressingVersion.W3C,
+                    address,null /*serviceName*/,null /*portName*/, null /*portType*/, null, null /*wsdlAddress*/, refParams).toSpec(clazz);
+        } else {
+            return new WSEndpointReference(
+                    AddressingVersion.MEMBER,
+                    address, serviceName, portName, portType, null, wsdlAddress, refParams).toSpec(clazz);
+        }
+    }
+
+    public @NotNull QName getPortName() {
+        return portName;
+    }
+
+
+    public @NotNull Codec createCodec() {
+        return masterCodec.copy();
+    }
+
+    public @NotNull QName getServiceName() {
+        return serviceName;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/XMLEPTFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/XMLEPTFactoryImpl.java
deleted file mode 100644
index 38c4a5a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/XMLEPTFactoryImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server;
-
-import com.sun.xml.internal.ws.pept.encoding.Decoder;
-import com.sun.xml.internal.ws.pept.encoding.Encoder;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.TargetFinder;
-import com.sun.xml.internal.ws.pept.protocol.Interceptors;
-import com.sun.xml.internal.ws.pept.protocol.MessageDispatcher;
-import com.sun.xml.internal.ws.encoding.internal.InternalEncoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLDecoder;
-import com.sun.xml.internal.ws.encoding.xml.XMLEPTFactory;
-import com.sun.xml.internal.ws.encoding.xml.XMLEncoder;
-
-/**
- * @author WS Development Team
- */
-public class XMLEPTFactoryImpl implements XMLEPTFactory {
-    private Encoder encoder;
-    private Decoder decoder;
-    private XMLEncoder xmlEncoder;
-    private XMLDecoder xmlDecoder;
-    private InternalEncoder internalEncoder;
-    private TargetFinder targetFinder;
-    private MessageDispatcher messageDispatcher;
-
-    public XMLEPTFactoryImpl(Encoder encoder, Decoder decoder,
-            TargetFinder targetFinder, MessageDispatcher messageDispatcher) {
-        this.encoder = encoder;
-        this.decoder = decoder;
-        this.targetFinder = targetFinder;
-        this.messageDispatcher = messageDispatcher;
-    }
-
-    public XMLEPTFactoryImpl(XMLEncoder xmlEncoder, XMLDecoder xmlDecoder,
-                             InternalEncoder internalEncoder,
-                             TargetFinder targetFinder, MessageDispatcher messageDispatcher) {
-        this.xmlEncoder = xmlEncoder;
-        this.xmlDecoder = xmlDecoder;
-        this.encoder = null;
-        this.decoder = null;
-        this.internalEncoder = internalEncoder;
-        this.targetFinder = targetFinder;
-        this.messageDispatcher = messageDispatcher;
-    }
-
-    public Encoder getEncoder(MessageInfo messageInfo) {
-        messageInfo.setEncoder(encoder);
-        return messageInfo.getEncoder();
-    }
-
-    public Decoder getDecoder(MessageInfo messageInfo) {
-        messageInfo.setDecoder(decoder);
-        return messageInfo.getDecoder();
-    }
-
-    public TargetFinder getTargetFinder(MessageInfo messageInfo) {
-        return targetFinder;
-    }
-
-    public MessageDispatcher getMessageDispatcher(MessageInfo messageInfo) {
-        messageInfo.setMessageDispatcher(messageDispatcher);
-        return messageDispatcher;
-    }
-
-    /*
-     * @see com.sun.istack.internal.pept.ept.EPTFactory#getInterceptors(com.sun.istack.internal.pept.ept.MessageInfo)
-     */
-    public Interceptors getInterceptors(MessageInfo x) {
-        return null;
-    }
-
-    /*
-     * @see com.sun.xml.internal.ws.encoding.jaxb.LogicalEPTFactory#getSoapEncoder()
-     */
-    public XMLEncoder getXMLEncoder() {
-        return xmlEncoder;
-    }
-
-    /*
-     * @see com.sun.xml.internal.ws.encoding.jaxb.LogicalEPTFactory#getSoapDecoder()
-     */
-    public XMLDecoder getXMLDecoder() {
-        return xmlDecoder;
-    }
-
-    public InternalEncoder getInternalEncoder() {
-        return internalEncoder;
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/package-info.java
index 268ce3a..d832f64 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,112 +24,14 @@
  */
 
 /**
- * <h1>JAX-WS 2.0 Server Runtime</h1>
+ * <h1>JAX-WS 2.0.1 Server Runtime</h1>
  * <P>This document describes the architecture of server side
- * JAX-WS 2.0 runtime. </p>
+ * JAX-WS 2.0.1 runtime. </p>
  *
- * <h3>JAX-WS 2.0 Server Runtime Sequence Diagram</h3>
- * {@SequenceDiagram
-      pobject(U,"user");
-      object(A,"WSConnection");
-      object(B,"Tie");
-      object(E,"MessageDispatcher");
-      object(F,"EPTFactoryFactoryBase");
-      object(G,"Endpoint");
-      step();
+ * <h3>JAX-WS 2.0.1 Server Runtime Sequence Diagram</h3>
 
-      message(U,A,"invoke Web Service");
-      active(A);
-      message(A,A,"getRuntimeEndpointInfo");
-      active(A);
-      step();
-      inactive(A);
+  * <img src='../../../../../jaxws/basic-server.seq.png'>
 
-      message(A,B,"handle");
-      active(B);
-#      inactive(A);
-
-      message(B,B,"createMessageInfo");
-      active(B);
-      step();
-      inactive(B);
-
-      message(B,B,"createRuntimeContext");
-      active(B);
-      step();
-      inactive(B);
-
-      message(B,F,"getEPTFactory");
-      active(F);
-      step();
-      inactive(F);
-
-      message(B,B,"getMessageDispatcher");
-      active(B);
-      step();
-      inactive(B);
-
-      message(B,E,"receive");
-      active(E);
-      inactive(B);
-#      complete(B);
-
-      message(E,E,"mustUnderstand");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,E,"createSOAPMessage");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,E,"invokeHandlers");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,E,"createInternalMessage");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,G,"invoke endpoint");
-      active(G);
-#      step();
-      rmessage(G,E,"response");
-#      complete(G);
-      inactive(G);
-
-      message(E,E,"createInternalMessage");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,E,"createSOAPMessage");
-      active(E);
-      step();
-      inactive(E);
-
-      message(E,E,"invokeHandlers");
-      active(E);
-      step();
-      inactive(E);
-
-#      active(A);
-      rmessage(E,A,"response");
-#      complete(E);
-#inactive(E);
-
-      active(A);
-#      complete(E);
-inactive(E);
-#      rmessage(A,U,"response");
-#      complete(E);
-#      complete(A);
-      complete(A);
- * }
- *
  *
  *
  * <H3>Message Flow</H3>
@@ -137,18 +39,18 @@
  * {@link com.sun.xml.internal.ws.transport.http.servlet.WSServletDelegate WSServletDelegate}
  * or the {@link com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl ServerConnectionImpl}.
  * Both of these classes find the appropriate {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo RuntimeEndpointInfo}
- * and invokes the {@link com.sun.xml.internal.ws.server.Tie#handle(com.sun.xml.internal.ws.spi.runtime.WSConnection,
+ * and invokes the {@link com.sun.xml.internal.ws.server.Tie#handle(com.sun.xml.internal.ws.api.server.WSConnection,
  * com.sun.xml.internal.ws.spi.runtime.RuntimeEndpointInfo) Tie.handle}
  * method. This method first creates a {@link com.sun.pept.ept.MessageInfo MessageInfo}
  * used to gather inforrmation about the message to be received. A
  * {@link com.sun.xml.internal.ws.server.RuntimeContext RuntimeContext}
- * is then created with the MessageInfo and the {@link com.sun.xml.internal.ws.model.RuntimeModel RuntimeModel}
+ * is then created with the MessageInfo and the {@link com.sun.xml.internal.ws.api.model.SEIModel RuntimeModel}
  * retrieved from the RuntimeEndpointInfo. The RuntimeContext is then
  * stored in the MessageInfo. The {@link com.sun.pept.ept.EPTFactory EPTFactory}
  * is retrieved from the {@link com.sun.xml.internal.ws.server.EPTFactoryFactoryBase EPTFactoryFactoryBase}
  * and also placed in the MessagInfo. A {@link com.sun.pept.protocol.MessageDispatcher MessageDispatcher}
  * is then created and the receive method is invoked. There will be two
- * types of MessageDispatchers for JAX-WS 2.0 FCS, SOAPMessageDispatcher
+ * types of MessageDispatchers for JAX-WS 2.0.1, SOAPMessageDispatcher
  * (one for client and one for the server) and an XMLMessageDispatcher
  * (one for the client and one for the server).</P>
  * <P>The MessageDispatcher.receive method orchestrates the receiving of
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/AsyncProviderInvokerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/AsyncProviderInvokerTube.java
new file mode 100644
index 0000000..cecfa13
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/AsyncProviderInvokerTube.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Fiber;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.api.server.AsyncProviderCallback;
+import com.sun.xml.internal.ws.api.server.Invoker;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.server.AbstractWebServiceContext;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This {@link Tube} is used to invoke the {@link AsyncProvider} endpoints.
+ *
+ * @author Jitendra Kotamraju
+ */
+class AsyncProviderInvokerTube<T> extends ProviderInvokerTube<T> {
+
+    private static final Logger LOGGER = Logger.getLogger(
+        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.AsyncProviderInvokerTube");
+
+    public AsyncProviderInvokerTube(Invoker invoker, ProviderArgumentsBuilder<T> argsBuilder) {
+        super(invoker, argsBuilder);
+    }
+
+   /*
+    * This binds the parameter for Provider endpoints and invokes the
+    * invoke() method of {@linke Provider} endpoint. The return value from
+    * invoke() is used to create a new {@link Message} that traverses
+    * through the Pipeline to transport.
+    */
+    public @NotNull NextAction processRequest(@NotNull Packet request) {
+        T param = argsBuilder.getParameter(request);
+        AsyncProviderCallback callback = new AsyncProviderInvokerTube.AsyncProviderCallbackImpl(request);
+        AsyncWebServiceContext ctxt = new AsyncWebServiceContext(getEndpoint(),request);
+
+        AsyncProviderInvokerTube.LOGGER.fine("Invoking AsyncProvider Endpoint");
+        try {
+            getInvoker(request).invokeAsyncProvider(request, param, callback, ctxt);
+        } catch(Exception e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+            return doThrow(e);
+        }
+        // Suspend the Fiber. AsyncProviderCallback will resume the Fiber after
+        // it receives response.
+        return doSuspend();
+    }
+
+    private class AsyncProviderCallbackImpl implements AsyncProviderCallback<T> {
+        private final Packet request;
+        private final Fiber fiber;
+
+        public AsyncProviderCallbackImpl(Packet request) {
+            this.request = request;
+            this.fiber = Fiber.current();
+        }
+
+        public void send(@Nullable T param) {
+            if (param == null) {
+                if (request.transportBackChannel != null) {
+                    request.transportBackChannel.close();
+                }
+            }
+            Packet packet = argsBuilder.getResponse(request, param, getEndpoint().getPort(), getEndpoint().getBinding());
+            fiber.resume(packet);
+        }
+
+        public void sendError(@NotNull Throwable t) {
+            Exception e;
+            if (t instanceof RuntimeException) {
+                e = (RuntimeException)t;
+            } else {
+                e = new RuntimeException(t);
+            }
+            Packet packet = argsBuilder.getResponse(request, e, getEndpoint().getPort(), getEndpoint().getBinding());
+            fiber.resume(packet);
+        }
+    }
+
+    /**
+     * The single {@link javax.xml.ws.WebServiceContext} instance injected into application.
+     */
+    private static final class AsyncWebServiceContext extends AbstractWebServiceContext {
+        final Packet packet;
+
+        AsyncWebServiceContext(WSEndpoint endpoint, Packet packet) {
+            super(endpoint);
+            this.packet = packet;
+        }
+
+        public @NotNull Packet getRequestPacket() {
+            return packet;
+        }
+    }
+
+    public @NotNull NextAction processResponse(@NotNull Packet response) {
+        return doReturnWith(response);
+    }
+
+    public @NotNull NextAction processException(@NotNull Throwable t) {
+        throw new IllegalStateException("AsyncProviderInvokerTube's processException shouldn't be called.");
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/MessageProviderArgumentBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/MessageProviderArgumentBuilder.java
new file mode 100644
index 0000000..ee63206
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/MessageProviderArgumentBuilder.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+final class MessageProviderArgumentBuilder extends ProviderArgumentsBuilder<Message> {
+    private final SOAPVersion soapVersion;
+
+    public MessageProviderArgumentBuilder(SOAPVersion soapVersion) {
+        this.soapVersion = soapVersion;
+    }
+
+    @Override
+    protected Message getParameter(Packet packet) {
+        return packet.getMessage();
+    }
+
+    @Override
+    protected Message getResponseMessage(Message returnValue) {
+        return returnValue;
+    }
+
+    @Override
+    protected Message getResponseMessage(Exception e) {
+        return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java
new file mode 100644
index 0000000..fbcd783
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+
+import javax.xml.ws.soap.SOAPBinding;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+
+abstract class ProviderArgumentsBuilder<T> {
+
+    /**
+     * Creates a fault {@link Message} from method invocation's exception
+     */
+    protected abstract Message getResponseMessage(Exception e);
+
+    /**
+     * Creates {@link Message} from method invocation's return value
+     */
+    protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) {
+        Message message = getResponseMessage(e);
+        Packet response = request.createServerResponse(message,port,null,binding);
+        return response;
+    }
+
+    /**
+     * Binds {@link com.sun.xml.internal.ws.api.message.Message} to method invocation parameter
+     * @param packet
+     */
+    protected abstract T getParameter(Packet packet);
+
+    protected abstract Message getResponseMessage(T returnValue);
+
+    /**
+     * Creates {@link Packet} from method invocation's return value
+     */
+    protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) {
+        Message message = null;
+        if (returnValue != null) {
+            message = getResponseMessage(returnValue);
+        }
+        Packet response = request.createServerResponse(message,port,null,binding);
+        return response;
+    }
+
+    public static ProviderArgumentsBuilder<?> create(ProviderEndpointModel model, WSBinding binding) {
+        return (binding instanceof SOAPBinding) ? SOAPProviderArgumentBuilder.create(model, binding.getSOAPVersion())
+                : XMLProviderArgumentBuilder.create(model);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderEndpointModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderEndpointModel.java
new file mode 100644
index 0000000..347b208
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderEndpointModel.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.bind.api.JAXBRIContext;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+
+import javax.activation.DataSource;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPBinding;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+
+/**
+ * Keeps the runtime information like Service.Mode and erasure of Provider class
+ * about Provider endpoint. It proccess annotations to find about Service.Mode
+ * It also finds about parameterized type(e.g. Source, SOAPMessage, DataSource)
+ * of endpoint class.
+ *
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguchi
+ */
+final class ProviderEndpointModel<T> {
+    /**
+     * True if this is {@link AsyncProvider}.
+     */
+    final boolean isAsync;
+
+    /**
+     * In which mode does this provider operate?
+     */
+    @NotNull final Service.Mode mode;
+    /**
+     * T of {@link Provider}&lt;T>.
+     */
+    @NotNull final Class datatype;
+    /**
+     * User class that extends {@link Provider}.
+     */
+    @NotNull final Class implClass;
+
+    ProviderEndpointModel(Class<T> implementorClass, WSBinding binding) {
+        assert implementorClass != null;
+        assert binding != null;
+
+        implClass = implementorClass;
+        mode = getServiceMode(implementorClass);
+        Class otherClass = (binding instanceof SOAPBinding)
+            ? SOAPMessage.class : DataSource.class;
+        isAsync = AsyncProvider.class.isAssignableFrom(implementorClass);
+
+
+        Class<? extends Object> baseType = isAsync ? AsyncProvider.class : Provider.class;
+        Type baseParam = JAXBRIContext.getBaseType(implementorClass, baseType);
+        if (baseParam==null)
+            throw new WebServiceException(ServerMessages.NOT_IMPLEMENT_PROVIDER(implementorClass.getName()));
+        if (!(baseParam instanceof ParameterizedType))
+            throw new WebServiceException(ServerMessages.PROVIDER_NOT_PARAMETERIZED(implementorClass.getName()));
+
+        ParameterizedType pt = (ParameterizedType)baseParam;
+        Type[] types = pt.getActualTypeArguments();
+        if(!(types[0] instanceof Class))
+            throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(implementorClass.getName(),types[0]));
+        datatype = (Class)types[0];
+
+        if (mode == Service.Mode.PAYLOAD && datatype!=Source.class) {
+            // Illegal to have PAYLOAD && SOAPMessage
+            // Illegal to have PAYLOAD && DataSource
+            throw new IllegalArgumentException(
+                "Illeagal combination - Mode.PAYLOAD and Provider<"+otherClass.getName()+">");
+        }
+    }
+
+    /**
+     * Is it PAYLOAD or MESSAGE ??
+     *
+     * @param c endpoint class
+     * @return Service.Mode.PAYLOAD or Service.Mode.MESSAGE
+     */
+    private static Service.Mode getServiceMode(Class<?> c) {
+        ServiceMode mode = c.getAnnotation(ServiceMode.class);
+        return (mode == null) ? Service.Mode.PAYLOAD : mode.value();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderInvokerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderInvokerTube.java
new file mode 100644
index 0000000..fa02c7d
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderInvokerTube.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.api.server.Invoker;
+import com.sun.xml.internal.ws.server.InvokerTube;
+
+import javax.xml.ws.Provider;
+
+/**
+ * This {@link Tube} is used to invoke the {@link Provider} and {@link AsyncProvider} endpoints.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class ProviderInvokerTube<T> extends InvokerTube<Provider<T>> {
+
+    protected ProviderArgumentsBuilder<T> argsBuilder;
+
+    /*package*/ ProviderInvokerTube(Invoker invoker, ProviderArgumentsBuilder<T> argsBuilder) {
+        super(invoker);
+        this.argsBuilder = argsBuilder;
+    }
+
+    public static <T> ProviderInvokerTube<T>
+    create(Class<T> implType, WSBinding binding, Invoker invoker) {
+
+        ProviderEndpointModel<T> model = new ProviderEndpointModel<T>(implType, binding);
+        ProviderArgumentsBuilder<?> argsBuilder = ProviderArgumentsBuilder.create(model, binding);
+        return model.isAsync ? new AsyncProviderInvokerTube(invoker, argsBuilder)
+            : new SyncProviderInvokerTube(invoker, argsBuilder);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderModel.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderModel.java
deleted file mode 100644
index 2a22578..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderModel.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server.provider;
-
-import com.sun.xml.internal.bind.api.JAXBRIContext;
-import java.lang.reflect.ParameterizedType;
-import javax.activation.DataSource;
-import javax.xml.ws.Binding;
-import javax.xml.ws.Provider;
-import com.sun.xml.internal.ws.server.PeptTie;
-import java.lang.reflect.Type;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.soap.SOAPBinding;
-
-
-/**
- * Keeps the runtime information like Service.Mode and erasure of Provider class
- * about Provider endpoint. It proccess annotations to find about Service.Mode
- * It also finds about parameterized type(e.g. Source, SOAPMessage, DataSource)
- * of endpoint class.
- *
- */
-public class ProviderModel {
-
-    private final boolean isSource;
-    private final Service.Mode mode;
-
-    public ProviderModel(Class implementorClass, Binding binding) {
-        assert implementorClass != null;
-        assert binding != null;
-
-        mode = getServiceMode(implementorClass);
-        Class otherClass = (binding instanceof SOAPBinding)
-            ? SOAPMessage.class : DataSource.class;
-        isSource = isSource(implementorClass, otherClass);
-        if (mode == Service.Mode.PAYLOAD && !isSource) {
-            // Illegal to have PAYLOAD && SOAPMessage
-            // Illegal to have PAYLOAD && DataSource
-            throw new IllegalArgumentException(
-                "Illeagal combination - Mode.PAYLOAD and Provider<"+otherClass.getName()+">");
-        }
-    }
-
-    public boolean isSource() {
-        return isSource;
-    }
-
-    public Service.Mode getServiceMode() {
-        return mode;
-    }
-
-    /**
-     * Is it PAYLOAD or MESSAGE ??
-     */
-    private static Service.Mode getServiceMode(Class c) {
-        ServiceMode mode = (ServiceMode)c.getAnnotation(ServiceMode.class);
-        if (mode == null) {
-            return Service.Mode.PAYLOAD;
-        }
-        return mode.value();
-    }
-
-    /**
-     * Is it Provider<Source> ? Finds whether the parameterized type is
-     * Source.class or not.
-     *
-     * @param c provider endpoint class
-     * @param otherClass Typically SOAPMessage.class or DataSource.class
-     * @return true if c's parameterized type is Source
-     *         false otherwise
-     * @throws IllegalArgumentException if it is not
-     *         Provider<Source> or Provider<otherClass>
-     *
-     */
-    private static boolean isSource(Class c, Class otherClass) {
-        Type base = JAXBRIContext.getBaseType(c, Provider.class);
-        assert base != null;
-        if (base instanceof ParameterizedType) {
-            ParameterizedType pt = (ParameterizedType)base;
-            Type[] types = pt.getActualTypeArguments();
-            if (types[0] instanceof Class && Source.class.isAssignableFrom((Class)types[0])) {
-                return true;
-            }
-            if (types[0] instanceof Class && otherClass.isAssignableFrom((Class)types[0])) {
-                return false;
-            }
-        }
-        throw new IllegalArgumentException(
-            "Endpoint should implement Provider<"+Source.class.getName()+
-                "> or Provider<"+otherClass.getName()+">");
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderPeptTie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderPeptTie.java
deleted file mode 100644
index c5d5de4..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderPeptTie.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.server.provider;
-
-import java.lang.reflect.Method;
-import javax.xml.ws.Provider;
-import javax.xml.ws.WebServiceException;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import com.sun.xml.internal.ws.server.PeptTie;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.util.MessageInfoUtil;
-
-
-/**
- * Creates a Stateless Tie object so that it is created only once and reused.
- */
-public class ProviderPeptTie extends PeptTie {
-
-    private static final Logger logger = Logger.getLogger(
-        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.ProviderPeptTie");
-
-    public static final Method invoke_Method;
-    static {
-        try {
-            Class[] methodParams = { Object.class };
-            invoke_Method = (Provider.class).getMethod("invoke", methodParams);
-        } catch (NoSuchMethodException e) {
-            throw new WebServiceException(e.getMessage(), e);
-        }
-    };
-
-    /*
-     * @see Tie#_invoke(MessageInfo)
-     */
-    public void _invoke(MessageInfo messageInfo) {
-        Object[] oa = messageInfo.getData();
-        RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(messageInfo);
-        RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-        Provider servant = (Provider)endpointInfo.getImplementor();
-        try {
-            Object response = servant.invoke(oa[0]);
-            messageInfo.setResponse(response);
-            messageInfo.setResponseType(MessageStruct.NORMAL_RESPONSE);
-            if (response == null) {
-                messageInfo.setMEP(MessageStruct.ONE_WAY_MEP);
-            } else {
-                messageInfo.setMEP(MessageStruct.REQUEST_RESPONSE_MEP);
-            }
-        } catch (RuntimeException e) {
-            logger.log(Level.SEVERE, e.getMessage(), e);
-            messageInfo.setResponseType(MessageStruct.UNCHECKED_EXCEPTION_RESPONSE);
-            messageInfo.setResponse(e);
-        } catch (Exception e) {
-            messageInfo.setResponseType(MessageStruct.CHECKED_EXCEPTION_RESPONSE);
-            messageInfo.setResponse(e);
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SOAPProviderArgumentBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SOAPProviderArgumentBuilder.java
new file mode 100644
index 0000000..75258a4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SOAPProviderArgumentBuilder.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+abstract class SOAPProviderArgumentBuilder<T> extends ProviderArgumentsBuilder<T> {
+    protected final SOAPVersion soapVersion;
+
+    private SOAPProviderArgumentBuilder(SOAPVersion soapVersion) {
+        this.soapVersion = soapVersion;
+    }
+
+    static ProviderArgumentsBuilder create(ProviderEndpointModel model, SOAPVersion soapVersion) {
+        if (model.mode == Service.Mode.PAYLOAD) {
+            return new PayloadSource(soapVersion);
+        } else {
+            if(model.datatype==Source.class)
+                return new MessageSource(soapVersion);
+            if(model.datatype==SOAPMessage.class)
+                return new SOAPMessageParameter(soapVersion);
+            if(model.datatype==Message.class)
+                return new MessageProviderArgumentBuilder(soapVersion);
+            throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
+        }
+    }
+
+    private static final class PayloadSource extends SOAPProviderArgumentBuilder<Source> {
+        PayloadSource(SOAPVersion soapVersion) {
+            super(soapVersion);
+        }
+
+        protected Source getParameter(Packet packet) {
+            return packet.getMessage().readPayloadAsSource();
+        }
+
+        protected Message getResponseMessage(Source source) {
+            return Messages.createUsingPayload(source, soapVersion);
+        }
+
+        protected Message getResponseMessage(Exception e) {
+            return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
+        }
+
+    }
+
+    private static final class MessageSource extends SOAPProviderArgumentBuilder<Source> {
+        MessageSource(SOAPVersion soapVersion) {
+            super(soapVersion);
+        }
+
+        protected Source getParameter(Packet packet) {
+            return packet.getMessage().readEnvelopeAsSource();
+        }
+
+        protected Message getResponseMessage(Source source) {
+            return Messages.create(source, soapVersion);
+        }
+
+        protected Message getResponseMessage(Exception e) {
+            return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
+        }
+    }
+
+    private static final class SOAPMessageParameter extends SOAPProviderArgumentBuilder<SOAPMessage> {
+        SOAPMessageParameter(SOAPVersion soapVersion) {
+            super(soapVersion);
+        }
+
+        protected SOAPMessage getParameter(Packet packet) {
+            try {
+                return packet.getMessage().readAsSOAPMessage(packet, true);
+            } catch (SOAPException se) {
+                throw new WebServiceException(se);
+            }
+        }
+
+        protected Message getResponseMessage(SOAPMessage soapMsg) {
+            return Messages.create(soapMsg);
+        }
+
+        protected Message getResponseMessage(Exception e) {
+            return SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
+        }
+
+        @Override
+        protected Packet getResponse(Packet request, @Nullable SOAPMessage returnValue, WSDLPort port, WSBinding binding) {
+            Packet response = super.getResponse(request, returnValue, port, binding);
+            // Populate SOAPMessage's transport headers
+            if (returnValue != null && response.supports(Packet.OUTBOUND_TRANSPORT_HEADERS)) {
+                MimeHeaders hdrs = returnValue.getMimeHeaders();
+                Map<String, List<String>> headers = new HashMap<String, List<String>>();
+                Iterator i = hdrs.getAllHeaders();
+                while(i.hasNext()) {
+                    MimeHeader header = (MimeHeader)i.next();
+                    if(header.getName().equalsIgnoreCase("SOAPAction"))
+                        // SAAJ sets this header automatically, but it interferes with the correct operation of JAX-WS.
+                        // so ignore this header.
+                        continue;
+
+                    List<String> list = headers.get(header.getName());
+                    if (list == null) {
+                        list = new ArrayList<String>();
+                        headers.put(header.getName(), list);
+                    }
+                    list.add(header.getValue());
+                }
+                response.put(Packet.OUTBOUND_TRANSPORT_HEADERS, headers);
+            }
+            return response;
+        }
+
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SyncProviderInvokerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SyncProviderInvokerTube.java
new file mode 100644
index 0000000..4e64077
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/SyncProviderInvokerTube.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.server.Invoker;
+
+import javax.xml.ws.Provider;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This tube is used to invoke the {@link Provider} endpoints.
+ *
+ * @author Jitendra Kotamraju
+ */
+class SyncProviderInvokerTube<T> extends ProviderInvokerTube<T> {
+
+    private static final Logger LOGGER = Logger.getLogger(
+        com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.SyncProviderInvokerTube");
+
+    public SyncProviderInvokerTube(Invoker invoker, ProviderArgumentsBuilder<T> argsBuilder) {
+        super(invoker, argsBuilder);
+    }
+
+    /*
+    * This binds the parameter for Provider endpoints and invokes the
+    * invoke() method of {@linke Provider} endpoint. The return value from
+    * invoke() is used to create a new {@link Message} that traverses
+    * through the Pipeline to transport.
+    */
+    public NextAction processRequest(Packet request) {
+        WSDLPort port = getEndpoint().getPort();
+        WSBinding binding = getEndpoint().getBinding();
+        T param = argsBuilder.getParameter(request);
+
+        LOGGER.fine("Invoking Provider Endpoint");
+
+        T returnValue;
+        try {
+            returnValue = getInvoker(request).invokeProvider(request, param);
+        } catch(Exception e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+            Packet response = argsBuilder.getResponse(request,e,port,binding);
+            return doReturnWith(response);
+        }
+        if (returnValue == null) {
+            // Oneway. Send response code immediately for transports(like HTTP)
+            // Don't do this above, since close() may generate some exceptions
+            if (request.transportBackChannel != null) {
+                request.transportBackChannel.close();
+            }
+        }
+        Packet response = argsBuilder.getResponse(request,returnValue,port,binding);
+        return doReturnWith(response);
+    }
+
+    public NextAction processResponse(Packet response) {
+        throw new IllegalStateException("InovkerPipe's processResponse shouldn't be called.");
+    }
+
+    public NextAction processException(@NotNull Throwable t) {
+        throw new IllegalStateException("InovkerPipe's processException shouldn't be called.");
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java
new file mode 100644
index 0000000..21b0314
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.provider;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+
+import javax.activation.DataSource;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.http.HTTPException;
+
+/**
+ * @author Jitendra Kotamraju
+ */
+abstract class XMLProviderArgumentBuilder<T> extends ProviderArgumentsBuilder<T> {
+
+    @Override
+    protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) {
+        Packet response = super.getResponse(request, e, port, binding);
+        if (e instanceof HTTPException) {
+            if (response.supports(MessageContext.HTTP_RESPONSE_CODE)) {
+                response.put(MessageContext.HTTP_RESPONSE_CODE, ((HTTPException)e).getStatusCode());
+            }
+        }
+        return response;
+    }
+
+    static XMLProviderArgumentBuilder create(ProviderEndpointModel model) {
+        if (model.mode == Service.Mode.PAYLOAD) {
+            return new PayloadSource();
+        } else {
+            if(model.datatype==Source.class)
+                return new PayloadSource();
+            if(model.datatype== DataSource.class)
+                return new DataSourceParameter();
+            throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
+        }
+    }
+
+    private static final class PayloadSource extends XMLProviderArgumentBuilder<Source> {
+        public Source getParameter(Packet packet) {
+            return packet.getMessage().readPayloadAsSource();
+        }
+
+        public Message getResponseMessage(Source source) {
+            return Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
+        }
+
+        protected Message getResponseMessage(Exception e) {
+            return XMLMessage.create(e);
+        }
+    }
+
+    private static final class DataSourceParameter extends XMLProviderArgumentBuilder<DataSource> {
+        public DataSource getParameter(Packet packet) {
+            Message msg = packet.getMessage();
+            return (msg instanceof XMLMessage.MessageDataSource)
+                    ? ((XMLMessage.MessageDataSource) msg).getDataSource()
+                    : XMLMessage.getDataSource(msg);
+        }
+
+        public Message getResponseMessage(DataSource ds) {
+            return XMLMessage.create(ds);
+        }
+
+        protected Message getResponseMessage(Exception e) {
+            return XMLMessage.create(e);
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ActionBasedDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ActionBasedDispatcher.java
new file mode 100644
index 0000000..b6aa3b6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ActionBasedDispatcher.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.message.HeaderList;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * An {@link EndpointMethodDispatcher} that uses
+ * WS-Addressing Action Message Addressing Property, <code>wsa:Action</code>,
+ * as the key for dispatching.
+ * <p/>
+ * A map of all wsa:Actions on the port and the corresponding {@link EndpointMethodHandler}
+ * is initialized in the constructor. The wsa:Action value is extracted from
+ * the request {@link Packet} and used as the key to return the correct
+ * handler.
+ *
+ * @author Arun Gupta
+ */
+final class ActionBasedDispatcher implements EndpointMethodDispatcher {
+    private final WSBinding binding;
+    private final Map<String, EndpointMethodHandler> actionMethodHandlers;
+    private final @NotNull AddressingVersion av;
+
+    public ActionBasedDispatcher(AbstractSEIModelImpl model, WSBinding binding, SEIInvokerTube invokerTube) {
+        this.binding = binding;
+        assert binding.getAddressingVersion()!=null;    // this dispatcher can be only used when addressing is on.
+        av = binding.getAddressingVersion();
+        actionMethodHandlers = new HashMap<String, EndpointMethodHandler>();
+
+        for( JavaMethodImpl m : model.getJavaMethods() ) {
+            EndpointMethodHandler handler = new EndpointMethodHandler(invokerTube,m,binding);
+            String action = m.getInputAction();
+            //first look at annotations and then in wsdlmodel
+            if(action != null && !action.equals("")) {
+                actionMethodHandlers.put(action, handler);
+            } else {
+                action = m.getOperation().getOperation().getInput().getAction();
+                if (action != null)
+                    actionMethodHandlers.put(action, handler);
+            }
+        }
+    }
+
+    public EndpointMethodHandler getEndpointMethodHandler(Packet request) throws DispatchException {
+
+        HeaderList hl = request.getMessage().getHeaders();
+
+        String action = hl.getAction(av, binding.getSOAPVersion());
+
+        if (action == null)
+            // this message doesn't contain addressing headers, which is legal.
+            // this happens when the server is capable of processing addressing but the client didn't send them
+            return null;
+
+        EndpointMethodHandler h = actionMethodHandlers.get(action);
+        if (h != null)
+            return h;
+
+        // invalid action header
+        Message result = Messages.create(action, av, binding.getSOAPVersion());
+
+        throw new DispatchException(result);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/DispatchException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/DispatchException.java
new file mode 100644
index 0000000..af3b9b6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/DispatchException.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.api.message.Message;
+
+/**
+ * {@link Exception} that demands a specific fault message to be sent back.
+ *
+ * TODO: think about a way to generalize it, as it seems to be useful
+ * in other places.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class DispatchException extends Exception {
+    final Message fault;
+
+    public DispatchException(Message fault) {
+        this.fault = fault;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java
new file mode 100644
index 0000000..aeb4ea5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java
@@ -0,0 +1,628 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.RawAccessor;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Attachment;
+import com.sun.xml.internal.ws.api.message.AttachmentSet;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+
+import javax.activation.DataHandler;
+import javax.imageio.ImageIO;
+import javax.jws.WebParam.Mode;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.awt.Image;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Reads a request {@link Message}, disassembles it, and moves obtained Java values
+ * to the expected places.
+ *
+ * @author Jitendra Kotamraju
+ */
+abstract class EndpointArgumentsBuilder {
+    /**
+     * Reads a request {@link Message}, disassembles it, and moves obtained
+     * Java values to the expected places.
+     *
+     * @param request
+     *      The request {@link Message} to be de-composed.
+     * @param args
+     *      The Java arguments given to the SEI method invocation.
+     *      Some parts of the reply message may be set to {@link Holder}s in the arguments.
+     * @throws JAXBException
+     *      if there's an error during unmarshalling the request message.
+     * @throws XMLStreamException
+     *      if there's an error during unmarshalling the request message.
+     */
+    abstract void readRequest(Message request, Object[] args)
+        throws JAXBException, XMLStreamException;
+
+    static final class None extends EndpointArgumentsBuilder {
+        private None(){
+        }
+        public void readRequest(Message msg, Object[] args) {
+            msg.consume();
+        }
+    }
+
+    /**
+     * The singleton instance that produces null return value.
+     * Used for operations that doesn't have any output.
+     */
+    public static EndpointArgumentsBuilder NONE = new None();
+
+    /**
+     * Returns the 'uninitialized' value for the given type.
+     *
+     * <p>
+     * For primitive types, it's '0', and for reference types, it's null.
+     */
+    public static Object getVMUninitializedValue(Type type) {
+        // if this map returns null, that means the 'type' is a reference type,
+        // in which case 'null' is the correct null value, so this code is correct.
+        return primitiveUninitializedValues.get(type);
+    }
+
+    private static final Map<Class,Object> primitiveUninitializedValues = new HashMap<Class, Object>();
+
+    static {
+        Map<Class, Object> m = primitiveUninitializedValues;
+        m.put(int.class,(int)0);
+        m.put(char.class,(char)0);
+        m.put(byte.class,(byte)0);
+        m.put(short.class,(short)0);
+        m.put(long.class,(long)0);
+        m.put(float.class,(float)0);
+        m.put(double.class,(double)0);
+    }
+
+    /**
+     * {@link EndpointArgumentsBuilder} that sets the VM uninitialized value to the type.
+     */
+    static final class NullSetter extends EndpointArgumentsBuilder {
+        private final EndpointValueSetter setter;
+        private final Object nullValue;
+
+        public NullSetter(EndpointValueSetter setter, Object nullValue){
+            assert setter!=null;
+            this.nullValue = nullValue;
+            this.setter = setter;
+        }
+        public void readRequest(Message msg, Object[] args) {
+            setter.put(nullValue, args);
+        }
+    }
+
+    /**
+     * {@link EndpointArgumentsBuilder} that is a composition of multiple
+     * {@link EndpointArgumentsBuilder}s.
+     *
+     * <p>
+     * Sometimes we need to look at multiple parts of the reply message
+     * (say, two header params, one body param, and three attachments, etc.)
+     * and that's when this object is used to combine multiple {@link EndpointArgumentsBuilder}s
+     * (that each responsible for handling one part).
+     *
+     * <p>
+     * The model guarantees that only at most one {@link EndpointArgumentsBuilder} will
+     * return a value as a return value (and everything else has to go to
+     * {@link Holder}s.)
+     */
+    static final class Composite extends EndpointArgumentsBuilder {
+        private final EndpointArgumentsBuilder[] builders;
+
+        public Composite(EndpointArgumentsBuilder... builders) {
+            this.builders = builders;
+        }
+
+        public Composite(Collection<? extends EndpointArgumentsBuilder> builders) {
+            this(builders.toArray(new EndpointArgumentsBuilder[builders.size()]));
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            for (EndpointArgumentsBuilder builder : builders) {
+                builder.readRequest(msg,args);
+            }
+        }
+    }
+
+
+    /**
+     * Reads an Attachment into a Java parameter.
+     */
+    static abstract class AttachmentBuilder extends EndpointArgumentsBuilder {
+        protected final EndpointValueSetter setter;
+        protected final ParameterImpl param;
+        protected final String pname;
+        protected final String pname1;
+
+        AttachmentBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            this.setter = setter;
+            this.param = param;
+            this.pname = param.getPartName();
+            this.pname1 = "<"+pname;
+        }
+
+        /**
+         * Creates an AttachmentBuilder based on the parameter type
+         *
+         * @param param
+         *      runtime Parameter that abstracts the annotated java parameter
+         * @param setter
+         *      specifies how the obtained value is set into the argument. Takes
+         *      care of Holder arguments.
+         */
+        public static EndpointArgumentsBuilder createAttachmentBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            Class type = (Class)param.getTypeReference().type;
+            if (DataHandler.class.isAssignableFrom(type)) {
+                return new DataHandlerBuilder(param, setter);
+            } else if (byte[].class==type) {
+                return new ByteArrayBuilder(param, setter);
+            } else if(Source.class.isAssignableFrom(type)) {
+                return new SourceBuilder(param, setter);
+            } else if(Image.class.isAssignableFrom(type)) {
+                return new ImageBuilder(param, setter);
+            } else if(InputStream.class==type) {
+                return new InputStreamBuilder(param, setter);
+            } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                return new JAXBBuilder(param, setter);
+            } else {
+                throw new UnsupportedOperationException("Attachment is not mapped");
+            }
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            // TODO not to loop
+            for (Attachment att : msg.getAttachments()) {
+                String part = getWSDLPartName(att);
+                if (part == null) {
+                    continue;
+                }
+                if(part.equals(pname) || part.equals(pname1)){
+                    mapAttachment(att, args);
+                    break;
+                }
+            }
+        }
+
+        abstract void mapAttachment(Attachment att, Object[] args) throws JAXBException;
+    }
+
+    private static final class DataHandlerBuilder extends AttachmentBuilder {
+        DataHandlerBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) {
+            setter.put(att.asDataHandler(), args);
+        }
+    }
+
+    private static final class ByteArrayBuilder extends AttachmentBuilder {
+        ByteArrayBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) {
+            setter.put(att.asByteArray(), args);
+        }
+    }
+
+    private static final class SourceBuilder extends AttachmentBuilder {
+        SourceBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) {
+            setter.put(att.asSource(), args);
+        }
+    }
+
+    private static final class ImageBuilder extends AttachmentBuilder {
+        ImageBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) {
+            Image image;
+            try {
+                image = ImageIO.read(att.asInputStream());
+            } catch(IOException ioe) {
+                throw new WebServiceException(ioe);
+            }
+            setter.put(image, args);
+        }
+    }
+
+    private static final class InputStreamBuilder extends AttachmentBuilder {
+        InputStreamBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) {
+            setter.put(att.asInputStream(), args);
+        }
+    }
+
+    private static final class JAXBBuilder extends AttachmentBuilder {
+        JAXBBuilder(ParameterImpl param, EndpointValueSetter setter) {
+            super(param, setter);
+        }
+
+        void mapAttachment(Attachment att, Object[] args) throws JAXBException {
+            Object obj = param.getBridge().unmarshal(att.asInputStream());
+            setter.put(obj, args);
+        }
+    }
+
+
+    /**
+     * Gets the WSDL part name of this attachment.
+     *
+     * <p>
+     * According to WSI AP 1.0
+     * <PRE>
+     * 3.8 Value-space of Content-Id Header
+     *   Definition: content-id part encoding
+     *   The "content-id part encoding" consists of the concatenation of:
+     * The value of the name attribute of the wsdl:part element referenced by the mime:content, in which characters disallowed in content-id headers (non-ASCII characters as represented by code points above 0x7F) are escaped as follows:
+     *     o Each disallowed character is converted to UTF-8 as one or more bytes.
+     *     o Any bytes corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
+     *     o The original character is replaced by the resulting character sequence.
+     * The character '=' (0x3D).
+     * A globally unique value such as a UUID.
+     * The character '@' (0x40).
+     * A valid domain name under the authority of the entity constructing the message.
+     * </PRE>
+     *
+     * So a wsdl:part fooPart will be encoded as:
+     *      <fooPart=somereallybignumberlikeauuid@example.com>
+     *
+     * @return null
+     *      if the parsing fails.
+     */
+    public static final String getWSDLPartName(com.sun.xml.internal.ws.api.message.Attachment att){
+        String cId = att.getContentId();
+
+        int index = cId.lastIndexOf('@', cId.length());
+        if(index == -1){
+            return null;
+        }
+        String localPart = cId.substring(0, index);
+        index = localPart.lastIndexOf('=', localPart.length());
+        if(index == -1){
+            return null;
+        }
+        try {
+            return java.net.URLDecoder.decode(localPart.substring(0, index), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+
+
+
+    /**
+     * Reads a header into a JAXB object.
+     */
+    static final class Header extends EndpointArgumentsBuilder {
+        private final Bridge<?> bridge;
+        private final EndpointValueSetter setter;
+        private final QName headerName;
+        private final SOAPVersion soapVersion;
+
+        /**
+         * @param name
+         *      The name of the header element.
+         * @param bridge
+         *      specifies how to unmarshal a header into a JAXB object.
+         * @param setter
+         *      specifies how the obtained value is returned to the client.
+         */
+        public Header(SOAPVersion soapVersion, QName name, Bridge<?> bridge, EndpointValueSetter setter) {
+            this.soapVersion = soapVersion;
+            this.headerName = name;
+            this.bridge = bridge;
+            this.setter = setter;
+        }
+
+        public Header(SOAPVersion soapVersion, ParameterImpl param, EndpointValueSetter setter) {
+            this(
+                soapVersion,
+                param.getTypeReference().tagName,
+                param.getBridge(),
+                setter);
+            assert param.getOutBinding()== ParameterBinding.HEADER;
+        }
+
+        private SOAPFaultException createDuplicateHeaderException() {
+            try {
+                SOAPFault fault = soapVersion.saajSoapFactory.createFault(
+                        ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName), soapVersion.faultCodeClient);
+                return new SOAPFaultException(fault);
+            } catch(SOAPException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException {
+            com.sun.xml.internal.ws.api.message.Header header = null;
+            Iterator<com.sun.xml.internal.ws.api.message.Header> it =
+                msg.getHeaders().getHeaders(headerName,true);
+            if (it.hasNext()) {
+                header = it.next();
+                if (it.hasNext()) {
+                    throw createDuplicateHeaderException();
+                }
+            }
+
+            if(header!=null) {
+                setter.put( header.readAsJAXB(bridge), args );
+            } else {
+                // header not found.
+            }
+        }
+    }
+
+    /**
+     * Reads the whole payload into a single JAXB bean.
+     */
+    static final class Body extends EndpointArgumentsBuilder {
+        private final Bridge<?> bridge;
+        private final EndpointValueSetter setter;
+
+        /**
+         * @param bridge
+         *      specifies how to unmarshal the payload into a JAXB object.
+         * @param setter
+         *      specifies how the obtained value is returned to the client.
+         */
+        public Body(Bridge<?> bridge, EndpointValueSetter setter) {
+            this.bridge = bridge;
+            this.setter = setter;
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException {
+            setter.put( msg.readPayloadAsJAXB(bridge), args );
+        }
+    }
+
+    /**
+     * Treats a payload as multiple parts wrapped into one element,
+     * and processes all such wrapped parts.
+     */
+    static final class DocLit extends EndpointArgumentsBuilder {
+        /**
+         * {@link PartBuilder} keyed by the element name (inside the wrapper element.)
+         */
+        private final PartBuilder[] parts;
+
+        private final Bridge wrapper;
+
+        public DocLit(WrapperParameter wp, Mode skipMode) {
+            wrapper = wp.getBridge();
+            Class wrapperType = (Class) wrapper.getTypeReference().type;
+
+            List<PartBuilder> parts = new ArrayList<PartBuilder>();
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+            for (ParameterImpl p : children) {
+                if (p.getMode() == skipMode) {
+                    continue;
+                }
+                /*
+                if(p.isIN())
+                    continue;
+                 */
+                QName name = p.getName();
+                try {
+                    parts.add( new PartBuilder(
+                        wp.getOwner().getJAXBContext().getElementPropertyAccessor(
+                            wrapperType,
+                            name.getNamespaceURI(),
+                            p.getName().getLocalPart()),
+                        EndpointValueSetter.get(p)
+                    ));
+                    // wrapper parameter itself always bind to body, and
+                    // so do all its children
+                    assert p.getBinding()== ParameterBinding.BODY;
+                } catch (JAXBException e) {
+                    throw new WebServiceException(  // TODO: i18n
+                        wrapperType+" do not have a property of the name "+name,e);
+                }
+            }
+
+            this.parts = parts.toArray(new PartBuilder[parts.size()]);
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            Object retVal = null;
+
+            XMLStreamReader reader = msg.readPayload();
+            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
+                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);
+
+            try {
+                for (PartBuilder part : parts) {
+                    Object o = part.readResponse(args,wrapperBean);
+                    // there's only at most one EndpointArgumentsBuilder that returns a value.
+                    // TODO: reorder parts so that the return value comes at the end.
+                    if(o!=null) {
+                        assert retVal==null;
+                        retVal = o;
+                    }
+                }
+            } catch (AccessorException e) {
+                // this can happen when the set method throw a checked exception or something like that
+                throw new WebServiceException(e);    // TODO:i18n
+            }
+
+            // we are done with the body
+            reader.close();
+            XMLStreamReaderFactory.recycle(reader);
+        }
+
+        /**
+         * Unmarshals each wrapped part into a JAXB object and moves it
+         * to the expected place.
+         */
+        static final class PartBuilder {
+            private final RawAccessor accessor;
+            private final EndpointValueSetter setter;
+
+            /**
+             * @param accessor
+             *      specifies which portion of the wrapper bean to obtain the value from.
+             * @param setter
+             *      specifies how the obtained value is returned to the client.
+             */
+            public PartBuilder(RawAccessor accessor, EndpointValueSetter setter) {
+                this.accessor = accessor;
+                this.setter = setter;
+                assert accessor!=null && setter!=null;
+            }
+
+            final Object readResponse( Object[] args, Object wrapperBean ) throws AccessorException {
+                Object obj = accessor.get(wrapperBean);
+                setter.put(obj,args);
+                return null;
+            }
+
+
+        }
+    }
+
+    /**
+     * Treats a payload as multiple parts wrapped into one element,
+     * and processes all such wrapped parts.
+     */
+    static final class RpcLit extends EndpointArgumentsBuilder {
+        /**
+         * {@link PartBuilder} keyed by the element name (inside the wrapper element.)
+         */
+        private final Map<QName,PartBuilder> parts = new HashMap<QName,PartBuilder>();
+
+        private QName wrapperName;
+
+        public RpcLit(WrapperParameter wp) {
+            assert wp.getTypeReference().type== CompositeStructure.class;
+
+            wrapperName = wp.getName();
+            List<ParameterImpl> children = wp.getWrapperChildren();
+            for (ParameterImpl p : children) {
+                parts.put( p.getName(), new PartBuilder(
+                    p.getBridge(), EndpointValueSetter.get(p)
+                ));
+                // wrapper parameter itself always bind to body, and
+                // so do all its children
+                assert p.getBinding()== ParameterBinding.BODY;
+            }
+        }
+
+        public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+            XMLStreamReader reader = msg.readPayload();
+            if (!reader.getName().equals(wrapperName))
+                throw new WebServiceException( // TODO: i18n
+                    "Unexpected response element "+reader.getName()+" expected: "+wrapperName);
+            reader.nextTag();
+
+            while(reader.getEventType()==XMLStreamReader.START_ELEMENT) {
+                // TODO: QName has a performance issue
+                PartBuilder part = parts.get(reader.getName());
+                if(part==null) {
+                    // no corresponding part found. ignore
+                    XMLStreamReaderUtil.skipElement(reader);
+                    reader.nextTag();
+                } else {
+                    part.readRequest(args,reader, msg.getAttachments());
+                }
+            }
+
+            // we are done with the body
+            reader.close();
+            XMLStreamReaderFactory.recycle(reader);
+        }
+
+        /**
+         * Unmarshals each wrapped part into a JAXB object and moves it
+         * to the expected place.
+         */
+        static final class PartBuilder {
+            private final Bridge bridge;
+            private final EndpointValueSetter setter;
+
+            /**
+             * @param bridge
+             *      specifies how the part is unmarshalled.
+             * @param setter
+             *      specifies how the obtained value is returned to the endpoint.
+             */
+            public PartBuilder(Bridge bridge, EndpointValueSetter setter) {
+                this.bridge = bridge;
+                this.setter = setter;
+            }
+
+            final void readRequest( Object[] args, XMLStreamReader r, AttachmentSet att) throws JAXBException {
+                Object obj = bridge.unmarshal(r, (att != null)?new AttachmentUnmarshallerImpl(att):null);
+                setter.put(obj,args);
+            }
+        }
+    }
+
+    private static boolean isXMLMimeType(String mimeType){
+        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcher.java
new file mode 100644
index 0000000..da61e04
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcher.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: EndpointMethodDispatcher.java,v 1.1.2.5 2006/11/10 00:55:03 kohsuke Exp $
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+
+/**
+ * This interface needs to be implemented if a new dispatching
+ * mechanism needs to be plugged in. The dispatcher is plugged in the
+ * constructor of {@link EndpointMethodDispatcherGetter}.
+ *
+ * @author Arun Gupta
+ * @see EndpointMethodDispatcherGetter
+ */
+interface EndpointMethodDispatcher {
+    /**
+     * Returns the {@link EndpointMethodHandler} for the <code>request</code>
+     * {@link Packet}.
+     *
+     * @param request request packet
+     * @return
+     *      non-null {@link EndpointMethodHandler} that will route the request packet.
+     *      null to indicate that the request packet be processed by the next available
+     *      {@link EndpointMethodDispatcher}.
+     * @throws DispatchException
+     *      If the request is invalid, and processing shall be aborted with a specific fault.
+     */
+    EndpointMethodHandler getEndpointMethodHandler(Packet request) throws DispatchException;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcherGetter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcherGetter.java
new file mode 100644
index 0000000..2320f8f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcherGetter.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Gets the list of {@link EndpointMethodDispatcher}s for {@link SEIInvokerTube}.
+ * a request {@link Packet}. If WS-Addressing is enabled on the endpoint, then
+ * only {@link ActionBasedDispatcher} is added to the list. Otherwise,
+ * {@link PayloadQNameBasedDispatcher} is added to the list.
+ *
+ * <p>
+ * {@link Message} payload's QName to obtain the handler. If no handler is
+ * registered corresponding to that QName, then uses Action Message
+ * Addressing Property value to get the handler.
+ *
+ * @author Arun Gupta
+ */
+final class EndpointMethodDispatcherGetter {
+    private final List<EndpointMethodDispatcher> dispatcherList;
+
+    EndpointMethodDispatcherGetter(AbstractSEIModelImpl model, WSBinding binding, SEIInvokerTube invokerTube) {
+        dispatcherList = new ArrayList<EndpointMethodDispatcher>();
+
+        if (binding.getAddressingVersion() != null) {
+            dispatcherList.add(new ActionBasedDispatcher(model, binding, invokerTube));
+        }
+
+        // even when action based dispatching is in place,
+        // we still need this because clients are alowed not to use addressing headers
+        dispatcherList.add(new PayloadQNameBasedDispatcher(model, binding, invokerTube));
+    }
+
+    List<EndpointMethodDispatcher> getDispatcherList() {
+        return dispatcherList;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodHandler.java
new file mode 100644
index 0000000..715f6b6
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodHandler.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.encoding.soap.DeserializationException;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.bind.JAXBException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.Holder;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * <p>
+ * This class mainly performs the following two tasks:
+ * <ol>
+ *  <li>Takes a {@link Message] that represents a request,
+ *      and extracts the arguments (and updates {@link Holder}s.)
+ *  <li>Accepts return value and {@link Holder} arguments for a Java method,
+ *      and creates {@link JAXBMessage} that represents a response message.
+ * </ol>
+ *
+ * <h2>Creating {@link JAXBMessage}</h2>
+ * <p>
+ * At the construction time, we prepare {@link EndpointArgumentsBuilder} that knows how to create endpoint {@link Method}
+ * invocation arguments.
+ * we also prepare {@link EndpointResponseMessageBuilder} and {@link MessageFiller}s
+ * that know how to move arguments into a {@link Message}.
+ * Some arguments go to the payload, some go to headers, still others go to attachments.
+ *
+ * @author Jitendra Kotamraju
+ */
+final class EndpointMethodHandler {
+
+    private final SOAPVersion soapVersion;
+    private final Method method;
+    private final int noOfArgs;
+    private final JavaMethodImpl javaMethodModel;
+
+     private final Boolean isOneWay;
+
+    // Converts {@link Message} --> Object[]
+    private final EndpointArgumentsBuilder argumentsBuilder;
+
+    // these objects together create a response message from method parameters
+    private final EndpointResponseMessageBuilder bodyBuilder;
+    private final MessageFiller[] outFillers;
+
+    private final SEIInvokerTube owner;
+
+    public EndpointMethodHandler(SEIInvokerTube owner, JavaMethodImpl method, WSBinding binding) {
+        this.owner = owner;
+        this.soapVersion = binding.getSOAPVersion();
+        this.method = method.getMethod();
+        this.javaMethodModel = method;
+        argumentsBuilder = createArgumentsBuilder();
+        List<MessageFiller> fillers = new ArrayList<MessageFiller>();
+        bodyBuilder = createResponseMessageBuilder(fillers);
+        this.outFillers = fillers.toArray(new MessageFiller[fillers.size()]);
+        this.isOneWay = method.getMEP().isOneWay();
+        this.noOfArgs = this.method.getParameterTypes().length;
+    }
+
+    /**
+     * It builds EndpointArgumentsBuilder which converts request {@link Message} to endpoint method's invocation
+     * arguments Object[]
+     *
+     * @return EndpointArgumentsBuilder
+     */
+    private EndpointArgumentsBuilder createArgumentsBuilder() {
+        EndpointArgumentsBuilder argsBuilder;
+        List<ParameterImpl> rp = javaMethodModel.getRequestParameters();
+        List<EndpointArgumentsBuilder> builders = new ArrayList<EndpointArgumentsBuilder>();
+
+        for( ParameterImpl param : rp ) {
+            EndpointValueSetter setter = EndpointValueSetter.get(param);
+            switch(param.getInBinding().kind) {
+            case BODY:
+                if(param.isWrapperStyle()) {
+                    if(param.getParent().getBinding().isRpcLit())
+                        builders.add(new EndpointArgumentsBuilder.RpcLit((WrapperParameter)param));
+                    else
+                        builders.add(new EndpointArgumentsBuilder.DocLit((WrapperParameter)param, Mode.OUT));
+                } else {
+                    builders.add(new EndpointArgumentsBuilder.Body(param.getBridge(),setter));
+                }
+                break;
+            case HEADER:
+                builders.add(new EndpointArgumentsBuilder.Header(soapVersion, param, setter));
+                break;
+            case ATTACHMENT:
+                builders.add(EndpointArgumentsBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
+                break;
+            case UNBOUND:
+                builders.add(new EndpointArgumentsBuilder.NullSetter(setter,
+                    EndpointArgumentsBuilder.getVMUninitializedValue(param.getTypeReference().type)));
+                break;
+            default:
+                throw new AssertionError();
+            }
+        }
+
+        // creates {@link Holder} arguments for OUT parameters
+        List<ParameterImpl> resp = javaMethodModel.getResponseParameters();
+        for( ParameterImpl param : resp ) {
+            if (param.isWrapperStyle()) {
+                WrapperParameter wp = (WrapperParameter)param;
+                List<ParameterImpl> children = wp.getWrapperChildren();
+                for (ParameterImpl p : children) {
+                    if (p.isOUT() && p.getIndex() != -1) {
+                        EndpointValueSetter setter = EndpointValueSetter.get(p);
+                        builders.add(new EndpointArgumentsBuilder.NullSetter(setter, null));
+                    }
+                }
+            } else if (param.isOUT() && param.getIndex() != -1) {
+                EndpointValueSetter setter = EndpointValueSetter.get(param);
+                builders.add(new EndpointArgumentsBuilder.NullSetter(setter, null));
+            }
+        }
+
+        switch(builders.size()) {
+        case 0:
+            argsBuilder = EndpointArgumentsBuilder.NONE;
+            break;
+        case 1:
+            argsBuilder = builders.get(0);
+            break;
+        default:
+            argsBuilder = new EndpointArgumentsBuilder.Composite(builders);
+        }
+        return argsBuilder;
+    }
+
+    /**
+    * prepare objects for creating response {@link Message}
+    */
+    private EndpointResponseMessageBuilder createResponseMessageBuilder(List<MessageFiller> fillers) {
+
+        EndpointResponseMessageBuilder bodyBuilder = null;
+        List<ParameterImpl> rp = javaMethodModel.getResponseParameters();
+
+        for (ParameterImpl param : rp) {
+            ValueGetter getter = ValueGetter.get(param);
+
+            switch(param.getOutBinding().kind) {
+            case BODY:
+                if(param.isWrapperStyle()) {
+                    if(param.getParent().getBinding().isRpcLit()) {
+                        bodyBuilder = new EndpointResponseMessageBuilder.RpcLit((WrapperParameter)param,
+                            soapVersion);
+                    } else {
+                        bodyBuilder = new EndpointResponseMessageBuilder.DocLit((WrapperParameter)param,
+                            soapVersion);
+                    }
+                } else {
+                    bodyBuilder = new EndpointResponseMessageBuilder.Bare(param, soapVersion);
+                }
+                break;
+            case HEADER:
+                fillers.add(new MessageFiller.Header(param.getIndex(), param.getBridge(), getter ));
+                break;
+            case ATTACHMENT:
+                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
+                break;
+            case UNBOUND:
+                break;
+            default:
+                throw new AssertionError(); // impossible
+            }
+        }
+
+        if (bodyBuilder == null) {
+            // no parameter binds to body. we create an empty message
+            switch(soapVersion) {
+            case SOAP_11:
+                bodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP11;
+                break;
+            case SOAP_12:
+                bodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP12;
+                break;
+            default:
+                throw new AssertionError();
+            }
+        }
+        return bodyBuilder;
+    }
+
+
+    public Packet invoke(Packet req) {
+        // Some transports(like HTTP) may want to send response before envoking endpoint method
+        if (isOneWay && req.transportBackChannel != null) {
+            req.transportBackChannel.close();
+        }
+        Message reqMsg = req.getMessage();
+        Object[] args = new Object[noOfArgs];
+        try {
+            argumentsBuilder.readRequest(reqMsg,args);
+        } catch (JAXBException e) {
+            throw new DeserializationException("failed.to.read.response",e);
+        } catch (XMLStreamException e) {
+            throw new DeserializationException("failed.to.read.response",e);
+        }
+        Message responseMessage;
+        try {
+            Object ret = owner.getInvoker(req).invoke(req, method, args);
+            responseMessage = isOneWay ? null : createResponseMessage(args, ret);
+        } catch (InvocationTargetException e) {
+            Throwable cause = e.getCause();
+
+            if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
+                // Service specific exception
+                LOGGER.log(Level.INFO, cause.getMessage(), cause);
+                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
+                        javaMethodModel.getCheckedException(cause.getClass()), cause);
+            } else {
+                LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
+                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
+            }
+        } catch (Exception e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+            responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
+        }
+        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());
+    }
+
+    /**
+     * Creates a response {@link JAXBMessage} from method arguments, return value
+     *
+     * @return response message
+     */
+    private Message createResponseMessage(Object[] args, Object returnValue) {
+        Message msg = bodyBuilder.createMessage(args, returnValue);
+
+        for (MessageFiller filler : outFillers)
+            filler.fillIn(args, returnValue, msg);
+
+        return msg;
+    }
+
+    private static final Logger LOGGER = Logger.getLogger(EndpointMethodHandler.class.getName());
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java
new file mode 100644
index 0000000..4dd2d0c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java
@@ -0,0 +1,297 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.bind.api.CompositeStructure;
+import com.sun.xml.internal.bind.api.RawAccessor;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Messages;
+import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.model.WrapperParameter;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+
+/**
+ * Builds a JAXB object that represents the payload.
+ *
+ * @see MessageFiller
+ * @author Jitendra Kotamraju
+ */
+abstract class EndpointResponseMessageBuilder {
+    abstract Message createMessage(Object[] methodArgs, Object returnValue);
+
+    static final EndpointResponseMessageBuilder EMPTY_SOAP11 = new Empty(SOAPVersion.SOAP_11);
+    static final EndpointResponseMessageBuilder EMPTY_SOAP12 = new Empty(SOAPVersion.SOAP_12);
+
+    private static final class Empty extends EndpointResponseMessageBuilder {
+        private final SOAPVersion soapVersion;
+
+        public Empty(SOAPVersion soapVersion) {
+            this.soapVersion = soapVersion;
+        }
+
+        Message createMessage(Object[] methodArgs, Object returnValue) {
+            return Messages.createEmpty(soapVersion);
+        }
+    }
+
+    /**
+     * Base class for those {@link EndpointResponseMessageBuilder}s that build a {@link Message}
+     * from JAXB objects.
+     */
+    private static abstract class JAXB extends EndpointResponseMessageBuilder {
+        /**
+         * This object determines the binding of the object returned
+         * from {@link #createMessage(Object[], Object)}
+         */
+        private final Bridge bridge;
+        private final SOAPVersion soapVersion;
+
+        protected JAXB(Bridge bridge, SOAPVersion soapVersion) {
+            assert bridge!=null;
+            this.bridge = bridge;
+            this.soapVersion = soapVersion;
+        }
+
+        final Message createMessage(Object[] methodArgs, Object returnValue) {
+            return JAXBMessage.create( bridge, build(methodArgs, returnValue), soapVersion );
+        }
+
+        /**
+         * Builds a JAXB object that becomes the payload.
+         */
+        abstract Object build(Object[] methodArgs, Object returnValue);
+    }
+
+    /**
+     * Used to create a payload JAXB object just by taking
+     * one of the parameters.
+     */
+    final static class Bare extends JAXB {
+        /**
+         * The index of the method invocation parameters that goes into the payload.
+         */
+        private final int methodPos;
+
+        private final ValueGetter getter;
+
+        /**
+         * Creates a {@link EndpointResponseMessageBuilder} from a bare parameter.
+         */
+        Bare(ParameterImpl p, SOAPVersion soapVersion) {
+            super(p.getBridge(), soapVersion);
+            this.methodPos = p.getIndex();
+            this.getter = ValueGetter.get(p);
+        }
+
+        /**
+         * Picks up an object from the method arguments and uses it.
+         */
+        Object build(Object[] methodArgs, Object returnValue) {
+            if (methodPos == -1) {
+                return returnValue;
+            }
+            return getter.get(methodArgs[methodPos]);
+        }
+    }
+
+
+    /**
+     * Used to handle a 'wrapper' style request.
+     * Common part of rpc/lit and doc/lit.
+     */
+    abstract static class Wrapped extends JAXB {
+
+        /**
+         * Where in the method argument list do they come from?
+         */
+        protected final int[] indices;
+
+        /**
+         * Abstracts away the {@link Holder} handling when touching method arguments.
+         */
+        protected final ValueGetter[] getters;
+
+        protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp.getBridge(), soapVersion);
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            indices = new int[children.size()];
+            getters = new ValueGetter[children.size()];
+            for( int i=0; i<indices.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                indices[i] = p.getIndex();
+                getters[i] = ValueGetter.get(p);
+            }
+        }
+    }
+
+    /**
+     * Used to create a payload JAXB object by wrapping
+     * multiple parameters into one "wrapper bean".
+     */
+    final static class DocLit extends Wrapped {
+        /**
+         * How does each wrapped parameter binds to XML?
+         */
+        private final RawAccessor[] accessors;
+
+        //private final RawAccessor retAccessor;
+
+        /**
+         * Wrapper bean.
+         */
+        private final Class wrapper;
+
+        /**
+         * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}.
+         */
+        DocLit(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp, soapVersion);
+
+            wrapper = (Class)wp.getBridge().getTypeReference().type;
+
+            List<ParameterImpl> children = wp.getWrapperChildren();
+
+            accessors = new RawAccessor[children.size()];
+            for( int i=0; i<accessors.length; i++ ) {
+                ParameterImpl p = children.get(i);
+                QName name = p.getName();
+                try {
+                    accessors[i] = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+                } catch (JAXBException e) {
+                    throw new WebServiceException(  // TODO: i18n
+                        wrapper+" do not have a property of the name "+name,e);
+                }
+            }
+
+        }
+
+        /**
+         * Packs a bunch of arguments into a {@link CompositeStructure}.
+         */
+        Object build(Object[] methodArgs, Object returnValue) {
+            try {
+                Object bean = wrapper.newInstance();
+
+                // fill in wrapped parameters from methodArgs
+                for( int i=indices.length-1; i>=0; i-- ) {
+                    if (indices[i] == -1) {
+                        accessors[i].set(bean, returnValue);
+                    } else {
+                        accessors[i].set(bean,getters[i].get(methodArgs[indices[i]]));
+                    }
+                }
+
+                return bean;
+            } catch (InstantiationException e) {
+                // this is irrecoverable
+                Error x = new InstantiationError(e.getMessage());
+                x.initCause(e);
+                throw x;
+            } catch (IllegalAccessException e) {
+                // this is irrecoverable
+                Error x = new IllegalAccessError(e.getMessage());
+                x.initCause(e);
+                throw x;
+            } catch (AccessorException e) {
+                // this can happen when the set method throw a checked exception or something like that
+                throw new WebServiceException(e);    // TODO:i18n
+            }
+        }
+    }
+
+
+    /**
+     * Used to create a payload JAXB object by wrapping
+     * multiple parameters into a {@link CompositeStructure}.
+     *
+     * <p>
+     * This is used for rpc/lit, as we don't have a wrapper bean for it.
+     * (TODO: Why don't we have a wrapper bean for this, when doc/lit does!?)
+     */
+    final static class RpcLit extends Wrapped {
+        /**
+         * How does each wrapped parameter binds to XML?
+         */
+        private final Bridge[] parameterBridges;
+
+        /**
+         * Used for error diagnostics.
+         */
+        private final List<ParameterImpl> children;
+
+        /**
+         * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}.
+         */
+        RpcLit(WrapperParameter wp, SOAPVersion soapVersion) {
+            super(wp, soapVersion);
+            // we'll use CompositeStructure to pack requests
+            assert wp.getTypeReference().type==CompositeStructure.class;
+
+            this.children = wp.getWrapperChildren();
+
+            parameterBridges = new Bridge[children.size()];
+            for( int i=0; i<parameterBridges.length; i++ )
+                parameterBridges[i] = children.get(i).getBridge();
+        }
+
+        /**
+         * Packs a bunch of arguments intoa {@link CompositeStructure}.
+         */
+        CompositeStructure build(Object[] methodArgs, Object returnValue) {
+            CompositeStructure cs = new CompositeStructure();
+            cs.bridges = parameterBridges;
+            cs.values = new Object[parameterBridges.length];
+
+            // fill in wrapped parameters from methodArgs
+            for( int i=indices.length-1; i>=0; i-- ) {
+                Object v;
+                if (indices[i] == -1) {
+                    v = getters[i].get(returnValue);
+                } else {
+                    v = getters[i].get(methodArgs[indices[i]]);
+                }
+                if(v==null) {
+                    throw new WebServiceException("Method Parameter: "+
+                        children.get(i).getName() +" cannot be null. This is BP 1.1 R2211 violation.");
+                }
+                cs.values[i] = v;
+            }
+
+            return cs;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java
new file mode 100644
index 0000000..51d3923
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.api.model.Parameter;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+
+import javax.xml.ws.Holder;
+
+/**
+ * Moves a Java value unmarshalled from a response message
+ * to the right place.
+ *
+ * <p>
+ * Sometimes values are returned as a return value, and
+ * others are returned in the {@link Holder} value. Instances
+ * of this interface abstracts this detail.
+ *
+ * <p>
+ * {@link EndpointValueSetter} is a stateless behavior encapsulation.
+ *
+ * @author Jitendra Kotamraju
+ */
+abstract class EndpointValueSetter {
+    private EndpointValueSetter() {}
+
+    /**
+     * Moves the value to the expected place.
+     *
+     * @param obj
+     *      The unmarshalled object.
+     * @param args
+     *      The arguments that need to be given to the Java method invocation. If <tt>obj</tt>
+     *      is supposed to be returned as a {@link Holder} value, a suitable
+     *      {@link Holder} is obtained from this argument list and <tt>obj</tt>
+     *      is set.
+     *
+     */
+    abstract void put(Object obj, Object[] args);
+
+    /**
+     * {@link Param}s with small index numbers are used often,
+     * so we pool them to reduce the footprint.
+     */
+    private static final EndpointValueSetter[] POOL = new EndpointValueSetter[16];
+
+    static {
+        for( int i=0; i<POOL.length; i++ )
+            POOL[i] = new Param(i);
+    }
+
+    /**
+     * Returns a {@link EndpointValueSetter} suitable for the given {@link Parameter}.
+     */
+    public static EndpointValueSetter get(ParameterImpl p) {
+        int idx = p.getIndex();
+        if (p.isIN()) {
+            if (idx<POOL.length) {
+                return POOL[idx];
+            } else {
+                return new Param(idx);
+            }
+        } else {
+            return new HolderParam(idx);
+        }
+    }
+
+    static class Param extends EndpointValueSetter {
+        /**
+         * Index of the argument to put the value to.
+         */
+        protected final int idx;
+
+        public Param(int idx) {
+            this.idx = idx;
+        }
+
+        void put(Object obj, Object[] args) {
+            if (obj != null) {
+                args[idx] = obj;
+            }
+        }
+    }
+
+    static final class HolderParam extends Param {
+
+        public HolderParam(int idx) {
+            super(idx);
+        }
+
+        @Override
+        void put(Object obj, Object[] args) {
+            Holder holder = new Holder();
+            if (obj != null) {
+                holder.value = obj;
+            }
+            args[idx] = holder;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java
new file mode 100644
index 0000000..af812e9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.bind.api.Bridge;
+import com.sun.xml.internal.ws.api.message.Headers;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.message.ByteArrayAttachment;
+import com.sun.xml.internal.ws.message.DataHandlerAttachment;
+import com.sun.xml.internal.ws.message.JAXBAttachment;
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.UUID;
+import javax.activation.DataHandler;
+import javax.xml.transform.Source;
+import javax.xml.ws.WebServiceException;
+import com.sun.xml.internal.ws.api.message.Attachment;
+
+/**
+ * Puts a non-payload message parameter to {@link Message}.
+ *
+ * <p>
+ * Instance of this class is used to handle header parameters and attachment parameters.
+ * They add things to {@link Message}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+abstract class MessageFiller {
+
+    /**
+     * The index of the method invocation parameters that this object looks for.
+     */
+    protected final int methodPos;
+
+    protected MessageFiller( int methodPos) {
+        this.methodPos = methodPos;
+    }
+
+    /**
+     * Moves an argument of a method invocation into a {@link Message}.
+     */
+    abstract void fillIn(Object[] methodArgs, Object returnValue, Message msg);
+
+    /**
+     * Adds a parameter as an MIME attachment to {@link Message}.
+     */
+    static abstract class AttachmentFiller extends MessageFiller {
+        protected final ParameterImpl param;
+        protected final ValueGetter getter;
+        protected final String mimeType;
+        private final String contentIdPart;
+
+        protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
+            super(param.getIndex());
+            this.param = param;
+            this.getter = getter;
+            mimeType = param.getBinding().getMimeType();
+            try {
+                contentIdPart = URLEncoder.encode(param.getPartName(), "UTF-8")+'=';
+            } catch (UnsupportedEncodingException e) {
+                throw new WebServiceException(e);
+            }
+        }
+
+        /**
+         * Creates an MessageFiller based on the parameter type
+         *
+         * @param param
+         *      runtime Parameter that abstracts the annotated java parameter
+         * @param getter
+         *      Gets a value from an object that represents a parameter passed
+         *      as a method argument.
+         */
+        public static MessageFiller createAttachmentFiller(ParameterImpl param, ValueGetter getter) {
+            Class type = (Class)param.getTypeReference().type;
+            if (DataHandler.class.isAssignableFrom(type) || Source.class.isAssignableFrom(type)) {
+                return new DataHandlerFiller(param, getter);
+            } else if (byte[].class==type) {
+                return new ByteArrayFiller(param, getter);
+            } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                return new JAXBFiller(param, getter);
+            } else {
+                return new DataHandlerFiller(param, getter);
+            }
+        }
+
+        String getContentId() {
+            return contentIdPart+UUID.randomUUID()+"@jaxws.sun.com";
+        }
+    }
+
+    private static class ByteArrayFiller extends AttachmentFiller {
+        protected ByteArrayFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
+            String contentId = getContentId();
+            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+            if (obj != null) {
+                Attachment att = new ByteArrayAttachment(contentId,(byte[])obj,mimeType);
+                msg.getAttachments().add(att);
+            }
+        }
+    }
+
+    private static class DataHandlerFiller extends AttachmentFiller {
+        protected DataHandlerFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
+            String contentId = getContentId();
+            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+            DataHandler dh = (obj instanceof DataHandler) ? (DataHandler)obj : new DataHandler(obj,mimeType);
+            Attachment att = new DataHandlerAttachment(contentId, dh);
+            msg.getAttachments().add(att);
+        }
+    }
+
+    private static class JAXBFiller extends AttachmentFiller {
+        protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
+            super(param, getter);
+        }
+        void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
+            String contentId = getContentId();
+            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+            Attachment att = new JAXBAttachment(contentId, obj, param.getBridge(), mimeType);
+            msg.getAttachments().add(att);
+        }
+    }
+
+    /**
+     * Adds a parameter as an header.
+     */
+    static final class Header extends MessageFiller {
+        private final Bridge bridge;
+        private final ValueGetter getter;
+
+        protected Header(int methodPos, Bridge bridge, ValueGetter getter) {
+            super(methodPos);
+            this.bridge = bridge;
+            this.getter = getter;
+        }
+
+        void fillIn(Object[] methodArgs, Object returnValue, Message msg) {
+            Object value = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+            msg.getHeaders().add(Headers.create(bridge,value));
+        }
+    }
+
+    private static boolean isXMLMimeType(String mimeType){
+        return mimeType.equals("text/xml") || mimeType.equals("application/xml");
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/PayloadQNameBasedDispatcher.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/PayloadQNameBasedDispatcher.java
new file mode 100644
index 0000000..da73ab0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/PayloadQNameBasedDispatcher.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.util.QNameMap;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An {@link com.sun.xml.internal.ws.server.sei.EndpointMethodDispatcher} that uses
+ * SOAP payload first child's QName as the key for dispatching.
+ * <p/>
+ * A map of all payload QNames on the port and the corresponding {@link EndpointMethodHandler}
+ * is initialized in the constructor. The payload QName is extracted from the
+ * request {@link Packet} and used as the key to return the correct
+ * handler.
+ *
+ * @author Arun Gupta
+ */
+final class PayloadQNameBasedDispatcher implements EndpointMethodDispatcher {
+    private final QNameMap<EndpointMethodHandler> methodHandlers;
+    private static final String EMPTY_PAYLOAD_LOCAL = "";
+    private static final String EMPTY_PAYLOAD_NSURI = "";
+    private WSBinding binding;
+
+    public PayloadQNameBasedDispatcher(AbstractSEIModelImpl model, WSBinding binding, SEIInvokerTube invokerTube) {
+        this.binding = binding;
+        methodHandlers = new QNameMap<EndpointMethodHandler>();
+        for( JavaMethodImpl m : model.getJavaMethods() ) {
+            EndpointMethodHandler handler = new EndpointMethodHandler(invokerTube,m,binding);
+            QName payloadName = model.getQNameForJM(m);     // TODO need a new method on JavaMethodImpl
+            methodHandlers.put(payloadName.getNamespaceURI(), payloadName.getLocalPart(), handler);
+        }
+    }
+
+    /**
+     * {@link PayloadQNameBasedDispatcher} never returns null because this is always
+     * the last {@link EndpointMethodHandler} to kick in.
+     */
+    public @NotNull EndpointMethodHandler getEndpointMethodHandler(Packet request) throws DispatchException {
+        Message message = request.getMessage();
+        String localPart = message.getPayloadLocalPart();
+        String nsUri;
+        if (localPart == null) {
+            localPart = EMPTY_PAYLOAD_LOCAL;
+            nsUri = EMPTY_PAYLOAD_NSURI;
+        } else {
+            nsUri = message.getPayloadNamespaceURI();
+        }
+
+        EndpointMethodHandler h = methodHandlers.get(nsUri, localPart);
+
+        if (h==null) {
+            String dispatchKey = "{" + nsUri + "}" + localPart;
+            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey, "Payload QName-based Dispatcher");
+            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
+                binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
+        }
+
+        return h;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java
new file mode 100644
index 0000000..1f3c132
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.server.Invoker;
+import com.sun.xml.internal.ws.client.sei.MethodHandler;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.server.InvokerTube;
+
+import java.util.List;
+
+/**
+ * This pipe is used to invoke SEI based endpoints.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class SEIInvokerTube extends InvokerTube {
+
+    /**
+     * For each method on the port interface we have
+     * a {@link MethodHandler} that processes it.
+     */
+    private final SOAPVersion soapVersion;
+    private final WSBinding binding;
+    private final AbstractSEIModelImpl model;
+    private final List<EndpointMethodDispatcher> dispatcherList;
+
+    public SEIInvokerTube(AbstractSEIModelImpl model,Invoker invoker, WSBinding binding) {
+        super(invoker);
+        this.soapVersion = binding.getSOAPVersion();
+        this.binding = binding;
+        this.model = model;
+        EndpointMethodDispatcherGetter methodDispatcherGetter = new EndpointMethodDispatcherGetter(model, binding, this);
+        dispatcherList = methodDispatcherGetter.getDispatcherList();
+    }
+
+    /**
+     * This binds the parameters for SEI endpoints and invokes the endpoint method. The
+     * return value, and response Holder arguments are used to create a new {@link Message}
+     * that traverses through the Pipeline to transport.
+     */
+    public @NotNull NextAction processRequest(@NotNull Packet req) {
+        Packet res = null;
+
+        try {
+            for (EndpointMethodDispatcher dispatcher : dispatcherList) {
+                EndpointMethodHandler handler = dispatcher.getEndpointMethodHandler(req);
+                if (handler != null) {
+                    res = handler.invoke(req);
+                    break;
+                }
+            }
+        } catch (DispatchException e) {
+            return doReturnWith(req.createServerResponse(e.fault, model.getPort(), null, binding));
+        }
+
+        // PayloadQNameBasedDispatcher should throw DispatchException
+        assert res!=null;
+
+        return doReturnWith(res);
+    }
+
+    public @NotNull NextAction processResponse(@NotNull Packet response) {
+        throw new IllegalStateException("InovkerPipe's processResponse shouldn't be called.");
+    }
+
+    public @NotNull NextAction processException(@NotNull Throwable t) {
+        throw new IllegalStateException("InovkerPipe's processException shouldn't be called.");
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ValueGetter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ValueGetter.java
new file mode 100644
index 0000000..0d628e4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ValueGetter.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.server.sei;
+
+import com.sun.xml.internal.ws.model.ParameterImpl;
+import com.sun.xml.internal.ws.api.model.Parameter;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.ws.Holder;
+
+/**
+ * Gets a value from an object that represents a parameter passed
+ * as a method argument.
+ *
+ * <p>
+ * This abstraction hides the handling of {@link Holder}.
+ *
+ * <p>
+ * {@link ValueGetter} is a stateless behavior encapsulation.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+enum ValueGetter {
+    /**
+     * {@link ValueGetter} that works for {@link Mode#IN}  parameter.
+     *
+     * <p>
+     * Since it's the IN mode, the parameter is not a {@link Holder},
+     * therefore the parameter itself is a value.
+     */
+    PLAIN() {
+        Object get(Object parameter) {
+            return parameter;
+        }
+    },
+    /**
+     * Creates {@link ValueGetter} that works for {@link Holder},
+     * which is  {@link Mode#INOUT} or  {@link Mode#OUT}.
+     *
+     * <p>
+     * In those {@link Mode}s, the parameter is a {@link Holder},
+     * so the value to be sent is obtained by getting the value of the holder.
+     */
+    HOLDER() {
+        Object get(Object parameter) {
+            if(parameter==null)
+                // the user is allowed to pass in null where a Holder is expected.
+                return null;
+            return ((Holder)parameter).value;
+        }
+    };
+
+    /**
+     * Gets the value to be sent, from a parameter given as a method argument.
+     */
+    abstract Object get(Object parameter);
+
+    /**
+     * Returns a {@link ValueGetter} suitable for the given {@link Parameter}.
+     */
+    static ValueGetter get(ParameterImpl p) {
+        // return value is always PLAIN
+        if(p.getMode() == Mode.IN || p.getIndex() == -1) {
+            return PLAIN;
+        } else {
+            return HOLDER;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java
index 2fd37f6..673a0b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,42 +25,185 @@
 package com.sun.xml.internal.ws.spi;
 
 
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSService;
+import com.sun.xml.internal.ws.api.server.*;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
 import com.sun.xml.internal.ws.client.WSServiceDelegate;
+import com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference;
+import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
+import com.sun.xml.internal.ws.resources.ProviderApiMessages;
 import com.sun.xml.internal.ws.transport.http.server.EndpointImpl;
+import com.sun.xml.internal.ws.util.ServiceFinder;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
 
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.*;
 import javax.xml.ws.spi.Provider;
 import javax.xml.ws.spi.ServiceDelegate;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.List;
 
 /**
+ * The entry point to the JAX-WS RI from the JAX-WS API.
+ *
  * @author WS Development Team
  */
 public class ProviderImpl extends Provider {
 
+    private final static JAXBContext eprjc = getEPRJaxbContext();
+
+    /**
+     * Convenient singleton instance.
+     */
+    public static final ProviderImpl INSTANCE = new ProviderImpl();
+
     @Override
     public Endpoint createEndpoint(String bindingId, Object implementor) {
-        return new EndpointImpl(bindingId, implementor);
+        return new EndpointImpl(
+            (bindingId != null) ? BindingID.parse(bindingId) : BindingID.parse(implementor.getClass()),
+            implementor);
     }
 
     @Override
-    public ServiceDelegate createServiceDelegate(
-         java.net.URL wsdlDocumentLocation,
-         QName serviceName, Class serviceClass) {
-
-
-
+    public ServiceDelegate createServiceDelegate( URL wsdlDocumentLocation, QName serviceName, Class serviceClass) {
          return new WSServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass);
     }
 
     @Override
     public Endpoint createAndPublishEndpoint(String address,
                                              Object implementor) {
-        Endpoint endpoint = new EndpointImpl(null, implementor);
+        Endpoint endpoint = new EndpointImpl(
+            BindingID.parse(implementor.getClass()),
+            implementor);
         endpoint.publish(address);
         return endpoint;
     }
 
+    public EndpointReference readEndpointReference(final Source eprInfoset) {
+        // EPR constructors are private, so we need privilege escalation.
+        // this unmarshalling can only access instances of a fixed, known set of classes,
+        // so doing that shouldn't introduce security vulnerability.
+        return AccessController.doPrivileged(new PrivilegedAction<EndpointReference>() {
+            public EndpointReference run() {
+                try {
+                    Unmarshaller unmarshaller = eprjc.createUnmarshaller();
+                    return (EndpointReference) unmarshaller.unmarshal(eprInfoset);
+                } catch (JAXBException e) {
+                    throw new WebServiceException("Error creating Marshaller or marshalling.", e);
+                }
+            }
+        });
+    }
+
+    public <T> T getPort(EndpointReference endpointReference, Class<T> clazz, WebServiceFeature... webServiceFeatures) {
+        /*
+        final @NotNull MemberSubmissionEndpointReference msepr =
+                EndpointReferenceUtil.transform(MemberSubmissionEndpointReference.class, endpointReference);
+                WSService service = new WSServiceDelegate(msepr.toWSDLSource(), msepr.serviceName.name, Service.class);
+                */
+        if(endpointReference == null)
+            throw new WebServiceException(ProviderApiMessages.NULL_EPR());
+        WSEndpointReference wsepr =  new WSEndpointReference(endpointReference);
+        WSEndpointReference.Metadata metadata = wsepr.getMetaData();
+        WSService service;
+        if(metadata.getWsdlSource() != null)
+            service = new WSServiceDelegate(metadata.getWsdlSource(), metadata.getServiceName(), Service.class);
+        else
+            throw new WebServiceException("WSDL metadata is missing in EPR");
+        return service.getPort(wsepr, clazz, webServiceFeatures);
+    }
+
+    public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters) {
+        if (address == null) {
+            if (serviceName == null || portName == null) {
+                throw new IllegalStateException(ProviderApiMessages.NULL_ADDRESS_SERVICE_ENDPOINT());
+            } else {
+                //check if it is run in a Java EE Container and if so, get address using serviceName and portName
+                Container container = ContainerResolver.getInstance().getContainer();
+                Module module = container.getSPI(Module.class);
+                if (module != null) {
+                    List<BoundEndpoint> beList = module.getBoundEndpoints();
+                    for (BoundEndpoint be : beList) {
+                        WSEndpoint wse = be.getEndpoint();
+                        if (wse.getServiceName().equals(serviceName) && wse.getPortName().equals(portName)) {
+                            try {
+                                address = be.getAddress().toString();
+                            } catch (WebServiceException e) {
+                                // May be the container does n't support this
+                                //just ignore the exception
+                            }
+                            break;
+                        }
+                    }
+                }
+                //address is still null? may be its not run in a JavaEE Container
+                if (address == null)
+                    throw new IllegalStateException(ProviderApiMessages.NULL_ADDRESS());
+            }
+        }
+        if((serviceName==null) && (portName != null)) {
+            throw new IllegalStateException(ProviderApiMessages.NULL_SERVICE());
+        }
+        //Validate Service and Port in WSDL
+        if (wsdlDocumentLocation != null) {
+            try {
+                EntityResolver er = XmlUtil.createDefaultCatalogResolver();
+
+                URL wsdlLoc = new URL(wsdlDocumentLocation);
+                WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()), er,
+                        false, ServiceFinder.find(WSDLParserExtension.class).toArray());
+                if (serviceName != null) {
+                    WSDLService wsdlService = wsdlDoc.getService(serviceName);
+                    if (wsdlService == null)
+                        throw new IllegalStateException(ProviderApiMessages.NOTFOUND_SERVICE_IN_WSDL(
+                                serviceName,wsdlDocumentLocation));
+                    if (portName != null) {
+                        WSDLPort wsdlPort = wsdlService.get(portName);
+                        if (wsdlPort == null)
+                            throw new IllegalStateException(ProviderApiMessages.NOTFOUND_PORT_IN_WSDL(
+                                    portName,serviceName,wsdlDocumentLocation));
+                    }
+                }
+            } catch (Exception e) {
+                throw new IllegalStateException(ProviderApiMessages.ERROR_WSDL(wsdlDocumentLocation),e);
+            }
+        }
+        // Supress writing ServiceName and EndpointName in W3C EPR,
+        // Until the ns for those metadata elements is resolved.
+        return new WSEndpointReference(
+            AddressingVersion.fromSpecClass(W3CEndpointReference.class),
+            address, null /*serviceName*/, null /*portName*/, null, metadata, null /*wsdlDocumentLocation*/, referenceParameters).toSpec(W3CEndpointReference.class);
+    }
+
+    private static JAXBContext getEPRJaxbContext() {
+        // EPRs have package and private fields, so we need privilege escalation.
+        // this access only fixed, known set of classes, so doing that
+        // shouldn't introduce security vulnerability.
+        return AccessController.doPrivileged(new PrivilegedAction<JAXBContext>() {
+            public JAXBContext run() {
+                try {
+                    return JAXBContext.newInstance(MemberSubmissionEndpointReference.class, W3CEndpointReference.class);
+                } catch (JAXBException e) {
+                    throw new WebServiceException("Error creating JAXBContext for W3CEndpointReference. ", e);
+                }
+            }
+        });
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Binding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Binding.java
deleted file mode 100644
index a13e2d0..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Binding.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.spi.runtime;
-
-/** The <code>Binding</code> is the spi interface that extends the base interface
- *  for JAX-WS protocol bindings.
- * This interface is implemented by com.sun.xml.internal.ws.client.Binding.
-**/
-public interface Binding extends javax.xml.ws.Binding {
-
-  public SystemHandlerDelegate getSystemHandlerDelegate();
-
-  public void setSystemHandlerDelegate(SystemHandlerDelegate delegate);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactory.java
deleted file mode 100644
index 602d427..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import java.util.Map;
-
-/**
- * This class is implemented by
- * com.sun.xml.internal.ws.client.ClientTransportFactory
- */
-public interface ClientTransportFactory {
-    public WSConnection create(Map<String, Object> context);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactoryTypes.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactoryTypes.java
deleted file mode 100644
index ff8d364..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/ClientTransportFactoryTypes.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-/**
- * This defines the types of ClientTransportFactory
- */
-public interface ClientTransportFactoryTypes {
-    public static final int HTTP  = 0;
-    public static final int LOCAL = 1;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/InternalSoapEncoder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/InternalSoapEncoder.java
deleted file mode 100644
index 78db370..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/InternalSoapEncoder.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.spi.runtime;
-
-import javax.xml.stream.XMLStreamWriter;
-import java.io.OutputStream;
-
-/**
- * SOAPEncoder to encode JAXWS runtime objects. Using this caller could optimize
- * SOAPMessage creation and not use JAXWS default encoding of SOAPMessage
- */
-public interface InternalSoapEncoder {
-    /**
-     *  Writes an object to output stream
-     * @param obj payload to be written
-     * @param messageInfo object containing informations to help JAXWS write the objects. Get
-     *        this object from SOAPMessageContext.getMessageInfo()
-     * @param out stream to write to
-     * @param mtomCallback callback is called if there any attachments while
-     *                     encoding the object
-     */
-    public void write(Object obj, Object messageInfo, OutputStream out, MtomCallback mtomCallback);
-
-    /**
-     * Writes an object to output stream
-     * @param obj payload to be written
-     * @param messageInfo object containing informations to help JAXWS write the objects. Get
-     *        this object from SOAPMessageContext.getMessageInfo()
-     * @param out stream writer to write to
-     * @param mtomCallback callback is called if there any attachments while
-     *                     encoding the object
-     */
-    public void write(Object obj, Object messageInfo, XMLStreamWriter out, MtomCallback mtomCallback);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Invoker.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Invoker.java
deleted file mode 100644
index e26a43c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Invoker.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import java.lang.reflect.Method;
-import javax.xml.namespace.QName;
-
-/**
- * Complete invocation of webservice can be done using this object. So this
- * object can be wrapped in other blocks to provide certain context(for e.g.
- * can be wrapped in doAsPrivileged())
- *
- * @author WS Development Team
- */
-public interface Invoker {
-    /**
-     * Invokes request handler chain, endpoint, response handler chain
-     */
-    public void invoke() throws Exception;
-
-    /**
-     * It gives java methods for a give operation name
-     *
-     * @return corresponding java method for operation name, otherwise null
-     */
-    public Method getMethod(QName name);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MessageContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MessageContext.java
deleted file mode 100644
index 4a3158e..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MessageContext.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import java.lang.reflect.Method;
-
-/**
- * Enhanced API' MessageContext with some extra properties
- */
-public interface MessageContext extends javax.xml.ws.handler.MessageContext {
-    /**
-     * Returns binding id defined in API
-     * @return bindingId is one of these values:
-     * javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING,
-     * javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING,
-     * javax.xml.ws.http.HTTPBinding.HTTP_BINDING
-     */
-    public String getBindingId();
-
-    /**
-     * Returns the invocation method.
-     *
-     * @return invocation method, null if the model doesn't know
-     */
-    public Method getMethod();
-
-    /**
-     * Sets cannonicalization algorithm that is used while writing JAXB objects
-     *
-     */
-    public void setCanonicalization(String algorithm);
-
-    /**
-     * Returns the Invoker
-     *
-     * @return Invoker
-     */
-    public Invoker getInvoker();
-
-    /**
-     * Returns if MTOM is anbled
-     * @return true if MTOM is enabled otherwise returns false;
-     */
-    public boolean isMtomEnabled();
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MtomCallback.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MtomCallback.java
deleted file mode 100644
index 7802095..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/MtomCallback.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import javax.activation.DataHandler;
-
-/**
- * MTOM callback class that is passed to InternalSoapEncoder.write() to get notification when
- * mtom attachment is added or the message is xopped.
- */
-public interface MtomCallback {
-    /**
-     * This method provides the content-id that will be set to Content-ID MIME header, the
-     * element which will be xop encoded by JAXB.
-     *
-     * @param contentId
-     * @param attachment
-     * @param elementTargetNamespace
-     * @param elementLocalName
-     */
-    public void addedMtomAttachment(String contentId, DataHandler attachment, String elementTargetNamespace, String elementLocalName);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/RuntimeEndpointInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/RuntimeEndpointInfo.java
deleted file mode 100644
index 442ad01..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/RuntimeEndpointInfo.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import java.net.URL;
-import javax.xml.namespace.QName;
-import org.xml.sax.EntityResolver;
-
-/**
- * This captures all the required information (e.g: handlers, binding, endpoint
- * object, proxy for endpoint object etc.) about the endpoint.
- */
-public interface RuntimeEndpointInfo {
-
-    /**
-     * Returns the name of the endpoint
-     * @return name of the endpoint
-     */
-    public String getName();
-
-    /**
-     * sets the name of the endpoint
-     */
-    public void setName(String name);
-
-    /**
-     * Builds runtime model from implementor object.
-     */
-    public void init();
-
-    /**
-     * Destroys any state in this object
-     */
-    public void destroy();
-
-    /**
-     * This object is used for method invocations. It could be actual
-     * implementor or a proxy object. This must be set before calling deploy().
-     */
-    public void setImplementor(Object implementor);
-
-    /**
-     * implementorClass should have <code>@WebService</code> or
-     * <code>@WebServiceProvider</code> annotation.
-     * Dynamic model is created using this object. If this is not set, implementor's
-     * class is used to create the model.
-     */
-    public void setImplementorClass(Class implementorClass);
-
-    /**
-     * Returns actual Endpoint Object where method invocation is done
-     *
-     * @return Object Gets the endpoint implementation object or a proxy
-     */
-    public Object getImplementor();
-
-    /**
-     * Returns the set implementorClass
-     *
-     * @return implementor's class that has the annotations
-     */
-    public Class getImplementorClass();
-
-    /**
-     * Returns the binding for this endpoint
-     *
-     * @return Binding Returns the binding for this endpoint.
-     */
-    public Binding getBinding();
-
-    /**
-     * sets the binding for this endpoint. If there are handlers, set them on
-     * the binding object.
-     */
-    public void setBinding(Binding binding);
-
-    /**
-     * Returns the WebServiceContext of this endpoint
-     *
-     * @return WebServiceContext Returns the WebServiceContext of this endpoint.
-     */
-    public WebServiceContext getWebServiceContext();
-
-    /**
-     * sets the WebServiceContext for this endpoint.
-     */
-    public void setWebServiceContext(WebServiceContext wsContext);
-
-    /**
-     * set the URL for primary WSDL, and a resolver to resolve entities like
-     * WSDL, imports/references. A resolver for XML catalog can be created using
-     * WSRtObjectFactory.createResolver(URL catalogURL).
-     */
-    public void setWsdlInfo(URL wsdlUrl, EntityResolver resolver);
-
-    /**
-     * Set service name from DD. If it is null, @WebService, @WebServiceProvider
-     * annotations are used to get service name
-     */
-    public void setServiceName(QName name);
-
-    /**
-     * Set port name from DD. If it is null, @WebService, @WebServiceProvider
-     * annotations are used to get port name
-     */
-    public void setPortName(QName name);
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SOAPMessageContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SOAPMessageContext.java
deleted file mode 100644
index c6bc173..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SOAPMessageContext.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-import java.util.List;
-
-/**
- * This enhances API's SOAPMessageContext and provides internal representation
- * of SOAPMessage so that it can be encoded optimally
- */
-public interface SOAPMessageContext
-    extends javax.xml.ws.handler.soap.SOAPMessageContext, MessageContext {
-
-    /**
-     * If there is a SOAPMessage already, use getSOAPMessage(). Ignore all other methods
-     * @return
-     */
-    public boolean isAlreadySoap();
-
-    /**
-     * Returns InternalMessage's BodyBlock value
-     * @return
-     */
-    public Object getBody();
-
-    /**
-     * Returns InternalMessage's HeaderBlock values
-     * @return
-     */
-    public List getHeaders();
-
-    /**
-     * Use this object to pass to InternalSoapEncoder write methods
-     * @return object containg information thats used by InternalEncoderDecoder write methods.
-     *
-     */
-    public Object getMessageInfo();
-
-    /**
-     * Returns to marshall all JAXWS objects: RpcLitPayload, JAXBBridgeInfo etc
-     * @return
-     */
-    public InternalSoapEncoder getEncoder();
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/StubBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/StubBase.java
deleted file mode 100644
index cbc2a4c..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/StubBase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-
-/**
- * This class is implemented by
- * com.sun.xml.internal.ws.client.StubBase
- */
-public interface StubBase {
-    public void _setTransportFactory(ClientTransportFactory f);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegate.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegate.java
deleted file mode 100644
index 508a3ab..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegate.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-
-/**
- * A SystemHandlerDelegate is used to inject system level functionality into a
- * message processing runtime. The methods of this interface are invoked by
- * the client and enpoint message dispatchers of the message processing
- * runtime.
- *
- * @author WS Development Team
- */
-
-public interface SystemHandlerDelegate {
-
-   /**
-    * Called by both client and endpoint message dispatchers to activate
-    * injected request message processing.
-    * When called by a client side message dispatcher, this method must be
-    * called just before the message (associated with the MessageContext)
-    * is sent. When called by the message dispatcher at an endpoint, this
-    * method must be called before MustUnderstand processing on the
-    * associated message.
-    *
-    * @param messageContext when called by a SOAPBinding the argument
-    * must be an instanceof com.sun.xml.internal.ws.spi.runtime.SOAPMessageContext, and
-    * when called by a SOAPBinding at an endpoint, the argument must
-    * be an instanceof com.sun.xml.internal.ws.spi.runtime.SOAPMessageContext and the
-    * Invoker (on the context) must be available for use on the server by the
-    * delegate. An argument SOAPMessageContext passed to this method by an endpoint
-    * dispatcher, must have values assigned for the following MessageContext
-    * properties.
-    * <ul>
-    * <li>MessageContext.SERVLET_REQUEST
-    * <li>MessageContext.SERVLET_RESPONSE
-    * <li>MessageContext.SERVLET_SESSION
-    * <li>MessageContext.SERVLET_CONTEXT
-    * </ul>
-    * @return true if processing by the delegate was such that the caller
-    * should continue with its normal message processing. Returns false when
-    * the delegate has established, in the MessageContext,
-    * the response message to be sent. When this method returns
-    * false, the calling message dispatcher must return the response message
-    * without performing MustUnderstand processing and without invoking the
-    * endpoint. Only delegates called by endpoint side message dispatchers
-    * may return false
-    *
-    * @throws java.lang.Exception when the processing by the delegate failed
-    * without yielding a response message; in which case, the caller shall
-    * determine how to process the error.
-    *
-    */
-    public boolean processRequest(MessageContext messageContext) throws Exception;
-
-   /**
-    * Called by both client and endpoint message dispatchers to activate
-    * injected response message processing.
-    * When called by the message dispatcher at the client, this method must be
-    * called before MustUnderstand processing on the received message
-    * (associated with the MessageContext). When called by the message
-    * dispatcher at an endpoint, this method must be called after the
-    * endpoint has been invoked, and just before the associated response
-    * message is sent. In the special case where invocation of the endpoint
-    * caused an Exception to be thrown, this method must not be called.
-    *
-    * @param messageContext when called by a SOAPBinding the argument
-    * must be an instanceof com.sun.xml.internal.ws.spi.runtime.SOAPMessageContext.
-    *
-    * @throws java.lang.Exception when the processing by the delegate failed.
-    * In this case, the caller must not send the response message but shall
-    * otherwise determine how to process the error.
-    */
-    public void processResponse(MessageContext messageContext) throws Exception;
-
-   /**
-    * This method must be called by an endpoint message dispatcher after
-    * MustUnderstand processing and before endpoint invocation.
-    *
-    * @param messageContext when called by a SOAPBinding the argument
-    * must be an instanceof com.sun.xml.internal.ws.spi.runtime.SOAPMessageContext, and
-    * must have values assigned for the following MessageContext
-    * properties.
-    * <ul>
-    * <li>MessageContext.SERVLET_REQUEST
-    * <li>MessageContext.SERVLET_RESPONSE
-    * <li>MessageContext.SERVLET_SESSION
-    * <li>MessageContext.SERVLET_CONTEXT
-    * </ul>
-     */
-    public void preInvokeEndpointHook(MessageContext messageContext);
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegateFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegateFactory.java
deleted file mode 100644
index 1d7b840..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/SystemHandlerDelegateFactory.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import javax.xml.ws.WebServiceException;
-import javax.xml.namespace.QName;
-import static java.lang.Class.forName;
-import static java.lang.Thread.currentThread;
-import java.util.HashMap;
-
-public abstract class SystemHandlerDelegateFactory {
-
-    private final static String DEFAULT_FACTORY_NAME =
-        "com.sun.xml.internal.xwss.SystemHandlerDelegateFactory";
-
-    private static String factoryName;
-
-    private static HashMap factoryMap;
-
-    static {
-        init();
-    }
-
-    private static synchronized void init() {
-        factoryName = DEFAULT_FACTORY_NAME;
-        factoryMap = new HashMap();
-    };
-
-    // foctory implementations that maintain a map of serviceName to
-    // would override this method
-    /**
-    * Used by the Appserver on client and server sides
-    * factory implementations that maintain a map of serviceName to
-    * factory
-    * @param serviceName when called by the SOAPBindingImpl to
-    * create the SystemHandlerDelegate. serviceName must be
-    * a QName
-    * @return com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate
-    * @throws java.lang.Exception when the create failed.
-    */
-    public SystemHandlerDelegate getDelegate(QName serviceName) {
-        return create();
-    }
-
-    /**
-    * Used by the Appserver and xws-security on client and server sides
-    * factory implementations that maintain a map of serviceName to
-    * factory
-    * @return com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegate
-    * @throws java.lang.Exception when the create failed.
-    */
-    public abstract SystemHandlerDelegate create();
-
-    //currently not used
-    public abstract boolean isEnabled(MessageContext messageContext);
-
-    // factory name can be set to null, in which case,
-    // the default factory will be disabled.
-    /**
-    * Used by the Appserver on client and server sides
-    * factoryName can be set to null, in which case the defaultFactory will be
-    * disabled
-    * @param name when called by the SOAPBindingImpl to
-    * create the SystemHandlerDelegate. serviceName must be
-    * a String
-    */
-    public static synchronized void setFactoryName(String name) {
-        factoryName = name;
-    }
-
-    /**
-    * Used by the Appserver on client and server sides
-    * factoryName can be set to null, in which case the defaultFactory will be
-    * disabled and will be null on return
-    * @return java.lang.String - name of factory
-    */
-    public static synchronized String getFactoryName() {
-        return factoryName;
-    }
-    /**
-    * Used by the JAX-WS implementation on client and server sides
-    * to load the SystemHandlerDelegateFactory
-    * @return com.sun.xml.internal.ws.spi.runtime.SystemHandlerDelegateFactory
-    * @throws javax.xml.ws.WebServiceException when the load fails.
-    */
-    public static synchronized SystemHandlerDelegateFactory getFactory() {
-
-        SystemHandlerDelegateFactory factory =
-            (SystemHandlerDelegateFactory) factoryMap.get(factoryName);
-
-        if (factory != null || factoryMap.containsKey(factoryName)) {
-            return factory;
-        } else {
-
-            Class clazz = null;
-            try {
-                ClassLoader loader = currentThread().getContextClassLoader();
-
-                if (loader == null) {
-                    clazz = forName(factoryName);
-                } else {
-                    clazz = loader.loadClass(factoryName);
-                }
-
-                if (clazz != null) {
-                    factory = (SystemHandlerDelegateFactory) clazz.newInstance();
-                }
-            } catch (ClassNotFoundException e) {
-                factory = null;
-                // e.printStackTrace(); //todo:need to add log
-            } catch (Exception x) {
-                throw new WebServiceException(x);
-            } finally {
-                // stores null factory values in map to prevent
-                // repeated class loading and instantiation errors.
-                factoryMap.put(factoryName, factory);
-            }
-        }
-        return factory;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Tie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Tie.java
deleted file mode 100644
index 2649d80..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/Tie.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-/**
- * Entry point to JAXWS server side runtime
- */
-public interface Tie {
-
-    /**
-     * Reads a Web Service request for RuntimeEndpointInfo from WSConnection
-     * and sends a response. Set <code>WebServiceContext</code> with a filled-in
-     * </code>MessageContext</code> on <code>RuntimeEndpointInfo</code> before
-     * calling this.
-     */
-    public void handle(WSConnection con, RuntimeEndpointInfo endpoint)
-    throws Exception;
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WSConnection.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WSConnection.java
deleted file mode 100644
index b103e26..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WSConnection.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * Captures many transports that are used to talk with WS endpoints.
- *
- * For endpoints deployed in light weight http server in J2SE, the implemenation
- * of this class uses HttpTransaction to read from or write to stream.
- *
- * For endpoints deployed in servlet container, the implementation of this
- * class uses HttpServletRequest to read a request, and uses HttpServletResponse
- * to write response.
- *
- * This also works for local transport, JMS transport.
- *
- * Runtime can access to the implementation of this interface using
- * messageInfo.getConnection()
- *
- */
-
-public interface WSConnection {
-
-    public static final int OK=200;
-    public static final int ONEWAY=202;
-    public static final int UNSUPPORTED_MEDIA=415;
-    public static final int MALFORMED_XML=400;
-    public static final int INTERNAL_ERR=500;
-
-    /**
-     * returns transport headers
-     * @return transport headers
-     */
-    public Map<String,List<String>> getHeaders();
-
-    /**
-     * sets transport headers
-     */
-    public void setHeaders(Map<String,List<String>> headers);
-
-    /**
-     * sets the transport status code like <code>OK</code>
-     */
-    public void setStatus(int status);
-
-    /**
-     * @return return the status code
-     */
-    public int getStatus();
-
-    /**
-     * Transport's underlying input stream
-     * @return Transport's underlying input stream
-     */
-    public InputStream getInput();
-
-    /**
-     * Closes transport's input stream
-     */
-    public void closeInput();
-
-    /**
-     * Transport's underlying output stream
-     * @return Transport's underlying output stream
-     */
-    public OutputStream getOutput();
-
-    /**
-     * Closes transport's output stream
-     */
-    public void closeOutput();
-
-    public OutputStream getDebug();
-
-    /**
-     * Closes transport connection
-     */
-    public void close();
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WebServiceContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WebServiceContext.java
deleted file mode 100644
index 0ddec49..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/WebServiceContext.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.spi.runtime;
-
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * Enhanced API WebServiceContext that contains a method to set MessageContext
- */
-public interface WebServiceContext extends javax.xml.ws.WebServiceContext {
-
-    /**
-     * Sets SPI's MessageContext
-     */
-    public void setMessageContext(MessageContext ctxt);
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/package-info.java
deleted file mode 100644
index 0162dbf..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/runtime/package-info.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/**
- *
- * <P>This document describes the SPI for the JAX-WS 2.0 runtime.
- *  Applications can use this SPI to interact with the runtime at
- *  various points to get access to information and to perform
- *  various operations such as security etc.
-*/
-package com.sun.xml.internal.ws.spi.runtime;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/Attributes.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/Attributes.java
index 4128acb..25d77e8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/Attributes.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/Attributes.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java
index 3fd2c85..7ba9542 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,57 +25,98 @@
 
 package com.sun.xml.internal.ws.streaming;
 
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Collections;
-
-import org.w3c.dom.*;
+import com.sun.istack.internal.FinalArrayList;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.XMLStreamException2;
+import com.sun.xml.internal.ws.util.xml.DummyLocation;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 import static org.w3c.dom.Node.*;
-import javax.xml.namespace.QName;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+
 import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
 import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.util.Collections;
+import java.util.Iterator;
 
 /**
+ * Create an {@link XMLStreamReader} on top of a DOM tree.
  *
- * Create an XMLStreamReader on top of a DOM level 2 tree. It a DOM level
+ * <p>
+ * Since various libraries as well as users often create "incorrect" DOM node,
+ * this class spends a lot of efforts making sure that broken DOM trees are
+ * nevertheless interpreted correctly.
+ *
+ * <p>
+ * For example, if a DOM level
  * 1 tree is passed, each method will attempt to return the correct value
- * by using <code>getNodeName()</code>.
+ * by using {@link Node#getNodeName()}.
+ *
+ * <p>
+ * Similarly, if DOM is missing explicit namespace declarations,
+ * this class attempts to emulate necessary declarations.
+ *
  *
  * @author Santiago.PericasGeertsen@sun.com
+ * @author Kohsuke Kawaguchi
  */
-public class DOMStreamReader implements XMLStreamReader, NamespaceContext {
+public final class DOMStreamReader implements XMLStreamReader, NamespaceContext {
 
     /**
      * Current DOM node being traversed.
      */
-    Node _current;
+    private Node _current;
 
     /**
      * Starting node of the subtree being traversed.
      */
-    Node _start;
+    private Node _start;
 
     /**
      * Named mapping for attributes and NS decls for the current node.
      */
-    NamedNodeMap _namedNodeMap;
+    private NamedNodeMap _namedNodeMap;
+
+    /**
+     * If the reader points at {@link #CHARACTERS the text node},
+     * its whole value.
+     *
+     * <p>
+     * This is simply a cache of {@link Text#getWholeText()} of {@link #_current},
+     * but when a large binary data sent as base64 text, this could get very much
+     * non-trivial.
+     */
+    private String wholeText;
 
     /**
      * List of attributes extracted from <code>_namedNodeMap</code>.
      */
-    List<Attr> _currentAttributes = new ArrayList<Attr>();
+    private final FinalArrayList<Attr> _currentAttributes = new FinalArrayList<Attr>();
 
     /**
-     * List of namespace declarations extracted from <code>_namedNodeMap</code>
+     * {@link Scope} buffer.
      */
-    List<Attr> _currentNamespaces = new ArrayList<Attr>();
+    private Scope[] scopes = new Scope[8];
 
     /**
-     * Flag indicating if <code>_namedNodeMap</code> is already split into
-     * <code>_currentAttributes</code> and <code>_currentNamespaces</code>
+     * Depth of the current element. The first element gets depth==0.
+     * Also used as the index to {@link #scopes}.
+     */
+    private int depth = 0;
+
+    /**
+     * Flag indicating if {@link #_namedNodeMap} is already split into
+     * {@link #_currentAttributes} and {@link Scope#currentNamespaces}.
      */
     boolean _needAttributesSplit;
 
@@ -86,25 +127,106 @@
     int _state;
 
     /**
-     * Dummy Location instance returned in <code>getLocation</code>.
+     * Namespace declarations on one element.
+     *
+     * Instances are reused.
      */
-    private static Location dummyLocation = new Location() {
-        public int getCharacterOffset() {
-            return -1;
+    private static final class Scope {
+        /**
+         * Scope for the parent element.
+         */
+        final Scope parent;
+
+        /**
+         * List of namespace declarations extracted from <code>_namedNodeMap</code>
+         */
+        final FinalArrayList<Attr> currentNamespaces = new FinalArrayList<Attr>();
+
+        /**
+         * Additional namespace declarations obtained as a result of "fixing" DOM tree,
+         * which were not part of the original DOM tree.
+         *
+         * One entry occupies two spaces (prefix followed by URI.)
+         */
+        final FinalArrayList<String> additionalNamespaces = new FinalArrayList<String>();
+
+        Scope(Scope parent) {
+            this.parent = parent;
         }
-        public int getColumnNumber() {
-            return -1;
+
+        void reset() {
+            currentNamespaces.clear();
+            additionalNamespaces.clear();
         }
-        public int getLineNumber() {
-            return -1;
+
+        int getNamespaceCount() {
+            return currentNamespaces.size()+additionalNamespaces.size()/2;
         }
-        public String getPublicId() {
+
+        String getNamespacePrefix(int index) {
+            int sz = currentNamespaces.size();
+            if(index< sz) {
+                Attr attr = currentNamespaces.get(index);
+                String result = attr.getLocalName();
+                if (result == null) {
+                    result = QName.valueOf(attr.getNodeName()).getLocalPart();
+                }
+                return result.equals("xmlns") ? null : result;
+            } else {
+                return additionalNamespaces.get((index-sz)*2);
+            }
+        }
+
+        String getNamespaceURI(int index) {
+            int sz = currentNamespaces.size();
+            if(index< sz) {
+                return currentNamespaces.get(index).getValue();
+            } else {
+                return additionalNamespaces.get((index-sz)*2+1);
+            }
+        }
+
+        /**
+         * Returns the prefix bound to the given URI, or null.
+         * This method recurses to the parent.
+         */
+        String getPrefix(String nsUri) {
+            for( Scope sp=this; sp!=null; sp=sp.parent ) {
+                for( int i=sp.currentNamespaces.size()-1; i>=0; i--) {
+                    String result = getPrefixForAttr(sp.currentNamespaces.get(i),nsUri);
+                    if(result!=null)
+                        return result;
+                }
+                for( int i=sp.additionalNamespaces.size()-2; i>=0; i-=2 )
+                    if(sp.additionalNamespaces.get(i+1).equals(nsUri))
+                        return sp.additionalNamespaces.get(i);
+            }
             return null;
         }
-        public String getSystemId() {
+
+        /**
+         * Returns the namespace URI bound by the given prefix.
+         *
+         * @param prefix
+         *      Prefix to look up.
+         */
+        String getNamespaceURI(@NotNull String prefix) {
+            String nsDeclName = prefix.length()==0 ? "xmlns" : "xmlns:"+prefix;
+
+            for( Scope sp=this; sp!=null; sp=sp.parent ) {
+                for( int i=sp.currentNamespaces.size()-1; i>=0; i--) {
+                    Attr a = sp.currentNamespaces.get(i);
+                    if(a.getNodeName().equals(nsDeclName))
+                        return a.getValue();
+                }
+                for( int i=sp.additionalNamespaces.size()-2; i>=0; i-=2 )
+                    if(sp.additionalNamespaces.get(i).equals(prefix))
+                        return sp.additionalNamespaces.get(i+1);
+            }
             return null;
         }
-    };
+    }
+
 
     public DOMStreamReader() {
     }
@@ -114,22 +236,31 @@
     }
 
     public void setCurrentNode(Node node) {
+        scopes[0] = new Scope(null);
+        depth=0;
+
         _start = _current = node;
         _state = START_DOCUMENT;
         // verifyDOMIntegrity(node);
         // displayDOM(node, System.out);
     }
 
-    public void close() throws javax.xml.stream.XMLStreamException {
+    public void close() throws XMLStreamException {
     }
 
-
+    /**
+     * Called when the current node is {@link Element} to look at attribute list
+     * (which contains both ns decl and attributes in DOM) and split them
+     * to attributes-proper and namespace decls.
+     */
     private void splitAttributes() {
         if (!_needAttributesSplit) return;
+        _needAttributesSplit = false;
 
         // Clear attribute and namespace lists
         _currentAttributes.clear();
-        _currentNamespaces.clear();
+
+        Scope scope = allocateScope();
 
         _namedNodeMap = _current.getAttributes();
         if (_namedNodeMap != null) {
@@ -138,14 +269,71 @@
                 final Attr attr = (Attr) _namedNodeMap.item(i);
                 final String attrName = attr.getNodeName();
                 if (attrName.startsWith("xmlns:") || attrName.equals("xmlns")) {     // NS decl?
-                    _currentNamespaces.add(attr);
+                    scope.currentNamespaces.add(attr);
                 }
                 else {
                     _currentAttributes.add(attr);
                 }
             }
         }
-        _needAttributesSplit = false;
+
+        // verify that all the namespaces used in element and attributes are indeed available
+        ensureNs(_current);
+        for( int i=_currentAttributes.size()-1; i>=0; i-- ) {
+            Attr a = _currentAttributes.get(i);
+            ensureNs(a);
+        }
+    }
+
+    /**
+     * Sub-routine of {@link #splitAttributes()}.
+     *
+     * <p>
+     * Makes sure that the namespace URI/prefix used in the given node is available,
+     * and if not, declare it on the current scope to "fix" it.
+     *
+     * It's often common to create DOM trees without putting namespace declarations,
+     * and this makes sure that such DOM tree will be properly marshalled.
+     */
+    private void ensureNs(Node n) {
+        String prefix = fixNull(n.getPrefix());
+        String uri = fixNull(n.getNamespaceURI());
+
+        Scope scope = scopes[depth];
+
+        String currentUri = scope.getNamespaceURI(prefix);
+
+        if(prefix.length()==0) {
+            currentUri = fixNull(currentUri);
+            if(currentUri.equals(uri))
+                return; // declared correctly
+        } else {
+            if(currentUri!=null && currentUri.equals(uri))
+                return; // declared correctly
+        }
+
+        // needs to be declared
+
+        scope.additionalNamespaces.add(prefix);
+        scope.additionalNamespaces.add(uri);
+    }
+
+    /**
+     * Allocate new {@link Scope} for {@link #splitAttributes()}.
+     */
+    private Scope allocateScope() {
+        if(scopes.length==depth) {
+            Scope[] newBuf = new Scope[scopes.length*2];
+            System.arraycopy(scopes,0,newBuf,0,scopes.length);
+            scopes = newBuf;
+        }
+        Scope scope = scopes[depth];
+        if(scope==null) {
+            scope = scopes[depth] = new Scope(scopes[depth-1]);
+        } else {
+            scope.reset();
+        }
+        return scope;
     }
 
     public int getAttributeCount() {
@@ -182,8 +370,7 @@
             if (localName != null) {
                 String prefix = attr.getPrefix();
                 String uri = attr.getNamespaceURI();
-                return new QName(uri != null ? uri : "", localName,
-                    prefix != null ? prefix : "");
+                return new QName(fixNull(uri), localName, fixNull(prefix));
             }
             else {
                 return QName.valueOf(attr.getNodeName());
@@ -196,7 +383,7 @@
         if (_state == START_ELEMENT) {
             splitAttributes();
             String uri = _currentAttributes.get(index).getNamespaceURI();
-            return uri != null ? uri : "";
+            return fixNull(uri);
         }
         throw new IllegalStateException("DOMStreamReader: getAttributeNamespace() called in illegal state");
     }
@@ -205,7 +392,7 @@
         if (_state == START_ELEMENT) {
             splitAttributes();
             String prefix = _currentAttributes.get(index).getPrefix();
-            return prefix != null ? prefix : "";
+            return fixNull(prefix);
         }
         throw new IllegalStateException("DOMStreamReader: getAttributePrefix() called in illegal state");
     }
@@ -268,8 +455,8 @@
         throw new IllegalStateException("DOMStreamReader: getAttributeValue() called in illegal state");
     }
 
-    public javax.xml.stream.Location getLocation() {
-        return dummyLocation;
+    public Location getLocation() {
+        return DummyLocation.INSTANCE;
     }
 
     /**
@@ -281,8 +468,7 @@
             if (localName != null) {
                 String prefix = _current.getPrefix();
                 String uri = _current.getNamespaceURI();
-                return new QName(uri != null ? uri : "", localName,
-                    prefix != null ? prefix : "");
+                return new QName(fixNull(uri), localName, fixNull(prefix));
             }
             else {
                 return QName.valueOf(_current.getNodeName());
@@ -295,44 +481,40 @@
         return this;
     }
 
-    public int getNamespaceCount() {
+    /**
+     * Verifies the current state to see if we can return the scope, and do so
+     * if appropriate.
+     *
+     * Used to implement a bunch of StAX API methods that have the same usage restriction.
+     */
+    private Scope getCheckedScope() {
         if (_state == START_ELEMENT || _state == END_ELEMENT) {
             splitAttributes();
-            return _currentNamespaces.size();
+            return scopes[depth];
         }
-        throw new IllegalStateException("DOMStreamReader: getNamespaceCount() called in illegal state");
+        throw new IllegalStateException("DOMStreamReader: neither on START_ELEMENT nor END_ELEMENT");
+    }
+
+    public int getNamespaceCount() {
+        return getCheckedScope().getNamespaceCount();
     }
 
     public String getNamespacePrefix(int index) {
-        if (_state == START_ELEMENT || _state == END_ELEMENT) {
-            splitAttributes();
+        return getCheckedScope().getNamespacePrefix(index);
+    }
 
-            Attr attr = _currentNamespaces.get(index);
-            String result = attr.getLocalName();
-            if (result == null) {
-                result = QName.valueOf(attr.getNodeName()).getLocalPart();
-            }
-            return result.equals("xmlns") ? null : result;
-        }
-        throw new IllegalStateException("DOMStreamReader: getNamespacePrefix() called in illegal state");
+    public String getNamespaceURI(int index) {
+        return getCheckedScope().getNamespaceURI(index);
     }
 
     public String getNamespaceURI() {
         if (_state == START_ELEMENT || _state == END_ELEMENT) {
             String uri = _current.getNamespaceURI();
-            return uri != null ? uri : "";
+            return fixNull(uri);
         }
         return null;
     }
 
-    public String getNamespaceURI(int index) {
-        if (_state == START_ELEMENT || _state == END_ELEMENT) {
-            splitAttributes();
-            return _currentNamespaces.get(index).getValue();
-        }
-        throw new IllegalStateException("DOMStreamReader: getNamespaceURI(int) called in illegal state");
-    }
-
     /**
      * This method is not particularly fast, but shouldn't be called very
      * often. If we start to use it more, we should keep track of the
@@ -348,30 +530,24 @@
         else if (prefix.equals("xmlns")) {
             return "http://www.w3.org/2000/xmlns/";
         }
-        else {
-            int type;
 
-            // Find nearest element node
-            Node node = _current;
-            while ((type = node.getNodeType()) != DOCUMENT_NODE
-                    && type != ELEMENT_NODE) {
-                node = node.getParentNode();
-            }
+        // check scopes
+        splitAttributes();
+        String nsUri = scopes[depth].getNamespaceURI(prefix);
+        if(nsUri!=null)    return nsUri;
 
-            boolean isDefault = (prefix.length() == 0);
-
-            while (node.getNodeType() != DOCUMENT_NODE) {
-                // Is ns declaration on this element?
-                NamedNodeMap namedNodeMap = node.getAttributes();
-                Attr attr = isDefault ? (Attr) namedNodeMap.getNamedItem("xmlns") :
-                                        (Attr) namedNodeMap.getNamedItem("xmlns:" + prefix);
-                if (attr != null) {
-                    return attr.getValue();
-                }
-                node = node.getParentNode();
-            }
-            return null;
+        // then ancestors above start node
+        Node node = findRootElement();
+        String nsDeclName = prefix.length()==0 ? "xmlns" : "xmlns:"+prefix;
+        while (node.getNodeType() != DOCUMENT_NODE) {
+            // Is ns declaration on this element?
+            NamedNodeMap namedNodeMap = node.getAttributes();
+            Attr attr = (Attr) namedNodeMap.getNamedItem(nsDeclName);
+            if (attr != null)
+                return attr.getValue();
+            node = node.getParentNode();
         }
+        return null;
     }
 
     public String getPrefix(String nsUri) {
@@ -384,37 +560,61 @@
         else if (nsUri.equals("http://www.w3.org/2000/xmlns/")) {
             return "xmlns";
         }
-        else {
-            int type;
 
-            // Find nearest element node
-            Node node = _current;
-            while ((type = node.getNodeType()) != DOCUMENT_NODE
-                    && type != ELEMENT_NODE) {
-                node = node.getParentNode();
+        // check scopes
+        splitAttributes();
+        String prefix = scopes[depth].getPrefix(nsUri);
+        if(prefix!=null)    return prefix;
+
+        // then ancestors above start node
+        Node node = findRootElement();
+
+        while (node.getNodeType() != DOCUMENT_NODE) {
+            // Is ns declaration on this element?
+            NamedNodeMap namedNodeMap = node.getAttributes();
+            for( int i=namedNodeMap.getLength()-1; i>=0; i-- ) {
+                Attr attr = (Attr)namedNodeMap.item(i);
+                prefix = getPrefixForAttr(attr,nsUri);
+                if(prefix!=null)
+                    return prefix;
             }
-
-            while (node.getNodeType() != DOCUMENT_NODE) {
-                // Is ns declaration on this element?
-                NamedNodeMap namedNodeMap = node.getAttributes();
-                for( int i=namedNodeMap.getLength()-1; i>=0; i-- ) {
-                    Attr attr = (Attr)namedNodeMap.item(i);
-
-                    String attrName = attr.getNodeName();
-                    if (attrName.startsWith("xmlns:") || attrName.equals("xmlns")) {     // NS decl?
-                        if(attr.getValue().equals(nsUri)) {
-                            if(attrName.equals("xmlns"))
-                                return "";
-                            String localName = attr.getLocalName();
-                            return (localName != null) ? localName :
-                                QName.valueOf(attrName).getLocalPart();
-                        }
-                    }
-                }
-                node = node.getParentNode();
-            }
-            return null;
+            node = node.getParentNode();
         }
+        return null;
+    }
+
+    /**
+     * Finds the root element node of the traversal.
+     */
+    private Node findRootElement() {
+        int type;
+
+        Node node = _start;
+        while ((type = node.getNodeType()) != DOCUMENT_NODE
+                && type != ELEMENT_NODE) {
+            node = node.getParentNode();
+        }
+        return node;
+    }
+
+    /**
+     * If the given attribute is a namespace declaration for the given namespace URI,
+     * return its prefix. Otherwise null.
+     */
+    private static String getPrefixForAttr(Attr attr, String nsUri) {
+        String attrName = attr.getNodeName();
+        if (!attrName.startsWith("xmlns:") && !attrName.equals("xmlns"))
+            return null;    // not nsdecl
+
+        if(attr.getValue().equals(nsUri)) {
+            if(attrName.equals("xmlns"))
+                return "";
+            String localName = attr.getLocalName();
+            return (localName != null) ? localName :
+                QName.valueOf(attrName).getLocalPart();
+        }
+
+        return null;
     }
 
     public Iterator getPrefixes(String nsUri) {
@@ -442,7 +642,7 @@
     public String getPrefix() {
         if (_state == START_ELEMENT || _state == END_ELEMENT) {
             String prefix = _current.getPrefix();
-            return prefix != null ? prefix : "";
+            return fixNull(prefix);
         }
         return null;
     }
@@ -452,10 +652,10 @@
     }
 
     public String getText() {
-        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT ||
-                _state == ENTITY_REFERENCE) {
+        if (_state == CHARACTERS)
+            return wholeText;
+        if(_state == CDATA || _state == COMMENT || _state == ENTITY_REFERENCE)
             return _current.getNodeValue();
-        }
         throw new IllegalStateException("DOMStreamReader: getTextLength() called in illegal state");
     }
 
@@ -464,24 +664,20 @@
     }
 
     public int getTextCharacters(int sourceStart, char[] target, int targetStart,
-                                 int targetLength) throws javax.xml.stream.XMLStreamException
-    {
-        char[] text = getTextCharacters();
-        System.arraycopy(text, sourceStart, target, targetStart, targetLength);
-        return Math.min(targetLength, text.length - sourceStart);
+                                 int targetLength) throws XMLStreamException {
+        String text = getText();
+        int copiedSize = Math.min(targetLength, text.length() - sourceStart);
+        text.getChars(sourceStart, sourceStart + copiedSize, target, targetStart);
+
+        return copiedSize;
     }
 
     public int getTextLength() {
-        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT ||
-                _state == ENTITY_REFERENCE) {
-            return _current.getNodeValue().length();
-        }
-        throw new IllegalStateException("DOMStreamReader: getTextLength() called in illegal state");
+        return getText().length();
     }
 
     public int getTextStart() {
-        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT ||
-                _state == ENTITY_REFERENCE) {
+        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT || _state == ENTITY_REFERENCE) {
             return 0;
         }
         throw new IllegalStateException("DOMStreamReader: getTextStart() called in illegal state");
@@ -500,9 +696,8 @@
     }
 
     public boolean hasText() {
-        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT ||
-                _state == ENTITY_REFERENCE) {
-            return (_current.getNodeValue().trim().length() > 0);
+        if (_state == CHARACTERS || _state == CDATA || _state == COMMENT || _state == ENTITY_REFERENCE) {
+            return getText().trim().length() > 0;
         }
         return false;
     }
@@ -528,10 +723,8 @@
     }
 
     public boolean isWhiteSpace() {
-        final int nodeType = _current.getNodeType();
-        if (nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE) {
-            return (_current.getNodeValue().trim().length() == 0);
-        }
+        if (_state == CHARACTERS || _state == CDATA)
+            return getText().trim().length()==0;
         return false;
     }
 
@@ -558,7 +751,25 @@
         }
     }
 
-    public int next() throws javax.xml.stream.XMLStreamException {
+    public int next() throws XMLStreamException {
+        while(true) {
+            int r = _next();
+            if(r!=CHARACTERS)   return r;
+
+            // if we are currently at text node, make sure that this is a meaningful text node.
+            Node prev = _current.getPreviousSibling();
+            if(prev!=null && prev.getNodeType()==Node.TEXT_NODE)
+                continue;   // nope. this is just a continuation of previous text that should be invisible
+
+            Text t = (Text)_current;
+            wholeText = t.getWholeText();
+            if(wholeText.length()==0)
+                continue;   // nope. this is empty text.
+            return CHARACTERS;
+        }
+    }
+
+    private int _next() throws XMLStreamException {
         Node child;
 
         // Indicate that attributes still need processing
@@ -582,11 +793,7 @@
                     return (_state = mapNodeTypeToState(_current.getNodeType()));
                 }
             case START_ELEMENT:
-                /*
-                 * SAAJ tree may contain multiple adjacent text nodes.  Normalization
-                 * is very expensive, so we should think about changing SAAJ instead!
-                 */
-                _current.normalize();
+                depth++;
 
                 child = _current.getFirstChild();
                 if (child == null) {
@@ -596,12 +803,14 @@
                     _current = child;
                     return (_state = mapNodeTypeToState(_current.getNodeType()));
                 }
+            case END_ELEMENT:
+                depth--;
+                // fall through next
             case CHARACTERS:
             case COMMENT:
             case CDATA:
             case ENTITY_REFERENCE:
             case PROCESSING_INSTRUCTION:
-            case END_ELEMENT:
                 // If at the end of this fragment, then terminate traversal
                 if (_current == _start) {
                     return (_state = END_DOCUMENT);
@@ -638,7 +847,7 @@
             eventType = next();
         }
         if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
-            throw new XMLStreamException("DOMStreamReader: Expected start or end tag");
+            throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
         }
         return eventType;
     }
@@ -647,13 +856,13 @@
         throws javax.xml.stream.XMLStreamException
     {
         if (type != _state) {
-            throw new XMLStreamException("DOMStreamReader: Required event type not found");
+            throw new XMLStreamException2("DOMStreamReader: Required event type not found");
         }
         if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
-            throw new XMLStreamException("DOMStreamReader: Required namespaceURI not found");
+            throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
         }
         if (localName != null && !localName.equals(getLocalName())) {
-            throw new XMLStreamException("DOMStreamReader: Required localName not found");
+            throw new XMLStreamException2("DOMStreamReader: Required localName not found");
         }
     }
 
@@ -668,9 +877,8 @@
     private static void displayDOM(Node node, java.io.OutputStream ostream) {
         try {
             System.out.println("\n====\n");
-            javax.xml.transform.TransformerFactory.newInstance().newTransformer().transform(
-                new javax.xml.transform.dom.DOMSource(node),
-                new javax.xml.transform.stream.StreamResult(ostream));
+            XmlUtil.newTransformer().transform(
+                new DOMSource(node), new StreamResult(ostream));
             System.out.println("\n====\n");
         }
         catch (Exception e) {
@@ -694,7 +902,7 @@
 
                 if (node.getNodeType() == ATTRIBUTE_NODE) return;
 
-                NamedNodeMap attrs = ((Element) node).getAttributes();
+                NamedNodeMap attrs = node.getAttributes();
                 for (int i = 0; i < attrs.getLength(); i++) {
                     verifyDOMIntegrity(attrs.item(i));
                 }
@@ -706,21 +914,9 @@
         }
     }
 
-    static public void main(String[] args) throws Exception {
-        String sample = "<?xml version='1.0' encoding='UTF-8'?><env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Internal server error</faultstring></env:Fault></env:Body></env:Envelope>";
-        javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
-        dbf.setNamespaceAware(true);
-        javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
-        Document dd = db.parse(new java.io.ByteArrayInputStream(sample.getBytes("UTF-8")));
 
-        DOMStreamReader dsr = new DOMStreamReader(dd);
-        while (dsr.hasNext()) {
-            System.out.println("dsr.next() = " + dsr.next());
-            if (dsr.getEventType() == START_ELEMENT || dsr.getEventType() == END_ELEMENT) {
-                System.out.println("dsr.getName = " + dsr.getName());
-                if (dsr.getEventType() == START_ELEMENT)
-                    System.out.println("dsr.getAttributeCount() = " + dsr.getAttributeCount());
-            }
-        }
+    private static String fixNull(String s) {
+        if(s==null) return "";
+        else        return s;
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java
index cafcc63..29d9ea7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactory.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java
index 31103b3..138ebe4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/PrefixFactoryImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java
index 49af586..40b02b6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,22 @@
 
 package com.sun.xml.internal.ws.streaming;
 
-import com.sun.xml.internal.ws.util.FastInfosetReflection;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.util.FastInfosetUtil;
 import com.sun.xml.internal.ws.util.xml.XmlUtil;
 
-import java.io.Reader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
+import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
-import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-import javax.xml.stream.XMLStreamReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Method;
+import java.net.URL;
 
 /**
  * @author Santiago.PericasGeertsen@sun.com
@@ -46,20 +48,33 @@
 public class SourceReaderFactory {
 
     /**
-     * Thread variable used to store DOMStreamReader for current thread.
+     * FI FastInfosetSource class.
      */
-    static ThreadLocal<DOMStreamReader> domStreamReader =
-        new ThreadLocal<DOMStreamReader>();
+    static Class fastInfosetSourceClass;
 
-    public static XMLStreamReader createSourceReader(Source source,
-        boolean rejectDTDs)
-    {
+    /**
+     * FI <code>StAXDocumentSerializer.setEncoding()</code> method via reflection.
+     */
+    static Method fastInfosetSource_getInputStream;
+
+    static {
+        // Use reflection to avoid static dependency with FI jar
+        try {
+            fastInfosetSourceClass =
+                Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
+            fastInfosetSource_getInputStream =
+                fastInfosetSourceClass.getMethod("getInputStream");
+        }
+        catch (Exception e) {
+            fastInfosetSourceClass = null;
+        }
+    }
+
+    public static XMLStreamReader createSourceReader(Source source, boolean rejectDTDs) {
         return createSourceReader(source, rejectDTDs, null);
     }
 
-    public static XMLStreamReader createSourceReader(Source source,
-        boolean rejectDTDs, String charsetName)
-    {
+    public static XMLStreamReader createSourceReader(Source source, boolean rejectDTDs, String charsetName) {
         try {
             if (source instanceof StreamSource) {
                 StreamSource streamSource = (StreamSource) source;
@@ -68,35 +83,32 @@
                 if (is != null) {
                     // Wrap input stream in Reader if charset is specified
                     if (charsetName != null) {
-                        return XMLStreamReaderFactory.createXMLStreamReader(
-                            new InputStreamReader(is, charsetName), rejectDTDs);
+                        return XMLStreamReaderFactory.create(
+                            source.getSystemId(), new InputStreamReader(is, charsetName), rejectDTDs);
                     }
                     else {
-                        return XMLStreamReaderFactory.createXMLStreamReader(is,
-                            rejectDTDs);
+                        return XMLStreamReaderFactory.create(
+                            source.getSystemId(), is, rejectDTDs);
                     }
                 }
                 else {
                     Reader reader = streamSource.getReader();
                     if (reader != null) {
-                        return XMLStreamReaderFactory.createXMLStreamReader(reader,
-                            rejectDTDs);
+                        return XMLStreamReaderFactory.create(
+                            source.getSystemId(), reader, rejectDTDs);
                     }
                     else {
-                        throw new XMLReaderException("sourceReader.invalidSource",
-                            new Object[] { source.getClass().getName() });
+                        return XMLStreamReaderFactory.create(
+                            source.getSystemId(), new URL(source.getSystemId()).openStream(), rejectDTDs );
                     }
                 }
             }
-            else if (FastInfosetReflection.isFastInfosetSource(source)) {
-                return XMLStreamReaderFactory.createFIStreamReader((InputStream)
-                    FastInfosetReflection.FastInfosetSource_getInputStream(source));
+            else if (source.getClass() == fastInfosetSourceClass) {
+                return FastInfosetUtil.createFIStreamReader((InputStream)
+                    fastInfosetSource_getInputStream.invoke(source));
             }
             else if (source instanceof DOMSource) {
-                DOMStreamReader dsr = domStreamReader.get();
-                if (dsr == null) {
-                    domStreamReader.set(dsr = new DOMStreamReader());
-                }
+                DOMStreamReader dsr =  new DOMStreamReader();
                 dsr.setCurrentNode(((DOMSource) source).getNode());
                 return dsr;
             }
@@ -111,7 +123,7 @@
             }
             else {
                 throw new XMLReaderException("sourceReader.invalidSource",
-                    new Object[] { source.getClass().getName() });
+                        source.getClass().getName());
             }
         }
         catch (Exception e) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java
index bf638c8..01ee1e1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/TidyXMLStreamReader.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,213 +25,37 @@
 
 package com.sun.xml.internal.ws.streaming;
 
-import javax.xml.stream.XMLStreamReader;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter;
+
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.Location;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.WebServiceException;
 import java.io.Closeable;
 import java.io.IOException;
 
 /**
- * Wrapper over XMLStreamReader. It will be used primarily to cleaup the resources such as closure on InputStream/Reader.
+ * Wrapper over XMLStreamReader. It will be used primarily to
+ * clean up the resources such as closure on InputStream/Reader.
  *
  * @author Vivek Pandey
  */
-public class TidyXMLStreamReader implements XMLStreamReader{
-    private final XMLStreamReader reader;
+public class TidyXMLStreamReader extends XMLStreamReaderFilter {
     private final Closeable closeableSource;
 
-    public TidyXMLStreamReader(XMLStreamReader reader, Closeable closeableSource) {
-        this.reader = reader;
+    public TidyXMLStreamReader(@NotNull XMLStreamReader reader, @Nullable Closeable closeableSource) {
+        super(reader);
         this.closeableSource = closeableSource;
     }
 
-    public int getAttributeCount() {
-        return reader.getAttributeCount();
-    }
-
-    public int getEventType() {
-        return reader.getEventType();
-    }
-
-    public int getNamespaceCount() {
-        return reader.getNamespaceCount();
-    }
-
-    public int getTextLength() {
-        return reader.getTextLength();
-    }
-
-    public int getTextStart() {
-        return reader.getTextStart();
-    }
-
-    public int next() throws XMLStreamException {
-        return reader.next();
-    }
-
-    public int nextTag() throws XMLStreamException {
-        return reader.nextTag();
-    }
-
     public void close() throws XMLStreamException {
-        reader.close();
+        super.close();
         try {
-            closeableSource.close();
+            if(closeableSource != null)
+                closeableSource.close();
         } catch (IOException e) {
             throw new WebServiceException(e);
         }
     }
-
-    public boolean hasName() {
-        return reader.hasName();
-    }
-
-    public boolean hasNext() throws XMLStreamException {
-        return reader.hasNext();
-    }
-
-    public boolean hasText() {
-        return reader.hasText();
-    }
-
-    public boolean isCharacters() {
-        return reader.isCharacters();
-    }
-
-    public boolean isEndElement() {
-        return reader.isEndElement();
-    }
-
-    public boolean isStandalone() {
-        return reader.isStandalone();
-    }
-
-    public boolean isStartElement() {
-        return reader.isStartElement();
-    }
-
-    public boolean isWhiteSpace() {
-        return reader.isWhiteSpace();
-    }
-
-    public boolean standaloneSet() {
-        return reader.standaloneSet();
-    }
-
-    public char[] getTextCharacters() {
-        return reader.getTextCharacters();
-    }
-
-    public boolean isAttributeSpecified(int i) {
-        return reader.isAttributeSpecified(i);
-    }
-
-    public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
-        return reader.getTextCharacters(i, chars, i1, i2);
-    }
-
-    public String getCharacterEncodingScheme() {
-        return reader.getCharacterEncodingScheme();
-    }
-
-    public String getElementText() throws XMLStreamException {
-        return reader.getElementText();
-    }
-
-    public String getEncoding() {
-        return reader.getEncoding();
-    }
-
-    public String getLocalName() {
-        return reader.getLocalName();
-    }
-
-    public String getNamespaceURI() {
-        return reader.getNamespaceURI();
-    }
-
-    public String getPIData() {
-        return reader.getPIData();
-    }
-
-    public String getPITarget() {
-        return reader.getPITarget();
-    }
-
-    public String getPrefix() {
-        return reader.getPrefix();
-    }
-
-    public String getText() {
-        return reader.getText();
-    }
-
-    public String getVersion() {
-        return reader.getVersion();
-    }
-
-    public String getAttributeLocalName(int i) {
-        return reader.getAttributeLocalName(i);
-    }
-
-    public String getAttributeNamespace(int i) {
-        return reader.getAttributeNamespace(i);
-    }
-
-    public String getAttributePrefix(int i) {
-        return reader.getAttributePrefix(i);
-    }
-
-    public String getAttributeType(int i) {
-        return reader.getAttributeType(i);
-    }
-
-    public String getAttributeValue(int i) {
-        return reader.getAttributeValue(i);
-    }
-
-    public String getNamespacePrefix(int i) {
-        return reader.getNamespacePrefix(i);
-    }
-
-    public String getNamespaceURI(int i) {
-        return reader.getNamespaceURI(i);
-    }
-
-    public NamespaceContext getNamespaceContext() {
-        return reader.getNamespaceContext();
-    }
-
-    public QName getName() {
-        return reader.getName();
-    }
-
-    public QName getAttributeName(int i) {
-        return reader.getAttributeName(i);
-    }
-
-    public Location getLocation() {
-        return reader.getLocation();
-    }
-
-    public Object getProperty(String s) throws IllegalArgumentException {
-        return reader.getProperty(s);
-    }
-
-    public void require(int i, String s, String s1) throws XMLStreamException {
-        reader.require(i, s, s1);
-    }
-
-    public String getNamespaceURI(String s) {
-        return reader.getNamespaceURI(s);
-    }
-
-    public String getAttributeValue(String s, String s1) {
-        return reader.getAttributeValue(s, s1);
-    }
-
-
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReader.java
index aa24b76..4cdd3ac 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReader.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReader.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
 
 package com.sun.xml.internal.ws.streaming;
 
+import org.xml.sax.helpers.XMLReaderFactory;
+
 import java.util.Iterator;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java
index 449ae13..e077dda 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
         super("xmlreader.nestedError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.streaming";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java
index ce51423..f37f95d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("xmlreader.nestedError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.streaming";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderFactory.java
deleted file mode 100644
index 713af62..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderFactory.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.streaming;
-
-import org.xml.sax.InputSource;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import com.sun.xml.internal.ws.util.SunStAXReflection;
-import com.sun.xml.internal.ws.util.FastInfosetReflection;
-
-/**
- * <p>A factory to create XML and FI parsers.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- */
-public class XMLStreamReaderFactory {
-
-    /**
-     * StAX input factory shared by all threads.
-     */
-    static XMLInputFactory xmlInputFactory;
-
-    /**
-     * FI stream reader for each thread.
-     */
-    static ThreadLocal fiStreamReader = new ThreadLocal();
-
-    /**
-     * Zephyr's stream reader for each thread.
-     */
-    static ThreadLocal xmlStreamReader = new ThreadLocal();
-
-    static {
-        // Use StAX pluggability layer to get factory instance
-        xmlInputFactory = XMLInputFactory.newInstance();
-        xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
-
-        try {
-            // Turn OFF internal factory caching in Zephyr -- not thread safe
-            xmlInputFactory.setProperty("reuse-instance", Boolean.FALSE);
-        }
-        catch (IllegalArgumentException e) {
-            // falls through
-        }
-    }
-
-    // -- XML ------------------------------------------------------------
-
-    /**
-     * Returns a fresh StAX parser created from an InputSource. Use this
-     * method when concurrent instances are needed within a single thread.
-     *
-     * TODO: Reject DTDs?
-     */
-    public static XMLStreamReader createFreshXMLStreamReader(InputSource source,
-        boolean rejectDTDs) {
-        try {
-            synchronized (xmlInputFactory) {
-                // Char stream available?
-                if (source.getCharacterStream() != null) {
-                    return xmlInputFactory.createXMLStreamReader(
-                        source.getSystemId(), source.getCharacterStream());
-                }
-
-                // Byte stream available?
-                if (source.getByteStream() != null) {
-                    return xmlInputFactory.createXMLStreamReader(
-                        source.getSystemId(), source.getByteStream());
-                }
-
-                // Otherwise, open URI
-                return xmlInputFactory.createXMLStreamReader(source.getSystemId(),
-                    new URL(source.getSystemId()).openStream());
-            }
-        }
-        catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-    /**
-     * This factory method would be used for example when caller wants to close the stream.
-     */
-    public static XMLStreamReader createFreshXMLStreamReader(String systemId, InputStream stream) {
-        try {
-            synchronized (xmlInputFactory) {
-                // Otherwise, open URI
-                return xmlInputFactory.createXMLStreamReader(systemId,
-                    stream);
-            }
-        }
-        catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-    /**
-     * This factory method would be used for example when caller wants to close the stream.
-     */
-    public static XMLStreamReader createFreshXMLStreamReader(String systemId, Reader reader) {
-        try {
-            synchronized (xmlInputFactory) {
-                // Otherwise, open URI
-                return xmlInputFactory.createXMLStreamReader(systemId,
-                    reader);
-            }
-        }
-        catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-
-
-    /**
-     * Returns a StAX parser from an InputStream.
-     *
-     * TODO: Reject DTDs?
-     */
-    public static XMLStreamReader createXMLStreamReader(InputStream in,
-        boolean rejectDTDs) {
-        return createXMLStreamReader(null, in, rejectDTDs);
-    }
-
-    /**
-     * Returns a StAX parser from an InputStream. Attemps to re-use parsers if
-     * underlying representation is Zephyr.
-     *
-     * TODO: Reject DTDs?
-     */
-    public static XMLStreamReader createXMLStreamReader(String systemId,
-        InputStream in, boolean rejectDTDs) {
-        try {
-            // If using Zephyr, try re-using the last instance
-            if (SunStAXReflection.XMLReaderImpl_setInputSource != null) {
-                Object xsr = xmlStreamReader.get();
-                if (xsr == null) {
-                    synchronized (xmlInputFactory) {
-                        xmlStreamReader.set(
-                            xsr = xmlInputFactory.createXMLStreamReader(systemId, in));
-                    }
-                }
-                else {
-                    SunStAXReflection.XMLReaderImpl_reset.invoke(xsr);
-                    InputSource inputSource = new InputSource(in);
-                    inputSource.setSystemId(systemId);
-                    SunStAXReflection.XMLReaderImpl_setInputSource.invoke(xsr, inputSource);
-                }
-                return (XMLStreamReader) xsr;
-            }
-            else {
-                synchronized (xmlInputFactory) {
-                    return xmlInputFactory.createXMLStreamReader(systemId, in);
-                }
-            }
-        } catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-    /**
-     * Returns a StAX parser from a Reader. Attemps to re-use parsers if
-     * underlying representation is Zephyr.
-     *
-     * TODO: Reject DTDs?
-     */
-    public static XMLStreamReader createXMLStreamReader(Reader reader,
-        boolean rejectDTDs) {
-        try {
-            // If using Zephyr, try re-using the last instance
-            if (SunStAXReflection.XMLReaderImpl_setInputSource != null) {
-                Object xsr = xmlStreamReader.get();
-                if (xsr == null) {
-                    synchronized (xmlInputFactory) {
-                        xmlStreamReader.set(
-                            xsr = xmlInputFactory.createXMLStreamReader(reader));
-                    }
-                }
-                else {
-                    SunStAXReflection.XMLReaderImpl_reset.invoke(xsr);
-                    SunStAXReflection.XMLReaderImpl_setInputSource.invoke(xsr, new InputSource(reader));
-                }
-                return (XMLStreamReader) xsr;
-            }
-            else {
-                synchronized (xmlInputFactory) {
-                    return xmlInputFactory.createXMLStreamReader(reader);
-                }
-            }
-        }
-        catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-    // -- Fast Infoset ---------------------------------------------------
-
-    public static XMLStreamReader createFIStreamReader(InputSource source) {
-        return createFIStreamReader(source.getByteStream());
-    }
-
-    /**
-     * Returns the FI parser allocated for this thread.
-     */
-    public static XMLStreamReader createFIStreamReader(InputStream in) {
-        // Check if compatible implementation of FI was found
-        if (FastInfosetReflection.fiStAXDocumentParser_new == null) {
-            throw new XMLReaderException("fastinfoset.noImplementation");
-        }
-
-        try {
-            Object sdp = fiStreamReader.get();
-            if (sdp == null) {
-                // Do not use StAX pluggable layer for FI
-                fiStreamReader.set(sdp = FastInfosetReflection.fiStAXDocumentParser_new.newInstance());
-                FastInfosetReflection.fiStAXDocumentParser_setStringInterning.invoke(sdp, Boolean.TRUE);
-            }
-            FastInfosetReflection.fiStAXDocumentParser_setInputStream.invoke(sdp, in);
-            return (XMLStreamReader) sdp;
-        }
-        catch (Exception e) {
-            throw new XMLStreamReaderException(e);
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java
index d67765d..cf77885 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,18 +26,9 @@
 package com.sun.xml.internal.ws.streaming;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
-
 import static javax.xml.stream.XMLStreamConstants.*;
-import java.util.Map;
-import java.util.HashMap;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 /**
  * <p> XMLStreamReaderUtil provides some utility methods intended to be used
@@ -53,8 +44,7 @@
     public static void close(XMLStreamReader reader) {
         try {
             reader.close();
-        }
-        catch (XMLStreamException e) {
+        } catch (XMLStreamException e) {
             throw wrapException(e);
         }
     }
@@ -164,14 +154,14 @@
     */
     public static QName getElementQName(XMLStreamReader reader) {
         try {
-            String text = reader.getElementText();
-            String prefix = text.substring(0, text.indexOf(':'));
-            String namespaceURI = reader.getNamespaceURI(prefix);
+            String text = reader.getElementText().trim();
+            String prefix = text.substring(0,text.indexOf(':'));
+            String namespaceURI = reader.getNamespaceContext().getNamespaceURI(prefix);
             if (namespaceURI == null) {
                 namespaceURI = "";
             }
             String localPart = text.substring(
-                text.indexOf(':') + 1,  text.length());
+                    text.indexOf(':') + 1, text.length());
             return new QName(namespaceURI, localPart);
         } catch (XMLStreamException e) {
             throw wrapException(e);
@@ -183,8 +173,8 @@
      * be called multiple times to get the same list of attributes.
      */
     public static Attributes getAttributes(XMLStreamReader reader) {
-        return (reader.getEventType() == reader.START_ELEMENT ||
-                reader.getEventType() == reader.ATTRIBUTE) ?
+        return (reader.getEventType() == START_ELEMENT ||
+                reader.getEventType() == ATTRIBUTE) ?
                 new AttributesImpl(reader) : null;
     }
 
@@ -193,18 +183,21 @@
         if (state != expectedState) {
             throw new XMLStreamReaderException(
                 "xmlreader.unexpectedState",
-                new Object[] {
-                    getStateName(expectedState), getStateName(state) });
+                getStateName(expectedState), getStateName(state));
+        }
+    }
+
+    public static void verifyTag(XMLStreamReader reader, String namespaceURI, String localName) {
+        if (!localName.equals(reader.getLocalName()) || !namespaceURI.equals(reader.getNamespaceURI())) {
+            throw new XMLStreamReaderException(
+                "xmlreader.unexpectedState.tag",
+                    "{" + namespaceURI + "}" + localName,
+                    "{" + reader.getNamespaceURI() + "}" + reader.getLocalName());
         }
     }
 
     public static void verifyTag(XMLStreamReader reader, QName name) {
-        if (!name.equals(reader.getName())) {
-            throw new XMLStreamReaderException(
-                "xmlreader.unexpectedState.tag",
-                    name,
-                    reader.getName());
-        }
+        verifyTag(reader, name.getNamespaceURI(), name.getLocalPart());
     }
 
     public static String getStateName(XMLStreamReader reader) {
@@ -320,12 +313,11 @@
 
                 // this is the normal case
                 int index = 0;
-                String namespacePrefix = null;
                 int namespaceCount = reader.getNamespaceCount();
                 int attributeCount = reader.getAttributeCount();
                 atInfos = new AttributeInfo[namespaceCount + attributeCount];
                 for (int i=0; i<namespaceCount; i++) {
-                    namespacePrefix = reader.getNamespacePrefix(i);
+                    String namespacePrefix = reader.getNamespacePrefix(i);
 
                     // will be null if default prefix. QName can't take null
                     if (namespacePrefix == null) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java
index 32f9383..2841f4e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
         super("xmlwriter.nestedError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.streaming";
     }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterFactory.java
deleted file mode 100644
index db86418..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterFactory.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.streaming;
-
-import com.sun.xml.internal.ws.util.FastInfosetReflection;
-import java.io.OutputStream;
-import java.lang.reflect.Method;
-import java.lang.reflect.Constructor;
-
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLOutputFactory;
-
-/**
- * <p>A factory to create XML and FI serializers.</p>
- *
- * @author Santiago.PericasGeertsen@sun.com
- */
-public class XMLStreamWriterFactory {
-
-    /**
-     * StAX input factory shared by all threads.
-     */
-    static XMLOutputFactory xmlOutputFactory;
-
-    /**
-     * FI stream writer for each thread.
-     */
-    static ThreadLocal fiStreamWriter = new ThreadLocal();
-
-    static {
-        // Use StAX pluggability layer to get factory instance
-        xmlOutputFactory = XMLOutputFactory.newInstance();
-    }
-
-    // -- XML ------------------------------------------------------------
-
-    public static XMLStreamWriter createXMLStreamWriter(OutputStream out) {
-        return createXMLStreamWriter(out, "UTF-8");
-    }
-
-    public static XMLStreamWriter createXMLStreamWriter(OutputStream out, String encoding) {
-        return createXMLStreamWriter(out, encoding, true);
-    }
-
-    /**
-     * TODO: declare?
-     * TODO: Use thread locals and reset() when using Zephyr
-     */
-    public static XMLStreamWriter createXMLStreamWriter(OutputStream out,
-        String encoding, boolean declare)
-    {
-        try {
-            // Assume StAX factory implementation is not thread-safe
-            synchronized (xmlOutputFactory) {
-                return xmlOutputFactory.createXMLStreamWriter(out, encoding);
-            }
-        }
-        catch (Exception e) {
-            throw new XMLReaderException("stax.cantCreate",e);
-        }
-    }
-
-    // -- Fast Infoset ---------------------------------------------------
-
-    public static XMLStreamWriter createFIStreamWriter(OutputStream out) {
-        return createFIStreamWriter(out, "UTF-8");
-    }
-
-    public static XMLStreamWriter createFIStreamWriter(OutputStream out, String encoding) {
-        return createFIStreamWriter(out, encoding, true);
-    }
-
-    public static XMLStreamWriter createFIStreamWriter(OutputStream out,
-        String encoding, boolean declare)
-    {
-        // Check if compatible implementation of FI was found
-        if (FastInfosetReflection.fiStAXDocumentSerializer_new == null) {
-            throw new XMLReaderException("fastinfoset.noImplementation");
-        }
-
-        try {
-            Object sds = fiStreamWriter.get();
-            if (sds == null) {
-                // Do not use StAX pluggable layer for FI
-                fiStreamWriter.set(sds = FastInfosetReflection.fiStAXDocumentSerializer_new.newInstance());
-            }
-            FastInfosetReflection.fiStAXDocumentSerializer_setOutputStream.invoke(sds, out);
-            FastInfosetReflection.fiStAXDocumentSerializer_setEncoding.invoke(sds, encoding);
-            return (XMLStreamWriter) sds;
-        }  catch (Exception e) {
-            throw new XMLStreamWriterException(e);
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java
index 4050522..34524a2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,13 @@
 
 package com.sun.xml.internal.ws.streaming;
 
+import com.sun.istack.internal.Nullable;
+
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.stream.XMLStreamException;
+import java.util.Map;
+import java.io.OutputStream;
 
 /**
  * <p>XMLStreamWriterUtil provides some utility methods intended to be used
@@ -40,6 +44,40 @@
     private XMLStreamWriterUtil() {
     }
 
+    /**
+     * Gives the underlying stream for XMLStreamWriter. It closes any start elements, and returns the stream so
+     * that JAXB can write infoset directly to the stream.
+     *
+     * @param writer XMLStreamWriter for which stream is required
+     * @return  underlying OutputStream, null if writer doesn't provide a way to get it
+     * @throws XMLStreamException if any of writer operations throw the exception
+     */
+    public static @Nullable OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException {
+        // SJSXP
+        if (writer instanceof Map) {
+            Object obj = ((Map) writer).get("sjsxp-outputstream");
+            if (obj != null) {
+                writer.writeCharacters("");  // Force completion of open elems
+                return (OutputStream)obj;
+            }
+        }
+        // woodstox
+        try {
+            Object obj = writer.getProperty("com.ctc.wstx.outputUnderlyingStream");
+            if (obj != null) {
+                writer.writeCharacters("");  // Force completion of open elems
+                writer.flush();
+                return (OutputStream)obj;
+            }
+        } catch(Exception ie) {
+            //Above property lookup causes NPE on JDK6u1, should be ignored.
+            // We should not fail due to such lookups.
+
+            // nothing to do here
+        }
+        return null;
+    }
+
 
     public static String encodeQName(XMLStreamWriter writer, QName qname,
         PrefixFactory prefixFactory)
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/DeferredTransportPipe.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/DeferredTransportPipe.java
new file mode 100644
index 0000000..423b3c8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/DeferredTransportPipe.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport;
+
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.*;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.ws.BindingProvider;
+
+/**
+ * Proxy transport {@link Tube} and {@link Pipe} that lazily determines the
+ * actual transport pipe by looking at {@link Packet#endpointAddress}.
+ *
+ * <p>
+ * This pseudo transport is used when there's no statically known endpoint address,
+ * and thus it's expected that the application will configure {@link BindingProvider}
+ * at runtime before making invocation.
+ *
+ * <p>
+ * Since a typical application makes multiple invocations with the same endpoint
+ * address, this class implements a simple cache strategy to avoid re-creating
+ * transport pipes excessively.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class DeferredTransportPipe extends AbstractTubeImpl {
+
+    private Tube transport;
+    private EndpointAddress address;
+
+    // parameter to TransportPipeFactory
+    private final ClassLoader classLoader;
+    private final ClientTubeAssemblerContext context;
+
+    public DeferredTransportPipe(ClassLoader classLoader, ClientPipeAssemblerContext context) {
+        this(classLoader, new ClientTubeAssemblerContext(context.getAddress(), context.getWsdlModel(),
+                context.getService(), context.getBinding(), context.getContainer()));
+    }
+
+    public DeferredTransportPipe(ClassLoader classLoader, ClientTubeAssemblerContext context) {
+        this.classLoader = classLoader;
+        this.context = context;
+    }
+
+    public NextAction processException(@NotNull Throwable t) {
+        return transport.processException(t);
+    }
+
+    public NextAction processRequest(@NotNull Packet request) {
+        if(request.endpointAddress==address)
+            // cache hit
+            return transport.processRequest(request);
+
+        // cache miss
+
+        if(transport!=null) {
+            // delete the current entry
+            transport.preDestroy();
+            transport = null;
+            address = null;
+        }
+
+        // otherwise find out what transport will process this.
+
+        ClientTubeAssemblerContext newContext = new ClientTubeAssemblerContext(
+            request.endpointAddress,
+            context.getWsdlModel(),
+            context.getService(),
+            context.getBinding(),
+            context.getContainer(),
+            context.getCodec().copy()
+        );
+
+        address = request.endpointAddress;
+        transport = TransportTubeFactory.create(classLoader, newContext);
+        // successful return from the above method indicates a successful pipe creation
+        assert transport!=null;
+
+        return transport.processRequest(request);
+    }
+
+    public NextAction processResponse(@NotNull Packet response) {
+        return transport.processResponse(response);
+    }
+
+    public void preDestroy() {
+        if(transport!=null) {
+            transport.preDestroy();
+            transport = null;
+            address = null;
+        }
+    }
+
+    public DeferredTransportPipe copy(TubeCloner cloner) {
+        DeferredTransportPipe copy = new DeferredTransportPipe(classLoader,context);
+        cloner.add(this,copy);
+
+        // TODO Is the following thread-safe ??
+        // copied pipeline is still likely to work with the same endpoint address,
+        // so also copy the cached transport pipe, if any
+        if(transport!=null) {
+            copy.transport = ((PipeCloner)cloner).copy(this.transport);
+            copy.address = this.address;
+        }
+
+        return copy;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java
index fcad032..d7e9ae9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java
@@ -1,6 +1,5 @@
-
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +23,7 @@
  * have any questions.
  */
 
+
 package com.sun.xml.internal.ws.transport;
 
 import java.util.Collection;
@@ -180,7 +180,9 @@
     }
 
     public void putAll(Map<? extends String,? extends List<String>> t)  {
-        map.putAll (t);
+        for(Map.Entry<? extends String, ? extends List<String>> entry : t.entrySet()) {
+            put(entry.getKey(), entry.getValue());
+        }
     }
 
     public void clear() {
@@ -206,8 +208,4 @@
     public int hashCode() {
         return map.hashCode();
     }
-
-    public String toString() {
-        return map.toString();
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/WSConnectionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/WSConnectionImpl.java
deleted file mode 100644
index b7334a3..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/WSConnectionImpl.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport;
-
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-
-import com.sun.xml.internal.ws.client.ClientTransportException;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-/**
- * Abstract class for WSConnection. All client-side and server-side
- * transports should extend this class and override appropriate methods.
- *
- * @author WS Development Team
- */
-public abstract class WSConnectionImpl implements WSConnection {
-    Map<String, List<String>> headers = null;
-    public OutputStream debugStream = null;
-    public OutputStream outputStream = null;
-    public InputStream inputStream = null;
-    int statusCode;
-
-    /** Creates a new instance of WSConnectionImpl */
-    public WSConnectionImpl () {
-    }
-
-    public int getStatus () {
-        return statusCode;
-    }
-
-    public void setStatus (int statusCode) {
-        this.statusCode = statusCode;
-    }
-
-    public OutputStream getDebug () {
-        return debugStream;
-    }
-
-    /**
-     * @return outputStream
-     *
-     * Returns the OutputStream on which the outbound message is written.
-     * Any stream or connection initialization, pre-processing is done here.
-     */
-    public OutputStream getOutput() {
-        return outputStream;
-    }
-
-    /**
-     * @return inputStream
-     *
-     * Returns the InputStream on which the inbound message is received.
-     * Any post-processing of message is done here.
-     */
-    public InputStream getInput() {
-        return inputStream;
-    }
-
-    public Map<String, List<String>> getHeaders () {
-        return headers;
-    }
-
-    public void setHeaders (Map<String, List<String>> headers) {
-        this.headers = headers;
-    }
-
-    /**
-     * Write connection headers in HTTP syntax using \r\n as a
-     * separator.
-     */
-    public void writeHeaders(OutputStream os) {
-        try {
-            byte[] newLine = "\r\n".getBytes("us-ascii");
-
-            // Write all headers ala HTTP (only first list entry serialized)
-            Map<String, List<String>> headers = getHeaders();
-            for (String header : headers.keySet()) {
-                os.write((header + ":" +
-                    headers.get(header).get(0)).getBytes("us-ascii"));
-                os.write(newLine);
-            }
-
-            // Write empty line as in HTTP
-            os.write(newLine);
-        }
-        catch (Exception ex) {
-            throw new ClientTransportException("local.client.failed",ex);
-        }
-    }
-
-    /**
-     * Read and consume connection headers in HTTP syntax using
-     * \r\n as a separator.
-     */
-    public void readHeaders(InputStream is) {
-        try {
-            int c1, c2;
-            StringBuffer line = new StringBuffer();
-
-            if (headers == null) {
-                headers = new HashMap<String, List<String>>();
-            }
-            else {
-                headers.clear();
-            }
-
-            // Read headers until finding a \r\n line
-            while ((c1 = is.read()) != -1) {
-                if (c1 == '\r') {
-                    c2 = is.read();
-                    assert c2 != -1;
-
-                    if (c2 == '\n') {
-                        String s = line.toString();
-                        if (s.length() == 0) {
-                            break;  // found \r\n line
-                        }
-                        else {
-                            int k  = s.indexOf(':');
-                            assert k > 0;
-                            ArrayList<String> value = new ArrayList<String>();
-                            value.add(s.substring(k + 1));
-                            headers.put(s.substring(0, k), value);
-                            line.setLength(0);      // clear line buffer
-                        }
-                    }
-                    else {
-                        line.append((char) c1).append((char) c2);
-                    }
-                }
-                else {
-                    line.append((char) c1);
-                }
-            }
-        }
-        catch (Exception ex) {
-            throw new ClientTransportException("local.client.failed",ex);
-        }
-    }
-
-    public void closeOutput() {
-        try {
-            if (outputStream != null) {
-                outputStream.flush();
-                outputStream.close();
-            }
-        } catch (IOException ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    public void closeInput() {
-    }
-
-    public void close() {
-
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java
new file mode 100644
index 0000000..7999e77
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java
@@ -0,0 +1,564 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport.http;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.handler.HandlerChainsModel;
+import com.sun.xml.internal.ws.resources.ServerMessages;
+import com.sun.xml.internal.ws.resources.WsservletMessages;
+import com.sun.xml.internal.ws.server.EndpointFactory;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.streaming.Attributes;
+import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.HandlerAnnotationInfo;
+import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.xml.sax.EntityResolver;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.soap.MTOMFeature;
+import javax.xml.ws.soap.SOAPBinding;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Parses {@code sun-jaxws.xml} into {@link WSEndpoint}.
+ *
+ * <p>
+ * Since {@code sun-jaxws.xml} captures more information that what {@link WSEndpoint}
+ * represents (in particular URL pattern and name), this class
+ * takes a parameterization 'A' so that the user of this parser can choose to
+ * create another type that wraps {@link WSEndpoint}.
+ *
+ * {@link HttpAdapter} and its derived type is used for this often,
+ * but it can be anything.
+ *
+ * @author WS Development Team
+ * @author Kohsuke Kawaguchi
+ */
+public class DeploymentDescriptorParser<A> {
+    private final Container container;
+    private final ClassLoader classLoader;
+    private final ResourceLoader loader;
+    private final AdapterFactory<A> adapterFactory;
+
+    /**
+     * Endpoint names that are declared.
+     * Used to catch double definitions.
+     */
+    private final Set<String> names = new HashSet<String>();
+
+    /**
+     * WSDL/schema documents collected from /WEB-INF/wsdl. Keyed by the system ID.
+     */
+    private final Map<String,SDDocumentSource> docs = new HashMap<String,SDDocumentSource>();
+
+    /**
+     *
+     * @param cl
+     *      Used to load service implementations.
+     * @param loader
+     *      Used to locate resources, in particular WSDL.
+     * @param container
+     *      Optional {@link Container} that {@link WSEndpoint}s receive.
+     * @param adapterFactory
+     *      Creates {@link HttpAdapter} (or its derived class.)
+     */
+    public DeploymentDescriptorParser(ClassLoader cl, ResourceLoader loader, Container container, AdapterFactory<A> adapterFactory) throws MalformedURLException {
+        classLoader = cl;
+        this.loader = loader;
+        this.container = container;
+        this.adapterFactory = adapterFactory;
+
+        collectDocs("/WEB-INF/wsdl/");
+        logger.fine("war metadata="+docs);
+    }
+
+    /**
+     * Parses the {@code sun-jaxws.xml} file and configures
+     * a set of {@link HttpAdapter}s.
+     */
+    public @NotNull List<A> parse(String systemId, InputStream is) {
+        XMLStreamReader reader = null;
+        try {
+            reader = new TidyXMLStreamReader(
+                XMLStreamReaderFactory.create(systemId,is,true), is);
+            XMLStreamReaderUtil.nextElementContent(reader);
+            return parseAdapters(reader);
+        } finally {
+            if (reader != null) {
+                try {
+                    reader.close();
+                } catch (XMLStreamException e) {
+                    throw new ServerRtException("runtime.parser.xmlReader",e);
+                }
+            }
+            try {
+                is.close();
+            } catch (IOException e) {
+                // ignore
+            }
+        }
+    }
+
+    /**
+     * Parses the {@code sun-jaxws.xml} file and configures
+     * a set of {@link HttpAdapter}s.
+     */
+    public @NotNull List<A> parse(File f) throws IOException {
+        FileInputStream in = new FileInputStream(f);
+        try {
+            return parse(f.getPath(), in);
+        } finally {
+            in.close();
+        }
+    }
+
+    /**
+     * Get all the WSDL & schema documents recursively.
+     */
+    private void collectDocs(String dirPath) throws MalformedURLException {
+        Set<String> paths = loader.getResourcePaths(dirPath);
+        if (paths != null) {
+            for (String path : paths) {
+                if (path.endsWith("/")) {
+                    collectDocs(path);
+                } else {
+                    URL res = loader.getResource(path);
+                    docs.put(res.toString(),SDDocumentSource.create(res));
+                }
+            }
+        }
+    }
+
+
+    private List<A> parseAdapters(XMLStreamReader reader) {
+        if (!reader.getName().equals(QNAME_ENDPOINTS)) {
+            failWithFullName("runtime.parser.invalidElement", reader);
+        }
+
+        List<A> adapters = new ArrayList<A>();
+
+        Attributes attrs = XMLStreamReaderUtil.getAttributes(reader);
+        String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION);
+        if (!version.equals(ATTRVALUE_VERSION_1_0)) {
+            failWithLocalName("runtime.parser.invalidVersionNumber",
+                reader, version);
+        }
+
+        while (XMLStreamReaderUtil.nextElementContent(reader) !=
+            XMLStreamConstants.END_ELEMENT) if (reader.getName().equals(QNAME_ENDPOINT)) {
+
+            attrs = XMLStreamReaderUtil.getAttributes(reader);
+            String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME);
+            if (!names.add(name)) {
+                logger.warning(
+                        WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/));
+            }
+
+            String implementationName =
+                    getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION);
+            Class<?> implementorClass = getImplementorClass(implementationName,reader);
+            EndpointFactory.verifyImplementorClass(implementorClass);
+
+            SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass);
+
+            QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE);
+            if (serviceName == null)
+                serviceName = EndpointFactory.getDefaultServiceName(implementorClass);
+
+            QName portName = getQNameAttribute(attrs, ATTR_PORT);
+            if (portName == null)
+                portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass);
+
+            //get enable-mtom attribute value
+            String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM);
+            String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE);
+            String bindingId = getAttribute(attrs, ATTR_BINDING);
+            if (bindingId != null)
+                // Convert short-form tokens to API's binding ids
+                bindingId = getBindingIdForToken(bindingId);
+            WSBinding binding = createBinding(bindingId,implementorClass,
+                    enable_mtom,mtomThreshold);
+            String urlPattern =
+                    getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN);
+
+            // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary.
+
+            boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName);
+
+            ensureNoContent(reader);
+            WSEndpoint<?> endpoint = WSEndpoint.create(
+                    implementorClass, !handlersSetInDD,
+                    InstanceResolver.createDefault(implementorClass).createInvoker(),
+                    serviceName, portName, container, binding,
+                    primaryWSDL, docs.values(), createEntityResolver(),false
+            );
+            adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint));
+        } else {
+            failWithLocalName("runtime.parser.invalidElement", reader);
+        }
+        return adapters;
+    }
+
+    /**
+     * @param ddBindingId
+     *      binding id explicitlyspecified in the DeploymentDescriptor or parameter
+     * @param implClass
+     *      Endpoint Implementation class
+     * @param mtomEnabled
+     *      represents mtom-enabled attribute in DD
+     * @param mtomThreshold
+     *      threshold value specified in DD
+     * @return
+     *      is returned with only MTOMFeature set resolving the various precendece rules
+     */
+    private static WSBinding createBinding(String ddBindingId,Class implClass,
+                                          String mtomEnabled, String mtomThreshold) {
+        // Features specified through DD
+        WebServiceFeatureList features;
+
+        MTOMFeature mtomfeature = null;
+        if (mtomEnabled != null) {
+            if (mtomThreshold != null)
+                mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled),
+                        Integer.valueOf(mtomThreshold));
+            else
+                mtomfeature = new MTOMFeature(Boolean.valueOf(mtomEnabled));
+        }
+
+
+        BindingID bindingID;
+        if (ddBindingId != null) {
+            bindingID = BindingID.parse(ddBindingId);
+            features = bindingID.createBuiltinFeatureList();
+
+            if(checkMtomConflict(features.get(MTOMFeature.class),mtomfeature)) {
+                throw new ServerRtException(ServerMessages.DD_MTOM_CONFLICT(ddBindingId, mtomEnabled));
+            }
+        } else {
+            bindingID = BindingID.parse(implClass);
+            // Since bindingID is coming from implclass,
+            // mtom through Feature annotation or DD takes precendece
+
+            features = new WebServiceFeatureList();
+            if(mtomfeature != null)
+                features.add(mtomfeature); // this wins over MTOM setting in bindingID
+            features.addAll(bindingID.createBuiltinFeatureList());
+        }
+
+        return bindingID.createBinding(features.toArray());
+    }
+
+    private static boolean checkMtomConflict(MTOMFeature lhs, MTOMFeature rhs) {
+        if(lhs==null || rhs==null)  return false;
+        return lhs.isEnabled() ^ rhs.isEnabled();
+    }
+
+    /**
+     * JSR-109 defines short-form tokens for standard binding Ids. These are
+     * used only in DD. So stand alone deployment descirptor should also honor
+     * these tokens. This method converts the tokens to API's standard
+     * binding ids
+     *
+     * @param lexical binding attribute value from DD. Always not null
+     *
+     * @return returns corresponding API's binding ID or the same lexical
+     */
+    public static @NotNull String getBindingIdForToken(@NotNull String lexical) {
+        if (lexical.equals("##SOAP11_HTTP")) {
+            return SOAPBinding.SOAP11HTTP_BINDING;
+        } else if (lexical.equals("##SOAP11_HTTP_MTOM")) {
+            return SOAPBinding.SOAP11HTTP_MTOM_BINDING;
+        } else if (lexical.equals("##SOAP12_HTTP")) {
+            return SOAPBinding.SOAP12HTTP_BINDING;
+        } else if (lexical.equals("##SOAP12_HTTP_MTOM")) {
+            return SOAPBinding.SOAP12HTTP_MTOM_BINDING;
+        } else if (lexical.equals("##XML_HTTP")) {
+            return HTTPBinding.HTTP_BINDING;
+        }
+        return lexical;
+    }
+
+    /**
+     * Creates a new "Adapter".
+     *
+     * <P>
+     * Normally 'A' would be {@link HttpAdapter} or some derived class.
+     * But the parser doesn't require that to be of any particular type.
+     */
+    public static interface AdapterFactory<A> {
+        A createAdapter(String name, String urlPattern, WSEndpoint<?> endpoint);
+    }
+
+    /**
+     * Checks the deployment descriptor or {@link @WebServiceProvider} annotation
+     * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}.
+     *
+     * @return
+     *      The pointed WSDL, if any. Otherwise null.
+     */
+    private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class<?> implementorClass) {
+
+        String wsdlFile = getAttribute(attrs, ATTR_WSDL);
+        if (wsdlFile == null) {
+            wsdlFile = EndpointFactory.getWsdlLocation(implementorClass);
+        }
+
+        if (wsdlFile!=null) {
+            if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR)) {
+                logger.warning("Ignoring wrong wsdl="+wsdlFile+". It should start with "
+                        +JAXWS_WSDL_DD_DIR
+                        +". Going to generate and publish a new WSDL.");
+                return null;
+            }
+
+            URL wsdl;
+            try {
+                wsdl = loader.getResource('/'+wsdlFile);
+            } catch (MalformedURLException e) {
+                throw new LocatableWebServiceException(
+                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr );
+            }
+            if (wsdl == null) {
+                throw new LocatableWebServiceException(
+                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr );
+            }
+            SDDocumentSource docInfo = docs.get(wsdl.toExternalForm());
+            assert docInfo != null;
+            return docInfo;
+        }
+
+        return null;
+    }
+
+    /**
+     * Creates an {@link EntityResolver} that consults {@code /WEB-INF/jax-ws-catalog.xml}.
+     */
+    private EntityResolver createEntityResolver() {
+        try {
+            return XmlUtil.createEntityResolver(loader.getCatalogFile());
+        } catch(MalformedURLException e) {
+            throw new WebServiceException(e);
+        }
+    }
+
+    protected String getAttribute(Attributes attrs, String name) {
+        String value = attrs.getValue(name);
+        if (value != null) {
+            value = value.trim();
+        }
+        return value;
+    }
+
+    protected QName getQNameAttribute(Attributes attrs, String name) {
+        String value = getAttribute(attrs, name);
+        if (value == null || value.equals("")) {
+            return null;
+        } else {
+            return QName.valueOf(value);
+        }
+    }
+
+    protected String getNonEmptyAttribute(XMLStreamReader reader, Attributes attrs, String name) {
+        String value = getAttribute(attrs, name);
+        if (value != null && value.equals("")) {
+            failWithLocalName(
+                "runtime.parser.invalidAttributeValue",
+                reader,
+                name);
+        }
+        return value;
+    }
+
+    protected String getMandatoryAttribute(XMLStreamReader reader, Attributes attrs, String name) {
+        String value = getAttribute(attrs, name);
+        if (value == null) {
+            failWithLocalName("runtime.parser.missing.attribute", reader, name);
+        }
+        return value;
+    }
+
+    protected String getMandatoryNonEmptyAttribute(XMLStreamReader reader, Attributes attributes,
+                                                   String name) {
+        String value = getAttribute(attributes, name);
+        if (value == null) {
+            failWithLocalName("runtime.parser.missing.attribute", reader, name);
+        } else if (value.equals("")) {
+            failWithLocalName(
+                "runtime.parser.invalidAttributeValue",
+                reader,
+                name);
+        }
+        return value;
+    }
+
+    /**
+     * Parses the handler and role information and sets it
+     * on the {@link WSBinding}.
+     * @return true if <handler-chains> element present in DD
+     *         false otherwise.
+     */
+    protected boolean setHandlersAndRoles(WSBinding binding, XMLStreamReader reader, QName serviceName, QName portName) {
+
+        if (XMLStreamReaderUtil.nextElementContent(reader) ==
+            XMLStreamConstants.END_ELEMENT ||
+            !reader.getName().equals(
+            HandlerChainsModel.QNAME_HANDLER_CHAINS)) {
+
+            return false;
+        }
+
+        HandlerAnnotationInfo handlerInfo = HandlerChainsModel.parseHandlerFile(
+            reader, classLoader,serviceName, portName, binding);
+
+        binding.setHandlerChain(handlerInfo.getHandlers());
+        if (binding instanceof SOAPBinding) {
+            ((SOAPBinding)binding).setRoles(handlerInfo.getRoles());
+        }
+
+        // move past </handler-chains>
+        XMLStreamReaderUtil.nextContent(reader);
+        return true;
+    }
+
+    protected static void ensureNoContent(XMLStreamReader reader) {
+        if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
+            fail("runtime.parser.unexpectedContent", reader);
+        }
+    }
+
+    protected static void fail(String key, XMLStreamReader reader) {
+        logger.log(Level.SEVERE, key + reader.getLocation().getLineNumber());
+        throw new ServerRtException(
+            key,
+            Integer.toString(reader.getLocation().getLineNumber()));
+    }
+
+    protected static void failWithFullName(String key, XMLStreamReader reader) {
+        throw new ServerRtException(
+            key,
+            reader.getLocation().getLineNumber(),
+            reader.getName());
+    }
+
+    protected static void failWithLocalName(String key, XMLStreamReader reader) {
+        throw new ServerRtException(
+            key,
+            reader.getLocation().getLineNumber(),
+            reader.getLocalName());
+    }
+
+    protected static void failWithLocalName(
+        String key,
+        XMLStreamReader reader,
+        String arg) {
+        throw new ServerRtException(
+            key,
+            reader.getLocation().getLineNumber(),
+            reader.getLocalName(),
+            arg);
+    }
+
+    protected Class loadClass(String name) {
+        try {
+            return Class.forName(name, true, classLoader);
+        } catch (ClassNotFoundException e) {
+            logger.log(Level.SEVERE, e.getMessage(), e);
+            throw new ServerRtException(
+                "runtime.parser.classNotFound",
+                name);
+        }
+    }
+
+    /**
+     * Loads the class of the given name.
+     *
+     * @param xsr
+     *      Used to report the source location information if there's any error.
+     */
+    private Class getImplementorClass(String name, XMLStreamReader xsr) {
+        try {
+            return Class.forName(name, true, classLoader);
+        } catch (ClassNotFoundException e) {
+            logger.log(Level.SEVERE, e.getMessage(), e);
+            throw new LocatableWebServiceException(
+                ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr );
+        }
+    }
+
+    public static final String NS_RUNTIME =
+        "http://java.sun.com/xml/ns/jax-ws/ri/runtime";
+
+    public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl";
+
+    public static final QName QNAME_ENDPOINTS =
+        new QName(NS_RUNTIME, "endpoints");
+    public static final QName QNAME_ENDPOINT =
+        new QName(NS_RUNTIME, "endpoint");
+
+    public static final String ATTR_VERSION = "version";
+    public static final String ATTR_NAME = "name";
+    public static final String ATTR_IMPLEMENTATION = "implementation";
+    public static final String ATTR_WSDL = "wsdl";
+    public static final String ATTR_SERVICE = "service";
+    public static final String ATTR_PORT = "port";
+    public static final String ATTR_URL_PATTERN = "url-pattern";
+    public static final String ATTR_ENABLE_MTOM = "enable-mtom";
+    public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value";
+    public static final String ATTR_BINDING = "binding";
+
+    public static final String ATTRVALUE_VERSION_1_0 = "2.0";
+    private static final Logger logger =
+        Logger.getLogger(
+            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java
new file mode 100644
index 0000000..8d0250c
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java
@@ -0,0 +1,545 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport.http;
+
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;
+import com.sun.xml.internal.ws.api.message.Message;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.server.AbstractServerAsyncTransport;
+import com.sun.xml.internal.ws.api.server.Adapter;
+import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
+import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+import com.sun.xml.internal.ws.api.server.SDDocument;
+import com.sun.xml.internal.ws.api.server.ServiceDefinition;
+import com.sun.xml.internal.ws.api.server.TransportBackChannel;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+import com.sun.xml.internal.ws.resources.WsservletMessages;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.server.UnsupportedMediaException;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.HttpURLConnection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * {@link Adapter} that receives messages in HTTP.
+ *
+ * <p>
+ * This object also assigns unique query string (such as "xsd=1") to
+ * each {@link SDDocument} so that they can be served by HTTP GET requests.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class HttpAdapter extends Adapter<HttpAdapter.HttpToolkit> {
+
+    /**
+     * {@link SDDocument}s keyed by the query string like "?abc".
+     * Used for serving documents via HTTP GET.
+     *
+     * Empty if the endpoint doesn't have {@link ServiceDefinition}.
+     * Read-only.
+     */
+    public final Map<String,SDDocument> wsdls;
+
+    /**
+     * Reverse map of {@link #wsdls}. Read-only.
+     */
+    public final Map<SDDocument,String> revWsdls;
+
+    public final HttpAdapterList<? extends HttpAdapter> owner;
+
+    /**
+     * Creates a lone {@link HttpAdapter} that does not know of any other
+     * {@link HttpAdapter}s.
+     *
+     * This is convenient for creating an {@link HttpAdapter} for an environment
+     * where they don't know each other (such as JavaSE deployment.)
+     *
+     * @param endpoint web service endpoint
+     * @return singe adapter to process HTTP messages
+     */
+    public static HttpAdapter createAlone(WSEndpoint endpoint) {
+        return new DummyList().createAdapter("","",endpoint);
+    }
+
+    protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner) {
+        super(endpoint);
+        this.owner = owner;
+
+        // fill in WSDL map
+        ServiceDefinition sdef = this.endpoint.getServiceDefinition();
+        if(sdef==null) {
+            wsdls = Collections.emptyMap();
+            revWsdls = Collections.emptyMap();
+        } else {
+            wsdls = new HashMap<String, SDDocument>();  // wsdl=1 --> Doc
+            // Sort WSDL, Schema documents based on SystemId so that the same
+            // document gets wsdl=x mapping
+            Map<String, SDDocument> systemIds = new TreeMap<String, SDDocument>();
+            for (SDDocument sdd : sdef) {
+                if (sdd == sdef.getPrimary()) { // No sorting for Primary WSDL
+                    wsdls.put("wsdl", sdd);
+                    wsdls.put("WSDL", sdd);
+                } else {
+                    systemIds.put(sdd.getURL().toString(), sdd);
+                }
+            }
+
+            int wsdlnum = 1;
+            int xsdnum = 1;
+            for (Map.Entry<String, SDDocument> e : systemIds.entrySet()) {
+                SDDocument sdd = e.getValue();
+                if (sdd.isWSDL()) {
+                    wsdls.put("wsdl="+(wsdlnum++),sdd);
+                }
+                if (sdd.isSchema()) {
+                    wsdls.put("xsd="+(xsdnum++),sdd);
+                }
+            }
+
+            revWsdls = new HashMap<SDDocument,String>();    // Doc --> wsdl=1
+            for (Entry<String,SDDocument> e : wsdls.entrySet()) {
+                if (!e.getKey().equals("WSDL")) {           // map Doc --> wsdl, not WSDL
+                    revWsdls.put(e.getValue(),e.getKey());
+                }
+            }
+        }
+    }
+
+    protected HttpToolkit createToolkit() {
+        return new HttpToolkit();
+    }
+
+    /**
+     * Receives the incoming HTTP connection and dispatches
+     * it to JAX-WS. This method returns when JAX-WS completes
+     * processing the request and the whole reply is written
+     * to {@link WSHTTPConnection}.
+     *
+     * <p>
+     * This method is invoked by the lower-level HTTP stack,
+     * and "connection" here is an HTTP connection.
+     *
+     * <p>
+     * To populate a request {@link Packet} with more info,
+     * define {@link PropertySet.Property properties} on
+     * {@link WSHTTPConnection}.
+     *
+     * @param connection to receive/send HTTP messages for web service endpoints
+     * @throws IOException when I/O errors happen
+     */
+    public void handle(@NotNull WSHTTPConnection connection) throws IOException {
+        HttpToolkit tk = pool.take();
+        try {
+            tk.handle(connection);
+        } finally {
+            pool.recycle(tk);
+        }
+    }
+
+    /**
+     *
+     * @param con
+     * @param codec
+     * @return
+     * @throws IOException
+     *         ExceptionHasMessage exception that contains particular fault message
+     *         UnsupportedMediaException to indicate to send 415 error code
+     */
+    private Packet decodePacket(@NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException {
+        String ct = con.getRequestHeader("Content-Type");
+        InputStream in = con.getInput();
+        Packet packet = new Packet();
+        packet.soapAction = con.getRequestHeader("SOAPAction");
+        packet.wasTransportSecure = con.isSecure();
+        packet.acceptableMimeTypes = con.getRequestHeader("Accept");
+        packet.addSatellite(con);
+        packet.transportBackChannel = new Oneway(con);
+        packet.webServiceContextDelegate = con.getWebServiceContextDelegate();
+
+        if (dump) {
+            ByteArrayBuffer buf = new ByteArrayBuffer();
+            buf.write(in);
+            dump(buf, "HTTP request", con.getRequestHeaders());
+            in = buf.newInputStream();
+        }
+        codec.decode(in, ct, packet);
+        return packet;
+    }
+
+
+
+
+    private void encodePacket(@NotNull Packet packet, @NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException {
+        if (con.isClosed()) {
+            return;                 // Connection is already closed
+        }
+        Message responseMessage = packet.getMessage();
+        if (responseMessage == null) {
+            if (!con.isClosed()) {
+                // set the response code if not already set
+                // for example, 415 may have been set earlier for Unsupported Content-Type
+                if (con.getStatus() == 0)
+                    con.setStatus(WSHTTPConnection.ONEWAY);
+                // close the response channel now
+                try {
+                    con.getOutput().close(); // no payload
+                } catch (IOException e) {
+                    throw new WebServiceException(e);
+                }
+            }
+        } else {
+            if (con.getStatus() == 0) {
+                // if the appliation didn't set the status code,
+                // set the default one.
+                con.setStatus(responseMessage.isFault()
+                        ? HttpURLConnection.HTTP_INTERNAL_ERROR
+                        : HttpURLConnection.HTTP_OK);
+            }
+
+            ContentType contentType = codec.getStaticContentType(packet);
+            if (contentType != null) {
+                con.setContentTypeResponseHeader(contentType.getContentType());
+                OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
+                if (dump) {
+                    ByteArrayBuffer buf = new ByteArrayBuffer();
+                    codec.encode(packet, buf);
+                    dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders());
+                    buf.writeTo(os);
+                } else {
+                    codec.encode(packet, os);
+                }
+                os.close();
+            } else {
+                ByteArrayBuffer buf = new ByteArrayBuffer();
+                contentType = codec.encode(packet, buf);
+                con.setContentTypeResponseHeader(contentType.getContentType());
+                if (dump) {
+                    dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders());
+                }
+                OutputStream os = con.getOutput();
+                buf.writeTo(os);
+                os.close();
+            }
+        }
+    }
+
+    public void invokeAsync(final WSHTTPConnection con) throws IOException {
+        final HttpToolkit tk = pool.take();
+        final Packet request;
+        try {
+            request = decodePacket(con, tk.codec);
+        } catch(ExceptionHasMessage e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+            Packet response = new Packet();
+            response.setMessage(e.getFaultMessage());
+            encodePacket(response, con, tk.codec);
+            pool.recycle(tk);
+            con.close();
+            return;
+        } catch(UnsupportedMediaException e) {
+            LOGGER.log(Level.SEVERE, e.getMessage(), e);
+            Packet response = new Packet();
+            con.setStatus(WSHTTPConnection.UNSUPPORTED_MEDIA);
+            encodePacket(response, con, tk.codec);
+            pool.recycle(tk);
+            con.close();
+            return;
+        }
+
+        endpoint.schedule(request, new WSEndpoint.CompletionCallback() {
+            public void onCompletion(@NotNull Packet response) {
+                try {
+                    try {
+                        encodePacket(response, con, tk.codec);
+                    } catch(IOException ioe) {
+                        LOGGER.log(Level.SEVERE, ioe.getMessage(), ioe);
+                    }
+                    pool.recycle(tk);
+                } finally{
+                    con.close();
+                }
+            }
+        });
+    }
+
+    final class AsyncTransport extends AbstractServerAsyncTransport<WSHTTPConnection> {
+
+        public AsyncTransport() {
+            super(endpoint);
+        }
+
+        public void handleAsync(WSHTTPConnection con) throws IOException {
+            super.handle(con);
+        }
+
+        protected void encodePacket(WSHTTPConnection con, @NotNull Packet packet, @NotNull Codec codec) throws IOException {
+            HttpAdapter.this.encodePacket(packet, con, codec);
+        }
+
+        protected @Nullable String getAcceptableMimeTypes(WSHTTPConnection con) {
+            return null;
+        }
+
+        protected @Nullable TransportBackChannel getTransportBackChannel(WSHTTPConnection con) {
+            return new Oneway(con);
+        }
+
+        protected @NotNull
+        PropertySet getPropertySet(WSHTTPConnection con) {
+            return con;
+        }
+
+        protected @NotNull WebServiceContextDelegate getWebServiceContextDelegate(WSHTTPConnection con) {
+            return con.getWebServiceContextDelegate();
+        }
+    }
+
+    final class Oneway implements TransportBackChannel {
+        WSHTTPConnection con;
+        Oneway(WSHTTPConnection con) {
+            this.con = con;
+        }
+        public void close() {
+            if(!con.isClosed()) {
+                // close the response channel now
+                con.setStatus(WSHTTPConnection.ONEWAY);
+                try {
+                    con.getOutput().close(); // no payload
+                } catch (IOException e) {
+                    throw new WebServiceException(e);
+                }
+                con.close();
+            }
+        }
+    }
+
+    final class HttpToolkit extends Adapter.Toolkit {
+        public void handle(WSHTTPConnection con) throws IOException {
+            try {
+                Packet packet = new Packet();
+                try {
+                    packet = decodePacket(con, codec);
+                } catch(ExceptionHasMessage e) {
+                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                    packet.setMessage(e.getFaultMessage());
+                } catch(UnsupportedMediaException e) {
+                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                    con.setStatus(WSHTTPConnection.UNSUPPORTED_MEDIA);
+                } catch(ServerRtException e) {
+                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                }
+                if (packet.getMessage() != null && !packet.getMessage().isFault()) {
+                    try {
+                        packet = head.process(packet, con.getWebServiceContextDelegate(),
+                                packet.transportBackChannel);
+                    } catch(Exception e) {
+                        LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                        if (!con.isClosed()) {
+                            writeInternalServerError(con);
+                        }
+                        return;
+                    }
+                }
+               encodePacket(packet, con, codec);
+            } finally {
+                if (!con.isClosed()) {
+                    con.close();
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns true if the given query string is for metadata request.
+     *
+     * @param query
+     *      String like "xsd=1" or "perhaps=some&amp;unrelated=query".
+     *      Can be null.
+     * @return true for metadata requests
+     *         false for web service requests
+     */
+    public final boolean isMetadataQuery(String query) {
+        // we intentionally return true even if documents don't exist,
+        // so that they get 404.
+        return query != null && (query.equals("WSDL") || query.startsWith("wsdl") || query.startsWith("xsd="));
+    }
+
+    /**
+     * Sends out the WSDL (and other referenced documents)
+     * in response to the GET requests to URLs like "?wsdl" or "?xsd=2".
+     *
+     * @param con
+     *      The connection to which the data will be sent. Must not be null.
+     * @param baseAddress
+     *      The requested base URL (such as "http://myhost:2045/foo/bar").
+     *      Used to reference other resoures. Must not be null.
+     * @param queryString
+     *      The query string given by the client (which indicates
+     *      what document to serve.) Can be null (but it causes an 404 not found.)
+     *
+     * @throws IOException when I/O errors happen
+     */
+    public void publishWSDL(WSHTTPConnection con, final String baseAddress, String queryString) throws IOException {
+        // Workaround for a bug in http server. Read and close InputStream
+        // TODO remove once the bug is fixed in http server
+        InputStream in = con.getInput();
+        while(in.read() != -1);
+        in.close();
+
+        SDDocument doc = wsdls.get(queryString);
+        if (doc == null) {
+            writeNotFoundErrorPage(con,"Invalid Request");
+            return;
+        }
+
+        con.setStatus(HttpURLConnection.HTTP_OK);
+        con.setContentTypeResponseHeader("text/xml;charset=utf-8");
+
+        OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
+
+        final PortAddressResolver portAddressResolver = owner.createPortAddressResolver(baseAddress);
+        final String address = portAddressResolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
+        assert address != null;
+        DocumentAddressResolver resolver = new DocumentAddressResolver() {
+            public String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced) {
+                // the map on endpoint should account for all SDDocument
+                assert revWsdls.containsKey(referenced);
+                return address+'?'+ revWsdls.get(referenced);
+            }
+        };
+
+        doc.writeTo(portAddressResolver, resolver, os);
+        os.close();
+    }
+
+    /**
+     * HTTP/1.0 connections require Content-Length. So just buffer to find out
+     * the length.
+     */
+    private final static class Http10OutputStream extends ByteArrayBuffer {
+        private final WSHTTPConnection con;
+
+        Http10OutputStream(WSHTTPConnection con) {
+            this.con = con;
+        }
+
+        @Override
+        public void close() throws IOException {
+            super.close();
+            con.setContentLengthResponseHeader(size());
+            OutputStream os = con.getOutput();
+            writeTo(os);
+            os.close();
+        }
+    }
+
+    private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
+        con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
+        con.setContentTypeResponseHeader("text/html; charset=UTF-8");
+
+        PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
+        out.println("<html>");
+        out.println("<head><title>");
+        out.println(WsservletMessages.SERVLET_HTML_TITLE());
+        out.println("</title></head>");
+        out.println("<body>");
+        out.println(WsservletMessages.SERVLET_HTML_NOT_FOUND(message));
+        out.println("</body>");
+        out.println("</html>");
+        out.close();
+    }
+
+    private void writeInternalServerError(WSHTTPConnection con) throws IOException {
+        con.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
+        con.getOutput().close();        // Sets the status code
+    }
+
+    private static final class DummyList extends HttpAdapterList<HttpAdapter> {
+        @Override
+        protected HttpAdapter createHttpAdapter(String name, String urlPattern, WSEndpoint<?> endpoint) {
+            return new HttpAdapter(endpoint, this);
+        }
+    }
+
+    private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
+        System.out.println("---["+caption +"]---");
+        if (headers != null) {
+            for (Entry<String, List<String>> header : headers.entrySet()) {
+                if (header.getValue().isEmpty()) {
+                    // I don't think this is legal, but let's just dump it,
+                    // as the point of the dump is to uncover problems.
+                    System.out.println(header.getValue());
+                } else {
+                    for (String value : header.getValue()) {
+                        System.out.println(header.getKey() + ": " + value);
+                    }
+                }
+            }
+        }
+        buf.writeTo(System.out);
+        System.out.println("--------------------");
+    }
+
+    /**
+     * Dumps what goes across HTTP transport.
+     */
+    public static boolean dump;
+
+    static {
+        boolean b;
+        try {
+            b = Boolean.getBoolean(HttpAdapter.class.getName()+".dump");
+        } catch( Throwable t ) {
+            b = false;
+        }
+        dump = b;
+    }
+
+    private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName());
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapterList.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapterList.java
new file mode 100644
index 0000000..afe3036
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapterList.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport.http;
+
+import com.sun.xml.internal.ws.transport.http.DeploymentDescriptorParser.AdapterFactory;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.istack.internal.NotNull;
+
+import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.AbstractList;
+
+/**
+ * List of {@link HttpAdapter}s created together.
+ *
+ * <p>
+ * Some cases WAR file may contain multiple endpoints for ports in a WSDL.
+ * If the runtime knows these ports, their port addresses can be patched.
+ * This class keeps a list of {@link HttpAdapter}s and use that information to patch
+ * multiple port addresses.
+ *
+ * <p>
+ * Concrete implementations of this class need to override {@link #createHttpAdapter}
+ * method to create implementations of {@link HttpAdapter}.
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class HttpAdapterList<T extends HttpAdapter> extends AbstractList<T> implements AdapterFactory<T> {
+    private final List<T> adapters = new ArrayList<T>();
+    private final Map<PortInfo, String> addressMap = new HashMap<PortInfo, String>();
+
+    // TODO: documented because it's used by AS
+    public T createAdapter(String name, String urlPattern, WSEndpoint<?> endpoint) {
+        T t = createHttpAdapter(name, urlPattern, endpoint);
+        adapters.add(t);
+        WSDLPort port = endpoint.getPort();
+        if (port != null) {
+            PortInfo portInfo = new PortInfo(port.getOwner().getName(),port.getName().getLocalPart());
+            addressMap.put(portInfo, getValidPath(urlPattern));
+        }
+        return t;
+    }
+
+    /**
+     * Implementations need to override this one to create a concrete class
+     * of HttpAdapter
+     */
+    protected abstract T createHttpAdapter(String name, String urlPattern, WSEndpoint<?> endpoint);
+
+    /**
+     * @return urlPattern without "/*"
+     */
+    private String getValidPath(@NotNull String urlPattern) {
+        if (urlPattern.endsWith("/*")) {
+            return urlPattern.substring(0, urlPattern.length() - 2);
+        } else {
+            return urlPattern;
+        }
+    }
+
+    /**
+     * Creates a PortAddressResolver that maps portname to its address
+     */
+    public PortAddressResolver createPortAddressResolver(final String baseAddress) {
+        return new PortAddressResolver() {
+            public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
+                String urlPattern = addressMap.get(new PortInfo(serviceName,portName));
+                return (urlPattern == null) ? null : baseAddress+urlPattern;
+            }
+        };
+    }
+
+
+    public T get(int index) {
+        return adapters.get(index);
+    }
+
+    public int size() {
+        return adapters.size();
+    }
+
+    private static class PortInfo {
+        private final QName serviceName;
+        private final String portName;
+
+        PortInfo(@NotNull QName serviceName, @NotNull String portName) {
+            this.serviceName = serviceName;
+            this.portName = portName;
+        }
+
+        @Override
+        public boolean equals(Object portInfo) {
+            if (portInfo instanceof PortInfo) {
+                PortInfo that = (PortInfo)portInfo;
+                return this.serviceName.equals(that.serviceName) && this.portName.equals(that.portName);
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return serviceName.hashCode()+portName.hashCode();
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/ResourceLoader.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/ResourceLoader.java
new file mode 100644
index 0000000..66951b2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/ResourceLoader.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport.http;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Set;
+
+/**
+ * Used to locate resources for {@link DeploymentDescriptorParser}.
+ *
+ * <p>
+ * This allows {@link DeploymentDescriptorParser} to be used outside a servlet container,
+ * but it still needs to work with a layout similar to the web application.
+ * If this can be abstracted away better, that would be nice.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface ResourceLoader {
+    /**
+     * Returns the actual location of the resource from the 'path'
+     * that represents a virtual locaion of a file inside a web application.
+     *
+     * @param path
+     *      Desiganates an absolute path within an web application, such as:
+     *      '/WEB-INF/web.xml' or some such.
+     *
+     * @return
+     *      the actual location, if found, or null if not found.
+     */
+    URL getResource(String path) throws MalformedURLException;
+
+    /**
+     * Gets the catalog XML file that should be consulted when
+     * loading resources from this {@link ResourceLoader}.
+     */
+    URL getCatalogFile() throws MalformedURLException;
+
+    /**
+     * Returns the list of files in the given directory.
+     *
+     * @return
+     *      null if the path is invalid. empty if the path didn't contain
+     *      any entry in it.
+     *
+     * @see javax.servlet.http.ServletContext#getResourcePaths(String)
+     */
+    Set<String> getResourcePaths(String path);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java
new file mode 100644
index 0000000..7989e0b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.transport.http;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+
+import javax.xml.ws.WebServiceContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * The view of an HTTP exchange from the point of view of JAX-WS.
+ *
+ * <p>
+ * Different HTTP server layer uses different implementations of this class
+ * so that JAX-WS can be shielded from individuality of such layers.
+ * This is an interface implemented as an abstract class, so that
+ * future versions of the JAX-WS RI can add new methods.
+ *
+ * <p>
+ * This class extends {@link PropertySet} so that a transport can
+ * expose its properties to the appliation and pipes. (This object
+ * will be added to {@link Packet#addSatellite(PropertySet)}.)
+ *
+ * @author Jitendra Kotamraju
+ */
+public abstract class WSHTTPConnection extends PropertySet {
+
+    public static final int OK=200;
+    public static final int ONEWAY=202;
+    public static final int UNSUPPORTED_MEDIA=415;
+    public static final int MALFORMED_XML=400;
+    public static final int INTERNAL_ERR=500;
+
+    /**
+     * Overwrites all the HTTP response headers written thus far.
+     *
+     * <p>
+     * The implementation should copy the contents of the {@link Map},
+     * rather than retaining a reference. The {@link Map} passed as a
+     * parameter may change after this method is invoked.
+     *
+     * <p>
+     * This method may be called repeatedly, although in normal use
+     * case that's rare (so the implementation is encourage to take
+     * advantage of this usage pattern to improve performance, if possible.)
+     *
+     * <p>
+     * Initially, no header is set.
+     *
+     * <p>
+     * This parameter is usually exposed to {@link WebServiceContext}
+     * as {@link Packet#OUTBOUND_TRANSPORT_HEADERS}, and thus it
+     * should ignore <tt>Content-Type</tt> and <tt>Content-Length</tt> headers.
+     *
+     * @param headers
+     *      See {@link HttpURLConnection#getHeaderFields()} for the format.
+     *      This parameter may not be null, but since the user application
+     *      code may invoke this method, a graceful error checking with
+     *      an helpful error message should be provided if it's actually null.
+     * @see #setContentTypeResponseHeader(String)
+     */
+    public abstract void setResponseHeaders(@NotNull Map<String,List<String>> headers);
+
+    /**
+     * Sets the <tt>"Content-Type"</tt> header.
+     *
+     * <p>
+     * If the Content-Type header has already been set, this method will overwrite
+     * the previously set value. If not, this method adds it.
+     *
+     * <p>
+     * Note that this method and {@link #setResponseHeaders(Map<String,List<String>>)}
+     * may be invoked in any arbitrary order.
+     *
+     * @param value
+     *      strings like <tt>"application/xml; charset=UTF-8"</tt> or
+     *      <tt>"image/jpeg"</tt>.
+     */
+    public abstract void setContentTypeResponseHeader(@NotNull String value);
+
+    /**
+     * Sets the HTTP response code like {@link #OK}.
+     *
+     * <p>
+     * While JAX-WS processes a {@link WSHTTPConnection}, it
+     * will at least call this method once to set a valid HTTP response code.
+     * Note that this method may be invoked multiple times (from user code),
+     * so do not consider the value to be final until {@link #getOutput()}
+     * is invoked.
+     */
+
+    public abstract void setStatus(int status);
+
+    /**
+     * Gets the last value set by {@link #setStatus(int)}.
+     *
+     * @return
+     *      if {@link #setStatus(int)} has not been invoked yet,
+     *      return 0.
+     */
+    // I know this is ugly method!
+    public abstract int getStatus();
+
+    /**
+     * Transport's underlying input stream.
+     *
+     * <p>
+     * This method will be invoked at most once by the JAX-WS RI to
+     * read the request body. If there's no request body, this method
+     * should return an empty {@link InputStream}.
+     *
+     * @return
+     *      the stream from which the request body will be read.
+     */
+    public abstract @NotNull InputStream getInput() throws IOException;
+
+    /**
+     * Transport's underlying output stream
+     *
+     * <p>
+     * This method will be invoked exactly once by the JAX-WS RI
+     * to start writing the response body (unless the processing aborts abnormally.)
+     * Even if there's no response body to write, this method will
+     * still be invoked only to be closed immediately.
+     *
+     * <p>
+     * Once this method is called, the status code and response
+     * headers will never change (IOW {@link #setStatus(int)},
+     * {@link #setResponseHeaders}, and {@link #setContentTypeResponseHeader(String)}
+     * will never be invoked.
+     */
+    public abstract @NotNull OutputStream getOutput() throws IOException;
+
+    /**
+     * Returns the {@link WebServiceContextDelegate} for this connection.
+     */
+    public abstract @NotNull WebServiceContextDelegate getWebServiceContextDelegate();
+
+    /**
+     * HTTP request method, such as "GET" or "POST".
+     */
+    public abstract @NotNull String getRequestMethod();
+
+    /**
+     * HTTP request headers.
+     *
+     * @deprecated
+     *      This is a potentially expensive operation.
+     *      Programs that want to access HTTP headers should consider using
+     *      other methods such as {@link #getRequestHeader(String)}.
+     *
+     * @return
+     *      can be empty but never null.
+     */
+    public abstract @NotNull Map<String,List<String>> getRequestHeaders();
+
+    /**
+     * @return
+     *      HTTP response headers.
+     */
+    public abstract Map<String,List<String>> getResponseHeaders();
+    /**
+     * Gets an HTTP request header.
+     *
+     * <p>
+     * if multiple headers are present, this method returns one of them.
+     * (The implementation is free to choose which one it returns.)
+     *
+     * @return
+     *      null if no header exists.
+     */
+    public abstract @Nullable String getRequestHeader(@NotNull String headerName);
+
+    /**
+     * HTTP Query string, such as "foo=bar", or null if none exists.
+     */
+    public abstract @Nullable String getQueryString();
+
+    /**
+     * Requested path. A string like "/foo/bar/baz"
+     */
+    public abstract @Nullable String getPathInfo();
+
+    /**
+     * Whether connection is HTTPS or not
+     *
+     * @return if the received request is on HTTPS, return true
+     *         else false
+     */
+    public abstract boolean isSecure();
+
+    private boolean closed;
+
+    /**
+     * Close the connection
+     */
+    public void close() {
+        this.closed = true;
+    }
+
+    /**
+     * Retuns whether connection is closed or not.
+     */
+    public boolean isClosed() {
+        return closed;
+    }
+
+    /**
+     * Subclasses are expected to override
+     *
+     * @return
+     */
+    public String getProtocol() {
+        return "HTTP/1.1";
+    }
+
+    /**
+     * Subclasses are expected to override
+     *
+     * @return
+     */
+    public void setContentLengthResponseHeader(int value) {
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/CookieJar.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/CookieJar.java
index 103e69d..5908086 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/CookieJar.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/CookieJar.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java
index 0972723..a7141de 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,242 +25,157 @@
 
 package com.sun.xml.internal.ws.transport.http.client;
 
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.client.BindingProviderProperties;
 import static com.sun.xml.internal.ws.client.BindingProviderProperties.*;
 import com.sun.xml.internal.ws.client.ClientTransportException;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.transport.WSConnectionImpl;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.transport.Headers;
+import com.sun.xml.internal.ws.developer.JAXWSProperties;
+import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.NotNull;
 
-import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
+import static javax.xml.bind.DatatypeConverter.printBase64Binary;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
 import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPConstants;
-import static javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY;
 import static javax.xml.ws.BindingProvider.SESSION_MAINTAIN_PROPERTY;
-import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.GZIPInputStream;
 
 /**
+ * TODO: this class seems to be pointless. Just merge it with {@link HttpTransportPipe}.
+ *
  * @author WS Development Team
  */
-public class HttpClientTransport extends WSConnectionImpl {
+final class HttpClientTransport {
 
+    // Need to use JAXB first to register DatatypeConverter
+    static {
+        try {
+            JAXBContext.newInstance().createUnmarshaller();
+        } catch(JAXBException je) {
+            // Nothing much can be done. Intentionally left empty
+        }
+    }
     private static String LAST_ENDPOINT = "";
     private static boolean redirect = true;
     private static final int START_REDIRECT_COUNT = 3;
     private static int redirectCount = START_REDIRECT_COUNT;
-    int statusCode;
+
+    /*package*/ int statusCode;
+    private final Map<String, List<String>> reqHeaders;
     private Map<String, List<String>> respHeaders = null;
 
-    public HttpClientTransport() {
-        this(null, new HashMap<String, Object>());
-    }
+    private OutputStream outputStream;
+    private boolean https;
+    private HttpURLConnection httpConnection = null;
+    private EndpointAddress endpoint = null;
+    private Packet context = null;
+    private CookieJar cookieJar = null;
+    private boolean isFailure = false;
+    private final Integer chunkSize;
 
-    public HttpClientTransport(OutputStream logStream, Map<String, Object> context) {
-        this.context = context;
-        _logStream = logStream;
 
-        String bindingId = (String) context.get(BINDING_ID_PROPERTY);
-        try {
-            if (bindingId == null)
-                bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-
-            if (bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING))
-                _messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-            else
-                _messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
-
-            endpoint = (String) context.get(ENDPOINT_ADDRESS_PROPERTY);
-        } catch (Exception e) {
-            throw new ClientTransportException("http.client.cannotCreateMessageFactory");
-        }
+    public HttpClientTransport(@NotNull Packet packet, @NotNull Map<String,List<String>> reqHeaders) {
+        endpoint = packet.endpointAddress;
+        context = packet;
+        this.reqHeaders = reqHeaders;
+        chunkSize = (Integer)context.invocationProperties.get(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE);
     }
 
     /**
      * Prepare the stream for HTTP request
      */
-    @Override
     public OutputStream getOutput() {
         try {
-            httpConnection = createHttpConnection(endpoint, context);
-            cookieJar = sendCookieAsNeeded();
-
-            // how to incorporate redirect processing: message dispatcher does not seem to tbe right place
-            String requestMethod = httpConnection.getRequestMethod();
-            boolean skipOut = ("GET".equalsIgnoreCase(requestMethod) ||
-                "HEAD".equalsIgnoreCase(requestMethod) ||
-                "DELETE".equalsIgnoreCase(requestMethod));
-            if (!skipOut)
+            createHttpConnection();
+            sendCookieAsNeeded();
+            // for "GET" request no need to get outputStream
+            if (requiresOutputStream()) {
                 outputStream = httpConnection.getOutputStream();
-            //if use getOutputStream method set as "POST"
-            //but for "Get" request no need to get outputStream
-            connectForResponse();
-
+                if (chunkSize != null) {
+                    outputStream = new WSChunkedOuputStream(outputStream, chunkSize);
+                }
+                List<String> contentEncoding = reqHeaders.get("Content-Encoding");
+                // TODO need to find out correct encoding based on q value - RFC 2616
+                if (contentEncoding != null && contentEncoding.get(0).contains("gzip")) {
+                    outputStream = new GZIPOutputStream(outputStream);
+                }
+            }
+            httpConnection.connect();
         } catch (Exception ex) {
-            throw new ClientTransportException("http.client.failed", ex);
+            throw new ClientTransportException(
+                ClientMessages.localizableHTTP_CLIENT_FAILED(ex),ex);
         }
 
         return outputStream;
     }
 
+    public void closeOutput() throws IOException {
+        if (outputStream != null) {
+            outputStream.close();
+            outputStream = null;
+        }
+    }
+
     /**
      * Get the response from HTTP connection and prepare the input stream for response
      */
-    @Override
     public InputStream getInput() {
         // response processing
 
         InputStream in;
         try {
             in = readResponse();
+            String contentEncoding = httpConnection.getContentEncoding();
+            if (contentEncoding != null && contentEncoding.contains("gzip")) {
+                in = new GZIPInputStream(in);
+            }
         } catch (IOException e) {
             if (statusCode == HttpURLConnection.HTTP_NO_CONTENT
                 || (isFailure
                 && statusCode != HttpURLConnection.HTTP_INTERNAL_ERROR)) {
                 try {
-                    throw new ClientTransportException("http.status.code",
-                        statusCode, httpConnection.getResponseMessage());
+                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(
+                        statusCode, httpConnection.getResponseMessage()));
                 } catch (IOException ex) {
-                    throw new ClientTransportException("http.status.code",
-                        statusCode, ex);
+                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(
+                        statusCode, ex));
                 }
             }
-            throw new ClientTransportException("http.client.failed",
-                e.getMessage());
+            throw new ClientTransportException(ClientMessages.localizableHTTP_CLIENT_FAILED(e),e);
         }
-        httpConnection = null;
-
         return in;
     }
 
-    @Override
-    public OutputStream getDebug() {
-        return _logStream;
-    }
-
-    @Override
     public Map<String, List<String>> getHeaders() {
         if (respHeaders != null) {
             return respHeaders;
         }
-        try {
-            isFailure = checkResponseCode();
-
-            respHeaders = collectResponseMimeHeaders();
-
-            saveCookieAsNeeded(cookieJar);
-            setHeaders(respHeaders);
-
-            return respHeaders;
-        } catch (IOException e) {
-            if (statusCode == HttpURLConnection.HTTP_NO_CONTENT
-                || (isFailure
-                && statusCode != HttpURLConnection.HTTP_INTERNAL_ERROR)) {
-                try {
-                    throw new ClientTransportException("http.status.code",
-                        new Object[]{
-                            statusCode,
-                            httpConnection.getResponseMessage()});
-                } catch (IOException ex) {
-                    throw new ClientTransportException("http.status.code",
-                        new Object[]{
-                            statusCode,
-                            ex});
-                }
-            }
-            throw new ClientTransportException("http.client.failed",
-                e.getMessage());
-        }
-
+        respHeaders = new Headers();
+        respHeaders.putAll(httpConnection.getHeaderFields());
+        return respHeaders;
     }
 
-//    public void invoke(String endpoint, SOAPMessageContext context)
-//            throws ClientTransportException {
-
-//        try {
-//            int statusCode = httpConnection.getResponseCode();
-//
-//            //http URL redirection does not redirect http requests
-//            //to an https endpoint probably due to a bug in the jdk
-//            //or by intent - to workaround this if an error code
-//            //of HTTP_MOVED_TEMP or HTTP_MOVED_PERM is received then
-//            //the jaxws client will reinvoke the original request
-//            //to the new endpoint - kw bug 4890118
-//            if (checkForRedirect(statusCode)) {
-//                redirectRequest(httpConnection, context);
-//                return;
-//            }
-//    }
-
-    protected InputStream readResponse()
-        throws IOException {
-        InputStream contentIn =
-            (isFailure
+    protected InputStream readResponse() throws IOException {
+        return (isFailure
                 ? httpConnection.getErrorStream()
                 : httpConnection.getInputStream());
-
-        ByteArrayBuffer bab = new ByteArrayBuffer();
-        if (contentIn != null) { // is this really possible?
-            bab.write(contentIn);
-            bab.close();
-        }
-
-        int length =
-            httpConnection.getContentLength() == -1
-                ? bab.size()
-                : httpConnection.getContentLength();
-
-        return bab.newInputStream(0, length);
-    }
-
-    protected Map<String, List<String>> collectResponseMimeHeaders() {
-        /*
-        MimeHeaders mimeHeaders = new MimeHeaders();
-        for (int i = 1; ; ++i) {
-            String key = httpConnection.getHeaderFieldKey(i);
-            if (key == null) {
-                break;
-            }
-            String value = httpConnection.getHeaderField(i);
-            try {
-                mimeHeaders.addHeader(key, value);
-            } catch (IllegalArgumentException e) {
-                // ignore headers that are illegal in MIME
-            }
-        }
-
-        Map<String, List<String>> headers = new HashMap<String, List<String>>();
-        for (Iterator iter = mimeHeaders.getAllHeaders(); iter.hasNext();) {
-            MimeHeader header = (MimeHeader)iter.next();
-            List<String> h = new ArrayList<String>();
-            h.add(header.getValue());
-            headers.put (header.getName (), h);
-        }
-        return headers;
-         */
-        return httpConnection.getHeaderFields();
-    }
-
-    protected void connectForResponse()
-        throws IOException {
-
-        httpConnection.connect();
     }
 
     /*
@@ -268,13 +183,10 @@
      * return message to be processed (i.e., in the case of an UNAUTHORIZED
      * response from the servlet or 404 not found)
      */
-    protected boolean checkResponseCode()
-        throws IOException {
-        boolean isFailure = false;
+    /*package*/void checkResponseCode() {
         try {
 
             statusCode = httpConnection.getResponseCode();
-            setStatus(statusCode);
 
             if ((httpConnection.getResponseCode()
                 == HttpURLConnection.HTTP_INTERNAL_ERROR)) {
@@ -285,51 +197,39 @@
                     == HttpURLConnection.HTTP_UNAUTHORIZED) {
 
                 // no soap message returned, so skip reading message and throw exception
-                throw new ClientTransportException("http.client.unauthorized",
-                    httpConnection.getResponseMessage());
+                throw new ClientTransportException(
+                    ClientMessages.localizableHTTP_CLIENT_UNAUTHORIZED(httpConnection.getResponseMessage()));
             } else if (
                 httpConnection.getResponseCode()
                     == HttpURLConnection.HTTP_NOT_FOUND) {
 
                 // no message returned, so skip reading message and throw exception
-                throw new ClientTransportException("http.not.found",
-                    httpConnection.getResponseMessage());
+                throw new ClientTransportException(
+                    ClientMessages.localizableHTTP_NOT_FOUND(httpConnection.getResponseMessage()));
             } else if (
                 (statusCode == HttpURLConnection.HTTP_MOVED_TEMP) ||
                     (statusCode == HttpURLConnection.HTTP_MOVED_PERM)) {
                 isFailure = true;
 
                 if (!redirect || (redirectCount <= 0)) {
-                    throw new ClientTransportException("http.status.code",
-                        new Object[]{
-                            statusCode,
-                            getStatusMessage(httpConnection)});
+                    throw new ClientTransportException(
+                        ClientMessages.localizableHTTP_STATUS_CODE(statusCode,getStatusMessage()));
                 }
             } else if (
                 statusCode < 200 || (statusCode >= 303 && statusCode < 500)) {
-                throw new ClientTransportException("http.status.code",
-                    new Object[]{
-                        statusCode,
-                        getStatusMessage(httpConnection)});
+                throw new ClientTransportException(
+                    ClientMessages.localizableHTTP_STATUS_CODE(statusCode,getStatusMessage()));
             } else if (statusCode >= 500) {
                 isFailure = true;
             }
         } catch (IOException e) {
             throw new WebServiceException(e);
-            // on JDK1.3.1_01, we end up here, but then getResponseCode() succeeds!
-//            if (httpConnection.getResponseCode()
-//                    == HttpURLConnection.HTTP_INTERNAL_ERROR) {
-//                isFailure = true;
-//            } else {
-//                throw e;
-//            }
         }
-
-        return isFailure;
+        // Hack for now
+        saveCookieAsNeeded();
     }
 
-    protected String getStatusMessage(HttpURLConnection httpConnection)
-        throws IOException {
+    private String getStatusMessage() throws IOException {
         int statusCode = httpConnection.getResponseCode();
         String message = httpConnection.getResponseMessage();
         if (statusCode == HttpURLConnection.HTTP_CREATED
@@ -343,108 +243,117 @@
         return message;
     }
 
-    protected CookieJar sendCookieAsNeeded() {
+    protected void sendCookieAsNeeded() {
         Boolean shouldMaintainSessionProperty =
-            (Boolean) context.get(SESSION_MAINTAIN_PROPERTY);
-        if (shouldMaintainSessionProperty == null) {
-            return null;
-        }
-        if (shouldMaintainSessionProperty.booleanValue()) {
-            CookieJar cookieJar = (CookieJar) context.get(HTTP_COOKIE_JAR);
+            (Boolean) context.invocationProperties.get(SESSION_MAINTAIN_PROPERTY);
+        if (shouldMaintainSessionProperty != null && shouldMaintainSessionProperty) {
+            cookieJar = (CookieJar) context.invocationProperties.get(HTTP_COOKIE_JAR);
             if (cookieJar == null) {
                 cookieJar = new CookieJar();
 
                 // need to store in binding's context so it is not lost
-                BindingProvider bp =
-                    (BindingProvider) context.get(JAXWS_CLIENT_HANDLE_PROPERTY);
-                bp.getRequestContext().put(HTTP_COOKIE_JAR, cookieJar);
+                context.proxy.getRequestContext().put(HTTP_COOKIE_JAR, cookieJar);
             }
             cookieJar.applyRelevantCookies(httpConnection);
-            return cookieJar;
-        } else {
-            return null;
         }
     }
 
-    protected void saveCookieAsNeeded(CookieJar cookieJar) {
+    private void saveCookieAsNeeded() {
         if (cookieJar != null) {
             cookieJar.recordAnyCookies(httpConnection);
         }
     }
 
-    protected HttpURLConnection createHttpConnection(String endpoint,
-                                                     Map<String, Object> context)
-        throws IOException {
 
-        boolean verification = false;
-        // does the client want client hostname verification by the service
-        String verificationProperty =
-            (String) context.get(HOSTNAME_VERIFICATION_PROPERTY);
-        if (verificationProperty != null) {
-            if (verificationProperty.equalsIgnoreCase("true"))
-                verification = true;
-        }
+    private void createHttpConnection() throws IOException {
 
         // does the client want request redirection to occur
         String redirectProperty =
-            (String) context.get(REDIRECT_REQUEST_PROPERTY);
+            (String) context.invocationProperties.get(REDIRECT_REQUEST_PROPERTY);
         if (redirectProperty != null) {
             if (redirectProperty.equalsIgnoreCase("false"))
                 redirect = false;
         }
 
-        checkEndpoints(endpoint);
+        checkEndpoints();
 
-        HttpURLConnection httpConnection = createConnection(endpoint);
+        httpConnection = (HttpURLConnection) endpoint.openConnection();
+        if (httpConnection instanceof HttpsURLConnection) {
+            https = true;
 
-        if (!verification) {
-            // for https hostname verification  - turn off by default
-            if (httpConnection instanceof HttpsURLConnection) {
+            boolean verification = false;
+            // does the client want client hostname verification by the service
+            String verificationProperty =
+                (String) context.invocationProperties.get(HOSTNAME_VERIFICATION_PROPERTY);
+            if (verificationProperty != null) {
+                if (verificationProperty.equalsIgnoreCase("true"))
+                    verification = true;
+            }
+            if (!verification) {
                 ((HttpsURLConnection) httpConnection).setHostnameVerifier(new HttpClientVerifier());
             }
+
+            // Set application's HostNameVerifier for this connection
+            HostnameVerifier verifier =
+                (HostnameVerifier) context.invocationProperties.get(JAXWSProperties.HOSTNAME_VERIFIER);
+            if (verifier != null) {
+                ((HttpsURLConnection) httpConnection).setHostnameVerifier(verifier);
+            }
+
+            // Set application's SocketFactory for this connection
+            SSLSocketFactory sslSocketFactory =
+                (SSLSocketFactory) context.invocationProperties.get(JAXWSProperties.SSL_SOCKET_FACTORY);
+            if (sslSocketFactory != null) {
+                ((HttpsURLConnection) httpConnection).setSSLSocketFactory(sslSocketFactory);
+            }
+
         }
 
+
+        writeBasicAuthAsNeeded(context, reqHeaders);
+
         // allow interaction with the web page - user may have to supply
         // username, password id web page is accessed from web browser
         httpConnection.setAllowUserInteraction(true);
+
         // enable input, output streams
         httpConnection.setDoOutput(true);
         httpConnection.setDoInput(true);
-        // the soap message is always sent as a Http POST
-        // HTTP Get is disallowed by BP 1.0
-        // needed for XML/HTTPBinding and SOAP12Binding
-        // for xml/http binding other methods are allowed.
-        // for Soap 1.2 "GET" is allowed.
-        String method = "POST";
-        String requestMethod = (String) context.get(MessageContext.HTTP_REQUEST_METHOD);
-        if (context.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(HTTPBinding.HTTP_BINDING)){
+
+        String requestMethod = (String) context.invocationProperties.get(MessageContext.HTTP_REQUEST_METHOD);
+        String method = (requestMethod != null) ? requestMethod : "POST";
+        httpConnection.setRequestMethod(method);
+
+        //this code or something similiar needs t be moved elsewhere for error checking
+        /*if (context.invocationProperties.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(HTTPBinding.HTTP_BINDING)){
             method = (requestMethod != null)?requestMethod:method;
         } else if
-            (context.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(SOAPBinding.SOAP12HTTP_BINDING) &&
+            (context.invocationProperties.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(SOAPBinding.SOAP12HTTP_BINDING) &&
             "GET".equalsIgnoreCase(requestMethod)) {
-            method = (requestMethod != null)?requestMethod:method;
         }
-        ((HttpURLConnection)httpConnection).setRequestMethod(method);
+       */
 
-        Integer reqTimeout = (Integer)context.get(BindingProviderProperties.REQUEST_TIMEOUT);
+        Integer reqTimeout = (Integer)context.invocationProperties.get(BindingProviderProperties.REQUEST_TIMEOUT);
         if (reqTimeout != null) {
             httpConnection.setReadTimeout(reqTimeout);
         }
 
-        // set the properties on HttpURLConnection
-        for (Map.Entry entry : super.getHeaders().entrySet()) {
-            httpConnection.addRequestProperty((String) entry.getKey(), ((List<String>) entry.getValue()).get(0));
+        Integer chunkSize = (Integer)context.invocationProperties.get(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE);
+        if (chunkSize != null) {
+            httpConnection.setChunkedStreamingMode(chunkSize);
         }
 
-        return httpConnection;
+        // set the properties on HttpURLConnection
+        for (Map.Entry<String, List<String>> entry : reqHeaders.entrySet()) {
+            httpConnection.addRequestProperty(entry.getKey(), entry.getValue().get(0));
+        }
     }
 
-    private java.net.HttpURLConnection createConnection(String endpoint)
-        throws IOException {
-        return (HttpURLConnection) new URL(endpoint).openConnection();
+    public boolean isSecure() {
+        return https;
     }
 
-//    private void redirectRequest(HttpURLConnection httpConnection, SOAPMessageContext context) {
+    //    private void redirectRequest(HttpURLConnection httpConnection, SOAPMessageContext context) {
 //        String redirectEndpoint = httpConnection.getHeaderField("Location");
 //        if (redirectEndpoint != null) {
 //            httpConnection.disconnect();
@@ -457,26 +366,94 @@
         return (((statusCode == 301) || (statusCode == 302)) && redirect && (redirectCount-- > 0));
     }
 
-    private void checkEndpoints(String currentEndpoint) {
-        if (!LAST_ENDPOINT.equalsIgnoreCase(currentEndpoint)) {
+    private void checkEndpoints() {
+        if (!LAST_ENDPOINT.equalsIgnoreCase(endpoint.toString())) {
             redirectCount = START_REDIRECT_COUNT;
-            LAST_ENDPOINT = currentEndpoint;
+            LAST_ENDPOINT = endpoint.toString();
         }
     }
 
+
+    private void writeBasicAuthAsNeeded(Packet context, Map<String, List<String>> reqHeaders) {
+        String user = (String) context.invocationProperties.get(BindingProvider.USERNAME_PROPERTY);
+        if (user != null) {
+            String pw = (String) context.invocationProperties.get(BindingProvider.PASSWORD_PROPERTY);
+            if (pw != null) {
+                StringBuffer buf = new StringBuffer(user);
+                buf.append(":");
+                buf.append(pw);
+                String creds = printBase64Binary(buf.toString().getBytes());
+                reqHeaders.put("Authorization", Collections.singletonList("Basic "+creds));
+            }
+        }
+    }
+
+    private boolean requiresOutputStream() {
+        return !(httpConnection.getRequestMethod().equalsIgnoreCase("GET") ||
+                httpConnection.getRequestMethod().equalsIgnoreCase("HEAD") ||
+                httpConnection.getRequestMethod().equalsIgnoreCase("DELETE"));
+    }
+
+    public @Nullable String getContentType() {
+        return httpConnection.getContentType();
+    }
+
     // overide default SSL HttpClientVerifier to always return true
     // effectively overiding Hostname client verification when using SSL
-    static class HttpClientVerifier implements HostnameVerifier {
+    private static class HttpClientVerifier implements HostnameVerifier {
         public boolean verify(String s, SSLSession sslSession) {
             return true;
         }
     }
 
-    private MessageFactory _messageFactory;
-    HttpURLConnection httpConnection = null;
-    String endpoint = null;
-    Map<String, Object> context = null;
-    CookieJar cookieJar = null;
-    boolean isFailure = false;
-    OutputStream _logStream = null;
+    /**
+     * HttpURLConnection.getOuputStream() returns sun.net.www.http.ChunkedOuputStream in chunked
+     * streaming mode. If you call ChunkedOuputStream.write(byte[20MB], int, int), then the whole data
+     * is kept in memory. This wraps the ChunkedOuputStream so that it writes only small
+     * chunks.
+     */
+    private static final class WSChunkedOuputStream extends OutputStream {
+        final OutputStream actual;
+        final int chunkSize;
+
+        WSChunkedOuputStream(OutputStream actual, int chunkSize) {
+            this.actual = actual;
+            this.chunkSize = chunkSize;
+        }
+
+        @Override
+        public void write(byte b[], int off, int len) throws IOException {
+            int sent = 0;
+            while(sent < len) {
+                int chunk = len-sent;
+                if (chunk > chunkSize) {
+                    chunk = chunkSize;
+                }
+                actual.write(b, off, chunk);
+                off += chunk;
+                sent += chunk;
+            }
+        }
+
+        @Override
+        public void write(byte b[]) throws IOException {
+            write(b, 0, b.length);
+        }
+
+        @Override
+        public void write(int b) throws IOException {
+            actual.write(b);
+        }
+
+        @Override
+        public void flush() throws IOException {
+            actual.flush();
+        }
+
+        @Override
+        public void close() throws IOException {
+            actual.close();
+        }
+    }
+
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransportFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransportFactory.java
deleted file mode 100644
index a0209ec..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransportFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.http.client;
-
-import java.io.OutputStream;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import java.util.Map;
-
-import javax.xml.ws.soap.SOAPBinding;
-
-import static com.sun.xml.internal.ws.client.BindingProviderProperties.BINDING_ID_PROPERTY;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import java.util.HashMap;
-
-/**
- * @author WS Development Team
- */
-public class HttpClientTransportFactory implements ClientTransportFactory {
-
-
-    public HttpClientTransportFactory() {
-        this(null);
-    }
-
-    public HttpClientTransportFactory(OutputStream logStream) {
-        _logStream = logStream;
-    }
-
-    /*
-    public WSConnection create() {
-        Map<String, Object> context = new HashMap<String, Object>();
-        context.put(BINDING_ID_PROPERTY, SOAPBinding.SOAP11HTTP_BINDING);
-
-        return new HttpClientTransport(_logStream, context);
-    }
-     */
-
-    /**
-     * Binding Id, Endpoint address and other metadata is in the property bag
-     */
-    public WSConnection create(Map<String, Object> context) {
-        return new HttpClientTransport(_logStream, context);
-    }
-
-    private OutputStream _logStream;
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpCookie.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpCookie.java
index 8688791..c7aa4b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpCookie.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpCookie.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java
new file mode 100644
index 0000000..c0a9574
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.transport.http.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.PropertySet;
+import com.sun.xml.internal.ws.client.ResponseContext;
+
+import javax.xml.ws.handler.MessageContext;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Properties exposed from {@link HttpTransportPipe} for {@link ResponseContext}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class HttpResponseProperties extends PropertySet {
+
+    private final HttpClientTransport deferedCon;
+
+    public HttpResponseProperties(@NotNull HttpClientTransport con) {
+        this.deferedCon = con;
+    }
+
+    @Property(MessageContext.HTTP_RESPONSE_HEADERS)
+    public Map<String, List<String>> getResponseHeaders() {
+        return deferedCon.getHeaders();
+    }
+
+    @Property(MessageContext.HTTP_RESPONSE_CODE)
+    public int getResponseCode() {
+        return deferedCon.statusCode;
+    }
+
+    @Override
+    protected PropertyMap getPropertyMap() {
+        return model;
+    }
+
+    private static final PropertyMap model;
+
+    static {
+        model = parse(HttpResponseProperties.class);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java
new file mode 100644
index 0000000..29d8e29
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.transport.http.client;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.Codec;
+import com.sun.xml.internal.ws.api.pipe.ContentType;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * {@link Pipe} and {@link Tube} that sends a request to a remote HTTP server.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class HttpTransportPipe extends AbstractTubeImpl {
+
+    private final Codec codec;
+
+    public HttpTransportPipe(Codec codec) {
+        this.codec = codec;
+    }
+
+    /**
+     * Copy constructor for {@link Tube#copy(TubeCloner)}.
+     */
+    private HttpTransportPipe(HttpTransportPipe that, TubeCloner cloner) {
+        this( that.codec.copy() );
+        cloner.add(that,this);
+    }
+
+    public NextAction processException(@NotNull Throwable t) {
+        throw new IllegalStateException("HttpTransportPipe's processException shouldn't be called.");
+    }
+
+    public NextAction processRequest(@NotNull Packet request) {
+        return doReturnWith(process(request));
+    }
+
+    public NextAction processResponse(@NotNull Packet response) {
+        throw new IllegalStateException("HttpTransportPipe's processResponse shouldn't be called.");
+    }
+
+    public Packet process(Packet request) {
+        HttpClientTransport con;
+        try {
+            // get transport headers from message
+            Map<String, List<String>> reqHeaders = (Map<String, List<String>>) request.invocationProperties.get(MessageContext.HTTP_REQUEST_HEADERS);
+            //assign empty map if its null
+            if(reqHeaders == null){
+                reqHeaders = new HashMap<String, List<String>>();
+            }
+
+            con = new HttpClientTransport(request,reqHeaders);
+            request.addSatellite(new HttpResponseProperties(con));
+
+            ContentType ct = codec.getStaticContentType(request);
+            if (ct == null) {
+                ByteArrayBuffer buf = new ByteArrayBuffer();
+
+                ct = codec.encode(request, buf);
+                // data size is available, set it as Content-Length
+                reqHeaders.put("Content-Length", Collections.singletonList(Integer.toString(buf.size())));
+                reqHeaders.put("Content-Type", Collections.singletonList(ct.getContentType()));
+                if (ct.getAcceptHeader() != null) {
+                    reqHeaders.put("Accept", Collections.singletonList(ct.getAcceptHeader()));
+                }
+                writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(),request);
+
+                if(dump)
+                    dump(buf, "HTTP request", reqHeaders);
+
+                buf.writeTo(con.getOutput());
+            } else {
+                // Set static Content-Type
+                reqHeaders.put("Content-Type", Collections.singletonList(ct.getContentType()));
+                if (ct.getAcceptHeader() != null) {
+                    reqHeaders.put("Accept", Collections.singletonList(ct.getAcceptHeader()));
+                }
+                writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(), request);
+
+                if(dump) {
+                    ByteArrayBuffer buf = new ByteArrayBuffer();
+                    codec.encode(request, buf);
+                    dump(buf, "HTTP request", reqHeaders);
+                    OutputStream out = con.getOutput();
+                    if (out != null) {
+                        buf.writeTo(out);
+                    }
+                } else {
+                    OutputStream os = con.getOutput();
+                    if (os != null) {
+                        codec.encode(request, os);
+                    }
+                }
+            }
+
+            con.closeOutput();
+
+            con.checkResponseCode();
+            if (con.statusCode== WSHTTPConnection.ONEWAY) {
+                return request.createClientResponse(null);    // one way. no response given.
+            }
+            String contentType = con.getContentType();
+            if (contentType == null) {
+                throw new WebServiceException("No Content-type in the header!");
+            }
+
+            // TODO check if returned MIME type is the same as that which was sent
+            // or is acceptable if an Accept header was used
+            Packet reply = request.createClientResponse(null);
+            //reply.addSatellite(new HttpResponseProperties(con));
+            reply.wasTransportSecure = con.isSecure();
+            InputStream response = con.getInput();
+            if(dump) {
+                ByteArrayBuffer buf = new ByteArrayBuffer();
+                buf.write(response);
+                dump(buf,"HTTP response "+con.statusCode, con.getHeaders());
+                response = buf.newInputStream();
+            }
+            codec.decode(response, contentType, reply);
+            return reply;
+        } catch(WebServiceException wex) {
+            throw wex;
+        } catch(Exception ex) {
+            throw new WebServiceException(ex);
+        }
+    }
+
+    /**
+     * write SOAPAction header if the soapAction parameter is non-null or BindingProvider properties set.
+     * BindingProvider properties take precedence.
+     */
+    private void writeSOAPAction(Map<String, List<String>> reqHeaders, String soapAction, Packet packet) {
+        if (soapAction != null)
+            reqHeaders.put("SOAPAction", Collections.singletonList(soapAction));
+        else
+            reqHeaders.put("SOAPAction", Collections.singletonList("\"\""));
+    }
+
+    public void preDestroy() {
+        // nothing to do. Intentionally left empty.
+    }
+
+    public HttpTransportPipe copy(TubeCloner cloner) {
+        return new HttpTransportPipe(this,cloner);
+    }
+
+    private void dump(ByteArrayBuffer buf, String caption, Map<String, List<String>> headers) throws IOException {
+        System.out.println("---["+caption +"]---");
+        for (Entry<String,List<String>> header : headers.entrySet()) {
+            if(header.getValue().isEmpty()) {
+                // I don't think this is legal, but let's just dump it,
+                // as the point of the dump is to uncover problems.
+                System.out.println(header.getValue());
+            } else {
+                for (String value : header.getValue()) {
+                    System.out.println(header.getKey()+": "+value);
+                }
+            }
+        }
+
+        buf.writeTo(System.out);
+        System.out.println("--------------------");
+    }
+
+    /**
+     * Dumps what goes across HTTP transport.
+     */
+    public static boolean dump;
+
+    static {
+        boolean b;
+        try {
+            b = Boolean.getBoolean(HttpTransportPipe.class.getName()+".dump");
+        } catch( Throwable t ) {
+            b = false;
+        }
+        dump = b;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/RfcDateParser.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/RfcDateParser.java
index 1170ed5..6de9f97 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/RfcDateParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/RfcDateParser.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 package com.sun.xml.internal.ws.transport.http.client;
 
 import java.text.SimpleDateFormat;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
@@ -38,9 +39,7 @@
  *
  * @author WS Development Team
  */
-public class RfcDateParser {
-
-    private static final String debugProp = "hotjava.debug.RfcDateParser";
+final class RfcDateParser {
     private boolean isGMT = false;
     static final String[] standardFormats =
         { "EEEE', 'dd-MMM-yy HH:mm:ss z", // RFC 850 (obsoleted by 1036)
@@ -108,7 +107,7 @@
 
         try {
             return df.parse(dateString);
-        } catch (Exception e) {
+        } catch (ParseException e) {
             return null;
         }
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointDocInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointDocInfo.java
deleted file mode 100644
index 561b9ca..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointDocInfo.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.transport.http.server;
-
-import com.sun.xml.internal.ws.server.DocInfo;
-import com.sun.xml.internal.ws.wsdl.parser.Service;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.net.URL;
-
-public class EndpointDocInfo implements DocInfo {
-    private URL resourceUrl;
-    private String queryString;
-    private ByteArrayBuffer buf;
-    private DOC_TYPE docType;
-    private String tns;
-    private Service service;
-    private boolean portType;
-
-    public EndpointDocInfo(URL resourceUrl, ByteArrayBuffer buf) {
-        this.resourceUrl = resourceUrl;
-        this.buf = buf;
-    }
-
-    public InputStream getDoc() {
-        return buf.newInputStream();
-    }
-
-    public String getPath() {
-        return null;
-    }
-
-    public String getQueryString() {
-        return queryString;
-    }
-
-    public void setQueryString(String queryString) {
-        this.queryString = queryString;
-    }
-
-    public void setDocType(DOC_TYPE docType) {
-        this.docType = docType;
-    }
-
-    public DOC_TYPE getDocType() {
-        return docType;
-    }
-
-    public void setTargetNamespace(String tns) {
-        this.tns = tns;
-    }
-
-    public String getTargetNamespace() {
-        return tns;
-    }
-
-    public void setService(Service service) {
-        this.service = service;
-    }
-
-    public Service getService() {
-        return service;
-    }
-
-    public void setHavingPortType(boolean portType) {
-        this.portType = portType;
-    }
-
-    public boolean isHavingPortType() {
-        return portType;
-    }
-
-    public URL getUrl() {
-        return resourceUrl;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointEntityResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointEntityResolver.java
deleted file mode 100644
index cdad48b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointEntityResolver.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.http.server;
-
-import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
-import com.sun.xml.internal.ws.server.DocInfo;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- *
- * @author WS Developement Team
- */
-public class EndpointEntityResolver implements EntityResolver {
-
-    private EntityResolver catalogResolver;
-    private Map<String, DocInfo> metadata;
-
-    /*
-     * Assumes Source objects can be reused multiple times
-     */
-    public EndpointEntityResolver(Map<String, DocInfo> metadata) {
-        this.metadata = metadata;
-        catalogResolver = XmlUtil.createDefaultCatalogResolver();
-    }
-
-    /*
-     * It resolves the systemId in the metadata first. If it is not found, then
-     * it tries to resolve in catalog
-     */
-    public InputSource resolveEntity (String publicId, String systemId)
-        throws SAXException, IOException {
-        if (systemId != null) {
-            DocInfo docInfo = metadata.get(systemId);
-            if (docInfo != null) {
-                InputStream in = docInfo.getDoc();
-                InputSource is = new InputSource(in);
-                is.setSystemId(systemId);
-                return is;
-            }
-        }
-        return catalogResolver.resolveEntity(publicId, systemId);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
index 1c6615a..b7b1c3e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java
@@ -1,6 +1,5 @@
-
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,39 +25,94 @@
 
 package com.sun.xml.internal.ws.transport.http.server;
 
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
 import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import java.net.MalformedURLException;
-import java.net.URL;
+import com.sun.xml.internal.ws.api.server.InstanceResolver;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.server.EndpointFactory;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import com.sun.istack.internal.NotNull;
 
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.Binding;
+import java.net.MalformedURLException;
+
+import javax.xml.namespace.QName;
 import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.ws.*;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Executor;
-import javax.xml.ws.WebServicePermission;
+
+import org.xml.sax.EntityResolver;
+import org.w3c.dom.Element;
 
 
 /**
+ * Implements {@link Endpoint}.
+ * <p/>
+ * <p/>
+ * This class accumulates the information necessary to create
+ * {@link WSEndpoint}, and then when {@link #publish} method
+ * is called it will be created.
+ * <p/>
+ * <p/>
+ * This object also allows accumulated information to be retrieved.
  *
- * @author WS Development Team
+ * @author Jitendra Kotamraju
  */
 public class EndpointImpl extends Endpoint {
 
     private static final WebServicePermission ENDPOINT_PUBLISH_PERMISSION =
-        new WebServicePermission("publishEndpoint");
-    private Object actualEndpoint;        // Don't declare as HttpEndpoint type
-    private Executor executor;
-    private boolean published;
-    private boolean stopped;
-    private final com.sun.xml.internal.ws.spi.runtime.Binding binding;
-    private final Object implementor;
-    private Map<String, Object> properties;
-    private java.util.List<Source> metadata;
+            new WebServicePermission("publishEndpoint");
 
-    public EndpointImpl(String bindingId, Object impl) {
-        this.implementor = impl;
-        this.binding = BindingImpl.getBinding(bindingId, impl.getClass(), null, false);
+    /**
+     * Once the service is published, this field will
+     * be set to the {@link HttpEndpoint} instance.
+     * <p/>
+     * But don't declare the type as {@link HttpEndpoint}
+     * to avoid static type dependency that cause the class loading to
+     * fail if the LW HTTP server doesn't exist.
+     */
+    private Object actualEndpoint;
+
+    // information accumulated for creating WSEndpoint
+    private final WSBinding binding;
+    private final Object implementor;
+    private List<Source> metadata;
+    private Executor executor;
+    private Map<String, Object> properties = Collections.emptyMap(); // always non-null
+    private boolean stopped;
+
+
+    public EndpointImpl(@NotNull BindingID bindingId, @NotNull Object impl) {
+        binding = BindingImpl.create(bindingId);
+        implementor = impl;
+    }
+
+    /**
+     * Wraps an already created {@link WSEndpoint} into an {@link EndpointImpl},
+     * and immediately publishes it with the given context.
+     *
+     * @deprecated This is a backdoor method. Don't use it unless you know what you are doing.
+     */
+    public EndpointImpl(WSEndpoint wse, Object serverContext) {
+        actualEndpoint = new HttpEndpoint(wse, executor);
+        ((HttpEndpoint) actualEndpoint).publish(serverContext);
+        binding = wse.getBinding();
+        implementor = null; // this violates the semantics, but hey, this is a backdoor.
     }
 
     public Binding getBinding() {
@@ -75,63 +129,46 @@
         try {
             url = new URL(address);
         } catch (MalformedURLException ex) {
-            throw new IllegalArgumentException("Cannot create URL for this address "+address);
+            throw new IllegalArgumentException("Cannot create URL for this address " + address);
         }
         if (!url.getProtocol().equals("http")) {
-            throw new IllegalArgumentException(url.getProtocol()+" protocol based address is not supported");
+            throw new IllegalArgumentException(url.getProtocol() + " protocol based address is not supported");
         }
         if (!url.getPath().startsWith("/")) {
-            throw new IllegalArgumentException("Incorrect WebService address="+address+
+            throw new IllegalArgumentException("Incorrect WebService address=" + address +
                     ". The address's path should start with /");
         }
-        checkPlatform();
-        // Don't load HttpEndpoint class before as it may load HttpServer classes
-        actualEndpoint = new HttpEndpoint(implementor, binding, metadata, properties, executor);
-        ((HttpEndpoint)actualEndpoint).publish(address);
-        published = true;
+        createEndpoint();
+        ((HttpEndpoint) actualEndpoint).publish(address);
     }
 
     public void publish(Object serverContext) {
         canPublish();
-        checkPlatform();
         if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) {
-            throw new IllegalArgumentException(serverContext.getClass()+" is not a supported context.");
+            throw new IllegalArgumentException(serverContext.getClass() + " is not a supported context.");
         }
-        // Don't load HttpEndpoint class before as it may load HttpServer classes
-        actualEndpoint = new HttpEndpoint(implementor, binding, metadata, properties, executor);
-        ((HttpEndpoint)actualEndpoint).publish(serverContext);
-        published = true;
+        createEndpoint();
+        ((HttpEndpoint) actualEndpoint).publish(serverContext);
     }
 
     public void stop() {
-        if (published) {
-            ((HttpEndpoint)actualEndpoint).stop();
-            published = false;
+        if (isPublished()) {
+            ((HttpEndpoint) actualEndpoint).stop();
+            actualEndpoint = null;
             stopped = true;
         }
     }
 
     public boolean isPublished() {
-        return published;
+        return actualEndpoint != null;
     }
 
-    private void canPublish() {
-        if (published) {
-            throw new IllegalStateException(
-                "Cannot publish this endpoint. Endpoint has been already published.");
-        }
-        if (stopped) {
-            throw new IllegalStateException(
-                "Cannot publish this endpoint. Endpoint has been already stopped.");
-        }
-    }
-
-    public java.util.List<Source> getMetadata() {
+    public List<Source> getMetadata() {
         return metadata;
     }
 
     public void setMetadata(java.util.List<Source> metadata) {
-        if (published) {
+        if (isPublished()) {
             throw new IllegalStateException("Cannot set Metadata. Endpoint is already published");
         }
         this.metadata = metadata;
@@ -146,19 +183,18 @@
     }
 
     public Map<String, Object> getProperties() {
-        return properties;
+        return new HashMap<String, Object>(properties);
     }
 
     public void setProperties(Map<String, Object> map) {
-        this.properties = map;
+        this.properties = new HashMap<String, Object>(map);
     }
 
-    /**
-     * Checks the permission of "publishEndpoint" before accessing HTTP classes.
-     * Also it checks if there is an available HTTP server implementation.
-     */
-    private void checkPlatform() {
-
+    /*
+    * Checks the permission of "publishEndpoint" before accessing HTTP classes.
+    * Also it checks if there is an available HTTP server implementation.
+    */
+    private void createEndpoint() {
         // Checks permission for "publishEndpoint"
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
@@ -168,10 +204,98 @@
         // See if HttpServer implementation is available
         try {
             Class.forName("com.sun.net.httpserver.HttpServer");
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new UnsupportedOperationException("NOT SUPPORTED");
         }
 
+        WSEndpoint wse = WSEndpoint.create(
+                (Class<?>) implementor.getClass(), true,
+                InstanceResolver.createSingleton(implementor).createInvoker(),
+                getProperty(QName.class, Endpoint.WSDL_SERVICE),
+                getProperty(QName.class, Endpoint.WSDL_PORT),
+                null /* no container */,
+                binding,
+                getPrimaryWsdl(),
+                buildDocList(),
+                (EntityResolver) null
+        );
+        // Don't load HttpEndpoint class before as it may load HttpServer classes
+        actualEndpoint = new HttpEndpoint(wse, executor);
     }
 
+    private <T> T getProperty(Class<T> type, String key) {
+        Object o = properties.get(key);
+        if (o == null) return null;
+        if (type.isInstance(o))
+            return type.cast(o);
+        else
+            throw new IllegalArgumentException("Property " + key + " has to be of type " + type);   // i18n
+    }
+
+    /**
+     * Convert metadata sources using identity transform. So that we can
+     * reuse the Source object multiple times.
+     */
+    private List<SDDocumentSource> buildDocList() {
+        List<SDDocumentSource> r = new ArrayList<SDDocumentSource>();
+
+        if (metadata != null) {
+            Transformer transformer = XmlUtil.newTransformer();
+            for (Source source : metadata) {
+                try {
+                    XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
+                    transformer.transform(source, xsbr);
+                    String systemId = source.getSystemId();
+
+                    r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
+                } catch (TransformerException te) {
+                    throw new ServerRtException("server.rt.err", te);
+                } catch (IOException te) {
+                    throw new ServerRtException("server.rt.err", te);
+                }
+            }
+        }
+
+        return r;
+    }
+
+    /**
+     * Gets wsdl from @WebService or @WebServiceProvider
+     */
+    private @Nullable SDDocumentSource getPrimaryWsdl() {
+        Class implType = implementor.getClass();
+        // Takes care of @WebService, @WebServiceProvider's wsdlLocation
+        String wsdlLocation = EndpointFactory.getWsdlLocation(implType);
+        if (wsdlLocation != null) {
+            ClassLoader cl = implType.getClassLoader();
+            URL url = cl.getResource(wsdlLocation);
+            if (url != null) {
+                return SDDocumentSource.create(url);
+            }
+            throw new ServerRtException("cannot.load.wsdl", wsdlLocation);
+        }
+        return null;
+    }
+
+    private void canPublish() {
+        if (isPublished()) {
+            throw new IllegalStateException(
+                    "Cannot publish this endpoint. Endpoint has been already published.");
+        }
+        if (stopped) {
+            throw new IllegalStateException(
+                    "Cannot publish this endpoint. Endpoint has been already stopped.");
+        }
+    }
+
+    public EndpointReference getEndpointReference(Element...referenceParameters) {
+        return getEndpointReference(W3CEndpointReference.class, referenceParameters);
+    }
+
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
+        if (!isPublished()) {
+            throw new WebServiceException("Endpoint is not published yet");
+        }
+        return ((HttpEndpoint)actualEndpoint).getEndpointReference(clazz,referenceParameters);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java
index 6f2d872..444ac44 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,265 +26,73 @@
 package com.sun.xml.internal.ws.transport.http.server;
 
 import com.sun.net.httpserver.HttpContext;
-import com.sun.xml.internal.ws.server.DocInfo;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.transport.http.HttpAdapter;
+import com.sun.xml.internal.ws.transport.http.HttpAdapterList;
 import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.server.Tie;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.concurrent.Executor;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.EntityResolver;
+import com.sun.xml.internal.ws.server.WSEndpointImpl;
 
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.Endpoint;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.logging.Logger;
-import com.sun.xml.internal.ws.spi.runtime.Binding;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.EndpointReference;
+import java.util.concurrent.Executor;
+import java.io.IOException;
+
+import org.w3c.dom.Element;
 
 /**
+ * Hides {@link HttpContext} so that {@link EndpointImpl}
+ * may load even without {@link HttpContext}.
  *
- * @author WS Development Team
+ * TODO: But what's the point? If Light-weight HTTP server isn't present,
+ * all the publish operations will fail way. Why is it better to defer
+ * the failure, as opposed to cause the failure as earyl as possible? -KK
+ *
+ * @author Jitendra Kotamraju
  */
-public class HttpEndpoint {
-
-    private static final Logger logger =
-        Logger.getLogger(
-            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
-
+final class HttpEndpoint {
     private String address;
     private HttpContext httpContext;
-    private final RuntimeEndpointInfo endpointInfo;
-    private String primaryWsdl;
-    private Executor executor;
-    private final Map<String, Object> properties;
+    private final HttpAdapter adapter;
+    private final Executor executor;
 
-    private static final int MAX_THREADS = 5;
-
-    public HttpEndpoint(Object implementor, Binding binding, List<Source>metadata, Map<String, Object> properties, Executor executor) {
-        endpointInfo = new RuntimeEndpointInfo();
-        endpointInfo.setImplementor(implementor);
-        endpointInfo.setImplementorClass(implementor.getClass());
-        endpointInfo.setBinding(binding);
-        endpointInfo.setUrlPattern("");
-        endpointInfo.setMetadata(metadata);
-        this.properties = properties;
+    public HttpEndpoint(WSEndpoint endpoint, Executor executor) {
         this.executor = executor;
-    }
-
-    /**
-     * If Service Name is in properties, set it on RuntimeEndpointInfo
-     */
-    private void setServiceName() {
-        if (properties != null) {
-            QName serviceName = (QName)properties.get(Endpoint.WSDL_SERVICE);
-            if (serviceName != null) {
-                endpointInfo.setServiceName(serviceName);
-            }
-        }
-    }
-
-    /**
-     * If Port Name is in properties, set it on RuntimeEndpointInfo
-     */
-    private void setPortName() {
-        if (properties != null) {
-            QName portName = (QName)properties.get(Endpoint.WSDL_PORT);
-            if (portName != null) {
-                endpointInfo.setPortName(portName);
-            }
-        }
-    }
-
-    /**
-     * Convert metadata sources using identity transform. So that we can
-     * reuse the Source object multiple times.
-     */
-    private void setDocInfo() throws MalformedURLException {
-        List<Source> metadata = endpointInfo.getMetadata();
-
-        // Takes care of @WebService, @WebServiceProvider's wsdlLocation
-        String wsdlLocation = endpointInfo.getWsdlLocation();
-        if (wsdlLocation != null) {
-            ClassLoader cl = endpointInfo.getImplementorClass().getClassLoader();
-            URL url = cl.getResource(wsdlLocation);
-            if (url == null) {
-                throw new ServerRtException("cannot.load.wsdl", wsdlLocation);
-            } else {
-                Source source = null;
-                try {
-                    source = new StreamSource(url.openStream());
-                } catch(IOException ioe) {
-                    throw new ServerRtException("server.rt.err", ioe);
-                }
-                primaryWsdl = url.toExternalForm();
-                source.setSystemId(primaryWsdl);
-                if (metadata == null) {
-                    metadata = new ArrayList<Source>();
-                    endpointInfo.setMetadata(metadata);
-                }
-                metadata.add(source);
-            }
-        }
-
-        // Creates DocInfo for each metdata Source
-        if (metadata != null) {
-            Map<String, DocInfo> newMetadata = new HashMap<String, DocInfo>();
-            Transformer transformer = XmlUtil.newTransformer();
-            for(Source source: metadata) {
-                ByteArrayBuffer baos = new ByteArrayBuffer();
-                try {
-                    transformer.transform(source, new StreamResult(baos));
-                    baos.close();
-                } catch (TransformerException te) {
-                    throw new ServerRtException("server.rt.err",te);
-                }
-                String systemId = source.getSystemId();
-                URL url;
-                try {
-                    url = new URL(systemId);
-                } catch(MalformedURLException me) {
-                    logger.severe("Metadata Source's systemId="+systemId+
-                            " is incorrect. Provide a correct one");
-                    throw me;
-                }
-                EndpointDocInfo docInfo = new EndpointDocInfo(url, baos);
-                DocInfo old = newMetadata.put(systemId, docInfo);
-                if (old != null) {
-                    logger.warning("Duplicate Source objects for systemId="+systemId+" in metadata");
-                }
-            }
-            endpointInfo.setMetadata(newMetadata);
-        }
-    }
-
-    /**
-     * Finds primary WSDL
-     */
-    private void findPrimaryWSDL() throws Exception {
-        Map<String, DocInfo> metadata = endpointInfo.getDocMetadata();
-        // Checks whether the wsdlLocation resource is a primary wsdl
-        if (primaryWsdl != null) {
-            DocInfo docInfo = metadata.get(primaryWsdl);
-            if (docInfo.getService() == null) {
-                throw new ServerRtException("not.primary.wsdl", primaryWsdl);
-            }
-        }
-        // Checks whether metadata contains duplicate primary wsdls or abstract wsdsl
-        if (metadata != null) {
-            boolean concreteWsdl = false;
-            boolean abstractWsdl = false;
-            for(Entry<String, DocInfo> entry: metadata.entrySet()) {
-                DocInfo docInfo = entry.getValue();
-                if (docInfo.getService() != null) {
-                    if (!concreteWsdl) {
-                        concreteWsdl = true;
-                    } else {
-                        throw new ServerRtException("duplicate.primary.wsdl", entry.getKey());
-                    }
-                }
-                if (docInfo.isHavingPortType()) {
-                    if (!abstractWsdl) {
-                        abstractWsdl = true;
-                    } else {
-                        throw new ServerRtException("duplicate.abstract.wsdl", entry.getKey());
-                    }
-                }
-            }
-        }
-        if (metadata != null) {
-            for(Entry<String, DocInfo> entry: metadata.entrySet()) {
-                DocInfo docInfo = entry.getValue();
-                if (docInfo.getService() != null) {
-                    // Donot generate any WSDL or Schema document
-                    URL wsdlUrl = new URL(entry.getKey());
-                    EntityResolver resolver = new EndpointEntityResolver(metadata);
-                    endpointInfo.setWsdlInfo(wsdlUrl, resolver);
-                    docInfo.setQueryString("wsdl");
-                    break;
-                }
-            }
-        }
-    }
-
-    /**
-     * Fills RuntimeEndpointInfo with ServiceName, and PortName from properties
-     */
-    public void fillEndpointInfo() throws Exception {
-        // set Service Name from properties on RuntimeEndpointInfo
-        setServiceName();
-
-        // set Port Name from properties on RuntimeEndpointInfo
-        setPortName();
-
-        // Sets the correct Service Name
-        endpointInfo.doServiceNameProcessing();
-
-        // Sets the correct Port Name
-        endpointInfo.doPortNameProcessing();
-
-        // Sets the PortType Name
-        endpointInfo.doPortTypeNameProcessing();
-
-        // Creates DocInfo from metadata and sets it on RuntimeEndpointinfo
-        setDocInfo();
-
-        // Fill DocInfo with docuent info : WSDL or Schema, targetNS etc.
-        RuntimeEndpointInfo.fillDocInfo(endpointInfo);
-
-        // Finds primary WSDL from metadata documents
-        findPrimaryWSDL();
-
-    }
-
-    /**
-     * Generates necessary WSDL and Schema documents
-     */
-    public void generateWSDLDocs() {
-        if (endpointInfo.needWSDLGeneration()) {
-            endpointInfo.generateWSDL();
-        }
+        this.adapter = HttpAdapter.createAlone(endpoint);
     }
 
     public void publish(String address) {
-        try {
-            this.address = address;
-            httpContext = ServerMgr.getInstance().createContext(address);
-            try {
-                publish(httpContext);
-            } catch(Exception e) {
-                ServerMgr.getInstance().removeContext(httpContext);
-                throw e;
-            }
-        } catch(Exception e) {
-            throw new ServerRtException("server.rt.err", e );
-        }
+        this.address = address;
+        httpContext = ServerMgr.getInstance().createContext(address);
+        publish(httpContext);
     }
 
     public void publish(Object serverContext) {
-        this.httpContext = (HttpContext)serverContext;
-        try {
-            publish(httpContext);
-        } catch(Exception e) {
-            throw new ServerRtException("server.rt.err", new Object[] { e } );
+        if (!(serverContext instanceof HttpContext)) {
+            throw new ServerRtException("not.HttpContext.type", serverContext.getClass());
         }
+
+        this.httpContext = (HttpContext)serverContext;
+        publish(httpContext);
+    }
+
+    /**
+     * This can be called only after publish
+     * @return address of the Endpoint
+     */
+    private String getEPRAddress() {
+        if(address == null) {
+            // Application created its own HttpContext
+            return httpContext.getServer().getAddress().toString();
+        } else
+            return address;
     }
 
     public void stop() {
         if (address == null) {
             // Application created its own HttpContext
+            // httpContext.setHandler(null);
             httpContext.getServer().removeContext(httpContext);
         } else {
             // Remove HttpContext created by JAXWS runtime
@@ -292,22 +100,17 @@
         }
 
         // Invoke WebService Life cycle method
-        endpointInfo.endService();
+        adapter.getEndpoint().dispose();
     }
 
-    private void publish (HttpContext context) throws Exception {
-        endpointInfo.verifyImplementorClass();
-        fillEndpointInfo();
-        endpointInfo.init();
-        generateWSDLDocs();
-        RuntimeEndpointInfo.publishWSDLDocs(endpointInfo);
-        logger.fine("Doc Metadata="+endpointInfo.getDocMetadata());
-        WebServiceContext wsContext = new WebServiceContextImpl();
-        endpointInfo.setWebServiceContext(wsContext);
-        endpointInfo.injectContext();
-        endpointInfo.beginService();
-        Tie tie = new Tie();
-        context.setHandler(new WSHttpHandler(tie, endpointInfo, executor));
+    private void publish (HttpContext context) {
+        context.setHandler(new WSHttpHandler(adapter, executor));
+    }
+
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
+        WSEndpointImpl endpointImpl = (WSEndpointImpl) adapter.getEndpoint();
+        String eprAddress = getEPRAddress();
+        return clazz.cast(endpointImpl.getEndpointReference(clazz, eprAddress,eprAddress+"?wsdl", referenceParameters));
     }
 
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java
index 960d312..3e5fd05 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,231 +25,204 @@
 
 package com.sun.xml.internal.ws.transport.http.server;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-
-import com.sun.xml.internal.ws.pept.ept.EPTFactory;
-import com.sun.xml.internal.ws.transport.WSConnectionImpl;
+import com.sun.istack.internal.NotNull;
+import com.sun.net.httpserver.Headers;
 import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpsExchange;
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.server.WSEndpoint;
+import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+import com.sun.xml.internal.ws.transport.http.HttpAdapter;
+import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
 
-import java.net.HttpURLConnection;
+import javax.xml.ws.handler.MessageContext;
+import java.io.*;
+import java.net.URI;
+import java.security.Principal;
 import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 
 /**
- * <code>com.sun.xml.internal.ws.spi.runtime.WSConnection</code> used with Java SE endpoints
+ * {@link WSHTTPConnection} used with Java SE endpoints. It provides connection
+ * implementation using {@link HttpExchange} object.
  *
- * @author WS Development Team
+ * @author Jitendra Kotamraju
  */
-public class ServerConnectionImpl extends WSConnectionImpl {
+final class ServerConnectionImpl extends WSHTTPConnection implements WebServiceContextDelegate {
 
-    private HttpExchange httpExchange;
+    private final HttpExchange httpExchange;
     private int status;
-    private Map<String,List<String>> requestHeaders;
-    private Map<String,List<String>> responseHeaders;
-    private NoCloseInputStream is;
-    private NoCloseOutputStream out;
-    private boolean closedInput;
-    private boolean closedOutput;
+    private final HttpAdapter adapter;
+    private boolean outputWritten;
 
-    public ServerConnectionImpl(HttpExchange httpTransaction) {
-        this.httpExchange = httpTransaction;
+
+    public ServerConnectionImpl(@NotNull HttpAdapter adapter, @NotNull HttpExchange httpExchange) {
+        this.adapter = adapter;
+        this.httpExchange = httpExchange;
     }
 
-    public Map<String,List<String>> getHeaders() {
+    @Override
+    @Property(value = {MessageContext.HTTP_REQUEST_HEADERS, Packet.INBOUND_TRANSPORT_HEADERS})
+    public @NotNull Map<String,List<String>> getRequestHeaders() {
         return httpExchange.getRequestHeaders();
     }
 
-    /**
-     * sets response headers.
-     */
-    public void setHeaders(Map<String,List<String>> headers) {
-        responseHeaders = headers;
+    @Override
+    public String getRequestHeader(String headerName) {
+        return httpExchange.getRequestHeaders().getFirst(headerName);
     }
 
+    @Override
+    public void setResponseHeaders(Map<String,List<String>> headers) {
+        Headers r = httpExchange.getResponseHeaders();
+        r.clear();
+        for(Map.Entry <String, List<String>> entry : headers.entrySet()) {
+            String name = entry.getKey();
+            List<String> values = entry.getValue();
+            if (name.equalsIgnoreCase("Content-Length") || name.equalsIgnoreCase("Content-Type")) {
+                continue;  // ignore headers that interfere with our correct operations
+            } else {
+                r.put(name,new ArrayList<String>(values));
+            }
+        }
+    }
+    @Override
+    @Property({MessageContext.HTTP_RESPONSE_HEADERS,Packet.OUTBOUND_TRANSPORT_HEADERS})
+    public Map<String,List<String>> getResponseHeaders() {
+        return httpExchange.getResponseHeaders();
+    }
+
+    @Override
+    public void setContentTypeResponseHeader(@NotNull String value) {
+        httpExchange.getResponseHeaders().set("Content-Type",value);
+    }
+
+    @Override
     public void setStatus(int status) {
         this.status = status;
     }
 
-    /**
-     * sets HTTP status code
-     */
+    @Override
+    @Property(MessageContext.HTTP_RESPONSE_CODE)
     public int getStatus() {
-        if (status == 0) {
-            status = HttpURLConnection.HTTP_INTERNAL_ERROR;
-        }
         return status;
     }
 
-    public InputStream getInput() {
-        if (is == null) {
-            is = new NoCloseInputStream(httpExchange.getRequestBody());
-        }
-        return is;
-    }
-
-    public OutputStream getOutput() {
-        if (out == null) {
-            try {
-                closeInput();
-                int len = 0;
-                if (responseHeaders != null) {
-                    for(Map.Entry <String, List<String>> entry : responseHeaders.entrySet()) {
-                        String name = entry.getKey();
-                        List<String> values = entry.getValue();
-                        if (name.equals("Content-Length")) {
-                            // No need to add this header
-                            len = Integer.valueOf(values.get(0));
-                        } else {
-                            for(String value : values) {
-                                httpExchange.getResponseHeaders().add(name, value);
-                            }
-                        }
-                    }
+    public @NotNull InputStream getInput() {
+        // Light weight http server's InputStream.close() throws exception if
+        // all the bytes are not read. Work around until it is fixed.
+        return new FilterInputStream(httpExchange.getRequestBody()) {
+            @Override
+            public void close() throws IOException {
+                try {
+                    while (read() != -1);
+                } catch(IOException e) {
+                    //Ignore
                 }
-
-                // write HTTP status code, and headers
-                httpExchange.sendResponseHeaders(getStatus(), len);
-                out = new NoCloseOutputStream(httpExchange.getResponseBody());
-            } catch(IOException ioe) {
-                ioe.printStackTrace();
+                super.close();
             }
-        }
-        return out;
+        };
     }
 
-    public void closeOutput() {
-        if (out != null) {
-            try {
-                out.getOutputStream().close();
-                closedOutput = true;
-            } catch (IOException ex) {
-                ex.printStackTrace();
-            }
-        }
-        out = null;
-    }
+    public @NotNull OutputStream getOutput() throws IOException {
+        assert !outputWritten;
+        outputWritten = true;
 
-    public void closeInput() {
-        if (is != null) {
-            try {
-                // Read everything from request and close it
-                byte[] buf = new byte[1024];
-                while (is.read(buf) != -1) {
+        List<String> lenHeader = httpExchange.getResponseHeaders().get("Content-Length");
+        int length = (lenHeader != null) ? Integer.parseInt(lenHeader.get(0)) : 0;
+        httpExchange.sendResponseHeaders(getStatus(), length);
+
+        // Light weight http server's OutputStream.close() throws exception if
+        // all the bytes are not read on the client side(StreamMessage on the client
+        // side doesn't read all bytes.
+        return new FilterOutputStream(httpExchange.getResponseBody()) {
+            @Override
+            public void close() throws IOException {
+                try {
+                    super.close();
+                } catch(IOException ioe) {
+                    // Ignoring purposefully.
                 }
-                is.getInputStream().close();
-                closedInput = true;
-            } catch (IOException ex) {
-                ex.printStackTrace();
             }
-        }
-        is = null;
+        };
     }
 
-    public void close() {
-        httpExchange.close();
+    public @NotNull WebServiceContextDelegate getWebServiceContextDelegate() {
+        return this;
     }
 
-    private static class NoCloseInputStream extends InputStream {
-        private InputStream is;
-
-        public NoCloseInputStream(InputStream is) {
-            this.is = is;
-        }
-
-        @Override
-        public int read() throws IOException {
-            return is.read();
-        }
-
-        @Override
-        public void close() throws IOException {
-            // Intentionally left empty. use closeInput() to close
-        }
-
-        public InputStream getInputStream() {
-            return is;
-        }
-
-        @Override
-        public int read(byte b[]) throws IOException {
-            return is.read(b);
-        }
-
-        @Override
-        public int read(byte b[], int off, int len) throws IOException {
-            return is.read(b, off, len);
-        }
-
-        @Override
-        public long skip(long n) throws IOException {
-            return is.skip(n);
-        }
-
-        @Override
-        public int available() throws IOException {
-            return is.available();
-        }
-
-        @Override
-        public void mark(int readlimit) {
-            is.mark(readlimit);
-        }
-
-
-        @Override
-        public void reset() throws IOException {
-            is.reset();
-        }
-
-        @Override
-        public boolean markSupported() {
-            return is.markSupported();
-        }
+    public Principal getUserPrincipal(Packet request) {
+        return httpExchange.getPrincipal();
     }
 
-    private static class NoCloseOutputStream extends OutputStream {
-        private OutputStream out;
-
-        public NoCloseOutputStream(OutputStream out) {
-            this.out = out;
-        }
-
-        @Override
-        public void write(int ch) throws IOException {
-            out.write(ch);
-        }
-
-        @Override
-        public void close() throws IOException {
-            // Intentionally left empty. use closeOutput() to close
-        }
-
-        @Override
-        public void write(byte b[]) throws IOException {
-            out.write(b);
-        }
-
-        @Override
-        public void write(byte b[], int off, int len) throws IOException {
-            out.write(b, off, len);
-        }
-
-        @Override
-        public void flush() throws IOException {
-            out.flush();
-        }
-
-        public OutputStream getOutputStream() {
-            return out;
-        }
+    public boolean isUserInRole(Packet request, String role) {
+        return false;
     }
 
+    public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
+        return WSHttpHandler.getRequestAddress(httpExchange);
+    }
+
+    public String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint) {
+        String eprAddress = getEPRAddress(request,endpoint);
+        if(adapter.getEndpoint().getPort() != null)
+            return eprAddress+"?wsdl";
+        else
+            return null;
+    }
+
+    @Override
+    public boolean isSecure() {
+        return (httpExchange instanceof HttpsExchange);
+    }
+
+    @Override
+    @Property(MessageContext.HTTP_REQUEST_METHOD)
+    public @NotNull String getRequestMethod() {
+        return httpExchange.getRequestMethod();
+    }
+
+    @Override
+    @Property(MessageContext.QUERY_STRING)
+    public String getQueryString() {
+        URI requestUri = httpExchange.getRequestURI();
+        String query = requestUri.getQuery();
+        if (query != null)
+            return query;
+        return null;
+    }
+
+    @Override
+    @Property(MessageContext.PATH_INFO)
+    public String getPathInfo() {
+        URI requestUri = httpExchange.getRequestURI();
+        String reqPath = requestUri.getPath();
+        String ctxtPath = httpExchange.getHttpContext().getPath();
+        if (reqPath.length() > ctxtPath.length()) {
+            return reqPath.substring(ctxtPath.length());
+        }
+        return null;
+    }
+
+    @Override
+    public String getProtocol() {
+        return httpExchange.getProtocol();
+    }
+
+    @Override
+    public void setContentLengthResponseHeader(int value) {
+        httpExchange.getResponseHeaders().set("Content-Length", ""+value);
+    }
+
+    protected PropertyMap getPropertyMap() {
+        return model;
+    }
+
+    private static final PropertyMap model;
+
+    static {
+        model = parse(ServerConnectionImpl.class);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
index 5c871ba..c3c75a3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,34 +26,35 @@
 
 import com.sun.net.httpserver.HttpContext;
 import com.sun.net.httpserver.HttpServer;
-import com.sun.net.httpserver.HttpsConfigurator;
-import com.sun.net.httpserver.HttpsServer;
 import com.sun.xml.internal.ws.server.ServerRtException;
+
 import java.net.InetSocketAddress;
 import java.net.URL;
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.logging.Logger;
-import javax.net.ssl.SSLContext;
 
 /**
  * Manages all the WebService HTTP servers created by JAXWS runtime.
  *
- * @author WS Development Team
+ * @author Jitendra Kotamraju
  */
-public class ServerMgr {
+final class ServerMgr {
 
     private static final ServerMgr serverMgr = new ServerMgr();
     private static final Logger logger =
         Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
-    private Map<InetSocketAddress, ServerState> servers = new HashMap();
+    private final Map<InetSocketAddress,ServerState> servers = new HashMap<InetSocketAddress,ServerState>();
 
-    protected ServerMgr() {
-    }
+    private ServerMgr() {}
 
+    /**
+     * Gets the singleton instance.
+     */
     public static ServerMgr getInstance() {
         return serverMgr;
     }
@@ -65,24 +66,24 @@
      */
     public HttpContext createContext(String address) {
         try {
-            HttpServer server = null;
-            ServerState state = null;
-            boolean started = false;
+            HttpServer server;
+            ServerState state;
             URL url = new URL(address);
             int port = url.getPort();
             if (port == -1) {
                 port = url.getDefaultPort();
             }
             InetSocketAddress inetAddress = new InetSocketAddress(url.getHost(),
-                    url.getPort());
+                port);
             synchronized(servers) {
                 state = servers.get(inetAddress);
                 if (state == null) {
                     logger.fine("Creating new HTTP Server at "+inetAddress);
                     server = HttpServer.create(inetAddress, 5);
                     server.setExecutor(Executors.newFixedThreadPool(5));
-                    logger.fine("Creating HTTP Context at = "+url.getPath());
-                    HttpContext context = server.createContext(url.getPath());
+                    String path = url.toURI().getPath();
+                    logger.fine("Creating HTTP Context at = "+path);
+                    HttpContext context = server.createContext(path);
                     server.start();
                     logger.fine("HTTP server started = "+inetAddress);
                     state = new ServerState(server);
@@ -120,8 +121,8 @@
         }
     }
 
-    private static class ServerState {
-        private HttpServer server;
+    private static final class ServerState {
+        private final HttpServer server;
         private int instances;
 
         ServerState(HttpServer server) {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java
index e66bb5e..c4eb2f8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,66 +25,44 @@
 
 package com.sun.xml.internal.ws.transport.http.server;
 
-import com.sun.net.httpserver.HttpHandler;
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
 import com.sun.net.httpserver.HttpsExchange;
-import com.sun.xml.internal.ws.handler.MessageContextImpl;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import com.sun.xml.internal.ws.server.DocInfo;
-import com.sun.xml.internal.ws.server.WSDLPatcher;
-import java.util.concurrent.Executor;
-import javax.xml.ws.handler.MessageContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.server.Tie;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.transport.Headers;
-import com.sun.xml.internal.ws.util.localization.LocalizableMessageFactory;
-import com.sun.xml.internal.ws.util.localization.Localizer;
+import com.sun.xml.internal.ws.resources.HttpserverMessages;
+import com.sun.xml.internal.ws.transport.http.HttpAdapter;
+import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
+
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
 /**
- * Implementation of HttpContext's HttpHandler. HttpServer calls this when there
- * is request that matches the context path. Then the handler processes
- * HttpExchange and sends appropriate response
+ * {@link HttpHandler} implementation that serves the actual request.
  *
- * @author WS Development Team
+ * @author Jitendra Kotamraju
+ * @author Kohsuke Kawaguhi
  */
-public class WSHttpHandler implements HttpHandler {
+final class WSHttpHandler implements HttpHandler {
 
     private static final String GET_METHOD = "GET";
     private static final String POST_METHOD = "POST";
     private static final String HEAD_METHOD = "HEAD";
     private static final String PUT_METHOD = "PUT";
     private static final String DELETE_METHOD = "DELETE";
-    private static final String HTML_CONTENT_TYPE = "text/html";
-    private static final String XML_CONTENT_TYPE = "text/xml";
-    private static final String CONTENT_TYPE_HEADER = "Content-Type";
 
     private static final Logger logger =
         Logger.getLogger(
             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
-    private static final Localizer localizer = new Localizer();
-    private static final LocalizableMessageFactory messageFactory =
-        new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.httpserver");
 
-    private final RuntimeEndpointInfo endpointInfo;
-    private final Tie tie;
+    private final HttpAdapter adapter;
     private final Executor executor;
 
-    public WSHttpHandler(Tie tie, RuntimeEndpointInfo endpointInfo, Executor executor) {
-        this.tie = tie;
-        this.endpointInfo = endpointInfo;
+    public WSHttpHandler(@NotNull HttpAdapter adapter, @Nullable Executor executor) {
+        assert adapter!=null;
+        this.adapter = adapter;
         this.executor = executor;
     }
 
@@ -92,45 +70,42 @@
      * Called by HttpServer when there is a matching request for the context
      */
     public void handle(HttpExchange msg) {
-        logger.fine("Received HTTP request:"+msg.getRequestURI());
-        if (executor != null) {
-            // Use endpoint's Executor to handle request
-            executor.execute(new HttpHandlerRunnable(msg));
-        } else {
-            handleExchange(msg);
+        try {
+            logger.fine("Received HTTP request:"+msg.getRequestURI());
+            if (executor != null) {
+                // Use application's Executor to handle request. Application may
+                // have set an executor using Endpoint.setExecutor().
+                executor.execute(new HttpHandlerRunnable(msg));
+            } else {
+                handleExchange(msg);
+            }
+        } catch(Throwable e) {
+            // Dont't propagate the exception otherwise it kills the httpserver
+            e.printStackTrace();
         }
     }
 
-    /**
-     * Handles the HTTP request for GET, POST
-     *
-     */
-    private void handleExchange(HttpExchange msg) {
+    public void handleExchange(HttpExchange msg) throws IOException {
+        WSHTTPConnection con = new ServerConnectionImpl(adapter,msg);
         try {
+            logger.fine("Received HTTP request:"+msg.getRequestURI());
             String method = msg.getRequestMethod();
             if (method.equals(GET_METHOD)) {
                 String queryString = msg.getRequestURI().getQuery();
                 logger.fine("Query String for request ="+queryString);
-                if (queryString != null &&
-                    (queryString.equals("WSDL") || queryString.equals("wsdl")
-                    || queryString.startsWith("wsdl=") || queryString.startsWith("xsd="))) {
-                    // Handles WSDL, Schema documents
-                    processDocRequest(msg);
+                if (adapter.isMetadataQuery(queryString)) {
+                    adapter.publishWSDL(con,getRequestAddress(msg), msg.getRequestURI().getQuery());
                 } else {
-                    process(msg);
+                    adapter.handle(con);
                 }
             } else if (method.equals(POST_METHOD) || method.equals(HEAD_METHOD)
                         || method.equals(PUT_METHOD) || method.equals(DELETE_METHOD)) {
-                process(msg);
+                adapter.handle(con);
             } else {
-                logger.warning(
-                    localizer.localize(
-                        messageFactory.getMessage(
-                            "unexpected.http.method", method)));
-                msg.close();
+                logger.warning(HttpserverMessages.UNEXPECTED_HTTP_METHOD(method));
             }
-        } catch(Exception e) {
-            e.printStackTrace();
+        } finally {
+            msg.close();
         }
     }
 
@@ -146,142 +121,39 @@
         }
 
         public void run() {
-            handleExchange(msg);
-        }
-    }
-
-    /**
-     * Handles POST requests
-     */
-    private void process(HttpExchange msg) {
-        WSConnection con = new ServerConnectionImpl(msg);
-        try {
-            MessageContext msgCtxt = new MessageContextImpl();
-            WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-            wsContext.setMessageContext(msgCtxt);
-            MessageContextUtil.setHttpRequestMethod(msgCtxt, msg.getRequestMethod());
-            MessageContextUtil.setHttpRequestHeaders(msgCtxt, con.getHeaders());
-            MessageContextUtil.setHttpExchange(msgCtxt, msg);
-            URI requestUri = msg.getRequestURI();
-            String query = requestUri.getQuery();
-            if (query != null) {
-                MessageContextUtil.setQueryString(msgCtxt, query);
-            }
-            String reqPath = requestUri.getPath();
-            String ctxtPath = msg.getHttpContext().getPath();
-            if (reqPath.length() > ctxtPath.length()) {
-                String extraPath = reqPath.substring(ctxtPath.length());
-                MessageContextUtil.setPathInfo(msgCtxt, extraPath);
-            }
-            tie.handle(con, endpointInfo);
-        } catch(Exception e) {
-            e.printStackTrace();
-        } finally {
-            con.close();
-        }
-    }
-
-    /**
-     * Handles GET requests for WSDL and Schema docuemnts
-     */
-    public void processDocRequest(HttpExchange msg) {
-        WSConnection con = new ServerConnectionImpl(msg);
-        try {
-            con.getInput();
-            String queryString = msg.getRequestURI().getQuery();
-            String inPath = endpointInfo.getPath(queryString);
-            if (inPath == null) {
-                String message =
-                    localizer.localize(
-                        messageFactory.getMessage("html.notFound",
-                            "Invalid Request ="+msg.getRequestURI()));
-                writeErrorPage(con, HttpURLConnection.HTTP_NOT_FOUND, message);
-                return;
-            }
-            DocInfo docInfo = endpointInfo.getDocMetadata().get(inPath);
-            if (docInfo == null) {
-                String message =
-                    localizer.localize(
-                        messageFactory.getMessage("html.notFound",
-                            "Invalid Request ="+msg.getRequestURI()));
-                writeErrorPage(con, HttpURLConnection.HTTP_NOT_FOUND, message);
-                return;
-            }
-
-            InputStream docStream = null;
             try {
-                Map<String, List<String>> reqHeaders = con.getHeaders();
-                List<String> hostHeader = reqHeaders.get("Host");
-
-                Headers respHeaders = new Headers();
-                respHeaders.add(CONTENT_TYPE_HEADER, XML_CONTENT_TYPE);
-                con.setHeaders(respHeaders);
-                con.setStatus(HttpURLConnection.HTTP_OK);
-                OutputStream os = con.getOutput();
-
-                List<RuntimeEndpointInfo> endpoints = new ArrayList<RuntimeEndpointInfo>();
-                endpoints.add(endpointInfo);
-
-                StringBuffer strBuf = new StringBuffer();
-                strBuf.append((msg instanceof HttpsExchange) ? "https" : "http");
-                strBuf.append("://");
-                if (hostHeader != null) {
-                    strBuf.append(hostHeader.get(0));   // Uses Host header
-                } else {
-                    strBuf.append(msg.getLocalAddress().getHostName());
-                    strBuf.append(":");
-                    strBuf.append(msg.getLocalAddress().getPort());
-                }
-                strBuf.append(msg.getRequestURI().getPath());
-                String address = strBuf.toString();
-                logger.fine("Address ="+address);
-                WSDLPatcher patcher = new WSDLPatcher(docInfo, address,
-                        endpointInfo, endpoints);
-                docStream = docInfo.getDoc();
-                patcher.patchDoc(docStream, os);
-            } finally {
-                closeInputStream(docStream);
-                con.closeOutput();
+                handleExchange(msg);
+            } catch (Throwable e) {
+                // Does application's executor handle this exception ?
+                e.printStackTrace();
             }
-        } finally {
-            con.close();
         }
     }
 
+
     /**
-     * writes error html page
+     * Computes the Endpoint's address from the request. Use "Host" header
+     * so that it has correct address(IP address or someother hostname) through
+     * which the application reached the endpoint.
+     *
+     * @return
+     *      a string like "http://foo.bar:1234/abc/def"
      */
-    private void writeErrorPage(WSConnection con, int status, String message) {
-        try {
-            Map<String,List<String>> headers = new HashMap<String, List<String>>();
-            List<String> ctHeader = new ArrayList<String>();
-            ctHeader.add(HTML_CONTENT_TYPE);
-            headers.put(CONTENT_TYPE_HEADER, ctHeader);
-            con.setHeaders(headers);
-            con.setStatus(status);
-            OutputStream outputStream = con.getOutput();
-            PrintWriter out = new PrintWriter(outputStream);
-            out.println("<html><head><title>");
-            out.println(
-                localizer.localize(
-                    messageFactory.getMessage("html.title")));
-            out.println("</title></head><body>");
-            out.println(message);
-            out.println("</body></html>");
-            out.close();
-        } finally {
-            con.closeOutput();
-        }
-    }
+    static @NotNull String getRequestAddress(HttpExchange msg) {
+        StringBuilder strBuf = new StringBuilder();
+        strBuf.append((msg instanceof HttpsExchange) ? "https" : "http");
+        strBuf.append("://");
 
-    private static void closeInputStream(InputStream is) {
-        if (is != null) {
-            try {
-                is.close();
-            } catch(IOException ioe) {
-                ioe.printStackTrace();
-            }
+        List<String> hostHeader = msg.getRequestHeaders().get("Host");
+        if (hostHeader != null) {
+            strBuf.append(hostHeader.get(0));   // Uses Host header
+        } else {
+            strBuf.append(msg.getLocalAddress().getHostName());
+            strBuf.append(":");
+            strBuf.append(msg.getLocalAddress().getPort());
         }
-    }
+        strBuf.append(msg.getRequestURI().getPath());
 
+        return strBuf.toString();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WebServiceContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WebServiceContextImpl.java
deleted file mode 100644
index a652e65..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WebServiceContextImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.transport.http.server;
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.xml.internal.ws.handler.MessageContextUtil;
-import java.security.Principal;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-
-public class WebServiceContextImpl implements WebServiceContext  {
-
-    public ThreadLocal msgContext = new ThreadLocal();
-
-    public MessageContext getMessageContext() {
-        MessageContext ctxt = (MessageContext)msgContext.get();
-        if (ctxt == null) {
-            throw new IllegalStateException();
-        }
-        return ctxt;
-    }
-
-    public void setMessageContext(MessageContext ctxt) {
-        msgContext.set(ctxt);
-    }
-
-    public Principal getUserPrincipal() {
-        MessageContext ctxt = (MessageContext)msgContext.get();
-        if (ctxt != null) {
-            HttpExchange req = MessageContextUtil.getHttpExchange(ctxt);
-            return (req != null) ? req.getPrincipal() : null;
-        }
-        throw new IllegalStateException();
-    }
-
-
-    public boolean isUserInRole(String role) {
-        return false;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/LocalMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/LocalMessage.java
deleted file mode 100644
index be979ac..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/LocalMessage.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.local;
-
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import java.io.ByteArrayOutputStream;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author WS Development Team
- */
-public class LocalMessage {
-    ByteArrayBuffer baos;
-    Map<String, List<String>> headers;
-
-    public LocalMessage () {
-    }
-
-    public ByteArrayBuffer getOutput() {
-        return baos;
-    }
-
-    public void setOutput(ByteArrayBuffer baos) {
-        this.baos = baos;
-    }
-
-    public Map<String, List<String>> getHeaders() {
-        return headers;
-    }
-
-    public void setHeaders(Map<String, List<String>> headers) {
-        this.headers = headers;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransport.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransport.java
deleted file mode 100644
index 28178f0..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransport.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.local.client;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStream;
-import com.sun.xml.internal.ws.client.ClientTransportException;
-import com.sun.xml.internal.ws.handler.MessageContextImpl;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.server.Tie;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import com.sun.xml.internal.ws.transport.WSConnectionImpl;
-import com.sun.xml.internal.ws.util.localization.Localizable;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
-import java.net.HttpURLConnection;
-import java.net.ProtocolException;
-
-import com.sun.xml.internal.ws.transport.local.server.LocalConnectionImpl;
-import com.sun.xml.internal.ws.transport.local.LocalMessage;
-
-import static com.sun.xml.internal.ws.developer.JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-import javax.xml.ws.http.HTTPException;
-
-/**
- * @author WS Development Team
- */
-public class LocalClientTransport extends WSConnectionImpl {
-
-    private RuntimeEndpointInfo endpointInfo;
-    private Tie tie = new Tie();
-    LocalMessage lm = new LocalMessage();
-
-    //this class is used primarily for debugging purposes
-    public LocalClientTransport(RuntimeEndpointInfo endpointInfo) {
-        this(endpointInfo, null);
-    }
-
-    public LocalClientTransport(RuntimeEndpointInfo endpointInfo,
-                                OutputStream logStream) {
-        this.endpointInfo = endpointInfo;
-        debugStream = logStream;
-    }
-
-
-    @Override
-    public OutputStream getOutput() {
-        try {
-            lm.setOutput(new ByteArrayBuffer());
-            return lm.getOutput();
-        }
-        catch (Exception ex) {
-            throw new ClientTransportException("local.client.failed",ex);
-        }
-    }
-
-    private static void checkMessageContentType(WSConnection con, boolean response) {
-        String negotiation = System.getProperty(CONTENT_NEGOTIATION_PROPERTY, "none").intern();
-        String contentType = con.getHeaders().get("Content-Type").get(0);
-
-        // Use indexOf() to handle Multipart/related types
-        if (negotiation == "none") {
-            // OK only if XML
-            if (contentType.indexOf("text/xml") < 0 &&
-                   contentType.indexOf("application/soap+xml") < 0 &&
-                   contentType.indexOf("application/xop+xml") < 0)
-            {
-                throw new RuntimeException("Invalid content type '" + contentType
-                    + "' with content negotiation set to '" + negotiation + "'.");
-            }
-        }
-        else if (negotiation == "optimistic") {
-            // OK only if FI
-            if (contentType.indexOf("application/fastinfoset") < 0 &&
-                   contentType.indexOf("application/soap+fastinfoset") < 0)
-            {
-                throw new RuntimeException("Invalid content type '" + contentType
-                    + "' with content negotiation set to '" + negotiation + "'.");
-            }
-        }
-        else if (negotiation == "pessimistic") {
-            // OK if FI request is anything and response is FI
-            if (response &&
-                    contentType.indexOf("application/fastinfoset") < 0 &&
-                    contentType.indexOf("application/soap+fastinfoset") < 0)
-            {
-                throw new RuntimeException("Invalid content type '" + contentType
-                    + "' with content negotiation set to '" + negotiation + "'.");
-            }
-        }
-    }
-
-    @Override
-    public void closeOutput() {
-        super.closeOutput();
-        WSConnection con = new LocalConnectionImpl(lm);
-
-        // Copy headers for content negotiation
-        con.setHeaders(getHeaders());
-
-        // Check request content type based on negotiation property
-        checkMessageContentType(this, false);
-
-        try {
-            // Set a MessageContext per invocation
-            WebServiceContext wsContext = endpointInfo.getWebServiceContext();
-            wsContext.setMessageContext(new MessageContextImpl());
-            tie.handle(con, endpointInfo);
-
-            checkMessageContentType(con, true);
-        }
-        catch (Exception ex) {
-            new ProtocolException("Server side Exception:" + ex);
-        }
-    }
-
-    @Override
-    public InputStream getInput() {
-        try {
-            return lm.getOutput().newInputStream();
-        }
-        catch (Exception ex) {
-            throw new ClientTransportException("local.client.failed",ex);
-        }
-    }
-
-    @Override
-    public void setHeaders(Map<String, List<String>> headers) {
-        lm.setHeaders(headers);
-    }
-
-    @Override
-    public Map<String, List<String>> getHeaders() {
-        return lm.getHeaders();
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransportFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransportFactory.java
deleted file mode 100644
index f1eb52f..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/client/LocalClientTransportFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.local.client;
-
-import java.io.OutputStream;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.spi.runtime.ClientTransportFactory;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-import java.util.Map;
-
-/**
- * @author WS Development Team
- */
-public class LocalClientTransportFactory implements ClientTransportFactory {
-    private RuntimeEndpointInfo endpointInfo;
-    private OutputStream logStream;
-
-    //this class is used primarily for debugging purposes
-    public LocalClientTransportFactory(RuntimeEndpointInfo endpointInfo) {
-        this(endpointInfo, null);
-    }
-
-    public LocalClientTransportFactory(RuntimeEndpointInfo endpointInfo,
-        OutputStream logStream) {
-        this.endpointInfo = endpointInfo;
-        this.logStream = logStream;
-    }
-
-    public WSConnection create() {
-        return create(null);
-    }
-
-    public WSConnection create(Map<String, Object> context) {
-        return new LocalClientTransport(endpointInfo, logStream);
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalConnectionImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalConnectionImpl.java
deleted file mode 100644
index 8d411c2..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalConnectionImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.transport.local.server;
-import java.util.List;
-import java.util.Map;
-import com.sun.xml.internal.ws.transport.WSConnectionImpl;
-import com.sun.xml.internal.ws.transport.local.LocalMessage;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-
-/**
- * @author WS Development Team
- *
- * Server-side Local transport implementation
- */
-public class LocalConnectionImpl extends WSConnectionImpl {
-    private int status;
-    private LocalMessage lm;
-
-    public LocalConnectionImpl (LocalMessage localMessage) {
-        this.lm = localMessage;
-    }
-
-    public Map<String,List<String>> getHeaders () {
-        return lm.getHeaders ();
-    }
-
-    /**
-     * sets response headers.
-     */
-    public void setHeaders (Map<String,List<String>> headers) {
-        lm.setHeaders (headers);
-    }
-
-    public void setStatus (int status) {
-        this.status = status;
-    }
-
-    public InputStream getInput () {
-        return lm.getOutput().newInputStream();
-    }
-
-    public OutputStream getOutput () {
-        ByteArrayBuffer bab = new ByteArrayBuffer();
-        lm.setOutput(bab);
-        return bab;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalWSContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalWSContextImpl.java
deleted file mode 100644
index d312277..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/local/server/LocalWSContextImpl.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.transport.local.server;
-import java.security.Principal;
-import com.sun.xml.internal.ws.spi.runtime.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-
-public class LocalWSContextImpl implements WebServiceContext  {
-
-    public static ThreadLocal msgContext = new ThreadLocal();
-
-    public MessageContext getMessageContext() {
-        MessageContext ctxt = (MessageContext)msgContext.get();
-        if (ctxt == null) {
-            throw new IllegalStateException();
-        }
-        return ctxt;
-    }
-
-    public void setMessageContext(MessageContext ctxt) {
-        msgContext.set(ctxt);
-    }
-
-    public Principal getUserPrincipal() {
-        return null;
-    }
-
-
-    public boolean isUserInRole(String role) {
-        return false;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java
index dedbf1f..a211062 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Base64Util.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Base64Util.java
deleted file mode 100644
index 6772878..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Base64Util.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.util;
-
-/**
- *
- * @author jitu
- */
-public class Base64Util {
-
-    protected static final char encodeBase64[] = {
-        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
-        'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
-        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
-        'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
-        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
-    };
-
-    protected static final int decodeBase64[] = {
-        /*'+'*/ 62,
-        -1, -1, -1,
-        /*'/'*/ 63,
-        /*'0'*/ 52,
-        /*'1'*/ 53,
-        /*'2'*/ 54,
-        /*'3'*/ 55,
-        /*'4'*/ 56,
-        /*'5'*/ 57,
-        /*'6'*/ 58,
-        /*'7'*/ 59,
-        /*'8'*/ 60,
-        /*'9'*/ 61,
-        -1, -1, -1, -1, -1, -1, -1,
-        /*'A'*/ 0,
-        /*'B'*/ 1,
-        /*'C'*/ 2,
-        /*'D'*/ 3,
-        /*'E'*/ 4,
-        /*'F'*/ 5,
-        /*'G'*/ 6,
-        /*'H'*/ 7,
-        /*'I'*/ 8,
-        /*'J'*/ 9,
-        /*'K'*/ 10,
-        /*'L'*/ 11,
-        /*'M'*/ 12,
-        /*'N'*/ 13,
-        /*'O'*/ 14,
-        /*'P'*/ 15,
-        /*'Q'*/ 16,
-        /*'R'*/ 17,
-        /*'S'*/ 18,
-        /*'T'*/ 19,
-        /*'U'*/ 20,
-        /*'V'*/ 21,
-        /*'W'*/ 22,
-        /*'X'*/ 23,
-        /*'Y'*/ 24,
-        /*'Z'*/ 25,
-        -1, -1, -1, -1, -1, -1,
-        /*'a'*/ 26,
-        /*'b'*/ 27,
-        /*'c'*/ 28,
-        /*'d'*/ 29,
-        /*'e'*/ 30,
-        /*'f'*/ 31,
-        /*'g'*/ 32,
-        /*'h'*/ 33,
-        /*'i'*/ 34,
-        /*'j'*/ 35,
-        /*'k'*/ 36,
-        /*'l'*/ 37,
-        /*'m'*/ 38,
-        /*'n'*/ 39,
-        /*'o'*/ 40,
-        /*'p'*/ 41,
-        /*'q'*/ 42,
-        /*'r'*/ 43,
-        /*'s'*/ 44,
-        /*'t'*/ 45,
-        /*'u'*/ 46,
-        /*'v'*/ 47,
-        /*'w'*/ 48,
-        /*'x'*/ 49,
-        /*'y'*/ 50,
-        /*'z'*/ 51
-    };
-
-    public static String encode(byte[] value)
-        throws Exception {
-
-        if (value == null) {
-            return null;
-        }
-        if (value.length == 0) {
-            return "";
-        }
-        int blockCount = value.length / 3;
-        int partialBlockLength = value.length % 3;
-
-        if (partialBlockLength != 0) {
-            ++blockCount;
-        }
-
-        int encodedLength = blockCount * 4;
-        StringBuffer encodedValue = new StringBuffer(encodedLength);
-
-        int idx = 0;
-        for (int i = 0; i < blockCount; ++i) {
-            int b1 = value[idx++];
-            int b2 = (idx < value.length) ? value[idx++] : 0;
-            int b3 = (idx < value.length) ? value[idx++] : 0;
-
-            if (b1 < 0) {
-                b1 += 256;
-            }
-            if (b2 < 0) {
-                b2 += 256;
-            }
-            if (b3 < 0) {
-                b3 += 256;
-            }
-
-            char encodedChar;
-
-            encodedChar = encodeBase64[b1 >> 2];
-            encodedValue.append(encodedChar);
-
-            encodedChar = encodeBase64[((b1 & 0x03) << 4) | (b2 >> 4)];
-            encodedValue.append(encodedChar);
-
-            encodedChar = encodeBase64[((b2 & 0x0f) << 2) | (b3 >> 6)];
-            encodedValue.append(encodedChar);
-
-            encodedChar = encodeBase64[b3 & 0x3f];
-            encodedValue.append(encodedChar);
-        }
-
-        switch (partialBlockLength) {
-            case 0 :
-                // do nothing
-                break;
-            case 1 :
-                encodedValue.setCharAt(encodedLength - 1, '=');
-                encodedValue.setCharAt(encodedLength - 2, '=');
-                break;
-            case 2 :
-                encodedValue.setCharAt(encodedLength - 1, '=');
-                break;
-        }
-
-        return encodedValue.toString();
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java
index 35dfe43..05e9e80 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,11 +49,11 @@
  *
  * @author Kohsuke Kawaguchi
  */
-public final class ByteArrayBuffer extends OutputStream {
+public class ByteArrayBuffer extends OutputStream {
     /**
      * The buffer where data is stored.
      */
-    private byte buf[];
+    protected byte[] buf;
 
     /**
      * The number of valid bytes in the buffer.
@@ -92,7 +92,7 @@
      * @throws IOException
      *      if the read operation fails with an {@link IOException}.
      */
-    public void write(InputStream in) throws IOException {
+    public final void write(InputStream in) throws IOException {
         while(true) {
             int cap = buf.length-count;     // the remaining buffer space
             int sz = in.read(buf,count,cap);
@@ -105,14 +105,14 @@
         }
     }
 
-    public void write(int b) {
+    public final void write(int b) {
         int newcount = count + 1;
         ensureCapacity(newcount);
         buf[count] = (byte) b;
         count = newcount;
     }
 
-    public void write(byte b[], int off, int len) {
+    public final void write(byte b[], int off, int len) {
         int newcount = count + len;
         ensureCapacity(newcount);
         System.arraycopy(b, off, buf, count, len);
@@ -127,11 +127,11 @@
         }
     }
 
-    public void writeTo(OutputStream out) throws IOException {
+    public final void writeTo(OutputStream out) throws IOException {
         out.write(buf, 0, count);
     }
 
-    public void reset() {
+    public final void reset() {
         count = 0;
     }
 
@@ -145,30 +145,51 @@
      *      this method causes a buffer reallocation. Use it only when
      *      you have to.
      */
-    public byte toByteArray()[] {
+    public final byte[] toByteArray() {
         byte newbuf[] = new byte[count];
         System.arraycopy(buf, 0, newbuf, 0, count);
         return newbuf;
     }
 
-    public int size() {
+    public final int size() {
         return count;
     }
 
-    public void close() {
+    /**
+     * Gets the underlying buffer that this {@link ByteArrayBuffer} uses.
+     * It's never small than its {@link #size()}.
+     *
+     * Use with caution.
+     */
+    public final byte[] getRawData() {
+        return buf;
+    }
+
+    public void close() throws IOException {
     }
 
     /**
      * Creates a new {@link InputStream} that reads from this buffer.
      */
-    public InputStream newInputStream() {
+    public final InputStream newInputStream() {
         return new ByteArrayInputStream(buf,0,count);
     }
 
     /**
      * Creates a new {@link InputStream} that reads a part of this bfufer.
      */
-    public InputStream newInputStream(int start, int length) {
+    public final InputStream newInputStream(int start, int length) {
         return new ByteArrayInputStream(buf,start,length);
     }
+
+    /**
+     * Decodes the contents of this buffer by the default encoding
+     * and returns it as a string.
+     *
+     * <p>
+     * Meant to aid debugging, but no more.
+     */
+    public String toString() {
+        return new String(buf, 0, count);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java
index 9463e63..184b920 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/CompletedFuture.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/CompletedFuture.java
new file mode 100644
index 0000000..7ab847a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/CompletedFuture.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * {@link Future} implementation that obtains an already available value.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class CompletedFuture<T> implements Future<T> {
+    private final T v;
+    private final Throwable re;
+
+    public CompletedFuture(T v, Throwable re) {
+        this.v = v;
+        this.re = re;
+    }
+
+    public boolean cancel(boolean mayInterruptIfRunning) {
+        return false;
+    }
+
+    public boolean isCancelled() {
+        return false;
+    }
+
+    public boolean isDone() {
+        return true;
+    }
+
+    public T get() throws ExecutionException {
+        if (re != null) {
+            throw new ExecutionException(re);
+        }
+        return v;
+    }
+
+    public T get(long timeout, TimeUnit unit) throws ExecutionException {
+        return get();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Constants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Constants.java
index 7c44119..d9e20f2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Constants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Constants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java
index a9de941..d0b2dcd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,20 +25,29 @@
 
 package com.sun.xml.internal.ws.util;
 
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
 import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.dom.DOMResult;
-import java.io.InputStream;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
 import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
 
 /**
  * $author: JAXWS Development Team
@@ -86,4 +95,167 @@
         }
         return null;
     }
+
+    /**
+     * Traverses a DOM node and writes out on a streaming writer.
+     *
+     * @param node
+     * @param writer
+     */
+    public static void serializeNode(Element node, XMLStreamWriter writer) throws XMLStreamException {
+        writeTagWithAttributes(node, writer);
+
+        if (node.hasChildNodes()) {
+            NodeList children = node.getChildNodes();
+            for (int i = 0; i < children.getLength(); i++) {
+                Node child = children.item(i);
+                switch (child.getNodeType()) {
+                    case Node.PROCESSING_INSTRUCTION_NODE:
+                        writer.writeProcessingInstruction(child.getNodeValue());
+                    case Node.DOCUMENT_TYPE_NODE:
+                        break;
+                    case Node.CDATA_SECTION_NODE:
+                        writer.writeCData(child.getNodeValue());
+                        break;
+                    case Node.COMMENT_NODE:
+                        writer.writeComment(child.getNodeValue());
+                        break;
+                    case Node.TEXT_NODE:
+                        writer.writeCharacters(child.getNodeValue());
+                        break;
+                    case Node.ELEMENT_NODE:
+                        serializeNode((Element) child, writer);
+                        break;
+                }
+            }
+        }
+        writer.writeEndElement();
+    }
+
+    public static void writeTagWithAttributes(Element node, XMLStreamWriter writer) throws XMLStreamException {
+        String nodePrefix = fixNull(node.getPrefix());
+        String nodeNS = fixNull(node.getNamespaceURI());
+
+        // See if nodePrefix:nodeNS is declared in writer's NamespaceContext before writing start element
+        // Writing start element puts nodeNS in NamespaceContext even though namespace declaration not written
+        boolean prefixDecl = isPrefixDeclared(writer, nodeNS, nodePrefix);
+        writer.writeStartElement(nodePrefix, node.getLocalName(), nodeNS);
+
+        if (node.hasAttributes()) {
+            NamedNodeMap attrs = node.getAttributes();
+            int numOfAttributes = attrs.getLength();
+            // write namespace declarations first.
+            // if we interleave this with attribue writing,
+            // Zephyr will try to fix it and we end up getting inconsistent namespace bindings.
+            for (int i = 0; i < numOfAttributes; i++) {
+                Node attr = attrs.item(i);
+                String nsUri = fixNull(attr.getNamespaceURI());
+                if (nsUri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+                    // handle default ns declarations
+                    String local = attr.getLocalName().equals(XMLConstants.XMLNS_ATTRIBUTE) ? "" : attr.getLocalName();
+                    if (local.equals(nodePrefix) && attr.getNodeValue().equals(nodeNS)) {
+                        prefixDecl = true;
+                    }
+                    if (local.equals("")) {
+                        writer.writeDefaultNamespace(attr.getNodeValue());
+                    } else {
+                        // this is a namespace declaration, not an attribute
+                        writer.setPrefix(attr.getLocalName(), attr.getNodeValue());
+                        writer.writeNamespace(attr.getLocalName(), attr.getNodeValue());
+                    }
+                }
+            }
+        }
+        // node's namespace is not declared as attribute, but declared on ancestor
+        if (!prefixDecl) {
+            writer.writeNamespace(nodePrefix, nodeNS);
+        }
+
+        // Write all other attributes which are not namespace decl.
+        if (node.hasAttributes()) {
+            NamedNodeMap attrs = node.getAttributes();
+            int numOfAttributes = attrs.getLength();
+
+            for (int i = 0; i < numOfAttributes; i++) {
+                Node attr = attrs.item(i);
+                String attrPrefix = fixNull(attr.getPrefix());
+                String attrNS = fixNull(attr.getNamespaceURI());
+                if (!attrNS.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+                    String localName = attr.getLocalName();
+                    if (localName == null) {
+                        // TODO: this is really a bug in the caller for not creating proper DOM tree.
+                        // will remove this workaround after plugfest
+                        localName = attr.getNodeName();
+                    }
+                    boolean attrPrefixDecl = isPrefixDeclared(writer, attrNS, attrPrefix);
+                    if (!attrPrefix.equals("") && !attrPrefixDecl) {
+                        // attr has namespace but namespace decl is there in ancestor node
+                        // So write the namespace decl before writing the attr
+                        writer.setPrefix(attr.getLocalName(), attr.getNodeValue());
+                        writer.writeNamespace(attrPrefix, attrNS);
+                    }
+                    writer.writeAttribute(attrPrefix, attrNS, localName, attr.getNodeValue());
+                }
+            }
+        }
+    }
+
+    private static boolean isPrefixDeclared(XMLStreamWriter writer, String nsUri, String prefix) {
+        boolean prefixDecl = false;
+        NamespaceContext nscontext = writer.getNamespaceContext();
+        Iterator prefixItr = nscontext.getPrefixes(nsUri);
+        while (prefixItr.hasNext()) {
+            if (prefix.equals(prefixItr.next())) {
+                prefixDecl = true;
+                break;
+            }
+        }
+        return prefixDecl;
+    }
+
+    /**
+     * Gets the first child of the given name, or null.
+     */
+    public static Element getFirstChild(Element e, String nsUri, String local) {
+        for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                Element c = (Element) n;
+                if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri))
+                    return c;
+            }
+        }
+        return null;
+    }
+
+    private static
+    @NotNull
+    String fixNull(@Nullable String s) {
+        if (s == null) return "";
+        else return s;
+    }
+
+    /**
+     * Gets the first element child.
+     */
+    public static
+    @Nullable
+    Element getFirstElementChild(Node parent) {
+        for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) {
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                return (Element) n;
+            }
+        }
+        return null;
+    }
+
+    public static @NotNull
+    List<Element> getChildElements(Node parent){
+        List<Element> elements = new ArrayList<Element>();
+        for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) {
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                elements.add((Element)n);
+            }
+        }
+        return elements;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java
index c938deb..a693af5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,8 @@
 
 package com.sun.xml.internal.ws.util;
 
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
 
 
 /**
@@ -42,248 +36,40 @@
  */
 public class FastInfosetReflection {
     /**
-     *
-     */
-    public static ClassLoader fiClassLoader;
-
-    /**
      * FI StAXDocumentParser constructor using reflection.
      */
-    public static Constructor fiStAXDocumentParser_new;
+    public static final Constructor fiStAXDocumentParser_new;
 
     /**
      * FI <code>StAXDocumentParser.setInputStream()</code> method via reflection.
      */
-    public static Method fiStAXDocumentParser_setInputStream;
+    public static final Method fiStAXDocumentParser_setInputStream;
 
     /**
      * FI <code>StAXDocumentParser.setStringInterning()</code> method via reflection.
      */
-    public static Method fiStAXDocumentParser_setStringInterning;
-
-    /**
-     * FI StAXDocumentSerializer constructor using reflection.
-     */
-    public static Constructor fiStAXDocumentSerializer_new;
-
-    /**
-     * FI <code>StAXDocumentSerializer.setOutputStream()</code> method via reflection.
-     */
-    public static Method fiStAXDocumentSerializer_setOutputStream;
-
-    /**
-     * FI <code>StAXDocumentSerializer.setEncoding()</code> method via reflection.
-     */
-    public static Method fiStAXDocumentSerializer_setEncoding;
-
-    /**
-     * FI DOMDocumentParser constructor using reflection.
-     */
-    public static Constructor fiDOMDocumentParser_new;
-
-    /**
-     * FI <code>DOMDocumentParser.parse()</code> method via reflection.
-     */
-    public static Method fiDOMDocumentParser_parse;
-
-    /**
-     * FI DOMDocumentSerializer constructor using reflection.
-     */
-    public static Constructor fiDOMDocumentSerializer_new;
-
-    /**
-     * FI <code>FastInfosetSource.serialize(Document)</code> method via reflection.
-     */
-    public static Method fiDOMDocumentSerializer_serialize;
-
-    /**
-     * FI <code>FastInfosetSource.setOutputStream(OutputStream)</code> method via reflection.
-     */
-    public static Method fiDOMDocumentSerializer_setOutputStream;
-
-    /**
-     * FI FastInfosetSource class.
-     */
-    public static Class fiFastInfosetSource;
-
-    /**
-     * FI FastInfosetSource constructor using reflection.
-     */
-    public static Constructor fiFastInfosetSource_new;
-
-    /**
-     * FI <code>FastInfosetSource.getInputStream()</code> method via reflection.
-     */
-    public static Method fiFastInfosetSource_getInputStream;
-
-    /**
-     * FI <code>FastInfosetSource.setInputSTream()</code> method via reflection.
-     */
-    public static Method fiFastInfosetSource_setInputStream;
-
-    /**
-     * FI FastInfosetResult class using reflection.
-     */
-    public static Class fiFastInfosetResult;
-
-    /**
-     * FI FastInfosetResult constructor using reflection.
-     */
-    public static Constructor fiFastInfosetResult_new;
-
-    /**
-     * FI <code>FastInfosetResult.getOutputSTream()</code> method via reflection.
-     */
-    public static Method fiFastInfosetResult_getOutputStream;
+    public static final Method fiStAXDocumentParser_setStringInterning;
 
     static {
+        Constructor tmp_new = null;
+        Method tmp_setInputStream = null;
+        Method tmp_setStringInterning = null;
+
         // Use reflection to avoid static dependency with FI jar
         try {
-            Class clazz = null;
-            clazz = Class.forName("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
-            fiStAXDocumentParser_new = clazz.getConstructor();
-            fiStAXDocumentParser_setInputStream =
+            Class clazz = Class.forName("com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser");
+            tmp_new = clazz.getConstructor();
+            tmp_setInputStream =
                 clazz.getMethod("setInputStream", java.io.InputStream.class);
-            fiStAXDocumentParser_setStringInterning =
+            tmp_setStringInterning =
                 clazz.getMethod("setStringInterning", boolean.class);
-
-            clazz =
-                Class.forName("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
-            fiStAXDocumentSerializer_new = clazz.getConstructor();
-            fiStAXDocumentSerializer_setOutputStream =
-                clazz.getMethod("setOutputStream", java.io.OutputStream.class);
-            fiStAXDocumentSerializer_setEncoding =
-                clazz.getMethod("setEncoding", String.class);
-
-            clazz =
-                Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentParser");
-            fiDOMDocumentParser_new = clazz.getConstructor();
-            fiDOMDocumentParser_parse = clazz.getMethod("parse",
-                new Class[] { org.w3c.dom.Document.class, java.io.InputStream.class });
-
-            clazz = Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentSerializer");
-            fiDOMDocumentSerializer_new = clazz.getConstructor();
-            fiDOMDocumentSerializer_serialize = clazz.getMethod("serialize",
-                new Class[] { org.w3c.dom.Node.class });
-            fiDOMDocumentSerializer_setOutputStream = clazz.getMethod("setOutputStream",
-                new Class[] { java.io.OutputStream.class });
-
-            fiFastInfosetSource = clazz = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
-            fiFastInfosetSource_new = clazz.getConstructor(
-                new Class[] { java.io.InputStream.class });
-            fiFastInfosetSource_getInputStream = clazz.getMethod("getInputStream");
-            fiFastInfosetSource_setInputStream = clazz.getMethod("setInputStream",
-                new Class[] { java.io.InputStream.class });
-
-            fiFastInfosetResult = clazz = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetResult");
-            fiFastInfosetResult_new = clazz.getConstructor(
-                new Class[] { java.io.OutputStream.class });
-            fiFastInfosetResult_getOutputStream = clazz.getMethod("getOutputStream");
         }
         catch (Exception e) {
             // falls through
         }
+        fiStAXDocumentParser_new = tmp_new;
+        fiStAXDocumentParser_setInputStream = tmp_setInputStream;
+        fiStAXDocumentParser_setStringInterning = tmp_setStringInterning;
     }
 
-    // -- DOMDocumentParser ----------------------------------------------
-
-    public static Object DOMDocumentParser_new() throws Exception {
-        if (fiDOMDocumentParser_new == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return fiDOMDocumentParser_new.newInstance();
-    }
-
-    public static void DOMDocumentParser_parse(Object parser,
-        Document d, InputStream s) throws Exception
-    {
-        if (fiDOMDocumentParser_parse == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        fiDOMDocumentParser_parse.invoke(parser, d, s);
-    }
-
-    // -- DOMDocumentSerializer-------------------------------------------
-
-    public static Object DOMDocumentSerializer_new() throws Exception {
-        if (fiDOMDocumentSerializer_new == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return fiDOMDocumentSerializer_new.newInstance();
-    }
-
-    public static void DOMDocumentSerializer_serialize(Object serializer, Node node)
-        throws Exception
-    {
-        if (fiDOMDocumentSerializer_serialize == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        fiDOMDocumentSerializer_serialize.invoke(serializer, node);
-    }
-
-    public static void DOMDocumentSerializer_setOutputStream(Object serializer,
-        OutputStream os) throws Exception
-    {
-        if (fiDOMDocumentSerializer_setOutputStream == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        fiDOMDocumentSerializer_setOutputStream.invoke(serializer, os);
-    }
-
-    // -- FastInfosetSource ----------------------------------------------
-
-    public static boolean isFastInfosetSource(Source source) {
-        return source.getClass() == fiFastInfosetSource;
-    }
-
-    public static Source FastInfosetSource_new(InputStream is)
-        throws Exception
-    {
-        if (fiFastInfosetSource_new == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return (Source) fiFastInfosetSource_new.newInstance(is);
-    }
-
-    public static InputStream FastInfosetSource_getInputStream(Source source)
-        throws Exception
-    {
-        if (fiFastInfosetSource_getInputStream == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return (InputStream) fiFastInfosetSource_getInputStream.invoke(source);
-    }
-
-    public static void FastInfosetSource_setInputStream(Source source,
-        InputStream is) throws Exception
-    {
-        if (fiFastInfosetSource_setInputStream == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        fiFastInfosetSource_setInputStream.invoke(source, is);
-    }
-
-    // -- FastInfosetResult ----------------------------------------------
-
-    public static boolean isFastInfosetResult(Result result) {
-        return result.getClass() == fiFastInfosetResult;
-    }
-
-    public static Result FastInfosetResult_new(OutputStream os)
-        throws Exception
-    {
-        if (fiFastInfosetResult_new == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return (Result) fiFastInfosetResult_new.newInstance(os);
-    }
-
-    public static OutputStream FastInfosetResult_getOutputStream(Result result)
-        throws Exception
-    {
-        if (fiFastInfosetResult_getOutputStream == null) {
-            throw new RuntimeException("Unable to locate Fast Infoset implementation");
-        }
-        return (OutputStream) fiFastInfosetResult_getOutputStream.invoke(result);
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java
index 7c95a08..1165b6b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,78 +25,31 @@
 
 package com.sun.xml.internal.ws.util;
 
-import java.io.OutputStream;
-import java.io.StringReader;
-import java.util.List;
-import java.util.StringTokenizer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPException;
+import com.sun.xml.internal.ws.streaming.XMLReaderException;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderException;
 
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.messaging.saaj.soap.MessageImpl;
-import com.sun.xml.internal.ws.util.xml.XmlUtil;
-
-import static com.sun.xml.internal.ws.developer.JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY;
+import javax.xml.stream.XMLStreamReader;
+import java.io.InputStream;
 
 public class FastInfosetUtil {
 
-    public static boolean isFastInfosetAccepted(String[] accepts) {
-        if (accepts != null) {
-            for (String accept : accepts) {
-                if (isFastInfosetAccepted(accept)) {
-                    return true;
-                }
-            }
+    /**
+     * Returns the FI parser allocated for this thread.
+     */
+    public static XMLStreamReader createFIStreamReader(InputStream in) {
+        // Check if compatible implementation of FI was found
+        if (FastInfosetReflection.fiStAXDocumentParser_new == null) {
+            throw new XMLReaderException("fastinfoset.noImplementation");
         }
-        return false;
-    }
 
-    public static boolean isFastInfosetAccepted(String accept) {
-        StringTokenizer st = new StringTokenizer(accept, ",");
-        while (st.hasMoreTokens()) {
-            final String token = st.nextToken().trim();
-            if (token.equalsIgnoreCase("application/fastinfoset")) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static String getFastInfosetFromAccept(List<String> accepts) {
-        for (String accept : accepts) {
-            StringTokenizer st = new StringTokenizer(accept, ",");
-            while (st.hasMoreTokens()) {
-                final String token = st.nextToken().trim();
-                if (token.equalsIgnoreCase("application/fastinfoset")) {
-                    return "application/fastinfoset";
-                }
-                if (token.equalsIgnoreCase("application/soap+fastinfoset")) {
-                    return "application/soap+fastinfoset";
-                }
-            }
-        }
-        return null;
-    }
-
-    public static void transcodeXMLStringToFI(String xml, OutputStream out) {
         try {
-            XmlUtil.newTransformer().transform(
-                new StreamSource(new java.io.StringReader(xml)),
-                FastInfosetReflection.FastInfosetResult_new(out));
-        }
-        catch (Exception e) {
-            // Ignore
-        }
-    }
-
-    public static void ensureCorrectEncoding(MessageInfo messageInfo,
-        SOAPMessage message)
-    {
-        String conneg = (String) messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-        if (conneg == "optimistic") {
-            ((MessageImpl) message).setIsFastInfoset(true);
+            // Do not use StAX pluggable layer for FI
+            Object sdp = FastInfosetReflection.fiStAXDocumentParser_new.newInstance();
+            FastInfosetReflection.fiStAXDocumentParser_setStringInterning.invoke(sdp, Boolean.TRUE);
+            FastInfosetReflection.fiStAXDocumentParser_setInputStream.invoke(sdp, in);
+            return (XMLStreamReader) sdp;
+        } catch (Exception e) {
+            throw new XMLStreamReaderException(e);
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java
index 167bfd9..5c026a7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
index 8b71f0c..ea7e109 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,18 @@
  */
 package com.sun.xml.internal.ws.util;
 
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.server.AsyncProvider;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
 import com.sun.xml.internal.ws.handler.HandlerChainsModel;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.server.EndpointFactory;
 import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
 
 import javax.jws.HandlerChain;
 import javax.jws.WebService;
 import javax.jws.soap.SOAPMessageHandlers;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.Provider;
 import javax.xml.ws.Service;
@@ -52,9 +56,7 @@
  * So this class is used for all handler xml information. The
  * two public entry points are
  * {@link HandlerAnnotationProcessor#buildHandlerInfo}, called
- * when you have an annotated class that points to a file, and
- * {@link HandlerAnnotationProcessor#parseHandlerFile}, called
- * when the file reader already exists.
+ * when you have an annotated class that points to a file.
  *
  * <p>The methods in the class are static so that it may called
  * from the runtime statically.
@@ -70,8 +72,7 @@
 
     /**
      * <p>This method is called by
-     * {@link com.sun.xml.internal.ws.client.ServiceContextBuilder} and
-     * {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo} when
+     * {@link EndpointFactory} when
      * they have an annotated class.
      *
      * <p>If there is no handler chain annotation on the class,
@@ -83,17 +84,17 @@
      * handlers and roles. Will return null if the class passed
      * in has no handler chain annotation.
      */
-    public static HandlerAnnotationInfo buildHandlerInfo(Class clazz,
-        QName serviceName, QName portName, String bindingId) {
+    public static HandlerAnnotationInfo buildHandlerInfo(
+        Class<?> clazz, QName serviceName, QName portName, WSBinding binding) {
 
 //        clazz = checkClass(clazz);
         HandlerChain handlerChain =
-            (HandlerChain) clazz.getAnnotation(HandlerChain.class);
+            clazz.getAnnotation(HandlerChain.class);
         if (handlerChain == null) {
             clazz = getSEI(clazz);
             if (clazz != null)
             handlerChain =
-                (HandlerChain) clazz.getAnnotation(HandlerChain.class);
+                clazz.getAnnotation(HandlerChain.class);
             if (handlerChain == null)
                 return null;
         }
@@ -104,25 +105,47 @@
         }
         InputStream iStream = getFileAsStream(clazz, handlerChain);
         XMLStreamReader reader =
-            XMLStreamReaderFactory.createXMLStreamReader(iStream, true);
+            XMLStreamReaderFactory.create(null,iStream, true);
         XMLStreamReaderUtil.nextElementContent(reader);
-        return HandlerChainsModel.parseHandlerFile(reader, clazz.getClassLoader(),
-            serviceName, portName, bindingId);
+        HandlerAnnotationInfo handlerAnnInfo = HandlerChainsModel.parseHandlerFile(reader, clazz.getClassLoader(),
+            serviceName, portName, binding);
+        try {
+            reader.close();
+            iStream.close();
+        } catch (XMLStreamException e) {
+            e.printStackTrace();
+            throw new UtilException(e.getMessage());
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new UtilException(e.getMessage());
+        }
+        return handlerAnnInfo;
     }
 
-    public static HandlerChainsModel buildHandlerChainsModel(final Class clazz) {
+    public static HandlerChainsModel buildHandlerChainsModel(final Class<?> clazz) {
         if(clazz == null) {
             return null;
         }
         HandlerChain handlerChain =
-            (HandlerChain) clazz.getAnnotation(HandlerChain.class);
+            clazz.getAnnotation(HandlerChain.class);
         if(handlerChain == null)
             return null;
         InputStream iStream = getFileAsStream(clazz, handlerChain);
         XMLStreamReader reader =
-            XMLStreamReaderFactory.createXMLStreamReader(iStream, true);
+            XMLStreamReaderFactory.create(null,iStream, true);
         XMLStreamReaderUtil.nextElementContent(reader);
-        return HandlerChainsModel.parseHandlerConfigFile(clazz, reader);
+        HandlerChainsModel handlerChainsModel = HandlerChainsModel.parseHandlerConfigFile(clazz, reader);
+        try {
+            reader.close();
+            iStream.close();
+        } catch (XMLStreamException e) {
+            e.printStackTrace();
+            throw new UtilException(e.getMessage());
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new UtilException(e.getMessage());
+        }
+        return handlerChainsModel;
     }
 
     static Class getClass(String className) {
@@ -131,12 +154,12 @@
                 className);
         } catch (ClassNotFoundException e) {
             throw new UtilException("util.handler.class.not.found",
-                new Object[] {className});
+                className);
         }
     }
 
-    static Class getSEI(Class clazz) {
-        if (Provider.class.isAssignableFrom(clazz)) {
+    static Class getSEI(Class<?> clazz) {
+        if (Provider.class.isAssignableFrom(clazz) || AsyncProvider.class.isAssignableFrom(clazz)) {
             //No SEI for Provider Implementation
             return null;
         }
@@ -146,25 +169,24 @@
         }
         if (!clazz.isAnnotationPresent(WebService.class)) {
             throw new UtilException("util.handler.no.webservice.annotation",
-                new Object[] {clazz.getCanonicalName()});
+                clazz.getCanonicalName());
         }
 
-        WebService webService =
-            (WebService) clazz.getAnnotation(WebService.class);
+        WebService webService = clazz.getAnnotation(WebService.class);
 
         String ei = webService.endpointInterface();
         if (ei.length() > 0) {
             clazz = getClass(webService.endpointInterface());
             if (!clazz.isAnnotationPresent(WebService.class)) {
                 throw new UtilException("util.handler.endpoint.interface.no.webservice",
-                                    new Object[] {webService.endpointInterface()});
+                    webService.endpointInterface());
             }
             return clazz;
         }
         return null;
     }
 
-    static InputStream getFileAsStream(Class clazz, HandlerChain chain) {
+   static InputStream getFileAsStream(Class clazz, HandlerChain chain) {
         URL url = clazz.getResource(chain.file());
         if (url == null) {
             url = Thread.currentThread().getContextClassLoader().
@@ -179,15 +201,13 @@
         }
         if (url == null) {
             throw new UtilException("util.failed.to.find.handlerchain.file",
-                new Object[] {clazz.getName(), chain.file()});
+                clazz.getName(), chain.file());
         }
         try {
             return url.openStream();
         } catch (IOException e) {
             throw new UtilException("util.failed.to.parse.handlerchain.file",
-                new Object[] {clazz.getName(), chain.file()});
+                clazz.getName(), chain.file());
         }
     }
-
-
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/JAXWSUtils.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/JAXWSUtils.java
index a4e2a1d..77abccb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/JAXWSUtils.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/JAXWSUtils.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/MessageInfoUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/MessageInfoUtil.java
deleted file mode 100644
index 8036df9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/MessageInfoUtil.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.util;
-
-import com.sun.xml.internal.bind.api.BridgeContext;
-import com.sun.xml.internal.ws.client.BindingProviderProperties;
-import com.sun.xml.internal.ws.encoding.JAXWSAttachmentMarshaller;
-import com.sun.xml.internal.ws.encoding.soap.SOAPDecoder;
-import com.sun.xml.internal.ws.encoding.soap.internal.HeaderBlock;
-import com.sun.xml.internal.ws.handler.HandlerChainCaller;
-import com.sun.xml.internal.ws.handler.HandlerContext;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.bind.Marshaller;
-import java.util.Set;
-
-/**
- * @author WS RI Development Team
- */
-public class MessageInfoUtil {
-
-    public static void setRuntimeContext(MessageInfo messageInfo,
-                                         RuntimeContext runtimeContext) {
-        messageInfo.setMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT, runtimeContext);
-    }
-
-    public static RuntimeContext getRuntimeContext(MessageInfo messageInfo) {
-        return (RuntimeContext) messageInfo.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-    }
-
-    public static MessageContext getMessageContext(MessageInfo messageInfo) {
-        RuntimeContext rtCtxt = getRuntimeContext(messageInfo);
-        HandlerContext hdCtxt = null;
-        if (rtCtxt != null)
-            hdCtxt = rtCtxt.getHandlerContext();
-        else
-            hdCtxt = (HandlerContext)
-                messageInfo.getMetaData(BindingProviderProperties.JAXWS_HANDLER_CONTEXT_PROPERTY);
-        return (hdCtxt == null) ? null : hdCtxt.getMessageContext();
-    }
-
-    public static HandlerChainCaller getHandlerChainCaller(
-        MessageInfo messageInfo) {
-        return (HandlerChainCaller) messageInfo.getMetaData(
-            HandlerChainCaller.HANDLER_CHAIN_CALLER);
-    }
-
-    public static void setHandlerChainCaller(MessageInfo messageInfo,
-                                             HandlerChainCaller caller) {
-        messageInfo.setMetaData(HandlerChainCaller.HANDLER_CHAIN_CALLER,
-            caller);
-    }
-
-    public static JAXWSAttachmentMarshaller getAttachmentMarshaller(MessageInfo messageInfo) {
-        Object rtc = messageInfo.getMetaData(BindingProviderProperties.JAXWS_RUNTIME_CONTEXT);
-        if (rtc != null) {
-            BridgeContext bc = ((RuntimeContext) rtc).getBridgeContext();
-            if (bc != null) {
-                return (JAXWSAttachmentMarshaller) bc.getAttachmentMarshaller();
-            }
-        } else {
-             Marshaller m = (Marshaller)messageInfo.getMetaData(BindingProviderProperties.DISPATCH_MARSHALLER);
-            if (m != null) {
-                return (JAXWSAttachmentMarshaller) m.getAttachmentMarshaller();
-            }
-        }
-        return null;
-    }
-
-    public static void setNotUnderstoodHeaders(MessageInfo messageInfo,
-                                               Set<HeaderBlock> headers) {
-
-        messageInfo.setMetaData(SOAPDecoder.NOT_UNDERSTOOD_HEADERS, headers);
-    }
-
-    public static Set<HeaderBlock> getNotUnderstoodHeaders(
-        MessageInfo messageInfo) {
-
-        return (Set<HeaderBlock>) messageInfo.getMetaData(
-            SOAPDecoder.NOT_UNDERSTOOD_HEADERS);
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NamespaceSupport.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NamespaceSupport.java
index bb8de46..4eb4459 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NamespaceSupport.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NamespaceSupport.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,8 +103,8 @@
     /**
      * An empty enumeration.
      */
-    private final static Iterator EMPTY_ENUMERATION =
-        new ArrayList().iterator();
+    private final static Iterable<String> EMPTY_ENUMERATION =
+        new ArrayList<String>();
 
     ////////////////////////////////////////////////////////////////////
     // Constructor.
@@ -367,7 +367,7 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-    public Iterator getPrefixes() {
+    public Iterable<String> getPrefixes() {
         return currentContext.getPrefixes();
     }
 
@@ -417,9 +417,7 @@
      */
     public Iterator getPrefixes(String uri) {
         List prefixes = new ArrayList();
-        Iterator allPrefixes = getPrefixes();
-        while (allPrefixes.hasNext()) {
-            String prefix = (String) allPrefixes.next();
+        for (String prefix: getPrefixes()) {
             if (uri.equals(getURI(prefix))) {
                 prefixes.add(prefix);
             }
@@ -439,7 +437,7 @@
      * @see #getPrefixes
      * @see #getURI
      */
-    public Iterator getDeclaredPrefixes() {
+    public Iterable<String> getDeclaredPrefixes() {
         return currentContext.getDeclaredPrefixes();
     }
 
@@ -674,11 +672,11 @@
          * @return An enumeration of prefixes (possibly empty).
          * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
          */
-        Iterator getDeclaredPrefixes() {
+        Iterable<String> getDeclaredPrefixes() {
             if (declarations == null) {
                 return EMPTY_ENUMERATION;
             } else {
-                return declarations.iterator();
+                return declarations;
             }
         }
 
@@ -691,11 +689,11 @@
          * @return An enumeration of prefixes (never empty).
          * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
          */
-        Iterator getPrefixes() {
+        Iterable<String> getPrefixes() {
             if (prefixTable == null) {
                 return EMPTY_ENUMERATION;
             } else {
-                return prefixTable.keySet().iterator();
+                return prefixTable.keySet();
             }
         }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseInputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseInputStream.java
new file mode 100644
index 0000000..3a69209
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseInputStream.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * {@link InputStream} that cannot be closed.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class NoCloseInputStream extends FilterInputStream {
+    public NoCloseInputStream(InputStream is) {
+        super(is);
+    }
+
+    @Override
+    public void close() throws IOException {
+        // Intentionally left empty. use closeInput() to close
+    }
+
+    public void doClose() throws IOException {
+        super.close();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java
new file mode 100644
index 0000000..0d138f9
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import java.io.FilterOutputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * {@link OutputStream} that cannot be closed.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class NoCloseOutputStream extends FilterOutputStream {
+    public NoCloseOutputStream(OutputStream out) {
+        super(out);
+    }
+
+    @Override
+    public void close() throws IOException {
+        // Intentionally left empty. use closeOutput() to close
+    }
+
+    public void doClose() throws IOException {
+        super.close();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NullIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NullIterator.java
deleted file mode 100644
index 531c5b6..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NullIterator.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * An Iterator on an empty collection.
- *
- * @author WS Development Team
- */
-public final class NullIterator implements Iterator {
-
-    public static NullIterator getInstance() {
-        return _instance;
-    }
-
-    private static final NullIterator _instance = new NullIterator();
-
-    private NullIterator() {
-    }
-
-    public boolean hasNext() {
-        return false;
-    }
-
-    public Object next() {
-        throw new NoSuchElementException();
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Pool.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Pool.java
new file mode 100644
index 0000000..b95ec98
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Pool.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * General-purpose object pool.
+ *
+ * <p>
+ * In many parts of the runtime, we need to pool instances of objects that
+ * are expensive to create (such as JAXB objects, StAX parsers, {@link Tube} instances.)
+ *
+ * <p>
+ * This class provides a default implementation of such a pool.
+ *
+ * TODO: improve the implementation
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Pool<T> {
+    private final ConcurrentLinkedQueue<T> queue = new ConcurrentLinkedQueue<T>();
+
+    /**
+     * Gets a new object from the pool.
+     *
+     * <p>
+     * If no object is available in the pool, this method creates a new one.
+     *
+     * @return
+     *      always non-null.
+     */
+    public final T take() {
+        T t = queue.poll();
+        if(t==null)
+            return create();
+        return t;
+    }
+
+    /**
+     * Returns an object back to the pool.
+     */
+    public final void recycle(T t) {
+        queue.offer(t);
+    }
+
+    /**
+     * Creates a new instance of object.
+     *
+     * <p>
+     * This method is used when someone wants to
+     * {@link #take() take} an object from an empty pool.
+     *
+     * <p>
+     * Also note that multiple threads may call this method
+     * concurrently.
+     */
+    protected abstract T create();
+
+
+    /**
+     * JAXB {@link javax.xml.bind.Marshaller} pool.
+     */
+    public static final class Marshaller extends Pool<javax.xml.bind.Marshaller> {
+        private final JAXBContext context;
+
+        public Marshaller(JAXBContext context) {
+            this.context = context;
+        }
+
+        protected javax.xml.bind.Marshaller create() {
+            try {
+                return context.createMarshaller();
+            } catch (JAXBException e) {
+                // impossible
+                throw new AssertionError(e);
+            }
+        }
+    }
+
+    /**
+     * JAXB {@link javax.xml.bind.Marshaller} pool.
+     */
+    public static final class Unmarshaller extends Pool<javax.xml.bind.Unmarshaller> {
+        private final JAXBContext context;
+
+        public Unmarshaller(JAXBContext context) {
+            this.context = context;
+        }
+
+        protected javax.xml.bind.Unmarshaller create() {
+            try {
+                return context.createUnmarshaller();
+            } catch (JAXBException e) {
+                // impossible
+                throw new AssertionError(e);
+            }
+        }
+    }
+
+    /**
+     * {@link Tube} pool.
+     */
+    public static final class TubePool extends Pool<Tube> {
+        private final Tube master;
+
+        public TubePool(Tube master) {
+            this.master = master;
+            recycle(master);    // we'll use master as a part of the pool, too.
+        }
+
+        protected Tube create() {
+            return TubeCloner.clone(master);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/QNameMap.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/QNameMap.java
new file mode 100644
index 0000000..25ae78a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/QNameMap.java
@@ -0,0 +1,485 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import javax.xml.namespace.QName;
+import java.util.AbstractSet;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+/**
+ * Map keyed by {@link QName}.
+ *
+ * This specialized map allows a look up operation without constructing
+ * a new QName instance, for a performance reason. This {@link Map} assumes
+ * that both namespace URI and local name are {@link String#intern() intern}ed.
+ *
+ * @since JAXB 2.0
+ */
+public final class QNameMap<V> {
+    /**
+     * The default initial capacity - MUST be a power of two.
+     */
+    private static final int DEFAULT_INITIAL_CAPACITY = 16;
+
+    /**
+     * The maximum capacity, used if a higher value is implicitly specified
+     * by either of the constructors with arguments.
+     * MUST be a power of two <= 1<<30.
+     */
+    private static final int MAXIMUM_CAPACITY = 1 << 30;
+
+    /**
+     * The table, resized as necessary. Length MUST Always be a power of two.
+     */
+    transient Entry<V>[] table = new Entry[DEFAULT_INITIAL_CAPACITY];
+
+    /**
+     * The number of key-value mappings contained in this identity hash map.
+     */
+    transient int size;
+
+    /**
+     * The next size value at which to resize . Taking it as
+     * MAXIMUM_CAPACITY
+     * @serial
+     */
+    private int threshold;
+
+    /**
+     * The load factor used when none specified in constructor.
+     **/
+    private static final float DEFAULT_LOAD_FACTOR = 0.75f;
+
+
+
+    /**
+     * Gives an entrySet view of this map
+     */
+    private Set<Entry<V>> entrySet = null;
+
+    public QNameMap() {
+        threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);
+        table = new Entry[DEFAULT_INITIAL_CAPACITY];
+
+    }
+
+    /**
+     * Associates the specified value with the specified keys in this map.
+     * If the map previously contained a mapping for this key, the old
+     * value is replaced.
+     *
+     * @param namespaceUri First key with which the specified value is to be associated.
+     * @param localname Second key with which the specified value is to be associated.
+     * @param value value to be associated with the specified key.
+     *
+     */
+    public void put(String namespaceUri,String localname, V value ) {
+        //keys cannot be null
+        assert localname !=null;
+        assert namespaceUri !=null;
+
+        int hash = hash(localname);
+        int i = indexFor(hash, table.length);
+
+        for (Entry<V> e = table[i]; e != null; e = e.next) {
+            if (e.hash == hash && localname.equals(e.localName) && namespaceUri.equals(e.nsUri)) {
+                e.value = value;
+                return;
+            }
+        }
+
+        addEntry(hash, namespaceUri,localname, value, i);
+
+    }
+
+    public void put(QName name, V value ) {
+        put(name.getNamespaceURI(),name.getLocalPart(),value);
+    }
+
+    /**
+     * Returns the value to which the specified keys are mapped in this QNameMap,
+     * or <tt>null</tt> if the map contains no mapping for this key.
+     *
+     * @param   nsUri the namespaceUri key whose associated value is to be returned.
+     * @param   localPart the localPart key whose associated value is to be returned.
+     * @return  the value to which this map maps the specified set of keya, or
+     *          <tt>null</tt> if the map contains no mapping for this set of keys.
+     * @see #put(String,String, Object)
+     */
+    public V get( String nsUri, String localPart ) {
+        Entry<V> e = getEntry(nsUri,localPart);
+        if(e==null) return null;
+        else        return e.value;
+    }
+
+    public V get( QName name ) {
+        return get(name.getNamespaceURI(),name.getLocalPart());
+    }
+
+    /**
+     * Returns the number of keys-value mappings in this map.
+     *
+     * @return the number of keys-value mappings in this map.
+     */
+    public int size() {
+        return size;
+    }
+
+    /**
+     * Copies all of the mappings from the specified map to this map
+     * These mappings will replace any mappings that
+     * this map had for any of the keys currently in the specified map.
+     *
+     * @param map mappings to be stored in this map.
+     *
+     */
+    public QNameMap<V> putAll(QNameMap<? extends V> map) {
+        int numKeysToBeAdded = map.size();
+        if (numKeysToBeAdded == 0)
+            return this;
+
+
+        if (numKeysToBeAdded > threshold) {
+            int targetCapacity = numKeysToBeAdded;
+            if (targetCapacity > MAXIMUM_CAPACITY)
+                targetCapacity = MAXIMUM_CAPACITY;
+            int newCapacity = table.length;
+            while (newCapacity < targetCapacity)
+                newCapacity <<= 1;
+            if (newCapacity > table.length)
+                resize(newCapacity);
+        }
+
+        for( Entry<? extends V> e : map.entrySet() )
+            put(e.nsUri,e.localName,e.getValue());
+        return this;
+    }
+
+    public QNameMap<V> putAll(Map<QName,? extends V> map) {
+        for (Map.Entry<QName, ? extends V> e : map.entrySet()) {
+            QName qn = e.getKey();
+            put(qn.getNamespaceURI(),qn.getLocalPart(),e.getValue());
+        }
+        return this;
+    }
+
+
+    /**
+     * Returns a hash value for the specified object.The hash value is computed
+     * for the localName.
+     */
+    private static int hash(String x) {
+        int h = x.hashCode();
+
+        h += ~(h << 9);
+        h ^=  (h >>> 14);
+        h +=  (h << 4);
+        h ^=  (h >>> 10);
+        return h;
+    }
+
+    /**
+     * Returns index for hash code h.
+     */
+    private static int indexFor(int h, int length) {
+        return h & (length-1);
+    }
+
+    /**
+     * Add a new entry with the specified keys, value and hash code to
+     * the specified bucket.  It is the responsibility of this
+     * method to resize the table if appropriate.
+     *
+     */
+    private void addEntry(int hash, String nsUri, String localName, V value, int bucketIndex) {
+        Entry<V> e = table[bucketIndex];
+        table[bucketIndex] = new Entry<V>(hash, nsUri, localName, value, e);
+        if (size++ >= threshold)
+            resize(2 * table.length);
+    }
+
+
+    /**
+     * Rehashes the contents of this map into a new array with a
+     * larger capacity.  This method is called automatically when the
+     * number of keys in this map reaches its threshold.
+     */
+    private void resize(int newCapacity) {
+        Entry[] oldTable = table;
+        int oldCapacity = oldTable.length;
+        if (oldCapacity == MAXIMUM_CAPACITY) {
+            threshold = Integer.MAX_VALUE;
+            return;
+        }
+
+        Entry[] newTable = new Entry[newCapacity];
+        transfer(newTable);
+        table = newTable;
+        threshold = newCapacity;
+    }
+
+    /**
+     * Transfer all entries from current table to newTable.
+     */
+    private void transfer(Entry<V>[] newTable) {
+        Entry<V>[] src = table;
+        int newCapacity = newTable.length;
+        for (int j = 0; j < src.length; j++) {
+            Entry<V> e = src[j];
+            if (e != null) {
+                src[j] = null;
+                do {
+                    Entry<V> next = e.next;
+                    int i = indexFor(e.hash, newCapacity);
+                    e.next = newTable[i];
+                    newTable[i] = e;
+                    e = next;
+                } while (e != null);
+            }
+        }
+    }
+
+    /**
+     * Returns one random item in the map.
+     * If this map is empty, return null.
+     *
+     * <p>
+     * This method is useful to obtain the value from a map that only contains one element.
+     */
+    public Entry<V> getOne() {
+        for( Entry<V> e : table ) {
+            if(e!=null)
+                return e;
+        }
+        return null;
+    }
+
+    public Collection<QName> keySet() {
+        Set<QName> r = new HashSet<QName>();
+        for (Entry<V> e : entrySet()) {
+            r.add(e.createQName());
+        }
+        return r;
+    }
+
+    public Iterable<V> values() {
+        return views;
+    }
+
+    private transient Iterable<V> views = new Iterable<V>() {
+        public Iterator<V> iterator() {
+            return new ValueIterator();
+        }
+    };
+
+    private abstract class HashIterator<E> implements Iterator<E> {
+        Entry<V> next;  // next entry to return
+        int index;              // current slot
+
+        HashIterator() {
+            Entry<V>[] t = table;
+            int i = t.length;
+            Entry<V> n = null;
+            if (size != 0) { // advance to first entry
+                while (i > 0 && (n = t[--i]) == null)
+                    ;
+            }
+            next = n;
+            index = i;
+        }
+
+        public boolean hasNext() {
+            return next != null;
+        }
+
+        Entry<V> nextEntry() {
+            Entry<V> e = next;
+            if (e == null)
+                throw new NoSuchElementException();
+
+            Entry<V> n = e.next;
+            Entry<V>[] t = table;
+            int i = index;
+            while (n == null && i > 0)
+                n = t[--i];
+            index = i;
+            next = n;
+            return e;
+        }
+
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    private class ValueIterator extends HashIterator<V> {
+        public V next() {
+            return nextEntry().value;
+        }
+    }
+
+    public boolean containsKey(String nsUri,String localName) {
+        return getEntry(nsUri,localName)!=null;
+    }
+
+
+    /**
+     * Returns true if this map is empty.
+     */
+    public boolean isEmpty() {
+        return size == 0;
+    }
+
+
+    public static final class Entry<V>  {
+        /** The namespace URI. */
+        public final String nsUri;
+
+        /** The localPart. */
+        public final String localName;
+
+        V value;
+        final int hash;
+        Entry<V> next;
+
+        /**
+         * Create new entry.
+         */
+        Entry(int h, String nsUri, String localName, V v, Entry<V> n) {
+            value = v;
+            next = n;
+            this.nsUri = nsUri;
+            this.localName = localName;
+            hash = h;
+        }
+
+        /**
+         * Creates a new QName object from {@link #nsUri} and {@link #localName}.
+         */
+        public QName createQName() {
+            return new QName(nsUri,localName);
+        }
+
+        public V getValue() {
+            return value;
+        }
+
+        public V setValue(V newValue) {
+            V oldValue = value;
+            value = newValue;
+            return oldValue;
+        }
+
+        public boolean equals(Object o) {
+            if (!(o instanceof Entry))
+                return false;
+            Entry e = (Entry)o;
+            String k1 = nsUri;
+            String k2 = e.nsUri;
+            String k3 = localName;
+            String k4 = e.localName;
+            if (k1.equals(k2) && k3.equals(k4)) {
+                Object v1 = getValue();
+                Object v2 = e.getValue();
+                if (v1 == v2 || (v1 != null && v1.equals(v2)))
+                    return true;
+            }
+            return false;
+        }
+
+        public int hashCode() {
+            return ( localName.hashCode()) ^
+                    (value==null   ? 0 : value.hashCode());
+        }
+
+        public String toString() {
+            return '"'+nsUri +"\",\"" +localName + "\"=" + getValue();
+        }
+    }
+
+    public Set<Entry<V>> entrySet() {
+        Set<Entry<V>> es = entrySet;
+        return es != null ? es : (entrySet = new EntrySet());
+    }
+
+    private Iterator<Entry<V>> newEntryIterator() {
+        return new EntryIterator();
+    }
+
+    private class EntryIterator extends HashIterator<Entry<V>> {
+        public Entry<V> next() {
+            return nextEntry();
+        }
+    }
+    private class EntrySet extends AbstractSet<Entry<V>> {
+        public Iterator<Entry<V>> iterator() {
+            return newEntryIterator();
+        }
+        public boolean contains(Object o) {
+            if (!(o instanceof Entry))
+                return false;
+            Entry<V> e = (Entry<V>) o;
+            Entry<V> candidate = getEntry(e.nsUri,e.localName);
+            return candidate != null && candidate.equals(e);
+        }
+        public boolean remove(Object o) {
+            throw new UnsupportedOperationException();
+        }
+        public int size() {
+            return size;
+        }
+    }
+
+    private Entry<V> getEntry(String nsUri,String localName) {
+        int hash = hash(localName);
+        int i = indexFor(hash, table.length);
+        Entry<V> e = table[i];
+        while (e != null && !(localName.equals(e.localName) && nsUri.equals(e.nsUri)))
+            e = e.next;
+        return e;
+    }
+
+    public String toString() {
+        StringBuilder buf = new StringBuilder();
+        buf.append('{');
+
+        for( Entry<V> e : entrySet() ) {
+            if(buf.length()>1)
+                buf.append(',');
+            buf.append('[');
+            buf.append(e);
+            buf.append(']');
+        }
+
+        buf.append('}');
+        return buf.toString();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ReadOnlyPropertyException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ReadOnlyPropertyException.java
new file mode 100644
index 0000000..a9f21d2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ReadOnlyPropertyException.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import com.sun.xml.internal.ws.api.PropertySet;
+
+/**
+ * Used to indicate that {@link PropertySet#put(String, Object)} failed
+ * because a property is read-only.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class ReadOnlyPropertyException extends IllegalArgumentException {
+    private final String propertyName;
+
+    public ReadOnlyPropertyException(String propertyName) {
+        super(propertyName+" is a read-only property.");
+        this.propertyName = propertyName;
+    }
+
+    /**
+     * Gets the name of the property that was read-only.
+     */
+    public String getPropertyName() {
+        return propertyName;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java
index 38b47ff..84feee9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPConnectionUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPConnectionUtil.java
deleted file mode 100644
index 29b801b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPConnectionUtil.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util;
-
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.messaging.saaj.util.ByteInputStream;
-import com.sun.xml.internal.ws.binding.BindingImpl;
-import com.sun.xml.internal.ws.server.RuntimeContext;
-import com.sun.xml.internal.ws.server.RuntimeEndpointInfo;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPBinding;
-
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import static com.sun.xml.internal.ws.developer.JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-/**
- * @author WS Development Team
- */
-public class SOAPConnectionUtil {
-
-    public static SOAPMessage getSOAPMessage(WSConnection con, MessageInfo mi, String bindingId) {
-        try {
-            Map<String, List<String>> headers = con.getHeaders();
-            MimeHeaders mh = new MimeHeaders();
-            if (headers != null)
-                for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
-                    String name = entry.getKey();
-                    for (String value : entry.getValue()) {
-                        try {
-                            mh.addHeader(name, value);
-                        } catch(IllegalArgumentException ie) {
-                            // Not a mime header. Ignore it.
-                        }
-                    }
-                }
-            RuntimeContext rtCtxt = MessageInfoUtil.getRuntimeContext(mi);
-            if (rtCtxt != null) {
-                RuntimeEndpointInfo endpointInfo = rtCtxt.getRuntimeEndpointInfo();
-                if (bindingId == null)
-                    bindingId = ((BindingImpl) endpointInfo.getBinding()).getBindingId();
-            }
-            SOAPMessage soapMessage = SOAPUtil.createMessage(mh,
-                con.getInput(), bindingId);
-            return soapMessage;
-        } catch (Exception e) {
-//            e.printStackTrace();
-            throw new WebServiceException(e);
-        }
-    }
-
-    private static void send(WSConnection con, SOAPMessage soapMessage) {
-        try {
-            if (soapMessage.saveRequired()) {
-                soapMessage.saveChanges();
-            }
-            Map<String, List<String>> headers = new HashMap<String, List<String>>();
-            MimeHeaders mhs = soapMessage.getMimeHeaders();
-            Iterator i = mhs.getAllHeaders();
-            while (i.hasNext()) {
-                MimeHeader mh = (MimeHeader) i.next();
-                String name = mh.getName();
-                List<String> values = headers.get(name);
-                if (values == null) {
-                    values = new ArrayList<String>();
-                    headers.put(name, values);
-                }
-                values.add(mh.getValue());
-            }
-            con.setHeaders(headers);
-            soapMessage.writeTo(con.getOutput());
-            con.closeOutput();
-        } catch (Exception e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    public static void sendResponse(WSConnection con, SOAPMessage soapMessage) {
-        //setStatus(con, WSConnection.OK);
-        send(con, soapMessage);
-    }
-
-    public static void sendKnownError(MessageInfo messageInfo, int status) {
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        setStatus(con, status);
-        con.getOutput();
-        con.closeOutput();
-    }
-
-    public static void sendResponseOneway(MessageInfo messageInfo) {
-        WSConnection con = (WSConnection)messageInfo.getConnection();
-        setStatus(con, WSConnection.ONEWAY);
-        con.getOutput();
-
-        // Ensure conneg is completed even if no data is sent back
-        if (messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY) == "optimistic") {
-            List<String> acceptList = null;
-            List<String> contentTypeList = null;
-            Map<String, List<String>> headers = con.getHeaders();
-
-            // Go through the entries because a gets are case sensitive
-            for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
-                if (entry.getKey().equalsIgnoreCase("content-type")) {
-                    contentTypeList = entry.getValue();
-                }
-                else if (entry.getKey().equalsIgnoreCase("accept")) {
-                    acceptList = entry.getValue();
-                }
-            }
-
-            // If content-type is FI, FI must be listed in the accept header
-            assert contentTypeList != null && acceptList != null;
-
-            // Use FI MIME type based on Accept header
-            contentTypeList.set(0,
-                FastInfosetUtil.getFastInfosetFromAccept(acceptList));
-        }
-
-        con.closeOutput();
-    }
-
-    public static void sendResponseError(WSConnection con, String bindingId) {
-        try {
-            SOAPMessage message = SOAPUtil.createMessage(bindingId);
-            ByteArrayBuffer bufferedStream = new ByteArrayBuffer();
-            Writer writer = new OutputStreamWriter(bufferedStream, "UTF-8");
-            if(bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING))
-                writer.write(DEFAULT_SERVER_ERROR_SOAP12_ENVELOPE);
-            else
-                writer.write(DEFAULT_SERVER_ERROR_ENVELOPE);
-            writer.close();
-            message.getSOAPPart().setContent(new StreamSource(bufferedStream.newInputStream()));
-            setStatus(con, WSConnection.INTERNAL_ERR);
-            send(con, message);
-        } catch (Exception e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    public static Map<String, List<String>> getHeaders(WSConnection con) {
-        return con.getHeaders();
-    }
-
-    /**
-     * sets response headers.
-     */
-    public static void setHeaders(WSConnection con,
-                                  Map<String, List<String>> headers) {
-        con.setHeaders(headers);
-    }
-
-    public static void setStatus(WSConnection con, int status) {
-        con.setStatus(status);
-    }
-
-    private final static String DEFAULT_SERVER_ERROR_ENVELOPE =
-        "<?xml version='1.0' encoding='UTF-8'?>"
-        + "<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">"
-        + "<env:Body>"
-        + "<env:Fault>"
-        + "<faultcode>env:Server</faultcode>"
-        + "<faultstring>Internal server error</faultstring>"
-        + "</env:Fault>"
-        + "</env:Body>"
-        + "</env:Envelope>";
-
-    private final static String DEFAULT_SERVER_ERROR_SOAP12_ENVELOPE =
-        "<?xml version='1.0' encoding='UTF-8'?>"
-        + "<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">"
-        + "<env:Body>"
-        + "<env:Fault>"
-        + "<env:Code><env:Value>env:Receiver</env:Value></env:Code>"
-        + "<env:Reason><env:Text lang=\""+ Locale.getDefault().getLanguage() +"\">"
-        + "Internal server error</env:Text></env:Reason>"
-        + "</env:Fault>"
-        + "</env:Body>"
-        + "</env:Envelope>";
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPUtil.java
deleted file mode 100644
index cc87a66..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SOAPUtil.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util;
-
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPMsgCreateException;
-import com.sun.xml.internal.ws.encoding.soap.message.SOAPMsgFactoryCreateException;
-import java.io.IOException;
-import java.io.InputStream;
-import javax.xml.soap.*;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.*;
-import org.w3c.dom.Node;
-
-/**
- * $author: JAXWS Development Team
- */
-
-/**
- * Has utility methods to create SOAPMessage
- */
-public class SOAPUtil {
-
-    private static final MessageFactory soap11messageFactory =
-            createMessageFactory(SOAPConstants.SOAP_1_1_PROTOCOL);
-    private static final MessageFactory soap12messageFactory =
-            createMessageFactory(SOAPConstants.SOAP_1_2_PROTOCOL);
-    private static final SOAPFactory soap11Factory = createSOAPFactory(SOAPConstants.SOAP_1_1_PROTOCOL);
-    private static final SOAPFactory soap12Factory = createSOAPFactory(SOAPConstants.SOAP_1_2_PROTOCOL);
-
-    private static SOAPFactory createSOAPFactory(String soapProtocol) {
-        try {
-            return SOAPFactory.newInstance(soapProtocol);
-        } catch(SOAPException e) {
-            throw new SOAPMsgFactoryCreateException(
-                "soap.factory.create.err",
-                new Object[] { e });
-        }
-    }
-
-    /**
-     *
-     * @param bindingId
-     * @return
-     *          returns SOAPFactor for SOAP 1.2 if bindingID equals SOAP1.2 HTTP binding else
-     *          SOAPFactory for SOAP 1.1
-     */
-    public static SOAPFactory getSOAPFactory(String bindingId){
-        if(bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)){
-            return soap12Factory;
-        }
-        return soap11Factory;
-    }
-
-    public static SOAPFault createSOAPFault(String bindingId){
-        if(bindingId == null)
-            bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-         try {
-            if(bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING))
-                return soap12Factory.createFault();
-            return soap11Factory.createFault();
-        } catch (SOAPException e) {
-            throw new SOAPMsgFactoryCreateException(
-                "soap.fault.create.err",
-                new Object[] { e });
-        }
-    }
-
-    /**
-     * Creates SOAP 1.1 or SOAP 1.2 SOAPFault based on the bindingId
-     * @param msg
-     * @param code
-     * @param actor
-     * @param detail
-     * @return the created SOAPFault
-     */
-    public static SOAPFault createSOAPFault(String msg, QName code, String actor, Detail detail, String bindingId){
-        if(bindingId == null)
-            bindingId = SOAPBinding.SOAP11HTTP_BINDING;
-        try {
-            SOAPFault fault = null;
-            if(bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING))
-                fault = soap12Factory.createFault(msg, code);
-            else if(bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING))
-                fault = soap11Factory.createFault(msg, code);
-            if(actor != null)
-                fault.setFaultActor(actor);
-            if(detail != null){
-                Node n = fault.getOwnerDocument().importNode(detail, true);
-                fault.appendChild(n);
-            }
-            return fault;
-        } catch (SOAPException e) {
-            throw new SOAPMsgFactoryCreateException(
-                "soap.fault.create.err",
-                new Object[] { e });
-        }
-    }
-
-    public static SOAPMessage createMessage() {
-        return createMessage(SOAPBinding.SOAP11HTTP_BINDING);
-    }
-
-    /**
-     *
-     * @param binding
-     * @return a <code>SOAPMessage</code> associated with <code>binding</code>
-     */
-    public static SOAPMessage createMessage(String binding) {
-        try {
-            return getMessageFactory(binding).createMessage();
-        } catch (SOAPException e) {
-            throw new SOAPMsgCreateException(
-                    "soap.msg.create.err",
-                    new Object[] { e });
-        }
-    }
-
-    /**
-     *
-     * @param binding
-     * @param headers
-     * @param in
-     * @return <code>SOAPMessage</code> with <code>MimeHeaders</code> from an
-     *         <code>InputStream</code> and binding.
-     * @throws IOException
-     */
-    public static SOAPMessage createMessage(MimeHeaders headers, InputStream in,
-            String binding) throws IOException {
-        try {
-            return getMessageFactory(binding).createMessage(headers, in);
-        } catch (SOAPException e) {
-            throw new SOAPMsgCreateException(
-                    "soap.msg.create.err",
-                    new Object[] { e });
-        }
-    }
-
-    public static SOAPMessage createMessage(MimeHeaders headers, InputStream in)
-    throws IOException {
-        return createMessage(headers, in, SOAPBinding.SOAP11HTTP_BINDING);
-    }
-
-    public static MessageFactory getMessageFactory(String binding) {
-        if (binding.equals(SOAPBinding.SOAP11HTTP_BINDING)) {
-            return soap11messageFactory;
-        } else if (binding.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
-            return soap12messageFactory;
-        }
-        return soap11messageFactory;
-    }
-
-    private static MessageFactory createMessageFactory(String bindingId) {
-        try {
-            return MessageFactory.newInstance(bindingId);
-        } catch(SOAPException e) {
-            throw new SOAPMsgFactoryCreateException(
-                "soap.msg.factory.create.err",
-                new Object[] { e });
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceConfigurationError.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceConfigurationError.java
new file mode 100644
index 0000000..b644768
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceConfigurationError.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+/**
+ * Error thrown when something goes wrong while looking up service providers.
+ * In particular, this error will be thrown in the following situations:
+ *
+ *   <ul>
+ *   <li> A concrete provider class cannot be found,
+ *   <li> A concrete provider class cannot be instantiated,
+ *   <li> The format of a provider-configuration file is illegal, or
+ *   <li> An IOException occurs while reading a provider-configuration file.
+ *   </ul>
+ *
+ * @author Mark Reinhold
+ * @version 1.7, 03/12/19
+ * @since 1.3
+ */
+public class ServiceConfigurationError extends Error {
+
+    /**
+     * Constructs a new instance with the specified detail string.
+     */
+    public ServiceConfigurationError(String msg) {
+        super(msg);
+    }
+
+    /**
+     * Constructs a new instance that wraps the specified throwable.
+     */
+    public ServiceConfigurationError(Throwable x) {
+        super(x);
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceFinder.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceFinder.java
new file mode 100644
index 0000000..d1da32a
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ServiceFinder.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Array;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.TreeSet;
+
+
+/**
+ * A simple service-provider lookup mechanism.  A <i>service</i> is a
+ * well-known set of interfaces and (usually abstract) classes.  A <i>service
+ * provider</i> is a specific implementation of a service.  The classes in a
+ * provider typically implement the interfaces and subclass the classes defined
+ * in the service itself.  Service providers may be installed in an
+ * implementation of the Java platform in the form of extensions, that is, jar
+ * files placed into any of the usual extension directories.  Providers may
+ * also be made available by adding them to the applet or application class
+ * path or by some other platform-specific means.
+ * <p/>
+ * <p> In this lookup mechanism a service is represented by an interface or an
+ * abstract class.  (A concrete class may be used, but this is not
+ * recommended.)  A provider of a given service contains one or more concrete
+ * classes that extend this <i>service class</i> with data and code specific to
+ * the provider.  This <i>provider class</i> will typically not be the entire
+ * provider itself but rather a proxy that contains enough information to
+ * decide whether the provider is able to satisfy a particular request together
+ * with code that can create the actual provider on demand.  The details of
+ * provider classes tend to be highly service-specific; no single class or
+ * interface could possibly unify them, so no such class has been defined.  The
+ * only requirement enforced here is that provider classes must have a
+ * zero-argument constructor so that they may be instantiated during lookup.
+ * <p/>
+ * <p> A service provider identifies itself by placing a provider-configuration
+ * file in the resource directory <tt>META-INF/services</tt>.  The file's name
+ * should consist of the fully-qualified name of the abstract service class.
+ * The file should contain a list of fully-qualified concrete provider-class
+ * names, one per line.  Space and tab characters surrounding each name, as
+ * well as blank lines, are ignored.  The comment character is <tt>'#'</tt>
+ * (<tt>0x23</tt>); on each line all characters following the first comment
+ * character are ignored.  The file must be encoded in UTF-8.
+ * <p/>
+ * <p> If a particular concrete provider class is named in more than one
+ * configuration file, or is named in the same configuration file more than
+ * once, then the duplicates will be ignored.  The configuration file naming a
+ * particular provider need not be in the same jar file or other distribution
+ * unit as the provider itself.  The provider must be accessible from the same
+ * class loader that was initially queried to locate the configuration file;
+ * note that this is not necessarily the class loader that found the file.
+ * <p/>
+ * <p> <b>Example:</b> Suppose we have a service class named
+ * <tt>java.io.spi.CharCodec</tt>.  It has two abstract methods:
+ * <p/>
+ * <pre>
+ *   public abstract CharEncoder getEncoder(String encodingName);
+ *   public abstract CharDecoder getDecoder(String encodingName);
+ * </pre>
+ * <p/>
+ * Each method returns an appropriate object or <tt>null</tt> if it cannot
+ * translate the given encoding.  Typical <tt>CharCodec</tt> providers will
+ * support more than one encoding.
+ * <p/>
+ * <p> If <tt>sun.io.StandardCodec</tt> is a provider of the <tt>CharCodec</tt>
+ * service then its jar file would contain the file
+ * <tt>META-INF/services/java.io.spi.CharCodec</tt>.  This file would contain
+ * the single line:
+ * <p/>
+ * <pre>
+ *   sun.io.StandardCodec    # Standard codecs for the platform
+ * </pre>
+ * <p/>
+ * To locate an codec for a given encoding name, the internal I/O code would
+ * do something like this:
+ * <p/>
+ * <pre>
+ *   CharEncoder getEncoder(String encodingName) {
+ *       for( CharCodec cc : ServiceFinder.find(CharCodec.class) ) {
+ *           CharEncoder ce = cc.getEncoder(encodingName);
+ *           if (ce != null)
+ *               return ce;
+ *       }
+ *       return null;
+ *   }
+ * </pre>
+ * <p/>
+ * The provider-lookup mechanism always executes in the security context of the
+ * caller.  Trusted system code should typically invoke the methods in this
+ * class from within a privileged security context.
+ *
+ * @author Mark Reinhold
+ * @version 1.11, 03/12/19
+ * @since 1.3
+ */
+public final class ServiceFinder<T> implements Iterable<T> {
+
+    private static final String prefix = "META-INF/services/";
+
+    private final Class<T> serviceClass;
+    private final @Nullable ClassLoader classLoader;
+
+    /**
+     * Locates and incrementally instantiates the available providers of a
+     * given service using the given class loader.
+     * <p/>
+     * <p> This method transforms the name of the given service class into a
+     * provider-configuration filename as described above and then uses the
+     * <tt>getResources</tt> method of the given class loader to find all
+     * available files with that name.  These files are then read and parsed to
+     * produce a list of provider-class names.  The iterator that is returned
+     * uses the given class loader to lookup and then instantiate each element
+     * of the list.
+     * <p/>
+     * <p> Because it is possible for extensions to be installed into a running
+     * Java virtual machine, this method may return different results each time
+     * it is invoked. <p>
+     *
+     * @param service The service's abstract service class
+     * @param loader  The class loader to be used to load provider-configuration files
+     *                and instantiate provider classes, or <tt>null</tt> if the system
+     *                class loader (or, failing that the bootstrap class loader) is to
+     *                be used
+     * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
+     *                                   or names a provider class that cannot be found and instantiated
+     * @see #find(Class)
+     */
+    public static <T> ServiceFinder<T> find(@NotNull Class<T> service, @Nullable ClassLoader loader) {
+        return new ServiceFinder<T>(service,loader);
+    }
+
+    /**
+     * Locates and incrementally instantiates the available providers of a
+     * given service using the context class loader.  This convenience method
+     * is equivalent to
+     * <p/>
+     * <pre>
+     *   ClassLoader cl = Thread.currentThread().getContextClassLoader();
+     *   return Service.providers(service, cl);
+     * </pre>
+     *
+     * @param service The service's abstract service class
+     *
+     * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
+     *                                   or names a provider class that cannot be found and instantiated
+     * @see #find(Class, ClassLoader)
+     */
+    public static <T> ServiceFinder<T> find(Class<T> service) {
+        return find(service,Thread.currentThread().getContextClassLoader());
+    }
+
+    private ServiceFinder(Class<T> service, ClassLoader loader) {
+        this.serviceClass = service;
+        this.classLoader = loader;
+    }
+
+    /**
+     * Returns discovered objects incrementally.
+     *
+     * @return An <tt>Iterator</tt> that yields provider objects for the given
+     *         service, in some arbitrary order.  The iterator will throw a
+     *         <tt>ServiceConfigurationError</tt> if a provider-configuration
+     *         file violates the specified format or if a provider class cannot
+     *         be found and instantiated.
+     */
+    public Iterator<T> iterator() {
+        return new LazyIterator<T>(serviceClass,classLoader);
+    }
+
+    /**
+     * Returns discovered objects all at once.
+     *
+     * @return
+     *      can be empty but never null.
+     *
+     * @throws ServiceConfigurationError
+     */
+    public T[] toArray() {
+        List<T> result = new ArrayList<T>();
+        for (T t : this) {
+            result.add(t);
+        }
+        return result.toArray((T[])Array.newInstance(serviceClass,result.size()));
+    }
+
+    private static void fail(Class service, String msg, Throwable cause)
+        throws ServiceConfigurationError {
+        ServiceConfigurationError sce
+            = new ServiceConfigurationError(service.getName() + ": " + msg);
+        sce.initCause(cause);
+        throw sce;
+    }
+
+    private static void fail(Class service, String msg)
+        throws ServiceConfigurationError {
+        throw new ServiceConfigurationError(service.getName() + ": " + msg);
+    }
+
+    private static void fail(Class service, URL u, int line, String msg)
+        throws ServiceConfigurationError {
+        fail(service, u + ":" + line + ": " + msg);
+    }
+
+    /**
+     * Parse a single line from the given configuration file, adding the name
+     * on the line to both the names list and the returned set iff the name is
+     * not already a member of the returned set.
+     */
+    private static int parseLine(Class service, URL u, BufferedReader r, int lc,
+                                 List<String> names, Set<String> returned)
+        throws IOException, ServiceConfigurationError {
+        String ln = r.readLine();
+        if (ln == null) {
+            return -1;
+        }
+        int ci = ln.indexOf('#');
+        if (ci >= 0) ln = ln.substring(0, ci);
+        ln = ln.trim();
+        int n = ln.length();
+        if (n != 0) {
+            if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))
+                fail(service, u, lc, "Illegal configuration-file syntax");
+            int cp = ln.codePointAt(0);
+            if (!Character.isJavaIdentifierStart(cp))
+                fail(service, u, lc, "Illegal provider-class name: " + ln);
+            for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
+                cp = ln.codePointAt(i);
+                if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
+                    fail(service, u, lc, "Illegal provider-class name: " + ln);
+            }
+            if (!returned.contains(ln)) {
+                names.add(ln);
+                returned.add(ln);
+            }
+        }
+        return lc + 1;
+    }
+
+    /**
+     * Parse the content of the given URL as a provider-configuration file.
+     *
+     * @param service  The service class for which providers are being sought;
+     *                 used to construct error detail strings
+     * @param u        The URL naming the configuration file to be parsed
+     * @param returned A Set containing the names of provider classes that have already
+     *                 been returned.  This set will be updated to contain the names
+     *                 that will be yielded from the returned <tt>Iterator</tt>.
+     * @return A (possibly empty) <tt>Iterator</tt> that will yield the
+     *         provider-class names in the given configuration file that are
+     *         not yet members of the returned set
+     * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, or
+     *                                   if a configuration-file format error is detected
+     */
+    @SuppressWarnings({"StatementWithEmptyBody"})
+    private static Iterator<String> parse(Class service, URL u, Set<String> returned)
+        throws ServiceConfigurationError {
+        InputStream in = null;
+        BufferedReader r = null;
+        ArrayList<String> names = new ArrayList<String>();
+        try {
+            in = u.openStream();
+            r = new BufferedReader(new InputStreamReader(in, "utf-8"));
+            int lc = 1;
+            while ((lc = parseLine(service, u, r, lc, names, returned)) >= 0) ;
+        } catch (IOException x) {
+            fail(service, ": " + x);
+        } finally {
+            try {
+                if (r != null) r.close();
+                if (in != null) in.close();
+            } catch (IOException y) {
+                fail(service, ": " + y);
+            }
+        }
+        return names.iterator();
+    }
+
+
+    /**
+     * Private inner class implementing fully-lazy provider lookup
+     */
+    private static class LazyIterator<T> implements Iterator<T> {
+        Class<T> service;
+        @Nullable ClassLoader loader;
+        Enumeration<URL> configs = null;
+        Iterator<String> pending = null;
+        Set<String> returned = new TreeSet<String>();
+        String nextName = null;
+        URL currentConfig = null;
+
+        private LazyIterator(Class<T> service, ClassLoader loader) {
+            this.service = service;
+            this.loader = loader;
+        }
+
+        public boolean hasNext() throws ServiceConfigurationError {
+            if (nextName != null) {
+                return true;
+            }
+            if (configs == null) {
+                try {
+                    String fullName = prefix + service.getName();
+                    if (loader == null)
+                        configs = ClassLoader.getSystemResources(fullName);
+                    else
+                        configs = loader.getResources(fullName);
+                } catch (IOException x) {
+                    fail(service, ": " + x);
+                }
+            }
+            while ((pending == null) || !pending.hasNext()) {
+                if (!configs.hasMoreElements()) {
+                    return false;
+                }
+                currentConfig = configs.nextElement();
+                pending = parse(service, currentConfig, returned);
+            }
+            nextName = pending.next();
+            return true;
+        }
+
+        public T next() throws ServiceConfigurationError {
+            if (!hasNext()) {
+                throw new NoSuchElementException();
+            }
+            String cn = nextName;
+            nextName = null;
+            try {
+                return service.cast(Class.forName(cn, true, loader).newInstance());
+            } catch (ClassNotFoundException x) {
+                fail(service,
+                    "Provider " + cn + " is specified in "+currentConfig+" but not found");
+            } catch (Exception x) {
+                fail(service,
+                    "Provider " + cn + " is specified in "+currentConfig+"but could not be instantiated: " + x, x);
+            }
+            return null;    /* This cannot happen */
+        }
+
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/StringUtils.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/StringUtils.java
index 8a8fa6f..247b6f7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/StringUtils.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/StringUtils.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SunStAXReflection.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SunStAXReflection.java
deleted file mode 100644
index cb13e6a..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/SunStAXReflection.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util;
-
-import java.lang.reflect.Method;
-
-public class SunStAXReflection {
-    /**
-     * Sun StAX impl <code>XMLReaderImpl.setInputSource()</code> method via reflection.
-     */
-    public static Method XMLReaderImpl_setInputSource;
-
-    /**
-     * Sun StAX impl <code>XMLReaderImpl.reset()</code> method via reflection.
-     */
-    public static Method XMLReaderImpl_reset;
-
-    static {
-        try {
-            Class clazz = Class.forName("com.sun.xml.internal.stream.XMLReaderImpl");
-            // Are we running on top of JAXP 1.4?
-            if (clazz == null) {
-                clazz = Class.forName("com.sun.xml.internal.stream.XMLStreamReaderImpl");
-            }
-            XMLReaderImpl_setInputSource =
-                clazz.getMethod("setInputSource", org.xml.sax.InputSource.class);
-            XMLReaderImpl_reset = clazz.getMethod("reset");
-        } catch (Exception e) {
-            // falls through
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java
index f044315..23a9ef0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
         super("nestedUtilError", arg);
     }
 
-    public String getResourceBundleName() {
+    public String getDefaultResourceBundleName() {
         return "com.sun.xml.internal.ws.resources.util";
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Version.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Version.java
index 6fc7005..29071e6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Version.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Version.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,10 @@
             props.load(is);
         } catch (IOException e) {
             // ignore even if the property was not found. we'll treat everything as unknown
+        } catch (Exception e) {
+            //ignore even if property not found
         }
+
         return new Version(
             props.getProperty("build-id"),
             props.getProperty("build-version"),
@@ -71,4 +74,8 @@
         if(v==null) return "unknown";
         return v;
     }
+
+    public String toString() {
+        return BUILD_VERSION;
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/VersionUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/VersionUtil.java
index a93ca29c..a54d50e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/VersionUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/VersionUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/XMLConnectionUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/XMLConnectionUtil.java
deleted file mode 100644
index d00a78b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/XMLConnectionUtil.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.http.HTTPException;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import com.sun.xml.internal.ws.spi.runtime.WSConnection;
-import com.sun.xml.internal.ws.pept.ept.MessageInfo;
-import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
-import java.io.ByteArrayInputStream;
-import java.net.HttpURLConnection;
-import javax.xml.transform.stream.StreamSource;
-
-import static com.sun.xml.internal.ws.developer.JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY;
-
-/**
- * @author WS Development Team
- */
-public class XMLConnectionUtil {
-
-    public static XMLMessage getXMLMessage(WSConnection con, MessageInfo mi) {
-        try {
-            Map<String, List<String>> headers = con.getHeaders();
-            MimeHeaders mh = new MimeHeaders();
-            if (headers != null) {
-                for (Map.Entry<String, List<String>> entry : headers.entrySet())
-                {
-                    String name = entry.getKey();
-                    for (String value : entry.getValue()) {
-                        try {
-                            mh.addHeader(name, value);
-                        } catch (IllegalArgumentException ie) {
-                            // Not a mime header. Ignore it.
-                        }
-                    }
-                }
-            }
-            return new XMLMessage(mh, con.getInput());
-        } catch (Exception e) {
-            throw (HTTPException)new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR).initCause(e);
-        }
-    }
-
-    private static void send(WSConnection con, XMLMessage xmlMessage) {
-        try {
-            Map<String, List<String>> headers = new HashMap<String, List<String>>();
-            MimeHeaders mhs = xmlMessage.getMimeHeaders();
-            Iterator i = mhs.getAllHeaders();
-            while (i.hasNext()) {
-                MimeHeader mh = (MimeHeader) i.next();
-                String name = mh.getName();
-                List<String> values = headers.get(name);
-                if (values == null) {
-                    values = new ArrayList<String>();
-                    headers.put(name, values);
-                }
-                values.add(mh.getValue());
-            }
-            con.setHeaders(headers);
-            xmlMessage.writeTo(con.getOutput());
-
-        } catch (Exception e) {
-            throw (HTTPException)new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR).initCause(e);
-        }
-        try {
-            con.closeOutput();
-        } catch (Exception e) {
-            throw (HTTPException)new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR).initCause(e);
-        }
-    }
-
-    public static void sendResponse(WSConnection con, XMLMessage xmlMessage) {
-        setStatus(con, xmlMessage.getStatus());
-        send(con, xmlMessage);
-    }
-
-    public static void sendResponseOneway(WSConnection con) {
-        setStatus(con, WSConnection.ONEWAY);
-        con.getOutput();
-        con.closeOutput();
-    }
-
-    public static void sendResponseError(WSConnection con, MessageInfo messageInfo) {
-        try {
-            StreamSource source = new StreamSource(
-                new ByteArrayInputStream(DEFAULT_SERVER_ERROR.getBytes()));
-            String conneg = (String) messageInfo.getMetaData(CONTENT_NEGOTIATION_PROPERTY);
-            XMLMessage message = new XMLMessage(source, conneg == "optimistic");
-            setStatus(con, WSConnection.INTERNAL_ERR);
-            send(con, message);
-        }
-        catch (Exception e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    public static Map<String, List<String>> getHeaders(WSConnection con) {
-        return con.getHeaders();
-    }
-
-    /**
-     * sets response headers.
-     */
-    public static void setHeaders(WSConnection con,
-                                  Map<String, List<String>> headers) {
-        con.setHeaders(headers);
-    }
-
-    public static void setStatus(WSConnection con, int status) {
-        con.setStatus(status);
-    }
-
-    private final static String DEFAULT_SERVER_ERROR =
-        "<?xml version='1.0' encoding='UTF-8'?>"
-            + "<err>Internal Server Error</err>";
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java
index cf0696e..9f42538 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,9 @@
 package com.sun.xml.internal.ws.util.exception;
 
 import com.sun.xml.internal.ws.util.localization.Localizable;
+import com.sun.xml.internal.ws.util.localization.LocalizableImpl;
 import com.sun.xml.internal.ws.util.localization.Localizer;
+import com.sun.xml.internal.ws.util.localization.NullLocalizable;
 
 import javax.xml.ws.WebServiceException;
 
@@ -39,23 +41,42 @@
 public abstract class JAXWSExceptionBase
     extends WebServiceException implements Localizable {
 
-    private final String key;
-    private final Object[] args;
+    private final Localizable msg;
 
+    /**
+     * @deprecated
+     *      Should use the localizable constructor instead.
+     */
     protected JAXWSExceptionBase(String key, Object... args) {
         super(findNestedException(args));
-        if(args==null)  args = new Object[0];
-        this.key = key;
-        this.args = args;
+        this.msg = new LocalizableImpl(key,fixNull(args),getDefaultResourceBundleName());
+    }
+
+
+    protected JAXWSExceptionBase(String message) {
+        super(message);
+        msg=null;
+    }
+
+    private static Object[] fixNull(Object[] x) {
+        if(x==null)     return new Object[0];
+        else            return x;
     }
 
     /**
      * Creates a new exception that wraps the specified exception.
      */
     protected JAXWSExceptionBase(Throwable throwable) {
-        super(throwable);
-        this.key = Localizable.NOT_LOCALIZABLE;
-        this.args = new Object[]{throwable.toString()};
+        this(new NullLocalizable(throwable.toString()),throwable);
+    }
+
+    protected JAXWSExceptionBase(Localizable msg) {
+        this.msg = msg;
+    }
+
+    protected JAXWSExceptionBase(Localizable msg, Throwable cause) {
+        super(cause);
+        this.msg = msg;
     }
 
     private static Throwable findNestedException(Object[] args) {
@@ -68,22 +89,29 @@
         return null;
     }
 
-    public String getKey() {
-        return key;
-    }
-
-    public Object[] getArguments() {
-        return args;
-    }
-
-    public String toString() {
-        // for debug purposes only
-        //return getClass().getName() + " (" + getKey() + ")";
-        return getMessage();
-    }
-
     public String getMessage() {
         Localizer localizer = new Localizer();
         return localizer.localize(this);
     }
+
+    /**
+     * Gets the default resource bundle name for this kind of exception.
+     * Used for {@link #JAXWSExceptionBase(String, Object[])}.
+     */
+    protected abstract String getDefaultResourceBundleName();
+
+//
+// Localizable delegation
+//
+    public final String getKey() {
+        return msg.getKey();
+    }
+
+    public final Object[] getArguments() {
+        return msg.getArguments();
+    }
+
+    public final String getResourceBundleName() {
+        return msg.getResourceBundleName();
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/LocatableWebServiceException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/LocatableWebServiceException.java
new file mode 100644
index 0000000..5e67bcf
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/LocatableWebServiceException.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.exception;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.resources.UtilMessages;
+import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
+
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * {@link WebServiceException} with source location informaiton.
+ *
+ * <p>
+ * This exception should be used wherever the location information is available,
+ * so that the location information is carried forward to users (to assist
+ * error diagnostics.)
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class LocatableWebServiceException extends WebServiceException {
+    /**
+     * Locations related to error.
+     */
+    private final Locator[] location;
+
+    public LocatableWebServiceException(String message, Locator... location) {
+        this(message,null,location);
+    }
+
+    public LocatableWebServiceException(String message, Throwable cause, Locator... location) {
+        super(appendLocationInfo(message,location), cause);
+        this.location = location;
+    }
+
+    public LocatableWebServiceException(Throwable cause, Locator... location) {
+        this(cause.toString(),cause,location);
+    }
+
+    public LocatableWebServiceException(String message, XMLStreamReader locationSource) {
+        this(message,toLocation(locationSource));
+    }
+
+    public LocatableWebServiceException(String message, Throwable cause, XMLStreamReader locationSource) {
+        this(message,cause,toLocation(locationSource));
+    }
+
+    public LocatableWebServiceException(Throwable cause, XMLStreamReader locationSource) {
+        this(cause,toLocation(locationSource));
+    }
+
+    /**
+     * Locations related to this exception.
+     *
+     * @return
+     *      Can be empty but never null.
+     */
+    public @NotNull List<Locator> getLocation() {
+        return Arrays.asList(location);
+    }
+
+    private static String appendLocationInfo(String message, Locator[] location) {
+        StringBuilder buf = new StringBuilder(message);
+        for( Locator loc : location )
+            buf.append('\n').append(UtilMessages.UTIL_LOCATION( loc.getLineNumber(), loc.getSystemId() ));
+        return buf.toString();
+    }
+
+    private static Locator toLocation(XMLStreamReader xsr) {
+        LocatorImpl loc = new LocatorImpl();
+        Location in = xsr.getLocation();
+        loc.setSystemId(in.getSystemId());
+        loc.setPublicId(in.getPublicId());
+        loc.setLineNumber(in.getLineNumber());
+        loc.setColumnNumber(in.getColumnNumber());
+        return loc;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizable.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizable.java
index f470122..bd8dd7a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizable.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableImpl.java
new file mode 100644
index 0000000..650a82e
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableImpl.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.localization;
+
+/**
+ * Straight-forward {@link Localizable} implementation.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class LocalizableImpl implements Localizable {
+    private final String key;
+    private final Object[] arguments;
+    private final String resourceBundleName;
+
+    public LocalizableImpl(String key, Object[] arguments, String resourceBundleName) {
+        this.key = key;
+        this.arguments = arguments;
+        this.resourceBundleName = resourceBundleName;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public Object[] getArguments() {
+        return arguments;
+    }
+
+    public String getResourceBundleName() {
+        return resourceBundleName;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessage.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessage.java
index 3fe9be3..576cb3f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessage.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessage.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessageFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessageFactory.java
index 5533ab0..aa8e415 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessageFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableMessageFactory.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizer.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizer.java
index c671a41..cbbfabe 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/Localizer.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,11 @@
     }
 
     public String localize(Localizable l) {
+        String key = l.getKey();
+        if (key == Localizable.NOT_LOCALIZABLE) {
+            // this message is not localizable
+            return (String) l.getArguments()[0];
+        }
         String bundlename = l.getResourceBundleName();
 
         try {
@@ -96,13 +101,6 @@
                 return getDefaultMessage(l);
             }
 
-            String key = l.getKey();
-            if(key==Localizable.NOT_LOCALIZABLE) {
-                // this message is not localizable
-                return (String)l.getArguments()[0];
-            }
-
-
             if (key == null)
                 key = "undefined";
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/NullLocalizable.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/NullLocalizable.java
index e8f57f2..804fb63 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/NullLocalizable.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/NullLocalizable.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java
new file mode 100644
index 0000000..3220cc3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.pipe;
+
+import com.sun.xml.internal.ws.api.message.Packet;
+import com.sun.xml.internal.ws.api.pipe.NextAction;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubeCloner;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.PrintStream;
+import java.lang.reflect.Constructor;
+
+/**
+ * {@link Pipe} that dumps messages that pass through.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class DumpTube extends AbstractFilterTubeImpl {
+
+    private final String name;
+
+    private final PrintStream out;
+
+    private final XMLOutputFactory staxOut;
+
+    /**
+     * @param name
+     *      Specify the name that identifies this {@link DumpTube}
+     *      instance. This string will be printed when this pipe
+     *      dumps messages, and allows people to distinguish which
+     *      pipe instance is dumping a message when multiple
+     *      {@link DumpTube}s print messages out.
+     * @param out
+     *      The output to send dumps to.
+     * @param next
+     *      The next {@link Tube} in the pipeline.
+     */
+    public DumpTube(String name, PrintStream out, Tube next) {
+        super(next);
+        this.name = name;
+        this.out = out;
+        this.staxOut = XMLOutputFactory.newInstance();
+        //staxOut.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,true);
+    }
+
+    /**
+     * Copy constructor.
+     */
+    protected DumpTube(DumpTube that, TubeCloner cloner) {
+        super(that,cloner);
+        this.name = that.name;
+        this.out = that.out;
+        this.staxOut = that.staxOut;
+    }
+
+    public NextAction processRequest(Packet request) {
+        dump("request",request);
+        return super.processRequest(request);
+    }
+
+    public NextAction processResponse(Packet response) {
+        dump("response",response);
+        return super.processResponse(response);
+    }
+
+    protected void dump(String header, Packet packet) {
+        out.println("====["+name+":"+header+"]====");
+        if(packet.getMessage()==null)
+            out.println("(none)");
+        else
+            try {
+                XMLStreamWriter writer = staxOut.createXMLStreamWriter(new PrintStream(out) {
+                    public void close() {
+                        // noop
+                    }
+                });
+                writer = createIndenter(writer);
+                packet.getMessage().copy().writeTo(writer);
+                writer.close();
+            } catch (XMLStreamException e) {
+                e.printStackTrace(out);
+            }
+        out.println("============");
+    }
+
+    /**
+     * Wraps {@link XMLStreamWriter} by an indentation engine if possible.
+     *
+     * <p>
+     * We can do this only when we have <tt>stax-utils.jar</tt> in the classpath.
+     */
+    private XMLStreamWriter createIndenter(XMLStreamWriter writer) {
+        try {
+            Class clazz = getClass().getClassLoader().loadClass("javanet.staxutils.IndentingXMLStreamWriter");
+            Constructor c = clazz.getConstructor(XMLStreamWriter.class);
+            writer = (XMLStreamWriter)c.newInstance(writer);
+        } catch (Exception e) {
+            // if stax-utils.jar is not in the classpath, this will fail
+            // so, we'll just have to do without indentation
+            if(!warnStaxUtils) {
+                warnStaxUtils = true;
+                out.println("WARNING: put stax-utils.jar to the classpath to indent the dump output");
+            }
+        }
+        return writer;
+    }
+
+
+    public AbstractTubeImpl copy(TubeCloner cloner) {
+        return new DumpTube(this,cloner);
+    }
+
+    private static boolean warnStaxUtils;
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java
new file mode 100644
index 0000000..320a22b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * Copyright (c) 2006 Your Corporation. All Rights Reserved.
+ */
+package com.sun.xml.internal.ws.util.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.ClientPipeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.Pipe;
+import com.sun.xml.internal.ws.api.pipe.PipelineAssembler;
+import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext;
+
+/**
+ * Default Pipeline assembler for JAX-WS client and server side runtimes. It
+ * assembles various pipes into a pipeline that a message needs to be passed
+ * through.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Jitendra Kotamraju
+ */
+public class StandalonePipeAssembler implements PipelineAssembler {
+
+    @NotNull
+    public Pipe createClient(ClientPipeAssemblerContext context) {
+        Pipe head = context.createTransportPipe();
+        head = context.createSecurityPipe(head);
+
+        if (dump) {
+            // for debugging inject a dump pipe. this is left in the production code,
+            // as it would be very handy for a trouble-shooting at the production site.
+            head = context.createDumpPipe("client", System.out, head);
+        }
+        head = context.createWsaPipe(head);
+        head = context.createClientMUPipe(head);
+        return context.createHandlerPipe(head);
+    }
+
+    /**
+     * On Server-side, HandlerChains cannot be changed after it is deployed.
+     * During assembling the Pipelines, we can decide if we really need a
+     * SOAPHandlerPipe and LogicalHandlerPipe for a particular Endpoint.
+     */
+    public Pipe createServer(ServerPipeAssemblerContext context) {
+        Pipe head = context.getTerminalPipe();
+        head = context.createHandlerPipe(head);
+        head = context.createMonitoringPipe(head);
+        head = context.createServerMUPipe(head);
+        head = context.createWsaPipe(head);
+        head = context.createSecurityPipe(head);
+        return head;
+    }
+
+    /**
+     * Are we going to dump the message to System.out?
+     */
+    private static final boolean dump;
+
+    static {
+        boolean b = false;
+        try {
+            b = Boolean.getBoolean(StandalonePipeAssembler.class.getName()+".dump");
+        } catch (Throwable t) {
+            // treat it as false
+        }
+        dump = b;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java
new file mode 100644
index 0000000..38ef2e8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.pipe;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.ws.api.pipe.ClientTubeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext;
+import com.sun.xml.internal.ws.api.pipe.Tube;
+import com.sun.xml.internal.ws.api.pipe.TubelineAssembler;
+
+/**
+ * Default Pipeline assembler for JAX-WS client and server side runtimes. It
+ * assembles various pipes into a pipeline that a message needs to be passed
+ * through.
+ *
+ * @author Jitendra Kotamraju
+ */
+public class StandaloneTubeAssembler implements TubelineAssembler {
+
+    @NotNull
+    public Tube createClient(ClientTubeAssemblerContext context) {
+        Tube head = context.createTransportTube();
+        head = context.createSecurityTube(head);
+        if (dump) {
+            // for debugging inject a dump pipe. this is left in the production code,
+            // as it would be very handy for a trouble-shooting at the production site.
+            head = context.createDumpTube("client", System.out, head);
+        }
+        head = context.createWsaTube(head);
+        head = context.createClientMUTube(head);
+        return context.createHandlerTube(head);
+    }
+
+    /**
+     * On Server-side, HandlerChains cannot be changed after it is deployed.
+     * During assembling the Pipelines, we can decide if we really need a
+     * SOAPHandlerPipe and LogicalHandlerPipe for a particular Endpoint.
+     */
+    public Tube createServer(ServerTubeAssemblerContext context) {
+        Tube head = context.getTerminalTube();
+        head = context.createHandlerTube(head);
+        head = context.createMonitoringTube(head);
+        head = context.createServerMUTube(head);
+        head = context.createWsaTube(head);
+        if (dump) {
+            // for debugging inject a dump pipe. this is left in the production code,
+            // as it would be very handy for a trouble-shooting at the production site.
+            head = context.createDumpTube("server", System.out, head);
+        }
+        head = context.createSecurityTube(head);
+        return head;
+    }
+
+    /**
+     * Are we going to dump the message to System.out?
+     */
+    public static final boolean dump;
+
+    static {
+        boolean b = false;
+        try {
+            b = Boolean.getBoolean(StandaloneTubeAssembler.class.getName()+".dump");
+        } catch (Throwable t) {
+            // treat it as false
+        }
+        dump = b;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties
index 67d84a4..2bdd9f9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-# 
+#
 
 #
 # English diagnostic messages (and fragments) for Sun's XML parser.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/version.properties
index 106fba4..27f0f70 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -1,4 +1,29 @@
-build-id=b08
-build-version=JAX-WS RI 2.0_03-b08-fcs
-major-version=2.0_03
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+build-id=JAX-WS RI 2.1.1
+build-version=JAX-WS RI 2.1.1
+major-version=2.1.1
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/CDATA.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/CDATA.java
index 09cea48..165a57c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/CDATA.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/CDATA.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java
new file mode 100644
index 0000000..1267b39
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.util.Stack;
+
+/**
+ * This is a simple utility class that adapts SAX events into StAX
+ * {@link XMLStreamWriter} events, bridging between
+ * the two parser technologies.
+ *
+ * This ContentHandler does not own the XMLStreamWriter.  Therefore, it will
+ * not close or flush the writer at any point.
+ *
+ * @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
+ */
+public class ContentHandlerToXMLStreamWriter extends DefaultHandler {
+
+    // SAX events will be sent to this XMLStreamWriter
+    private final XMLStreamWriter staxWriter;
+
+    // storage for prefix bindings
+    private final Stack prefixBindings;
+
+    public ContentHandlerToXMLStreamWriter(XMLStreamWriter staxCore) {
+        this.staxWriter = staxCore;
+        prefixBindings = new Stack(); // default of 10 seems reasonable
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#endDocument()
+     */
+    public void endDocument() throws SAXException {
+        try {
+            staxWriter.writeEndDocument();
+            staxWriter.flush();
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#startDocument()
+     */
+    public void startDocument() throws SAXException {
+        try {
+            staxWriter.writeStartDocument();
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#characters(char[], int, int)
+     */
+    public void characters(char[] ch, int start, int length)
+        throws SAXException {
+
+        try {
+            staxWriter.writeCharacters(ch, start, length);
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
+     */
+    public void ignorableWhitespace(char[] ch, int start, int length)
+        throws SAXException {
+
+        characters(ch,start,length);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
+     */
+    public void endPrefixMapping(String prefix) throws SAXException {
+        // TODO: no-op?
+
+        // I think we can ignore these SAX events because StAX
+        // automatically scopes the prefix bindings.
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
+     */
+    public void skippedEntity(String name) throws SAXException {
+        try {
+            staxWriter.writeEntityRef(name);
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
+     */
+    public void setDocumentLocator(Locator locator) {
+        // TODO: no-op?
+        // there doesn't seem to be any way to pass location info
+        // along to the XMLStreamWriter. On the XMLEventWriter side, you
+        // can set the location info on the event objects.
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String,
+     *      java.lang.String)
+     */
+    public void processingInstruction(String target, String data)
+        throws SAXException {
+
+        try {
+            staxWriter.writeProcessingInstruction(target, data);
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
+     *      java.lang.String)
+     */
+    public void startPrefixMapping(String prefix, String uri)
+        throws SAXException {
+
+        if (prefix.equals("xml")) {
+            return;
+        }
+
+        // defend against parsers that pass null in for "xmlns" prefix
+        if (prefix == null) {
+            prefix = "";
+        }
+
+        prefixBindings.add(prefix);
+        prefixBindings.add(uri);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#endElement(java.lang.String,
+     *      java.lang.String, java.lang.String)
+     */
+    public void endElement(String namespaceURI, String localName, String qName)
+        throws SAXException {
+
+        try {
+            // TODO: is this all we have to do?
+            staxWriter.writeEndElement();
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
+     *      java.lang.String, java.lang.String, org.xml.sax.Attributes)
+     */
+    public void startElement(
+        String namespaceURI,
+        String localName,
+        String qName,
+        Attributes atts)
+        throws SAXException {
+
+        try {
+            staxWriter.writeStartElement(
+                getPrefix(qName),
+                localName,
+                namespaceURI);
+
+            String uri, prefix;
+            while (prefixBindings.size() != 0) {
+                uri = (String)prefixBindings.pop();
+                prefix = (String)prefixBindings.pop();
+                if (prefix.length() == 0) {
+                    staxWriter.setDefaultNamespace(uri);
+                } else {
+                    staxWriter.setPrefix(prefix, uri);
+                }
+
+                // this method handles "", null, and "xmlns" prefixes properly
+                staxWriter.writeNamespace(prefix, uri);
+            }
+
+            writeAttributes(atts);
+        } catch (XMLStreamException e) {
+            throw new SAXException(e);
+        }
+
+    }
+
+    /**
+     * Generate a StAX writeAttribute event for each attribute
+     *
+     * @param atts
+     *                attributes from the SAX event
+     */
+    private void writeAttributes(Attributes atts) throws XMLStreamException {
+        for (int i = 0; i < atts.getLength(); i++) {
+            final String prefix = getPrefix(atts.getQName(i));
+            if(!prefix.equals("xmlns")) { // defend againts broken transformers that report xmlns decls as attrs
+                staxWriter.writeAttribute(
+                    prefix,
+                    atts.getURI(i),
+                    atts.getLocalName(i),
+                    atts.getValue(i));
+                }
+        }
+    }
+
+    /**
+     * Pull the prefix off of the specified QName.
+     *
+     * @param qName
+     *                the QName
+     * @return the prefix or the empty string if it doesn't exist.
+     */
+    private String getPrefix(String qName) {
+        int idx = qName.indexOf(':');
+        if (idx == -1) {
+            return "";
+        } else {
+            return qName.substring(0, idx);
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/DummyLocation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/DummyLocation.java
new file mode 100644
index 0000000..f03009f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/DummyLocation.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import javax.xml.stream.Location;
+
+/**
+ * {@link Location} that returns no info.
+ *
+ * @author Santiago.PericasGeertsen@sun.com
+ */
+public final class DummyLocation implements Location {
+    private DummyLocation() {}
+
+    public static final Location INSTANCE = new DummyLocation();
+
+    public int getCharacterOffset() {
+        return -1;
+    }
+    public int getColumnNumber() {
+        return -1;
+    }
+    public int getLineNumber() {
+        return -1;
+    }
+    public String getPublicId() {
+        return null;
+    }
+    public String getSystemId() {
+        return null;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java
index 9d3fcf3..726a6d4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NamedNodeMapIterator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java
index c747a94..bea0af9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/NodeListIterator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXResult.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXResult.java
new file mode 100644
index 0000000..64c3361
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXResult.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.sax.SAXResult;
+
+/**
+ * A JAXP {@link javax.xml.transform.Result} implementation that produces
+ * a result on the specified {@link javax.xml.stream.XMLStreamWriter} or
+ * {@link javax.xml.stream.XMLEventWriter}.
+ *
+ * <p>
+ * Please note that you may need to call flush() on the underlying
+ * XMLStreamWriter or XMLEventWriter after the transform is complete.
+ * <p>
+ *
+ * The fact that JAXBResult derives from SAXResult is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXResult.
+ *
+ * <p>
+ * In particular it shall never attempt to call the following methods:
+ *
+ * <ul>
+ *    <li>setHandler</li>
+ *    <li>setLexicalHandler</li>
+ *    <li>setSystemId</li>
+ * </ul>
+ *
+ * <p>
+ * Example:
+ *
+ * <pre>
+    // create a DOMSource
+    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(...);
+    Source domSource = new DOMSource(doc);
+
+    // create a StAXResult
+    XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
+    Result staxResult = new StAXResult(writer);
+
+    // run the transform
+    TransformerFactory.newInstance().newTransformer().transform(domSource, staxResult);
+ * </pre>
+ *
+ * @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
+ */
+public class StAXResult extends SAXResult {
+
+    /**
+     * Create a new {@link javax.xml.transform.Result} that produces
+     * a result on the specified {@link javax.xml.stream.XMLStreamWriter}
+     *
+     * @param writer the XMLStreamWriter
+     * @throws IllegalArgumentException iff the writer is null
+     */
+    public StAXResult(XMLStreamWriter writer) {
+        if( writer == null ) {
+            throw new IllegalArgumentException();
+        }
+
+        super.setHandler(new ContentHandlerToXMLStreamWriter( writer ));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java
index eccce23..954398b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package com.sun.xml.internal.ws.util.xml;
 
+import com.sun.istack.internal.XMLStreamReaderToContentHandler;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.DTDHandler;
 import org.xml.sax.EntityResolver;
@@ -79,6 +80,7 @@
  * </pre>
  *
  * @author Ryan.Shoemaker@Sun.COM
+ * @version 1.0
  */
 public class StAXSource extends SAXSource {
 
@@ -213,7 +215,7 @@
             throw new IllegalStateException();
         }
 
-        this.reader = new XMLStreamReaderToContentHandler(reader,repeater,eagerQuit);
+        this.reader = new XMLStreamReaderToContentHandler(reader,repeater,eagerQuit,false);
 
         super.setXMLReader(pseudoParser);
         // pass a dummy InputSource. We don't care
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java
new file mode 100644
index 0000000..186c614
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderFilter.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * {@link XMLStreamReader} that delegates to another {@link XMLStreamReader}.
+ *
+ * <p>
+ * This class isn't very useful by itself, but works as a base class
+ * for {@link XMLStreamReader} filtering.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class XMLStreamReaderFilter implements XMLStreamReaderFactory.RecycleAware, XMLStreamReader {
+    /**
+     * The underlying {@link XMLStreamReader} that does the parsing of the root part.
+     */
+    protected XMLStreamReader reader;
+
+    public XMLStreamReaderFilter(XMLStreamReader core) {
+        this.reader = core;
+    }
+
+    public void onRecycled() {
+        XMLStreamReaderFactory.recycle(reader);
+        reader = null;
+    }
+
+    public int getAttributeCount() {
+        return reader.getAttributeCount();
+    }
+
+    public int getEventType() {
+        return reader.getEventType();
+    }
+
+    public int getNamespaceCount() {
+        return reader.getNamespaceCount();
+    }
+
+    public int getTextLength() {
+        return reader.getTextLength();
+    }
+
+    public int getTextStart() {
+        return reader.getTextStart();
+    }
+
+    public int next() throws XMLStreamException {
+        return reader.next();
+    }
+
+    public int nextTag() throws XMLStreamException {
+        return reader.nextTag();
+    }
+
+    public void close() throws XMLStreamException {
+        reader.close();
+    }
+
+    public boolean hasName() {
+        return reader.hasName();
+    }
+
+    public boolean hasNext() throws XMLStreamException {
+        return reader.hasNext();
+    }
+
+    public boolean hasText() {
+        return reader.hasText();
+    }
+
+    public boolean isCharacters() {
+        return reader.isCharacters();
+    }
+
+    public boolean isEndElement() {
+        return reader.isEndElement();
+    }
+
+    public boolean isStandalone() {
+        return reader.isStandalone();
+    }
+
+    public boolean isStartElement() {
+        return reader.isStartElement();
+    }
+
+    public boolean isWhiteSpace() {
+        return reader.isWhiteSpace();
+    }
+
+    public boolean standaloneSet() {
+        return reader.standaloneSet();
+    }
+
+    public char[] getTextCharacters() {
+        return reader.getTextCharacters();
+    }
+
+    public boolean isAttributeSpecified(int index) {
+        return reader.isAttributeSpecified(index);
+    }
+
+    public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
+        return reader.getTextCharacters(sourceStart, target, targetStart, length);
+    }
+
+    public String getCharacterEncodingScheme() {
+        return reader.getCharacterEncodingScheme();
+    }
+
+    public String getElementText() throws XMLStreamException {
+        return reader.getElementText();
+    }
+
+    public String getEncoding() {
+        return reader.getEncoding();
+    }
+
+    public String getLocalName() {
+        return reader.getLocalName();
+    }
+
+    public String getNamespaceURI() {
+        return reader.getNamespaceURI();
+    }
+
+    public String getPIData() {
+        return reader.getPIData();
+    }
+
+    public String getPITarget() {
+        return reader.getPITarget();
+    }
+
+    public String getPrefix() {
+        return reader.getPrefix();
+    }
+
+    public String getText() {
+        return reader.getText();
+    }
+
+    public String getVersion() {
+        return reader.getVersion();
+    }
+
+    public String getAttributeLocalName(int index) {
+        return reader.getAttributeLocalName(index);
+    }
+
+    public String getAttributeNamespace(int index) {
+        return reader.getAttributeNamespace(index);
+    }
+
+    public String getAttributePrefix(int index) {
+        return reader.getAttributePrefix(index);
+    }
+
+    public String getAttributeType(int index) {
+        return reader.getAttributeType(index);
+    }
+
+    public String getAttributeValue(int index) {
+        return reader.getAttributeValue(index);
+    }
+
+    public String getNamespacePrefix(int index) {
+        return reader.getNamespacePrefix(index);
+    }
+
+    public String getNamespaceURI(int index) {
+        return reader.getNamespaceURI(index);
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        return reader.getNamespaceContext();
+    }
+
+    public QName getName() {
+        return reader.getName();
+    }
+
+    public QName getAttributeName(int index) {
+        return reader.getAttributeName(index);
+    }
+
+    public Location getLocation() {
+        return reader.getLocation();
+    }
+
+    public Object getProperty(String name) throws IllegalArgumentException {
+        return reader.getProperty(name);
+    }
+
+    public void require(int type, String namespaceURI, String localName) throws XMLStreamException {
+        reader.require(type, namespaceURI, localName);
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return reader.getNamespaceURI(prefix);
+    }
+
+    public String getAttributeValue(String namespaceURI, String localName) {
+        return reader.getAttributeValue(namespaceURI, localName);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java
deleted file mode 100644
index 5c544fc..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToContentHandler.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.util.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * This is a simple utility class that adapts StAX events from an
- * {@link XMLStreamReader} to SAX events on a
- * {@link ContentHandler}, bridging between the two
- * parser technologies.
- *
- * @author Ryan.Shoemaker@Sun.COM
- */
-public class XMLStreamReaderToContentHandler {
-
-    // StAX event source
-    private final XMLStreamReader staxStreamReader;
-
-    // SAX event sink
-    private final ContentHandler saxHandler;
-
-    // if true, when the conversion is completed, leave the cursor to the last
-    // event that was fired (such as end element)
-    private boolean eagerQuit;
-
-    /**
-     * Construct a new StAX to SAX adapter that will convert a StAX event
-     * stream into a SAX event stream.
-     *
-     * @param staxCore
-     *                StAX event source
-     * @param saxCore
-     *                SAXevent sink
-     */
-    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit) {
-        this.staxStreamReader = staxCore;
-        this.saxHandler = saxCore;
-        this.eagerQuit = eagerQuit;
-    }
-
-    /*
-     * @see StAXReaderToContentHandler#bridge()
-     */
-    public void bridge() throws XMLStreamException {
-
-        try {
-            // remembers the nest level of elements to know when we are done.
-            int depth=0;
-
-            // if the parser is at the start tag, proceed to the first element
-            int event = staxStreamReader.getEventType();
-            if(event == XMLStreamConstants.START_DOCUMENT) {
-                // nextTag doesn't correctly handle DTDs
-                while( !staxStreamReader.isStartElement() )
-                    event = staxStreamReader.next();
-            }
-
-
-            if( event!=XMLStreamConstants.START_ELEMENT)
-                throw new IllegalStateException("The current event is not START_ELEMENT\n but " + event);
-
-            handleStartDocument();
-
-            OUTER:
-            do {
-                // These are all of the events listed in the javadoc for
-                // XMLEvent.
-                // The spec only really describes 11 of them.
-                switch (event) {
-                    case XMLStreamConstants.START_ELEMENT :
-                        depth++;
-                        handleStartElement();
-                        break;
-                    case XMLStreamConstants.END_ELEMENT :
-                        handleEndElement();
-                        depth--;
-                        if(depth==0 && eagerQuit)
-                            break OUTER;
-                        break;
-                    case XMLStreamConstants.CHARACTERS :
-                        handleCharacters();
-                        break;
-                    case XMLStreamConstants.ENTITY_REFERENCE :
-                        handleEntityReference();
-                        break;
-                    case XMLStreamConstants.PROCESSING_INSTRUCTION :
-                        handlePI();
-                        break;
-                    case XMLStreamConstants.COMMENT :
-                        handleComment();
-                        break;
-                    case XMLStreamConstants.DTD :
-                        handleDTD();
-                        break;
-                    case XMLStreamConstants.ATTRIBUTE :
-                        handleAttribute();
-                        break;
-                    case XMLStreamConstants.NAMESPACE :
-                        handleNamespace();
-                        break;
-                    case XMLStreamConstants.CDATA :
-                        handleCDATA();
-                        break;
-                    case XMLStreamConstants.ENTITY_DECLARATION :
-                        handleEntityDecl();
-                        break;
-                    case XMLStreamConstants.NOTATION_DECLARATION :
-                        handleNotationDecl();
-                        break;
-                    case XMLStreamConstants.SPACE :
-                        handleSpace();
-                        break;
-                    default :
-                        throw new InternalError("processing event: " + event);
-                }
-
-                event=staxStreamReader.next();
-            } while (depth!=0);
-
-            handleEndDocument();
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleEndDocument() throws SAXException {
-        saxHandler.endDocument();
-    }
-
-    private void handleStartDocument() throws SAXException {
-        saxHandler.setDocumentLocator(new Locator() {
-            public int getColumnNumber() {
-                return staxStreamReader.getLocation().getColumnNumber();
-            }
-            public int getLineNumber() {
-                return staxStreamReader.getLocation().getLineNumber();
-            }
-            public String getPublicId() {
-                return staxStreamReader.getLocation().getPublicId();
-            }
-            public String getSystemId() {
-                return staxStreamReader.getLocation().getSystemId();
-            }
-        });
-        saxHandler.startDocument();
-    }
-
-    private void handlePI() throws XMLStreamException {
-        try {
-            saxHandler.processingInstruction(
-                staxStreamReader.getPITarget(),
-                staxStreamReader.getPIData());
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleCharacters() throws XMLStreamException {
-        try {
-            saxHandler.characters(
-                staxStreamReader.getTextCharacters(),
-                staxStreamReader.getTextStart(),
-                staxStreamReader.getTextLength() );
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleEndElement() throws XMLStreamException {
-        QName qName = staxStreamReader.getName();
-
-        try {
-            // fire endElement
-            saxHandler.endElement(
-                qName.getNamespaceURI(),
-                qName.getLocalPart(),
-                qName.toString());
-
-            // end namespace bindings
-            int nsCount = staxStreamReader.getNamespaceCount();
-            for (int i = nsCount - 1; i >= 0; i--) {
-                String prefix = staxStreamReader.getNamespacePrefix(i);
-                if (prefix == null) { // true for default namespace
-                    prefix = "";
-                }
-                saxHandler.endPrefixMapping(prefix);
-            }
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private void handleStartElement() throws XMLStreamException {
-
-        try {
-            // start namespace bindings
-            int nsCount = staxStreamReader.getNamespaceCount();
-            for (int i = 0; i < nsCount; i++) {
-                saxHandler.startPrefixMapping(
-                    fixNull(staxStreamReader.getNamespacePrefix(i)),
-                    fixNull(staxStreamReader.getNamespaceURI(i)));
-            }
-
-            // fire startElement
-            QName qName = staxStreamReader.getName();
-            String prefix = qName.getPrefix();
-            String rawname;
-            if(prefix==null || prefix.length()==0)
-                rawname = qName.getLocalPart();
-            else
-                rawname = prefix + ':' + qName.getLocalPart();
-            Attributes attrs = getAttributes();
-            saxHandler.startElement(
-                qName.getNamespaceURI(),
-                qName.getLocalPart(),
-                rawname,
-                attrs);
-        } catch (SAXException e) {
-            throw new XMLStreamException(e);
-        }
-    }
-
-    private static String fixNull(String s) {
-        if(s==null)     return "";
-        else            return s;
-    }
-
-    /**
-     * Get the attributes associated with the given START_ELEMENT or ATTRIBUTE
-     * StAXevent.
-     *
-     * @return the StAX attributes converted to an org.xml.sax.Attributes
-     */
-    private Attributes getAttributes() {
-        AttributesImpl attrs = new AttributesImpl();
-
-        int eventType = staxStreamReader.getEventType();
-        if (eventType != XMLStreamConstants.ATTRIBUTE
-            && eventType != XMLStreamConstants.START_ELEMENT) {
-            throw new InternalError(
-                "getAttributes() attempting to process: " + eventType);
-        }
-
-        // in SAX, namespace declarations are not part of attributes by default.
-        // (there's a property to control that, but as far as we are concerned
-        // we don't use it.) So don't add xmlns:* to attributes.
-
-        // gather non-namespace attrs
-        for (int i = 0; i < staxStreamReader.getAttributeCount(); i++) {
-            String uri = staxStreamReader.getAttributeNamespace(i);
-            if(uri==null)   uri="";
-            String localName = staxStreamReader.getAttributeLocalName(i);
-            String prefix = staxStreamReader.getAttributePrefix(i);
-            String qName;
-            if(prefix==null || prefix.length()==0)
-                qName = localName;
-            else
-                qName = prefix + ':' + localName;
-            String type = staxStreamReader.getAttributeType(i);
-            String value = staxStreamReader.getAttributeValue(i);
-
-            attrs.addAttribute(uri, localName, qName, type, value);
-        }
-
-        return attrs;
-    }
-
-    private void handleNamespace() {
-        // no-op ???
-        // namespace events don't normally occur outside of a startElement
-        // or endElement
-    }
-
-    private void handleAttribute() {
-        // no-op ???
-        // attribute events don't normally occur outside of a startElement
-        // or endElement
-    }
-
-    private void handleDTD() {
-        // no-op ???
-        // it seems like we need to pass this info along, but how?
-    }
-
-    private void handleComment() {
-        // no-op ???
-    }
-
-    private void handleEntityReference() {
-        // no-op ???
-    }
-
-    private void handleSpace() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleNotationDecl() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleEntityDecl() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-
-    private void handleCDATA() {
-        // no-op ???
-        // this event is listed in the javadoc, but not in the spec.
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java
new file mode 100644
index 0000000..2ec1de7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.XMLConstants;
+
+/**
+ * Reads a sub-tree from {@link XMLStreamReader} and writes to {@link XMLStreamWriter}
+ * as-is.
+ *
+ * <p>
+ * This class can be sub-classed to implement a simple transformation logic.
+ *
+ * @author Kohsuke Kawaguchi
+ * @author Ryan Shoemaker
+ */
+public class XMLStreamReaderToXMLStreamWriter {
+
+    protected XMLStreamReader in;
+    protected XMLStreamWriter out;
+
+    /**
+     * Reads one subtree and writes it out.
+     *
+     * <p>
+     * The {@link XMLStreamWriter} never receives a start/end document event.
+     * Those need to be written separately by the caller.
+     */
+    public void bridge(XMLStreamReader in, XMLStreamWriter out) throws XMLStreamException {
+        assert in!=null && out!=null;
+        this.in = in;
+        this.out = out;
+
+        // remembers the nest level of elements to know when we are done.
+        int depth=0;
+
+        // if the parser is at the start tag, proceed to the first element
+        int event = in.getEventType();
+        if(event == XMLStreamConstants.START_DOCUMENT) {
+            // nextTag doesn't correctly handle DTDs
+            while( !in.isStartElement() ) {
+                event = in.next();
+                if (event == XMLStreamConstants.COMMENT)
+                    handleComment();
+            }
+        }
+
+
+        if( event!=XMLStreamConstants.START_ELEMENT)
+            throw new IllegalStateException("The current event is not START_ELEMENT\n but " + event);
+
+        do {
+            // These are all of the events listed in the javadoc for
+            // XMLEvent.
+            // The spec only really describes 11 of them.
+            switch (event) {
+                case XMLStreamConstants.START_ELEMENT :
+                    depth++;
+                    handleStartElement();
+                    break;
+                case XMLStreamConstants.END_ELEMENT :
+                    handleEndElement();
+                    depth--;
+                    if(depth==0)
+                        return;
+                    break;
+                case XMLStreamConstants.CHARACTERS :
+                    handleCharacters();
+                    break;
+                case XMLStreamConstants.ENTITY_REFERENCE :
+                    handleEntityReference();
+                    break;
+                case XMLStreamConstants.PROCESSING_INSTRUCTION :
+                    handlePI();
+                    break;
+                case XMLStreamConstants.COMMENT :
+                    handleComment();
+                    break;
+                case XMLStreamConstants.DTD :
+                    handleDTD();
+                    break;
+                case XMLStreamConstants.CDATA :
+                    handleCDATA();
+                    break;
+                case XMLStreamConstants.SPACE :
+                    handleSpace();
+                    break;
+                default :
+                    throw new InternalError("processing event: " + event);
+            }
+
+            event=in.next();
+        } while (depth!=0);
+    }
+
+    protected void handlePI() throws XMLStreamException {
+        out.writeProcessingInstruction(
+            in.getPITarget(),
+            in.getPIData());
+    }
+
+    protected void handleCharacters() throws XMLStreamException {
+        out.writeCharacters(
+            in.getTextCharacters(),
+            in.getTextStart(),
+            in.getTextLength() );
+    }
+
+    protected void handleEndElement() throws XMLStreamException {
+        out.writeEndElement();
+    }
+
+    protected void handleStartElement() throws XMLStreamException {
+        String nsUri = in.getNamespaceURI();
+        if(nsUri==null)
+            out.writeStartElement(in.getLocalName());
+        else
+            out.writeStartElement(
+                fixNull(in.getPrefix()),
+                in.getLocalName(),
+                nsUri
+            );
+
+        // start namespace bindings
+        int nsCount = in.getNamespaceCount();
+        for (int i = 0; i < nsCount; i++) {
+            out.writeNamespace(
+                in.getNamespacePrefix(i),
+                fixNull(in.getNamespaceURI(i)));    // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now
+        }
+
+        // write attributes
+        int attCount = in.getAttributeCount();
+        for (int i = 0; i < attCount; i++) {
+            handleAttribute(i);
+        }
+    }
+
+    /**
+     * Writes out the {@code i}-th attribute of the current element.
+     *
+     * <p>
+     * Used from {@link #handleStartElement()}.
+     */
+    protected void handleAttribute(int i) throws XMLStreamException {
+        String nsUri = in.getAttributeNamespace(i);
+        String prefix = in.getAttributePrefix(i);
+         if (fixNull(nsUri).equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+             //Its a namespace decl, ignore as it is already written.
+             return;
+         }
+
+        if(nsUri==null || prefix == null || prefix.equals("")) {
+            out.writeAttribute(
+                in.getAttributeLocalName(i),
+                in.getAttributeValue(i)
+            );
+        } else {
+            out.writeAttribute(
+                prefix,
+                nsUri,
+                in.getAttributeLocalName(i),
+                in.getAttributeValue(i)
+            );
+        }
+    }
+
+    protected void handleDTD() throws XMLStreamException {
+        out.writeDTD(in.getText());
+    }
+
+    protected void handleComment() throws XMLStreamException {
+        out.writeComment(in.getText());
+    }
+
+    protected void handleEntityReference() throws XMLStreamException {
+        out.writeEntityRef(in.getText());
+    }
+
+    protected void handleSpace() throws XMLStreamException {
+        handleCharacters();
+    }
+
+    protected void handleCDATA() throws XMLStreamException {
+        out.writeCData(in.getText());
+    }
+
+    private static String fixNull(String s) {
+        if(s==null)     return "";
+        else            return s;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamWriterFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamWriterFilter.java
new file mode 100644
index 0000000..b1cadb4
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamWriterFilter.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.util.xml;
+
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.RecycleAware;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * {@link XMLStreamWriter} that delegates to another {@link XMLStreamWriter}.
+ *
+ * <p>
+ * This class isn't very useful by itself, but works as a base class
+ * for {@link XMLStreamWriter} filtering.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class XMLStreamWriterFilter implements XMLStreamWriter, RecycleAware {
+    protected XMLStreamWriter writer;
+
+    public XMLStreamWriterFilter(XMLStreamWriter writer) {
+        this.writer = writer;
+    }
+
+    public void close() throws XMLStreamException {
+        writer.close();
+    }
+
+    public void flush() throws XMLStreamException {
+        writer.flush();
+    }
+
+    public void writeEndDocument() throws XMLStreamException {
+        writer.writeEndDocument();
+    }
+
+    public void writeEndElement() throws XMLStreamException {
+        writer.writeEndElement();
+    }
+
+    public void writeStartDocument() throws XMLStreamException {
+        writer.writeStartDocument();
+    }
+
+    public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
+        writer.writeCharacters(text, start, len);
+    }
+
+    public void setDefaultNamespace(String uri) throws XMLStreamException {
+        writer.setDefaultNamespace(uri);
+    }
+
+    public void writeCData(String data) throws XMLStreamException {
+        writer.writeCData(data);
+    }
+
+    public void writeCharacters(String text) throws XMLStreamException {
+        writer.writeCharacters(text);
+    }
+
+    public void writeComment(String data) throws XMLStreamException {
+        writer.writeComment(data);
+    }
+
+    public void writeDTD(String dtd) throws XMLStreamException {
+        writer.writeDTD(dtd);
+    }
+
+    public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
+        writer.writeDefaultNamespace(namespaceURI);
+    }
+
+    public void writeEmptyElement(String localName) throws XMLStreamException {
+        writer.writeEmptyElement(localName);
+    }
+
+    public void writeEntityRef(String name) throws XMLStreamException {
+        writer.writeEntityRef(name);
+    }
+
+    public void writeProcessingInstruction(String target) throws XMLStreamException {
+        writer.writeProcessingInstruction(target);
+    }
+
+    public void writeStartDocument(String version) throws XMLStreamException {
+        writer.writeStartDocument(version);
+    }
+
+    public void writeStartElement(String localName) throws XMLStreamException {
+        writer.writeStartElement(localName);
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        return writer.getNamespaceContext();
+    }
+
+    public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
+        writer.setNamespaceContext(context);
+    }
+
+    public Object getProperty(String name) throws IllegalArgumentException {
+        return writer.getProperty(name);
+    }
+
+    public String getPrefix(String uri) throws XMLStreamException {
+        return writer.getPrefix(uri);
+    }
+
+    public void setPrefix(String prefix, String uri) throws XMLStreamException {
+        writer.setPrefix(prefix, uri);
+    }
+
+    public void writeAttribute(String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(localName, value);
+    }
+
+    public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
+        writer.writeEmptyElement(namespaceURI, localName);
+    }
+
+    public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
+        writer.writeNamespace(prefix, namespaceURI);
+    }
+
+    public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
+        writer.writeProcessingInstruction(target, data);
+    }
+
+    public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+        writer.writeStartDocument(encoding, version);
+    }
+
+    public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
+        writer.writeStartElement(namespaceURI, localName);
+    }
+
+    public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(namespaceURI, localName, value);
+    }
+
+    public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        writer.writeEmptyElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
+        writer.writeStartElement(prefix, localName, namespaceURI);
+    }
+
+    public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
+        writer.writeAttribute(prefix, namespaceURI, localName, value);
+    }
+
+    public void onRecycled() {
+        XMLStreamWriterFactory.recycle(writer);
+        writer = null;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
index 6019eba..cb00e5a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,35 +25,37 @@
 
 package com.sun.xml.internal.ws.util.xml;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-
+import com.sun.istack.internal.Nullable;
+import com.sun.org.apache.xml.internal.resolver.CatalogManager;
+import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver;
+import com.sun.xml.internal.ws.server.ServerRtException;
+import com.sun.xml.internal.ws.util.ByteArrayBuffer;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
-
-import com.sun.xml.internal.ws.server.ServerRtException;
-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
-
-import java.net.URL;
-import java.util.Enumeration;
-import javax.xml.ws.WebServiceException;
-import com.sun.org.apache.xml.internal.resolver.CatalogManager;
-import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver;
 import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
 
 /**
  * @author WS Development Team
@@ -93,6 +95,15 @@
         return a.getValue();
     }
 
+    public static String getAttributeNSOrNull(
+        Element e,
+        QName name) {
+        Attr a = e.getAttributeNodeNS(name.getNamespaceURI(), name.getLocalPart());
+        if (a == null)
+            return null;
+        return a.getValue();
+    }
+
 /*    public static boolean matchesTagNS(Element e, String tag, String nsURI) {
         try {
             return e.getLocalName().equals(tag)
@@ -177,6 +188,9 @@
 
     static final TransformerFactory transformerFactory = TransformerFactory.newInstance();
 
+    /**
+     * Creates a new identity transformer.
+     */
     public static Transformer newTransformer() {
         try {
             return transformerFactory.newTransformer();
@@ -186,9 +200,9 @@
     }
 
     /*
-     * Gets an EntityResolver using XML catalog
-     */
-    public static EntityResolver createEntityResolver(URL catalogUrl) {
+    * Gets an EntityResolver using XML catalog
+    */
+    public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
         // set up a manager
         CatalogManager manager = new CatalogManager();
         manager.setIgnoreMissingProperties(true);
@@ -231,4 +245,20 @@
 
         return new CatalogResolver(manager);
     }
+
+    /**
+     * {@link ErrorHandler} that always treat the error as fatal.
+     */
+    public static final ErrorHandler DRACONIAN_ERROR_HANDLER = new ErrorHandler() {
+        public void warning(SAXParseException exception) {
+        }
+
+        public void error(SAXParseException exception) throws SAXException {
+            throw exception;
+        }
+
+        public void fatalError(SAXParseException exception) throws SAXException {
+            throw exception;
+        }
+    };
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/WSDLContext.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/WSDLContext.java
deleted file mode 100644
index bceac71..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/WSDLContext.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl;
-
-import com.sun.xml.internal.ws.wsdl.parser.*;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.SAXException;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPBinding;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * $author: JAXWS Development Team
- */
-public class WSDLContext {
-    private final URL orgWsdlLocation;
-    private String targetNamespace;
-    private final WSDLDocument wsdlDoc;
-
-    /**
-     * Creates a {@link WSDLContext} by parsing the given wsdl file.
-     */
-    public WSDLContext(URL wsdlDocumentLocation, EntityResolver entityResolver) throws WebServiceException {
-        //must get binding information
-        assert entityResolver != null;
-
-        if (wsdlDocumentLocation == null)
-            throw new WebServiceException("No WSDL location Information present, error");
-
-        orgWsdlLocation = wsdlDocumentLocation;
-        try {
-            wsdlDoc = RuntimeWSDLParser.parse(wsdlDocumentLocation, entityResolver);
-        } catch (IOException e) {
-            throw new WebServiceException(e);
-        } catch (XMLStreamException e) {
-            throw new WebServiceException(e);
-        } catch (SAXException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    public URL getWsdlLocation() {
-        return orgWsdlLocation;
-    }
-
-    public String getOrigURLPath() {
-        return orgWsdlLocation.getPath();
-    }
-
-    public QName getServiceQName() {
-        return wsdlDoc.getFirstServiceName();
-    }
-
-    public boolean contains(QName serviceName) {
-        return (wsdlDoc.getServices().containsKey(serviceName));
-    }
-
-    //just get the first one for now
-    public String getEndpoint(QName serviceName) {
-        if (serviceName == null)
-            throw new WebServiceException("Service unknown, can not identify ports for an unknown Service.");
-        Service service = wsdlDoc.getService(serviceName);
-        String endpoint = null;
-        if (service != null) {
-            Iterator<Map.Entry<QName, Port>> iter = service.entrySet().iterator();
-            if (iter.hasNext()) {
-                Port port = iter.next().getValue();
-                endpoint = port.getAddress();
-            }
-        }
-        if (endpoint == null)
-            throw new WebServiceException("Endpoint not found. Check WSDL file to verify endpoint was provided.");
-        return endpoint;
-    }
-
-    //just get the first one for now
-    public QName getPortName() {
-        return wsdlDoc.getFirstPortName();
-    }
-
-    public String getBindingID(QName serviceName, QName portName) {
-        return getWsdlDocument().getBindingId(serviceName, portName);
-    }
-
-    public String getTargetNamespace() {
-        return targetNamespace;
-    }
-
-    public void setTargetNamespace(String tns) {
-        targetNamespace = tns;
-    }
-
-    public Set<QName> getPortsAsSet(QName serviceName) {
-        Service service = wsdlDoc.getService(serviceName);
-        if (service != null) {
-            return service.keySet();
-        }
-        return null;
-    }
-
-
-    public boolean contains(QName serviceName, QName portName) {
-        Service service = wsdlDoc.getService(serviceName);
-        if (service != null) {
-
-            Iterator<Map.Entry<QName, Port>> iter = service.entrySet().iterator();
-            while (iter.hasNext()) {
-                Port port = iter.next().getValue();
-                if (port.getName().equals(portName))
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    public QName getFirstServiceName() {
-        return wsdlDoc.getFirstServiceName();
-    }
-
-    public Set<QName> getAllServiceNames() {
-        return wsdlDoc.getServices().keySet();
-    }
-
-    public WSDLDocument getWsdlDocument() {
-        return wsdlDoc;
-    }
-
-    public Binding getWsdlBinding(QName service, QName port) {
-        if (wsdlDoc == null)
-            return null;
-        return wsdlDoc.getBinding(service, port);
-    }
-
-    public String getEndpoint(QName serviceName, QName portQName) {
-        Service service = wsdlDoc.getService(serviceName);
-        if (service != null) {
-            Port p = service.get(portQName);
-            if (p != null)
-                return p.getAddress();
-            else
-                throw new WebServiceException("No ports found for service " + serviceName);
-        } else {
-            throw new WebServiceException("Service unknown, can not identify ports for an unknown Service.");
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Binding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Binding.java
deleted file mode 100644
index fd95ec9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Binding.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import com.sun.xml.internal.ws.model.Mode;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-
-public class Binding extends HashMap<String, BindingOperation> {
-    private QName name;
-    private QName portTypeName;
-    private PortType portType;
-    private String bindingId;
-    private WSDLDocument wsdlDoc;
-    private boolean finalized = false;
-
-    public Binding(QName name, QName portTypeName) {
-        super();
-        this.name = name;
-        this.portTypeName = portTypeName;
-    }
-
-    public QName getName() {
-        return name;
-    }
-
-    public QName getPortTypeName(){
-        return portTypeName;
-    }
-
-    public PortType getPortType() {
-        return portType;
-    }
-
-    public void setPortType(PortType portType) {
-        this.portType = portType;
-    }
-
-    public String getBindingId() {
-        return bindingId;
-    }
-
-    public void setBindingId(String bindingId) {
-        this.bindingId = bindingId;
-    }
-
-    public void setWsdlDocument(WSDLDocument wsdlDoc) {
-        this.wsdlDoc = wsdlDoc;
-    }
-
-    public ParameterBinding getBinding(String operation, String part, Mode mode){
-        BindingOperation op = get(operation);
-        if(op == null){
-            //TODO throw exception
-            return null;
-        }
-        if((Mode.IN == mode)||(Mode.INOUT == mode))
-            return op.getInputBinding(part);
-        else
-            return op.getOutputBinding(part);
-    }
-
-    /**
-     * Gives binding for a given {@link BindingOperation} a wsdl part and {@link Mode}
-     * @param op  must be non-null
-     * @param part must be non-null
-     * @param mode must be non-null
-     * @return  parameter Binding, null the binding could not be determined.
-     */
-    public ParameterBinding getBinding(BindingOperation op, String part, Mode mode){
-        if((Mode.IN == mode)||(Mode.INOUT == mode))
-            return op.getInputBinding(part);
-        else
-            return op.getOutputBinding(part);
-    }
-
-    public String getMimeType(String operation, String part, Mode mode){
-        BindingOperation op = get(operation);
-        if(Mode.IN == mode)
-            return op.getMimeTypeForInputPart(part);
-        else
-            return op.getMimeTypeForOutputPart(part);
-    }
-
-    public void finalizeBinding(){
-        if(!finalized){
-            wsdlDoc.finalizeBinding(this);
-            finalized = true;
-        }
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/BindingOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/BindingOperation.java
deleted file mode 100644
index c301ad9..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/BindingOperation.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.Mode;
-
-import javax.xml.ws.Response;
-import java.util.HashMap;
-import java.util.Map;
-
-public class BindingOperation {
-    private String name;
-
-    // map of wsdl:part to the binding
-    private Map<String, ParameterBinding> inputParts;
-    private Map<String, ParameterBinding> outputParts;
-    private Map<String, String> inputMimeTypes;
-    private Map<String, String> outputMimeTypes;
-
-    private boolean explicitInputSOAPBodyParts = false;
-    private boolean explicitOutputSOAPBodyParts = false;
-
-    private Boolean emptyInputBody;
-    private Boolean emptyOutputBody;
-
-    private Map<String, Part> inParts;
-    private Map<String, Part> outParts;
-
-
-    /**
-     *
-     * @param name wsdl:operation name qualified value
-     */
-    public BindingOperation(String name) {
-        this.name = name;
-        inputParts = new HashMap<String, ParameterBinding>();
-        outputParts = new HashMap<String, ParameterBinding>();
-        inputMimeTypes = new HashMap<String, String>();
-        outputMimeTypes = new HashMap<String, String>();
-        inParts = new HashMap<String, Part>();
-        outParts = new HashMap<String, Part>();
-    }
-
-    public String getName(){
-        return name;
-    }
-
-    public Part getPart(String partName, Mode mode){
-        if(mode.equals(Mode.IN)){
-            return inParts.get(partName);
-        }else if(mode.equals(Mode.OUT)){
-            return outParts.get(partName);
-        }
-        return null;
-    }
-
-    public void addPart(Part part, Mode mode){
-        if(mode.equals(Mode.IN))
-            inParts.put(part.getName(), part);
-        else if(mode.equals(Mode.OUT))
-            outParts.put(part.getName(), part);
-    }
-
-    public Map<String, ParameterBinding> getInputParts() {
-        return inputParts;
-    }
-
-    public Map<String, ParameterBinding> getOutputParts() {
-        return outputParts;
-    }
-
-    public Map<String, String> getInputMimeTypes() {
-        return inputMimeTypes;
-    }
-
-    public Map<String, String> getOutputMimeTypes() {
-        return outputMimeTypes;
-    }
-
-    public ParameterBinding getInputBinding(String part){
-        if(emptyInputBody == null){
-            if(inputParts.get(" ") != null)
-                emptyInputBody = true;
-            else
-                emptyInputBody = false;
-        }
-        ParameterBinding block = inputParts.get(part);
-        if(block == null){
-            if(explicitInputSOAPBodyParts || emptyInputBody)
-                return ParameterBinding.UNBOUND;
-            return ParameterBinding.BODY;
-        }
-
-        return block;
-    }
-
-    public ParameterBinding getOutputBinding(String part){
-        if(emptyOutputBody == null){
-            if(outputParts.get(" ") != null)
-                emptyOutputBody = true;
-            else
-                emptyOutputBody = false;
-        }
-        ParameterBinding block = outputParts.get(part);
-        if(block == null){
-            if(explicitOutputSOAPBodyParts || emptyOutputBody)
-                return ParameterBinding.UNBOUND;
-            return ParameterBinding.BODY;
-        }
-
-        return block;
-    }
-
-    public String getMimeTypeForInputPart(String part){
-        return inputMimeTypes.get(part);
-    }
-
-    public String getMimeTypeForOutputPart(String part){
-        return outputMimeTypes.get(part);
-    }
-
-    public void setInputExplicitBodyParts(boolean b) {
-        explicitInputSOAPBodyParts = b;
-    }
-
-    public void setOutputExplicitBodyParts(boolean b) {
-        explicitOutputSOAPBodyParts = b;
-    }
-
-    String reqNamespace;
-    String respNamespace;
-
-    /**
-     * For rpclit gives namespace value on soapbinding:body@namespace
-     *
-     * @return   non-null for rpclit and null for doclit
-     * @see com.sun.xml.internal.ws.modeler.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethod, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService)
-     */
-    public String getRequestNamespace(){
-        return reqNamespace;
-    }
-
-    /**
-     * For rpclit gives namespace value on soapbinding:body@namespace
-     *
-     * @return   non-null for rpclit and null for doclit
-     *      * @see com.sun.xml.internal.ws.modeler.RuntimeModeler#processRpcMethod(com.sun.xml.internal.ws.model.JavaMethod, String, javax.jws.WebMethod, String, java.lang.reflect.Method, javax.jws.WebService)
-     */
-    public String getResponseNamespace(){
-        return respNamespace;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java
new file mode 100644
index 0000000..be16000
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Delegate to another {@link WSDLParserExtension}
+ * useful for the base class for filtering.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+class DelegatingParserExtension extends WSDLParserExtension {
+    protected final WSDLParserExtension core;
+
+    public DelegatingParserExtension(WSDLParserExtension core) {
+        this.core = core;
+    }
+
+    public void start(WSDLParserExtensionContext context) {
+        core.start(context);
+    }
+
+    public void serviceAttributes(WSDLService service, XMLStreamReader reader) {
+        core.serviceAttributes(service, reader);
+    }
+
+    public boolean serviceElements(WSDLService service, XMLStreamReader reader) {
+        return core.serviceElements(service, reader);
+    }
+
+    public void portAttributes(WSDLPort port, XMLStreamReader reader) {
+        core.portAttributes(port, reader);
+    }
+
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        return core.portElements(port, reader);
+    }
+
+    public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) {
+        return core.portTypeOperationInput(op, reader);
+    }
+
+    public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) {
+        return core.portTypeOperationOutput(op, reader);
+    }
+
+    public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) {
+        return core.portTypeOperationFault(op, reader);
+    }
+
+    public boolean definitionsElements(XMLStreamReader reader) {
+        return core.definitionsElements(reader);
+    }
+
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+        return core.bindingElements(binding, reader);
+    }
+
+    public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) {
+        core.bindingAttributes(binding, reader);
+    }
+
+    public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) {
+        return core.portTypeElements(portType, reader);
+    }
+
+    public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) {
+        core.portTypeAttributes(portType, reader);
+    }
+
+    public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) {
+        return core.portTypeOperationElements(operation, reader);
+    }
+
+    public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) {
+        core.portTypeOperationAttributes(operation, reader);
+    }
+
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return core.bindingOperationElements(operation, reader);
+    }
+
+    public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        core.bindingOperationAttributes(operation, reader);
+    }
+
+    public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) {
+        return core.messageElements(msg, reader);
+    }
+
+    public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) {
+        core.messageAttributes(msg, reader);
+    }
+
+    public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) {
+        return core.portTypeOperationInputElements(input, reader);
+    }
+
+    public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) {
+        core.portTypeOperationInputAttributes(input, reader);
+    }
+
+    public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) {
+        return core.portTypeOperationOutputElements(output, reader);
+    }
+
+    public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) {
+        core.portTypeOperationOutputAttributes(output, reader);
+    }
+
+    public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) {
+        return core.portTypeOperationFaultElements(fault, reader);
+    }
+
+    public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) {
+        core.portTypeOperationFaultAttributes(fault, reader);
+    }
+
+    public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return core.bindingOperationInputElements(operation, reader);
+    }
+
+    public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        core.bindingOperationInputAttributes(operation, reader);
+    }
+
+    public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return core.bindingOperationOutputElements(operation, reader);
+    }
+
+    public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        core.bindingOperationOutputAttributes(operation, reader);
+    }
+
+    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return core.bindingOperationFaultElements(operation, reader);
+    }
+
+    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        core.bindingOperationFaultAttributes(operation, reader);
+    }
+
+    public void finished(WSDLParserExtensionContext context) {
+        core.finished(context);
+    }
+
+    public void postFinished(WSDLParserExtensionContext context) {
+        core.postFinished(context);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/EntityResolverWrapper.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/EntityResolverWrapper.java
new file mode 100644
index 0000000..5196f32
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/EntityResolverWrapper.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver;
+import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * Wraps {@link EntityResolver} into {@link com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class EntityResolverWrapper implements XMLEntityResolver {
+    private final EntityResolver core;
+
+    public EntityResolverWrapper(EntityResolver core) {
+        this.core = core;
+    }
+
+    public Parser resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+        InputSource source = core.resolveEntity(publicId,systemId);
+        if(source==null)
+            return null;    // default
+
+        // ideally entity resolvers should be giving us the system ID for the resource
+        // (or otherwise we won't be able to resolve references within this imported WSDL correctly),
+        // but if none is given, the system ID before the entity resolution is better than nothing.
+        if(source.getSystemId()!=null)
+            systemId = source.getSystemId();
+
+        URL url = new URL(systemId);
+        InputStream stream = url.openStream();
+        return new Parser(url,
+                new TidyXMLStreamReader(XMLStreamReaderFactory.create(url.toExternalForm(), stream, true), stream));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ErrorHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ErrorHandler.java
new file mode 100644
index 0000000..4969f82
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ErrorHandler.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import javax.xml.ws.WebServiceException;
+
+
+/**
+ * listen to static errors found during building a the WSDL Model.
+ *
+ * @author Vivek Pandey
+ */
+public interface ErrorHandler {
+    /**
+     * Receives a notification for an error in the annotated code.
+     */
+    void error( Throwable e );
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java
new file mode 100644
index 0000000..7202cd2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.parser;
+
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * {@link WSDLParserExtension} filter that checks if
+ * another {@link WSDLParserExtension} is following the contract.
+ *
+ * <p>
+ * This code protects the JAX-WS RI from broken extensions.
+ *
+ * <p>
+ * For now it just checks if {@link XMLStreamReader} is placed
+ * at the expected start/end element.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class FoolProofParserExtension extends DelegatingParserExtension {
+
+    public FoolProofParserExtension(WSDLParserExtension core) {
+        super(core);
+    }
+
+    private QName pre(XMLStreamReader xsr) {
+        return xsr.getName();
+    }
+
+    private boolean post(QName tagName, XMLStreamReader xsr, boolean result) {
+        if(!tagName.equals(xsr.getName()))
+            return foundFool();
+        if(result) {
+            if(xsr.getEventType()!=XMLStreamConstants.END_ELEMENT)
+                foundFool();
+        } else {
+            if(xsr.getEventType()!=XMLStreamConstants.START_ELEMENT)
+                foundFool();
+        }
+        return result;
+    }
+
+    private boolean foundFool() {
+        throw new AssertionError("XMLStreamReader is placed at the wrong place after invoking "+core);
+    }
+
+    public boolean serviceElements(WSDLService service, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.serviceElements(service, reader));
+    }
+
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portElements(port, reader));
+    }
+
+    public boolean definitionsElements(XMLStreamReader reader) {
+        return post(pre(reader),reader,super.definitionsElements(reader));
+    }
+
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.bindingElements(binding, reader));
+    }
+
+    public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portTypeElements(portType, reader));
+    }
+
+    public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portTypeOperationElements(operation, reader));
+    }
+
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.bindingOperationElements(operation, reader));
+    }
+
+    public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.messageElements(msg, reader));
+    }
+
+    public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portTypeOperationInputElements(input, reader));
+    }
+
+    public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portTypeOperationOutputElements(output, reader));
+    }
+
+    public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.portTypeOperationFaultElements(fault, reader));
+    }
+
+    public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return super.bindingOperationInputElements(operation, reader);
+    }
+
+    public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.bindingOperationOutputElements(operation, reader));
+    }
+
+    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return post(pre(reader),reader,super.bindingOperationFaultElements(operation, reader));
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/InaccessibleWSDLException.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/InaccessibleWSDLException.java
new file mode 100644
index 0000000..6fd82a0
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/InaccessibleWSDLException.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.parser;
+
+
+
+import javax.xml.ws.WebServiceException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * A list of {@link InaccessibleWSDLException} wrapped in one exception.
+ *
+ * <p>
+ * This exception is used to report all the errors during WSDL parsing from {@link RuntimeWSDLParser#parse(java.net.URL, org.xml.sax.EntityResolver, boolean, com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension[])}
+ *
+ * @author Vivek Pandey
+ */
+public class InaccessibleWSDLException extends WebServiceException {
+
+    private final List<Throwable> errors;
+
+    private static final long serialVersionUID = 1L;
+
+    public InaccessibleWSDLException(List<Throwable> errors) {
+        super(errors.size()+" counts of InaccessibleWSDLException.\n");
+        assert !errors.isEmpty() : "there must be at least one error";
+        this.errors = Collections.unmodifiableList(new ArrayList<Throwable>(errors));
+    }
+
+    public String toString() {
+        StringBuilder sb = new StringBuilder(super.toString());
+        sb.append('\n');
+
+        for( Throwable error : errors )
+            sb.append(error.toString()).append('\n');
+
+        return sb.toString();
+    }
+
+    /**
+     * Returns a read-only list of {@link InaccessibleWSDLException}s
+     * wrapped in this exception.
+     *
+     * @return
+     *      a non-null list.
+     */
+    public List<Throwable> getErrors() {
+        return errors;
+    }
+
+    public static class Builder implements ErrorHandler {
+        private final List<Throwable> list = new ArrayList<Throwable>();
+        public void error(Throwable e) {
+            list.add(e);
+        }
+        /**
+         * If an error was reported, throw the exception.
+         * Otherwise exit normally.
+         */
+        public void check() throws InaccessibleWSDLException {
+            if(list.isEmpty())
+                return;
+            throw new InaccessibleWSDLException(list);
+        }
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java
index 12e1220..67fe200 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MIMEConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 import javax.xml.namespace.QName;
 
 
-public interface MIMEConstants {
+interface MIMEConstants {
     // namespace URIs
     public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java
new file mode 100644
index 0000000..21a4efd
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Member Submission WS-Addressing Runtime WSDL parser extension
+ *
+ * @author Arun Gupta
+ */
+public class MemberSubmissionAddressingWSDLParserExtension extends W3CAddressingWSDLParserExtension {
+    @Override
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+        return addressibleElement(reader, binding);
+    }
+
+    @Override
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        return addressibleElement(reader, port);
+    }
+
+    private boolean addressibleElement(XMLStreamReader reader, WSDLFeaturedObject binding) {
+        QName ua = reader.getName();
+        if (ua.equals(AddressingVersion.MEMBER.wsdlExtensionTag)) {
+            String required = reader.getAttributeValue(WSDLConstants.NS_WSDL, "required");
+            binding.addFeature(new MemberSubmissionAddressingFeature(Boolean.parseBoolean(required)));
+            XMLStreamReaderUtil.skipElement(reader);
+            return true;        // UsingAddressing is consumed
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationInput(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.MEMBER.wsdlActionTag);
+        if (action != null) {
+            impl.getInput().setAction(action);
+            impl.getInput().setDefaultAction(false);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationOutput(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.MEMBER.wsdlActionTag);
+        if (action != null) {
+            impl.getOutput().setAction(action);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationFault(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.MEMBER.wsdlActionTag);
+        if (action != null) {
+            String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
+            impl.getFaultActionMap().put(name, action);
+        }
+
+        return false;
+    }
+
+    @Override
+    protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) {
+    }
+
+    @Override
+    protected String getNamespaceURI() {
+        return AddressingVersion.MEMBER.wsdlNsUri;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Message.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Message.java
deleted file mode 100644
index cd1fb34..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Message.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-import java.util.TreeMap;
-import java.util.LinkedHashSet;
-
-public class Message extends LinkedHashSet<String>{
-    private QName name;
-
-    /**
-     * @param name wsdl:message name attribute qualified name
-     */
-    public Message(QName name) {
-        this.name = name;
-    }
-
-    public QName getName() {
-        return name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MexEntityResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MexEntityResolver.java
new file mode 100644
index 0000000..1e5afd7
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/MexEntityResolver.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.stream.buffer.XMLStreamBufferResult;
+import com.sun.xml.internal.ws.api.server.SDDocumentSource;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver;
+import com.sun.xml.internal.ws.util.JAXWSUtils;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.xml.sax.SAXException;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Entity resolver that works on MEX Metadata
+ *
+ * @author Vivek Pandey
+ */
+public final class MexEntityResolver implements XMLEntityResolver {
+    private final Map<String, SDDocumentSource> wsdls = new HashMap<String, SDDocumentSource>();
+
+    public MexEntityResolver(List<? extends Source> wsdls) throws IOException {
+        Transformer transformer = XmlUtil.newTransformer();
+        for (Source source : wsdls) {
+            XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
+            try {
+                transformer.transform(source, xsbr);
+            } catch (TransformerException e) {
+                throw new WebServiceException(e);
+            }
+            String systemId = source.getSystemId();
+
+            //TODO: can we do anything if the given mex Source has no systemId?
+            if(systemId != null){
+                SDDocumentSource doc = SDDocumentSource.create(JAXWSUtils.getFileOrURL(systemId), xsbr.getXMLStreamBuffer());
+                this.wsdls.put(systemId, doc);
+            }
+        }
+    }
+
+    public Parser resolveEntity(String publicId, String systemId) throws SAXException, IOException, XMLStreamException {
+        if (systemId != null) {
+            SDDocumentSource src = wsdls.get(systemId);
+            if (src != null)
+                return new Parser(src);
+        }
+        return null;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java
index cb5d142..871a13e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
 
 
 /**
+ *
+ * TODO: made public just for now
  * @author WS Development Team
  */
 public class ParserUtil {
@@ -46,6 +48,14 @@
         return reader.getAttributeValue(null, name);
     }
 
+    public static String getAttribute(XMLStreamReader reader, String nsUri, String name) {
+        return reader.getAttributeValue(nsUri, name);
+    }
+
+    public static String getAttribute(XMLStreamReader reader, QName name) {
+        return reader.getAttributeValue(name.getNamespaceURI(), name.getLocalPart());
+    }
+
     public static void verifyTag(XMLReader reader, QName name) {
         if (!name.equals(reader.getName())) {
             throw new XMLReaderException("xmlreader.unexpectedState.tag",
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Part.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Part.java
deleted file mode 100644
index 7bca3d3..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Part.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import com.sun.xml.internal.ws.model.ParameterBinding;
-
-public class Part {
-    private String name;
-    private ParameterBinding binding;
-    private int index;
-
-    public Part(String name, ParameterBinding binding, int index) {
-        this.name = name;
-        this.binding = binding;
-        this.index = index;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public ParameterBinding getBinding() {
-        return binding;
-    }
-
-    public int getIndex() {
-        return index;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Port.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Port.java
deleted file mode 100644
index e03a5de..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Port.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import javax.xml.namespace.QName;
-
-public class Port {
-    private QName name;
-    private String address;
-    private QName bindingName;
-    private Binding binding;
-
-    public Port(QName name, QName binding, String address) {
-        this.name = name;
-        this.bindingName = binding;
-        this.address = address;
-    }
-
-    public QName getName() {
-        return name;
-    }
-
-    public QName getBindingName() {
-        return bindingName;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public Binding getBinding() {
-        return binding;
-    }
-
-    public void setBinding(Binding binding) {
-        this.binding = binding;
-    }
-
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortType.java
deleted file mode 100644
index 5f74557..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-
-public class PortType extends HashMap<String, PortTypeOperation>{
-    private QName name;
-
-    public PortType(QName name) {
-        super();
-        this.name = name;
-    }
-
-    public QName getName() {
-        return name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortTypeOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortTypeOperation.java
deleted file mode 100644
index 689dd4b..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/PortTypeOperation.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import javax.xml.namespace.QName;
-
-public class PortTypeOperation{
-    private QName name;
-    private String parameterOrder;
-    private QName inputMessage;
-    private QName outputMessage;
-    private QName faultMessage;
-
-    public PortTypeOperation(QName name) {
-        this.name = name;
-    }
-
-    public QName getName() {
-        return name;
-    }
-
-    public String getParameterOrder() {
-        return parameterOrder;
-    }
-
-    public void setParameterOrder(String parameterOrder) {
-        this.parameterOrder = parameterOrder;
-    }
-
-    public QName getInputMessage() {
-        return inputMessage;
-    }
-
-    public void setInputMessage(QName inputMessage) {
-        this.inputMessage = inputMessage;
-    }
-
-    public QName getOutputMessage() {
-        return outputMessage;
-    }
-
-    public void setOutputMessage(QName outputMessage) {
-        this.outputMessage = outputMessage;
-    }
-
-    public QName getFaultMessage() {
-        return faultMessage;
-    }
-
-    public void setFaultMessage(QName faultMessage) {
-        this.faultMessage = faultMessage;
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java
index 7589016..1403cec 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,34 +24,53 @@
  */
 
 package com.sun.xml.internal.ws.wsdl.parser;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.server.DocInfo;
-import com.sun.xml.internal.ws.server.DocInfo.DOC_TYPE;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderFactory;
-import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import com.sun.xml.internal.ws.api.BindingID;
+import com.sun.xml.internal.ws.api.EndpointAddress;
+import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.wsdl.parser.*;
+import com.sun.xml.internal.ws.api.wsdl.parser.XMLEntityResolver.Parser;
+import com.sun.xml.internal.ws.model.wsdl.*;
+import com.sun.xml.internal.ws.resources.ClientMessages;
+import com.sun.xml.internal.ws.resources.WsdlmodelMessages;
+import com.sun.xml.internal.ws.streaming.SourceReaderFactory;
 import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.util.ServiceFinder;
 import com.sun.xml.internal.ws.util.xml.XmlUtil;
 import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
+import javax.jws.soap.SOAPBinding.Style;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
 import javax.xml.ws.WebServiceException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.Reader;
+import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.*;
+import java.util.logging.Logger;
 
+/**
+ * Parses WSDL and builds {@link WSDLModel}.
+ *
+ * @author Vivek Pandey
+ */
 public class RuntimeWSDLParser {
-    private final WSDLDocument wsdlDoc = new WSDLDocument();
+
+    private final WSDLModelImpl wsdlDoc;
     /**
      * Target namespace URI of the WSDL that we are currently parsing.
      */
@@ -63,319 +82,480 @@
     /**
      * Must not be null.
      */
-    private final EntityResolver resolver;
+    private final XMLEntityResolver resolver;
+    /**
+     * The {@link WSDLParserExtension}. Always non-null.
+     */
+    private final WSDLParserExtension extensionFacade;
 
-    public static WSDLDocument parse(URL wsdlLoc, EntityResolver resolver) throws IOException, XMLStreamException, SAXException {
-        assert resolver!=null;
-        RuntimeWSDLParser parser = new RuntimeWSDLParser(resolver);
-        parser.parseWSDL(wsdlLoc);
+    private final WSDLParserExtensionContextImpl context;
+
+    List<WSDLParserExtension> extensions;
+
+    /**
+     * Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
+     * document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
+     * then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
+     *
+     * @param wsdlLoc
+     *      Either this or <tt>wsdl</tt> parameter must be given.
+     *      Null location means the system won't be able to resolve relative references in the WSDL,
+     */
+    public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+        assert resolver != null;
+
+        RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver), isClientSide, extensions);
+        Parser parser;
+        try{
+            parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource);
+            if(!hasWSDLDefinitions(parser.parser)){
+                throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
+                        WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
+            }
+        }catch(XMLStreamException e){
+            //Try MEX if there is WSDLLoc available
+            if(wsdlLoc == null)
+                throw e;
+            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, e, extensions);
+
+        }catch(IOException e){
+            //Try MEX if there is WSDLLoc available
+            if(wsdlLoc == null)
+                throw e;
+            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, e, extensions);
+        }
+        wsdlParser.parseWSDL(parser, false);
+        wsdlParser.wsdlDoc.freeze();
+        wsdlParser.extensionFacade.finished(wsdlParser.context);
+        wsdlParser.extensionFacade.postFinished(wsdlParser.context);
+        return wsdlParser.wsdlDoc;
+    }
+
+    private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Throwable e, WSDLParserExtension... extensions) throws SAXException, XMLStreamException {
+        ArrayList<Throwable> exceptions = new ArrayList<Throwable>();
+        try {
+            WSDLModelImpl wsdlModel =  wsdlParser.parseUsingMex(wsdlLoc, resolver, isClientSide, extensions);
+            if(wsdlModel == null){
+                throw new WebServiceException(ClientMessages.FAILED_TO_PARSE(wsdlLoc.toExternalForm(), e.getMessage()), e);
+            }
+            return wsdlModel;
+        } catch (URISyntaxException e1) {
+            exceptions.add(e);
+            exceptions.add(e1);
+        } catch(IOException e1){
+            exceptions.add(e);
+            exceptions.add(e1);
+        }
+        throw new InaccessibleWSDLException(exceptions);
+    }
+
+    private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException {
+        //try MEX
+        MetaDataResolver mdResolver = null;
+        ServiceDescriptor serviceDescriptor = null;
+        RuntimeWSDLParser wsdlParser = null;
+
+        //Currently we try the first available MetadataResolverFactory that gives us a WSDL document
+        for (MetadataResolverFactory resolverFactory : ServiceFinder.find(MetadataResolverFactory.class)) {
+            mdResolver = resolverFactory.metadataResolver(resolver);
+            serviceDescriptor = mdResolver.resolve(wsdlLoc.toURI());
+            //we got the ServiceDescriptor, now break
+            if (serviceDescriptor != null)
+                break;
+        }
+        if (serviceDescriptor != null) {
+            List<? extends Source> wsdls = serviceDescriptor.getWSDLs();
+            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(), new MexEntityResolver(wsdls), isClientSide, extensions);
+
+            //now parse the first WSDL in the list
+            if(wsdls.size() > 0){
+                String systemId = wsdls.get(0).getSystemId();
+                Parser parser = wsdlParser.resolver.resolveEntity(null, systemId);
+                wsdlParser.parseWSDL(parser, false);
+            }
+        }
+        //Incase that mex is not present or it couldn't get the metadata, try by appending ?wsdl and give
+        // it a last shot else fail
+        if (mdResolver == null && (wsdlLoc.getProtocol().equals("http") || wsdlLoc.getProtocol().equals("https")) && (wsdlLoc.getQuery() == null)) {
+            String urlString = wsdlLoc.toExternalForm();
+            urlString += "?wsdl";
+            wsdlLoc = new URL(urlString);
+            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(),new EntityResolverWrapper(resolver), isClientSide, extensions);
+            Parser parser = resolveWSDL(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()));
+            wsdlParser.parseWSDL(parser, false);
+        }
+
+        if(wsdlParser == null)
+            return null;
+
+        wsdlParser.wsdlDoc.freeze();
+        wsdlParser.extensionFacade.finished(wsdlParser.context);
+        wsdlParser.extensionFacade.postFinished(wsdlParser.context);
+        return wsdlParser.wsdlDoc;
+    }
+
+    private static boolean hasWSDLDefinitions(XMLStreamReader reader) {
+        XMLStreamReaderUtil.nextElementContent(reader);
+        return reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS);
+    }
+
+    public static WSDLModelImpl parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+        assert resolver != null;
+        RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, extensions);
+        parser.parseWSDL(wsdl, false);
+        parser.wsdlDoc.freeze();
+        parser.extensionFacade.finished(parser.context);
+        parser.extensionFacade.postFinished(parser.context);
         return parser.wsdlDoc;
     }
 
-    /*
-     * Fills DocInfo with Document type(WSDL, or schema),
-     * Service Name, Port Type name, targetNamespace for the document.
-     *
-     * Don't follow imports
-     */
-    public static void fillDocInfo(DocInfo docInfo, QName serviceName,
-        QName portTypeName) throws XMLStreamException {
+    private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) {
+        this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
+        this.resolver = resolver;
 
-        RuntimeWSDLParser parser = new RuntimeWSDLParser(null);
-        InputSource source = new InputSource(docInfo.getDoc());
+        this.extensions = new ArrayList<WSDLParserExtension>();
+        this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide);
 
-        XMLStreamReader reader = createReader(source);
+        // register handlers for default extensions
+        register(new MemberSubmissionAddressingWSDLParserExtension());
+        register(new W3CAddressingWSDLParserExtension());
+
+        for (WSDLParserExtension e : extensions)
+            register(e);
+
+        this.extensionFacade =  new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0]));
+    }
+
+    private Parser resolveWSDL(@Nullable URL wsdlLoc, @NotNull Source wsdlSource) throws IOException, SAXException, XMLStreamException {
+        String systemId = wsdlSource.getSystemId();
+
+        XMLEntityResolver.Parser parser = resolver.resolveEntity(null, systemId);
+        if (parser == null && wsdlLoc != null) {
+            parser = resolver.resolveEntity(null, wsdlLoc.toExternalForm());
+
+        }
+        if(parser == null){
+            if(wsdlLoc != null)
+                parser = new Parser(wsdlLoc, createReader(wsdlLoc));
+            else
+                parser = new Parser(wsdlLoc, createReader(wsdlSource));
+        }
+        return parser;
+    }
+
+
+    private XMLStreamReader createReader(@NotNull Source src) throws XMLStreamException {
+        return new TidyXMLStreamReader(SourceReaderFactory.createSourceReader(src, true), null);
+    }
+
+    private void parseImport(@NotNull URL wsdlLoc) throws XMLStreamException, IOException, SAXException {
+        String systemId = wsdlLoc.toExternalForm();
+        XMLEntityResolver.Parser parser = resolver.resolveEntity(null, systemId);
+        if (parser == null) {
+            parser = new Parser(wsdlLoc, createReader(wsdlLoc));
+        }
+        parseWSDL(parser, true);
+    }
+
+    private void parseWSDL(Parser parser, boolean imported) throws XMLStreamException, IOException, SAXException {
+        XMLStreamReader reader = parser.parser;
         try {
-            XMLStreamReaderUtil.nextElementContent(reader);
+            // avoid processing the same WSDL twice.
+            // if no system ID is given, the check won't work
+            if (parser.systemId != null && !importedWSDLs.add(parser.systemId.toExternalForm()))
+                return;
 
-            if(reader.getName().equals(WSDLConstants.QNAME_SCHEMA)){
-                docInfo.setDocType(DOC_TYPE.SCHEMA);
-                String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
-                docInfo.setTargetNamespace(tns);
-                return;
-            }else if (reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
-                docInfo.setDocType(DOC_TYPE.WSDL);
-                String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
-                parser.targetNamespace = tns;
-                docInfo.setTargetNamespace(tns);
-            }else{
-                docInfo.setDocType(DOC_TYPE.OTHER);
-                return;
+            if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
+                XMLStreamReaderUtil.nextElementContent(reader);
+
+            if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
+                if (imported) {
+                    // wsdl:import could be a schema. Relaxing BP R2001 requirement.
+                    LOGGER.warning(WsdlmodelMessages.WSDL_IMPORT_SHOULD_BE_WSDL(parser.systemId));
+                    return;
+                }
             }
 
+            //get the targetNamespace of the service
+            String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
+
+            final String oldTargetNamespace = targetNamespace;
+            targetNamespace = tns;
+
             while (XMLStreamReaderUtil.nextElementContent(reader) !=
                     XMLStreamConstants.END_ELEMENT) {
-                 if(reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
+                if (reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
                     break;
 
                 QName name = reader.getName();
-                if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
-                    String pn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-                    if (portTypeName != null) {
-                        if(portTypeName.getLocalPart().equals(pn) && portTypeName.getNamespaceURI().equals(docInfo.getTargetNamespace())) {
-                            docInfo.setHavingPortType(true);
-                        }
-                    }
-                    XMLStreamReaderUtil.skipElement(reader);
+                if (WSDLConstants.QNAME_IMPORT.equals(name)) {
+                    parseImport(parser.systemId, reader);
+                } else if (WSDLConstants.QNAME_MESSAGE.equals(name)) {
+                    parseMessage(reader);
+                } else if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
+                    parsePortType(reader);
+                } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
+                    parseBinding(reader);
                 } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
-                    String sn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-                    QName sqn = new QName(docInfo.getTargetNamespace(), sn);
-                    if(serviceName.equals(sqn)) {
-                        parser.parseService(reader);
-                        docInfo.setService(parser.wsdlDoc.getService(sqn));
-                        if(reader.getEventType() != XMLStreamConstants.END_ELEMENT)
-                            XMLStreamReaderUtil.next(reader);
-                    } else {
-                        XMLStreamReaderUtil.skipElement(reader);
-                    }
-                } else{
-                    XMLStreamReaderUtil.skipElement(reader);
+                    parseService(reader);
+                } else {
+                    extensionFacade.definitionsElements(reader);
                 }
             }
+            targetNamespace = oldTargetNamespace;
         } finally {
             reader.close();
         }
     }
 
-    private RuntimeWSDLParser(EntityResolver resolver) {
-        this.resolver = resolver;
-    }
-
-    /**
-     * Make sure to return a "fresh" reader each time it is called because
-     * more than one active reader may be needed within a single thread
-     * to parse a WSDL file.
-     */
-    private static XMLStreamReader createReader(InputSource source) {
-        // Char stream available?
-        if (source.getCharacterStream() != null) {
-            Reader reader = source.getCharacterStream();
-            return new TidyXMLStreamReader(XMLStreamReaderFactory.createFreshXMLStreamReader(source.getSystemId(), reader), reader);
-        }
-
-        // Byte stream available?
-        if (source.getByteStream() != null) {
-            InputStream stream = source.getByteStream();
-            return new TidyXMLStreamReader(XMLStreamReaderFactory.createFreshXMLStreamReader(source.getSystemId(), stream), stream);
-        }
-
-        // Otherwise, open URI
-        try {
-            InputStream stream = new URL(source.getSystemId()).openStream();
-            return new TidyXMLStreamReader(XMLStreamReaderFactory.createFreshXMLStreamReader(source.getSystemId(), stream), stream);
-        } catch (IOException e) {
-            throw new WebServiceException(e);
-        }
-    }
-
-    private void parseWSDL(URL wsdlLoc) throws XMLStreamException, IOException, SAXException {
-
-//        String systemId = wsdlLoc.toExternalForm();
-//        InputSource source = resolver.resolveEntity(null,systemId);
-//        if(source==null)
-//            source = new InputSource(systemId);
-
-        InputSource source = resolver.resolveEntity(null,wsdlLoc.toExternalForm());
-        if(source==null)
-            source = new InputSource(wsdlLoc.toExternalForm());  // default resolution
-        else
-            if(source.getSystemId()==null)
-                // ideally entity resolvers should be giving us the system ID for the resource
-                // (or otherwise we won't be able to resolve references within this imported WSDL correctly),
-                // but if none is given, the system ID before the entity resolution is better than nothing.
-                source.setSystemId(wsdlLoc.toExternalForm());
-
-        // avoid processing the same WSDL twice.
-        if(!importedWSDLs.add(source.getSystemId()))
-            return;
-
-
-        XMLStreamReader reader = createReader(source);
-        XMLStreamReaderUtil.nextElementContent(reader);
-
-        //wsdl:definition
-        if (!reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS)) {
-            ParserUtil.failWithFullName("runtime.parser.wsdl.invalidElement", reader);
-        }
-
-        //get the targetNamespace of the service
-        String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
-
-        final String oldTargetNamespace = targetNamespace;
-        targetNamespace = tns;
-
-        while (XMLStreamReaderUtil.nextElementContent(reader) !=
-                XMLStreamConstants.END_ELEMENT) {
-             if(reader.getEventType() == XMLStreamConstants.END_DOCUMENT)
-                break;
-
-            QName name = reader.getName();
-            if (WSDLConstants.QNAME_IMPORT.equals(name)) {
-                parseImport(wsdlLoc, reader);
-            } else if(WSDLConstants.QNAME_MESSAGE.equals(name)){
-                parseMessage(reader);
-            } else if(WSDLConstants.QNAME_PORT_TYPE.equals(name)){
-                parsePortType(reader);
-            } else if (WSDLConstants.QNAME_BINDING.equals(name)) {
-                parseBinding(reader);
-            } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
-                parseService(reader);
-            } else{
-                XMLStreamReaderUtil.skipElement(reader);
-            }
-        }
-        targetNamespace = oldTargetNamespace;
-        reader.close();
-    }
-
     private void parseService(XMLStreamReader reader) {
         String serviceName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-        Service service = new Service(new QName(targetNamespace, serviceName));
+        WSDLServiceImpl service = new WSDLServiceImpl(reader,wsdlDoc,new QName(targetNamespace, serviceName));
+        extensionFacade.serviceAttributes(service, reader);
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(WSDLConstants.QNAME_PORT.equals(name)){
+            if (WSDLConstants.QNAME_PORT.equals(name)) {
                 parsePort(reader, service);
-                if(reader.getEventType() != XMLStreamConstants.END_ELEMENT)
+                if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
                     XMLStreamReaderUtil.next(reader);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+                }
+            } else {
+                extensionFacade.serviceElements(service, reader);
             }
         }
         wsdlDoc.addService(service);
     }
 
-    private static void parsePort(XMLStreamReader reader, Service service) {
+    private void parsePort(XMLStreamReader reader, WSDLServiceImpl service) {
         String portName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
         String binding = ParserUtil.getMandatoryNonEmptyAttribute(reader, "binding");
+
         QName bindingName = ParserUtil.getQName(reader, binding);
-        String location = null;
+        QName portQName = new QName(service.getName().getNamespaceURI(), portName);
+        WSDLPortImpl port = new WSDLPortImpl(reader,service, portQName, bindingName);
+
+        extensionFacade.portAttributes(port, reader);
+
+        String location;
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(SOAPConstants.QNAME_ADDRESS.equals(name)||SOAPConstants.QNAME_SOAP12ADDRESS.equals(name)){
+            if (SOAPConstants.QNAME_ADDRESS.equals(name) || SOAPConstants.QNAME_SOAP12ADDRESS.equals(name)) {
                 location = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_LOCATION);
+                if (location != null) {
+                    try {
+                        port.setAddress(new EndpointAddress(location));
+                    } catch (URISyntaxException e) {
+                        //Lets not throw any exception, latter on it should be thrown when invocation happens. At this
+                        // time user has option to set the endopint address using request contexxt property.
+                    }
+                }
                 XMLStreamReaderUtil.next(reader);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else if (AddressingVersion.W3C.nsUri.equals(name.getNamespaceURI()) &&
+                    "EndpointReference".equals(name.getLocalPart())) {
+                try {
+                    WSEndpointReference wsepr = new WSEndpointReference(reader, AddressingVersion.W3C);
+                    port.setEPR(wsepr);
+                    /** XMLStreamBuffer.createNewBufferFromXMLStreamReader(reader) called from inside WSEndpointReference()
+                     *  consumes the complete EPR infoset and moves to the next element. This breaks the normal wsdl parser
+                     *  processing where it expects anyone reading the infoset to move to the end of the element that its reading
+                     *  and not to the next element.
+                     */
+                    if(reader.getEventType() == XMLStreamConstants.END_ELEMENT && reader.getName().equals(WSDLConstants.QNAME_PORT))
+                        break;
+                } catch (XMLStreamException e) {
+                    throw new WebServiceException(e);
+                }
+            } else {
+
+                extensionFacade.portElements(port, reader);
             }
         }
-        QName portQName = new QName(service.getName().getNamespaceURI(), portName);
-        service.put(portQName, new Port(portQName, bindingName, location));
+        if (port.getAddress() == null) {
+            try {
+                port.setAddress(new EndpointAddress(""));
+            } catch (URISyntaxException e) {
+                //Lets not throw any exception, latter on it should be thrown when invocation happens. At this
+                //time user has option to set the endopint address using request contexxt property.
+            }
+        }
+        service.put(portQName, port);
     }
 
     private void parseBinding(XMLStreamReader reader) {
         String bindingName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
         String portTypeName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "type");
-        if((bindingName == null) || (portTypeName == null)){
+        if ((bindingName == null) || (portTypeName == null)) {
             //TODO: throw exception?
-            //skip wsdl:binding element for now
+            //
+            //  wsdl:binding element for now
             XMLStreamReaderUtil.skipElement(reader);
             return;
         }
-        Binding binding = new Binding(new QName(targetNamespace, bindingName),
+        WSDLBoundPortTypeImpl binding = new WSDLBoundPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, bindingName),
                 ParserUtil.getQName(reader, portTypeName));
-        binding.setWsdlDocument(wsdlDoc);
-        wsdlDoc.addBinding(binding);
+        extensionFacade.bindingAttributes(binding, reader);
 
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
             if (WSDLConstants.NS_SOAP_BINDING.equals(name)) {
-                binding.setBindingId(SOAPBinding.SOAP11HTTP_BINDING);
+                binding.setBindingId(BindingID.SOAP11_HTTP);
+                String style = reader.getAttributeValue(null, "style");
+
+                if ((style != null) && (style.equals("rpc"))) {
+                    binding.setStyle(Style.RPC);
+                } else {
+                    binding.setStyle(Style.DOCUMENT);
+                }
                 XMLStreamReaderUtil.next(reader);
             } else if (WSDLConstants.NS_SOAP12_BINDING.equals(name)) {
-                binding.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
+                binding.setBindingId(BindingID.SOAP12_HTTP);
+                String style = reader.getAttributeValue(null, "style");
+                if ((style != null) && (style.equals("rpc"))) {
+                    binding.setStyle(Style.RPC);
+                } else {
+                    binding.setStyle(Style.DOCUMENT);
+                }
                 XMLStreamReaderUtil.next(reader);
             } else if (WSDLConstants.QNAME_OPERATION.equals(name)) {
                 parseBindingOperation(reader, binding);
-            }else{
-               XMLStreamReaderUtil.skipElement(reader);
+            } else {
+                extensionFacade.bindingElements(binding, reader);
             }
         }
     }
 
-    private static void parseBindingOperation(XMLStreamReader reader, Binding binding) {
+
+    private void parseBindingOperation(XMLStreamReader reader, WSDLBoundPortTypeImpl binding) {
         String bindingOpName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
-        if(bindingOpName == null){
+        if (bindingOpName == null) {
             //TODO: throw exception?
             //skip wsdl:binding element for now
             XMLStreamReaderUtil.skipElement(reader);
             return;
         }
 
-        BindingOperation bindingOp = new BindingOperation(bindingOpName);
-        binding.put(bindingOpName, bindingOp);
+        QName opName = new QName(binding.getPortTypeName().getNamespaceURI(), bindingOpName);
+        WSDLBoundOperationImpl bindingOp = new WSDLBoundOperationImpl(reader,binding, opName);
+        binding.put(opName, bindingOp);
+        extensionFacade.bindingOperationAttributes(bindingOp, reader);
 
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
             if (WSDLConstants.QNAME_INPUT.equals(name)) {
                 parseInputBinding(reader, bindingOp);
-            }else if(WSDLConstants.QNAME_OUTPUT.equals(name)){
+            } else if (WSDLConstants.QNAME_OUTPUT.equals(name)) {
                 parseOutputBinding(reader, bindingOp);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else if (WSDLConstants.QNAME_FAULT.equals(name)) {
+                parseFaultBinding(reader, bindingOp);
+            } else if (SOAPConstants.QNAME_OPERATION.equals(name) ||
+                    SOAPConstants.QNAME_SOAP12OPERATION.equals(name)) {
+                String style = reader.getAttributeValue(null, "style");
+                /**
+                 *  If style attribute is present set it otherwise set the style as defined
+                 *  on the <soap:binding> element
+                 */
+                if (style != null) {
+                    if (style.equals("rpc"))
+                        bindingOp.setStyle(Style.RPC);
+                    else
+                        bindingOp.setStyle(Style.DOCUMENT);
+                } else {
+                    bindingOp.setStyle(binding.getStyle());
+                }
+                String soapAction = reader.getAttributeValue(null, "soapAction");
+
+                if (soapAction != null)
+                    bindingOp.setSoapAction(soapAction);
+
+                XMLStreamReaderUtil.next(reader);
+            } else {
+                extensionFacade.bindingOperationElements(bindingOp, reader);
             }
         }
     }
 
-    private static void parseInputBinding(XMLStreamReader reader, BindingOperation bindingOp) {
+    private void parseInputBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) {
         boolean bodyFound = false;
+        extensionFacade.bindingOperationInputAttributes(bindingOp, reader);
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound){
+            if ((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound) {
                 bodyFound = true;
                 bindingOp.setInputExplicitBodyParts(parseSOAPBodyBinding(reader, bindingOp, BindingMode.INPUT));
                 goToEnd(reader);
-            }else if((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))){
+            } else if ((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))) {
                 parseSOAPHeaderBinding(reader, bindingOp.getInputParts());
-            }else if(MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)){
+            } else if (MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)) {
                 parseMimeMultipartBinding(reader, bindingOp, BindingMode.INPUT);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else {
+                extensionFacade.bindingOperationInputElements(bindingOp, reader);
             }
-
         }
     }
 
-    private static void parseOutputBinding(XMLStreamReader reader, BindingOperation bindingOp) {
+    private void parseOutputBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) {
         boolean bodyFound = false;
+        extensionFacade.bindingOperationOutputAttributes(bindingOp, reader);
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound){
+            if ((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound) {
                 bodyFound = true;
                 bindingOp.setOutputExplicitBodyParts(parseSOAPBodyBinding(reader, bindingOp, BindingMode.OUTPUT));
                 goToEnd(reader);
-            }else if((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))){
+            } else if ((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))) {
                 parseSOAPHeaderBinding(reader, bindingOp.getOutputParts());
-            }else if(MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)){
+            } else if (MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)) {
                 parseMimeMultipartBinding(reader, bindingOp, BindingMode.OUTPUT);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else {
+                extensionFacade.bindingOperationOutputElements(bindingOp, reader);
             }
-
         }
     }
 
-    private static boolean parseSOAPBodyBinding(XMLStreamReader reader, BindingOperation op, BindingMode mode){
+    private void parseFaultBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) {
+        boolean bodyFound = false;
+        extensionFacade.bindingOperationFaultAttributes(bindingOp, reader);
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+            QName name = reader.getName();
+            if ((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound) {
+                bodyFound = true;
+                bindingOp.setFaultExplicitBodyParts(parseSOAPBodyBinding(reader, bindingOp.getFaultParts()));
+                goToEnd(reader);
+            } else if ((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))) {
+                parseSOAPHeaderBinding(reader, bindingOp.getFaultParts());
+            } else if (MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)) {
+                parseMimeMultipartBinding(reader, bindingOp, BindingMode.FAULT);
+            } else {
+                extensionFacade.bindingOperationFaultElements(bindingOp, reader);
+            }
+        }
+    }
+
+    private enum BindingMode {
+        INPUT, OUTPUT, FAULT}
+
+    private static boolean parseSOAPBodyBinding(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) {
         String namespace = reader.getAttributeValue(null, "namespace");
-        if(mode == BindingMode.INPUT){
-            op.reqNamespace = namespace;
+        if (mode == BindingMode.INPUT) {
+            op.setRequestNamespace(namespace);
             return parseSOAPBodyBinding(reader, op.getInputParts());
         }
         //resp
-        op.respNamespace = namespace;
+        op.setResponseNamespace(namespace);
         return parseSOAPBodyBinding(reader, op.getOutputParts());
     }
 
     /**
      * Returns true if body has explicit parts declaration
      */
-    private static boolean parseSOAPBodyBinding(XMLStreamReader reader, Map<String, ParameterBinding> parts){
+    private static boolean parseSOAPBodyBinding(XMLStreamReader reader, Map<String, ParameterBinding> parts) {
         String partsString = reader.getAttributeValue(null, "parts");
-        if(partsString != null){
+        if (partsString != null) {
             List<String> partsList = XmlUtil.parseTokenList(partsString);
-            if(partsList.isEmpty()){
+            if (partsList.isEmpty()) {
                 parts.put(" ", ParameterBinding.BODY);
-            }else{
-                for(String part:partsList){
+            } else {
+                for (String part : partsList) {
                     parts.put(part, ParameterBinding.BODY);
                 }
             }
@@ -384,10 +564,10 @@
         return false;
     }
 
-    private static void parseSOAPHeaderBinding(XMLStreamReader reader, Map<String,ParameterBinding> parts){
+    private static void parseSOAPHeaderBinding(XMLStreamReader reader, Map<String, ParameterBinding> parts) {
         String part = reader.getAttributeValue(null, "part");
         //if(part == null| part.equals("")||message == null || message.equals("")){
-        if(part == null| part.equals("")){
+        if (part == null || part.equals("")) {
             return;
         }
 
@@ -399,93 +579,94 @@
     }
 
 
-    private enum BindingMode {INPUT, OUTPUT};
-
-    private static void parseMimeMultipartBinding(XMLStreamReader reader, BindingOperation op, BindingMode mode){
+    private static void parseMimeMultipartBinding(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) {
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(MIMEConstants.QNAME_PART.equals(name)){
+            if (MIMEConstants.QNAME_PART.equals(name)) {
                 parseMIMEPart(reader, op, mode);
-            }else{
+            } else {
                 XMLStreamReaderUtil.skipElement(reader);
             }
         }
-
     }
 
-    private static void parseMIMEPart(XMLStreamReader reader, BindingOperation op, BindingMode mode) {
+    private static void parseMIMEPart(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) {
         boolean bodyFound = false;
-        Map<String,ParameterBinding> parts = null;
-        Map<String,String> mimeTypes = null;
-        if(mode == BindingMode.INPUT){
+        Map<String, ParameterBinding> parts = null;
+        if (mode == BindingMode.INPUT) {
             parts = op.getInputParts();
-            mimeTypes = op.getInputMimeTypes();
-        }else{
+        } else if (mode == BindingMode.OUTPUT) {
             parts = op.getOutputParts();
-            mimeTypes = op.getOutputMimeTypes();
+        } else if (mode == BindingMode.FAULT) {
+            parts = op.getFaultParts();
         }
-
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(SOAPConstants.QNAME_BODY.equals(name) && !bodyFound){
+            if (SOAPConstants.QNAME_BODY.equals(name) && !bodyFound) {
                 bodyFound = true;
                 parseSOAPBodyBinding(reader, op, mode);
                 XMLStreamReaderUtil.next(reader);
-            }else if(SOAPConstants.QNAME_HEADER.equals(name)){
+            } else if (SOAPConstants.QNAME_HEADER.equals(name)) {
                 bodyFound = true;
                 parseSOAPHeaderBinding(reader, parts);
                 XMLStreamReaderUtil.next(reader);
-            }else if(MIMEConstants.QNAME_CONTENT.equals(name)){
+            } else if (MIMEConstants.QNAME_CONTENT.equals(name)) {
                 String part = reader.getAttributeValue(null, "part");
                 String type = reader.getAttributeValue(null, "type");
-                if((part == null) || (type == null)){
+                if ((part == null) || (type == null)) {
                     XMLStreamReaderUtil.skipElement(reader);
                     continue;
                 }
                 ParameterBinding sb = ParameterBinding.createAttachment(type);
-                parts.put(part, sb);
-                //mimeTypes.put(part, type);
+                if (parts != null && sb != null && part != null)
+                    parts.put(part, sb);
                 XMLStreamReaderUtil.next(reader);
-            }else{
+            } else {
                 XMLStreamReaderUtil.skipElement(reader);
             }
         }
     }
 
-    protected void parseImport(URL baseURL, XMLStreamReader reader) throws IOException, SAXException, XMLStreamException {
+    protected void parseImport(@Nullable URL baseURL, XMLStreamReader reader) throws IOException, SAXException, XMLStreamException {
         // expand to the absolute URL of the imported WSDL.
         String importLocation =
                 ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_LOCATION);
-        URL importURL = new URL(baseURL,importLocation);
-        parseWSDL(importURL);
-        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT){
+        URL importURL;
+        if(baseURL!=null)
+            importURL = new URL(baseURL, importLocation);
+        else // no base URL. this better be absolute
+            importURL = new URL(importLocation);
+        parseImport(importURL);
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             XMLStreamReaderUtil.skipElement(reader);
         }
     }
 
     private void parsePortType(XMLStreamReader reader) {
         String portTypeName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-        if(portTypeName == null){
+        if (portTypeName == null) {
             //TODO: throw exception?
             //skip wsdl:portType element for now
             XMLStreamReaderUtil.skipElement(reader);
             return;
         }
-        PortType portType = new PortType(new QName(targetNamespace, portTypeName));
+        WSDLPortTypeImpl portType = new WSDLPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, portTypeName));
+        extensionFacade.portTypeAttributes(portType, reader);
         wsdlDoc.addPortType(portType);
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(WSDLConstants.QNAME_OPERATION.equals(name)){
+            if (WSDLConstants.QNAME_OPERATION.equals(name)) {
                 parsePortTypeOperation(reader, portType);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else {
+                extensionFacade.portTypeElements(portType, reader);
             }
         }
     }
 
-    private void parsePortTypeOperation(XMLStreamReader reader, PortType portType) {
+
+    private void parsePortTypeOperation(XMLStreamReader reader, WSDLPortTypeImpl portType) {
         String operationName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-        if(operationName == null){
+        if (operationName == null) {
             //TODO: throw exception?
             //skip wsdl:portType element for now
             XMLStreamReaderUtil.skipElement(reader);
@@ -493,69 +674,125 @@
         }
 
         QName operationQName = new QName(portType.getName().getNamespaceURI(), operationName);
-        PortTypeOperation operation = new PortTypeOperation(operationQName);
+        WSDLOperationImpl operation = new WSDLOperationImpl(reader,portType, operationQName);
+        extensionFacade.portTypeOperationAttributes(operation, reader);
         String parameterOrder = ParserUtil.getAttribute(reader, "parameterOrder");
         operation.setParameterOrder(parameterOrder);
         portType.put(operationName, operation);
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
-            if(name.equals(WSDLConstants.QNAME_INPUT)){
+            if (name.equals(WSDLConstants.QNAME_INPUT)) {
                 parsePortTypeOperationInput(reader, operation);
-            }else if(name.equals(WSDLConstants.QNAME_OUTPUT)){
+            } else if (name.equals(WSDLConstants.QNAME_OUTPUT)) {
                 parsePortTypeOperationOutput(reader, operation);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else if (name.equals(WSDLConstants.QNAME_FAULT)) {
+                parsePortTypeOperationFault(reader, operation);
+            } else {
+                extensionFacade.portTypeOperationElements(operation, reader);
             }
         }
     }
 
-    private void parsePortTypeOperationInput(XMLStreamReader reader, PortTypeOperation operation) {
-        String msg = ParserUtil.getAttribute(reader, "message");
+
+    private void parsePortTypeOperationFault(XMLStreamReader reader, WSDLOperationImpl operation) {
+        String msg = ParserUtil.getMandatoryNonEmptyAttribute(reader, "message");
         QName msgName = ParserUtil.getQName(reader, msg);
-        operation.setInputMessage(msgName);
-        goToEnd(reader);
+        String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
+        WSDLFaultImpl fault = new WSDLFaultImpl(reader,name, msgName);
+        operation.addFault(fault);
+        extensionFacade.portTypeOperationFaultAttributes(fault, reader);
+        extensionFacade.portTypeOperationFault(operation, reader);
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+            extensionFacade.portTypeOperationFaultElements(fault, reader);
+        }
     }
 
-    private void parsePortTypeOperationOutput(XMLStreamReader reader, PortTypeOperation operation) {
+    private void parsePortTypeOperationInput(XMLStreamReader reader, WSDLOperationImpl operation) {
+        String msg = ParserUtil.getMandatoryNonEmptyAttribute(reader, "message");
+        QName msgName = ParserUtil.getQName(reader, msg);
+        String name = ParserUtil.getAttribute(reader, "name");
+        WSDLInputImpl input = new WSDLInputImpl(reader, name, msgName, operation);
+        operation.setInput(input);
+        extensionFacade.portTypeOperationInputAttributes(input, reader);
+        extensionFacade.portTypeOperationInput(operation, reader);
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+            extensionFacade.portTypeOperationInputElements(input, reader);
+        }
+    }
+
+    private void parsePortTypeOperationOutput(XMLStreamReader reader, WSDLOperationImpl operation) {
         String msg = ParserUtil.getAttribute(reader, "message");
         QName msgName = ParserUtil.getQName(reader, msg);
-        operation.setOutputMessage(msgName);
-        goToEnd(reader);
+        String name = ParserUtil.getAttribute(reader, "name");
+        WSDLOutputImpl output = new WSDLOutputImpl(reader,name, msgName, operation);
+        operation.setOutput(output);
+        extensionFacade.portTypeOperationOutputAttributes(output, reader);
+        extensionFacade.portTypeOperationOutput(operation, reader);
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+            extensionFacade.portTypeOperationOutputElements(output, reader);
+        }
     }
 
     private void parseMessage(XMLStreamReader reader) {
         String msgName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-        Message msg = new Message(new QName(targetNamespace, msgName));
+        WSDLMessageImpl msg = new WSDLMessageImpl(reader,new QName(targetNamespace, msgName));
+        extensionFacade.messageAttributes(msg, reader);
+        int partIndex = 0;
         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             QName name = reader.getName();
             if (WSDLConstants.QNAME_PART.equals(name)) {
                 String part = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
-//                String desc = null;
-//                int index = reader.getAttributeCount();
-//                for (int i = 0; i < index; i++) {
-//                    if (reader.getAttributeName(i).equals("element") || reader.getAttributeName(i).equals("type")) {
-//                        desc = reader.getAttributeValue(i);
-//                        break;
-//                    }
-//                }
-//                if (desc == null)
-//                    continue;
-                msg.add(part);
-                if(reader.getEventType() != XMLStreamConstants.END_ELEMENT)
+                String desc = null;
+                int index = reader.getAttributeCount();
+                WSDLDescriptorKind kind = WSDLDescriptorKind.ELEMENT;
+                for (int i = 0; i < index; i++) {
+                    QName descName = reader.getAttributeName(i);
+                    if (descName.getLocalPart().equals("element"))
+                        kind = WSDLDescriptorKind.ELEMENT;
+                    else if (descName.getLocalPart().equals("TYPE"))
+                        kind = WSDLDescriptorKind.TYPE;
+
+                    if (descName.getLocalPart().equals("element") || descName.getLocalPart().equals("type")) {
+                        desc = reader.getAttributeValue(i);
+                        break;
+                    }
+                }
+                if (desc == null)
+                    continue;
+
+                WSDLPartImpl wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader,ParserUtil.getQName(reader, desc), kind));
+                msg.add(wsdlPart);
+                if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
                     goToEnd(reader);
-            }else{
-                XMLStreamReaderUtil.skipElement(reader);
+            } else {
+                extensionFacade.messageElements(msg, reader);
             }
         }
         wsdlDoc.addMessage(msg);
-        if(reader.getEventType() != XMLStreamConstants.END_ELEMENT)
+        if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
             goToEnd(reader);
     }
 
-    private static void goToEnd(XMLStreamReader reader){
-        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT){
+    private static void goToEnd(XMLStreamReader reader) {
+        while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
             XMLStreamReaderUtil.skipElement(reader);
         }
     }
 
+    /**
+     * Make sure to return a "fresh" reader each time it is called because
+     * more than one active reader may be needed within a single thread
+     * to parse a WSDL file.
+     */
+    private static XMLStreamReader createReader(URL wsdlLoc) throws IOException, XMLStreamException {
+        InputStream stream = wsdlLoc.openStream();
+        return new TidyXMLStreamReader(XMLStreamReaderFactory.create(wsdlLoc.toExternalForm(), stream, false), stream);
+    }
+
+    private void register(WSDLParserExtension e) {
+        // protect JAX-WS RI from broken parser extension
+        extensions.add(new FoolProofParserExtension(e));
+    }
+
+    private static final Logger LOGGER = Logger.getLogger(RuntimeWSDLParser.class.getName());
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java
index 991ebef..0c192df 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,8 @@
         new QName(NS_WSDL_SOAP, "headerfault");
     public static final QName QNAME_OPERATION =
         new QName(NS_WSDL_SOAP, "operation");
+    public static final QName QNAME_SOAP12OPERATION =
+        new QName(NS_WSDL_SOAP12, "operation");
     public static final QName QNAME_MUSTUNDERSTAND =
         new QName(URI_ENVELOPE, "mustUnderstand");
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Service.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Service.java
deleted file mode 100644
index ba557be..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/Service.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import javax.xml.namespace.QName;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public class Service extends LinkedHashMap<QName, Port> {
-    private QName name;
-
-    public Service(QName name) {
-        super();
-        this.name = name;
-    }
-
-    public QName getName() {
-        return name;
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java
new file mode 100644
index 0000000..e21dfde
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java
@@ -0,0 +1,282 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortTypeImpl;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.resources.AddressingMessages;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.AddressingFeature;
+import java.util.Map;
+
+/**
+ * W3C WS-Addressing Runtime WSDL parser extension
+ *
+ * @author Arun Gupta
+ */
+public class W3CAddressingWSDLParserExtension extends WSDLParserExtension {
+    @Override
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+        return addressibleElement(reader, binding);
+    }
+
+    @Override
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        return addressibleElement(reader, port);
+    }
+
+    private boolean addressibleElement(XMLStreamReader reader, WSDLFeaturedObject binding) {
+        QName ua = reader.getName();
+        if (ua.equals(AddressingVersion.W3C.wsdlExtensionTag)) {
+            String required = reader.getAttributeValue(WSDLConstants.NS_WSDL, "required");
+            binding.addFeature(new AddressingFeature(true, Boolean.parseBoolean(required)));
+            XMLStreamReaderUtil.skipElement(reader);
+            return true;        // UsingAddressing is consumed
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        WSDLBoundOperationImpl impl = (WSDLBoundOperationImpl)operation;
+
+        QName anon = reader.getName();
+        if (anon.equals(AddressingVersion.W3C.wsdlAnonymousTag)) {
+            try {
+                String value = reader.getElementText();
+                if (value == null || value.trim().equals("")) {
+                    throw new WebServiceException("Null values not permitted in wsaw:Anonymous.");
+                    // TODO: throw exception only if wsdl:required=true
+                    // TODO: is this the right exception ?
+                } else if (value.equals("optional")) {
+                    impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.optional);
+                } else if (value.equals("required")) {
+                    impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.required);
+                } else if (value.equals("prohibited")) {
+                    impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.prohibited);
+                } else {
+                    throw new WebServiceException("wsaw:Anonymous value \"" + value + "\" not understood.");
+                    // TODO: throw exception only if wsdl:required=true
+                    // TODO: is this the right exception ?
+                }
+            } catch (XMLStreamException e) {
+                throw new WebServiceException(e);       // TODO: is this the correct behavior ?
+            }
+
+            return true;        // consumed the element
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationInput(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.W3C.wsdlActionTag);
+        if (action != null) {
+            impl.getInput().setAction(action);
+            impl.getInput().setDefaultAction(false);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationOutput(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.W3C.wsdlActionTag);
+        if (action != null) {
+            impl.getOutput().setAction(action);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean portTypeOperationFault(WSDLOperation o, XMLStreamReader reader) {
+        WSDLOperationImpl impl = (WSDLOperationImpl)o;
+
+        String action = ParserUtil.getAttribute(reader, AddressingVersion.W3C.wsdlActionTag);
+        if (action != null) {
+            String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
+            impl.getFaultActionMap().put(name, action);
+        }
+
+        return false;
+    }
+
+    /**
+     * Process wsdl:portType operation after the entire WSDL model has been populated.
+     * The task list includes: <p>
+     * <ul>
+     * <li>Patch the value of UsingAddressing in wsdl:port and wsdl:binding</li>
+     * <li>Populate actions for the messages that do not have an explicit wsaw:Action</li>
+     * <li>Patch the default value of wsaw:Anonymous=optional if none is specified</li>
+     * </ul>
+     * @param context
+     */
+    @Override
+    public void finished(WSDLParserExtensionContext context) {
+        WSDLModel model = context.getWSDLModel();
+        for (WSDLService service : model.getServices().values()) {
+            for (WSDLPort wp : service.getPorts()) {
+                WSDLPortImpl port = (WSDLPortImpl)wp;
+                WSDLBoundPortTypeImpl binding = port.getBinding();
+
+                // populate actions for the messages that do not have an explicit wsaw:Action
+                populateActions(binding);
+
+                // patch the default value of wsaw:Anonymous=optional if none is specified
+                patchAnonymousDefault(binding);
+            }
+        }
+    }
+
+    protected String getNamespaceURI() {
+        return AddressingVersion.W3C.wsdlNsUri;
+    }
+
+    /**
+     * Populate all the Actions
+     *
+     * @param binding soapbinding:operation
+     */
+    private void populateActions(WSDLBoundPortTypeImpl binding) {
+        WSDLPortTypeImpl porttype = binding.getPortType();
+        for (WSDLOperationImpl o : porttype.getOperations()) {
+            // TODO: this may be performance intensive. Alternatively default action
+            // TODO: can be calculated when the operation is actually invoked.
+            WSDLBoundOperationImpl wboi = binding.get(o.getName());
+
+            if (wboi == null) {
+                //If this operation is unbound set the action to default
+                o.getInput().setAction(defaultInputAction(o));
+                continue;
+            }
+                String soapAction = wboi.getSOAPAction();
+            if (o.getInput().getAction() == null || o.getInput().getAction().equals("")) {
+                // explicit wsaw:Action is not specified
+
+                if (soapAction != null && !soapAction.equals("")) {
+                    // if soapAction is non-empty, use that
+                    o.getInput().setAction(soapAction);
+                } else {
+                    // otherwise generate default Action
+                    o.getInput().setAction(defaultInputAction(o));
+                }
+            }
+
+            // skip output and fault processing for one-way methods
+            if (o.getOutput() == null)
+                continue;
+
+            if (o.getOutput().getAction() == null || o.getOutput().getAction().equals("")) {
+                o.getOutput().setAction(defaultOutputAction(o));
+            }
+
+            if (o.getFaults() == null || !o.getFaults().iterator().hasNext())
+                continue;
+
+            Map<String,String> map = o.getFaultActionMap();
+            for (WSDLFault f : o.getFaults()) {
+                if (map.get(f.getName()) == null || map.get(f.getName()).equals(""))
+                    map.put(f.getName(), defaultFaultAction(f.getName(), o));
+            }
+        }
+    }
+
+    /**
+     * Patch the default value of wsaw:Anonymous=optional if none is specified
+     *
+     * @param binding WSDLBoundPortTypeImpl
+     */
+    protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) {
+        for (WSDLBoundOperationImpl wbo : binding.getBindingOperations()) {
+            if (wbo.getAnonymous() == null)
+                wbo.setAnonymous(WSDLBoundOperation.ANONYMOUS.optional);
+        }
+    }
+
+    private String defaultInputAction(WSDLOperation o) {
+        return buildAction(o.getInput().getName(), o, false);
+    }
+
+    private String defaultOutputAction(WSDLOperation o) {
+        return buildAction(o.getOutput().getName(), o, false);
+    }
+
+    private String defaultFaultAction(String name, WSDLOperation o) {
+        return buildAction(name, o, true);
+    }
+
+    protected static final String buildAction(String name, WSDLOperation o, boolean isFault) {
+        String tns = o.getName().getNamespaceURI();
+
+        String delim = SLASH_DELIMITER;
+
+        // TODO: is this the correct way to find the separator ?
+        if (!tns.startsWith("http"))
+            delim = COLON_DELIMITER;
+
+        if (tns.endsWith(delim))
+            tns = tns.substring(0, tns.length()-1);
+
+        if (o.getPortTypeName() == null)
+            throw new WebServiceException("\"" + o.getName() + "\" operation's owning portType name is null.");
+
+        return tns +
+            delim +
+            o.getPortTypeName().getLocalPart() +
+            delim +
+            (isFault ? o.getName().getLocalPart() + delim + "Fault" + delim : "") +
+            name;
+    }
+
+    protected static final String COLON_DELIMITER = ":";
+    protected static final String SLASH_DELIMITER = "/";
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java
index 115f6f3..6e3c06a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLConstants.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
  */
 public interface WSDLConstants {
     // namespace URIs
+    public static final String PREFIX_NS_WSDL = "wsdl";
     public static final String NS_XMLNS = "http://www.w3.org/2001/XMLSchema";
     public static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
     public static final String NS_SOAP11_HTTP_BINDING = "http://schemas.xmlsoap.org/soap/http";
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLDocument.java
deleted file mode 100644
index 612ffe7..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLDocument.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.xml.internal.ws.wsdl.parser;
-
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.Mode;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.soap.SOAPBinding;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class WSDLDocument {
-    protected Map<QName, Message> messages;
-    protected Map<QName, PortType> portTypes;
-    protected Map<QName, Binding> bindings;
-    protected Map<QName, Service> services;
-
-    public WSDLDocument() {
-        messages = new HashMap<QName, Message>();
-        portTypes = new HashMap<QName, PortType>();
-        bindings = new HashMap<QName, Binding>();
-        services = new LinkedHashMap<QName, Service>();
-    }
-
-    public void addMessage(Message msg){
-        messages.put(msg.getName(), msg);
-    }
-
-    public Message getMessage(QName name){
-        return messages.get(name);
-    }
-
-    public void addPortType(PortType pt){
-        portTypes.put(pt.getName(), pt);
-    }
-
-    public PortType getPortType(QName name){
-        return portTypes.get(name);
-    }
-
-    public void addBinding(Binding binding){
-        bindings.put(binding.getName(), binding);
-    }
-
-    public Binding getBinding(QName name){
-        return bindings.get(name);
-    }
-
-    public void addService(Service svc){
-        services.put(svc.getName(), svc);
-    }
-
-    public Service getService(QName name){
-        return services.get(name);
-    }
-
-    public Map<QName, Service> getServices(){
-        return services;
-    }
-
-    /**
-     * Returns the first service QName from insertion order
-     * @return
-     */
-    public QName getFirstServiceName(){
-        if(services.isEmpty())
-            return null;
-        return services.values().iterator().next().getName();
-    }
-
-    /**
-     * Returns first port QName from first service as per the insertion order
-     * @return
-     */
-    public QName getFirstPortName(){
-        if(services.isEmpty())
-            return null;
-        Service service = services.values().iterator().next();
-        Iterator<QName> iter = service.keySet().iterator();
-        QName port = (iter.hasNext())?iter.next():null;
-        return port;
-    }
-
-    private Port getFirstPort(){
-        if(services.isEmpty())
-            return null;
-        Service service = services.values().iterator().next();
-        Collection<Port> coll = service.values();
-        Port port = (coll != null)?((coll.iterator().hasNext())?coll.iterator().next():null):null;
-        return port;
-    }
-
-
-    /**
-     * Returns biningId of the first port
-     * @return
-     */
-    public String getBindingId(){
-        Port port = getFirstPort();
-        if(port == null)
-            return null;
-        Binding binding = bindings.get(port.getBindingName());
-        if(binding == null)
-            return null;
-        return binding.getBindingId();
-    }
-
-    /**
-     * Gives the binding Id of the given service and port
-     * @param service
-     * @param port
-     * @return
-     */
-    public String getBindingId(QName service, QName port){
-        Service s = services.get(service);
-        if(s != null){
-            Port p = s.get(port);
-            if(p != null){
-                Binding b = bindings.get(p.getBindingName());
-                if(b != null)
-                    return b.getBindingId();
-            }
-
-        }
-        return null;
-    }
-
-     /**
-     *
-     * @param serviceName non-null service QName
-     * @param portName    non-null port QName
-     * @return
-     *          BindingOperation on success otherwise null. throws NPE if any of the parameters null
-     */
-    public Binding getBinding(QName serviceName, QName portName){
-        Service service = services.get(serviceName);
-        if(service != null){
-            Port port = service.get(portName);
-            if(port != null){
-                QName bindingName = port.getBindingName();
-                return bindings.get(bindingName);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the bindings for the given bindingId
-     * @param service  non-null service
-     * @param bindingId  non-null binding id
-     * @return
-     */
-    public List<Binding> getBindings(Service service, String bindingId){
-        List<Binding> bs = new ArrayList<Binding>();
-        Collection<Port> ports = service.values();
-        if(ports.isEmpty())
-            return bs;
-        for(Port port:ports){
-            Binding b = bindings.get(port.getName());
-            if(b == null)
-                return bs;
-            if(b.equals(bindingId))
-                bs.add(b);
-        }
-        return bs;
-    }
-
-    public QName getPortName(QName serviceName, QName portType){
-        Service service = services.get(serviceName);
-        for(Port port:service.values()){
-            QName bindingName = port.getBindingName();
-            assert (bindingName != null);
-            Binding binding = bindings.get(bindingName);
-            QName ptName = binding.getPortTypeName();
-            assert (ptName != null);
-            if(ptName.equals(portType))
-                return port.getName();
-        }
-        return null;
-    }
-
-    public void finalizeBinding(Binding binding){
-        assert(binding != null);
-        QName portTypeName = binding.getPortTypeName();
-        if(portTypeName == null)
-            return;
-        PortType pt = portTypes.get(portTypeName);
-        if(pt == null)
-            return;
-        for(String op:binding.keySet()){
-            PortTypeOperation pto = pt.get(op);
-            if(pto == null)
-                return;
-            QName inMsgName = pto.getInputMessage();
-            if(inMsgName == null)
-                continue;
-            Message inMsg = messages.get(inMsgName);
-            BindingOperation bo = binding.get(op);
-            int bodyindex = 0;
-            if(inMsg != null){
-                for(String name:inMsg){
-                    ParameterBinding pb = bo.getInputBinding(name);
-                    if(pb.isBody()){
-                        bo.addPart(new Part(name, pb, bodyindex++), Mode.IN);
-                    }
-                }
-            }
-            bodyindex=0;
-            QName outMsgName = pto.getOutputMessage();
-            if(outMsgName == null)
-                continue;
-            Message outMsg = messages.get(outMsgName);
-            if(outMsg!= null){
-                for(String name:outMsg){
-                    ParameterBinding pb = bo.getOutputBinding(name);
-                    if(pb.isBody()){
-                        bo.addPart(new Part(name, pb, bodyindex++), Mode.OUT);
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java
new file mode 100644
index 0000000..b383999
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+
+/**
+ * Provides implementation of {@link WSDLParserExtensionContext}
+ *
+ * @author Vivek Pandey
+ */
+final class WSDLParserExtensionContextImpl implements WSDLParserExtensionContext {
+    private final boolean isClientSide;
+    private final WSDLModel wsdlModel;
+
+    /**
+     * Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side
+     * or server side.
+     */
+    protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide) {
+        this.wsdlModel = model;
+        this.isClientSide = isClientSide;
+    }
+
+    public boolean isClientSide() {
+        return isClientSide;
+    }
+
+    public WSDLModel getWSDLModel() {
+        return wsdlModel;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java
new file mode 100644
index 0000000..17d58b2
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java
@@ -0,0 +1,347 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.parser;
+
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+import com.sun.xml.internal.ws.api.model.wsdl.*;
+import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.Location;
+
+import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
+
+/**
+ * {@link WSDLParserExtension} that delegates to
+ * multiple {@link WSDLParserExtension}s.
+ *
+ * <p>
+ * This simplifies {@link RuntimeWSDLParser} since it now
+ * only needs to work with one {@link WSDLParserExtension}.
+ *
+ * <p>
+ * This class is guaranteed to return true from
+ * all the extension callback methods.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class WSDLParserExtensionFacade extends WSDLParserExtension {
+    private final WSDLParserExtension[] extensions;
+
+    WSDLParserExtensionFacade(WSDLParserExtension... extensions) {
+        assert extensions!=null;
+        this.extensions = extensions;
+    }
+
+    public void start(WSDLParserExtensionContext context) {
+        for (WSDLParserExtension e : extensions) {
+            e.start(context);
+        }
+    }
+
+    public boolean serviceElements(WSDLService service, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if(e.serviceElements(service,reader))
+                return true;
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void serviceAttributes(WSDLService service, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions)
+            e.serviceAttributes(service,reader);
+    }
+
+    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if(e.portElements(port,reader))
+                return true;
+        }
+        //extension is not understood by any WSDlParserExtension
+        //Check if it must be understood.
+        if(isRequiredExtension(reader)) {
+            ((WSDLPortImpl)port).addNotUnderstoodExtension(reader.getName(),getLocator(reader));
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions)
+            e.portTypeOperationInput(op,reader);
+
+        return false;
+    }
+
+    public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions)
+            e.portTypeOperationOutput(op,reader);
+
+        return false;
+    }
+
+    public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions)
+            e.portTypeOperationFault(op,reader);
+
+        return false;
+    }
+
+    public void portAttributes(WSDLPort port, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions)
+            e.portAttributes(port,reader);
+    }
+
+    public boolean definitionsElements(XMLStreamReader reader){
+        for (WSDLParserExtension e : extensions) {
+            if (e.definitionsElements(reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader){
+        for (WSDLParserExtension e : extensions) {
+            if (e.bindingElements(binding, reader)) {
+                return true;
+            }
+        }
+        //extension is not understood by any WSDlParserExtension
+        //Check if it must be understood.
+        if (isRequiredExtension(reader)) {
+            ((WSDLBoundPortTypeImpl) binding).addNotUnderstoodExtension(
+                    reader.getName(), getLocator(reader));
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader){
+        for (WSDLParserExtension e : extensions) {
+            e.bindingAttributes(binding, reader);
+        }
+    }
+
+    public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.portTypeElements(portType, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.portTypeAttributes(portType, reader);
+        }
+    }
+
+    public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.portTypeOperationElements(operation, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.portTypeOperationAttributes(operation, reader);
+        }
+    }
+
+    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.bindingOperationElements(operation, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.bindingOperationAttributes(operation, reader);
+        }
+    }
+
+    public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.messageElements(msg, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.messageAttributes(msg, reader);
+        }
+    }
+
+    public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.portTypeOperationInputElements(input, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.portTypeOperationInputAttributes(input, reader);
+        }
+    }
+
+    public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.portTypeOperationOutputElements(output, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.portTypeOperationOutputAttributes(output, reader);
+        }
+    }
+
+    public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.portTypeOperationFaultElements(fault, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.portTypeOperationFaultAttributes(fault, reader);
+        }
+    }
+
+    public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.bindingOperationInputElements(operation, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.bindingOperationInputAttributes(operation, reader);
+        }
+    }
+
+    public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.bindingOperationOutputElements(operation, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.bindingOperationOutputAttributes(operation, reader);
+        }
+    }
+
+    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            if (e.bindingOperationFaultElements(operation, reader)) {
+                return true;
+            }
+        }
+        XMLStreamReaderUtil.skipElement(reader);
+        return true;
+    }
+
+    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+        for (WSDLParserExtension e : extensions) {
+            e.bindingOperationFaultAttributes(operation, reader);
+        }
+    }
+
+    public void finished(WSDLParserExtensionContext context) {
+        for (WSDLParserExtension e : extensions) {
+            e.finished(context);
+        }
+    }
+
+    public void postFinished(WSDLParserExtensionContext context) {
+        for (WSDLParserExtension e : extensions) {
+            e.postFinished(context);
+        }
+    }
+    /**
+     *
+     * @param reader
+     * @return If the element has wsdl:required attribute set to true
+     */
+
+    private boolean isRequiredExtension(XMLStreamReader reader) {
+        String required = reader.getAttributeValue(WSDLConstants.NS_WSDL, "required");
+        if(required != null)
+            return Boolean.parseBoolean(required);
+        return false;
+    }
+
+    private Locator getLocator(XMLStreamReader reader) {
+        Location location = reader.getLocation();
+            LocatorImpl loc = new LocatorImpl();
+            loc.setSystemId(location.getSystemId());
+            loc.setLineNumber(location.getLineNumber());
+        return loc;
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java
new file mode 100644
index 0000000..4beba11
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: UsingAddressing.java,v 1.1.2.3 2006/09/26 22:17:15 ramapulavarthi Exp $
+ */
+
+package com.sun.xml.internal.ws.wsdl.writer;
+
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.txw2.annotation.XmlAttribute;
+import com.sun.xml.internal.txw2.annotation.XmlElement;
+import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+import com.sun.xml.internal.ws.wsdl.writer.document.StartWithExtensionsType;
+
+/**
+ * @author Arun Gupta
+ */
+@XmlElement(value = W3CAddressingConstants.WSA_NAMESPACE_WSDL_NAME,
+            ns = W3CAddressingConstants.WSAW_USING_ADDRESSING_NAME)
+public interface UsingAddressing extends TypedXmlWriter, StartWithExtensionsType {
+    @XmlAttribute(value = "required", ns = "http://schemas.xmlsoap.org/wsdl/")
+    public void required(boolean b);
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java
new file mode 100644
index 0000000..3e567f3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * $Id: W3CAddressingWSDLGeneratorExtension.java,v 1.1.2.14 2007/03/15 07:22:13 ramapulavarthi Exp $
+ */
+
+package com.sun.xml.internal.ws.wsdl.writer;
+
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.soap.AddressingFeature;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+import com.sun.xml.internal.ws.api.model.CheckedException;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGenExtnContext;
+
+/**
+ * @author Arun Gupta
+ */
+public class W3CAddressingWSDLGeneratorExtension extends WSDLGeneratorExtension {
+    private boolean enabled;
+    private boolean required = false;
+
+    @Override
+    public void start(WSDLGenExtnContext ctxt) {
+        WSBinding binding = ctxt.getBinding();
+        TypedXmlWriter root = ctxt.getRoot();
+        enabled = binding.isFeatureEnabled(AddressingFeature.class);
+        if (!enabled)
+            return;
+        AddressingFeature ftr = binding.getFeature(AddressingFeature.class);
+        required = ftr.isRequired();
+        root._namespace(AddressingVersion.W3C.wsdlNsUri, AddressingVersion.W3C.getWsdlPrefix());
+    }
+
+    @Override
+    public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
+        if (!enabled)
+            return;
+
+        Action a = method.getSEIMethod().getAnnotation(Action.class);
+        if (a != null && !a.input().equals("")) {
+            addAttribute(input, a.input());
+        }
+    }
+
+    @Override
+    public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+        if (!enabled)
+            return;
+
+        Action a = method.getSEIMethod().getAnnotation(Action.class);
+        if (a != null && !a.output().equals("")) {
+            addAttribute(output, a.output());
+        }
+    }
+
+    @Override
+    public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
+        if (!enabled)
+            return;
+
+        Action a = method.getSEIMethod().getAnnotation(Action.class);
+        Class[] exs = method.getSEIMethod().getExceptionTypes();
+
+        if (exs == null)
+            return;
+
+        if (a != null && a.fault() != null) {
+            for (FaultAction fa : a.fault()) {
+                if (fa.className().getName().equals(ce.getExceptionClass().getName())) {
+                    if (fa.value().equals(""))
+                        return;
+
+                    addAttribute(fault, fa.value());
+                    return;
+                }
+            }
+        }
+    }
+
+    private void addAttribute(TypedXmlWriter writer, String attrValue) {
+        writer._attribute(AddressingVersion.W3C.wsdlActionTag, attrValue);
+    }
+
+    @Override
+    public void addBindingExtension(TypedXmlWriter binding) {
+        if (!enabled)
+            return;
+        UsingAddressing ua = binding._element(AddressingVersion.W3C.wsdlExtensionTag, UsingAddressing.class);
+        /*
+        Do not generate wsdl:required=true
+        if(required) {
+            ua.required(true);
+        }
+        */
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
index 045d085..7e085a0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,25 +25,29 @@
 package com.sun.xml.internal.ws.wsdl.writer;
 
 
-import com.sun.xml.internal.ws.pept.presentation.MessageStruct;
 import com.sun.xml.internal.bind.api.JAXBRIContext;
 import static com.sun.xml.internal.bind.v2.schemagen.Util.*;
 import com.sun.xml.internal.txw2.TXW;
 import com.sun.xml.internal.txw2.TypedXmlWriter;
 import com.sun.xml.internal.txw2.output.ResultFactory;
 import com.sun.xml.internal.txw2.output.XmlSerializer;
-import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
+import com.sun.xml.internal.ws.api.SOAPVersion;
+import com.sun.xml.internal.ws.api.WSBinding;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.model.MEP;
+import com.sun.xml.internal.ws.api.model.ParameterBinding;
+import com.sun.xml.internal.ws.api.model.SEIModel;
+import com.sun.xml.internal.ws.api.model.soap.SOAPBinding;
+import com.sun.xml.internal.ws.api.server.Container;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGenExtnContext;
 import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
-import com.sun.xml.internal.ws.model.CheckedException;
-import com.sun.xml.internal.ws.model.JavaMethod;
-import com.sun.xml.internal.ws.model.Parameter;
-import com.sun.xml.internal.ws.model.ParameterBinding;
-import com.sun.xml.internal.ws.model.RuntimeModel;
+import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
+import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+import com.sun.xml.internal.ws.model.JavaMethodImpl;
+import com.sun.xml.internal.ws.model.ParameterImpl;
 import com.sun.xml.internal.ws.model.WrapperParameter;
-import com.sun.xml.internal.ws.model.soap.SOAPBinding;
-import com.sun.xml.internal.ws.model.soap.Style;
-import com.sun.xml.internal.ws.model.soap.Use;
 import com.sun.xml.internal.ws.wsdl.parser.SOAPConstants;
 import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
 import com.sun.xml.internal.ws.wsdl.writer.document.Binding;
@@ -64,7 +68,10 @@
 import com.sun.xml.internal.ws.wsdl.writer.document.soap.Header;
 import com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPAddress;
 import com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPFault;
+import com.sun.xml.internal.ws.util.RuntimeVersion;
 
+import javax.jws.soap.SOAPBinding.Style;
+import javax.jws.soap.SOAPBinding.Use;
 import javax.xml.bind.SchemaOutputResolver;
 import javax.xml.namespace.QName;
 import javax.xml.transform.Result;
@@ -81,62 +88,153 @@
 
 
 /**
- * Class used to generate WSDLs from a <code>RunTimeModel</code>
+ * Class used to generate WSDLs from a {@link SEIModel}.
  *
  * @author WS Development Team
  */
 public class WSDLGenerator {
     private JAXWSOutputSchemaResolver resolver;
-    private WSDLOutputResolver wsdlResolver = null;
-    private RuntimeModel model;
+    private WSDLResolver wsdlResolver = null;
+    private AbstractSEIModelImpl model;
     private Definitions serviceDefinitions;
     private Definitions portDefinitions;
     private Types types;
-    public static final String DOT_WSDL         = ".wsdl";
-    public static final String RESPONSE         = "Response";
-    public static final String PARAMETERS       = "parameters";
-    public static final String RESULT           = "parameters";
-    public static final String UNWRAPPABLE_RESULT  = "result";
-    public static final String WSDL_NAMESPACE   = WSDLConstants.NS_WSDL;
-    public static final String WSDL_PREFIX      = "wsdl";
-    public static final String XSD_NAMESPACE    = SOAPNamespaceConstants.XSD;
-    public static final String XSD_PREFIX       = "xsd";
-    public static final String SOAP11_NAMESPACE = SOAPConstants.NS_WSDL_SOAP;
-    public static final String SOAP12_NAMESPACE = SOAPConstants.NS_WSDL_SOAP12;
-    public static final String SOAP_PREFIX      = "soap";
-    public static final String SOAP12_PREFIX    = "soap12";
-    public static final String TNS_PREFIX       = "tns";
-    public static final String BINDING          = "Binding";
-    public static final String SOAP_HTTP_TRANSPORT = SOAPNamespaceConstants.TRANSPORT_HTTP;
-    public static final String SOAP12_HTTP_TRANSPORT = SOAP12NamespaceConstants.TRANSPORT_HTTP;
-    public static final String DOCUMENT         = "document";
-    public static final String RPC              = "rpc";
-    public static final String LITERAL          = "literal";
-    public static final String REPLACE_WITH_ACTUAL_URL = "REPLACE_WITH_ACTUAL_URL";
+    /**
+     * Constant String for ".wsdl"
+     */
+    private static final String DOT_WSDL         = ".wsdl";
+    /**
+     * Constant String appended to response message names
+     */
+    private static final String RESPONSE         = "Response";
+    /**
+     * constant String used for part name for wrapped request messages
+     */
+    private static final String PARAMETERS       = "parameters";
+    /**
+     * the part name for unwrappable response messages
+     */
+    private static final String RESULT           = "parameters";
+    /**
+     * the part name for response messages that are not unwrappable
+     */
+    private static final String UNWRAPPABLE_RESULT  = "result";
+    /**
+     * The WSDL namespace
+     */
+    private static final String WSDL_NAMESPACE   = WSDLConstants.NS_WSDL;
+
+    /**
+     * the XSD namespace
+     */
+    private static final String XSD_NAMESPACE    = SOAPNamespaceConstants.XSD;
+    /**
+     * the namespace prefix to use for the XSD namespace
+     */
+    private static final String XSD_PREFIX       = "xsd";
+    /**
+     * The SOAP 1.1 namespace
+     */
+    private static final String SOAP11_NAMESPACE = SOAPConstants.NS_WSDL_SOAP;
+    /**
+     * The SOAP 1.2 namespace
+     */
+    private static final String SOAP12_NAMESPACE = SOAPConstants.NS_WSDL_SOAP12;
+    /**
+     * The namespace prefix to use for the SOAP 1.1 namespace
+     */
+    private static final String SOAP_PREFIX      = "soap";
+    /**
+     * The namespace prefix to use for the SOAP 1.2 namespace
+     */
+    private static final String SOAP12_PREFIX    = "soap12";
+    /**
+     * The namespace prefix to use for the targetNamespace
+     */
+    private static final String TNS_PREFIX       = "tns";
+    /**
+     * The URI for the SOAP 1.1 HTTP Transport.  Used to create soapBindings
+     */
+    private static final String SOAP_HTTP_TRANSPORT = SOAPNamespaceConstants.TRANSPORT_HTTP;
+    /**
+     * The URI for the SOAP 1.2 HTTP Transport.  Used to create soapBindings
+     */
+    private static final String SOAP12_HTTP_TRANSPORT = SOAP12NamespaceConstants.TRANSPORT_HTTP;
+    /**
+     * Constant String "document" used to specify <code>document</code> style
+     * soapBindings
+     */
+    private static final String DOCUMENT         = "document";
+    /**
+     * Constant String "rpc" used to specify <code>rpc</code> style
+     * soapBindings
+     */
+    private static final String RPC              = "rpc";
+    /**
+     * Constant String "literal" used to create <code>literal</code> use binddings
+     */
+    private static final String LITERAL          = "literal";
+    /**
+     * Constant String to flag the URL to replace at runtime for the endpoint
+     */
+    private static final String REPLACE_WITH_ACTUAL_URL = "REPLACE_WITH_ACTUAL_URL";
     private Set<QName> processedExceptions = new HashSet<QName>();
-    private String bindingId;
+    private WSBinding binding;
     private String wsdlLocation;
     private String portWSDLID;
     private String schemaPrefix;
+    private WSDLGeneratorExtension extension;
+    List<WSDLGeneratorExtension> extensionHandlers;
 
+    private String endpointAddress = REPLACE_WITH_ACTUAL_URL;
+    private Container container;
+    private final Class implType;
 
-    public WSDLGenerator(RuntimeModel model, WSDLOutputResolver wsdlResolver, String bindingId) {
+    /**
+     * Creates the WSDLGenerator
+     * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
+     * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
+     * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
+     * @param extensions an array {@link WSDLGeneratorExtension} that will
+     * be invoked to generate WSDL extensions
+     */
+    public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
+                         Class implType, WSDLGeneratorExtension... extensions) {
         this.model = model;
         resolver = new JAXWSOutputSchemaResolver();
         this.wsdlResolver = wsdlResolver;
-        this.bindingId = bindingId;
+        this.binding = binding;
+        this.container = container;
+        this.implType = implType;
+        extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
+
+        // register handlers for default extensions
+        register(new W3CAddressingWSDLGeneratorExtension());
+
+        for (WSDLGeneratorExtension w : extensions)
+            register(w);
+
+        this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
     }
 
+    /**
+     * Sets the endpoint address string to be written.
+     * Defaults to {@link #REPLACE_WITH_ACTUAL_URL}.
+     */
+    public void setEndpointAddress(String address) {
+        this.endpointAddress = address;
+    }
+
+    /**
+     * Performes the actual WSDL generation
+     */
     public void doGeneration() {
         XmlSerializer serviceWriter;
         XmlSerializer portWriter = null;
         String fileName = JAXBRIContext.mangleNameToClassName(model.getServiceQName().getLocalPart());
-//        System.out.println("concrete name: "+ fileName);
-        Result result = wsdlResolver.getWSDLOutput(fileName+DOT_WSDL);
-        if (result == null)
-            return;
+        Result result = wsdlResolver.getWSDL(fileName+DOT_WSDL);
         wsdlLocation = result.getSystemId();
-        serviceWriter = ResultFactory.createSerializer(result);
+        serviceWriter = new CommentFilter(ResultFactory.createSerializer(result));
         if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) {
             portWriter = serviceWriter;
             schemaPrefix = fileName+"_";
@@ -144,20 +242,16 @@
             String wsdlName = JAXBRIContext.mangleNameToClassName(model.getPortTypeName().getLocalPart());
             if (wsdlName.equals(fileName))
                 wsdlName += "PortType";
-//            System.out.println("abstract name: "+ wsdlName);
             Holder<String> absWSDLName = new Holder<String>();
             absWSDLName.value = wsdlName+DOT_WSDL;
-//            System.out.println("absWSDLName.value: "+ absWSDLName.value);
-            result = wsdlResolver.getAbstractWSDLOutput(absWSDLName);
-//            System.out.println("absWSDLName.value: "+ absWSDLName.value);
-//             schemaPrefix = model.getJAXBContext().mangleNameToClassName(portWSDLID)+"_";
+            result = wsdlResolver.getAbstractWSDL(absWSDLName);
 
             if (result != null) {
                 portWSDLID = result.getSystemId();
                 if (portWSDLID.equals(wsdlLocation)) {
                     portWriter = serviceWriter;
                 } else {
-                    portWriter = ResultFactory.createSerializer(result);
+                    portWriter = new CommentFilter(ResultFactory.createSerializer(result));
                 }
             } else {
                 portWSDLID = absWSDLName.value;
@@ -167,24 +261,85 @@
             if (idx > 0)
                 schemaPrefix = schemaPrefix.substring(0, idx);
             schemaPrefix = JAXBRIContext.mangleNameToClassName(schemaPrefix)+"_";
-//            System.out.println("portWSDLID: "+ portWSDLID);
-//            schemaPrefix = model.getJAXBContext().mangleNameToClassName(portWSDLID)+"_";
-//            System.out.println("schemaPrefix: "+ schemaPrefix);
         }
         generateDocument(serviceWriter, portWriter);
     }
 
+    /**
+     * Writing directly to XmlSerializer is a problem, since it doesn't suppress
+     * xml declaration. Creating filter so that comment is written before TXW writes
+     * anything in the WSDL.
+     */
+    private static class CommentFilter implements XmlSerializer {
+        final XmlSerializer serializer;
+        private static final String VERSION_COMMENT =
+            " Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is "+RuntimeVersion.VERSION+". ";
+
+        CommentFilter(XmlSerializer serializer) {
+            this.serializer = serializer;
+        }
+
+        public void startDocument() {
+            serializer.startDocument();
+            comment(new StringBuilder(VERSION_COMMENT));
+            text(new StringBuilder("\n"));
+        }
+
+        public void beginStartTag(String uri, String localName, String prefix) {
+            serializer.beginStartTag(uri, localName, prefix);
+        }
+
+        public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
+            serializer.writeAttribute(uri, localName, prefix, value);
+        }
+
+        public void writeXmlns(String prefix, String uri) {
+            serializer.writeXmlns(prefix, uri);
+        }
+
+        public void endStartTag(String uri, String localName, String prefix) {
+            serializer.endStartTag(uri, localName, prefix);
+        }
+
+        public void endTag() {
+            serializer.endTag();
+        }
+
+        public void text(StringBuilder text) {
+            serializer.text(text);
+        }
+
+        public void cdata(StringBuilder text) {
+            serializer.cdata(text);
+        }
+
+        public void comment(StringBuilder comment) {
+            serializer.comment(comment);
+        }
+
+        public void endDocument() {
+            serializer.endDocument();
+        }
+
+        public void flush() {
+            serializer.flush();
+        }
+
+    }
+
     private void generateDocument(XmlSerializer serviceStream, XmlSerializer portStream) {
         serviceDefinitions = TXW.create(Definitions.class, serviceStream);
         serviceDefinitions._namespace(WSDL_NAMESPACE, "");//WSDL_PREFIX);
         serviceDefinitions._namespace(XSD_NAMESPACE, XSD_PREFIX);
         serviceDefinitions.targetNamespace(model.getServiceQName().getNamespaceURI());
         serviceDefinitions._namespace(model.getServiceQName().getNamespaceURI(), TNS_PREFIX);
-        if(bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING))
+        if(binding.getSOAPVersion()== SOAPVersion.SOAP_12)
             serviceDefinitions._namespace(SOAP12_NAMESPACE, SOAP12_PREFIX);
         else
             serviceDefinitions._namespace(SOAP11_NAMESPACE, SOAP_PREFIX);
         serviceDefinitions.name(model.getServiceQName().getLocalPart());
+        WSDLGenExtnContext serviceCtx = new WSDLGenExtnContext(serviceDefinitions, model, binding, container, implType);
+        extension.start(serviceCtx);
         if (serviceStream != portStream && portStream != null) {
             // generate an abstract and concrete wsdl
             portDefinitions = TXW.create(Definitions.class, portStream);
@@ -207,6 +362,7 @@
             Import _import = serviceDefinitions._import().namespace(model.getTargetNamespace());
             _import.location(schemaLoc);
         }
+        extension.addDefinitionsExtension(serviceDefinitions);
 
         if (portDefinitions != null) {
             generateTypes();
@@ -215,13 +371,17 @@
         }
         generateBinding();
         generateService();
+        //Give a chance to WSDLGeneratorExtensions to write stuff before closing </wsdl:defintions>
+        extension.end(serviceCtx);
         serviceDefinitions.commit();
         if (portDefinitions != null && portDefinitions != serviceDefinitions)
             portDefinitions.commit();
     }
 
 
-
+    /**
+     * Generates the types section of the WSDL
+     */
     protected void generateTypes() {
         types = portDefinitions.types();
         if (model.getJAXBContext() != null) {
@@ -235,20 +395,29 @@
         }
     }
 
+    /**
+     * Generates the WSDL messages
+     */
     protected void generateMessages() {
-        for (JavaMethod method : model.getJavaMethods()) {
-            if (method.getBinding() instanceof SOAPBinding)
-                generateSOAPMessages(method, (SOAPBinding)method.getBinding());
+        for (JavaMethodImpl method : model.getJavaMethods()) {
+            generateSOAPMessages(method, method.getBinding());
         }
     }
 
-    protected void generateSOAPMessages(JavaMethod method, SOAPBinding binding) {
+   /**
+     * Generates messages for a SOAPBinding
+     * @param method The {@link JavaMethod} to generate messages for
+     * @param binding The {@link com.sun.xml.internal.ws.api.model.soap.SOAPBinding} to add the generated messages to
+     */
+    protected void generateSOAPMessages(JavaMethodImpl method, com.sun.xml.internal.ws.api.model.soap.SOAPBinding binding) {
         boolean isDoclit = binding.isDocLit();
-        Message message = portDefinitions.message().name(method.getOperationName());
+//        Message message = portDefinitions.message().name(method.getOperation().getName().getLocalPart());
+        Message message = portDefinitions.message().name(method.getRequestMessageName());
+        extension.addInputMessageExtension(message, method);
         com.sun.xml.internal.ws.wsdl.writer.document.Part part;
         JAXBRIContext jaxbContext = model.getJAXBContext();
         boolean unwrappable = true;
-        for (Parameter param : method.getRequestParameters()) {
+        for (ParameterImpl param : method.getRequestParameters()) {
             if (isDoclit) {
                 if (isHeaderParameter(param))
                     unwrappable = false;
@@ -261,9 +430,9 @@
                 }
             } else {
                 if (param.isWrapperStyle()) {
-                    for (Parameter childParam : ((WrapperParameter)param).getWrapperChildren()) {
+                    for (ParameterImpl childParam : ((WrapperParameter)param).getWrapperChildren()) {
                         part = message.part().name(childParam.getPartName());
-                        part.type(jaxbContext.getTypeName(childParam.getTypeReference()));
+                        part.type(jaxbContext.getTypeName(childParam.getBridge().getTypeReference()));
                     }
                 } else {
                     part = message.part().name(param.getPartName());
@@ -271,16 +440,18 @@
                 }
             }
         }
-        if (method.getMEP() != MessageStruct.ONE_WAY_MEP) {
-            message = portDefinitions.message().name(method.getOperationName()+RESPONSE);
+        if (method.getMEP() != MEP.ONE_WAY) {
+//            message = portDefinitions.message().name(method.getOperation().getName().getLocalPart()+RESPONSE);
+            message = portDefinitions.message().name(method.getResponseMessageName());
+            extension.addOutputMessageExtension(message, method);
             if (unwrappable) {
-                for (Parameter param : method.getResponseParameters()) {
+                for (ParameterImpl param : method.getResponseParameters()) {
                    if (isHeaderParameter(param))
                        unwrappable = false;
                 }
             }
 
-            for (Parameter param : method.getResponseParameters()) {
+            for (ParameterImpl param : method.getResponseParameters()) {
                 if (isDoclit) {
                     if (param.isWrapperStyle()) {
                         // if its not really wrapper style dont use the same name as input message
@@ -295,9 +466,9 @@
                     }
                 } else {
                     if (param.isWrapperStyle()) {
-                        for (Parameter childParam : ((WrapperParameter)param).getWrapperChildren()) {
+                        for (ParameterImpl childParam : ((WrapperParameter)param).getWrapperChildren()) {
                             part = message.part().name(childParam.getPartName());
-                            part.type(jaxbContext.getTypeName(childParam.getTypeReference()));
+                            part.type(jaxbContext.getTypeName(childParam.getBridge().getTypeReference()));
                         }
                     } else {
                         part = message.part().name(param.getPartName());
@@ -306,70 +477,81 @@
                 }
             }
         }
-        for (CheckedException exception : method.getCheckedExceptions()) {
+        for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
             QName tagName = exception.getDetailType().tagName;
-//            if (processedExceptions.contains(tagName))
-//                continue;
-//            message = portDefinitions.message().name(tagName.getLocalPart());
             String messageName = exception.getMessageName();
             QName messageQName = new QName(model.getTargetNamespace(), messageName);
             if (processedExceptions.contains(messageQName))
                 continue;
             message = portDefinitions.message().name(messageName);
 
+            extension.addFaultMessageExtension(message, method, exception);
             part = message.part().name("fault");//tagName.getLocalPart());
             part.element(tagName);
-//            processedExceptions.add(tagName);
             processedExceptions.add(messageQName);
         }
     }
 
+    /**
+     * Generates the WSDL portType
+     */
     protected void generatePortType() {
 
         PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart());
-        for (JavaMethod method : model.getJavaMethods()) {
+        extension.addPortTypeExtension(portType);
+        for (JavaMethodImpl method : model.getJavaMethods()) {
+//            Operation operation = portType.operation().name(method.getOperation().getLocalName());
             Operation operation = portType.operation().name(method.getOperationName());
             generateParameterOrder(operation, method);
             switch (method.getMEP()) {
-                case MessageStruct.REQUEST_RESPONSE_MEP:
+                case REQUEST_RESPONSE:
                     // input message
                     generateInputMessage(operation, method);
                     // output message
                     generateOutputMessage(operation, method);
                     break;
-                case MessageStruct.ONE_WAY_MEP:
+                case ONE_WAY:
                     generateInputMessage(operation, method);
                     break;
             }
             // faults
-            for (CheckedException exception : method.getCheckedExceptions()) {
-                QName tagName = exception.getDetailType().tagName;
-//                QName messageName = new QName(model.getTargetNamespace(), tagName.getLocalPart());
-//                FaultType paramType = operation.fault().name(tagName.getLocalPart()).message(messageName);
+            for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
                 QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName());
-                FaultType paramType = operation.fault().name(exception.getMessageName()).message(messageName);
+                FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName());
+                extension.addOperationFaultExtension(paramType, method, exception);
             }
         }
     }
 
-    protected boolean isWrapperStyle(JavaMethod method) {
+    /**
+     * Determines if the <CODE>method</CODE> is wrapper style
+     * @param method The {@link JavaMethod} to check if it is wrapper style
+     * @return true if the method is wrapper style, otherwise, false.
+     */
+    protected boolean isWrapperStyle(JavaMethodImpl method) {
         if (method.getRequestParameters().size() > 0) {
-            Parameter param = method.getRequestParameters().iterator().next();
+            ParameterImpl param = method.getRequestParameters().iterator().next();
             return param.isWrapperStyle();
         }
         return false;
     }
 
-    protected boolean isRpcLit(JavaMethod method) {
-        if (method.getBinding() instanceof SOAPBinding) {
-            if (((SOAPBinding)method.getBinding()).getStyle().equals(Style.RPC))
-                return true;
-        }
-        return false;
+    /**
+     * Determines if a {@link JavaMethod} is rpc/literal
+     * @param method The method to check
+     * @return true if method is rpc/literal, otherwise, false
+     */
+    protected boolean isRpcLit(JavaMethodImpl method) {
+        return method.getBinding().getStyle() == Style.RPC;
     }
 
-    protected void generateParameterOrder(Operation operation, JavaMethod method) {
-        if (method.getMEP() == MessageStruct.ONE_WAY_MEP)
+    /**
+     * Generates the parameterOrder for a PortType operation
+     * @param operation The operation to generate the parameterOrder for
+     * @param method The {@link JavaMethod} to generate the parameterOrder from
+     */
+    protected void generateParameterOrder(Operation operation, JavaMethodImpl method) {
+        if (method.getMEP() == MEP.ONE_WAY)
             return;
         if (isRpcLit(method))
             generateRpcParameterOrder(operation, method);
@@ -377,13 +559,18 @@
             generateDocumentParameterOrder(operation, method);
     }
 
-    protected void generateRpcParameterOrder(Operation operation, JavaMethod method) {
+    /**
+     * Generates the parameterOrder for a PortType operation
+     * @param operation the operation to generate the parameterOrder for
+     * @param method the {@link JavaMethod} to generate the parameterOrder from
+     */
+    protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method) {
         String partName;
         StringBuffer paramOrder = new StringBuffer();
         Set<String> partNames = new HashSet<String>();
-        List<Parameter> sortedParams = sortMethodParameters(method);
+        List<ParameterImpl> sortedParams = sortMethodParameters(method);
         int i = 0;
-        for (Parameter parameter : sortedParams) {
+        for (ParameterImpl parameter : sortedParams) {
             if (parameter.getIndex() >= 0) {
                partName = parameter.getPartName();
                 if (!partNames.contains(partName)) {
@@ -398,14 +585,19 @@
     }
 
 
-    protected void generateDocumentParameterOrder(Operation operation, JavaMethod method) {
+    /**
+     * Generates the parameterOrder for a PortType operation
+     * @param operation the operation to generate the parameterOrder for
+     * @param method the {@link JavaMethod} to generate the parameterOrder from
+     */
+    protected void generateDocumentParameterOrder(Operation operation, JavaMethodImpl method) {
         String partName;
         StringBuffer paramOrder = new StringBuffer();
         Set<String> partNames = new HashSet<String>();
-        List<Parameter> sortedParams = sortMethodParameters(method);
+        List<ParameterImpl> sortedParams = sortMethodParameters(method);
         boolean isWrapperStyle = isWrapperStyle(method);
         int i = 0;
-        for (Parameter parameter : sortedParams) {
+        for (ParameterImpl parameter : sortedParams) {
 //            System.out.println("param: "+parameter.getIndex()+" name: "+parameter.getName().getLocalPart());
             if (parameter.getIndex() < 0)
                 continue;
@@ -432,18 +624,23 @@
         }
     }
 
-    protected List<Parameter> sortMethodParameters(JavaMethod method) {
-        Set<Parameter> paramSet = new HashSet<Parameter>();
-        List<Parameter> sortedParams = new ArrayList<Parameter>();
+    /**
+     * Sorts the parameters for the method by their position
+     * @param method the {@link JavaMethod} used to sort the parameters
+     * @return the sorted {@link List} of parameters
+     */
+    protected List<ParameterImpl> sortMethodParameters(JavaMethodImpl method) {
+        Set<ParameterImpl> paramSet = new HashSet<ParameterImpl>();
+        List<ParameterImpl> sortedParams = new ArrayList<ParameterImpl>();
         if (isRpcLit(method)) {
-            for (Parameter param : method.getRequestParameters()) {
+            for (ParameterImpl param : method.getRequestParameters()) {
                 if (param instanceof WrapperParameter) {
                     paramSet.addAll(((WrapperParameter)param).getWrapperChildren());
                 } else {
                     paramSet.add(param);
                 }
             }
-            for (Parameter param : method.getResponseParameters()) {
+            for (ParameterImpl param : method.getResponseParameters()) {
                 if (param instanceof WrapperParameter) {
                     paramSet.addAll(((WrapperParameter)param).getWrapperChildren());
                 } else {
@@ -454,12 +651,12 @@
             paramSet.addAll(method.getRequestParameters());
             paramSet.addAll(method.getResponseParameters());
         }
-        Iterator<Parameter>params = paramSet.iterator();
+        Iterator<ParameterImpl>params = paramSet.iterator();
         if (paramSet.size() == 0)
             return sortedParams;
-        Parameter param = params.next();
+        ParameterImpl param = params.next();
         sortedParams.add(param);
-        Parameter sortedParam;
+        ParameterImpl sortedParam;
         int pos;
         for (int i=1; i<paramSet.size();i++) {
             param = params.next();
@@ -477,260 +674,266 @@
         return sortedParams;
     }
 
-    protected boolean isBodyParameter(Parameter parameter) {
+    /**
+     * Determines if a parameter is associated with the message Body
+     * @param parameter the parameter to check
+     * @return true if the parameter is a <code>body</code> parameter
+     */
+    protected boolean isBodyParameter(ParameterImpl parameter) {
         ParameterBinding paramBinding = parameter.getBinding();
         return paramBinding.isBody();
     }
 
-    protected boolean isHeaderParameter(Parameter parameter) {
+    protected boolean isHeaderParameter(ParameterImpl parameter) {
         ParameterBinding paramBinding = parameter.getBinding();
         return paramBinding.isHeader();
     }
 
-    protected boolean isAttachmentParameter(Parameter parameter) {
+    protected boolean isAttachmentParameter(ParameterImpl parameter) {
         ParameterBinding paramBinding = parameter.getBinding();
         return paramBinding.isAttachment();
     }
 
 
+    /**
+     * Generates the Binding section of the WSDL
+     */
     protected void generateBinding() {
-        Binding binding = serviceDefinitions.binding().name(model.getPortName().getLocalPart()+BINDING);
+        Binding binding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart());
+        extension.addBindingExtension(binding);
         binding.type(model.getPortTypeName());
         boolean first = true;
-        for (JavaMethod method : model.getJavaMethods()) {
+        for (JavaMethodImpl method : model.getJavaMethods()) {
             if (first) {
-                if (method.getBinding() instanceof SOAPBinding) {
-                    SOAPBinding sBinding = (SOAPBinding)method.getBinding();
-                    SOAPVersion soapVersion = sBinding.getSOAPVersion();
-
-                    if(soapVersion.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)){
-                        com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = binding.soap12Binding();
-                        soapBinding.transport(SOAP12_HTTP_TRANSPORT);
-                        if (sBinding.getStyle().equals(Style.DOCUMENT))
-                            soapBinding.style(DOCUMENT);
-                        else
-                            soapBinding.style(RPC);
-                    }else{
-                        com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = binding.soapBinding();
-                        soapBinding.transport(SOAP_HTTP_TRANSPORT);
-                        if (sBinding.getStyle().equals(Style.DOCUMENT))
-                            soapBinding.style(DOCUMENT);
-                        else
-                            soapBinding.style(RPC);
-                    }
+                SOAPBinding sBinding = method.getBinding();
+                SOAPVersion soapVersion = sBinding.getSOAPVersion();
+                if (soapVersion == SOAPVersion.SOAP_12){
+                    com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = binding.soap12Binding();
+                    soapBinding.transport(SOAP12_HTTP_TRANSPORT);
+                    if (sBinding.getStyle().equals(Style.DOCUMENT))
+                        soapBinding.style(DOCUMENT);
+                    else
+                        soapBinding.style(RPC);
+                } else {
+                com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = binding.soapBinding();
+                    soapBinding.transport(SOAP_HTTP_TRANSPORT);
+                    if (sBinding.getStyle().equals(Style.DOCUMENT))
+                        soapBinding.style(DOCUMENT);
+                    else
+                        soapBinding.style(RPC);
                 }
                 first = false;
             }
-            if(bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING))
+            if(this.binding.getBindingId().getSOAPVersion()==SOAPVersion.SOAP_12)
                 generateSOAP12BindingOperation(method, binding);
             else
                 generateBindingOperation(method, binding);
         }
     }
 
-    protected void generateBindingOperation(JavaMethod method, Binding binding) {
+    protected void generateBindingOperation(JavaMethodImpl method, Binding binding) {
         BindingOperationType operation = binding.operation().name(method.getOperationName());
+        extension.addBindingOperationExtension(operation, method);
         String targetNamespace = model.getTargetNamespace();
         QName requestMessage = new QName(targetNamespace, method.getOperationName());
-        QName responseMessage = new QName(targetNamespace, method.getOperationName()+RESPONSE);
-        if (method.getBinding() instanceof SOAPBinding) {
-            List<Parameter> bodyParams = new ArrayList<Parameter>();
-            List<Parameter> headerParams = new ArrayList<Parameter>();
-            splitParameters(bodyParams, headerParams, method.getRequestParameters());
-            SOAPBinding soapBinding = (SOAPBinding)method.getBinding();
-            operation.soapOperation().soapAction(soapBinding.getSOAPAction());
+        List<ParameterImpl> bodyParams = new ArrayList<ParameterImpl>();
+        List<ParameterImpl> headerParams = new ArrayList<ParameterImpl>();
+        splitParameters(bodyParams, headerParams, method.getRequestParameters());
+        SOAPBinding soapBinding = method.getBinding();
+        operation.soapOperation().soapAction(soapBinding.getSOAPAction());
 
-            // input
-            TypedXmlWriter input = operation.input();
-            BodyType body = input._element(Body.class);
-            boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
-            if (soapBinding.getUse().equals(Use.LITERAL)) {
-                body.use(LITERAL);
-                if (headerParams.size() > 0) {
-                    if (bodyParams.size() > 0) {
-                        Parameter param = bodyParams.iterator().next();
-                        if (isRpc) {
-                            StringBuffer parts = new StringBuffer();
-                            int i=0;
-                            for (Parameter parameter : ((WrapperParameter)param).getWrapperChildren()) {
-                                if (i++>0)
-                                    parts.append(' ');
-                                parts.append(parameter.getPartName());
-                            }
-                            body.parts(parts.toString());
-                        } else if (param.isWrapperStyle()) {
-                            body.parts(PARAMETERS);
-                        } else {
-                           body.parts(param.getPartName());
+        // input
+        TypedXmlWriter input = operation.input();
+        extension.addBindingOperationInputExtension(input, method);
+        BodyType body = input._element(Body.class);
+        boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
+        if (soapBinding.getUse()==Use.LITERAL) {
+            body.use(LITERAL);
+            if (headerParams.size() > 0) {
+                if (bodyParams.size() > 0) {
+                    ParameterImpl param = bodyParams.iterator().next();
+                    if (isRpc) {
+                        StringBuffer parts = new StringBuffer();
+                        int i=0;
+                        for (ParameterImpl parameter : ((WrapperParameter)param).getWrapperChildren()) {
+                            if (i++>0)
+                                parts.append(' ');
+                            parts.append(parameter.getPartName());
                         }
+                        body.parts(parts.toString());
+                    } else if (param.isWrapperStyle()) {
+                        body.parts(PARAMETERS);
                     } else {
-                        body.parts("");
+                       body.parts(param.getPartName());
                     }
-                    generateSOAPHeaders(input, headerParams, requestMessage);
+                } else {
+                    body.parts("");
                 }
-                if (isRpc) {
-                    body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
-                }
-            } else {
-                // TODO localize this
-                throw new WebServiceException("encoded use is not supported");
+                generateSOAPHeaders(input, headerParams, requestMessage);
             }
+            if (isRpc) {
+                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
+            }
+        } else {
+            // TODO localize this
+            throw new WebServiceException("encoded use is not supported");
+        }
 
-            if (method.getMEP() != MessageStruct.ONE_WAY_MEP) {
-                boolean unwrappable = headerParams.size() == 0;
-                // output
-                bodyParams.clear();
-                headerParams.clear();
-                splitParameters(bodyParams, headerParams, method.getResponseParameters());
-                unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable;
-                TypedXmlWriter output = operation.output();
-                body = output._element(Body.class);
-                body.use(LITERAL);
-                if (headerParams.size() > 0) {
-                    String parts = "";
-                    if (bodyParams.size() > 0) {
-                        Parameter param = bodyParams.iterator().next();
+        if (method.getMEP() != MEP.ONE_WAY) {
+            boolean unwrappable = headerParams.size() == 0;
+            // output
+            bodyParams.clear();
+            headerParams.clear();
+            splitParameters(bodyParams, headerParams, method.getResponseParameters());
+            unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable;
+            TypedXmlWriter output = operation.output();
+            extension.addBindingOperationOutputExtension(output, method);
+            body = output._element(Body.class);
+            body.use(LITERAL);
+            if (headerParams.size() > 0) {
+                String parts = "";
+                if (bodyParams.size() > 0) {
+                    ParameterImpl param = bodyParams.iterator().hasNext() ? bodyParams.iterator().next() : null;
+                    if(param!=null){
                         if (isRpc) {
                             int i=0;
-                            for (Parameter parameter : ((WrapperParameter)param).getWrapperChildren()) {
+                            for (ParameterImpl parameter : ((WrapperParameter)param).getWrapperChildren()) {
                                 if (i++>0)
                                     parts += " ";
                                 parts += parameter.getPartName();
                             }
                         } else {
-                            if (param != null) {
-                                if (param.isWrapperStyle()) {
-                                    // if its not really wrapper style dont use the same name as input message
-                                    if (unwrappable)
-                                        parts = RESULT;
-                                    else
-                                        parts = UNWRAPPABLE_RESULT;
-                                } else {
-                                    parts = param.getPartName();
-                                }
+                            if (param.isWrapperStyle()) {
+                                // if its not really wrapper style dont use the same name as input message
+                                if (unwrappable)
+                                    parts = RESULT;
+                                else
+                                    parts = UNWRAPPABLE_RESULT;
+                            } else {
+                                parts = param.getPartName();
                             }
                         }
                     }
-                    body.parts(parts);
-                    generateSOAPHeaders(output, headerParams, responseMessage);
                 }
-                if (isRpc) {
-                    body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
-                }
+                body.parts(parts);
+                QName responseMessage = new QName(targetNamespace, method.getResponseMessageName());
+                generateSOAPHeaders(output, headerParams, responseMessage);
             }
-            for (CheckedException exception : method.getCheckedExceptions()) {
-//                QName tagName = exception.getDetailType().tagName;
-//                Fault fault = operation.fault().name(tagName.getLocalPart());
-//                SOAPFault soapFault = fault._element(SOAPFault.class).name(tagName.getLocalPart());
-                Fault fault = operation.fault().name(exception.getMessageName());
-                SOAPFault soapFault = fault._element(SOAPFault.class).name(exception.getMessageName());
-                soapFault.use(LITERAL);
+            if (isRpc) {
+                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
             }
         }
+        for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
+            Fault fault = operation.fault().name(exception.getMessageName());
+            SOAPFault soapFault = fault._element(SOAPFault.class).name(exception.getMessageName());
+            soapFault.use(LITERAL);
+        }
     }
 
-    protected void generateSOAP12BindingOperation(JavaMethod method, Binding binding) {
+    protected void generateSOAP12BindingOperation(JavaMethodImpl method, Binding binding) {
         BindingOperationType operation = binding.operation().name(method.getOperationName());
         String targetNamespace = model.getTargetNamespace();
         QName requestMessage = new QName(targetNamespace, method.getOperationName());
-        QName responseMessage = new QName(targetNamespace, method.getOperationName()+RESPONSE);
-        if (method.getBinding() instanceof SOAPBinding) {
-            List<Parameter> bodyParams = new ArrayList<Parameter>();
-            List<Parameter> headerParams = new ArrayList<Parameter>();
-            splitParameters(bodyParams, headerParams, method.getRequestParameters());
-            SOAPBinding soapBinding = (SOAPBinding)method.getBinding();
-            operation.soap12Operation().soapAction(soapBinding.getSOAPAction());
 
-            // input
-            TypedXmlWriter input = operation.input();
+        ArrayList<ParameterImpl> bodyParams = new ArrayList<ParameterImpl>();
+        ArrayList<ParameterImpl> headerParams = new ArrayList<ParameterImpl>();
+        splitParameters(bodyParams, headerParams, method.getRequestParameters());
+        SOAPBinding soapBinding = method.getBinding();
+        operation.soap12Operation().soapAction(soapBinding.getSOAPAction());
 
-            com.sun.xml.internal.ws.wsdl.writer.document.soap12.BodyType body = input._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class);
-            boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
-            if (soapBinding.getUse().equals(Use.LITERAL)) {
-                body.use(LITERAL);
-                if (headerParams.size() > 0) {
-                    if (bodyParams.size() > 0) {
-                        Parameter param = bodyParams.iterator().next();
-                        if (isRpc) {
-                            StringBuffer parts = new StringBuffer();
-                            int i=0;
-                            for (Parameter parameter : ((WrapperParameter)param).getWrapperChildren()) {
-                                if (i++>0)
-                                    parts.append(' ');
-                                parts.append(parameter.getPartName());
-                            }
-                            body.parts(parts.toString());
-                        } else if (param.isWrapperStyle()) {
-                            body.parts(PARAMETERS);
-                        } else {
-                           body.parts(param.getPartName());
+        // input
+        TypedXmlWriter input = operation.input();
+
+        com.sun.xml.internal.ws.wsdl.writer.document.soap12.BodyType body = input._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class);
+        boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
+        if (soapBinding.getUse().equals(Use.LITERAL)) {
+            body.use(LITERAL);
+            if (headerParams.size() > 0) {
+                if (bodyParams.size() > 0) {
+                    ParameterImpl param = bodyParams.iterator().next();
+                    if (isRpc) {
+                        StringBuffer parts = new StringBuffer();
+                        int i=0;
+                        for (ParameterImpl parameter : ((WrapperParameter)param).getWrapperChildren()) {
+                            if (i++>0)
+                                parts.append(' ');
+                            parts.append(parameter.getPartName());
                         }
+                        body.parts(parts.toString());
+                    } else if (param.isWrapperStyle()) {
+                        body.parts(PARAMETERS);
                     } else {
-                        body.parts("");
+                       body.parts(param.getPartName());
                     }
-                    generateSOAP12Headers(input, headerParams, requestMessage);
+                } else {
+                    body.parts("");
                 }
-                if (isRpc) {
-                    body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
-                }
-            } else {
-                // TODO localize this
-                throw new WebServiceException("encoded use is not supported");
+                generateSOAP12Headers(input, headerParams, requestMessage);
             }
+            if (isRpc) {
+                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
+            }
+        } else {
+            // TODO localize this
+            throw new WebServiceException("encoded use is not supported");
+        }
 
-            if (method.getMEP() != MessageStruct.ONE_WAY_MEP) {
-                // output
-                boolean unwrappable = headerParams.size() == 0;
-                bodyParams.clear();
-                headerParams.clear();
-                splitParameters(bodyParams, headerParams, method.getResponseParameters());
-                unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable;
-                TypedXmlWriter output = operation.output();
-                body = output._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class);
-                body.use(LITERAL);
-                if (headerParams.size() > 0) {
-                    if (bodyParams.size() > 0) {
-                        Parameter param = bodyParams.iterator().next();
-                        if (isRpc) {
-                            String parts = "";
-                            int i=0;
-                            for (Parameter parameter : ((WrapperParameter)param).getWrapperChildren()) {
-                                if (i++>0)
-                                    parts += " ";
-                                parts += parameter.getPartName();
-                            }
-                            body.parts(parts);
-                        } else if (param.isWrapperStyle()) {
-                            // if its not really wrapper style dont use the same name as input message
-                            if (unwrappable)
-                                body.parts(RESULT);
-                            else
-                                body.parts(UNWRAPPABLE_RESULT);
-                        } else {
-                            body.parts(param.getPartName());
+        if (method.getMEP() != MEP.ONE_WAY) {
+            // output
+            boolean unwrappable = headerParams.size() == 0;
+            bodyParams.clear();
+            headerParams.clear();
+            splitParameters(bodyParams, headerParams, method.getResponseParameters());
+            unwrappable = unwrappable ? headerParams.size() == 0 : unwrappable;
+            TypedXmlWriter output = operation.output();
+            body = output._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class);
+            body.use(LITERAL);
+            if (headerParams.size() > 0) {
+                if (bodyParams.size() > 0) {
+                    ParameterImpl param = bodyParams.iterator().next();
+                    if (isRpc) {
+                        String parts = "";
+                        int i=0;
+                        for (ParameterImpl parameter : ((WrapperParameter)param).getWrapperChildren()) {
+                            if (i++>0)
+                                parts += " ";
+                            parts += parameter.getPartName();
                         }
+                        body.parts(parts);
+                    } else if (param.isWrapperStyle()) {
+                        // if its not really wrapper style dont use the same name as input message
+                        if (unwrappable)
+                            body.parts(RESULT);
+                        else
+                            body.parts(UNWRAPPABLE_RESULT);
                     } else {
-                        body.parts("");
+                        body.parts(param.getPartName());
                     }
-                    generateSOAP12Headers(output, headerParams, responseMessage);
+                } else {
+                    body.parts("");
                 }
-                if (isRpc) {
-                    body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
-                }
+                QName responseMessage = new QName(targetNamespace, method.getResponseMessageName());
+                generateSOAP12Headers(output, headerParams, responseMessage);
             }
-            for (CheckedException exception : method.getCheckedExceptions()) {
-//                QName tagName = exception.getDetailType().tagName;
-//                Fault fault = operation.fault().name(tagName.getLocalPart());
-//                com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault soapFault = fault._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault.class).name(tagName.getLocalPart());
-                Fault fault = operation.fault().name(exception.getMessageName());
-                com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault soapFault = fault._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault.class).name(exception.getMessageName());
-                soapFault.use(LITERAL);
+            if (isRpc) {
+                body.namespace(method.getRequestParameters().iterator().next().getName().getNamespaceURI());
             }
         }
+        for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
+            Fault fault = operation.fault().name(exception.getMessageName());
+            com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault soapFault = fault._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault.class).name(exception.getMessageName());
+            soapFault.use(LITERAL);
+        }
     }
 
-    protected void splitParameters(List<Parameter> bodyParams, List<Parameter>headerParams, List<Parameter>params) {
-        for (Parameter parameter : params) {
+    /**
+     *
+     * @param bodyParams
+     * @param headerParams
+     * @param params
+     */
+    protected void splitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl>headerParams, List<ParameterImpl>params) {
+        for (ParameterImpl parameter : params) {
             if (isBodyParameter(parameter)) {
                 bodyParams.add(parameter);
             } else {
@@ -739,9 +942,15 @@
         }
     }
 
-    protected void generateSOAPHeaders(TypedXmlWriter writer, List<Parameter> parameters, QName message) {
+    /**
+     *
+     * @param writer
+     * @param parameters
+     * @param message
+     */
+    protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {
 
-        for (Parameter headerParam : parameters) {
+        for (ParameterImpl headerParam : parameters) {
             Header header = writer._element(Header.class);
             header.message(message);
             header.part(headerParam.getPartName());
@@ -749,9 +958,15 @@
         }
     }
 
-    protected void generateSOAP12Headers(TypedXmlWriter writer, List<Parameter> parameters, QName message) {
+    /**
+     *
+     * @param writer
+     * @param parameters
+     * @param message
+     */
+    protected void generateSOAP12Headers(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {
 
-        for (Parameter headerParam : parameters) {
+        for (ParameterImpl headerParam : parameters) {
             com.sun.xml.internal.ws.wsdl.writer.document.soap12.Header header = writer._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Header.class);
             header.message(message);
 
@@ -761,35 +976,61 @@
         }
     }
 
+    /**
+     * Generates the Service section of the WSDL
+     */
     protected void generateService() {
         QName portQName = model.getPortName();
         QName serviceQName = model.getServiceQName();
         Service service = serviceDefinitions.service().name(serviceQName.getLocalPart());
+        extension.addServiceExtension(service);
         Port port = service.port().name(portQName.getLocalPart());
-        port.binding(new QName(serviceQName.getNamespaceURI(), portQName.getLocalPart()+BINDING));
+        port.binding(model.getBoundPortTypeName());
+        extension.addPortExtension(port);
         if (model.getJavaMethods().size() == 0)
             return;
-        if (model.getJavaMethods().iterator().next().getBinding() instanceof SOAPBinding) {
-            if(bindingId.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)){
-                com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPAddress address = port._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPAddress.class);
-                address.location(REPLACE_WITH_ACTUAL_URL);
-            }else{
-                SOAPAddress address = port._element(SOAPAddress.class);
-                address.location(REPLACE_WITH_ACTUAL_URL);
-            }
+
+        if(this.binding.getBindingId().getSOAPVersion()== SOAPVersion.SOAP_12){
+            com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPAddress address = port._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPAddress.class);
+            address.location(endpointAddress);
+        }else{
+            SOAPAddress address = port._element(SOAPAddress.class);
+            address.location(endpointAddress);
         }
     }
 
-    protected void generateInputMessage(Operation operation, JavaMethod method) {
+    /**
+     *
+     * @param operation
+     * @param method
+     */
+    protected void generateInputMessage(Operation operation, JavaMethodImpl method) {
         ParamType paramType = operation.input();
-        paramType.message(new QName(model.getTargetNamespace(), method.getOperationName()));
+        extension.addOperationInputExtension(paramType, method);
+//        paramType.message(method.getOperation().getName());
+        paramType.message(new QName(model.getTargetNamespace(), method.getRequestMessageName()));
     }
 
-    protected void generateOutputMessage(Operation operation, JavaMethod method) {
+    /**
+     *
+     * @param operation
+     * @param method
+     */
+    protected void generateOutputMessage(Operation operation, JavaMethodImpl method) {
         ParamType paramType = operation.output();
-        paramType.message(new QName(model.getTargetNamespace(), method.getOperationName()+RESPONSE));
+        extension.addOperationOutputExtension(paramType, method);
+//        paramType.message(new QName(model.getTargetNamespace(), method.getOperation().getLocalName()+RESPONSE));
+        paramType.message(new QName(model.getTargetNamespace(), method.getResponseMessageName()));
     }
 
+    /**
+     * Creates the {@link Result} object used by JAXB to generate a schema for the
+     * namesapceUri namespace.
+     * @param namespaceUri The namespace for the schema being generated
+     * @param suggestedFileName the JAXB suggested file name for the schema file
+     * @return the {@link Result} for JAXB to generate the schema into
+     * @throws java.io.IOException thrown if on IO error occurs
+     */
     public Result createOutputFile(String namespaceUri, String suggestedFileName) throws IOException {
         Result result;
         if (namespaceUri.equals("")) {
@@ -825,7 +1066,10 @@
      *
      * <p>
      * This method will not normalize the relative URI.
+     * @param uri the URI to relativize
      *
+     *
+     * @param baseUri the base URI to use for the relativization
      * @return the relative URI or the original URI if a relative one could not be computed
      */
     protected static String relativize(String uri, String baseUri) {
@@ -884,9 +1128,25 @@
     }
 
 
+    /**
+     * Implements the SchemaOutputResolver used by JAXB to
+     */
     protected class JAXWSOutputSchemaResolver extends SchemaOutputResolver {
+
+        /**
+         * Creates the {@link Result} object used by JAXB to generate a schema for the
+         * namesapceUri namespace.
+         * @param namespaceUri The namespace for the schema being generated
+         * @param suggestedFileName the JAXB suggested file name for the schema file
+         * @return the {@link Result} for JAXB to generate the schema into
+         * @throws java.io.IOException thrown if on IO error occurs
+         */
         public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
             return createOutputFile(namespaceUri, suggestedFileName);
         }
     }
+
+    private void register(WSDLGeneratorExtension h) {
+        extensionHandlers.add(h);
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGeneratorExtensionFacade.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGeneratorExtensionFacade.java
new file mode 100644
index 0000000..c8280b8
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGeneratorExtensionFacade.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.xml.internal.ws.wsdl.writer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.xml.internal.txw2.TypedXmlWriter;
+import com.sun.xml.internal.ws.api.model.CheckedException;
+import com.sun.xml.internal.ws.api.model.JavaMethod;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGenExtnContext;
+import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+
+/**
+ * {@link WSDLGeneratorExtension} that delegates to
+ * multiple {@link WSDLGeneratorExtension}s.
+ *
+ * <p>
+ * This simplifies {@link WSDLGenerator} since it now
+ * only needs to work with one {@link WSDLGeneratorExtension}.
+ *
+ *
+ * @author Doug Kohlert
+ */
+final class WSDLGeneratorExtensionFacade extends WSDLGeneratorExtension {
+    private final WSDLGeneratorExtension[] extensions;
+
+    WSDLGeneratorExtensionFacade(WSDLGeneratorExtension... extensions) {
+        assert extensions!=null;
+        this.extensions = extensions;
+    }
+
+    public void start(WSDLGenExtnContext ctxt) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.start(ctxt);
+    }
+
+    public void end(@NotNull WSDLGenExtnContext ctxt) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.end(ctxt);
+    }
+
+    public void addDefinitionsExtension(TypedXmlWriter definitions) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addDefinitionsExtension(definitions);
+    }
+
+    public void addServiceExtension(TypedXmlWriter service) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addServiceExtension(service);
+    }
+
+    public void addPortExtension(TypedXmlWriter port) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addPortExtension(port);
+    }
+
+    public void addPortTypeExtension(TypedXmlWriter portType) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addPortTypeExtension(portType);
+    }
+
+    public void addBindingExtension(TypedXmlWriter binding) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addBindingExtension(binding);
+    }
+
+    public void addOperationExtension(TypedXmlWriter operation, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addOperationExtension(operation, method);
+    }
+
+    public void addBindingOperationExtension(TypedXmlWriter operation, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addBindingOperationExtension(operation, method);
+    }
+
+    public void addInputMessageExtension(TypedXmlWriter message, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addInputMessageExtension(message, method);
+    }
+
+    public void addOutputMessageExtension(TypedXmlWriter message, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addOutputMessageExtension(message, method);
+    }
+
+    public void addOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addOperationInputExtension(input, method);
+    }
+
+    public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addOperationOutputExtension(output, method);
+    }
+
+    public void addBindingOperationInputExtension(TypedXmlWriter input, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addBindingOperationInputExtension(input, method);
+    }
+
+    public void addBindingOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addBindingOperationOutputExtension(output, method);
+    }
+
+    public void addBindingOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addBindingOperationFaultExtension(fault, method, ce);
+    }
+
+    public void addFaultMessageExtension(TypedXmlWriter message, JavaMethod method, CheckedException ce) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addFaultMessageExtension(message, method, ce);
+    }
+
+    public void addOperationFaultExtension(TypedXmlWriter fault, JavaMethod method, CheckedException ce) {
+        for (WSDLGeneratorExtension e : extensions)
+            e.addOperationFaultExtension(fault, method, ce);
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLOutputResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLOutputResolver.java
deleted file mode 100644
index 2007f12..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLOutputResolver.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.ws.wsdl.writer;
-
-import javax.xml.transform.Result;
-import javax.xml.ws.Holder;
-
-
-/**
- *
- * @author WS Development Team
- */
-public interface WSDLOutputResolver {
-    public Result getWSDLOutput(String suggestedFilename);
-
-    /*
-     * Updates filename if the suggested filename need to be changed in
-     * wsdl:import
-     *
-     * return null if abstract WSDL need not be generated
-     */
-    public Result getAbstractWSDLOutput(Holder<String> filename);
-
-    /*
-     * Updates filename if the suggested filename need to be changed in
-     * xsd:import
-     *
-     * return null if schema need not be generated
-     */
-    public Result getSchemaOutput(String namespace, Holder<String> filename);
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java
new file mode 100644
index 0000000..863200b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.ws.wsdl.writer;
+
+import com.sun.istack.internal.NotNull;
+import com.sun.istack.internal.Nullable;
+import javax.xml.transform.Result;
+import javax.xml.ws.Holder;
+
+
+/**
+ * WSDLResolver is used by WSDLGenerator while generating WSDL and its associated
+ * documents. It is used to control what documents need to be generated and what
+ * documents need to be picked from metadata. If endpont's document metadata
+ * already contains some documents, their systemids may be used for wsdl:import,
+ * and schema:import. The suggested filenames are relative urls(for e.g: EchoSchema1.xsd)
+ * The Result object systemids are also relative urls(for e.g: AbsWsdl.wsdl).
+ *
+ * @author Jitendra Kotamraju
+ */
+public interface WSDLResolver {
+    /**
+     * Create a Result object into which concrete WSDL is to be generated.
+     *
+     * @return Result for the concrete WSDL
+     */
+    public @NotNull Result getWSDL(@NotNull String suggestedFilename);
+
+    /**
+     * Create a Result object into which abstract WSDL is to be generated. If the the
+     * abstract WSDL is already in metadata, it is not generated.
+     *
+     * Update filename if the suggested filename need to be changed in wsdl:import.
+     * This needs to be done if the metadata contains abstract WSDL, and that systemid
+     * needs to be reflected in concrete WSDL's wsdl:import
+     *
+     * @return null if abstract WSDL need not be generated
+     */
+    public @Nullable Result getAbstractWSDL(@NotNull Holder<String> filename);
+
+    /**
+     * Create a Result object into which schema doc is to be generated. Typically if
+     * there is a schema doc for namespace in metadata, then it is not generated.
+     *
+     * Update filename if the suggested filename need to be changed in xsd:import. This
+     * needs to be done if the metadata contains the document, and that systemid
+     * needs to be reflected in some other document's xsd:import
+     *
+     * @return null if schema need not be generated
+     */
+    public @Nullable Result getSchemaOutput(@NotNull String namespace, @NotNull Holder<String> filename);
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java
index fd2f07d..e897527 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Binding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java
index 47c4b32..e0b7c90 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/BindingOperationType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java
index bfe69d1..d8037b0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Definitions.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java
index 5bb5de3..1d8b8b0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Documented.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java
index cbee537..5ebdbdc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Fault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java
index 530b6bc..6405d9d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/FaultType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java
index 527ac8a..16eb0b7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Import.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java
index 0213113..4c755d8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Message.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java
index 6b1923a..7342735 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/OpenAtts.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java
index 85ab882..2777395 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Operation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java
index 1da1812..511e048 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/ParamType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java
index e02b851..ea63d12 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Part.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java
index 2fca0a1..22864ed 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Port.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java
index b26c7de..52ececa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/PortType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java
index dd067e9..9a2df96 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Service.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java
index ab664c9..2741b13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/StartWithExtensionsType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java
index 3872199..73cc896 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/Types.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java
index f803410..a113b17 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Address.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java
index 401ec75..2fd5527 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Binding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java
index 1ba7c0b..6ace1eb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/Operation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java
index a3f611f..df0d58a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/http/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java
index e868187..a514761 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java
index ece9955..740e3f3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Body.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java
index b3013ca..18fba2c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/BodyType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java
index 563ba27..2eacf24 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/Header.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java
index 173e6ef..d96fce4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/HeaderFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java
index 32f4afe..2e21319 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPAddress.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java
index e949766..4859bbc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPBinding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java
index 75d3652..c39e5d9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java
index fc94fe6..84262ba 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/SOAPOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java
index cc8794e..88ac336 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java
index 913c25e..e59b71b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Body.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java
index 9840648..f6fe953 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/BodyType.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java
index 48d4cda..7129c34 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/Header.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java
index 0587f67..311edc4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/HeaderFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java
index 51adfab..8923fb6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPAddress.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java
index 6f39f76..6b86112 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPBinding.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java
index 30f2e3f..c64dcae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPFault.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java
index 539dbc3..43c969a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/SOAPOperation.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java
index 932a52a..6e2ce67 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/soap12/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java
index 4d1a8b1..6bf44f2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Import.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java
index 82bae2b..57f150b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/Schema.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java
index 739b469..02565c7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/document/xsd/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java
index 1a3313c..1452a8f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/SCD.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/SCD.java
new file mode 100644
index 0000000..3557144
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/SCD.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom;
+
+import com.sun.xml.internal.xsom.impl.scd.Iterators;
+import com.sun.xml.internal.xsom.impl.scd.ParseException;
+import com.sun.xml.internal.xsom.impl.scd.SCDImpl;
+import com.sun.xml.internal.xsom.impl.scd.SCDParser;
+import com.sun.xml.internal.xsom.impl.scd.Step;
+import com.sun.xml.internal.xsom.impl.scd.TokenMgrError;
+import com.sun.xml.internal.xsom.util.DeferedCollection;
+
+import javax.xml.namespace.NamespaceContext;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Schema Component Designator (SCD).
+ *
+ * <p>
+ * SCD for schema is what XPath is for XML. SCD allows you to select a schema component(s)
+ * from a schema component(s).
+ *
+ * <p>
+ * See <a href="http://www.w3.org/TR/2005/WD-xmlschema-ref-20050329/">XML Schema: Component Designators</a>.
+ * This implementation is based on 03/29/2005 working draft.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class SCD {
+
+    /**
+     * Parses the string representation of SCD.
+     *
+     * <p>
+     * This method involves parsing the path expression and preparing the in-memory
+     * structure, so this is useful when you plan to use the same SCD against
+     * different context node multiple times.
+     *
+     * <p>
+     * If you want to evaluate SCD just once, use {@link XSComponent#select} methods.
+     *
+     * @param path
+     *      the string representation of SCD, such as "/foo/bar".
+     * @param nsContext
+     *      Its {@link NamespaceContext#getNamespaceURI(String)} is used
+     *      to resolve prefixes in the SCD to the namespace URI.
+     */
+    public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException {
+        try {
+            SCDParser p = new SCDParser(path,nsContext);
+            List<?> list = p.RelativeSchemaComponentPath();
+            return new SCDImpl(path,list.toArray(new Step[list.size()]));
+        } catch (TokenMgrError e) {
+            throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e);
+        } catch (ParseException e) {
+            throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e);
+        }
+    }
+
+    private static java.text.ParseException setCause(java.text.ParseException e, Throwable x) {
+        e.initCause(x);
+        return e;
+    }
+
+    /**
+     * Evaluates the SCD against the given context node and
+     * returns the matched nodes.
+     *
+     * @return
+     *      could be empty but never be null.
+     */
+    public final Collection<XSComponent> select(XSComponent contextNode) {
+        return new DeferedCollection<XSComponent>(select(Iterators.singleton(contextNode)));
+    }
+
+    /**
+     * Evaluates the SCD against the whole schema and
+     * returns the matched nodes.
+     *
+     * <p>
+     * This method is here because {@link XSSchemaSet}
+     * doesn't implement {@link XSComponent}.
+     *
+     * @return
+     *      could be empty but never be null.
+     */
+    public final Collection<XSComponent> select(XSSchemaSet contextNode) {
+        return select(contextNode.getSchemas());
+    }
+
+    /**
+     * Evaluates the SCD against the given context node and
+     * returns the matched node.
+     *
+     * @return
+     *      null if the SCD didn't match anything. If the SCD matched more than one node,
+     *      the first one will be returned.
+     */
+    public final XSComponent selectSingle(XSComponent contextNode) {
+        Iterator<XSComponent> r = select(Iterators.singleton(contextNode));
+        if(r.hasNext())     return r.next();
+        return null;
+    }
+
+    /**
+     * Evaluates the SCD against the whole schema set and
+     * returns the matched node.
+     *
+     * @return
+     *      null if the SCD didn't match anything. If the SCD matched more than one node,
+     *      the first one will be returned.
+     */
+    public final XSComponent selectSingle(XSSchemaSet contextNode) {
+        Iterator<XSComponent> r = select(contextNode.iterateSchema());
+        if(r.hasNext())     return r.next();
+        return null;
+    }
+
+    /**
+     * Evaluates the SCD against the given set of context nodes and
+     * returns the matched nodes.
+     *
+     * @param contextNodes
+     *      {@link XSComponent}s that represent the context node against
+     *      which {@link SCD} is evaluated.
+     *
+     * @return
+     *      could be empty but never be null.
+     */
+    public abstract Iterator<XSComponent> select(Iterator<? extends XSComponent> contextNodes);
+
+    /**
+     * Evaluates the SCD against the given set of context nodes and
+     * returns the matched nodes.
+     *
+     * @param contextNodes
+     *      {@link XSComponent}s that represent the context node against
+     *      which {@link SCD} is evaluated.
+     *
+     * @return
+     *      could be empty but never be null.
+     */
+    public final Collection<XSComponent> select(Collection<? extends XSComponent> contextNodes) {
+        return new DeferedCollection<XSComponent>(select(contextNodes.iterator()));
+    }
+
+    /**
+     * Returns the textual SCD representation as given to {@link SCD#create(String, NamespaceContext)}.
+     */
+    public abstract String toString();
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java
index c979022..99237b3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import org.xml.sax.Locator;
@@ -47,6 +46,16 @@
     Object getAnnotation();
 
     /**
+     * Sets the value to be returned by {@link #getAnnotation()}.
+     *
+     * @param o
+     *      can be null.
+     * @return
+     *      old value that was replaced by the <tt>o</tt>.
+     */
+    Object setAnnotation(Object o);
+
+    /**
      * Returns a location information of the annotation.
      */
     Locator getLocator();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java
index ce6bdfa..271d59d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java
index e85a098..a8ed336 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java
index e49327d..d1c5ecf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java
index 7363ab7..1cf8932 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import org.relaxng.datatype.ValidationContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java
index 34745ba..e33bc45 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java
index 4b702c3..cd97fe1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import com.sun.xml.internal.xsom.parser.SchemaDocument;
@@ -30,7 +29,9 @@
 import com.sun.xml.internal.xsom.visitor.XSVisitor;
 import org.xml.sax.Locator;
 
+import javax.xml.namespace.NamespaceContext;
 import java.util.List;
+import java.util.Collection;
 
 /**
  * Base interface for all the schema components.
@@ -44,6 +45,20 @@
     XSAnnotation getAnnotation();
 
     /**
+     * Works like {@link #getAnnotation()}, but allow a new empty {@link XSAnnotation} to be created
+     * if not exist.
+     *
+     * @param createIfNotExist
+     *      true to create a new {@link XSAnnotation} if it doesn't exist already.
+     *      false to make this method behavel like {@link #getAnnotation()}.
+     *
+     * @return
+     *      null if <tt>createIfNotExist==false</tt> and annotation didn't exist.
+     *      Otherwise non-null.
+     */
+    XSAnnotation getAnnotation(boolean createIfNotExist);
+
+    /**
      * Gets the foreign attributes on this schema component.
      *
      * <p>
@@ -89,6 +104,15 @@
     XSSchema getOwnerSchema();
 
     /**
+     * Gets the root schema set that includes this component.
+     *
+     * <p>
+     * In case of <code>XSEmpty</code> component, this method
+     * returns null since there is no owner component.
+     */
+    XSSchemaSet getRoot();
+
+    /**
      * Gets the {@link SchemaDocument} that indicates which document this component
      * was defined in.
      *
@@ -102,6 +126,39 @@
     SchemaDocument getSourceDocument();
 
     /**
+     * Evaluates a schema component designator against this schema component
+     * and returns the resulting schema components.
+     *
+     * @throws IllegalArgumentException
+     *      if SCD is syntactically incorrect.
+     *
+     * @param scd
+     *      Schema component designator. See {@link SCD} for more details.
+     * @param nsContext
+     *      The namespace context in which SCD is evaluated. Cannot be null.
+     * @return
+     *      Can be empty but never null.
+     */
+    Collection<XSComponent> select(String scd, NamespaceContext nsContext);
+
+    /**
+     * Evaluates a schema component designator against this schema component
+     * and returns the first resulting schema component.
+     *
+     * @throws IllegalArgumentException
+     *      if SCD is syntactically incorrect.
+     *
+     * @param scd
+     *      Schema component designator. See {@link SCD} for more details.
+     * @param nsContext
+     *      The namespace context in which SCD is evaluated. Cannot be null.
+     * @return
+     *      null if the SCD didn't match anything. If the SCD matched more than one node,
+     *      the first one will be returned.
+     */
+    XSComponent selectSingle(String scd, NamespaceContext nsContext);
+
+    /**
      * Accepts a visitor.
      */
     void visit( XSVisitor visitor );
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java
index 045844e..197f892 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import com.sun.xml.internal.xsom.visitor.XSContentTypeFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java
index 9d17f48..fc7f5a0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
@@ -41,6 +40,8 @@
 
     /**
      * Gets the (local) name of the declaration.
+     *
+     * @return null if this component is anonymous.
      */
     String getName();
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java
index cecd1ad..fb2ebd2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import java.util.List;
@@ -36,10 +35,19 @@
  */
 public interface XSElementDecl extends XSDeclaration, XSTerm
 {
+    /**
+     * Gets the type of this element declaration.
+     * @return
+     *      always non-null.
+     */
     XSType getType();
 
     boolean isNillable();
 
+    /**
+     * Gets the substitution head of this element, if any.
+     * Otherwise null.
+     */
     XSElementDecl getSubstAffiliation();
 
     /**
@@ -57,7 +65,7 @@
      * (plus <code>finalDefault</code>).
      *
      * @param method
-     *      Possible values are {@link XSType.EXTENSION} or
+     *      Possible values are {@link XSType#EXTENSION} or
      *      <code>XSType.RESTRICTION</code>.
      */
     boolean isSubstitutionExcluded(int method);
@@ -69,7 +77,7 @@
      * (plus <code>blockDefault</code>).
      *
      * @param method
-     *      Possible values are {@link XSType.EXTENSION},
+     *      Possible values are {@link XSType#EXTENSION},
      *      <code>XSType.RESTRICTION</code>, or <code>XSType.SUBSTITUTION</code>
      */
     boolean isSubstitutionDisallowed(int method);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java
index c8c834b..5fe2d0b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java
index 3f86629..12ab2e7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import java.util.List;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java
index 8de5496..b80da6c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java
index 3b6a2f8..62e0774 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java
index b27b6d9..7310ca3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java
index 7ff6601..a4568d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java
index f6c5229..255107d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java
index 06e1bdc..844610e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java
index f21d0d8..980064d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import com.sun.xml.internal.xsom.parser.SchemaDocument;
@@ -129,4 +128,11 @@
      *      there's something wrong with your code.
      */
     SchemaDocument getSourceDocument();
+
+    /**
+     * Gets the root schema set that includes this schema.
+     *
+     * @return never null.
+     */
+    XSSchemaSet getRoot();
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java
index 9d944f4..b80128d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,9 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
+import javax.xml.namespace.NamespaceContext;
 import java.util.Iterator;
 import java.util.Collection;
 
@@ -81,4 +81,34 @@
     XSSimpleType getAnySimpleType();
     XSContentType getEmpty();
 
+    /**
+     * Evaluates a schema component designator against this schema component
+     * and returns the resulting schema components.
+     *
+     * @throws IllegalArgumentException
+     *      if SCD is syntactically incorrect.
+     * @param scd
+     *      Schema component designator. See {@link SCD} for more details.
+     * @param nsContext
+     *      The namespace context in which SCD is evaluated. Cannot be null.
+     * @return
+     *      Can be empty but never null.
+     */
+    Collection<XSComponent> select(String scd, NamespaceContext nsContext);
+
+    /**
+     * Evaluates a schema component designator against this schema component
+     * and returns the first resulting schema component.
+     *
+     * @throws IllegalArgumentException
+     *      if SCD is syntactically incorrect.
+     * @param scd
+     *      Schema component designator. See {@link SCD} for more details.
+     * @param nsContext
+     *      The namespace context in which SCD is evaluated. Cannot be null.
+     * @return
+     *      null if the SCD didn't match anything. If the SCD matched more than one node,
+     *      the first one will be returned.
+     */
+    XSComponent selectSingle(String scd, NamespaceContext nsContext);
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java
index 40b37f9..81b1496 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import com.sun.xml.internal.xsom.visitor.XSSimpleTypeFunction;
@@ -60,6 +59,37 @@
     XSVariety getVariety();
 
     /**
+     * Gets the ancestor primitive {@link XSSimpleType} if
+     * this type is {@link XSVariety#ATOMIC atomic}.
+     *
+     * @return
+     *      null otherwise.
+     */
+    XSSimpleType getPrimitiveType();
+
+    /**
+     * Returns true if this is a primitive built-in simple type
+     * (that directly derives from xs:anySimpleType, by definition.)
+     */
+    boolean isPrimitive();
+
+    /**
+     * Gets the nearest ancestor {@link XSListSimpleType} (including itself)
+     * if the variety of this type is {@link XSVariety#LIST list}.
+     *
+     * @return otherwise return null
+     */
+    XSListSimpleType getBaseListType();
+
+    /**
+     * Gets the nearest ancestor {@link XSUnionSimpleType} (including itself)
+     * if the variety of this type is {@link XSVariety#UNION union}.
+     *
+     * @return otherwise return null
+     */
+    XSUnionSimpleType getBaseUnionType();
+
+    /**
      * Returns true if this type definition is marked as 'final'
      * with respect to the given {@link XSVariety}.
      *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java
index 0ea325d..432918e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import com.sun.xml.internal.xsom.visitor.XSTermFunction;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSType.java
index f782ae2..8052f17 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java
index 6d0c10e..392063f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java
index 9eeb41c..c3590f5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java
index 49f30bb..219dd60 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java
index d58af40..774d5c1 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XmlString.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XmlString.java
index f118f6a..cde4c6e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/XmlString.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/XmlString.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom;
 
 import org.relaxng.datatype.ValidationContext;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java
index 2cdd394..40a49bc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,19 @@
 
 import com.sun.xml.internal.xsom.XSAnnotation;
 import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
 
 public class AnnotationImpl implements XSAnnotation
 {
-    private final Object annotation;
+    private Object annotation;
     public Object getAnnotation() { return annotation; }
 
+    public Object setAnnotation(Object o) {
+        Object r = this.annotation;
+        this.annotation = o;
+        return r;
+    }
+
     private final Locator locator;
     public Locator getLocator() { return locator; }
 
@@ -39,4 +46,11 @@
         this.annotation = o;
         this.locator = _loc;
     }
+
+    public AnnotationImpl() {
+        locator = NULL_LOCATION;
+    }
+
+
+    private static final LocatorImpl NULL_LOCATION = new LocatorImpl();
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java
index 5bcedff..30a799f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java
index 1b786b3..00ec2bb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSAttributeDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java
index a5aad56..f09f971 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java
index 6116c76..9d2107e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
 import com.sun.xml.internal.xsom.XSAttributeUse;
 import com.sun.xml.internal.xsom.impl.parser.SchemaDocumentImpl;
+import com.sun.xml.internal.xsom.impl.scd.Iterators;
+import com.sun.xml.internal.xsom.impl.Ref.AttGroup;
 import org.xml.sax.Locator;
 
 import java.util.AbstractSet;
@@ -39,11 +40,12 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
+import java.util.LinkedHashMap;
 
 public abstract class AttributesHolder extends DeclarationImpl {
 
     protected AttributesHolder( SchemaDocumentImpl _parent, AnnotationImpl _annon,
-        Locator loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous ) {
+                                Locator loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous ) {
 
         super(_parent,_annon,loc,_fa,_parent.getTargetNamespace(),_name,_anonymous);
     }
@@ -53,10 +55,10 @@
 
     /**
      * Local attribute use.
-     * It has to be {@link TreeMap} or otherwise we cannot guarantee
-     * the order of iteration.
+     * Use linked hash map to guarantee the iteration order, and make it close to
+     * what was in the schema document.
      */
-    protected final Map<UName,AttributeUseImpl> attributes = new TreeMap<UName,AttributeUseImpl>(UName.comparator);
+    protected final Map<UName,AttributeUseImpl> attributes = new LinkedHashMap<UName,AttributeUseImpl>();
     public void addAttributeUse( UName name, AttributeUseImpl a ) {
         attributes.put( name, a );
     }
@@ -100,13 +102,10 @@
     // Iterates all AttGroups which are directly referenced from this component
     // this does not iterate att groups referenced from the base type
     public Iterator<XSAttGroupDecl> iterateAttGroups() {
-        return new Iterator<XSAttGroupDecl>() {
-            private final Iterator<Ref.AttGroup> itr = attGroups.iterator();
-            public boolean hasNext() { return itr.hasNext(); }
-            public XSAttGroupDecl next() {
-                return itr.next().get();
+        return new Iterators.Adapter<XSAttGroupDecl,Ref.AttGroup>(attGroups.iterator()) {
+            protected XSAttGroupDecl filter(AttGroup u) {
+                return u.get();
             }
-            public void remove() { itr.remove(); }
         };
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java
index 81e90c4..31c3714 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,8 +35,7 @@
 import com.sun.xml.internal.xsom.XSWildcard;
 import com.sun.xml.internal.xsom.impl.parser.DelayedRef;
 import com.sun.xml.internal.xsom.impl.parser.SchemaDocumentImpl;
-import com.sun.xml.internal.xsom.impl.util.ConcatIterator;
-import com.sun.xml.internal.xsom.impl.util.FilterIterator;
+import com.sun.xml.internal.xsom.impl.scd.Iterators;
 import com.sun.xml.internal.xsom.visitor.XSFunction;
 import com.sun.xml.internal.xsom.visitor.XSVisitor;
 import org.xml.sax.Locator;
@@ -214,16 +213,16 @@
         return o;
     }
 
-    public Iterator iterateAttributeUses() {
+    public Iterator<XSAttributeUse> iterateAttributeUses() {
 
         XSComplexType baseType = getBaseType().asComplexType();
 
         if( baseType==null )    return super.iterateAttributeUses();
 
-        return new ConcatIterator(
-            new FilterIterator(baseType.iterateAttributeUses()) {
-                protected boolean allows( Object o ) {
-                    XSAttributeDecl u = ((XSAttributeUse)o).getDecl();
+        return new Iterators.Union<XSAttributeUse>(
+            new Iterators.Filter<XSAttributeUse>(baseType.iterateAttributeUses()) {
+                protected boolean matches(XSAttributeUse value) {
+                    XSAttributeDecl u = value.getDecl();
                     UName n = new UName(u.getTargetNamespace(),u.getName());
                     return !prohibitedAtts.contains(n);
                 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java
index 546cb85..180fdc3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,20 @@
  */
 package com.sun.xml.internal.xsom.impl;
 
+import com.sun.xml.internal.xsom.SCD;
 import com.sun.xml.internal.xsom.XSAnnotation;
 import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSSchemaSet;
+import com.sun.xml.internal.xsom.util.ComponentNameFunction;
 import com.sun.xml.internal.xsom.impl.parser.SchemaDocumentImpl;
 import com.sun.xml.internal.xsom.parser.SchemaDocument;
 import org.xml.sax.Locator;
+import org.xml.sax.helpers.LocatorImpl;
 
+import javax.xml.namespace.NamespaceContext;
+import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -51,13 +58,27 @@
             return ownerDocument.getSchema();
     }
 
+    public XSSchemaSet getRoot() {
+        if(ownerDocument==null)
+            return null;
+        else
+            return getOwnerSchema().getRoot();
+    }
+
     public SchemaDocument getSourceDocument() {
         return ownerDocument;
     }
 
-    private final AnnotationImpl annotation;
+    private AnnotationImpl annotation;
     public final XSAnnotation getAnnotation() { return annotation; }
 
+    public XSAnnotation getAnnotation(boolean createIfNotExist) {
+        if(createIfNotExist && annotation==null) {
+            annotation = new AnnotationImpl();
+        }
+        return annotation;
+    }
+
     private final Locator locator;
     public final Locator getLocator() { return locator; }
 
@@ -69,7 +90,7 @@
      */
     private Object foreignAttributes;
 
-    public List getForeignAttributes() {
+    public List<ForeignAttributesImpl> getForeignAttributes() {
         Object t = foreignAttributes;
 
         if(t==null)
@@ -83,19 +104,39 @@
     }
 
     public String getForeignAttribute(String nsUri, String localName) {
-        for( ForeignAttributesImpl fa : (List<ForeignAttributesImpl>)getForeignAttributes() ) {
+        for( ForeignAttributesImpl fa : getForeignAttributes() ) {
             String v = fa.getValue(nsUri,localName);
             if(v!=null) return v;
         }
         return null;
     }
 
-    private List convertToList(ForeignAttributesImpl fa) {
-        List lst = new ArrayList();
+    private List<ForeignAttributesImpl> convertToList(ForeignAttributesImpl fa) {
+        List<ForeignAttributesImpl> lst = new ArrayList<ForeignAttributesImpl>();
         while(fa!=null) {
             lst.add(fa);
             fa = fa.next;
         }
         return Collections.unmodifiableList(lst);
     }
+
+    public Collection<XSComponent> select(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).select(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    public XSComponent selectSingle(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).selectSingle(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    public String toString() {
+        return apply(new ComponentNameFunction());
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java
index 49cc7b7..1a49c93 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 public class Const
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java
index 5625ebb..398bc4d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSContentType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java
index 7b6ee46..afefbae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSDeclaration;
@@ -54,9 +53,4 @@
 
     public final boolean isGlobal() { return !isAnonymous(); }
     public final boolean isLocal() { return isAnonymous(); }
-
-
-    public String toString() {
-        return NameGetter.get(this)+" "+getName();
-    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
index 6213726..0af81c9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java
index 0180390..1e98f3b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSContentType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java
index 40997ba..b416b0d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSFacet;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java
index a6f346d..4ff2fcd 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.ForeignAttributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
index 3e27d30..7901f45b 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java
index 22a0399..01bb653 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSFacet;
@@ -64,6 +63,10 @@
 
     public XSVariety getVariety() { return XSVariety.LIST; }
 
+    public XSSimpleType getPrimitiveType() { return null; }
+
+    public XSListSimpleType getBaseListType() {return this;}
+
     public boolean isList() { return true; }
     public XSListSimpleType asList() { return this; }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java
index 02ece89..aaa9d8a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java
index 1e8bb75..40274ab 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java
index d6d8d75..07944af 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSNotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java
index 7bebc20..922e2bf 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSContentType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java
index 6f963ae..3f347b4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java
index 3bc538a..da28db3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,12 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSFacet;
 import com.sun.xml.internal.xsom.XSRestrictionSimpleType;
 import com.sun.xml.internal.xsom.XSVariety;
+import com.sun.xml.internal.xsom.XSSimpleType;
 import com.sun.xml.internal.xsom.impl.parser.SchemaDocumentImpl;
 import com.sun.xml.internal.xsom.visitor.XSSimpleTypeFunction;
 import com.sun.xml.internal.xsom.visitor.XSSimpleTypeVisitor;
@@ -90,6 +90,15 @@
 
     public XSVariety getVariety() { return getSimpleBaseType().getVariety(); }
 
+    public XSSimpleType getPrimitiveType() {
+        if(isPrimitive())       return this;
+        return getSimpleBaseType().getPrimitiveType();
+    }
+
+    public boolean isPrimitive() {
+        return getSimpleBaseType()==getOwnerSchema().getRoot().anySimpleType;
+    }
+
     public void visit( XSSimpleTypeVisitor visitor ) {
         visitor.restrictionSimpleType(this);
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java
index f1f60d9..bcb78c6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,15 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.ForeignAttributes;
+import com.sun.xml.internal.xsom.SCD;
 import com.sun.xml.internal.xsom.XSAnnotation;
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
 import com.sun.xml.internal.xsom.XSAttributeDecl;
 import com.sun.xml.internal.xsom.XSComplexType;
+import com.sun.xml.internal.xsom.XSComponent;
 import com.sun.xml.internal.xsom.XSElementDecl;
 import com.sun.xml.internal.xsom.XSIdentityConstraint;
 import com.sun.xml.internal.xsom.XSModelGroupDecl;
@@ -42,7 +43,10 @@
 import com.sun.xml.internal.xsom.visitor.XSVisitor;
 import org.xml.sax.Locator;
 
+import javax.xml.namespace.NamespaceContext;
+import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -64,11 +68,12 @@
         return null;
     }
 
-    protected final SchemaSetImpl parent;
-    public SchemaSetImpl getParent() {
+    public SchemaSetImpl getRoot() {
         return parent;
     }
 
+    protected final SchemaSetImpl parent;
+
     private final String targetNamespace;
     public String getTargetNamespace() {
         return targetNamespace;
@@ -86,6 +91,12 @@
         return annotation;
     }
 
+    public XSAnnotation getAnnotation(boolean createIfNotExist) {
+        if(createIfNotExist && annotation==null)
+            annotation = new AnnotationImpl();
+        return annotation;
+    }
+
     // it's difficult to determine the source location for the schema
     // component as one schema can be defined across multiple files.
     // so this locator might not correctly reflect all the locations
@@ -130,8 +141,9 @@
 
     private final Map<String,XSAttGroupDecl> attGroups = new HashMap<String,XSAttGroupDecl>();
     private final Map<String,XSAttGroupDecl> attGroupsView = Collections.unmodifiableMap(attGroups);
-    public void addAttGroupDecl(XSAttGroupDecl newDecl) {
-        attGroups.put(newDecl.getName(), newDecl);
+    public void addAttGroupDecl(XSAttGroupDecl newDecl, boolean overwrite) {
+        if(overwrite || !attGroups.containsKey(newDecl.getName()))
+            attGroups.put(newDecl.getName(), newDecl);
     }
     public Map<String,XSAttGroupDecl> getAttGroupDecls() {
         return attGroupsView;
@@ -161,8 +173,9 @@
 
     private final Map<String,XSModelGroupDecl> modelGroups = new HashMap<String,XSModelGroupDecl>();
     private final Map<String,XSModelGroupDecl> modelGroupsView = Collections.unmodifiableMap(modelGroups);
-    public void addModelGroupDecl(XSModelGroupDecl newDecl) {
-        modelGroups.put(newDecl.getName(), newDecl);
+    public void addModelGroupDecl(XSModelGroupDecl newDecl, boolean overwrite) {
+        if(overwrite || !modelGroups.containsKey(newDecl.getName()))
+            modelGroups.put(newDecl.getName(), newDecl);
     }
     public Map<String,XSModelGroupDecl> getModelGroupDecls() {
         return modelGroupsView;
@@ -195,9 +208,11 @@
 
     private final Map<String,XSSimpleType> simpleTypes = new HashMap<String,XSSimpleType>();
     private final Map<String,XSSimpleType> simpleTypesView = Collections.unmodifiableMap(simpleTypes);
-    public void addSimpleType(XSSimpleType newDecl) {
-        simpleTypes.put(newDecl.getName(), newDecl);
-        allTypes.put(newDecl.getName(), newDecl);
+    public void addSimpleType(XSSimpleType newDecl, boolean overwrite) {
+        if(overwrite || !simpleTypes.containsKey(newDecl.getName())) {
+            simpleTypes.put(newDecl.getName(), newDecl);
+            allTypes.put(newDecl.getName(), newDecl);
+        }
     }
     public Map<String,XSSimpleType> getSimpleTypes() {
         return simpleTypesView;
@@ -211,9 +226,11 @@
 
     private final Map<String,XSComplexType> complexTypes = new HashMap<String,XSComplexType>();
     private final Map<String,XSComplexType> complexTypesView = Collections.unmodifiableMap(complexTypes);
-    public void addComplexType(XSComplexType newDecl) {
-        complexTypes.put(newDecl.getName(), newDecl);
-        allTypes.put(newDecl.getName(), newDecl);
+    public void addComplexType(XSComplexType newDecl, boolean overwrite) {
+        if(overwrite || !complexTypes.containsKey(newDecl.getName())) {
+            complexTypes.put(newDecl.getName(), newDecl);
+            allTypes.put(newDecl.getName(), newDecl);
+        }
     }
     public Map<String,XSComplexType> getComplexTypes() {
         return complexTypesView;
@@ -272,4 +289,20 @@
         }
         return null;
     }
+
+    public Collection<XSComponent> select(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).select(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    public XSComponent selectSingle(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).selectSingle(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java
index 4212bc6..518439c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,14 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
+import com.sun.xml.internal.xsom.SCD;
 import com.sun.xml.internal.xsom.XSAttGroupDecl;
 import com.sun.xml.internal.xsom.XSAttributeDecl;
 import com.sun.xml.internal.xsom.XSAttributeUse;
 import com.sun.xml.internal.xsom.XSComplexType;
+import com.sun.xml.internal.xsom.XSComponent;
 import com.sun.xml.internal.xsom.XSContentType;
 import com.sun.xml.internal.xsom.XSElementDecl;
 import com.sun.xml.internal.xsom.XSFacet;
@@ -36,6 +37,7 @@
 import com.sun.xml.internal.xsom.XSListSimpleType;
 import com.sun.xml.internal.xsom.XSModelGroup;
 import com.sun.xml.internal.xsom.XSModelGroupDecl;
+import com.sun.xml.internal.xsom.XSNotation;
 import com.sun.xml.internal.xsom.XSParticle;
 import com.sun.xml.internal.xsom.XSRestrictionSimpleType;
 import com.sun.xml.internal.xsom.XSSchema;
@@ -45,6 +47,7 @@
 import com.sun.xml.internal.xsom.XSUnionSimpleType;
 import com.sun.xml.internal.xsom.XSVariety;
 import com.sun.xml.internal.xsom.XSWildcard;
+import com.sun.xml.internal.xsom.impl.scd.Iterators;
 import com.sun.xml.internal.xsom.visitor.XSContentTypeFunction;
 import com.sun.xml.internal.xsom.visitor.XSContentTypeVisitor;
 import com.sun.xml.internal.xsom.visitor.XSFunction;
@@ -53,13 +56,14 @@
 import com.sun.xml.internal.xsom.visitor.XSVisitor;
 import org.xml.sax.Locator;
 
+import javax.xml.namespace.NamespaceContext;
+import java.text.ParseException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Vector;
 
 public class SchemaSetImpl implements XSSchemaSet
@@ -155,109 +159,89 @@
         return schema.getIdentityConstraint(localName);
     }
 
-    private abstract class MultiSchemaIterator<T> implements Iterator<T> {
-        private Iterator<XSSchema> sitr = iterateSchema();
-        private Iterator<T> citr = null;
-        /** The object to be returned from the next method. */
-        private T next;
-
-        public void remove() { throw new UnsupportedOperationException(); }
-        public boolean hasNext() {
-            getNext();
-            return next!=null;
-        }
-        public T next() {
-            getNext();
-            T r = next;
-            next = null;
-            return r;
-        }
-        private void getNext() {
-            if(next!=null)  return;
-
-            if(citr!=null && citr.hasNext()) {
-                next = citr.next();
-                return;
-            }
-            // citr is empty
-            if(sitr.hasNext()) {
-                citr = nextIterator(sitr.next());
-                getNext();
-            }
-            // else
-            //      no more object
-        }
-
-        protected abstract Iterator<T> nextIterator( XSSchema s );
-    }
-
-    public Iterator iterateElementDecls() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateElementDecls();
+    public Iterator<XSElementDecl> iterateElementDecls() {
+        return new Iterators.Map<XSElementDecl,XSSchema>(iterateSchema()) {
+            protected Iterator<XSElementDecl> apply(XSSchema u) {
+                return u.iterateElementDecls();
             }
         };
     }
 
-    public Iterator iterateTypes() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateTypes();
+    public Iterator<XSType> iterateTypes() {
+        return new Iterators.Map<XSType,XSSchema>(iterateSchema()) {
+            protected Iterator<XSType> apply(XSSchema u) {
+                return u.iterateTypes();
             }
         };
     }
 
-    public Iterator iterateAttributeDecls() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateAttributeDecls();
+    public Iterator<XSAttributeDecl> iterateAttributeDecls() {
+        return new Iterators.Map<XSAttributeDecl,XSSchema>(iterateSchema()) {
+            protected Iterator<XSAttributeDecl> apply(XSSchema u) {
+                return u.iterateAttributeDecls();
             }
         };
     }
-    public Iterator iterateAttGroupDecls() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateAttGroupDecls();
+    public Iterator<XSAttGroupDecl> iterateAttGroupDecls() {
+        return new Iterators.Map<XSAttGroupDecl,XSSchema>(iterateSchema()) {
+            protected Iterator<XSAttGroupDecl> apply(XSSchema u) {
+                return u.iterateAttGroupDecls();
             }
         };
     }
-    public Iterator iterateModelGroupDecls() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateModelGroupDecls();
+    public Iterator<XSModelGroupDecl> iterateModelGroupDecls() {
+        return new Iterators.Map<XSModelGroupDecl,XSSchema>(iterateSchema()) {
+            protected Iterator<XSModelGroupDecl> apply(XSSchema u) {
+                return u.iterateModelGroupDecls();
             }
         };
     }
-    public Iterator iterateSimpleTypes() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateSimpleTypes();
+    public Iterator<XSSimpleType> iterateSimpleTypes() {
+        return new Iterators.Map<XSSimpleType,XSSchema>(iterateSchema()) {
+            protected Iterator<XSSimpleType> apply(XSSchema u) {
+                return u.iterateSimpleTypes();
             }
         };
     }
-    public Iterator iterateComplexTypes() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateComplexTypes();
+    public Iterator<XSComplexType> iterateComplexTypes() {
+        return new Iterators.Map<XSComplexType,XSSchema>(iterateSchema()) {
+            protected Iterator<XSComplexType> apply(XSSchema u) {
+                return u.iterateComplexTypes();
             }
         };
     }
-    public Iterator iterateNotations() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.iterateNotations();
+    public Iterator<XSNotation> iterateNotations() {
+        return new Iterators.Map<XSNotation,XSSchema>(iterateSchema()) {
+            protected Iterator<XSNotation> apply(XSSchema u) {
+                return u.iterateNotations();
             }
         };
     }
 
     public Iterator<XSIdentityConstraint> iterateIdentityConstraints() {
-        return new MultiSchemaIterator() {
-            protected Iterator nextIterator( XSSchema xs ) {
-                return xs.getIdentityConstraints().values().iterator();
+        return new Iterators.Map<XSIdentityConstraint,XSSchema>(iterateSchema()) {
+            protected Iterator<XSIdentityConstraint> apply(XSSchema u) {
+                return u.getIdentityConstraints().values().iterator();
             }
         };
     }
 
+    public Collection<XSComponent> select(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).select(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    public XSComponent selectSingle(String scd, NamespaceContext nsContext) {
+        try {
+            return SCD.create(scd,nsContext).selectSingle(this);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
 
     public final EmptyImpl empty = new EmptyImpl();
     public XSContentType getEmpty() { return empty; }
@@ -287,7 +271,7 @@
         public XSType getBaseType() { return anyType; }
         public XSSimpleType getSimpleBaseType() { return null; }
         public int getDerivationMethod() { return RESTRICTION; }
-        public Iterator iterateDeclaredFacets() { return emptyIterator; }
+        public Iterator<XSFacet> iterateDeclaredFacets() { return Iterators.empty(); }
         public Collection<? extends XSFacet> getDeclaredFacets() { return Collections.EMPTY_LIST; }
         public void visit( XSSimpleTypeVisitor visitor ) {visitor.restrictionSimpleType(this); }
         public void visit( XSContentTypeVisitor visitor ) {visitor.simpleType(this); }
@@ -296,6 +280,10 @@
         public <T> T apply( XSContentTypeFunction<T> f ) { return f.simpleType(this); }
         public <T> T apply( XSFunction<T> f ) { return f.simpleType(this); }
         public XSVariety getVariety() { return XSVariety.ATOMIC; }
+        public XSSimpleType getPrimitiveType() {return this;}
+        public boolean isPrimitive() {return true;}
+        public XSListSimpleType getBaseListType() {return null;}
+        public XSUnionSimpleType getBaseUnionType() {return null;}
         public XSFacet getFacet(String name) { return null; }
         public XSFacet getDeclaredFacet(String name) { return null; }
         public List<XSFacet> getDeclaredFacets(String name) { return Collections.EMPTY_LIST; }
@@ -314,7 +302,7 @@
         public XSType[] listSubstitutables() {
             return Util.listSubstitutables(this);
         }
-    };
+    }
 
     public XSComplexType getAnyType() { return anyType; }
     public final AnyType anyType = new AnyType();
@@ -328,10 +316,10 @@
         public boolean isAbstract() { return false; }
         public XSWildcard getAttributeWildcard() { return anyWildcard; }
         public XSAttributeUse getAttributeUse( String nsURI, String localName ) { return null; }
-        public Iterator iterateAttributeUses() { return emptyIterator; }
+        public Iterator<XSAttributeUse> iterateAttributeUses() { return Iterators.empty(); }
         public XSAttributeUse getDeclaredAttributeUse( String nsURI, String localName ) { return null; }
-        public Iterator iterateDeclaredAttributeUses() { return emptyIterator; }
-        public Iterator iterateAttGroups() { return emptyIterator; }
+        public Iterator<XSAttributeUse> iterateDeclaredAttributeUses() { return Iterators.empty(); }
+        public Iterator<XSAttGroupDecl> iterateAttGroups() { return Iterators.empty(); }
         public Collection<XSAttributeUse> getAttributeUses() { return Collections.EMPTY_LIST; }
         public Collection<? extends XSAttributeUse> getDeclaredAttributeUses() { return Collections.EMPTY_LIST; }
         public Collection<? extends XSAttGroupDecl> getAttGroups() { return Collections.EMPTY_LIST; }
@@ -374,12 +362,5 @@
                         XSParticle.UNBOUNDED, 0 )
                 })
                 ,null,1,1);
-    };
-
-    private static final Iterator emptyIterator = new Iterator() {
-        public boolean hasNext() { return false; }
-        public Object next() { throw new NoSuchElementException(); }
-        public void remove() { throw new UnsupportedOperationException(); }
-    };
-
+    }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java
index f267bdc..aa01ede 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSComplexType;
@@ -94,6 +93,15 @@
 
     public XSType getBaseType() { return baseType.getType(); }
     public XSSimpleType getSimpleBaseType() { return baseType.getType(); }
+    public boolean isPrimitive() { return false; }
+
+    public XSListSimpleType getBaseListType() {
+        return getSimpleBaseType().getBaseListType();
+    }
+
+    public XSUnionSimpleType getBaseUnionType() {
+        return getSimpleBaseType().getBaseUnionType();
+    }
 
     private final Set<XSVariety> finalSet;
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java
index f79905c..326d2a6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import java.util.Comparator;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java
index afe8bd6..d64a246 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSFacet;
@@ -78,11 +77,17 @@
         return function.unionSimpleType(this);
     }
 
+    public XSUnionSimpleType getBaseUnionType() {
+        return this;
+    }
+
     // union type by itself doesn't have any facet. */
     public XSFacet getFacet( String name ) { return null; }
 
     public XSVariety getVariety() { return XSVariety.LIST; }
 
+    public XSSimpleType getPrimitiveType() { return null; }
+
     public boolean isUnion() { return true; }
     public XSUnionSimpleType asUnion() { return this; }
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java
index 15a6f5a..dee3e8c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSComplexType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java
index b019803..8e30b78 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java
index c1fdf50..98149ac 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl;
 
 import com.sun.xml.internal.xsom.XSIdentityConstraint;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/package.html b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/package.html
index bb877ed..c734a13 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Implementation of the <code>com.sun.xml.xsom</code> package.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/BaseContentRef.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/BaseContentRef.java
new file mode 100644
index 0000000..9dc4afc
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/BaseContentRef.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.parser;
+
+import com.sun.xml.internal.xsom.impl.Ref;
+import com.sun.xml.internal.xsom.XSContentType;
+import com.sun.xml.internal.xsom.XSType;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+public final class BaseContentRef implements Ref.ContentType, Patch {
+    private final Ref.Type baseType;
+    private final Locator loc;
+
+    public BaseContentRef(final NGCCRuntimeEx $runtime, Ref.Type _baseType) {
+        this.baseType = _baseType;
+        $runtime.addPatcher(this);
+        $runtime.addErrorChecker(new Patch() {
+            public void run() throws SAXException {
+                XSType t = baseType.getType();
+                if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
+                    $runtime.reportError(
+                        Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
+                            t.getTargetNamespace(), t.getName()), loc);
+                }
+            }
+        });
+        this.loc = $runtime.copyLocator();
+    }
+
+    public XSContentType getContentType() {
+        XSType t = baseType.getType();
+        if(t.asComplexType()!=null)
+            return t.asComplexType().getContentType();
+        else
+            return t.asSimpleType();
+    }
+
+    public void run() throws SAXException {
+        if (baseType instanceof Patch)
+            ((Patch) baseType).run();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java
index 1b00022..a1a9927 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java
index ec2f1db..5faea26 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,10 +48,9 @@
  * after all the schemas are parsed.
  */
 public abstract class DelayedRef implements Patch {
-    DelayedRef( PatcherManager _manager, Locator _source,
-        SchemaImpl _schema, UName _name ) {
+    DelayedRef( PatcherManager _manager, Locator _source, SchemaImpl _schema, UName _name ) {
 
-        this.schema = _schema.getParent();
+        this.schema = _schema.getRoot();
         this.manager = _manager;
         this.name = _name;
         this.source = _source;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java
index a70389f..e0cb997 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,4 +73,7 @@
 
     public static final String ERR_ENTITY_RESOLUTION_FAILURE =
         "EntityResolutionFailure"; // arg:2
+
+    public static final String ERR_SIMPLE_CONTENT_EXPECTED =
+        "SimpleContentExpected"; // arg:2
 }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties
index a288f4f..6673c2f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 UndefinedSimpleType = \
 	undefined simple type ''{0}''
 
@@ -42,5 +67,7 @@
 
 EntityResolutionFailure = \
 	failed to retrieve ''{0}'': {1}
-	
+
+SimpleContentExpected = \
+  A complex type with a simple content or a simple type is expected but found ''{0}'':{1}
  
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties
index 4443274..aad85b9 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 UndefinedSimpleType = \
 	\u672A\u5B9A\u7FA9\u306E\u30B7\u30F3\u30D7\u30EB\u30BF\u30A4\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
index 339383c..c0eaf3e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,15 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser;
 
 import com.sun.xml.internal.xsom.XSDeclaration;
 import com.sun.xml.internal.xsom.XmlString;
+import com.sun.xml.internal.xsom.XSSimpleType;
 import com.sun.xml.internal.xsom.impl.ForeignAttributesImpl;
 import com.sun.xml.internal.xsom.impl.SchemaImpl;
 import com.sun.xml.internal.xsom.impl.UName;
+import com.sun.xml.internal.xsom.impl.Const;
 import com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime;
 import com.sun.xml.internal.xsom.impl.parser.state.Schema;
 import com.sun.xml.internal.xsom.impl.util.Uri;
@@ -127,17 +128,32 @@
     }
 
     public void checkDoubleDefError( XSDeclaration c ) throws SAXException {
-        if(c==null) return;
+        if(c==null || ignorableDuplicateComponent(c)) return;
+
         reportError( Messages.format(Messages.ERR_DOUBLE_DEFINITION,c.getName()) );
         reportError( Messages.format(Messages.ERR_DOUBLE_DEFINITION_ORIGINAL), c.getLocator() );
     }
 
+    public static boolean ignorableDuplicateComponent(XSDeclaration c) {
+        if(c.getTargetNamespace().equals(Const.schemaNamespace)) {
+            if(c instanceof XSSimpleType)
+                // hide artificial "double definitions" on simple types
+                return true;
+            if(c.isGlobal() && c.getName().equals("anyType"))
+                return true; // ditto for anyType
+        }
+        return false;
+    }
+
 
 
     /* registers a patcher that will run after all the parsing has finished. */
     public void addPatcher( Patch patcher ) {
         parser.patcherManager.addPatcher(patcher);
     }
+    public void addErrorChecker( Patch patcher ) {
+        parser.patcherManager.addErrorChecker(patcher);
+    }
     public void reportError( String msg, Locator loc ) throws SAXException {
         parser.patcherManager.reportError(msg,loc);
     }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java
index 99f984d..bd6c01a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser;
 
 import com.sun.xml.internal.xsom.XSSchemaSet;
@@ -65,6 +64,7 @@
 
 
     private final Vector<Patch> patchers = new Vector<Patch>();
+    private final Vector<Patch> errorCheckers = new Vector<Patch>();
 
     /**
      * Documents that are parsed already. Used to avoid cyclic inclusion/double
@@ -85,8 +85,8 @@
 
             SchemaImpl xs = (SchemaImpl)
                 schemaSet.getSchema("http://www.w3.org/2001/XMLSchema");
-            xs.addSimpleType(schemaSet.anySimpleType);
-            xs.addComplexType(schemaSet.anyType);
+            xs.addSimpleType(schemaSet.anySimpleType,true);
+            xs.addComplexType(schemaSet.anyType,true);
         } catch( SAXException e ) {
             // this must be a bug of XSOM
             if(e.getException()!=null)
@@ -124,6 +124,12 @@
         while(itr.hasNext())
             ((ElementDecl)itr.next()).updateSubstitutabilityMap();
 
+        // run all the error checkers
+        for (Patch patcher : errorCheckers)
+            patcher.run();
+        errorCheckers.clear();
+
+
         if(hadError)    return null;
         else            return schemaSet;
     }
@@ -148,6 +154,9 @@
         public void addPatcher( Patch patch ) {
             patchers.add(patch);
         }
+        public void addErrorChecker( Patch patch ) {
+            errorCheckers.add(patch);
+        }
         public void reportError( String msg, Locator src ) throws SAXException {
             // set a flag to true to avoid returning a corrupted object.
             setErrorFlag();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java
index 98225ee..5907139 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java
index 3458d95..55ca9d8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
  */
 public interface PatcherManager {
     void addPatcher( Patch p );
+    void addErrorChecker( Patch p );
     /**
      * Reports an error during the parsing.
      *
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java
index 93acba9..06b2b98 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java
index cea2ab9..ab71e2f 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser;
 
 import com.sun.xml.internal.xsom.impl.SchemaImpl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java
index adc9047..a7ea8a4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd
index ba81ced..d70aeb5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/datatypes.xsd
@@ -1,7 +1,6 @@
 <?xml version='1.0'?>
-
 <!--
- Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -24,7 +23,6 @@
  CA 95054 USA or visit www.sun.com if you need additional information or
  have any questions.
 -->
-
 <!-- XML Schema schema for XML Schemas: Part 2: Datatypes -->
 <!--
 	This file is fed to XSOM to build schema components for built-in datatypes.
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/package.html b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/package.html
index 95405cb..eaaed54 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Parser that reads XML Schema documents and builds an <code>XSSchemaSet</code> object.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java
index f0ab667..bee56d3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 // AttributesImpl.java - default implementation of Attributes.
 // Written by David Megginson, sax@megginson.com
 // NO WARRANTY!  This class is in the public domain.
@@ -67,6 +66,7 @@
  * @since SAX 2.0
  * @author David Megginson,
  *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
+ * @version 2.0
  */
 public class AttributesImpl implements Attributes
 {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java
index ae2c48b..1348e62 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser.state;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java
index 2fe9b57..ff7f94c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser.state;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java
index 42bf262..b9a4571 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser.state;
 
 import org.xml.sax.Attributes;
@@ -31,6 +30,7 @@
 /**
  *
  *
+ * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public abstract class NGCCHandler implements NGCCEventReceiver {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java
index 774ac7b..a01b6de 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser.state;
 
 import org.xml.sax.Attributes;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java
index b8627db..6484806 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.parser.state;
 
 import java.text.MessageFormat;
@@ -51,6 +50,7 @@
  *
  *  <li>TODO: provide support for interleaving.
  *
+ * @version $Id: NGCCRuntime.java,v 1.15 2002/09/29 02:55:48 okajima Exp $
  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public class NGCCRuntime implements ContentHandler, NGCCEventSource {
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java
index ac50629..75acbf4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -85,7 +84,7 @@
 
     private void action0()throws SAXException {
         $runtime.checkDoubleDefError( $runtime.currentSchema.getAttGroupDecl(ag.getName()) );
-            $runtime.currentSchema.addAttGroupDecl(ag);
+            $runtime.currentSchema.addAttGroupDecl(ag,false);
 }
 
     private void action1()throws SAXException {
@@ -94,7 +93,7 @@
 
     private void action2()throws SAXException {
         $runtime.checkDoubleDefError( $runtime.currentSchema.getModelGroupDecl(group.getName()) );
-            $runtime.currentSchema.addModelGroupDecl(group);
+            $runtime.currentSchema.addModelGroupDecl(group,false);
 }
 
     private void action3()throws SAXException {
@@ -110,12 +109,12 @@
 
     private void action5()throws SAXException {
         $runtime.checkDoubleDefError( $runtime.currentSchema.getType(ct.getName()) );
-            $runtime.currentSchema.addComplexType(ct);
+            $runtime.currentSchema.addComplexType(ct,false);
 }
 
     private void action6()throws SAXException {
         $runtime.checkDoubleDefError( $runtime.currentSchema.getType(st.getName()) );
-            $runtime.currentSchema.addSimpleType(st);
+            $runtime.currentSchema.addSimpleType(st,false);
 }
 
     private void action7()throws SAXException {
@@ -195,6 +194,30 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 41:
+            {
+                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 37;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 16:
+            {
+                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 12;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 45:
             {
                 if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
@@ -207,16 +230,9 @@
                 }
             }
             break;
-        case 57:
+        case 0:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    action15();
-                    $_ngcc_current_state = 53;
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
+                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
         case 12:
@@ -231,25 +247,37 @@
                 }
             }
             break;
+        case 53:
+            {
+                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 49;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 174, anno,AnnotationContext.SCHEMA);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 376, anno,AnnotationContext.SCHEMA);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
-                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 175);
+                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 377);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
-                            NGCCHandler h = new importDecl(this, super._source, $runtime, 176);
+                            NGCCHandler h = new importDecl(this, super._source, $runtime, 378);
                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                         }
                         else {
                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
-                                NGCCHandler h = new redefine(this, super._source, $runtime, 177);
+                                NGCCHandler h = new redefine(this, super._source, $runtime, 379);
                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                             }
                             else {
@@ -260,12 +288,12 @@
                                 }
                                 else {
                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 179);
+                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 381);
                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                     }
                                     else {
                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                                            NGCCHandler h = new complexType(this, super._source, $runtime, 180);
+                                            NGCCHandler h = new complexType(this, super._source, $runtime, 382);
                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                         }
                                         else {
@@ -276,17 +304,17 @@
                                             }
                                             else {
                                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
-                                                    NGCCHandler h = new group(this, super._source, $runtime, 182);
+                                                    NGCCHandler h = new group(this, super._source, $runtime, 384);
                                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                 }
                                                 else {
                                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
-                                                        NGCCHandler h = new notation(this, super._source, $runtime, 183);
+                                                        NGCCHandler h = new notation(this, super._source, $runtime, 385);
                                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                     }
                                                     else {
                                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 184);
+                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 386);
                                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                         }
                                                         else {
@@ -305,10 +333,10 @@
                 }
             }
             break;
-        case 11:
+        case 27:
             {
-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","form"))>=0)) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 80, locator,false,defaultValue,fixedValue);
+                if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -316,10 +344,10 @@
                 }
             }
             break;
-        case 27:
+        case 11:
             {
-                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
+                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0)) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -327,25 +355,37 @@
                 }
             }
             break;
+        case 57:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    action15();
+                    $_ngcc_current_state = 53;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 163, anno,AnnotationContext.SCHEMA);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 365, anno,AnnotationContext.SCHEMA);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
-                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 164);
+                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 366);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
-                            NGCCHandler h = new importDecl(this, super._source, $runtime, 165);
+                            NGCCHandler h = new importDecl(this, super._source, $runtime, 367);
                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                         }
                         else {
                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
-                                NGCCHandler h = new redefine(this, super._source, $runtime, 166);
+                                NGCCHandler h = new redefine(this, super._source, $runtime, 368);
                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                             }
                             else {
@@ -356,12 +396,12 @@
                                 }
                                 else {
                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 168);
+                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 370);
                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                     }
                                     else {
                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                                            NGCCHandler h = new complexType(this, super._source, $runtime, 169);
+                                            NGCCHandler h = new complexType(this, super._source, $runtime, 371);
                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                         }
                                         else {
@@ -372,17 +412,17 @@
                                             }
                                             else {
                                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
-                                                    NGCCHandler h = new group(this, super._source, $runtime, 171);
+                                                    NGCCHandler h = new group(this, super._source, $runtime, 373);
                                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                 }
                                                 else {
                                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
-                                                        NGCCHandler h = new notation(this, super._source, $runtime, 172);
+                                                        NGCCHandler h = new notation(this, super._source, $runtime, 374);
                                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                     }
                                                     else {
                                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 173);
+                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 375);
                                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                                         }
                                                         else {
@@ -400,29 +440,6 @@
                 }
             }
             break;
-        case 41:
-            {
-                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 37;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 36:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 186, null);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 49:
             {
                 if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
@@ -435,23 +452,17 @@
                 }
             }
             break;
-        case 16:
+        case 36:
             {
-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 388, null);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 12;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                    unexpectedEnterElement($__qname);
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         case 37:
             {
                 if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
@@ -464,18 +475,6 @@
                 }
             }
             break;
-        case 53:
-            {
-                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 49;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -490,6 +489,30 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 41:
+            {
+                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 37;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 16:
+            {
+                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 12;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 45:
             {
                 if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
@@ -502,6 +525,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 12:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -514,17 +542,29 @@
                 }
             }
             break;
+        case 53:
+            {
+                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 49;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 26:
+        case 27:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 1;
+                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
+                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
                     unexpectedLeaveElement($__qname);
@@ -533,53 +573,8 @@
             break;
         case 11:
             {
-                if(((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 80, locator,false,defaultValue,fixedValue);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 27:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 1:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 41:
-            {
-                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 37;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 36:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 186, null);
+                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -598,6 +593,17 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 49:
             {
                 if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
@@ -610,23 +616,17 @@
                 }
             }
             break;
-        case 16:
+        case 36:
             {
-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 388, null);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 12;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                    unexpectedLeaveElement($__qname);
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 37:
             {
                 if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
@@ -639,15 +639,14 @@
                 }
             }
             break;
-        case 53:
+        case 26:
             {
-                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 1;
                 }
                 else {
-                    $_ngcc_current_state = 49;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                    unexpectedLeaveElement($__qname);
                 }
             }
             break;
@@ -665,17 +664,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 45:
-            {
-                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
-                    $_ngcc_current_state = 47;
-                }
-                else {
-                    $_ngcc_current_state = 41;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         case 41:
             {
                 if(($__uri.equals("") && $__local.equals("blockDefault"))) {
@@ -687,24 +675,13 @@
                 }
             }
             break;
-        case 12:
+        case 45:
             {
-                if(($__uri.equals("") && $__local.equals("fixed"))) {
-                    $_ngcc_current_state = 14;
+                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
+                    $_ngcc_current_state = 47;
                 }
                 else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 49:
-            {
-                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
-                    $_ngcc_current_state = 51;
-                }
-                else {
-                    $_ngcc_current_state = 45;
+                    $_ngcc_current_state = 41;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -720,10 +697,15 @@
                 }
             }
             break;
-        case 2:
+        case 12:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("fixed"))) {
+                    $_ngcc_current_state = 14;
+                }
+                else {
+                    $_ngcc_current_state = 11;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
             }
             break;
         case 0:
@@ -731,17 +713,6 @@
                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 37:
-            {
-                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
-                    $_ngcc_current_state = 39;
-                }
-                else {
-                    $_ngcc_current_state = 36;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         case 53:
             {
                 if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
@@ -753,10 +724,16 @@
                 }
             }
             break;
-        case 11:
+        case 2:
             {
-                if((($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("form")))) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 80, locator,false,defaultValue,fixedValue);
+                $_ngcc_current_state = 1;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 27:
+            {
+                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -764,10 +741,32 @@
                 }
             }
             break;
-        case 27:
+        case 49:
             {
-                if((($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("block")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
+                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
+                    $_ngcc_current_state = 51;
+                }
+                else {
+                    $_ngcc_current_state = 45;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 37:
+            {
+                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
+                    $_ngcc_current_state = 39;
+                }
+                else {
+                    $_ngcc_current_state = 36;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 11:
+            {
+                if((($__uri.equals("") && $__local.equals("form")) || ($__uri.equals("") && $__local.equals("name")))) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -789,26 +788,39 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 41:
+            {
+                $_ngcc_current_state = 37;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 16:
+            {
+                $_ngcc_current_state = 12;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 45:
             {
                 $_ngcc_current_state = 41;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 12:
             {
                 $_ngcc_current_state = 11;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 46:
+        case 53:
             {
-                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
-                    $_ngcc_current_state = 41;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
+                $_ngcc_current_state = 49;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 2:
@@ -817,20 +829,20 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 42:
+        case 50:
             {
-                if(($__uri.equals("") && $__local.equals("blockDefault"))) {
-                    $_ngcc_current_state = 37;
+                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
+                    $_ngcc_current_state = 45;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 13:
+        case 54:
             {
-                if(($__uri.equals("") && $__local.equals("fixed"))) {
-                    $_ngcc_current_state = 11;
+                if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
+                    $_ngcc_current_state = 49;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -847,10 +859,14 @@
                 }
             }
             break;
-        case 41:
+        case 42:
             {
-                $_ngcc_current_state = 37;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("blockDefault"))) {
+                    $_ngcc_current_state = 37;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
             }
             break;
         case 17:
@@ -869,43 +885,26 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 16:
-            {
-                $_ngcc_current_state = 12;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 37:
             {
                 $_ngcc_current_state = 36;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 53:
+        case 13:
             {
-                $_ngcc_current_state = 49;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 54:
-            {
-                if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
-                    $_ngcc_current_state = 49;
+                if(($__uri.equals("") && $__local.equals("fixed"))) {
+                    $_ngcc_current_state = 11;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 50:
+        case 46:
             {
-                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
-                    $_ngcc_current_state = 45;
+                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
+                    $_ngcc_current_state = 41;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -923,112 +922,6 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 14:
-            {
-                fixedValue = $value;
-                $_ngcc_current_state = 13;
-            }
-            break;
-        case 45:
-            {
-                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 41;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 12:
-            {
-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 43:
-            {
-                NGCCHandler h = new ersSet(this, super._source, $runtime, 193);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 11:
-            {
-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 80, locator,false,defaultValue,fixedValue);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 80, locator,false,defaultValue,fixedValue);
-                        spawnChildFromText(h, $value);
-                    }
-                }
-            }
-            break;
-        case 39:
-            {
-                NGCCHandler h = new erSet(this, super._source, $runtime, 188);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 27:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                        spawnChildFromText(h, $value);
-                    }
-                    else {
-                        if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                            spawnChildFromText(h, $value);
-                        }
-                        else {
-                            if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                                spawnChildFromText(h, $value);
-                            }
-                            else {
-                                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                                    spawnChildFromText(h, $value);
-                                }
-                                else {
-                                    if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                                        spawnChildFromText(h, $value);
-                                    }
-                                    else {
-                                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 98, locator,true);
-                                            spawnChildFromText(h, $value);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            break;
         case 41:
             {
                 if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
@@ -1041,44 +934,10 @@
                 }
             }
             break;
-        case 47:
+        case 39:
             {
-                if($value.equals("unqualified")) {
-                    NGCCHandler h = new qualification(this, super._source, $runtime, 198);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if($value.equals("qualified")) {
-                        NGCCHandler h = new qualification(this, super._source, $runtime, 198);
-                        spawnChildFromText(h, $value);
-                    }
-                }
-            }
-            break;
-        case 51:
-            {
-                if($value.equals("unqualified")) {
-                    NGCCHandler h = new qualification(this, super._source, $runtime, 203);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if($value.equals("qualified")) {
-                        NGCCHandler h = new qualification(this, super._source, $runtime, 203);
-                        spawnChildFromText(h, $value);
-                    }
-                }
-            }
-            break;
-        case 49:
-            {
-                if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 45;
-                    $runtime.sendText(super._cookie, $value);
-                }
+                NGCCHandler h = new erSet(this, super._source, $runtime, 390);
+                spawnChildFromText(h, $value);
             }
             break;
         case 16:
@@ -1093,6 +952,32 @@
                 }
             }
             break;
+        case 45:
+            {
+                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 41;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 51:
+            {
+                if($value.equals("unqualified")) {
+                    NGCCHandler h = new qualification(this, super._source, $runtime, 405);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if($value.equals("qualified")) {
+                        NGCCHandler h = new qualification(this, super._source, $runtime, 405);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
         case 18:
             {
                 defaultValue = $value;
@@ -1104,14 +989,14 @@
                 revertToParentFromText(this, super._cookie, $value);
             }
             break;
-        case 37:
+        case 12:
             {
-                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendText(super._cookie, $value);
                 }
                 else {
-                    $_ngcc_current_state = 36;
+                    $_ngcc_current_state = 11;
                     $runtime.sendText(super._cookie, $value);
                 }
             }
@@ -1128,179 +1013,293 @@
                 }
             }
             break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 27:
+            {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                        spawnChildFromText(h, $value);
+                    }
+                    else {
+                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                            spawnChildFromText(h, $value);
+                        }
+                        else {
+                            if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                                spawnChildFromText(h, $value);
+                            }
+                            else {
+                                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                                    spawnChildFromText(h, $value);
+                                }
+                                else {
+                                    if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                                        spawnChildFromText(h, $value);
+                                    }
+                                    else {
+                                        if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+                                            spawnChildFromText(h, $value);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            break;
+        case 11:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
+        case 47:
+            {
+                if($value.equals("unqualified")) {
+                    NGCCHandler h = new qualification(this, super._source, $runtime, 400);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if($value.equals("qualified")) {
+                        NGCCHandler h = new qualification(this, super._source, $runtime, 400);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
+        case 43:
+            {
+                NGCCHandler h = new ersSet(this, super._source, $runtime, 395);
+                spawnChildFromText(h, $value);
+            }
+            break;
         case 55:
             {
                 $_ngcc_current_state = 54;
             }
             break;
+        case 14:
+            {
+                fixedValue = $value;
+                $_ngcc_current_state = 13;
+            }
+            break;
+        case 49:
+            {
+                if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 45;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 37:
+            {
+                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 36;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 80:
-            {
-                ad = ((AttributeDeclImpl)$__result__);
-                action3();
-                $_ngcc_current_state = 10;
-            }
-            break;
-        case 98:
-            {
-                e = ((ElementDecl)$__result__);
-                action7();
-                $_ngcc_current_state = 26;
-            }
-            break;
-        case 163:
-            {
-                anno = ((AnnotationImpl)$__result__);
-                action9();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 164:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 165:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 166:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 168:
-            {
-                st = ((SimpleTypeImpl)$__result__);
-                action6();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 169:
-            {
-                ct = ((ComplexTypeImpl)$__result__);
-                action5();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 171:
-            {
-                group = ((ModelGroupDeclImpl)$__result__);
-                action2();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 172:
-            {
-                notation = ((XSNotation)$__result__);
-                action1();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 173:
-            {
-                ag = ((AttGroupDeclImpl)$__result__);
-                action0();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 198:
-            {
-                efd = ((Boolean)$__result__).booleanValue();
-                action13();
-                $_ngcc_current_state = 46;
-            }
-            break;
-        case 203:
-            {
-                afd = ((Boolean)$__result__).booleanValue();
-                action14();
-                $_ngcc_current_state = 50;
-            }
-            break;
-        case 186:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                action10();
-                $_ngcc_current_state = 2;
-            }
-            break;
-        case 174:
-            {
-                anno = ((AnnotationImpl)$__result__);
-                action9();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 175:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 176:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 177:
-            {
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 179:
-            {
-                st = ((SimpleTypeImpl)$__result__);
-                action6();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 180:
-            {
-                ct = ((ComplexTypeImpl)$__result__);
-                action5();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 182:
-            {
-                group = ((ModelGroupDeclImpl)$__result__);
-                action2();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 183:
-            {
-                notation = ((XSNotation)$__result__);
-                action1();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 184:
-            {
-                ag = ((AttGroupDeclImpl)$__result__);
-                action0();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 193:
+        case 395:
             {
                 blockDefault = ((Integer)$__result__);
                 action12();
                 $_ngcc_current_state = 42;
             }
             break;
-        case 188:
+        case 388:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                action10();
+                $_ngcc_current_state = 2;
+            }
+            break;
+        case 390:
             {
                 finalDefault = ((Integer)$__result__);
                 action11();
                 $_ngcc_current_state = 38;
             }
             break;
+        case 405:
+            {
+                afd = ((Boolean)$__result__).booleanValue();
+                action14();
+                $_ngcc_current_state = 50;
+            }
+            break;
+        case 300:
+            {
+                e = ((ElementDecl)$__result__);
+                action7();
+                $_ngcc_current_state = 26;
+            }
+            break;
+        case 376:
+            {
+                anno = ((AnnotationImpl)$__result__);
+                action9();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 377:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 378:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 379:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 381:
+            {
+                st = ((SimpleTypeImpl)$__result__);
+                action6();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 382:
+            {
+                ct = ((ComplexTypeImpl)$__result__);
+                action5();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 384:
+            {
+                group = ((ModelGroupDeclImpl)$__result__);
+                action2();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 385:
+            {
+                notation = ((XSNotation)$__result__);
+                action1();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 386:
+            {
+                ag = ((AttGroupDeclImpl)$__result__);
+                action0();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 282:
+            {
+                ad = ((AttributeDeclImpl)$__result__);
+                action3();
+                $_ngcc_current_state = 10;
+            }
+            break;
+        case 400:
+            {
+                efd = ((Boolean)$__result__).booleanValue();
+                action13();
+                $_ngcc_current_state = 46;
+            }
+            break;
+        case 365:
+            {
+                anno = ((AnnotationImpl)$__result__);
+                action9();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 366:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 367:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 368:
+            {
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 370:
+            {
+                st = ((SimpleTypeImpl)$__result__);
+                action6();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 371:
+            {
+                ct = ((ComplexTypeImpl)$__result__);
+                action5();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 373:
+            {
+                group = ((ModelGroupDeclImpl)$__result__);
+                action2();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 374:
+            {
+                notation = ((XSNotation)$__result__);
+                action1();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 375:
+            {
+                ag = ((AttGroupDeclImpl)$__result__);
+                action0();
+                $_ngcc_current_state = 1;
+            }
+            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java
index e8af9f5..5163854 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -98,6 +97,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 2:
             {
                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
@@ -106,7 +116,7 @@
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 219);
+                        NGCCHandler h = new simpleType(this, super._source, $runtime, 3);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
@@ -115,11 +125,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         case 10:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
@@ -135,7 +140,7 @@
         case 7:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 225, annotation,AnnotationContext.SIMPLETYPE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 9, annotation,AnnotationContext.SIMPLETYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -144,15 +149,9 @@
                 }
             }
             break;
-        case 9:
+        case 0:
             {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 227, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
         default:
@@ -169,6 +168,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 2:
             {
                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
@@ -180,11 +190,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
@@ -203,15 +208,9 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 9:
+        case 0:
             {
-                if((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 227, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         default:
@@ -228,6 +227,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if(($__uri.equals("") && $__local.equals("itemType"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
         case 2:
             {
                 if(($__uri.equals("") && $__local.equals("itemType"))) {
@@ -238,26 +248,15 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 7:
             {
                 $_ngcc_current_state = 2;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 9:
+        case 0:
             {
-                if(($__uri.equals("") && $__local.equals("itemType"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 227, fa);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         default:
@@ -274,17 +273,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 7:
             {
                 $_ngcc_current_state = 2;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 if(($__uri.equals("") && $__local.equals("itemType"))) {
@@ -308,10 +307,18 @@
         switch($_ngcc_current_state) {
         case 5:
             {
-                NGCCHandler h = new qname(this, super._source, $runtime, 221);
+                NGCCHandler h = new qname(this, super._source, $runtime, 5);
                 spawnChildFromText(h, $value);
             }
             break;
+        case 9:
+            {
+                if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+                    spawnChildFromText(h, $value);
+                }
+            }
+            break;
         case 2:
             {
                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
@@ -320,23 +327,15 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(result, super._cookie, $value);
-            }
-            break;
         case 7:
             {
                 $_ngcc_current_state = 2;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 9:
+        case 0:
             {
-                if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 227, fa);
-                    spawnChildFromText(h, $value);
-                }
+                revertToParentFromText(result, super._cookie, $value);
             }
             break;
         }
@@ -344,26 +343,26 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 221:
+        case 11:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 7;
+            }
+            break;
+        case 5:
             {
                 itemTypeName = ((UName)$__result__);
                 action1();
                 $_ngcc_current_state = 4;
             }
             break;
-        case 219:
+        case 3:
             {
                 itemType = ((SimpleTypeImpl)$__result__);
                 $_ngcc_current_state = 1;
             }
             break;
-        case 227:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 7;
-            }
-            break;
-        case 225:
+        case 9:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 2;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java
index 4b9bb65..e9edd6d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -104,15 +103,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 10:
+        case 1:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 604, annotation,AnnotationContext.SIMPLETYPE_DECL);
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    NGCCHandler h = new facet(this, super._source, $runtime, 40);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 5;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                    unexpectedEnterElement($__qname);
                 }
             }
             break;
@@ -133,47 +131,18 @@
                 }
             }
             break;
-        case 4:
+        case 10:
             {
-                action1();
-                $_ngcc_current_state = 2;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 1:
-            {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    NGCCHandler h = new facet(this, super._source, $runtime, 593);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 51, annotation,AnnotationContext.SIMPLETYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 2:
-            {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    NGCCHandler h = new facet(this, super._source, $runtime, 594);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 5;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
-        case 12:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (($ai = $runtime.getAttributeIndex("","base"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 606, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
@@ -182,7 +151,7 @@
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 598);
+                        NGCCHandler h = new simpleType(this, super._source, $runtime, 45);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
@@ -191,6 +160,36 @@
                 }
             }
             break;
+        case 12:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","base"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 4:
+            {
+                action1();
+                $_ngcc_current_state = 2;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 2:
+            {
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    NGCCHandler h = new facet(this, super._source, $runtime, 41);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -205,24 +204,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 10:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 4:
-            {
-                action1();
-                $_ngcc_current_state = 2;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
@@ -234,21 +215,15 @@
                 }
             }
             break;
-        case 2:
+        case 0:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 12:
+        case 10:
             {
-                if((($ai = $runtime.getAttributeIndex("","base"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 606, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
+                $_ngcc_current_state = 5;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 5:
@@ -262,6 +237,30 @@
                 }
             }
             break;
+        case 12:
+            {
+                if((($ai = $runtime.getAttributeIndex("","base"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 4:
+            {
+                action1();
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -276,15 +275,36 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 10:
             {
                 $_ngcc_current_state = 5;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 5:
             {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    $_ngcc_current_state = 8;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 12:
+            {
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
             }
             break;
         case 4:
@@ -300,27 +320,6 @@
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 12:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 606, fa);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 5:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 8;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -335,27 +334,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 10:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 0:
             {
                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 4:
+        case 10:
             {
-                action1();
-                $_ngcc_current_state = 2;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
+                $_ngcc_current_state = 5;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -369,6 +355,19 @@
                 }
             }
             break;
+        case 4:
+            {
+                action1();
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -380,15 +379,37 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromText(result, super._cookie, $value);
+            }
+            break;
         case 10:
             {
                 $_ngcc_current_state = 5;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 0:
+        case 5:
             {
-                revertToParentFromText(result, super._cookie, $value);
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 12:
+            {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
+                    spawnChildFromText(h, $value);
+                }
+            }
+            break;
+        case 8:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 47);
+                spawnChildFromText(h, $value);
             }
             break;
         case 4:
@@ -404,72 +425,50 @@
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 8:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 600);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 12:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 606, fa);
-                    spawnChildFromText(h, $value);
-                }
-            }
-            break;
-        case 5:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 604:
+        case 40:
+            {
+                facet = ((XSFacet)$__result__);
+                action0();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 51:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 5;
             }
             break;
-        case 593:
+        case 47:
             {
-                facet = ((XSFacet)$__result__);
-                action0();
-                $_ngcc_current_state = 1;
+                baseTypeName = ((UName)$__result__);
+                action2();
+                $_ngcc_current_state = 7;
             }
             break;
-        case 606:
+        case 53:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 10;
             }
             break;
-        case 598:
+        case 45:
             {
                 baseType = ((SimpleTypeImpl)$__result__);
                 $_ngcc_current_state = 4;
             }
             break;
-        case 594:
+        case 41:
             {
                 facet = ((XSFacet)$__result__);
                 action0();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 600:
-            {
-                baseTypeName = ((UName)$__result__);
-                action2();
-                $_ngcc_current_state = 7;
-            }
-            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java
index 9fe2e0e..ead3131 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -110,33 +109,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 1:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 631);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 6:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 637, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 7:
             {
                 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
@@ -161,10 +133,26 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 1:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+                    NGCCHandler h = new simpleType(this, super._source, $runtime, 682);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 632);
+                    NGCCHandler h = new simpleType(this, super._source, $runtime, 683);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -176,7 +164,7 @@
         case 4:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 635, annotation,AnnotationContext.SIMPLETYPE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 686, annotation,AnnotationContext.SIMPLETYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -185,6 +173,17 @@
                 }
             }
             break;
+        case 6:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -199,6 +198,18 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 7:
+            {
+                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 6;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 0:
             {
                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
@@ -216,29 +227,6 @@
                 }
             }
             break;
-        case 6:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 637, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 7:
-            {
-                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 6;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -251,6 +239,17 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 6:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -265,11 +264,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 7:
             {
                 if(($__uri.equals("") && $__local.equals("memberTypes"))) {
@@ -281,6 +275,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -307,27 +306,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 8:
-            {
-                if(($__uri.equals("") && $__local.equals("memberTypes"))) {
-                    $_ngcc_current_state = 6;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 7:
             {
                 $_ngcc_current_state = 6;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -340,6 +329,16 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 8:
+            {
+                if(($__uri.equals("") && $__local.equals("memberTypes"))) {
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -351,23 +350,6 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromText(result, super._cookie, $value);
-            }
-            break;
-        case 9:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 639);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 8:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 640);
-                spawnChildFromText(h, $value);
-            }
-            break;
         case 7:
             {
                 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
@@ -380,6 +362,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromText(result, super._cookie, $value);
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -399,51 +386,63 @@
                 action3();
             }
             break;
+        case 9:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 690);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 8:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 691);
+                spawnChildFromText(h, $value);
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 637:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 4;
-            }
-            break;
-        case 640:
-            {
-                memberTypeName = ((UName)$__result__);
-                action2();
-                $_ngcc_current_state = 8;
-            }
-            break;
-        case 631:
+        case 682:
             {
                 anonymousMemberType = ((SimpleTypeImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 639:
-            {
-                memberTypeName = ((UName)$__result__);
-                action2();
-                $_ngcc_current_state = 8;
-            }
-            break;
-        case 632:
+        case 683:
             {
                 anonymousMemberType = ((SimpleTypeImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 635:
+        case 691:
+            {
+                memberTypeName = ((UName)$__result__);
+                action2();
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 690:
+            {
+                memberTypeName = ((UName)$__result__);
+                action2();
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 686:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 2;
             }
             break;
+        case 688:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 4;
+            }
+            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java
index 7423a23..4d269db 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -86,11 +85,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
@@ -103,6 +97,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -117,6 +116,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
@@ -128,11 +132,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java
index d445573..71d1dd0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -91,10 +90,22 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","type"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 7:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 686, null,AnnotationContext.ATTRIBUTE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 216, null,AnnotationContext.ATTRIBUTE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -103,6 +114,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         case 1:
             {
                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
@@ -111,7 +127,7 @@
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 677);
+                        NGCCHandler h = new simpleType(this, super._source, $runtime, 207);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
@@ -121,29 +137,6 @@
                 }
             }
             break;
-        case 9:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","type"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 12:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
@@ -156,9 +149,15 @@
                 }
             }
             break;
-        case 0:
+        case 12:
             {
-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
             }
             break;
         default:
@@ -175,12 +174,29 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 7:
             {
                 $_ngcc_current_state = 1;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
@@ -193,29 +209,6 @@
                 }
             }
             break;
-        case 9:
-            {
-                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 12:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
@@ -228,9 +221,15 @@
                 }
             }
             break;
-        case 0:
+        case 12:
             {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
             }
             break;
         default:
@@ -247,12 +246,29 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 9:
+            {
+                if(($__uri.equals("") && $__local.equals("type"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 7:
             {
                 $_ngcc_current_state = 1;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("") && $__local.equals("type"))) {
@@ -264,28 +280,6 @@
                 }
             }
             break;
-        case 9:
-            {
-                if(($__uri.equals("") && $__local.equals("type"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 12:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 11;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
         case 13:
             {
                 if(($__uri.equals("") && $__local.equals("form"))) {
@@ -297,9 +291,14 @@
                 }
             }
             break;
-        case 0:
+        case 12:
             {
-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 11;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
             }
             break;
         default:
@@ -316,6 +315,28 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 10:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 9;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 9:
+            {
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
+            }
+            break;
+        case 7:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 14:
             {
                 if(($__uri.equals("") && $__local.equals("form"))) {
@@ -326,9 +347,14 @@
                 }
             }
             break;
-        case 7:
+        case 0:
             {
-                $_ngcc_current_state = 1;
+                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -342,39 +368,12 @@
                 }
             }
             break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 10:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 9;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 9:
-            {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
-            }
-            break;
         case 13:
             {
                 $_ngcc_current_state = 12;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -386,12 +385,55 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 15:
+            {
+                if($value.equals("unqualified")) {
+                    NGCCHandler h = new qualification(this, super._source, $runtime, 223);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if($value.equals("qualified")) {
+                        NGCCHandler h = new qualification(this, super._source, $runtime, 223);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
+        case 5:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 209);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 9:
+            {
+                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+                    spawnChildFromText(h, $value);
+                }
+            }
+            break;
         case 7:
             {
                 $_ngcc_current_state = 1;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
+        case 11:
+            {
+                name = $value;
+                $_ngcc_current_state = 10;
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromText(makeResult(), super._cookie, $value);
+            }
+            break;
         case 1:
             {
                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
@@ -404,52 +446,6 @@
                 }
             }
             break;
-        case 9:
-            {
-                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
-                    spawnChildFromText(h, $value);
-                }
-            }
-            break;
-        case 11:
-            {
-                name = $value;
-                $_ngcc_current_state = 10;
-            }
-            break;
-        case 12:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 5:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 679);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 15:
-            {
-                if($value.equals("unqualified")) {
-                    NGCCHandler h = new qualification(this, super._source, $runtime, 693);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if($value.equals("qualified")) {
-                        NGCCHandler h = new qualification(this, super._source, $runtime, 693);
-                        spawnChildFromText(h, $value);
-                    }
-                }
-            }
-            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
@@ -462,9 +458,12 @@
                 }
             }
             break;
-        case 0:
+        case 12:
             {
-                revertToParentFromText(makeResult(), super._cookie, $value);
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
             }
             break;
         }
@@ -472,43 +471,43 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 677:
-            {
-                type = ((SimpleTypeImpl)$__result__);
-                $_ngcc_current_state = 0;
-            }
-            break;
-        case 688:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 7;
-            }
-            break;
-        case 693:
+        case 223:
             {
                 form = ((Boolean)$__result__).booleanValue();
                 action1();
                 $_ngcc_current_state = 14;
             }
             break;
-        case 679:
+        case 216:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 218:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 7;
+            }
+            break;
+        case 207:
+            {
+                type = ((SimpleTypeImpl)$__result__);
+                $_ngcc_current_state = 0;
+            }
+            break;
+        case 209:
             {
                 typeName = ((UName)$__result__);
                 action0();
                 $_ngcc_current_state = 4;
             }
             break;
-        case 686:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 1;
-            }
-            break;
         }
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 7) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
+        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 7))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java
index a7c4395..7d781aa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -82,34 +81,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 360, null,AnnotationContext.ATTRIBUTE_GROUP);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 3;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 6:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 362, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 7:
             {
                 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
@@ -122,12 +93,24 @@
                 }
             }
             break;
-        case 13:
+        case 4:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 17, null,AnnotationContext.ATTRIBUTE_GROUP);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 3;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
+            }
+            break;
+        case 6:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 19, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
                 else {
                     unexpectedEnterElement($__qname);
                 }
@@ -145,6 +128,22 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 13:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 3:
             {
                 action0();
@@ -155,7 +154,7 @@
         case 2:
             {
                 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 357, result);
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 14, result);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -177,28 +176,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 6:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 362, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 7:
             {
                 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
@@ -211,6 +188,28 @@
                 }
             }
             break;
+        case 4:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 6:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 19, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -222,6 +221,13 @@
                 }
             }
             break;
+        case 3:
+            {
+                action0();
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
@@ -233,17 +239,10 @@
                 }
             }
             break;
-        case 3:
-            {
-                action0();
-                $_ngcc_current_state = 2;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 357, result);
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 14, result);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -265,17 +264,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 7:
             {
                 if(($__uri.equals("") && $__local.equals("id"))) {
@@ -287,6 +275,17 @@
                 }
             }
             break;
+        case 4:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 13:
             {
                 if(($__uri.equals("") && $__local.equals("name"))) {
@@ -328,6 +327,12 @@
                 }
             }
             break;
+        case 7:
+            {
+                $_ngcc_current_state = 6;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 $_ngcc_current_state = 3;
@@ -339,12 +344,6 @@
                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 7:
-            {
-                $_ngcc_current_state = 6;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 3:
             {
                 action0();
@@ -373,23 +372,6 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromText(result, super._cookie, $value);
-            }
-            break;
-        case 12:
-            {
-                name = $value;
-                $_ngcc_current_state = 11;
-            }
-            break;
         case 7:
             {
                 if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
@@ -402,6 +384,28 @@
                 }
             }
             break;
+        case 4:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 9:
+            {
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 12:
+            {
+                name = $value;
+                $_ngcc_current_state = 11;
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromText(result, super._cookie, $value);
+            }
+            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -410,11 +414,6 @@
                 }
             }
             break;
-        case 9:
-            {
-                $_ngcc_current_state = 8;
-            }
-            break;
         case 3:
             {
                 action0();
@@ -427,19 +426,19 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 360:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 3;
-            }
-            break;
-        case 362:
+        case 19:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 4;
             }
             break;
-        case 357:
+        case 17:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 3;
+            }
+            break;
+        case 14:
             {
                 $_ngcc_current_state = 1;
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java
index f070b6f..3e43242 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -142,6 +141,30 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 33:
+            {
+                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 29;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 19:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 621, null,AnnotationContext.ATTRIBUTE_USE);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 18;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 25:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -154,6 +177,108 @@
                 }
             }
             break;
+        case 5:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    action7();
+                    $_ngcc_current_state = 33;
+                }
+                else {
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                        action3();
+                        $_ngcc_current_state = 13;
+                    }
+                    else {
+                        $_ngcc_current_state = 1;
+                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                    }
+                }
+            }
+            break;
+        case 8:
+            {
+                action2();
+                $_ngcc_current_state = 7;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 3:
+            {
+                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 16:
+            {
+                action4();
+                $_ngcc_current_state = 15;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 9:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 610, null,AnnotationContext.ATTRIBUTE_USE);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 8;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 29:
+            {
+                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 25;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 17:
+            {
+                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0)) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                        $runtime.consumeAttribute($ai);
+                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                    }
+                    else {
+                        unexpectedEnterElement($__qname);
+                    }
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 13:
+            {
+                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
@@ -181,132 +306,6 @@
                 }
             }
             break;
-        case 8:
-            {
-                action2();
-                $_ngcc_current_state = 7;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 16:
-            {
-                action4();
-                $_ngcc_current_state = 15;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 17:
-            {
-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","form"))>=0)) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 42, locator,true,defaultValue,fixedValue);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                        $runtime.consumeAttribute($ai);
-                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                    }
-                    else {
-                        unexpectedEnterElement($__qname);
-                    }
-                }
-            }
-            break;
-        case 9:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 24, null,AnnotationContext.ATTRIBUTE_USE);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 8;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 29:
-            {
-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 25;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 19:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 35, null,AnnotationContext.ATTRIBUTE_USE);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 18;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 33:
-            {
-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 29;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 5:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    action7();
-                    $_ngcc_current_state = 33;
-                }
-                else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                        action3();
-                        $_ngcc_current_state = 13;
-                    }
-                    else {
-                        $_ngcc_current_state = 1;
-                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                    }
-                }
-            }
-            break;
-        case 3:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 17, wloc);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 13:
-            {
-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -321,6 +320,24 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 33:
+            {
+                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 29;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 25:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -333,106 +350,12 @@
                 }
             }
             break;
-        case 18:
+        case 5:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 33, null);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
+                $_ngcc_current_state = 1;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 8:
-            {
-                action2();
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 16:
-            {
-                action4();
-                $_ngcc_current_state = 15;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 7:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 1;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 17:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 42, locator,true,defaultValue,fixedValue);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                        $runtime.consumeAttribute($ai);
-                        $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                    }
-                    else {
-                        unexpectedLeaveElement($__qname);
-                    }
-                }
-            }
-            break;
-        case 9:
-            {
-                $_ngcc_current_state = 8;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 29:
-            {
-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 25;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 19:
-            {
-                $_ngcc_current_state = 18;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 33:
-            {
-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 29;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
@@ -455,10 +378,17 @@
                 }
             }
             break;
+        case 8:
+            {
+                action2();
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 3:
             {
                 if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 17, wloc);
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -466,12 +396,75 @@
                 }
             }
             break;
-        case 5:
+        case 16:
             {
-                $_ngcc_current_state = 1;
+                action4();
+                $_ngcc_current_state = 15;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 9:
+            {
+                $_ngcc_current_state = 8;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 29:
+            {
+                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 25;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 7:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 1;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 17:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                        $runtime.consumeAttribute($ai);
+                        $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                    }
+                    else {
+                        unexpectedLeaveElement($__qname);
+                    }
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 18:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 619, null);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 13:
             {
                 if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
@@ -483,6 +476,12 @@
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -497,6 +496,23 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 33:
+            {
+                if(($__uri.equals("") && $__local.equals("use"))) {
+                    $_ngcc_current_state = 35;
+                }
+                else {
+                    $_ngcc_current_state = 29;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 25:
             {
                 if(($__uri.equals("") && $__local.equals("fixed"))) {
@@ -508,9 +524,9 @@
                 }
             }
             break;
-        case 1:
+        case 5:
             {
-                $_ngcc_current_state = 0;
+                $_ngcc_current_state = 1;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -521,6 +537,17 @@
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 3:
+            {
+                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
         case 16:
             {
                 action4();
@@ -528,33 +555,12 @@
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 17:
-            {
-                if((($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("form")))) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 42, locator,true,defaultValue,fixedValue);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    if(($__uri.equals("") && $__local.equals("ref"))) {
-                        $_ngcc_current_state = 22;
-                    }
-                    else {
-                        unexpectedEnterAttribute($__qname);
-                    }
-                }
-            }
-            break;
         case 9:
             {
                 $_ngcc_current_state = 8;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 29:
             {
                 if(($__uri.equals("") && $__local.equals("default"))) {
@@ -566,40 +572,27 @@
                 }
             }
             break;
-        case 19:
+        case 17:
             {
-                $_ngcc_current_state = 18;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 33:
-            {
-                if(($__uri.equals("") && $__local.equals("use"))) {
-                    $_ngcc_current_state = 35;
-                }
-                else {
-                    $_ngcc_current_state = 29;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 5:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 3:
-            {
-                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 17, wloc);
+                if((($__uri.equals("") && $__local.equals("form")) || ($__uri.equals("") && $__local.equals("name")))) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
-                    unexpectedEnterAttribute($__qname);
+                    if(($__uri.equals("") && $__local.equals("ref"))) {
+                        $_ngcc_current_state = 22;
+                    }
+                    else {
+                        unexpectedEnterAttribute($__qname);
+                    }
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 13:
             {
                 if(($__uri.equals("") && $__local.equals("ref"))) {
@@ -610,6 +603,12 @@
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -624,28 +623,40 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 33:
+            {
+                $_ngcc_current_state = 29;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 25:
             {
                 $_ngcc_current_state = 17;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 34:
+        case 5:
             {
-                if(($__uri.equals("") && $__local.equals("use"))) {
-                    $_ngcc_current_state = 29;
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 30:
+            {
+                if(($__uri.equals("") && $__local.equals("default"))) {
+                    $_ngcc_current_state = 25;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 8:
             {
                 action2();
@@ -660,17 +671,22 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 26:
+            {
+                if(($__uri.equals("") && $__local.equals("fixed"))) {
+                    $_ngcc_current_state = 17;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
         case 9:
             {
                 $_ngcc_current_state = 8;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 11:
             {
                 if(($__uri.equals("") && $__local.equals("ref"))) {
@@ -687,22 +703,21 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 19:
+        case 0:
             {
-                $_ngcc_current_state = 18;
+                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 33:
+        case 34:
             {
-                $_ngcc_current_state = 29;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 30:
-            {
-                if(($__uri.equals("") && $__local.equals("default"))) {
-                    $_ngcc_current_state = 25;
+                if(($__uri.equals("") && $__local.equals("use"))) {
+                    $_ngcc_current_state = 29;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -719,22 +734,6 @@
                 }
             }
             break;
-        case 26:
-            {
-                if(($__uri.equals("") && $__local.equals("fixed"))) {
-                    $_ngcc_current_state = 17;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 5:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -746,6 +745,30 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 33:
+            {
+                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 29;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 12:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 613);
+                spawnChildFromText(h, $value);
+            }
+            break;
         case 25:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -758,41 +781,9 @@
                 }
             }
             break;
-        case 12:
+        case 5:
             {
-                NGCCHandler h = new qname(this, super._source, $runtime, 27);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 31:
-            {
-                defaultValue = $value;
-                $_ngcc_current_state = 30;
-            }
-            break;
-        case 22:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 38);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 8:
-            {
-                action2();
-                $_ngcc_current_state = 7;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 16:
-            {
-                action4();
-                $_ngcc_current_state = 15;
+                $_ngcc_current_state = 1;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
@@ -802,37 +793,52 @@
                 $_ngcc_current_state = 34;
             }
             break;
-        case 17:
+        case 8:
             {
-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 42, locator,true,defaultValue,fixedValue);
+                action2();
+                $_ngcc_current_state = 7;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 3:
+            {
+                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 42, locator,true,defaultValue,fixedValue);
+                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
                         spawnChildFromText(h, $value);
                     }
-                    else {
-                        if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                            $runtime.consumeAttribute($ai);
-                            $runtime.sendText(super._cookie, $value);
-                        }
-                    }
                 }
             }
             break;
+        case 16:
+            {
+                action4();
+                $_ngcc_current_state = 15;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 27:
+            {
+                fixedValue = $value;
+                $_ngcc_current_state = 26;
+            }
+            break;
+        case 31:
+            {
+                defaultValue = $value;
+                $_ngcc_current_state = 30;
+            }
+            break;
         case 9:
             {
                 $_ngcc_current_state = 8;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(this, super._cookie, $value);
-            }
-            break;
         case 29:
             {
                 if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
@@ -845,48 +851,35 @@
                 }
             }
             break;
-        case 19:
+        case 17:
             {
-                $_ngcc_current_state = 18;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 33:
-            {
-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 29;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 3:
-            {
-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 17, wloc);
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 17, wloc);
+                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
                         spawnChildFromText(h, $value);
                     }
+                    else {
+                        if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                            $runtime.consumeAttribute($ai);
+                            $runtime.sendText(super._cookie, $value);
+                        }
+                    }
                 }
             }
             break;
-        case 5:
+        case 0:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
+                revertToParentFromText(this, super._cookie, $value);
             }
             break;
-        case 27:
+        case 22:
             {
-                fixedValue = $value;
-                $_ngcc_current_state = 26;
+                NGCCHandler h = new qname(this, super._source, $runtime, 624);
+                spawnChildFromText(h, $value);
             }
             break;
         case 13:
@@ -897,60 +890,66 @@
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 33:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 16;
-            }
-            break;
-        case 27:
-            {
-                groupName = ((UName)$__result__);
-                $_ngcc_current_state = 11;
-            }
-            break;
-        case 38:
-            {
-                attDeclName = ((UName)$__result__);
-                action5();
-                $_ngcc_current_state = 21;
-            }
-            break;
-        case 42:
-            {
-                anonymousDecl = ((AttributeDeclImpl)$__result__);
-                action6();
-                $_ngcc_current_state = 16;
-            }
-            break;
-        case 24:
-            {
-                $_ngcc_current_state = 8;
-            }
-            break;
-        case 35:
+        case 621:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 18;
             }
             break;
-        case 17:
+        case 603:
             {
                 wildcard = ((WildcardImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 2;
             }
             break;
+        case 610:
+            {
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 628:
+            {
+                anonymousDecl = ((AttributeDeclImpl)$__result__);
+                action6();
+                $_ngcc_current_state = 16;
+            }
+            break;
+        case 619:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 16;
+            }
+            break;
+        case 613:
+            {
+                groupName = ((UName)$__result__);
+                $_ngcc_current_state = 11;
+            }
+            break;
+        case 624:
+            {
+                attDeclName = ((UName)$__result__);
+                action5();
+                $_ngcc_current_state = 21;
+            }
+            break;
         }
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
+        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 5))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java
index cf75ef0..9428e3d 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -125,7 +124,7 @@
 
     private void action8()throws SAXException {
 
-                contentType = new BaseContentRef(baseType);
+                contentType = new BaseContentRef($runtime,baseType);
                 makeResult(XSType.EXTENSION);
                 result.setContentType(contentType);
 
@@ -188,14 +187,59 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 49:
+        case 28:
             {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    NGCCHandler h = new facet(this, super._source, $runtime, 538);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 113, fa);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 48;
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 72:
+            {
+                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 68;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 47:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 135, result);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 18:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 100, result);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 52:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+                    NGCCHandler h = new simpleType(this, super._source, $runtime, 143);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 51;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -207,106 +251,34 @@
                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 59:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 24:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 39:
+        case 61:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 525, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 155, annotation,AnnotationContext.COMPLEXTYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 38;
+                    $_ngcc_current_state = 35;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
-        case 84:
+        case 35:
             {
-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    action15();
+                    $_ngcc_current_state = 59;
                 }
                 else {
-                    $_ngcc_current_state = 80;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 9:
-            {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))))))) {
-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 488, result);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 52:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 542);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 51;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 51:
-            {
-                action13();
-                $_ngcc_current_state = 49;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 21:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 503, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 28:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 512, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                        action10();
+                        $_ngcc_current_state = 44;
+                    }
+                    else {
+                        unexpectedEnterElement($__qname);
+                    }
                 }
             }
             break;
@@ -322,6 +294,90 @@
                 }
             }
             break;
+        case 48:
+            {
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    NGCCHandler h = new facet(this, super._source, $runtime, 138);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    action11();
+                    $_ngcc_current_state = 47;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 49:
+            {
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    NGCCHandler h = new facet(this, super._source, $runtime, 139);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 48;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 59:
+            {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 39:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 126, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 38;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 63;
+                }
+                else {
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
+                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                        $_ngcc_current_state = 29;
+                    }
+                    else {
+                        if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+                            action1();
+                            NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 86, result);
+                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                        }
+                        else {
+                            unexpectedEnterElement($__qname);
+                        }
+                    }
+                }
+            }
+            break;
+        case 65:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 163, null,AnnotationContext.COMPLEXTYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 2;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 68:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -334,82 +390,13 @@
                 }
             }
             break;
-        case 47:
+        case 15:
             {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 534, result);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 80:
-            {
-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 76;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 61:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 554, annotation,AnnotationContext.COMPLEXTYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 35;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 37:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 522, result);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 56:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 547, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 76:
-            {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 72;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 67:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent")))))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 564, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
                     unexpectedEnterElement($__qname);
                 }
             }
@@ -433,97 +420,7 @@
                 }
             }
             break;
-        case 2:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 63;
-                }
-                else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                        $_ngcc_current_state = 29;
-                    }
-                    else {
-                        if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))))))) {
-                            action1();
-                            NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 485, result);
-                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                        }
-                        else {
-                            unexpectedEnterElement($__qname);
-                        }
-                    }
-                }
-            }
-            break;
-        case 12:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 492, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 41:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 527, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 19:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 501, annotation,AnnotationContext.COMPLEXTYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 18;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 35:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    action15();
-                    $_ngcc_current_state = 59;
-                }
-                else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                        action10();
-                        $_ngcc_current_state = 44;
-                    }
-                    else {
-                        unexpectedEnterElement($__qname);
-                    }
-                }
-            }
-            break;
-        case 48:
-            {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    NGCCHandler h = new facet(this, super._source, $runtime, 537);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    action11();
-                    $_ngcc_current_state = 47;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 15:
+        case 24:
             {
                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
                     $runtime.consumeAttribute($ai);
@@ -534,22 +431,10 @@
                 }
             }
             break;
-        case 65:
+        case 21:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 562, null,AnnotationContext.COMPLEXTYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 2;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 18:
-            {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))))))) {
-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 499, result);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 104, fa);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -557,10 +442,52 @@
                 }
             }
             break;
-        case 63:
+        case 54:
             {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 556, fa);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 146, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 52;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 80:
+            {
+                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 76;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 9:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 89, result);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 51:
+            {
+                action13();
+                $_ngcc_current_state = 49;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 12:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 93, fa);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -571,7 +498,7 @@
         case 26:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 510, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 111, annotation,AnnotationContext.COMPLEXTYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -580,6 +507,29 @@
                 }
             }
             break;
+        case 67:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 165, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 10:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 91, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 9;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 29:
             {
                 if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
@@ -592,38 +542,31 @@
                 }
             }
             break;
-        case 54:
+        case 84:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 545, annotation,AnnotationContext.COMPLEXTYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 52;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 72:
-            {
-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 68;
+                    $_ngcc_current_state = 80;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
-        case 10:
+        case 0:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 490, annotation,AnnotationContext.COMPLEXTYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 76:
+            {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 9;
+                    $_ngcc_current_state = 72;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -639,6 +582,62 @@
                 }
             }
             break;
+        case 19:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 102, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 18;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 37:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 123, result);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 41:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 128, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 56:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 148, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 63:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 157, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -653,9 +652,76 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 49:
+        case 1:
             {
-                $_ngcc_current_state = 48;
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 8:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 72:
+            {
+                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 68;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 47:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 135, result);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 18:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 100, result);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 46:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 34;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 52:
+            {
+                $_ngcc_current_state = 51;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -666,9 +732,23 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 61:
             {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+                $_ngcc_current_state = 35;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 48:
+            {
+                action11();
+                $_ngcc_current_state = 47;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 49:
+            {
+                $_ngcc_current_state = 48;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 59:
@@ -682,6 +762,53 @@
                 }
             }
             break;
+        case 39:
+            {
+                $_ngcc_current_state = 38;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+                    action1();
+                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 86, result);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 65:
+            {
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 68:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 67;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 15:
+            {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 24:
             {
                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
@@ -693,74 +820,10 @@
                 }
             }
             break;
-        case 39:
-            {
-                $_ngcc_current_state = 38;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 84:
-            {
-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 80;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 36:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 34;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 9:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 488, result);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 52:
-            {
-                $_ngcc_current_state = 51;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 51:
-            {
-                action13();
-                $_ngcc_current_state = 49;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 34:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 1;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 21:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 503, fa);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 104, fa);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -768,21 +831,9 @@
                 }
             }
             break;
-        case 68:
+        case 54:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 67;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 61:
-            {
-                $_ngcc_current_state = 35;
+                $_ngcc_current_state = 52;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -798,10 +849,10 @@
                 }
             }
             break;
-        case 47:
+        case 9:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 534, result);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 89, result);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -809,6 +860,30 @@
                 }
             }
             break;
+        case 51:
+            {
+                action13();
+                $_ngcc_current_state = 49;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 12:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 93, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 26:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 17:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
@@ -820,10 +895,10 @@
                 }
             }
             break;
-        case 37:
+        case 67:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 522, result);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 165, fa);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -831,9 +906,15 @@
                 }
             }
             break;
-        case 6:
+        case 10:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
+                $_ngcc_current_state = 9;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 34:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
                     $_ngcc_current_state = 1;
                 }
@@ -842,154 +923,6 @@
                 }
             }
             break;
-        case 1:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 56:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 547, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 76:
-            {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 72;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 67:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 564, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 2:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                    action1();
-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 485, result);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 12:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 492, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 8:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 6;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 19:
-            {
-                $_ngcc_current_state = 18;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 41:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 527, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 48:
-            {
-                action11();
-                $_ngcc_current_state = 47;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 15:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 65:
-            {
-                $_ngcc_current_state = 2;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 18:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 499, result);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 46:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 34;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 26:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 29:
             {
                 if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
@@ -1002,28 +935,44 @@
                 }
             }
             break;
-        case 54:
+        case 6:
             {
-                $_ngcc_current_state = 52;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 1;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
             }
             break;
-        case 72:
+        case 84:
             {
-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 68;
+                    $_ngcc_current_state = 80;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
             break;
-        case 10:
+        case 0:
             {
-                $_ngcc_current_state = 9;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 76:
+            {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 72;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
             }
             break;
         case 44:
@@ -1037,6 +986,56 @@
                 }
             }
             break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 37:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 123, result);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 41:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 128, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 56:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 148, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 36:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 34;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -1051,35 +1050,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 76:
-            {
-                if(($__uri.equals("") && $__local.equals("final"))) {
-                    $_ngcc_current_state = 78;
-                }
-                else {
-                    $_ngcc_current_state = 72;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 49:
-            {
-                $_ngcc_current_state = 48;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 38:
-            {
-                action8();
-                $_ngcc_current_state = 37;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 59:
             {
                 if(($__uri.equals("") && $__local.equals("base"))) {
@@ -1090,69 +1060,18 @@
                 }
             }
             break;
-        case 19:
+        case 49:
             {
-                $_ngcc_current_state = 18;
+                $_ngcc_current_state = 48;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 24:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 23;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
         case 39:
             {
                 $_ngcc_current_state = 38;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 48:
-            {
-                action11();
-                $_ngcc_current_state = 47;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 84:
-            {
-                if(($__uri.equals("") && $__local.equals("abstract"))) {
-                    $_ngcc_current_state = 86;
-                }
-                else {
-                    $_ngcc_current_state = 80;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 52:
-            {
-                $_ngcc_current_state = 51;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 15:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 14;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 51:
-            {
-                action13();
-                $_ngcc_current_state = 49;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 65:
             {
                 $_ngcc_current_state = 2;
@@ -1170,9 +1089,29 @@
                 }
             }
             break;
-        case 61:
+        case 15:
             {
-                $_ngcc_current_state = 35;
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    $_ngcc_current_state = 14;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 24:
+            {
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    $_ngcc_current_state = 23;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 54:
+            {
+                $_ngcc_current_state = 52;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -1187,26 +1126,22 @@
                 }
             }
             break;
+        case 51:
+            {
+                action13();
+                $_ngcc_current_state = 49;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 26:
             {
                 $_ngcc_current_state = 7;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 29:
+        case 10:
             {
-                if(($__uri.equals("") && $__local.equals("mixed"))) {
-                    $_ngcc_current_state = 31;
-                }
-                else {
-                    $_ngcc_current_state = 28;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 54:
-            {
-                $_ngcc_current_state = 52;
+                $_ngcc_current_state = 9;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -1221,9 +1156,47 @@
                 }
             }
             break;
-        case 10:
+        case 29:
             {
-                $_ngcc_current_state = 9;
+                if(($__uri.equals("") && $__local.equals("mixed"))) {
+                    $_ngcc_current_state = 31;
+                }
+                else {
+                    $_ngcc_current_state = 28;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 84:
+            {
+                if(($__uri.equals("") && $__local.equals("abstract"))) {
+                    $_ngcc_current_state = 86;
+                }
+                else {
+                    $_ngcc_current_state = 80;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 76:
+            {
+                if(($__uri.equals("") && $__local.equals("final"))) {
+                    $_ngcc_current_state = 78;
+                }
+                else {
+                    $_ngcc_current_state = 72;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 52:
+            {
+                $_ngcc_current_state = 51;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -1237,6 +1210,32 @@
                 }
             }
             break;
+        case 38:
+            {
+                action8();
+                $_ngcc_current_state = 37;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 61:
+            {
+                $_ngcc_current_state = 35;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 48:
+            {
+                action11();
+                $_ngcc_current_state = 47;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -1251,22 +1250,38 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 13:
+        case 42:
             {
                 if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 12;
+                    $_ngcc_current_state = 41;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 49:
+        case 72:
             {
-                $_ngcc_current_state = 48;
+                $_ngcc_current_state = 68;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 52:
+            {
+                $_ngcc_current_state = 51;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 69:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 67;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
         case 38:
             {
                 action8();
@@ -1274,21 +1289,20 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 61:
             {
-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 39:
-            {
-                $_ngcc_current_state = 38;
+                $_ngcc_current_state = 35;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 84:
+        case 81:
             {
-                $_ngcc_current_state = 80;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("block"))) {
+                    $_ngcc_current_state = 76;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
             }
             break;
         case 73:
@@ -1301,9 +1315,56 @@
                 }
             }
             break;
-        case 52:
+        case 48:
             {
-                $_ngcc_current_state = 51;
+                action11();
+                $_ngcc_current_state = 47;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 49:
+            {
+                $_ngcc_current_state = 48;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 39:
+            {
+                $_ngcc_current_state = 38;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 65:
+            {
+                $_ngcc_current_state = 2;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 68:
+            {
+                $_ngcc_current_state = 67;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 57:
+            {
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    $_ngcc_current_state = 56;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 80:
+            {
+                $_ngcc_current_state = 76;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 54:
+            {
+                $_ngcc_current_state = 52;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -1314,6 +1375,40 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 26:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 10:
+            {
+                $_ngcc_current_state = 9;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 29:
+            {
+                $_ngcc_current_state = 28;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 22:
+            {
+                if(($__uri.equals("") && $__local.equals("base"))) {
+                    $_ngcc_current_state = 21;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 84:
+            {
+                $_ngcc_current_state = 80;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 77:
             {
                 if(($__uri.equals("") && $__local.equals("final"))) {
@@ -1324,22 +1419,9 @@
                 }
             }
             break;
-        case 68:
+        case 0:
             {
-                $_ngcc_current_state = 67;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 80:
-            {
-                $_ngcc_current_state = 76;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 61:
-            {
-                $_ngcc_current_state = 35;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 76:
@@ -1358,55 +1440,12 @@
                 }
             }
             break;
-        case 57:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 56;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 19:
             {
                 $_ngcc_current_state = 18;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 48:
-            {
-                action11();
-                $_ngcc_current_state = 47;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 69:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 67;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 65:
-            {
-                $_ngcc_current_state = 2;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 42:
-            {
-                if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 41;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 85:
             {
                 if(($__uri.equals("") && $__local.equals("abstract"))) {
@@ -1417,56 +1456,16 @@
                 }
             }
             break;
-        case 22:
+        case 13:
             {
                 if(($__uri.equals("") && $__local.equals("base"))) {
-                    $_ngcc_current_state = 21;
+                    $_ngcc_current_state = 12;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 26:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 29:
-            {
-                $_ngcc_current_state = 28;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 54:
-            {
-                $_ngcc_current_state = 52;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 72:
-            {
-                $_ngcc_current_state = 68;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 81:
-            {
-                if(($__uri.equals("") && $__local.equals("block"))) {
-                    $_ngcc_current_state = 76;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -1478,9 +1477,51 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 49:
+        case 82:
             {
-                $_ngcc_current_state = 48;
+                NGCCHandler h = new erSet(this, super._source, $runtime, 182);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 23:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 106);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 43:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 130);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 72:
+            {
+                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 68;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 58:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 150);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 31:
+            {
+                mixedValue = $value;
+                $_ngcc_current_state = 30;
+            }
+            break;
+        case 52:
+            {
+                $_ngcc_current_state = 51;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
@@ -1491,9 +1532,29 @@
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 0:
+        case 61:
             {
-                revertToParentFromText(result, super._cookie, $value);
+                $_ngcc_current_state = 35;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 70:
+            {
+                name = $value;
+                $_ngcc_current_state = 69;
+            }
+            break;
+        case 48:
+            {
+                action11();
+                $_ngcc_current_state = 47;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 49:
+            {
+                $_ngcc_current_state = 48;
+                $runtime.sendText(super._cookie, $value);
             }
             break;
         case 59:
@@ -1504,26 +1565,113 @@
                 }
             }
             break;
-        case 43:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 529);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 24:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
         case 39:
             {
                 $_ngcc_current_state = 38;
                 $runtime.sendText(super._cookie, $value);
             }
             break;
+        case 65:
+            {
+                $_ngcc_current_state = 2;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 68:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 67;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 74:
+            {
+                mixedValue = $value;
+                $_ngcc_current_state = 73;
+            }
+            break;
+        case 15:
+            {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 24:
+            {
+                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 86:
+            {
+                abstractValue = $value;
+                $_ngcc_current_state = 85;
+            }
+            break;
+        case 54:
+            {
+                $_ngcc_current_state = 52;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 80:
+            {
+                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 76;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 51:
+            {
+                action13();
+                $_ngcc_current_state = 49;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 78:
+            {
+                NGCCHandler h = new erSet(this, super._source, $runtime, 177);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 26:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 10:
+            {
+                $_ngcc_current_state = 9;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 29:
+            {
+                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 28;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
         case 84:
             {
                 if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
@@ -1538,81 +1686,13 @@
             break;
         case 14:
             {
-                NGCCHandler h = new qname(this, super._source, $runtime, 494);
+                NGCCHandler h = new qname(this, super._source, $runtime, 95);
                 spawnChildFromText(h, $value);
             }
             break;
-        case 74:
+        case 0:
             {
-                mixedValue = $value;
-                $_ngcc_current_state = 73;
-            }
-            break;
-        case 52:
-            {
-                $_ngcc_current_state = 51;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 51:
-            {
-                action13();
-                $_ngcc_current_state = 49;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 70:
-            {
-                name = $value;
-                $_ngcc_current_state = 69;
-            }
-            break;
-        case 82:
-            {
-                NGCCHandler h = new erSet(this, super._source, $runtime, 581);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 68:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 67;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 80:
-            {
-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 76;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 61:
-            {
-                $_ngcc_current_state = 35;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 78:
-            {
-                NGCCHandler h = new erSet(this, super._source, $runtime, 576);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 58:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 549);
-                spawnChildFromText(h, $value);
+                revertToParentFromText(result, super._cookie, $value);
             }
             break;
         case 76:
@@ -1627,93 +1707,6 @@
                 }
             }
             break;
-        case 19:
-            {
-                $_ngcc_current_state = 18;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 48:
-            {
-                action11();
-                $_ngcc_current_state = 47;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 23:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 505);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 31:
-            {
-                mixedValue = $value;
-                $_ngcc_current_state = 30;
-            }
-            break;
-        case 15:
-            {
-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 65:
-            {
-                $_ngcc_current_state = 2;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 86:
-            {
-                abstractValue = $value;
-                $_ngcc_current_state = 85;
-            }
-            break;
-        case 26:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 29:
-            {
-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 28;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 54:
-            {
-                $_ngcc_current_state = 52;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 72:
-            {
-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 68;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 44:
             {
                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
@@ -1722,186 +1715,192 @@
                 }
             }
             break;
+        case 19:
+            {
+                $_ngcc_current_state = 18;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 529:
-            {
-                baseTypeName = ((UName)$__result__);
-                action9();
-                $_ngcc_current_state = 42;
-            }
-            break;
-        case 488:
-            {
-                explicitContent = ((ContentTypeImpl)$__result__);
-                action2();
-                $_ngcc_current_state = 8;
-            }
-            break;
-        case 534:
-            {
-                $_ngcc_current_state = 46;
-            }
-            break;
-        case 492:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 10;
-            }
-            break;
-        case 501:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 18;
-            }
-            break;
-        case 527:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 39;
-            }
-            break;
-        case 499:
-            {
-                explicitContent = ((ContentTypeImpl)$__result__);
-                action5();
-                $_ngcc_current_state = 17;
-            }
-            break;
-        case 545:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 52;
-            }
-            break;
-        case 538:
-            {
-                facet = ((XSFacet)$__result__);
-                action12();
-                $_ngcc_current_state = 48;
-            }
-            break;
-        case 525:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 38;
-            }
-            break;
-        case 494:
-            {
-                baseTypeName = ((UName)$__result__);
-                action3();
-                $_ngcc_current_state = 13;
-            }
-            break;
-        case 542:
-            {
-                baseContentType = ((SimpleTypeImpl)$__result__);
-                $_ngcc_current_state = 51;
-            }
-            break;
-        case 503:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 19;
-            }
-            break;
-        case 512:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 26;
-            }
-            break;
-        case 581:
-            {
-                blockValue = ((Integer)$__result__);
-                $_ngcc_current_state = 81;
-            }
-            break;
-        case 554:
-            {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 35;
-            }
-            break;
-        case 576:
-            {
-                finalValue = ((Integer)$__result__);
-                $_ngcc_current_state = 77;
-            }
-            break;
-        case 549:
-            {
-                baseTypeName = ((UName)$__result__);
-                action14();
-                $_ngcc_current_state = 57;
-            }
-            break;
-        case 522:
-            {
-                $_ngcc_current_state = 36;
-            }
-            break;
-        case 547:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 54;
-            }
-            break;
-        case 564:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 65;
-            }
-            break;
-        case 485:
-            {
-                explicitContent = ((ContentTypeImpl)$__result__);
-                action0();
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 537:
-            {
-                facet = ((XSFacet)$__result__);
-                action12();
-                $_ngcc_current_state = 48;
-            }
-            break;
-        case 505:
+        case 106:
             {
                 baseTypeName = ((UName)$__result__);
                 action6();
                 $_ngcc_current_state = 22;
             }
             break;
-        case 562:
+        case 143:
+            {
+                baseContentType = ((SimpleTypeImpl)$__result__);
+                $_ngcc_current_state = 51;
+            }
+            break;
+        case 155:
             {
                 annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 2;
+                $_ngcc_current_state = 35;
             }
             break;
-        case 556:
+        case 138:
             {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 61;
+                facet = ((XSFacet)$__result__);
+                action12();
+                $_ngcc_current_state = 48;
             }
             break;
-        case 510:
+        case 139:
+            {
+                facet = ((XSFacet)$__result__);
+                action12();
+                $_ngcc_current_state = 48;
+            }
+            break;
+        case 86:
+            {
+                explicitContent = ((ContentTypeImpl)$__result__);
+                action0();
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 89:
+            {
+                explicitContent = ((ContentTypeImpl)$__result__);
+                action2();
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 177:
+            {
+                finalValue = ((Integer)$__result__);
+                $_ngcc_current_state = 77;
+            }
+            break;
+        case 111:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 7;
             }
             break;
-        case 490:
+        case 91:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 9;
             }
             break;
+        case 95:
+            {
+                baseTypeName = ((UName)$__result__);
+                action3();
+                $_ngcc_current_state = 13;
+            }
+            break;
+        case 102:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 18;
+            }
+            break;
+        case 123:
+            {
+                $_ngcc_current_state = 36;
+            }
+            break;
+        case 113:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 26;
+            }
+            break;
+        case 182:
+            {
+                blockValue = ((Integer)$__result__);
+                $_ngcc_current_state = 81;
+            }
+            break;
+        case 130:
+            {
+                baseTypeName = ((UName)$__result__);
+                action9();
+                $_ngcc_current_state = 42;
+            }
+            break;
+        case 150:
+            {
+                baseTypeName = ((UName)$__result__);
+                action14();
+                $_ngcc_current_state = 57;
+            }
+            break;
+        case 135:
+            {
+                $_ngcc_current_state = 46;
+            }
+            break;
+        case 100:
+            {
+                explicitContent = ((ContentTypeImpl)$__result__);
+                action5();
+                $_ngcc_current_state = 17;
+            }
+            break;
+        case 126:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 38;
+            }
+            break;
+        case 163:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 2;
+            }
+            break;
+        case 146:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 52;
+            }
+            break;
+        case 104:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 19;
+            }
+            break;
+        case 93:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 10;
+            }
+            break;
+        case 165:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 65;
+            }
+            break;
+        case 128:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 39;
+            }
+            break;
+        case 148:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 54;
+            }
+            break;
+        case 157:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 61;
+            }
+            break;
         }
     }
 
@@ -1926,27 +1925,16 @@
         public XSSimpleType getType() {
           return (XSSimpleType)((XSComplexType)baseType.getType()).getContentType();
         }
-      };
-      private static class BaseContentRef implements Ref.ContentType {
-        private final Ref.Type baseType;
-        private BaseContentRef(Ref.Type _baseType ) { this.baseType = _baseType; }
-        public XSContentType getContentType() {
-            XSType t = baseType.getType();
-            if(t.asComplexType()!=null)
-                return t.asComplexType().getContentType();
-            else
-                return t.asSimpleType();
-        }
-      };
+      }
 
 
       // baseType and contentType must be computed before calling this method.
       private void makeResult( int derivationMethod ) {
 
         if(finalValue==null)
-          finalValue = new Integer($runtime.finalDefault);
+          finalValue = $runtime.finalDefault;
         if(blockValue==null)
-          blockValue = new Integer($runtime.blockDefault);
+          blockValue = $runtime.blockDefault;
 
         result = new ComplexTypeImpl(
             $runtime.document,
@@ -1958,8 +1946,8 @@
             $runtime.parseBoolean(abstractValue),
             derivationMethod,
             baseType,
-            finalValue.intValue(),
-            blockValue.intValue(),
+            finalValue,
+            blockValue,
             $runtime.parseBoolean(mixedValue)
         );
       }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java
index 8ade208..a3e9bd2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -75,22 +74,27 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterElement(particle, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         case 1:
             {
                 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
         case 2:
             {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
-                    NGCCHandler h = new particle(this, super._source, $runtime, 610);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+                    NGCCHandler h = new particle(this, super._source, $runtime, 678);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -99,11 +103,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(particle, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -118,9 +117,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveElement(particle, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
             }
             break;
@@ -130,11 +134,6 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(particle, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -149,9 +148,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterAttribute(particle, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
             }
             break;
@@ -161,11 +165,6 @@
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(particle, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -180,9 +179,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(particle, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
             }
             break;
@@ -192,11 +196,6 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(particle, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -208,9 +207,14 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromText(particle, super._cookie, $value);
+            }
+            break;
         case 1:
             {
-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 608, owner);
+                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
                 spawnChildFromText(h, $value);
             }
             break;
@@ -220,23 +224,18 @@
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(particle, super._cookie, $value);
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 608:
+        case 676:
             {
                 action0();
                 $_ngcc_current_state = 0;
             }
             break;
-        case 610:
+        case 678:
             {
                 particle = ((ParticleImpl)$__result__);
                 $_ngcc_current_state = 1;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java
index 37eee58..0d6d888 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -106,97 +105,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 3:
+        case 0:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 412);
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 492);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                        NGCCHandler h = new complexType(this, super._source, $runtime, 413);
-                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                    }
-                    else {
-                        if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
-                            $runtime.consumeAttribute($ai);
-                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                        }
-                        else {
-                            $_ngcc_current_state = 1;
-                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                        }
-                    }
-                }
-            }
-            break;
-        case 23:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 36:
-            {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 32;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 48:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 28:
-            {
-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 24;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 13:
-            {
-                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 44:
-            {
-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 40;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                    revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
@@ -212,14 +128,14 @@
                 }
             }
             break;
-        case 40:
+        case 36:
             {
-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 36;
+                    $_ngcc_current_state = 32;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -236,10 +152,34 @@
                 }
             }
             break;
+        case 44:
+            {
+                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 40;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 28:
+            {
+                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 24;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 11:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 417, null,AnnotationContext.ELEMENT_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 510, null,AnnotationContext.ELEMENT_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -248,6 +188,88 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 493);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 0;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 23:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 3:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+                    NGCCHandler h = new simpleType(this, super._source, $runtime, 505);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+                        NGCCHandler h = new complexType(this, super._source, $runtime, 506);
+                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                    }
+                    else {
+                        if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+                            $runtime.consumeAttribute($ai);
+                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                        }
+                        else {
+                            $_ngcc_current_state = 1;
+                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                        }
+                    }
+                }
+            }
+            break;
+        case 48:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 13:
+            {
+                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 11;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 40:
+            {
+                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 36;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 24:
             {
                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
@@ -260,29 +282,6 @@
                 }
             }
             break;
-        case 1:
-            {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
-                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 400);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 0;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 0:
-            {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
-                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 399);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -297,86 +296,9 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 3:
+        case 0:
             {
-                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 1;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 23:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 36:
-            {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 32;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 48:
-            {
-                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 28:
-            {
-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 24;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 13:
-            {
-                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 44:
-            {
-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 40;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 17:
@@ -391,14 +313,14 @@
                 }
             }
             break;
-        case 40:
+        case 36:
             {
-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 36;
+                    $_ngcc_current_state = 32;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -415,12 +337,100 @@
                 }
             }
             break;
+        case 44:
+            {
+                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 40;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 28:
+            {
+                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 24;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 11:
             {
                 $_ngcc_current_state = 3;
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 23:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 3:
+            {
+                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 48:
+            {
+                if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 13:
+            {
+                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 11;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 40:
+            {
+                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 36;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 24:
             {
                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
@@ -433,17 +443,6 @@
                 }
             }
             break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -458,80 +457,9 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 3:
+        case 0:
             {
-                if(($__uri.equals("") && $__local.equals("type"))) {
-                    $_ngcc_current_state = 6;
-                }
-                else {
-                    $_ngcc_current_state = 1;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 23:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 22;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 36:
-            {
-                if(($__uri.equals("") && $__local.equals("final"))) {
-                    $_ngcc_current_state = 38;
-                }
-                else {
-                    $_ngcc_current_state = 32;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 48:
-            {
-                if((($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("block")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 28:
-            {
-                if(($__uri.equals("") && $__local.equals("fixed"))) {
-                    $_ngcc_current_state = 30;
-                }
-                else {
-                    $_ngcc_current_state = 24;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 13:
-            {
-                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
-                    $_ngcc_current_state = 15;
-                }
-                else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 44:
-            {
-                if(($__uri.equals("") && $__local.equals("abstract"))) {
-                    $_ngcc_current_state = 46;
-                }
-                else {
-                    $_ngcc_current_state = 40;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
+                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 17:
@@ -545,13 +473,13 @@
                 }
             }
             break;
-        case 40:
+        case 36:
             {
-                if(($__uri.equals("") && $__local.equals("block"))) {
-                    $_ngcc_current_state = 42;
+                if(($__uri.equals("") && $__local.equals("final"))) {
+                    $_ngcc_current_state = 38;
                 }
                 else {
-                    $_ngcc_current_state = 36;
+                    $_ngcc_current_state = 32;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -567,12 +495,94 @@
                 }
             }
             break;
+        case 44:
+            {
+                if(($__uri.equals("") && $__local.equals("abstract"))) {
+                    $_ngcc_current_state = 46;
+                }
+                else {
+                    $_ngcc_current_state = 40;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 28:
+            {
+                if(($__uri.equals("") && $__local.equals("fixed"))) {
+                    $_ngcc_current_state = 30;
+                }
+                else {
+                    $_ngcc_current_state = 24;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 11:
             {
                 $_ngcc_current_state = 3;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 23:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 22;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 3:
+            {
+                if(($__uri.equals("") && $__local.equals("type"))) {
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 48:
+            {
+                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 13:
+            {
+                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
+                    $_ngcc_current_state = 15;
+                }
+                else {
+                    $_ngcc_current_state = 11;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 40:
+            {
+                if(($__uri.equals("") && $__local.equals("block"))) {
+                    $_ngcc_current_state = 42;
+                }
+                else {
+                    $_ngcc_current_state = 36;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         case 24:
             {
                 if(($__uri.equals("") && $__local.equals("form"))) {
@@ -584,17 +594,6 @@
                 }
             }
             break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -609,30 +608,15 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 3:
+        case 17:
             {
-                $_ngcc_current_state = 1;
+                $_ngcc_current_state = 13;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 14:
+        case 0:
             {
-                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
-                    $_ngcc_current_state = 11;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 45:
-            {
-                if(($__uri.equals("") && $__local.equals("abstract"))) {
-                    $_ngcc_current_state = 40;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
+                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 36:
@@ -641,22 +625,6 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 28:
-            {
-                $_ngcc_current_state = 24;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 33:
-            {
-                if(($__uri.equals("") && $__local.equals("default"))) {
-                    $_ngcc_current_state = 28;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 25:
             {
                 if(($__uri.equals("") && $__local.equals("form"))) {
@@ -667,10 +635,40 @@
                 }
             }
             break;
-        case 29:
+        case 44:
             {
-                if(($__uri.equals("") && $__local.equals("fixed"))) {
-                    $_ngcc_current_state = 24;
+                $_ngcc_current_state = 40;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 32:
+            {
+                $_ngcc_current_state = 28;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 28:
+            {
+                $_ngcc_current_state = 24;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 11:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 18:
+            {
+                if(($__uri.equals("") && $__local.equals("nillable"))) {
+                    $_ngcc_current_state = 13;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -687,31 +685,82 @@
                 }
             }
             break;
-        case 13:
+        case 21:
             {
-                $_ngcc_current_state = 11;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 44:
-            {
-                $_ngcc_current_state = 40;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 18:
-            {
-                if(($__uri.equals("") && $__local.equals("nillable"))) {
-                    $_ngcc_current_state = 13;
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 17;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 17:
+        case 5:
             {
-                $_ngcc_current_state = 13;
+                if(($__uri.equals("") && $__local.equals("type"))) {
+                    $_ngcc_current_state = 1;
+                    action1();
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 29:
+            {
+                if(($__uri.equals("") && $__local.equals("fixed"))) {
+                    $_ngcc_current_state = 24;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 3:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 33:
+            {
+                if(($__uri.equals("") && $__local.equals("default"))) {
+                    $_ngcc_current_state = 28;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 14:
+            {
+                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
+                    $_ngcc_current_state = 11;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 13:
+            {
+                $_ngcc_current_state = 11;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 45:
+            {
+                if(($__uri.equals("") && $__local.equals("abstract"))) {
+                    $_ngcc_current_state = 40;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 24:
+            {
+                $_ngcc_current_state = 23;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -731,56 +780,6 @@
                 }
             }
             break;
-        case 5:
-            {
-                if(($__uri.equals("") && $__local.equals("type"))) {
-                    $_ngcc_current_state = 1;
-                    action1();
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 32:
-            {
-                $_ngcc_current_state = 28;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 24:
-            {
-                $_ngcc_current_state = 23;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 11:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 21:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 17;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -792,9 +791,144 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 17:
+            {
+                if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 13;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromText(makeResult(), super._cookie, $value);
+            }
+            break;
+        case 36:
+            {
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 32;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 44:
+            {
+                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 40;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 32:
+            {
+                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 28;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 46:
+            {
+                abstractValue = $value;
+                $_ngcc_current_state = 45;
+            }
+            break;
+        case 30:
+            {
+                fixedValue = $value;
+                $_ngcc_current_state = 29;
+            }
+            break;
+        case 6:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 496);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 28:
+            {
+                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 24;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 22:
+            {
+                name = $value;
+                $_ngcc_current_state = 21;
+            }
+            break;
+        case 11:
+            {
+                $_ngcc_current_state = 3;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 26:
+            {
+                if($value.equals("unqualified")) {
+                    NGCCHandler h = new qualification(this, super._source, $runtime, 526);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if($value.equals("qualified")) {
+                        NGCCHandler h = new qualification(this, super._source, $runtime, 526);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
+        case 19:
+            {
+                nillable = $value;
+                $_ngcc_current_state = 18;
+            }
+            break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 23:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
         case 38:
             {
-                NGCCHandler h = new erSet(this, super._source, $runtime, 448);
+                NGCCHandler h = new erSet(this, super._source, $runtime, 541);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 15:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 513);
                 spawnChildFromText(h, $value);
             }
             break;
@@ -810,80 +944,46 @@
                 }
             }
             break;
-        case 6:
+        case 42:
             {
-                NGCCHandler h = new qname(this, super._source, $runtime, 403);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 46:
-            {
-                abstractValue = $value;
-                $_ngcc_current_state = 45;
-            }
-            break;
-        case 26:
-            {
-                if($value.equals("unqualified")) {
-                    NGCCHandler h = new qualification(this, super._source, $runtime, 433);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if($value.equals("qualified")) {
-                        NGCCHandler h = new qualification(this, super._source, $runtime, 433);
-                        spawnChildFromText(h, $value);
-                    }
-                }
-            }
-            break;
-        case 23:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 15:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 420);
+                NGCCHandler h = new ersSet(this, super._source, $runtime, 546);
                 spawnChildFromText(h, $value);
             }
             break;
         case 48:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                         spawnChildFromText(h, $value);
                     }
                     else {
-                        if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                             spawnChildFromText(h, $value);
                         }
                         else {
-                            if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                            if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                                 spawnChildFromText(h, $value);
                             }
                             else {
-                                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                                     spawnChildFromText(h, $value);
                                 }
                                 else {
-                                    if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                                    if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                                         spawnChildFromText(h, $value);
                                     }
                                     else {
-                                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 462, fa);
+                                        if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
                                             spawnChildFromText(h, $value);
                                         }
                                     }
@@ -894,28 +994,10 @@
                 }
             }
             break;
-        case 36:
+        case 34:
             {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 32;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 28:
-            {
-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 24;
-                    $runtime.sendText(super._cookie, $value);
-                }
+                defaultValue = $value;
+                $_ngcc_current_state = 33;
             }
             break;
         case 13:
@@ -930,44 +1012,14 @@
                 }
             }
             break;
-        case 19:
+        case 24:
             {
-                nillable = $value;
-                $_ngcc_current_state = 18;
-            }
-            break;
-        case 34:
-            {
-                defaultValue = $value;
-                $_ngcc_current_state = 33;
-            }
-            break;
-        case 44:
-            {
-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendText(super._cookie, $value);
                 }
                 else {
-                    $_ngcc_current_state = 40;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 22:
-            {
-                name = $value;
-                $_ngcc_current_state = 21;
-            }
-            break;
-        case 17:
-            {
-                if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 13;
+                    $_ngcc_current_state = 23;
                     $runtime.sendText(super._cookie, $value);
                 }
             }
@@ -984,139 +1036,86 @@
                 }
             }
             break;
-        case 30:
-            {
-                fixedValue = $value;
-                $_ngcc_current_state = 29;
-            }
-            break;
-        case 32:
-            {
-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 28;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 42:
-            {
-                NGCCHandler h = new ersSet(this, super._source, $runtime, 453);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 24:
-            {
-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 23;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
-        case 11:
-            {
-                $_ngcc_current_state = 3;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromText(makeResult(), super._cookie, $value);
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 412:
-            {
-                type = ((SimpleTypeImpl)$__result__);
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 413:
-            {
-                type = ((ComplexTypeImpl)$__result__);
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 453:
-            {
-                blockValue = ((Integer)$__result__);
-                $_ngcc_current_state = 41;
-            }
-            break;
-        case 417:
+        case 510:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 3;
             }
             break;
-        case 400:
+        case 546:
+            {
+                blockValue = ((Integer)$__result__);
+                $_ngcc_current_state = 41;
+            }
+            break;
+        case 496:
+            {
+                typeName = ((UName)$__result__);
+                $_ngcc_current_state = 5;
+            }
+            break;
+        case 492:
             {
                 idc = ((IdentityConstraintImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 0;
             }
             break;
-        case 448:
-            {
-                finalValue = ((Integer)$__result__);
-                $_ngcc_current_state = 37;
-            }
-            break;
-        case 403:
-            {
-                typeName = ((UName)$__result__);
-                $_ngcc_current_state = 5;
-            }
-            break;
-        case 433:
+        case 526:
             {
                 form = ((Boolean)$__result__).booleanValue();
                 action3();
                 $_ngcc_current_state = 25;
             }
             break;
-        case 462:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 44;
-            }
-            break;
-        case 420:
-            {
-                substRef = ((UName)$__result__);
-                action2();
-                $_ngcc_current_state = 14;
-            }
-            break;
-        case 399:
+        case 493:
             {
                 idc = ((IdentityConstraintImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 0;
             }
             break;
+        case 541:
+            {
+                finalValue = ((Integer)$__result__);
+                $_ngcc_current_state = 37;
+            }
+            break;
+        case 513:
+            {
+                substRef = ((UName)$__result__);
+                action2();
+                $_ngcc_current_state = 14;
+            }
+            break;
+        case 505:
+            {
+                type = ((SimpleTypeImpl)$__result__);
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 506:
+            {
+                type = ((ComplexTypeImpl)$__result__);
+                $_ngcc_current_state = 1;
+            }
+            break;
+        case 555:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 44;
+            }
+            break;
         }
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 17) || (($_ngcc_current_state == 13) || (($_ngcc_current_state == 1) || (($_ngcc_current_state == 11) || ($_ngcc_current_state == 3)))))));
+        return((($_ngcc_current_state == 13) || (($_ngcc_current_state == 17) || (($_ngcc_current_state == 3) || (($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 11)))))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java
index d874414..5f931ad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -142,17 +141,17 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromText(makeResult(), super._cookie, $value);
-            }
-            break;
         case 1:
             {
                 v = $value;
                 $_ngcc_current_state = 0;
             }
             break;
+        case 0:
+            {
+                revertToParentFromText(makeResult(), super._cookie, $value);
+            }
+            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java
index 4be0001..df89d1c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -142,17 +141,17 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 0:
-            {
-                revertToParentFromText(makeResult(), super._cookie, $value);
-            }
-            break;
         case 1:
             {
                 v = $value;
                 $_ngcc_current_state = 0;
             }
             break;
+        case 0:
+            {
+                revertToParentFromText(makeResult(), super._cookie, $value);
+            }
+            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java
index f4e8bb2..34ef0cb 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -84,17 +83,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 276, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -107,12 +95,11 @@
                 }
             }
             break;
-        case 12:
+        case 4:
             {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    action1();
-                    $_ngcc_current_state = 11;
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 577, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -133,7 +120,7 @@
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 274, null,AnnotationContext.SIMPLETYPE_DECL);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 575, null,AnnotationContext.SIMPLETYPE_DECL);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -142,6 +129,18 @@
                 }
             }
             break;
+        case 12:
+            {
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    action1();
+                    $_ngcc_current_state = 11;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 0:
             {
                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
@@ -161,17 +160,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
-            {
-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 276, fa);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
@@ -184,6 +172,17 @@
                 }
             }
             break;
+        case 4:
+            {
+                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 577, fa);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 11:
             {
                 if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
@@ -352,6 +351,12 @@
                 }
             }
             break;
+        case 7:
+            {
+                fixed = $value;
+                $_ngcc_current_state = 6;
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -363,24 +368,18 @@
                 revertToParentFromText(result, super._cookie, $value);
             }
             break;
-        case 7:
-            {
-                fixed = $value;
-                $_ngcc_current_state = 6;
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 276:
+        case 577:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 2;
             }
             break;
-        case 274:
+        case 575:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 1;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java
index 69c3dd7..f5a1165 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java
index c107ce1..bfe47f8 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -94,45 +93,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 5:
-            {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 467, null);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 0:
             {
                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 3:
-            {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 465, mloc,compositorName);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 6:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 469, null,AnnotationContext.MODELGROUP_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 5;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         case 10:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -144,11 +109,23 @@
                 }
             }
             break;
-        case 4:
+        case 6:
             {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 3;
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 233, null,AnnotationContext.MODELGROUP_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 5;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 3:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 229, mloc,compositorName);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -167,6 +144,28 @@
                 }
             }
             break;
+        case 5:
+            {
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 231, null);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 4:
+            {
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 3;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 11:
             {
                 if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
@@ -193,40 +192,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 1:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
-                    action0();
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 0:
             {
                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 3:
-            {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 465, mloc,compositorName);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 6:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 10:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -238,6 +208,12 @@
                 }
             }
             break;
+        case 6:
+            {
+                $_ngcc_current_state = 5;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 2:
             {
                 if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
@@ -249,6 +225,29 @@
                 }
             }
             break;
+        case 3:
+            {
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 229, mloc,compositorName);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 1:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                    action0();
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 11:
             {
                 if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
@@ -280,12 +279,6 @@
                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 6:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 10:
             {
                 if(($__uri.equals("") && $__local.equals("name"))) {
@@ -296,6 +289,12 @@
                 }
             }
             break;
+        case 6:
+            {
+                $_ngcc_current_state = 5;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 11:
             {
                 if(($__uri.equals("") && $__local.equals("ID"))) {
@@ -321,27 +320,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 8:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 6;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 0:
             {
                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 6:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 12:
             {
                 if(($__uri.equals("") && $__local.equals("ID"))) {
@@ -352,6 +335,22 @@
                 }
             }
             break;
+        case 8:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 6:
+            {
+                $_ngcc_current_state = 5;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 11:
             {
                 $_ngcc_current_state = 10;
@@ -374,12 +373,6 @@
                 revertToParentFromText(result, super._cookie, $value);
             }
             break;
-        case 6:
-            {
-                $_ngcc_current_state = 5;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 13:
             {
                 $_ngcc_current_state = 12;
@@ -393,6 +386,12 @@
                 }
             }
             break;
+        case 6:
+            {
+                $_ngcc_current_state = 5;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         case 11:
             {
                 if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
@@ -416,23 +415,23 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 465:
+        case 233:
             {
-                term = ((ModelGroupImpl)$__result__);
-                $_ngcc_current_state = 2;
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 5;
             }
             break;
-        case 467:
+        case 231:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 4;
             }
             break;
-        case 469:
+        case 229:
             {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 5;
+                term = ((ModelGroupImpl)$__result__);
+                $_ngcc_current_state = 2;
             }
             break;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java
index 4ed35a7..63cf994 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -95,10 +94,21 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 17:
+        case 7:
             {
-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 665, null);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 6:
+            {
+                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -118,21 +128,15 @@
                 }
             }
             break;
-        case 1:
+        case 0:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 3;
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
+                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 6:
+        case 3:
             {
                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 652);
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -140,11 +144,11 @@
                 }
             }
             break;
-        case 4:
+        case 16:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 3;
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -154,7 +158,7 @@
         case 8:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 655, null,AnnotationContext.IDENTITY_CONSTRAINT);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 254, null,AnnotationContext.IDENTITY_CONSTRAINT);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -163,27 +167,11 @@
                 }
             }
             break;
-        case 3:
+        case 4:
             {
-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 648);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 16:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 3;
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -202,11 +190,22 @@
                 }
             }
             break;
-        case 7:
+        case 17:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
+                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 1:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 6;
+                    $_ngcc_current_state = 3;
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -227,10 +226,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 17:
+        case 6:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 665, null);
+                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")))) {
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -238,6 +237,17 @@
                 }
             }
             break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 1;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 10:
             {
                 if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
@@ -250,38 +260,15 @@
                 }
             }
             break;
-        case 1:
+        case 0:
             {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 6:
-            {
-                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")))) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 652);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 8:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 3:
             {
                 if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field")))) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 648);
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -289,11 +276,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 16:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -305,11 +287,17 @@
                 }
             }
             break;
-        case 2:
+        case 8:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 1;
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 17:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
                     unexpectedLeaveElement($__qname);
@@ -327,6 +315,17 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -341,10 +340,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 17:
+        case 6:
             {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 665, null);
+                if(($__uri.equals("") && $__local.equals("xpath"))) {
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -363,10 +362,15 @@
                 }
             }
             break;
-        case 6:
+        case 0:
+            {
+                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 3:
             {
                 if(($__uri.equals("") && $__local.equals("xpath"))) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 652);
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -374,32 +378,27 @@
                 }
             }
             break;
+        case 16:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 15;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
         case 8:
             {
                 $_ngcc_current_state = 7;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 3:
-            {
-                if(($__uri.equals("") && $__local.equals("xpath"))) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 648);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 16:
+        case 17:
             {
                 if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 15;
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
                     unexpectedEnterAttribute($__qname);
@@ -426,31 +425,31 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 8:
             {
                 $_ngcc_current_state = 7;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 11:
             {
-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 14:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 10;
+                if(($__uri.equals("") && $__local.equals("refer"))) {
+                    $_ngcc_current_state = 8;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
                 }
             }
             break;
-        case 11:
+        case 14:
             {
-                if(($__uri.equals("") && $__local.equals("refer"))) {
-                    $_ngcc_current_state = 8;
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 10;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -468,10 +467,10 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 17:
+        case 6:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 665, null);
+                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
                     spawnChildFromText(h, $value);
                 }
             }
@@ -488,37 +487,29 @@
                 }
             }
             break;
-        case 12:
+        case 0:
             {
-                NGCCHandler h = new qname(this, super._source, $runtime, 658);
-                spawnChildFromText(h, $value);
+                revertToParentFromText(makeResult(), super._cookie, $value);
             }
             break;
-        case 6:
+        case 15:
             {
-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 652);
-                    spawnChildFromText(h, $value);
-                }
-            }
-            break;
-        case 8:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendText(super._cookie, $value);
+                name = $value;
+                $_ngcc_current_state = 14;
             }
             break;
         case 3:
             {
                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new xpath(this, super._source, $runtime, 648);
+                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
                     spawnChildFromText(h, $value);
                 }
             }
             break;
-        case 0:
+        case 12:
             {
-                revertToParentFromText(makeResult(), super._cookie, $value);
+                NGCCHandler h = new qname(this, super._source, $runtime, 257);
+                spawnChildFromText(h, $value);
             }
             break;
         case 16:
@@ -529,10 +520,18 @@
                 }
             }
             break;
-        case 15:
+        case 8:
             {
-                name = $value;
-                $_ngcc_current_state = 14;
+                $_ngcc_current_state = 7;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 17:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
+                    spawnChildFromText(h, $value);
+                }
             }
             break;
         }
@@ -540,33 +539,33 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 652:
+        case 251:
             {
                 selector = ((XPathImpl)$__result__);
                 $_ngcc_current_state = 5;
             }
             break;
-        case 658:
+        case 257:
             {
                 ref = ((UName)$__result__);
                 action1();
                 $_ngcc_current_state = 11;
             }
             break;
-        case 648:
+        case 264:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 16;
+            }
+            break;
+        case 247:
             {
                 field = ((XPathImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 2;
             }
             break;
-        case 665:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 16;
-            }
-            break;
-        case 655:
+        case 254:
             {
                 ann = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 7;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java
index cc05296..1ea3133 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -77,6 +76,30 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 8:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 4;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 589, null,AnnotationContext.SCHEMA);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 4:
             {
                 if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
@@ -89,6 +112,11 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         case 12:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
@@ -100,35 +128,6 @@
                 }
             }
             break;
-        case 2:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 3, null,AnnotationContext.SCHEMA);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 1;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 8:
-            {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 4;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -143,14 +142,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
+        case 8:
             {
-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 2;
+                    $_ngcc_current_state = 4;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -173,23 +172,23 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 4:
             {
-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 8:
-            {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 4;
+                    $_ngcc_current_state = 2;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -204,6 +203,23 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 8:
+            {
+                if(($__uri.equals("") && $__local.equals("namespace"))) {
+                    $_ngcc_current_state = 10;
+                }
+                else {
+                    $_ngcc_current_state = 4;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
@@ -215,28 +231,11 @@
                 }
             }
             break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 0:
             {
                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 8:
-            {
-                if(($__uri.equals("") && $__local.equals("namespace"))) {
-                    $_ngcc_current_state = 10;
-                }
-                else {
-                    $_ngcc_current_state = 4;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -251,20 +250,27 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 8:
+            {
+                $_ngcc_current_state = 4;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 $_ngcc_current_state = 2;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 5:
+        case 0:
             {
-                if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
-                    $_ngcc_current_state = 2;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
+                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 9:
@@ -277,21 +283,14 @@
                 }
             }
             break;
-        case 2:
+        case 5:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 8:
-            {
-                $_ngcc_current_state = 4;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
+                    $_ngcc_current_state = 2;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
             }
             break;
         default:
@@ -305,6 +304,24 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 8:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 4;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         case 4:
             {
                 if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
@@ -317,33 +334,15 @@
                 }
             }
             break;
-        case 6:
-            {
-                schemaLocation = $value;
-                $_ngcc_current_state = 5;
-            }
-            break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 0:
             {
                 revertToParentFromText(this, super._cookie, $value);
             }
             break;
-        case 8:
+        case 6:
             {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 4;
-                    $runtime.sendText(super._cookie, $value);
-                }
+                schemaLocation = $value;
+                $_ngcc_current_state = 5;
             }
             break;
         case 10:
@@ -357,7 +356,7 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 3:
+        case 589:
             {
                 $_ngcc_current_state = 1;
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java
index b3bac6b..0187040 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -78,21 +77,10 @@
                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 7:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 6;
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         case 2:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 231, null,AnnotationContext.SCHEMA);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 268, null,AnnotationContext.SCHEMA);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -112,6 +100,17 @@
                 }
             }
             break;
+        case 7:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 6;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -137,17 +136,6 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 6:
-            {
-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
@@ -160,6 +148,17 @@
                 }
             }
             break;
+        case 6:
+            {
+                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -271,7 +270,7 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 231:
+        case 268:
             {
                 $_ngcc_current_state = 1;
             }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java
index 503f921..2243dd5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -96,10 +95,15 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
         case 1:
             {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
-                    NGCCHandler h = new particle(this, super._source, $runtime, 669);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+                    NGCCHandler h = new particle(this, super._source, $runtime, 31);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -111,8 +115,8 @@
             break;
         case 2:
             {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
-                    NGCCHandler h = new particle(this, super._source, $runtime, 670);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+                    NGCCHandler h = new particle(this, super._source, $runtime, 32);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -124,7 +128,7 @@
         case 4:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 673, null,AnnotationContext.MODELGROUP);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 35, null,AnnotationContext.MODELGROUP);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -135,21 +139,16 @@
             break;
         case 6:
             {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -164,6 +163,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 action0();
@@ -185,15 +189,10 @@
             break;
         case 6:
             {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -208,6 +207,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 action0();
@@ -229,15 +233,10 @@
             break;
         case 6:
             {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -252,6 +251,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 1:
             {
                 action0();
@@ -273,15 +277,10 @@
             break;
         case 6:
             {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -293,6 +292,11 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromText(result, super._cookie, $value);
+            }
+            break;
         case 1:
             {
                 action0();
@@ -314,41 +318,36 @@
             break;
         case 6:
             {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 675, null);
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
                 spawnChildFromText(h, $value);
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(result, super._cookie, $value);
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 669:
+        case 31:
             {
                 childParticle = ((ParticleImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 670:
+        case 32:
             {
                 childParticle = ((ParticleImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 675:
+        case 37:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 4;
             }
             break;
-        case 673:
+        case 35:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 2;
@@ -358,7 +357,7 @@
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 4) || (($_ngcc_current_state == 2) || ($_ngcc_current_state == 1)))));
+        return((($_ngcc_current_state == 4) || (($_ngcc_current_state == 2) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 0)))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java
index be82d82..ff8fe99 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -77,6 +76,34 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 14:
+            {
+                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 558, null,AnnotationContext.NOTATION);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         case 4:
             {
                 if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
@@ -89,34 +116,17 @@
                 }
             }
             break;
-        case 2:
+        case 10:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 614, null,AnnotationContext.NOTATION);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 1;
+                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
+                    $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
-            }
-            break;
-        case 14:
-            {
-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 627, null);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
                 else {
                     unexpectedEnterElement($__qname);
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
         case 15:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
@@ -140,17 +150,6 @@
                 }
             }
             break;
-        case 10:
-            {
-                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -165,28 +164,15 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 4:
+        case 0:
             {
-                if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 2;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 14:
             {
                 if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 627, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -205,14 +191,27 @@
                 }
             }
             break;
-        case 0:
+        case 2:
             {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 13:
+        case 4:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 2;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
+        case 10:
+            {
+                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
@@ -221,9 +220,9 @@
                 }
             }
             break;
-        case 10:
+        case 13:
             {
-                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
@@ -246,6 +245,28 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 14:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 if(($__uri.equals("") && $__local.equals("system"))) {
@@ -257,28 +278,16 @@
                 }
             }
             break;
-        case 2:
+        case 10:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 14:
-            {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 627, null);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                if(($__uri.equals("") && $__local.equals("public"))) {
+                    $_ngcc_current_state = 9;
                 }
                 else {
                     unexpectedEnterAttribute($__qname);
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 13:
             {
                 if(($__uri.equals("") && $__local.equals("name"))) {
@@ -289,16 +298,6 @@
                 }
             }
             break;
-        case 10:
-            {
-                if(($__uri.equals("") && $__local.equals("public"))) {
-                    $_ngcc_current_state = 9;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -313,6 +312,27 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 5:
+            {
+                if(($__uri.equals("") && $__local.equals("system"))) {
+                    $_ngcc_current_state = 2;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 4:
             {
                 $_ngcc_current_state = 2;
@@ -329,27 +349,6 @@
                 }
             }
             break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 5:
-            {
-                if(($__uri.equals("") && $__local.equals("system"))) {
-                    $_ngcc_current_state = 2;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 8:
             {
                 if(($__uri.equals("") && $__local.equals("public"))) {
@@ -371,6 +370,31 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromText(makeResult(), super._cookie, $value);
+            }
+            break;
+        case 14:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+                    spawnChildFromText(h, $value);
+                }
+            }
+            break;
+        case 6:
+            {
+                sys = $value;
+                $_ngcc_current_state = 5;
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         case 4:
             {
                 if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
@@ -383,45 +407,12 @@
                 }
             }
             break;
-        case 9:
-            {
-                pub = $value;
-                $_ngcc_current_state = 8;
-            }
-            break;
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
-        case 14:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 627, null);
-                    spawnChildFromText(h, $value);
-                }
-            }
-            break;
         case 12:
             {
                 name = $value;
                 $_ngcc_current_state = 11;
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(makeResult(), super._cookie, $value);
-            }
-            break;
-        case 13:
-            {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
         case 10:
             {
                 if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
@@ -430,10 +421,18 @@
                 }
             }
             break;
-        case 6:
+        case 9:
             {
-                sys = $value;
-                $_ngcc_current_state = 5;
+                pub = $value;
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 13:
+            {
+                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
             }
             break;
         }
@@ -441,18 +440,18 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 614:
-            {
-                ann = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 1;
-            }
-            break;
-        case 627:
+        case 571:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 13;
             }
             break;
+        case 558:
+            {
+                ann = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 1;
+            }
+            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java
index 9796eca..a2e4ad3 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -81,14 +80,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 5:
+        case 1:
             {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 0;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -98,14 +97,14 @@
                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 1:
+        case 5:
             {
-                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 0;
+                    $_ngcc_current_state = 1;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -124,14 +123,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 5:
+        case 1:
             {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 0;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -141,14 +140,14 @@
                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 1:
+        case 5:
             {
-                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
                     $runtime.consumeAttribute($ai);
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    $_ngcc_current_state = 0;
+                    $_ngcc_current_state = 1;
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -167,13 +166,13 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 5:
+        case 1:
             {
-                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
-                    $_ngcc_current_state = 7;
+                if(($__uri.equals("") && $__local.equals("minOccurs"))) {
+                    $_ngcc_current_state = 3;
                 }
                 else {
-                    $_ngcc_current_state = 1;
+                    $_ngcc_current_state = 0;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -183,13 +182,13 @@
                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 1:
+        case 5:
             {
-                if(($__uri.equals("") && $__local.equals("minOccurs"))) {
-                    $_ngcc_current_state = 3;
+                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
+                    $_ngcc_current_state = 7;
                 }
                 else {
-                    $_ngcc_current_state = 0;
+                    $_ngcc_current_state = 1;
                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
                 }
             }
@@ -208,12 +207,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 5:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 2:
             {
                 if(($__uri.equals("") && $__local.equals("minOccurs"))) {
@@ -234,14 +227,20 @@
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 0:
             {
                 revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 1:
+        case 5:
             {
-                $_ngcc_current_state = 0;
+                $_ngcc_current_state = 1;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -256,18 +255,6 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 5:
-            {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 1;
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
         case 7:
             {
                 if($value.equals("unbounded")) {
@@ -281,18 +268,6 @@
                 }
             }
             break;
-        case 3:
-            {
-                v = $value;
-                $_ngcc_current_state = 2;
-                action0();
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromText(this, super._cookie, $value);
-            }
-            break;
         case 1:
             {
                 if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
@@ -305,6 +280,30 @@
                 }
             }
             break;
+        case 0:
+            {
+                revertToParentFromText(this, super._cookie, $value);
+            }
+            break;
+        case 3:
+            {
+                v = $value;
+                $_ngcc_current_state = 2;
+                action0();
+            }
+            break;
+        case 5:
+            {
+                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 1;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
         }
     }
 
@@ -314,7 +313,7 @@
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 5))));
+        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java
index d223207..5b54441 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -130,6 +129,17 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 3:
+            {
+                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 10:
             {
                 action3();
@@ -137,15 +147,16 @@
                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 16:
+        case 0:
             {
-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && (((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
+                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 20:
+            {
+                action5();
+                $_ngcc_current_state = 19;
+                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
         case 1:
@@ -181,10 +192,21 @@
                 }
             }
             break;
+        case 4:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 11:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 323, null,AnnotationContext.PARTICLE);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 425, null,AnnotationContext.PARTICLE);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -196,7 +218,7 @@
         case 21:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 335, null,AnnotationContext.PARTICLE);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 437, null,AnnotationContext.PARTICLE);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -205,15 +227,10 @@
                 }
             }
             break;
-        case 0:
+        case 16:
             {
-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 4:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -228,8 +245,8 @@
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    if((($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                    if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
@@ -238,10 +255,21 @@
                 }
             }
             break;
-        case 3:
+        case 29:
             {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 314, wloc);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 446, loc,compositorName);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 26:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -251,26 +279,8 @@
             break;
         case 30:
             {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 345);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 20:
-            {
-                action5();
-                $_ngcc_current_state = 19;
-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 29:
-            {
-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 344, loc,compositorName);
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -289,17 +299,6 @@
                 }
             }
             break;
-        case 26:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 340);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -314,6 +313,28 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 19:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 3:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 10:
             {
                 action3();
@@ -321,10 +342,22 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 16:
+        case 0:
             {
-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
+                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 20:
+            {
+                action5();
+                $_ngcc_current_state = 19;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 4:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -344,14 +377,9 @@
                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 2:
             {
-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 19:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) {
                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
                     $_ngcc_current_state = 0;
                 }
@@ -360,10 +388,10 @@
                 }
             }
             break;
-        case 4:
+        case 16:
             {
-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -371,6 +399,17 @@
                 }
             }
             break;
+        case 7:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
+                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                    $_ngcc_current_state = 0;
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 8:
             {
                 if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
@@ -378,8 +417,8 @@
                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
                 }
                 else {
-                    if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                    if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
+                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                         spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                     }
                     else {
@@ -388,11 +427,22 @@
                 }
             }
             break;
-        case 7:
+        case 29:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
+                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 446, loc,compositorName);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 26:
+            {
+                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
                     unexpectedLeaveElement($__qname);
@@ -410,50 +460,10 @@
                 }
             }
             break;
-        case 3:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 314, wloc);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 30:
             {
-                if(((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 345);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 2:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) {
-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
-                    $_ngcc_current_state = 0;
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
-        case 20:
-            {
-                action5();
-                $_ngcc_current_state = 19;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 29:
-            {
-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 344, loc,compositorName);
+                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || (($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -472,17 +482,6 @@
                 }
             }
             break;
-        case 26:
-            {
-                if(((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || (($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 340);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -497,17 +496,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 10:
+        case 4:
             {
-                action3();
-                $_ngcc_current_state = 7;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 3:
-            {
-                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 314, wloc);
+                if((($__uri.equals("") && $__local.equals("namespace")) || (($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("processContents")))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -515,66 +507,22 @@
                 }
             }
             break;
-        case 30:
-            {
-                if((($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("maxOccurs")))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 345);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 16:
-            {
-                if((($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("ref")) || (($__uri.equals("") && $__local.equals("maxOccurs")) || ($__uri.equals("") && $__local.equals("name")))))))))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 21:
-            {
-                $_ngcc_current_state = 20;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 11:
             {
                 $_ngcc_current_state = 10;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 20:
+        case 21:
             {
-                action5();
-                $_ngcc_current_state = 19;
+                $_ngcc_current_state = 20;
                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
+        case 16:
             {
-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 25:
-            {
-                if(($__uri.equals("") && $__local.equals("ref"))) {
-                    $_ngcc_current_state = 24;
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
-        case 4:
-            {
-                if((($__uri.equals("") && $__local.equals("namespace")) || (($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("processContents")) || ($__uri.equals("") && $__local.equals("maxOccurs")))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                if((($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("ref")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final")))))))))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -588,8 +536,8 @@
                     $_ngcc_current_state = 14;
                 }
                 else {
-                    if((($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("block")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                    if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                         spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                     }
                     else {
@@ -598,10 +546,40 @@
                 }
             }
             break;
+        case 3:
+            {
+                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 10:
+            {
+                action3();
+                $_ngcc_current_state = 7;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 20:
+            {
+                action5();
+                $_ngcc_current_state = 19;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 26:
             {
-                if((($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("ref")) || ($__uri.equals("") && $__local.equals("maxOccurs"))))) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 340);
+                if((($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("ref"))))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
@@ -609,6 +587,27 @@
                 }
             }
             break;
+        case 30:
+            {
+                if((($__uri.equals("") && $__local.equals("maxOccurs")) || ($__uri.equals("") && $__local.equals("minOccurs")))) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
+        case 25:
+            {
+                if(($__uri.equals("") && $__local.equals("ref"))) {
+                    $_ngcc_current_state = 24;
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -623,10 +622,25 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 10:
+        case 13:
             {
-                action3();
-                $_ngcc_current_state = 7;
+                if(($__uri.equals("") && $__local.equals("ref"))) {
+                    $_ngcc_current_state = 11;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 11:
+            {
+                $_ngcc_current_state = 10;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 21:
+            {
+                $_ngcc_current_state = 20;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
@@ -640,16 +654,16 @@
                 }
             }
             break;
-        case 21:
+        case 10:
             {
-                $_ngcc_current_state = 20;
+                action3();
+                $_ngcc_current_state = 7;
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 11:
+        case 0:
             {
-                $_ngcc_current_state = 10;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 20:
@@ -659,21 +673,6 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 13:
-            {
-                if(($__uri.equals("") && $__local.equals("ref"))) {
-                    $_ngcc_current_state = 11;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -685,6 +684,26 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 24:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 440);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 3:
+            {
+                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+                    spawnChildFromText(h, $value);
+                }
+                else {
+                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+                        spawnChildFromText(h, $value);
+                    }
+                }
+            }
+            break;
         case 10:
             {
                 action3();
@@ -692,63 +711,45 @@
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 16:
+        case 0:
             {
-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
+                revertToParentFromText(result, super._cookie, $value);
+            }
+            break;
+        case 20:
+            {
+                action5();
+                $_ngcc_current_state = 19;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 14:
+            {
+                NGCCHandler h = new qname(this, super._source, $runtime, 428);
+                spawnChildFromText(h, $value);
+            }
+            break;
+        case 4:
+            {
+                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
-                        NGCCHandler h = new occurs(this, super._source, $runtime, 329);
+                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                        NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                         spawnChildFromText(h, $value);
                     }
                     else {
-                        if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                            NGCCHandler h = new occurs(this, super._source, $runtime, 329);
+                        if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                            NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                             spawnChildFromText(h, $value);
                         }
                         else {
-                            if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
-                                NGCCHandler h = new occurs(this, super._source, $runtime, 329);
+                            if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                                NGCCHandler h = new occurs(this, super._source, $runtime, 417);
                                 spawnChildFromText(h, $value);
                             }
-                            else {
-                                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                    spawnChildFromText(h, $value);
-                                }
-                                else {
-                                    if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                                        NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                        spawnChildFromText(h, $value);
-                                    }
-                                    else {
-                                        if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                                            NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                            spawnChildFromText(h, $value);
-                                        }
-                                        else {
-                                            if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                                                NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                                spawnChildFromText(h, $value);
-                                            }
-                                            else {
-                                                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
-                                                    NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                                    spawnChildFromText(h, $value);
-                                                }
-                                                else {
-                                                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                                                        NGCCHandler h = new occurs(this, super._source, $runtime, 329);
-                                                        spawnChildFromText(h, $value);
-                                                    }
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
                         }
                     }
                 }
@@ -766,32 +767,63 @@
                 $runtime.sendText(super._cookie, $value);
             }
             break;
-        case 0:
+        case 16:
             {
-                revertToParentFromText(result, super._cookie, $value);
-            }
-            break;
-        case 4:
-            {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
-                        NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                    if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                         spawnChildFromText(h, $value);
                     }
                     else {
-                        if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
-                            NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                            NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                             spawnChildFromText(h, $value);
                         }
                         else {
-                            if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                                NGCCHandler h = new occurs(this, super._source, $runtime, 315);
+                            if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                                NGCCHandler h = new occurs(this, super._source, $runtime, 431);
                                 spawnChildFromText(h, $value);
                             }
+                            else {
+                                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                    spawnChildFromText(h, $value);
+                                }
+                                else {
+                                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                        spawnChildFromText(h, $value);
+                                    }
+                                    else {
+                                        if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                                            NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                            spawnChildFromText(h, $value);
+                                        }
+                                        else {
+                                            if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                                                NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                                spawnChildFromText(h, $value);
+                                            }
+                                            else {
+                                                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                                                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                                    spawnChildFromText(h, $value);
+                                                }
+                                                else {
+                                                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                                                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
+                                                        spawnChildFromText(h, $value);
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
                         }
                     }
                 }
@@ -804,38 +836,38 @@
                     $runtime.sendText(super._cookie, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                    if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                         spawnChildFromText(h, $value);
                     }
                     else {
-                        if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
-                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                        if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                             spawnChildFromText(h, $value);
                         }
                         else {
-                            if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
-                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                            if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                                 spawnChildFromText(h, $value);
                             }
                             else {
-                                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
-                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                                     spawnChildFromText(h, $value);
                                 }
                                 else {
-                                    if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                                    if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                                         spawnChildFromText(h, $value);
                                     }
                                     else {
-                                        if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
-                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                                        if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                                             spawnChildFromText(h, $value);
                                         }
                                         else {
-                                            if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
-                                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 320, loc,false);
+                                            if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
                                                 spawnChildFromText(h, $value);
                                             }
                                         }
@@ -847,47 +879,40 @@
                 }
             }
             break;
-        case 3:
+        case 26:
             {
-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 314, wloc);
+                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 314, wloc);
+                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                        NGCCHandler h = new occurs(this, super._source, $runtime, 442);
                         spawnChildFromText(h, $value);
                     }
+                    else {
+                        if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                            NGCCHandler h = new occurs(this, super._source, $runtime, 442);
+                            spawnChildFromText(h, $value);
+                        }
+                    }
                 }
             }
             break;
         case 30:
             {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 345);
+                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
                     spawnChildFromText(h, $value);
                 }
                 else {
-                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
-                        NGCCHandler h = new occurs(this, super._source, $runtime, 345);
+                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                        NGCCHandler h = new occurs(this, super._source, $runtime, 447);
                         spawnChildFromText(h, $value);
                     }
                 }
             }
             break;
-        case 24:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 338);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 20:
-            {
-                action5();
-                $_ngcc_current_state = 19;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 25:
             {
                 if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
@@ -896,104 +921,78 @@
                 }
             }
             break;
-        case 14:
-            {
-                NGCCHandler h = new qname(this, super._source, $runtime, 326);
-                spawnChildFromText(h, $value);
-            }
-            break;
-        case 26:
-            {
-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
-                    NGCCHandler h = new occurs(this, super._source, $runtime, 340);
-                    spawnChildFromText(h, $value);
-                }
-                else {
-                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
-                        NGCCHandler h = new occurs(this, super._source, $runtime, 340);
-                        spawnChildFromText(h, $value);
-                    }
-                    else {
-                        if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
-                            NGCCHandler h = new occurs(this, super._source, $runtime, 340);
-                            spawnChildFromText(h, $value);
-                        }
-                    }
-                }
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 323:
+        case 440:
             {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 10;
+                groupName = ((UName)$__result__);
+                $_ngcc_current_state = 23;
             }
             break;
-        case 320:
-            {
-                anonymousElementDecl = ((ElementDecl)$__result__);
-                action2();
-                $_ngcc_current_state = 7;
-            }
-            break;
-        case 314:
+        case 416:
             {
                 wcBody = ((WildcardImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 2;
             }
             break;
-        case 345:
+        case 428:
             {
-                occurs = ((occurs)$__result__);
-                $_ngcc_current_state = 29;
+                elementTypeName = ((UName)$__result__);
+                $_ngcc_current_state = 13;
             }
             break;
-        case 338:
+        case 425:
             {
-                groupName = ((UName)$__result__);
-                $_ngcc_current_state = 23;
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 10;
             }
             break;
-        case 344:
+        case 422:
+            {
+                anonymousElementDecl = ((ElementDecl)$__result__);
+                action2();
+                $_ngcc_current_state = 7;
+            }
+            break;
+        case 446:
             {
                 term = ((ModelGroupImpl)$__result__);
                 action7();
                 $_ngcc_current_state = 28;
             }
             break;
-        case 326:
-            {
-                elementTypeName = ((UName)$__result__);
-                $_ngcc_current_state = 13;
-            }
-            break;
-        case 329:
+        case 442:
             {
                 occurs = ((occurs)$__result__);
-                $_ngcc_current_state = 8;
+                $_ngcc_current_state = 25;
             }
             break;
-        case 335:
+        case 447:
             {
-                annotation = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 20;
+                occurs = ((occurs)$__result__);
+                $_ngcc_current_state = 29;
             }
             break;
-        case 315:
+        case 417:
             {
                 occurs = ((occurs)$__result__);
                 $_ngcc_current_state = 3;
             }
             break;
-        case 340:
+        case 437:
+            {
+                annotation = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 20;
+            }
+            break;
+        case 431:
             {
                 occurs = ((occurs)$__result__);
-                $_ngcc_current_state = 25;
+                $_ngcc_current_state = 8;
             }
             break;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java
index 053bbd6..f399826 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -142,17 +141,17 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
+            }
+            break;
         case 1:
             {
                 qvalue = $value;
                 $_ngcc_current_state = 0;
             }
             break;
-        case 0:
-            {
-                revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
-            }
-            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java
index 9f4a054..3f824ad 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java
index 4856095..caea009 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -73,7 +72,7 @@
               $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_ATTRIBUTEGROUP,newAg.getName()) );
             } else {
               newAg.redefine((AttGroupDeclImpl)oldAg);
-              $runtime.currentSchema.addAttGroupDecl(newAg);
+              $runtime.currentSchema.addAttGroupDecl(newAg,true);
             }
 }
 
@@ -83,7 +82,7 @@
               $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_MODELGROUP,newGrp.getName()) );
             } else {
               newGrp.redefine((ModelGroupDeclImpl)oldGrp);
-              $runtime.currentSchema.addModelGroupDecl(newGrp);
+              $runtime.currentSchema.addModelGroupDecl(newGrp,true);
             }
 }
 
@@ -93,7 +92,7 @@
               $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_COMPLEXTYPE,newCt.getName()) );
             } else {
               newCt.redefine((ComplexTypeImpl)oldCt);
-              $runtime.currentSchema.addComplexType(newCt);
+              $runtime.currentSchema.addComplexType(newCt,true);
             }
 }
 
@@ -103,7 +102,7 @@
               $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_SIMPLETYPE,newSt.getName()) );
             } else {
               newSt.redefine((SimpleTypeImpl)oldSt);
-              $runtime.currentSchema.addSimpleType(newSt);
+              $runtime.currentSchema.addSimpleType(newSt,true);
             }
 }
 
@@ -117,47 +116,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 2:
+        case 15:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 262, null,AnnotationContext.SCHEMA);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 263);
-                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                    }
-                    else {
-                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                            NGCCHandler h = new complexType(this, super._source, $runtime, 264);
-                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                        }
-                        else {
-                            if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
-                                NGCCHandler h = new group(this, super._source, $runtime, 265);
-                                spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                            }
-                            else {
-                                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 266);
-                                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                                }
-                                else {
-                                    $_ngcc_current_state = 1;
-                                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            break;
-        case 14:
-            {
-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    $_ngcc_current_state = 14;
                 }
                 else {
                     unexpectedEnterElement($__qname);
@@ -167,27 +130,27 @@
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 257, null,AnnotationContext.SCHEMA);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 476, null,AnnotationContext.SCHEMA);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 258);
+                        NGCCHandler h = new simpleType(this, super._source, $runtime, 477);
                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                     }
                     else {
                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
-                            NGCCHandler h = new complexType(this, super._source, $runtime, 259);
+                            NGCCHandler h = new complexType(this, super._source, $runtime, 478);
                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                         }
                         else {
                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
-                                NGCCHandler h = new group(this, super._source, $runtime, 260);
+                                NGCCHandler h = new group(this, super._source, $runtime, 479);
                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                             }
                             else {
                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
-                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 261);
+                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 480);
                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                                 }
                                 else {
@@ -204,17 +167,53 @@
                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
             }
             break;
-        case 15:
+        case 14:
             {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    $_ngcc_current_state = 14;
+                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
                     unexpectedEnterElement($__qname);
                 }
             }
             break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 481, null,AnnotationContext.SCHEMA);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+                        NGCCHandler h = new simpleType(this, super._source, $runtime, 482);
+                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                    }
+                    else {
+                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+                            NGCCHandler h = new complexType(this, super._source, $runtime, 483);
+                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                        }
+                        else {
+                            if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                                NGCCHandler h = new group(this, super._source, $runtime, 484);
+                                spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                            }
+                            else {
+                                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 485);
+                                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                }
+                                else {
+                                    $_ngcc_current_state = 1;
+                                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -229,23 +228,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 2:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 14:
-            {
-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
@@ -262,6 +244,23 @@
                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 14:
+            {
+                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -276,10 +275,9 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 2:
+        case 0:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 14:
@@ -292,9 +290,10 @@
                 }
             }
             break;
-        case 0:
+        case 2:
             {
-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+                $_ngcc_current_state = 1;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         default:
@@ -311,6 +310,11 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 2:
             {
                 $_ngcc_current_state = 1;
@@ -327,11 +331,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -343,10 +342,9 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 2:
+        case 0:
             {
-                $_ngcc_current_state = 1;
-                $runtime.sendText(super._cookie, $value);
+                revertToParentFromText(this, super._cookie, $value);
             }
             break;
         case 14:
@@ -357,6 +355,12 @@
                 }
             }
             break;
+        case 2:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         case 13:
             {
                 schemaLocation = $value;
@@ -364,76 +368,71 @@
                 action4();
             }
             break;
-        case 0:
-            {
-                revertToParentFromText(this, super._cookie, $value);
-            }
-            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 262:
+        case 476:
             {
                 $_ngcc_current_state = 1;
             }
             break;
-        case 263:
+        case 477:
             {
                 newSt = ((SimpleTypeImpl)$__result__);
                 action3();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 264:
+        case 478:
             {
                 newCt = ((ComplexTypeImpl)$__result__);
                 action2();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 265:
+        case 479:
             {
                 newGrp = ((ModelGroupDeclImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 266:
+        case 480:
             {
                 newAg = ((AttGroupDeclImpl)$__result__);
                 action0();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 257:
+        case 481:
             {
                 $_ngcc_current_state = 1;
             }
             break;
-        case 258:
+        case 482:
             {
                 newSt = ((SimpleTypeImpl)$__result__);
                 action3();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 259:
+        case 483:
             {
                 newCt = ((ComplexTypeImpl)$__result__);
                 action2();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 260:
+        case 484:
             {
                 newGrp = ((ModelGroupDeclImpl)$__result__);
                 action1();
                 $_ngcc_current_state = 1;
             }
             break;
-        case 261:
+        case 485:
             {
                 newAg = ((AttGroupDeclImpl)$__result__);
                 action0();
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java
index f28d540..5c4d8fa 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -92,6 +91,64 @@
                 }
             }
             break;
+        case 19:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+                    action1();
+                    $_ngcc_current_state = 15;
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 10:
+            {
+                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union")))))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, fa);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
+        case 8:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 69, null,AnnotationContext.SIMPLETYPE_DECL);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 7;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
+        case 2:
+            {
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                    NGCCHandler h = new SimpleType_Restriction(this, super._source, $runtime, 65, annotation,locator,fa,name,finalSet);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
+                        NGCCHandler h = new SimpleType_List(this, super._source, $runtime, 66, annotation,locator,fa,name,finalSet);
+                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                    }
+                    else {
+                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+                            NGCCHandler h = new SimpleType_Union(this, super._source, $runtime, 60, annotation,locator,fa,name,finalSet);
+                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                        }
+                        else {
+                            unexpectedEnterElement($__qname);
+                        }
+                    }
+                }
+            }
+            break;
         case 0:
             {
                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
@@ -109,64 +166,6 @@
                 }
             }
             break;
-        case 19:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
-                    action1();
-                    $_ngcc_current_state = 15;
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 2:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
-                    NGCCHandler h = new SimpleType_Restriction(this, super._source, $runtime, 379, annotation,locator,fa,name,finalSet);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
-                        NGCCHandler h = new SimpleType_List(this, super._source, $runtime, 380, annotation,locator,fa,name,finalSet);
-                        spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                    }
-                    else {
-                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
-                            NGCCHandler h = new SimpleType_Union(this, super._source, $runtime, 374, annotation,locator,fa,name,finalSet);
-                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                        }
-                        else {
-                            unexpectedEnterElement($__qname);
-                        }
-                    }
-                }
-            }
-            break;
-        case 10:
-            {
-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 385, fa);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
-        case 8:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 383, null,AnnotationContext.SIMPLETYPE_DECL);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 7;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         case 7:
             {
                 action0();
@@ -200,23 +199,17 @@
                 }
             }
             break;
+        case 8:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 0:
             {
                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 15:
-            {
-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 11;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-            }
-            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
@@ -228,10 +221,16 @@
                 }
             }
             break;
-        case 8:
+        case 15:
             {
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 11;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
             }
             break;
         case 7:
@@ -266,6 +265,12 @@
                 }
             }
             break;
+        case 8:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 0:
             {
                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
@@ -282,12 +287,6 @@
                 }
             }
             break;
-        case 8:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 7:
             {
                 action0();
@@ -309,10 +308,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 12:
+        case 16:
             {
-                if(($__uri.equals("") && $__local.equals("name"))) {
-                    $_ngcc_current_state = 10;
+                if(($__uri.equals("") && $__local.equals("final"))) {
+                    $_ngcc_current_state = 11;
                 }
                 else {
                     unexpectedLeaveAttribute($__qname);
@@ -325,6 +324,22 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
+        case 12:
+            {
+                if(($__uri.equals("") && $__local.equals("name"))) {
+                    $_ngcc_current_state = 10;
+                }
+                else {
+                    unexpectedLeaveAttribute($__qname);
+                }
+            }
+            break;
+        case 8:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 0:
             {
                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
@@ -336,22 +351,6 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 8:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 16:
-            {
-                if(($__uri.equals("") && $__local.equals("final"))) {
-                    $_ngcc_current_state = 11;
-                }
-                else {
-                    unexpectedLeaveAttribute($__qname);
-                }
-            }
-            break;
         case 7:
             {
                 action0();
@@ -370,18 +369,6 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 13:
-            {
-                name = $value;
-                $_ngcc_current_state = 12;
-            }
-            break;
-        case 17:
-            {
-                finalValue = $value;
-                $_ngcc_current_state = 16;
-            }
-            break;
         case 11:
             {
                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
@@ -394,11 +381,29 @@
                 }
             }
             break;
+        case 17:
+            {
+                finalValue = $value;
+                $_ngcc_current_state = 16;
+            }
+            break;
+        case 8:
+            {
+                $_ngcc_current_state = 7;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
         case 0:
             {
                 revertToParentFromText(result, super._cookie, $value);
             }
             break;
+        case 13:
+            {
+                name = $value;
+                $_ngcc_current_state = 12;
+            }
+            break;
         case 15:
             {
                 if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
@@ -411,12 +416,6 @@
                 }
             }
             break;
-        case 8:
-            {
-                $_ngcc_current_state = 7;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 7:
             {
                 action0();
@@ -429,36 +428,36 @@
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 383:
+        case 71:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 8;
+            }
+            break;
+        case 69:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 7;
             }
             break;
-        case 379:
+        case 65:
             {
                 result = ((RestrictionSimpleTypeImpl)$__result__);
                 $_ngcc_current_state = 1;
             }
             break;
-        case 380:
+        case 66:
             {
                 result = ((ListSimpleTypeImpl)$__result__);
                 $_ngcc_current_state = 1;
             }
             break;
-        case 374:
+        case 60:
             {
                 result = ((UnionSimpleTypeImpl)$__result__);
                 $_ngcc_current_state = 1;
             }
             break;
-        case 385:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 8;
-            }
-            break;
         }
     }
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java
index f30b0d4..4bbd39e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -76,14 +75,14 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 1:
+        case 10:
             {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 204, null,AnnotationContext.WILDCARD);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    $_ngcc_current_state = 0;
+                    $_ngcc_current_state = 9;
                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
                 }
             }
@@ -96,27 +95,15 @@
         case 9:
             {
                 if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
             }
             break;
-        case 10:
-            {
-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 298, null,AnnotationContext.WILDCARD);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    $_ngcc_current_state = 9;
-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
-                }
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
@@ -129,6 +116,18 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    $_ngcc_current_state = 0;
+                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -143,16 +142,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 1:
+        case 10:
             {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
-                else {
-                    $_ngcc_current_state = 0;
-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-                }
+                $_ngcc_current_state = 9;
+                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 0:
@@ -163,21 +156,15 @@
         case 9:
             {
                 if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
                 else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
                 }
             }
             break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
@@ -190,6 +177,18 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+                else {
+                    $_ngcc_current_state = 0;
+                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -204,15 +203,10 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 1:
+        case 10:
             {
-                if(($__uri.equals("") && $__local.equals("namespace"))) {
-                    $_ngcc_current_state = 3;
-                }
-                else {
-                    $_ngcc_current_state = 0;
-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-                }
+                $_ngcc_current_state = 9;
+                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
         case 0:
@@ -223,21 +217,15 @@
         case 9:
             {
                 if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
                 else {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
                 }
             }
             break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 5:
             {
                 if(($__uri.equals("") && $__local.equals("processContents"))) {
@@ -249,6 +237,17 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(($__uri.equals("") && $__local.equals("namespace"))) {
+                    $_ngcc_current_state = 3;
+                }
+                else {
+                    $_ngcc_current_state = 0;
+                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                }
+            }
+            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -273,6 +272,29 @@
                 }
             }
             break;
+        case 10:
+            {
+                $_ngcc_current_state = 9;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 0:
+            {
+                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 9:
+            {
+                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
+                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
+            }
+            break;
+        case 5:
+            {
+                $_ngcc_current_state = 1;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         case 2:
             {
                 if(($__uri.equals("") && $__local.equals("namespace"))) {
@@ -289,29 +311,6 @@
                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 9:
-            {
-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
-                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
-            }
-            break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 5:
-            {
-                $_ngcc_current_state = 1;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -323,28 +322,16 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 3:
-            {
-                ns = $value;
-                $_ngcc_current_state = 2;
-            }
-            break;
         case 7:
             {
                 modeValue = $value;
                 $_ngcc_current_state = 6;
             }
             break;
-        case 1:
+        case 10:
             {
-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-                else {
-                    $_ngcc_current_state = 0;
-                    $runtime.sendText(super._cookie, $value);
-                }
+                $_ngcc_current_state = 9;
+                $runtime.sendText(super._cookie, $value);
             }
             break;
         case 0:
@@ -355,27 +342,21 @@
         case 9:
             {
                 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                     spawnChildFromText(h, $value);
                 }
                 else {
                     if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                         spawnChildFromText(h, $value);
                     }
                     else {
-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 296, null);
+                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
                         spawnChildFromText(h, $value);
                     }
                 }
             }
             break;
-        case 10:
-            {
-                $_ngcc_current_state = 9;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 5:
             {
                 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
@@ -388,28 +369,46 @@
                 }
             }
             break;
+        case 1:
+            {
+                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+                else {
+                    $_ngcc_current_state = 0;
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
+        case 3:
+            {
+                ns = $value;
+                $_ngcc_current_state = 2;
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 296:
-            {
-                fa = ((ForeignAttributesImpl)$__result__);
-                $_ngcc_current_state = 5;
-            }
-            break;
-        case 298:
+        case 204:
             {
                 annotation = ((AnnotationImpl)$__result__);
                 $_ngcc_current_state = 9;
             }
             break;
+        case 202:
+            {
+                fa = ((ForeignAttributesImpl)$__result__);
+                $_ngcc_current_state = 5;
+            }
+            break;
         }
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
+        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 5) || ($_ngcc_current_state == 0))));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java
index 66e47fa..c8e78d0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 /* this file is generated by RelaxNGCC */
 package com.sun.xml.internal.xsom.impl.parser.state;
 import org.xml.sax.SAXException;
@@ -71,10 +70,26 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+            }
+            break;
+        case 6:
+            {
+                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                }
+                else {
+                    unexpectedEnterElement($__qname);
+                }
+            }
+            break;
         case 1:
             {
                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
-                    NGCCHandler h = new annotation(this, super._source, $runtime, 66, null,AnnotationContext.XPATH);
+                    NGCCHandler h = new annotation(this, super._source, $runtime, 652, null,AnnotationContext.XPATH);
                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
                 }
                 else {
@@ -94,22 +109,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
-            }
-            break;
-        case 6:
-            {
-                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, null);
-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
-                }
-                else {
-                    unexpectedEnterElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterElement($__qname);
@@ -124,6 +123,22 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 6:
+            {
+                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedLeaveElement($__qname);
+                }
+            }
+            break;
         case 1:
             {
                 $_ngcc_current_state = 0;
@@ -141,22 +156,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 6:
-            {
-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, null);
-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedLeaveElement($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedLeaveElement($__qname);
@@ -171,6 +170,22 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
+        case 0:
+            {
+                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
+        case 6:
+            {
+                if(($__uri.equals("") && $__local.equals("xpath"))) {
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                }
+                else {
+                    unexpectedEnterAttribute($__qname);
+                }
+            }
+            break;
         case 1:
             {
                 $_ngcc_current_state = 0;
@@ -187,22 +202,6 @@
                 }
             }
             break;
-        case 0:
-            {
-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
-        case 6:
-            {
-                if(($__uri.equals("") && $__local.equals("xpath"))) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, null);
-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
-                }
-                else {
-                    unexpectedEnterAttribute($__qname);
-                }
-            }
-            break;
         default:
             {
                 unexpectedEnterAttribute($__qname);
@@ -217,12 +216,6 @@
         $localName = $__local;
         $qname = $__qname;
         switch($_ngcc_current_state) {
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
-            }
-            break;
         case 0:
             {
                 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
@@ -238,6 +231,12 @@
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+            }
+            break;
         default:
             {
                 unexpectedLeaveAttribute($__qname);
@@ -249,26 +248,12 @@
     public void text(String $value) throws SAXException {
         int $ai;
         switch($_ngcc_current_state) {
-        case 1:
-            {
-                $_ngcc_current_state = 0;
-                $runtime.sendText(super._cookie, $value);
-            }
-            break;
         case 4:
             {
                 xpath = $value;
                 $_ngcc_current_state = 3;
             }
             break;
-        case 5:
-            {
-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    $runtime.consumeAttribute($ai);
-                    $runtime.sendText(super._cookie, $value);
-                }
-            }
-            break;
         case 0:
             {
                 revertToParentFromText(makeResult(), super._cookie, $value);
@@ -277,33 +262,47 @@
         case 6:
             {
                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, null);
+                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
                     spawnChildFromText(h, $value);
                 }
             }
             break;
+        case 1:
+            {
+                $_ngcc_current_state = 0;
+                $runtime.sendText(super._cookie, $value);
+            }
+            break;
+        case 5:
+            {
+                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+                    $runtime.consumeAttribute($ai);
+                    $runtime.sendText(super._cookie, $value);
+                }
+            }
+            break;
         }
     }
 
     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
         switch($__cookie__) {
-        case 66:
-            {
-                ann = ((AnnotationImpl)$__result__);
-                $_ngcc_current_state = 0;
-            }
-            break;
-        case 71:
+        case 657:
             {
                 fa = ((ForeignAttributesImpl)$__result__);
                 $_ngcc_current_state = 5;
             }
             break;
+        case 652:
+            {
+                ann = ((AnnotationImpl)$__result__);
+                $_ngcc_current_state = 0;
+            }
+            break;
         }
     }
 
     public boolean accepted() {
-        return((($_ngcc_current_state == 0) || ($_ngcc_current_state == 1)));
+        return((($_ngcc_current_state == 1) || ($_ngcc_current_state == 0)));
     }
 
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/AbstractAxisImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/AbstractAxisImpl.java
new file mode 100644
index 0000000..394a648
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/AbstractAxisImpl.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import com.sun.xml.internal.xsom.XSAnnotation;
+import com.sun.xml.internal.xsom.XSAttGroupDecl;
+import com.sun.xml.internal.xsom.XSAttributeDecl;
+import com.sun.xml.internal.xsom.XSAttributeUse;
+import com.sun.xml.internal.xsom.XSComplexType;
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSContentType;
+import com.sun.xml.internal.xsom.XSElementDecl;
+import com.sun.xml.internal.xsom.XSFacet;
+import com.sun.xml.internal.xsom.XSIdentityConstraint;
+import com.sun.xml.internal.xsom.XSModelGroup;
+import com.sun.xml.internal.xsom.XSModelGroupDecl;
+import com.sun.xml.internal.xsom.XSNotation;
+import com.sun.xml.internal.xsom.XSParticle;
+import com.sun.xml.internal.xsom.XSSchema;
+import com.sun.xml.internal.xsom.XSSimpleType;
+import com.sun.xml.internal.xsom.XSWildcard;
+import com.sun.xml.internal.xsom.XSXPath;
+import com.sun.xml.internal.xsom.visitor.XSFunction;
+
+import java.util.Iterator;
+
+/**
+ * Partial default implementation of {@link Axis}.
+ *
+ * <p>
+ * {@link XSParticle}s are skipped in SCD, so this class compensates that.
+ * For example, when we are considering a path from {@link XSComplexType},
+ * we need to also consider a path from its content type particle (if any.)
+ *
+ * @author Kohsuke Kawaguchi
+ */
+abstract class AbstractAxisImpl<T extends XSComponent> implements Axis<T>, XSFunction<Iterator<T>> {
+    /**
+     * Creates a singleton list.
+     */
+    protected final Iterator<T> singleton(T t) {
+        return Iterators.singleton(t);
+    }
+
+    protected final Iterator<T> union(T... items) {
+        return new Iterators.Array<T>(items);
+    }
+
+    protected final Iterator<T> union(Iterator<? extends T> first, Iterator<? extends T> second) {
+        return new Iterators.Union<T>(first,second);
+    }
+
+    public Iterator<T> iterator(XSComponent contextNode) {
+        return contextNode.apply(this);
+    }
+
+    /**
+     * Gets the prefix of the axis, like "foo::".
+     */
+    public String getName() {
+        return toString();
+    }
+
+    /**
+     * Default implementation that simply delegate sto {@link #iterator(XSComponent)}
+     */
+    public Iterator<T> iterator(Iterator<? extends XSComponent> contextNodes) {
+        return new Iterators.Map<T,XSComponent>(contextNodes) {
+            protected Iterator<? extends T> apply(XSComponent u) {
+                return iterator(u);
+            }
+        };
+    }
+
+    public boolean isModelGroup() {
+        return false;
+    }
+
+    public Iterator<T> annotation(XSAnnotation ann) {
+        return empty();
+    }
+
+    public Iterator<T> attGroupDecl(XSAttGroupDecl decl) {
+        return empty();
+    }
+
+    public Iterator<T> attributeDecl(XSAttributeDecl decl) {
+        return empty();
+    }
+
+    public Iterator<T> attributeUse(XSAttributeUse use) {
+        return empty();
+    }
+
+    public Iterator<T> complexType(XSComplexType type) {
+        // compensate particle
+        XSParticle p = type.getContentType().asParticle();
+        if(p!=null)
+            return particle(p);
+        else
+            return empty();
+    }
+
+    public Iterator<T> schema(XSSchema schema) {
+        return empty();
+    }
+
+    public Iterator<T> facet(XSFacet facet) {
+        return empty();
+    }
+
+    public Iterator<T> notation(XSNotation notation) {
+        return empty();
+    }
+
+    public Iterator<T> identityConstraint(XSIdentityConstraint decl) {
+        return empty();
+    }
+
+    public Iterator<T> xpath(XSXPath xpath) {
+        return empty();
+    }
+
+    public Iterator<T> simpleType(XSSimpleType simpleType) {
+        return empty();
+    }
+
+    public Iterator<T> particle(XSParticle particle) {
+        return empty();
+    }
+
+    public Iterator<T> empty(XSContentType empty) {
+        return empty();
+    }
+
+    public Iterator<T> wildcard(XSWildcard wc) {
+        return empty();
+    }
+
+    public Iterator<T> modelGroupDecl(XSModelGroupDecl decl) {
+        return empty();
+    }
+
+    public Iterator<T> modelGroup(XSModelGroup group) {
+        // compensate for particles that are ignored in SCD
+        return new Iterators.Map<T,XSParticle>(group.iterator()) {
+            protected Iterator<? extends T> apply(XSParticle p) {
+                return particle(p);
+            }
+        };
+    }
+
+    public Iterator<T> elementDecl(XSElementDecl decl) {
+        return empty();
+    }
+
+    /**
+     * Returns an empty list.
+     */
+    protected final Iterator<T> empty() {
+        return Iterators.empty();
+    }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Axis.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Axis.java
new file mode 100644
index 0000000..dcc6a4b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Axis.java
@@ -0,0 +1,578 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import com.sun.xml.internal.xsom.XSAttContainer;
+import com.sun.xml.internal.xsom.XSAttGroupDecl;
+import com.sun.xml.internal.xsom.XSAttributeDecl;
+import com.sun.xml.internal.xsom.XSAttributeUse;
+import com.sun.xml.internal.xsom.XSComplexType;
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSElementDecl;
+import com.sun.xml.internal.xsom.XSFacet;
+import com.sun.xml.internal.xsom.XSIdentityConstraint;
+import com.sun.xml.internal.xsom.XSListSimpleType;
+import com.sun.xml.internal.xsom.XSModelGroup;
+import com.sun.xml.internal.xsom.XSModelGroup.Compositor;
+import com.sun.xml.internal.xsom.XSModelGroupDecl;
+import com.sun.xml.internal.xsom.XSNotation;
+import com.sun.xml.internal.xsom.XSParticle;
+import com.sun.xml.internal.xsom.XSRestrictionSimpleType;
+import com.sun.xml.internal.xsom.XSSchema;
+import com.sun.xml.internal.xsom.XSSimpleType;
+import com.sun.xml.internal.xsom.XSType;
+import com.sun.xml.internal.xsom.XSUnionSimpleType;
+import com.sun.xml.internal.xsom.XSWildcard;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Axis of traversal.
+ *
+ * @param <T>
+ *      The kind of components that this axis may return.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface Axis<T extends XSComponent> {
+    Iterator<T> iterator(XSComponent contextNode);
+
+    Iterator<T> iterator(Iterator<? extends XSComponent> contextNodes);
+
+    /**
+     * Returns true if this is one of the model group axis.
+     */
+    boolean isModelGroup();
+
+
+    /**
+     * Pseudo-axis that selects all the {@link XSSchema}s in the current set.
+     * Used to implement the absolute path expression
+     */
+    public static final Axis<XSSchema> ROOT = new Axis<XSSchema>() {
+        public Iterator<XSSchema> iterator(XSComponent contextNode) {
+            return contextNode.getRoot().iterateSchema();
+        }
+
+        public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) {
+            if(!contextNodes.hasNext())
+                return Iterators.empty();
+            else
+                // this assumes that all current nodes belong to the same owner.
+                return iterator(contextNodes.next());
+        }
+
+        public boolean isModelGroup() {
+            return false;
+        }
+
+        public String toString() {
+            return "root::";
+        }
+    };
+
+    /**
+     * Pseudo-axis that visits all skipped intermediate steps.
+     * Those are:
+     * <ol>
+     *  <li>complex type reachable from element
+     *  <li>model groups
+     *  <li>combination of above.
+     * </ol>
+     */
+    public static final Axis<XSComponent> INTERMEDIATE_SKIP = new AbstractAxisImpl<XSComponent>() {
+        public Iterator<XSComponent> elementDecl(XSElementDecl decl) {
+            XSComplexType ct = decl.getType().asComplexType();
+            if(ct==null)
+                return empty();
+            else {
+                // also pick up model groups inside this complex type
+                return new Iterators.Union<XSComponent>(singleton(ct),complexType(ct));
+            }
+        }
+
+        public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) {
+            return descendants(decl.getModelGroup());
+        }
+
+        public Iterator<XSComponent> particle(XSParticle particle) {
+            return descendants(particle.getTerm().asModelGroup());
+        }
+
+        /**
+         * Iterate all descendant model groups of the given model group, including itself.
+         */
+        private Iterator<XSComponent> descendants(XSModelGroup mg) {
+            // TODO: write a tree iterator
+            // for now, we do it eagerly because I'm lazy
+            List<XSComponent> r = new ArrayList<XSComponent>();
+            visit(mg,r);
+            return r.iterator();
+        }
+
+        private void visit(XSModelGroup mg, List<XSComponent> r) {
+            // since model groups never form a cycle, no cycle check is needed
+            r.add(mg);
+            for (XSParticle p : mg) {
+                XSModelGroup child = p.getTerm().asModelGroup();
+                if(child!=null)
+                    visit(child,r);
+            }
+        }
+
+        public String toString() {
+            return "(intermediateSkip)";
+        }
+    };
+
+    /**
+     * All descendants reachable via default axes. Used to implement the "//" semantics.
+     *
+     * So far the default axes together are guaranteed not to cause any cycle, so
+     * no cycle check is needed (if it's needed, the life would be much harder!)
+     */
+    public static final Axis<XSComponent> DESCENDANTS = new Axis<XSComponent>() {
+        public Iterator<XSComponent> iterator(XSComponent contextNode) {
+            return new Visitor().iterator(contextNode);
+        }
+        public Iterator<XSComponent> iterator(Iterator<? extends XSComponent> contextNodes) {
+            return new Visitor().iterator(contextNodes);
+        }
+
+        public boolean isModelGroup() {
+            return false;
+        }
+
+        /**
+         * Stateful visitor that remembers what's already traversed, to reduce the search space.
+         */
+        final class Visitor extends AbstractAxisImpl<XSComponent> {
+            private final Set<XSComponent> visited = new HashSet<XSComponent>();
+
+            /**
+             * Recursively apply the {@link Axis#DESCENDANTS} axis.
+             */
+            final class Recursion extends Iterators.Map<XSComponent,XSComponent> {
+                public Recursion(Iterator<? extends XSComponent> core) {
+                    super(core);
+                }
+
+                protected Iterator<XSComponent> apply(XSComponent u) {
+                    return DESCENDANTS.iterator(u);
+                }
+            }
+            public Iterator<XSComponent> schema(XSSchema schema) {
+                if(visited.add(schema))
+                    return ret( schema, new Recursion(schema.iterateElementDecls()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> elementDecl(XSElementDecl decl) {
+                if(visited.add(decl))
+                    return ret(decl, iterator(decl.getType()) );
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> simpleType(XSSimpleType type) {
+                if(visited.add(type))
+                    return ret(type, FACET.iterator(type));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> complexType(XSComplexType type) {
+                if(visited.add(type))
+                    return ret(type, iterator(type.getContentType()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> particle(XSParticle particle) {
+                if(visited.add(particle))
+                    return ret(particle, iterator(particle.getTerm()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> modelGroupDecl(XSModelGroupDecl decl) {
+                if(visited.add(decl))
+                    return ret(decl, iterator(decl.getModelGroup()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> modelGroup(XSModelGroup group) {
+                if(visited.add(group))
+                    return ret(group, new Recursion(group.iterator()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> attGroupDecl(XSAttGroupDecl decl) {
+                if(visited.add(decl))
+                    return ret(decl, new Recursion(decl.iterateAttributeUses()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> attributeUse(XSAttributeUse use) {
+                if(visited.add(use))
+                    return ret(use, iterator(use.getDecl()));
+                else
+                    return empty();
+            }
+
+            public Iterator<XSComponent> attributeDecl(XSAttributeDecl decl) {
+                if(visited.add(decl))
+                    return ret(decl, iterator(decl.getType()));
+                else
+                    return empty();
+            }
+
+            private Iterator<XSComponent> ret( XSComponent one, Iterator<? extends XSComponent> rest ) {
+                return union(singleton(one),rest);
+            }
+        }
+
+        public String toString() {
+            return "/";
+        }
+    };
+
+    public static final Axis<XSSchema> X_SCHEMA = new Axis<XSSchema>() {
+        public Iterator<XSSchema> iterator(XSComponent contextNode) {
+            return Iterators.singleton(contextNode.getOwnerSchema());
+        }
+
+        public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) {
+            return new Iterators.Adapter<XSSchema,XSComponent>(contextNodes) {
+                protected XSSchema filter(XSComponent u) {
+                    return u.getOwnerSchema();
+                }
+            };
+        }
+
+        public boolean isModelGroup() {
+            return false;
+        }
+
+        public String toString() {
+            return "x-schema::";
+        }
+    };
+
+    public static final Axis<XSElementDecl> SUBSTITUTION_GROUP = new AbstractAxisImpl<XSElementDecl>() {
+        public Iterator<XSElementDecl> elementDecl(XSElementDecl decl) {
+            return singleton(decl.getSubstAffiliation());
+        }
+
+        public String toString() {
+            return "substitutionGroup::";
+        }
+    };
+
+    public static final Axis<XSAttributeDecl> ATTRIBUTE = new AbstractAxisImpl<XSAttributeDecl>() {
+        public Iterator<XSAttributeDecl> complexType(XSComplexType type) {
+            return attributeHolder(type);
+        }
+
+        public Iterator<XSAttributeDecl> attGroupDecl(XSAttGroupDecl decl) {
+            return attributeHolder(decl);
+        }
+
+        private Iterator<XSAttributeDecl> attributeHolder(final XSAttContainer atts) {
+            // TODO: check spec. is this correct?
+            return new Iterators.Adapter<XSAttributeDecl,XSAttributeUse>(atts.iterateAttributeUses()) {
+                protected XSAttributeDecl filter(XSAttributeUse u) {
+                    return u.getDecl();
+                }
+            };
+        }
+
+        public Iterator<XSAttributeDecl> schema(XSSchema schema) {
+            return schema.iterateAttributeDecls();
+        }
+
+        public String toString() {
+            return "@";
+        }
+    };
+
+    public static final Axis<XSElementDecl> ELEMENT = new AbstractAxisImpl<XSElementDecl>() {
+        public Iterator<XSElementDecl> particle(XSParticle particle) {
+            return singleton(particle.getTerm().asElementDecl());
+        }
+
+        public Iterator<XSElementDecl> schema(XSSchema schema) {
+            return schema.iterateElementDecls();
+        }
+
+        public Iterator<XSElementDecl> modelGroupDecl(XSModelGroupDecl decl) {
+            return modelGroup(decl.getModelGroup());
+        }
+
+        //public Iterator<XSElementDecl> modelGroup(XSModelGroup group) {
+        //    return new Iterators.Map<XSElementDecl,XSParticle>(group.iterator()) {
+        //        protected Iterator<XSElementDecl> apply(XSParticle p) {
+        //            return particle(p);
+        //        }
+        //    };
+        //}
+
+        @Override
+        public String getName() {
+            return "";
+        }
+
+        public String toString() {
+            return "element::";
+        }
+    };
+
+
+    public static final Axis<XSType> TYPE_DEFINITION = new AbstractAxisImpl<XSType>() {
+        public Iterator<XSType> schema(XSSchema schema) {
+            return schema.iterateTypes();
+        }
+
+        public Iterator<XSType> attributeDecl(XSAttributeDecl decl) {
+            return singleton(decl.getType());
+        }
+
+        public Iterator<XSType> elementDecl(XSElementDecl decl) {
+            return singleton(decl.getType());
+        }
+
+        public String toString() {
+            return "~";
+        }
+    };
+
+    public static final Axis<XSType> BASETYPE = new AbstractAxisImpl<XSType>() {
+        public Iterator<XSType> simpleType(XSSimpleType type) {
+            return singleton(type.getBaseType());
+        }
+
+        public Iterator<XSType> complexType(XSComplexType type) {
+            return singleton(type.getBaseType());
+        }
+
+        public String toString() {
+            return "baseType::";
+        }
+    };
+
+    public static final Axis<XSSimpleType> PRIMITIVE_TYPE = new AbstractAxisImpl<XSSimpleType>() {
+        public Iterator<XSSimpleType> simpleType(XSSimpleType type) {
+            return singleton(type.getPrimitiveType());
+        }
+
+        public String toString() {
+            return "primitiveType::";
+        }
+    };
+
+    public static final Axis<XSSimpleType> ITEM_TYPE = new AbstractAxisImpl<XSSimpleType>() {
+        public Iterator<XSSimpleType> simpleType(XSSimpleType type) {
+            XSListSimpleType baseList = type.getBaseListType();
+            if(baseList==null)      return empty();
+            return singleton(baseList.getItemType());
+        }
+
+        public String toString() {
+            return "itemType::";
+        }
+    };
+
+    public static final Axis<XSSimpleType> MEMBER_TYPE = new AbstractAxisImpl<XSSimpleType>() {
+        public Iterator<XSSimpleType> simpleType(XSSimpleType type) {
+            XSUnionSimpleType baseUnion = type.getBaseUnionType();
+            if(baseUnion ==null)      return empty();
+            return baseUnion.iterator();
+        }
+
+        public String toString() {
+            return "memberType::";
+        }
+    };
+
+    public static final Axis<XSComponent> SCOPE = new AbstractAxisImpl<XSComponent>() {
+        public Iterator<XSComponent> complexType(XSComplexType type) {
+            return singleton(type.getScope());
+        }
+        // TODO: attribute declaration has a scope, too.
+        // TODO: element declaration has a scope
+
+        public String toString() {
+            return "scope::";
+        }
+    };
+
+    public static final Axis<XSAttGroupDecl> ATTRIBUTE_GROUP = new AbstractAxisImpl<XSAttGroupDecl>() {
+        public Iterator<XSAttGroupDecl> schema(XSSchema schema) {
+            return schema.iterateAttGroupDecls();
+        }
+
+        public String toString() {
+            return "attributeGroup::";
+        }
+    };
+
+    public static final Axis<XSModelGroupDecl> MODEL_GROUP_DECL = new AbstractAxisImpl<XSModelGroupDecl>() {
+        public Iterator<XSModelGroupDecl> schema(XSSchema schema) {
+            return schema.iterateModelGroupDecls();
+        }
+
+        public Iterator<XSModelGroupDecl> particle(XSParticle particle) {
+            return singleton(particle.getTerm().asModelGroupDecl());
+        }
+
+        public String toString() {
+            return "group::";
+        }
+    };
+
+    public static final Axis<XSIdentityConstraint> IDENTITY_CONSTRAINT = new AbstractAxisImpl<XSIdentityConstraint>() {
+        public Iterator<XSIdentityConstraint> elementDecl(XSElementDecl decl) {
+            return decl.getIdentityConstraints().iterator();
+        }
+
+        public Iterator<XSIdentityConstraint> schema(XSSchema schema) {
+            // TODO: iterate all elements in this schema (local or global!) and its identity constraints
+            return super.schema(schema);
+        }
+
+        public String toString() {
+            return "identityConstraint::";
+        }
+    };
+
+    public static final Axis<XSIdentityConstraint> REFERENCED_KEY = new AbstractAxisImpl<XSIdentityConstraint>() {
+        public Iterator<XSIdentityConstraint> identityConstraint(XSIdentityConstraint decl) {
+            return singleton(decl.getReferencedKey());
+        }
+
+        public String toString() {
+            return "key::";
+        }
+    };
+
+    public static final Axis<XSNotation> NOTATION = new AbstractAxisImpl<XSNotation>() {
+        public Iterator<XSNotation> schema(XSSchema schema) {
+            return schema.iterateNotations();
+        }
+
+        public String toString() {
+            return "notation::";
+        }
+    };
+
+    public static final Axis<XSWildcard> WILDCARD = new AbstractAxisImpl<XSWildcard>() {
+        public Iterator<XSWildcard> particle(XSParticle particle) {
+            return singleton(particle.getTerm().asWildcard());
+        }
+
+        public String toString() {
+            return "any::";
+        }
+    };
+
+    public static final Axis<XSWildcard> ATTRIBUTE_WILDCARD = new AbstractAxisImpl<XSWildcard>() {
+        public Iterator<XSWildcard> complexType(XSComplexType type) {
+            return singleton(type.getAttributeWildcard());
+        }
+
+        public Iterator<XSWildcard> attGroupDecl(XSAttGroupDecl decl) {
+            return singleton(decl.getAttributeWildcard());
+        }
+
+        public String toString() {
+            return "anyAttribute::";
+        }
+    };
+
+    public static final Axis<XSFacet> FACET = new AbstractAxisImpl<XSFacet>() {
+        public Iterator<XSFacet> simpleType(XSSimpleType type) {
+            // TODO: it's not clear if "facets" mean all inherited facets or just declared facets
+            XSRestrictionSimpleType r = type.asRestriction();
+            if(r!=null)
+                return r.iterateDeclaredFacets();
+            else
+                return empty();
+        }
+
+        public String toString() {
+            return "facet::";
+        }
+    };
+
+    public static final Axis<XSModelGroup> MODELGROUP_ALL = new ModelGroupAxis(Compositor.ALL);
+    public static final Axis<XSModelGroup> MODELGROUP_CHOICE = new ModelGroupAxis(Compositor.CHOICE);
+    public static final Axis<XSModelGroup> MODELGROUP_SEQUENCE = new ModelGroupAxis(Compositor.SEQUENCE);
+    public static final Axis<XSModelGroup> MODELGROUP_ANY = new ModelGroupAxis(null);
+
+    static final class ModelGroupAxis extends AbstractAxisImpl<XSModelGroup> {
+        private final XSModelGroup.Compositor compositor;
+
+        ModelGroupAxis(Compositor compositor) {
+            this.compositor = compositor;
+        }
+
+        @Override
+        public boolean isModelGroup() {
+            return true;
+        }
+
+        public Iterator<XSModelGroup> particle(XSParticle particle) {
+            return filter(particle.getTerm().asModelGroup());
+        }
+
+        public Iterator<XSModelGroup> modelGroupDecl(XSModelGroupDecl decl) {
+            return filter(decl.getModelGroup());
+        }
+
+        private Iterator<XSModelGroup> filter(XSModelGroup mg) {
+            if(mg==null)
+                return empty();
+            if(mg.getCompositor() == compositor || compositor == null)
+                return singleton(mg);
+            else
+                return empty();
+        }
+
+        public String toString() {
+            if(compositor==null)
+                return "model::*";
+            else
+                return "model::"+compositor;
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Iterators.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Iterators.java
new file mode 100644
index 0000000..c39f85f
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Iterators.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+
+/**
+ * Various convenient {@link Iterator} implementations.
+ * @author Kohsuke Kawaguchi
+ */
+public class Iterators {
+
+    static abstract class ReadOnly<T> implements Iterator<T> {
+        public final void remove() {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    // we need to run on JDK 1.4
+    private static final Iterator EMPTY = Collections.EMPTY_LIST.iterator();
+
+    public static <T> Iterator<T> empty() {
+        return EMPTY;
+    }
+
+    public static <T> Iterator<T> singleton(T value) {
+        return new Singleton<T>(value);
+    }
+
+    /**
+     * {@link Iterator} that returns a single (or no) value.
+     */
+    static final class Singleton<T> extends ReadOnly<T> {
+        private T next;
+
+        Singleton(T next) {
+            this.next = next;
+        }
+
+        public boolean hasNext() {
+            return next!=null;
+        }
+
+        public T next() {
+            T r = next;
+            next = null;
+            return r;
+        }
+    }
+
+    /**
+     * {@link Iterator} that wraps another {@link Iterator} and changes its type.
+     */
+    public static abstract class Adapter<T,U> extends ReadOnly<T> {
+        private final Iterator<? extends U> core;
+
+        public Adapter(Iterator<? extends U> core) {
+            this.core = core;
+        }
+
+        public boolean hasNext() {
+            return core.hasNext();
+        }
+
+        public T next() {
+            return filter(core.next());
+        }
+
+        protected abstract T filter(U u);
+    }
+
+    /**
+     * For each U, apply U->Iterator&lt;T> function and then iterate all
+     * the resulting T.
+     */
+    public static abstract class Map<T,U> extends ReadOnly<T> {
+        private final Iterator<? extends U> core;
+
+        private Iterator<? extends T> current;
+
+        protected Map(Iterator<? extends U> core) {
+            this.core = core;
+        }
+
+        public boolean hasNext() {
+            while(current==null || !current.hasNext()) {
+                if(!core.hasNext())
+                    return false;   // nothing more to enumerate
+                current = apply(core.next());
+            }
+            return true;
+        }
+
+        public T next() {
+            return current.next();
+        }
+
+        protected abstract Iterator<? extends T> apply(U u);
+    }
+
+    /**
+     * Filter out objects from another iterator.
+     */
+    public static abstract class Filter<T> extends ReadOnly<T> {
+        private final Iterator<? extends T> core;
+        private T next;
+
+        protected Filter(Iterator<? extends T> core) {
+            this.core = core;
+        }
+
+        /**
+         * Return true to retain the value.
+         */
+        protected abstract boolean matches(T value);
+
+        public boolean hasNext() {
+            while(core.hasNext() && next==null) {
+                next = core.next();
+                if(!matches(next))
+                    next = null;
+            }
+
+            return next!=null;
+        }
+
+        public T next() {
+            if(next==null)      throw new NoSuchElementException();
+            T r = next;
+            next = null;
+            return r;
+        }
+    }
+
+    /**
+     * Only return unique items.
+     */
+    static final class Unique<T> extends Filter<T> {
+        private Set<T> values = new HashSet<T>();
+        public Unique(Iterator<? extends T> core) {
+            super(core);
+        }
+
+        protected boolean matches(T value) {
+            return values.add(value);
+        }
+    }
+
+    /**
+     * Union of two iterators.
+     */
+    public static final class Union<T> extends ReadOnly<T> {
+        private final Iterator<? extends T> first,second;
+
+        public Union(Iterator<? extends T> first, Iterator<? extends T> second) {
+            this.first = first;
+            this.second = second;
+        }
+
+        public boolean hasNext() {
+            return first.hasNext() || second.hasNext();
+        }
+
+        public T next() {
+            if(first.hasNext())     return first.next();
+            else                    return second.next();
+        }
+    }
+
+    /**
+     * Array iterator.
+     */
+    public static final class Array<T> extends ReadOnly<T> {
+        private final T[] items;
+        private int index=0;
+        public Array(T[] items) {
+            this.items = items;
+        }
+
+        public boolean hasNext() {
+            return index<items.length;
+        }
+
+        public T next() {
+            return items[index++];
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/ParseException.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/ParseException.java
new file mode 100644
index 0000000..a635624
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/ParseException.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
+package com.sun.xml.internal.xsom.impl.scd;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+  /**
+   * This constructor is used by the method "generateParseException"
+   * in the generated parser.  Calling this constructor generates
+   * a new object of this type with the fields "currentToken",
+   * "expectedTokenSequences", and "tokenImage" set.  The boolean
+   * flag "specialConstructor" is also set to true to indicate that
+   * this constructor was used to create this object.
+   * This constructor calls its super class with the empty string
+   * to force the "toString" method of parent class "Throwable" to
+   * print the error message in the form:
+   *     ParseException: <result of getMessage>
+   */
+  public ParseException(Token currentTokenVal,
+                        int[][] expectedTokenSequencesVal,
+                        String[] tokenImageVal
+                       )
+  {
+    super("");
+    specialConstructor = true;
+    currentToken = currentTokenVal;
+    expectedTokenSequences = expectedTokenSequencesVal;
+    tokenImage = tokenImageVal;
+  }
+
+  /**
+   * The following constructors are for use by you for whatever
+   * purpose you can think of.  Constructing the exception in this
+   * manner makes the exception behave in the normal way - i.e., as
+   * documented in the class "Throwable".  The fields "errorToken",
+   * "expectedTokenSequences", and "tokenImage" do not contain
+   * relevant information.  The JavaCC generated code does not use
+   * these constructors.
+   */
+
+  public ParseException() {
+    super();
+    specialConstructor = false;
+  }
+
+  public ParseException(String message) {
+    super(message);
+    specialConstructor = false;
+  }
+
+  /**
+   * This variable determines which constructor was used to create
+   * this object and thereby affects the semantics of the
+   * "getMessage" method (see below).
+   */
+  protected boolean specialConstructor;
+
+  /**
+   * This is the last token that has been consumed successfully.  If
+   * this object has been created due to a parse error, the token
+   * followng this token will (therefore) be the first error token.
+   */
+  public Token currentToken;
+
+  /**
+   * Each entry in this array is an array of integers.  Each array
+   * of integers represents a sequence of tokens (by their ordinal
+   * values) that is expected at this point of the parse.
+   */
+  public int[][] expectedTokenSequences;
+
+  /**
+   * This is a reference to the "tokenImage" array of the generated
+   * parser within which the parse error occurred.  This array is
+   * defined in the generated ...Constants interface.
+   */
+  public String[] tokenImage;
+
+  /**
+   * This method has the standard behavior when this object has been
+   * created using the standard constructors.  Otherwise, it uses
+   * "currentToken" and "expectedTokenSequences" to generate a parse
+   * error message and returns it.  If this object has been created
+   * due to a parse error, and you do not catch it (it gets thrown
+   * from the parser), then this method is called during the printing
+   * of the final stack trace, and hence the correct error message
+   * gets displayed.
+   */
+  public String getMessage() {
+    if (!specialConstructor) {
+      return super.getMessage();
+    }
+    StringBuffer expected = new StringBuffer();
+    int maxSize = 0;
+    for (int i = 0; i < expectedTokenSequences.length; i++) {
+      if (maxSize < expectedTokenSequences[i].length) {
+        maxSize = expectedTokenSequences[i].length;
+      }
+      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+        expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
+      }
+      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+        expected.append("...");
+      }
+      expected.append(eol).append("    ");
+    }
+    String retval = "Encountered \"";
+    Token tok = currentToken.next;
+    for (int i = 0; i < maxSize; i++) {
+      if (i != 0) retval += " ";
+      if (tok.kind == 0) {
+        retval += tokenImage[0];
+        break;
+      }
+      retval += add_escapes(tok.image);
+      tok = tok.next;
+    }
+    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+    retval += "." + eol;
+    if (expectedTokenSequences.length == 1) {
+      retval += "Was expecting:" + eol + "    ";
+    } else {
+      retval += "Was expecting one of:" + eol + "    ";
+    }
+    retval += expected.toString();
+    return retval;
+  }
+
+  /**
+   * The end of line string for this machine.
+   */
+  protected String eol = System.getProperty("line.separator", "\n");
+
+  /**
+   * Used to convert raw characters to their escaped version
+   * when these raw version cannot be used as part of an ASCII
+   * string literal.
+   */
+  protected String add_escapes(String str) {
+      StringBuffer retval = new StringBuffer();
+      char ch;
+      for (int i = 0; i < str.length(); i++) {
+        switch (str.charAt(i))
+        {
+           case 0 :
+              continue;
+           case '\b':
+              retval.append("\\b");
+              continue;
+           case '\t':
+              retval.append("\\t");
+              continue;
+           case '\n':
+              retval.append("\\n");
+              continue;
+           case '\f':
+              retval.append("\\f");
+              continue;
+           case '\r':
+              retval.append("\\r");
+              continue;
+           case '\"':
+              retval.append("\\\"");
+              continue;
+           case '\'':
+              retval.append("\\\'");
+              continue;
+           case '\\':
+              retval.append("\\\\");
+              continue;
+           default:
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                 String s = "0000" + Integer.toString(ch, 16);
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+              } else {
+                 retval.append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.toString();
+   }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDImpl.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDImpl.java
new file mode 100644
index 0000000..723ab36
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDImpl.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import com.sun.xml.internal.xsom.SCD;
+import com.sun.xml.internal.xsom.XSComponent;
+
+import java.util.Iterator;
+
+/**
+ * Schema component designator.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class SCDImpl extends SCD {
+    /**
+     * SCD is fundamentally a list of steps.
+     */
+    private final Step[] steps;
+
+    /**
+     * The original textual SCD representation.
+     */
+    private final String text;
+
+    public SCDImpl(String text, Step[] steps) {
+        this.text = text;
+        this.steps = steps;
+    }
+
+    public Iterator<XSComponent> select(Iterator<? extends XSComponent> contextNode) {
+        Iterator<XSComponent> nodeSet = (Iterator)contextNode;
+
+        int len = steps.length;
+        for( int i=0; i<len; i++ ) {
+            if(i!=0 && i!=len-1 && !steps[i-1].axis.isModelGroup() && steps[i].axis.isModelGroup()) {
+                // expand the current nodeset by adding abbreviatable complex type and model groups.
+                // note that such expansion is not allowed to occure in in between model group axes.
+
+                // TODO: this step is not needed if the next step is known not to react to
+                // complex type nor model groups, such as, say Axis.FACET
+                nodeSet = new Iterators.Unique<XSComponent>(
+                    new Iterators.Map<XSComponent,XSComponent>(nodeSet) {
+                        protected Iterator<XSComponent> apply(XSComponent u) {
+                            return new Iterators.Union<XSComponent>(
+                                Iterators.singleton(u),
+                                Axis.INTERMEDIATE_SKIP.iterator(u) );
+                        }
+                    }
+                );
+            }
+            nodeSet = steps[i].evaluate(nodeSet);
+        }
+
+        return nodeSet;
+    }
+
+    public String toString() {
+        return text;
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParser.java
new file mode 100644
index 0000000..ac97ab3
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParser.java
@@ -0,0 +1,561 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. SCDParser.java */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import java.util.*;
+import java.io.*;
+import com.sun.xml.internal.xsom.impl.UName;
+import javax.xml.namespace.*;
+
+public class SCDParser implements SCDParserConstants {
+  private NamespaceContext nsc;
+  public SCDParser(String text,NamespaceContext nsc) {
+    this(new StringReader(text));
+    this.nsc = nsc;
+  }
+  private String trim(String s) {
+    return s.substring(1,s.length()-1);
+  }
+  private String resolvePrefix(String prefix) throws ParseException {
+    try {
+      String r=nsc.getNamespaceURI(prefix);
+      // grrr!!
+      if(prefix.equals(""))
+        return r;
+      if(!r.equals(""))
+        return r;
+    } catch( IllegalArgumentException e ) {
+      ; // report an error
+    }
+    throw new ParseException("Unbound prefix: "+prefix);
+  }
+
+  // "[^:]+"
+  final public UName QName() throws ParseException {
+                  Token p,l=null;
+    p = jj_consume_token(NCNAME);
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case 15:
+      jj_consume_token(15);
+      l = jj_consume_token(NCNAME);
+      break;
+    default:
+      jj_la1[0] = jj_gen;
+      ;
+    }
+    if(l==null)
+      {if (true) return new UName(resolvePrefix(""),p.image);}
+    else
+      {if (true) return new UName(resolvePrefix(p.image),l.image);}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public String Prefix() throws ParseException {
+                    Token p;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case NCNAME:
+      p = jj_consume_token(NCNAME);
+              {if (true) return resolvePrefix(p.image);}
+      break;
+    default:
+      jj_la1[1] = jj_gen;
+   {if (true) return resolvePrefix("");}
+    }
+    throw new Error("Missing return statement in function");
+  }
+
+  final public List RelativeSchemaComponentPath() throws ParseException {
+  List steps = new ArrayList();
+  Step s;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case 16:
+    case 17:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 16:
+        jj_consume_token(16);
+          steps.add(new Step.Any(Axis.ROOT));
+        break;
+      case 17:
+        jj_consume_token(17);
+          steps.add(new Step.Any(Axis.DESCENDANTS));
+        break;
+      default:
+        jj_la1[2] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+      break;
+    default:
+      jj_la1[3] = jj_gen;
+      ;
+    }
+    s = Step();
+            steps.add(s);
+    label_1:
+    while (true) {
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 16:
+      case 17:
+        ;
+        break;
+      default:
+        jj_la1[4] = jj_gen;
+        break label_1;
+      }
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 16:
+        jj_consume_token(16);
+        break;
+      case 17:
+        jj_consume_token(17);
+            steps.add(new Step.Any(Axis.DESCENDANTS));
+        break;
+      default:
+        jj_la1[5] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+      s = Step();
+              steps.add(s);
+    }
+    {if (true) return steps;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Step Step() throws ParseException {
+  Step s; String p; Token n;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case 18:
+    case 19:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 18:
+        jj_consume_token(18);
+        break;
+      case 19:
+        jj_consume_token(19);
+        break;
+      default:
+        jj_la1[6] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+      s = NameOrWildcard(Axis.ATTRIBUTE);
+      break;
+    case NCNAME:
+    case 20:
+    case 45:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 20:
+        jj_consume_token(20);
+        break;
+      default:
+        jj_la1[7] = jj_gen;
+        ;
+      }
+      s = NameOrWildcard(Axis.ELEMENT);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[8] = jj_gen;
+        ;
+      }
+      break;
+    case 21:
+      jj_consume_token(21);
+      s = NameOrWildcard(Axis.SUBSTITUTION_GROUP);
+      break;
+    case 22:
+    case 23:
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case 22:
+        jj_consume_token(22);
+        break;
+      case 23:
+        jj_consume_token(23);
+        break;
+      default:
+        jj_la1[9] = jj_gen;
+        jj_consume_token(-1);
+        throw new ParseException();
+      }
+      s = NameOrWildcardOrAnonymous(Axis.TYPE_DEFINITION);
+      break;
+    case 24:
+      jj_consume_token(24);
+      s = NameOrWildcard(Axis.BASETYPE);
+      break;
+    case 25:
+      jj_consume_token(25);
+      s = NameOrWildcard(Axis.PRIMITIVE_TYPE);
+      break;
+    case 26:
+      jj_consume_token(26);
+      s = NameOrWildcardOrAnonymous(Axis.ITEM_TYPE);
+      break;
+    case 27:
+      jj_consume_token(27);
+      s = NameOrWildcardOrAnonymous(Axis.MEMBER_TYPE);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[10] = jj_gen;
+        ;
+      }
+      break;
+    case 28:
+      jj_consume_token(28);
+      s = NameOrWildcardOrAnonymous(Axis.SCOPE);
+      break;
+    case 29:
+      jj_consume_token(29);
+      s = NameOrWildcard(Axis.ATTRIBUTE_GROUP);
+      break;
+    case 30:
+      jj_consume_token(30);
+      s = NameOrWildcard(Axis.MODEL_GROUP_DECL);
+      break;
+    case 31:
+      jj_consume_token(31);
+      s = NameOrWildcard(Axis.IDENTITY_CONSTRAINT);
+      break;
+    case 32:
+      jj_consume_token(32);
+      s = NameOrWildcard(Axis.REFERENCED_KEY);
+      break;
+    case 33:
+      jj_consume_token(33);
+      s = NameOrWildcard(Axis.NOTATION);
+      break;
+    case 34:
+      jj_consume_token(34);
+                           s=new Step.Any(Axis.MODELGROUP_SEQUENCE);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[11] = jj_gen;
+        ;
+      }
+      break;
+    case 35:
+      jj_consume_token(35);
+                           s=new Step.Any(Axis.MODELGROUP_CHOICE);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[12] = jj_gen;
+        ;
+      }
+      break;
+    case 36:
+      jj_consume_token(36);
+                           s=new Step.Any(Axis.MODELGROUP_ALL);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[13] = jj_gen;
+        ;
+      }
+      break;
+    case 37:
+      jj_consume_token(37);
+                           s=new Step.Any(Axis.MODELGROUP_ANY);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[14] = jj_gen;
+        ;
+      }
+      break;
+    case 38:
+      jj_consume_token(38);
+                           s=new Step.Any(Axis.WILDCARD);
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+      case NUMBER:
+        Predicate(s);
+        break;
+      default:
+        jj_la1[15] = jj_gen;
+        ;
+      }
+      break;
+    case 39:
+      jj_consume_token(39);
+                           s=new Step.Any(Axis.ATTRIBUTE_WILDCARD);
+      break;
+    case 40:
+      jj_consume_token(40);
+                           s=new Step.Any(Axis.FACET);
+      break;
+    case 41:
+      jj_consume_token(41);
+      n = jj_consume_token(FACETNAME);
+                           s=new Step.Facet(Axis.FACET,n.image);
+      break;
+    case 42:
+      jj_consume_token(42);
+                           s=new Step.Any(Axis.DESCENDANTS);
+      break;
+    case 43:
+      jj_consume_token(43);
+      p = Prefix();
+                           s=new Step.Schema(Axis.X_SCHEMA,p);
+      break;
+    case 44:
+      jj_consume_token(44);
+                           s=new Step.Any(Axis.X_SCHEMA);
+      break;
+    default:
+      jj_la1[16] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+   {if (true) return s;}
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Step NameOrWildcard(Axis a) throws ParseException {
+                               UName un;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case NCNAME:
+      un = QName();
+               {if (true) return new Step.Named(a,un);}
+      break;
+    case 45:
+      jj_consume_token(45);
+               {if (true) return new Step.Any(a);}
+      break;
+    default:
+      jj_la1[17] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    throw new Error("Missing return statement in function");
+  }
+
+  final public Step NameOrWildcardOrAnonymous(Axis a) throws ParseException {
+                                          UName un;
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+    case NCNAME:
+      un = QName();
+               {if (true) return new Step.Named(a,un);}
+      break;
+    case 45:
+      jj_consume_token(45);
+               {if (true) return new Step.Any(a);}
+      break;
+    case 46:
+      jj_consume_token(46);
+                 {if (true) return new Step.AnonymousType(a);}
+      break;
+    default:
+      jj_la1[18] = jj_gen;
+      jj_consume_token(-1);
+      throw new ParseException();
+    }
+    throw new Error("Missing return statement in function");
+  }
+
+  final public int Predicate(Step s) throws ParseException {
+  Token t;
+    t = jj_consume_token(NUMBER);
+               {if (true) return s.predicate=Integer.parseInt(trim(t.image));}
+    throw new Error("Missing return statement in function");
+  }
+
+  public SCDParserTokenManager token_source;
+  SimpleCharStream jj_input_stream;
+  public Token token, jj_nt;
+  private int jj_ntk;
+  private int jj_gen;
+  final private int[] jj_la1 = new int[19];
+  static private int[] jj_la1_0;
+  static private int[] jj_la1_1;
+  static {
+      jj_la1_0();
+      jj_la1_1();
+   }
+   private static void jj_la1_0() {
+      jj_la1_0 = new int[] {0x8000,0x1000,0x30000,0x30000,0x30000,0x30000,0xc0000,0x100000,0x2000,0xc00000,0x2000,0x2000,0x2000,0x2000,0x2000,0x2000,0xfffc1000,0x1000,0x1000,};
+   }
+   private static void jj_la1_1() {
+      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3fff,0x2000,0x6000,};
+   }
+
+  public SCDParser(java.io.InputStream stream) {
+     this(stream, null);
+  }
+  public SCDParser(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source = new SCDParserTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(java.io.InputStream stream) {
+     ReInit(stream, null);
+  }
+  public void ReInit(java.io.InputStream stream, String encoding) {
+    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  public SCDParser(java.io.Reader stream) {
+    jj_input_stream = new SimpleCharStream(stream, 1, 1);
+    token_source = new SCDParserTokenManager(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(java.io.Reader stream) {
+    jj_input_stream.ReInit(stream, 1, 1);
+    token_source.ReInit(jj_input_stream);
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  public SCDParser(SCDParserTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  public void ReInit(SCDParserTokenManager tm) {
+    token_source = tm;
+    token = new Token();
+    jj_ntk = -1;
+    jj_gen = 0;
+    for (int i = 0; i < 19; i++) jj_la1[i] = -1;
+  }
+
+  final private Token jj_consume_token(int kind) throws ParseException {
+    Token oldToken;
+    if ((oldToken = token).next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    if (token.kind == kind) {
+      jj_gen++;
+      return token;
+    }
+    token = oldToken;
+    jj_kind = kind;
+    throw generateParseException();
+  }
+
+  final public Token getNextToken() {
+    if (token.next != null) token = token.next;
+    else token = token.next = token_source.getNextToken();
+    jj_ntk = -1;
+    jj_gen++;
+    return token;
+  }
+
+  final public Token getToken(int index) {
+    Token t = token;
+    for (int i = 0; i < index; i++) {
+      if (t.next != null) t = t.next;
+      else t = t.next = token_source.getNextToken();
+    }
+    return t;
+  }
+
+  final private int jj_ntk() {
+    if ((jj_nt=token.next) == null)
+      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+    else
+      return (jj_ntk = jj_nt.kind);
+  }
+
+  private java.util.Vector jj_expentries = new java.util.Vector();
+  private int[] jj_expentry;
+  private int jj_kind = -1;
+
+  public ParseException generateParseException() {
+    jj_expentries.removeAllElements();
+    boolean[] la1tokens = new boolean[47];
+    for (int i = 0; i < 47; i++) {
+      la1tokens[i] = false;
+    }
+    if (jj_kind >= 0) {
+      la1tokens[jj_kind] = true;
+      jj_kind = -1;
+    }
+    for (int i = 0; i < 19; i++) {
+      if (jj_la1[i] == jj_gen) {
+        for (int j = 0; j < 32; j++) {
+          if ((jj_la1_0[i] & (1<<j)) != 0) {
+            la1tokens[j] = true;
+          }
+          if ((jj_la1_1[i] & (1<<j)) != 0) {
+            la1tokens[32+j] = true;
+          }
+        }
+      }
+    }
+    for (int i = 0; i < 47; i++) {
+      if (la1tokens[i]) {
+        jj_expentry = new int[1];
+        jj_expentry[0] = i;
+        jj_expentries.addElement(jj_expentry);
+      }
+    }
+    int[][] exptokseq = new int[jj_expentries.size()][];
+    for (int i = 0; i < jj_expentries.size(); i++) {
+      exptokseq[i] = (int[])jj_expentries.elementAt(i);
+    }
+    return new ParseException(token, exptokseq, tokenImage);
+  }
+
+  final public void enable_tracing() {
+  }
+
+  final public void disable_tracing() {
+  }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserConstants.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserConstants.java
new file mode 100644
index 0000000..2540352
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserConstants.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. SCDParserConstants.java */
+package com.sun.xml.internal.xsom.impl.scd;
+
+public interface SCDParserConstants {
+
+  int EOF = 0;
+  int Letter = 6;
+  int BaseChar = 7;
+  int Ideographic = 8;
+  int CombiningChar = 9;
+  int UnicodeDigit = 10;
+  int Extender = 11;
+  int NCNAME = 12;
+  int NUMBER = 13;
+  int FACETNAME = 14;
+
+  int DEFAULT = 0;
+
+  String[] tokenImage = {
+    "<EOF>",
+    "\" \"",
+    "\"\\t\"",
+    "\"\\n\"",
+    "\"\\r\"",
+    "\"\\f\"",
+    "<Letter>",
+    "<BaseChar>",
+    "<Ideographic>",
+    "<CombiningChar>",
+    "<UnicodeDigit>",
+    "<Extender>",
+    "<NCNAME>",
+    "<NUMBER>",
+    "<FACETNAME>",
+    "\":\"",
+    "\"/\"",
+    "\"//\"",
+    "\"attribute::\"",
+    "\"@\"",
+    "\"element::\"",
+    "\"substitutionGroup::\"",
+    "\"type::\"",
+    "\"~\"",
+    "\"baseType::\"",
+    "\"primitiveType::\"",
+    "\"itemType::\"",
+    "\"memberType::\"",
+    "\"scope::\"",
+    "\"attributeGroup::\"",
+    "\"group::\"",
+    "\"identityContraint::\"",
+    "\"key::\"",
+    "\"notation::\"",
+    "\"model::sequence\"",
+    "\"model::choice\"",
+    "\"model::all\"",
+    "\"model::*\"",
+    "\"any::*\"",
+    "\"anyAttribute::*\"",
+    "\"facet::*\"",
+    "\"facet::\"",
+    "\"component::*\"",
+    "\"x-schema::\"",
+    "\"x-schema::*\"",
+    "\"*\"",
+    "\"0\"",
+  };
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java
new file mode 100644
index 0000000..9539a28
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java
@@ -0,0 +1,2457 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. SCDParserTokenManager.java */
+package com.sun.xml.internal.xsom.impl.scd;
+import java.util.*;
+import java.io.*;
+import com.sun.xml.internal.xsom.impl.UName;
+import javax.xml.namespace.*;
+
+public class SCDParserTokenManager implements SCDParserConstants
+{
+  public  java.io.PrintStream debugStream = System.out;
+  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+   switch (pos)
+   {
+      case 0:
+         if ((active0 & 0x3c08000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 103;
+         }
+         if ((active0 & 0x400000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 55;
+         }
+         if ((active0 & 0x30000000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 68;
+         }
+         if ((active0 & 0x2000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 81;
+         }
+         if ((active0 & 0x200000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 23;
+         }
+         if ((active0 & 0x40000000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 34;
+         }
+         if ((active0 & 0x100000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 91;
+         }
+         if ((active0 & 0x18c1f4240000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 1;
+         }
+         if ((active0 & 0x1000000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            return 16;
+         }
+         return -1;
+      case 1:
+         if ((active0 & 0x1fffff740000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 1;
+            return 1;
+         }
+         return -1;
+      case 2:
+         if ((active0 & 0x1fffff740000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 2;
+            return 1;
+         }
+         return -1;
+      case 3:
+         if ((active0 & 0x4100000000L) != 0L)
+         {
+            if (jjmatchedPos < 2)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 2;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1fbeff740000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 3;
+            return 1;
+         }
+         return -1;
+      case 4:
+         if ((active0 & 0x4100000000L) != 0L)
+         {
+            if (jjmatchedPos < 2)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 2;
+            }
+            return -1;
+         }
+         if ((active0 & 0x400000L) != 0L)
+         {
+            if (jjmatchedPos < 3)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 3;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1fbeff340000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 4;
+            return 1;
+         }
+         return -1;
+      case 5:
+         if ((active0 & 0x4000000000L) != 0L)
+         {
+            if (jjmatchedPos < 2)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 2;
+            }
+            return -1;
+         }
+         if ((active0 & 0x33c50000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0x400000L) != 0L)
+         {
+            if (jjmatchedPos < 3)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 3;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1c82af340000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 5;
+            return 1;
+         }
+         return -1;
+      case 6:
+         if ((active0 & 0x33c50000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1c82af340000L) != 0L)
+         {
+            if (jjmatchedPos != 6)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 6;
+            }
+            return 1;
+         }
+         return -1;
+      case 7:
+         if ((active0 & 0x100000L) != 0L)
+         {
+            if (jjmatchedPos < 6)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 6;
+            }
+            return -1;
+         }
+         if ((active0 & 0x13c00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1c82af240000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 7;
+            return 1;
+         }
+         return -1;
+      case 8:
+         if ((active0 & 0x480aa240000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 8;
+            return 1;
+         }
+         if ((active0 & 0x180205000000L) != 0L)
+         {
+            if (jjmatchedPos < 7)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 7;
+            }
+            return -1;
+         }
+         if ((active0 & 0x100000L) != 0L)
+         {
+            if (jjmatchedPos < 6)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 6;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1c00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         return -1;
+      case 9:
+         if ((active0 & 0x80aa200000L) != 0L)
+         {
+            if (jjmatchedPos != 9)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 9;
+            }
+            return 1;
+         }
+         if ((active0 & 0x180205000000L) != 0L)
+         {
+            if (jjmatchedPos < 7)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 7;
+            }
+            return -1;
+         }
+         if ((active0 & 0x40000040000L) != 0L)
+         {
+            if (jjmatchedPos < 8)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 8;
+            }
+            return -1;
+         }
+         if ((active0 & 0x1c00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         return -1;
+      case 10:
+         if ((active0 & 0x100000000000L) != 0L)
+         {
+            if (jjmatchedPos < 7)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 7;
+            }
+            return -1;
+         }
+         if ((active0 & 0x8000000L) != 0L)
+         {
+            if (jjmatchedPos < 9)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 9;
+            }
+            return -1;
+         }
+         if ((active0 & 0x40000040000L) != 0L)
+         {
+            if (jjmatchedPos < 8)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 8;
+            }
+            return -1;
+         }
+         if ((active0 & 0x80a2200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 10;
+            return 1;
+         }
+         if ((active0 & 0xc00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         return -1;
+      case 11:
+         if ((active0 & 0x40000000000L) != 0L)
+         {
+            if (jjmatchedPos < 8)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 8;
+            }
+            return -1;
+         }
+         if ((active0 & 0x8000000L) != 0L)
+         {
+            if (jjmatchedPos < 9)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 9;
+            }
+            return -1;
+         }
+         if ((active0 & 0xc00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0x80a2200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 11;
+            return 1;
+         }
+         return -1;
+      case 12:
+         if ((active0 & 0x8000000000L) != 0L)
+         {
+            if (jjmatchedPos < 11)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 11;
+            }
+            return -1;
+         }
+         if ((active0 & 0xc00000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0xa2200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 12;
+            return 1;
+         }
+         return -1;
+      case 13:
+         if ((active0 & 0x8000000000L) != 0L)
+         {
+            if (jjmatchedPos < 11)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 11;
+            }
+            return -1;
+         }
+         if ((active0 & 0x2000000L) != 0L)
+         {
+            if (jjmatchedPos < 12)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 12;
+            }
+            return -1;
+         }
+         if ((active0 & 0x400000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0xa0200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 13;
+            return 1;
+         }
+         return -1;
+      case 14:
+         if ((active0 & 0x8000000000L) != 0L)
+         {
+            if (jjmatchedPos < 11)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 11;
+            }
+            return -1;
+         }
+         if ((active0 & 0x20000000L) != 0L)
+         {
+            if (jjmatchedPos < 13)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 13;
+            }
+            return -1;
+         }
+         if ((active0 & 0x2000000L) != 0L)
+         {
+            if (jjmatchedPos < 12)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 12;
+            }
+            return -1;
+         }
+         if ((active0 & 0x400000000L) != 0L)
+         {
+            if (jjmatchedPos < 4)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 4;
+            }
+            return -1;
+         }
+         if ((active0 & 0x80200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 14;
+            return 1;
+         }
+         return -1;
+      case 15:
+         if ((active0 & 0x20000000L) != 0L)
+         {
+            if (jjmatchedPos < 13)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 13;
+            }
+            return -1;
+         }
+         if ((active0 & 0x80200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 15;
+            return 1;
+         }
+         return -1;
+      case 16:
+         if ((active0 & 0x80200000L) != 0L)
+         {
+            jjmatchedKind = 12;
+            jjmatchedPos = 16;
+            return 1;
+         }
+         return -1;
+      case 17:
+         if ((active0 & 0x80200000L) != 0L)
+         {
+            if (jjmatchedPos < 16)
+            {
+               jjmatchedKind = 12;
+               jjmatchedPos = 16;
+            }
+            return -1;
+         }
+         return -1;
+      default :
+         return -1;
+   }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
+private final int jjStopAtPos(int pos, int kind)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   return pos + 1;
+}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+   jjmatchedKind = kind;
+   jjmatchedPos = pos;
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) { return pos + 1; }
+   return jjMoveNfa_0(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_0()
+{
+   switch(curChar)
+   {
+      case 42:
+         return jjStopAtPos(0, 45);
+      case 47:
+         jjmatchedKind = 16;
+         return jjMoveStringLiteralDfa1_0(0x20000L);
+      case 48:
+         return jjStopAtPos(0, 46);
+      case 58:
+         return jjStopAtPos(0, 15);
+      case 64:
+         return jjStopAtPos(0, 19);
+      case 97:
+         return jjMoveStringLiteralDfa1_0(0xc020040000L);
+      case 98:
+         return jjMoveStringLiteralDfa1_0(0x1000000L);
+      case 99:
+         return jjMoveStringLiteralDfa1_0(0x40000000000L);
+      case 101:
+         return jjMoveStringLiteralDfa1_0(0x100000L);
+      case 102:
+         return jjMoveStringLiteralDfa1_0(0x30000000000L);
+      case 103:
+         return jjMoveStringLiteralDfa1_0(0x40000000L);
+      case 105:
+         return jjMoveStringLiteralDfa1_0(0x84000000L);
+      case 107:
+         return jjMoveStringLiteralDfa1_0(0x100000000L);
+      case 109:
+         return jjMoveStringLiteralDfa1_0(0x3c08000000L);
+      case 110:
+         return jjMoveStringLiteralDfa1_0(0x200000000L);
+      case 112:
+         return jjMoveStringLiteralDfa1_0(0x2000000L);
+      case 115:
+         return jjMoveStringLiteralDfa1_0(0x10200000L);
+      case 116:
+         return jjMoveStringLiteralDfa1_0(0x400000L);
+      case 120:
+         return jjMoveStringLiteralDfa1_0(0x180000000000L);
+      case 126:
+         return jjStopAtPos(0, 23);
+      default :
+         return jjMoveNfa_0(0, 0);
+   }
+}
+private final int jjMoveStringLiteralDfa1_0(long active0)
+{
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(0, active0);
+      return 1;
+   }
+   switch(curChar)
+   {
+      case 45:
+         return jjMoveStringLiteralDfa2_0(active0, 0x180000000000L);
+      case 47:
+         if ((active0 & 0x20000L) != 0L)
+            return jjStopAtPos(1, 17);
+         break;
+      case 97:
+         return jjMoveStringLiteralDfa2_0(active0, 0x30001000000L);
+      case 99:
+         return jjMoveStringLiteralDfa2_0(active0, 0x10000000L);
+      case 100:
+         return jjMoveStringLiteralDfa2_0(active0, 0x80000000L);
+      case 101:
+         return jjMoveStringLiteralDfa2_0(active0, 0x108000000L);
+      case 108:
+         return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
+      case 110:
+         return jjMoveStringLiteralDfa2_0(active0, 0xc000000000L);
+      case 111:
+         return jjMoveStringLiteralDfa2_0(active0, 0x43e00000000L);
+      case 114:
+         return jjMoveStringLiteralDfa2_0(active0, 0x42000000L);
+      case 116:
+         return jjMoveStringLiteralDfa2_0(active0, 0x24040000L);
+      case 117:
+         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
+      case 121:
+         return jjMoveStringLiteralDfa2_0(active0, 0x400000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(0, active0);
+}
+private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(0, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(1, active0);
+      return 2;
+   }
+   switch(curChar)
+   {
+      case 98:
+         return jjMoveStringLiteralDfa3_0(active0, 0x200000L);
+      case 99:
+         return jjMoveStringLiteralDfa3_0(active0, 0x30000000000L);
+      case 100:
+         return jjMoveStringLiteralDfa3_0(active0, 0x3c00000000L);
+      case 101:
+         return jjMoveStringLiteralDfa3_0(active0, 0x84100000L);
+      case 105:
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000000L);
+      case 109:
+         return jjMoveStringLiteralDfa3_0(active0, 0x40008000000L);
+      case 111:
+         return jjMoveStringLiteralDfa3_0(active0, 0x50000000L);
+      case 112:
+         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
+      case 115:
+         return jjMoveStringLiteralDfa3_0(active0, 0x180001000000L);
+      case 116:
+         return jjMoveStringLiteralDfa3_0(active0, 0x220040000L);
+      case 121:
+         return jjMoveStringLiteralDfa3_0(active0, 0xc100000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(1, active0);
+}
+private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(1, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(2, active0);
+      return 3;
+   }
+   switch(curChar)
+   {
+      case 58:
+         return jjMoveStringLiteralDfa4_0(active0, 0x4100000000L);
+      case 65:
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000000000L);
+      case 97:
+         return jjMoveStringLiteralDfa4_0(active0, 0x200000000L);
+      case 98:
+         return jjMoveStringLiteralDfa4_0(active0, 0x8000000L);
+      case 99:
+         return jjMoveStringLiteralDfa4_0(active0, 0x180000000000L);
+      case 101:
+         return jjMoveStringLiteralDfa4_0(active0, 0x33c01400000L);
+      case 109:
+         return jjMoveStringLiteralDfa4_0(active0, 0x6100000L);
+      case 110:
+         return jjMoveStringLiteralDfa4_0(active0, 0x80000000L);
+      case 112:
+         return jjMoveStringLiteralDfa4_0(active0, 0x40010000000L);
+      case 114:
+         return jjMoveStringLiteralDfa4_0(active0, 0x20040000L);
+      case 115:
+         return jjMoveStringLiteralDfa4_0(active0, 0x200000L);
+      case 117:
+         return jjMoveStringLiteralDfa4_0(active0, 0x40000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(2, active0);
+}
+private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(2, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(3, active0);
+      return 4;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x100000000L) != 0L)
+            return jjStopAtPos(4, 32);
+         return jjMoveStringLiteralDfa5_0(active0, 0x4000400000L);
+      case 84:
+         return jjMoveStringLiteralDfa5_0(active0, 0x5000000L);
+      case 101:
+         return jjMoveStringLiteralDfa5_0(active0, 0x18100000L);
+      case 104:
+         return jjMoveStringLiteralDfa5_0(active0, 0x180000000000L);
+      case 105:
+         return jjMoveStringLiteralDfa5_0(active0, 0x22040000L);
+      case 108:
+         return jjMoveStringLiteralDfa5_0(active0, 0x3c00000000L);
+      case 111:
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L);
+      case 112:
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000000L);
+      case 116:
+         return jjMoveStringLiteralDfa5_0(active0, 0x38280200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(3, active0);
+}
+private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(3, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(4, active0);
+      return 5;
+   }
+   switch(curChar)
+   {
+      case 42:
+         if ((active0 & 0x4000000000L) != 0L)
+            return jjStopAtPos(5, 38);
+         break;
+      case 58:
+         if ((active0 & 0x400000L) != 0L)
+            return jjStopAtPos(5, 22);
+         return jjMoveStringLiteralDfa6_0(active0, 0x33c50000000L);
+      case 98:
+         return jjMoveStringLiteralDfa6_0(active0, 0x20040000L);
+      case 101:
+         return jjMoveStringLiteralDfa6_0(active0, 0x180000000000L);
+      case 105:
+         return jjMoveStringLiteralDfa6_0(active0, 0x280200000L);
+      case 110:
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000100000L);
+      case 114:
+         return jjMoveStringLiteralDfa6_0(active0, 0x8000000L);
+      case 116:
+         return jjMoveStringLiteralDfa6_0(active0, 0x8002000000L);
+      case 121:
+         return jjMoveStringLiteralDfa6_0(active0, 0x5000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(4, active0);
+}
+private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(4, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(5, active0);
+      return 6;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x10000000L) != 0L)
+            return jjStopAtPos(6, 28);
+         else if ((active0 & 0x40000000L) != 0L)
+            return jjStopAtPos(6, 30);
+         else if ((active0 & 0x20000000000L) != 0L)
+         {
+            jjmatchedKind = 41;
+            jjmatchedPos = 6;
+         }
+         return jjMoveStringLiteralDfa7_0(active0, 0x13c00000000L);
+      case 84:
+         return jjMoveStringLiteralDfa7_0(active0, 0x8000000L);
+      case 101:
+         return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L);
+      case 105:
+         return jjMoveStringLiteralDfa7_0(active0, 0x2000000L);
+      case 109:
+         return jjMoveStringLiteralDfa7_0(active0, 0x180000000000L);
+      case 111:
+         return jjMoveStringLiteralDfa7_0(active0, 0x200000000L);
+      case 112:
+         return jjMoveStringLiteralDfa7_0(active0, 0x5000000L);
+      case 114:
+         return jjMoveStringLiteralDfa7_0(active0, 0x8000000000L);
+      case 116:
+         return jjMoveStringLiteralDfa7_0(active0, 0x80300000L);
+      case 117:
+         return jjMoveStringLiteralDfa7_0(active0, 0x20040000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(5, active0);
+}
+private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(5, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(6, active0);
+      return 7;
+   }
+   switch(curChar)
+   {
+      case 42:
+         if ((active0 & 0x2000000000L) != 0L)
+            return jjStopAtPos(7, 37);
+         else if ((active0 & 0x10000000000L) != 0L)
+            return jjStopAtPos(7, 40);
+         break;
+      case 58:
+         return jjMoveStringLiteralDfa8_0(active0, 0x100000L);
+      case 97:
+         return jjMoveStringLiteralDfa8_0(active0, 0x181000000000L);
+      case 99:
+         return jjMoveStringLiteralDfa8_0(active0, 0x800000000L);
+      case 101:
+         return jjMoveStringLiteralDfa8_0(active0, 0x5000000L);
+      case 105:
+         return jjMoveStringLiteralDfa8_0(active0, 0x8000000000L);
+      case 110:
+         return jjMoveStringLiteralDfa8_0(active0, 0x40200000000L);
+      case 115:
+         return jjMoveStringLiteralDfa8_0(active0, 0x400000000L);
+      case 116:
+         return jjMoveStringLiteralDfa8_0(active0, 0x20040000L);
+      case 117:
+         return jjMoveStringLiteralDfa8_0(active0, 0x200000L);
+      case 118:
+         return jjMoveStringLiteralDfa8_0(active0, 0x2000000L);
+      case 121:
+         return jjMoveStringLiteralDfa8_0(active0, 0x88000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(6, active0);
+}
+private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(6, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(7, active0);
+      return 8;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x100000L) != 0L)
+            return jjStopAtPos(8, 20);
+         return jjMoveStringLiteralDfa9_0(active0, 0x180205000000L);
+      case 67:
+         return jjMoveStringLiteralDfa9_0(active0, 0x80000000L);
+      case 98:
+         return jjMoveStringLiteralDfa9_0(active0, 0x8000000000L);
+      case 101:
+         return jjMoveStringLiteralDfa9_0(active0, 0x422040000L);
+      case 104:
+         return jjMoveStringLiteralDfa9_0(active0, 0x800000000L);
+      case 108:
+         return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L);
+      case 112:
+         return jjMoveStringLiteralDfa9_0(active0, 0x8000000L);
+      case 116:
+         return jjMoveStringLiteralDfa9_0(active0, 0x40000200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(7, active0);
+}
+private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(7, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(8, active0);
+      return 9;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x1000000L) != 0L)
+            return jjStopAtPos(9, 24);
+         else if ((active0 & 0x4000000L) != 0L)
+            return jjStopAtPos(9, 26);
+         else if ((active0 & 0x200000000L) != 0L)
+            return jjStopAtPos(9, 33);
+         else if ((active0 & 0x80000000000L) != 0L)
+         {
+            jjmatchedKind = 43;
+            jjmatchedPos = 9;
+         }
+         return jjMoveStringLiteralDfa10_0(active0, 0x140000040000L);
+      case 71:
+         return jjMoveStringLiteralDfa10_0(active0, 0x20000000L);
+      case 84:
+         return jjMoveStringLiteralDfa10_0(active0, 0x2000000L);
+      case 101:
+         return jjMoveStringLiteralDfa10_0(active0, 0x8000000L);
+      case 105:
+         return jjMoveStringLiteralDfa10_0(active0, 0x200000L);
+      case 108:
+         if ((active0 & 0x1000000000L) != 0L)
+            return jjStopAtPos(9, 36);
+         break;
+      case 111:
+         return jjMoveStringLiteralDfa10_0(active0, 0x880000000L);
+      case 113:
+         return jjMoveStringLiteralDfa10_0(active0, 0x400000000L);
+      case 117:
+         return jjMoveStringLiteralDfa10_0(active0, 0x8000000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(8, active0);
+}
+private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(8, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(9, active0);
+      return 10;
+   }
+   switch(curChar)
+   {
+      case 42:
+         if ((active0 & 0x100000000000L) != 0L)
+            return jjStopAtPos(10, 44);
+         break;
+      case 58:
+         if ((active0 & 0x40000L) != 0L)
+            return jjStopAtPos(10, 18);
+         return jjMoveStringLiteralDfa11_0(active0, 0x40008000000L);
+      case 105:
+         return jjMoveStringLiteralDfa11_0(active0, 0x800000000L);
+      case 110:
+         return jjMoveStringLiteralDfa11_0(active0, 0x80000000L);
+      case 111:
+         return jjMoveStringLiteralDfa11_0(active0, 0x200000L);
+      case 114:
+         return jjMoveStringLiteralDfa11_0(active0, 0x20000000L);
+      case 116:
+         return jjMoveStringLiteralDfa11_0(active0, 0x8000000000L);
+      case 117:
+         return jjMoveStringLiteralDfa11_0(active0, 0x400000000L);
+      case 121:
+         return jjMoveStringLiteralDfa11_0(active0, 0x2000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(9, active0);
+}
+private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(9, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(10, active0);
+      return 11;
+   }
+   switch(curChar)
+   {
+      case 42:
+         if ((active0 & 0x40000000000L) != 0L)
+            return jjStopAtPos(11, 42);
+         break;
+      case 58:
+         if ((active0 & 0x8000000L) != 0L)
+            return jjStopAtPos(11, 27);
+         break;
+      case 99:
+         return jjMoveStringLiteralDfa12_0(active0, 0x800000000L);
+      case 101:
+         return jjMoveStringLiteralDfa12_0(active0, 0x8400000000L);
+      case 110:
+         return jjMoveStringLiteralDfa12_0(active0, 0x200000L);
+      case 111:
+         return jjMoveStringLiteralDfa12_0(active0, 0x20000000L);
+      case 112:
+         return jjMoveStringLiteralDfa12_0(active0, 0x2000000L);
+      case 116:
+         return jjMoveStringLiteralDfa12_0(active0, 0x80000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(10, active0);
+}
+private final int jjMoveStringLiteralDfa12_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(10, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(11, active0);
+      return 12;
+   }
+   switch(curChar)
+   {
+      case 58:
+         return jjMoveStringLiteralDfa13_0(active0, 0x8000000000L);
+      case 71:
+         return jjMoveStringLiteralDfa13_0(active0, 0x200000L);
+      case 101:
+         if ((active0 & 0x800000000L) != 0L)
+            return jjStopAtPos(12, 35);
+         return jjMoveStringLiteralDfa13_0(active0, 0x2000000L);
+      case 110:
+         return jjMoveStringLiteralDfa13_0(active0, 0x400000000L);
+      case 114:
+         return jjMoveStringLiteralDfa13_0(active0, 0x80000000L);
+      case 117:
+         return jjMoveStringLiteralDfa13_0(active0, 0x20000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(11, active0);
+}
+private final int jjMoveStringLiteralDfa13_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(11, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(12, active0);
+      return 13;
+   }
+   switch(curChar)
+   {
+      case 58:
+         return jjMoveStringLiteralDfa14_0(active0, 0x8002000000L);
+      case 97:
+         return jjMoveStringLiteralDfa14_0(active0, 0x80000000L);
+      case 99:
+         return jjMoveStringLiteralDfa14_0(active0, 0x400000000L);
+      case 112:
+         return jjMoveStringLiteralDfa14_0(active0, 0x20000000L);
+      case 114:
+         return jjMoveStringLiteralDfa14_0(active0, 0x200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(12, active0);
+}
+private final int jjMoveStringLiteralDfa14_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(12, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(13, active0);
+      return 14;
+   }
+   switch(curChar)
+   {
+      case 42:
+         if ((active0 & 0x8000000000L) != 0L)
+            return jjStopAtPos(14, 39);
+         break;
+      case 58:
+         if ((active0 & 0x2000000L) != 0L)
+            return jjStopAtPos(14, 25);
+         return jjMoveStringLiteralDfa15_0(active0, 0x20000000L);
+      case 101:
+         if ((active0 & 0x400000000L) != 0L)
+            return jjStopAtPos(14, 34);
+         break;
+      case 105:
+         return jjMoveStringLiteralDfa15_0(active0, 0x80000000L);
+      case 111:
+         return jjMoveStringLiteralDfa15_0(active0, 0x200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(13, active0);
+}
+private final int jjMoveStringLiteralDfa15_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(13, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(14, active0);
+      return 15;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x20000000L) != 0L)
+            return jjStopAtPos(15, 29);
+         break;
+      case 110:
+         return jjMoveStringLiteralDfa16_0(active0, 0x80000000L);
+      case 117:
+         return jjMoveStringLiteralDfa16_0(active0, 0x200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(14, active0);
+}
+private final int jjMoveStringLiteralDfa16_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(14, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(15, active0);
+      return 16;
+   }
+   switch(curChar)
+   {
+      case 112:
+         return jjMoveStringLiteralDfa17_0(active0, 0x200000L);
+      case 116:
+         return jjMoveStringLiteralDfa17_0(active0, 0x80000000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(15, active0);
+}
+private final int jjMoveStringLiteralDfa17_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(15, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(16, active0);
+      return 17;
+   }
+   switch(curChar)
+   {
+      case 58:
+         return jjMoveStringLiteralDfa18_0(active0, 0x80200000L);
+      default :
+         break;
+   }
+   return jjStartNfa_0(16, active0);
+}
+private final int jjMoveStringLiteralDfa18_0(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_0(16, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_0(17, active0);
+      return 18;
+   }
+   switch(curChar)
+   {
+      case 58:
+         if ((active0 & 0x200000L) != 0L)
+            return jjStopAtPos(18, 21);
+         else if ((active0 & 0x80000000L) != 0L)
+            return jjStopAtPos(18, 31);
+         break;
+      default :
+         break;
+   }
+   return jjStartNfa_0(17, active0);
+}
+private final void jjCheckNAdd(int state)
+{
+   if (jjrounds[state] != jjround)
+   {
+      jjstateSet[jjnewStateCnt++] = state;
+      jjrounds[state] = jjround;
+   }
+}
+private final void jjAddStates(int start, int end)
+{
+   do {
+      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+   } while (start++ != end);
+}
+private final void jjCheckNAddTwoStates(int state1, int state2)
+{
+   jjCheckNAdd(state1);
+   jjCheckNAdd(state2);
+}
+private final void jjCheckNAddStates(int start, int end)
+{
+   do {
+      jjCheckNAdd(jjnextStates[start]);
+   } while (start++ != end);
+}
+private final void jjCheckNAddStates(int start)
+{
+   jjCheckNAdd(jjnextStates[start]);
+   jjCheckNAdd(jjnextStates[start + 1]);
+}
+static final long[] jjbitVec0 = {
+   0x0L, 0xffffffffffffc000L, 0xfffff0007fffffffL, 0x7fffffL
+};
+static final long[] jjbitVec2 = {
+   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec3 = {
+   0x7ff3ffffffffffffL, 0x7ffffffffffffdfeL, 0xffffffffffffffffL, 0xfc31ffffffffe00fL
+};
+static final long[] jjbitVec4 = {
+   0xffffffL, 0xffffffffffff0000L, 0xf80001ffffffffffL, 0x3L
+};
+static final long[] jjbitVec5 = {
+   0x0L, 0x0L, 0xfffffffbffffd740L, 0xffffd547f7fffL
+};
+static final long[] jjbitVec6 = {
+   0xffffffffffffdffeL, 0xffffffffdffeffffL, 0xffffffffffff0003L, 0x33fcfffffff199fL
+};
+static final long[] jjbitVec7 = {
+   0xfffe000000000000L, 0xfffffffe027fffffL, 0x7fL, 0x707ffffff0000L
+};
+static final long[] jjbitVec8 = {
+   0x7fffffe00000000L, 0xfffe0000000007feL, 0x7cffffffffffffffL, 0x60002f7fffL
+};
+static final long[] jjbitVec9 = {
+   0x23ffffffffffffe0L, 0x3ff000000L, 0x3c5fdfffff99fe0L, 0x30003b0000000L
+};
+static final long[] jjbitVec10 = {
+   0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbafe0L, 0x100000000L
+};
+static final long[] jjbitVec11 = {
+   0x23cdfdfffff99fe0L, 0x3b0000000L, 0x3bfc718d63dc7e0L, 0x0L
+};
+static final long[] jjbitVec12 = {
+   0x3effdfffffddfe0L, 0x300000000L, 0x3effdfffffddfe0L, 0x340000000L
+};
+static final long[] jjbitVec13 = {
+   0x3fffdfffffddfe0L, 0x300000000L, 0x0L, 0x0L
+};
+static final long[] jjbitVec14 = {
+   0xd7ffffffffffeL, 0x3fL, 0x200d6caefef02596L, 0x1fL
+};
+static final long[] jjbitVec15 = {
+   0x0L, 0x3fffffffeffL, 0x0L, 0x0L
+};
+static final long[] jjbitVec16 = {
+   0x0L, 0x0L, 0xffffffff00000000L, 0x7fffffffff003fL
+};
+static final long[] jjbitVec17 = {
+   0x500000000007daedL, 0x2c62ab82315001L, 0xf580c90040000000L, 0x201080000000007L
+};
+static final long[] jjbitVec18 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL
+};
+static final long[] jjbitVec19 = {
+   0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL
+};
+static final long[] jjbitVec20 = {
+   0x4c4000000000L, 0x0L, 0x7L, 0x0L
+};
+static final long[] jjbitVec21 = {
+   0x3fe00000080L, 0xfffffffffffffffeL, 0xfffffffe001fffffL, 0x7ffffffffffffffL
+};
+static final long[] jjbitVec22 = {
+   0x1fffffffffe0L, 0x0L, 0x0L, 0x0L
+};
+static final long[] jjbitVec23 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L
+};
+static final long[] jjbitVec24 = {
+   0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L
+};
+static final long[] jjbitVec25 = {
+   0x0L, 0x0L, 0x80000000000000L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec26 = {
+   0xffffffL, 0xffffffffffff0000L, 0xf80001ffffffffffL, 0x30003L
+};
+static final long[] jjbitVec27 = {
+   0xffffffffffffffffL, 0x30000003fL, 0xfffffffbffffd7c0L, 0xffffd547f7fffL
+};
+static final long[] jjbitVec28 = {
+   0xffffffffffffdffeL, 0xffffffffdffeffffL, 0xffffffffffff007bL, 0x33fcfffffff199fL
+};
+static final long[] jjbitVec29 = {
+   0xfffe000000000000L, 0xfffffffe027fffffL, 0xbbfffffbfffe007fL, 0x707ffffff0016L
+};
+static final long[] jjbitVec30 = {
+   0x7fffffe00000000L, 0xffff03ff0007ffffL, 0x7cffffffffffffffL, 0x3ff3dffffef7fffL
+};
+static final long[] jjbitVec31 = {
+   0xf3ffffffffffffeeL, 0xffcfff1e3fffL, 0xd3c5fdfffff99feeL, 0x3ffcfb080399fL
+};
+static final long[] jjbitVec32 = {
+   0xd36dfdfffff987e4L, 0x1fffc05e003987L, 0xf3edfdfffffbafeeL, 0xffc100003bbfL
+};
+static final long[] jjbitVec33 = {
+   0xf3cdfdfffff99feeL, 0xffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0xff8000803dc7L
+};
+static final long[] jjbitVec34 = {
+   0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xc3effdfffffddfecL, 0xffc340603ddfL
+};
+static final long[] jjbitVec35 = {
+   0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x0L, 0x0L
+};
+static final long[] jjbitVec36 = {
+   0x7ff7ffffffffffeL, 0x3ff7fffL, 0x3bff6caefef02596L, 0x3ff3f5fL
+};
+static final long[] jjbitVec37 = {
+   0xc2a003ff03000000L, 0xfffe03fffffffeffL, 0x2fe3ffffebf0fdfL, 0x0L
+};
+static final long[] jjbitVec38 = {
+   0x0L, 0x0L, 0x0L, 0x21fff0000L
+};
+static final long[] jjbitVec39 = {
+   0x3efffe000000a0L, 0xfffffffffffffffeL, 0xfffffffe661fffffL, 0x77ffffffffffffffL
+};
+private final int jjMoveNfa_0(int startState, int curPos)
+{
+   int[] nextStates;
+   int startsAt = 0;
+   jjnewStateCnt = 148;
+   int i = 1;
+   jjstateSet[0] = startState;
+   int j, kind = 0x7fffffff;
+   for (;;)
+   {
+      if (++jjround == 0x7fffffff)
+         ReInitRounds();
+      if (curChar < 64)
+      {
+         long l = 1L << curChar;
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 34:
+               case 1:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 91:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 16:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 55:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 68:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 103:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 81:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 23:
+                  if ((0x3ff600000000000L & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 3:
+                  if ((0x3ff000000000000L & l) != 0L)
+                     jjAddStates(0, 1);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else if (curChar < 128)
+      {
+         long l = 1L << (curChar & 077);
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 34:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 33;
+                  break;
+               case 91:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 90;
+                  break;
+               case 16:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 15;
+                  break;
+               case 55:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 54;
+                  break;
+               case 68:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 67;
+                  break;
+               case 103:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 146;
+                  else if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 139;
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 132;
+                  else if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 122;
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 112;
+                  else if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 102;
+                  break;
+               case 0:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  else if (curChar == 91)
+                     jjstateSet[jjnewStateCnt++] = 3;
+                  if (curChar == 109)
+                     jjAddStates(2, 7);
+                  else if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 91;
+                  else if (curChar == 112)
+                     jjstateSet[jjnewStateCnt++] = 81;
+                  else if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 74;
+                  else if (curChar == 102)
+                     jjstateSet[jjnewStateCnt++] = 68;
+                  else if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 55;
+                  else if (curChar == 119)
+                     jjstateSet[jjnewStateCnt++] = 44;
+                  else if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 34;
+                  else if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 23;
+                  else if (curChar == 98)
+                     jjstateSet[jjnewStateCnt++] = 16;
+                  else if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  break;
+               case 81:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 80;
+                  break;
+               case 23:
+                  if ((0x7fffffe87fffffeL & l) != 0L)
+                  {
+                     if (kind > 12)
+                        kind = 12;
+                     jjCheckNAdd(1);
+                  }
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 22;
+                  break;
+               case 1:
+                  if ((0x7fffffe87fffffeL & l) == 0L)
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 2:
+                  if (curChar == 91)
+                     jjstateSet[jjnewStateCnt++] = 3;
+                  break;
+               case 4:
+                  if (curChar == 93)
+                     kind = 13;
+                  break;
+               case 5:
+                  if (curChar == 100 && kind > 14)
+                     kind = 14;
+                  break;
+               case 6:
+               case 12:
+                  if (curChar == 101)
+                     jjCheckNAdd(5);
+                  break;
+               case 7:
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 6;
+                  break;
+               case 8:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 7;
+                  break;
+               case 9:
+                  if (curChar == 100)
+                     jjstateSet[jjnewStateCnt++] = 8;
+                  break;
+               case 10:
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 9;
+                  break;
+               case 11:
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 10;
+                  break;
+               case 13:
+                  if (curChar == 100)
+                     jjstateSet[jjnewStateCnt++] = 12;
+                  break;
+               case 14:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 13;
+                  break;
+               case 15:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 14;
+                  break;
+               case 17:
+                  if (curChar == 98)
+                     jjstateSet[jjnewStateCnt++] = 16;
+                  break;
+               case 18:
+                  if (curChar == 99 && kind > 14)
+                     kind = 14;
+                  break;
+               case 19:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 18;
+                  break;
+               case 20:
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 19;
+                  break;
+               case 21:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 20;
+                  break;
+               case 22:
+                  if (curChar == 109)
+                     jjstateSet[jjnewStateCnt++] = 21;
+                  break;
+               case 24:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 23;
+                  break;
+               case 25:
+                  if (curChar == 121 && kind > 14)
+                     kind = 14;
+                  break;
+               case 26:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 25;
+                  break;
+               case 27:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 26;
+                  break;
+               case 28:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 27;
+                  break;
+               case 29:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 28;
+                  break;
+               case 30:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 29;
+                  break;
+               case 31:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 30;
+                  break;
+               case 32:
+                  if (curChar == 100)
+                     jjstateSet[jjnewStateCnt++] = 31;
+                  break;
+               case 33:
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 32;
+                  break;
+               case 35:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 34;
+                  break;
+               case 36:
+                  if (curChar == 101 && kind > 14)
+                     kind = 14;
+                  break;
+               case 37:
+                  if (curChar == 99)
+                     jjCheckNAdd(36);
+                  break;
+               case 38:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 37;
+                  break;
+               case 39:
+                  if (curChar == 112)
+                     jjstateSet[jjnewStateCnt++] = 38;
+                  break;
+               case 40:
+                  if (curChar == 83)
+                     jjstateSet[jjnewStateCnt++] = 39;
+                  break;
+               case 41:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 40;
+                  break;
+               case 42:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 41;
+                  break;
+               case 43:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 42;
+                  break;
+               case 44:
+                  if (curChar == 104)
+                     jjstateSet[jjnewStateCnt++] = 43;
+                  break;
+               case 45:
+                  if (curChar == 119)
+                     jjstateSet[jjnewStateCnt++] = 44;
+                  break;
+               case 46:
+                  if (curChar == 115 && kind > 14)
+                     kind = 14;
+                  break;
+               case 47:
+               case 57:
+                  if (curChar == 116)
+                     jjCheckNAdd(46);
+                  break;
+               case 48:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 47;
+                  break;
+               case 49:
+                  if (curChar == 103)
+                     jjstateSet[jjnewStateCnt++] = 48;
+                  break;
+               case 50:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 49;
+                  break;
+               case 51:
+                  if (curChar == 68)
+                     jjstateSet[jjnewStateCnt++] = 50;
+                  break;
+               case 52:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 51;
+                  break;
+               case 53:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 52;
+                  break;
+               case 54:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 53;
+                  break;
+               case 56:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 55;
+                  break;
+               case 58:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 57;
+                  break;
+               case 59:
+                  if (curChar == 103)
+                     jjstateSet[jjnewStateCnt++] = 58;
+                  break;
+               case 60:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 59;
+                  break;
+               case 61:
+                  if (curChar == 68)
+                     jjstateSet[jjnewStateCnt++] = 60;
+                  break;
+               case 62:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 61;
+                  break;
+               case 63:
+                  if (curChar == 111)
+                     jjstateSet[jjnewStateCnt++] = 62;
+                  break;
+               case 64:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 63;
+                  break;
+               case 65:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 64;
+                  break;
+               case 66:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 65;
+                  break;
+               case 67:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 66;
+                  break;
+               case 69:
+                  if (curChar == 102)
+                     jjstateSet[jjnewStateCnt++] = 68;
+                  break;
+               case 70:
+                  if (curChar == 104 && kind > 14)
+                     kind = 14;
+                  break;
+               case 71:
+               case 134:
+               case 141:
+                  if (curChar == 116)
+                     jjCheckNAdd(70);
+                  break;
+               case 72:
+                  if (curChar == 103)
+                     jjstateSet[jjnewStateCnt++] = 71;
+                  break;
+               case 73:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 72;
+                  break;
+               case 74:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 73;
+                  break;
+               case 75:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 74;
+                  break;
+               case 76:
+                  if (curChar == 110 && kind > 14)
+                     kind = 14;
+                  break;
+               case 77:
+                  if (curChar == 114)
+                     jjCheckNAdd(76);
+                  break;
+               case 78:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 77;
+                  break;
+               case 79:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 78;
+                  break;
+               case 80:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 79;
+                  break;
+               case 82:
+                  if (curChar == 112)
+                     jjstateSet[jjnewStateCnt++] = 81;
+                  break;
+               case 83:
+                  if (curChar == 111)
+                     jjCheckNAdd(76);
+                  break;
+               case 84:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 83;
+                  break;
+               case 85:
+                  if (curChar == 116)
+                     jjstateSet[jjnewStateCnt++] = 84;
+                  break;
+               case 86:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 85;
+                  break;
+               case 87:
+                  if (curChar == 114)
+                     jjstateSet[jjnewStateCnt++] = 86;
+                  break;
+               case 88:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 87;
+                  break;
+               case 89:
+                  if (curChar == 109)
+                     jjstateSet[jjnewStateCnt++] = 88;
+                  break;
+               case 90:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 89;
+                  break;
+               case 92:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 91;
+                  break;
+               case 93:
+                  if (curChar == 109)
+                     jjAddStates(2, 7);
+                  break;
+               case 94:
+               case 104:
+               case 114:
+               case 124:
+                  if (curChar == 118)
+                     jjCheckNAdd(36);
+                  break;
+               case 95:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 94;
+                  break;
+               case 96:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 95;
+                  break;
+               case 97:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 96;
+                  break;
+               case 98:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 97;
+                  break;
+               case 99:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 98;
+                  break;
+               case 100:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 99;
+                  break;
+               case 101:
+                  if (curChar == 73)
+                     jjstateSet[jjnewStateCnt++] = 100;
+                  break;
+               case 102:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 101;
+                  break;
+               case 105:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 104;
+                  break;
+               case 106:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 105;
+                  break;
+               case 107:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 106;
+                  break;
+               case 108:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 107;
+                  break;
+               case 109:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 108;
+                  break;
+               case 110:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 109;
+                  break;
+               case 111:
+                  if (curChar == 73)
+                     jjstateSet[jjnewStateCnt++] = 110;
+                  break;
+               case 112:
+                  if (curChar == 120)
+                     jjstateSet[jjnewStateCnt++] = 111;
+                  break;
+               case 113:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 112;
+                  break;
+               case 115:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 114;
+                  break;
+               case 116:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 115;
+                  break;
+               case 117:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 116;
+                  break;
+               case 118:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 117;
+                  break;
+               case 119:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 118;
+                  break;
+               case 120:
+                  if (curChar == 120)
+                     jjstateSet[jjnewStateCnt++] = 119;
+                  break;
+               case 121:
+                  if (curChar == 69)
+                     jjstateSet[jjnewStateCnt++] = 120;
+                  break;
+               case 122:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 121;
+                  break;
+               case 123:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 122;
+                  break;
+               case 125:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 124;
+                  break;
+               case 126:
+                  if (curChar == 115)
+                     jjstateSet[jjnewStateCnt++] = 125;
+                  break;
+               case 127:
+                  if (curChar == 117)
+                     jjstateSet[jjnewStateCnt++] = 126;
+                  break;
+               case 128:
+                  if (curChar == 108)
+                     jjstateSet[jjnewStateCnt++] = 127;
+                  break;
+               case 129:
+                  if (curChar == 99)
+                     jjstateSet[jjnewStateCnt++] = 128;
+                  break;
+               case 130:
+                  if (curChar == 120)
+                     jjstateSet[jjnewStateCnt++] = 129;
+                  break;
+               case 131:
+                  if (curChar == 69)
+                     jjstateSet[jjnewStateCnt++] = 130;
+                  break;
+               case 132:
+                  if (curChar == 120)
+                     jjstateSet[jjnewStateCnt++] = 131;
+                  break;
+               case 133:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 132;
+                  break;
+               case 135:
+                  if (curChar == 103)
+                     jjstateSet[jjnewStateCnt++] = 134;
+                  break;
+               case 136:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 135;
+                  break;
+               case 137:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 136;
+                  break;
+               case 138:
+                  if (curChar == 76)
+                     jjstateSet[jjnewStateCnt++] = 137;
+                  break;
+               case 139:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 138;
+                  break;
+               case 140:
+                  if (curChar == 105)
+                     jjstateSet[jjnewStateCnt++] = 139;
+                  break;
+               case 142:
+                  if (curChar == 103)
+                     jjstateSet[jjnewStateCnt++] = 141;
+                  break;
+               case 143:
+                  if (curChar == 110)
+                     jjstateSet[jjnewStateCnt++] = 142;
+                  break;
+               case 144:
+                  if (curChar == 101)
+                     jjstateSet[jjnewStateCnt++] = 143;
+                  break;
+               case 145:
+                  if (curChar == 76)
+                     jjstateSet[jjnewStateCnt++] = 144;
+                  break;
+               case 146:
+                  if (curChar == 120)
+                     jjstateSet[jjnewStateCnt++] = 145;
+                  break;
+               case 147:
+                  if (curChar == 97)
+                     jjstateSet[jjnewStateCnt++] = 146;
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      else
+      {
+         int hiByte = (int)(curChar >> 8);
+         int i1 = hiByte >> 6;
+         long l1 = 1L << (hiByte & 077);
+         int i2 = (curChar & 0xff) >> 6;
+         long l2 = 1L << (curChar & 077);
+         MatchLoop: do
+         {
+            switch(jjstateSet[--i])
+            {
+               case 34:
+               case 1:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 91:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 16:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 55:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 68:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 103:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 0:
+                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 81:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               case 23:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 12)
+                     kind = 12;
+                  jjCheckNAdd(1);
+                  break;
+               default : break;
+            }
+         } while(i != startsAt);
+      }
+      if (kind != 0x7fffffff)
+      {
+         jjmatchedKind = kind;
+         jjmatchedPos = curPos;
+         kind = 0x7fffffff;
+      }
+      ++curPos;
+      if ((i = jjnewStateCnt) == (startsAt = 148 - (jjnewStateCnt = startsAt)))
+         return curPos;
+      try { curChar = input_stream.readChar(); }
+      catch(java.io.IOException e) { return curPos; }
+   }
+}
+static final int[] jjnextStates = {
+   3, 4, 103, 113, 123, 133, 140, 147,
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec2[i2] & l2) != 0L);
+      case 1:
+         return ((jjbitVec3[i2] & l2) != 0L);
+      case 2:
+         return ((jjbitVec4[i2] & l2) != 0L);
+      case 3:
+         return ((jjbitVec5[i2] & l2) != 0L);
+      case 4:
+         return ((jjbitVec6[i2] & l2) != 0L);
+      case 5:
+         return ((jjbitVec7[i2] & l2) != 0L);
+      case 6:
+         return ((jjbitVec8[i2] & l2) != 0L);
+      case 9:
+         return ((jjbitVec9[i2] & l2) != 0L);
+      case 10:
+         return ((jjbitVec10[i2] & l2) != 0L);
+      case 11:
+         return ((jjbitVec11[i2] & l2) != 0L);
+      case 12:
+         return ((jjbitVec12[i2] & l2) != 0L);
+      case 13:
+         return ((jjbitVec13[i2] & l2) != 0L);
+      case 14:
+         return ((jjbitVec14[i2] & l2) != 0L);
+      case 15:
+         return ((jjbitVec15[i2] & l2) != 0L);
+      case 16:
+         return ((jjbitVec16[i2] & l2) != 0L);
+      case 17:
+         return ((jjbitVec17[i2] & l2) != 0L);
+      case 30:
+         return ((jjbitVec18[i2] & l2) != 0L);
+      case 31:
+         return ((jjbitVec19[i2] & l2) != 0L);
+      case 33:
+         return ((jjbitVec20[i2] & l2) != 0L);
+      case 48:
+         return ((jjbitVec21[i2] & l2) != 0L);
+      case 49:
+         return ((jjbitVec22[i2] & l2) != 0L);
+      case 159:
+         return ((jjbitVec23[i2] & l2) != 0L);
+      case 215:
+         return ((jjbitVec24[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec0[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
+{
+   switch(hiByte)
+   {
+      case 0:
+         return ((jjbitVec25[i2] & l2) != 0L);
+      case 1:
+         return ((jjbitVec3[i2] & l2) != 0L);
+      case 2:
+         return ((jjbitVec26[i2] & l2) != 0L);
+      case 3:
+         return ((jjbitVec27[i2] & l2) != 0L);
+      case 4:
+         return ((jjbitVec28[i2] & l2) != 0L);
+      case 5:
+         return ((jjbitVec29[i2] & l2) != 0L);
+      case 6:
+         return ((jjbitVec30[i2] & l2) != 0L);
+      case 9:
+         return ((jjbitVec31[i2] & l2) != 0L);
+      case 10:
+         return ((jjbitVec32[i2] & l2) != 0L);
+      case 11:
+         return ((jjbitVec33[i2] & l2) != 0L);
+      case 12:
+         return ((jjbitVec34[i2] & l2) != 0L);
+      case 13:
+         return ((jjbitVec35[i2] & l2) != 0L);
+      case 14:
+         return ((jjbitVec36[i2] & l2) != 0L);
+      case 15:
+         return ((jjbitVec37[i2] & l2) != 0L);
+      case 16:
+         return ((jjbitVec16[i2] & l2) != 0L);
+      case 17:
+         return ((jjbitVec17[i2] & l2) != 0L);
+      case 30:
+         return ((jjbitVec18[i2] & l2) != 0L);
+      case 31:
+         return ((jjbitVec19[i2] & l2) != 0L);
+      case 32:
+         return ((jjbitVec38[i2] & l2) != 0L);
+      case 33:
+         return ((jjbitVec20[i2] & l2) != 0L);
+      case 48:
+         return ((jjbitVec39[i2] & l2) != 0L);
+      case 49:
+         return ((jjbitVec22[i2] & l2) != 0L);
+      case 159:
+         return ((jjbitVec23[i2] & l2) != 0L);
+      case 215:
+         return ((jjbitVec24[i2] & l2) != 0L);
+      default :
+         if ((jjbitVec0[i1] & l1) != 0L)
+            return true;
+         return false;
+   }
+}
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, "\72", "\57", "\57\57", "\141\164\164\162\151\142\165\164\145\72\72",
+"\100", "\145\154\145\155\145\156\164\72\72",
+"\163\165\142\163\164\151\164\165\164\151\157\156\107\162\157\165\160\72\72", "\164\171\160\145\72\72", "\176", "\142\141\163\145\124\171\160\145\72\72",
+"\160\162\151\155\151\164\151\166\145\124\171\160\145\72\72", "\151\164\145\155\124\171\160\145\72\72",
+"\155\145\155\142\145\162\124\171\160\145\72\72", "\163\143\157\160\145\72\72",
+"\141\164\164\162\151\142\165\164\145\107\162\157\165\160\72\72", "\147\162\157\165\160\72\72",
+"\151\144\145\156\164\151\164\171\103\157\156\164\162\141\151\156\164\72\72", "\153\145\171\72\72", "\156\157\164\141\164\151\157\156\72\72",
+"\155\157\144\145\154\72\72\163\145\161\165\145\156\143\145", "\155\157\144\145\154\72\72\143\150\157\151\143\145",
+"\155\157\144\145\154\72\72\141\154\154", "\155\157\144\145\154\72\72\52", "\141\156\171\72\72\52",
+"\141\156\171\101\164\164\162\151\142\165\164\145\72\72\52", "\146\141\143\145\164\72\72\52", "\146\141\143\145\164\72\72",
+"\143\157\155\160\157\156\145\156\164\72\72\52", "\170\55\163\143\150\145\155\141\72\72",
+"\170\55\163\143\150\145\155\141\72\72\52", "\52", "\60", };
+public static final String[] lexStateNames = {
+   "DEFAULT",
+};
+static final long[] jjtoToken = {
+   0x7ffffffff001L,
+};
+static final long[] jjtoSkip = {
+   0x3eL,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[148];
+private final int[] jjstateSet = new int[296];
+protected char curChar;
+public SCDParserTokenManager(SimpleCharStream stream){
+   if (SimpleCharStream.staticFlag)
+      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+   input_stream = stream;
+}
+public SCDParserTokenManager(SimpleCharStream stream, int lexState){
+   this(stream);
+   SwitchTo(lexState);
+}
+public void ReInit(SimpleCharStream stream)
+{
+   jjmatchedPos = jjnewStateCnt = 0;
+   curLexState = defaultLexState;
+   input_stream = stream;
+   ReInitRounds();
+}
+private final void ReInitRounds()
+{
+   int i;
+   jjround = 0x80000001;
+   for (i = 148; i-- > 0;)
+      jjrounds[i] = 0x80000000;
+}
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+   ReInit(stream);
+   SwitchTo(lexState);
+}
+public void SwitchTo(int lexState)
+{
+   if (lexState >= 1 || lexState < 0)
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+   else
+      curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+   Token t = Token.newToken(jjmatchedKind);
+   t.kind = jjmatchedKind;
+   String im = jjstrLiteralImages[jjmatchedKind];
+   t.image = (im == null) ? input_stream.GetImage() : im;
+   t.beginLine = input_stream.getBeginLine();
+   t.beginColumn = input_stream.getBeginColumn();
+   t.endLine = input_stream.getEndLine();
+   t.endColumn = input_stream.getEndColumn();
+   return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+public Token getNextToken()
+{
+  int kind;
+  Token specialToken = null;
+  Token matchedToken;
+  int curPos = 0;
+
+  EOFLoop :
+  for (;;)
+  {
+   try
+   {
+      curChar = input_stream.BeginToken();
+   }
+   catch(java.io.IOException e)
+   {
+      jjmatchedKind = 0;
+      matchedToken = jjFillToken();
+      return matchedToken;
+   }
+
+   try { input_stream.backup(0);
+      while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
+         curChar = input_stream.BeginToken();
+   }
+   catch (java.io.IOException e1) { continue EOFLoop; }
+   jjmatchedKind = 0x7fffffff;
+   jjmatchedPos = 0;
+   curPos = jjMoveStringLiteralDfa0_0();
+   if (jjmatchedKind != 0x7fffffff)
+   {
+      if (jjmatchedPos + 1 < curPos)
+         input_stream.backup(curPos - jjmatchedPos - 1);
+      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+      {
+         matchedToken = jjFillToken();
+         return matchedToken;
+      }
+      else
+      {
+         continue EOFLoop;
+      }
+   }
+   int error_line = input_stream.getEndLine();
+   int error_column = input_stream.getEndColumn();
+   String error_after = null;
+   boolean EOFSeen = false;
+   try { input_stream.readChar(); input_stream.backup(1); }
+   catch (java.io.IOException e1) {
+      EOFSeen = true;
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+      if (curChar == '\n' || curChar == '\r') {
+         error_line++;
+         error_column = 0;
+      }
+      else
+         error_column++;
+   }
+   if (!EOFSeen) {
+      input_stream.backup(1);
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();
+   }
+   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+  }
+}
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SimpleCharStream.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SimpleCharStream.java
new file mode 100644
index 0000000..d4fa673
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SimpleCharStream.java
@@ -0,0 +1,463 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
+package com.sun.xml.internal.xsom.impl.scd;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+  public static final boolean staticFlag = false;
+  int bufsize;
+  int available;
+  int tokenBegin;
+  public int bufpos = -1;
+  protected int bufline[];
+  protected int bufcolumn[];
+
+  protected int column = 0;
+  protected int line = 1;
+
+  protected boolean prevCharIsCR = false;
+  protected boolean prevCharIsLF = false;
+
+  protected java.io.Reader inputStream;
+
+  protected char[] buffer;
+  protected int maxNextCharInd = 0;
+  protected int inBuf = 0;
+  protected int tabSize = 8;
+
+  protected void setTabSize(int i) { tabSize = i; }
+  protected int getTabSize(int i) { return tabSize; }
+
+
+  protected void ExpandBuff(boolean wrapAround)
+  {
+     char[] newbuffer = new char[bufsize + 2048];
+     int newbufline[] = new int[bufsize + 2048];
+     int newbufcolumn[] = new int[bufsize + 2048];
+
+     try
+     {
+        if (wrapAround)
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           System.arraycopy(buffer, 0, newbuffer,
+                                             bufsize - tokenBegin, bufpos);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+        }
+        else
+        {
+           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+           buffer = newbuffer;
+
+           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+           bufline = newbufline;
+
+           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+           bufcolumn = newbufcolumn;
+
+           maxNextCharInd = (bufpos -= tokenBegin);
+        }
+     }
+     catch (Throwable t)
+     {
+        throw new Error(t.getMessage());
+     }
+
+
+     bufsize += 2048;
+     available = bufsize;
+     tokenBegin = 0;
+  }
+
+  protected void FillBuff() throws java.io.IOException
+  {
+     if (maxNextCharInd == available)
+     {
+        if (available == bufsize)
+        {
+           if (tokenBegin > 2048)
+           {
+              bufpos = maxNextCharInd = 0;
+              available = tokenBegin;
+           }
+           else if (tokenBegin < 0)
+              bufpos = maxNextCharInd = 0;
+           else
+              ExpandBuff(false);
+        }
+        else if (available > tokenBegin)
+           available = bufsize;
+        else if ((tokenBegin - available) < 2048)
+           ExpandBuff(true);
+        else
+           available = tokenBegin;
+     }
+
+     int i;
+     try {
+        if ((i = inputStream.read(buffer, maxNextCharInd,
+                                    available - maxNextCharInd)) == -1)
+        {
+           inputStream.close();
+           throw new java.io.IOException();
+        }
+        else
+           maxNextCharInd += i;
+        return;
+     }
+     catch(java.io.IOException e) {
+        --bufpos;
+        backup(0);
+        if (tokenBegin == -1)
+           tokenBegin = bufpos;
+        throw e;
+     }
+  }
+
+  public char BeginToken() throws java.io.IOException
+  {
+     tokenBegin = -1;
+     char c = readChar();
+     tokenBegin = bufpos;
+
+     return c;
+  }
+
+  protected void UpdateLineColumn(char c)
+  {
+     column++;
+
+     if (prevCharIsLF)
+     {
+        prevCharIsLF = false;
+        line += (column = 1);
+     }
+     else if (prevCharIsCR)
+     {
+        prevCharIsCR = false;
+        if (c == '\n')
+        {
+           prevCharIsLF = true;
+        }
+        else
+           line += (column = 1);
+     }
+
+     switch (c)
+     {
+        case '\r' :
+           prevCharIsCR = true;
+           break;
+        case '\n' :
+           prevCharIsLF = true;
+           break;
+        case '\t' :
+           column--;
+           column += (tabSize - (column % tabSize));
+           break;
+        default :
+           break;
+     }
+
+     bufline[bufpos] = line;
+     bufcolumn[bufpos] = column;
+  }
+
+  public char readChar() throws java.io.IOException
+  {
+     if (inBuf > 0)
+     {
+        --inBuf;
+
+        if (++bufpos == bufsize)
+           bufpos = 0;
+
+        return buffer[bufpos];
+     }
+
+     if (++bufpos >= maxNextCharInd)
+        FillBuff();
+
+     char c = buffer[bufpos];
+
+     UpdateLineColumn(c);
+     return (c);
+  }
+
+  /**
+   * @deprecated
+   * @see #getEndColumn
+   */
+
+  public int getColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  /**
+   * @deprecated
+   * @see #getEndLine
+   */
+
+  public int getLine() {
+     return bufline[bufpos];
+  }
+
+  public int getEndColumn() {
+     return bufcolumn[bufpos];
+  }
+
+  public int getEndLine() {
+     return bufline[bufpos];
+  }
+
+  public int getBeginColumn() {
+     return bufcolumn[tokenBegin];
+  }
+
+  public int getBeginLine() {
+     return bufline[tokenBegin];
+  }
+
+  public void backup(int amount) {
+
+    inBuf += amount;
+    if ((bufpos -= amount) < 0)
+       bufpos += bufsize;
+  }
+
+  public SimpleCharStream(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    available = bufsize = buffersize;
+    buffer = new char[buffersize];
+    bufline = new int[buffersize];
+    bufcolumn = new int[buffersize];
+  }
+
+  public SimpleCharStream(java.io.Reader dstream, int startline,
+                          int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.Reader dstream)
+  {
+     this(dstream, 1, 1, 4096);
+  }
+  public void ReInit(java.io.Reader dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+    inputStream = dstream;
+    line = startline;
+    column = startcolumn - 1;
+
+    if (buffer == null || buffersize != buffer.length)
+    {
+      available = bufsize = buffersize;
+      buffer = new char[buffersize];
+      bufline = new int[buffersize];
+      bufcolumn = new int[buffersize];
+    }
+    prevCharIsLF = prevCharIsCR = false;
+    tokenBegin = inBuf = maxNextCharInd = 0;
+    bufpos = -1;
+  }
+
+  public void ReInit(java.io.Reader dstream, int startline,
+                     int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+
+  public void ReInit(java.io.Reader dstream)
+  {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+  int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+  {
+     this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream, int startline,
+  int startcolumn, int buffersize)
+  {
+     this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+                          int startcolumn) throws java.io.UnsupportedEncodingException
+  {
+     this(dstream, encoding, startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream, int startline,
+                          int startcolumn)
+  {
+     this(dstream, startline, startcolumn, 4096);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+  {
+     this(dstream, encoding, 1, 1, 4096);
+  }
+
+  public SimpleCharStream(java.io.InputStream dstream)
+  {
+     this(dstream, 1, 1, 4096);
+  }
+
+  public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+                          int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+  {
+     ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+  }
+
+  public void ReInit(java.io.InputStream dstream, int startline,
+                          int startcolumn, int buffersize)
+  {
+     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+  }
+
+  public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+  {
+     ReInit(dstream, encoding, 1, 1, 4096);
+  }
+
+  public void ReInit(java.io.InputStream dstream)
+  {
+     ReInit(dstream, 1, 1, 4096);
+  }
+  public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+                     int startcolumn) throws java.io.UnsupportedEncodingException
+  {
+     ReInit(dstream, encoding, startline, startcolumn, 4096);
+  }
+  public void ReInit(java.io.InputStream dstream, int startline,
+                     int startcolumn)
+  {
+     ReInit(dstream, startline, startcolumn, 4096);
+  }
+  public String GetImage()
+  {
+     if (bufpos >= tokenBegin)
+        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+     else
+        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+                              new String(buffer, 0, bufpos + 1);
+  }
+
+  public char[] GetSuffix(int len)
+  {
+     char[] ret = new char[len];
+
+     if ((bufpos + 1) >= len)
+        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+     else
+     {
+        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+                                                          len - bufpos - 1);
+        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+     }
+
+     return ret;
+  }
+
+  public void Done()
+  {
+     buffer = null;
+     bufline = null;
+     bufcolumn = null;
+  }
+
+  /**
+   * Method to adjust line and column numbers for the start of a token.
+   */
+  public void adjustBeginLineColumn(int newLine, int newCol)
+  {
+     int start = tokenBegin;
+     int len;
+
+     if (bufpos >= tokenBegin)
+     {
+        len = bufpos - tokenBegin + inBuf + 1;
+     }
+     else
+     {
+        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+     }
+
+     int i = 0, j = 0, k = 0;
+     int nextColDiff = 0, columnDiff = 0;
+
+     while (i < len &&
+            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+     {
+        bufline[j] = newLine;
+        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+        bufcolumn[j] = newCol + columnDiff;
+        columnDiff = nextColDiff;
+        i++;
+     }
+
+     if (i < len)
+     {
+        bufline[j] = newLine++;
+        bufcolumn[j] = newCol + columnDiff;
+
+        while (i++ < len)
+        {
+           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+              bufline[j] = newLine++;
+           else
+              bufline[j] = newLine;
+        }
+     }
+
+     line = bufline[j];
+     column = bufcolumn[j];
+  }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Step.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Step.java
new file mode 100644
index 0000000..4e9cb60
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Step.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.impl.scd;
+
+import com.sun.xml.internal.xsom.XSComponent;
+import com.sun.xml.internal.xsom.XSDeclaration;
+import com.sun.xml.internal.xsom.XSFacet;
+import com.sun.xml.internal.xsom.XSType;
+import com.sun.xml.internal.xsom.SCD;
+import com.sun.xml.internal.xsom.XSSchema;
+import com.sun.xml.internal.xsom.impl.UName;
+
+import java.util.Iterator;
+
+/**
+ * Building block of {@link SCD}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class Step<T extends XSComponent> {
+    public final Axis<? extends T> axis;
+
+    /**
+     * 'Predicate' in SCD designates the index of the item. -1 if there's no predicate.
+     * Predicate starts from 1.
+     *
+     * <p>
+     * Because of the parsing order this parameter cannot be marked
+     * final, even though it's immutable once it's parsed.
+     */
+    int predicate = -1;
+
+    protected Step(Axis<? extends T> axis) {
+        this.axis = axis;
+    }
+
+    /**
+     * Perform filtering (which is different depending on the kind of step.)
+     */
+    protected abstract Iterator<? extends T> filter( Iterator<? extends T> base );
+
+    /**
+     * Evaluate this step against the current node set
+     * and returns matched nodes.
+     */
+    public final Iterator<T> evaluate(Iterator<XSComponent> nodeSet) {
+        // list up the whole thing
+        Iterator<T> r = new Iterators.Map<T,XSComponent>(nodeSet) {
+            protected Iterator<? extends T> apply(XSComponent contextNode) {
+                return filter(axis.iterator(contextNode));
+            }
+        };
+
+        // avoid duplicates
+        r = new Iterators.Unique<T>(r);
+
+        if(predicate>=0) {
+            T item=null;
+            for( int i=predicate; i>0; i-- ) {
+                if(!r.hasNext())
+                    return Iterators.empty();
+                item = r.next();
+            }
+            return new Iterators.Singleton<T>(item);
+        }
+
+        return r;
+    }
+
+    /**
+     * Matches any name.
+     */
+    static final class Any extends Step<XSComponent> {
+        public Any(Axis<? extends XSComponent> axis) {
+            super(axis);
+        }
+
+        // no filtering.
+        protected Iterator<? extends XSComponent> filter(Iterator<? extends XSComponent> base) {
+            return base;
+        }
+    }
+
+    private static abstract class Filtered<T extends XSComponent> extends Step<T> {
+        protected Filtered(Axis<? extends T> axis) {
+            super(axis);
+        }
+
+        protected Iterator<T> filter(Iterator<? extends T> base) {
+            return new Iterators.Filter<T>(base) {
+                protected boolean matches(T d) {
+                    return match(d);
+                }
+            };
+        }
+
+        protected abstract boolean match(T d);
+    }
+
+    /**
+     * Matches a particular name.
+     */
+    static final class Named extends Filtered<XSDeclaration> {
+        private final String nsUri;
+        private final String localName;
+
+        public Named(Axis<? extends XSDeclaration> axis, UName n) {
+            this(axis,n.getNamespaceURI(),n.getName());
+        }
+
+        public Named(Axis<? extends XSDeclaration> axis, String nsUri, String localName) {
+            super(axis);
+            this.nsUri = nsUri;
+            this.localName = localName;
+        }
+
+        protected boolean match(XSDeclaration d) {
+            return d.getName().equals(localName) && d.getTargetNamespace().equals(nsUri);
+        }
+    }
+
+    /**
+     * Matches anonymous types.
+     */
+    static final class AnonymousType extends Filtered<XSType> {
+        public AnonymousType(Axis<? extends XSType> axis) {
+            super(axis);
+        }
+
+        protected boolean match(XSType node) {
+            return node.isLocal();
+        }
+    }
+
+    /**
+     * Matches a particular kind of facets.
+     */
+    static final class Facet extends Filtered<XSFacet> {
+        private final String name;
+        public Facet(Axis<XSFacet> axis, String facetName) {
+            super(axis);
+            this.name = facetName;
+        }
+
+        protected boolean match(XSFacet f) {
+            return f.getName().equals(name);
+        }
+    }
+
+    /**
+     * Matches a schema in a particular namespace.
+     */
+    static final class Schema extends Filtered<XSSchema> {
+        private final String uri;
+        public Schema(Axis<XSSchema> axis, String uri) {
+            super(axis);
+            this.uri = uri;
+        }
+
+        protected boolean match(XSSchema d) {
+            return d.getTargetNamespace().equals(uri);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Token.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Token.java
new file mode 100644
index 0000000..8e85aa5
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Token.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
+package com.sun.xml.internal.xsom.impl.scd;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token {
+
+  /**
+   * An integer that describes the kind of this token.  This numbering
+   * system is determined by JavaCCParser, and a table of these numbers is
+   * stored in the file ...Constants.java.
+   */
+  public int kind;
+
+  /**
+   * beginLine and beginColumn describe the position of the first character
+   * of this token; endLine and endColumn describe the position of the
+   * last character of this token.
+   */
+  public int beginLine, beginColumn, endLine, endColumn;
+
+  /**
+   * The string image of the token.
+   */
+  public String image;
+
+  /**
+   * A reference to the next regular (non-special) token from the input
+   * stream.  If this is the last token from the input stream, or if the
+   * token manager has not read tokens beyond this one, this field is
+   * set to null.  This is true only if this token is also a regular
+   * token.  Otherwise, see below for a description of the contents of
+   * this field.
+   */
+  public Token next;
+
+  /**
+   * This field is used to access special tokens that occur prior to this
+   * token, but after the immediately preceding regular (non-special) token.
+   * If there are no such special tokens, this field is set to null.
+   * When there are more than one such special token, this field refers
+   * to the last of these special tokens, which in turn refers to the next
+   * previous special token through its specialToken field, and so on
+   * until the first special token (whose specialToken field is null).
+   * The next fields of special tokens refer to other special tokens that
+   * immediately follow it (without an intervening regular token).  If there
+   * is no such token, this field is null.
+   */
+  public Token specialToken;
+
+  /**
+   * Returns the image.
+   */
+  public String toString()
+  {
+     return image;
+  }
+
+  /**
+   * Returns a new Token object, by default. However, if you want, you
+   * can create and return subclass objects based on the value of ofKind.
+   * Simply add the cases to the switch for all those special cases.
+   * For example, if you have a subclass of Token called IDToken that
+   * you want to create if ofKind is ID, simlpy add something like :
+   *
+   *    case MyParserConstants.ID : return new IDToken();
+   *
+   * to the following switch statement. Then you can cast matchedToken
+   * variable to the appropriate type and use it in your lexical actions.
+   */
+  public static final Token newToken(int ofKind)
+  {
+     switch(ofKind)
+     {
+       default : return new Token();
+     }
+  }
+
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/TokenMgrError.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/TokenMgrError.java
new file mode 100644
index 0000000..10eb721
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/TokenMgrError.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
+package com.sun.xml.internal.xsom.impl.scd;
+
+public class TokenMgrError extends Error
+{
+   /*
+    * Ordinals for various reasons why an Error of this type can be thrown.
+    */
+
+   /**
+    * Lexical error occured.
+    */
+   static final int LEXICAL_ERROR = 0;
+
+   /**
+    * An attempt wass made to create a second instance of a static token manager.
+    */
+   static final int STATIC_LEXER_ERROR = 1;
+
+   /**
+    * Tried to change to an invalid lexical state.
+    */
+   static final int INVALID_LEXICAL_STATE = 2;
+
+   /**
+    * Detected (and bailed out of) an infinite loop in the token manager.
+    */
+   static final int LOOP_DETECTED = 3;
+
+   /**
+    * Indicates the reason why the exception is thrown. It will have
+    * one of the above 4 values.
+    */
+   int errorCode;
+
+   /**
+    * Replaces unprintable characters by their espaced (or unicode escaped)
+    * equivalents in the given string
+    */
+   protected static final String addEscapes(String str) {
+      StringBuffer retval = new StringBuffer();
+      char ch;
+      for (int i = 0; i < str.length(); i++) {
+        switch (str.charAt(i))
+        {
+           case 0 :
+              continue;
+           case '\b':
+              retval.append("\\b");
+              continue;
+           case '\t':
+              retval.append("\\t");
+              continue;
+           case '\n':
+              retval.append("\\n");
+              continue;
+           case '\f':
+              retval.append("\\f");
+              continue;
+           case '\r':
+              retval.append("\\r");
+              continue;
+           case '\"':
+              retval.append("\\\"");
+              continue;
+           case '\'':
+              retval.append("\\\'");
+              continue;
+           case '\\':
+              retval.append("\\\\");
+              continue;
+           default:
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                 String s = "0000" + Integer.toString(ch, 16);
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+              } else {
+                 retval.append(ch);
+              }
+              continue;
+        }
+      }
+      return retval.toString();
+   }
+
+   /**
+    * Returns a detailed message for the Error when it is thrown by the
+    * token manager to indicate a lexical error.
+    * Parameters :
+    *    EOFSeen     : indicates if EOF caused the lexicl error
+    *    curLexState : lexical state in which this error occured
+    *    errorLine   : line number when the error occured
+    *    errorColumn : column number when the error occured
+    *    errorAfter  : prefix that was seen before this error occured
+    *    curchar     : the offending character
+    * Note: You can customize the lexical error message by modifying this method.
+    */
+   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+      return("Lexical error at line " +
+           errorLine + ", column " +
+           errorColumn + ".  Encountered: " +
+           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+           "after : \"" + addEscapes(errorAfter) + "\"");
+   }
+
+   /**
+    * You can also modify the body of this method to customize your error messages.
+    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+    * of end-users concern, so you can return something like :
+    *
+    *     "Internal Error : Please file a bug report .... "
+    *
+    * from this method for such cases in the release version of your parser.
+    */
+   public String getMessage() {
+      return super.getMessage();
+   }
+
+   /*
+    * Constructors of various flavors follow.
+    */
+
+   public TokenMgrError() {
+   }
+
+   public TokenMgrError(String message, int reason) {
+      super(message);
+      errorCode = reason;
+   }
+
+   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+   }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ConcatIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ConcatIterator.java
deleted file mode 100644
index 8009e76..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ConcatIterator.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.xsom.impl.util;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * @author
- *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public class ConcatIterator implements Iterator {
-
-    private Iterator lhs,rhs;
-
-    public ConcatIterator(Iterator _lhs, Iterator _rhs) {
-        this.lhs = _lhs;
-        this.rhs = _rhs;
-    }
-
-    public boolean hasNext() {
-        if( lhs!=null ) {
-            if( lhs.hasNext() ) return true;
-            lhs = null; // no more item in lhs
-        }
-        return rhs.hasNext();
-    }
-
-    public Object next() {
-        if( lhs!=null )     return lhs.next();
-        else                return rhs.next();
-    }
-
-    public void remove() {
-        if( lhs!=null )     lhs.remove();
-        else                rhs.remove();
-    }
-
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java
index 3ba74b0..4faad35 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/FilterIterator.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/FilterIterator.java
deleted file mode 100644
index bb91970..0000000
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/FilterIterator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-package com.sun.xml.internal.xsom.impl.util;
-
-import java.util.Iterator;
-
-/**
- * {@link Iterator} that works as a filter to another {@link Iterator}.
- *
- * @author
- *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- */
-public abstract class FilterIterator implements Iterator {
-
-    private final Iterator core;
-    private Object next;
-
-    protected FilterIterator( Iterator core ) {
-        this.core = core;
-    }
-
-    /**
-     * Implemented by the derived class to filter objects.
-     *
-     * @return true
-     *      to let the iterator return the object to the client.
-     */
-    protected abstract boolean allows( Object o );
-
-    public boolean hasNext() {
-        while(next==null && core.hasNext()) {
-            // fetch next
-            Object o = core.next();
-            if( allows(o) )
-                next = o;
-        }
-        return next!=null;
-    }
-
-    public Object next() {
-        Object r = next;
-        next = null;
-        return r;
-    }
-
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java
index d0bf149..1422ae7 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java
index efee6e5..3fad540 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.impl.util;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java
index 2b102ae..b80b16c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java
index 6c38aca..073896e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java
@@ -1,4 +1,28 @@
 /*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
 Copyright (c) 2001, 2002 Thai Open Source Software Center Ltd
 All rights reserved.
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/package.html b/jaxws/src/share/classes/com/sun/xml/internal/xsom/package.html
index 0338a6b..74e609a 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Interfaces that the client should use to access schema information.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java
index 3109b35..ac5616e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java
index 4f75219..404dcef 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 import org.xml.sax.ContentHandler;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java
index a44b681..acd9015 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 /**
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java
index 9558220..43cae21 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java
index cae1aea..1b99b65 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 import com.sun.xml.internal.xsom.XSSchema;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java
index 199778d..5dbaedc 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java
index ace1cea..a313ea6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.parser;
 
 import java.io.File;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/package.html b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/package.html
index eccdc7f..4298934 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Classes to parse XML Schema documents into objects of <code>com.sun.xml.xsom</code> package.
 </body></html>
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java
index 9c42e22..b855362 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
@@ -48,6 +47,7 @@
  * Extract the name of the components.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.4 $
  */
 public class ComponentNameFunction implements XSFunction<String> {
 
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DeferedCollection.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DeferedCollection.java
new file mode 100644
index 0000000..638a88b
--- /dev/null
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DeferedCollection.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.xml.internal.xsom.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+/**
+ * {@link Collection} that returns the view of objects which are actually fetched
+ * lazily from an {@link Iterator}.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public class DeferedCollection<T> implements Collection<T> {
+    /**
+     * The iterator that lazily evaluates SCD query.
+     */
+    private final Iterator<T> result;
+
+    /**
+     * Stores values that are already fetched from {@link #result}.
+     */
+    private final List<T> archive = new ArrayList<T>();
+
+    public DeferedCollection(Iterator<T> result) {
+        this.result = result;
+    }
+
+    public boolean isEmpty() {
+        if(archive.isEmpty())
+            fetch();
+        return archive.isEmpty();
+    }
+
+    public int size() {
+        fetchAll();
+        return archive.size();
+    }
+
+    public boolean contains(Object o) {
+        if(archive.contains(o))
+            return true;
+        while(result.hasNext()) {
+            T value = result.next();
+            archive.add(value);
+            if(value.equals(o))
+                return true;
+        }
+        return false;
+    }
+
+    public boolean containsAll(Collection<?> c) {
+        for (Object o : c) {
+            if(!contains(o))
+                return false;
+        }
+        return true;
+    }
+
+    public Iterator<T> iterator() {
+        return new Iterator<T>() {
+            int idx=0;
+            public boolean hasNext() {
+                if(idx<archive.size())
+                    return true;
+                return result.hasNext();
+            }
+
+            public T next() {
+                if(idx==archive.size())
+                    fetch();
+                if(idx==archive.size())
+                    throw new NoSuchElementException();
+                return archive.get(idx++);
+            }
+
+            public void remove() {
+                // TODO
+            }
+        };
+    }
+
+    public Object[] toArray() {
+        fetchAll();
+        return archive.toArray();
+    }
+
+    public <T>T[] toArray(T[] a) {
+        fetchAll();
+        return archive.toArray(a);
+    }
+
+
+
+    private void fetchAll() {
+        while(result.hasNext())
+            archive.add(result.next());
+    }
+
+    /**
+     * Fetches another item from {@link
+     */
+    private void fetch() {
+        if(result.hasNext())
+            archive.add(result.next());
+    }
+
+// mutation methods are unsupported
+    public boolean add(T o) {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean remove(Object o) {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean addAll(Collection<? extends T> c) {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean removeAll(Collection<?> c) {
+        throw new UnsupportedOperationException();
+    }
+
+    public boolean retainAll(Collection<?> c) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void clear() {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java
index 665a125..2cac03e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,24 +22,23 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
 import com.sun.xml.internal.xsom.parser.AnnotationContext;
 import com.sun.xml.internal.xsom.parser.AnnotationParser;
 import com.sun.xml.internal.xsom.parser.AnnotationParserFactory;
-import org.w3c.dom.Element;
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.ErrorHandler;
 
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.sax.TransformerHandler;
 
 /**
  * {@link AnnotationParserFactory} that parses annotations into a W3C DOM.
@@ -91,8 +90,10 @@
                 // merge all the children
                 Element prev = (Element) existing;
                 Node anchor = e.getFirstChild();
-                while(prev.getFirstChild()!=null)
-                    e.insertBefore(prev.getFirstChild(), anchor );
+                while(prev.getFirstChild()!=null) {
+                    Node move = prev.getFirstChild();
+                    e.insertBefore(e.getOwnerDocument().adoptNode(move), anchor );
+                }
             }
             return e;
         }
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java
index 2c506bd..bea12ae 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import java.util.Locale;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties
index d5838c7..1d44b23 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties
@@ -1,6 +1,31 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 annotation		= annotation
 attGroupDecl	= attribute group declaration
-attributeDecl	= attribtue declaration
+attributeDecl	= attribute declaration
 attributeUse	= attribute use
 complexType		= complex type
 schema			= schema
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java
index 88c5bb0..2464d05 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import java.util.Set;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java
index 3a4cb82..7b5f2a0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java
index ea02f19..c9041b2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java
index 6678f17..46a52d5 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java
index 470467b..2ba69d6 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.util;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java
index 80e326c..eccff23 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSContentType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java
index 3c9dab1..59a70b2 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSContentType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java
index 640cc878..f39f25c 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java
index 87fd750..87a4e74 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSListSimpleType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java
index f746d9c..084b6d0 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSListSimpleType;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java
index 27b8390..06f8809 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java
index 2e33258..f082f06 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSWildcard;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java
index 5b065a6..8d39975 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSElementDecl;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java
index b92874c..33d7ba4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSAnnotation;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java
index 892d7b3..f03e703 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSWildcard;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java
index 2dca615..699513e 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.xml.internal.xsom.visitor;
 
 import com.sun.xml.internal.xsom.XSWildcard;
diff --git a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html
index 9d1a15f..a076ed4 100644
--- a/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html
+++ b/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html><body>
 Visitor pattern support for the <code>com.sun.xml.xsom</code> interfaces.
 </body></html>
diff --git a/jaxws/src/share/classes/javax/activation/ActivationDataFlavor.java b/jaxws/src/share/classes/javax/activation/ActivationDataFlavor.java
index 3501435..7b9cbaf 100644
--- a/jaxws/src/share/classes/javax/activation/ActivationDataFlavor.java
+++ b/jaxws/src/share/classes/javax/activation/ActivationDataFlavor.java
@@ -204,7 +204,10 @@
             if (mimeObject == null)
                 mimeObject = new MimeType(this.mimeType);
             mt = new MimeType(mimeType);
-        } catch (MimeTypeParseException e) {}
+        } catch (MimeTypeParseException e) {
+            // something didn't parse, do a crude comparison
+            return this.mimeType.equalsIgnoreCase(mimeType);
+        }
 
         return mimeObject.match(mt);
     }
diff --git a/jaxws/src/share/classes/javax/activation/MailcapCommandMap.java b/jaxws/src/share/classes/javax/activation/MailcapCommandMap.java
index f312326..8b6fc31 100644
--- a/jaxws/src/share/classes/javax/activation/MailcapCommandMap.java
+++ b/jaxws/src/share/classes/javax/activation/MailcapCommandMap.java
@@ -348,7 +348,7 @@
     public synchronized CommandInfo[] getPreferredCommands(String mimeType) {
         List cmdList = new ArrayList();
         if (mimeType != null)
-            mimeType = mimeType.toLowerCase();
+            mimeType = mimeType.toLowerCase(Locale.ENGLISH);
 
         for (int i = 0; i < DB.length; i++) {
             if (DB[i] == null)
@@ -414,7 +414,7 @@
     public synchronized CommandInfo[] getAllCommands(String mimeType) {
         List cmdList = new ArrayList();
         if (mimeType != null)
-            mimeType = mimeType.toLowerCase();
+            mimeType = mimeType.toLowerCase(Locale.ENGLISH);
 
         for (int i = 0; i < DB.length; i++) {
             if (DB[i] == null)
@@ -468,7 +468,7 @@
     public synchronized CommandInfo getCommand(String mimeType,
                                                         String cmdName) {
         if (mimeType != null)
-            mimeType = mimeType.toLowerCase();
+            mimeType = mimeType.toLowerCase(Locale.ENGLISH);
 
         for (int i = 0; i < DB.length; i++) {
             if (DB[i] == null)
@@ -535,7 +535,7 @@
             LogSupport.log(
                 "MailcapCommandMap: createDataContentHandler for " + mimeType);
         if (mimeType != null)
-            mimeType = mimeType.toLowerCase();
+            mimeType = mimeType.toLowerCase(Locale.ENGLISH);
 
         for (int i = 0; i < DB.length; i++) {
             if (DB[i] == null)
@@ -652,7 +652,7 @@
     public synchronized String[] getNativeCommands(String mimeType) {
         List cmdList = new ArrayList();
         if (mimeType != null)
-            mimeType = mimeType.toLowerCase();
+            mimeType = mimeType.toLowerCase(Locale.ENGLISH);
 
         for (int i = 0; i < DB.length; i++) {
             if (DB[i] == null)
diff --git a/jaxws/src/share/classes/javax/activation/MimeType.java b/jaxws/src/share/classes/javax/activation/MimeType.java
index 3e309fd..0b0f788 100644
--- a/jaxws/src/share/classes/javax/activation/MimeType.java
+++ b/jaxws/src/share/classes/javax/activation/MimeType.java
@@ -25,10 +25,8 @@
 
 package javax.activation;
 
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-import java.io.IOException;
 import java.io.*;
+import java.util.Locale;
 
 /**
  * A Multipurpose Internet Mail Extension (MIME) type, as defined
@@ -77,14 +75,14 @@
     public MimeType(String primary, String sub) throws MimeTypeParseException {
         //    check to see if primary is valid
         if (isValidToken(primary)) {
-            primaryType = primary.toLowerCase();
+            primaryType = primary.toLowerCase(Locale.ENGLISH);
         } else {
             throw new MimeTypeParseException("Primary type is invalid.");
         }
 
         //    check to see if sub is valid
         if (isValidToken(sub)) {
-            subType = sub.toLowerCase();
+            subType = sub.toLowerCase(Locale.ENGLISH);
         } else {
             throw new MimeTypeParseException("Sub type is invalid.");
         }
@@ -108,14 +106,17 @@
             throw new MimeTypeParseException("Unable to find a sub type.");
         } else if ((slashIndex >= 0) && (semIndex < 0)) {
             //    we have a primary and sub type but no parameter list
-            primaryType = rawdata.substring(0, slashIndex).trim().toLowerCase();
-            subType = rawdata.substring(slashIndex + 1).trim().toLowerCase();
+            primaryType = rawdata.substring(0, slashIndex).trim().
+                                                toLowerCase(Locale.ENGLISH);
+            subType = rawdata.substring(slashIndex + 1).trim().
+                                                toLowerCase(Locale.ENGLISH);
             parameters = new MimeTypeParameterList();
         } else if (slashIndex < semIndex) {
             //    we have all three items in the proper sequence
-            primaryType = rawdata.substring(0, slashIndex).trim().toLowerCase();
-            subType = rawdata.substring(slashIndex + 1,
-                                                semIndex).trim().toLowerCase();
+            primaryType = rawdata.substring(0, slashIndex).trim().
+                                                toLowerCase(Locale.ENGLISH);
+            subType = rawdata.substring(slashIndex + 1, semIndex).trim().
+                                                toLowerCase(Locale.ENGLISH);
             parameters = new MimeTypeParameterList(rawdata.substring(semIndex));
         } else {
             // we have a ';' lexically before a '/' which means we
@@ -154,7 +155,7 @@
         //    check to see if primary is valid
         if (!isValidToken(primaryType))
             throw new MimeTypeParseException("Primary type is invalid.");
-        primaryType = primary.toLowerCase();
+        primaryType = primary.toLowerCase(Locale.ENGLISH);
     }
 
     /**
@@ -177,7 +178,7 @@
         //    check to see if sub is valid
         if (!isValidToken(subType))
             throw new MimeTypeParseException("Sub type is invalid.");
-        subType = sub.toLowerCase();
+        subType = sub.toLowerCase(Locale.ENGLISH);
     }
 
     /**
diff --git a/jaxws/src/share/classes/javax/activation/MimeTypeParameterList.java b/jaxws/src/share/classes/javax/activation/MimeTypeParameterList.java
index e4033dc..5c449ed 100644
--- a/jaxws/src/share/classes/javax/activation/MimeTypeParameterList.java
+++ b/jaxws/src/share/classes/javax/activation/MimeTypeParameterList.java
@@ -27,6 +27,7 @@
 
 import java.util.Hashtable;
 import java.util.Enumeration;
+import java.util.Locale;
 
 /**
  * A parameter list of a MimeType
@@ -105,7 +106,8 @@
             while ((i < length) && isTokenChar(parameterList.charAt(i)))
                 i++;
 
-            name = parameterList.substring(lastIndex, i).toLowerCase();
+            name = parameterList.substring(lastIndex, i).
+                                                toLowerCase(Locale.ENGLISH);
 
             //    now parse the '=' that separates the name from the value
             i = skipWhiteSpace(parameterList, i);
@@ -202,7 +204,7 @@
      * @return          the parameter's value
      */
     public String get(String name) {
-        return (String)parameters.get(name.trim().toLowerCase());
+        return (String)parameters.get(name.trim().toLowerCase(Locale.ENGLISH));
     }
 
     /**
@@ -213,7 +215,7 @@
      * @param value     the parameter's value
      */
     public void set(String name, String value) {
-        parameters.put(name.trim().toLowerCase(), value);
+        parameters.put(name.trim().toLowerCase(Locale.ENGLISH), value);
     }
 
     /**
@@ -222,7 +224,7 @@
      * @param name      the parameter name
      */
     public void remove(String name) {
-        parameters.remove(name.trim().toLowerCase());
+        parameters.remove(name.trim().toLowerCase(Locale.ENGLISH));
     }
 
     /**
diff --git a/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java b/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java
index 335b51e0b..4d0eee5 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
 import java.util.logging.ConsoleHandler;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import static javax.xml.bind.JAXBContext.JAXB_CONTEXT_FACTORY;
 
@@ -51,6 +53,7 @@
  * This code is designed to implement the JAXB 1.0 spec pluggability feature
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
  * @see JAXBContext
  */
 class ContextFinder {
@@ -58,7 +61,7 @@
     static {
         logger = Logger.getLogger("javax.xml.bind");
         try {
-            if (System.getProperty("jaxb.debug", null) != null) {
+            if (AccessController.doPrivileged(new GetPropertyAction("jaxb.debug")) != null) {
                 // disconnect the logger from a bigger framework (if any)
                 // and take the matters into our own hands
                 logger.setUseParentHandlers(false);
@@ -105,17 +108,16 @@
      *          The Class object of the type being cast
      * @param targetType
      *          The Class object of the type that is being cast to
-     * @throws JAXBException
-     *          If the cast would fail
+     * @return JAXBException to be thrown.
      */
-    private static void handleClassCastException(Class originalType, Class targetType) throws JAXBException {
+    private static JAXBException handleClassCastException(Class originalType, Class targetType) {
         final URL targetTypeURL = which(targetType);
 
-        throw new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
+        return new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
                 // we don't care where the impl class is, we want to know where JAXBContext lives in the impl
                 // class' ClassLoader
-                originalType.getClass().getClassLoader().getResource("javax/xml/bind/JAXBContext.class").toString(),
-                targetTypeURL.toString()));
+                originalType.getClassLoader().getResource("javax/xml/bind/JAXBContext.class"),
+                targetTypeURL));
     }
 
     /**
@@ -128,12 +130,7 @@
         throws JAXBException
     {
         try {
-            Class spiClass;
-            if (classLoader == null) {
-                spiClass = Class.forName(className);
-            } else {
-                spiClass = classLoader.loadClass(className);
-            }
+            Class spiClass = safeLoadClass(className,classLoader);
 
             /*
              * javax.xml.bind.context.factory points to a class which has a
@@ -150,7 +147,7 @@
                 // any failure in invoking this method would be considered fatal
                 context = m.invoke(null,contextPath,classLoader,properties);
             } catch (NoSuchMethodException e) {
-                ; // it's not an error for the provider not to have this method.
+                // it's not an error for the provider not to have this method.
             }
 
             if(context==null) {
@@ -205,11 +202,7 @@
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         Class spi;
         try {
-            logger.fine("Trying to load "+className);
-            if (cl != null)
-                spi = cl.loadClass(className);
-            else
-                spi = Class.forName(className);
+            spi = safeLoadClass(className,cl);
         } catch (ClassNotFoundException e) {
             throw new JAXBException(e);
         }
@@ -229,7 +222,7 @@
             Object context = m.invoke(null, classes, properties);
             if(!(context instanceof JAXBContext)) {
                 // the cast would fail, so generate an exception with a nice message
-                handleClassCastException(context.getClass(), JAXBContext.class);
+                throw handleClassCastException(context.getClass(), JAXBContext.class);
             }
             return (JAXBContext)context;
         } catch (IllegalAccessException e) {
@@ -270,9 +263,7 @@
              propFileName = new StringBuilder().append(packageName).append("/jaxb.properties");
 
             Properties props = loadJAXBProperties( classLoader, propFileName.toString() );
-            if (props == null) {
-                continue;
-            } else {
+            if (props != null) {
                 if (props.containsKey(factoryId)) {
                     factoryClassName = props.getProperty(factoryId);
                     return newInstance( contextPath, factoryClassName, classLoader, properties );
@@ -285,7 +276,7 @@
         logger.fine("Searching the system property");
 
         // search for a system property second (javax.xml.bind.JAXBContext)
-        factoryClassName = System.getProperty(jaxbContextFQCN, null);
+        factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN));
         if(  factoryClassName != null ) {
             return newInstance( contextPath, factoryClassName, classLoader, properties );
         }
@@ -302,6 +293,7 @@
             if (resourceStream != null) {
                 r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
                 factoryClassName = r.readLine().trim();
+                r.close();
                 return newInstance(contextPath, factoryClassName, classLoader, properties);
             } else {
                 logger.fine("Unable to load:" + resource.toString());
@@ -327,8 +319,13 @@
         String factoryClassName;
 
         // search for jaxb.properties in the class loader of each class first
-        for (Class c : classes) {
-            ClassLoader classLoader = c.getClassLoader();
+        for (final Class c : classes) {
+            // this classloader is used only to load jaxb.properties, so doing this should be safe.
+            ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+                public ClassLoader run() {
+                    return c.getClassLoader();
+                }
+            });
             Package pkg = c.getPackage();
             if(pkg==null)
                 continue;       // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders
@@ -346,7 +343,6 @@
             Properties props = loadJAXBProperties(classLoader, resourceName);
             if (props == null) {
                 logger.fine("  not found");
-                continue;
             } else {
                 logger.fine("  found");
                 if (props.containsKey(JAXB_CONTEXT_FACTORY)) {
@@ -361,7 +357,7 @@
 
         // search for a system property second (javax.xml.bind.JAXBContext)
         logger.fine("Checking system property "+jaxbContextFQCN);
-        factoryClassName = System.getProperty(jaxbContextFQCN, null);
+        factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN));
         if(  factoryClassName != null ) {
             logger.fine("  found "+factoryClassName);
             return newInstance( classes, properties, factoryClassName );
@@ -483,4 +479,31 @@
      * For this reason, we have to hard-code the class name into the API.
      */
     private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
+
+    /**
+     * Loads the class, provided that the calling thread has an access to the class being loaded.
+     */
+    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+        logger.fine("Trying to load "+className);
+        try {
+            // make sure that the current thread has an access to the package of the given name.
+            SecurityManager s = System.getSecurityManager();
+            if (s != null) {
+                int i = className.lastIndexOf('.');
+                if (i != -1) {
+                    s.checkPackageAccess(className.substring(0,i));
+                }
+            }
+
+            if (classLoader == null)
+                return Class.forName(className);
+            else
+                return classLoader.loadClass(className);
+        } catch (SecurityException se) {
+            // anyone can access the platform default factory class without permission
+            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
+                return Class.forName(className);
+            throw se;
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/javax/xml/bind/DataBindingException.java b/jaxws/src/share/classes/javax/xml/bind/DataBindingException.java
new file mode 100644
index 0000000..2106563
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/DataBindingException.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind;
+
+/**
+ * Exception that represents a failure in a JAXB operation.
+ *
+ * <p>
+ * This exception differs from {@link JAXBException} in that
+ * this is an unchecked exception, while <tt>JAXBException</tt>
+ * is a checked exception.
+ *
+ * @see JAXB
+ * @since JAXB2.1
+ */
+public class DataBindingException extends RuntimeException {
+    public DataBindingException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public DataBindingException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/DatatypeConverter.java b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverter.java
index 3e5ea90..97b0041 100644
--- a/jaxws/src/share/classes/javax/xml/bind/DatatypeConverter.java
+++ b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverter.java
@@ -85,6 +85,7 @@
  * </p>
  *
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision$
  * @see DatatypeConverterInterface
  * @see ParseConversionEvent
  * @see PrintConversionEvent
@@ -94,7 +95,7 @@
 final public class DatatypeConverter {
 
     // delegate to this instance of DatatypeConverter
-    private static DatatypeConverterInterface theConverter = null;
+    private static DatatypeConverterInterface theConverter = new DatatypeConverterImpl();
 
     private DatatypeConverter() {
         // private constructor
diff --git a/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterImpl.java b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterImpl.java
new file mode 100644
index 0000000..134b514
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterImpl.java
@@ -0,0 +1,915 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind;
+
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.DatatypeConfigurationException;
+import java.math.BigInteger;
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+/**
+ * This class is the JAXB RI's default implementation of the
+ * {@link DatatypeConverterInterface}.
+ *
+ * <p>
+ * When client apps specify the use of the static print/parse
+ * methods in {@link DatatypeConverter}, it will delegate
+ * to this class.
+ *
+ * <p>
+ * This class is responsible for whitespace normalization.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @since JAXB2.1
+ */
+final class DatatypeConverterImpl implements DatatypeConverterInterface {
+
+    /**
+     * To avoid re-creating instances, we cache one instance.
+     */
+    public static final DatatypeConverterInterface theInstance = new DatatypeConverterImpl();
+
+    protected DatatypeConverterImpl() {
+    }
+
+    public String parseString(String lexicalXSDString) {
+        return lexicalXSDString;
+    }
+
+    public BigInteger parseInteger(String lexicalXSDInteger) {
+        return _parseInteger(lexicalXSDInteger);
+    }
+
+    public static BigInteger _parseInteger(CharSequence s) {
+        return new BigInteger(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
+    }
+
+    public String printInteger(BigInteger val) {
+        return _printInteger(val);
+    }
+
+    public static String _printInteger(BigInteger val) {
+        return val.toString();
+    }
+
+    public int parseInt(String s) {
+        return _parseInt(s);
+    }
+
+    /**
+     * Faster but less robust String->int conversion.
+     *
+     * Note that:
+     * <ol>
+     *  <li>XML Schema allows '+', but {@link Integer#valueOf(String)} is not.
+     *  <li>XML Schema allows leading and trailing (but not in-between) whitespaces..
+     *      {@link Integer#valueOf(String)} doesn't allow any.
+     * </ol>
+     */
+    public static int _parseInt(CharSequence s) {
+        int len = s.length();
+        int sign = 1;
+
+        int r = 0;
+
+        for( int i=0; i<len; i++ ) {
+            char ch = s.charAt(i);
+            if(WhiteSpaceProcessor.isWhiteSpace(ch)) {
+                // skip whitespace
+            } else
+            if('0'<=ch && ch<='9') {
+                r = r*10 + (ch-'0');
+            } else
+            if(ch=='-') {
+                sign = -1;
+            } else
+            if(ch=='+') {
+                // noop
+            } else
+                throw new NumberFormatException("Not a number: "+s);
+        }
+
+        return r*sign;
+    }
+
+    public long parseLong(String lexicalXSLong) {
+        return _parseLong(lexicalXSLong);
+    }
+
+    public static long _parseLong(CharSequence s) {
+        return Long.valueOf(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
+    }
+
+    public short parseShort(String lexicalXSDShort) {
+        return _parseShort(lexicalXSDShort);
+    }
+
+    public static short _parseShort(CharSequence s) {
+        return (short)_parseInt(s);
+    }
+
+    public String printShort(short val) {
+        return _printShort(val);
+    }
+
+    public static String _printShort(short val) {
+        return String.valueOf(val);
+    }
+
+    public BigDecimal parseDecimal(String content) {
+        return _parseDecimal(content);
+    }
+    public static BigDecimal _parseDecimal(CharSequence content) {
+        content = WhiteSpaceProcessor.trim(content);
+
+        return new BigDecimal(content.toString());
+
+        // from purely XML Schema perspective,
+        // this implementation has a problem, since
+        // in xs:decimal "1.0" and "1" is equal whereas the above
+        // code will return different values for those two forms.
+        //
+        // the code was originally using com.sun.msv.datatype.xsd.NumberType.load,
+        // but a profiling showed that the process of normalizing "1.0" into "1"
+        // could take non-trivial time.
+        //
+        // also, from the user's point of view, one might be surprised if
+        // 1 (not 1.0) is returned from "1.000"
+    }
+
+    public float parseFloat(String lexicalXSDFloat) {
+        return _parseFloat(lexicalXSDFloat);
+    }
+
+    public static float _parseFloat( CharSequence _val ) {
+        String s = WhiteSpaceProcessor.trim(_val).toString();
+        /* Incompatibilities of XML Schema's float "xfloat" and Java's float "jfloat"
+
+            * jfloat.valueOf ignores leading and trailing whitespaces,
+              whereas this is not allowed in xfloat.
+            * jfloat.valueOf allows "float type suffix" (f, F) to be
+              appended after float literal (e.g., 1.52e-2f), whereare
+              this is not the case of xfloat.
+
+            gray zone
+            ---------
+            * jfloat allows ".523". And there is no clear statement that mentions
+              this case in xfloat. Although probably this is allowed.
+            *
+        */
+
+        if(s.equals("NaN"))         return Float.NaN;
+        if(s.equals("INF"))         return Float.POSITIVE_INFINITY;
+        if(s.equals("-INF"))        return Float.NEGATIVE_INFINITY;
+
+        if(s.length()==0
+        || !isDigitOrPeriodOrSign(s.charAt(0))
+        || !isDigitOrPeriodOrSign(s.charAt(s.length()-1)) )
+            throw new NumberFormatException();
+
+        // these screening process is necessary due to the wobble of Float.valueOf method
+        return Float.parseFloat(s);
+    }
+
+    public String printFloat(float v) {
+        return _printFloat(v);
+    }
+
+    public static String _printFloat(float v) {
+        if( v==Float.NaN )                  return "NaN";
+        if( v==Float.POSITIVE_INFINITY )    return "INF";
+        if( v==Float.NEGATIVE_INFINITY )    return "-INF";
+        return String.valueOf(v);
+    }
+
+
+
+    public double parseDouble(String lexicalXSDDouble) {
+        return _parseDouble(lexicalXSDDouble);
+    }
+
+    public static double _parseDouble( CharSequence _val ) {
+        String val = WhiteSpaceProcessor.trim(_val).toString();
+
+        if(val.equals("NaN"))    return Double.NaN;
+        if(val.equals("INF"))    return Double.POSITIVE_INFINITY;
+        if(val.equals("-INF"))    return Double.NEGATIVE_INFINITY;
+
+        if(val.length()==0
+        || !isDigitOrPeriodOrSign(val.charAt(0))
+        || !isDigitOrPeriodOrSign(val.charAt(val.length()-1)) )
+            throw new NumberFormatException(val);
+
+
+        // these screening process is necessary due to the wobble of Float.valueOf method
+        return Double.parseDouble(val);
+    }
+
+    public boolean parseBoolean(String lexicalXSDBoolean) {
+        return _parseBoolean(lexicalXSDBoolean);
+    }
+
+    public static boolean _parseBoolean(CharSequence literal) {
+        int i=0;
+        int len = literal.length();
+        char ch;
+        do {
+            ch = literal.charAt(i++);
+        } while(WhiteSpaceProcessor.isWhiteSpace(ch) && i<len);
+
+        // if we are strict about errors, check i==len. and report an error
+
+        if( ch=='t' || ch=='1' )        return true;
+        if( ch=='f' || ch=='0' )        return false;
+        return false;
+    }
+
+    public String printBoolean(boolean val) {
+        return val?"true":"false";
+    }
+    public static String _printBoolean(boolean val) {
+        return val?"true":"false";
+    }
+
+    public byte parseByte(String lexicalXSDByte) {
+        return _parseByte(lexicalXSDByte);
+    }
+
+    public static byte _parseByte(CharSequence literal) {
+        return (byte)_parseInt(literal);
+    }
+
+    public String printByte(byte val) {
+        return _printByte(val);
+    }
+
+    public static String _printByte(byte val) {
+        return String.valueOf(val);
+    }
+
+    public QName parseQName(String lexicalXSDQName, NamespaceContext nsc) {
+        return _parseQName(lexicalXSDQName,nsc);
+    }
+
+    /**
+     * @return null if fails to convert.
+     */
+    public static QName _parseQName(CharSequence text, NamespaceContext nsc) {
+        int length = text.length();
+
+        // trim whitespace
+        int start=0;
+        while(start<length && WhiteSpaceProcessor.isWhiteSpace(text.charAt(start)))
+            start++;
+
+        int end = length;
+        while(end>start && WhiteSpaceProcessor.isWhiteSpace(text.charAt(end-1)))
+            end--;
+
+        if(end==start)
+            throw new IllegalArgumentException("input is empty");
+
+
+        String uri;
+        String localPart;
+        String prefix;
+
+        // search ':'
+        int idx=start+1;    // no point in searching the first char. that's not valid.
+        while(idx<end && text.charAt(idx)!=':' )
+            idx++;
+
+        if( idx==end ) {
+            uri = nsc.getNamespaceURI("");
+            localPart = text.subSequence(start,end).toString();
+            prefix = "";
+        } else {
+            // Prefix exists, check everything
+            prefix = text.subSequence(start,idx).toString();
+            localPart = text.subSequence(idx+1,end).toString();
+            uri = nsc.getNamespaceURI(prefix);
+            // uri can never be null according to javadoc,
+            // but some users reported that there are implementations that return null.
+            if(uri==null || uri.length()==0) // crap. the NamespaceContext interface is broken.
+                // error: unbound prefix
+                throw new IllegalArgumentException("prefix "+prefix+" is not bound to a namespace");
+        }
+
+        return new QName(uri,localPart,prefix);
+    }
+
+    public Calendar parseDateTime(String lexicalXSDDateTime) {
+        return _parseDateTime(lexicalXSDDateTime);
+    }
+
+    public static GregorianCalendar _parseDateTime(CharSequence s) {
+        String val = WhiteSpaceProcessor.trim(s).toString();
+        return datatypeFactory.newXMLGregorianCalendar(val).toGregorianCalendar();
+    }
+
+    public String printDateTime(Calendar val) {
+        return _printDateTime(val);
+    }
+
+    public static String _printDateTime(Calendar val) {
+        return CalendarFormatter.doFormat("%Y-%M-%DT%h:%m:%s%z",val);
+    }
+
+    public byte[] parseBase64Binary(String lexicalXSDBase64Binary) {
+        return _parseBase64Binary(lexicalXSDBase64Binary);
+    }
+
+
+    public byte[] parseHexBinary(String s) {
+        final int len = s.length();
+
+        // "111" is not a valid hex encoding.
+        if( len%2 != 0 )
+            throw new IllegalArgumentException("hexBinary needs to be even-length: "+s);
+
+        byte[] out = new byte[len/2];
+
+        for( int i=0; i<len; i+=2 ) {
+            int h = hexToBin(s.charAt(i  ));
+            int l = hexToBin(s.charAt(i+1));
+            if( h==-1 || l==-1 )
+                throw new IllegalArgumentException("contains illegal character for hexBinary: "+s);
+
+            out[i/2] = (byte)(h*16+l);
+        }
+
+        return out;
+    }
+
+    private static int hexToBin( char ch ) {
+        if( '0'<=ch && ch<='9' )    return ch-'0';
+        if( 'A'<=ch && ch<='F' )    return ch-'A'+10;
+        if( 'a'<=ch && ch<='f' )    return ch-'a'+10;
+        return -1;
+    }
+
+    private static final char[] hexCode = "0123456789ABCDEF".toCharArray();
+
+    public String printHexBinary(byte[] data) {
+        StringBuilder r = new StringBuilder(data.length*2);
+        for ( byte b : data) {
+            r.append(hexCode[(b >> 4) & 0xF]);
+            r.append(hexCode[(b & 0xF)]);
+        }
+        return r.toString();
+    }
+
+
+    public long parseUnsignedInt(String lexicalXSDUnsignedInt) {
+        return _parseLong(lexicalXSDUnsignedInt);
+    }
+
+    public String printUnsignedInt(long val) {
+        return _printLong(val);
+    }
+
+    public int parseUnsignedShort(String lexicalXSDUnsignedShort) {
+        return _parseInt(lexicalXSDUnsignedShort);
+    }
+
+    public Calendar parseTime(String lexicalXSDTime) {
+        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
+    }
+
+    public String printTime(Calendar val) {
+        return CalendarFormatter.doFormat("%h:%m:%s%z",val);
+    }
+
+    public Calendar parseDate(String lexicalXSDDate) {
+        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
+    }
+
+    public String printDate(Calendar val) {
+
+        return CalendarFormatter.doFormat((new StringBuilder("%Y-%M-%D").append("%z")).toString(),val);
+    }
+
+    public String parseAnySimpleType(String lexicalXSDAnySimpleType) {
+        return lexicalXSDAnySimpleType;
+//        return (String)SimpleURType.theInstance._createValue( lexicalXSDAnySimpleType, null );
+    }
+
+    public String printString(String val) {
+//        return StringType.theInstance.convertToLexicalValue( val, null );
+        return val;
+    }
+
+
+    public String printInt(int val) {
+        return _printInt(val);
+    }
+
+    public static String _printInt(int val) {
+        return String.valueOf(val);
+    }
+
+    public String printLong(long val) {
+        return _printLong(val);
+    }
+
+    public static String _printLong(long val) {
+        return String.valueOf(val);
+    }
+
+    public String printDecimal(BigDecimal val) {
+        return _printDecimal(val);
+    }
+
+    public static String _printDecimal(BigDecimal val) {
+        return val.toPlainString();
+    }
+
+    public String printDouble(double v) {
+        return _printDouble(v);
+    }
+
+    public static String _printDouble(double v) {
+        if( v==Double.NaN )                    return "NaN";
+        if( v==Double.POSITIVE_INFINITY )    return "INF";
+        if( v==Double.NEGATIVE_INFINITY )    return "-INF";
+        return String.valueOf(v);
+    }
+
+    public String printQName(QName val, NamespaceContext nsc) {
+        return _printQName(val,nsc);
+    }
+
+    public static String _printQName(QName val, NamespaceContext nsc) {
+        // Double-check
+        String qname;
+        String prefix = nsc.getPrefix( val.getNamespaceURI() );
+        String localPart = val.getLocalPart();
+
+        if( prefix == null || prefix.length()==0 ) { // be defensive
+            qname = localPart;
+        } else {
+            qname = prefix + ':' + localPart;
+        }
+
+        return qname;
+    }
+
+    public String printBase64Binary(byte[] val) {
+        return _printBase64Binary(val);
+    }
+
+    public String printUnsignedShort(int val) {
+        return String.valueOf(val);
+    }
+
+    public String printAnySimpleType(String val) {
+        return val;
+    }
+
+
+    /**
+     * Just return the string passed as a parameter but
+     * installs an instance of this class as the DatatypeConverter
+     * implementation. Used from static fixed value initializers.
+     */
+    public static String installHook( String s ) {
+        DatatypeConverter.setDatatypeConverter(theInstance);
+        return s;
+    }
+
+
+
+
+// base64 decoder
+//====================================
+
+    private static final byte[] decodeMap = initDecodeMap();
+    private static final byte PADDING = 127;
+
+    private static byte[] initDecodeMap() {
+        byte[] map = new byte[128];
+        int i;
+        for( i=0; i<128; i++ )        map[i] = -1;
+
+        for( i='A'; i<='Z'; i++ )    map[i] = (byte)(i-'A');
+        for( i='a'; i<='z'; i++ )    map[i] = (byte)(i-'a'+26);
+        for( i='0'; i<='9'; i++ )    map[i] = (byte)(i-'0'+52);
+        map['+'] = 62;
+        map['/'] = 63;
+        map['='] = PADDING;
+
+        return map;
+    }
+
+    /**
+     * computes the length of binary data speculatively.
+     *
+     * <p>
+     * Our requirement is to create byte[] of the exact length to store the binary data.
+     * If we do this in a straight-forward way, it takes two passes over the data.
+     * Experiments show that this is a non-trivial overhead (35% or so is spent on
+     * the first pass in calculating the length.)
+     *
+     * <p>
+     * So the approach here is that we compute the length speculatively, without looking
+     * at the whole contents. The obtained speculative value is never less than the
+     * actual length of the binary data, but it may be bigger. So if the speculation
+     * goes wrong, we'll pay the cost of reallocation and buffer copying.
+     *
+     * <p>
+     * If the base64 text is tightly packed with no indentation nor illegal char
+     * (like what most web services produce), then the speculation of this method
+     * will be correct, so we get the performance benefit.
+     */
+    private static int guessLength( String text ) {
+        final int len = text.length();
+
+        // compute the tail '=' chars
+        int j=len-1;
+        for(; j>=0; j-- ) {
+            byte code = decodeMap[text.charAt(j)];
+            if(code==PADDING)
+                continue;
+            if(code==-1)
+                // most likely this base64 text is indented. go with the upper bound
+                return text.length()/4*3;
+            break;
+        }
+
+        j++;    // text.charAt(j) is now at some base64 char, so +1 to make it the size
+        int padSize = len-j;
+        if(padSize >2) // something is wrong with base64. be safe and go with the upper bound
+            return text.length()/4*3;
+
+        // so far this base64 looks like it's unindented tightly packed base64.
+        // take a chance and create an array with the expected size
+        return text.length()/4*3-padSize;
+    }
+
+    /**
+     * @param text
+     *      base64Binary data is likely to be long, and decoding requires
+     *      each character to be accessed twice (once for counting length, another
+     *      for decoding.)
+     *
+     *      A benchmark showed that taking {@link String} is faster, presumably
+     *      because JIT can inline a lot of string access (with data of 1K chars, it was twice as fast)
+     */
+    public static byte[] _parseBase64Binary(String text) {
+        final int buflen = guessLength(text);
+        final byte[] out = new byte[buflen];
+        int o=0;
+
+        final int len = text.length();
+        int i;
+
+        final byte[] quadruplet = new byte[4];
+        int q=0;
+
+        // convert each quadruplet to three bytes.
+        for( i=0; i<len; i++ ) {
+            char ch = text.charAt(i);
+            byte v = decodeMap[ch];
+
+            if( v!=-1 )
+                quadruplet[q++] = v;
+
+            if(q==4) {
+                // quadruplet is now filled.
+                out[o++] = (byte)((quadruplet[0]<<2)|(quadruplet[1]>>4));
+                if( quadruplet[2]!=PADDING )
+                    out[o++] = (byte)((quadruplet[1]<<4)|(quadruplet[2]>>2));
+                if( quadruplet[3]!=PADDING )
+                    out[o++] = (byte)((quadruplet[2]<<6)|(quadruplet[3]));
+                q=0;
+            }
+        }
+
+        if(buflen==o) // speculation worked out to be OK
+            return out;
+
+        // we overestimated, so need to create a new buffer
+        byte[] nb = new byte[o];
+        System.arraycopy(out,0,nb,0,o);
+        return nb;
+    }
+
+    private static final char[] encodeMap = initEncodeMap();
+
+    private static char[] initEncodeMap() {
+        char[] map = new char[64];
+        int i;
+        for( i= 0; i<26; i++ )        map[i] = (char)('A'+i);
+        for( i=26; i<52; i++ )        map[i] = (char)('a'+(i-26));
+        for( i=52; i<62; i++ )        map[i] = (char)('0'+(i-52));
+        map[62] = '+';
+        map[63] = '/';
+
+        return map;
+    }
+
+    public static char encode( int i ) {
+        return encodeMap[i&0x3F];
+    }
+
+    public static byte encodeByte( int i ) {
+        return (byte)encodeMap[i&0x3F];
+    }
+
+    public static String _printBase64Binary(byte[] input) {
+        return _printBase64Binary(input, 0, input.length);
+    }
+    public static String _printBase64Binary(byte[] input, int offset, int len) {
+        char[] buf = new char[((len+2)/3)*4];
+        int ptr = _printBase64Binary(input,offset,len,buf,0);
+        assert ptr==buf.length;
+        return new String(buf);
+    }
+
+    /**
+     * Encodes a byte array into a char array by doing base64 encoding.
+     *
+     * The caller must supply a big enough buffer.
+     *
+     * @return
+     *      the value of {@code ptr+((len+2)/3)*4}, which is the new offset
+     *      in the output buffer where the further bytes should be placed.
+     */
+    public static int _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr) {
+        for( int i=offset; i<len; i+=3 ) {
+            switch( len-i ) {
+            case 1:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(((input[i])&0x3)<<4);
+                buf[ptr++] = '=';
+                buf[ptr++] = '=';
+                break;
+            case 2:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encode((input[i+1]&0xF)<<2);
+                buf[ptr++] = '=';
+                break;
+            default:
+                buf[ptr++] = encode(input[i]>>2);
+                buf[ptr++] = encode(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encode(
+                            ((input[i+1]&0xF)<<2)|
+                            ((input[i+2]>>6)&0x3));
+                buf[ptr++] = encode(input[i+2]&0x3F);
+                break;
+            }
+        }
+        return ptr;
+    }
+
+    /**
+     * Encodes a byte array into another byte array by first doing base64 encoding
+     * then encoding the result in ASCII.
+     *
+     * The caller must supply a big enough buffer.
+     *
+     * @return
+     *      the value of {@code ptr+((len+2)/3)*4}, which is the new offset
+     *      in the output buffer where the further bytes should be placed.
+     */
+    public static int _printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr) {
+        byte[] buf = out;
+        int max = len+offset;
+        for( int i=offset; i<max; i+=3 ) {
+            switch( max-i ) {
+            case 1:
+                buf[ptr++] = encodeByte(input[i]>>2);
+                buf[ptr++] = encodeByte(((input[i])&0x3)<<4);
+                buf[ptr++] = '=';
+                buf[ptr++] = '=';
+                break;
+            case 2:
+                buf[ptr++] = encodeByte(input[i]>>2);
+                buf[ptr++] = encodeByte(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encodeByte((input[i+1]&0xF)<<2);
+                buf[ptr++] = '=';
+                break;
+            default:
+                buf[ptr++] = encodeByte(input[i]>>2);
+                buf[ptr++] = encodeByte(
+                            ((input[i]&0x3)<<4) |
+                            ((input[i+1]>>4)&0xF));
+                buf[ptr++] = encodeByte(
+                            ((input[i+1]&0xF)<<2)|
+                            ((input[i+2]>>6)&0x3));
+                buf[ptr++] = encodeByte(input[i+2]&0x3F);
+                break;
+            }
+        }
+
+        return ptr;
+    }
+
+    private static CharSequence removeOptionalPlus(CharSequence s) {
+        int len = s.length();
+
+        if(len<=1 || s.charAt(0)!='+')    return s;
+
+        s = s.subSequence(1,len);
+        char ch = s.charAt(0);
+        if('0'<=ch && ch<='9')    return s;
+        if('.'==ch )    return s;
+
+        throw new NumberFormatException();
+    }
+
+    private static boolean isDigitOrPeriodOrSign( char ch ) {
+        if( '0'<=ch && ch<='9' )    return true;
+        if( ch=='+' || ch=='-' || ch=='.' )    return true;
+        return false;
+    }
+
+    private static final DatatypeFactory datatypeFactory;
+
+    static {
+        try {
+            datatypeFactory = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException e) {
+            throw new Error(e);
+        }
+    }
+
+
+    private static final class CalendarFormatter {
+        public static String doFormat( String format, Calendar cal ) throws IllegalArgumentException {
+            int fidx = 0;
+            int flen = format.length();
+            StringBuilder buf = new StringBuilder();
+
+            while(fidx<flen) {
+                char fch = format.charAt(fidx++);
+
+                if(fch!='%') {  // not a meta character
+                    buf.append(fch);
+                    continue;
+                }
+
+                // seen meta character. we don't do error check against the format
+                switch (format.charAt(fidx++)) {
+                case 'Y' : // year
+                    formatYear(cal, buf);
+                    break;
+
+                case 'M' : // month
+                    formatMonth(cal, buf);
+                    break;
+
+                case 'D' : // days
+                    formatDays(cal, buf);
+                    break;
+
+                case 'h' : // hours
+                    formatHours(cal, buf);
+                    break;
+
+                case 'm' : // minutes
+                    formatMinutes(cal, buf);
+                    break;
+
+                case 's' : // parse seconds.
+                    formatSeconds(cal, buf);
+                    break;
+
+                case 'z' : // time zone
+                    formatTimeZone(cal,buf);
+                    break;
+
+                default :
+                    // illegal meta character. impossible.
+                    throw new InternalError();
+                }
+            }
+
+            return buf.toString();
+        }
+
+
+        private static void formatYear(Calendar cal, StringBuilder buf) {
+            int year = cal.get(Calendar.YEAR);
+
+            String s;
+            if (year <= 0) // negative value
+                s = Integer.toString(1 - year);
+            else // positive value
+                s = Integer.toString(year);
+
+            while (s.length() < 4)
+                s = '0' + s;
+            if (year <= 0)
+                s = '-' + s;
+
+            buf.append(s);
+        }
+
+        private static void formatMonth(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.MONTH)+1,buf);
+        }
+
+        private static void formatDays(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.DAY_OF_MONTH),buf);
+        }
+
+        private static void formatHours(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.HOUR_OF_DAY),buf);
+        }
+
+        private static void formatMinutes(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.MINUTE),buf);
+        }
+
+        private static void formatSeconds(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.SECOND),buf);
+            if (cal.isSet(Calendar.MILLISECOND)) { // milliseconds
+                int n = cal.get(Calendar.MILLISECOND);
+                if(n!=0) {
+                    String ms = Integer.toString(n);
+                    while (ms.length() < 3)
+                        ms = '0' + ms; // left 0 paddings.
+
+                    buf.append('.');
+                    buf.append(ms);
+                }
+            }
+        }
+
+        /** formats time zone specifier. */
+        private static void formatTimeZone(Calendar cal,StringBuilder buf) {
+            TimeZone tz = cal.getTimeZone();
+
+            if (tz == null)      return;
+
+            // otherwise print out normally.
+            int offset;
+            if (tz.inDaylightTime(cal.getTime())) {
+                offset = tz.getRawOffset() + (tz.useDaylightTime()?3600000:0);
+            } else {
+                offset = tz.getRawOffset();
+            }
+
+            if(offset==0) {
+                buf.append('Z');
+                return;
+            }
+
+            if (offset >= 0)
+                buf.append('+');
+            else {
+                buf.append('-');
+                offset *= -1;
+            }
+
+            offset /= 60 * 1000; // offset is in milli-seconds
+
+            formatTwoDigits(offset / 60, buf);
+            buf.append(':');
+            formatTwoDigits(offset % 60, buf);
+        }
+
+        /** formats Integer into two-character-wide string. */
+        private static void formatTwoDigits(int n,StringBuilder buf) {
+            // n is always non-negative.
+            if (n < 10) buf.append('0');
+            buf.append(n);
+        }
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java
index 44d950b..e67d265 100644
--- a/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java
+++ b/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java
@@ -75,6 +75,7 @@
  *
  * <p>
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision: 1.4 $
  * @see DatatypeConverter
  * @see ParseConversionEvent
  * @see PrintConversionEvent
diff --git a/jaxws/src/share/classes/javax/xml/bind/Element.java b/jaxws/src/share/classes/javax/xml/bind/Element.java
index e50635a..b0e6997 100644
--- a/jaxws/src/share/classes/javax/xml/bind/Element.java
+++ b/jaxws/src/share/classes/javax/xml/bind/Element.java
@@ -35,6 +35,7 @@
  * and 5.7.1 "Bind to Java Element Interface" of the specification.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @since JAXB1.0
  */
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/GetPropertyAction.java b/jaxws/src/share/classes/javax/xml/bind/GetPropertyAction.java
new file mode 100644
index 0000000..ce7ba25
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/GetPropertyAction.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind;
+
+import java.security.PrivilegedAction;
+
+/**
+ * {@link PrivilegedAction} that gets the system property value.
+ * @author Kohsuke Kawaguchi
+ */
+final class GetPropertyAction implements PrivilegedAction<String> {
+    private final String propertyName;
+
+    public GetPropertyAction(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public String run() {
+        return System.getProperty(propertyName);
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/JAXB.java b/jaxws/src/share/classes/javax/xml/bind/JAXB.java
new file mode 100644
index 0000000..63455e0
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/JAXB.java
@@ -0,0 +1,628 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.beans.Introspector;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.lang.ref.WeakReference;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+
+/**
+ * Class that defines convenience methods for common, simple use of JAXB.
+ *
+ * <p>
+ * Methods defined in this class are convenience methods that combine several basic operations
+ * in the {@link JAXBContext}, {@link Unmarshaller}, and {@link Marshaller}.
+ *
+ * They are designed
+ * to be the prefered methods for developers new to JAXB. They have
+ * the following characterstics:
+ *
+ * <ol>
+ *  <li>Generally speaking, the performance is not necessarily optimal.
+ *      It is expected that people who need to write performance
+ *      critical code will use the rest of the JAXB API directly.
+ *  <li>Errors that happen during the processing is wrapped into
+ *      {@link DataBindingException} (which will have {@link JAXBException}
+ *      as its {@link Throwable#getCause() cause}. It is expected that
+ *      people who prefer the checked exception would use
+ *      the rest of the JAXB API directly.
+ * </ol>
+ *
+ * <p>
+ * In addition, the <tt>unmarshal</tt> methods have the following characteristic:
+ *
+ * <ol>
+ *  <li>Schema validation is not performed on the input XML.
+ *      The processing will try to continue even if there
+ *      are errors in the XML, as much as possible. Only as
+ *      the last resort, this method fails with {@link DataBindingException}.
+ * </ol>
+ *
+ * <p>
+ * Similarly, the <tt>marshal</tt> methods have the following characteristic:
+ * <ol>
+ *  <li>The processing will try to continue even if the Java object tree
+ *      does not meet the validity requirement. Only as
+ *      the last resort, this method fails with {@link DataBindingException}.
+ * </ol>
+ *
+ *
+ * <p>
+ * All the methods on this class require non-null arguments to all parameters.
+ * The <tt>unmarshal</tt> methods either fail with an exception or return
+ * a non-null value.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 2.1
+ */
+public final class JAXB {
+    /**
+     * No instanciation is allowed.
+     */
+    private JAXB() {}
+
+    /**
+     * To improve the performance, we'll cache the last {@link JAXBContext} used.
+     */
+    private static final class Cache {
+        final Class type;
+        final JAXBContext context;
+
+        public Cache(Class type) throws JAXBException {
+            this.type = type;
+            this.context = JAXBContext.newInstance(type);
+        }
+    }
+
+    /**
+     * Cache. We don't want to prevent the {@link Cache#type} from GC-ed,
+     * hence {@link WeakReference}.
+     */
+    private static volatile WeakReference<Cache> cache;
+
+    /**
+     * Obtains the {@link JAXBContext} from the given type,
+     * by using the cache if possible.
+     *
+     * <p>
+     * We don't use locks to control access to {@link #cache}, but this code
+     * should be thread-safe thanks to the immutable {@link Cache} and {@code volatile}.
+     */
+    private static <T> JAXBContext getContext(Class<T> type) throws JAXBException {
+        WeakReference<Cache> c = cache;
+        if(c!=null) {
+            Cache d = c.get();
+            if(d!=null && d.type==type)
+                return d.context;
+        }
+
+        // overwrite the cache
+        Cache d = new Cache(type);
+        cache = new WeakReference<Cache>(d);
+
+        return d.context;
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      Reads the entire file as XML.
+     */
+    public static <T> T unmarshal( File xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(new StreamSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The resource pointed by the URL is read in its entirety.
+     */
+    public static <T> T unmarshal( URL xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The URI is {@link URI#toURL() turned into URL} and then
+     *      follows the handling of <tt>URL</tt>.
+     */
+    public static <T> T unmarshal( URI xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The string is first interpreted as an absolute <tt>URI</tt>.
+     *      If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *      then it's interpreted as a <tt>File</tt>
+     */
+    public static <T> T unmarshal( String xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The entire stream is read as an XML infoset.
+     *      Upon a successful completion, the stream will be closed by this method.
+     */
+    public static <T> T unmarshal( InputStream xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The character stream is read as an XML infoset.
+     *      The encoding declaration in the XML will be ignored.
+     *      Upon a successful completion, the stream will be closed by this method.
+     */
+    public static <T> T unmarshal( Reader xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The XML infoset that the {@link Source} represents is read.
+     */
+    public static <T> T unmarshal( Source xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+
+
+    /**
+     * Creates {@link Source} from various XML representation.
+     * See {@link #unmarshal} for the conversion rules.
+     */
+    private static Source toSource(Object xml) throws IOException {
+        if(xml==null)
+            throw new IllegalArgumentException("no XML is given");
+
+        if (xml instanceof String) {
+            try {
+                xml=new URI((String)xml);
+            } catch (URISyntaxException e) {
+                xml=new File((String)xml);
+            }
+        }
+        if (xml instanceof File) {
+            File file = (File) xml;
+            return new StreamSource(file);
+        }
+        if (xml instanceof URI) {
+            URI uri = (URI) xml;
+            xml=uri.toURL();
+        }
+        if (xml instanceof URL) {
+            URL url = (URL) xml;
+            return new StreamSource(url.toExternalForm());
+        }
+        if (xml instanceof InputStream) {
+            InputStream in = (InputStream) xml;
+            return new StreamSource(in);
+        }
+        if (xml instanceof Reader) {
+            Reader r = (Reader) xml;
+            return new StreamSource(r);
+        }
+        if (xml instanceof Source) {
+            return (Source) xml;
+        }
+        throw new IllegalArgumentException("I don't understand how to handle "+xml.getClass());
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      XML will be written to this file. If it already exists,
+     *      it will be overwritten.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, File xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be {@link URLConnection#getOutputStream() sent} to the
+     *      resource pointed by this URL. Note that not all <tt>URL</tt>s support
+     *      such operation, and exact semantics depends on the <tt>URL</tt>
+     *      implementations. In case of {@link HttpURLConnection HTTP URLs},
+     *      this will perform HTTP POST.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, URL xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The URI is {@link URI#toURL() turned into URL} and then
+     *      follows the handling of <tt>URL</tt>. See above.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, URI xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The string is first interpreted as an absolute <tt>URI</tt>.
+     *      If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *      then it's interpreted as a <tt>File</tt>
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, String xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent to the given {@link OutputStream}.
+     *      Upon a successful completion, the stream will be closed by this method.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, OutputStream xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent as a character stream to the given {@link Writer}.
+     *      Upon a successful completion, the stream will be closed by this method.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, Writer xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent to the {@link Result} object.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, Result xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * <p>
+     * This method is a convenience method that combines several basic operations
+     * in the {@link JAXBContext} and {@link Marshaller}. This method is designed
+     * to be the prefered method for developers new to JAXB. This method
+     * has the following characterstics:
+     *
+     * <ol>
+     *  <li>Generally speaking, the performance is not necessarily optimal.
+     *      It is expected that those people who need to write performance
+     *      critical code will use the rest of the JAXB API directly.
+     *  <li>Errors that happen during the processing is wrapped into
+     *      {@link DataBindingException} (which will have {@link JAXBException}
+     *      as its {@link Throwable#getCause() cause}. It is expected that
+     *      those people who prefer the checked exception would use
+     *      the rest of the JAXB API directly.
+     * </ol>
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      Represents the receiver of XML. Objects of the following types are allowed.
+     *
+     *      <table><tr>
+     *          <th>Type</th>
+     *          <th>Operation</th>
+     *      </tr><tr>
+     *          <td>{@link File}</td>
+     *          <td>XML will be written to this file. If it already exists,
+     *              it will be overwritten.</td>
+     *      </tr><tr>
+     *          <td>{@link URL}</td>
+     *          <td>The XML will be {@link URLConnection#getOutputStream() sent} to the
+     *              resource pointed by this URL. Note that not all <tt>URL</tt>s support
+     *              such operation, and exact semantics depends on the <tt>URL</tt>
+     *              implementations. In case of {@link HttpURLConnection HTTP URLs},
+     *              this will perform HTTP POST.</td>
+     *      </tr><tr>
+     *          <td>{@link URI}</td>
+     *          <td>The URI is {@link URI#toURL() turned into URL} and then
+     *              follows the handling of <tt>URL</tt>. See above.</td>
+     *      </tr><tr>
+     *          <td>{@link String}</td>
+     *          <td>The string is first interpreted as an absolute <tt>URI</tt>.
+     *              If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *              then it's interpreted as a <tt>File</tt></td>
+     *      </tr><tr>
+     *          <td>{@link OutputStream}</td>
+     *          <td>The XML will be sent to the given {@link OutputStream}.
+     *              Upon a successful completion, the stream will be closed by this method.</td>
+     *      </tr><tr>
+     *          <td>{@link Writer}</td>
+     *          <td>The XML will be sent as a character stream to the given {@link Writer}.
+     *              Upon a successful completion, the stream will be closed by this method.</td>
+     *      </tr><tr>
+     *          <td>{@link Result}</td>
+     *          <td>The XML will be sent to the {@link Result} object.</td>
+     *      </tr></table>
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    private static void _marshal( Object jaxbObject, Object xml ) {
+        try {
+            JAXBContext context;
+
+            if(jaxbObject instanceof JAXBElement) {
+                context = getContext(((JAXBElement<?>)jaxbObject).getDeclaredType());
+            } else {
+                Class<?> clazz = jaxbObject.getClass();
+                XmlRootElement r = clazz.getAnnotation(XmlRootElement.class);
+                context = getContext(clazz);
+                if(r==null) {
+                    // we need to infer the name
+                    jaxbObject = new JAXBElement(new QName(inferName(clazz)),clazz,jaxbObject);
+                }
+            }
+
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
+            m.marshal(jaxbObject, toResult(xml));
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    private static String inferName(Class clazz) {
+        return Introspector.decapitalize(clazz.getSimpleName());
+    }
+
+    /**
+     * Creates {@link Result} from various XML representation.
+     * See {@link #_marshal(Object,Object)} for the conversion rules.
+     */
+    private static Result toResult(Object xml) throws IOException {
+        if(xml==null)
+            throw new IllegalArgumentException("no XML is given");
+
+        if (xml instanceof String) {
+            try {
+                xml=new URI((String)xml);
+            } catch (URISyntaxException e) {
+                xml=new File((String)xml);
+            }
+        }
+        if (xml instanceof File) {
+            File file = (File) xml;
+            return new StreamResult(file);
+        }
+        if (xml instanceof URI) {
+            URI uri = (URI) xml;
+            xml=uri.toURL();
+        }
+        if (xml instanceof URL) {
+            URL url = (URL) xml;
+            URLConnection con = url.openConnection();
+            con.setDoOutput(true);
+            con.setDoInput(false);
+            con.connect();
+            return new StreamResult(con.getOutputStream());
+        }
+        if (xml instanceof OutputStream) {
+            OutputStream os = (OutputStream) xml;
+            return new StreamResult(os);
+        }
+        if (xml instanceof Writer) {
+            Writer w = (Writer)xml;
+            return new StreamResult(w);
+        }
+        if (xml instanceof Result) {
+            return (Result) xml;
+        }
+        throw new IllegalArgumentException("I don't understand how to handle "+xml.getClass());
+    }
+
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/JAXBContext.java b/jaxws/src/share/classes/javax/xml/bind/JAXBContext.java
index ce2ba30..b556c3b 100644
--- a/jaxws/src/share/classes/javax/xml/bind/JAXBContext.java
+++ b/jaxws/src/share/classes/javax/xml/bind/JAXBContext.java
@@ -217,6 +217,7 @@
  * </blockquote>
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.23 $ $Date: 2005/08/31 20:57:57 $
  * @see Marshaller
  * @see Unmarshaller
  * @see <a href="http://java.sun.com/docs/books/jls">S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition</a>
diff --git a/jaxws/src/share/classes/javax/xml/bind/JAXBElement.java b/jaxws/src/share/classes/javax/xml/bind/JAXBElement.java
index c8db788..5c915b1 100644
--- a/jaxws/src/share/classes/javax/xml/bind/JAXBElement.java
+++ b/jaxws/src/share/classes/javax/xml/bind/JAXBElement.java
@@ -143,7 +143,7 @@
      * <p>Set the content model and attributes of this xml element.</p>
      *
      * <p>When this property is set to <tt>null</tt>, <tt>isNil()</tt> must by <tt>true</tt>.
-     *    Details of constraint are described at {@link #isNil()}.</p>
+     *    Details of constraint are described at {@link #isNil()}.</pp>
      *
      * @see #isTypeSubstituted()
      */
diff --git a/jaxws/src/share/classes/javax/xml/bind/JAXBException.java b/jaxws/src/share/classes/javax/xml/bind/JAXBException.java
index 55aa587..af275e6 100644
--- a/jaxws/src/share/classes/javax/xml/bind/JAXBException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/JAXBException.java
@@ -31,6 +31,7 @@
  * This is the root exception class for all JAXB exceptions.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.3 $ $Date: 2004/10/22 15:46:02 $
  * @see JAXBContext
  * @see Marshaller
  * @see Unmarshaller
diff --git a/jaxws/src/share/classes/javax/xml/bind/MarshalException.java b/jaxws/src/share/classes/javax/xml/bind/MarshalException.java
index f3101ce..f0c6acf 100644
--- a/jaxws/src/share/classes/javax/xml/bind/MarshalException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/MarshalException.java
@@ -36,6 +36,7 @@
  * ValidationEventHandler.handleEvent(ValidationEvent)}.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see JAXBException
  * @see Marshaller
  * @since JAXB1.0
diff --git a/jaxws/src/share/classes/javax/xml/bind/Marshaller.java b/jaxws/src/share/classes/javax/xml/bind/Marshaller.java
index 22f9a7e..02dfe8d 100644
--- a/jaxws/src/share/classes/javax/xml/bind/Marshaller.java
+++ b/jaxws/src/share/classes/javax/xml/bind/Marshaller.java
@@ -29,6 +29,7 @@
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.bind.attachment.AttachmentMarshaller;
 import javax.xml.validation.Schema;
+import java.io.File;
 
 /**
  * <p>
@@ -288,10 +289,10 @@
  * <blockquote>
  * <pre>
  *   // Invoked by Marshaller after it has created an instance of this object.
- *   boolean beforeMarshal(Marshaller, Object parent);
+ *   boolean beforeMarshal(Marshaller);
  *
  *   // Invoked by Marshaller after it has marshalled all properties of this object.
- *   void afterMmarshal(Marshaller, Object parent);
+ *   void afterMmarshal(Marshaller);
  * </pre>
  * </blockquote>
  * The class defined event callback methods should be used when the callback method requires
@@ -309,6 +310,7 @@
  * </blockquote>
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date$
  * @see JAXBContext
  * @see Validator
  * @see Unmarshaller
@@ -405,6 +407,29 @@
         throws JAXBException;
 
     /**
+     * Marshal the content tree rooted at <tt>jaxbElement</tt> into a file.
+     *
+     * @param jaxbElement
+     *      The root of content tree to be marshalled.
+     * @param output
+     *      File to be written. If this file already exists, it will be overwritten.
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its <tt>handleEvent</tt> method or the
+     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+     *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     * @since JAXB2.1
+     */
+    public void marshal( Object jaxbElement, File output )
+        throws JAXBException;
+
+    /**
      * Marshal the content tree rooted at <tt>jaxbElement</tt> into a Writer.
      *
      * @param jaxbElement
diff --git a/jaxws/src/share/classes/javax/xml/bind/Messages.properties b/jaxws/src/share/classes/javax/xml/bind/Messages.properties
index 3797cfd..6fb29bf 100644
--- a/jaxws/src/share/classes/javax/xml/bind/Messages.properties
+++ b/jaxws/src/share/classes/javax/xml/bind/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 ContextFinder.ProviderNotFound = \
 	Provider {0} not found
 	
diff --git a/jaxws/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java b/jaxws/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java
index 385ca51..66ed2bb 100644
--- a/jaxws/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java
+++ b/jaxws/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java
@@ -30,6 +30,7 @@
  *
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see Validator
  * @see ValidationEventHandler
  * @since JAXB1.0
diff --git a/jaxws/src/share/classes/javax/xml/bind/ParseConversionEvent.java b/jaxws/src/share/classes/javax/xml/bind/ParseConversionEvent.java
index 095152f..bbdda94 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ParseConversionEvent.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ParseConversionEvent.java
@@ -30,6 +30,7 @@
  * string from the XML data into a value of the target Java data type.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see ValidationEvent
  * @see ValidationEventHandler
  * @see Unmarshaller
diff --git a/jaxws/src/share/classes/javax/xml/bind/PrintConversionEvent.java b/jaxws/src/share/classes/javax/xml/bind/PrintConversionEvent.java
index 60c7dfe..1c6f9eb 100644
--- a/jaxws/src/share/classes/javax/xml/bind/PrintConversionEvent.java
+++ b/jaxws/src/share/classes/javax/xml/bind/PrintConversionEvent.java
@@ -30,6 +30,7 @@
  * from the Java content tree into its lexical representation.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see ValidationEvent
  * @see ValidationEventHandler
  * @see Marshaller
diff --git a/jaxws/src/share/classes/javax/xml/bind/PropertyException.java b/jaxws/src/share/classes/javax/xml/bind/PropertyException.java
index 5c548b7..3f5f734 100644
--- a/jaxws/src/share/classes/javax/xml/bind/PropertyException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/PropertyException.java
@@ -32,6 +32,7 @@
  * setting a property.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $ $Date: 2004/06/14 21:23:04 $
  * @see JAXBContext
  * @see Validator
  * @see Unmarshaller
diff --git a/jaxws/src/share/classes/javax/xml/bind/SchemaOutputResolver.java b/jaxws/src/share/classes/javax/xml/bind/SchemaOutputResolver.java
index e86589c..c51be0a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/SchemaOutputResolver.java
+++ b/jaxws/src/share/classes/javax/xml/bind/SchemaOutputResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package javax.xml.bind;
 
 import javax.xml.transform.Result;
diff --git a/jaxws/src/share/classes/javax/xml/bind/TypeConstraintException.java b/jaxws/src/share/classes/javax/xml/bind/TypeConstraintException.java
index c4d1917..6765778 100644
--- a/jaxws/src/share/classes/javax/xml/bind/TypeConstraintException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/TypeConstraintException.java
@@ -41,6 +41,7 @@
  * called.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see ValidationEvent
  * @since JAXB1.0
  */
diff --git a/jaxws/src/share/classes/javax/xml/bind/UnmarshalException.java b/jaxws/src/share/classes/javax/xml/bind/UnmarshalException.java
index c73ec5c..bdd9444 100644
--- a/jaxws/src/share/classes/javax/xml/bind/UnmarshalException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/UnmarshalException.java
@@ -37,6 +37,7 @@
  * ValidationEventHandler.handleEvent(ValidationEvent)}.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see JAXBException
  * @see Unmarshaller
  * @see ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/Unmarshaller.java b/jaxws/src/share/classes/javax/xml/bind/Unmarshaller.java
index 2e639ca..e13390d 100644
--- a/jaxws/src/share/classes/javax/xml/bind/Unmarshaller.java
+++ b/jaxws/src/share/classes/javax/xml/bind/Unmarshaller.java
@@ -271,7 +271,7 @@
  *     </tr>
  *     <tr>
  *       <td>scope</td>
- *       <td><code>null</code> <i>(actual scope is unknown)</i></td>
+ *       <td><code>null</code> <i>(actual scope is unknown)</td>
  *     </tr>
  *   </tbody>
  *  </table>
@@ -402,6 +402,7 @@
  * </blockquote>
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.31 $ $Date: 2005/08/15 20:54:42 $
  * @see JAXBContext
  * @see Marshaller
  * @see Validator
@@ -708,7 +709,7 @@
      * and return the resulting content tree.
      *
      * <p>
-     * This method implements <a href="#unmarshalByDeclaredType">unmarshal by declaredType</a>.
+     * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
      * <p>
      * This method assumes that the parser is on a START_DOCUMENT or
      * START_ELEMENT event. Unmarshalling will be done from this
@@ -778,7 +779,7 @@
      * and return the resulting content tree.
      *
      * <p>
-     * This method implements <a href="#unmarshalByDeclaredType">unmarshal by declaredType</a>.
+     * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
      *
      * <p>
      * This method assumes that the parser is on a START_DOCUMENT or
diff --git a/jaxws/src/share/classes/javax/xml/bind/UnmarshallerHandler.java b/jaxws/src/share/classes/javax/xml/bind/UnmarshallerHandler.java
index 42193b3..b8b9322 100644
--- a/jaxws/src/share/classes/javax/xml/bind/UnmarshallerHandler.java
+++ b/jaxws/src/share/classes/javax/xml/bind/UnmarshallerHandler.java
@@ -55,6 +55,7 @@
  * an object, s/he can still start a new round of unmarshalling.
  *
  * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.1 $ $Date: 2004/12/14 21:50:41 $
  * @see Unmarshaller#getUnmarshallerHandler()
  * @since JAXB1.0
  */
diff --git a/jaxws/src/share/classes/javax/xml/bind/ValidationEvent.java b/jaxws/src/share/classes/javax/xml/bind/ValidationEvent.java
index 794ebfb..3dd45c8 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ValidationEvent.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ValidationEvent.java
@@ -32,6 +32,7 @@
  * Java content tree back to XML data.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see Validator
  * @see ValidationEventHandler
  * @since JAXB1.0
diff --git a/jaxws/src/share/classes/javax/xml/bind/ValidationEventHandler.java b/jaxws/src/share/classes/javax/xml/bind/ValidationEventHandler.java
index ad184e0..7c78352 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ValidationEventHandler.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ValidationEventHandler.java
@@ -60,6 +60,7 @@
  * </blockquote>
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see Unmarshaller
  * @see Validator
  * @see Marshaller
diff --git a/jaxws/src/share/classes/javax/xml/bind/ValidationEventLocator.java b/jaxws/src/share/classes/javax/xml/bind/ValidationEventLocator.java
index e93465a..b91630a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ValidationEventLocator.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ValidationEventLocator.java
@@ -38,6 +38,7 @@
  * source of the XML data (file, url, Node, etc).
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see Validator
  * @see ValidationEvent
  * @since JAXB1.0
diff --git a/jaxws/src/share/classes/javax/xml/bind/ValidationException.java b/jaxws/src/share/classes/javax/xml/bind/ValidationException.java
index 31d9308..1dcd4a6 100644
--- a/jaxws/src/share/classes/javax/xml/bind/ValidationException.java
+++ b/jaxws/src/share/classes/javax/xml/bind/ValidationException.java
@@ -36,6 +36,7 @@
  * ValidationEventHandler.handleEvent(ValidationEvent)}.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see JAXBException
  * @see Validator
  * @since JAXB1.0
diff --git a/jaxws/src/share/classes/javax/xml/bind/Validator.java b/jaxws/src/share/classes/javax/xml/bind/Validator.java
index 06dd8d0..67dd7ec 100644
--- a/jaxws/src/share/classes/javax/xml/bind/Validator.java
+++ b/jaxws/src/share/classes/javax/xml/bind/Validator.java
@@ -149,6 +149,7 @@
  *
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.3 $ $Date: 2005/06/06 15:04:03 $
  * @see JAXBContext
  * @see Unmarshaller
  * @see ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/WhiteSpaceProcessor.java b/jaxws/src/share/classes/javax/xml/bind/WhiteSpaceProcessor.java
new file mode 100644
index 0000000..110a452
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/WhiteSpaceProcessor.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind;
+
+/**
+ * Processes white space normalization.
+ *
+ * @since 1.0
+ */
+abstract class WhiteSpaceProcessor {
+
+// benchmarking (see test/src/ReplaceTest.java in the CVS Attic)
+// showed that this code is slower than the current code.
+//
+//    public static String replace(String text) {
+//        final int len = text.length();
+//        StringBuffer result = new StringBuffer(len);
+//
+//        for (int i = 0; i < len; i++) {
+//            char ch = text.charAt(i);
+//            if (isWhiteSpace(ch))
+//                result.append(' ');
+//            else
+//                result.append(ch);
+//        }
+//
+//        return result.toString();
+//    }
+
+    public static String replace(String text) {
+        return replace( (CharSequence)text ).toString();
+    }
+
+    /**
+     * @since 2.0
+     */
+    public static CharSequence replace(CharSequence text) {
+        int i=text.length()-1;
+
+        // look for the first whitespace char.
+        while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+            i--;
+
+        if( i<0 )
+            // no such whitespace. replace(text)==text.
+            return text;
+
+        // we now know that we need to modify the text.
+        // allocate a char array to do it.
+        StringBuilder buf = new StringBuilder(text);
+
+        buf.setCharAt(i--,' ');
+        for( ; i>=0; i-- )
+            if( isWhiteSpaceExceptSpace(buf.charAt(i)))
+                buf.setCharAt(i,' ');
+
+        return new String(buf);
+    }
+
+    /**
+     * Equivalent of {@link String#trim()}.
+     * @since 2.0
+     */
+    public static CharSequence trim(CharSequence text) {
+        int len = text.length();
+        int start = 0;
+
+        while( start<len && isWhiteSpace(text.charAt(start)) )
+            start++;
+
+        int end = len-1;
+
+        while( end>start && isWhiteSpace(text.charAt(end)) )
+            end--;
+
+        if(start==0 && end==len-1)
+            return text;    // no change
+        else
+            return text.subSequence(start,end+1);
+    }
+
+    public static String collapse(String text) {
+        return collapse( (CharSequence)text ).toString();
+    }
+
+    /**
+     * This is usually the biggest processing bottleneck.
+     *
+     * @since 2.0
+     */
+    public static CharSequence collapse(CharSequence text) {
+        int len = text.length();
+
+        // most of the texts are already in the collapsed form.
+        // so look for the first whitespace in the hope that we will
+        // never see it.
+        int s=0;
+        while(s<len) {
+            if(isWhiteSpace(text.charAt(s)))
+                break;
+            s++;
+        }
+        if(s==len)
+            // the input happens to be already collapsed.
+            return text;
+
+        // we now know that the input contains spaces.
+        // let's sit down and do the collapsing normally.
+
+        StringBuilder result = new StringBuilder(len /*allocate enough size to avoid re-allocation*/ );
+
+        if(s!=0) {
+            for( int i=0; i<s; i++ )
+                result.append(text.charAt(i));
+            result.append(' ');
+        }
+
+        boolean inStripMode = true;
+        for (int i = s+1; i < len; i++) {
+            char ch = text.charAt(i);
+            boolean b = isWhiteSpace(ch);
+            if (inStripMode && b)
+                continue; // skip this character
+
+            inStripMode = b;
+            if (inStripMode)
+                result.append(' ');
+            else
+                result.append(ch);
+        }
+
+        // remove trailing whitespaces
+        len = result.length();
+        if (len > 0 && result.charAt(len - 1) == ' ')
+            result.setLength(len - 1);
+        // whitespaces are already collapsed,
+        // so all we have to do is to remove the last one character
+        // if it's a whitespace.
+
+        return result;
+    }
+
+    /**
+     * Returns true if the specified string is all whitespace.
+     */
+    public static final boolean isWhiteSpace(CharSequence s) {
+        for( int i=s.length()-1; i>=0; i-- )
+            if(!isWhiteSpace(s.charAt(i)))
+                return false;
+        return true;
+    }
+
+    /** returns true if the specified char is a white space character. */
+    public static final boolean isWhiteSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+    }
+
+    /**
+     * Returns true if the specified char is a white space character
+     * but not 0x20.
+     */
+    protected static final boolean isWhiteSpaceExceptSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>=0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD;
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java
index 88eea61..ca57b0d 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.3 $
  * @see XmlAccessorOrder
  */
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java
index d88cccf..5a4cecd 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.10 $
  * @see XmlAccessorType
  */
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java
index aa67d3b..67f0c11 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java
@@ -36,7 +36,7 @@
 /**
  * <p> Controls the ordering of fields and properties in a class. </p>
  *
- * <p> <b> Usage </b> </p>
+ * <h3>Usage </h3>
  *
  * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following
  * program elements:</p>
@@ -46,33 +46,23 @@
  *   <li> a top level class </li>
  * </ul>
  *
- * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * <p> See "Package Specification" in <tt>javax.xml.bind</tt> package javadoc for
  * additional common information.</p>
  *
- * <p>The annotation <tt> @XmlAccessorOrder </tt> on a package applies to
- * all classes in a package. The following inheritance semantics apply:
+ * <p>The effective {@link XmlAccessOrder} on a class is determined
+ * as follows:
  *
  * <ul>
  *   <li> If there is a <tt>@XmlAccessorOrder</tt> on a class, then
  *        it is used. </li>
  *   <li> Otherwise, if a <tt>@XmlAccessorOrder </tt> exists on one of
- *        its super classes, then it is inherited.
- *   <li> Otherwise, the <tt>@XmlAccessorOrder </tt> on a package is
- *        inherited.
+ *        its super classes, then it is inherited (by the virtue of
+ *        {@link Inherited})
+ *   <li> Otherwise, the <tt>@XmlAccessorOrder</tt> on the package
+ *        of the class is used, if it's there.
+ *   <li> Otherwise {@link XmlAccessOrder#UNDEFINED}.
  * </ul>
- * <p> <b> Defaulting Rules: </b> </p>
  *
- * <p>By default, if <tt>@XmlAccessorOrder </tt> on a package is absent,
- * then the following package level annotation is assumed.</p>
- *<pre>
- *    &#64;XmlAccessorType(XmlAccessOrder.UNDEFINED)
- *</pre>
- * <p> By default, if <tt>@XmlAccessorOrder</tt> on a class is absent
- * and none of super classes is annotated with <tt> XmlAccessorOrder
- * </tt>, then the following default on the class is assumed: </p>
- *<pre>
- *    &#64;XmlAccessorType(XmlAccessOrder.UNDEFINED)
- *</pre>
  * <p>This annotation can be used with the following annotations:
  *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
  *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
@@ -81,6 +71,7 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version  $Revision: 1.11 $
  * @see XmlAccessOrder
  */
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java
index a14d2c8..bc2bbdc 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java
@@ -86,6 +86,7 @@
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
  * @see XmlAccessType
+ * @version  $Revision: 1.8 $
  */
 
 @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java
index 2a03c11..daf8e5a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java
@@ -121,6 +121,7 @@
  *
  * </pre>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @version $Revision: 1.13 $
  * @see XmlType
  * @since JAXB2.0
  */
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElement.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElement.java
index 61e2f6b..39ffbd6 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElement.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElement.java
@@ -37,7 +37,7 @@
  *
  * <p> <b>Usage</b> </p>
  * <p>
- * <tt>@XmlElement</tt> annotation can be used with the following program
+ * </tt>@XmlElement</tt> annotation can be used with the following program
  * elements:
  * <ul>
  *   <li> a JavaBean property </li>
@@ -134,6 +134,7 @@
  * <p>
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.18 $
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java
index 19a807c..cad3c6a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java
@@ -94,7 +94,7 @@
  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
  * additional common information.</p>
  *
- * <p><b>Example 1: Ant Task Example</b></p>
+ * <p><b>Example 1: </b>Ant Task Example</b></p>
  * The following Java class hierarchy models an Ant build
  * script.  An Ant task corresponds to a class in the class
  * hierarchy. The XML element name of an Ant task is indicated by the
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
index 9163f06..bcae12b 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package javax.xml.bind.annotation;
 
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@@ -124,4 +123,22 @@
      * the absence of the element.
      */
     boolean nillable() default false;
+
+    /**
+     * Customize the wrapper element declaration to be required.
+     *
+     * <p>
+     * If required() is true, then the corresponding generated
+     * XML schema element declaration will have <tt>minOccurs="1"</tt>,
+     * to indicate that the wrapper element is always expected.
+     *
+     * <p>
+     * Note that this only affects the schema generation, and
+     * not the unmarshalling or marshalling capability. This is
+     * simply a mechanism to let users express their application constraints
+     * better.
+     *
+     * @since JAXB 2.1
+     */
+    boolean required() default false;
 }
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlID.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlID.java
index 148f80c..fda3691 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlID.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlID.java
@@ -88,6 +88,7 @@
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlIDREF
  * @since JAXB2.0
+ * @version $Revision: 1.4 $
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java
index db6f4e7..df0a31a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java
@@ -244,6 +244,7 @@
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlID
  * @since JAXB2.0
+ * @version $Revision: 1.11 $
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlList.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlList.java
index 5338732..e924b8a 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlList.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlList.java
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package javax.xml.bind.annotation;
 
 import java.lang.annotation.Retention;
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNs.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNs.java
index f814cf2..7fff607 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNs.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNs.java
@@ -43,6 +43,7 @@
  * <p><b>Example:</b>See <tt>XmlSchema</tt> annotation type for an example.
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.2 $
  */
 
 @Retention(RUNTIME) @Target({})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java
index f92fba4..3f0b361 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java
@@ -40,8 +40,8 @@
  * <table border="1" cellpadding="4" cellspacing="3">
  *   <tbody>
  *     <tr>
- *       <td><b>Enum Value</b></td>
- *       <td><b>XML Schema Value</b></td>
+ *       <td><b>Enum Value<b></td>
+ *       <td><b>XML Schema Value<b></td>
  *     </tr>
  *
  *     <tr valign="top">
@@ -62,5 +62,6 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.1 $
  */
 public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchema.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchema.java
index a6a9580..92b5386 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchema.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchema.java
@@ -34,7 +34,7 @@
 /**
  * <p> Maps a package name to a XML namespace. </p>
  *
- * <p><b>Usage</b> </p>
+ * <h3>Usage</h3>
  * <p>
  * The XmlSchema annotation can be used with the following program
  * elements:
@@ -42,6 +42,7 @@
  *   <li>package</li>
  * </ul>
  *
+ * <p>
  * This is a package level annotation and follows the recommendations
  * and restrictions contained in JSR 175, section III, "Annotations".
  * Thus the usage is subject to the following constraints and
@@ -114,9 +115,10 @@
 
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision: 1.9 $
  */
 
-@Retention(RUNTIME) @Target({PACKAGE})
+@Retention(RUNTIME) @Target(PACKAGE)
 public @interface XmlSchema {
 
     /**
@@ -142,4 +144,64 @@
      * attributesFormDefault will be absent from the XML Schema fragment.
      */
     XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
+
+    /**
+     * Indicates that this namespace (specified by {@link #namespace()})
+     * has a schema already available exeternally, available at this location.
+     *
+     * <p>
+     * This instructs the JAXB schema generators to simply refer to
+     * the pointed schema, as opposed to generating components into the schema.
+     * This schema is assumed to match what would be otherwise produced
+     * by the schema generator (same element names, same type names...)
+     *
+     * <p>
+     * This feature is intended to be used when a set of the Java classes
+     * is originally generated from an existing schema, hand-written to
+     * match externally defined schema, or the generated schema is modified
+     * manually.
+     *
+     * <p>
+     * Value could be any absolute URI, like <tt>http://example.org/some.xsd</tt>.
+     * It is also possible to specify the empty string, to indicate
+     * that the schema is externally available but the location is
+     * unspecified (and thus it's the responsibility of the reader of the generate
+     * schema to locate it.) Finally, the default value of this property
+     * <tt>"##generate"</tt> indicates that the schema generator is going
+     * to generate components for this namespace (as it did in JAXB 2.0.)
+     *
+     * <p>
+     * Multiple {@link XmlSchema} annotations on multiple packages are allowed
+     * to govern the same {@link #namespace()}. In such case, all of them
+     * must have the same {@link #location()} values.
+     *
+     *
+     * <h3>Note to implementor</h3>
+     * <p>
+     * More precisely, the value must be either <tt>""</tt>, <tt>"##generate"</tt>, or
+     * <a href="http://www.w3.org/TR/xmlschema-2/#anyURI">
+     * a valid lexical representation of <tt>xs:anyURI</tt></a> that begins
+     * with <tt>&lt;scheme>:</tt>.
+     *
+     * <p>
+     * A schema generator is expected to generate a corresponding
+     * <tt>&lt;xs:import namespace="..." schemaLocation="..."/></tt> (or
+     * no <tt>schemaLocation</tt> attribute at all if the empty string is specified.)
+     * However, the schema generator is allowed to use a different value in
+     * the <tt>schemaLocation</tt> attribute (including not generating
+     * such attribute), for example so that the user can specify a local
+     * copy of the resource through the command line interface.
+     *
+     * @since JAXB2.1
+     */
+    String location() default NO_LOCATION;
+
+    /**
+     * The default value of the {@link #location()} attribute,
+     * which indicates that the schema generator will generate
+     * components in this namespace.
+     */
+    // the actual value is chosen because ## is not a valid
+    // sequence in xs:anyURI.
+    static final String NO_LOCATION = "##generate";
 }
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSeeAlso.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSeeAlso.java
new file mode 100644
index 0000000..c5fe51e
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSeeAlso.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.JAXBContext;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Instructs JAXB to also bind other classes when binding this class.
+ *
+ * <p>
+ * Java makes it impractical/impossible to list all sub-classes of
+ * a given class. This often gets in a way of JAXB users, as it JAXB
+ * cannot automatically list up the classes that need to be known
+ * to {@link JAXBContext}.
+ *
+ * <p>
+ * For example, with the following class definitions:
+ *
+ * <pre>
+ * class Animal {}
+ * class Dog extends Animal {}
+ * class Cat extends Animal {}
+ * </pre>
+ *
+ * <p>
+ * The user would be required to create {@link JAXBContext} as
+ * <tt>JAXBContext.newInstance(Dog.class,Cat.class)</tt>
+ * (<tt>Animal</tt> will be automatically picked up since <tt>Dog</tt>
+ * and <tt>Cat</tt> refers to it.)
+ *
+ * <p>
+ * {@link XmlSeeAlso} annotation would allow you to write:
+ * <pre>
+ * &#64;XmlSeeAlso({Dog.class,Cat.class})
+ * class Animal {}
+ * class Dog extends Animal {}
+ * class Cat extends Animal {}
+ * </pre>
+ *
+ * <p>
+ * This would allow you to do <tt>JAXBContext.newInstance(Animal.class)</tt>.
+ * By the help of this annotation, JAXB implementations will be able to
+ * correctly bind <tt>Dog</tt> and <tt>Cat</tt>.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.1
+ * @version $Revision: $
+ */
+@Target({ElementType.TYPE})
+@Retention(RUNTIME)
+public @interface XmlSeeAlso {
+    Class[] value();
+}
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlTransient.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlTransient.java
index c97bf0e..5cc238e 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlTransient.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlTransient.java
@@ -32,7 +32,7 @@
 
 /**
  * <p>
- * Prevents the mapping of a JavaBean property to XML representation.
+ * Prevents the mapping of a JavaBean property/type to XML representation.
  * <p>
  * The <tt>@XmlTransient</tt> annotation is useful for resolving name
  * collisions between a JavaBean property name and a field name or
@@ -42,12 +42,19 @@
  * then the name collision can be resolved by preventing the
  * mapping of either the field or the JavaBean property using the
  * <tt>@XmlTransient</tt> annotation.
+ *
+ * <p>
+ * When placed on a class, it indicates that the class shouldn't be mapped
+ * to XML by itself. Properties on such class will be mapped to XML along
+ * with its derived classes, as if the class is inlined.
+ *
  * <p><b>Usage</b></p>
  * <p> The <tt>@XmlTransient</tt> annotation can be used with the following
  *     program elements:
  * <ul>
  *   <li> a JavaBean property </li>
  *   <li> field </li>
+ *   <li> class </li>
  * </ul>
  *
  * <p><tt>@XmlTransient</tt>is mutually exclusive with all other
@@ -82,7 +89,8 @@
  *
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @since JAXB2.0
+ * @version $Revision$
  */
 
-@Retention(RUNTIME) @Target({FIELD, METHOD})
+@Retention(RUNTIME) @Target({FIELD, METHOD, TYPE})
 public @interface XmlTransient {}
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlType.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlType.java
index b076f3e..1e35ae5 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlType.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlType.java
@@ -122,7 +122,7 @@
  *   <table border="1" cellpadding="4" cellspacing="3">
  *     <tbody>
  *       <tr>
- *         <td><b>Target</b></td>
+ *         <td><b>Target</td>
  *         <td><b>propOrder</b></td>
  *         <td><b>ClassBody</b></td>
  *         <td><b>ComplexType</b></td>
@@ -380,6 +380,7 @@
  * @see XmlValue
  * @see XmlSchema
  * @since JAXB2.0
+ * @version $Revision: 1.19 $
  */
 
 @Retention(RUNTIME) @Target({TYPE})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlValue.java b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlValue.java
index 9dbcd52..44160df 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/XmlValue.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/XmlValue.java
@@ -125,6 +125,7 @@
  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
  * @see XmlType
  * @since JAXB2.0
+ * @version $Revision: 1.5 $
  */
 
 @Retention(RUNTIME) @Target({FIELD, METHOD})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
index 83df577..85ce1c7 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
@@ -38,10 +38,12 @@
  */
 public final class HexBinaryAdapter extends XmlAdapter<String,byte[]> {
     public byte[] unmarshal(String s) {
+        if(s==null)     return null;
         return DatatypeConverter.parseHexBinary(s);
     }
 
     public String marshal(byte[] bytes) {
+        if(bytes==null)     return null;
         return DatatypeConverter.printHexBinary(bytes);
     }
 }
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
index aa3d05d..630fc36 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
@@ -39,9 +39,8 @@
  */
 public final class NormalizedStringAdapter extends XmlAdapter<String,String> {
     /**
-     * Removes leading and trailing whitespaces of the string
-     * given as the parameter, then replace
-     * any tab, CR, and LF by a whitespace character ' '.
+     * Replace any tab, CR, and LF by a whitespace character ' ',
+     * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace">the whitespace facet 'replace'</a>
      */
     public String unmarshal(String text) {
         if(text==null)      return null;    // be defensive
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
index 3fc3e09..43b4133 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
@@ -25,9 +25,6 @@
 
 package javax.xml.bind.annotation.adapters;
 
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.Marshaller;
-
 /**
  * Adapts a Java type for custom marshaling.
  *
@@ -71,7 +68,7 @@
  *        XmlJavaTypeAdapter} </li>
  * </ul>
  *
- * <p><b>Example:</b> Customized mapping of <tt>HashMap</tt></p>
+ * <p><b>Example:</b> Customized mapping of </tt>HashMap</tt></p>
  * <p> The following example illustrates the use of
  * <tt>&#64;XmlAdapter</tt> and <tt>&#64;XmlJavaTypeAdapter</tt> to
  * customize the mapping of a <tt>HashMap</tt>.
@@ -130,7 +127,7 @@
  *
  * <pre>
  *     public final class MyHashMapAdapter extends
- *                        XmlAdapter&lt;HashMap, MyHashMapType> { ... }
+ *                        XmlAdapter&lt;MyHashMapType,HashMap> { ... }
  *
  * </pre>
  *
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
index 044cb0d..a3f12be 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
@@ -88,6 +88,7 @@
  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
  * @since JAXB2.0
  * @see XmlAdapter
+ * @version $Revision: 1.9 $
  */
 
 @Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/package.html b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/package.html
index c264668..1515de9 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/package.html
@@ -1,30 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-        -->
+        
     </head>
 
     <body>
diff --git a/jaxws/src/share/classes/javax/xml/bind/annotation/package.html b/jaxws/src/share/classes/javax/xml/bind/annotation/package.html
index ea022a7..3c95116 100644
--- a/jaxws/src/share/classes/javax/xml/bind/annotation/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/annotation/package.html
@@ -1,31 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-
-        -->
+        
     </head>
 
     <body bgcolor="white">
diff --git a/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java b/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java
index a415b39..191a431 100644
--- a/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java
+++ b/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package javax.xml.bind.attachment;
 
 import javax.activation.DataHandler;
diff --git a/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
index dd3bb13..f50f26b 100644
--- a/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ b/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package javax.xml.bind.attachment;
 
 import javax.activation.DataHandler;
diff --git a/jaxws/src/share/classes/javax/xml/bind/attachment/package.html b/jaxws/src/share/classes/javax/xml/bind/attachment/package.html
index 1b881c6..e300db7 100644
--- a/jaxws/src/share/classes/javax/xml/bind/attachment/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/attachment/package.html
@@ -1,30 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-        -->
+        
     </head>
 
     <body bgcolor="white">
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java
index a414cfa..20ac6ca 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java
@@ -37,6 +37,11 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.validation.Schema;
 import java.io.UnsupportedEncodingException;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
 // J2SE1.4 feature
 // import java.nio.charset.Charset;
 // import java.nio.charset.UnsupportedCharsetException;
@@ -55,6 +60,7 @@
  * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date$
  * @see javax.xml.bind.Marshaller
  * @since JAXB1.0
  */
@@ -89,6 +95,20 @@
         marshal( obj, new StreamResult(os) );
     }
 
+    public void marshal(Object jaxbElement, File output) throws JAXBException {
+        checkNotNull(jaxbElement, "jaxbElement", output, "output" );
+        try {
+            OutputStream os = new BufferedOutputStream(new FileOutputStream(output));
+            try {
+                marshal( jaxbElement, new StreamResult(os) );
+            } finally {
+                os.close();
+            }
+        } catch (IOException e) {
+            throw new JAXBException(e);
+        }
+    }
+
     public final void marshal( Object obj, java.io.Writer w )
         throws JAXBException {
 
@@ -422,18 +442,13 @@
                 Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
         }
     }
-    /* (non-Javadoc)
-     * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLEventWriter)
-     */
+
     public void marshal(Object obj, XMLEventWriter writer)
         throws JAXBException {
 
         throw new UnsupportedOperationException();
     }
 
-    /* (non-Javadoc)
-     * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLStreamWriter)
-     */
     public void marshal(Object obj, XMLStreamWriter writer)
         throws JAXBException {
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
index cedc641..4f2f6a1 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
@@ -66,6 +66,7 @@
  * @author <ul>
  *         <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
  *         </ul>
+ * @version $Revision: 1.13 $ $Date: 2005/07/28 22:18:12 $
  * @see javax.xml.bind.Unmarshaller
  * @since JAXB1.0
  */
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java b/jaxws/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java
index 0cfaa88..4b484ee 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java
@@ -48,6 +48,7 @@
  * {@link javax.xml.bind.Marshaller}.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.4 $
  * @see javax.xml.bind.Unmarshaller
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.properties b/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.properties
index 6515c86..8407c34 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.properties
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 AbstractUnmarshallerImpl.ISNotNull = \
 	InputStream can not be null
 
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
index b1f3005..94bee73 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
@@ -36,6 +36,7 @@
  * convenience.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see javax.xml.bind.NotIdentifiableEvent
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java
index 2bc0ab0..6ee20e4 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java
@@ -37,6 +37,7 @@
  * convenience.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see javax.xml.bind.ParseConversionEvent
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java
index 126e725..8316934 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java
@@ -37,6 +37,7 @@
  * convenience.
  *
  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see javax.xml.bind.PrintConversionEvent
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java
index 2ccc069..7ad6cdc 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java
@@ -38,6 +38,7 @@
  * convenience.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.2 $
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java b/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
index 214bbab..09d919e 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
@@ -42,6 +42,7 @@
  * convenience.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision: 1.1 $
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
diff --git a/jaxws/src/share/classes/javax/xml/bind/helpers/package.html b/jaxws/src/share/classes/javax/xml/bind/helpers/package.html
index d92375e..f46749c 100644
--- a/jaxws/src/share/classes/javax/xml/bind/helpers/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/helpers/package.html
@@ -1,30 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-        -->
+        
     </head>
 
     <body bgcolor="white">
diff --git a/jaxws/src/share/classes/javax/xml/bind/package.html b/jaxws/src/share/classes/javax/xml/bind/package.html
index 48a697a..2d1f566 100644
--- a/jaxws/src/share/classes/javax/xml/bind/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/package.html
@@ -1,30 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-        -->
+        
     </head>
 
     <body bgcolor="white">
diff --git a/jaxws/src/share/classes/javax/xml/bind/util/Messages.properties b/jaxws/src/share/classes/javax/xml/bind/util/Messages.properties
index 09b8163..b7b409c 100644
--- a/jaxws/src/share/classes/javax/xml/bind/util/Messages.properties
+++ b/jaxws/src/share/classes/javax/xml/bind/util/Messages.properties
@@ -1,3 +1,28 @@
+#
+# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
 ValidationEventCollector.UnrecognizedSeverity = \
 	Unrecognized event severity field "{0}"
 	
diff --git a/jaxws/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java b/jaxws/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java
index 70026b0..27e22b4 100644
--- a/jaxws/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java
+++ b/jaxws/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java
@@ -24,9 +24,10 @@
  */
 package javax.xml.bind.util;
 
-import java.util.Vector;
-import javax.xml.bind.ValidationEventHandler;
 import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler}
@@ -39,6 +40,7 @@
  * the reported errors and warnings.
  *
  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
  * @see javax.xml.bind.Validator
  * @see javax.xml.bind.ValidationEventHandler
  * @see javax.xml.bind.ValidationEvent
@@ -47,7 +49,7 @@
  */
 public class ValidationEventCollector implements ValidationEventHandler
 {
-    private final Vector<ValidationEvent> events = new Vector<ValidationEvent>();
+    private final List<ValidationEvent> events = new ArrayList<ValidationEvent>();
 
     /**
      * Return an array of ValidationEvent objects containing a copy of each of
@@ -65,7 +67,7 @@
      * Clear all collected errors and warnings.
      */
     public void reset() {
-        events.removeAllElements();
+        events.clear();
     }
 
     /**
diff --git a/jaxws/src/share/classes/javax/xml/bind/util/package.html b/jaxws/src/share/classes/javax/xml/bind/util/package.html
index 2a6e209..fcffa20 100644
--- a/jaxws/src/share/classes/javax/xml/bind/util/package.html
+++ b/jaxws/src/share/classes/javax/xml/bind/util/package.html
@@ -1,30 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
     <head>
-        <!--
-Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
-        -->
+        
     </head>
 
     <body bgcolor="white">
diff --git a/jaxws/src/share/classes/javax/xml/soap/AttachmentPart.java b/jaxws/src/share/classes/javax/xml/soap/AttachmentPart.java
index 98fe277..ab1a899 100644
--- a/jaxws/src/share/classes/javax/xml/soap/AttachmentPart.java
+++ b/jaxws/src/share/classes/javax/xml/soap/AttachmentPart.java
@@ -1,10 +1,4 @@
 /*
- * $Id: AttachmentPart.java,v 1.11 2005/08/17 08:13:01 vj135062 Exp $
- * $Revision: 1.11 $
- * $Date: 2005/08/17 08:13:01 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: AttachmentPart.java,v 1.12 2005/09/08 14:19:50 vj135062 Exp $
+ * $Revision: 1.12 $
+ * $Date: 2005/09/08 14:19:50 $
+ */
+
+
 package javax.xml.soap;
 
 import java.io.InputStream;
diff --git a/jaxws/src/share/classes/javax/xml/soap/Detail.java b/jaxws/src/share/classes/javax/xml/soap/Detail.java
index 33176a1..63eecec 100644
--- a/jaxws/src/share/classes/javax/xml/soap/Detail.java
+++ b/jaxws/src/share/classes/javax/xml/soap/Detail.java
@@ -1,10 +1,4 @@
 /*
- * $Id: Detail.java,v 1.7 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.7 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Detail.java,v 1.8 2005/04/05 20:34:16 mk125090 Exp $
+ * $Revision: 1.8 $
+ * $Date: 2005/04/05 20:34:16 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/DetailEntry.java b/jaxws/src/share/classes/javax/xml/soap/DetailEntry.java
index eac373e..4f4aa1c 100644
--- a/jaxws/src/share/classes/javax/xml/soap/DetailEntry.java
+++ b/jaxws/src/share/classes/javax/xml/soap/DetailEntry.java
@@ -1,10 +1,4 @@
 /*
- * $Id: DetailEntry.java,v 1.2 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.2 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: DetailEntry.java,v 1.3 2005/04/05 20:34:16 mk125090 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2005/04/05 20:34:16 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/FactoryFinder.java b/jaxws/src/share/classes/javax/xml/soap/FactoryFinder.java
index 67ac61b..df3c3d1 100644
--- a/jaxws/src/share/classes/javax/xml/soap/FactoryFinder.java
+++ b/jaxws/src/share/classes/javax/xml/soap/FactoryFinder.java
@@ -1,10 +1,4 @@
 /*
- * $Id: FactoryFinder.java,v 1.5 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.5 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: FactoryFinder.java,v 1.6 2005/04/05 22:28:12 mk125090 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2005/04/05 22:28:12 $
+ */
+
+
 
 package javax.xml.soap;
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/MessageFactory.java b/jaxws/src/share/classes/javax/xml/soap/MessageFactory.java
index fee378c..e6ee4ff 100644
--- a/jaxws/src/share/classes/javax/xml/soap/MessageFactory.java
+++ b/jaxws/src/share/classes/javax/xml/soap/MessageFactory.java
@@ -1,10 +1,4 @@
 /*
- * $Id: MessageFactory.java,v 1.9 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.9 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MessageFactory.java,v 1.10 2005/04/05 22:28:13 mk125090 Exp $
+ * $Revision: 1.10 $
+ * $Date: 2005/04/05 22:28:13 $
+ */
+
+
 package javax.xml.soap;
 
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/MimeHeader.java b/jaxws/src/share/classes/javax/xml/soap/MimeHeader.java
index c4bda58..427b349 100644
--- a/jaxws/src/share/classes/javax/xml/soap/MimeHeader.java
+++ b/jaxws/src/share/classes/javax/xml/soap/MimeHeader.java
@@ -1,10 +1,4 @@
 /*
- * $Id: MimeHeader.java,v 1.2 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.2 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MimeHeader.java,v 1.3 2005/04/05 20:49:48 mk125090 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2005/04/05 20:49:48 $
+ */
+
+
 package javax.xml.soap;
 
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/MimeHeaders.java b/jaxws/src/share/classes/javax/xml/soap/MimeHeaders.java
index 209131f..b1a9382 100644
--- a/jaxws/src/share/classes/javax/xml/soap/MimeHeaders.java
+++ b/jaxws/src/share/classes/javax/xml/soap/MimeHeaders.java
@@ -1,10 +1,4 @@
 /*
- * $Id: MimeHeaders.java,v 1.4 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.4 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: MimeHeaders.java,v 1.5 2005/04/05 20:49:49 mk125090 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2005/04/05 20:49:49 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/Name.java b/jaxws/src/share/classes/javax/xml/soap/Name.java
index e5699bd..a247bb3 100644
--- a/jaxws/src/share/classes/javax/xml/soap/Name.java
+++ b/jaxws/src/share/classes/javax/xml/soap/Name.java
@@ -1,10 +1,4 @@
 /*
- * $Id: Name.java,v 1.3 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.3 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Name.java,v 1.4 2005/04/05 20:49:49 mk125090 Exp $
+ * $Revision: 1.4 $
+ * $Date: 2005/04/05 20:49:49 $
+ */
+
+
 package javax.xml.soap;
 
 /**
@@ -75,7 +76,7 @@
  * </PRE>
  * <P>
  * The <code>Name</code> interface may be deprecated in a future release of SAAJ
- * in favor of <code>javax.xml.namespace.QName</code>
+ * in favor of <code>javax.xml.namespace.QName<code>
  * @see SOAPEnvelope#createName(String, String, String) SOAPEnvelope.createName
  * @see SOAPFactory#createName(String, String, String) SOAPFactory.createName
  */
diff --git a/jaxws/src/share/classes/javax/xml/soap/Node.java b/jaxws/src/share/classes/javax/xml/soap/Node.java
index 4695d29..8507b3e 100644
--- a/jaxws/src/share/classes/javax/xml/soap/Node.java
+++ b/jaxws/src/share/classes/javax/xml/soap/Node.java
@@ -1,10 +1,4 @@
 /*
- * $Id: Node.java,v 1.12 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.12 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Node.java,v 1.13 2005/04/05 20:49:49 mk125090 Exp $
+ * $Revision: 1.13 $
+ * $Date: 2005/04/05 20:49:49 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SAAJMetaFactory.java b/jaxws/src/share/classes/javax/xml/soap/SAAJMetaFactory.java
index 42fcb84..3aad820 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SAAJMetaFactory.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SAAJMetaFactory.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SAAJMetaFactory.java,v 1.2.2.15 2005/02/11 07:26:15 vj135062 Exp $
- * $Revision: 1.2.2.15 $
- * $Date: 2005/02/11 07:26:15 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SAAJMetaFactory.java,v 1.4 2006/03/30 00:59:39 ofung Exp $
+ * $Revision: 1.4 $
+ * $Date: 2006/03/30 00:59:39 $
+ */
+
+
 package javax.xml.soap;
 
 /**
@@ -52,8 +53,6 @@
     static private final String DEFAULT_META_FACTORY_CLASS =
         "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
 
-    static private SAAJMetaFactory instance = null;
-
     /**
      * Creates a new instance of a concrete <code>SAAJMetaFactory</code> object.
      * The SAAJMetaFactory is an SPI, it pulls the creation of the other factories together into a
@@ -75,20 +74,17 @@
      * @return a concrete <code>SAAJMetaFactory</code> object
      * @exception SOAPException if there is an error in creating the <code>SAAJMetaFactory</code>
      */
-    static synchronized SAAJMetaFactory getInstance() throws SOAPException {
-        if (instance == null) {
+    static SAAJMetaFactory getInstance() throws SOAPException {
             try {
-                instance =
+                SAAJMetaFactory instance =
                     (SAAJMetaFactory) FactoryFinder.find(
                         META_FACTORY_CLASS_PROPERTY,
                         DEFAULT_META_FACTORY_CLASS);
+                return instance;
             } catch (Exception e) {
                 throw new SOAPException(
                     "Unable to create SAAJ meta-factory" + e.getMessage());
             }
-        }
-
-        return instance;
     }
 
     protected SAAJMetaFactory() { }
diff --git a/jaxws/src/share/classes/javax/xml/soap/SAAJResult.java b/jaxws/src/share/classes/javax/xml/soap/SAAJResult.java
index f46b06e..ebacb21 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SAAJResult.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SAAJResult.java
@@ -1,8 +1,4 @@
 /*
- * $Id: SAAJResult.java,v 1.3 2006/03/09 16:09:42 vj135062 Exp $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -26,6 +22,11 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SAAJResult.java,v 1.4 2006/03/24 13:05:43 vj135062 Exp $
+ */
+
+
 
 package javax.xml.soap;
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPBody.java b/jaxws/src/share/classes/javax/xml/soap/SOAPBody.java
index 86cab0f..f17f073 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPBody.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPBody.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPBody.java,v 1.16 2005/04/05 22:28:13 mk125090 Exp $
- * $Revision: 1.16 $
- * $Date: 2005/04/05 22:28:13 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPBody.java,v 1.17 2005/06/22 10:24:11 vj135062 Exp $
+ * $Revision: 1.17 $
+ * $Date: 2005/06/22 10:24:11 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Locale;
@@ -292,7 +293,7 @@
      *         of the <code>SOAPBody</code> content.
      *
      * @exception SOAPException
-     *                if there is not exactly one child <code>SOAPElement</code> of the
+     *                if there is not exactly one child <code>SOAPElement</code> of the <code>
      *              <code>SOAPBody</code>.
      *
      * @since SAAJ 1.3
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPBodyElement.java b/jaxws/src/share/classes/javax/xml/soap/SOAPBodyElement.java
index f1b4926..a3d824d 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPBodyElement.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPBodyElement.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPBodyElement.java,v 1.2 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.2 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPBodyElement.java,v 1.3 2005/04/05 22:28:13 mk125090 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2005/04/05 22:28:13 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPConnection.java b/jaxws/src/share/classes/javax/xml/soap/SOAPConnection.java
index 670af21..0c9b5ad 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPConnection.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPConnection.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPConnection.java,v 1.11 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.11 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPConnection.java,v 1.12 2005/04/05 21:03:23 mk125090 Exp $
+ * $Revision: 1.12 $
+ * $Date: 2005/04/05 21:03:23 $
+ */
+
+
 package javax.xml.soap;
 
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java b/jaxws/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java
index 29bce97..ed3b909 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPConnectionFactory.java,v 1.4 2004/04/02 01:24:17 ofung Exp $
- * $Revision: 1.4 $
- * $Date: 2004/04/02 01:24:17 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPConnectionFactory.java,v 1.5 2005/04/05 21:03:23 mk125090 Exp $
+ * $Revision: 1.5 $
+ * $Date: 2005/04/05 21:03:23 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPConstants.java b/jaxws/src/share/classes/javax/xml/soap/SOAPConstants.java
index cfbb9aa..b46d143 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPConstants.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPConstants.java
@@ -1,10 +1,4 @@
 /*
- * $Id: $
- * $Revision: 1.11 $
- * $Date: 2004/04/02 01:24:18 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPConstants.java,v 1.12 2005/04/05 22:28:13 mk125090 Exp $
+ * $Revision: 1.12 $
+ * $Date: 2005/04/05 22:28:13 $
+ */
+
+
 package javax.xml.soap;
 
 import javax.xml.namespace.QName;
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPElement.java b/jaxws/src/share/classes/javax/xml/soap/SOAPElement.java
index c07cacd..c4fd713 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPElement.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPElement.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPElement.java,v 1.18 2005/12/07 07:25:37 vj135062 Exp $
- * $Revision: 1.18 $
- * $Date: 2005/12/07 07:25:37 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPElement.java,v 1.19 2005/12/13 09:20:25 vj135062 Exp $
+ * $Revision: 1.19 $
+ * $Date: 2005/12/13 09:20:25 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPElementFactory.java b/jaxws/src/share/classes/javax/xml/soap/SOAPElementFactory.java
index d1a5837..0fb6c59 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPElementFactory.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPElementFactory.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPElementFactory.java,v 1.4.2.7 2004/08/27 19:00:36 goodwin Exp $
- * $Revision: 1.4.2.7 $
- * $Date: 2004/08/27 19:00:36 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPElementFactory.java,v 1.11 2005/04/05 22:42:05 mk125090 Exp $
+ * $Revision: 1.11 $
+ * $Date: 2005/04/05 22:42:05 $
+ */
+
+
 
 package javax.xml.soap;
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPEnvelope.java b/jaxws/src/share/classes/javax/xml/soap/SOAPEnvelope.java
index 96ed2b4..5419de5 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPEnvelope.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPEnvelope.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPEnvelope.java,v 1.5 2004/04/02 01:24:18 ofung Exp $
- * $Revision: 1.5 $
- * $Date: 2004/04/02 01:24:18 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPEnvelope.java,v 1.6 2005/04/05 22:42:05 mk125090 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2005/04/05 22:42:05 $
+ */
+
+
 package javax.xml.soap;
 
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPException.java b/jaxws/src/share/classes/javax/xml/soap/SOAPException.java
index ef80335..f4ae4e8 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPException.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPException.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPException.java,v 1.5 2004/04/02 01:24:18 ofung Exp $
- * $Revision: 1.5 $
- * $Date: 2004/04/02 01:24:18 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPException.java,v 1.6 2005/04/05 21:03:23 mk125090 Exp $
+ * $Revision: 1.6 $
+ * $Date: 2005/04/05 21:03:23 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPFactory.java b/jaxws/src/share/classes/javax/xml/soap/SOAPFactory.java
index 3e29e984..dff07d8 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPFactory.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPFactory.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPFactory.java,v 1.12 2005/04/05 22:46:26 mk125090 Exp $
- * $Revision: 1.12 $
- * $Datae$
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFactory.java,v 1.13 2005/06/22 10:24:11 vj135062 Exp $
+ * $Revision: 1.13 $
+ * $Datae$
+ */
+
+
 
 package javax.xml.soap;
 
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPFault.java b/jaxws/src/share/classes/javax/xml/soap/SOAPFault.java
index a50de16..1d2087b 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPFault.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPFault.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPFault.java,v 1.19 2005/09/26 21:09:04 mk125090 Exp $
- * $Revision: 1.19 $
- * $Date: 2005/09/26 21:09:04 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFault.java,v 1.20 2006/02/14 04:40:57 vj135062 Exp $
+ * $Revision: 1.20 $
+ * $Date: 2006/02/14 04:40:57 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPFaultElement.java b/jaxws/src/share/classes/javax/xml/soap/SOAPFaultElement.java
index 7323f64..5ed03cf 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPFaultElement.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPFaultElement.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPFaultElement.java,v 1.3 2004/04/02 01:24:18 ofung Exp $
- * $Revision: 1.3 $
- * $Date: 2004/04/02 01:24:18 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPFaultElement.java,v 1.4 2005/04/05 20:53:20 mk125090 Exp $
+ * $Revision: 1.4 $
+ * $Date: 2005/04/05 20:53:20 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPHeader.java b/jaxws/src/share/classes/javax/xml/soap/SOAPHeader.java
index 2781e01..35c986a 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPHeader.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPHeader.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPHeader.java,v 1.5.2.12 2004/11/17 13:59:28 vj135062 Exp $
- * $Revision: 1.5.2.12 $
- * $Date: 2004/11/17 13:59:28 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPHeader.java,v 1.14 2005/04/05 22:46:27 mk125090 Exp $
+ * $Revision: 1.14 $
+ * $Date: 2005/04/05 22:46:27 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPHeaderElement.java b/jaxws/src/share/classes/javax/xml/soap/SOAPHeaderElement.java
index cd3623b..f8dcce4 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPHeaderElement.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPHeaderElement.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPHeaderElement.java,v 1.5.2.11 2005/02/09 07:39:03 vj135062 Exp $
- * $Revision: 1.5.2.11 $
- * $Date: 2005/02/09 07:39:03 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPHeaderElement.java,v 1.9 2005/04/05 22:46:27 mk125090 Exp $
+ * $Revision: 1.9 $
+ * $Date: 2005/04/05 22:46:27 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPMessage.java b/jaxws/src/share/classes/javax/xml/soap/SOAPMessage.java
index 6bc99a7..8fe8491 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPMessage.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPMessage.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPMessage.java,v 1.21 2005/06/21 17:49:12 mk125090 Exp $
- * $Revision: 1.21 $
- * $Date: 2005/06/21 17:49:12 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPMessage.java,v 1.22 2005/08/17 08:13:01 vj135062 Exp $
+ * $Revision: 1.22 $
+ * $Date: 2005/08/17 08:13:01 $
+ */
+
+
 package javax.xml.soap;
 import java.io.OutputStream;
 import java.io.IOException;
diff --git a/jaxws/src/share/classes/javax/xml/soap/SOAPPart.java b/jaxws/src/share/classes/javax/xml/soap/SOAPPart.java
index 26193de..3367ceb 100644
--- a/jaxws/src/share/classes/javax/xml/soap/SOAPPart.java
+++ b/jaxws/src/share/classes/javax/xml/soap/SOAPPart.java
@@ -1,10 +1,4 @@
 /*
- * $Id: SOAPPart.java,v 1.8 2005/06/20 12:07:05 vj135062 Exp $
- * $Revision: 1.8 $
- * $Date: 2005/06/20 12:07:05 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: SOAPPart.java,v 1.9 2005/06/21 17:32:45 mk125090 Exp $
+ * $Revision: 1.9 $
+ * $Date: 2005/06/21 17:32:45 $
+ */
+
+
 package javax.xml.soap;
 
 import java.util.Iterator;
diff --git a/jaxws/src/share/classes/javax/xml/soap/Text.java b/jaxws/src/share/classes/javax/xml/soap/Text.java
index e7492b1..3461dda 100644
--- a/jaxws/src/share/classes/javax/xml/soap/Text.java
+++ b/jaxws/src/share/classes/javax/xml/soap/Text.java
@@ -1,10 +1,4 @@
 /*
- * $Id: Text.java,v 1.2 2004/04/02 01:24:19 ofung Exp $
- * $Revision: 1.2 $
- * $Date: 2004/04/02 01:24:19 $
- */
-
-/*
  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -28,6 +22,13 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
+/*
+ * $Id: Text.java,v 1.3 2005/04/05 20:34:16 mk125090 Exp $
+ * $Revision: 1.3 $
+ * $Date: 2005/04/05 20:34:16 $
+ */
+
+
 package javax.xml.soap;
 
 /**
diff --git a/jaxws/src/share/classes/javax/xml/soap/package.html b/jaxws/src/share/classes/javax/xml/soap/package.html
index 9028815..9fbb05f 100644
--- a/jaxws/src/share/classes/javax/xml/soap/package.html
+++ b/jaxws/src/share/classes/javax/xml/soap/package.html
@@ -1,31 +1,31 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
 <html>
 <head>
-   <!--
-
-Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code 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
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
--->
+   
   <title></title>
 
 </head>
diff --git a/jaxws/src/share/classes/javax/xml/ws/Action.java b/jaxws/src/share/classes/javax/xml/ws/Action.java
new file mode 100644
index 0000000..e98da23
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/Action.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.xml.ws.soap.Addressing;
+
+/**
+
+ * The <code>Action</code> annotation allows explicit association of a
+ * WS-Addressing <code>Action</code> message addressing property with
+ * <code>input</code>, <code>output</code>, and
+ * <code>fault</code> messages of the mapped WSDL operation.
+ * <p>
+ * In this version of JAX-WS there is no standard way to specify
+ * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that,
+ * after the W3C WG on WS-Addressing has defined these items in a recommendation,
+ * a future version of JAX-WS will require the new standards.
+ *
+ * @see Addressing
+ * @see FaultAction
+ *
+ * @since JAX-WS 2.1
+ */
+
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface Action {
+    /**
+     * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>input</code>
+     * message of the operation.
+     */
+    String input() default "";
+
+    /**
+     * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>output</code>
+     * message of the operation.
+     */
+    String output() default "";
+
+    /**
+     * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>fault</code>
+     * message(s) of the operation. Each exception that is mapped to a fault and requires an explicit WS-Addressing
+     * <code>Action</code> message addressing property, needs to be specified as a value in this property
+     * using {@link FaultAction} annotation.
+     */
+    FaultAction[] fault() default { };
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/AsyncHandler.java b/jaxws/src/share/classes/javax/xml/ws/AsyncHandler.java
index b1ff3dc..ccd25c7 100644
--- a/jaxws/src/share/classes/javax/xml/ws/AsyncHandler.java
+++ b/jaxws/src/share/classes/javax/xml/ws/AsyncHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/Binding.java b/jaxws/src/share/classes/javax/xml/ws/Binding.java
index 0c998e9..0ea658f 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Binding.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Binding.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 package javax.xml.ws;
 
+
 /** The <code>Binding</code> interface is the base interface
  *  for JAX-WS protocol bindings.
  *
@@ -32,23 +33,35 @@
 **/
 public interface Binding {
 
-  /** Gets a copy of the handler chain for a protocol binding instance.
-   *  If the returned chain is modified a call to <code>setHandlerChain</code>
-   * is required to configure the binding instance with the new chain.
-   *
-   *  @return java.util.List<javax.xml.ws.handler.HandlerInfo> Handler chain
-  **/
-  public java.util.List<javax.xml.ws.handler.Handler> getHandlerChain();
+   /**
+    * Gets a copy of the handler chain for a protocol binding instance.
+    * If the returned chain is modified a call to <code>setHandlerChain</code>
+    * is required to configure the binding instance with the new chain.
+    *
+    *  @return java.util.List&lt;Handler> Handler chain
+    */
+    public java.util.List<javax.xml.ws.handler.Handler> getHandlerChain();
 
-  /** Sets the handler chain for the protocol binding instance.
-   *
-   *  @param chain    A List of handler configuration entries
-   *  @throws WebServiceException On an error in the configuration of
-   *                  the handler chain
-   *  @throws java.lang.UnsupportedOperationException If this
-   *          operation is not supported. This may be done to
-   *          avoid any overriding of a pre-configured handler
-   *          chain.
-  **/
-  public void setHandlerChain(java.util.List<javax.xml.ws.handler.Handler> chain);
+   /**
+    * Sets the handler chain for the protocol binding instance.
+    *
+    *  @param chain    A List of handler configuration entries
+    *  @throws WebServiceException On an error in the configuration of
+    *                  the handler chain
+    *  @throws java.lang.UnsupportedOperationException If this
+    *          operation is not supported. This may be done to
+    *          avoid any overriding of a pre-configured handler
+    *          chain.
+    */
+    public void setHandlerChain(java.util.List<javax.xml.ws.handler.Handler> chain);
+
+    /**
+     * Get the URI for this binding instance.
+     *
+     * @return String The binding identifier for the port.
+     *    Never returns <code>null</code>
+     *
+     * @since JAX-WS 2.1
+     */
+    String getBindingID();
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/BindingProvider.java b/jaxws/src/share/classes/javax/xml/ws/BindingProvider.java
index 5d3557f..d6eb6a1 100644
--- a/jaxws/src/share/classes/javax/xml/ws/BindingProvider.java
+++ b/jaxws/src/share/classes/javax/xml/ws/BindingProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,77 +26,99 @@
 package javax.xml.ws;
 
 import java.util.Map;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
 
-/** The <code>BindingProvider</code> interface provides access to the
- *  protocol binding and associated context objects for request and
- *  response message processing.
+/**
+ * The <code>BindingProvider</code> interface provides access to the
+ * protocol binding and associated context objects for request and
+ * response message processing.
  *
- *  @since JAX-WS 2.0
+ * @since JAX-WS 2.0
  *
- *  @see javax.xml.ws.Binding
-**/
+ * @see javax.xml.ws.Binding
+ **/
 public interface BindingProvider {
-    /** Standard property: User name for authentication.
-     *  <p>Type: java.lang.String
-    **/
+    /**
+     * Standard property: User name for authentication.
+     * <p>Type: <code>java.lang.String</code>
+     **/
     public static final String USERNAME_PROPERTY =
-                      "javax.xml.ws.security.auth.username";
+            "javax.xml.ws.security.auth.username";
 
-    /** Standard property: Password for authentication.
-     *  <p>Type: java.lang.String
-    **/
+    /**
+     * Standard property: Password for authentication.
+     * <p>Type: <code>java.lang.String</code>
+     **/
     public static final String PASSWORD_PROPERTY =
-                      "javax.xml.ws.security.auth.password";
+            "javax.xml.ws.security.auth.password";
 
-    /** Standard property: Target service endpoint address. The
-     *  URI scheme for the endpoint address specification must
-     *  correspond to the protocol/transport binding for the
-     *  binding in use.
-     *  <p>Type: java.lang.String
-    **/
+    /**
+     * Standard property: Target service endpoint address. The
+     * URI scheme for the endpoint address specification MUST
+     * correspond to the protocol/transport binding for the
+     * binding in use.
+     * <p>Type: <code>java.lang.String</code>
+     **/
     public static final String ENDPOINT_ADDRESS_PROPERTY =
-                      "javax.xml.ws.service.endpoint.address";
+            "javax.xml.ws.service.endpoint.address";
 
-    /** Standard property: This boolean property is used by a service
-     *  client to indicate whether or not it wants to participate in
-     *  a session with a service endpoint. If this property is set to
-     *  true, the service client indicates that it wants the session
-     *  to be maintained. If set to false, the session is not maintained.
-     *  The default value for this property is false.
-     *  <p>Type: java.lang.Boolean
-    **/
+    /**
+     * Standard property: This boolean property is used by a service
+     * client to indicate whether or not it wants to participate in
+     * a session with a service endpoint. If this property is set to
+     * <code>true</code>, the service client indicates that it wants the session
+     * to be maintained. If set to <code>false</code>, the session is not maintained.
+     * The default value for this property is <code>false</code>.
+     * <p>Type: <code>java.lang.Boolean</code>
+     **/
     public static final String SESSION_MAINTAIN_PROPERTY =
-                      "javax.xml.ws.session.maintain";
+            "javax.xml.ws.session.maintain";
 
-    /** Standard property for SOAPAction. This boolean property
-     *  indicates whether or not SOAPAction is to be used. The
-     *  default value of this property is false indicating that
-     *  the SOAPAction is not used.
-     *  <p>Type: <code>java.lang.Boolean</code>
-    **/
+    /**
+     * Standard property for SOAPAction. This boolean property
+     * indicates whether or not the value of the
+     * <code>javax.xml.ws.soap.http.soapaction.uri</code> property
+     * is used for the value of the SOAPAction. The
+     * default value of this property is <code>false</code> indicating
+     * that the
+     * <code>javax.xml.ws.soap.http.soapaction.uri</code> property
+     * is not used for the value of the SOAPAction, however,
+     * if WS-Addressing is enabled, the default value is
+     * <code>true</code>.
+     *
+     * <p>Type: <code>java.lang.Boolean</code>
+     **/
     public static final String SOAPACTION_USE_PROPERTY =
-                      "javax.xml.ws.soap.http.soapaction.use";
+            "javax.xml.ws.soap.http.soapaction.use";
 
-    /** Standard property for SOAPAction. Indicates the SOAPAction
-     *  URI if the <code>javax.xml.ws.soap.http.soapaction.use</code>
-     *  property is set to <code>true</code>.
-     *  <p>Type: <code>java.lang.String</code>
-    **/
+    /**
+     * Standard property for SOAPAction. Indicates the SOAPAction
+     * URI if the <code>javax.xml.ws.soap.http.soapaction.use</code>
+     * property is set to <code>true</code>. If WS-Addressing
+     * is enabled, this value will also be used for the value of the
+     * WS-Addressing Action header.  If this property is not set,
+     * the default SOAPAction and WS-Addressing Action will be sent.
+     *
+     * <p>Type: <code>java.lang.String</code>
+     **/
     public static final String SOAPACTION_URI_PROPERTY =
-                      "javax.xml.ws.soap.http.soapaction.uri";
+            "javax.xml.ws.soap.http.soapaction.uri";
 
-    /** Get the context that is used to initialize the message context
-     *  for request messages.
+    /**
+     * Get the context that is used to initialize the message context
+     * for request messages.
      *
      * Modifications to the request context do not affect the message context of
      * either synchronous or asynchronous operations that have already been
      * started.
      *
      * @return The context that is used in processing request messages.
-    **/
+     **/
     Map<String, Object> getRequestContext();
 
-    /** Get the context that resulted from processing a response message.
+    /**
+     * Get the context that resulted from processing a response message.
      *
      * The returned context is for the most recently completed synchronous
      * operation. Subsequent synchronous operation invocations overwrite the
@@ -105,12 +127,57 @@
      *
      * @return The context that resulted from processing the latest
      * response messages.
-    **/
+     **/
     Map<String, Object> getResponseContext();
 
-    /** Get the Binding for this binding provider.
+    /**
+     * Get the Binding for this binding provider.
      *
      * @return The Binding for this binding provider.
-    **/
+     **/
     Binding getBinding();
+
+
+
+    /**
+     * Returns the <code>EndpointReference</code> associated with
+     * this <code>BindingProvider</code> instance.
+     * <p>
+     * If the Binding for this <code>bindingProvider</code> is
+     * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
+     * <code>W3CEndpointReference</code> MUST be returned.
+     *
+     * @return EndpointReference of the target endpoint associated with this
+     * <code>BindingProvider</code> instance.
+     *
+     * @throws java.lang.UnsupportedOperationException If this
+     * <code>BindingProvider</code> uses the XML/HTTP binding.
+     *
+     * @see W3CEndpointReference
+     *
+     * @since JAX-WS 2.1
+     */
+    public EndpointReference getEndpointReference();
+
+
+    /**
+     * Returns the <code>EndpointReference</code> associated with
+     * this <code>BindingProvider</code> instance.  The instance
+     * returned will be of type <code>clazz</code>.
+     *
+     * @param clazz Specifies the type of <code>EndpointReference</code>
+     * that MUST be returned.
+
+     * @return EndpointReference of the target endpoint associated with this
+     * <code>BindingProvider</code> instance. MUST be of type
+     * <code>clazz</code>.
+
+     * @throws WebServiceException If the Class <code>clazz</code>
+     * is not supported by this implementation.
+     * @throws java.lang.UnsupportedOperationException If this
+     * <code>BindingProvider</code> uses the XML/HTTP binding.
+     *
+     * @since JAX-WS 2.1
+     */
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/BindingType.java b/jaxws/src/share/classes/javax/xml/ws/BindingType.java
index da1f23c..04c9352 100644
--- a/jaxws/src/share/classes/javax/xml/ws/BindingType.java
+++ b/jaxws/src/share/classes/javax/xml/ws/BindingType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/Dispatch.java b/jaxws/src/share/classes/javax/xml/ws/Dispatch.java
index 12ce6d3..56e693c 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Dispatch.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Dispatch.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
      *  method returns without waiting for the response to the operation
      *  invocation, the results of the operation are obtained by polling the
      *  returned <code>Response</code>.
-     *
+     * <p>
      * The client is responsible for ensuring that the <code>msg</code> object
      * when marshalled is formed according to the requirements of the protocol
      * binding in use.
@@ -75,8 +75,8 @@
     /** Invoke a service operation asynchronously. The
      *  method returns without waiting for the response to the operation
      *  invocation, the results of the operation are communicated to the client
-     *  via the passed in handler.
-     *
+     *  via the passed in <code>handler</code>.
+     * <p>
      * The client is responsible for ensuring that the <code>msg</code> object
      * when marshalled is formed according to the requirements of the protocol
      * binding in use.
@@ -86,9 +86,9 @@
      * @param handler The handler object that will receive the
      *     response to the operation invocation.
      * @return A <code>Future</code> object that may be used to check the status
-     *     of the operation invocation. This object must not be used to try to
+     *     of the operation invocation. This object MUST NOT be used to try to
      *     obtain the results of the operation - the object returned from
-     *     <code>Future<?>.get()</code> is implementation dependent
+     *     <code>Future&lt;?>.get()</code> is implementation dependent
      *     and any use of it will result in non-portable behaviour.
      * @throws WebServiceException If there is any error in the configuration of
      *     the <code>Dispatch</code> instance
@@ -99,9 +99,9 @@
      *  interaction mode. The operation invocation is logically non-blocking,
      *  subject to the capabilities of the underlying protocol, no results
      *  are returned. When
-     *  the protocol in use is SOAP/HTTP, this method must block until
+     *  the protocol in use is SOAP/HTTP, this method MUST block until
      *  an HTTP response code has been received or an error occurs.
-     *
+     * <p>
      * The client is responsible for ensuring that the <code>msg</code> object
      * when marshalled is formed according to the requirements of the protocol
      * binding in use.
diff --git a/jaxws/src/share/classes/javax/xml/ws/Endpoint.java b/jaxws/src/share/classes/javax/xml/ws/Endpoint.java
index 7b79fce..6701522 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Endpoint.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Endpoint.java
@@ -28,6 +28,9 @@
 import java.util.List;
 import java.util.Map;
 import javax.xml.ws.spi.Provider;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
+
 
 /**
  * A Web service endpoint.
@@ -54,7 +57,7 @@
  * <p>An endpoint may have a list of metadata documents, such as WSDL
  * and XMLSchema documents, bound to it. At publishing time, the
  * JAX-WS implementation will try to reuse as much of that metadata
- * as possible instead of generating new one based on the annotations
+ * as possible instead of generating new ones based on the annotations
  * present on the implementor.
  *
  * @since JAX-WS 2.0
@@ -64,209 +67,225 @@
  * @see javax.xml.ws.soap.SOAPBinding
  * @see java.util.concurrent.Executor
  *
-**/
+ **/
 public abstract class Endpoint {
 
-  /** Standard property: name of WSDL service.
-   *  <p>Type: javax.xml.namespace.QName
-   **/
-  public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
+    /** Standard property: name of WSDL service.
+     *  <p>Type: javax.xml.namespace.QName
+     **/
+    public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
 
-  /** Standard property: name of WSDL port.
-   *  <p>Type: javax.xml.namespace.QName
-   **/
-  public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
+    /** Standard property: name of WSDL port.
+     *  <p>Type: javax.xml.namespace.QName
+     **/
+    public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
 
 
-  /**
-   * Creates an endpoint with the specified implementor object. If there is
-   * a binding specified via a BindingType annotation then it MUST be used else
-   * a default of SOAP 1.1 / HTTP binding MUST be used.
-   * <p>
-   * The newly created endpoint may be published by calling
-   * one of the javax.xml.ws.Endpoint#publish(String) and
-   * javax.xml.ws.Endpoint#publish(Object) methods.
-   *
-   *
-   * @param implementor The endpoint implementor.
-   *
-   * @return The newly created endpoint.
-   *
-   **/
-  public static Endpoint create(Object implementor) {
-    return create(null, implementor);
-  }
+    /**
+     * Creates an endpoint with the specified implementor object. If there is
+     * a binding specified via a BindingType annotation then it MUST be used else
+     * a default of SOAP 1.1 / HTTP binding MUST be used.
+     * <p>
+     * The newly created endpoint may be published by calling
+     * one of the {@link javax.xml.ws.Endpoint#publish(String)} and
+     * {@link javax.xml.ws.Endpoint#publish(Object)} methods.
+     *
+     *
+     * @param implementor The endpoint implementor.
+     *
+     * @return The newly created endpoint.
+     *
+     **/
+    public static Endpoint create(Object implementor) {
+        return create(null, implementor);
+    }
 
-  /**
-   * Creates an endpoint with the specified binding type and
-   * implementor object.
-   * <p>
-   * The newly created endpoint may be published by calling
-   * one of the javax.xml.ws.Endpoint#publish(String) and
-   * javax.xml.ws.Endpoint#publish(Object) methods.
-   *
-   * @param bindingId A URI specifying the binding to use. If the bindingID is
-   * <code>null</code> and no binding is specified via a BindingType
-   * annotation then a default SOAP 1.1 / HTTP binding MUST be used.
-   *
-   * @param implementor The endpoint implementor.
-   *
-   * @return The newly created endpoint.
-   *
-   **/
-  public static Endpoint create(String bindingId, Object implementor) {
-    return Provider.provider().createEndpoint(bindingId, implementor);
-  }
+    /**
+     * Creates an endpoint with the specified binding type and
+     * implementor object.
+     * <p>
+     * The newly created endpoint may be published by calling
+     * one of the {@link javax.xml.ws.Endpoint#publish(String)} and
+     * {@link javax.xml.ws.Endpoint#publish(Object)} methods.
+     *
+     * @param bindingId A URI specifying the binding to use. If the bindingID is
+     * <code>null</code> and no binding is specified via a BindingType
+     * annotation then a default SOAP 1.1 / HTTP binding MUST be used.
+     *
+     * @param implementor The endpoint implementor.
+     *
+     * @return The newly created endpoint.
+     *
+     **/
+    public static Endpoint create(String bindingId, Object implementor) {
+        return Provider.provider().createEndpoint(bindingId, implementor);
+    }
 
-  /**
-   * Returns the binding for this endpoint.
-   *
-   * @return The binding for this endpoint
-  **/
-  public abstract Binding getBinding();
 
-  /**
-   * Returns the implementation object for this endpoint.
-   *
-   * @return The implementor for this endpoint
-  **/
-  public abstract Object getImplementor();
+    /**
+     * Returns the binding for this endpoint.
+     *
+     * @return The binding for this endpoint
+     **/
+    public abstract Binding getBinding();
 
-  /**
-   * Publishes this endpoint at the given address.
-   * The necessary server infrastructure will be created and
-   * configured by the JAX-WS implementation using some default configuration.
-   * In order to get more control over the server configuration, please
-   * use the javax.xml.ws.Endpoint#publish(Object) method instead.
-   *
-   * @param address A URI specifying the address to use. The address
-   *        must be compatible with the binding specified at the
-   *        time the endpoint was created.
-   *
-   * @throws java.lang.IllegalArgumentException
-   *              If the provided address URI is not usable
-   *              in conjunction with the endpoint's binding.
-   *
-   * @throws java.lang.IllegalStateException
-   *         If the endpoint has been published already or it has been stopped.
-  **/
-  public abstract void publish(String address);
+    /**
+     * Returns the implementation object for this endpoint.
+     *
+     * @return The implementor for this endpoint
+     **/
+    public abstract Object getImplementor();
 
-  /**
-   * Creates and publishes an endpoint for the specified implementor
-   * object at the given address.
-   * <p>
-   * The necessary server infrastructure will be created and
-   * configured by the JAX-WS implementation using some default configuration.
-   *
-   * In order to get more control over the server configuration, please
-   * use the javax.xml.ws.Endpoint#create(String,Object) and
-   * javax.xml.ws.Endpoint#publish(Object) method instead.
-   *
-   * @param address A URI specifying the address and transport/protocol
-   *        to use. A http: URI must result in the SOAP 1.1/HTTP
-   *        binding being used. Implementations may support other
-   *        URI schemes.
-   * @param implementor The endpoint implementor.
-   *
-   * @return The newly created endpoint.
-   *
-   **/
-  public static Endpoint publish (String address, Object implementor) {
-    return Provider.provider().createAndPublishEndpoint(address, implementor);
-  }
+    /**
+     * Publishes this endpoint at the given address.
+     * The necessary server infrastructure will be created and
+     * configured by the JAX-WS implementation using some default configuration.
+     * In order to get more control over the server configuration, please
+     * use the {@link javax.xml.ws.Endpoint#publish(Object)} method instead.
+     *
+     * @param address A URI specifying the address to use. The address
+     *        MUST be compatible with the binding specified at the
+     *        time the endpoint was created.
+     *
+     * @throws java.lang.IllegalArgumentException
+     *          If the provided address URI is not usable
+     *          in conjunction with the endpoint's binding.
+     *
+     * @throws java.lang.IllegalStateException
+     *          If the endpoint has been published already or it has been stopped.
+     *
+     * @throws java.lang.SecurityException
+     *          If a <code>java.lang.SecurityManger</code>
+     *          is being used and the application doesn't have the
+     *          <code>WebServicePermission("publishEndpoint")</code> permission.
+     **/
+    public abstract void publish(String address);
 
-  /**
-   * Publishes this endpoint at the provided server context.
-   * A server context encapsulates the server infrastructure
-   * and addressing information for a particular transport.
-   * For a call to this method to succeed, the server context
-   * passed as an argument to it must be compatible with the
-   * endpoint's binding.
-   *
-   * @param serverContext An object representing a server
-   *           context to be used for publishing the endpoint.
-   *
-   * @throws java.lang.IllegalArgumentException
-   *              If the provided server context is not
-   *              supported by the implementation or turns
-   *              out to be unusable in conjunction with the
-   *              endpoint's binding.
-   *
-   * @throws java.lang.IllegalStateException
-   *         If the endpoint has been published already or it has been stopped.
-  **/
-  public abstract void publish(Object serverContext);
+    /**
+     * Creates and publishes an endpoint for the specified implementor
+     * object at the given address.
+     * <p>
+     * The necessary server infrastructure will be created and
+     * configured by the JAX-WS implementation using some default configuration.
+     *
+     * In order to get more control over the server configuration, please
+     * use the {@link javax.xml.ws.Endpoint#create(String,Object)} and
+     * {@link javax.xml.ws.Endpoint#publish(Object)} methods instead.
+     *
+     * @param address A URI specifying the address and transport/protocol
+     *        to use. A http: URI MUST result in the SOAP 1.1/HTTP
+     *        binding being used. Implementations may support other
+     *        URI schemes.
+     * @param implementor The endpoint implementor.
+     *
+     * @return The newly created endpoint.
+     *
+     * @throws java.lang.SecurityException
+     *          If a <code>java.lang.SecurityManger</code>
+     *          is being used and the application doesn't have the
+     *          <code>WebServicePermission("publishEndpoint")</code> permission.
+     *
+     **/
+    public static Endpoint publish(String address, Object implementor) {
+        return Provider.provider().createAndPublishEndpoint(address, implementor);
+    }
 
-  /**
-   * Stops publishing this endpoint.
-   *
-   * If the endpoint is not in a published state, this method
-   * has not effect.
-   *
-  **/
-  public abstract void stop();
+    /**
+     * Publishes this endpoint at the provided server context.
+     * A server context encapsulates the server infrastructure
+     * and addressing information for a particular transport.
+     * For a call to this method to succeed, the server context
+     * passed as an argument to it MUST be compatible with the
+     * endpoint's binding.
+     *
+     * @param serverContext An object representing a server
+     *           context to be used for publishing the endpoint.
+     *
+     * @throws java.lang.IllegalArgumentException
+     *              If the provided server context is not
+     *              supported by the implementation or turns
+     *              out to be unusable in conjunction with the
+     *              endpoint's binding.
+     *
+     * @throws java.lang.IllegalStateException
+     *         If the endpoint has been published already or it has been stopped.
+     *
+     * @throws java.lang.SecurityException
+     *          If a <code>java.lang.SecurityManger</code>
+     *          is being used and the application doesn't have the
+     *          <code>WebServicePermission("publishEndpoint")</code> permission.
+     **/
+    public abstract void publish(Object serverContext);
 
-  /**
-   * Returns true if the endpoint is in the published state.
-   *
-   * @return <code>true</code> if the endpoint is in the published state.
-  **/
-  public abstract boolean isPublished();
+    /**
+     * Stops publishing this endpoint.
+     *
+     * If the endpoint is not in a published state, this method
+     * has no effect.
+     *
+     **/
+    public abstract void stop();
 
-  /**
-   * Returns a list of metadata documents for the service.
-   *
-   * @return <code>List&lt;javax.xml.transform.Source&gt;</code> A list of metadata documents for the service
-  **/
-  public abstract List<javax.xml.transform.Source> getMetadata();
+    /**
+     * Returns true if the endpoint is in the published state.
+     *
+     * @return <code>true</code> if the endpoint is in the published state.
+     **/
+    public abstract boolean isPublished();
 
-  /**
-   * Sets the metadata for this endpoint.
-   *
-   * @param metadata A list of XML document sources containing
-   *           metadata information for the endpoint (e.g.
-   *           WSDL or XML Schema documents)
-   *
-   * @throws java.lang.IllegalStateException If the endpoint
-   *         has already been published.
-  **/
-  public abstract void setMetadata(List<javax.xml.transform.Source> metadata);
+    /**
+     * Returns a list of metadata documents for the service.
+     *
+     * @return <code>List&lt;javax.xml.transform.Source&gt;</code> A list of metadata documents for the service
+     **/
+    public abstract List<javax.xml.transform.Source> getMetadata();
 
-  /**
-   * Returns the executor for this <code>Endpoint</code>instance.
-   *
-   * The executor is used to dispatch an incoming request to
-   * the implementor object.
-   *
-   * @return The <code>java.util.concurrent.Executor</code> to be
-   *         used to dispatch a request.
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public abstract java.util.concurrent.Executor getExecutor();
+    /**
+     * Sets the metadata for this endpoint.
+     *
+     * @param metadata A list of XML document sources containing
+     *           metadata information for the endpoint (e.g.
+     *           WSDL or XML Schema documents)
+     *
+     * @throws java.lang.IllegalStateException  If the endpoint
+     *         has already been published.
+     **/
+    public abstract void setMetadata(List<javax.xml.transform.Source> metadata);
 
-  /**
-   * Sets the executor for this <code>Endpoint</code> instance.
-   *
-   * The executor is used to dispatch an incoming request to
-   * the implementor object.
-   *
-   * If this <code>Endpoint</code> is published using the
-   * <code>publish(Object)</code> method and the specified server
-   * context defines its own threading behavior, the executor
-   * may be ignored.
-   *
-   * @param executor The <code>java.util.concurrent.Executor</code>
-   *        to be used to dispatch a request.
-   *
-   * @throws SecurityException If the instance does not support
-   *         setting an executor for security reasons (e.g. the
-   *         necessary permissions are missing).
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public abstract void setExecutor(java.util.concurrent.Executor executor);
+    /**
+     * Returns the executor for this <code>Endpoint</code>instance.
+     *
+     * The executor is used to dispatch an incoming request to
+     * the implementor object.
+     *
+     * @return The <code>java.util.concurrent.Executor</code> to be
+     *         used to dispatch a request.
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public abstract java.util.concurrent.Executor getExecutor();
+
+    /**
+     * Sets the executor for this <code>Endpoint</code> instance.
+     *
+     * The executor is used to dispatch an incoming request to
+     * the implementor object.
+     *
+     * If this <code>Endpoint</code> is published using the
+     * <code>publish(Object)</code> method and the specified server
+     * context defines its own threading behavior, the executor
+     * may be ignored.
+     *
+     * @param executor The <code>java.util.concurrent.Executor</code>
+     *        to be used to dispatch a request.
+     *
+     * @throws SecurityException  If the instance does not support
+     *         setting an executor for security reasons (e.g. the
+     *         necessary permissions are missing).
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public abstract void setExecutor(java.util.concurrent.Executor executor);
 
 
     /**
@@ -275,7 +294,7 @@
      * @return Map&lt;String,Object&gt; The property bag
      *         associated with this instance.
      **/
-     public abstract Map<String,Object> getProperties();
+    public abstract Map<String,Object> getProperties();
 
     /**
      * Sets the property bag for this <code>Endpoint</code> instance.
@@ -283,5 +302,59 @@
      * @param properties The property bag associated with
      *        this instance.
      **/
-     public abstract void setProperties(Map<String,Object> properties);
+    public abstract void setProperties(Map<String,Object> properties);
+
+    /**
+     * Returns the <code>EndpointReference</code> associated with
+     * this <code>Endpoint</code> instance.
+     * <p>
+     * If the Binding for this <code>bindingProvider</code> is
+     * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
+     * <code>W3CEndpointReference</code> MUST be returned.
+     *
+     * @param referenceParameters Reference parameters to be associated with the
+     * returned <code>EndpointReference</code> instance.
+     * @return EndpointReference of this <code>Endpoint</code> instance.
+     * If the returned <code>EndpointReference</code> is of type
+     * <code>W3CEndpointReference</code> then it MUST contain the
+     * the specified <code>referenceParameters</code>.
+
+     * @throws WebServiceException If any error in the creation of
+     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+     * not in the published state.
+     * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+     * uses the XML/HTTP binding.
+     *
+     * @see W3CEndpointReference
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract EndpointReference getEndpointReference(Element... referenceParameters);
+
+
+    /**
+     * Returns the <code>EndpointReference</code> associated with
+     * this <code>Endpoint</code> instance.
+     *
+     * @param clazz Specifies the type of EndpointReference  that MUST be returned.
+     * @param referenceParameters Reference parameters to be associated with the
+     * returned <code>EndpointReference</code> instance.
+     * @return EndpointReference of type <code>clazz</code> of this
+     * <code>Endpoint<code> instance.
+     * If the returned <code>EndpointReference</code> is of type
+     * <code>W3CEndpointReference</code> then it MUST contain the
+     * the specified <code>referenceParameters</code>.
+
+     * @throws WebServiceException If any error in the creation of
+     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+     * not in the published state or if the <code>clazz</code> is not a supported
+     * <code>EndpointReference</code> type.
+     * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+     * uses the XML/HTTP binding.
+     *
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
+            Element... referenceParameters);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/EndpointReference.java b/jaxws/src/share/classes/javax/xml/ws/EndpointReference.java
new file mode 100644
index 0000000..46fd6da
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/EndpointReference.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.spi.Provider;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.StringWriter;
+
+/**
+ * This class represents an WS-Addressing EndpointReference
+ * which is a remote reference to a web service endpoint.
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+ * Web Services Addressing 1.0 - Core</a>
+ * for more information on WS-Addressing EndpointReferences.
+ * <p>
+ * This class is immutable as the typical web service developer
+ * need not be concerned with its contents.  The web service
+ * developer should use this class strictly as a mechanism to
+ * reference a remote web service endpoint. See the {@link Service} APIs
+ * that clients can use to that utilize an <code>EndpointReference</code>.
+ * See the {@link javax.xml.ws.Endpoint}, and
+ * {@link javax.xml.ws.BindingProvider} APIs on how
+ * <code>EndpointReferences</code> can be created for published
+ * endpoints.
+ * <p>
+ * Concrete implementations of this class will represent
+ * an <code>EndpointReference</code> for a particular version of Addressing.
+ * For example the {@link W3CEndpointReference} is for use
+ * with W3C Web Services Addressing 1.0 - Core Recommendation.
+ * If JAX-WS implementors need to support different versions
+ * of addressing, they should write their own
+ * <code>EndpointReference</code> subclass for that version.
+ * This will allow a JAX-WS implementation to create
+ * vendor specific <code>EndpointReferences</code> that that
+ * vendor can use to flag a different version of
+ * addressing.
+ * <p>
+ * Web service developers that wish to pass or return
+ * <code>EndpointReferences</code> in Java methods in an
+ * SEI should use
+ * concrete instances of an <code>EndpointReference</code> such
+ * as the <code>W3CEndpointReference</code>.  This way the
+ * schema mapped from the SEI will be more descriptive of the
+ * type of endpoint reference being passed.
+ * <p>
+ * JAX-WS implementors are expected to extract the XML infoset
+ * from an <CODE>EndpointReferece</CODE> using the
+ * <code>{@link EndpointReference#writeTo}</code>
+ * method.
+ * <p>
+ * JAXB will bind this class to xs:anyType. If a better binding
+ * is desired, web services developers should use a concrete
+ * subclass such as {@link W3CEndpointReference}.
+ *
+ * @see W3CEndpointReference
+ * @see Service
+ * @since JAX-WS 2.1
+ */
+@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
+public abstract class EndpointReference {
+    //
+    //Default constructor to be only called by derived types.
+    //
+    protected EndpointReference(){};
+
+    /**
+     * Factory method to read an EndpointReference from the infoset contained in
+     * <code>eprInfoset</code>. This method delegates to the vendor specific
+     * implementation of the {@link javax.xml.ws.spi.Provider#readEndpointReference} method.
+     *
+     * @param eprInfoset The <code>EndpointReference<code> infoset to be unmarshalled
+     *
+     * @return the EndpointReference unmarshalled from <code>eprInfoset</code>
+     *    never <code>null</code>
+     * @throws WebServiceException
+     *    if an error occurs while creating the
+     *    <code>EndpointReference</code> from the <CODE>eprInfoset</CODE>
+     * @throws java.lang.IllegalArgumentException
+     *     if the <code>null</code> <code>eprInfoset</tt> value is given.
+     */
+    public static EndpointReference readFrom(Source eprInfoset) {
+        return Provider.provider().readEndpointReference(eprInfoset);
+    }
+
+    /**
+     * write this <code>EndpointReference</code> to the specified infoset format
+     * @throws WebServiceException
+     *   if there is an error writing the
+     *   <code>EndpointReference</code> to the specified <code>result</code>.
+     *
+     * @throws java.lang.IllegalArgumentException
+     *      If the <code>null</code> <code>result</tt> value is given.
+     */
+    public abstract void writeTo(Result result);
+
+
+    /**
+     * The <code>getPort</code> method returns a proxy. If there
+     * are any reference parameters in the
+     * <code>EndpointReference</code> instance, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The parameter  <code>serviceEndpointInterface</code> specifies
+     * the service endpoint interface that is supported by the
+     * returned proxy.
+     * The <code>EndpointReference</code> instance specifies the
+     * endpoint that will be invoked by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly from
+     * the WSDL Metadata from this <code>EndpointReference</code> or from
+     * annotations on the <code>serviceEndpointInterface</code>.  For this method
+     * to successfully return a proxy, WSDL metadata MUST be available and the
+     * <code>EndpointReference</code> instance MUST contain an implementation understood
+     * <code>serviceName</code> metadata.
+     * <p>
+     * Because this port is not created from a <code>Service</code> object, handlers
+     * will not automatically be configured, and the <code>HandlerResolver</code>
+     * and <code>Executor</code> cannot be get or set for this port. The
+     * <code>BindingProvider().getBinding().setHandlerChain()</code>
+     * method can be used to manually configure handlers for this port.
+     *
+     *
+     * @param serviceEndpointInterface Service endpoint interface
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that supports the
+     *                  specified service endpoint interface
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method
+     *                  <LI>If this
+     *                      <code>endpointReference</code>
+     *                      is invalid
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified
+     *                  <LI>If a feature is enabled that is not compatible with
+     *                      this port or is unsupported.
+     *                   </UL>
+     *
+     * @see java.lang.reflect.Proxy
+     * @see WebServiceFeature
+     **/
+    public <T> T getPort(Class<T> serviceEndpointInterface,
+                         WebServiceFeature... features) {
+        return Provider.provider().getPort(this, serviceEndpointInterface,
+                                           features);
+    }
+
+    /**
+     * Displays EPR infoset for debugging convenience.
+     */
+    public String toString() {
+        StringWriter w = new StringWriter();
+        writeTo(new StreamResult(w));
+        return w.toString();
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/FaultAction.java b/jaxws/src/share/classes/javax/xml/ws/FaultAction.java
new file mode 100644
index 0000000..c73ed52
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/FaultAction.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * The <code>FaultAction</code> annotation is used inside an {@link Action}
+ * annotation to allow an explicit association of a WS-Addressing
+ * <code>Action</code> message addressing property with the <code>fault</code>
+ * messages of the WSDL operation mapped from the exception class.
+ * <p>
+ * In this version of JAX-WS there is no standard way to specify
+ * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that,
+ * after the W3C WG on WS-Addressing has defined these items in a recommendation,
+ * a future version of JAX-WS will require the new standards.
+ *
+ * @see Action
+ *
+ * @since JAX-WS 2.1
+ */
+
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface FaultAction {
+    /**
+     * Name of the exception class
+     */
+    Class className();
+
+    /**
+     * Value of WS-Addressing <code>Action</code> message addressing property for the exception
+     */
+    String value() default "";
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/Holder.java b/jaxws/src/share/classes/javax/xml/ws/Holder.java
index 091dac4..8911923 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Holder.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Holder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/LogicalMessage.java b/jaxws/src/share/classes/javax/xml/ws/LogicalMessage.java
index b166a59..de4d189 100644
--- a/jaxws/src/share/classes/javax/xml/ws/LogicalMessage.java
+++ b/jaxws/src/share/classes/javax/xml/ws/LogicalMessage.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,16 +38,17 @@
 
   /** Gets the message payload as an XML source, may be called
    *  multiple times on the same LogicalMessage instance, always
-   *  returns a new Source that may be used to retrieve the entire
+   *  returns a new <code>Source</code> that may be used to retrieve the entire
    *  message payload.
    *
-   *  <p>If the returned Source is an instance of DOMSource, then
+   *  <p>If the returned <code>Source</code> is an instance of
+   *  <code>DOMSource</code>, then
    *  modifications to the encapsulated DOM tree change the message
    *  payload in-place, there is no need to susequently call
-   *  <code>setPayload</code>. Other types of Source provide only
+   *  <code>setPayload</code>. Other types of <code>Source</code> provide only
    *  read access to the message payload.
    *
-   *  @return The contained message payload; returns null if no
+   *  @return The contained message payload; returns <code>null</code> if no
    *          payload is present in this message.
   **/
   public Source getPayload();
@@ -68,7 +69,7 @@
    *
    *  @param  context The JAXBContext that should be used to unmarshall
    *          the message payload
-   *  @return The contained message payload; returns null if no
+   *  @return The contained message payload; returns <code>null</code> if no
    *          payload is present in this message
    *  @throws WebServiceException If an error occurs when using a supplied
    *     JAXBContext to unmarshall the payload. The cause of
diff --git a/jaxws/src/share/classes/javax/xml/ws/ProtocolException.java b/jaxws/src/share/classes/javax/xml/ws/ProtocolException.java
index 7d5883d..2479ec4 100644
--- a/jaxws/src/share/classes/javax/xml/ws/ProtocolException.java
+++ b/jaxws/src/share/classes/javax/xml/ws/ProtocolException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,9 +34,9 @@
 **/
 public class ProtocolException extends WebServiceException {
     /**
-     * Constructs a new protocol exception with null as its detail message. The
+     * Constructs a new protocol exception with <code>null</code> as its detail message. The
      * cause is not initialized, and may subsequently be initialized by a call
-     * to Throwable.initCause(java.lang.Throwable).
+     * to <code>Throwable.initCause(java.lang.Throwable)</code>.
      */
     public ProtocolException() {
         super();
@@ -45,7 +45,7 @@
     /**
      * Constructs a new protocol exception with the specified detail message.
      * The cause is not initialized, and may subsequently be initialized by a
-     * call to Throwable.initCause(java.lang.Throwable).
+     * call to <code>Throwable.initCause(java.lang.Throwable)</code>.
      *
      * @param message the detail message. The detail message is saved for later
      *   retrieval by the Throwable.getMessage() method.
@@ -64,7 +64,7 @@
      * @param message the detail message (which is saved for later retrieval  by
      *   the Throwable.getMessage() method).
      * @param cause the cause (which is saved for later retrieval by the
-     * Throwable.getCause() method). (A null value is  permitted, and indicates
+     * <code>Throwable.getCause()</code> method). (A <code>null</code> value is  permitted, and indicates
      * that the cause is nonexistent or  unknown.)
      */
     public ProtocolException(String message,  Throwable cause) {
@@ -73,13 +73,13 @@
 
     /**
      * Constructs a new runtime exception with the specified cause and a  detail
-     * message of (cause==null ? null : cause.toString())  (which typically
+     * message of <code>(cause==null ? null : cause.toString())</code>  (which typically
      * contains the class and detail message of  cause). This constructor is
      * useful for runtime exceptions  that are little more than wrappers for
      * other throwables.
      *
      * @param cause the cause (which is saved for later retrieval by the
-     * Throwable.getCause() method). (A null value is  permitted, and indicates
+     * <code>Throwable.getCause()</code> method). (A <code>null</code> value is  permitted, and indicates
      * that the cause is nonexistent or  unknown.)
      */
     public ProtocolException(Throwable cause) {
diff --git a/jaxws/src/share/classes/javax/xml/ws/Provider.java b/jaxws/src/share/classes/javax/xml/ws/Provider.java
index ffb9e08..dc0c0b5 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Provider.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Provider.java
@@ -50,11 +50,11 @@
    *  message.
    *
    *  @param  request The request message or message payload.
-   *  @return The response message or message payload. May be null if
+   *  @return The response message or message payload. May be <code>null</code> if
               there is no response.
-   *  @throws WebServiceException if there is an error processing request.
-   *          The cause of the WebServiceException may be set to a subclass
-   *          of ProtocolException to control the protocol level
+   *  @throws WebServiceException If there is an error processing request.
+   *          The cause of the <code>WebServiceException</code> may be set to a subclass
+   *          of <code>ProtocolException</code> to control the protocol level
    *          representation of the exception.
    *  @see javax.xml.ws.handler.MessageContext
    *  @see javax.xml.ws.ProtocolException
diff --git a/jaxws/src/share/classes/javax/xml/ws/RequestWrapper.java b/jaxws/src/share/classes/javax/xml/ws/RequestWrapper.java
index 65efff7a..4d91745 100644
--- a/jaxws/src/share/classes/javax/xml/ws/RequestWrapper.java
+++ b/jaxws/src/share/classes/javax/xml/ws/RequestWrapper.java
@@ -34,11 +34,11 @@
 /**
 
  * Used to annotate methods in the Service Endpoint Interface with the request
- * wrapper bean to be used at runtime. The default value of the localName is
- * the operationName, as defined in WebMethod annotation and the
- * targetNamespace is the target namespace of the SEI.
+ * wrapper bean to be used at runtime. The default value of the <code>localName</code> is
+ * the <code>operationName</code>, as defined in <code>WebMethod</code> annotation and the
+ * <code>targetNamespace</code> is the target namespace of the SEI.
  * <p> When starting from Java this annotation is used resolve
- * overloading conflicts in document literal mode. Only the className
+ * overloading conflicts in document literal mode. Only the <code>className</code>
  * is required in this case.
  *
  *  @since JAX-WS 2.0
@@ -49,12 +49,12 @@
 @Documented
 public @interface RequestWrapper {
   /**
-   *  Elements local name.
+   *  Element's local name.
   **/
   public String localName() default "";
 
   /**
-   *  Elements namespace name.
+   *  Element's namespace name.
   **/
   public String targetNamespace() default "";
 
diff --git a/jaxws/src/share/classes/javax/xml/ws/RespectBinding.java b/jaxws/src/share/classes/javax/xml/ws/RespectBinding.java
new file mode 100644
index 0000000..6caed28
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/RespectBinding.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+
+/**
+ * This feature clarifies the use of the <code>wsdl:binding</code>
+ * in a JAX-WS runtime.
+ * <p>
+ * This feature is only useful with web services that have an
+ * associated WSDL. Enabling this feature requires that a JAX-WS
+ * implementation inspect the <code>wsdl:binding</code> for an
+ * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
+ * that have the <code>required</code> attribute set to <code>true</code>
+ * are understood and are being used.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+ *  required <code>wsdl:binding</code> extensions are either understood
+ *  and used by the runtime, or explicitly disabled by the web service
+ *  application.  A web service application can disable a particular
+ *  extension that has a known WebServiceFeature using either the appropriate
+ *  annotation associated with that WebServiceFeature on the server, or one of
+ *  the following methods on the client:
+ *    <ul>
+ *      <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+ *      <li>{@link Service#getPort(Class,WebServiceFeature...)}
+ *      <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(QName,Class,Service.Mode mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(EndpointReference,Class,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(QName,JAXBContext,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(EndpointReference,JAXBContext,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
+ *      <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
+ *          generated <code>Service</code>.
+ *    </ul>
+ *    The runtime MUST also make sure that binding of
+ *    SEI parameters/return values respect the <code>wsdl:binding</code>.
+ *    With this feature enabled, if a required (<code>wsdl:required="true"</code>)
+ *    <code>wsdl:binding</code> extension is in the WSDL and it is not
+ *    supported by a JAX-WS runtime and it has not
+ *    been explicitly turned off by the web service developer, then
+ *    that JAX-WS runtime MUST behave appropriately based on whether it is
+ *    on the client or server:
+ *    <UL>
+ *      <li>Client: runtime MUST throw a
+ *      <code>WebServiceException</code> no sooner than when one of the methods
+ *      above is invoked but no later than the first invocation of an endpoint
+ *      operation.
+ *      <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
+ *    </ul>
+ *  <li> DISABLED: In this Mode, an implementation may choose whether
+ *  to inspect the <code>wsdl:binding<code> or not and to what degree
+ *  the <code>wsdl:binding</code> will be inspected.  For example,
+ *  one implementation may choose to behave as if this feature is enabled,
+ *  another implementation may only choose to verify the SEI's
+ *  parameter/return type bindings.
+ * </ul>
+ *
+ * @see javax.xml.ws.RespectBindingFeature
+ *
+ * @since JAX-WS 2.1
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@WebServiceFeatureAnnotation(id=RespectBindingFeature.ID,bean=RespectBindingFeature.class)
+public @interface RespectBinding {
+    /**
+     * Specifies if this feature is enabled or disabled.
+     */
+    boolean enabled() default true;
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/RespectBindingFeature.java b/jaxws/src/share/classes/javax/xml/ws/RespectBindingFeature.java
new file mode 100644
index 0000000..e30553f
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/RespectBindingFeature.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
+
+/**
+ * This feature clarifies the use of the <code>wsdl:binding</code>
+ * in a JAX-WS runtime.
+ * <p>
+ * This feature is only useful with web services that have an
+ * associated WSDL. Enabling this feature requires that a JAX-WS
+ * implementation inspect the <code>wsdl:binding</code> for an
+ * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
+ * that have the <code>required</code> attribute set to <code>true</code>
+ * are understood and are being used.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+ *  required <code>wsdl:binding</code> extensions are either understood
+    and used by the runtime, or explicitly disabled by the web service
+ *  application.  A web service application can disable a particular
+ *  extension that has a known WebServiceFeature using either the appropriate
+ *  annotation associated with that WebServiceFeature on the server, or one of
+ *  the following methods on the client:
+ *    <ul>
+ *      <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+ *      <li>{@link Service#getPort(Class,WebServiceFeature...)}
+ *      <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(QName,Class,Service.Mode mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(EndpointReference,Class,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(QName,JAXBContext,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link Service#createDispatch(EndpointReference,JAXBContext,Service.Mode,WebServiceFeature...)}
+ *      <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
+ *      <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
+ *          generated <code>Service</code>.
+ *    </ul>
+ *  The runtime MUST also make sure that binding of
+ *  SEI parameters/return values respect the <code>wsdl:binding</code>.
+ *  With this feature enabled, if a required (<code>wsdl:required="true"</code>)
+ *  <code>wsdl:binding</code> extension is in the WSDL and it is not
+ *  supported by a JAX-WS runtime and it has not
+ *  been explicitly turned off by the web service developer, then
+ *  that JAX-WS runtime MUST behave appropriately based on whether it is
+ *  on the client or server:
+ *  <UL>
+ *    <li>Client: runtime MUST throw a
+ *  <code>WebServiceException</code> no sooner than when one of the methods
+ *  above is invoked but no later than the first invocation of an endpoint
+ *  operation.
+ *    <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
+ *  </ul>
+ *  <li> DISABLED: In this Mode, an implementation may choose whether
+ *  to inspect the <code>wsdl:binding<code> or not and to what degree
+ *  the <code>wsdl:binding</code> will be inspected.  For example,
+ *  one implementation may choose to behave as if this feature is enabled,
+ *  another implementation may only choose to verify the SEI's
+ *  parameter/return type bindings.
+ * </ul>
+ *
+ * @see javax.xml.ws.soap.AddressingFeature
+ *
+ * @since JAX-WS 2.1
+ */
+public final class RespectBindingFeature extends WebServiceFeature {
+    /**
+     *
+     * Constant value identifying the RespectBindingFeature
+     */
+    public static final String ID = "javax.xml.ws.RespectBindingFeature";
+
+
+    /**
+     * Creates an <code>RespectBindingFeature</code>.
+     * The instance created will be enabled.
+     */
+    public RespectBindingFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Creates an RespectBindingFeature
+     *
+     * @param enabled specifies whether this feature should
+     * be enabled or not.
+     */
+    public RespectBindingFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/Response.java b/jaxws/src/share/classes/javax/xml/ws/Response.java
index e0dc3ac..429a746 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Response.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Response.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,8 +35,8 @@
  *  <p>For asynchronous operation invocations it provides additional methods
  *  to check the status of the request. The <code>get(...)</code> methods may
  *  throw the standard
- *  set of exceptions and their cause may be a RemoteException or a
- *  WebServiceException that represents the error that occured during the
+ *  set of exceptions and their cause may be a <code>RemoteException</code> or a
+ *  {@link WebServiceException} that represents the error that occured during the
  *  asynchronous method invocation.</p>
  *
  *  @since JAX-WS 2.0
diff --git a/jaxws/src/share/classes/javax/xml/ws/ResponseWrapper.java b/jaxws/src/share/classes/javax/xml/ws/ResponseWrapper.java
index 9528f07..83958f8 100644
--- a/jaxws/src/share/classes/javax/xml/ws/ResponseWrapper.java
+++ b/jaxws/src/share/classes/javax/xml/ws/ResponseWrapper.java
@@ -31,11 +31,11 @@
 import java.lang.annotation.RetentionPolicy;
 /**
  * Used to annotate methods in the Service Endpoint Interface with the response
- * wrapper bean to be used at runtime. The default value of the localName is
- * the operationName as defined in WebMethod annotation appended with
- * Response and the targetNamespace is the target namespace of the SEI.
+ * wrapper bean to be used at runtime. The default value of the <code>localName</code> is
+ * the <code>operationName</code> as defined in <code>WebMethod</code> annotation appended with
+ * <code>Response</code> and the <code>targetNamespace</code> is the target namespace of the SEI.
  * <p> When starting from Java this annotation is used resolve
- * overloading conflicts in document literal mode. Only the className
+ * overloading conflicts in document literal mode. Only the <code>className</code>
  * is required in this case.
  *
  *  @since JAX-WS 2.0
@@ -48,7 +48,7 @@
 
   /**
 
-   *  Elements local name.
+   *  Element's local name.
 
   **/
 
@@ -58,7 +58,7 @@
 
   /**
 
-   *  Elements namespace name.
+   *  Element's namespace name.
 
   **/
 
diff --git a/jaxws/src/share/classes/javax/xml/ws/Service.java b/jaxws/src/share/classes/javax/xml/ws/Service.java
index 82b3f5e..ae04916 100644
--- a/jaxws/src/share/classes/javax/xml/ws/Service.java
+++ b/jaxws/src/share/classes/javax/xml/ws/Service.java
@@ -33,14 +33,14 @@
 import javax.xml.ws.spi.Provider;
 
 /**
- *  <code>Service</code> objects provide the client view of a Web service.
- *  <p><code>Service</code> acts as a factory of the following:
- *  <ul>
- *  <li>Proxies for a target service endpoint.
- *  <li>Instances of <code>javax.xml.ws.Dispatch</code> for
- *      dynamic message-oriented invocation of a remote
- *      operation.
- *  </li>
+ * <code>Service</code> objects provide the client view of a Web service.
+ * <p><code>Service</code> acts as a factory of the following:
+ * <ul>
+ * <li>Proxies for a target service endpoint.
+ * <li>Instances of {@link javax.xml.ws.Dispatch} for
+ *     dynamic message-oriented invocation of a remote
+ *     operation.
+ * </li>
  *
  * <p>The ports available on a service can be enumerated using the
  * <code>getPorts</code> method. Alternatively, you can pass a
@@ -56,280 +56,658 @@
  * can be enabled by creating a <code>ThreadPoolExecutor</code> and
  * registering it with the service.
  *
- *  @since JAX-WS 2.0
+ * @since JAX-WS 2.0
  *
- *  @see javax.xml.ws.spi.Provider
- *  @see javax.xml.ws.handler.HandlerResolver
- *  @see java.util.concurrent.Executor
-**/
+ * @see javax.xml.ws.spi.Provider
+ * @see javax.xml.ws.handler.HandlerResolver
+ * @see java.util.concurrent.Executor
+ **/
 public class Service {
 
-  private ServiceDelegate delegate;
-  /**
-   * The orientation of a dynamic client or service. MESSAGE provides
-   * access to entire protocol message, PAYLOAD to protocol message
-   * payload only.
-  **/
-  public enum Mode { MESSAGE, PAYLOAD };
+    private ServiceDelegate delegate;
+    /**
+     * The orientation of a dynamic client or service. <code>MESSAGE</code> provides
+     * access to entire protocol message, <code>PAYLOAD</code> to protocol message
+     * payload only.
+     **/
+    public enum Mode { MESSAGE, PAYLOAD };
 
-  protected Service(java.net.URL wsdlDocumentLocation, QName serviceName)
-  {
-      delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
-                                                           serviceName,
-                                                           this.getClass());
-  }
+    protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {
+        delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
+                serviceName,
+                this.getClass());
+    }
 
 
-  /** The getPort method returns a stub. A service client
-   *  uses this stub to invoke operations on the target
-   *  service endpoint. The <code>serviceEndpointInterface</code>
-   *  specifies the service endpoint interface that is supported by
-   *  the created dynamic proxy or stub instance.
-   *
-   *  @param portName  Qualified name of the service endpoint in
-   *                   the WSDL service description
-   *  @param serviceEndpointInterface Service endpoint interface
-   *                   supported by the dynamic proxy or stub
-   *                   instance
-   *  @return Object Proxy instance that
-   *                 supports the specified service endpoint
-   *                 interface
-   *  @throws WebServiceException This exception is thrown in the
-   *                   following cases:
-   *                   <UL>
-   *                   <LI>If there is an error in creation of
-   *                       the proxy
-   *                   <LI>If there is any missing WSDL metadata
-   *                       as required by this method
-   *                   <LI>Optionally, if an illegal
-   *                       <code>serviceEndpointInterface</code>
-   *                       or <code>portName</code> is specified
-   *                   </UL>
-   *  @see java.lang.reflect.Proxy
-   *  @see java.lang.reflect.InvocationHandler
-  **/
-  public <T> T getPort(QName portName,
-                                 Class<T> serviceEndpointInterface)
-  {
-      return delegate.getPort(portName, serviceEndpointInterface);
-  }
+    /**
+     * The <code>getPort</code> method returns a proxy. A service client
+     * uses this proxy to invoke operations on the target
+     * service endpoint. The <code>serviceEndpointInterface</code>
+     * specifies the service endpoint interface that is supported by
+     * the created dynamic proxy instance.
+     *
+     * @param portName  Qualified name of the service endpoint in
+     *                  the WSDL service description.
+     * @param serviceEndpointInterface Service endpoint interface
+     *                  supported by the dynamic proxy instance.
+     * @return Object Proxy instance that
+     *                supports the specified service endpoint
+     *                interface.
+     * @throws WebServiceException This exception is thrown in the
+     *                  following cases:
+     *                  <UL>
+     *                  <LI>If there is an error in creation of
+     *                      the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      or <code>portName</code> is specified.
+     *                  </UL>
+     * @see java.lang.reflect.Proxy
+     * @see java.lang.reflect.InvocationHandler
+     **/
+    public <T> T getPort(QName portName,
+            Class<T> serviceEndpointInterface) {
+        return delegate.getPort(portName, serviceEndpointInterface);
+    }
 
-  /** The getPort method returns a stub. The parameter
-   *  <code>serviceEndpointInterface</code> specifies the service
-   *  endpoint interface that is supported by the returned proxy.
-   *  In the implementation of this method, the JAX-WS
-   *  runtime system takes the responsibility of selecting a protocol
-   *  binding (and a port) and configuring the proxy accordingly.
-   *  The returned proxy should not be reconfigured by the client.
-   *
-   *  @param serviceEndpointInterface Service endpoint interface
-   *  @return Object instance that supports the
-   *                   specified service endpoint interface
-   *  @throws WebServiceException
-   *                   <UL>
-   *                   <LI>If there is an error during creation
-   *                       of the proxy
-   *                   <LI>If there is any missing WSDL metadata
-   *                       as required by this method
-   *                   <LI>Optionally, if an illegal
-   *                       <code>serviceEndpointInterface</code>
-   *                       is specified
-   *                   </UL>
-  **/
-  public <T> T getPort(Class<T> serviceEndpointInterface) {
-      return delegate.getPort(serviceEndpointInterface);
-  }
-
-  /** Creates a new port for the service. Ports created in this way contain
-   *  no WSDL port type information and can only be used for creating
-   *  <code>Dispatch</code>instances.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param bindingId A String identifier of a binding.
-   *  @param endpointAddress Address of the target service endpoint as a URI
-   *  @throws WebServiceException If any error in the creation of
-   *  the port
-   *
-   *  @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
-   *  @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
-   *  @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
-   **/
-  public void addPort(QName portName, String bindingId, String endpointAddress)
-  {
-      delegate.addPort(portName, bindingId, endpointAddress);
-  }
-
-  /** Creates a <code>Dispatch</code> instance for use with objects of
-   *  the users choosing.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param type The class of object used to messages or message
-   *  payloads. Implementations are required to support
-   *  <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>
-   *  and <code>javax.activation.DataSource</code>, depending on
-   *  the binding in use.
-   *  @param mode Controls whether the created dispatch instance is message
-   *  or payload oriented, i.e. whether the user will work with complete
-   *  protocol messages or message payloads. E.g. when using the SOAP
-   *  protocol, this parameter controls whether the user will work with
-   *  SOAP messages or the contents of a SOAP body. Mode must be MESSAGE
-   *  when type is SOAPMessage.
-   *
-   *  @return Dispatch instance
-   *  @throws WebServiceException If any error in the creation of
-   *                   the <code>Dispatch</code> object
-   *  @see javax.xml.transform.Source
-   *  @see javax.xml.soap.SOAPMessage
-   **/
-  public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)
-  {
-      return delegate.createDispatch(portName, type, mode);
-  }
-
-  /** Creates a <code>Dispatch</code> instance for use with JAXB
-   *  generated objects.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param context The JAXB context used to marshall and unmarshall
-   *  messages or message payloads.
-   *  @param mode Controls whether the created dispatch instance is message
-   *  or payload oriented, i.e. whether the user will work with complete
-   *  protocol messages or message payloads. E.g. when using the SOAP
-   *  protocol, this parameter controls whether the user will work with
-   *  SOAP messages or the contents of a SOAP body.
-   *
-   *  @return Dispatch instance
-   *  @throws ServiceException If any error in the creation of
-   *                   the <code>Dispatch</code> object
-   *
-   *  @see javax.xml.bind.JAXBContext
-   **/
-  public Dispatch<Object> createDispatch(QName portName, JAXBContext context,
-      Mode mode)
-  {
-      return delegate.createDispatch(portName, context,  mode);
-  }
+    /**
+     * The <code>getPort</code> method returns a proxy. A service client
+     * uses this proxy to invoke operations on the target
+     * service endpoint. The <code>serviceEndpointInterface</code>
+     * specifies the service endpoint interface that is supported by
+     * the created dynamic proxy instance.
+     *
+     * @param portName  Qualified name of the service endpoint in
+     *                  the WSDL service description.
+     * @param serviceEndpointInterface Service endpoint interface
+     *                  supported by the dynamic proxy instance.
+     * @param features  A list of WebServiceFeatures to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that
+     *                supports the specified service endpoint
+     *                interface.
+     * @throws WebServiceException This exception is thrown in the
+     *                  following cases:
+     *                  <UL>
+     *                  <LI>If there is an error in creation of
+     *                      the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      or <code>portName</code> is specified.
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     * @see java.lang.reflect.Proxy
+     * @see java.lang.reflect.InvocationHandler
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T> T getPort(QName portName,
+            Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+        return delegate.getPort(portName, serviceEndpointInterface, features);
+    }
 
 
+    /**
+     * The <code>getPort</code> method returns a proxy. The parameter
+     * <code>serviceEndpointInterface</code> specifies the service
+     * endpoint interface that is supported by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly.
+     * The returned proxy should not be reconfigured by the client.
+     *
+     * @param serviceEndpointInterface Service endpoint interface.
+     * @return Object instance that supports the
+     *                  specified service endpoint interface.
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If an illegal.
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified.
+     *                  </UL>
+     **/
+    public <T> T getPort(Class<T> serviceEndpointInterface) {
+        return delegate.getPort(serviceEndpointInterface);
+    }
 
-  /** Gets the name of this service.
-   *  @return Qualified name of this service
-  **/
-  public QName getServiceName() {
-      return delegate.getServiceName();
-  }
 
-  /** Returns an <code>Iterator</code> for the list of
-   *  <code>QName</code>s of service endpoints grouped by this
-   *  service
-   *
-   *  @return Returns <code>java.util.Iterator</code> with elements
-   *          of type <code>javax.xml.namespace.QName</code>
-   *  @throws WebServiceException If this Service class does not
-   *          have access to the required WSDL metadata
-  **/
-  public Iterator<javax.xml.namespace.QName> getPorts() {
-      return delegate.getPorts();
-  }
+    /**
+     * The <code>getPort</code> method returns a proxy. The parameter
+     * <code>serviceEndpointInterface</code> specifies the service
+     * endpoint interface that is supported by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly.
+     * The returned proxy should not be reconfigured by the client.
+     *
+     * @param serviceEndpointInterface Service endpoint interface.
+     * @param features  A list of WebServiceFeatures to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object instance that supports the
+     *                  specified service endpoint interface.
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified.
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T> T getPort(Class<T> serviceEndpointInterface,
+            WebServiceFeature... features) {
+        return delegate.getPort(serviceEndpointInterface, features);
+    }
 
-  /** Gets the location of the WSDL document for this Service.
-   *
-   *  @return URL for the location of the WSDL document for
-   *          this service
-  **/
-  public java.net.URL getWSDLDocumentLocation() {
-      return delegate.getWSDLDocumentLocation();
-  }
 
-  /**
-   * Returns the configured handler resolver.
-   *
-   *  @return HandlerResolver The <code>HandlerResolver</code> being
-   *          used by this <code>Service</code> instance, or <code>null</code>
-   *          if there isn't one.
-  **/
+    /**
+     * The <code>getPort</code> method returns a proxy.
+     * The parameter <code>endpointReference</code> specifies the
+     * endpoint that will be invoked by the returned proxy.  If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * The parameter <code>serviceEndpointInterface</code> specifies
+     * the service endpoint interface that is supported by the
+     * returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code> metadata
+     * also has a WSDL, then the WSDL from this instance MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * The returned proxy should not be reconfigured by the client.
+     * If this <code>Service</code> instance has a known proxy
+     * port that matches the information contained in
+     * the WSDL,
+     * then that proxy is returned, otherwise a WebServiceException
+     * is thrown.
+     * <p>
+     * Calling this method has the same behavior as the following
+     * <pre>
+     * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * metadata of the <code>endpointReference</code> or from the
+     * <code>serviceEndpointInterface</code> and the WSDL
+     * associated with this <code>Service</code> instance.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned proxy.
+     * @param serviceEndpointInterface Service endpoint interface.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that supports the
+     *                  specified service endpoint interface.
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If the <code>endpointReference</code> metadata does
+     *                      not match the <code>serviceName</code> of this
+     *                      <code>Service</code> instance.
+     *                  <LI>If a <code>portName</code> cannot be extracted
+     *                      from the WSDL or <code>endpointReference</code> metadata.
+     *                  <LI>If an invalid
+     *                      <code>endpointReference</code>
+     *                      is specified.
+     *                  <LI>If an invalid
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified.
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T> T getPort(EndpointReference endpointReference,
+           Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+        return delegate.getPort(endpointReference, serviceEndpointInterface, features);
+    }
+
+    /**
+     * Creates a new port for the service. Ports created in this way contain
+     * no WSDL port type information and can only be used for creating
+     * <code>Dispatch</code>instances.
+     *
+     * @param portName  Qualified name for the target service endpoint.
+     * @param bindingId A String identifier of a binding.
+     * @param endpointAddress Address of the target service endpoint as a URI.
+     * @throws WebServiceException If any error in the creation of
+     * the port.
+     *
+     * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
+     * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
+     * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
+     **/
+    public void addPort(QName portName, String bindingId, String endpointAddress) {
+        delegate.addPort(portName, bindingId, endpointAddress);
+    }
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param type The class of object used for messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>
+     * and <code>javax.activation.DataSource</code>, depending on
+     * the binding in use.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
+     * when type is SOAPMessage.
+     *
+     * @return Dispatch instance.
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object.
+     *
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     **/
+    public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode) {
+        return delegate.createDispatch(portName, type, mode);
+    }
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param type The class of object used for messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+     * when type is <code>SOAPMessage</code>.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance.
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object or if a
+     *                  feature is enabled that is not compatible with
+     *                  this port or is unsupported.
+     *
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+            Service.Mode mode, WebServiceFeature... features) {
+        return delegate.createDispatch(portName, type, mode, features);
+    }
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing. If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the dispatch accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code>
+     * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * An implementation MUST be able to retrieve the <code>portName</code> from the
+     * <code>endpointReference</code> metadata.
+     * <p>
+     * This method behaves the same as calling
+     * <pre>
+     * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * WSDL or <code>EndpointReference</code> metadata.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned <code>Dispatch</code> object.
+     * @param type The class of object used to messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+     * when type is <code>SOAPMessage</code>.
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException
+     *                  <UL>
+     *                    <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                    <li>If the <code>endpointReference</code> metadata does
+     *                      not match the <code>serviceName</code> or <code>portName</code>
+     *                      of a WSDL associated
+     *                      with this <code>Service</code> instance.
+     *                    <li>If the <code>portName</code> cannot be determined
+     *                    from the <code>EndpointReference</code> metadata.
+     *                    <li>If any error in the creation of
+     *                     the <code>Dispatch</code> object.
+     *                    <li>If a feature is enabled that is not
+     *                    compatible with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
+            Class<T> type, Service.Mode mode,
+            WebServiceFeature... features) {
+        return delegate.createDispatch(endpointReference, type, mode, features);
+    }
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     *
+     * @return Dispatch instance.
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object.
+     *
+     * @see javax.xml.bind.JAXBContext
+     **/
+    public Dispatch<Object> createDispatch(QName portName, JAXBContext context,
+            Mode mode) {
+        return delegate.createDispatch(portName, context,  mode);
+    }
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance.
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object or if a
+     *                  feature is enabled that is not compatible with
+     *                  this port or is unsupported.
+     *
+     * @see javax.xml.bind.JAXBContext
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public Dispatch<Object> createDispatch(QName portName,
+            JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
+        return delegate.createDispatch(portName, context, mode, features);
+    }
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects. If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the dispatch accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code>
+     * also has a WSDL in its metadata, then the WSDL from this instance
+     * MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * An implementation MUST be able to retrieve the <code>portName</code> from the
+     * <code>endpointReference</code> metadata.
+     * <p>
+     * This method behavies the same as calling
+     * <pre>
+     * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * WSDL or <code>endpointReference</code> metadata.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned <code>Dispatch</code> object.
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException
+     *                  <UL>
+     *                    <li>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                    <li>If the <code>endpointReference</code> metadata does
+     *                    not match the <code>serviceName</code> or <code>portName</code>
+     *                    of a WSDL associated
+     *                    with this <code>Service</code> instance.
+     *                    <li>If the <code>portName</code> cannot be determined
+     *                    from the <code>EndpointReference</code> metadata.
+     *                    <li>If any error in the creation of
+     *                    the <code>Dispatch</code> object.
+     *                    <li>if a feature is enabled that is not
+     *                    compatible with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see javax.xml.bind.JAXBContext
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+    **/
+    public Dispatch<Object> createDispatch(EndpointReference endpointReference,
+            JAXBContext context, Service.Mode mode,
+            WebServiceFeature... features) {
+        return delegate.createDispatch(endpointReference, context, mode, features);
+    }
+
+    /**
+     * Gets the name of this service.
+     * @return Qualified name of this service
+     **/
+    public QName getServiceName() {
+        return delegate.getServiceName();
+    }
+
+    /**
+     * Returns an <code>Iterator</code> for the list of
+     * <code>QName</code>s of service endpoints grouped by this
+     * service
+     *
+     * @return Returns <code>java.util.Iterator</code> with elements
+     *         of type <code>javax.xml.namespace.QName</code>.
+     * @throws WebServiceException If this Service class does not
+     *         have access to the required WSDL metadata.
+     **/
+    public Iterator<javax.xml.namespace.QName> getPorts() {
+        return delegate.getPorts();
+    }
+
+    /**
+     * Gets the location of the WSDL document for this Service.
+     *
+     * @return URL for the location of the WSDL document for
+     *         this service.
+     **/
+    public java.net.URL getWSDLDocumentLocation() {
+        return delegate.getWSDLDocumentLocation();
+    }
+
+    /**
+     * Returns the configured handler resolver.
+     *
+     * @return HandlerResolver The <code>HandlerResolver</code> being
+     *         used by this <code>Service</code> instance, or <code>null</code>
+     *         if there isn't one.
+     **/
     public HandlerResolver getHandlerResolver() {
         return delegate.getHandlerResolver();
     }
 
-  /**
-   *  Sets the <code>HandlerResolver</code> for this <code>Service</code>
-   *  instance.
-   *  <p>
-   *  The handler resolver, if present, will be called once for each
-   *  proxy or dispatch instance that is created, and the handler chain
-   *  returned by the resolver will be set on the instance.
-   *
-   *  @param handlerResolver The <code>HandlerResolver</code> to use
-   *         for all subsequently created proxy/dispatch objects.
-   *
-   *  @see javax.xml.ws.handler.HandlerResolver
-  **/
-   public void setHandlerResolver(HandlerResolver handlerResolver) {
-       delegate.setHandlerResolver(handlerResolver);
-   }
+    /**
+     * Sets the <code>HandlerResolver</code> for this <code>Service</code>
+     * instance.
+     * <p>
+     * The handler resolver, if present, will be called once for each
+     * proxy or dispatch instance that is created, and the handler chain
+     * returned by the resolver will be set on the instance.
+     *
+     * @param handlerResolver The <code>HandlerResolver</code> to use
+     *        for all subsequently created proxy/dispatch objects.
+     *
+     * @see javax.xml.ws.handler.HandlerResolver
+     **/
+    public void setHandlerResolver(HandlerResolver handlerResolver) {
+        delegate.setHandlerResolver(handlerResolver);
+    }
 
-  /**
-   * Returns the executor for this <code>Service</code>instance.
-   *
-   * The executor is used for all asynchronous invocations that
-   * require callbacks.
-   *
-   * @return The <code>java.util.concurrent.Executor</code> to be
-   *         used to invoke a callback.
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public java.util.concurrent.Executor getExecutor() {
-       return delegate.getExecutor();
-   }
+    /**
+     * Returns the executor for this <code>Service</code>instance.
+     *
+     * The executor is used for all asynchronous invocations that
+     * require callbacks.
+     *
+     * @return The <code>java.util.concurrent.Executor</code> to be
+     *         used to invoke a callback.
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public java.util.concurrent.Executor getExecutor() {
+        return delegate.getExecutor();
+    }
 
-  /**
-   * Sets the executor for this <code>Service</code> instance.
-   *
-   * The executor is used for all asynchronous invocations that
-   * require callbacks.
-   *
-   * @param executor The <code>java.util.concurrent.Executor</code>
-   *        to be used to invoke a callback.
-   *
-   * @throws SecurityException If the instance does not support
-   *         setting an executor for security reasons (e.g. the
-   *         necessary permissions are missing).
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public void setExecutor(java.util.concurrent.Executor executor) {
-       delegate.setExecutor(executor);
-   }
+    /**
+     * Sets the executor for this <code>Service</code> instance.
+     *
+     * The executor is used for all asynchronous invocations that
+     * require callbacks.
+     *
+     * @param executor The <code>java.util.concurrent.Executor</code>
+     *        to be used to invoke a callback.
+     *
+     * @throws SecurityException If the instance does not support
+     *         setting an executor for security reasons (e.g. the
+     *         necessary permissions are missing).
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public void setExecutor(java.util.concurrent.Executor executor) {
+        delegate.setExecutor(executor);
+    }
 
-  /**
-   *  Create a <code>Service</code> instance.
-   *
-   *  The specified WSDL document location and service qualified name must
-   *  uniquely identify a <code>wsdl:service</code> element.
-   *
-   *  @param wsdlDocumentLocation URL for the WSDL document location
-   *                              for the service
-   *  @param serviceName QName for the service
-   *  @throws WebServiceException If any error in creation of the
-   *                     specified service
-  **/
-  public static Service create(
-                            java.net.URL wsdlDocumentLocation,
-                            QName serviceName)
-  {
-      return new Service(wsdlDocumentLocation, serviceName);
-  }
+    /**
+     * Creates a <code>Service</code> instance.
+     *
+     * The specified WSDL document location and service qualified name MUST
+     * uniquely identify a <code>wsdl:service</code> element.
+     *
+     * @param wsdlDocumentLocation <code>URL</code> for the WSDL document location
+     *                             for the service
+     * @param serviceName <code>QName</code> for the service
+     * @throws WebServiceException If any error in creation of the
+     *                    specified service.
+     **/
+    public static Service create(
+            java.net.URL wsdlDocumentLocation,
+            QName serviceName) {
+        return new Service(wsdlDocumentLocation, serviceName);
+    }
 
-  /**
-   *  Create a <code>Service</code> instance.
-   *
-   *  @param serviceName QName for the service
-   *  @throws WebServiceException If any error in creation of the
-   *                     specified service
-   */
-  public static Service create(QName serviceName) {
-      return new Service(null, serviceName);
-  }
+    /**
+     * Creates a <code>Service</code> instance.
+     *
+     * @param serviceName <code>QName</code> for the service
+     * @throws WebServiceException If any error in creation of the
+     *                    specified service
+     */
+    public static Service create(QName serviceName) {
+        return new Service(null, serviceName);
+    }
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/ServiceMode.java b/jaxws/src/share/classes/javax/xml/ws/ServiceMode.java
index abaa38b..5744a2c 100644
--- a/jaxws/src/share/classes/javax/xml/ws/ServiceMode.java
+++ b/jaxws/src/share/classes/javax/xml/ws/ServiceMode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 import java.lang.annotation.Inherited;
 
 /**
- * Used to indicate whether a Provider implementation wishes to work
+ * Used to indicate whether a {@link Provider} implementation wishes to work
  * with entire protocol messages or just with protocol message payloads.
  *
  *  @since JAX-WS 2.0
@@ -44,9 +44,9 @@
 @Documented
 public @interface ServiceMode {
   /**
-   * Service mode. PAYLOAD indicates that the Provider implementation
-   * wishes to work with protocol message payloads only. MESSAGE indicates
-   * that the Provider implementation wishes to work with entire protocol
+   * Service mode. <code>PAYLOAD</code> indicates that the <code>Provider</code> implementation
+   * wishes to work with protocol message payloads only. <code>MESSAGE</code> indicates
+   * that the <code>Provider</code> implementation wishes to work with entire protocol
    * messages.
   **/
   public Service.Mode value() default Service.Mode.PAYLOAD;
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebEndpoint.java b/jaxws/src/share/classes/javax/xml/ws/WebEndpoint.java
index 778167b..636061e 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebEndpoint.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebEndpoint.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebFault.java b/jaxws/src/share/classes/javax/xml/ws/WebFault.java
index 7fa2a5c..ac6766c 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebFault.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebFault.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,12 +43,12 @@
 @Documented
 public @interface WebFault {
   /**
-   *  Elements local name.
+   *  Element's local name.
   **/
   public String name() default "";
 
   /**
-   *  Elements namespace name.
+   *  Element's namespace name.
   **/
   public String targetNamespace() default "";
 
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceClient.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceClient.java
index 431ecce..233459f 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServiceClient.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceContext.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceContext.java
index 39631fe..cc8df86 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServiceContext.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,9 @@
 
 import java.security.Principal;
 import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
+
 
 /**
  *  A <code>WebServiceContext</code> makes it possible for
@@ -41,57 +44,108 @@
  *  @since JAX-WS 2.0
  *
  *  @see javax.annotation.Resource
-**/
+ **/
 public interface WebServiceContext {
 
-  /**
-   *  Returns the MessageContext for the request being served
-   *  at the time this method is called. Only properties with
-   *  APPLICATION scope will be visible to the application.
-   *
-   *  @return MessageContext The message context.
-   *
-   *  @throws IllegalStateException This exception is thrown
-   *          if the method is called while no request is
-   *          being serviced.
-   *
-   *  @see javax.xml.ws.handler.MessageContext
-   *  @see javax.xml.ws.handler.MessageContext.Scope
-   *  @see java.lang.IllegalStateException
-  **/
-  public MessageContext getMessageContext();
+    /**
+     * Returns the <code>MessageContext</code> for the request being served
+     * at the time this method is called. Only properties with
+     * APPLICATION scope will be visible to the application.
+     *
+     * @return MessageContext The message context.
+     *
+     * @throws IllegalStateException This exception is thrown
+     *         if the method is called while no request is
+     *         being serviced.
+     *
+     * @see javax.xml.ws.handler.MessageContext
+     * @see javax.xml.ws.handler.MessageContext.Scope
+     * @see java.lang.IllegalStateException
+     **/
+    public MessageContext getMessageContext();
 
-  /**
-   *  Returns the Principal that identifies the sender
-   *  of the request currently being serviced. If the
-   *  sender has not been authenticated, the method
-   *  returns <code>null</code>.
-   *
-   *  @return Principal The principal object.
-   *
-   *  @throws IllegalStateException This exception is thrown
-   *          if the method is called while no request is
-   *          being serviced.
-   *
-   *  @see java.security.Principal
-   *  @see java.lang.IllegalStateException
-  **/
-  public Principal getUserPrincipal();
+    /**
+     * Returns the Principal that identifies the sender
+     * of the request currently being serviced. If the
+     * sender has not been authenticated, the method
+     * returns <code>null</code>.
+     *
+     * @return Principal The principal object.
+     *
+     * @throws IllegalStateException This exception is thrown
+     *         if the method is called while no request is
+     *         being serviced.
+     *
+     * @see java.security.Principal
+     * @see java.lang.IllegalStateException
+     **/
+    public Principal getUserPrincipal();
 
-  /**
-   *  Returns a boolean indicating whether the
-   *  authenticated user is included in the specified
-   *  logical role. If the user has not been
-   *  authenticated, the method returns </code>false</code>.
-   *
-   *  @param role  A <code>String</code> specifying the name of the role
-   *
-   *  @return a <code>boolean</code> indicating whether
-   *  the sender of the request belongs to a given role
-   *
-   *  @throws IllegalStateException This exception is thrown
-   *          if the method is called while no request is
-   *          being serviced.
-  **/
-  public boolean isUserInRole(String role);
+    /**
+     * Returns a boolean indicating whether the
+     * authenticated user is included in the specified
+     * logical role. If the user has not been
+     * authenticated, the method returns </code>false</code>.
+     *
+     * @param role  A <code>String</code> specifying the name of the role
+     *
+     * @return a <code>boolean</code> indicating whether
+     * the sender of the request belongs to a given role
+     *
+     * @throws IllegalStateException This exception is thrown
+     *         if the method is called while no request is
+     *         being serviced.
+     **/
+    public boolean isUserInRole(String role);
+
+    /**
+     * Returns the <code>EndpointReference</code> for this
+     * endpoint.
+     * <p>
+     * If the {@link Binding} for this <code>bindingProvider</code> is
+     * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
+     * <code>W3CEndpointReference</code> MUST be returned.
+     *
+     * @param referenceParameters Reference parameters to be associated with the
+     * returned <code>EndpointReference</code> instance.
+     * @return EndpointReference of the endpoint associated with this
+     * <code>WebServiceContext</code>.
+     * If the returned <code>EndpointReference</code> is of type
+     * <code>W3CEndpointReference</code> then it MUST contain the
+     * the specified <code>referenceParameters</code>.
+     *
+     * @throws IllegalStateException This exception is thrown
+     *         if the method is called while no request is
+     *         being serviced.
+     *
+     * @see W3CEndpointReference
+     *
+     * @since JAX-WS 2.1
+     */
+    public EndpointReference getEndpointReference(Element... referenceParameters);
+
+    /**
+     * Returns the <code>EndpointReference</code> associated with
+     * this endpoint.
+     *
+     * @param clazz The type of <code>EndpointReference</code> that
+     * MUST be returned.
+     * @param referenceParameters Reference parameters to be associated with the
+     * returned <code>EndpointReference</code> instance.
+     * @return EndpointReference of type <code>clazz</code> of the endpoint
+     * associated with this <code>WebServiceContext</code> instance.
+     * If the returned <code>EndpointReference</code> is of type
+     * <code>W3CEndpointReference</code> then it MUST contain the
+     * the specified <code>referenceParameters</code>.
+     *
+     * @throws IllegalStateException This exception is thrown
+     *         if the method is called while no request is
+     *         being serviced.
+     * @throws WebServiceException If the <code>clazz</code> type of
+     * <code>EndpointReference</code> is not supported.
+     *
+     * @since JAX-WS 2.1
+     **/
+    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
+            Element... referenceParameters);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceException.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceException.java
index 3cc5a08..9637dbd 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServiceException.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceFeature.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceFeature.java
new file mode 100644
index 0000000..419a956
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceFeature.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws;
+
+
+/**
+ * A WebServiceFeature is used to represent a feature that can be
+ * enabled or disabled for a web service.
+ * <p>
+ * The JAX-WS specification will define some standard features and
+ * JAX-WS implementors are free to define additional features if
+ * necessary.  Vendor specific features may not be portable so
+ * caution should be used when using them. Each Feature definition
+ * MUST define a <code>public static final String ID</code>
+ * that can be used in the Feature annotation to refer
+ * to the feature. This ID MUST be unique across all features
+ * of all vendors.  When defining a vendor specific feature ID,
+ * use a vendor specific namespace in the ID string.
+ *
+ * @see javax.xml.ws.RespectBindingFeature
+ * @see javax.xml.ws.soap.AddressingFeature
+ * @see javax.xml.ws.soap.MTOMFeature
+ *
+ * @since 2.1
+ */
+public abstract class WebServiceFeature {
+   /**
+    * Each Feature definition MUST define a public static final
+    * String ID that can be used in the Feature annotation to refer
+    * to the feature.
+    */
+   // public static final String ID = "some unique feature Identifier";
+
+   /**
+    * Get the unique identifier for this WebServiceFeature.
+    *
+    * @return the unique identifier for this feature.
+    */
+   public abstract String getID();
+
+   /**
+    * Specifies if the feature is enabled or disabled
+    */
+   protected boolean enabled = false;
+
+
+   protected WebServiceFeature(){}
+
+
+   /**
+    * Returns <code>true</code> if this feature is enabled.
+    *
+    * @return <code>true</code> if and only if the feature is enabled .
+    */
+   public boolean isEnabled() {
+       return enabled;
+   }
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServicePermission.java b/jaxws/src/share/classes/javax/xml/ws/WebServicePermission.java
index 3fc5134..5de72fe 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServicePermission.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServicePermission.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceRef.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceRef.java
index 98ca206..51d9785 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServiceRef.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceRef.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
       * the default is the field name.  For method annotations,
       * the default is the JavaBeans property name corresponding
       * to the method.  For class annotations, there is no default
-      * and this must be specified.
+      * and this MUST be specified.
       */
      String name() default "";
 
@@ -61,7 +61,7 @@
       * The Java type of the resource.  For field annotations,
       * the default is the type of the field.  For method annotations,
       * the default is the type of the JavaBeans property.
-      * For class annotations, there is no default and this must be
+      * For class annotations, there is no default and this MUST be
       * specified.
       */
      Class type() default Object.class ;
@@ -85,7 +85,7 @@
 
      /**
       * The service class, always a type extending
-      * <code>javax.xml.ws.Service</code>. This element must be specified
+      * <code>javax.xml.ws.Service</code>. This element MUST be specified
       * whenever the type of the reference is a service endpoint interface.
       */
      Class value() default Object.class ;
diff --git a/jaxws/src/share/classes/javax/xml/ws/WebServiceRefs.java b/jaxws/src/share/classes/javax/xml/ws/WebServiceRefs.java
index 3cbd360..2125241 100644
--- a/jaxws/src/share/classes/javax/xml/ws/WebServiceRefs.java
+++ b/jaxws/src/share/classes/javax/xml/ws/WebServiceRefs.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/HandlerResolver.java b/jaxws/src/share/classes/javax/xml/ws/handler/HandlerResolver.java
index 0f18052..4f91f77 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/HandlerResolver.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/HandlerResolver.java
@@ -47,7 +47,7 @@
    *  Gets the handler chain for the specified port.
    *
    *  @param portInfo Contains information about the port being accessed.
-   *  @return java.util.List Handler chain
+   *  @return java.util.List&lt;Handler> chain
   **/
   public java.util.List<Handler> getHandlerChain(PortInfo portInfo);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java b/jaxws/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java
index ebf356d..8b49b04 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 
   /** Gets the message from this message context
    *
-   *  @return The contained message; returns null if no
+   *  @return The contained message; returns <code>null</code> if no
    *          message is present in this message context
   **/
   public LogicalMessage getMessage();
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/MessageContext.java b/jaxws/src/share/classes/javax/xml/ws/handler/MessageContext.java
index b8be744..f827d9e 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/MessageContext.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/MessageContext.java
@@ -26,151 +26,180 @@
 package javax.xml.ws.handler;
 import java.util.Map;
 
-/** The interface <code>MessageContext</code> abstracts the message
- *  context that is processed by a handler in the <code>handle</code>
- *  method.
+/**
+ * The interface <code>MessageContext</code> abstracts the message
+ * context that is processed by a handler in the <code>handle</code>
+ * method.
  *
- *  <p>The <code>MessageContext</code> interface provides methods to
- *  manage a property set. <code>MessageContext</code> properties
- *  enable handlers in a handler chain to share processing related
- *  state.
+ * <p>The <code>MessageContext</code> interface provides methods to
+ * manage a property set. <code>MessageContext</code> properties
+ * enable handlers in a handler chain to share processing related
+ * state.
  *
- *  @since JAX-WS 2.0
-**/
+ * @since JAX-WS 2.0
+ */
 public interface MessageContext extends Map<String, Object> {
 
-  /** Standard property: message direction, <code>true</code> for
-   *  outbound messages, <code>false</code> for inbound.
-   *  <p>Type: boolean
-  **/
-  public static final String MESSAGE_OUTBOUND_PROPERTY =
-                      "javax.xml.ws.handler.message.outbound";
+    /**
+     * Standard property: message direction, <code>true</code> for
+     * outbound messages, <code>false</code> for inbound.
+     * <p>Type: boolean
+     */
+    public static final String MESSAGE_OUTBOUND_PROPERTY =
+            "javax.xml.ws.handler.message.outbound";
 
-  /** Standard property: Map of attachments to a message for the inbound
-   * message, key is  the MIME Content-ID, value is a DataHandler.
-   *  <p>Type: java.util.Map<String,DataHandler>
-  **/
-  public static final String INBOUND_MESSAGE_ATTACHMENTS =
-        "javax.xml.ws.binding.attachments.inbound";
+    /**
+     * Standard property: Map of attachments to a message for the inbound
+     * message, key is  the MIME Content-ID, value is a DataHandler.
+     * <p>Type: java.util.Map<String,DataHandler>
+     */
+    public static final String INBOUND_MESSAGE_ATTACHMENTS =
+            "javax.xml.ws.binding.attachments.inbound";
 
-  /** Standard property: Map of attachments to a message for the outbound
-   * message, key is the MIME Content-ID, value is a DataHandler.
-   *  <p>Type: java.util.Map<String,DataHandler>
-  **/
-  public static final String OUTBOUND_MESSAGE_ATTACHMENTS =
-        "javax.xml.ws.binding.attachments.outbound";
+    /**
+     * Standard property: Map of attachments to a message for the outbound
+     * message, key is the MIME Content-ID, value is a DataHandler.
+     * <p>Type: java.util.Map<String,DataHandler>
+     */
+    public static final String OUTBOUND_MESSAGE_ATTACHMENTS =
+            "javax.xml.ws.binding.attachments.outbound";
 
-  /** Standard property: input source for WSDL document.
-   *  <p>Type: org.xml.sax.InputSource
-  **/
-  public static final String WSDL_DESCRIPTION =
-        "javax.xml.ws.wsdl.description";
+    /**
+     * Standard property: input source for WSDL document.
+     * <p>Type: org.xml.sax.InputSource
+     */
+    public static final String WSDL_DESCRIPTION =
+            "javax.xml.ws.wsdl.description";
 
-  /** Standard property: name of WSDL service.
-   *  <p>Type: javax.xml.namespace.QName
-  **/
-  public static final String WSDL_SERVICE =
-        "javax.xml.ws.wsdl.service";
+    /**
+     * Standard property: name of WSDL service.
+     * <p>Type: javax.xml.namespace.QName
+     */
+    public static final String WSDL_SERVICE =
+            "javax.xml.ws.wsdl.service";
 
-  /** Standard property: name of WSDL port.
-   *  <p>Type: javax.xml.namespace.QName
-  **/
-  public static final String WSDL_PORT =
-        "javax.xml.ws.wsdl.port";
+    /**
+     * Standard property: name of WSDL port.
+     * <p>Type: javax.xml.namespace.QName
+     */
+    public static final String WSDL_PORT =
+            "javax.xml.ws.wsdl.port";
 
-  /** Standard property: name of wsdl interface (2.0) or port type (1.1).
-   *  <p>Type: javax.xml.namespace.QName
-  **/
-  public static final String WSDL_INTERFACE =
-        "javax.xml.ws.wsdl.interface";
+    /**
+     * Standard property: name of wsdl interface (2.0) or port type (1.1).
+     * <p>Type: javax.xml.namespace.QName
+     */
+    public static final String WSDL_INTERFACE =
+            "javax.xml.ws.wsdl.interface";
 
-  /** Standard property: name of WSDL operation.
-   *  <p>Type: javax.xml.namespace.QName
-  **/
-  public static final String WSDL_OPERATION =
-        "javax.xml.ws.wsdl.operation";
+    /**
+     * Standard property: name of WSDL operation.
+     * <p>Type: javax.xml.namespace.QName
+     */
+    public static final String WSDL_OPERATION =
+            "javax.xml.ws.wsdl.operation";
 
-  /** Standard property: HTTP response status code.
-   *  <p>Type: java.lang.Integer
-  **/
-  public static final String HTTP_RESPONSE_CODE =
-        "javax.xml.ws.http.response.code";
+    /**
+     * Standard property: HTTP response status code.
+     * <p>Type: java.lang.Integer
+     */
+    public static final String HTTP_RESPONSE_CODE =
+            "javax.xml.ws.http.response.code";
 
-  /** Standard property: HTTP request headers.
-   *  <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
-  **/
-  public static final String HTTP_REQUEST_HEADERS =
-        "javax.xml.ws.http.request.headers";
+    /**
+     * Standard property: HTTP request headers.
+     * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
+     */
+    public static final String HTTP_REQUEST_HEADERS =
+            "javax.xml.ws.http.request.headers";
 
-  /** Standard property: HTTP response headers.
-   *  <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
-  **/
-  public static final String HTTP_RESPONSE_HEADERS =
-        "javax.xml.ws.http.response.headers";
+    /**
+     * Standard property: HTTP response headers.
+     * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
+     */
+    public static final String HTTP_RESPONSE_HEADERS =
+            "javax.xml.ws.http.response.headers";
 
-  /** Standard property: HTTP request method.
-   *  <p>Type: java.lang.String
-  **/
-  public static final String HTTP_REQUEST_METHOD =
-        "javax.xml.ws.http.request.method";
+    /**
+     * Standard property: HTTP request method.
+     * <p>Type: java.lang.String
+     */
+    public static final String HTTP_REQUEST_METHOD =
+            "javax.xml.ws.http.request.method";
 
-  /** Standard property: servlet request object.
-   *  <p>Type: javax.servlet.http.HttpServletRequest
-  **/
-  public static final String SERVLET_REQUEST =
-        "javax.xml.ws.servlet.request";
+    /**
+     * Standard property: servlet request object.
+     * <p>Type: javax.servlet.http.HttpServletRequest
+     */
+    public static final String SERVLET_REQUEST =
+            "javax.xml.ws.servlet.request";
 
-  /** Standard property: servlet response object.
-   *  <p>Type: javax.servlet.http.HttpServletResponse
-  **/
-  public static final String SERVLET_RESPONSE =
-        "javax.xml.ws.servlet.response";
+    /**
+     * Standard property: servlet response object.
+     * <p>Type: javax.servlet.http.HttpServletResponse
+     */
+    public static final String SERVLET_RESPONSE =
+            "javax.xml.ws.servlet.response";
 
-  /** Standard property: servlet context object.
-   *  <p>Type: javax.servlet.ServletContext
-  **/
-  public static final String SERVLET_CONTEXT =
-        "javax.xml.ws.servlet.context";
+    /**
+     * Standard property: servlet context object.
+     * <p>Type: javax.servlet.ServletContext
+     */
+    public static final String SERVLET_CONTEXT =
+            "javax.xml.ws.servlet.context";
 
-  /** Standard property: Query string for request.
-   *  <p>Type: String
-  **/
-  public static final String QUERY_STRING =
-        "javax.xml.ws.http.request.querystring";
+    /**
+     * Standard property: Query string for request.
+     * <p>Type: String
+     **/
+    public static final String QUERY_STRING =
+            "javax.xml.ws.http.request.querystring";
 
-  /** Standard property: Request Path Info
-   *  <p>Type: String
-  **/
-  public static final String PATH_INFO =
-        "javax.xml.ws.http.request.pathinfo";
+    /**
+     * Standard property: Request Path Info
+     * <p>Type: String
+     */
+    public static final String PATH_INFO =
+            "javax.xml.ws.http.request.pathinfo";
 
-  /**
-   * Property scope. Properties scoped as <code>APPLICATION</code> are
-   * visible to handlers,
-   * client applications and service endpoints; properties scoped as
-   * <code>HANDLER</code>
-   * are only normally visible to handlers.
-  **/
-  public enum Scope {APPLICATION, HANDLER};
+    /**
+     * Standard property: WS Addressing Reference Parameters.
+     * The list MUST include all SOAP headers marked with the
+     * wsa:IsReferenceParameter="true" attribute.
+     * <p>Type: List<Element>
+     *
+     * @since JAX-WS 2.1
+     */
+    public static final String REFERENCE_PARAMETERS =
+            "javax.xml.ws.reference.parameters";
 
-  /** Sets the scope of a property.
-   *
-   *  @param name Name of the property associated with the
-   *              <code>MessageContext</code>
-   *  @param scope Desired scope of the property
-   *  @throws java.lang.IllegalArgumentException if an illegal
-   *              property name is specified
-   *
-  **/
-  public void setScope(String name,  Scope scope);
+    /**
+     * Property scope. Properties scoped as <code>APPLICATION</code> are
+     * visible to handlers,
+     * client applications and service endpoints; properties scoped as
+     * <code>HANDLER</code>
+     * are only normally visible to handlers.
+     */
+    public enum Scope {APPLICATION, HANDLER};
 
-  /** Gets the scope of a property.
-   *
-   *  @param name Name of the property
-   *  @return Scope of the property
-   *  @throws java.lang.IllegalArgumentException if a non-existant
-   *              property name is specified
-   *
-  **/
-  public Scope getScope(String  name);
+    /**
+     * Sets the scope of a property.
+     *
+     * @param name Name of the property associated with the
+     *             <code>MessageContext</code>
+     * @param scope Desired scope of the property
+     * @throws java.lang.IllegalArgumentException if an illegal
+     *             property name is specified
+     */
+    public void setScope(String name,  Scope scope);
+
+    /**
+     * Gets the scope of a property.
+     *
+     * @param name Name of the property
+     * @return Scope of the property
+     * @throws java.lang.IllegalArgumentException if a non-existant
+     *             property name is specified
+     */
+    public Scope getScope(String  name);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/PortInfo.java b/jaxws/src/share/classes/javax/xml/ws/handler/PortInfo.java
index 469baad..f6f33b0 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/PortInfo.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/PortInfo.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/package.html b/jaxws/src/share/classes/javax/xml/ws/handler/package.html
index d37dcab..3f2f999 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 This package defines APIs for message handlers.
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java b/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java
index 9da41eb..e9431ed 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
   /** Gets the header blocks that can be processed by this Handler
    *  instance.
    *
-   *  @return Set of QNames of header blocks processed by this
+   *  @return Set of <code>QNames</code> of header blocks processed by this
    *           handler instance. <code>QName</code> is the qualified
    *           name of the outermost element of the Header block.
   **/
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java b/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java
index a5b0a3e..ba08209 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,12 +43,12 @@
 public interface SOAPMessageContext
                     extends javax.xml.ws.handler.MessageContext {
 
-  /** Gets the SOAPMessage from this message context. Modifications
-   *  to the returned SOAPMessage change the message in-place, there
+  /** Gets the <code>SOAPMessage<code> from this message context. Modifications
+   *  to the returned <code>SOAPMessage</code> change the message in-place, there
    *  is no need to susequently call <code>setMessage</code>.
    *
-   *  @return Returns the SOAPMessage; returns null if no
-   *          SOAPMessage is present in this message context
+   *  @return Returns the <code>SOAPMessage</code>; returns <code>null</code> if no
+   *          <code>SOAPMessage</code> is present in this message context
   **/
   public SOAPMessage getMessage();
 
@@ -56,7 +56,7 @@
    *
    *  @param  message SOAP message
    *  @throws WebServiceException If any error during the setting
-   *          of the SOAPMessage in this message context
+   *          of the <code>SOAPMessage</code> in this message context
    *  @throws java.lang.UnsupportedOperationException If this
    *          operation is not supported
   **/
@@ -77,8 +77,8 @@
    *          message is present in this message context or no headers match
    *          the supplied qualified name.
    *  @throws WebServiceException If an error occurs when using the supplied
-   *     JAXBContext to unmarshall. The cause of
-   *     the WebServiceException is the original JAXBException.
+   *     <code>JAXBContext</code> to unmarshall. The cause of
+   *     the <code>WebServiceException</code> is the original <code>JAXBException</code>.
   **/
   public Object[] getHeaders(QName header, JAXBContext context,
     boolean allRoles);
@@ -86,14 +86,14 @@
   /** Gets the SOAP actor roles associated with an execution
    *  of the handler chain.
    *  Note that SOAP actor roles apply to the SOAP node and
-   *  are managed using <code>SOAPBinding.setRoles</code> and
-   *  <code>SOAPBinding.getRoles</code>. Handler instances in
+   *  are managed using {@link javax.xml.ws.soap.SOAPBinding#setRoles} and
+   *  {@link javax.xml.ws.soap.SOAPBinding#getRoles}. <code>Handler</code> instances in
    *  the handler chain use this information about the SOAP actor
    *  roles to process the SOAP header blocks. Note that the
    *  SOAP actor roles are invariant during the processing of
    *  SOAP message through the handler chain.
    *
-   *  @return Array of String for SOAP actor roles
+   *  @return Array of <code>String</code> for SOAP actor roles
   **/
   public Set<String> getRoles();
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/handler/soap/package.html b/jaxws/src/share/classes/javax/xml/ws/handler/soap/package.html
index ed4fb04..a0c2d3b 100644
--- a/jaxws/src/share/classes/javax/xml/ws/handler/soap/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/handler/soap/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 This package defines APIs for SOAP message handlers.
diff --git a/jaxws/src/share/classes/javax/xml/ws/http/package.html b/jaxws/src/share/classes/javax/xml/ws/http/package.html
index 41b5f87..b612f28 100644
--- a/jaxws/src/share/classes/javax/xml/ws/http/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/http/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 This package defines APIs specific to the HTTP binding.
diff --git a/jaxws/src/share/classes/javax/xml/ws/package.html b/jaxws/src/share/classes/javax/xml/ws/package.html
index 49f69bb..da299d1 100644
--- a/jaxws/src/share/classes/javax/xml/ws/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 This package contains the core JAX-WS APIs.
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/Addressing.java b/jaxws/src/share/classes/javax/xml/ws/soap/Addressing.java
new file mode 100644
index 0000000..49c0756
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/Addressing.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.soap;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+
+import javax.xml.ws.Action;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+
+/**
+ * <p>
+ * This feature represents the use of WS-Addressing with either
+ * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding.  Using this feature
+ * with any other binding is NOT required.
+ * <p>
+ * The following describes the effects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, WS-Addressing will be enabled.
+ *       At runtime, WS-Addressing headers
+ *       MUST be consumed by the receiver and produced by the
+ *       sender even if the WSDL declares otherwise. The
+ *       mustUnderstand="0" attribute MUST be used on the response WS-Addressing
+ *       headers.
+ *  <li> DISABLED: In this Mode, WS-Addressing will be disabled
+ *       even if an associated WSDL specifies otherwise. At runtime,
+ *       WS-Addressing headers MUST NOT be used. WS-Addressing may be explicitly
+ *       disabled to prevent a JAX-WS implementation from consuming and producing
+ *       WS-Addressing headers. If an application
+ *       has implemented WS-Addressing itself, it MUST explicitly disable this feature.
+*        Not doing so may break compatibility with future versions of JAX-WS.
+ * </ul>
+ * <p>
+ * The <code>required</code> property can be used to
+ * specify if WS-Addressing headers MUST
+ * be present on incoming messages.  By default the
+ * <code>required</code> property is <code>false</code>.
+ * <p>
+ * The definition of this annotation is incomplete in this release of JAX-WS as
+ * there is no standard way to convey the use of WS-Addressing via a WSDL and there is no
+ * standard definition for the default value of WS-Addressing <code>Action</code> headers;
+ * however, the runtime behavior of this annotation is well-defined.
+ * It is intended that a future version of
+ * JAX-WS will require the use of the standard mechanism to convey the use
+ * of WS-Addressing via WSDL and default values for WS-Addressing <code>Action</code> headers
+ * as defined by the W3C WG on WS-Addressing.
+ * <p>
+ * To write a portable endpoint and its corresponding client with this version of JAX-WS,
+ * an endpoint MUST explicitly specify what WS-Addressing <code>Actions</code> are to be used
+ * via the {@link Action} and {@link FaultAction} annotations.  The client MUST explicitly
+ * enable addresssing via the {@link AddressingFeature}, and for each invocation, the client
+ * MUST explicitly set the {@link BindingProvider#SOAPACTION_URI_PROPERTY}.
+ * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing is specified in the WSDL,
+ * and what the default value must be for Action headers, a future version of JAX-WS will remove these requirements.
+ * <p>
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">Web Services Addressing - Core</a>
+ * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a>
+ * for more information on WS-Addressing.
+ *
+ * @since JAX-WS 2.1
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@WebServiceFeatureAnnotation(id=AddressingFeature.ID,bean=AddressingFeature.class)
+public @interface Addressing {
+    /**
+     * Specifies if this feature is enabled or disabled.
+     */
+    boolean enabled() default true;
+
+    /**
+     * Property to determine if WS-Addressing headers MUST
+     * be present on incoming messages.
+     */
+    boolean required() default false;
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/AddressingFeature.java b/jaxws/src/share/classes/javax/xml/ws/soap/AddressingFeature.java
new file mode 100644
index 0000000..b70c394
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/AddressingFeature.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.soap;
+
+import javax.xml.ws.Action;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
+
+/**
+ * This feature represents the use of WS-Addressing with either
+ * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding.  Using this feature
+ * with any other binding is NOT required.
+ * <p>
+ * Enabling this feature on the client will cause the JAX-WS runtime
+ * to include WS-Addressing headers in SOAP messages.
+ * <p>
+ * If the web service developer has not explicitly enabled this feature,
+ * it MAY be automatically enabled if the associated WSDL enables
+ * WS-Addressing with an implementation recognized WSDL extension element.
+ * However, in this version of JAX-WS, there is no standard WSDL
+ * extension that a client can rely on to automatically enable WS-Addressing,
+ * nor is there a standard default value specified for WS-Addressing
+ * <code>Action</code> headers.
+ * <p>
+ * To write a portable endpoint and its corresponding client with this
+ * version of JAX-WS, an endpoint MUST explicitly specify what WS-Addressing
+ * <code>Actions</code> are to be used via the {@link Action} and
+ * {@link FaultAction} annotations.  The client MUST explicitly enable
+ * addresssing via this <code>AddressingFeature</code>, and for each invocation,
+ * the client MUST explicitly set the {@link BindingProvider#SOAPACTION_URI_PROPERTY}.
+ * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing
+ * is specified in the WSDL, and what the default value must be for Action headers,
+ * a future version of JAX-WS will remove these requirements.
+ * <p>
+ * See {@link javax.xml.ws.RespectBindingFeature} for more information
+ * on required WSDL extensions.
+ * <p>
+ * The following describes the effects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, WS-Addressing will be enabled.
+ *       At runtime, WS-Addressing headers
+ *       MUST be consumed by the receiver and produced by the
+ *       sender even if the WSDL declares otherwise. The
+ *       mustUnderstand="0" attribute MUST be used on the WS-Addressing
+ *       headers.
+ *  <li> DISABLED: In this Mode, WS-Addressing will be disabled
+ *       even if an associated WSDL specifies otherwise. At runtime,
+ *       WS-Addressing headers MUST NOT be used.  WS-Addressing may be explicitly
+ *       disabled to prevent a JAX-WS implementation from consuming and producing
+ *       WS-Addressing headers. If an application
+ *       has implemented WS-Addressing itself, it MUST explicitly disable this feature.
+*        Not doing so may break compatibility with future versions of JAX-WS.
+ * </ul>
+ * <p>
+ * The {@link #required} property can be used to
+ * specify if WS-Addressing headers MUST be present
+ * on incoming messages.  This property only has meaning when used on the
+ * endpoint and has no affect when used on the client.
+ * By default the
+ * <code>required</code> property is <code>false</code>.
+  <p>
+
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">Web Services Addressing - Core</a>
+ * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a>
+ * for more information on WS-Addressing.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class AddressingFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the AddressingFeature
+     */
+    public static final String ID = "http://www.w3.org/2005/08/addressing/module";
+
+    /**
+     * Property for the <code>required</code> feature parameter. When WS-Addressing
+     * is enabled, the value of this property will be used
+     * to specify if WS-Addressing headers MUST be present on incoming messages.  This
+     * property only has meaning on the endpoint and has no
+     * affect when used on the client.
+     */
+    protected boolean required = false;
+
+    /**
+     * Create an <code>AddressingFeature</code>.
+     * The instance created will be enabled.
+     */
+    public AddressingFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Create an <code>AddressingFeature</code>
+     *
+     * @param enabled specifies whether this feature should
+     * be enabled or not.
+     */
+    public AddressingFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    /**
+     * Create an <code>AddressingFeature</code>
+     *
+     * @param enabled specifies whether this feature should
+     * be enabled or not.
+     * @param required specifies whether
+     * WS-Addressing headers MUST be present on incoming messages. This property
+     * only has meaning on the endpoint and has no affect when
+     * used on the client.
+     */
+    public AddressingFeature(boolean enabled, boolean required) {
+        this.enabled = enabled;
+        this.required = required;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+
+    /**
+     * Gets the boolean value used to determine if WS-Addressing
+     * headers MUST be present on incoming messages.  This property
+     * only has meaning on the endpoint, and has no affect
+     * when used on the client.
+     *
+     * @return the current required value
+     */
+    public boolean isRequired() {
+        return required;
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/MTOM.java b/jaxws/src/share/classes/javax/xml/ws/soap/MTOM.java
new file mode 100644
index 0000000..2df12de
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/MTOM.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.soap;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+/**
+ * This feature represents the use of MTOM with a
+ * web service.
+ *
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, MTOM will be enabled.
+ *  <li> DISABLED: In this Mode, MTOM will be disabled
+ * </ul>
+ * <p>
+ * The {@link #threshold} property can be used to set the threshold
+ * value used to determine when binary data should be XOP encoded.
+ *
+ * @since JAX-WS 2.1
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@WebServiceFeatureAnnotation(id=MTOMFeature.ID,bean=MTOMFeature.class)
+public @interface MTOM {
+    /**
+     * Specifies if this feature is enabled or disabled.
+     */
+    boolean enabled() default true;
+
+    /**
+     * Property for MTOM threshold value. When MTOM is enabled, binary data above this
+     * size in bytes will be XOP encoded or sent as attachment. The value of this property
+     * MUST always be >= 0. Default value is 0.
+     */
+    int threshold() default 0;
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/MTOMFeature.java b/jaxws/src/share/classes/javax/xml/ws/soap/MTOMFeature.java
new file mode 100644
index 0000000..c4e1ca5
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/MTOMFeature.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.soap;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
+
+
+/**
+ * This feature represents the use of MTOM with a
+ * web service.
+ *
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ *  <li> ENABLED: In this Mode, MTOM will be enabled.
+ *  <li> DISABLED: In this Mode, MTOM will be disabled
+ * </ul>
+ * <p>
+ * The {@link #threshold} property can be used to set the threshold
+ * value used to determine when binary data should be XOP encoded.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class MTOMFeature extends WebServiceFeature {
+    /**
+     * Constant value identifying the MTOMFeature
+     */
+    public static final String ID = "http://www.w3.org/2004/08/soap/features/http-optimization";
+
+
+    /**
+     * Property for MTOM threshold value. This property serves as a hint when
+     * MTOM is enabled, binary data above this size in bytes SHOULD be sent
+     * as attachment.
+     * The value of this property MUST always be >= 0. Default value is 0.
+     */
+    protected int threshold = 0;
+
+
+    /**
+     * Create an <code>MTOMFeature</code>.
+     * The instance created will be enabled.
+     */
+    public MTOMFeature() {
+        this.enabled = true;
+    }
+
+    /**
+     * Creates an <code>MTOMFeature</code>.
+     *
+     * @param enabled specifies if this feature should be enabled or not
+     */
+    public MTOMFeature(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+
+    /**
+     * Creates an <code>MTOMFeature</code>.
+     * The instance created will be enabled.
+     *
+     * @param threshold the size in bytes that binary data SHOULD be before
+     * being sent as an attachment.
+     *
+     * @throws WebServiceException if threshold is < 0
+     */
+    public MTOMFeature(int threshold) {
+        if (threshold < 0)
+            throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+        this.enabled = true;
+        this.threshold = threshold;
+    }
+
+    /**
+     * Creates an <code>MTOMFeature</code>.
+     *
+     * @param enabled specifies if this feature should be enabled or not
+     * @param threshold the size in bytes that binary data SHOULD be before
+     * being sent as an attachment.
+     *
+     * @throws WebServiceException if threshold is < 0
+     */
+    public MTOMFeature(boolean enabled, int threshold) {
+        if (threshold < 0)
+            throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+        this.enabled = enabled;
+        this.threshold = threshold;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID() {
+        return ID;
+    }
+
+    /**
+     * Gets the threshold value used to determine when binary data
+     * should be sent as an attachment.
+     *
+     * @return the current threshold size in bytes
+     */
+    public int getThreshold() {
+        return threshold;
+    }
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/SOAPBinding.java b/jaxws/src/share/classes/javax/xml/ws/soap/SOAPBinding.java
index 166f2ce..152fe07 100644
--- a/jaxws/src/share/classes/javax/xml/ws/soap/SOAPBinding.java
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/SOAPBinding.java
@@ -60,6 +60,7 @@
    */
   public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
 
+
   /** Gets the roles played by the SOAP binding instance.
    *
    *  @return Set<String> The set of roles played by the binding instance.
@@ -87,9 +88,10 @@
    *
    * @param flag   A <code>boolean</code> specifying whether the use of MTOM should
    *               be enabled or disabled.
-   *  @throws WebServiceException If the specified setting is not supported
+   * @throws WebServiceException If the specified setting is not supported
    *                  by this binding instance.
-  **/
+   *
+   **/
   public void setMTOMEnabled(boolean flag);
 
   /**
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java b/jaxws/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java
index a42de1d..ab03e0f 100644
--- a/jaxws/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/jaxws/src/share/classes/javax/xml/ws/soap/package.html b/jaxws/src/share/classes/javax/xml/ws/soap/package.html
index 7e46cdb..2ce7b17 100644
--- a/jaxws/src/share/classes/javax/xml/ws/soap/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/soap/package.html
@@ -1,3 +1,27 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
 This package defines APIs specific to the SOAP binding.
diff --git a/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java b/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java
index 5cd2666..77c4bdb 100644
--- a/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java
+++ b/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,12 +47,7 @@
                                       ClassLoader classLoader)
     {
         try {
-            Class spiClass;
-            if (classLoader == null) {
-                spiClass = Class.forName(className);
-            } else {
-                spiClass = classLoader.loadClass(className);
-            }
+            Class spiClass = safeLoadClass(className, classLoader);
             return spiClass.newInstance();
         } catch (ClassNotFoundException x) {
             throw new WebServiceException(
@@ -67,7 +62,7 @@
     /**
      * Finds the implementation <code>Class</code> object for the given
      * factory name, or if that fails, finds the <code>Class</code> object
-     * for the given fallback class name. The arguments supplied must be
+     * for the given fallback class name. The arguments supplied MUST be
      * used in order. If using the first argument is successful, the second
      * one will not be used.
      * <P>
@@ -152,4 +147,33 @@
 
         return newInstance(fallbackClassName, classLoader);
     }
+
+
+    private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.ws.spi.ProviderImpl";
+
+    /**
+     * Loads the class, provided that the calling thread has an access to the class being loaded.
+     */
+    private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+        try {
+            // make sure that the current thread has an access to the package of the given name.
+            SecurityManager s = System.getSecurityManager();
+            if (s != null) {
+                int i = className.lastIndexOf('.');
+                if (i != -1) {
+                    s.checkPackageAccess(className.substring(0,i));
+                }
+            }
+
+            if (classLoader == null)
+                return Class.forName(className);
+            else
+                return classLoader.loadClass(className);
+        } catch (SecurityException se) {
+            // anyone can access the platform default factory class without permission
+            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
+                return Class.forName(className);
+            throw se;
+        }
+    }
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/spi/Provider.java b/jaxws/src/share/classes/javax/xml/ws/spi/Provider.java
index e17c771..1d6485b 100644
--- a/jaxws/src/share/classes/javax/xml/ws/spi/Provider.java
+++ b/jaxws/src/share/classes/javax/xml/ws/spi/Provider.java
@@ -25,9 +25,16 @@
 
 package javax.xml.ws.spi;
 
+import java.net.URL;
+import java.util.List;
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
 import javax.xml.namespace.QName;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.w3c.dom.Element;
 
 /**
  * Service provider for <code>ServiceDelegate</code> and
@@ -38,20 +45,20 @@
  */
 public abstract class Provider {
 
-  /**
-   * A constant representing the property used to lookup the
-   * name of a <code>Provider</code> implementation
-   * class.
-   */
-  static public final String JAXWSPROVIDER_PROPERTY
-        = "javax.xml.ws.spi.Provider";
+    /**
+     * A constant representing the property used to lookup the
+     * name of a <code>Provider</code> implementation
+     * class.
+     */
+    static public final String JAXWSPROVIDER_PROPERTY
+            = "javax.xml.ws.spi.Provider";
 
-  /**
-   * A constant representing the name of the default
-   * <code>Provider</code> implementation class.
-  **/
-  static private final String DEFAULT_JAXWSPROVIDER
-        = "com.sun.xml.internal.ws.spi.ProviderImpl";
+    /**
+     * A constant representing the name of the default
+     * <code>Provider</code> implementation class.
+     **/
+    static private final String DEFAULT_JAXWSPROVIDER
+            = "com.sun.xml.internal.ws.spi.ProviderImpl";
 
 
     /**
@@ -92,16 +99,27 @@
      */
     public static Provider provider() {
         try {
-            return (Provider)
-            FactoryFinder.find(JAXWSPROVIDER_PROPERTY,
-                               DEFAULT_JAXWSPROVIDER);
+            Object provider =
+                    FactoryFinder.find(JAXWSPROVIDER_PROPERTY,
+                    DEFAULT_JAXWSPROVIDER);
+            if (!(provider instanceof Provider)) {
+                Class pClass = Provider.class;
+                String classnameAsResource = pClass.getName().replace('.', '/') + ".class";
+                ClassLoader loader = pClass.getClassLoader();
+                if(loader == null) {
+                    loader = ClassLoader.getSystemClassLoader();
+                }
+                URL targetTypeURL  = loader.getResource(classnameAsResource);
+                throw new LinkageError("ClassCastException: attempting to cast" +
+                       provider.getClass().getClassLoader().getResource(classnameAsResource) +
+                       "to" + targetTypeURL.toString() );
+            }
+            return (Provider) provider;
         } catch (WebServiceException ex) {
             throw ex;
         } catch (Exception ex) {
-            throw new WebServiceException("Unable to create Provider: "+
-                                ex.getMessage());
+            throw new WebServiceException("Unable to createEndpointReference Provider", ex);
         }
-
     }
 
     /**
@@ -110,13 +128,13 @@
      * @param wsdlDocumentLocation A URL pointing to the WSDL document
      *        for the service, or <code>null</code> if there isn't one.
      * @param serviceName The qualified name of the service.
-     * @param serviceClass The service class, which must be either
+     * @param serviceClass The service class, which MUST be either
      *        <code>javax.xml.ws.Service</code> or a subclass thereof.
      * @return The newly created service delegate.
      */
     public abstract ServiceDelegate createServiceDelegate(
-                                    java.net.URL wsdlDocumentLocation,
-                                    QName serviceName, Class serviceClass);
+            java.net.URL wsdlDocumentLocation,
+            QName serviceName, Class serviceClass);
 
 
     /**
@@ -127,27 +145,160 @@
      * @param bindingId A URI specifying the desired binding (e.g. SOAP/HTTP)
      * @param implementor A service implementation object to which
      *        incoming requests will be dispatched. The corresponding
-     *        class must be annotated with all the necessary Web service
+     *        class MUST be annotated with all the necessary Web service
      *        annotations.
      * @return The newly created endpoint.
      */
     public abstract Endpoint createEndpoint(String bindingId,
-                                            Object implementor);
+            Object implementor);
+
 
     /**
      * Creates and publishes an endpoint object with the specified
      * address and implementation object.
      *
      * @param address A URI specifying the address and transport/protocol
-     *        to use. A http: URI must result in the SOAP 1.1/HTTP
+     *        to use. A http: URI MUST result in the SOAP 1.1/HTTP
      *        binding being used. Implementations may support other
      *        URI schemes.
      * @param implementor A service implementation object to which
      *        incoming requests will be dispatched. The corresponding
-     *        class must be annotated with all the necessary Web service
+     *        class MUST be annotated with all the necessary Web service
      *        annotations.
      * @return The newly created endpoint.
      */
     public abstract Endpoint createAndPublishEndpoint(String address,
-                                                      Object implementor);
+            Object implementor);
+    /**
+     * read an EndpointReference from the infoset contained in
+     * <code>eprInfoset</code>.
+     *
+     * @return the <code>EndpointReference</code> unmarshalled from
+     * <code>eprInfoset</code>.  This method never returns <code>null</code>.
+     *
+     * @throws WebServiceException If there is an error creating the
+     * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
+     *
+     * @throws NullPointerException If the <code>null</code>
+     * <code>eprInfoset</code> value is given.
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
+
+
+    /**
+     * The getPort method returns a proxy.  If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The parameter  <code>serviceEndpointInterface</code> specifies
+     * the service endpoint interface that is supported by the
+     * returned proxy.
+     * The parameter <code>endpointReference</code> specifies the
+     * endpoint that will be invoked by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly from
+     * the WSDL metadata of the
+     * <code>serviceEndpointInterface</code> and the <code>EndpointReference</code>.
+     * For this method
+     * to successfully return a proxy, WSDL metadata MUST be available and the
+     * <code>endpointReference</code> MUST contain an implementation understood
+     * <code>serviceName</code> metadata.
+     *
+     *
+     * @param endpointReference the EndpointReference that will
+     * be invoked by the returned proxy.
+     * @param serviceEndpointInterface Service endpoint interface
+     * @param features  A list of WebServiceFeatures to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that supports the
+     *                  specified service endpoint interface
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method}
+     *                  <LI>If this
+     *                      <code>endpointReference</code>
+     *                      is illegal
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified
+     *                  <LI>If a feature is enabled that is not compatible with
+     *                      this port or is unsupported.
+     *                   </UL>
+     *
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> T getPort(EndpointReference endpointReference,
+            Class<T> serviceEndpointInterface,
+            WebServiceFeature... features);
+
+    /**
+     * Factory method to create a <code>W3CEndpointReference</code>.
+     *
+     * <p>
+     * This method can be used to create a <code>W3CEndpointReference</code>
+     * for any endpoint by specifying the <code>address</code> property along
+     * with any other desired properties.  This method
+     * can also be used to create a <code>W3CEndpointReference</code> for
+     * an endpoint that is published by the same Java EE application.
+     * To do so the <code>address</code> property can be provided or this
+     * method can automatically determine the <code>address</code> of
+     * an endpoint that is published by the same Java EE application and is
+     * identified by the <code>serviceName</code> and
+     * <code>portName</code> propeties.  If the <code>address</code> is
+     * <code>null</code> and the <code>serviceName</code> and
+     * <code>portName</code> do not identify an endpoint published by the
+     * same Java EE application, a
+     * <code>javax.lang.IllegalStateException</code> MUST be thrown.
+     *
+     * @param address Specifies the address of the target endpoint
+     * @param serviceName Qualified name of the service in the WSDL.
+     * @param portName Qualified name of the endpoint in the WSDL.
+     * @param metadata A list of elements that should be added to the
+     * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
+     * element.
+     * @param wsdlDocumentLocation URL for the WSDL document location for
+     * the service.
+     * @param referenceParameters Reference parameters to be associated
+     * with the returned <code>EndpointReference</code> instance.
+     *
+     * @return the <code>W3CEndpointReference<code> created from
+     *          <code>serviceName</code>, <code>portName</code>,
+     *          <code>metadata</code>, <code>wsdlDocumentLocation</code>
+     *          and <code>referenceParameters</code>. This method
+     *          never returns <code>null</code>.
+     *
+     * @throws java.lang.IllegalStateException
+     *     <ul>
+     *        <li>If the <code>address</code>, <code>serviceName</code> and
+     *            <code>portName</code> are all <code>null</code>.
+     *        <li>If the <code>serviceName</code> service is <code>null</code> and the
+     *            <code>portName> is NOT <code>null</code>.
+     *        <li>If the <code>address</code> property is <code>null</code> and
+     *            the <code>serviceName</code> and <code>portName</code> do not
+     *            specify a valid endpoint published by the same Java EE
+     *            application.
+     *        <li>If the <code>serviceName</code>is NOT <code>null</code>
+     *             and is not present in the specified WSDL.
+     *        <li>If the <code>portName</code> port is not <code>null<code> and it
+     *             is not present in <code>serviceName</code> service in the WSDL.
+     *        <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+     *            and does not represent a valid WSDL.
+     *     </ul>
+     * @throws WebServiceException If an error occurs while creating the
+     *                             <code>W3CEndpointReference</code>.
+     *
+     * @since JAX-WS 2.1
+     */
+    public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName,
+            List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters);
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java b/jaxws/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java
index daa21a3..0742e7f 100644
--- a/jaxws/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java
+++ b/jaxws/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java
@@ -30,14 +30,18 @@
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Service;
 import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.WebServiceFeature;
 import javax.xml.bind.JAXBContext;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+
 
 /**
  * Service delegates are used internally by <code>Service</code> objects
  * to allow pluggability of JAX-WS implementations.
  * <p>
  * Every <code>Service</code> object has its own delegate, created using
- * the javax.xml.ws.Provider#createServiceDelegate method. A <code>Service</code>
+ * the {@link javax.xml.ws.spi.Provider#createServiceDelegate} method. A <code>Service</code>
  * object delegates all of its instance methods to its delegate.
  *
  * @see javax.xml.ws.Service
@@ -50,200 +54,569 @@
     protected ServiceDelegate() {
     }
 
-  /** The getPort method returns a stub. A service client
-   *  uses this stub to invoke operations on the target
-   *  service endpoint. The <code>serviceEndpointInterface</code>
-   *  specifies the service endpoint interface that is supported by
-   *  the created dynamic proxy or stub instance.
-   *
-   *  @param portName  Qualified name of the service endpoint in
-   *                   the WSDL service description
-   *  @param serviceEndpointInterface Service endpoint interface
-   *                   supported by the dynamic proxy or stub
-   *                   instance
-   *  @return Object Proxy instance that
-   *                 supports the specified service endpoint
-   *                 interface
-   *  @throws WebServiceException This exception is thrown in the
-   *                   following cases:
-   *                   <UL>
-   *                   <LI>If there is an error in creation of
-   *                       the proxy
-   *                   <LI>If there is any missing WSDL metadata
-   *                       as required by this method
-   *                   <LI>Optionally, if an illegal
-   *                       <code>serviceEndpointInterface</code>
-   *                       or <code>portName</code> is specified
-   *                   </UL>
-   *  @see java.lang.reflect.Proxy
-   *  @see java.lang.reflect.InvocationHandler
-  **/
+    /**
+     * The <code>getPort</code> method returns a proxy. A service client
+     * uses this proxy to invoke operations on the target
+     * service endpoint. The <code>serviceEndpointInterface</code>
+     * specifies the service endpoint interface that is supported by
+     * the created dynamic proxy instance.
+     *
+     * @param portName  Qualified name of the service endpoint in
+     *                  the WSDL service description
+     * @param serviceEndpointInterface Service endpoint interface
+     *                  supported by the dynamic proxy
+     * @return Object Proxy instance that
+     *                supports the specified service endpoint
+     *                interface
+     * @throws WebServiceException This exception is thrown in the
+     *                  following cases:
+     *                  <UL>
+     *                  <LI>If there is an error in creation of
+     *                      the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      or <code>portName</code> is specified
+     *                  </UL>
+     * @see java.lang.reflect.Proxy
+     * @see java.lang.reflect.InvocationHandler
+     **/
+    public abstract <T> T getPort(QName portName,
+            Class<T> serviceEndpointInterface);
+
+    /**
+     * The <code>getPort</code> method returns a proxy. A service client
+     * uses this proxy to invoke operations on the target
+     * service endpoint. The <code>serviceEndpointInterface</code>
+     * specifies the service endpoint interface that is supported by
+     * the created dynamic proxy instance.
+     *
+     * @param portName  Qualified name of the service endpoint in
+     *                  the WSDL service description
+     * @param serviceEndpointInterface Service endpoint interface
+     *                  supported by the dynamic proxy or instance
+     * @param features  A list of WebServiceFeatures to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that
+     *                supports the specified service endpoint
+     *                interface
+     * @throws WebServiceException This exception is thrown in the
+     *                  following cases:
+     *                  <UL>
+     *                  <LI>If there is an error in creation of
+     *                      the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      or <code>portName</code> is specified
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     * @see java.lang.reflect.Proxy
+     * @see java.lang.reflect.InvocationHandler
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> T getPort(QName portName,
+            Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+    /**
+     * The <code>getPort</code> method returns a proxy.
+     * The parameter <code>endpointReference</code> specifies the
+     * endpoint that will be invoked by the returned proxy.  If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * The parameter <code>serviceEndpointInterface</code> specifies
+     * the service endpoint interface that is supported by the
+     * returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code> metadata
+     * also has a WSDL, then the WSDL from this instance MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * The returned proxy should not be reconfigured by the client.
+     * If this <code>Service</code> instance has a known proxy
+     * port that matches the information contained in
+     * the WSDL,
+     * then that proxy is returned, otherwise a WebServiceException
+     * is thrown.
+     * <p>
+     * Calling this method has the same behavior as the following
+     * <pre>
+     * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * metadata of the <code>endpointReference</code> or from the
+     * <code>serviceEndpointInterface</code> and the WSDL
+     * associated with this <code>Service</code> instance.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned proxy.
+     * @param serviceEndpointInterface Service endpoint interface.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object Proxy instance that supports the
+     *                  specified service endpoint interface.
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy.
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                  <LI>If the <code>endpointReference</code> metadata does
+     *                      not match the <code>serviceName</code> of this
+     *                      <code>Service</code> instance.
+     *                  <LI>If a <code>portName</code> cannot be extracted
+     *                      from the WSDL or <code>endpointReference</code> metadata.
+     *                  <LI>If an invalid
+     *                      <code>endpointReference</code>
+     *                      is specified.
+     *                  <LI>If an invalid
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified.
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> T getPort(EndpointReference endpointReference,
+           Class<T> serviceEndpointInterface, WebServiceFeature... features);
 
 
-  public abstract <T> T getPort(QName portName,
-                                 Class<T> serviceEndpointInterface);
+    /**
+     * The <code>getPort</code> method returns a proxy. The parameter
+     * <code>serviceEndpointInterface</code> specifies the service
+     * endpoint interface that is supported by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly.
+     * The returned proxy should not be reconfigured by the client.
+     *
+     * @param serviceEndpointInterface Service endpoint interface
+     * @return Object instance that supports the
+     *                  specified service endpoint interface
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified
+     *                  </UL>
+     **/
+    public abstract <T> T getPort(Class<T> serviceEndpointInterface);
 
 
-  /** The getPort method returns a stub. The parameter
-   *  <code>serviceEndpointInterface</code> specifies the service
-   *  endpoint interface that is supported by the returned proxy.
-   *  In the implementation of this method, the JAX-WS
-   *  runtime system takes the responsibility of selecting a protocol
-   *  binding (and a port) and configuring the proxy accordingly.
-   *  The returned proxy should not be reconfigured by the client.
-   *
-   *  @param serviceEndpointInterface Service endpoint interface
-   *  @return Object instance that supports the
-   *                   specified service endpoint interface
-   *  @throws WebServiceException
-   *                   <UL>
-   *                   <LI>If there is an error during creation
-   *                       of the proxy
-   *                   <LI>If there is any missing WSDL metadata
-   *                       as required by this method
-   *                   <LI>Optionally, if an illegal
-   *                       <code>serviceEndpointInterface</code>
-   *                       is specified
-   *                   </UL>
-  **/
-  public abstract <T> T getPort(Class<T> serviceEndpointInterface);
-
-  /** Creates a new port for the service. Ports created in this way contain
-   *  no WSDL port type information and can only be used for creating
-   *  <code>Dispatch</code>instances.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param bindingId A URI identifier of a binding.
-   *  @param endpointAddress Address of the target service endpoint as a URI
-   *  @throws WebServiceException If any error in the creation of
-   *  the port
-   *
-   *  @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
-   *  @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
-   *  @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
-   **/
-  public abstract void addPort(QName portName, String bindingId,
-      String endpointAddress);
-
-  /** Creates a <code>Dispatch</code> instance for use with objects of
-   *  the users choosing.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param type The class of object used to messages or message
-   *  payloads. Implementations are required to support
-   *  javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
-   *  @param mode Controls whether the created dispatch instance is message
-   *  or payload oriented, i.e. whether the user will work with complete
-   *  protocol messages or message payloads. E.g. when using the SOAP
-   *  protocol, this parameter controls whether the user will work with
-   *  SOAP messages or the contents of a SOAP body. Mode must be MESSAGE
-   *  when type is SOAPMessage.
-   *
-   *  @return Dispatch instance
-   *  @throws WebServiceException If any error in the creation of
-   *                   the <code>Dispatch</code> object
-   *  @see javax.xml.transform.Source
-   *  @see javax.xml.soap.SOAPMessage
-   **/
-  public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode);
-
-  /** Creates a <code>Dispatch</code> instance for use with JAXB
-   *  generated objects.
-   *
-   *  @param portName  Qualified name for the target service endpoint
-   *  @param context The JAXB context used to marshall and unmarshall
-   *  messages or message payloads.
-   *  @param mode Controls whether the created dispatch instance is message
-   *  or payload oriented, i.e. whether the user will work with complete
-   *  protocol messages or message payloads. E.g. when using the SOAP
-   *  protocol, this parameter controls whether the user will work with
-   *  SOAP messages or the contents of a SOAP body.
-   *
-   *  @return Dispatch instance
-   *  @throws ServiceException If any error in the creation of
-   *                   the <code>Dispatch</code> object
-   *
-   *  @see javax.xml.bind.JAXBContext
-   **/
-  public abstract Dispatch<Object> createDispatch(QName portName,
-              JAXBContext context, Service.Mode mode);
+    /**
+     * The <code>getPort</code> method returns a proxy. The parameter
+     * <code>serviceEndpointInterface</code> specifies the service
+     * endpoint interface that is supported by the returned proxy.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the proxy accordingly.
+     * The returned proxy should not be reconfigured by the client.
+     *
+     * @param serviceEndpointInterface Service endpoint interface
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     * @return Object instance that supports the
+     *                  specified service endpoint interface
+     * @throws WebServiceException
+     *                  <UL>
+     *                  <LI>If there is an error during creation
+     *                      of the proxy
+     *                  <LI>If there is any missing WSDL metadata
+     *                      as required by this method
+     *                  <LI>If an illegal
+     *                      <code>serviceEndpointInterface</code>
+     *                      is specified
+     *                  <LI>If a feature is enabled that is not compatible
+     *                      with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> T getPort(Class<T> serviceEndpointInterface,
+            WebServiceFeature... features);
 
 
-  /** Gets the name of this service.
-   *  @return Qualified name of this service
-  **/
-  public abstract QName getServiceName();
+    /**
+     * Creates a new port for the service. Ports created in this way contain
+     * no WSDL port type information and can only be used for creating
+     * <code>Dispatch</code>instances.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param bindingId A URI identifier of a binding.
+     * @param endpointAddress Address of the target service endpoint as a URI
+     * @throws WebServiceException If any error in the creation of
+     * the port
+     *
+     * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
+     * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
+     * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
+     **/
+    public abstract void addPort(QName portName, String bindingId,
+            String endpointAddress);
 
-  /** Returns an <code>Iterator</code> for the list of
-   *  <code>QName</code>s of service endpoints grouped by this
-   *  service
-   *
-   *  @return Returns <code>java.util.Iterator</code> with elements
-   *          of type <code>javax.xml.namespace.QName</code>
-   *  @throws WebServiceException If this Service class does not
-   *          have access to the required WSDL metadata
-  **/
-  public abstract Iterator<javax.xml.namespace.QName> getPorts();
 
-  /** Gets the location of the WSDL document for this Service.
-   *
-   *  @return URL for the location of the WSDL document for
-   *          this service
-  **/
-  public abstract java.net.URL getWSDLDocumentLocation();
 
-  /**
-   * Returns the configured handler resolver.
-   *
-   *  @return HandlerResolver The <code>HandlerResolver</code> being
-   *          used by this <code>Service</code> instance, or <code>null</code>
-   *          if there isn't one.
-  **/
-  public abstract HandlerResolver getHandlerResolver();
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param type The class of object used for messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+     * when type is <code>SOAPMessage</code>.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     **/
+    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+            Service.Mode mode);
 
-  /**
-   *  Sets the <code>HandlerResolver</code> for this <code>Service</code>
-   *  instance.
-   *  <p>
-   *  The handler resolver, if present, will be called once for each
-   *  proxy or dispatch instance that is created, and the handler chain
-   *  returned by the resolver will be set on the instance.
-   *
-   *  @param handlerResolver The <code>HandlerResolver</code> to use
-   *         for all subsequently created proxy/dispatch objects.
-   *
-   *  @see javax.xml.ws.handler.HandlerResolver
-  **/
-  public abstract void setHandlerResolver(HandlerResolver handlerResolver);
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param type The class of object used for messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+     * when type is <code>SOAPMessage</code>.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object or if a
+     *                  feature is enabled that is not compatible with
+     *                  this port or is unsupported.
+     *
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+            Service.Mode mode, WebServiceFeature... features);
 
-  /**
-   * Returns the executor for this <code>Service</code>instance.
-   *
-   * The executor is used for all asynchronous invocations that
-   * require callbacks.
-   *
-   * @return The <code>java.util.concurrent.Executor</code> to be
-   *         used to invoke a callback.
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public abstract java.util.concurrent.Executor getExecutor();
+    /**
+     * Creates a <code>Dispatch</code> instance for use with objects of
+     * the user's choosing. If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the dispatch accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code>
+     * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * An implementation MUST be able to retrieve the <code>portName</code> from the
+     * <code>endpointReference</code> metadata.
+     * <p>
+     * This method behaves the same as calling
+     * <pre>
+     * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * WSDL or <code>EndpointReference</code> metadata.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned <code>Dispatch</code> object.
+     * @param type The class of object used to messages or message
+     * payloads. Implementations are required to support
+     * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+     * when type is <code>SOAPMessage</code>.
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException
+     *                  <UL>
+     *                    <LI>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                    <li>If the <code>endpointReference</code> metadata does
+     *                      not match the <code>serviceName</code> or <code>portName</code>
+     *                      of a WSDL associated
+     *                      with this <code>Service</code> instance.
+     *                    <li>If the <code>portName</code> cannot be determined
+     *                    from the <code>EndpointReference</code> metadata.
+     *                    <li>If any error in the creation of
+     *                     the <code>Dispatch</code> object.
+     *                    <li>If a feature is enabled that is not
+     *                    compatible with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see javax.xml.transform.Source
+     * @see javax.xml.soap.SOAPMessage
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
+            Class<T> type, Service.Mode mode,
+            WebServiceFeature... features);
 
-  /**
-   * Sets the executor for this <code>Service</code> instance.
-   *
-   * The executor is used for all asynchronous invocations that
-   * require callbacks.
-   *
-   * @param executor The <code>java.util.concurrent.Executor</code>
-   *        to be used to invoke a callback.
-   *
-   * @throws SecurityException If the instance does not support
-   *         setting an executor for security reasons (e.g. the
-   *         necessary permissions are missing).
-   *
-   * @see java.util.concurrent.Executor
-   **/
-   public abstract void setExecutor(java.util.concurrent.Executor executor);
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object
+     *
+     * @see javax.xml.bind.JAXBContext
+     **/
+    public abstract Dispatch<Object> createDispatch(QName portName,
+            JAXBContext context, Service.Mode mode);
+
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects.
+     *
+     * @param portName  Qualified name for the target service endpoint
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException If any error in the creation of
+     *                  the <code>Dispatch</code> object or if a
+     *                  feature is enabled that is not compatible with
+     *                  this port or is unsupported.
+     *
+     * @see javax.xml.bind.JAXBContext
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+     **/
+    public abstract Dispatch<Object> createDispatch(QName portName,
+            JAXBContext context, Service.Mode mode, WebServiceFeature... features);
+
+    /**
+     * Creates a <code>Dispatch</code> instance for use with JAXB
+     * generated objects. If there
+     * are any reference parameters in the
+     * <code>endpointReference</code>, then those reference
+     * parameters MUST appear as SOAP headers, indicating them to be
+     * reference parameters, on all messages sent to the endpoint.
+     * The <code>endpointReference's</code> address MUST be used
+     * for invocations on the endpoint.
+     * In the implementation of this method, the JAX-WS
+     * runtime system takes the responsibility of selecting a protocol
+     * binding (and a port) and configuring the dispatch accordingly from
+     * the WSDL associated with this <code>Service</code> instance or
+     * from the metadata from the <code>endpointReference</code>.
+     * If this <code>Service</code> instance has a WSDL and
+     * the <code>endpointReference</code>
+     * also has a WSDL in its metadata, then the WSDL from this instance
+     * MUST be used.
+     * If this <code>Service</code> instance does not have a WSDL and
+     * the <code>endpointReference</code> does have a WSDL, then the
+     * WSDL from the <code>endpointReference</code> MAY be used.
+     * An implementation MUST be able to retrieve the <code>portName</code> from the
+     * <code>endpointReference</code> metadata.
+     * <p>
+     * This method behavies the same as calling
+     * <pre>
+     * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
+     * </pre>
+     * where the <code>portName</code> is retrieved from the
+     * WSDL or <code>endpointReference</code> metadata.
+     *
+     * @param endpointReference  The <code>EndpointReference</code>
+     * for the target service endpoint that will be invoked by the
+     * returned <code>Dispatch</code> object.
+     * @param context The JAXB context used to marshall and unmarshall
+     * messages or message payloads.
+     * @param mode Controls whether the created dispatch instance is message
+     * or payload oriented, i.e. whether the user will work with complete
+     * protocol messages or message payloads. E.g. when using the SOAP
+     * protocol, this parameter controls whether the user will work with
+     * SOAP messages or the contents of a SOAP body.
+     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+     *                proxy.  Supported features not in the <code>features
+     *                </code> parameter will have their default values.
+     *
+     * @return Dispatch instance
+     * @throws WebServiceException
+     *                  <UL>
+     *                    <li>If there is any missing WSDL metadata
+     *                      as required by this method.
+     *                    <li>If the <code>endpointReference</code> metadata does
+     *                    not match the <code>serviceName</code> or <code>portName</code>
+     *                    of a WSDL associated
+     *                    with this <code>Service</code> instance.
+     *                    <li>If the <code>portName</code> cannot be determined
+     *                    from the <code>EndpointReference</code> metadata.
+     *                    <li>If any error in the creation of
+     *                    the <code>Dispatch</code> object.
+     *                    <li>if a feature is enabled that is not
+     *                    compatible with this port or is unsupported.
+     *                  </UL>
+     *
+     * @see javax.xml.bind.JAXBContext
+     * @see WebServiceFeature
+     *
+     * @since JAX-WS 2.1
+    **/
+    public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference,
+            JAXBContext context, Service.Mode mode,
+            WebServiceFeature... features);
+
+
+    /**
+     * Gets the name of this service.
+     * @return Qualified name of this service
+     **/
+    public abstract QName getServiceName();
+
+    /**
+     * Returns an <code>Iterator</code> for the list of
+     * <code>QName</code>s of service endpoints grouped by this
+     * service
+     *
+     * @return Returns <code>java.util.Iterator</code> with elements
+     *         of type <code>javax.xml.namespace.QName</code>
+     * @throws WebServiceException If this Service class does not
+     *         have access to the required WSDL metadata
+     **/
+    public abstract Iterator<javax.xml.namespace.QName> getPorts();
+
+    /**
+     * Gets the location of the WSDL document for this Service.
+     *
+     * @return URL for the location of the WSDL document for
+     *         this service
+     **/
+    public abstract java.net.URL getWSDLDocumentLocation();
+
+    /**
+     * Returns the configured handler resolver.
+     *
+     * @return HandlerResolver The <code>HandlerResolver</code> being
+     *         used by this <code>Service</code> instance, or <code>null</code>
+     *         if there isn't one.
+     **/
+    public abstract HandlerResolver getHandlerResolver();
+
+    /**
+     * Sets the <code>HandlerResolver</code> for this <code>Service</code>
+     * instance.
+     * <p>
+     * The handler resolver, if present, will be called once for each
+     * proxy or dispatch instance that is created, and the handler chain
+     * returned by the resolver will be set on the instance.
+     *
+     * @param handlerResolver The <code>HandlerResolver</code> to use
+     *        for all subsequently created proxy/dispatch objects.
+     *
+     * @see javax.xml.ws.handler.HandlerResolver
+     **/
+    public abstract void setHandlerResolver(HandlerResolver handlerResolver);
+
+    /**
+     * Returns the executor for this <code>Service</code>instance.
+     *
+     * The executor is used for all asynchronous invocations that
+     * require callbacks.
+     *
+     * @return The <code>java.util.concurrent.Executor</code> to be
+     *         used to invoke a callback.
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public abstract java.util.concurrent.Executor getExecutor();
+
+    /**
+     * Sets the executor for this <code>Service</code> instance.
+     *
+     * The executor is used for all asynchronous invocations that
+     * require callbacks.
+     *
+     * @param executor The <code>java.util.concurrent.Executor</code>
+     *        to be used to invoke a callback.
+     *
+     * @throws SecurityException If the instance does not support
+     *         setting an executor for security reasons (e.g. the
+     *         necessary permissions are missing).
+     *
+     * @see java.util.concurrent.Executor
+     **/
+    public abstract void setExecutor(java.util.concurrent.Executor executor);
 
 }
diff --git a/jaxws/src/share/classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java b/jaxws/src/share/classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
new file mode 100644
index 0000000..b8a4e41
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.spi;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Annotation used to identify other annotations
+ * as a <code>WebServiceFeature</code>.
+ *
+ * Each <code>WebServiceFeature</code> annotation annotated with
+ * this annotation MUST contain an
+ * <code>enabled</code> property of type
+ * <code>boolean</code> with a default value of <code>true</code>.
+ * JAX-WS defines the following
+ * <code>WebServiceFeature</code> annotations (<code>Addressing</code>,
+ * <code>MTOM</code>, <code>RespectBinding</code>), however, an implementation
+ * may define vendors specific annotations for other features.
+ * If a JAX-WS implementation encounters an annotation annotated
+ * with the <code>WebServiceFeatureAnnotation</code> that it does not
+ * recognize/support an error MUST be given.
+ *
+ * @see javax.xml.ws.soap.Addressing
+ * @see javax.xml.ws.soap.MTOM
+ * @see javax.xml.ws.RespectBinding
+ *
+ * @since JAX-WS 2.1
+ */
+@Target(ElementType.ANNOTATION_TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface WebServiceFeatureAnnotation {
+    /**
+     * Unique identifier for the WebServiceFeature.  This
+     * identifier MUST be unique across all implementations
+     * of JAX-WS.
+     */
+    String id();
+
+    /**
+     * The <code>WebServiceFeature</code> bean that is associated
+     * with the <code>WebServiceFeature</code> annotation
+     */
+    Class<? extends WebServiceFeature> bean();
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/spi/package.html b/jaxws/src/share/classes/javax/xml/ws/spi/package.html
index 3866126..00bc15a 100644
--- a/jaxws/src/share/classes/javax/xml/ws/spi/package.html
+++ b/jaxws/src/share/classes/javax/xml/ws/spi/package.html
@@ -1,5 +1,29 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
 <html>
 <body>
-This package defines SPIs for JAX-WS 2.0.
+This package defines SPIs for JAX-WS.
 </body>
 </html>
diff --git a/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java
new file mode 100644
index 0000000..ab6520c
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.wsaddressing;
+
+
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * This class represents a W3C Addressing EndpointReferece which is
+ * a remote reference to a web service endpoint that supports the
+ * W3C WS-Addressing 1.0 - Core Recommendation.
+ * <p>
+ * Developers should use this class in their SEIs if they want to
+ * pass/return endpoint references that represent the W3C WS-Addressing
+ * recommendation.
+ * <p>
+ * JAXB will use the JAXB annotations and bind this class to XML infoset
+ * that is consistent with that defined by WS-Addressing.  See
+ * <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+ * WS-Addressing</a>
+ * for more information on WS-Addressing EndpointReferences.
+ *
+ * @since JAX-WS 2.1
+ */
+
+// XmlRootElement allows this class to be marshalled on its own
+@XmlRootElement(name="EndpointReference",namespace=W3CEndpointReference.NS)
+@XmlType(name="EndpointReferenceType",namespace=W3CEndpointReference.NS)
+public final class W3CEndpointReference extends EndpointReference {
+
+    private final static JAXBContext w3cjc = getW3CJaxbContext();
+
+    protected W3CEndpointReference() {
+    }
+
+    /**
+     * Creates an EPR from infoset representation
+     *
+     * @param source A source object containing valid XmlInfoset
+     * instance consistent with the W3C WS-Addressing Core
+     * recommendation.
+     *
+     * @throws WebServiceException
+     *   If the source does NOT contain a valid W3C WS-Addressing
+     *   EndpointReference.
+     * @throws NullPointerException
+     *   If the <code>null</code> <code>source</code> value is given
+     */
+    public W3CEndpointReference(Source source) {
+        try {
+            W3CEndpointReference epr = w3cjc.createUnmarshaller().unmarshal(source,W3CEndpointReference.class).getValue();
+            this.address = epr.address;
+            this.metadata = epr.metadata;
+            this.referenceParameters = epr.referenceParameters;
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error unmarshalling W3CEndpointReference " ,e);
+        } catch (ClassCastException e) {
+            throw new WebServiceException("Source did not contain W3CEndpointReference", e);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void writeTo(Result result){
+        try {
+            Marshaller marshaller = w3cjc.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+            marshaller.marshal(this, result);
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
+        }
+    }
+
+    private static JAXBContext getW3CJaxbContext() {
+        try {
+            return JAXBContext.newInstance(W3CEndpointReference.class);
+        } catch (JAXBException e) {
+            throw new WebServiceException("Error creating JAXBContext for W3CEndpointReference. ", e);
+        }
+    }
+
+    // private but necessary properties for databinding
+    @XmlElement(name="Address",namespace=NS)
+    private Address address;
+    @XmlElement(name="ReferenceParameters",namespace=NS)
+    private Elements referenceParameters;
+    @XmlElement(name="Metadata",namespace=NS)
+    private Elements metadata;
+    @XmlAnyAttribute
+    Map<QName,String> attributes;
+    @XmlAnyElement
+    List<Element> elements;
+
+
+    private static class Address {
+        protected Address() {}
+        @XmlValue
+        String uri;
+        @XmlAnyAttribute
+        Map<QName,String> attributes;
+    }
+
+
+    private static class Elements {
+        protected Elements() {}
+        @XmlAnyElement
+        List<Element> elements;
+        @XmlAnyAttribute
+        Map<QName,String> attributes;
+    }
+
+    protected static final String NS = "http://www.w3.org/2005/08/addressing";
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
new file mode 100644
index 0000000..45b968e
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.xml.ws.wsaddressing;
+
+
+import org.w3c.dom.Element;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
+
+
+/**
+ * This class is used to build <code>W3CEndpointReference</code>
+ * instances. The intended use of this clsss is for
+ * an application component, for example a factory component,
+ * to create an <code>W3CEndpointReference</code> for a
+ * web service endpoint published by the same
+ * Java EE application. It can also be used to create
+ * <code>W3CEndpointReferences</code> for an Java SE based
+ * endpoint by providing the <code>address</code> property.
+ * <p>
+ * When creating a <code>W3CEndpointReference</code> for an
+ * endpoint that is not published by the same Java EE application,
+ * the <code>address</code> property MUST be specified.
+ * <p>
+ * When creating a <code>W3CEndpointReference</code> for an endpoint
+ * published by the same Java EE application, the <code>address</code>
+ * property MAY be <code>null</code> but then the <code>serviceName</code>
+ * and <code>endpointName</code> MUST specify an endpoint published by
+ * the same Java EE application.
+ * <p>
+ * When the <code>wsdlDocumentLocation</code> is specified it MUST refer
+ * to a valid WSDL document and the <code>serviceName</code> and
+ * <code>endpointName</code> (if specified) MUST match a service and port
+ * in the WSDL document.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class W3CEndpointReferenceBuilder {
+    /**
+     * Creates a new <code>W3CEndpointReferenceBuilder</code> instance.
+     */
+    public W3CEndpointReferenceBuilder() {
+        referenceParameters = new ArrayList<Element>();
+        metadata = new ArrayList<Element>();
+    }
+
+    /**
+     * Sets the <code>address</code> to the
+     * <code>W3CEndpointReference</code> instance's
+     * <code>wsa:Address</code>.
+     * <p>
+     * The <code>address</code> MUST be set to a non-<code>null</code>
+     * value when building a <code>W3CEndpointReference</code> for a
+     * web service endpoint that is not published by the same
+     * Java EE application or when running on Java SE.
+     *
+     * @param address The address of the endpoint to be targeted
+     *      by the returned <code>W3CEndpointReference<code>.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>address</code> set to the <code>wsa:Address</code>.
+     */
+    public W3CEndpointReferenceBuilder address(String address) {
+        this.address = address;
+        return this;
+    }
+
+    /**
+     * Sets the <code>serviceName</code> of the endpoint to be targeted
+     *      by the returned <code>W3CEndpointReference</code>.
+     *
+     * @param serviceName The service name of the endpoint to be targeted
+     *      by the returned <code>W3CEndpointReference<code>.  This property
+     *      may also be used with the <code>endpointName</code> (portName)
+     *      property to lookup the <code>address</code> of a web service
+     *      endpoint that is published by the same Java EE application.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>serviceName</code> property set.
+     *
+     */
+    public W3CEndpointReferenceBuilder serviceName(QName serviceName) {
+        this.serviceName = serviceName;
+        return this;
+    }
+
+    /**
+     * Sets the <code>endpointName</code> of the endpoint to
+     * be targeted by the returned <code>W3CEndpointRefernce</code>.
+     * This method can only
+     * be called after the {@link #serviceName} method has been called.
+     *
+     * @param endpointName The name of the endpoint to be targeted
+     *      by the returned <code>W3CEndpointReference<code>. The
+     *      <code>endpointName</code> (portName) property may also be
+     *      used with the <code>serviceName</code> property to lookup
+     *      the <code>address</code> of a web service
+     *      endpoint published by the same Java EE application.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>endpointName</code> property set.
+     *
+     * @throws java.lang.IllegalStateException If the <code>serviceName</code> has not
+     *  been set.
+     */
+    public W3CEndpointReferenceBuilder endpointName(QName endpointName) {
+        if (serviceName == null) {
+            throw new IllegalStateException("The W3CEndpointReferenceBuilder's serviceName must be set before setting the endpointName: "+endpointName);
+        }
+
+        this.endpointName = endpointName;
+        return this;
+    }
+
+    /**
+     * Sets the <code>wsdlDocumentLocation</code> associated with the targeted
+     * <code>W3CEndpointReference</code>.
+     *
+     * @param wsdlDocumentLocation The location of the WSDL document associated
+     * with the targeted <code>W3CEndpointReference</code>.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>wsdlDocumentLocation</code> property set.
+     *
+     */
+    public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation) {
+        this.wsdlDocumentLocation = wsdlDocumentLocation;
+        return this;
+    }
+
+    /**
+     * Adds the <code>referenceParameter</code> to the
+     * <code>W3CEndpointReference</code> instance
+     * <code>wsa:ReferenceParameters</code> element.
+     *
+     * @param referenceParameter The element to be added to the
+     *      <code>wsa:ReferenceParameters</code> element.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>referenceParameter</code> added to the
+     *   <code>wsa:ReferenceParameters</code> element.
+     *
+     * @throws java.lang.IllegalArgumentException if <code>referenceParameter</code>
+     * is <code>null</code>.
+     */
+    public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter) {
+        if (referenceParameter == null)
+            throw new java.lang.IllegalArgumentException("The referenceParameter cannot be null.");
+        referenceParameters.add(referenceParameter);
+        return this;
+    }
+
+    /**
+     * Adds the <code>metadataElement</code> to the
+     * <code>W3CEndpointReference</code> instance's
+     * <code>wsa:Metadata</code> element.
+     *
+     * @param metadataElement The element to be added to the
+     *      <code>wsa:Metadata</code> element.
+     *
+     * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+     *   the <code>metadataElement</code> added to the
+     *    <code>wsa:Metadata</code> element.
+     *
+     * @throws java.lang.IllegalArgumentException if <code>metadataElement</code>
+     * is <code>null</code>.
+     */
+    public W3CEndpointReferenceBuilder metadata(Element metadataElement) {
+        if (metadataElement == null)
+            throw new java.lang.IllegalArgumentException("The metadataElement cannot be null.");
+        metadata.add(metadataElement);
+        return this;
+    }
+
+    /**
+     * Builds a <code>W3CEndpointReference</code> from the accumulated
+     * properties set on this <code>W3CEndpointReferenceBuilder</code>
+     * instance.
+     * <p>
+     * This method can be used to create a <code>W3CEndpointReference</code>
+     * for any endpoint by specifying the <code>address</code> property along
+     * with any other desired properties.  This method
+     * can also be used to create a <code>W3CEndpointReference</code> for
+     * an endpoint that is published by the same Java EE application.
+     * This method can automatically determine the <code>address</code> of
+     * an endpoint published by the same Java EE application that is identified by the
+     * <code>serviceName</code> and
+     * <code>endpointName</code> properties.  If the <code>address</code> is
+     * <code>null</code> and the <code>serviceName</code> and
+     * <code>endpointName</code>
+     * do not identify an endpoint published by the same Java EE application, a
+     * <code>java.lang.IllegalStateException</code> MUST be thrown.
+     *
+     *
+     * @return <code>W3CEndpointReference</code> from the accumulated
+     * properties set on this <code>W3CEndpointReferenceBuilder</code>
+     * instance. This method never returns <code>null</code>.
+     *
+     * @throws java.lang.IllegalStateException
+     *     <ul>
+     *        <li>If the <code>address</code>, <code>serviceName</code> and
+     *            <code>endpointName</code> are all <code>null</code>.
+     *        <li>If the <code>serviceName</code> service is <code>null</code> and the
+     *            <code>endpointName</code> is NOT <code>null</code>.
+     *        <li>If the <code>address</code> property is <code>null</code> and
+     *            the <code>serviceName</code> and <code>endpointName</code> do not
+     *            specify a valid endpoint published by the same Java EE
+     *            application.
+     *        <li>If the <code>serviceName</code> is NOT <code>null</code>
+     *             and is not present in the specified WSDL.
+     *        <li>If the <code>endpointName</code> port is not <code>null<code> and it
+     *             is not present in <code>serviceName</code> service in the WSDL.
+     *        <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+     *            and does not represent a valid WSDL.
+     *     </ul>
+     * @throws WebServiceException If an error occurs while creating the
+     *                             <code>W3CEndpointReference</code>.
+     *
+     */
+    public W3CEndpointReference build() {
+        return Provider.provider().createW3CEndpointReference(address,
+                serviceName, endpointName, metadata, wsdlDocumentLocation,
+                referenceParameters);
+    }
+
+    private String address;
+    private List<Element> referenceParameters;
+    private List<Element> metadata;
+    private QName serviceName;
+    private QName endpointName;
+    private String wsdlDocumentLocation;
+}
diff --git a/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package-info.java b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package-info.java
new file mode 100644
index 0000000..279488c
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package-info.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+@javax.xml.bind.annotation.XmlSchema(namespace=W3CEndpointReference.NS,
+                                     location="http://www.w3.org/2006/03/addressing/ws-addr.xsd")
+package javax.xml.ws.wsaddressing;
diff --git a/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package.html b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package.html
new file mode 100644
index 0000000..3eb4686
--- /dev/null
+++ b/jaxws/src/share/classes/javax/xml/ws/wsaddressing/package.html
@@ -0,0 +1,29 @@
+<!--
+ Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+<html>
+<body>
+This package defines APIs related to WS-Addressing.
+</body>
+</html>
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/Datatype.java b/jaxws/src/share/classes/org/relaxng/datatype/Datatype.java
new file mode 100644
index 0000000..706b52e
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/Datatype.java
@@ -0,0 +1,262 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * Datatype object.
+ *
+ * This object has the following functionality:
+ *
+ * <ol>
+ *  <li> functionality to identify a class of character sequences. This is
+ *       done through the isValid method.
+ *
+ *  <li> functionality to produce a "value object" from a character sequence and
+ *               context information.
+ *
+ *  <li> functionality to test the equality of two value objects.
+ * </ol>
+ *
+ * This interface also defines the createStreamingValidator method,
+ * which is intended to efficiently support the validation of
+ * large character sequences.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface Datatype {
+
+        /**
+         * Checks if the specified 'literal' matches this Datatype
+         * with respect to the current context.
+         *
+         * @param literal
+         *              the lexical representation to be checked.
+         * @param context
+         *              If this datatype is context-dependent
+         *              (i.e. the {@link #isContextDependent} method returns true),
+         *              then the caller must provide a non-null valid context object.
+         *              Otherwise, the caller can pass null.
+         *
+         * @return
+         *              true if the 'literal' is a member of this Datatype;
+         *              false if it's not a member of this Datatype.
+         */
+        boolean isValid( String literal, ValidationContext context );
+
+        /**
+         * Similar to the isValid method but throws an exception with diagnosis
+         * in case of errors.
+         *
+         * <p>
+         * If the specified 'literal' is a valid lexical representation for this
+         * datatype, then this method must return without throwing any exception.
+         * If not, the callee must throw an exception (with diagnosis message,
+         * if possible.)
+         *
+         * <p>
+         * The application can use this method to provide detailed error message
+         * to users. This method is kept separate from the isValid method to
+         * achieve higher performance during normal validation.
+         *
+         * @exception DatatypeException
+         *              If the given literal is invalid, then this exception is thrown.
+         *              If the callee supports error diagnosis, then the exception should
+         *              contain a diagnosis message.
+         */
+        void checkValid( String literal, ValidationContext context )
+                throws DatatypeException;
+
+        /**
+         * Creates an instance of a streaming validator for this type.
+         *
+         * <p>
+         * By using streaming validators instead of the isValid method,
+         * the caller can avoid keeping the entire string, which is
+         * sometimes quite big, in memory.
+         *
+         * @param context
+         *              If this datatype is context-dependent
+         *              (i.e. the {@link #isContextDependent} method returns true),
+         *              then the caller must provide a non-null valid context object.
+         *              Otherwise, the caller can pass null.
+         *              The callee may keep a reference to this context object
+         *              only while the returned streaming validator is being used.
+         */
+        DatatypeStreamingValidator createStreamingValidator( ValidationContext context );
+
+        /**
+         * Converts lexcial value and the current context to the corresponding
+         * value object.
+         *
+         * <p>
+         * The caller cannot generally assume that the value object is
+         * a meaningful Java object. For example, the caller cannot expect
+         * this method to return <code>java.lang.Number</code> type for
+         * the "integer" type of XML Schema Part 2.
+         *
+         * <p>
+         * Also, the caller cannot assume that the equals method and
+         * the hashCode method of the value object are consistent with
+         * the semantics of the datatype. For that purpose, the sameValue
+         * method and the valueHashCode method have to be used. Note that
+         * this means you cannot use classes like
+         * <code>java.util.Hashtable</code> to store the value objects.
+         *
+         * <p>
+         * The returned value object should be used solely for the sameValue
+         * and valueHashCode methods.
+         *
+         * @param context
+         *              If this datatype is context-dependent
+         *              (when the {@link #isContextDependent} method returns true),
+         *              then the caller must provide a non-null valid context object.
+         *              Otherwise, the caller can pass null.
+         *
+         * @return      null
+         *              when the given lexical value is not a valid lexical
+         *              value for this type.
+         */
+        Object createValue( String literal, ValidationContext context );
+
+        /**
+         * Tests the equality of two value objects which were originally
+         * created by the createValue method of this object.
+         *
+         * The behavior is undefined if objects not created by this type
+         * are passed. It is the caller's responsibility to ensure that
+         * value objects belong to this type.
+         *
+         * @return
+         *              true if two value objects are considered equal according to
+         *              the definition of this datatype; false if otherwise.
+         */
+        boolean sameValue( Object value1, Object value2 );
+
+
+        /**
+         * Computes the hash code for a value object,
+         * which is consistent with the sameValue method.
+         *
+         * @return
+         *              hash code for the specified value object.
+         */
+        int valueHashCode( Object value );
+
+
+
+
+        /**
+         * Indicates that the datatype doesn't have ID/IDREF semantics.
+         *
+         * This value is one of the possible return values of the
+         * {@link #getIdType} method.
+         */
+        public static final int ID_TYPE_NULL = 0;
+
+        /**
+         * Indicates that RELAX NG compatibility processors should
+         * treat this datatype as having ID semantics.
+         *
+         * This value is one of the possible return values of the
+         * {@link #getIdType} method.
+         */
+        public static final int ID_TYPE_ID = 1;
+
+        /**
+         * Indicates that RELAX NG compatibility processors should
+         * treat this datatype as having IDREF semantics.
+         *
+         * This value is one of the possible return values of the
+         * {@link #getIdType} method.
+         */
+        public static final int ID_TYPE_IDREF = 2;
+
+        /**
+         * Indicates that RELAX NG compatibility processors should
+         * treat this datatype as having IDREFS semantics.
+         *
+         * This value is one of the possible return values of the
+         * {@link #getIdType} method.
+         */
+        public static final int ID_TYPE_IDREFS = 3;
+
+        /**
+         * Checks if the ID/IDREF semantics is associated with this
+         * datatype.
+         *
+         * <p>
+         * This method is introduced to support the RELAX NG DTD
+         * compatibility spec. (Of course it's always free to use
+         * this method for other purposes.)
+         *
+         * <p>
+         * If you are implementing a datatype library and have no idea about
+         * the "RELAX NG DTD compatibility" thing, just return
+         * <code>ID_TYPE_NULL</code> is fine.
+         *
+         * @return
+         *              If this datatype doesn't have any ID/IDREF semantics,
+         *              it returns {@link #ID_TYPE_NULL}. If it has such a semantics
+         *              (for example, XSD:ID, XSD:IDREF and comp:ID type), then
+         *              it returns {@link #ID_TYPE_ID}, {@link #ID_TYPE_IDREF} or
+         *              {@link #ID_TYPE_IDREFS}.
+         */
+        public int getIdType();
+
+
+        /**
+         * Checks if this datatype may need a context object for
+         * the validation.
+         *
+         * <p>
+         * The callee must return true even when the context
+         * is not always necessary. (For example, the "QName" type
+         * doesn't need a context object when validating unprefixed
+         * string. But nonetheless QName must return true.)
+         *
+         * <p>
+         * XSD's <code>string</code> and <code>short</code> types
+         * are examples of context-independent datatypes.
+         * Its <code>QName</code> and <code>ENTITY</code> types
+         * are examples of context-dependent datatypes.
+         *
+         * <p>
+         * When a datatype is context-independent, then
+         * the {@link #isValid} method, the {@link #checkValid} method,
+         * the {@link #createStreamingValidator} method and
+         * the {@link #createValue} method can be called without
+         * providing a context object.
+         *
+         * @return
+         *              <b>true</b> if this datatype is context-dependent
+         *              (it needs a context object sometimes);
+         *
+         *              <b>false</b> if this datatype is context-<b>in</b>dependent
+         *              (it never needs a context object).
+         */
+        public boolean isContextDependent();
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java
new file mode 100644
index 0000000..55d1bb8
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * Creates a user-defined type by adding parameters to
+ * the pre-defined type.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface DatatypeBuilder {
+
+        /**
+         * Adds a new parameter.
+         *
+         * @param name
+         *              The name of the parameter to be added.
+         * @param strValue
+         *              The raw value of the parameter. Caller may not normalize
+         *              this value because any white space is potentially significant.
+         * @param context
+         *              The context information which can be used by the callee to
+         *              acquire additional information. This context object is
+         *              valid only during this method call. The callee may not
+         *              keep a reference to this object.
+         * @exception   DatatypeException
+         *              When the given parameter is inappropriate for some reason.
+         *              The callee is responsible to recover from this error.
+         *              That is, the object should behave as if no such error
+         *              was occured.
+         */
+        void addParameter( String name, String strValue, ValidationContext context )
+                throws DatatypeException;
+
+        /**
+         * Derives a new Datatype from a Datatype by parameters that
+         * were already set through the addParameter method.
+         *
+         * @exception DatatypeException
+         *              DatatypeException must be thrown if the derivation is
+         *              somehow invalid. For example, a required parameter is missing,
+         *              etc. The exception should contain a diagnosis message
+         *              if possible.
+         */
+        Datatype createDatatype() throws DatatypeException;
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/DatatypeException.java b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeException.java
new file mode 100644
index 0000000..5e01118
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeException.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * Signals Datatype related exceptions.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public class DatatypeException extends Exception {
+
+        public DatatypeException( int index, String msg ) {
+                super(msg);
+                this.index = index;
+        }
+        public DatatypeException( String msg ) {
+                this(UNKNOWN,msg);
+        }
+        /**
+         * A constructor for those datatype libraries which don't support any
+         * diagnostic information at all.
+         */
+        public DatatypeException() {
+                this(UNKNOWN,null);
+        }
+
+
+        private final int index;
+
+        public static final int UNKNOWN = -1;
+
+        /**
+         * Gets the index of the content where the error occured.
+         * UNKNOWN can be returned to indicate that no index information
+         * is available.
+         */
+        public int getIndex() {
+                return index;
+        }
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java
new file mode 100644
index 0000000..8cb81cb
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * A Datatype library
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface DatatypeLibrary {
+
+        /**
+         * Creates a new instance of DatatypeBuilder.
+         *
+         * The callee should throw a DatatypeException in case of an error.
+         *
+         * @param baseTypeLocalName
+         *              The local name of the base type.
+         *
+         * @return
+         *              A non-null valid datatype object.
+         */
+        DatatypeBuilder createDatatypeBuilder( String baseTypeLocalName )
+                throws DatatypeException;
+
+        /**
+         * Gets or creates a pre-defined type.
+         *
+         * This is just a short-cut of
+         * <code>createDatatypeBuilder(typeLocalName).createDatatype();</code>
+         *
+         * The callee should throw a DatatypeException in case of an error.
+         *
+         * @return
+         *              A non-null valid datatype object.
+         */
+        Datatype createDatatype( String typeLocalName ) throws DatatypeException;
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java
new file mode 100644
index 0000000..e636e00
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * Factory class for the DatatypeLibrary class.
+ *
+ * <p>
+ * The datatype library should provide the implementation of
+ * this interface if it wants to be found by the schema processors.
+ * The implementor also have to place a file in your jar file.
+ * See the reference datatype library implementation for detail.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface DatatypeLibraryFactory
+{
+        /**
+         * Creates a new instance of a DatatypeLibrary that supports
+         * the specified namespace URI.
+         *
+         * @return
+         *              <code>null</code> if the specified namespace URI is not
+         *              supported.
+         */
+        DatatypeLibrary createDatatypeLibrary( String namespaceURI );
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java
new file mode 100644
index 0000000..0f379d5
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * Datatype streaming validator.
+ *
+ * <p>
+ * The streaming validator is an optional feature that is useful for
+ * certain Datatypes. It allows the caller to incrementally provide
+ * the literal.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface DatatypeStreamingValidator {
+
+        /**
+         * Passes an additional fragment of the literal.
+         *
+         * <p>
+         * The application can call this method several times, then call
+         * the isValid method (or the checkValid method) to check the validity
+         * of the accumulated characters.
+         */
+        void addCharacters( char[] buf, int start, int len );
+
+        /**
+         * Tells if the accumulated literal is valid with respect to
+         * the underlying Datatype.
+         *
+         * @return
+         *              True if it is valid. False if otherwise.
+         */
+        boolean isValid();
+
+        /**
+         * Similar to the isValid method, but this method throws
+         * Exception (with possibly diagnostic information), instead of
+         * returning false.
+         *
+         * @exception DatatypeException
+         *              If the callee supports the diagnosis and the accumulated
+         *              literal is invalid, then this exception that possibly
+         *              contains diagnosis information is thrown.
+         */
+        void checkValid() throws DatatypeException;
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/ValidationContext.java b/jaxws/src/share/classes/org/relaxng/datatype/ValidationContext.java
new file mode 100644
index 0000000..45f2ed8
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/ValidationContext.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype;
+
+/**
+ * An interface that must be implemented by caller to
+ * provide context information that is necessary to
+ * perform validation of some Datatypes.
+ *
+ * @author <a href="mailto:jjc@jclark.com">James Clark</a>
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public interface ValidationContext {
+
+        /**
+         * Resolves a namespace prefix to the corresponding namespace URI.
+         *
+         * This method is used for validating the QName type, for example.
+         *
+         * <p>
+         * If the prefix is "" (empty string), it indicates
+         * an unprefixed value. The callee
+         * should resolve it as for an unprefixed
+         * element, rather than for an unprefixed attribute.
+         *
+         * <p>
+         * If the prefix is "xml", then the callee must resolve
+         * this prefix into "http://www.w3.org/XML/1998/namespace",
+         * as defined in the XML Namespaces Recommendation.
+         *
+         * @return
+         *              namespace URI of this prefix.
+         *              If the specified prefix is not declared,
+         *              the implementation must return null.
+         */
+        String resolveNamespacePrefix( String prefix );
+
+        /**
+         * Returns the base URI of the context.  The null string may be returned
+         * if no base URI is known.
+         */
+        String getBaseUri();
+
+        /**
+         * Checks if an unparsed entity is declared with the
+         * specified name.
+         *
+         * @return
+         *  true
+         *              if the DTD has an unparsed entity declaration for
+         *              the specified name.
+         *  false
+         *              otherwise.
+         */
+        boolean isUnparsedEntity( String entityName );
+
+        /**
+         * Checks if a notation is declared with the
+         * specified name.
+         *
+         * @return
+         *  true
+         *              if the DTD has a notation declaration for the specified name.
+         *  false
+         *              otherwise.
+         */
+        boolean isNotation( String notationName );
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java b/jaxws/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java
new file mode 100644
index 0000000..a3091b0
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java
@@ -0,0 +1,262 @@
+/**
+ * Copyright (c) 2001, Thai Open Source Software Center Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *     Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *
+ *     Neither the name of the Thai Open Source Software Center Ltd nor
+ *     the names of its contributors may be used to endorse or promote
+ *     products derived from this software without specific prior written
+ *     permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.relaxng.datatype.helpers;
+
+import org.relaxng.datatype.DatatypeLibraryFactory;
+import org.relaxng.datatype.DatatypeLibrary;
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+import java.io.Reader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+
+/**
+ * Discovers the datatype library implementation from the classpath.
+ *
+ * <p>
+ * The call of the createDatatypeLibrary method finds an implementation
+ * from a given datatype library URI at run-time.
+ */
+public class DatatypeLibraryLoader implements DatatypeLibraryFactory {
+  private final Service service = new Service(DatatypeLibraryFactory.class);
+
+  public DatatypeLibrary createDatatypeLibrary(String uri) {
+    for (Enumeration e = service.getProviders();
+         e.hasMoreElements();) {
+      DatatypeLibraryFactory factory
+        = (DatatypeLibraryFactory)e.nextElement();
+      DatatypeLibrary library = factory.createDatatypeLibrary(uri);
+      if (library != null)
+        return library;
+    }
+    return null;
+  }
+
+        private static class Service {
+          private final Class serviceClass;
+          private final Enumeration configFiles;
+          private Enumeration classNames = null;
+          private final Vector providers = new Vector();
+          private Loader loader;
+
+          private class ProviderEnumeration implements Enumeration {
+            private int nextIndex = 0;
+
+            public boolean hasMoreElements() {
+              return nextIndex < providers.size() || moreProviders();
+            }
+
+            public Object nextElement() {
+              try {
+                return providers.elementAt(nextIndex++);
+              }
+              catch (ArrayIndexOutOfBoundsException e) {
+                throw new NoSuchElementException();
+              }
+            }
+          }
+
+          private static class Singleton implements Enumeration {
+            private Object obj;
+            private Singleton(Object obj) {
+              this.obj = obj;
+            }
+
+            public boolean hasMoreElements() {
+              return obj != null;
+            }
+
+            public Object nextElement() {
+              if (obj == null)
+                throw new NoSuchElementException();
+              Object tem = obj;
+              obj = null;
+              return tem;
+            }
+          }
+
+          // JDK 1.1
+          private static class Loader {
+            Enumeration getResources(String resName) {
+              ClassLoader cl = Loader.class.getClassLoader();
+              URL url;
+              if (cl == null)
+                url = ClassLoader.getSystemResource(resName);
+              else
+                url = cl.getResource(resName);
+              return new Singleton(url);
+            }
+
+            Class loadClass(String name) throws ClassNotFoundException {
+              return Class.forName(name);
+            }
+          }
+
+          // JDK 1.2+
+          private static class Loader2 extends Loader {
+            private ClassLoader cl;
+
+            Loader2() {
+              cl = Loader2.class.getClassLoader();
+              // If the thread context class loader has the class loader
+              // of this class as an ancestor, use the thread context class
+              // loader.  Otherwise, the thread context class loader
+              // probably hasn't been set up properly, so don't use it.
+              ClassLoader clt = Thread.currentThread().getContextClassLoader();
+              for (ClassLoader tem = clt; tem != null; tem = tem.getParent())
+                if (tem == cl) {
+                  cl = clt;
+                  break;
+                }
+            }
+
+            Enumeration getResources(String resName) {
+              try {
+                    return cl.getResources(resName);
+
+              }
+              catch (IOException e) {
+                return new Singleton(null);
+              }
+            }
+
+            Class loadClass(String name) throws ClassNotFoundException {
+              return Class.forName(name, true, cl);
+            }
+          }
+
+          public Service(Class cls) {
+            try {
+              loader = new Loader2();
+            }
+            catch (NoSuchMethodError e) {
+              loader = new Loader();
+            }
+            serviceClass = cls;
+            String resName = "META-INF/services/" + serviceClass.getName();
+            configFiles = loader.getResources(resName);
+          }
+
+          public Enumeration getProviders() {
+            return new ProviderEnumeration();
+          }
+
+          synchronized private boolean moreProviders() {
+            for (;;) {
+              while (classNames == null) {
+                if (!configFiles.hasMoreElements())
+                  return false;
+                classNames = parseConfigFile((URL)configFiles.nextElement());
+              }
+              while (classNames.hasMoreElements()) {
+                String className = (String)classNames.nextElement();
+                try {
+                  Class cls = loader.loadClass(className);
+                  Object obj = cls.newInstance();
+                  if (serviceClass.isInstance(obj)) {
+                    providers.addElement(obj);
+                    return true;
+                  }
+                }
+                catch (ClassNotFoundException e) { }
+                catch (InstantiationException e) { }
+                catch (IllegalAccessException e) { }
+                catch (LinkageError e) { }
+              }
+              classNames = null;
+            }
+          }
+
+          private static final int START = 0;
+          private static final int IN_NAME = 1;
+          private static final int IN_COMMENT = 2;
+
+          private static Enumeration parseConfigFile(URL url) {
+            try {
+              InputStream in = url.openStream();
+              Reader r;
+              try {
+                r = new InputStreamReader(in, "UTF-8");
+              }
+              catch (UnsupportedEncodingException e) {
+                r = new InputStreamReader(in, "UTF8");
+              }
+              r = new BufferedReader(r);
+              Vector tokens = new Vector();
+              StringBuffer tokenBuf = new StringBuffer();
+              int state = START;
+              for (;;) {
+                int n = r.read();
+                if (n < 0)
+                  break;
+                char c = (char)n;
+                switch (c) {
+                case '\r':
+                case '\n':
+                  state = START;
+                  break;
+                case ' ':
+                case '\t':
+                  break;
+                case '#':
+                  state = IN_COMMENT;
+                  break;
+                default:
+                  if (state != IN_COMMENT) {
+                    state = IN_NAME;
+                    tokenBuf.append(c);
+                  }
+                  break;
+                }
+                if (tokenBuf.length() != 0 && state != IN_NAME) {
+                  tokens.addElement(tokenBuf.toString());
+                  tokenBuf.setLength(0);
+                }
+              }
+              if (tokenBuf.length() != 0)
+                tokens.addElement(tokenBuf.toString());
+              return tokens.elements();
+            }
+            catch (IOException e) {
+              return null;
+            }
+          }
+        }
+
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java b/jaxws/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java
new file mode 100644
index 0000000..2c94271
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype.helpers;
+
+import org.relaxng.datatype.*;
+
+/**
+ * Dummy implementation of {@link DatatypeBuilder}.
+ *
+ * This implementation can be used for Datatypes which have no parameters.
+ * Any attempt to add parameters will be rejected.
+ *
+ * <p>
+ * Typical usage would be:
+ * <PRE><XMP>
+ * class MyDatatypeLibrary implements DatatypeLibrary {
+ *     ....
+ *     DatatypeBuilder createDatatypeBuilder( String typeName ) {
+ *         return new ParameterleessDatatypeBuilder(createDatatype(typeName));
+ *     }
+ *     ....
+ * }
+ * </XMP></PRE>
+ *
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public final class ParameterlessDatatypeBuilder implements DatatypeBuilder {
+
+        /** This type object is returned for the derive method. */
+        private final Datatype baseType;
+
+        public ParameterlessDatatypeBuilder( Datatype baseType ) {
+                this.baseType = baseType;
+        }
+
+        public void addParameter( String name, String strValue, ValidationContext context )
+                        throws DatatypeException {
+                throw new DatatypeException();
+        }
+
+        public Datatype createDatatype() throws DatatypeException {
+                return baseType;
+        }
+}
diff --git a/jaxws/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java b/jaxws/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java
new file mode 100644
index 0000000..a614f2a
--- /dev/null
+++ b/jaxws/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package org.relaxng.datatype.helpers;
+
+import org.relaxng.datatype.*;
+
+/**
+ * Dummy implementation of {@link DatatypeStreamingValidator}.
+ *
+ * <p>
+ * This implementation can be used as a quick hack when the performance
+ * of streaming validation is not important. And this implementation
+ * also shows you how to implement the DatatypeStreamingValidator interface.
+ *
+ * <p>
+ * Typical usage would be:
+ * <PRE><XMP>
+ * class MyDatatype implements Datatype {
+ *     ....
+ *     public DatatypeStreamingValidator createStreamingValidator( ValidationContext context ) {
+ *         return new StreamingValidatorImpl(this,context);
+ *     }
+ *     ....
+ * }
+ * </XMP></PRE>
+ *
+ * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+ */
+public final class StreamingValidatorImpl implements DatatypeStreamingValidator {
+
+        /** This buffer accumulates characters. */
+        private final StringBuffer buffer = new StringBuffer();
+
+        /** Datatype obejct that creates this streaming validator. */
+        private final Datatype baseType;
+
+        /** The current context. */
+        private final ValidationContext context;
+
+        public void addCharacters( char[] buf, int start, int len ) {
+                // append characters to the current buffer.
+                buffer.append(buf,start,len);
+        }
+
+        public boolean isValid() {
+                return baseType.isValid(buffer.toString(),context);
+        }
+
+        public void checkValid() throws DatatypeException {
+                baseType.checkValid(buffer.toString(),context);
+        }
+
+        public StreamingValidatorImpl( Datatype baseType, ValidationContext context ) {
+                this.baseType = baseType;
+                this.context = context;
+        }
+}
diff --git a/jdk/.hgtags b/jdk/.hgtags
index f3ad419..b33e53b 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -30,3 +30,4 @@
 a2033addca678f9e4c0d92ffa1e389171cc9321d jdk7-b53
 d1c43d1f5676a24ba86221ac7cad5694f3a9afda jdk7-b54
 522bb5aa17e0c0cff00b1ed7d1b51bc4db2cfef9 jdk7-b55
+7fd3bc37afe36f8f6165ba679db1229716db822a jdk7-b56
diff --git a/jdk/README b/jdk/README
index d774ab8..e3cc63e 100644
--- a/jdk/README
+++ b/jdk/README
@@ -9,25 +9,35 @@
      http://java.sun.com/javase/downloads/index.jsp
      Set the environment variable ALT_BOOTDIR to the location of this JDK 6.
 
-  2. Download and install the Binary Plugs for the most recent JDK7 from
+  2. Download and install the JIBX libraries, version 1.1.5 from
+     http://sourceforge.net/project/showfiles.php?group_id=69358&package_id=68290
+     You'll need the following four JAR files:
+         bcel.jar
+         jibx-bind.jar
+         jibx-run.jar
+         xpp3.jar
+     Set the environment variable ALT_JIBX_LIBS_PATH to the location of
+     these JAR files.
+     
+  3. Download and install the Binary Plugs for the most recent JDK7 from
      http://download.java.net/openjdk/jdk7/
      Set the environment variable ALT_BINARY_PLUGS_PATH to the location of
      these binary plugs.
      
-  3. Either download and install the latest JDK7 from
+  4. Either download and install the latest JDK7 from
      http://download.java.net/openjdk/jdk7/, or build your own complete
      OpenJDK7 by using the top level Makefile in the OpenJDK Mercurial forest.
      Set the environment variable ALT_JDK_IMPORT_PATH to the location of
      this latest JDK7 or OpenJDK7 build.
      
-  4. Check the sanity of doing a build with the current machine:
+  5. Check the sanity of doing a build with the current machine:
        cd make && gnumake sanity
      See README-builds.html if you run into problems.
   
-  5. Do a partial build of the jdk:
+  6. Do a partial build of the jdk:
        cd make && gnumake all
   
-  6. Construct the images:
+  7. Construct the images:
        cd make && gnumake images
      The resulting JDK image should be found in build/*/j2sdk-image
 
diff --git a/jdk/make/common/Sanity.gmk b/jdk/make/common/Sanity.gmk
index 3388be0..eb4f00e 100644
--- a/jdk/make/common/Sanity.gmk
+++ b/jdk/make/common/Sanity.gmk
@@ -92,7 +92,8 @@
     sane-ld_run_path \
     sane-alt_bootdir \
     sane-bootdir \
-    sane-alsa-headers
+    sane-alsa-headers \
+    sane-jibx
 
 ifdef OPENJDK
 sanity-all:: sane-freetype 
diff --git a/jdk/make/common/shared/Defs.gmk b/jdk/make/common/shared/Defs.gmk
index 5da4a29..dc62f1e 100644
--- a/jdk/make/common/shared/Defs.gmk
+++ b/jdk/make/common/shared/Defs.gmk
@@ -515,6 +515,15 @@
 #   NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
 BINDIR      = $(OUTPUTDIR)/bin$(ISA_DIR)
   
+# JIBX_LIBS_PATH: path to JIBX libraries, needed for NimbusLookAndFeel
+ifdef ALT_JIBX_LIBS_PATH
+  JIBX_LIBS_PATH:=$(call FullPath,$(ALT_JIBX_LIBS_PATH))
+  JIBX_LIBS_PATH:=$(call AltCheckSpaces,JIBX_LIBS_PATH)
+  JIBX_LIBS_PATH:=$(call AltCheckValue,JIBX_LIBS_PATH)
+else
+  JIBX_LIBS_PATH=$(JDK_DEVTOOLS_DIR)/share/jibx/lib
+endif
+
 # MOZILLA_HEADERS_PATH: path to mozilla header files for plugin
 ifdef ALT_MOZILLA_HEADERS_PATH
   MOZILLA_HEADERS_PATH :=$(call FullPath,$(ALT_MOZILLA_HEADERS_PATH))
@@ -529,7 +538,7 @@
 JDK_CUPS_HEADERS_PATH=$(JDK_DEVTOOLS_DIR)/share/cups/include
   ifdef ALT_CUPS_HEADERS_PATH
      CUPS_HEADERS_PATH:=$(call FullPath,$(ALT_CUPS_HEADERS_PATH))
-     CUP_HEADERS_PATH:=$(call AltCheckValue,CUPS_HEADERS_PATH)
+     CUPS_HEADERS_PATH:=$(call AltCheckValue,CUPS_HEADERS_PATH)
   else 
     CUPS_HEADERS_PATH:= \
       $(shell if [ -d "$(JDK_CUPS_HEADERS_PATH)" ]; then \
diff --git a/jdk/make/common/shared/Sanity-Settings.gmk b/jdk/make/common/shared/Sanity-Settings.gmk
index b64e3b5..283598e 100644
--- a/jdk/make/common/shared/Sanity-Settings.gmk
+++ b/jdk/make/common/shared/Sanity-Settings.gmk
@@ -233,6 +233,7 @@
   endif
 endif
 ALL_SETTINGS+=$(call addAltSetting,CACERTS_FILE)
+ALL_SETTINGS+=$(call addAltSetting,JIBX_LIBS_PATH)
 ifndef OPENJDK
   ALL_SETTINGS+=$(call addAltSetting,MOZILLA_HEADERS_PATH)
 endif
diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk
index 180e521..84d5e22 100644
--- a/jdk/make/common/shared/Sanity.gmk
+++ b/jdk/make/common/shared/Sanity.gmk
@@ -213,6 +213,7 @@
 	sane-link \
 	sane-cacerts \
 	sane-alsa-headers \
+	sane-jibx \
 	sane-ant_version \
 	sane-zip_version \
 	sane-unzip_version \
@@ -1498,6 +1499,18 @@
 
 
 ######################################################
+# JIBX_LIBS_PATH must be valid
+######################################################
+sane-jibx:
+	@if [ ! -r $(subst \,/,$(JIBX_LIBS_PATH))/jibx-run.jar ]; then \
+	  $(ECHO) "ERROR: You do not have access to valid JIBX library files. \n" \
+	    "      Please check your access to \n" \
+	    "          $(subst \,/,$(JIBX_LIBS_PATH))/jibx-run.jar \n" \
+	    "      and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_JIBX_LIBS_PATH \n" \
+	    "" >> $(ERROR_FILE) ; \
+	fi
+
+######################################################
 # MOZILLA_HEADERS_PATH must be valid
 ######################################################
 sane-mozilla:
diff --git a/jdk/make/docs/CORE_PKGS.gmk b/jdk/make/docs/CORE_PKGS.gmk
index f9b9ee5..9ea6f0c 100644
--- a/jdk/make/docs/CORE_PKGS.gmk
+++ b/jdk/make/docs/CORE_PKGS.gmk
@@ -233,6 +233,7 @@
   javax.xml.ws.http                              \
   javax.xml.ws.soap                              \
   javax.xml.ws.spi                               \
+  javax.xml.ws.wsaddressing                      \
   javax.xml.transform                            \
   javax.xml.transform.sax                        \
   javax.xml.transform.dom                        \
diff --git a/jdk/make/java/zip/FILES_c.gmk b/jdk/make/java/zip/FILES_c.gmk
index 6426cea..f88386c 100644
--- a/jdk/make/java/zip/FILES_c.gmk
+++ b/jdk/make/java/zip/FILES_c.gmk
@@ -29,7 +29,6 @@
 	Deflater.c \
 	Inflater.c \
 	ZipFile.c \
-	ZipEntry.c \
 	zadler32.c \
 	zcrc32.c \
 	deflate.c \
diff --git a/jdk/make/java/zip/mapfile-vers b/jdk/make/java/zip/mapfile-vers
index 443ea67..096fa35 100644
--- a/jdk/make/java/zip/mapfile-vers
+++ b/jdk/make/java/zip/mapfile-vers
@@ -50,15 +50,17 @@
 		Java_java_util_zip_Inflater_initIDs;
 		Java_java_util_zip_Inflater_reset;
 		Java_java_util_zip_Inflater_setDictionary;
-		Java_java_util_zip_ZipEntry_initFields;
-		Java_java_util_zip_ZipEntry_initIDs;
 		Java_java_util_zip_ZipFile_close;
 		Java_java_util_zip_ZipFile_freeEntry;
-		Java_java_util_zip_ZipFile_getCSize;
 		Java_java_util_zip_ZipFile_getEntry;
-		Java_java_util_zip_ZipFile_getMethod;
+		Java_java_util_zip_ZipFile_getEntryBytes;
+		Java_java_util_zip_ZipFile_getEntryCrc;
+		Java_java_util_zip_ZipFile_getEntryCSize;
+		Java_java_util_zip_ZipFile_getEntryFlag;
+		Java_java_util_zip_ZipFile_getEntryMethod;
+		Java_java_util_zip_ZipFile_getEntrySize;
+		Java_java_util_zip_ZipFile_getEntryTime;
 		Java_java_util_zip_ZipFile_getNextEntry;
-		Java_java_util_zip_ZipFile_getSize;
 		Java_java_util_zip_ZipFile_getZipMessage;
 		Java_java_util_zip_ZipFile_getTotal;
 		Java_java_util_zip_ZipFile_initIDs;
diff --git a/jdk/make/java/zip/reorder-i586 b/jdk/make/java/zip/reorder-i586
index d1af81c..d9e90ea 100644
--- a/jdk/make/java/zip/reorder-i586
+++ b/jdk/make/java/zip/reorder-i586
@@ -20,12 +20,14 @@
 text: .text%Java_java_util_zip_ZipFile_open;
 text: .text%Java_java_util_zip_ZipFile_getTotal;
 text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipEntry_initIDs;
-text: .text%Java_java_util_zip_ZipEntry_initFields;
 text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getCSize;
-text: .text%Java_java_util_zip_ZipFile_getSize;
-text: .text%Java_java_util_zip_ZipFile_getMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryTime;
+text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
+text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
+text: .text%Java_java_util_zip_ZipFile_getEntrySize;
+text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
+text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
 text: .text%Java_java_util_zip_Inflater_initIDs;
 text: .text%Java_java_util_zip_Inflater_init;
 text: .text%inflateInit2_;
diff --git a/jdk/make/java/zip/reorder-sparc b/jdk/make/java/zip/reorder-sparc
index b004b3c..82cc81b 100644
--- a/jdk/make/java/zip/reorder-sparc
+++ b/jdk/make/java/zip/reorder-sparc
@@ -19,12 +19,14 @@
 text: .text%Java_java_util_zip_ZipFile_open;
 text: .text%Java_java_util_zip_ZipFile_getTotal;
 text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipEntry_initIDs;
-text: .text%Java_java_util_zip_ZipEntry_initFields;
 text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getCSize;
-text: .text%Java_java_util_zip_ZipFile_getSize;
-text: .text%Java_java_util_zip_ZipFile_getMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryTime;
+text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
+text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
+text: .text%Java_java_util_zip_ZipFile_getEntrySize;
+text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
+text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
 text: .text%Java_java_util_zip_Inflater_initIDs;
 text: .text%Java_java_util_zip_Inflater_init;
 text: .text%inflateInit2_;
diff --git a/jdk/make/java/zip/reorder-sparcv9 b/jdk/make/java/zip/reorder-sparcv9
index e1061f8..a2b0f46 100644
--- a/jdk/make/java/zip/reorder-sparcv9
+++ b/jdk/make/java/zip/reorder-sparcv9
@@ -20,12 +20,14 @@
 text: .text%Java_java_util_zip_ZipFile_open;
 text: .text%Java_java_util_zip_ZipFile_getTotal;
 text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipEntry_initIDs;
-text: .text%Java_java_util_zip_ZipEntry_initFields;
 text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getCSize;
-text: .text%Java_java_util_zip_ZipFile_getSize;
-text: .text%Java_java_util_zip_ZipFile_getMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryTime;
+text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
+text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
+text: .text%Java_java_util_zip_ZipFile_getEntrySize;
+text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
+text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
+text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
 text: .text%Java_java_util_zip_Inflater_initIDs;
 text: .text%Java_java_util_zip_Inflater_init;
 text: .text%inflateInit2_;
diff --git a/jdk/make/javax/swing/plaf/Makefile b/jdk/make/javax/swing/plaf/Makefile
index f8e5e0c..aea88f2 100644
--- a/jdk/make/javax/swing/plaf/Makefile
+++ b/jdk/make/javax/swing/plaf/Makefile
@@ -34,9 +34,14 @@
 #
 include FILES.gmk
 AUTO_FILES_JAVA_DIRS = javax/swing/plaf sun/swing com/sun/java/swing/plaf
+SUBDIRS = nimbus
+
+# Nimbus is handled in its own directory
+AUTO_JAVA_PRUNE = nimbus
+
 ifeq ($(PLATFORM), windows)
     # Don't build GTK L&F on Windows
-    AUTO_JAVA_PRUNE = gtk
+    AUTO_JAVA_PRUNE += gtk
 endif
 
 MISC_FILES = $(MISC_SWING_FILES)
@@ -68,8 +73,10 @@
 # Process LOGO_ICONS and Motif Icons first.
 #
 build: $(LOGO_ICONS) $(MISC_SWING_FILES_MOTIF_GIF) $(MISC_SWING_FILES_MOTIF_PNG) other_files
+	$(SUBDIRS-loop)
 
-clean:: classes.clean
+clean clobber::
+	$(SUBDIRS-loop)
 
 #
 # Include
diff --git a/jdk/make/javax/swing/plaf/nimbus/Makefile b/jdk/make/javax/swing/plaf/nimbus/Makefile
new file mode 100644
index 0000000..ed59f13
--- /dev/null
+++ b/jdk/make/javax/swing/plaf/nimbus/Makefile
@@ -0,0 +1,60 @@
+#
+# Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+BUILDDIR  = ../../../..
+PACKAGE   = javax.swing.plaf.nimbus
+PRODUCT   = com
+SWING_SRC = $(SHARE_SRC)/classes/javax/swing
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+NIMBUS_PKG = javax/swing/plaf/nimbus
+NIMBUS_COMPAT_PKG = com/sun/java/swing/plaf/nimbus
+NIMBUS_GENSRC_DIR = $(GENSRCDIR)/$(NIMBUS_PKG)
+NIMBUS_SKIN_FILE = $(SHARE_SRC)/classes/$(NIMBUS_PKG)/skin.laf
+NIMBUS_GENERATOR_JAR = $(BUILDTOOLJARDIR)/nimbus_generator.jar
+
+AUTO_FILES_JAVA_DIRS = $(NIMBUS_PKG) $(NIMBUS_COMPAT_PKG)
+
+
+#
+# Rules
+#
+CLASSES_INIT = $(NIMBUS_GENSRC_DIR)
+
+include $(BUILDDIR)/common/Classes.gmk
+
+$(NIMBUS_GENSRC_DIR): $(NIMBUS_SKIN_FILE) $(NIMBUS_GENERATOR_JAR)
+	@$(ECHO) "Generating Nimbus source files:"
+	$(BOOT_JAVA_CMD) -jar $(NIMBUS_GENERATOR_JAR) \
+	    -skinFile $(NIMBUS_SKIN_FILE) \
+	    -buildDir $(GENSRCDIR) -srcDir $(GENSRCDIR) \
+	    -packagePrefix $(PACKAGE) -lafName Nimbus
+	@$(ECHO) "Finished generating Nimbus source files"
+
+clean clobber::
+	$(RM) -r $(NIMBUS_GENSRC_DIR)
diff --git a/jdk/make/jprt.properties b/jdk/make/jprt.properties
index a1e7e51..5e21dba 100644
--- a/jdk/make/jprt.properties
+++ b/jdk/make/jprt.properties
@@ -32,8 +32,8 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
diff --git a/jdk/make/tools/Makefile b/jdk/make/tools/Makefile
index 3803fbc..a927209 100644
--- a/jdk/make/tools/Makefile
+++ b/jdk/make/tools/Makefile
@@ -51,6 +51,7 @@
   makeclasslist             \
   strip_properties          \
   spp                       \
+  swing-nimbus              \
   CharsetMapping
 
 all build clean clobber::
diff --git a/jdk/make/tools/swing-nimbus/Makefile b/jdk/make/tools/swing-nimbus/Makefile
new file mode 100644
index 0000000..36df571
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/Makefile
@@ -0,0 +1,91 @@
+#
+# Copyright 1998-2005 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
+# Makefile for building the Nimbus generator
+#
+
+BUILDDIR = ../..
+PACKAGE = org.jdesktop.synthdesigner.generator
+PRODUCT = tools
+PROGRAM = nimbus_generator
+include $(BUILDDIR)/common/Defs.gmk
+
+BUILDTOOL_SOURCE_ROOT = classes
+BUILDTOOL_MAIN        = $(PKGDIR)/Generator.java
+
+#
+# Files
+#
+
+MAIN_CLASS_FILE = $(BUILDTOOLCLASSDIR)/$(BUILDTOOL_MAIN:%.java=%.class)
+SOURCE_FILES    = $(shell $(FIND) $(BUILDTOOL_SOURCE_ROOT) -name '*.java' -print)
+
+TEMPLATE_FILES  = $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/Defaults.template \
+                  $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/PainterImpl.template \
+                  $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/StateImpl.template
+TEMPLATE_DEST   = $(BUILDTOOLCLASSDIR)/org/jdesktop/synthdesigner/generator/resources
+
+JIBX_FILES      = $(BUILDTOOL_SOURCE_ROOT)/org/jdesktop/swingx/designer/Designer.jibx.xml \
+                  $(BUILDTOOL_SOURCE_ROOT)/org/jdesktop/synthdesigner/synthmodel/SynthModel.jibx.xml
+JIBX_LIBS_CP    = $(JIBX_LIBS_PATH)/bcel.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/xpp3.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/jibx-bind.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/jibx-run.jar
+JIBX_LIBS_LIST  = $(subst $(CLASSPATH_SEPARATOR), ,$(JIBX_LIBS_CP))
+
+
+#
+# Rules
+#
+
+include $(BUILDDIR)/common/BuildToolJar.gmk
+
+$(MAIN_CLASS_FILE): $(SOURCE_FILES) $(JIBX_LIBS_LIST)
+	@$(MKDIR) -p $(BUILDTOOLCLASSDIR)
+	$(BOOT_JAVAC_CMD) -classpath "$(JIBX_LIBS_CP)" \
+	    -d $(BUILDTOOLCLASSDIR) -sourcepath $(BUILDTOOL_SOURCE_ROOT) \
+	    $(SOURCE_FILES)
+
+$(TEMPLATE_DEST): $(TEMPLATE_FILES)
+	$(MKDIR) -p $(TEMPLATE_DEST)
+	$(RM) $(TEMPLATE_DEST)/*.template
+	$(CP) $(TEMPLATE_FILES) $(TEMPLATE_DEST)
+
+$(BUILDTOOL_MANIFEST_FILE): $(MAIN_CLASS_FILE)
+	$(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@
+	$(ECHO) "Class-Path: $(JIBX_LIBS_LIST:$(JIBX_LIBS_PATH)/%=%)" >> $@
+	$(CP) $(JIBX_LIBS_LIST) $(BUILDTOOLJARDIR)
+
+$(BUILDTOOL_JAR_FILE): $(MAIN_CLASS_FILE) $(TEMPLATE_DEST) \
+    $(JIBX_FILES) $(BUILDTOOL_MANIFEST_FILE)
+	@$(prep-target)
+	$(BOOT_JAVA_CMD) \
+	  -classpath "$(JIBX_LIBS_CP)$(CLASSPATH_SEPARATOR)$(BUILDTOOLCLASSDIR)" \
+	  org.jibx.binding.Compile $(JIBX_FILES)
+	$(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \
+	    -C $(BUILDTOOLCLASSDIR) org \
+	    $(BOOT_JAR_JFLAGS) || $(RM) $@
+	@$(java-vm-cleanup)
+
+clean clobber::
+	$(RM) -r $(TEMPLATE_DEST)
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/beans/AbstractBean.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/beans/AbstractBean.java
new file mode 100644
index 0000000..9132531
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/beans/AbstractBean.java
@@ -0,0 +1,475 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.beans;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
+import java.beans.VetoableChangeSupport;
+
+/**
+ * <p>A convenience class from which to extend all non-visual AbstractBeans. It
+ * manages the PropertyChange notification system, making it relatively trivial
+ * to add support for property change events in getters/setters.</p>
+ *
+ * <p>A non-visual java bean is a Java class that conforms to the AbstractBean
+ * patterns to allow visual manipulation of the bean's properties and event
+ * handlers at design-time.</p>
+ *
+ * <p>Here is a simple example bean that contains one property, foo, and the
+ * proper pattern for implementing property change notification:
+ * <pre><code>
+ *  public class ABean extends AbstractBean {
+ *    private String foo;
+ *
+ *    public void setFoo(String newFoo) {
+ *      String old = getFoo();
+ *      this.foo = newFoo;
+ *      firePropertyChange("foo", old, getFoo());
+ *    }
+ *
+ *    public String getFoo() {
+ *      return foo;
+ *    }
+ *  }
+ * </code></pre></p>
+ *
+ * <p>You will notice that "getFoo()" is used in the setFoo method rather than
+ * accessing "foo" directly for the gets. This is done intentionally so that if
+ * a subclass overrides getFoo() to return, for instance, a constant value the
+ * property change notification system will continue to work properly.</p>
+ *
+ * <p>The firePropertyChange method takes into account the old value and the new
+ * value. Only if the two differ will it fire a property change event. So you can
+ * be assured from the above code fragment that a property change event will only
+ * occur if old is indeed different from getFoo()</p>
+ *
+ * <p><code>AbstractBean</code> also supports {@link VetoablePropertyChange} events.
+ * These events are similar to <code>PropertyChange</code> events, except a special
+ * exception can be used to veto changing the property. For example, perhaps the
+ * property is changing from "fred" to "red", but a listener deems that "red" is
+ * unexceptable. In this case, the listener can fire a veto exception and the property must
+ * remain "fred". For example:
+ * <pre><code>
+ *  public class ABean extends AbstractBean {
+ *    private String foo;
+ *
+ *    public void setFoo(String newFoo) throws PropertyVetoException {
+ *      String old = getFoo();
+ *      this.foo = newFoo;
+ *      fireVetoableChange("foo", old, getFoo());
+ *    }
+ *
+ *    public String getFoo() {
+ *      return foo;
+ *    }
+ *  }
+ *
+ *  public class Tester {
+ *    public static void main(String... args) {
+ *      try {
+ *        ABean a = new ABean();
+ *        a.setFoo("fred");
+ *        a.addVetoableChangeListener(new VetoableChangeListener() {
+ *          public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
+ *            if ("red".equals(evt.getNewValue()) {
+ *              throw new PropertyVetoException("Cannot be red!", evt);
+ *            }
+ *          }
+ *        }
+ *        a.setFoo("red");
+ *      } catch (Exception e) {
+ *        e.printStackTrace(); // this will be executed
+ *      }
+ *    }
+ *  }
+ * </code></pre></p>
+ *
+ * @status REVIEWED
+ * @author rbair
+ */
+public abstract class AbstractBean {
+    /**
+     * Helper class that manages all the property change notification machinery.
+     * PropertyChangeSupport cannot be extended directly because it requires
+     * a bean in the constructor, and the "this" argument is not valid until
+     * after super construction. Hence, delegation instead of extension
+     */
+    private transient PropertyChangeSupport pcs;
+
+    /**
+     * Helper class that manages all the veto property change notification machinery.
+     */
+    private transient VetoableChangeSupport vcs;
+
+    /** Creates a new instance of AbstractBean */
+    protected AbstractBean() {
+        pcs = new PropertyChangeSupport(this);
+        vcs = new VetoableChangeSupport(this);
+    }
+
+    /**
+     * Creates a new instance of AbstractBean, using the supplied PropertyChangeSupport and
+     * VetoableChangeSupport delegates. Neither of these may be null.
+     */
+    protected AbstractBean(PropertyChangeSupport pcs, VetoableChangeSupport vcs) {
+        if (pcs == null) {
+            throw new NullPointerException("PropertyChangeSupport must not be null");
+        }
+        if (vcs == null) {
+            throw new NullPointerException("VetoableChangeSupport must not be null");
+        }
+
+        this.pcs = pcs;
+        this.vcs = vcs;
+    }
+
+    /**
+     * Add a PropertyChangeListener to the listener list.
+     * The listener is registered for all properties.
+     * The same listener object may be added more than once, and will be called
+     * as many times as it is added.
+     * If <code>listener</code> is null, no exception is thrown and no action
+     * is taken.
+     *
+     * @param listener  The PropertyChangeListener to be added
+     */
+    public final void addPropertyChangeListener(PropertyChangeListener listener) {
+        pcs.addPropertyChangeListener(listener);
+    }
+
+    /**
+     * Remove a PropertyChangeListener from the listener list.
+     * This removes a PropertyChangeListener that was registered
+     * for all properties.
+     * If <code>listener</code> was added more than once to the same event
+     * source, it will be notified one less time after being removed.
+     * If <code>listener</code> is null, or was never added, no exception is
+     * thrown and no action is taken.
+     *
+     * @param listener  The PropertyChangeListener to be removed
+     */
+    public final void removePropertyChangeListener(PropertyChangeListener listener) {
+        pcs.removePropertyChangeListener(listener);
+    }
+
+    /**
+     * Returns an array of all the listeners that were added to the
+     * PropertyChangeSupport object with addPropertyChangeListener().
+     * <p>
+     * If some listeners have been added with a named property, then
+     * the returned array will be a mixture of PropertyChangeListeners
+     * and <code>PropertyChangeListenerProxy</code>s. If the calling
+     * method is interested in distinguishing the listeners then it must
+     * test each element to see if it's a
+     * <code>PropertyChangeListenerProxy</code>, perform the cast, and examine
+     * the parameter.
+     *
+     * <pre>
+     * PropertyChangeListener[] listeners = bean.getPropertyChangeListeners();
+     * for (int i = 0; i < listeners.length; i++) {
+     *   if (listeners[i] instanceof PropertyChangeListenerProxy) {
+     *     PropertyChangeListenerProxy proxy =
+     *                    (PropertyChangeListenerProxy)listeners[i];
+     *     if (proxy.getPropertyName().equals("foo")) {
+     *       // proxy is a PropertyChangeListener which was associated
+     *       // with the property named "foo"
+     *     }
+     *   }
+     * }
+     *</pre>
+     *
+     * @see java.beans.PropertyChangeListenerProxy
+     * @return all of the <code>PropertyChangeListeners</code> added or an
+     *         empty array if no listeners have been added
+     */
+    public final PropertyChangeListener[] getPropertyChangeListeners() {
+        return pcs.getPropertyChangeListeners();
+    }
+
+    /**
+     * Add a PropertyChangeListener for a specific property.  The listener
+     * will be invoked only when a call on firePropertyChange names that
+     * specific property.
+     * The same listener object may be added more than once.  For each
+     * property,  the listener will be invoked the number of times it was added
+     * for that property.
+     * If <code>propertyName</code> or <code>listener</code> is null, no
+     * exception is thrown and no action is taken.
+     *
+     * @param propertyName  The name of the property to listen on.
+     * @param listener  The PropertyChangeListener to be added
+     */
+    public final void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+        pcs.addPropertyChangeListener(propertyName, listener);
+    }
+
+    /**
+     * Remove a PropertyChangeListener for a specific property.
+     * If <code>listener</code> was added more than once to the same event
+     * source for the specified property, it will be notified one less time
+     * after being removed.
+     * If <code>propertyName</code> is null,  no exception is thrown and no
+     * action is taken.
+     * If <code>listener</code> is null, or was never added for the specified
+     * property, no exception is thrown and no action is taken.
+     *
+     * @param propertyName  The name of the property that was listened on.
+     * @param listener  The PropertyChangeListener to be removed
+     */
+    public final void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+        pcs.removePropertyChangeListener(propertyName, listener);
+    }
+
+    /**
+     * Returns an array of all the listeners which have been associated
+     * with the named property.
+     *
+     * @param propertyName  The name of the property being listened to
+     * @return all of the <code>PropertyChangeListeners</code> associated with
+     *         the named property.  If no such listeners have been added,
+     *         or if <code>propertyName</code> is null, an empty array is
+     *         returned.
+     */
+    public final PropertyChangeListener[] getPropertyChangeListeners(String propertyName) {
+            return pcs.getPropertyChangeListeners(propertyName);
+    }
+
+    /**
+     * Report a bound property update to any registered listeners.
+     * No event is fired if old and new are equal and non-null.
+     *
+     * <p>
+     * This is merely a convenience wrapper around the more general
+     * firePropertyChange method that takes {@code
+     * PropertyChangeEvent} value.
+     *
+     * @param propertyName  The programmatic name of the property
+     *                      that was changed.
+     * @param oldValue  The old value of the property.
+     * @param newValue  The new value of the property.
+     */
+    protected final void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+        pcs.firePropertyChange(propertyName, oldValue, newValue);
+    }
+
+    /**
+     * Fire an existing PropertyChangeEvent to any registered listeners.
+     * No event is fired if the given event's old and new values are
+     * equal and non-null.
+     * @param evt  The PropertyChangeEvent object.
+     */
+    protected final void firePropertyChange(PropertyChangeEvent evt) {
+        pcs.firePropertyChange(evt);
+    }
+
+
+    /**
+     * Report a bound indexed property update to any registered
+     * listeners.
+     * <p>
+     * No event is fired if old and new values are equal
+     * and non-null.
+     *
+     * <p>
+     * This is merely a convenience wrapper around the more general
+     * firePropertyChange method that takes {@code PropertyChangeEvent} value.
+     *
+     * @param propertyName The programmatic name of the property that
+     *                     was changed.
+     * @param index        index of the property element that was changed.
+     * @param oldValue     The old value of the property.
+     * @param newValue     The new value of the property.
+     */
+    protected final void fireIndexedPropertyChange(String propertyName,
+            int index, Object oldValue, Object newValue) {
+        pcs.fireIndexedPropertyChange(propertyName, index, oldValue, newValue);
+    }
+
+    /**
+     * Check if there are any listeners for a specific property, including
+     * those registered on all properties.  If <code>propertyName</code>
+     * is null, only check for listeners registered on all properties.
+     *
+     * @param propertyName  the property name.
+     * @return true if there are one or more listeners for the given property
+     */
+    protected final boolean hasPropertyChangeListeners(String propertyName) {
+        return pcs.hasListeners(propertyName);
+    }
+
+    /**
+     * Check if there are any listeners for a specific property, including
+     * those registered on all properties.  If <code>propertyName</code>
+     * is null, only check for listeners registered on all properties.
+     *
+     * @param propertyName  the property name.
+     * @return true if there are one or more listeners for the given property
+     */
+    protected final boolean hasVetoableChangeListeners(String propertyName) {
+        return vcs.hasListeners(propertyName);
+    }
+
+    /**
+     * Add a VetoableListener to the listener list.
+     * The listener is registered for all properties.
+     * The same listener object may be added more than once, and will be called
+     * as many times as it is added.
+     * If <code>listener</code> is null, no exception is thrown and no action
+     * is taken.
+     *
+     * @param listener  The VetoableChangeListener to be added
+     */
+
+    public final void addVetoableChangeListener(VetoableChangeListener listener) {
+        vcs.addVetoableChangeListener(listener);
+    }
+
+    /**
+     * Remove a VetoableChangeListener from the listener list.
+     * This removes a VetoableChangeListener that was registered
+     * for all properties.
+     * If <code>listener</code> was added more than once to the same event
+     * source, it will be notified one less time after being removed.
+     * If <code>listener</code> is null, or was never added, no exception is
+     * thrown and no action is taken.
+     *
+     * @param listener  The VetoableChangeListener to be removed
+     */
+    public final void removeVetoableChangeListener(VetoableChangeListener listener) {
+        vcs.removeVetoableChangeListener(listener);
+    }
+
+    /**
+     * Returns the list of VetoableChangeListeners. If named vetoable change listeners
+     * were added, then VetoableChangeListenerProxy wrappers will returned
+     * <p>
+     * @return List of VetoableChangeListeners and VetoableChangeListenerProxys
+     *         if named property change listeners were added.
+     */
+    public final VetoableChangeListener[] getVetoableChangeListeners(){
+        return vcs.getVetoableChangeListeners();
+    }
+
+    /**
+     * Add a VetoableChangeListener for a specific property.  The listener
+     * will be invoked only when a call on fireVetoableChange names that
+     * specific property.
+     * The same listener object may be added more than once.  For each
+     * property,  the listener will be invoked the number of times it was added
+     * for that property.
+     * If <code>propertyName</code> or <code>listener</code> is null, no
+     * exception is thrown and no action is taken.
+     *
+     * @param propertyName  The name of the property to listen on.
+     * @param listener  The VetoableChangeListener to be added
+     */
+
+    public final void addVetoableChangeListener(String propertyName,
+                VetoableChangeListener listener) {
+        vcs.addVetoableChangeListener(propertyName, listener);
+    }
+
+    /**
+     * Remove a VetoableChangeListener for a specific property.
+     * If <code>listener</code> was added more than once to the same event
+     * source for the specified property, it will be notified one less time
+     * after being removed.
+     * If <code>propertyName</code> is null, no exception is thrown and no
+     * action is taken.
+     * If <code>listener</code> is null, or was never added for the specified
+     * property, no exception is thrown and no action is taken.
+     *
+     * @param propertyName  The name of the property that was listened on.
+     * @param listener  The VetoableChangeListener to be removed
+     */
+
+    public final void removeVetoableChangeListener(String propertyName,
+                VetoableChangeListener listener) {
+        vcs.removeVetoableChangeListener(propertyName, listener);
+    }
+
+    /**
+     * Returns an array of all the listeners which have been associated
+     * with the named property.
+     *
+     * @param propertyName  The name of the property being listened to
+     * @return all the <code>VetoableChangeListeners</code> associated with
+     *         the named property.  If no such listeners have been added,
+     *         or if <code>propertyName</code> is null, an empty array is
+     *         returned.
+     */
+    public final VetoableChangeListener[] getVetoableChangeListeners(String propertyName) {
+        return vcs.getVetoableChangeListeners(propertyName);
+    }
+
+    /**
+     * Report a vetoable property update to any registered listeners.  If
+     * anyone vetos the change, then fire a new event reverting everyone to
+     * the old value and then rethrow the PropertyVetoException.
+     * <p>
+     * No event is fired if old and new are equal and non-null.
+     *
+     * @param propertyName  The programmatic name of the property
+     *                      that is about to change..
+     * @param oldValue  The old value of the property.
+     * @param newValue  The new value of the property.
+     * @exception PropertyVetoException if the recipient wishes the property
+     *              change to be rolled back.
+     */
+    protected final void fireVetoableChange(String propertyName,
+                                            Object oldValue, Object newValue)
+                                            throws PropertyVetoException {
+         vcs.fireVetoableChange(propertyName, oldValue, newValue);
+    }
+
+    /**
+     * Fire a vetoable property update to any registered listeners.  If
+     * anyone vetos the change, then fire a new event reverting everyone to
+     * the old value and then rethrow the PropertyVetoException.
+     * <p>
+     * No event is fired if old and new are equal and non-null.
+     *
+     * @param evt  The PropertyChangeEvent to be fired.
+     * @exception PropertyVetoException if the recipient wishes the property
+     *              change to be rolled back.
+     */
+    protected final void fireVetoableChange(PropertyChangeEvent evt)
+                    throws PropertyVetoException {
+        vcs.fireVetoableChange(evt);
+    }
+
+    /**
+     * @inheritDoc
+     */
+    public Object clone() throws CloneNotSupportedException {
+        AbstractBean result = (AbstractBean) super.clone();
+        result.pcs = new PropertyChangeSupport(result);
+        result.vcs = new VetoableChangeSupport(result);
+        return result;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BezierControlPoint.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BezierControlPoint.java
new file mode 100644
index 0000000..be2bc4e
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BezierControlPoint.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import java.awt.BasicStroke;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * BezierControlPoint
+ *
+ * @author Created by Jasper Potts (May 29, 2007)
+ */
+public class BezierControlPoint extends ControlPoint {
+    private HandleControlPoint cp1 = new HandleControlPoint();
+    private HandleControlPoint cp2 = new HandleControlPoint();
+    private transient boolean makingChange = false;
+    private transient PropertyChangeListener cpListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+//            if (!makingChange) {
+//                makingChange = true;
+//                if (evt.getSource() == cp1) {
+//                    double angle = Math.tan((cp1.getY() - getY())/(cp1.getX() - getX()));
+//                    double cp2len = Math.sqrt(
+//                            Math.pow(cp2.getX() - getX(),2) +
+//                            Math.pow(cp2.getY() - getY(),2)
+//                    );
+//                    double offsetX = cp2len * Math.sin(angle);
+//                    double offsetY = cp2len * Math.cos(angle);
+//                    cp2.setPosition(getX() - offsetX, getY() - offsetY);
+//                } else {
+//                    double angle = Math.tan((cp2.getY() - getY())/(cp2.getX() - getX()));
+//                    double cp1len = Math.sqrt(
+//                            Math.pow(cp1.getX() - getX(),2) +
+//                            Math.pow(cp1.getY() - getY(),2)
+//                    );
+//                    double offsetX = cp1len * Math.sin(angle);
+//                    double offsetY = cp1len * Math.cos(angle);
+//                    cp1.setPosition(getX() - offsetX, getY() - offsetY);
+//                }
+////                if (evt.getSource() == cp1) {
+////                    double offsetX = cp1.getX() - getX();
+////                    double offsetY = cp1.getY() - getY();
+////                    cp2.setPosition(getX() - offsetX, getY() - offsetY);
+////                } else {
+////                    double offsetX = cp2.getX() - getX();
+////                    double offsetY = cp2.getY() - getY();
+////                    cp1.setPosition(getX() - offsetX, getY() - offsetY);
+////                }
+//                makingChange = false;
+//                firePropertyChange("cp1", null, cp1);
+//                firePropertyChange("cp2", null, cp1);
+//            }
+            firePropertyChange("shape",null,getShape());
+        }
+    };
+
+    public BezierControlPoint() {
+        cp1.addPropertyChangeListener(cpListener);
+        cp2.addPropertyChangeListener(cpListener);
+    }
+
+    public BezierControlPoint(double x, double y) {
+        super(x, y);
+        cp1.addPropertyChangeListener(cpListener);
+        cp2.addPropertyChangeListener(cpListener);
+        cp1.setPosition(x, y);
+        cp2.setPosition(x, y);
+    }
+
+    public boolean isSharpCorner() {
+        return
+                (cp1.getX() == x.getValue()) &&
+                        (cp1.getY() == y.getValue()) &&
+                        (cp2.getX() == x.getValue()) &&
+                        (cp2.getY() == y.getValue());
+    }
+
+    public void flip(int width, int height){
+        makingChange = true;
+        if (width > 0){
+            x.setValue(width - x.getValue());
+            cp1.x.setValue(width - cp1.x.getValue());
+            cp2.x.setValue(width - cp2.x.getValue());
+        }
+        if (height > 0){
+            y.setValue(height - y.getValue());
+            cp1.y.setValue(height - cp1.y.getValue());
+            cp2.y.setValue(height - cp2.y.getValue());
+        }
+        makingChange = false;
+    }
+
+    public void convertToSharpCorner() {
+        cp1.setPosition(x.getValue(), y.getValue());
+        cp2.setPosition(x.getValue(), y.getValue());
+    }
+
+    public List<ControlPoint> getControlPoints() {
+        if (isSharpCorner()) {
+            return Collections.emptyList();
+        } else {
+            List<ControlPoint> points = new ArrayList<ControlPoint>();
+            points.add(cp1);
+            points.add(cp2);
+            return points;
+        }
+    }
+
+    public HandleControlPoint getCp1() {
+        return cp1;
+    }
+
+    public HandleControlPoint getCp2() {
+        return cp2;
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        g2.setStroke(new BasicStroke((float) pixelSize));
+        // paint control line
+        g2.setColor(GraphicsHelper.BEZIER_CONTROL_LINE);
+        g2.draw(new Line2D.Double(cp1.getX(), cp1.getY(), getX(), getY()));
+        g2.draw(new Line2D.Double(getX(), getY(), cp2.getX(), cp2.getY()));
+        // paint this control point
+        Shape s;
+        if (isSharpCorner()) {
+            double size = pixelSize * 4d;
+            GeneralPath path = new GeneralPath();
+            path.moveTo(getX() - size, getY());
+            path.lineTo(getX(), getY() + size);
+            path.lineTo(getX() + size, getY());
+            path.lineTo(getX(), getY() - size);
+            path.closePath();
+            s = path;
+        } else {
+            double size = pixelSize * 3d;
+            s = new Ellipse2D.Double(getX() - size, getY() - size,
+                    size * 2, size * 2);
+        }
+        g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_FILL);
+        g2.fill(s);
+        g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_LINE);
+        g2.draw(s);
+        // paint child control points
+        if (!isSharpCorner()) {
+            cp1.paintControls(g2, pixelSize, true);
+            cp2.paintControls(g2, pixelSize, true);
+        }
+    }
+
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        makingChange = true;
+        super.move(moveX, moveY, snapPixels);
+        cp1.move(moveX, moveY, snapPixels);
+        cp2.move(moveX, moveY, snapPixels);
+        makingChange = false;
+    }
+
+    public double getCp1X() {
+        return cp1.getX();
+    }
+
+    public void setCp1X(double v) {
+        cp1.setX(v);
+    }
+
+    public double getCp1Y() {
+        return cp1.getY();
+    }
+
+    public void setCp1Y(double v) {
+        cp1.setY(v);
+    }
+
+    public double getCp2X() {
+        return cp2.getX();
+    }
+
+    public void setCp2X(double v) {
+        cp2.setX(v);
+    }
+
+    public double getCp2Y() {
+        return cp2.getY();
+    }
+
+    public void setCp2Y(double v) {
+        cp2.setY(v);
+    }
+
+    // =================================================================================================================
+    // Bezier handle control point
+
+    public class HandleControlPoint extends ControlPoint {
+
+        public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+            if (!isSharp()){
+                double size = pixelSize * 3d;
+                Shape s = new Ellipse2D.Double(getX() - size, getY() - size,
+                        size * 2, size * 2);
+                g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_FILL);
+                g2.fill(s);
+                g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_LINE);
+                g2.draw(s);
+                g2.draw(new Rectangle2D.Double(getX() - (pixelSize / 2), getY() - (pixelSize / 2), pixelSize, pixelSize));
+            }
+        }
+
+        public boolean isHit(Point2D p, double pixelSize) {
+            return !isSharp() && super.isHit(p, pixelSize);
+        }
+
+        /**
+         * Is the line controled by this handle in or out of the parent BezierControlPoint sharp.
+         *
+         * @return <code>true</code> If this is the exact same point as the parent BezierControlPoint.
+         */
+        public boolean isSharp(){
+            return x.getValue() == BezierControlPoint.this.x.getValue() &&
+                y.getValue() == BezierControlPoint.this.y.getValue();
+        }
+
+        public void convertToSharp(){
+            setPosition(BezierControlPoint.this.x.getValue(),BezierControlPoint.this.y.getValue());
+        }
+
+        public BezierControlPoint getParentControlPoint(){
+            return BezierControlPoint.this;
+        }
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BlendingMode.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BlendingMode.java
new file mode 100644
index 0000000..ade7d08
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/BlendingMode.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+
+/**
+ * BlendingMode - Enum of composite blending modes, setup to match photoshop as closely as possible
+ *
+ * @author Created by Jasper Potts (May 31, 2007)
+ */
+public enum BlendingMode {
+    NORMAL,
+    // DISSOLVE, missing
+    // -----------------------------
+    DARKEN,
+    MULTIPLY,
+    COLOR_BURN,
+    LINEAR_BURN, // (SUBTRACT)
+    // -----------------------------
+    LIGHTEN,
+    SCREEN,
+    COLOR_DODGE,
+    LINEAR_DODGE, // (ADD)
+    // -----------------------------
+    OVERLAY,
+    SOFT_LIGHT,
+    HARD_LIGHT,
+    VIVID_LIGHT, // (HEAT) is close
+    LINEAR_LIGHT, // (GLOW) is close
+    //PIN_LIGHT, missing
+    //HARD_MIX, missing
+    // -----------------------------
+    DIFFERENCE,
+    EXCLUSION,
+    // -----------------------------
+    HUE, // nowhere close
+    SATURATION,
+    COLOR,
+    LUMINOSITY, // close but not exact
+    //LIGHTER_COLOR, missing
+    //DARKER_COLOR, missing
+    ;
+
+
+    // =================================================================================================================
+    // Helper methods for creating Blending Mode Combo Box
+
+    public static final Object[] BLENDING_MODES = new Object[]{
+            BlendingMode.NORMAL,
+            // DISSOLVE, missing
+            "-",
+            BlendingMode.DARKEN,
+            BlendingMode.MULTIPLY,
+            BlendingMode.COLOR_BURN,
+            BlendingMode.LINEAR_BURN, // (SUBTRACT)
+            "-",
+            BlendingMode.LIGHTEN,
+            BlendingMode.SCREEN,
+            BlendingMode.COLOR_DODGE,
+            BlendingMode.LINEAR_DODGE, // (ADD)
+            "-",
+            BlendingMode.OVERLAY,
+            BlendingMode.SOFT_LIGHT,
+            BlendingMode.HARD_LIGHT,
+            BlendingMode.VIVID_LIGHT, // (HEAT) is close
+            BlendingMode.LINEAR_LIGHT, // (GLOW) is close
+            //PIN_LIGHT, missing
+            //HARD_MIX, missing
+            "-",
+            BlendingMode.DIFFERENCE,
+            BlendingMode.EXCLUSION,
+            "-",
+            BlendingMode.HUE, // nowhere close
+            BlendingMode.SATURATION,
+            BlendingMode.COLOR,
+            BlendingMode.LUMINOSITY, // close but not exact
+    };
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Canvas.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Canvas.java
new file mode 100644
index 0000000..43f9cc6
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Canvas.java
@@ -0,0 +1,308 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.utils.HasResources;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.UIDefaults;
+import java.awt.AlphaComposite;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * ComponentRegion
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public class Canvas extends AbstractBean implements LayerContainer, HasUIDefaults, HasResources {
+    private Dimension size;
+    /** list of all layers in the canvas, the first layer is painted on top */
+    private List<Layer> layers;
+    private int nextLayerNameIndex = 1;
+    private BufferedImage buffer;
+    private boolean isValid = false;
+    private Insets stretchingInsets = null;
+    private Layer workingLayer = null;
+    private PropertyChangeListener layersPropertyChangeListener;
+    private UIDefaults canvasUIDefaults = null;
+    private transient File resourcesDir;
+    private transient File imagesDir;
+    private transient File templatesDir;
+
+    // =================================================================================================================
+    // Constructor
+
+    /** Private constructor for JIBX */
+    protected Canvas() {
+        layersPropertyChangeListener = new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                isValid = false;
+                // pass on layer change
+                int index = layers.indexOf((Layer) evt.getSource());
+                if (index != -1) {
+                    firePropertyChange("layers[" + index + "]." + evt.getPropertyName(), evt.getOldValue(),
+                            evt.getNewValue());
+                }
+            }
+        };
+    }
+
+    public Canvas(int width, int height) {
+        this();
+        stretchingInsets = new Insets(1, 1, 1, 1);
+        layers = new ArrayList<Layer>();
+        setSize(new Dimension(width, height));
+        addLayer(new Layer());
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX before all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void preSet(IUnmarshallingContext context) {
+        canvasUIDefaults = (UIDefaults) context.getUserContext();
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get the UIDefaults for this canvas. The UIDefaults is used to store default pallet of colors, fonts etc.
+     *
+     * @return Canvas UIDefaults
+     */
+    public UIDefaults getUiDefaults() {
+        return canvasUIDefaults;
+    }
+
+    /**
+     * Set the UIDefaults for this canvas. The UIDefaults is used to store default pallet of colors, fonts etc.
+     *
+     * @param canvasUIDefaults Canvas UIDefaults
+     */
+    public void setUiDefaults(UIDefaults canvasUIDefaults) {
+        this.canvasUIDefaults = canvasUIDefaults;
+    }
+
+    /**
+     * Get the current working layer, is is the layer that new shapes will be drawn into
+     *
+     * @return The current working layer, may be null if there is no working layer
+     */
+    public Layer getWorkingLayer() {
+        return workingLayer;
+    }
+
+    /**
+     * Set the current working layer, is is the layer that new shapes will be drawn into
+     *
+     * @param workingLayer the new working layer, must be a child of this canvas
+     */
+    public void setWorkingLayer(Layer workingLayer) {
+        Layer old = getWorkingLayer();
+        this.workingLayer = workingLayer;
+        firePropertyChange("workingLayer", old, getWorkingLayer());
+    }
+
+    public int getNextLayerNameIndex() {
+        return nextLayerNameIndex++;
+    }
+
+    public Dimension getSize() {
+        return size;
+    }
+
+    public void setSize(Dimension size) {
+        Dimension old = getSize();
+        this.size = size;
+        buffer = new BufferedImage(this.size.width, this.size.height, BufferedImage.TYPE_INT_ARGB);
+        isValid = false;
+        firePropertyChange("size", old, getSize());
+    }
+
+
+    public Insets getStretchingInsets() {
+        return stretchingInsets;
+    }
+
+    public void setStretchingInsets(Insets stretchingInsets) {
+        Insets old = getStretchingInsets();
+        this.stretchingInsets = stretchingInsets;
+        firePropertyChange("stretchingInsets", old, getStretchingInsets());
+    }
+
+    public BufferedImage getRenderedImage() {
+        if (!isValid) {
+            Graphics2D g2 = buffer.createGraphics();
+            // clear
+            g2.setComposite(AlphaComposite.Clear);
+            g2.fillRect(0, 0, buffer.getWidth(), buffer.getHeight());
+            // paint
+            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+            g2.setComposite(AlphaComposite.SrcOver);
+            for (int i = layers.size() - 1; i >= 0; i--) {
+                layers.get(i).paint(g2, 1);
+            }
+            g2.dispose();
+        }
+        return buffer;
+    }
+
+    /**
+     * @return true if this Canvas has not been edited.
+     *         <p/>
+     *         TODO Currently this is not a bound property, but should be. That is, when the Canvas becomes edited
+     *         (usually due to the Layer having a shape added to it), then a property change event should be fired.
+     */
+    public boolean isBlank() {
+        return layers.size() == 0 || (layers.size() == 1 && layers.get(0).isEmpty());
+    }
+
+    public File getResourcesDir() {
+        return resourcesDir;
+    }
+
+    public void setResourcesDir(File resourcesDir) {
+        File old = getResourcesDir();
+        this.resourcesDir = resourcesDir;
+        firePropertyChange("resourcesDir", old, getResourcesDir());
+    }
+
+    public File getImagesDir() {
+        return imagesDir;
+    }
+
+    public void setImagesDir(File imagesDir) {
+        File old = getImagesDir();
+        this.imagesDir = imagesDir;
+        firePropertyChange("imagesDir", old, getImagesDir());
+    }
+
+    public File getTemplatesDir() {
+        return templatesDir;
+    }
+
+    public void setTemplatesDir(File templatesDir) {
+        File old = getTemplatesDir();
+        this.templatesDir = templatesDir;
+        firePropertyChange("templatesDir", old, getTemplatesDir());
+    }
+
+    // =================================================================================================================
+    // LayerContainer Methods
+
+    public LayerContainer getParent() {
+        // we are root so null
+        return null;
+    }
+
+    public void addLayerToBottom(Layer layer) {
+        layers.add(layer);
+        layer.setParent(this);
+        layer.addPropertyChangeListener(layersPropertyChangeListener);
+        // no single layer changes so fire all changed event
+        firePropertyChange("layers", null, layers);
+    }
+
+    public void addLayer(int i, Layer layer) {
+        layers.add(i, layer);
+        layer.setParent(this);
+        layer.addPropertyChangeListener(layersPropertyChangeListener);
+        // no single layer changes so fire all changed event
+        firePropertyChange("layers", null, layers);
+    }
+
+    public void addLayer(Layer layer) {
+        layers.add(0, layer);
+        layer.setParent(this);
+        layer.addPropertyChangeListener(layersPropertyChangeListener);
+        // no single layer changes so fire all changed event
+        firePropertyChange("layers", null, layers);
+    }
+
+    public Layer getLayer(int index) {
+        return layers.get(index);
+    }
+
+    public int getLayerCount() {
+        return layers.size();
+    }
+
+    public Iterator<Layer> getLayerIterator() {
+        return Collections.unmodifiableList(layers).iterator();
+    }
+
+    public Collection<Layer> getLayers() {
+        return Collections.unmodifiableList(layers);
+    }
+
+    public int indexOfLayer(Layer layer) {
+        return layers.indexOf(layer);
+    }
+
+    public void removeLayer(Layer layer) {
+        int index = layers.indexOf(layer);
+        if (index != -1) {
+            layers.remove(layer);
+            layer.removePropertyChangeListener(layersPropertyChangeListener);
+            fireIndexedPropertyChange("layers", index, layer, null);
+        }
+    }
+
+    public Dimension getRootSize() {
+        return getSize();
+    }
+
+    // =================================================================================================================
+    // JIBX Helper Methods
+
+    /** Called by JIBX after "layers" has been filled so we can set parents and listeners */
+    private void setupLayers() {
+        for (Layer layer : layers) {
+            layer.setParent(this);
+            layer.addPropertyChangeListener(layersPropertyChangeListener);
+        }
+        // no single layer changes so fire all changed event
+        firePropertyChange("layers", null, layers);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/ControlPoint.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/ControlPoint.java
new file mode 100644
index 0000000..b4d231c
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/ControlPoint.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * ControlPoint
+ *
+ * @author Created by Jasper Potts (May 24, 2007)
+ */
+public class ControlPoint extends SimpleShape {
+    protected Color fillColor;
+    protected Color lineColor;
+    protected DoubleBean x, y;
+
+    public ControlPoint() {
+        this(new DoubleBean(), new DoubleBean());
+    }
+
+    public ControlPoint(Color fillColor, Color lineColor) {
+        this(new DoubleBean(), new DoubleBean(), fillColor, lineColor);
+    }
+
+    public ControlPoint(double x, double y) {
+        this(new DoubleBean(x), new DoubleBean(y));
+    }
+
+    public ControlPoint(DoubleBean x, DoubleBean y) {
+        this(x, y, GraphicsHelper.CONTROL_POINT_FILL, GraphicsHelper.CONTROL_POINT_LINE);
+    }
+
+    public ControlPoint(DoubleBean x, DoubleBean y, Color fillColor, Color lineColor) {
+        this.x = x;
+        this.y = y;
+        this.fillColor = fillColor;
+        this.lineColor = lineColor;
+        x.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("position",
+                        new Point2D.Double((Double) evt.getOldValue(), getY()),
+                        getPosition());
+            }
+        });
+        y.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("position",
+                        new Point2D.Double(getX(), (Double) evt.getOldValue()),
+                        getPosition());
+            }
+        });
+    }
+
+    public double getX() {
+        return x.getValue();
+    }
+
+    public double getY() {
+        return y.getValue();
+    }
+
+    public void setX(double x) {
+        this.x.setValue(x);
+    }
+
+    public void setY(double y) {
+        this.y.setValue(y);
+    }
+
+    public void setPosition(Point2D position) {
+        x.setValue(position.getX());
+        y.setValue(position.getY());
+    }
+
+    public void setPosition(double x, double y) {
+        setPosition(new Point2D.Double(x, y));
+    }
+
+    public Point2D getPosition() {
+        return new Point2D.Double(getX(), getY());
+    }
+
+    public Rectangle2D getBounds(double pixelSize) {
+        double size = pixelSize * 4d;
+        return new Rectangle2D.Double(getX() - size, getY() - size,
+                size * 2, size * 2);
+    }
+
+    public boolean isHit(Point2D p, double pixelSize) {
+        return getBounds(pixelSize).contains(p);
+    }
+
+
+    public Shape getShape() {
+        return getBounds(0);
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        g2.setStroke(new BasicStroke((float) pixelSize));
+        Shape s = getBounds(pixelSize);
+        g2.setColor(fillColor);
+        g2.fill(s);
+        g2.setColor(lineColor);
+        g2.draw(s);
+    }
+
+    public List<ControlPoint> getControlPoints() {
+        return Collections.emptyList();
+    }
+
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        if (snapPixels) {
+            setPosition(
+                    Math.round(x.getValue() + moveX),
+                    Math.round(y.getValue() + moveY));
+        } else {
+            setPosition(x.getValue() + moveX, y.getValue() + moveY);
+        }
+    }
+
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Designer.jibx.xml b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Designer.jibx.xml
new file mode 100644
index 0000000..0f80bcf
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Designer.jibx.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+
+<!DOCTYPE binding SYSTEM "http://jibx.sourceforge.net">
+<binding>
+    <!-- == PAINTS =========================================================================================== -->
+    <mapping class="java.awt.Color"
+             marshaller="org.jdesktop.swingx.designer.jibxhelpers.ColorMapper"
+             unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.ColorMapper"/>
+    <mapping name="matte" class="org.jdesktop.swingx.designer.paint.Matte" post-set="postSet">
+        <value name="red" field="red" style="attribute"/>
+        <value name="green" field="green" style="attribute"/>
+        <value name="blue" field="blue" style="attribute"/>
+        <value name="alpha" field="alpha" style="attribute"/>
+        <value name="uiDefaultParentName" field="uiDefaultParentName" style="attribute" usage="optional"/>
+        <value name="componentPropertyName" field="componentPropertyName" style="attribute" usage="optional"/>
+        <value name="hueOffset" field="hueOffset" style="attribute"/>
+        <value name="saturationOffset" field="saturationOffset" style="attribute"/>
+        <value name="brightnessOffset" field="brightnessOffset" style="attribute"/>
+        <value name="alphaOffset" field="alphaOffset" style="attribute"/>
+        <value name="uiResource" field="uiResource" style="attribute" usage="optional" default="true"/>
+    </mapping>
+    <mapping class="org.jdesktop.swingx.designer.paint.AbstractGradient" abstract="true">
+        <value name="cycleMethod" field="cycleMethod" style="attribute"/>
+        <collection field="stops" set-method="setStops" pre-set="clear" create-type="java.util.ArrayList">
+            <structure name="stop" type="org.jdesktop.swingx.designer.paint.GradientStop">
+                <value name="position" field="position" style="attribute"/>
+                <value name="midpoint" field="midpoint" style="attribute"/>
+                <structure field="color" set-method="setColor"/>
+            </structure>
+        </collection>
+    </mapping>
+    <mapping name="gradient" class="org.jdesktop.swingx.designer.paint.Gradient"
+             extends="org.jdesktop.swingx.designer.paint.AbstractGradient">
+        <structure map-as="org.jdesktop.swingx.designer.paint.AbstractGradient"/>
+    </mapping>
+    <mapping name="radialGradient" class="org.jdesktop.swingx.designer.paint.RadialGradient"
+             extends="org.jdesktop.swingx.designer.paint.AbstractGradient">
+        <structure map-as="org.jdesktop.swingx.designer.paint.AbstractGradient"/>
+    </mapping>
+    <!-- == SHAPES =========================================================================================== -->
+    <mapping class="org.jdesktop.swingx.designer.SimpleShape" abstract="true">
+        <!--protected AffineTransform transform = new AffineTransform();-->
+    </mapping>
+    <mapping class="org.jdesktop.swingx.designer.PaintedShape" abstract="true"
+             extends="org.jdesktop.swingx.designer.SimpleShape">
+        <structure map-as="org.jdesktop.swingx.designer.SimpleShape"/>
+        <structure field="paint"/>
+        <structure name="paintPoints">
+            <value name="x1" get-method="getPaintX1" set-method="setPaintX1" style="attribute"/>
+            <value name="y1" get-method="getPaintY1" set-method="setPaintY1" style="attribute"/>
+            <value name="x2" get-method="getPaintX2" set-method="setPaintX2" style="attribute"/>
+            <value name="y2" get-method="getPaintY2" set-method="setPaintY2" style="attribute"/>
+        </structure>
+    </mapping>
+    <mapping name="rectangle" class="org.jdesktop.swingx.designer.RectangleShape"
+             extends="org.jdesktop.swingx.designer.PaintedShape">
+        <structure map-as="org.jdesktop.swingx.designer.PaintedShape"/>
+        <value name="x1" get-method="getX1" set-method="setX1" style="attribute"/>
+        <value name="x2" get-method="getX2" set-method="setX2" style="attribute"/>
+        <value name="y1" get-method="getY1" set-method="setY1" style="attribute"/>
+        <value name="y2" get-method="getY2" set-method="setY2" style="attribute"/>
+        <value name="rounding" get-method="getRounding" set-method="setRounding" style="attribute"/>
+    </mapping>
+    <mapping name="ellipse" class="org.jdesktop.swingx.designer.EllipseShape"
+             extends="org.jdesktop.swingx.designer.PaintedShape">
+        <structure map-as="org.jdesktop.swingx.designer.PaintedShape"/>
+        <value name="x1" get-method="getX1" set-method="setX1" style="attribute"/>
+        <value name="x2" get-method="getX2" set-method="setX2" style="attribute"/>
+        <value name="y1" get-method="getY1" set-method="setY1" style="attribute"/>
+        <value name="y2" get-method="getY2" set-method="setY2" style="attribute"/>
+    </mapping>
+    <mapping name="path" class="org.jdesktop.swingx.designer.PathShape"
+             extends="org.jdesktop.swingx.designer.PaintedShape">
+        <structure map-as="org.jdesktop.swingx.designer.PaintedShape"/>
+        <collection name="points" get-method="getBezierControlPoints"
+                    set-method="setControlPoints" create-type="java.util.ArrayList">
+            <structure name="point" type="org.jdesktop.swingx.designer.BezierControlPoint">
+                <value name="x" get-method="getX" set-method="setX" style="attribute"/>
+                <value name="y" get-method="getY" set-method="setY" style="attribute"/>
+                <value name="cp1x" get-method="getCp1X" set-method="setCp1X" style="attribute"/>
+                <value name="cp1y" get-method="getCp1Y" set-method="setCp1Y" style="attribute"/>
+                <value name="cp2x" get-method="getCp2X" set-method="setCp2X" style="attribute"/>
+                <value name="cp2y" get-method="getCp2Y" set-method="setCp2Y" style="attribute"/>
+            </structure>
+        </collection>
+    </mapping>
+    <!-- == EFFECTS =========================================================================================== -->
+    <mapping class="org.jdesktop.swingx.designer.effects.ShadowEffect" abstract="true">
+        <structure field="color"/>
+        <value name="blendingMode" field="blendingMode" style="attribute"/>
+        <value name="opacity" field="opacity" style="attribute"/>
+        <value name="angle" field="angle" style="attribute"/>
+        <value name="distance" field="distance" style="attribute"/>
+        <value name="spread" field="spread" style="attribute"/>
+        <value name="size" field="size" style="attribute"/>
+    </mapping>
+    <mapping name="dropShadow" class="org.jdesktop.swingx.designer.effects.DropShadowEffect"
+             extends="org.jdesktop.swingx.designer.effects.ShadowEffect">
+        <structure map-as="org.jdesktop.swingx.designer.effects.ShadowEffect"/>
+    </mapping>
+    <mapping name="innerShadow" class="org.jdesktop.swingx.designer.effects.InnerShadowEffect"
+             extends="org.jdesktop.swingx.designer.effects.ShadowEffect">
+        <structure map-as="org.jdesktop.swingx.designer.effects.ShadowEffect"/>
+    </mapping>
+    <mapping name="innerGlow" class="org.jdesktop.swingx.designer.effects.InnerGlowEffect"
+             extends="org.jdesktop.swingx.designer.effects.ShadowEffect">
+        <structure map-as="org.jdesktop.swingx.designer.effects.ShadowEffect"/>
+    </mapping>
+    <mapping name="outerGlow" class="org.jdesktop.swingx.designer.effects.OuterGlowEffect"
+             extends="org.jdesktop.swingx.designer.effects.ShadowEffect">
+        <structure map-as="org.jdesktop.swingx.designer.effects.ShadowEffect"/>
+    </mapping>
+    <!-- == TEMPLATE LAYER ================================================================================== -->
+    <mapping name="templateLayer" class="org.jdesktop.swingx.designer.TemplateLayer"
+             extends="org.jdesktop.swingx.designer.Layer" post-set="postInit">
+        <structure map-as="org.jdesktop.swingx.designer.Layer"/>
+        <value name="fileName" field="fileName" style="attribute"/>
+    </mapping>
+    <!-- == LAYER =========================================================================================== -->
+    <mapping name="layer" class="org.jdesktop.swingx.designer.Layer"
+             extends="org.jdesktop.swingx.designer.SimpleShape" post-set="postInit">
+        <structure map-as="org.jdesktop.swingx.designer.SimpleShape"/>
+        <value name="name" field="name" style="attribute"/>
+        <value name="type" field="type" style="attribute" default="standard"/>
+        <value name="opacity" field="opacity"/>
+        <value name="fillOpacity" field="fillOpacity"/>
+        <value name="blendingMode" field="blendingMode"/>
+        <value name="locked" field="locked"/>
+        <value name="visible" field="visible"/>
+        <structure name="shapes">
+            <collection field="shapes" create-type="java.util.ArrayList"/>
+        </structure>
+        <structure name="effects">
+            <collection field="effects" create-type="java.util.ArrayList"/>
+        </structure>
+    </mapping>
+    <!-- == CANVAS =========================================================================================== -->
+    <mapping name="canvas" class="org.jdesktop.swingx.designer.Canvas" pre-set="preSet" post-set="setupLayers">
+        <structure name="size" get-method="getSize" set-method="setSize"
+                   marshaller="org.jdesktop.swingx.designer.jibxhelpers.DimensionMapper"
+                   unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.DimensionMapper"/>
+        <value name="nextLayerNameIndex" field="nextLayerNameIndex"/>
+        <structure name="stretchingInsets" field="stretchingInsets"
+                   marshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"
+                   unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"/>
+        <collection field="layers" create-type="java.util.ArrayList"/>
+    </mapping>
+</binding>
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/DoubleBean.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/DoubleBean.java
new file mode 100644
index 0000000..7297b80
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/DoubleBean.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.beans.AbstractBean;
+
+/**
+ * DoubleBean - Simple bean for a observable double value
+ *
+ * @author Created by Jasper Potts (May 25, 2007)
+ */
+public class DoubleBean extends AbstractBean {
+    private double value = 0;
+
+    public DoubleBean() {}
+
+    public DoubleBean(double value) {
+        this.value = value;
+    }
+
+    public double getValue() {
+        return value;
+    }
+
+    public void setValue(double value) {
+        double old = this.value;
+        this.value = value;
+        firePropertyChange("value", old, this.value);
+    }
+
+
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        DoubleBean that = (DoubleBean) o;
+
+        if (Double.compare(that.value, value) != 0) return false;
+
+        return true;
+    }
+
+    public int hashCode() {
+        long temp = value != +0.0d ? Double.doubleToLongBits(value) : 0L;
+        return (int) (temp ^ (temp >>> 32));
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/EllipseShape.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/EllipseShape.java
new file mode 100644
index 0000000..e0d1237
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/EllipseShape.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * EllipseShape
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public class EllipseShape extends PaintedShape {
+
+    private DoubleBean x1 = new DoubleBean();
+    private DoubleBean x2 = new DoubleBean();
+    private DoubleBean y1 = new DoubleBean();
+    private DoubleBean y2 = new DoubleBean();
+    private ControlPoint tl = new ControlPoint(x1, y1);
+    private ControlPoint tr = new ControlPoint(x2, y1);
+    private ControlPoint bl = new ControlPoint(x1, y2);
+    private ControlPoint br = new ControlPoint(x2, y2);
+
+    // =================================================================================================================
+    // Constructors
+
+    /** private noargs constructor for JIBX */
+    private EllipseShape() {
+        this(null);
+    }
+
+    public EllipseShape(UIDefaults canvasUiDefaults) {
+        super(canvasUiDefaults);
+        PropertyChangeListener listener = new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("bounds", null, getBounds(0));
+            }
+        };
+        x1.addPropertyChangeListener(listener);
+        y1.addPropertyChangeListener(listener);
+        x2.addPropertyChangeListener(listener);
+        y2.addPropertyChangeListener(listener);
+    }
+
+    public EllipseShape(double x, double y, double w, double h) {
+        this();
+        x1.setValue(x);
+        y1.setValue(y);
+        x2.setValue(x + w);
+        y2.setValue(y + h);
+    }
+
+    public Rectangle2D getBounds(double pixelSize) {
+        double left = Math.min(x1.getValue(), x2.getValue());
+        double right = Math.max(x1.getValue(), x2.getValue());
+        double top = Math.min(y1.getValue(), y2.getValue());
+        double bottom = Math.max(y1.getValue(), y2.getValue());
+        return new Rectangle2D.Double(left, top, right - left, bottom - top);
+    }
+
+    public Ellipse2D getShape() {
+        double left = Math.min(x1.getValue(), x2.getValue());
+        double right = Math.max(x1.getValue(), x2.getValue());
+        double top = Math.min(y1.getValue(), y2.getValue());
+        double bottom = Math.max(y1.getValue(), y2.getValue());
+        return new Ellipse2D.Double(left, top, right - left, bottom - top);
+    }
+
+    public boolean isHit(Point2D p, double pixelSize) {
+        return getBounds(pixelSize).contains(p);
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+        g2.setPaint(getPaint());
+        g2.fill(getShape());
+    }
+
+    public void setFrame(double x1, double y1, double x2, double y2) {
+        this.x1.setValue(x1);
+        this.y1.setValue(y1);
+        this.x2.setValue(x2);
+        this.y2.setValue(y2);
+    }
+
+    @Override
+    public String toString() {
+        Rectangle2D bounds = getBounds(0);
+        return "ELLIPSE { x=" +  bounds.getX() + ", y=" + bounds.getY() + ", w=" + bounds.getWidth() + ", h=" + bounds.getHeight() + " }";
+    }
+
+    public List<ControlPoint> getControlPoints() {
+        List<ControlPoint> points = new ArrayList<ControlPoint>();
+        points.addAll(super.getControlPoints());
+        points.add(tl);
+        points.add(tr);
+        points.add(bl);
+        points.add(br);
+        return points;
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        if (paintControlLines) {
+            g2.setStroke(new BasicStroke((float) pixelSize));
+            g2.setColor(GraphicsHelper.CONTROL_LINE);
+            g2.draw(getShape());
+        }
+        tl.paintControls(g2, pixelSize, true);
+        tr.paintControls(g2, pixelSize, true);
+        bl.paintControls(g2, pixelSize, true);
+        br.paintControls(g2, pixelSize, true);
+//        super.paintControls(g2, pixelSize, paintControlLines);
+    }
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        if (snapPixels) {
+            x1.setValue(Math.round(x1.getValue() + moveX));
+            x2.setValue(Math.round(x2.getValue() + moveX));
+            y1.setValue(Math.round(y1.getValue() + moveY));
+            y2.setValue(Math.round(y2.getValue() + moveY));
+        } else {
+            x1.setValue(x1.getValue() + moveX);
+            x2.setValue(x2.getValue() + moveX);
+            y1.setValue(y1.getValue() + moveY);
+            y2.setValue(y2.getValue() + moveY);
+        }
+    }
+
+    public double getX1() {
+        return x1.getValue();
+    }
+
+    public void setX1(double x1) {
+        this.x1.setValue(x1);
+    }
+
+    public double getX2() {
+        return x2.getValue();
+    }
+
+    public void setX2(double x2) {
+        this.x2.setValue(x2);
+    }
+
+    public double getY1() {
+        return y1.getValue();
+    }
+
+    public void setY1(double y1) {
+        this.y1.setValue(y1);
+    }
+
+    public double getY2() {
+        return y2.getValue();
+    }
+
+    public void setY2(double y2) {
+        this.y2.setValue(y2);
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/GraphicsHelper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/GraphicsHelper.java
new file mode 100644
index 0000000..519c42e
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/GraphicsHelper.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import java.awt.Color;
+
+/**
+ * GraphicsHelper
+ *
+ * @author Created by Jasper Potts (May 29, 2007)
+ */
+public class GraphicsHelper {
+    public static final Color FILL_LINE = Color.BLUE;
+    public static final Color FILL_CP_LINE = Color.BLUE;
+    public static final Color FILL_CP_FILL = Color.WHITE;
+    public static final Color CONTROL_LINE = Color.RED;
+    public static final Color CONTROL_POINT_LINE = Color.RED;
+    public static final Color CONTROL_POINT_FILL = Color.WHITE;
+    public static final Color BEZIER_CONTROL_POINT_LINE = CONTROL_POINT_LINE;
+    public static final Color BEZIER_CONTROL_POINT_FILL = CONTROL_POINT_FILL;
+    public static final Color BEZIER_CONTROL_LINE = Color.DARK_GRAY;
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Layer.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Layer.java
new file mode 100644
index 0000000..3b112ae
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/Layer.java
@@ -0,0 +1,443 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.swingx.designer.effects.Effect;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Layer
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public class Layer extends SimpleShape implements Iterable<SimpleShape>, LayerContainer {
+    public static enum LayerType {
+        standard, template
+    }
+
+    private String name;
+    protected LayerType type = LayerType.standard;
+    /** List of shapes in this layer, first shape is painted on top */
+    private List<SimpleShape> shapes = new ArrayList<SimpleShape>();
+    private List<Effect> effects = new ArrayList<Effect>();
+    private double opacity = 1;
+    private double fillOpacity = 1;
+    private BlendingMode blendingMode = BlendingMode.NORMAL;
+    private boolean locked = false;
+    private boolean visible = true;
+    private PropertyChangeListener shapeChangeListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            int index = shapes.indexOf((SimpleShape) evt.getSource());
+            firePropertyChange("shapes[" + index + "]." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+    private PropertyChangeListener effectChangeListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            int index = effects.indexOf((Effect) evt.getSource());
+            System.out.println(
+                    "Layer.propertyChange EFFECT PROPERTY CHANGED " + evt.getSource() + " -- " + evt.getPropertyName());
+            firePropertyChange("effects[" + index + "]." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+    private BufferedImage buffer = null;
+    // =================================================================================================================
+    // Constructors
+
+    public Layer() {
+    }
+
+    public Layer(String name) {
+        this();
+        this.name = name;
+    }
+
+    /** Called by JIBX after populating this layer so we can add listeners to children */
+    protected void postInit() {
+        for (SimpleShape shape : shapes) {
+            shape.addPropertyChangeListener(shapeChangeListener);
+            shape.setParent(this);
+        }
+        for (Effect effect : effects) {
+            effect.addPropertyChangeListener(effectChangeListener);
+        }
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    public LayerType getType() {
+        return type;
+    }
+
+    public boolean isLocked() {
+        return locked;
+    }
+
+    public void setLocked(boolean locked) {
+        boolean old = isLocked();
+        this.locked = locked;
+        firePropertyChange("locked", old, isLocked());
+    }
+
+    public boolean isVisible() {
+        return visible;
+    }
+
+    public void setVisible(boolean visible) {
+        boolean old = isVisible();
+        this.visible = visible;
+        firePropertyChange("visible", old, isVisible());
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        String old = getName();
+        this.name = name;
+        firePropertyChange("name", old, getName());
+    }
+
+    public void setParent(LayerContainer parent) {
+        super.setParent(parent);
+        // generate a name if null
+        if (name == null) {
+            Canvas c = null;
+            LayerContainer p = parent;
+            while (true) {
+                if (p instanceof Canvas) {
+                    c = (Canvas) p;
+                    break;
+                } else if (p == null) {
+                    break;
+                }
+                p = p.getParent();
+            }
+            if (c != null) {
+                setName("Layer " + c.getNextLayerNameIndex());
+            }
+        }
+    }
+
+    /**
+     * Add shape to top of layer so it paints above all other shapes
+     *
+     * @param shape The shape to add
+     */
+    public void add(SimpleShape shape) {
+        shapes.add(0, shape);
+        shape.setParent(this);
+        shape.addPropertyChangeListener(shapeChangeListener);
+        fireIndexedPropertyChange("shapes", 0, null, shape);
+    }
+
+    public void remove(SimpleShape shape) {
+        int index = shapes.indexOf(shape);
+        if (index != -1) {
+            shapes.remove(shape);
+            shape.setParent(null);
+            fireIndexedPropertyChange("shapes", index, shape, null);
+        }
+    }
+
+    /**
+     * Returns an unmodifianle iterator over a set of elements of type SimpleShape.
+     *
+     * @return an Iterator.
+     */
+    public Iterator<SimpleShape> iterator() {
+        return Collections.unmodifiableList(shapes).iterator();
+    }
+
+
+    public List<Effect> getEffects() {
+        return Collections.unmodifiableList(effects);
+    }
+
+    public void addEffect(Effect effect) {
+        int index = effects.size();
+        effects.add(effect);
+        effect.addPropertyChangeListener(effectChangeListener);
+        fireIndexedPropertyChange("effects", index, null, effects);
+    }
+
+    public void removeEffect(Effect effect) {
+        int index = effects.indexOf(effect);
+        if (index != -1) {
+            effects.remove(effect);
+            effect.removePropertyChangeListener(effectChangeListener);
+            fireIndexedPropertyChange("effects", index, effect, null);
+        }
+    }
+
+    public double getOpacity() {
+        return opacity;
+    }
+
+    public void setOpacity(double opacity) {
+        if (opacity < 0 || opacity > 1) return;
+        double old = getOpacity();
+        this.opacity = opacity;
+        firePropertyChange("opacity", old, getOpacity());
+    }
+
+    public double getFillOpacity() {
+        return fillOpacity;
+    }
+
+    public void setFillOpacity(double fillOpacity) {
+        if (fillOpacity < 0 || fillOpacity > 1) return;
+        double old = getFillOpacity();
+        this.fillOpacity = fillOpacity;
+        firePropertyChange("fillOpacity", old, getFillOpacity());
+    }
+
+    public BlendingMode getBlendingMode() {
+        return blendingMode;
+    }
+
+    public void setBlendingMode(BlendingMode blendingMode) {
+        BlendingMode old = getBlendingMode();
+        this.blendingMode = blendingMode;
+        firePropertyChange("blendingMode", old, getBlendingMode());
+    }
+
+    // =================================================================================================================
+    // Layer Methods
+
+    /**
+     * Get the parent canvas that contains this layer
+     *
+     * @return Parant canvas, or null if the layer is not in a canvas
+     */
+    public Canvas getCanvas() {
+        LayerContainer lc = this;
+        while (lc != null) {
+            if (lc instanceof Canvas) return (Canvas) lc;
+            lc = lc.getParent();
+        }
+        return null;
+    }
+
+    public List<SimpleShape> getShapes() {
+        return new ArrayList<SimpleShape>(shapes);
+    }
+
+    public List<SimpleShape> getIntersectingShapes(Point2D p, double pixelSize) {
+        if (isLocked() || !isVisible()) return Collections.emptyList();
+        List<SimpleShape> intersectingShapes = new ArrayList<SimpleShape>();
+        for (SimpleShape shape : shapes) {
+            if (shape instanceof Layer) {
+                intersectingShapes.addAll(((Layer) shape).getIntersectingShapes(p, pixelSize));
+            } else {
+                if (shape.isHit(p, pixelSize)) intersectingShapes.add(shape);
+            }
+        }
+        return intersectingShapes;
+    }
+
+    public List<SimpleShape> getIntersectingShapes(Rectangle2D rect, double pixelSize) {
+        if (isLocked() || !isVisible()) return Collections.emptyList();
+        List<SimpleShape> intersectingShapes = new ArrayList<SimpleShape>();
+        for (SimpleShape shape : shapes) {
+            if (shape instanceof Layer) {
+                intersectingShapes.addAll(((Layer) shape).getIntersectingShapes(rect, pixelSize));
+            } else {
+                if (shape.intersects(rect, pixelSize)) intersectingShapes.add(shape);
+            }
+        }
+        return intersectingShapes;
+
+    }
+
+    public boolean isEmpty() {
+        return shapes.isEmpty();
+    }
+
+    // =================================================================================================================
+    // SimpleShape Methods
+
+    public Rectangle2D getBounds(double pixelSize) {
+        Rectangle2D.Double rect = new Rectangle2D.Double();
+        for (SimpleShape shape : shapes) {
+            rect.add(shape.getBounds(pixelSize));
+        }
+        return rect;
+    }
+
+
+    public Shape getShape() {
+        return getBounds(0);
+    }
+
+    public boolean isHit(Point2D p, double pixelSize) {
+        if (isLocked() || !isVisible()) return false;
+        for (SimpleShape shape : shapes) {
+            if (shape.isHit(p, pixelSize)) return true;
+        }
+        return false;
+    }
+
+    public boolean intersects(Rectangle2D rect, double pixelSize) {
+        if (isLocked() || !isVisible()) return false;
+        for (SimpleShape shape : shapes) {
+            if (shape.intersects(rect, pixelSize)) return true;
+        }
+        return false;
+    }
+
+    public List<ControlPoint> getControlPoints() {
+        return Collections.emptyList();
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+
+    }
+
+    public String toString() {
+        return getName();
+    }
+
+    // =================================================================================================================
+    // LayerContainer Methods
+
+    public void addLayer(int i, Layer layer) {
+        // get existing layer at index i
+        Layer existingLayer = getLayer(i);
+        if (existingLayer == null) {
+            addLayer(layer);
+        } else {
+            int index = indexOfLayer(existingLayer);
+            shapes.add(index, layer);
+            layer.setParent(this);
+            layer.addPropertyChangeListener(shapeChangeListener);
+            fireIndexedPropertyChange("layers", index, null, layer);
+        }
+    }
+
+    public void addLayer(Layer layer) {
+        shapes.add(layer);
+        layer.setParent(this);
+        layer.addPropertyChangeListener(shapeChangeListener);
+        int index = indexOfLayer(layer);
+        fireIndexedPropertyChange("layers", index, null, layer);
+    }
+
+    public Layer getLayer(int index) {
+        int i = -1;
+        for (SimpleShape shape : shapes) {
+            if (shape instanceof Layer) i++;
+            if (i == index) return (Layer) shape;
+        }
+        return null;
+    }
+
+    public int getLayerCount() {
+        int count = 0;
+        for (SimpleShape shape : shapes) {
+            if (shape instanceof Layer) count++;
+        }
+        return count;
+    }
+
+
+    public Collection<Layer> getLayers() {
+        List<Layer> layers = new ArrayList<Layer>();
+        for (SimpleShape shape : shapes) {
+            if (shape instanceof Layer) layers.add((Layer) shape);
+        }
+        return Collections.unmodifiableList(layers);
+    }
+
+    public Iterator<Layer> getLayerIterator() {
+        return new Iterator<Layer>() {
+            private int index = 0;
+
+            public boolean hasNext() {
+                for (int i = index; i < shapes.size(); i++) {
+                    if (shapes.get(i) instanceof Layer) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+
+            public Layer next() {
+                for (; index < shapes.size(); index++) {
+                    if (shapes.get(index) instanceof Layer) {
+                        Layer nextLayer = (Layer) shapes.get(index);
+                        index++; // increment index so we don't find the same one again
+                        return nextLayer;
+                    }
+                }
+                return null;
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+        };
+    }
+
+    public int indexOfLayer(Layer layer) {
+        int i = -1;
+        for (SimpleShape s : shapes) {
+            if (s instanceof Layer) i++;
+            if (s == layer) return i;
+        }
+        return -1;
+    }
+
+    public void removeLayer(Layer layer) {
+        int index = indexOfLayer(layer);
+        if (index != -1) {
+            shapes.remove(layer);
+            layer.removePropertyChangeListener(shapeChangeListener);
+            fireIndexedPropertyChange("layers", index, layer, null);
+        }
+    }
+
+
+    public Dimension getRootSize() {
+        return getParent().getRootSize();
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/LayerContainer.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/LayerContainer.java
new file mode 100644
index 0000000..b5af519
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/LayerContainer.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import java.awt.Dimension;
+import java.beans.PropertyChangeListener;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * LayerContainer
+ *
+ * @author Created by Jasper Potts (May 31, 2007)
+ */
+public interface LayerContainer {
+    public void addPropertyChangeListener(PropertyChangeListener listener);
+
+    public void removePropertyChangeListener(PropertyChangeListener listener);
+
+    public LayerContainer getParent();
+
+    public void addLayer(Layer layer);
+
+    public void addLayer(int i, Layer layer);
+
+    public void removeLayer(Layer layer);
+
+    public int getLayerCount();
+
+    public Layer getLayer(int index);
+
+    public int indexOfLayer(Layer layer);
+
+    public Iterator<Layer> getLayerIterator();
+
+    public Collection<Layer> getLayers();
+
+    /**
+     * Get the size in pixels of the root of the layer tree, this is usualy a canvas
+     *
+     * @return The size of the whole layer tree
+     */
+    public Dimension getRootSize();
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PaintedShape.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PaintedShape.java
new file mode 100644
index 0000000..2d6d3cb
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PaintedShape.java
@@ -0,0 +1,289 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+import org.jdesktop.swingx.designer.paint.PaintModel;
+
+import javax.swing.UIDefaults;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.LinearGradientPaint;
+import java.awt.Paint;
+import java.awt.RadialGradientPaint;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Line2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * PaintedShape
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public abstract class PaintedShape extends SimpleShape {
+
+    private PaintModel paint;
+    // control points for paint control types
+    private DoubleBean px1 = new DoubleBean(0.25);
+    private DoubleBean px2 = new DoubleBean(0.75);
+    private DoubleBean py1 = new DoubleBean(0);
+    private DoubleBean py2 = new DoubleBean(1);
+    private ControlPoint ptl = new PaintControlPoint(px1, py1);
+    private ControlPoint ptr = new PaintControlPoint(px2, py1);
+    private ControlPoint pbl = new PaintControlPoint(px1, py2);
+    private ControlPoint pbr = new PaintControlPoint(px2, py2);
+    private PropertyChangeListener paintListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            firePropertyChange("paint." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+
+    protected PaintedShape() {
+        px1.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("x1", evt.getOldValue(), evt.getNewValue());
+            }
+        });
+        py1.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("y1", evt.getOldValue(), evt.getNewValue());
+            }
+        });
+        px2.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("x2", evt.getOldValue(), evt.getNewValue());
+            }
+        });
+        py2.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("y2", evt.getOldValue(), evt.getNewValue());
+            }
+        });
+    }
+
+    protected PaintedShape(UIDefaults canvasUiDefaults) {
+        this();
+        setPaintModel(new Matte(Color.ORANGE, canvasUiDefaults));
+    }
+
+    public PaintModel getPaintModel() {
+        return paint;
+    }
+
+    public void setPaintModel(PaintModel paint) {
+        PaintModel old = getPaintModel();
+        if (old != null) old.removePropertyChangeListener(paintListener);
+        this.paint = paint;
+        this.paint.addPropertyChangeListener(paintListener);
+        firePropertyChange("paintModel", old, getPaintModel());
+    }
+
+    public Paint getPaint() {
+        Paint p = getPaintModel().getPaint();
+        if (p instanceof Color) {
+            return p;
+        }
+        //resize p as necessary to fit the bounds of this PaintedShape
+        Rectangle2D bounds = getBounds(0);
+        if (p instanceof LinearGradientPaint) {
+            LinearGradientPaint lgp = (LinearGradientPaint) p;
+            return new LinearGradientPaint(
+                    convertLocalPoint(ptl.getPosition(), bounds),
+                    convertLocalPoint(pbr.getPosition(), bounds),
+                    lgp.getFractions(),
+                    lgp.getColors());
+        } else if (p instanceof RadialGradientPaint) {
+            RadialGradientPaint rgp = (RadialGradientPaint) p;
+            Point2D outer = convertLocalPoint(ptl.getPosition(), bounds);
+            Point2D center = convertLocalPoint(pbr.getPosition(), bounds);
+            double deltaX = Math.abs(center.getX() - outer.getX());
+            double deltaY = Math.abs(center.getY() - outer.getY());
+            float radius = (float) Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
+            return new RadialGradientPaint(
+                    center,
+                    radius,
+                    rgp.getFractions(),
+                    rgp.getColors());
+        } else {
+            return p;
+        }
+    }
+
+    public List<? extends ControlPoint> getControlPoints() {
+        switch (paint.getPaintControlType()) {
+            case control_line:
+                return Arrays.asList(ptl, pbr);
+            case control_rect:
+                return Arrays.asList(ptl, ptr, pbl, pbr);
+            default:
+                return Collections.emptyList();
+        }
+    }
+
+    public void paintFillControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        switch (paint.getPaintControlType()) {
+            case control_line:
+                Point2D p1 = convertLocalPoint(ptl.getPosition(), PaintedShape.this.getBounds(0));
+                Point2D p2 = convertLocalPoint(pbr.getPosition(), PaintedShape.this.getBounds(0));
+                g2.setStroke(new BasicStroke((float) pixelSize));
+                g2.setColor(GraphicsHelper.FILL_LINE);
+                g2.draw(new Line2D.Double(p1.getX(), p1.getY(), p2.getX(), p2.getY()));
+                ptl.paintControls(g2, pixelSize, true);
+                pbr.paintControls(g2, pixelSize, true);
+                break;
+            case control_rect:
+                g2.setStroke(new BasicStroke((float) pixelSize));
+                g2.setColor(GraphicsHelper.FILL_LINE);
+                g2.draw(new Rectangle2D.Double(
+                        px1.getValue(),
+                        py1.getValue(),
+                        px2.getValue() - px1.getValue(),
+                        py2.getValue() - py1.getValue()));
+                ptl.paintControls(g2, pixelSize, true);
+                ptr.paintControls(g2, pixelSize, true);
+                pbl.paintControls(g2, pixelSize, true);
+                pbr.paintControls(g2, pixelSize, true);
+                break;
+        }
+    }
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        for (ControlPoint controlPoint : getControlPoints()) {
+            if (!(controlPoint instanceof PaintControlPoint)) controlPoint.move(moveX, moveY, snapPixels);
+        }
+    }
+
+    public double getPaintX1() {
+        return px1.getValue();
+    }
+
+    public void setPaintX1(double x1) {
+        this.px1.setValue(x1);
+    }
+
+    public double getPaintX2() {
+        return px2.getValue();
+    }
+
+    public void setPaintX2(double x2) {
+        this.px2.setValue(x2);
+    }
+
+    public double getPaintY1() {
+        return py1.getValue();
+    }
+
+    public void setPaintY1(double y1) {
+        this.py1.setValue(y1);
+    }
+
+    public double getPaintY2() {
+        return py2.getValue();
+    }
+
+    public void setPaintY2(double y2) {
+        this.py2.setValue(y2);
+    }
+
+    // =================================================================================================================
+    // Private helper methods
+
+    private Point2D convertLocalPoint(Point2D point, Rectangle2D bounds) {
+        point.setLocation(
+                bounds.getX() + (point.getX() * bounds.getWidth()),
+                bounds.getY() + (point.getY() * bounds.getHeight())
+        );
+        return point;
+    }
+
+    private Point2D convertScreenPoint(Point2D point, Rectangle2D bounds) {
+        return new Point2D.Double(
+                (point.getX() - bounds.getX()) / bounds.getWidth(),
+                (point.getY() - bounds.getY()) / bounds.getHeight()
+        );
+    }
+
+    // =================================================================================================================
+    // Gradient ControlPoint
+
+    /**
+     * A Special ControlPoint thats internal values are in coordinates relative to the shapes bounds. With 0,0 being the
+     * top left of the shape and 1.0X == shape width and 1.0Y == shapes height.
+     */
+    public class PaintControlPoint extends ControlPoint {
+        public PaintControlPoint() {
+            super(GraphicsHelper.FILL_CP_FILL, GraphicsHelper.FILL_CP_LINE);
+        }
+
+        public PaintControlPoint(DoubleBean x, DoubleBean y) {
+            super(x, y, GraphicsHelper.FILL_CP_FILL, GraphicsHelper.FILL_CP_LINE);
+        }
+
+        public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+            Point2D p = convertLocalPoint(getPosition(), PaintedShape.this.getBounds(0));
+            g2.setStroke(new BasicStroke((float) pixelSize));
+            double size = pixelSize * 4d;
+            Shape s = new Ellipse2D.Double(p.getX() - size, p.getY() - size,
+                    size * 2, size * 2);
+            g2.setPaint(new GradientPaint(
+                    (float) p.getX(), (float) (p.getY() - size), Color.CYAN,
+                    (float) p.getX(), (float) (p.getY() + size), Color.WHITE
+            ));
+            g2.fill(s);
+            g2.setColor(GraphicsHelper.FILL_CP_LINE);
+            g2.draw(s);
+        }
+
+        public void move(double moveX, double moveY, boolean snapPixels) {
+            Rectangle2D bounds = PaintedShape.this.getBounds(0);
+            moveX = moveX / bounds.getWidth();
+            moveY = moveY / bounds.getHeight();
+            if (snapPixels) {
+                // snap to neareast 0.5
+                double newX = Math.round((x.getValue() + moveX) * 2d) / 2d;
+                double newY = Math.round((y.getValue() + moveY) * 2d) / 2d;
+                setPosition(newX, newY);
+            } else {
+                setPosition(x.getValue() + moveX, y.getValue() + moveY);
+            }
+        }
+
+        public Rectangle2D getBounds(double pixelSize) {
+            Point2D p = convertLocalPoint(getPosition(), PaintedShape.this.getBounds(0));
+            double size = pixelSize * 4d;
+            return new Rectangle2D.Double(p.getX() - size, p.getY() - size,
+                    size * 2, size * 2);
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PathShape.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PathShape.java
new file mode 100644
index 0000000..9699726
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/PathShape.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * PathShape
+ *
+ * @author Created by Jasper Potts (May 29, 2007)
+ */
+public class PathShape extends PaintedShape {
+
+    private Shape cachedShape = null;
+    private List<BezierControlPoint> controlPoints = new ArrayList<BezierControlPoint>();
+    private PropertyChangeListener cpListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            rebuildShape();
+        }
+    };
+
+    // =================================================================================================================
+    // Constructors
+
+    /** private noargs constructor for JIBX */
+    private PathShape() {
+        this(null);
+    }
+
+    public PathShape(UIDefaults canvasUiDefaults) {
+        super(canvasUiDefaults);
+    }
+
+    public BezierControlPoint addPoint(double x, double y) {
+        BezierControlPoint cp = new BezierControlPoint(x, y);
+        controlPoints.add(cp);
+        cp.addPropertyChangeListener(cpListener);
+        // update shape
+        rebuildShape();
+        // return new control point
+        return cp;
+    }
+
+    public Shape getShape() {
+        if (cachedShape == null) {
+            rebuildShape();
+        }
+        return cachedShape;
+    }
+
+    private void rebuildShape() {
+        GeneralPath path = new GeneralPath();
+        BezierControlPoint first, last;
+        first = last = controlPoints.get(0);
+        path.moveTo((float) first.getX(), (float) first.getY());
+        for (int i = 0; i < controlPoints.size(); i++) {
+            BezierControlPoint controlPoint = controlPoints.get(i);
+            if (last.getCp2().isSharp() && controlPoint.getCp1().isSharp()) {
+                path.lineTo(controlPoint.getX(), controlPoint.getY());
+            } else {
+                path.curveTo(
+                        (float) last.getCp2().getX(), (float) last.getCp2().getY(),
+                        (float) controlPoint.getCp1().getX(), (float) controlPoint.getCp1().getY(),
+                        (float) controlPoint.getX(), (float) controlPoint.getY()
+                );
+            }
+            last = controlPoint;
+        }
+        // close path
+        if (last.getCp2().isSharp() && first.getCp1().isSharp()) {
+            path.lineTo(first.getX(), first.getY());
+        } else {
+            path.curveTo(
+                    (float) last.getCp2().getX(), (float) last.getCp2().getY(),
+                    (float) first.getCp1().getX(), (float) first.getCp1().getY(),
+                    (float) first.getX(), (float) first.getY()
+            );
+        }
+        path.closePath();
+        // fire change
+        cachedShape = path;
+        firePropertyChange("shape", null, cachedShape);
+    }
+
+    @Override
+    public String toString() {
+        String p = "PATH {\n";
+        BezierControlPoint first, last;
+        first = last = controlPoints.get(0);
+        p += "   path.moveTo(" + first.getX() + "," + first.getY() + ");";
+        for (int i = 0; i < controlPoints.size(); i++) {
+            BezierControlPoint controlPoint = controlPoints.get(i);
+            p += "   path.curveTo(" +
+                    (float) last.getCp2().getX() + "," + (float) last.getCp2().getY() + "," +
+                    (float) controlPoint.getCp1().getX() + "," + (float) controlPoint.getCp1().getY() + "," +
+                    (float) controlPoint.getX() + "," + (float) controlPoint.getY() +
+                    ");\n";
+            last = controlPoint;
+        }
+        // close path
+        p += "   path.curveTo(" +
+                (float) last.getCp2().getX() + "," + (float) last.getCp2().getY() + "," +
+                (float) first.getCp1().getX() + "," + (float) first.getCp1().getY() + "," +
+                (float) first.getX() + "," + (float) first.getY() +
+                ");\n";
+        p += "}\n";
+        return p;
+    }
+
+    // =================================================================================================================
+    // Shape Methods
+
+    public Rectangle2D getBounds(double pixelSize) {
+        return getShape().getBounds2D();
+    }
+
+    public List<? extends ControlPoint> getControlPoints() {
+        List<ControlPoint> pts = new ArrayList<ControlPoint>();
+        for (BezierControlPoint controlPoint : controlPoints) {
+            pts.add(controlPoint);
+        }
+        for (ControlPoint controlPoint : super.getControlPoints()) {
+            pts.add(controlPoint);
+        }
+        return pts;
+    }
+
+    public void setControlPoints(List<BezierControlPoint> controlPoints) {
+        List<BezierControlPoint> old = this.controlPoints;
+        for (BezierControlPoint cp : old) {
+            cp.removePropertyChangeListener(cpListener);
+        }
+        this.controlPoints = controlPoints;
+        for (BezierControlPoint cp : this.controlPoints) {
+            cp.addPropertyChangeListener(cpListener);
+        }
+        // update shape
+        rebuildShape();
+    }
+
+    public boolean isHit(Point2D p, double pixelSize) {
+        return getShape().contains(p);
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+        g2.setPaint(getPaint());
+        g2.fill(getShape());
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        if (paintControlLines) {
+            g2.setStroke(new BasicStroke((float) pixelSize));
+            g2.setColor(GraphicsHelper.CONTROL_LINE);
+            g2.draw(getShape());
+        }
+        for (BezierControlPoint controlPoint : controlPoints) {
+            if (!controlPoint.isSharpCorner()) controlPoint.paintControls(g2, pixelSize, true);
+        }
+    }
+
+    public List<BezierControlPoint> getBezierControlPoints() {
+        return controlPoints;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/RectangleShape.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/RectangleShape.java
new file mode 100644
index 0000000..d93ef3f
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/RectangleShape.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * RectangleShape
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public class RectangleShape extends PaintedShape {
+
+    private DoubleBean x1 = new DoubleBean();
+    private DoubleBean x2 = new DoubleBean();
+    private DoubleBean y1 = new DoubleBean();
+    private DoubleBean y2 = new DoubleBean();
+    private ControlPoint tl = new ControlPoint(x1, y1);
+    private ControlPoint tr = new ControlPoint(x2, y1);
+    private ControlPoint bl = new ControlPoint(x1, y2);
+    private ControlPoint br = new ControlPoint(x2, y2);
+    private DoubleBean roundingX = new DoubleBean() {
+        public void setValue(double value) {
+            // contrain y = y1 and x is between x1+1 and (x2-x1)/2
+            boolean x1isLess = x1.getValue() < x2.getValue();
+            double min = x1isLess ? x1.getValue() + 1 : x1.getValue() - 1;
+            double max = x1isLess ? x1.getValue() + ((x2.getValue() - x1.getValue()) / 2) :
+                    x2.getValue() + ((x1.getValue() - x2.getValue()) / 2);
+            double newX = value;
+            if (newX < min) newX = min;
+            if (newX > max) newX = max;
+            super.setValue(newX);
+        }
+    };
+    private ControlPoint rounding = new ControlPoint(roundingX, y1) {
+        public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+            double size = pixelSize * 3d;
+            Shape s = new Ellipse2D.Double(getX() - size, getY() - size,
+                    size * 2, size * 2);
+            g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_FILL);
+            g2.fill(s);
+            g2.setColor(GraphicsHelper.BEZIER_CONTROL_POINT_LINE);
+            g2.draw(s);
+        }
+
+        public void setPosition(Point2D position) {
+            // only alow X to change
+            x.setValue(position.getX());
+        }
+
+    };
+
+    // =================================================================================================================
+    // Constructors
+
+    /** private noargs constructor for JIBX */
+    private RectangleShape() {
+        this(null);
+    }
+
+    public RectangleShape(UIDefaults canvasUiDefaults) {
+        super(canvasUiDefaults);
+        x1.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                // keep rounding point in sync
+                roundingX.setValue(roundingX.getValue() +
+                        ((Double) evt.getNewValue() - (Double) evt.getOldValue()));
+                firePropertyChange("bounds", null, getBounds(0));
+            }
+        });
+        x2.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                // keep rounding point in sync
+                double distanceFromX1 = Math.abs(roundingX.getValue() - x1.getValue());
+                roundingX.setValue(
+                        (x1.getValue() < x2.getValue()) ? x1.getValue() + distanceFromX1 :
+                                x1.getValue() - distanceFromX1
+                );
+                firePropertyChange("bounds", null, getBounds(0));
+            }
+        });
+        PropertyChangeListener listener = new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("bounds", null, getBounds(0));
+            }
+        };
+        y1.addPropertyChangeListener(listener);
+        y2.addPropertyChangeListener(listener);
+        rounding.addPropertyChangeListener(listener);
+    }
+
+    public RectangleShape(double x, double y, double w, double h) {
+        this();
+        x1.setValue(x);
+        y1.setValue(y);
+        x2.setValue(x + w);
+        y2.setValue(y + h);
+    }
+
+    public Shape getShape() {
+        double rounding = getRounding();
+        double left = Math.min(x1.getValue(), x2.getValue());
+        double right = Math.max(x1.getValue(), x2.getValue());
+        double top = Math.min(y1.getValue(), y2.getValue());
+        double bottom = Math.max(y1.getValue(), y2.getValue());
+        if (rounding > 0) {
+            return new RoundRectangle2D.Double(
+                    left, top, right - left, bottom - top, rounding, rounding
+            );
+        } else {
+            return new Rectangle2D.Double(left, top, right - left, bottom - top);
+        }
+    }
+
+    public double getRounding() {
+        double rounding = Math.abs(roundingX.getValue() - x1.getValue()) * 2;
+        return rounding > 2 ? rounding : 0;
+    }
+
+    public void setRounding(double rounding) {
+        if (rounding > 0 && rounding < 2) rounding = 0;
+        roundingX.setValue((rounding / 2d) + x1.getValue());
+    }
+
+    public boolean isRounded() {
+        return getRounding() > 0;
+    }
+
+    public double getX1() {
+        return x1.getValue();
+    }
+
+    public void setX1(double x1) {
+        this.x1.setValue(x1);
+    }
+
+    public double getX2() {
+        return x2.getValue();
+    }
+
+    public void setX2(double x2) {
+        this.x2.setValue(x2);
+    }
+
+    public double getY1() {
+        return y1.getValue();
+    }
+
+    public void setY1(double y1) {
+        this.y1.setValue(y1);
+    }
+
+    public double getY2() {
+        return y2.getValue();
+    }
+
+    public void setY2(double y2) {
+        this.y2.setValue(y2);
+    }
+
+    // =================================================================================================================
+    // SimpleShape Methods
+
+    public Rectangle2D getBounds(double pixelSize) {
+        double left = Math.min(x1.getValue(), x2.getValue());
+        double right = Math.max(x1.getValue(), x2.getValue());
+        double top = Math.min(y1.getValue(), y2.getValue());
+        double bottom = Math.max(y1.getValue(), y2.getValue());
+        return new Rectangle2D.Double(left, top, right - left, bottom - top);
+    }
+
+    public boolean isHit(Point2D p, double pixelSize) {
+        return getShape().contains(p);
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+        g2.setPaint(getPaint());
+        g2.fill(getShape());
+    }
+
+    public void setFrame(double x1, double y1, double x2, double y2) {
+        this.x1.setValue(x1);
+        this.y1.setValue(y1);
+        this.x2.setValue(x2);
+        this.y2.setValue(y2);
+    }
+
+    @Override
+    public String toString() {
+        Rectangle2D bounds = getBounds(0);
+        if (isRounded()) {
+            return "ROUND RECT { x=" +  bounds.getX() + ", y=" + bounds.getY() + ", w=" + bounds.getWidth() + ", h=" + bounds.getHeight() + ", rounding=" + getRounding() + " }";
+        } else {
+            return "ROUND RECT { x=" +  bounds.getX() + ", y=" + bounds.getY() + ", w=" + bounds.getWidth() + ", h=" + bounds.getHeight() + " }";
+        }
+    }
+
+    public List<ControlPoint> getControlPoints() {
+        List<ControlPoint> points = new ArrayList<ControlPoint>();
+        points.addAll(super.getControlPoints());
+        points.add(tl);
+        points.add(tr);
+        points.add(bl);
+        points.add(br);
+        points.add(rounding);
+        return points;
+    }
+
+    public void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines) {
+        if (paintControlLines) {
+            g2.setStroke(new BasicStroke((float) pixelSize));
+            g2.setColor(GraphicsHelper.CONTROL_LINE);
+            g2.draw(getShape());
+        }
+        tl.paintControls(g2, pixelSize, true);
+        tr.paintControls(g2, pixelSize, true);
+        bl.paintControls(g2, pixelSize, true);
+        br.paintControls(g2, pixelSize, true);
+        rounding.paintControls(g2, pixelSize, true);
+    }
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        if (snapPixels) {
+            x1.setValue(Math.round(x1.getValue() + moveX));
+            x2.setValue(Math.round(x2.getValue() + moveX));
+            y1.setValue(Math.round(y1.getValue() + moveY));
+            y2.setValue(Math.round(y2.getValue() + moveY));
+        } else {
+            x1.setValue(x1.getValue() + moveX);
+            x2.setValue(x2.getValue() + moveX);
+            y1.setValue(y1.getValue() + moveY);
+            y2.setValue(y2.getValue() + moveY);
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/SimpleShape.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/SimpleShape.java
new file mode 100644
index 0000000..c001c0f
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/SimpleShape.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.beans.AbstractBean;
+
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+/**
+ * SimpleShape
+ *
+ * @author Created by Jasper Potts (May 22, 2007)
+ */
+public abstract class SimpleShape extends AbstractBean {
+
+    protected AffineTransform transform = new AffineTransform();
+    protected LayerContainer parent = null;
+
+    public void applyTransform(AffineTransform t) {
+        transform.concatenate(t);
+    }
+
+    public abstract Rectangle2D getBounds(double pixelSize);
+
+    public abstract void paint(Graphics2D g2, double pixelSize);
+
+    public abstract boolean isHit(Point2D p, double pixelSize);
+
+    public boolean intersects(Rectangle2D rect, double pixelSize) {
+        return getBounds(pixelSize).intersects(rect);
+    }
+
+    public abstract List<? extends ControlPoint> getControlPoints();
+
+    public abstract void paintControls(Graphics2D g2, double pixelSize, boolean paintControlLines);
+
+    public void move(double moveX, double moveY, boolean snapPixels) {
+        for (ControlPoint controlPoint : getControlPoints()) {
+            controlPoint.move(moveX, moveY, snapPixels);
+        }
+    }
+
+    public LayerContainer getParent() {
+        return parent;
+    }
+
+    public void setParent(LayerContainer parent) {
+        LayerContainer old = getParent();
+        this.parent = parent;
+        firePropertyChange("parent", old, getParent());
+    }
+
+    public abstract Shape getShape();
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/TemplateLayer.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/TemplateLayer.java
new file mode 100644
index 0000000..d0e51c2
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/TemplateLayer.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer;
+
+import org.jdesktop.swingx.designer.effects.Effect;
+
+import javax.imageio.ImageIO;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.lang.ref.SoftReference;
+
+/**
+ * TemplateLayer
+ *
+ * @author Created by Jasper Potts (Jul 2, 2007)
+ */
+public class TemplateLayer extends Layer {
+
+    private String fileName;
+    private transient SoftReference<BufferedImage> imgRef = null;
+
+    public TemplateLayer() {
+        type = LayerType.template;
+    }
+
+    public TemplateLayer(String fileName, BufferedImage templateImage) {
+        super("Template");
+        this.fileName = fileName;
+        type = LayerType.template;
+        if (templateImage != null) {
+            imgRef = new SoftReference<BufferedImage>(templateImage);
+        }
+    }
+
+    // =================================================================================================================
+    // Methods
+
+    public String getName() {
+        return super.getName();
+    }
+
+    /**
+     * template layers are always locked
+     *
+     * @return <code>true</code>
+     */
+    public boolean isLocked() {
+        return true;
+    }
+
+    public void add(SimpleShape shape) {
+        throw new IllegalStateException("Template layers can't contain shapes");
+    }
+
+    public void addEffect(Effect effect) {
+        throw new IllegalStateException("Template layers can't contain effects");
+    }
+
+    public void addLayer(int i, Layer layer) {
+        throw new IllegalStateException("Template layers can't contain sub layers");
+    }
+
+    public void addLayer(Layer layer) {
+        throw new IllegalStateException("Template layers can't contain sub layers");
+    }
+
+    public void paint(Graphics2D g2, double pixelSize) {
+        if (isVisible()) {
+            BufferedImage img = getTemplateImage();
+            if (img != null) g2.drawImage(img, 0, 0, null);
+        }
+    }
+
+
+    public Image getBuffer(GraphicsConfiguration graphicsConfiguration) {
+        return getTemplateImage();
+    }
+
+    public BufferedImage getTemplateImage() {
+        BufferedImage img = null;
+        if (imgRef == null || (img = imgRef.get()) == null) {
+
+            // can not access canvas
+            final File templateImgFile = new File(getCanvas().getTemplatesDir(), fileName);
+            System.out.println("templateImgFile = " + templateImgFile.getAbsolutePath());
+            System.out.println("templateImgFile.exists = " + templateImgFile.exists());
+            try {
+                img = ImageIO.read(templateImgFile);
+                imgRef = new SoftReference<BufferedImage>(img);
+            } catch (IOException e) {
+                e.printStackTrace();
+                // create error image
+                img = new BufferedImage(getCanvas().getSize().width, getCanvas().getSize().height,
+                        BufferedImage.TYPE_INT_RGB);
+                Graphics2D g2 = img.createGraphics();
+                g2.setColor(Color.RED);
+                g2.fillRect(0, 0, img.getWidth(), img.getHeight());
+                g2.setColor(Color.WHITE);
+                g2.setFont(g2.getFont().deriveFont(8f));
+                FontMetrics fontMetrics = g2.getFontMetrics();
+                Rectangle2D stringBounds = fontMetrics.getStringBounds("Missing Image", g2);
+                int offsetX = (int) ((img.getWidth() - stringBounds.getWidth()) / 2d);
+                int offsetY = (int) (((img.getHeight() - stringBounds.getHeight()) / 2d) - stringBounds.getY());
+                g2.drawString("Missing Image", offsetX, offsetY);
+                g2.dispose();
+                imgRef = new SoftReference<BufferedImage>(img);
+            }
+        }
+        return img;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/DropShadowEffect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/DropShadowEffect.java
new file mode 100644
index 0000000..ae95ea5
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/DropShadowEffect.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Arrays;
+
+/**
+ * DropShadowEffect
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public class DropShadowEffect extends ShadowEffect {
+
+    protected DropShadowEffect() {}
+
+    ;
+
+    public DropShadowEffect(UIDefaults uiDefaults) {
+        color = new Matte(Color.BLACK, uiDefaults);
+    }
+
+    // =================================================================================================================
+    // Effect Methods
+
+    /**
+     * Get the display name for this effect
+     *
+     * @return The user displayable name
+     */
+    public String getDisplayName() {
+        return "Drop Shadow";
+    }
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    public EffectType getEffectType() {
+        return EffectType.UNDER;
+    }
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The dstination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return The result of appl
+     */
+    public BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h) {
+        // calculate offset
+        double trangleAngle = Math.toRadians(angle - 90);
+        int offsetX = (int) (Math.sin(trangleAngle) * distance);
+        int offsetY = (int) (Math.cos(trangleAngle) * distance);
+        // clac expanded size
+        int tmpOffX = offsetX + size;
+        int tmpOffY = offsetY + size;
+        int tmpW = w + offsetX + size + size;
+        int tmpH = h + offsetY + size + size;
+        // create tmp buffers
+        int[] lineBuf = getTmpIntArray(w);
+        byte[] tmpBuf1 = getTmpByteArray1(tmpW * tmpH);
+        Arrays.fill(tmpBuf1, (byte) 0x00);
+        byte[] tmpBuf2 = getTmpByteArray2(tmpW * tmpH);
+        // extract src image alpha channel and inverse and offset
+        Raster srcRaster = src.getRaster();
+        for (int y = 0; y < h; y++) {
+            int dy = (y + tmpOffY);
+            int offset = dy * tmpW;
+            srcRaster.getDataElements(0, y, w, 1, lineBuf);
+            for (int x = 0; x < w; x++) {
+                int dx = x + tmpOffX;
+                tmpBuf1[offset + dx] = (byte) ((lineBuf[x] & 0xFF000000) >>> 24);
+            }
+        }
+        // blur
+        float[] kernel = EffectUtils.createGaussianKernel(size);
+        EffectUtils.blur(tmpBuf1, tmpBuf2, tmpW, tmpH, kernel, size); // horizontal pass
+        EffectUtils.blur(tmpBuf2, tmpBuf1, tmpH, tmpW, kernel, size);// vertical pass
+        //rescale
+        float spread = Math.min(1 / (1 - (0.01f * this.spread)), 255);
+        for (int i = 0; i < tmpBuf1.length; i++) {
+            int val = (int) (((int) tmpBuf1[i] & 0xFF) * spread);
+            tmpBuf1[i] = (val > 255) ? (byte) 0xFF : (byte) val;
+        }
+        // create color image with shadow color and greyscale image as alpha
+        if (dst == null) dst = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        WritableRaster shadowRaster = dst.getRaster();
+        int red = color.getRed(), green = color.getGreen(), blue = color.getBlue();
+        for (int y = 0; y < h; y++) {
+            int srcY = y + tmpOffY;
+            int shadowOffset = (srcY - offsetY) * tmpW;
+            for (int x = 0; x < w; x++) {
+                int srcX = x + tmpOffX;
+                lineBuf[x] = tmpBuf1[shadowOffset + (srcX - offsetX)] << 24 | red << 16 | green << 8 | blue;
+            }
+            shadowRaster.setDataElements(0, y, w, 1, lineBuf);
+        }
+        return dst;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/Effect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/Effect.java
new file mode 100644
index 0000000..7b8b697
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/Effect.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.BlendingMode;
+
+import java.awt.image.BufferedImage;
+import java.lang.ref.SoftReference;
+
+/**
+ * Effect
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public abstract class Effect extends AbstractBean {
+    protected boolean visible = true;
+
+    public enum EffectType {
+        UNDER, BLENDED, OVER
+    }
+
+    public boolean isVisible() {
+        return visible;
+    }
+
+    public void setVisible(boolean visible) {
+        boolean old = isVisible();
+        this.visible = visible;
+        firePropertyChange("visible", old, isVisible());
+    }
+
+    public String toString() {
+        return getDisplayName();
+    }
+
+    // =================================================================================================================
+    // Abstract Methods
+
+    /**
+     * Get the display name for this effect
+     *
+     * @return The user displayable name
+     */
+    public abstract String getDisplayName();
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    public abstract EffectType getEffectType();
+
+    /**
+     * Get the blending mode to use to paint the result effected image if the EffectType is UNDER or OVER.
+     *
+     * @return The blending mode for the effect
+     */
+    public abstract BlendingMode getBlendingMode();
+
+    /**
+     * Get the opacity to use to paint the result effected image if the EffectType is UNDER or OVER.
+     *
+     * @return The opactity for the effect, 0.0f -> 1.0f
+     */
+    public abstract float getOpacity();
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The dstination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return The result of appl
+     */
+    public abstract BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h);
+
+    // =================================================================================================================
+    // Static data cache
+
+    private static SoftReference<int[]> tmpIntArray = null;
+    private static SoftReference<byte[]> tmpByteArray1 = null;
+    private static SoftReference<byte[]> tmpByteArray2 = null;
+    private static SoftReference<byte[]> tmpByteArray3 = null;
+
+    protected static int[] getTmpIntArray(int size) {
+        int[] tmp;
+        if (tmpIntArray == null || (tmp = tmpIntArray.get()) == null || tmp.length < size) {
+            // create new array
+            tmp = new int[size];
+            tmpIntArray = new SoftReference<int[]>(tmp);
+        }
+        return tmp;
+    }
+
+    protected static byte[] getTmpByteArray1(int size) {
+        byte[] tmp;
+        if (tmpByteArray1 == null || (tmp = tmpByteArray1.get()) == null || tmp.length < size) {
+            // create new array
+            tmp = new byte[size];
+            tmpByteArray1 = new SoftReference<byte[]>(tmp);
+        }
+        return tmp;
+    }
+
+    protected static byte[] getTmpByteArray2(int size) {
+        byte[] tmp;
+        if (tmpByteArray2 == null || (tmp = tmpByteArray2.get()) == null || tmp.length < size) {
+            // create new array
+            tmp = new byte[size];
+            tmpByteArray2 = new SoftReference<byte[]>(tmp);
+        }
+        return tmp;
+    }
+
+    protected static byte[] getTmpByteArray3(int size) {
+        byte[] tmp;
+        if (tmpByteArray3 == null || (tmp = tmpByteArray3.get()) == null || tmp.length < size) {
+            // create new array
+            tmp = new byte[size];
+            tmpByteArray3 = new SoftReference<byte[]>(tmp);
+        }
+        return tmp;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtils.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtils.java
new file mode 100644
index 0000000..9a6876b
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtils.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+
+/**
+ * EffectUtils
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public class EffectUtils {
+
+    /**
+     * <p>Blurs the source pixels into the destination pixels. The force of the blur is specified by the radius which
+     * must be greater than 0.</p> <p>The source and destination pixels arrays are expected to be in the BYTE_GREY
+     * format.</p> <p>After this method is executed, dstPixels contains a transposed and filtered copy of
+     * srcPixels.</p>
+     *
+     * @param srcPixels the source pixels
+     * @param dstPixels the destination pixels
+     * @param width     the width of the source picture
+     * @param height    the height of the source picture
+     * @param kernel    the kernel of the blur effect
+     * @param radius    the radius of the blur effect
+     */
+    public static void blur(byte[] srcPixels, byte[] dstPixels,
+                            int width, int height,
+                            float[] kernel, int radius) {
+        float p;
+        int cp;
+        for (int y = 0; y < height; y++) {
+            int index = y;
+            int offset = y * width;
+            for (int x = 0; x < width; x++) {
+                p = 0.0f;
+                for (int i = -radius; i <= radius; i++) {
+                    int subOffset = x + i;
+                    if (subOffset < 0 || subOffset >= width) {
+                        subOffset = (x + width) % width;
+                    }
+                    int pixel = srcPixels[offset + subOffset] & 0xFF;
+                    float blurFactor = kernel[radius + i];
+                    p += blurFactor * pixel;
+                }
+                cp = (int) (p + 0.5f);
+                dstPixels[index] = (byte) (cp > 255 ? 255 : cp);
+                index += height;
+            }
+        }
+    }
+
+    public static float[] createGaussianKernel(int radius) {
+        if (radius < 1) {
+            throw new IllegalArgumentException("Radius must be >= 1");
+        }
+
+        float[] data = new float[radius * 2 + 1];
+
+        float sigma = radius / 3.0f;
+        float twoSigmaSquare = 2.0f * sigma * sigma;
+        float sigmaRoot = (float) Math.sqrt(twoSigmaSquare * Math.PI);
+        float total = 0.0f;
+
+        for (int i = -radius; i <= radius; i++) {
+            float distance = i * i;
+            int index = i + radius;
+            data[index] = (float) Math.exp(-distance / twoSigmaSquare) / sigmaRoot;
+            total += data[index];
+        }
+
+        for (int i = 0; i < data.length; i++) {
+            data[i] /= total;
+        }
+
+        return data;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtilsTemp.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtilsTemp.java
new file mode 100644
index 0000000..17bfd33
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/EffectUtilsTemp.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import java.awt.Composite;
+import java.awt.CompositeContext;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+
+/**
+ * EffectUtilsTemp - effect utils methods that are not being used for now but we might want later
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public class EffectUtilsTemp {
+
+    /**
+     * Extract the alpha channel of a image into new greyscale buffered image
+     *
+     * @param src Must but INT_ARGB buffered image
+     * @return new TYPE_BYTE_GRAY image of just the alpha channel
+     */
+    public static BufferedImage extractAlpha(BufferedImage src) {
+        int w = src.getWidth();
+        int h = src.getHeight();
+        // extract image alpha channel as greyscale image
+        final BufferedImage greyImg = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_GRAY);
+        Graphics2D g2 = greyImg.createGraphics();
+        g2.setComposite(new Composite() {
+            public CompositeContext createContext(ColorModel srcColorModel, ColorModel dstColorModel,
+                                                  RenderingHints hints) {
+                return new CompositeContext() {
+                    public void dispose() {}
+
+                    public void compose(Raster src, Raster dstIn, WritableRaster dstOut) {
+                        int width = Math.min(src.getWidth(), dstIn.getWidth());
+                        int height = Math.min(src.getHeight(), dstIn.getHeight());
+                        int[] srcPixels = new int[width];
+                        byte[] dstPixels = new byte[width];
+                        for (int y = 0; y < height; y++) {
+                            src.getDataElements(0, y, width, 1, srcPixels);
+                            for (int x = 0; x < width; x++) {
+                                dstPixels[x] = (byte) ((srcPixels[x] & 0xFF000000) >>> 24);
+                            }
+                            dstOut.setDataElements(0, y, width, 1, dstPixels);
+                        }
+                    }
+                };
+            }
+        });
+        g2.drawImage(src, 0, 0, null);
+        g2.dispose();
+        return greyImg;
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerGlowEffect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerGlowEffect.java
new file mode 100644
index 0000000..ea0b2d1
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerGlowEffect.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+
+/**
+ * InnerGlowEffect
+ *
+ * @author Created by Jasper Potts (Jun 21, 2007)
+ */
+public class InnerGlowEffect extends InnerShadowEffect {
+
+    protected InnerGlowEffect() {
+        distance = 0;
+    }
+
+    public InnerGlowEffect(UIDefaults uiDefaults) {
+        color = new Matte(new Color(255, 255, 211), uiDefaults);
+    }
+
+    /**
+     * Get the display name for this effect
+     *
+     * @return The user displayable name
+     */
+    public String getDisplayName() {
+        return "Inner Glow";
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerShadowEffect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerShadowEffect.java
new file mode 100644
index 0000000..502c4a0
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/InnerShadowEffect.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Arrays;
+
+/**
+ * InnerShadowEffect
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public class InnerShadowEffect extends ShadowEffect {
+
+    protected InnerShadowEffect() {}
+
+    ;
+
+    public InnerShadowEffect(UIDefaults uiDefaults) {
+        color = new Matte(Color.BLACK, uiDefaults);
+    }
+
+    // =================================================================================================================
+    // Effect Methods
+
+    /**
+     * Get the display name for this effect
+     *
+     * @return The user displayable name
+     */
+    public String getDisplayName() {
+        return "Inner Shadow";
+    }
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    public Effect.EffectType getEffectType() {
+        return Effect.EffectType.OVER;
+    }
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The dstination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return The result of appl
+     */
+    public BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h) {
+        // calculate offset
+        double trangleAngle = Math.toRadians(angle - 90);
+        int offsetX = (int) (Math.sin(trangleAngle) * distance);
+        int offsetY = (int) (Math.cos(trangleAngle) * distance);
+        // clac expanded size
+        int tmpOffX = offsetX + size;
+        int tmpOffY = offsetY + size;
+        int tmpW = w + offsetX + size + size;
+        int tmpH = h + offsetY + size + size;
+        // create tmp buffers
+        int[] lineBuf = getTmpIntArray(w);
+        byte[] srcAlphaBuf = getTmpByteArray1(tmpW * tmpH);
+        Arrays.fill(srcAlphaBuf, (byte) 0xFF);
+        byte[] tmpBuf1 = getTmpByteArray2(tmpW * tmpH);
+        byte[] tmpBuf2 = getTmpByteArray3(tmpW * tmpH);
+        // extract src image alpha channel and inverse and offset
+        Raster srcRaster = src.getRaster();
+        for (int y = 0; y < h; y++) {
+            int dy = (y + tmpOffY);
+            int offset = dy * tmpW;
+            srcRaster.getDataElements(0, y, w, 1, lineBuf);
+            for (int x = 0; x < w; x++) {
+                int dx = x + tmpOffX;
+                srcAlphaBuf[offset + dx] = (byte) ((255 - ((lineBuf[x] & 0xFF000000) >>> 24)) & 0xFF);
+            }
+        }
+        // blur
+        float[] kernel = EffectUtils.createGaussianKernel(size * 2);
+        EffectUtils.blur(srcAlphaBuf, tmpBuf2, tmpW, tmpH, kernel, size * 2); // horizontal pass
+        EffectUtils.blur(tmpBuf2, tmpBuf1, tmpH, tmpW, kernel, size * 2);// vertical pass
+        //rescale
+        float spread = Math.min(1 / (1 - (0.01f * this.spread)), 255);
+        for (int i = 0; i < tmpBuf1.length; i++) {
+            int val = (int) (((int) tmpBuf1[i] & 0xFF) * spread);
+            tmpBuf1[i] = (val > 255) ? (byte) 0xFF : (byte) val;
+        }
+        // create color image with shadow color and greyscale image as alpha
+        if (dst == null) dst = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+        WritableRaster shadowRaster = dst.getRaster();
+        int red = color.getRed(), green = color.getGreen(), blue = color.getBlue();
+        for (int y = 0; y < h; y++) {
+            int srcY = y + tmpOffY;
+            int offset = srcY * tmpW;
+            int shadowOffset = (srcY - offsetY) * tmpW;
+            for (int x = 0; x < w; x++) {
+                int srcX = x + tmpOffX;
+                int origianlAlphaVal = 255 - ((int) srcAlphaBuf[offset + srcX] & 0xFF);
+                int shadowVal = (int) tmpBuf1[shadowOffset + (srcX - offsetX)] & 0xFF;
+                int alphaVal = Math.min(origianlAlphaVal, shadowVal);
+                lineBuf[x] = ((byte) alphaVal & 0xFF) << 24 | red << 16 | green << 8 | blue;
+            }
+            shadowRaster.setDataElements(0, y, w, 1, lineBuf);
+        }
+        return dst;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/OuterGlowEffect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/OuterGlowEffect.java
new file mode 100644
index 0000000..c431ed7
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/OuterGlowEffect.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+
+/**
+ * OuterGlowEffect
+ *
+ * @author Created by Jasper Potts (Jun 21, 2007)
+ */
+public class OuterGlowEffect extends DropShadowEffect {
+
+    protected OuterGlowEffect() {
+        distance = 0;
+    }
+
+    public OuterGlowEffect(UIDefaults uiDefaults) {
+        color = new Matte(new Color(255, 255, 211), uiDefaults);
+    }
+
+    /**
+     * Get the display name for this effect
+     *
+     * @return The user displayable name
+     */
+    public String getDisplayName() {
+        return "Outer Glow";
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/ShadowEffect.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/ShadowEffect.java
new file mode 100644
index 0000000..39620d5
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/effects/ShadowEffect.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.effects;
+
+import org.jdesktop.swingx.designer.BlendingMode;
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+
+/**
+ * ShadowEffect - base class with all the standard properties for shadow effects
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+public abstract class ShadowEffect extends Effect {
+    protected Matte color;
+    protected BlendingMode blendingMode = BlendingMode.NORMAL;
+    /** Opacity a float 0-1 for percentage */
+    protected float opacity = 0.75f;
+    /** Angle in degrees between 0-360 */
+    protected int angle = 135;
+    /** Distance in pixels */
+    protected int distance = 5;
+    /** The shadow spread between 0-100 % */
+    protected int spread = 0;
+    /** Size in pixels */
+    protected int size = 5;
+
+    protected ShadowEffect() {}
+
+    ;
+
+    public ShadowEffect(UIDefaults uiDefaults) {
+        color = new Matte(Color.BLACK, uiDefaults);
+    }
+
+    // =================================================================================================================
+    // Bean methods
+
+    public Matte getColor() {
+        return color;
+    }
+
+    public void setColor(Matte color) {
+        Matte old = getColor();
+        this.color = color;
+        firePropertyChange("color", old, getColor());
+    }
+
+    public BlendingMode getBlendingMode() {
+        return blendingMode;
+    }
+
+    public void setBlendingMode(BlendingMode blendingMode) {
+        BlendingMode old = getBlendingMode();
+        this.blendingMode = blendingMode;
+        firePropertyChange("blendingMode", old, getBlendingMode());
+    }
+
+    public float getOpacity() {
+        return opacity;
+    }
+
+    public void setOpacity(float opacity) {
+        float old = getOpacity();
+        this.opacity = opacity;
+        firePropertyChange("opacity", old, getOpacity());
+    }
+
+    public int getAngle() {
+        return angle;
+    }
+
+    public void setAngle(int angle) {
+        int old = getAngle();
+        this.angle = angle;
+        firePropertyChange("angle", old, getAngle());
+    }
+
+    public int getDistance() {
+        return distance;
+    }
+
+    public void setDistance(int distance) {
+        int old = getDistance();
+        this.distance = distance;
+        firePropertyChange("distance", old, getDistance());
+    }
+
+    public int getSpread() {
+        return spread;
+    }
+
+    public void setSpread(int spread) {
+        int old = getSpread();
+        this.spread = spread;
+        firePropertyChange("spread", old, getSpread());
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public void setSize(int size) {
+        int old = getSize();
+        this.size = size;
+        firePropertyChange("size", old, getSize());
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/font/Typeface.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/font/Typeface.java
new file mode 100644
index 0000000..89d4675f
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/font/Typeface.java
@@ -0,0 +1,484 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.font;
+
+import java.awt.Font;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.UIDefaults;
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * I don't think the name is technically correct (ie: a typeface is not a font),
+ * but I wanted something besides "font" so, here it is.
+ *
+ * This is a mutable font, much like Matte is a mutable color. Also like Matte,
+ * Typeface can be derived.
+ *
+ * @author rbair
+ */
+public class Typeface extends AbstractBean {
+    //specifies whether to derive bold, or italic.
+    //Default means, get my value from my parent.
+    //Off means, leave bold/italic off.
+    //On means, make bold/italic on.
+    public enum DeriveStyle { Default, Off, On }
+
+    private String uiDefaultParentName;
+    /** This is a local UIDefaults that contains all the UIDefaults in the Model. */
+    private transient UIDefaults uiDefaults = new UIDefaults();
+    private PropertyChangeListener uiDefaultsChangeListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (uiDefaultParentName != null && uiDefaultParentName.equals(evt.getPropertyName())) {
+                updateFontFromOffsets();
+            }
+        }
+    };
+
+    /**
+     * The name of the font. If uiDefaultParentName is specified, then this name
+     * will be set to be equal to the name of the parent font.
+     */
+    private String name;
+    /**
+     * The size of the font. If uiDefaultParentName is set, then this value is
+     * updated to reflect the size of the parent font * the sizeOffset.
+     */
+    private int size;
+
+    //this field is not publically accessible. Rather, it is updated based on
+    //"bold" and "italic" as necessary.
+    private int style = Font.PLAIN;
+    private DeriveStyle bold = DeriveStyle.Default;
+    private DeriveStyle italic = DeriveStyle.Default;
+
+    /**
+     * The size offset. Only used if uiDefaultParentName is specified. This offset
+     * will be multiplied with the parent font's size to determine the size of this
+     * typeface. The offset is specified as a percentage, either positive or negative.
+     *
+     * The reason a percentage was used, was so that things would look correctly
+     * when scaled, such as with high DPI situations.
+     */
+    private float sizeOffset;
+
+    /**
+     * Create a new Typeface. Note that, without specifying the uiDefaults,
+     * you cannot have font derivation. Thus, this constructor should never
+     * be called, except for the XML binding stuff.
+     */
+    public Typeface() { }
+
+    /**
+     * Creates a new Typeface.
+     *
+     * @param f The font from which to get the font name, size, and style to use
+     * to initialize this typeface. Note that this font is not used as a parent
+     * font for derivation purposes. Rather, it is used as a source from which to
+     * copy initial settings.
+     *
+     * @param uiDefaults The uiDefaults to use for font derivation purposes.
+     * When the uiDefaultParentName is specified, then this Typeface will inspect
+     * the given UIDefaults for that parent <em>font</em>. Note that the UIDefaults
+     * should be populated with a font, and not with a typeface.
+     */
+    public Typeface(Font f, UIDefaults uiDefaults) {
+        if (f != null) {
+            this.name = f.getName();
+            this.size = f.getSize();
+            this.style = f.getStyle();
+        }
+        setUiDefaults(uiDefaults);
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    protected void postSet(IUnmarshallingContext context) {
+        // walk up till we get synth model
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIDefaults) {
+                UIDefaults uiDefaults = ((HasUIDefaults) context.getStackObject(i)).getUiDefaults();
+                if (uiDefaults != null) {
+                    setUiDefaults(uiDefaults);
+                    break;
+                }
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // Typeface methods
+
+    /**
+     * Is the Typeface an absolute Font not derived from a parent ui default
+     *
+     * @return <code>true</code> if this is a absolute not uidefault derived font
+     */
+    public boolean isAbsolute() {
+        return uiDefaultParentName == null;
+    }
+
+    /**
+     * Set all properties of this Typeface to be the same as <code>src</code> and fire all the change events
+     *
+     * @param src the Typeface to copy properties from
+     */
+    public void copy(Typeface src) {
+        // keep old values
+        Font oldFont = getFont();
+        String oldParentName = uiDefaultParentName;
+        String oldName = name;
+        int oldSize = size;
+        float oldSizeOffset = sizeOffset;
+        DeriveStyle oldBold = bold, oldItalic = italic;
+
+        style = src.style;
+
+        //Note, I don't just call the setters here, because I want to make
+        //sure the "font" PCE is only fired once, at the end.
+        name = src.name;
+        firePropertyChange("name", oldName, name);
+        size = src.size;
+        firePropertyChange("size", oldSize, size);
+        bold = src.bold;
+        firePropertyChange("bold", oldBold, bold);
+        italic = src.italic;
+        firePropertyChange("italic", oldItalic, italic);
+        sizeOffset = src.sizeOffset;
+        firePropertyChange("sizeOffset", oldSizeOffset, sizeOffset);
+        uiDefaultParentName = src.uiDefaultParentName;
+        firePropertyChange("uiDefaultParentName", oldParentName, uiDefaultParentName);
+        setUiDefaults(src.uiDefaults);
+        firePropertyChange("font", oldFont, getFont());
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in the Model.
+     *
+     * @return The UIDefaults for the model that contains this Typeface, can be null if this Typeface is not part of a bigger
+     *         model
+     */
+    public UIDefaults getUiDefaults() {
+        return uiDefaults;
+    }
+
+    /**
+     * Set the local UIDefaults that contains all the UIDefaults in the Model.
+     *
+     * @param uiDefaults The UIDefaults for the model that contains this Typeface, can be null if this Typeface is not part of
+     *                   a bigger model
+     */
+    public void setUiDefaults(UIDefaults uiDefaults) {
+        if (uiDefaults != this.uiDefaults) {
+            UIDefaults old = getUiDefaults();
+            if (old != null) old.removePropertyChangeListener(uiDefaultsChangeListener);
+            this.uiDefaults = uiDefaults;
+            if (uiDefaults != null) this.uiDefaults.addPropertyChangeListener(uiDefaultsChangeListener);
+            firePropertyChange("uiDefaults", old, getUiDefaults());
+        }
+    }
+
+    /**
+     * Get the name if the uidefault font that is the parent that this Typeface is derived from. If null then this is a
+     * absolute font.
+     *
+     * @return Parent font ui default name
+     */
+    public String getUiDefaultParentName() {
+        return uiDefaultParentName;
+    }
+
+    /**
+     * Set the name if the uidefault font that is the parent that this Typeface is derived from. If null then this is a
+     * absolute font.
+     *
+     * @param uiDefaultParentName Parent font ui default name
+     */
+    public void setUiDefaultParentName(String uiDefaultParentName) {
+        String old = getUiDefaultParentName();
+        this.uiDefaultParentName = uiDefaultParentName;
+        firePropertyChange("uiDefaultParentName", old, getUiDefaultParentName());
+        if (isAbsolute()) {
+            // reset offsets
+            float oldSizeOffset = sizeOffset;
+            sizeOffset = 0;
+            firePropertyChange("sizeOffset", oldSizeOffset, sizeOffset);
+        } else {
+            updateFontFromOffsets();
+        }
+    }
+
+    /**
+     * @return Gets the name of the font
+     */
+    public final String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the name of the font. This method call <em>only</em> works if
+     * <code>isAbsolute</code> returns true. Otherwise, it is ignored.
+     * @param name the name of the font
+     */
+    public void setName(String name) {
+        if (isAbsolute()) {
+            String old = this.name;
+            Font oldF = getFont();
+            this.name = name;
+            firePropertyChange("name", old, this.name);
+            firePropertyChange("font", oldF, getFont());
+        }
+    }
+
+    /**
+     * @return gets the size of the font.
+     */
+    public final int getSize() {
+        return size;
+    }
+
+    /**
+     * <p>Sets the size of the font. THis method call will work whether
+     * <code>isAbsolute</code> returns true or false. If this is an absolute
+     * typeface, then the size is set directly. Otherwise, if this is a
+     * derived typeface, then the sizeOffset will be updated to reflect the
+     * proper offset based on this size, and the size of the parent font.</p>
+     *
+     * <p>For example, if the parent font's size was 12, and the sizeOffset was
+     * -2 (thus yielding as size on this typeface of 10), and you call setSize
+     * passing in "14" as the size, then the sizeOffset will be updated to be
+     * equal to "2".</p>
+     *
+     * @param size the new size for this typeface.
+     */
+    public void setSize(int size) {
+        int old = this.size;
+        Font oldF = getFont();
+        this.size = size;
+        firePropertyChange("size", old, this.size);
+        firePropertyChange("font", oldF, getFont());
+        updateOffsetsFromFont();
+    }
+
+    /**
+     * @return the size offset
+     */
+    public final float getSizeOffset() {
+        return sizeOffset;
+    }
+
+    /**
+     * Sets the percentage by which the size of this font should be different
+     * from its parent font. This property is kept in synch with the size property.
+     *
+     * @param sizeOffset the size offset. May be any float. The value "1" means,
+     * 100%. -1 means "-100%". 2 means "200%", and so on.
+     */
+    public void setSizeOffset(float sizeOffset) {
+        float old = this.sizeOffset;
+        Font oldF = getFont();
+        this.sizeOffset = sizeOffset;
+        firePropertyChange("sizeOffset", old, this.sizeOffset);
+        firePropertyChange("font", oldF, getFont());
+        updateFontFromOffsets();
+    }
+
+    public DeriveStyle getBold() {
+        return bold;
+    }
+
+    public void setBold(DeriveStyle bold) {
+        DeriveStyle old = this.bold;
+        this.bold = bold == null ? DeriveStyle.Default : bold;
+        firePropertyChange("bold", old, this.bold);
+        updateFontFromOffsets();
+    }
+
+    public DeriveStyle getItalic() {
+        return italic;
+    }
+
+    public void setItalic(DeriveStyle italic) {
+        DeriveStyle old = this.italic;
+        this.italic = italic == null ? DeriveStyle.Default : italic;
+        firePropertyChange("italic", old, this.italic);
+        updateFontFromOffsets();
+    }
+
+    /**
+     * @return whether or not the font represented by this typeface is supported
+     * on this operating system platform.
+     */
+    public boolean isFontSupported() {
+        return true;//Font.getFont(name) != null;
+    }
+
+    /**
+     * @return Gets the font associated with this Typeface. If font derivation is
+     * being used, then the Font returned is the result of that derivation.
+     */
+    public Font getFont() {
+        return new Font(name, style, size);
+    }
+
+    /**
+     * Sets the font from which this Typeface should extract the font name, style,
+     * and size. If font derivation is being used, then the font name will be ignored,
+     * the style will be used (and always override the parent font), and the size
+     * will be set and the sizeOffset updated appropriately.
+     *
+     * @param f the Font
+     */
+    public void setFont(Font f) {
+        Font oldFont = getFont();
+        String oldName = name;
+        int oldSize = size;
+        DeriveStyle oldBold = bold, oldItalic = italic;
+        name = f.getName();
+        size = f.getSize();
+        style = f.getStyle();
+        updateOffsetsFromFont();
+        firePropertyChange("name", oldName, name);
+        firePropertyChange("size", oldSize, size);
+        firePropertyChange("bold", oldBold, bold);
+        firePropertyChange("italic", oldItalic, italic);
+        firePropertyChange("font", oldFont, getFont());
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * @return A formatted string representing this Typeface. This String should
+     * not be considered public API, as it may change in a future release.
+     */
+    @Override public String toString() {
+        Font f = getFont();
+        String  strStyle;
+        if (f.isBold()) {
+            strStyle = f.isItalic() ? "bolditalic" : "bold";
+        } else {
+            strStyle = f.isItalic() ? "italic" : "plain";
+        }
+
+        if (isAbsolute()) {
+            return Typeface.class.getName() + "[name=" + name + ", size=" + size + ", style=" + strStyle + "]";
+        } else {
+            return Typeface.class.getName() + "[base=" + uiDefaultParentName +
+                    ", name=" + name + ", size=" + size + "(offset " + sizeOffset + ")" +
+                    ", style=" + strStyle + "]";
+        }
+    }
+
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Typeface typeface = (Typeface) o;
+        if (!typeface.name.equals(name)) return false;
+        if (size != typeface.size) return false;
+        if (bold != typeface.bold) return false;
+        if (italic != typeface.italic) return false;
+        if (sizeOffset != typeface.sizeOffset) return false;
+        if (uiDefaultParentName != null ? !uiDefaultParentName.equals(typeface.uiDefaultParentName) :
+                typeface.uiDefaultParentName != null) return false;
+        return true;
+    }
+
+    @Override public int hashCode() {
+        int result;
+        result = name.hashCode();
+        result = 31 * result + size;
+        result = 31 * result + bold.ordinal();
+        result = 31 * result + italic.ordinal();
+        result = 31 * result + (int)(sizeOffset*100);
+        result = 31 * result + (uiDefaultParentName != null ? uiDefaultParentName.hashCode() : 0);
+        return result;
+    }
+
+    @Override public Typeface clone() {
+        Typeface clone = new Typeface();
+        clone.name = name;
+        clone.size = size;
+        clone.style = style;
+        clone.bold = bold;
+        clone.italic = italic;
+        clone.sizeOffset = sizeOffset;
+        clone.uiDefaultParentName = uiDefaultParentName;
+        clone.setUiDefaults(uiDefaults);
+        return clone;
+    }
+
+    // =================================================================================================================
+    // Private Helper Methods
+
+    private void updateOffsetsFromFont() {
+        if (!isAbsolute()) {
+            float oldSizeOffset = sizeOffset;
+            Font parentFont = uiDefaults.getFont(uiDefaultParentName);
+            if (parentFont != null) {
+                float s = size;
+                float p = parentFont.getSize();
+                sizeOffset = (s/p) - 1f;
+                firePropertyChange("sizeOffset", oldSizeOffset, sizeOffset);
+            }
+        }
+    }
+
+    private void updateFontFromOffsets() {
+        if (!isAbsolute()) {
+            Font oldFont = getFont();
+            // get parent font data
+            Font parentFont = uiDefaults.getFont(uiDefaultParentName);
+            if (parentFont != null) {
+                String oldName = name;
+                int oldSize = size;
+
+                name = parentFont.getName();
+                size = Math.round(parentFont.getSize() * (1f + sizeOffset));
+
+                boolean isBold = (bold == DeriveStyle.Default && parentFont.isBold()) || bold == DeriveStyle.On;
+                boolean isItalic = (italic == DeriveStyle.Default && parentFont.isItalic()) || italic == DeriveStyle.On;
+                style = Font.PLAIN;
+                if (isBold) style = style | Font.BOLD;
+                if (isItalic) style = style | Font.ITALIC;
+
+                // update fire events
+                firePropertyChange("name", oldName, name);
+                firePropertyChange("size", oldSize, size);
+                firePropertyChange("font", oldFont, getFont());
+            }
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/CanvasMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/CanvasMapper.java
new file mode 100644
index 0000000..6c201fd
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/CanvasMapper.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.jibxhelpers;
+
+import org.jdesktop.swingx.designer.Canvas;
+import org.jdesktop.swingx.designer.utils.HasPath;
+import org.jdesktop.swingx.designer.utils.HasResources;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IMarshallable;
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+import javax.swing.UIDefaults;
+import java.io.File;
+
+/**
+ * CanvasMapper
+ *
+ * @author Created by Jasper Potts (Jun 12, 2007)
+ */
+public class CanvasMapper implements IMarshaller, IUnmarshaller {
+    private static final String ELEMENT_NAME = "canvas";
+    private IBindingFactory bindingFactory;
+
+
+    public CanvasMapper() {
+        try {
+            bindingFactory = BindingDirectory.getFactory(Canvas.class);
+        } catch (JiBXException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(null, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Canvas)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            // version found, create marshaller for the associated binding
+//            IBindingFactory bindingFactory = BindingDirectory.getFactory(object.getClass());
+            MarshallingContext context = (MarshallingContext) bindingFactory.createMarshallingContext();
+            // configure marshaller for writing document
+            context.setXmlWriter(iMarshallingContext.getXmlWriter());
+            // output object as document
+            ((IMarshallable) object).marshal(context);
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(null, ELEMENT_NAME)) {
+            ctx.throwStartTagNameError(null, ELEMENT_NAME);
+        }
+
+//        IBindingFactory bindingFactory = BindingDirectory.getFactory(Canvas.class);
+        UnmarshallingContext uctx = (UnmarshallingContext) bindingFactory.createUnmarshallingContext();
+        uctx.setFromContext(ctx);
+        // get the uiDefaults from SynthModel and set them as user context
+        UIDefaults uiDefaults = ((HasUIDefaults) ctx.getStackObject(ctx.getStackDepth() - 1)).getUiDefaults();
+        uctx.setUserContext(uiDefaults);
+        // get has resources
+        HasResources hasResources = (HasResources) ctx.getStackObject(ctx.getStackDepth() - 1);
+        // get path
+        HasPath hasPath = null;
+        for (int i = 0; i < ctx.getStackDepth(); i++) {
+            if (ctx.getStackObject(i) instanceof HasPath) {
+                hasPath = (HasPath) ctx.getStackObject(i);
+                break;
+            }
+        }
+        // Unmarshal the Canvas
+        Canvas canvas = (Canvas) uctx.unmarshalElement();
+        // set canvas's ui defaults
+        canvas.setUiDefaults(uiDefaults);
+        // get canvas path
+        String canvasPath = hasPath.getPath();
+        // calc and set resources
+        canvas.setResourcesDir(new File(hasResources.getResourcesDir(), canvasPath));
+        canvas.setTemplatesDir(new File(hasResources.getTemplatesDir(), canvasPath));
+        canvas.setImagesDir(new File(hasResources.getImagesDir(), canvasPath));
+        // return canvas
+        return canvas;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/ColorMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/ColorMapper.java
new file mode 100644
index 0000000..81cc738
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/ColorMapper.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.jibxhelpers;
+
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+import java.awt.Color;
+
+/**
+ * ColorMapper
+ *
+ * @author Created by Jasper Potts (Jun 8, 2007)
+ */
+public class ColorMapper implements IMarshaller, IUnmarshaller {
+    private static final String ELEMENT_NAME = "color";
+    private static final String RED_NAME = "red";
+    private static final String GREEN_NAME = "green";
+    private static final String BLUE_NAME = "blue";
+    private static final String ALPHA_NAME = "alpha";
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(null, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Color)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            Color color = (Color) object;
+            ctx.startTagAttributes(0, ELEMENT_NAME).
+                    attribute(0, RED_NAME, color.getRed()).
+                    attribute(0, GREEN_NAME, color.getGreen()).
+                    attribute(0, BLUE_NAME, color.getBlue()).
+                    attribute(0, ALPHA_NAME, color.getAlpha()).
+                    closeStartEmpty();
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(null, ELEMENT_NAME)) {
+            ctx.throwStartTagNameError(null, ELEMENT_NAME);
+        }
+        // get values
+        int red = ctx.attributeInt(null, RED_NAME, 0);
+        int green = ctx.attributeInt(null, GREEN_NAME, 0);
+        int blue = ctx.attributeInt(null, BLUE_NAME, 0);
+        int alpha = ctx.attributeInt(null, ALPHA_NAME, 0);
+        ctx.parsePastEndTag(null, ELEMENT_NAME);
+        // create
+        return new Color(red, green, blue, alpha);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/DimensionMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/DimensionMapper.java
new file mode 100644
index 0000000..44a0f26
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/DimensionMapper.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.jibxhelpers;
+
+import org.jibx.runtime.IAliasable;
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+import java.awt.Dimension;
+
+/**
+ * DimensionMapper
+ *
+ * @author Created by Jasper Potts (Jun 12, 2007)
+ */
+public class DimensionMapper implements IMarshaller, IUnmarshaller, IAliasable {
+    private static final String ELEMENT_NAME = "dimension";
+    private static final String WIDTH_NAME = "width";
+    private static final String HEIGHT_NAME = "height";
+
+    private String uri;
+    private int index;
+    private String name;
+
+    public DimensionMapper() {
+        uri = null;
+        index = 0;
+        name = ELEMENT_NAME;
+    }
+
+    public DimensionMapper(String uri, int index, String name) {
+        this.uri = uri;
+        this.index = index;
+        this.name = name;
+    }
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(uri, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Dimension)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            Dimension dimension = (Dimension) object;
+            ctx.startTagAttributes(index, name).
+                    attribute(index, WIDTH_NAME, dimension.width).
+                    attribute(index, HEIGHT_NAME, dimension.height).
+                    closeStartEmpty();
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(uri, name)) {
+            ctx.throwStartTagNameError(uri, name);
+        }
+        // get values
+        int width = ctx.attributeInt(uri, WIDTH_NAME, index);
+        int height = ctx.attributeInt(uri, HEIGHT_NAME, index);
+        // state finished parsing
+        ctx.parsePastEndTag(uri, name);
+        // create
+        return new Dimension(width, height);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/InsetsMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/InsetsMapper.java
new file mode 100644
index 0000000..e50cb14
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/jibxhelpers/InsetsMapper.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.jibxhelpers;
+
+import org.jibx.runtime.IAliasable;
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+import java.awt.Insets;
+
+/**
+ * InsetsMapper
+ *
+ * @author Created by Jasper Potts (Jun 8, 2007)
+ */
+public class InsetsMapper implements IMarshaller, IUnmarshaller, IAliasable {
+    private static final String ELEMENT_NAME = "insets";
+    private static final String TOP_NAME = "top";
+    private static final String BOTTOM_NAME = "bottom";
+    private static final String LEFT_NAME = "left";
+    private static final String RIGHT_NAME = "right";
+
+    private String uri;
+    private int index;
+    private String name;
+
+    public InsetsMapper() {
+        uri = null;
+        index = 0;
+        name = ELEMENT_NAME;
+    }
+
+    public InsetsMapper(String uri, int index, String name) {
+        this.uri = uri;
+        this.index = index;
+        this.name = name;
+//        System.out.println("InsetsMapper.CONSTRCUTED with uri="+uri+" index="+index+" name="+name);
+    }
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(uri, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Insets)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+//            System.out.println("InsetsMapper.marshal name="+name);
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            Insets insets = (Insets) object;
+            ctx.startTagAttributes(index, name).
+                    attribute(index, TOP_NAME, insets.top).
+                    attribute(index, BOTTOM_NAME, insets.bottom).
+                    attribute(index, LEFT_NAME, insets.left).
+                    attribute(index, RIGHT_NAME, insets.right).
+                    closeStartEmpty();
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(uri, name)) {
+//            System.out.println("InsetsMapper.unmarshal name="+name+" uri="+uri+" currentNode="+ctx.getName());
+            ctx.throwStartTagNameError(uri, name);
+        } else {
+//        System.out.println("InsetsMapper.unmarshal name="+name+" uri="+uri+" currentNode="+ctx.getName());
+        }
+        // get values
+        int top = ctx.attributeInt(uri, TOP_NAME, index);
+        int bottom = ctx.attributeInt(uri, BOTTOM_NAME, index);
+        int left = ctx.attributeInt(uri, LEFT_NAME, index);
+        int right = ctx.attributeInt(uri, RIGHT_NAME, index);
+        // create new hashmap if needed
+        Insets insets = (Insets) object;
+        if (insets == null) {
+            insets = new Insets(top, left, bottom, right);
+        } else {
+            insets.set(top, left, bottom, right);
+        }
+        ctx.parsePastEndTag(uri, name);
+        return insets;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/AbstractGradient.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/AbstractGradient.java
new file mode 100644
index 0000000..5a94abc
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/AbstractGradient.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import java.awt.Color;
+import java.awt.MultipleGradientPaint.CycleMethod;
+import java.awt.Paint;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/** @author rbair */
+public abstract class AbstractGradient extends PaintModel {
+    private final Comparator<GradientStop> sorter = new Comparator<GradientStop>() {
+        public int compare(GradientStop s1, GradientStop s2) {
+            //since a float value may be -.001 or .001, and since casting
+            //this to an int will round off to 0, I have to do a more direct
+            //comparison
+            float v = s1.getPosition() - s2.getPosition();
+
+            if (v < 0) return -1;
+            else if (v == 0) return 0;
+            else return 1;
+        }
+    };
+    private PropertyChangeListener stopListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals("position")) {
+                if (stops.contains((GradientStop) evt.getSource())) {
+                    resortModel(true);
+                } else {
+                    System.err.println("[WARNING] The position of an orphaned stop was changed.");
+                }
+            } else {
+                firePropertyChange("paint", null, getPaint());
+            }
+        }
+    };
+
+    private List<GradientStop> stops = new ArrayList<GradientStop>();
+    private List<GradientStop> unmodifiable;
+    private CycleMethod cycleMethod;
+
+    protected AbstractGradient() {
+        unmodifiable = Collections.unmodifiableList(stops);
+        cycleMethod = CycleMethod.NO_CYCLE;
+        setStops(new GradientStop(0, new Matte(Color.BLUE, null)),
+                new GradientStop(1, new Matte(Color.WHITE, null)));
+    }
+
+    /**
+     * Copy stops and cycleMethod from src to dst
+     *
+     * @param dst The gradient to update to same stops and cycle method as this gradient
+     */
+    protected void copyTo(AbstractGradient dst) {
+        dst.stops.clear();
+        List<GradientStop> stops = new ArrayList<GradientStop>();
+        for (GradientStop stop : this.stops) {
+            stops.add(stop.clone());
+        }
+        dst.setStops(stops);
+        dst.cycleMethod = this.cycleMethod;
+    }
+
+
+    public PaintControlType getPaintControlType() {
+        return PaintControlType.control_line;
+    }
+
+    public void setCycleMethod(CycleMethod method) {
+        CycleMethod old = cycleMethod;
+        Paint oldp = getPaint();
+        cycleMethod = method == null ? CycleMethod.NO_CYCLE : method;
+        firePropertyChange("cycleMethod", old, cycleMethod);
+        firePropertyChange("paint", oldp, getPaint());
+    }
+
+    public final CycleMethod getCycleMethod() {
+        return cycleMethod;
+    }
+
+    public void setStops(GradientStop... stops) {
+        if (stops == null || stops.length < 1) {
+            throw new IllegalArgumentException("Must have more than one stop");
+        }
+        List<GradientStop> old = new ArrayList<GradientStop>(this.stops);
+        for (GradientStop stop : old) {
+            stop.removePropertyChangeListener(stopListener);
+        }
+        Paint oldp = getPaint();
+        this.stops.clear();
+        Collections.addAll(this.stops, stops);
+        for (GradientStop stop : this.stops) {
+            stop.addPropertyChangeListener(stopListener);
+        }
+        resortModel(false);
+        firePropertyChange("stops", old, getStops());
+        firePropertyChange("paint", oldp, getPaint());
+    }
+
+    public final void setStops(List<GradientStop> stops) {
+        setStops(stops == null ? null : stops.toArray(new GradientStop[0]));
+    }
+
+    public final List<GradientStop> getStops() {
+        return unmodifiable;
+    }
+
+    private void resortModel(boolean fireEvent) {
+        Collections.sort(this.stops, sorter);
+        if (fireEvent) {
+            Paint oldp = getPaint();
+            firePropertyChange("stops", null, getStops());
+            firePropertyChange("paint", oldp, getPaint());
+        }
+    }
+
+    //adds a new stop, and interoplates the proper color to use based on
+    //its position
+    public GradientStop addStop(float position) {
+        GradientStop prevStop = null;
+        GradientStop nextStop = null;
+        for (GradientStop stop : stops) {
+            if (stop.getPosition() <= position) {
+                prevStop = stop;
+            } else if (stop.getPosition() >= position) {
+                nextStop = stop;
+            }
+        }
+
+        Matte c = null;
+        if (prevStop != null && nextStop != null) {
+            //interpolate the value of c
+            c = interpolate(prevStop.getColor(), nextStop.getColor(),
+                    position / (nextStop.getPosition() - prevStop.getPosition()));
+        } else if (prevStop != null) {
+            c = prevStop.getColor().clone();
+        } else if (nextStop != null) {
+            c = nextStop.getColor().clone();
+        }
+
+        return addStop(position, c);
+    }
+
+    public GradientStop addStop(float position, Matte color) {
+        GradientStop s = new GradientStop(position, color);
+        s.addPropertyChangeListener(stopListener);
+        List<GradientStop> old = new ArrayList<GradientStop>(stops);
+        Paint oldp = getPaint();
+        stops.add(s);
+        resortModel(false);
+        firePropertyChange("stops", old, getStops());
+        firePropertyChange("paint", oldp, getPaint());
+
+        return s;
+    }
+
+    public GradientStop removeStop(GradientStop s) {
+        List<GradientStop> old = new ArrayList<GradientStop>(stops);
+        Paint oldp = getPaint();
+        stops.remove(s);
+        s.removePropertyChangeListener(stopListener);
+        resortModel(false);
+        firePropertyChange("stops", old, getStops());
+        firePropertyChange("paint", oldp, getPaint());
+        return s;
+    }
+
+    @Override public Paint getPaint() {
+        if (stops.size() == 0) {
+            return null;
+        }
+
+        //there are stops.size() number of main stops. Between each is
+        //a fractional stop. Thus, there are:
+        //stops.size() + stops.size() - 1
+        //number of fractions and colors.
+
+        float[] fractions = new float[stops.size() + stops.size() - 1];
+        Matte[] colors = new Matte[fractions.length];
+
+        //for each stop, create the stop and it's associated fraction
+        int index = 0; // the index into fractions and colors
+        for (int i = 0; i < stops.size(); i++) {
+            GradientStop s = stops.get(i);
+            //copy over the stop's data
+            colors[index] = s.getColor();
+            fractions[index] = s.getPosition();
+
+            //If this isn't the last stop, then add in the fraction
+            if (index < fractions.length - 1) {
+                float f1 = s.getPosition();
+                float f2 = stops.get(i + 1).getPosition();
+
+                index++;
+                fractions[index] = f1 + (f2 - f1) * s.getMidpoint();
+                colors[index] = interpolate(colors[index - 1], stops.get(i + 1).getColor(), .5f);
+            }
+
+            index++;
+        }
+
+        for (int i = 1; i < fractions.length; i++) {
+            //to avoid an error with LinearGradientPaint where two fractions
+            //are identical, bump up the fraction value by a miniscule amount
+            //if it is identical to the previous one
+            //NOTE: The <= is critical because the previous value may already
+            //have been bumped up
+            if (fractions[i] <= fractions[i - 1]) {
+                fractions[i] = fractions[i - 1] + .000001f;
+            }
+        }
+
+        //another boundary condition where multiple stops are all at the end. The
+        //previous loop bumped all but one of these past 1.0, which is bad.
+        //so remove any fractions (and their colors!) that are beyond 1.0
+        int outOfBoundsIndex = -1;
+        for (int i = 0; i < fractions.length; i++) {
+            if (fractions[i] > 1) {
+                outOfBoundsIndex = i;
+                break;
+            }
+        }
+
+        if (outOfBoundsIndex >= 0) {
+            float[] f = fractions;
+            Matte[] c = colors;
+            fractions = new float[outOfBoundsIndex];
+            colors = new Matte[outOfBoundsIndex];
+            System.arraycopy(f, 0, fractions, 0, outOfBoundsIndex);
+            System.arraycopy(c, 0, colors, 0, outOfBoundsIndex);
+        }
+
+        return createPaint(fractions, colors, cycleMethod);
+    }
+
+    protected abstract Paint createPaint(float[] fractions, Matte[] colors, CycleMethod method);
+
+    protected static Matte interpolate(Matte v0, Matte v1, float fraction) {
+        return new Matte(interpolate(v0.getColor(), v1.getColor(), fraction), v0.getUiDefaults());
+    }
+
+    protected static Color interpolate(Color v0, Color v1, float fraction) {
+        int r = v0.getRed() +
+                (int) ((v1.getRed() - v0.getRed()) * fraction + 0.5f);
+        int g = v0.getGreen() +
+                (int) ((v1.getGreen() - v0.getGreen()) * fraction + 0.5f);
+        int b = v0.getBlue() +
+                (int) ((v1.getBlue() - v0.getBlue()) * fraction + 0.5f);
+        int a = v0.getAlpha() +
+                (int) ((v1.getAlpha() - v0.getAlpha()) * fraction + 0.5f);
+        return new Color(r, g, b, a);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Gradient.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Gradient.java
new file mode 100644
index 0000000..ed239ed
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Gradient.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import java.awt.Color;
+import java.awt.LinearGradientPaint;
+import java.awt.MultipleGradientPaint.CycleMethod;
+import java.awt.Paint;
+
+/**
+ * Represents a GradientPaint or LinearGradientPaint.
+ *
+ * @author rbair
+ */
+public class Gradient extends AbstractGradient implements Cloneable {
+    protected Paint createPaint(float[] fractions, Matte[] mattes, CycleMethod method) {
+        Color[] colors = new Color[mattes.length];
+        for (int i = 0; i < colors.length; i++) {
+            colors[i] = mattes[i].getColor();
+        }
+        return new LinearGradientPaint(0, 0, 1, 0, fractions, colors, method);
+    }
+
+    @Override public Gradient clone() {
+        Gradient gradient = new Gradient();
+        copyTo(gradient);
+        return gradient;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/GradientStop.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/GradientStop.java
new file mode 100644
index 0000000..f462fed
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/GradientStop.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import org.jdesktop.beans.AbstractBean;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/** Each stop is defined linearly, at positions between 0 and 1. */
+public final class GradientStop extends AbstractBean implements Cloneable {
+    private float position;
+    private Matte color;
+    private PropertyChangeListener matteListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            firePropertyChange("color", null, color);
+        }
+    };
+
+    /**
+     * The midpoint to the right of the stop. Must be 0 &lt;= midpoint &lt;= 1. The midpoint value of the last Stop is
+     * ignored.
+     */
+    private float midpoint;
+
+    public GradientStop() {}
+
+    public GradientStop(float position, Matte color) {
+        if (color == null) {
+            throw new IllegalArgumentException("Color must not be null");
+        }
+
+        this.position = clamp(0, 1, position);
+        this.color = color;
+        this.midpoint = .5f;
+
+        if (this.color != null) {
+            this.color.addPropertyChangeListener("color", matteListener);
+        }
+    }
+
+
+    public GradientStop clone() {
+        GradientStop clone = new GradientStop(this.position, this.color.clone());
+        clone.midpoint = midpoint;
+        return clone;
+    }
+
+    public final float getPosition() {
+        return position;
+    }
+
+    public final void setPosition(float position) {
+        float old = this.position;
+        this.position = clamp(0, 1, position);
+        firePropertyChange("position", old, this.position);
+    }
+
+    public final Matte getColor() {
+        return color;
+    }
+
+    public final void setColor(Matte c) {
+        if (c == null) throw new IllegalArgumentException("Color must not be null");
+        Matte old = this.color;
+        if (old != null) old.removePropertyChangeListener(matteListener);
+        this.color = c;
+        if (this.color != null) this.color.addPropertyChangeListener(matteListener);
+        firePropertyChange("color", old, c);
+    }
+
+    public final void setOpacity(int opacity) {
+        int old = getOpacity();
+        color.setAlpha(opacity);
+        firePropertyChange("opacity", old, getOpacity());
+    }
+
+    public final int getOpacity() {
+        return color.getAlpha();
+    }
+
+    public final float getMidpoint() {
+        return midpoint;
+    }
+
+    public final void setMidpoint(float midpoint) {
+        float old = this.midpoint;
+        this.midpoint = clamp(0, 1, midpoint);
+        firePropertyChange("midpoint", old, this.midpoint);
+    }
+
+    private float clamp(float lo, float hi, float value) {
+        if (value < lo) {
+            return lo;
+        } else if (value > hi) {
+            return hi;
+        } else {
+            return value;
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Matte.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Matte.java
new file mode 100644
index 0000000..634909f
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Matte.java
@@ -0,0 +1,610 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+import java.awt.Paint;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/**
+ * Representing a single uniform color. Basically, it represents the java.awt.Color. It can either be absolute or
+ * derived from a UIDefault color.
+ *
+ * @author rbair & jasper potts
+ */
+public class Matte extends PaintModel implements HasUIDefaults {
+    private float[] tmpf1 = new float[3];
+    private float[] tmpf2 = new float[3];
+
+    private int red;
+    private int green;
+    private int blue;
+    private int alpha;
+    private Color cached = null;
+
+    /**
+     * The name of the ui default key to derive this color from.
+     */
+    private String uiDefaultParentName = null;
+    /**
+     * The name of the bean property, or client property, on this component
+     * from which to extract a color used for painting. So for example the color
+     * used in a painter could be the background of the component.
+     */
+    private String componentPropertyName = null;
+    private float hueOffset = 0, saturationOffset = 0, brightnessOffset = 0;
+    private int alphaOffset = 0;
+    /**
+     * When true this color will become a UIResource in the UIManager defaults
+     * table. If false, then it will not be a UIResource. This is sometimes
+     * required, such as with colors installed on renderers.
+     */
+    private boolean uiResource = true;
+
+    /** This is a local UIDefaults that contains all the UIDefaults in the Model. */
+    private transient UIDefaults uiDefaults = new UIDefaults();
+    private PropertyChangeListener uiDefaultsChangeListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (uiDefaultParentName != null && uiDefaultParentName.equals(evt.getPropertyName())) {
+                updateARGBFromOffsets();
+            }
+        }
+    };
+
+    // =================================================================================================================
+    // Constructors
+
+    /** propected constructor for JIBX */
+    protected Matte() {}
+
+    public Matte(Color c, UIDefaults uiDefaults) {
+        if (c != null) {
+            this.red = c.getRed();
+            this.green = c.getGreen();
+            this.blue = c.getBlue();
+            this.alpha = c.getAlpha();
+        }
+        setUiDefaults(uiDefaults);
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    protected void postSet(IUnmarshallingContext context) {
+        // walk up till we get synth model
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIDefaults) {
+                UIDefaults uiDefaults = ((HasUIDefaults) context.getStackObject(i)).getUiDefaults();
+                if (uiDefaults != null) {
+                    setUiDefaults(uiDefaults);
+                    break;
+                }
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // Matte methods
+
+    /**
+     * Is the matte an absolute color ot derived from a parent ui default
+     *
+     * @return <code>true</code> if this is a absolute not uidefault derived color
+     */
+    public boolean isAbsolute() {
+        return uiDefaultParentName == null;
+    }
+
+    /**
+     * Set all properties of this matte to be the same as <code>srcMatte</code> and fire all the change events
+     *
+     * @param srcMatte the matte to copy properties from
+     */
+    public void copy(Matte srcMatte) {
+        // keep old values
+        Color oldColor = getColor();
+        String oldParentName = uiDefaultParentName;
+        String oldComponentPropertyName = componentPropertyName;
+        boolean oldUiResource = uiResource;
+        int oldR = red, oldG = green, oldB = blue, oldA = alpha;
+        float oldH = hueOffset, oldS = saturationOffset, oldBr = brightnessOffset;
+        // set properties
+        if (uiResource != srcMatte.uiResource) {
+            uiResource = srcMatte.uiResource;
+            firePropertyChange("uiResource", oldUiResource, isUiResource());
+        }
+        if (red != srcMatte.red) {
+            red = srcMatte.red;
+            firePropertyChange("red", oldR, getRed());
+        }
+        if (green != srcMatte.green) {
+            green = srcMatte.green;
+            firePropertyChange("green", oldG, getGreen());
+        }
+        if (blue != srcMatte.blue) {
+            blue = srcMatte.blue;
+            firePropertyChange("blue", oldB, getBlue());
+        }
+        if (alpha != srcMatte.alpha) {
+            alpha = srcMatte.alpha;
+            firePropertyChange("alpha", oldA, getAlpha());
+        }
+        if (hueOffset != srcMatte.hueOffset) {
+            hueOffset = srcMatte.hueOffset;
+            firePropertyChange("hueOffset", oldH, getHueOffset());
+        }
+        if (saturationOffset != srcMatte.saturationOffset) {
+            saturationOffset = srcMatte.saturationOffset;
+            firePropertyChange("saturationOffset", oldS, getSaturationOffset());
+        }
+        if (brightnessOffset != srcMatte.brightnessOffset) {
+            brightnessOffset = srcMatte.brightnessOffset;
+            firePropertyChange("brightnessOffset", oldBr, getBrightnessOffset());
+        }
+        if (alphaOffset != srcMatte.alphaOffset) {
+            alphaOffset = srcMatte.alphaOffset;
+            firePropertyChange("alphaOffset", oldA, getAlphaOffset());
+        }
+        if (uiDefaultParentName != srcMatte.uiDefaultParentName) {
+            uiDefaultParentName = srcMatte.uiDefaultParentName;
+            firePropertyChange("uiDefaultParentName", oldParentName, getUiDefaultParentName());
+        }
+        if (componentPropertyName != srcMatte.componentPropertyName) {
+            componentPropertyName = srcMatte.componentPropertyName;
+            firePropertyChange("componentPropertyName", oldComponentPropertyName, getComponentPropertyName());
+        }
+        if (uiDefaults != srcMatte.uiDefaults) {
+            setUiDefaults(srcMatte.uiDefaults);
+        }
+        if (!oldColor.equals(srcMatte.getColor())) {
+            firePropertyChange("paint", oldColor, getColor());
+            firePropertyChange("color", oldColor, getColor());
+            fireHSBChange(oldR, oldG, oldB);
+        }
+    }
+
+    // =================================================================================================================
+    // PaintModel methods
+
+    public PaintControlType getPaintControlType() {
+        return PaintControlType.none;
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in the Model.
+     *
+     * @return The UIDefaults for the model that contains this Matte, can be null if this Matte is not part of a bigger
+     *         model
+     */
+    public UIDefaults getUiDefaults() {
+        return uiDefaults;
+    }
+
+    /**
+     * Set the local UIDefaults that contains all the UIDefaults in the Model.
+     *
+     * @param uiDefaults The UIDefaults for the model that contains this Matte, can be null if this Matte is not part of
+     *                   a bigger model
+     */
+    public void setUiDefaults(UIDefaults uiDefaults) {
+        if (uiDefaults != this.uiDefaults) {
+            UIDefaults old = getUiDefaults();
+            if (old != null) old.removePropertyChangeListener(uiDefaultsChangeListener);
+            this.uiDefaults = uiDefaults;
+            if (uiDefaults != null) this.uiDefaults.addPropertyChangeListener(uiDefaultsChangeListener);
+            firePropertyChange("uiDefaults", old, getUiDefaults());
+        }
+    }
+
+    /**
+     * Get the name if the uidefault color that is the parent that this matte is derived from. If null then this is a
+     * absolute color.
+     *
+     * @return Parent color ui default name
+     */
+    public String getUiDefaultParentName() {
+        return uiDefaultParentName;
+    }
+
+    /**
+     * Set the name if the uidefault color that is the parent that this matte is derived from. If null then this is a
+     * absolute color.
+     *
+     * @param uiDefaultParentName Parent color ui default name
+     */
+    public void setUiDefaultParentName(String uiDefaultParentName) {
+        String old = getUiDefaultParentName();
+        this.uiDefaultParentName = uiDefaultParentName;
+        firePropertyChange("uiDefaultParentName", old, getUiDefaultParentName());
+        if (isAbsolute()) {
+            // reset offsets
+            float oldH = hueOffset, oldS = saturationOffset, oldB = brightnessOffset;
+            int oldA = alphaOffset;
+            hueOffset = 0;
+            saturationOffset = 0;
+            brightnessOffset = 0;
+            alphaOffset = 0;
+            firePropertyChange("hueOffset", oldH, getHueOffset());
+            firePropertyChange("saturationOffset", oldS, getSaturationOffset());
+            firePropertyChange("brightnessOffset", oldB, getBrightnessOffset());
+            firePropertyChange("alphaOffset", oldA, getAlphaOffset());
+        }
+        updateARGBFromOffsets();
+    }
+
+    /**
+     * Sets the property to use for extracting the color for whatever component
+     * is passed to the painter. Can be a key in client properties. Can be null.
+     * @param name
+     */
+    public void setComponentPropertyName(String name) {
+        String old = componentPropertyName;
+        firePropertyChange("componentPropertyName", old, componentPropertyName = name);
+    }
+
+    /**
+     * Gets the name of the bean property, or client property, on this component
+     * from which to extract a color used for painting. So for example the color
+     * used in a painter could be the background of the component.
+     *
+     * @return
+     */
+    public String getComponentPropertyName() {
+        return componentPropertyName;
+    }
+
+    /**
+     * Sets whether this color should be represented as a UIResource in UIDefaults
+     * @param b true if the color should be a ui resource
+     */
+    public void setUiResource(boolean b) {
+        boolean old = uiResource;
+        firePropertyChange("uiResource", old, uiResource = b);
+    }
+
+    /**
+     * When false this color will become a non-UIResource in the UIManager defaults
+     * table. This is sometimes required to force swing to use the given color,
+     * such as with renderers.
+     * @return false if the color should not be a uiresource
+     */
+    public boolean isUiResource() {
+        return uiResource;
+    }
+
+    public float getHueOffset() {
+        return hueOffset;
+    }
+
+    public void setHueOffset(float hueOffset) {
+        float old = getHueOffset();
+        this.hueOffset = hueOffset;
+        firePropertyChange("hueOffset", old, getHueOffset());
+        updateARGBFromOffsets();
+    }
+
+    public float getSaturationOffset() {
+        return saturationOffset;
+    }
+
+    public void setSaturationOffset(float satOffset) {
+        float old = getSaturationOffset();
+        this.saturationOffset = satOffset;
+        firePropertyChange("saturationOffset", old, getSaturationOffset());
+        updateARGBFromOffsets();
+    }
+
+    public float getBrightnessOffset() {
+        return brightnessOffset;
+    }
+
+    public void setBrightnessOffset(float brightOffset) {
+        float old = getBrightnessOffset();
+        this.brightnessOffset = brightOffset;
+        firePropertyChange("brightnessOffset", old, getBrightnessOffset());
+        updateARGBFromOffsets();
+    }
+
+    public int getAlphaOffset() {
+        return alphaOffset;
+    }
+
+    public void setAlphaOffset(int alphaOffset) {
+        int old = getAlphaOffset();
+        this.alphaOffset = alphaOffset;
+        firePropertyChange("alphaOffset", old, alphaOffset);
+        updateARGBFromOffsets();
+    }
+
+
+    public void setRed(int red) {
+        red = clamp(red);
+        if (this.red != red) {
+            Color old = getColor();
+            int oldr = this.red;
+            this.red = red;
+            firePropertyChange("paint", old, getColor());
+            firePropertyChange("color", old, getColor());
+            firePropertyChange("red", oldr, red);
+            fireHSBChange(oldr, green, blue);
+            updateOffsetsFromARGB();
+        }
+    }
+
+    public final int getRed() {
+        return red;
+    }
+
+    public void setGreen(int green) {
+        green = clamp(green);
+        if (this.green != green) {
+            Color old = getColor();
+            int oldg = this.green;
+            this.green = green;
+            firePropertyChange("paint", old, getColor());
+            firePropertyChange("color", old, getColor());
+            firePropertyChange("green", oldg, green);
+            fireHSBChange(red, oldg, blue);
+            updateOffsetsFromARGB();
+        }
+    }
+
+    public final int getGreen() {
+        return green;
+    }
+
+    public void setBlue(int blue) {
+        blue = clamp(blue);
+        if (this.blue != blue) {
+            Color old = getColor();
+            int oldb = this.blue;
+            this.blue = blue;
+            firePropertyChange("paint", old, getColor());
+            firePropertyChange("color", old, getColor());
+            firePropertyChange("blue", oldb, blue);
+            fireHSBChange(red, green, oldb);
+            updateOffsetsFromARGB();
+        }
+    }
+
+    public final int getBlue() {
+        return blue;
+    }
+
+    public void setAlpha(int alpha) {
+        alpha = clamp(alpha);
+        if (this.alpha != alpha) {
+            int old = getAlpha();
+            this.alpha = alpha;
+            firePropertyChange("alpha", old, alpha);
+            firePropertyChange("paint", old, getColor());
+            firePropertyChange("color", old, getColor());
+            updateOffsetsFromARGB();
+        }
+    }
+
+    public final int getAlpha() {
+        return alpha;
+    }
+
+    public Color getColor() {
+        if (cached == null || red != cached.getRed() || green != cached.getGreen() ||
+                blue != cached.getBlue() || alpha != cached.getAlpha()) {
+            cached = new Color(red, green, blue, alpha);
+        }
+        return cached;
+    }
+
+    public void setColor(Color c) {
+        setColor(c, false);
+    }
+
+    public void setColor(Color c, boolean dontSetAlpha) {
+        Color oldColor = getColor();
+        int oldR = red, oldG = green, oldB = blue, oldA = alpha;
+        cached = c;
+        red = c.getRed();
+        green = c.getGreen();
+        blue = c.getBlue();
+        if (!dontSetAlpha) alpha = c.getAlpha();
+        updateOffsetsFromARGB();
+        firePropertyChange("red", oldR, getRed());
+        firePropertyChange("green", oldG, getGreen());
+        firePropertyChange("blue", oldB, getBlue());
+        fireHSBChange(oldR, oldG, oldB);
+        if (!dontSetAlpha) firePropertyChange("alpha", oldA, getAlpha());
+        firePropertyChange("paint", oldColor, getColor());
+        firePropertyChange("color", oldColor, getColor());
+    }
+
+    @Override public Paint getPaint() {
+        return getColor();
+    }
+
+
+    @Override public String toString() {
+        if (isAbsolute()) {
+            return Matte.class.getName() + "[r=" + red + ", g=" + green + ", b=" + blue + ", a=" + alpha + "]";
+        } else {
+            return Matte.class.getName() + "[base=" + uiDefaultParentName + ", H+" + hueOffset +
+                    ", S+" + saturationOffset + ", B+" + brightnessOffset + ", A+" + alphaOffset + "]";
+        }
+    }
+
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Matte matte = (Matte) o;
+        if (alpha != matte.alpha) return false;
+        if (alphaOffset != matte.alphaOffset) return false;
+        if (Float.compare(matte.alpha, alpha) != 0) return false;
+        if (blue != matte.blue) return false;
+        if (Float.compare(matte.brightnessOffset, brightnessOffset) != 0)
+            return false;
+        if (green != matte.green) return false;
+        if (Float.compare(matte.hueOffset, hueOffset) != 0) return false;
+        if (red != matte.red) return false;
+        if (uiResource != matte.uiResource) return false;
+        if (Float.compare(matte.saturationOffset, saturationOffset) != 0)
+            return false;
+        if (componentPropertyName != null ?
+                !componentPropertyName.equals(componentPropertyName) :
+                matte.componentPropertyName != null) return false;
+
+        if (uiDefaultParentName != null ?
+                !uiDefaultParentName.equals(matte.uiDefaultParentName) :
+                matte.uiDefaultParentName != null) return false;
+        return true;
+    }
+
+    public int hashCode() {
+        int result;
+        result = red;
+        result = 31 * result + green;
+        result = 31 * result + blue;
+        result = 31 * result + alpha;
+        result = 31 * result + (uiDefaultParentName != null ?
+            uiDefaultParentName.hashCode() : 0);
+        result = 31 * result + (componentPropertyName != null ?
+            componentPropertyName.hashCode() : 0);
+        result = 31 * result + hueOffset != +0.0f ?
+            Float.floatToIntBits(hueOffset) : 0;
+        result = 31 * result + saturationOffset != +0.0f ?
+            Float.floatToIntBits(saturationOffset) : 0;
+        result = 31 * result + brightnessOffset != +0.0f ?
+            Float.floatToIntBits(brightnessOffset) : 0;
+        result = 31 * result + (uiResource ? 1 : 0);
+        return result;
+    }
+
+    @Override public Matte clone() {
+        Matte m = new Matte();
+        m.red = red;
+        m.green = green;
+        m.blue = blue;
+        m.alpha = alpha;
+        m.brightnessOffset = brightnessOffset;
+        m.hueOffset = hueOffset;
+        m.saturationOffset = saturationOffset;
+        m.alphaOffset = alphaOffset;
+        m.uiDefaultParentName = uiDefaultParentName;
+        m.componentPropertyName = componentPropertyName;
+        m.uiResource = uiResource;
+        m.setUiDefaults(uiDefaults);
+        return m;
+    }
+
+    // =================================================================================================================
+    // Private Helper Methods
+
+    private void updateOffsetsFromARGB() {
+        if (!isAbsolute()) {
+            tmpf1 = Color.RGBtoHSB(red, green, blue, tmpf1);
+            Color parentColor = uiDefaults.getColor(uiDefaultParentName);
+            tmpf2 = Color.RGBtoHSB(parentColor.getRed(), parentColor.getGreen(), parentColor.getBlue(), tmpf2);
+            // update offset properties and fire events
+            float oldH = hueOffset, oldS = saturationOffset, oldB = brightnessOffset;
+            int oldA = alphaOffset;
+            hueOffset = tmpf1[0] - tmpf2[0];
+            saturationOffset = tmpf1[1] - tmpf2[1];
+            brightnessOffset = tmpf1[2] - tmpf2[2];
+            alphaOffset = alpha - parentColor.getAlpha();
+            firePropertyChange("hueOffset", oldH, getHueOffset());
+            firePropertyChange("saturationOffset", oldS, getSaturationOffset());
+            firePropertyChange("brightnessOffset", oldB, getBrightnessOffset());
+            firePropertyChange("alphaOffset", oldA, getAlphaOffset());
+        }
+    }
+
+    private void updateARGBFromOffsets() {
+        if (!isAbsolute()) {
+            Color oldColor = getColor();
+            // get parent color HSB
+            Color parentColor = uiDefaults.getColor(uiDefaultParentName);
+            tmpf1 = Color.RGBtoHSB(parentColor.getRed(), parentColor.getGreen(), parentColor.getBlue(), tmpf1);
+            // apply offsets
+            tmpf1[0] = clamp(tmpf1[0] + hueOffset);
+            tmpf1[1] = clamp(tmpf1[1] + saturationOffset);
+            tmpf1[2] = clamp(tmpf1[2] + brightnessOffset);
+            int oldA = getAlpha();
+            alpha = clamp(parentColor.getAlpha() + alphaOffset);
+            updateRGB(tmpf1);
+            // update fire events
+            firePropertyChange("alpha", oldA, getAlpha());
+            firePropertyChange("paint", oldColor, getColor());
+            firePropertyChange("color", oldColor, getColor());
+        }
+    }
+
+    private void updateRGB(float[] hsb) {
+        int oldR = red, oldG = green, oldB = blue;
+        int rgb = Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]);
+        red = (rgb >> 16) & 0xFF;
+        green = (rgb >> 8) & 0xFF;
+        blue = rgb & 0xFF;
+        firePropertyChange("red", oldR, getRed());
+        firePropertyChange("green", oldG, getGreen());
+        firePropertyChange("blue", oldB, getBlue());
+    }
+
+    private void fireHSBChange(int oldR, int oldG, int oldB) {
+        tmpf1 = Color.RGBtoHSB(oldR, oldG, oldB, tmpf1);
+        tmpf2 = Color.RGBtoHSB(red, green, blue, tmpf2);
+        firePropertyChange("hue", tmpf1[0], tmpf2[0]);
+        firePropertyChange("saturation", tmpf1[1], tmpf2[1]);
+        firePropertyChange("brightness", tmpf1[2], tmpf2[2]);
+    }
+
+    private float clamp(float value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 1) {
+            value = 1;
+        }
+        return value;
+    }
+
+    private int clamp(int value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 255) {
+            value = 255;
+        }
+        return value;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/PaintModel.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/PaintModel.java
new file mode 100644
index 0000000..15b67f5
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/PaintModel.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import org.jdesktop.beans.AbstractBean;
+
+import java.awt.Paint;
+
+/**
+ * I'd have just called it Paint, but sadly, that name was already taken, and would have been too confusing.
+ * <p/>
+ * Whenever size or position values are required (for example with Texture or Gradient), they are specified in the unit
+ * square: that is, between 0 and 1 inclusive. They can then later be scaled as necessary by any painting code.
+ *
+ * @author rbair
+ */
+public abstract class PaintModel extends AbstractBean implements Cloneable {
+    public static enum PaintControlType {
+        none, control_line, control_rect
+    }
+
+    protected PaintModel() { }
+
+    /**
+     * @return an instance of Paint that is represented by this PaintModel. This is often not a reversable operation,
+     *         and hence there is no "setPaint" method. Rather, tweaking the exposed properties of the PaintModel fires,
+     *         when necessary, property change events for the "paint" property, and results in different values returned
+     *         from this method.
+     */
+    public abstract Paint getPaint();
+
+    /**
+     * Get the type of controls for this paint model
+     *
+     * @return The type of paint controls, one of PaintControlType.none, PaintControlType.control_line or
+     *         PaintControlType.control_rect
+     */
+    public abstract PaintControlType getPaintControlType();
+
+
+    public abstract PaintModel clone();
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/RadialGradient.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/RadialGradient.java
new file mode 100644
index 0000000..3e66092
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/RadialGradient.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import java.awt.Color;
+import java.awt.MultipleGradientPaint.CycleMethod;
+import java.awt.Paint;
+import java.awt.RadialGradientPaint;
+
+/**
+ * Represents a RadialGradientPaint.
+ *
+ * @author rbair
+ */
+public class RadialGradient extends AbstractGradient {
+    protected Paint createPaint(float[] fractions, Matte[] mattes, CycleMethod method) {
+        Color[] colors = new Color[mattes.length];
+        for (int i = 0; i < colors.length; i++) {
+            colors[i] = mattes[i].getColor();
+        }
+        return new RadialGradientPaint(.5f, .5f, 1, fractions, colors, method);
+    }
+
+    @Override public RadialGradient clone() {
+        RadialGradient gradient = new RadialGradient();
+        copyTo(gradient);
+        return gradient;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Texture.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Texture.java
new file mode 100644
index 0000000..8fd4b2a
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/paint/Texture.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.paint;
+
+import java.awt.Paint;
+import java.awt.TexturePaint;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+/**
+ * Represents a TexturePaint.
+ *
+ * @author rbair
+ */
+public class Texture extends PaintModel {
+    private static final Rectangle2D RECT = new Rectangle2D.Double(0, 0, 1, 1);
+    private BufferedImage img;
+
+    public Texture() {
+    }
+
+    public PaintControlType getPaintControlType() {
+        return PaintControlType.control_rect;
+    }
+
+    public void setImage(BufferedImage img) {
+        BufferedImage old = this.img;
+        this.img = img;
+        firePropertyChange("paint", old, this.img);
+        firePropertyChange("image", old, this.img);
+    }
+
+    public final BufferedImage getImage() {
+        return img;
+    }
+
+    public Paint getPaint() {
+        return new TexturePaint(img, RECT);
+    }
+
+
+    public Texture clone() {
+        Texture newTexture = new Texture();
+        newTexture.img = this.img;
+        return newTexture;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasPath.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasPath.java
new file mode 100644
index 0000000..f5459e1
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasPath.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.utils;
+
+/**
+ * HasPath - interface for model nodes that can provide there path in the tree
+ *
+ * @author Created by Jasper Potts (Jul 2, 2007)
+ */
+public interface HasPath {
+    public String getPath();
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasResources.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasResources.java
new file mode 100644
index 0000000..82f9c0d
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasResources.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.utils;
+
+import java.io.File;
+
+/**
+ * HasResources - interface for model nodes that have resources
+ *
+ * @author Created by Jasper Potts (Jul 2, 2007)
+ */
+public interface HasResources {
+
+    public File getResourcesDir();
+
+    public File getImagesDir();
+
+    public File getTemplatesDir();
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasUIDefaults.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasUIDefaults.java
new file mode 100644
index 0000000..c774d79
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/swingx/designer/utils/HasUIDefaults.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.swingx.designer.utils;
+
+import javax.swing.UIDefaults;
+
+/**
+ * HasUIDefaults - A tagging interface for any class that has UIDefaults
+ *
+ * @author Created by Jasper Potts (Jun 22, 2007)
+ */
+public interface HasUIDefaults {
+    public UIDefaults getUiDefaults();
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/DefaultsGenerator.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/DefaultsGenerator.java
new file mode 100644
index 0000000..948686c
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/DefaultsGenerator.java
@@ -0,0 +1,726 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import org.jdesktop.swingx.designer.Canvas;
+import org.jdesktop.swingx.designer.font.Typeface;
+import org.jdesktop.swingx.designer.paint.Matte;
+import org.jdesktop.swingx.designer.paint.PaintModel;
+import static org.jdesktop.synthdesigner.generator.GeneratorUtils.makePretty;
+import static org.jdesktop.synthdesigner.generator.GeneratorUtils.toConstantName;
+import static org.jdesktop.synthdesigner.generator.ObjectCodeConvertors.convert;
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.read;
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.writeSrcFile;
+import org.jdesktop.synthdesigner.synthmodel.SynthModel;
+import org.jdesktop.synthdesigner.synthmodel.UIComponent;
+import org.jdesktop.synthdesigner.synthmodel.UIFont;
+import org.jdesktop.synthdesigner.synthmodel.UIIconRegion;
+import org.jdesktop.synthdesigner.synthmodel.UIPaint;
+import org.jdesktop.synthdesigner.synthmodel.UIProperty;
+import org.jdesktop.synthdesigner.synthmodel.UIRegion;
+import org.jdesktop.synthdesigner.synthmodel.UIState;
+import org.jdesktop.synthdesigner.synthmodel.UIStateType;
+import org.jdesktop.synthdesigner.synthmodel.UIStyle;
+
+import javax.swing.border.BevelBorder;
+import javax.swing.border.Border;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.border.MatteBorder;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Insets;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import org.jdesktop.synthdesigner.synthmodel.PainterBorder;
+
+/**
+ * DefaultsGenerator
+ * <p/>
+ * There are two main sets of defaults that must be configured. The first is
+ * the actual UI defaults tree. The second is a map of components + regions, which
+ * are used to decide what SynthStyle to use.
+ *
+ * @author Jasper Potts
+ * @author Richard Bair
+ */
+public class DefaultsGenerator {
+    private static String stateTypeImplTemplate;
+
+    private static String getStateTypeTemplate() {
+        if (stateTypeImplTemplate == null) {
+            //load the painter template file into an in-memory string to improve performance
+            //when generating a lot of classes
+            try {
+                stateTypeImplTemplate = read("resources/StateImpl.template");
+            } catch (IOException e) {
+                System.err.println("Failed to read template files.");
+                throw new RuntimeException(e);
+            }
+        }
+        return stateTypeImplTemplate;
+    }
+
+    /**
+     * Generate the defaults file and all painter files for a SynthModel. This method
+     * is the main entry point, called by the Generator class.
+     *
+     * @param uiDefaultInit      The buffer to write ui default put methods of the form <code>d.put("activeCaption", new
+     *                           ColorUIResource(123, 45, 200));</code>
+     * @param styleInit          The buffer to write out code to generate Synth Style populating the styles map <code>m
+     *                           = new HashMap<Key, LazyStyle>()</code>
+     * @param model              The Synth Model we are writing out defaults class for
+     * @param variables          The variables map pre populated with "PACKAGE" and "LAF_NAME"
+     * @param packageNamePrefix  The package name associated with this synth look and feel. For example,
+     *                           org.mypackage.mylaf
+     * @param painterPackageRoot The directory to write painters out to
+     */
+    public static void generateDefaults(StringBuilder uiDefaultInit, StringBuilder styleInit, SynthModel model,
+                                        Map<String, String> variables, String packageNamePrefix,
+                                        File painterPackageRoot) {
+        // write color palette
+        uiDefaultInit.append("        //Color palette\n");
+        writeColorPalette(uiDefaultInit, model.getColorPalette());
+        uiDefaultInit.append("\n");
+        // write fonts palette
+        uiDefaultInit.append("        //Font palette\n");
+        uiDefaultInit.append("        d.put(\"defaultFont\", new FontUIResource(defaultFont));\n");
+        writeFontPalette(uiDefaultInit, model.getFontPalette());
+        uiDefaultInit.append("\n");
+        // TODO: Other palettes
+        uiDefaultInit.append("        //Border palette\n");
+        uiDefaultInit.append("\n");
+        // write global style
+        uiDefaultInit.append("        //The global style definition\n");
+        writeStyle(model.getStyle(), uiDefaultInit, "");
+        uiDefaultInit.append("\n");
+        // write components
+        for (UIComponent c : model.getComponents()) {
+            String prefix = escape(c.getKey());
+            uiDefaultInit.append("        //Initialize ").append(prefix)
+                    .append("\n");
+            writeRegion(c, c, prefix, uiDefaultInit,
+                    styleInit, variables, packageNamePrefix, painterPackageRoot);
+            uiDefaultInit.append("\n");
+        }
+    }
+
+    private static void writeColorPalette(StringBuilder uiDefaultInit, List<UIPaint> colors) {
+        for (UIPaint color : colors) {
+            uiDefaultInit.append("        d.put(\"")
+                    .append(color.getName())
+                    .append("\",")
+                    .append(convertPaint(color.getValue()))
+                    .append(");\n");
+        }
+    }
+
+    private static void writeFontPalette(StringBuilder uiDefaultInit, List<UIFont> fonts) {
+        for (UIFont font : fonts) {
+            // We have no way of doing CSS style font lists yet so will just
+            // just the first font
+            if (!font.getFonts().isEmpty()){
+                Typeface t = font.getFonts().get(0);
+                if (t.isAbsolute()){
+                    Font f = t.getFont();
+                    uiDefaultInit.append("        d.put(\"")
+                        .append(font.getName())
+                        .append("\", new javax.swing.plaf.FontUIResource(\"")
+                        .append(f.getName())
+                        .append("\", ")
+                        .append(f.getStyle())
+                        .append(", ")
+                        .append(f.getSize())
+                        .append("));\n");
+                } else {
+                    uiDefaultInit.append("        d.put(\"")
+                        .append(font.getName())
+                        .append("\", new DerivedFont(\"")
+                        .append(t.getUiDefaultParentName())
+                        .append("\", ")
+                        .append(t.getSizeOffset())
+                        .append("f, ");
+                    switch (t.getBold()){
+                        case Default:
+                            uiDefaultInit.append("null");
+                            break;
+                        case On:
+                            uiDefaultInit.append("true");
+                            break;
+                        case Off:
+                            uiDefaultInit.append("false");
+                            break;
+                    }
+                    uiDefaultInit.append(", ");
+                    switch (t.getItalic()){
+                        case Default:
+                            uiDefaultInit.append("null");
+                            break;
+                        case On:
+                            uiDefaultInit.append("true");
+                            break;
+                        case Off:
+                            uiDefaultInit.append("false");
+                            break;
+                    }
+                    uiDefaultInit.append("));\n");
+                }
+            }
+        }
+    }
+
+    /**
+     * Write out the UIDefaults entries for a style
+     *
+     * @param style         The style to write defaults entries for
+     * @param uiDefaultInit The buffer to write ui default put methods of the form <code>d.put("activeCaption", new
+     *                      ColorUIResource(123, 45, 200));</code>
+     * @param prefix        The prefix for the style property names, for the model path where the style is from, should
+     *                      end with a "."
+     */
+    private static void writeStyle(UIStyle style, StringBuilder uiDefaultInit, String prefix) {
+        if (!style.isTextForegroundInherited()) writeMatte(prefix + "textForeground", style.getTextForeground(), uiDefaultInit);
+        if (!style.isTextBackgroundInherited()) writeMatte(prefix + "textBackground", style.getTextBackground(), uiDefaultInit);
+        if (!style.isBackgroundInherited()) writeMatte(prefix + "background", style.getBackground(), uiDefaultInit);
+        if (!style.isFontInherited()) writeTypeFace(prefix + "font", style.getFont(), uiDefaultInit);
+        for (UIProperty property : style.getUiProperties()) {
+            switch (property.getType()) {
+                case BOOLEAN:
+                    Boolean b = ((Boolean)property.getValue());
+                    if (b != null) {
+                        uiDefaultInit.append("        d.put(\"")
+                                .append(prefix)
+                                .append(property.getName())
+                                .append("\", ")
+                                .append(b ? "Boolean.TRUE" : "Boolean.FALSE")
+                                .append(");\n");
+                    }
+                    break;
+                case STRING:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", \"")
+                            .append(property.getValue().toString())
+                            .append("\");\n");
+                    break;
+                case INT:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new Integer(")
+                            .append(((Integer) property.getValue()).intValue())
+                            .append("));\n");
+                    break;
+                case FLOAT:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new Float(")
+                            .append(((Float) property.getValue()).floatValue())
+                            .append("f));\n");
+                    break;
+                case DOUBLE:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new Double(")
+                            .append(((Double) property.getValue()).doubleValue())
+                            .append("));\n");
+                    break;
+                case COLOR:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", ")
+                            .append(convertPaint((Matte)property.getValue()))
+                            .append(");\n");
+                    break;
+                case FONT:
+                    writeTypeFace(prefix.replace("\"", "\\\"") + property.getName(),
+                            (Typeface) property.getValue(), uiDefaultInit);
+                    break;
+                case INSETS:
+                    Insets i = (Insets) property.getValue();
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new InsetsUIResource(")
+                            .append(i.top).append(", ").append(i.left).append(", ").append(i.bottom).append(", ")
+                            .append(i.right)
+                            .append("));\n");
+                    break;
+                case DIMENSION:
+                    Dimension d = (Dimension) property.getValue();
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new DimensionUIResource(")
+                            .append(d.width).append(", ").append(d.height)
+                            .append("));\n");
+                    break;
+                case BORDER:
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(property.getName())
+                            .append("\", new BorderUIResource(");
+                    uiDefaultInit.append(convertBorder(
+                            (Border)property.getValue()));
+                    uiDefaultInit.append("));\n");
+                    break;
+            }
+        }
+    }
+
+    private static void writeMatte(String propertyName, Matte matte, StringBuilder uiDefaultInit) {
+        if (matte==null) System.err.println("Error matte is NULL for ["+propertyName+"]");
+        uiDefaultInit.append("        d.put(\"")
+                    .append(propertyName)
+                    .append("\", ")
+                    .append(convertPaint(matte))
+                    .append(");\n");
+    }
+
+    private static void writeTypeFace(String propertyName, Typeface typeface, StringBuilder uiDefaultInit) {
+        uiDefaultInit.append("        d.put(\"")
+                .append(propertyName)
+                .append("\", new DerivedFont(\"")
+                .append(typeface.getUiDefaultParentName())
+                .append("\", ")
+                .append(typeface.getSizeOffset())
+                .append("f, ");
+        switch (typeface.getBold()) {
+            case Default:
+                uiDefaultInit.append("null,");
+                break;
+            case Off:
+                uiDefaultInit.append("Boolean.FALSE,");
+                break;
+            case On:
+                uiDefaultInit.append("Boolean.TRUE,");
+                break;
+        }
+        switch (typeface.getItalic()) {
+            case Default:
+                uiDefaultInit.append("null");
+                break;
+            case Off:
+                uiDefaultInit.append("Boolean.FALSE");
+                break;
+            case On:
+                uiDefaultInit.append("Boolean.TRUE");
+                break;
+        }
+        uiDefaultInit.append("));\n");
+    }
+
+
+    /**
+     * Write out code for a Component or Region
+     *
+     * @param comp               This may be the same as the region <code>reg</code> or is the parent component
+     *                           containing the region
+     * @param region             The region we are writing out
+     * @param prefix             This is dot sperated path of component and sub regions to and including the region
+     *                           <code>reg</code> of the form [Comp].[Region]......[Region] path
+     * @param uiDefaultInit      This is for inserting into org.mypackage.mylaf.MyDefaults#getDefaults() method
+     * @param styleInit          This is for inserting into org.mypackage.mylaf.MyDefaults#initialize() method
+     * @param variables          The variables map pre populated with "PACKAGE" and "LAF_NAME"
+     * @param packageNamePrefix  The package name associated with this synth look and feel. For example,
+     *                           org.mypackage.mylaf
+     * @param painterPackageRoot The directory to write painters out to
+     */
+    private static void writeRegion(UIComponent comp, UIRegion region, String prefix, StringBuilder uiDefaultInit,
+                                    StringBuilder styleInit, Map<String, String> variables,
+                                    String packageNamePrefix, File painterPackageRoot) {
+        // register component with LAF
+        String regionCode = GeneratorUtils.getRegionNameCaps(region.getName());
+        if (regionCode == null) {
+            throw new IllegalStateException("We were asked to encode a region we know nothing about: " + region.getName());
+        } else {
+            regionCode = "Region." + regionCode;
+        }
+
+        //construct the list of States that accompany this registration.
+        StringBuffer regString = new StringBuffer(); //like: Enabled,Disabled,Foo,Default,Etc
+        List<UIStateType> types = comp.getStateTypes(); //state types are only defined on the UIComponent level
+        if (types != null && types.size() > 0) {
+            for (UIStateType type : types) {
+                regString.append(type.getKey());
+                regString.append(",");
+            }
+            //remove the last ","
+            regString.deleteCharAt(regString.length()-1);
+        }
+
+        styleInit.append("        register(")
+                .append(regionCode)
+                .append(", \"")
+                .append(prefix);
+        styleInit.append("\"");
+        styleInit.append(");\n");
+
+        // write content margins
+        Insets i = (Insets) region.getContentMargins();
+        uiDefaultInit.append("        d.put(\"")
+                .append(prefix)
+                .append(".contentMargins")
+                .append("\", new InsetsUIResource(")
+                .append(i.top).append(", ").append(i.left).append(", ").append(i.bottom).append(", ").append(i.right)
+                .append("));\n");
+        // write opaque if true
+        if (region instanceof UIComponent && ((UIComponent)region).isOpaque()) {
+            uiDefaultInit.append("        d.put(\"")
+                    .append(prefix)
+                    .append(".opaque")
+                    .append("\", Boolean.TRUE);\n");
+        }
+        //write the State, if necessary
+        if (!regString.equals("Enabled,MouseOver,Pressed,Disabled,Focused,Selected,Default") && types.size() > 0) {
+            //there were either custom states, or the normal states were in a custom order
+            //so go ahead and write out prefix.State
+            uiDefaultInit.append("        d.put(\"")
+                    .append(prefix)
+                    .append(".States")
+                    .append("\", \"")
+                    .append(regString)
+                    .append("\");\n");
+        }
+        //write out any custom states, if necessary
+        for (UIStateType type : types) {
+            String synthState = type.getKey();
+            if (!"Enabled".equals(synthState) &&
+                !"MouseOver".equals(synthState) &&
+                !"Pressed".equals(synthState) &&
+                !"Disabled".equals(synthState) &&
+                !"Focused".equals(synthState) &&
+                !"Selected".equals(synthState) &&
+                !"Default".equals(synthState)) {
+                //what we have here, gentlemen, is a bona-fide custom state.
+                try {
+                    //if the type is not one of the standard types, then construct a name for
+                    //the new type, and write out a new subclass of State.
+                    java.lang.String className = makePretty(prefix) + synthState + "State";
+                    java.lang.String body = type.getCodeSnippet();
+                    variables.put("STATE_NAME", className);
+                    variables.put("STATE_KEY", synthState);
+                    variables.put("BODY", body);
+
+                    writeSrcFile(getStateTypeTemplate(), variables, new java.io.File(painterPackageRoot, className + ".java"));
+
+                    variables.remove("STATE_NAME");
+                    variables.remove("STATE_KEY");
+                    variables.remove("BODY");
+
+                    uiDefaultInit.append("        d.put(\"")
+                            .append(prefix)
+                            .append(".")
+                            .append(synthState)
+                            .append("\", new ")
+                            .append(className)
+                            .append("());\n");
+                } catch (IOException ex) {
+                    ex.printStackTrace();
+                }
+            }
+        }
+        // write region style
+        writeStyle(region.getStyle(), uiDefaultInit, prefix + ".");
+
+        try {
+            boolean hasCanvas = hasCanvas(region);
+            if (hasCanvas) {
+                PainterGenerator.writePainter(region, variables, painterPackageRoot, prefix);
+            }
+            String fileNamePrefix = makePretty(prefix) + "Painter";
+            // write states ui defaults
+            for (UIState state : region.getBackgroundStates()) {
+                String statePrefix = prefix + "[" + state.getName() + "]";
+                // write state style
+                writeStyle(state.getStyle(), uiDefaultInit, statePrefix + ".");
+                // write painter
+                if (hasCanvas) {
+                    writeLazyPainter(state, uiDefaultInit, statePrefix, packageNamePrefix, fileNamePrefix, "background");
+                }
+            }
+            for (UIState state : region.getForegroundStates()) {
+                String statePrefix = prefix + "[" + state.getName() + "]";
+                // write state style
+                writeStyle(state.getStyle(), uiDefaultInit, statePrefix + ".");
+                // write painter
+                if (hasCanvas) {
+                    writeLazyPainter(state, uiDefaultInit, statePrefix, packageNamePrefix, fileNamePrefix, "foreground");
+                }
+            }
+            for (UIState state : region.getBorderStates()) {
+                String statePrefix = prefix + "[" + state.getName() + "]";
+                // write state style
+                writeStyle(state.getStyle(), uiDefaultInit, statePrefix + ".");
+                // write painter
+                if (hasCanvas) {
+                    writeLazyPainter(state, uiDefaultInit, statePrefix, packageNamePrefix, fileNamePrefix, "border");
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        // handle sub regions
+        for (UIRegion subRegion : region.getSubRegions()) {
+            String subregionName = prefix + ":" + escape(subRegion.getKey());
+            if (subRegion instanceof UIIconRegion) {
+                writeIconRegion(comp, (UIIconRegion) subRegion, prefix, uiDefaultInit,
+                        variables, packageNamePrefix, painterPackageRoot);
+            } else if (subRegion instanceof UIComponent) {
+                // inner named component
+                UIComponent subComponent = (UIComponent) subRegion;
+                writeRegion(subComponent, subRegion, subregionName,
+                        uiDefaultInit, styleInit, variables, packageNamePrefix, painterPackageRoot);
+            } else {
+                writeRegion(comp, subRegion, subregionName, uiDefaultInit, styleInit, variables,
+                        packageNamePrefix, painterPackageRoot);
+            }
+        }
+    }
+
+    private static void writeLazyPainter(UIState state, StringBuilder uiDefaultInit, String statePrefix, String packageNamePrefix, String fileNamePrefix, String painterSuffix) {
+        Canvas canvas = state.getCanvas();
+        if (!canvas.isBlank()) {
+            Insets si = canvas.getStretchingInsets();
+            boolean inverted = state.isInverted();
+            UIStyle.CacheMode cache = state.getStyle().getCacheMode();
+            String cacheModeString = null;
+            switch (cache) {
+                case NO_CACHING: cacheModeString = "AbstractRegionPainter.PaintContext.CacheMode.NO_CACHING"; break;
+                case FIXED_SIZES: cacheModeString = "AbstractRegionPainter.PaintContext.CacheMode.FIXED_SIZES"; break;
+                case NINE_SQUARE_SCALE: cacheModeString = "AbstractRegionPainter.PaintContext.CacheMode.NINE_SQUARE_SCALE"; break;
+            }
+            double maxH = state.getStyle().getMaxHozCachedImgScaling();
+            double maxV = state.getStyle().getMaxVertCachedImgScaling();
+            String stateConstant = toConstantName(painterSuffix + "_" + UIState.keysToString(state.getStateKeys()));
+
+            uiDefaultInit.append("        d.put(\"")
+                    .append(statePrefix)
+                    .append(".").append(painterSuffix).append("Painter\", new LazyPainter(\"")
+                    .append(packageNamePrefix).append(".").append(fileNamePrefix)
+                    .append("\", ")
+                    .append(fileNamePrefix).append(".").append(stateConstant).append(", ")
+                    .append(convert(si)).append(", ")
+                    .append(convert(canvas.getSize())).append(", ")
+                    .append(inverted).append(", ")
+                    .append(cacheModeString).append(", ")
+                    .append(maxH == Double.POSITIVE_INFINITY ? "Double.POSITIVE_INFINITY" : maxH).append(", ")
+                    .append(maxV == Double.POSITIVE_INFINITY ? "Double.POSITIVE_INFINITY" : maxV).append("));\n");
+        }
+    }
+
+
+    /**
+     * Write out code for a IconRegion
+     *
+     * @param comp               This may be the same as the region <code>region</code> or is the parent component
+     *                           containing the region
+     * @param region             The region we are writing out
+     * @param prefix             This is [Comp][Region]......[Region] path
+     * @param key                The key for this icon.
+     * @param uiDefaultInit      This is for inserting into org.mypackage.mylaf.MyDefaults#getDefaults() method
+     * @param variables          The variables map pre populated with "PACKAGE" and "LAF_NAME"
+     * @param packageNamePrefix  The package name associated with this synth look and feel. For example,
+     *                           org.mypackage.mylaf
+     * @param painterPackageRoot The directory to write painters out to
+     */
+    private static void writeIconRegion(UIComponent comp, UIIconRegion region, String prefix,
+                                        StringBuilder uiDefaultInit, Map<String, String> variables,
+                                        String packageNamePrefix, File painterPackageRoot) {
+
+        Dimension size = null;
+        String fileNamePrefix = makePretty(prefix) + "Painter";
+        // write states ui defaults
+        for (UIState state : region.getBackgroundStates()) {// TODO: Handle Background,Foreground and Borders States Lists? Actually not sure that IconRegions need support borders or foregrounds
+            Canvas canvas = state.getCanvas();
+            if (!canvas.isBlank()) {
+                String statePrefix = prefix + "[" + state.getName() + "]";
+                // Put Painter in UiDefaults
+                writeLazyPainter(state, uiDefaultInit, statePrefix, packageNamePrefix, fileNamePrefix, region.getKey());
+                size = canvas.getSize();
+            }
+        }
+
+        if (size != null) {
+            // Put SynthIconImpl wrapper in UiDefaults
+            String key = region.getBasicKey() == null ? prefix + "." + region.getKey() : region.getBasicKey();
+            uiDefaultInit.append("        d.put(\"")
+                    .append(key)
+                    .append("\", new NimbusIcon(\"") //TODO should this be wrapped in an IconUIResource?
+                    .append(prefix)
+                    .append("\", \"")
+                    .append(region.getKey())
+                    .append("Painter")
+                    .append("\", ")
+                    .append(size.width)
+                    .append(", ")
+                    .append(size.height)
+                    .append("));\n");
+        }
+
+        // handle sub regions
+        if (region.getSubRegions().length > 0) {
+            // there is no meaning to a sub region inside a IconRegion
+            throw new IllegalStateException("You can not have sub regions inside UiIconRegions. \"" +
+                    comp.getSubRegions()[0].getName() + "\" is inside \""
+                    + prefix.substring(0, prefix.length() - 1) + "\"");
+        }
+    }
+
+    /**
+     * Utility method for escaping all double quotes with backslash double-quote.
+     */
+    private static String escape(String s) {
+        return s.replace("\"", "\\\"");
+    }
+
+    private static String convertPaint(PaintModel paint){
+        if (paint instanceof Matte){
+            Matte matte = (Matte)paint;
+            if (matte.isAbsolute()){
+                String colorParams = convert(matte.getColor());
+                if (matte.isUiResource()) {
+                    return "new ColorUIResource(" + colorParams + ")";
+                } else {
+                    return colorParams;
+                }
+            } else {
+                String s = "getDerivedColor(\"" +
+                            matte.getUiDefaultParentName()+"\","+
+                            matte.getHueOffset()+"f,"+matte.getSaturationOffset()+
+                            "f,"+matte.getBrightnessOffset()+"f,"+
+                            matte.getAlphaOffset();
+                if (matte.isUiResource()) {
+                    return s + ")";
+                } else {
+                    return s + ",false)";
+                }
+            }
+        } else {
+            //TODO: What about gradients etc here?
+            System.err.println("Error: Could not write paint in " +
+                    "DefaultsGenerator as it was not a Matte. = "+
+                    paint.getClass().getName());
+            return "";
+        }
+    }
+
+    private static String convertBorder(Border val) {
+        StringBuilder uiDefaultInit = new StringBuilder();
+        Insets i;
+        if (val instanceof PainterBorder) {
+            PainterBorder pb = (PainterBorder) val;
+            i = pb.getBorderInsets();
+            uiDefaultInit.append("new PainterBorder(\"")
+                    .append(pb.getPainterName())
+                    .append("\", new Insets(")
+                    .append(i.top).append(", ")
+                    .append(i.left).append(", ")
+                    .append(i.bottom).append(", ")
+                    .append(i.right)
+                    .append("))");
+        } else if (val instanceof EmptyBorder) {
+            i = ((EmptyBorder) val).getBorderInsets();
+            uiDefaultInit.append("BorderFactory.createEmptyBorder(")
+                    .append(i.top).append(", ")
+                    .append(i.left).append(", ")
+                    .append(i.bottom).append(", ")
+                    .append(i.right)
+                    .append(")");
+        } else if (val instanceof LineBorder) {
+            LineBorder border = (LineBorder) val;
+            uiDefaultInit.append("BorderFactory.createLineBorder(")
+                    .append(convert(border.getLineColor()))
+                    .append(",")
+                    .append(border.getThickness())
+                    .append(")");
+        } else if (val instanceof EtchedBorder) {
+            EtchedBorder border = (EtchedBorder) val;
+            uiDefaultInit.append("BorderFactory.createEtchedBorder(")
+                    .append(border.getEtchType())
+                    .append(",")
+                    .append(convert(border.getHighlightColor()))
+                    .append(",")
+                    .append(convert(border.getShadowColor()))
+                    .append(")");
+        } else if (val instanceof BevelBorder) {
+            BevelBorder border = (BevelBorder) val;
+            uiDefaultInit.append("BorderFactory.createEtchedBorder(")
+                    .append(border.getBevelType())
+                    .append(",")
+                    .append(convert(border.getHighlightOuterColor()))
+                    .append(",")
+                    .append(convert(border.getHighlightInnerColor()))
+                    .append(",")
+                    .append(convert(border.getShadowOuterColor()))
+                    .append(",")
+                    .append(convert(border.getShadowInnerColor()))
+                    .append(")");
+        } else if (val instanceof MatteBorder) {
+            MatteBorder border = (MatteBorder) val;
+            i = border.getBorderInsets();
+            uiDefaultInit.append("BorderFactory.createEmptyBorder(")
+                    .append(i.top).append(", ")
+                    .append(i.left).append(", ")
+                    .append(i.bottom).append(", ")
+                    .append(i.right).append(", ")
+                    .append(convert(border.getMatteColor()))
+                    .append(")");
+        } else if (val instanceof CompoundBorder) {
+            CompoundBorder border = (CompoundBorder) val;
+            uiDefaultInit.append("BorderFactory.createEmptyBorder(")
+                    .append(convertBorder(border.getOutsideBorder()))
+                    .append(",")
+                    .append(convertBorder(border.getInsideBorder()))
+                    .append(")");
+        }
+        return uiDefaultInit.toString();
+    }
+
+    private static boolean hasCanvas(UIRegion region) {
+        for (UIState s : region.getBackgroundStates()) {
+            if (!s.getCanvas().isBlank()) return true;
+        }
+        for (UIState s : region.getBorderStates()) {
+            if (!s.getCanvas().isBlank()) return true;
+        }
+        for (UIState s : region.getForegroundStates()) {
+            if (!s.getCanvas().isBlank()) return true;
+        }
+        for (UIRegion subregion : region.getSubRegions()) {
+            if (hasCanvas(subregion)) return true;
+        }
+        return false;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/Generator.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/Generator.java
new file mode 100644
index 0000000..6ab4b87
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/Generator.java
@@ -0,0 +1,289 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.read;
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.writeSrcFile;
+import org.jdesktop.synthdesigner.synthmodel.SynthModel;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Generates the various Java artifacts based on a SynthModel.
+ * <p/>
+ * Generated source files are split up among two different locations. There are those source files that are meant to be
+ * edited (generally, only the LookAndFeel class itself) and those that are autogenerated (everything else).
+ * <p/>
+ * All autogenerated files are placed in "buildPackageRoot" and are package private. A LAF author (one who has access to
+ * the generated sources) will be able to access any of the generated classes. Those referencing the library, however,
+ * will only be able to access the main LookAndFeel class itself (since everything else is package private).
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class Generator {
+    /** A map of variables that are used for variable substitution in the template files. */
+    private Map<String, String> variables;
+
+    private boolean full = false;
+    private File buildPackageRoot;
+    private File srcPackageRoot;
+    private String packageNamePrefix;
+    private String lafName;
+    private SynthModel model;
+
+    /**
+     * MAIN APPLICATION
+     * <p/>
+     * This is for using the generator as part of the java build process
+     *
+     * @param args The commandline arguments
+     */
+    public static void main(String[] args) {
+        if (args.length == 0 || (args.length % 2) != 0) {
+            System.out.println("Usage: generator [-options]\n" +
+                    "    -full <true|false>     True if we should build the whole LAF or false for building just states and painters.\n" +
+                    "    -skinFile <value>      Path to the skin.laf file for the LAF to be generated from.\n" +
+                    "    -buildDir <value>      The directory beneath which the build-controlled artifacts (such as the Painters) should\n" +
+                    "                           be placed. This is the root directory beneath which the necessary packages and source\n" +
+                    "                           files will be created.\n" +
+                    "    -srcDir <value>        The directory beneath which the normal user-controlled artifacts (such as the core\n" +
+                    "                           LookAndFeel file) should be placed. These are one-time generated files. This is the root\n" +
+                    "                           directory beneath which the necessary packages and source files will be created.\n" +
+                    "    -resourcesDir <value>  The resources directory containing templates and images.\n" +
+                    "    -packagePrefix <value> The package name associated with this synth look and feel. For example,\n" +
+                    "                           \"org.mypackage.mylaf\"\n" +
+                    "    -lafName <value>       The name of the laf, such as \"MyLAF\".\n");
+        } else {
+            boolean full = false;
+            File skinFile = new File(System.getProperty("user.dir"));
+            File buildDir = new File(System.getProperty("user.dir"));
+            File srcDir = new File(System.getProperty("user.dir"));
+            File resourcesDir = new File(System.getProperty("user.dir"));
+            String packagePrefix = "org.mypackage.mylaf";
+            String lafName = "MyLAF";
+            for (int i = 0; i < args.length; i += 2) {
+                String key = args[i].trim().toLowerCase();
+                String value = args[i + 1].trim();
+                if ("-full".equals(key)) {
+                    full = Boolean.parseBoolean(value);
+                } else if ("-skinfile".equals(key)) {
+                    skinFile = new File(value);
+                } else if ("-builddir".equals(key)) {
+                    buildDir = new File(value);
+                } else if ("-srcdir".equals(key)) {
+                    srcDir = new File(value);
+                } else if ("-resourcesdir".equals(key)) {
+                    resourcesDir = new File(value);
+                } else if ("-packageprefix".equals(key)) {
+                    packagePrefix = value;
+                } else if ("-lafname".equals(key)) {
+                    lafName = value;
+                }
+            }
+            System.out.println("### GENERATING LAF CODE ################################");
+            System.out.println("   full          :" + full);
+            System.out.println("   skinFile      :" + skinFile.getAbsolutePath());
+            System.out.println("   buildDir      :" + buildDir.getAbsolutePath());
+            System.out.println("   srcDir        :" + srcDir.getAbsolutePath());
+            System.out.println("   resourcesDir  :" + resourcesDir.getAbsolutePath());
+            System.out.println("   packagePrefix :" +packagePrefix);
+            System.out.println("   lafName       :" +lafName);
+            try {
+                // LOAD SKIN MODEL
+                IBindingFactory bindingFactory = BindingDirectory.getFactory(SynthModel.class);
+                IUnmarshallingContext mctx = bindingFactory.createUnmarshallingContext();
+                mctx.setDocument(new FileInputStream(skinFile), "UTF-8");
+                // pass resources directory in as user context so it can be used in SynthModel preSet
+                mctx.setUserContext(resourcesDir);
+                SynthModel model = (SynthModel) mctx.unmarshalElement();
+                // create and run generator
+                Generator generator = new Generator(full, buildDir, srcDir, packagePrefix, lafName, model);
+                generator.generate();
+            } catch (Exception e) {
+                System.err.println("Error loading skin and generating java src:");
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * Creates a new Generator, capable of outputting the source code artifacts related to a given SynthModel. It is
+     * capable of generating the one-time artifacts in addition to the regeneration of build-controlled artifacts.
+     *
+     * @param full              True if we should build the whole LAF or false for building just states and painters.
+     * @param buildDir          The directory beneath which the build-controlled artifacts (such as the Painters) should
+     *                          be placed. This is the root directory beneath which the necessary packages and source
+     *                          files will be created.
+     * @param srcDir            The directory beneath which the normal user-controlled artifacts (such as the core
+     *                          LookAndFeel file) should be placed. These are one-time generated files. This is the root
+     *                          directory beneath which the necessary packages and source files will be created.
+     * @param packageNamePrefix The package name associated with this synth look and feel. For example,
+     *                          org.mypackage.mylaf
+     * @param lafName           The name of the laf, such as MyLAF.
+     * @param model             The actual SynthModel to base these generated files on.
+     */
+    public Generator(boolean full, File buildDir, File srcDir, String packageNamePrefix, String lafName,
+                     SynthModel model) {
+        this.full = full;
+        //validate the input variables
+        if (packageNamePrefix == null) {
+            throw new IllegalArgumentException("You must specify a package name prefix");
+        }
+        if (buildDir == null) {
+            throw new IllegalArgumentException("You must specify the build directory");
+        }
+        if (srcDir == null) {
+            throw new IllegalArgumentException("You must specify the source directory");
+        }
+        if (model == null) {
+            throw new IllegalArgumentException("You must specify the SynthModel");
+        }
+        if (lafName == null) {
+            throw new IllegalArgumentException("You must specify the name of the look and feel");
+        }
+
+        //construct the map which is used to do variable substitution of the template
+        //files
+        variables = new HashMap<String, String>();
+        variables.put("PACKAGE", packageNamePrefix);
+        variables.put("LAF_NAME", lafName);
+
+        //generate and save references to the package-root directories.
+        //(That is, given the buildDir and srcDir, generate references to the
+        //org.mypackage.mylaf subdirectories)
+        buildPackageRoot = new File(buildDir, packageNamePrefix.replaceAll("\\.", "\\/"));
+        buildPackageRoot.mkdirs();
+        srcPackageRoot = new File(srcDir, packageNamePrefix.replaceAll("\\.", "\\/"));
+        srcPackageRoot.mkdirs();
+
+        //save the variables
+        this.packageNamePrefix = packageNamePrefix;
+        this.lafName = lafName;
+        this.model = model;
+    }
+
+    public void generate() {
+        //Generate the one-time files. If these files already exist, skip the
+        //ones that exist and create the missing ones. Register warnings for the
+        //already existing files.
+
+        //TODO Skip existing files, send warnings, etc.
+        if (full) {
+            try {
+                //create the LookAndFeel file
+                String template = read("resources/LookAndFeel.template");
+                writeSrcFile(template, variables, new File(srcPackageRoot, lafName + "LookAndFeel.java"));
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        //create the painters and such.
+        regenerate();
+    }
+
+    public void regenerate() {
+        try {
+            if (full) {
+                //first, create the AbstractRegionPainter.java file.
+                String template = read("resources/AbstractRegionPainter.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "AbstractRegionPainter.java"));
+
+                //write out BlendingMode.java
+                template = read("resources/BlendingMode.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "BlendingMode.java"));
+
+                //create the SynthPainterImpl class
+                template = read("resources/SynthPainterImpl.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "SynthPainterImpl.java"));
+
+                //create the IconImpl class
+                template = read("resources/IconImpl.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, lafName + "Icon.java"));
+
+                //create the StyleImpl class
+                template = read("resources/StyleImpl.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, lafName + "Style.java"));
+
+                //write out Effect.java
+                template = read("resources/Effect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "Effect.java"));
+
+                //write out EffectUtils.java
+                template = read("resources/EffectUtils.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "EffectUtils.java"));
+
+                //write out ShadowEffect.java
+                template = read("resources/ShadowEffect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "ShadowEffect.java"));
+
+                //write out DropShadowEffect.java
+                template = read("resources/DropShadowEffect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "DropShadowEffect.java"));
+
+                //write out InnerShadowEffect.java
+                template = read("resources/InnerShadowEffect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "InnerShadowEffect.java"));
+
+                //write out InnerGlowEffect.java
+                template = read("resources/InnerGlowEffect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "InnerGlowEffect.java"));
+
+                //write out OuterGlowEffect.java
+                template = read("resources/OuterGlowEffect.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "OuterGlowEffect.java"));
+
+                //write out State.java
+                template = read("resources/State.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "State.java"));
+
+                template = read("resources/ImageCache.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "ImageCache.java"));
+
+                template = read("resources/ImageScalingHelper.template");
+                writeSrcFile(template, variables, new File(buildPackageRoot, "ImageScalingHelper.java"));
+            }
+            //next, populate the first set of ui defaults based on what is in the
+            //various palettes of the synth model
+            StringBuilder uiDefaultInit = new StringBuilder();
+            StringBuilder styleInit = new StringBuilder();
+            DefaultsGenerator.generateDefaults(uiDefaultInit, styleInit, model, variables, packageNamePrefix,
+                    buildPackageRoot);
+            variables.put("UI_DEFAULT_INIT", uiDefaultInit.toString());
+            variables.put("STYLE_INIT", styleInit.toString());
+            writeSrcFile(read("resources/Defaults.template"), variables,
+                    new File(buildPackageRoot, lafName + "Defaults.java"));
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/GeneratorUtils.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/GeneratorUtils.java
new file mode 100644
index 0000000..0d0fb75
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/GeneratorUtils.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import javax.swing.plaf.synth.Region;
+import javax.swing.plaf.synth.SynthConstants;
+
+/**
+ * GeneratorUtils
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+class GeneratorUtils {
+    private GeneratorUtils() {}
+
+    /**
+     * Given a synth state, create the appropriate name as it would be used for a ui default key.
+     * <p/>
+     * For example:
+     * <p/>
+     * enabled enabled+over enabled+over+selected
+     */
+    static String toUIDefaultKey(int state) {
+        StringBuffer buffer = new StringBuffer();
+        if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
+            buffer.append("default");
+        }
+        if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("disabled");
+        }
+        if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("enabled");
+        }
+        if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("focused");
+        }
+        if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("over");
+        }
+        if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("down");
+        }
+        if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
+            if (buffer.length() > 0) buffer.append("+");
+            buffer.append("selected");
+        }
+        return buffer.toString();
+    }
+
+    //takes a states string of the form Enabled+Foo+Bar.
+    //removes any whitespace. Replaces the + signs with And.
+    static String toClassName(String states) {
+        String s = states.replace(" ", "");
+        s = states.replace("+", "And");
+        return s;
+    }
+
+    //takes a states string of the form Enabled+Foo+Bar.
+    //removes any whitespace. Replaces the + signs with _.
+    //capitalizes the whole lot
+    static String toConstantName(String states) {
+        String s = states.replace(" ", "");
+        s = states.replace("+", "_");
+        return s.toUpperCase();
+    }
+
+    /**
+     * Given a string "s" of the form:
+     *
+     * A.\"A.a\".B
+     *
+     * Make it such that:
+     *
+     * AAAB
+     *
+     * For example, ComboBox.\"ComboBox.arrowButton\" would become
+     * ComboBoxComboBoxArrowButton
+     *
+     * @param s
+     * @return
+     */
+    static String makePretty(String s) {
+        char[] src = s.toCharArray();
+        char[] dst = new char[src.length];
+        int dstIndex = 0;
+        for (int i=0; i<src.length; i++) {
+            //if the src char is a period and there is a following character,
+            //make sure the character is capitalized.
+            if ((src[i] == '.' || src[i] == ':') && i < src.length -1) {
+                src[i+1] = Character.toUpperCase(src[i+1]);
+                continue;
+            }
+            //if the src char is one that is to be removed, skip it.
+            if (src[i] == '.' || src[i] == ':' || src[i] == '\\' || src[i] == '"') {
+                continue;
+            }
+            //copy over the current char.
+            dst[dstIndex++] = src[i];
+        }
+        //at this point, dstIndex is 1 greater than the last valid index position in dst
+        //or in other words it represents the count.
+        return new String(dst, 0, dstIndex);
+    }
+
+    /**
+     * Encodes the given synth state as if it were specified in java code, such as
+     * <p/>
+     * SynthConstants.ENABLED | SynthConstants.MOUSE_OVER
+     */
+    static String toJavaList(int state) {
+        StringBuffer buffer = new StringBuffer();
+        if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
+            buffer.append("SynthConstants.DEFAULT");
+        }
+        if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.DISABLED");
+        }
+        if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.ENABLED");
+        }
+        if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.FOCUSED");
+        }
+        if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.MOUSE_OVER");
+        }
+        if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.PRESSED");
+        }
+        if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
+            if (buffer.length() > 0) buffer.append(" | ");
+            buffer.append("SynthConstants.SELECTED");
+        }
+        return buffer.toString();
+    }
+
+    /**
+     * Checks the given region name to discover if it is one of the standard synth regions. If so, return the name in
+     * caps and such. Otherwise, return a big fat null.
+     * <p/>
+     * I have to do this because, unfortunately, synth's Region doesn't implement equals.
+     */
+    static String getRegionNameCaps(String regionName) {
+        if (Region.ARROW_BUTTON.getName().equals(regionName)) {
+            return "ARROW_BUTTON";
+        } else if (Region.BUTTON.getName().equals(regionName)) {
+            return "BUTTON";
+        } else if (Region.CHECK_BOX.getName().equals(regionName)) {
+            return "CHECK_BOX";
+        } else if (Region.CHECK_BOX_MENU_ITEM.getName().equals(regionName)) {
+            return "CHECK_BOX_MENU_ITEM";
+        } else if (Region.COLOR_CHOOSER.getName().equals(regionName)) {
+            return "COLOR_CHOOSER";
+        } else if (Region.COMBO_BOX.getName().equals(regionName)) {
+            return "COMBO_BOX";
+        } else if (Region.DESKTOP_ICON.getName().equals(regionName)) {
+            return "DESKTOP_ICON";
+        } else if (Region.DESKTOP_PANE.getName().equals(regionName)) {
+            return "DESKTOP_PANE";
+        } else if (Region.EDITOR_PANE.getName().equals(regionName)) {
+            return "EDITOR_PANE";
+        } else if (Region.FILE_CHOOSER.getName().equals(regionName)) {
+            return "FILE_CHOOSER";
+        } else if (Region.FORMATTED_TEXT_FIELD.getName().equals(regionName)) {
+            return "FORMATTED_TEXT_FIELD";
+        } else if (Region.INTERNAL_FRAME.getName().equals(regionName)) {
+            return "INTERNAL_FRAME";
+        } else if (Region.INTERNAL_FRAME_TITLE_PANE.getName().equals(regionName)) {
+            return "INTERNAL_FRAME_TITLE_PANE";
+        } else if (Region.LABEL.getName().equals(regionName)) {
+            return "LABEL";
+        } else if (Region.LIST.getName().equals(regionName)) {
+            return "LIST";
+        } else if (Region.MENU.getName().equals(regionName)) {
+            return "MENU";
+        } else if (Region.MENU_BAR.getName().equals(regionName)) {
+            return "MENU_BAR";
+        } else if (Region.MENU_ITEM.getName().equals(regionName)) {
+            return "MENU_ITEM";
+        } else if (Region.MENU_ITEM_ACCELERATOR.getName().equals(regionName)) {
+            return "MENU_ITEM_ACCELERATOR";
+        } else if (Region.OPTION_PANE.getName().equals(regionName)) {
+            return "OPTION_PANE";
+        } else if (Region.PANEL.getName().equals(regionName)) {
+            return "PANEL";
+        } else if (Region.PASSWORD_FIELD.getName().equals(regionName)) {
+            return "PASSWORD_FIELD";
+        } else if (Region.POPUP_MENU.getName().equals(regionName)) {
+            return "POPUP_MENU";
+        } else if (Region.POPUP_MENU_SEPARATOR.getName().equals(regionName)) {
+            return "POPUP_MENU_SEPARATOR";
+        } else if (Region.PROGRESS_BAR.getName().equals(regionName)) {
+            return "PROGRESS_BAR";
+        } else if (Region.RADIO_BUTTON.getName().equals(regionName)) {
+            return "RADIO_BUTTON";
+        } else if (Region.RADIO_BUTTON_MENU_ITEM.getName().equals(regionName)) {
+            return "RADIO_BUTTON_MENU_ITEM";
+        } else if (Region.ROOT_PANE.getName().equals(regionName)) {
+            return "ROOT_PANE";
+        } else if (Region.SCROLL_BAR.getName().equals(regionName)) {
+            return "SCROLL_BAR";
+        } else if (Region.SCROLL_BAR_THUMB.getName().equals(regionName)) {
+            return "SCROLL_BAR_THUMB";
+        } else if (Region.SCROLL_BAR_TRACK.getName().equals(regionName)) {
+            return "SCROLL_BAR_TRACK";
+        } else if (Region.SCROLL_PANE.getName().equals(regionName)) {
+            return "SCROLL_PANE";
+        } else if (Region.SEPARATOR.getName().equals(regionName)) {
+            return "SEPARATOR";
+        } else if (Region.SLIDER.getName().equals(regionName)) {
+            return "SLIDER";
+        } else if (Region.SLIDER_THUMB.getName().equals(regionName)) {
+            return "SLIDER_THUMB";
+        } else if (Region.SLIDER_TRACK.getName().equals(regionName)) {
+            return "SLIDER_TRACK";
+        } else if (Region.SPINNER.getName().equals(regionName)) {
+            return "SPINNER";
+        } else if (Region.SPLIT_PANE.getName().equals(regionName)) {
+            return "SPLIT_PANE";
+        } else if (Region.SPLIT_PANE_DIVIDER.getName().equals(regionName)) {
+            return "SPLIT_PANE_DIVIDER";
+        } else if (Region.TABBED_PANE.getName().equals(regionName)) {
+            return "TABBED_PANE";
+        } else if (Region.TABBED_PANE_CONTENT.getName().equals(regionName)) {
+            return "TABBED_PANE_CONTENT";
+        } else if (Region.TABBED_PANE_TAB.getName().equals(regionName)) {
+            return "TABBED_PANE_TAB";
+        } else if (Region.TABBED_PANE_TAB_AREA.getName().equals(regionName)) {
+            return "TABBED_PANE_TAB_AREA";
+        } else if (Region.TABLE.getName().equals(regionName)) {
+            return "TABLE";
+        } else if (Region.TABLE_HEADER.getName().equals(regionName)) {
+            return "TABLE_HEADER";
+        } else if (Region.TEXT_AREA.getName().equals(regionName)) {
+            return "TEXT_AREA";
+        } else if (Region.TEXT_FIELD.getName().equals(regionName)) {
+            return "TEXT_FIELD";
+        } else if (Region.TEXT_PANE.getName().equals(regionName)) {
+            return "TEXT_PANE";
+        } else if (Region.TOGGLE_BUTTON.getName().equals(regionName)) {
+            return "TOGGLE_BUTTON";
+        } else if (Region.TOOL_BAR.getName().equals(regionName)) {
+            return "TOOL_BAR";
+        } else if (Region.TOOL_BAR_CONTENT.getName().equals(regionName)) {
+            return "TOOL_BAR_CONTENT";
+        } else if (Region.TOOL_BAR_DRAG_WINDOW.getName().equals(regionName)) {
+            return "TOOL_BAR_DRAG_WINDOW";
+        } else if (Region.TOOL_BAR_SEPARATOR.getName().equals(regionName)) {
+            return "TOOL_BAR_SEPARATOR";
+        } else if (Region.TOOL_TIP.getName().equals(regionName)) {
+            return "TOOL_TIP";
+        } else if (Region.TREE.getName().equals(regionName)) {
+            return "TREE";
+        } else if (Region.TREE_CELL.getName().equals(regionName)) {
+            return "TREE_CELL";
+        } else if (Region.VIEWPORT.getName().equals(regionName)) {
+            return "VIEWPORT";
+        }
+        System.err.println("[Info] Couldn't find a Region for " + regionName);
+        return null;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/ObjectCodeConvertors.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/ObjectCodeConvertors.java
new file mode 100644
index 0000000..88b1e9b
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/ObjectCodeConvertors.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import java.awt.*;
+
+/**
+ * ObjectCodeConvertors
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class ObjectCodeConvertors {
+    static java.math.MathContext ctx = new java.math.MathContext(3);
+
+    /**
+     * Given a value (x), encode it such that 0 -> 1 is to the left of a, 1 -> 2 is between a and b, and 2 -> 3
+     * is to the right of b.
+     *
+     * @param w width in the case of the x axis, height in the case of the y axis.
+     */
+    static float encode(float x, float a, float b, float w) {
+        float r = 0;
+        if (x < a) {
+            r = (x / a);
+        } else if (x > b) {
+            r = 2 + ((x - b) / (w - b));
+        } else if (x == a && x == b) {
+            return 1.5f;
+        } else {
+            r = 1 + ((x - a) / (b - a));
+        }
+
+        if (Float.isNaN(r)) {
+            System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            return 0;
+        } else if (Float.isInfinite(r)) {
+            System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            return 0;
+        } else if (r < 0) {
+            System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            return 0;
+        } else if (r > 3) {
+            System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")");
+            return 3;
+        } else {
+            //for prettyness sake (and since we aren't really going to miss
+            //any accuracy here) I'm rounding this to 3 decimal places
+//                return java.math.BigDecimal.valueOf(r).round(ctx).doubleValue();
+            return r;
+        }
+    }
+
+    static String convert(Paint paint) {
+        //TODO need to support writing out other Paints, such as gradients
+        if (paint instanceof Color) {
+            return convert((Color) paint);
+        } else {
+            System.err.println("[WARNING] Unable to encode a paint in the encode(Paint) method: " + paint);
+            return "null";
+        }
+    }
+
+    /**
+     * Given a Color, write out the java code required to create a new Color.
+     *
+     * @param color The color to convert
+     * @return String of the code for the color
+     */
+    static String convert(Color color) {
+        return "new Color(" +
+                color.getRed() + ", " +
+                color.getGreen() + ", " +
+                color.getBlue() + ", " +
+                color.getAlpha() + ")";
+    }
+
+    static String convert(Insets i) {
+        return "new Insets(" + i.top + ", " + i.left + ", " + i.bottom + ", " + i.right + ")";
+    }
+
+    static String convert(Dimension d) {
+        return "new Dimension(" + d.width + ", " + d.height + ")";
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/PainterGenerator.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/PainterGenerator.java
new file mode 100644
index 0000000..781fb21
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/PainterGenerator.java
@@ -0,0 +1,758 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import org.jdesktop.swingx.designer.BezierControlPoint;
+import org.jdesktop.swingx.designer.Canvas;
+import org.jdesktop.swingx.designer.EllipseShape;
+import org.jdesktop.swingx.designer.Layer;
+import org.jdesktop.swingx.designer.PaintedShape;
+import org.jdesktop.swingx.designer.PathShape;
+import org.jdesktop.swingx.designer.RectangleShape;
+import org.jdesktop.swingx.designer.SimpleShape;
+import org.jdesktop.swingx.designer.TemplateLayer;
+import org.jdesktop.swingx.designer.paint.Gradient;
+import org.jdesktop.swingx.designer.paint.Matte;
+import org.jdesktop.swingx.designer.paint.PaintModel;
+import org.jdesktop.swingx.designer.paint.RadialGradient;
+import org.jdesktop.swingx.designer.paint.GradientStop;
+import org.jdesktop.swingx.designer.paint.AbstractGradient;
+import static org.jdesktop.synthdesigner.generator.GeneratorUtils.makePretty;
+import static org.jdesktop.synthdesigner.generator.GeneratorUtils.toClassName;
+import static org.jdesktop.synthdesigner.generator.GeneratorUtils.toConstantName;
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.read;
+import static org.jdesktop.synthdesigner.generator.TemplateWriter.writeSrcFile;
+import org.jdesktop.synthdesigner.synthmodel.UIIconRegion;
+import org.jdesktop.synthdesigner.synthmodel.UIRegion;
+import org.jdesktop.synthdesigner.synthmodel.UIState;
+
+import java.awt.*;
+import java.awt.geom.Point2D;
+import java.beans.Beans;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
+import javax.swing.JList;
+import javax.swing.JTable;
+import javax.swing.text.JTextComponent;
+
+/**
+ * PainterGenerator - Class for generating Painter class java source from a Canvas
+ *
+ * Following in the general theory that is used to generate a Painter file.
+ *
+ * Each Painter file represents a Region. So there is one painter file per region. In
+ * skin.laf we support Icon subregions, which are really just hacked versions of the
+ * parent region.
+ *
+ * In order to generate the most compact and efficient bytecode possible for the
+ * Painters, we actually perform the generation sequence in two steps. The first
+ * step is the analysis phase, where we walk through the SynthModel for the region
+ * and discover commonality among the different states in the region. For example,
+ * do they have common paths? Do they have common colors? Gradients? Is the painting
+ * code for the different states identical other than for colors?
+ *
+ * We gather this information up. On the second pass, we use this data to determine the
+ * methods that need to be generated, and the class variables that need to be generated.
+ * We try to keep the actual bytecode count as small as possible so that we may reduce
+ * the overall size of the look and feel significantly.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class PainterGenerator {
+    private static String painterImplTemplate;
+    private static String getPainterImplTemplate() {
+        if (painterImplTemplate == null) {
+            //load the painter template file into an in-memory string to improve performance
+            //when generating a lot of classes
+            try {
+                painterImplTemplate = read("resources/PainterImpl.template");
+            } catch (IOException e) {
+                System.err.println("Failed to read template files.");
+                throw new RuntimeException(e);
+            }
+        }
+        return painterImplTemplate;
+    }
+
+
+    //a handful of counters, incremented whenever the associated object type is encounted.
+    //These counters form the basis of the field and method suffixes.
+    //These are all 1 based, because I felt like it :-)
+    private int colorCounter = 1;
+    private int gradientCounter = 1;
+    private int radialCounter = 1;
+    private int pathCounter = 1;
+    private int rectCounter = 1;
+    private int roundRectCounter = 1;
+    private int ellipseCounter = 1;
+
+    private int stateTypeCounter = 1;
+
+    //during the first pass, we will construct these maps
+    private Map<String, String> colors = new HashMap<String, String>();
+    /**
+     * Code=>method name.
+     */
+    private Map<String, String> methods = new HashMap<String, String>();
+
+    //these variables hold the generated code
+    /**
+     * The source code in this variable will be used to define the various state types
+     */
+    private StringBuilder stateTypeCode = new StringBuilder();
+    /**
+     * The source code in this variable will be used to define the switch statement for painting
+     */
+    private StringBuilder switchCode = new StringBuilder();
+    /**
+     * The source code in this variable will be used to define the methods for painting each state
+     */
+    private StringBuilder paintingCode = new StringBuilder();
+    /**
+     * The source code in this variable will be used to add getExtendedCacheKeys
+     * implementation if needed.
+     */
+    private StringBuilder getExtendedCacheKeysCode = new StringBuilder();
+    /**
+     * The source code in this variable will be used to define the methods for decoding gradients
+     * and shapes.
+     */
+    private StringBuilder gradientsCode = new StringBuilder();
+    private StringBuilder colorCode = new StringBuilder();
+    private StringBuilder shapesCode = new StringBuilder();
+    /**
+     * Map of component colors keyed by state constant name
+     */
+    private Map<String, List<ComponentColor>> componentColorsMap =
+            new LinkedHashMap<String, List<ComponentColor>>();
+    /**
+     * For the current state the list of all component colors used by this
+     * painter, the index in this list is also the index in the runtime array
+     * of defaults and keys.
+     */
+    private List<ComponentColor> componentColors = null;
+
+    PainterGenerator(UIRegion r) {
+        generate(r);
+    }
+
+    private void generate(UIRegion r) {
+        for (UIState state : r.getBackgroundStates()) {
+            System.out.println("------>" + state.getName());
+
+            Canvas canvas = state.getCanvas();
+            String type = r instanceof UIIconRegion ? ((UIIconRegion)r).getKey() : "Background";
+            generate(state, canvas, type);
+        }
+        for (UIState state : r.getForegroundStates()) {
+            Canvas canvas = state.getCanvas();
+            generate(state, canvas, "Foreground");
+        }
+        for (UIState state : r.getBorderStates()) {
+            Canvas canvas = state.getCanvas();
+            generate(state, canvas, "Border");
+        }
+        //now check for any uiIconRegions, since these are collapsed together.
+        for (UIRegion sub : r.getSubRegions()) {
+            if (sub instanceof UIIconRegion) {
+                generate(sub);
+            }
+        }
+        //generate all the code for component colors
+        if (!componentColorsMap.isEmpty()) {
+            getExtendedCacheKeysCode
+                    .append("    protected Object[] getExtendedCacheKeys(JComponent c) {\n")
+                    .append("        Object[] extendedCacheKeys = null;\n")
+                    .append("        switch(state) {\n");
+            for (Map.Entry<String, List<ComponentColor>> entry : componentColorsMap.entrySet()) {
+                getExtendedCacheKeysCode
+                    .append("            case ")
+                    .append(entry.getKey()).append(":\n")
+                    .append("                extendedCacheKeys = new Object[] {\n");
+                for (int i=0; i<entry.getValue().size(); i++) {
+                    ComponentColor cc = entry.getValue().get(i);
+                    getExtendedCacheKeysCode
+                    .append("                     getComponentColor(c, \"")
+                    .append(cc.propertyName).append("\", ")
+                    .append(cc.defaultColorVariableName).append(", ")
+                    .append(cc.saturationOffset).append("f, ")
+                    .append(cc.brightnessOffset).append("f, ")
+                    .append(cc.alphaOffset);
+                    if (i + 1 < entry.getValue().size()) {
+                        getExtendedCacheKeysCode.append("),\n");
+                    } else {
+                        getExtendedCacheKeysCode.append(")");
+                    }
+                }
+                getExtendedCacheKeysCode.append("};\n")
+                    .append("                break;\n");
+            }
+            getExtendedCacheKeysCode
+                    .append("        }\n")
+                    .append("        return extendedCacheKeys;\n")
+                    .append("    }");
+        }
+    }
+
+    //type is background, foreground, border, upArrowIcon, etc.
+    private void generate(UIState state, Canvas canvas, String type) {
+        String states = UIState.keysToString(state.getStateKeys());
+        String stateType = toConstantName(type + "_" + states);
+        String paintMethodName = "paint" + type + toClassName(states);
+        //create new array for component colors for this state
+        componentColors = new ArrayList<ComponentColor>();
+
+        stateTypeCode.append("    static final int ").append(stateType).append(" = ").append(stateTypeCounter++).append(";\n");
+
+        if (canvas.isBlank()) {
+            return;
+        }
+
+        switchCode.append("            case ").append(stateType).append(": ").append(paintMethodName).append("(g); break;\n");
+        paintingCode.append("    private void ").append(paintMethodName).append("(Graphics2D g) {\n");
+
+        //start by setting up common info needed to encode the control points
+        Insets in = canvas.getStretchingInsets();
+        float a = in.left;
+        float b = canvas.getSize().width - in.right;
+        float c = in.top;
+        float d = canvas.getSize().height - in.bottom;
+        float width = canvas.getSize().width;
+        float height = canvas.getSize().height;
+        float cw = b - a;
+        float ch = d - c;
+
+        Layer[] layers = canvas.getLayers().toArray(new Layer[0]);
+        for (int index=layers.length-1; index >= 0; index--) {
+            Layer layer = layers[index];
+            if (layer instanceof TemplateLayer) {
+                continue;
+            }
+            //shapes must be painted in reverse order
+            List<SimpleShape> shapes = layer.getShapes();
+            for (int i=shapes.size()-1; i>=0; i--) {
+                SimpleShape s = shapes.get(i);
+                if (s instanceof PaintedShape) {
+                    PaintedShape shape = (PaintedShape)s;
+                    PaintModel paint = shape.getPaintModel();
+
+                    /*
+                        We attempt to write the minimal number of bytecodes as possible when
+                        generating code. Due to the inherit complexities in determining what
+                        is extraneous, we use the following system:
+
+                        We first generate the code for the shape. Then, we check to see if
+                        this shape has already been generated. If so, then we defer to an
+                        existing method. If not, then we will create a new methods, stick
+                        the code in it, and refer to that method.
+                    */
+
+                    String shapeMethodName = null; // will contain the name of the method which creates the shape
+                    String shapeVariable = null; // will be one of rect, roundRect, ellipse, or path.
+                    String shapeMethodBody = null;
+
+                    if (shape instanceof RectangleShape) {
+                        RectangleShape rshape = (RectangleShape) shape;
+                        float x1 = encode((float)rshape.getX1(), a, b, width);
+                        float y1 = encode((float)rshape.getY1(), c, d, height);
+                        float x2 = encode((float)rshape.getX2(), a, b, width);
+                        float y2 = encode((float)rshape.getY2(), c, d, height);
+                        if (rshape.isRounded()) {
+                            //it is a rounded rectangle
+                            float rounding = (float)rshape.getRounding();
+
+                            shapeMethodBody =
+                                    "        roundRect.setRoundRect(" +
+                                    writeDecodeX(x1) + ", //x\n" +
+                                    "                               " + writeDecodeY(y1) + ", //y\n" +
+                                    "                               " + writeDecodeX(x2) + " - " + writeDecodeX(x1) + ", //width\n" +
+                                    "                               " + writeDecodeY(y2) + " - " + writeDecodeY(y1) + ", //height\n" +
+                                    "                               " + rounding + "f, " + rounding + "f); //rounding";
+                            shapeVariable = "roundRect";
+                        } else {
+                            shapeMethodBody =
+                                    "            rect.setRect(" +
+                                    writeDecodeX(x1) + ", //x\n" +
+                                    "                         " + writeDecodeY(y1) + ", //y\n" +
+                                    "                         " + writeDecodeX(x2) + " - " + writeDecodeX(x1) + ", //width\n" +
+                                    "                         " + writeDecodeY(y2) + " - " + writeDecodeY(y1) + "); //height";
+                            shapeVariable = "rect";
+                        }
+                    } else if (shape instanceof EllipseShape) {
+                        EllipseShape eshape = (EllipseShape) shape;
+                        float x1 = encode((float)eshape.getX1(), a, b, width);
+                        float y1 = encode((float)eshape.getY1(), c, d, height);
+                        float x2 = encode((float)eshape.getX2(), a, b, width);
+                        float y2 = encode((float)eshape.getY2(), c, d, height);
+                        shapeMethodBody =
+                                "        ellipse.setFrame(" +
+                                writeDecodeX(x1) + ", //x\n" +
+                                "                         " + writeDecodeY(y1) + ", //y\n" +
+                                "                         " + writeDecodeX(x2) + " - " + writeDecodeX(x1) + ", //width\n" +
+                                "                         " + writeDecodeY(y2) + " - " + writeDecodeY(y1) + "); //height";
+                        shapeVariable = "ellipse";
+                    } else if (shape instanceof PathShape) {
+                        PathShape pshape = (PathShape) shape;
+                        List<BezierControlPoint> controlPoints = pshape.getBezierControlPoints();
+                        BezierControlPoint first, last;
+                        first = last = controlPoints.get(0);
+                        StringBuilder buffer = new StringBuilder();
+                        buffer.append("        path.reset();\n");
+                        buffer.append("        path.moveTo(" + writeDecodeX(encode((float)first.getX(), a, b, width)) + ", " + writeDecodeY(encode((float)first.getY(), c, d, height)) + ");\n");
+                        for (int j=1; j<controlPoints.size(); j++) {
+                            BezierControlPoint cp = controlPoints.get(j);
+                            if (last.getCp2().isSharp() && cp.getCp1().isSharp()) {
+                                float x = encode((float)cp.getX(), a, b, width);
+                                float y = encode((float)cp.getY(), c, d, height);
+                                buffer.append("        path.lineTo(" + writeDecodeX(x) + ", " + writeDecodeY(y) + ");\n");
+                            } else {
+                                float x1 = encode((float)last.getX(), a, b, width);
+                                float y1 = encode((float)last.getY(), c, d, height);
+                                float x2 = encode((float)cp.getX(), a, b, width);
+                                float y2 = encode((float)cp.getY(), c, d, height);
+                                buffer.append(
+                                        "        path.curveTo(" + writeDecodeBezierX(x1, last.getX(), last.getCp2X()) + ", "
+                                                                + writeDecodeBezierY(y1, last.getY(), last.getCp2Y()) + ", "
+                                                                + writeDecodeBezierX(x2, cp.getX(), cp.getCp1X()) + ", "
+                                                                + writeDecodeBezierY(y2, cp.getY(), cp.getCp1Y()) + ", "
+                                                                + writeDecodeX(x2) + ", " + writeDecodeY(y2) + ");\n");
+                            }
+                            last = cp;
+                        }
+                        if (last.getCp2().isSharp() && first.getCp1().isSharp()) {
+                            float x = encode((float)first.getX(), a, b, width);
+                            float y = encode((float)first.getY(), c, d, height);
+                            buffer.append("        path.lineTo(" + writeDecodeX(x) + ", " + writeDecodeY(y) + ");\n");
+                        } else {
+                            float x1 = encode((float)last.getX(), a, b, width);
+                            float y1 = encode((float)last.getY(), c, d, height);
+                            float x2 = encode((float)first.getX(), a, b, width);
+                            float y2 = encode((float)first.getY(), c, d, height);
+                            buffer.append(
+                                    "        path.curveTo(" + writeDecodeBezierX(x1, last.getX(), last.getCp2X()) + ", "
+                                                            + writeDecodeBezierY(y1, last.getY(), last.getCp2Y()) + ", "
+                                                            + writeDecodeBezierX(x2, first.getX(), first.getCp1X()) + ", "
+                                                            + writeDecodeBezierY(y2, first.getY(), first.getCp1Y()) + ", "
+                                                            + writeDecodeX(x2) + ", " + writeDecodeY(y2) + ");\n");
+                        }
+                        buffer.append("        path.closePath();");
+                        shapeMethodBody = buffer.toString();
+                        shapeVariable = "path";
+                    } else {
+                        throw new RuntimeException("Cannot happen unless a new Shape has been defined");
+                    }
+
+                    //now that we have the shape defined in shapeMethodBody, and a shapeVariable name,
+                    //look to see if such a body has been previously defined.
+                    shapeMethodName = methods.get(shapeMethodBody);
+                    String returnType = null;
+                    if (shapeMethodName == null) {
+                        if ("rect".equals(shapeVariable)) {
+                            shapeMethodName = "decodeRect" + rectCounter++;
+                            returnType = "Rectangle2D";
+                        } else if ("roundRect".equals(shapeVariable)) {
+                            shapeMethodName = "decodeRoundRect" + roundRectCounter++;
+                            returnType = "RoundRectangle2D";
+                        } else if ("ellipse".equals(shapeVariable)) {
+                            shapeMethodName = "decodeEllipse" + ellipseCounter++;
+                            returnType = "Ellipse2D";
+                        } else {
+                            shapeMethodName = "decodePath" + pathCounter++;
+                            returnType = "Path2D";
+                        }
+                        methods.put(shapeMethodBody, shapeMethodName);
+
+                        //since the method wasn't previously defined, time to define it
+                        shapesCode.append("    private ").append(returnType).append(" ").append(shapeMethodName).append("() {\n");
+                        shapesCode.append(shapeMethodBody);
+                        shapesCode.append("\n");
+                        shapesCode.append("        return " + shapeVariable + ";\n");
+                        shapesCode.append("    }\n\n");
+                    }
+
+                    //now that the method has been defined, I can go on and decode the
+                    //paint. After the paint is decoded, I can write the g.fill() method call,
+                    //using the result of the shapeMethodName. Yay!
+
+//            if (shapeVariable != null) {
+                //first, calculate the bounds of the shape being painted and store in variables
+                    paintingCode.append("        ").append(shapeVariable).append(" = ").append(shapeMethodName).append("();\n");
+
+                    if (paint instanceof Matte) {
+                        String colorVariable = encodeMatte((Matte)paint);
+                        paintingCode.append("        g.setPaint(").append(colorVariable).append(");\n");
+                    } else if (paint instanceof Gradient) {
+                        String gradientMethodName = encodeGradient(shape, (Gradient)paint);
+                        paintingCode.append("        g.setPaint(").append(gradientMethodName).append("(").append(shapeVariable).append("));\n");
+                    } else if (paint instanceof RadialGradient) {
+                        String radialMethodName = encodeRadial(shape, (RadialGradient)paint);
+                        paintingCode.append("        g.setPaint(").append(radialMethodName).append("(").append(shapeVariable).append("));\n");
+                    }
+                    paintingCode.append("        g.fill(").append(shapeVariable).append(");\n");
+                }
+            }
+        }
+
+        paintingCode.append("\n    }\n\n");
+
+        //collect component colors
+        if (!componentColors.isEmpty()) {
+            componentColorsMap.put(stateType, componentColors);
+            componentColors = null;
+        }
+    }
+
+    private float encode(float x, float a, float b, float width) {
+        return ObjectCodeConvertors.encode(x, a, b, width);
+    }
+
+    private String writeDecodeX(float encodedX) {
+        return "decodeX(" + encodedX + "f)";
+    }
+
+    private String writeDecodeY(float encodedY) {
+        return "decodeY(" + encodedY + "f)";
+    }
+
+    /**
+     *
+     * @param ex encoded x value
+     * @param x unencoded x value
+     * @param cpx unencoded cpx value
+     * @return
+     */
+    private static String writeDecodeBezierX(double ex, double x, double cpx) {
+        return "decodeAnchorX(" + ex + "f, " + (cpx - x) + "f)";
+    }
+
+    /**
+     *
+     * @param ey encoded y value
+     * @param y unencoded y value
+     * @param cpy unencoded cpy value
+     * @return
+     */
+    private static String writeDecodeBezierY(double ey, double y, double cpy) {
+        return "decodeAnchorY(" + ey + "f, " + (cpy - y) + "f)";
+    }
+
+    private String encodeMatte(Matte m) {
+        String declaration = null;
+        if (m.isAbsolute()) {
+            Color c = m.getColor();
+            declaration = ObjectCodeConvertors.convert(c);
+        } else {
+            declaration = "decodeColor(\"" + m.getUiDefaultParentName() +
+                          "\", " + m.getHueOffset() + "f, " +
+                          m.getSaturationOffset() + "f, " +
+                          m.getBrightnessOffset() + "f, " +
+                          m.getAlphaOffset() + ")";
+        }
+
+        String variableName = colors.get(declaration);
+        if (variableName == null) {
+            variableName = "color" + colorCounter++;
+            colors.put(declaration, variableName);
+            colorCode.append("    private Color ").append(variableName).append(" = ");
+            colorCode.append(declaration).append(";\n");
+        }
+        // handle component colors
+        if (m.getComponentPropertyName() != null) {
+            ComponentColor cc = new ComponentColor(m.getComponentPropertyName(),
+                    variableName, m.getSaturationOffset(),
+                    m.getBrightnessOffset(), m.getAlphaOffset());
+            int index = componentColors.indexOf(cc);
+            if (index == -1) {
+                index = componentColors.size();
+                componentColors.add(cc);
+            }
+            return "(Color)componentColors[" + index + "]";
+        } else {
+            return variableName;
+        }
+    }
+
+    private String encodeColor(Color c) {
+        String declaration = ObjectCodeConvertors.convert(c);
+        String variableName = colors.get(declaration);
+        if (variableName == null) {
+            variableName = "color" + colorCounter++;
+            colors.put(declaration, variableName);
+            colorCode.append("    private Color ").append(variableName).append(" = ");
+            colorCode.append(declaration).append(";\n");
+        }
+
+        return variableName;
+    }
+
+    private String encodeGradient(PaintedShape ps, Gradient g) {
+        StringBuilder b = new StringBuilder();
+        float x1 = (float)ps.getPaintX1();
+        float y1 = (float)ps.getPaintY1();
+        float x2 = (float)ps.getPaintX2();
+        float y2 = (float)ps.getPaintY2();
+        b.append("        return decodeGradient((");
+        b.append(x1);
+        b.append("f * w) + x, (");
+        b.append(y1);
+        b.append("f * h) + y, (");
+        b.append(x2);
+        b.append("f * w) + x, (");
+        b.append(y2);
+        b.append("f * h) + y,\n");
+        encodeGradientColorsAndFractions(g,b);
+        b.append(");");
+
+        String methodBody = b.toString();
+        String methodName = methods.get(methodBody);
+        if (methodName == null) {
+            methodName = "decodeGradient" + gradientCounter++;
+            gradientsCode.append("    private Paint ").append(methodName).append("(Shape s) {\n");
+            gradientsCode.append("        Rectangle2D bounds = s.getBounds2D();\n");
+            gradientsCode.append("        float x = (float)bounds.getX();\n");
+            gradientsCode.append("        float y = (float)bounds.getY();\n");
+            gradientsCode.append("        float w = (float)bounds.getWidth();\n");
+            gradientsCode.append("        float h = (float)bounds.getHeight();\n");
+            gradientsCode.append(methodBody);
+            gradientsCode.append("\n    }\n\n");
+            methods.put(methodBody, methodName);
+        }
+        return methodName;
+    }
+
+    /**
+     * Takes a abstract gradient and creates the code for the fractions float
+     * array and the colors array that can be used in the constructors of linear
+     * and radial gradients.
+     *
+     * @param g The abstract gradient to get stops from
+     * @param b Append code string of the form "new float[]{...},
+     *          new Color[]{...}" to this StringBuilder
+     */
+    private void encodeGradientColorsAndFractions(AbstractGradient g,
+                                                    StringBuilder b) {
+        List<GradientStop> stops = g.getStops();
+        // there are stops.size() number of main stops. Between each is a
+        // fractional stop. Thus, there are: stops.size() + stops.size() - 1
+        // number of fractions and colors.
+        float[] fractions = new float[stops.size() + stops.size() - 1];
+        String[] colors = new String[fractions.length];
+        //for each stop, create the stop and it's associated fraction
+        int index = 0; // the index into fractions and colors
+        for (int i = 0; i < stops.size(); i++) {
+            GradientStop s = stops.get(i);
+            //copy over the stop's data
+            colors[index] = encodeMatte(s.getColor());
+            fractions[index] = s.getPosition();
+
+            //If this isn't the last stop, then add in the fraction
+            if (index < fractions.length - 1) {
+                float f1 = s.getPosition();
+                float f2 = stops.get(i + 1).getPosition();
+                index++;
+                fractions[index] = f1 + (f2 - f1) * s.getMidpoint();
+                colors[index] = "decodeColor("+
+                        colors[index - 1]+","+
+                        encodeMatte(stops.get(i + 1).getColor())+",0.5f)";
+            }
+            index++;
+        }
+        // Check boundry conditions
+        for (int i = 1; i < fractions.length; i++) {
+            //to avoid an error with LinearGradientPaint where two fractions
+            //are identical, bump up the fraction value by a miniscule amount
+            //if it is identical to the previous one
+            //NOTE: The <= is critical because the previous value may already
+            //have been bumped up
+            if (fractions[i] <= fractions[i - 1]) {
+                fractions[i] = fractions[i - 1] + .000001f;
+            }
+        }
+        //another boundary condition where multiple stops are all at the end. The
+        //previous loop bumped all but one of these past 1.0, which is bad.
+        //so remove any fractions (and their colors!) that are beyond 1.0
+        int outOfBoundsIndex = -1;
+        for (int i = 0; i < fractions.length; i++) {
+            if (fractions[i] > 1) {
+                outOfBoundsIndex = i;
+                break;
+            }
+        }
+        if (outOfBoundsIndex >= 0) {
+            float[] f = fractions;
+            String[] c = colors;
+            fractions = new float[outOfBoundsIndex];
+            colors = new String[outOfBoundsIndex];
+            System.arraycopy(f, 0, fractions, 0, outOfBoundsIndex);
+            System.arraycopy(c, 0, colors, 0, outOfBoundsIndex);
+        }
+        // build string
+        b.append("                new float[] { ");
+        for (int i = 0; i < fractions.length; i++) {
+            if (i>0)b.append(',');
+            b.append(fractions[i]);
+            b.append('f');
+        }
+        b.append(" },\n                new Color[] { ");
+        for (int i = 0; i < colors.length; i++) {
+            if (i>0) b.append(",\n                            ");
+            b.append(colors[i]);
+        }
+        b.append("}");
+    }
+
+    private String encodeRadial(PaintedShape ps, RadialGradient g) {
+        float centerX1 = (float)ps.getPaintX1();
+        float centerY1 = (float)ps.getPaintY1();
+        float x2 = (float)ps.getPaintX2();
+        float y2 = (float)ps.getPaintY2();
+        float radius = (float)Point2D.distance(centerX1, centerY1, x2, y2);
+        StringBuilder b = new StringBuilder();
+
+        b.append("        return decodeRadialGradient((");
+        b.append(centerX1);
+        b.append("f * w) + x, (");
+        b.append(centerY1);
+        b.append("f * h) + y, ");
+        b.append(radius);
+        b.append("f,\n");
+        encodeGradientColorsAndFractions(g,b);
+        b.append(");");
+
+        String methodBody = b.toString();
+        String methodName = methods.get(methodBody);
+        if (methodName == null) {
+            methodName = "decodeRadial" + radialCounter++;
+            gradientsCode.append("    private Paint ").append(methodName).append("(Shape s) {\n");
+            gradientsCode.append("        Rectangle2D bounds = s.getBounds2D();\n");
+            gradientsCode.append("        float x = (float)bounds.getX();\n");
+            gradientsCode.append("        float y = (float)bounds.getY();\n");
+            gradientsCode.append("        float w = (float)bounds.getWidth();\n");
+            gradientsCode.append("        float h = (float)bounds.getHeight();\n");
+            gradientsCode.append(methodBody);
+            gradientsCode.append("\n    }\n\n");
+            methods.put(methodBody, methodName);
+        }
+        return methodName;
+    }
+
+    //note that this method is not thread-safe. In fact, none of this class is.
+    static void writePainter(UIRegion r, Map<String, String> variables, File painterPackageRoot, String prefix) throws IOException {
+        //Need only write out the stuff for this region, don't need to worry about subregions
+        //since this method will be called for each of those (and they go in their own file, anyway).
+        //The only subregion that we compound into this is the one for icons.
+
+        String painterName = makePretty(prefix) + "Painter";
+        PainterGenerator gen = new PainterGenerator(r);
+        System.out.println("Generating source file: " + painterName + ".java");
+        System.out.println(gen.stateTypeCode.toString());
+        variables.put("PAINTER_NAME", painterName);
+        variables.put("STATIC_DECL", gen.stateTypeCode.toString());
+        variables.put("COLORS_DECL", gen.colorCode.toString());
+        variables.put("DO_PAINT_SWITCH_BODY", gen.switchCode.toString());
+        variables.put("PAINTING_DECL", gen.paintingCode.toString());
+        variables.put("GET_EXTENDED_CACHE_KEYS", gen.getExtendedCacheKeysCode.toString());
+        variables.put("SHAPES_DECL", gen.shapesCode.toString());
+        variables.put("GRADIENTS_DECL", gen.gradientsCode.toString());
+
+        writeSrcFile(getPainterImplTemplate(), variables, new File(painterPackageRoot, painterName + ".java"));
+
+        variables.remove("PAINTER_NAME");
+        variables.remove("STATIC_DECL");
+        variables.remove("COLORS_DECL");
+        variables.remove("DO_PAINT_SWITCH_BODY");
+        variables.remove("PAINTING_DECL");
+        variables.remove("SHAPES_DECL");
+        variables.remove("GRADIENTS_DECL");
+    }
+
+    /**
+     * Represents the usage of a color from a component within a painter. That
+     * is, a painter can use colors from the component when it paints. This
+     * class represents the usage of such a color, containing a reference to
+     * the name of the property that contains the color, and the various
+     * derivation offsets to apply to that color.
+     */
+    private static class ComponentColor {
+        public String propertyName;
+        public String defaultColorVariableName;
+        private float saturationOffset = 0, brightnessOffset = 0;
+        private int alphaOffset = 0;
+
+        private ComponentColor(String propertyName,
+                               String defaultColorVariableName,
+                               float saturationOffset,
+                               float brightnessOffset,
+                               int alphaOffset) {
+            this.propertyName = propertyName;
+            this.defaultColorVariableName = defaultColorVariableName;
+            this.saturationOffset = saturationOffset;
+            this.brightnessOffset = brightnessOffset;
+            this.alphaOffset = alphaOffset;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            ComponentColor c = (ComponentColor)o;
+            if (alphaOffset != c.alphaOffset) return false;
+            if (Float.compare(saturationOffset, c.saturationOffset) != 0)
+                return false;
+            if (Float.compare(brightnessOffset, c.brightnessOffset) != 0)
+                return false;
+            if (defaultColorVariableName != null ?
+                    !defaultColorVariableName.equals(c.defaultColorVariableName) :
+                    c.defaultColorVariableName != null) return false;
+            if (propertyName != null ? !propertyName.equals(c.propertyName) :
+                    c.propertyName != null) return false;
+            return true;
+        }
+
+        @Override
+        public int hashCode() {
+            int hash = 5;
+            hash = 61 * hash + (this.propertyName != null ?
+                this.propertyName.hashCode() : 0);
+            hash = 61 * hash + (this.defaultColorVariableName != null ?
+                this.defaultColorVariableName.hashCode() : 0);
+            hash = 61 * hash + Float.floatToIntBits(this.saturationOffset);
+            hash = 61 * hash + Float.floatToIntBits(this.brightnessOffset);
+            hash = 61 * hash + this.alphaOffset;
+            return hash;
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/TemplateWriter.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/TemplateWriter.java
new file mode 100644
index 0000000..9a76c80
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/generator/TemplateWriter.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.generator;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.util.Map;
+
+/**
+ * TemplateWriter - Class for writing Java Source files using a src template and variable subsitution
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class TemplateWriter {
+
+    /**
+     * Write a Java source file by taking a template file and applying variable substitution and writing to the output
+     * file.
+     *
+     * @param template  The template to use
+     * @param variables Map of the variable names and values to substitute in the template
+     * @param output    The file to write to
+     * @throws IOException If there was a problem writing the Java source file
+     */
+    static void writeSrcFile(String template, Map<String, String> variables, File output) throws IOException {
+        TemplateReader in = new TemplateReader(variables, template);
+        PrintWriter out =
+                new PrintWriter(new FileWriter(output));
+
+        String line = in.readLine();
+        while (line != null) {
+            out.println(line);
+            line = in.readLine();
+        }
+
+        out.close();
+    }
+
+    /**
+     * Read a template file into a string
+     *
+     * @param name The template file path relative to Generator class
+     * @return The contents of the template file as string
+     * @throws IOException If there was a problem reading the template file
+     */
+    static String read(String name) throws IOException {
+        InputStream in = Generator.class.getResourceAsStream(name);
+        if (in==null) throw new IOException("Could not find template ["+name+
+                "] relative to class ["+Generator.class.getName()+"]");
+        byte[] data = new byte[4096];
+        int length = -1;
+        StringBuilder buffer = new StringBuilder();
+        while ((length = in.read(data)) != -1) {
+            buffer.append(new String(data, 0, length));
+        }
+        return buffer.toString();
+    }
+
+    /** A BufferedReader implementation that automatically performs string replacements as needed. */
+    private static final class TemplateReader extends BufferedReader {
+        private Map<String, String> variables;
+
+        TemplateReader(Map<String, String> variables, String template) {
+            super(new StringReader(template));
+            this.variables = variables;
+        }
+
+        /**
+         * @return a line of text from the template but with variables substituted. Other methods will return the text
+         *         sans substitution. Call this method.
+         * @throws java.io.IOException
+         */
+        public String readLine() throws IOException {
+            return substituteVariables(super.readLine());
+        }
+
+        private String substituteVariables(String input) {
+            if (input == null) return null;
+            for (Map.Entry<String, String> variable : variables.entrySet()) {
+                input = input.replace("${" + variable.getKey() + "}", variable.getValue());
+            }
+            return input;
+        }
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/CustomUIDefault.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/CustomUIDefault.java
new file mode 100644
index 0000000..6d4740b
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/CustomUIDefault.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+/**
+ * CustomUIDefault
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class CustomUIDefault<T> extends UIDefault<T> {
+    private static int counter = -1;
+
+    public CustomUIDefault() {
+        super("Unnamed" + (++counter == 0 ? "" : counter), null);
+    }
+
+    public void setName(String id) {
+        super.setName(id);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/HasUIStyle.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/HasUIStyle.java
new file mode 100644
index 0000000..e73b434
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/HasUIStyle.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+/**
+ * HasUIStyle - A marker interface for all classes that have a UIStyle
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public interface HasUIStyle {
+
+    public UIStyle getStyle();
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/PainterBorder.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/PainterBorder.java
new file mode 100644
index 0000000..b3e53db
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/PainterBorder.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import javax.swing.border.EmptyBorder;
+
+/**
+ * Represents a border that refers to a Painter to do it's work. This border
+ * doesn't actually render -- it is just used as part of the model.
+ *
+ * @author Richard Bair
+ */
+public class PainterBorder extends EmptyBorder {
+    private String painterName;
+    public PainterBorder(String painterName, int top, int left, int bottom, int right) {
+        super(top, left, bottom, right);
+        this.painterName = painterName;
+    }
+
+    public String getPainterName() { return painterName; }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.java
new file mode 100644
index 0000000..70a18c5
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.java
@@ -0,0 +1,530 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.utils.HasResources;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JColorChooser;
+import javax.swing.JComboBox;
+import javax.swing.JDesktopPane;
+import javax.swing.JEditorPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFormattedTextField;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JPopupMenu;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButton;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JRootPane;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.JToolTip;
+import javax.swing.JTree;
+import javax.swing.JViewport;
+import javax.swing.UIDefaults;
+import javax.swing.plaf.basic.BasicLookAndFeel;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import static javax.swing.plaf.synth.SynthConstants.*;
+import javax.swing.table.JTableHeader;
+import java.awt.Insets;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Models a Synth look and feel. Contains all of the colors, fonts, painters, states, etc that compose a synth look and
+ * feel.
+ * <p/>
+ * To model Synth properly, I need to both Model the way Synth works (with styles, and so forth) and the way a look and
+ * feel works (UIDefaults table, etc) since both of these are supported ways of doing things in Synth.
+ * <p/>
+ * One important (but non-visual) thing that needs to be configurable is the support for InputMaps per component. In
+ * Synth, an input map can be associated with the main Synth element, meaning it applies to everything. Or it can be
+ * associated with a single style. An Inputmap can have an id, and it can contain multiple key/action pairs (where
+ * actions are denoted by name).
+ * <p/>
+ * It looks like Regions can have InputMaps? Sounds fishy to me. I think only Components really have input maps.
+ * <p/>
+ * I would like some way of denoting special keys between mac and other platforms. For example, cut, copy, paste etc
+ * should be different. In general, the ctrl key and apple (meta) key are reversed from what is typically on windows.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class SynthModel extends AbstractBean implements HasUIDefaults, HasUIStyle, HasResources {
+    //I'm going to want:
+    //entries related to the Control color, and other colors of the Basic LAF
+    //entries related to fonts (standard fonts) used in the Basic LAF
+    //entries related to standard insets, borders, dimensions, icons
+    //entries related to component specific entries in the LAF
+    private List<UIPaint> colors;
+    private List<UIFont> fonts;
+    private List<UIInsets> insets;
+    private List<UIBorder> borders;
+    private List<UIDimension> dimensions;
+    private List<UIIcon> icons;
+    private List<UIComponent> components;
+    /**
+     * This is a local UIDefaults that contains all the UIDefaults in this synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     */
+    private transient UIDefaults modelDefaults = new UIDefaults();
+    private transient UIStyle globalStyle = new UIStyle();
+
+    private transient File resourcesDir;
+    private transient File imagesDir;
+    private transient File templatesDir;
+
+    /** Default constructor used by JIBX to create new empty SynthModel */
+    protected SynthModel() {
+        this(false);
+    }
+
+    public SynthModel(boolean populateWithDefaults) {
+        // create observable lists that fire changes on as property changes
+        colors = new ArrayList<UIPaint>();
+        fonts = new ArrayList<UIFont>();
+        insets = new ArrayList<UIInsets>();
+        borders = new ArrayList<UIBorder>();
+        dimensions = new ArrayList<UIDimension>();
+        icons = new ArrayList<UIIcon>();
+        components = new ArrayList<UIComponent>();
+
+        if (populateWithDefaults) {
+            //get the ui defaults from the SynthLookAndFeel. Using the UIDefaults table,
+            //pre initialize everything.
+//        SynthLookAndFeel synth = new SynthLookAndFeel();
+            BasicLookAndFeel synth = new MetalLookAndFeel();
+            UIDefaults defaults = synth.getDefaults();
+
+            //pre-init the palettes
+            colors.add(new UIColor("desktop", defaults.getColor("desktop"), modelDefaults));
+            colors.add(new UIColor("activeCaption", defaults.getColor("activeCaption"), modelDefaults));
+            colors.add(new UIColor("activeCaptionText", defaults.getColor("activeCaptionText"), modelDefaults));
+            colors.add(new UIColor("activeCaptionBorder", defaults.getColor("activeCaptionBorder"), modelDefaults));
+            colors.add(new UIColor("inactiveCaption", defaults.getColor("inactiveCaption"), modelDefaults));
+            colors.add(new UIColor("inactiveCaptionText", defaults.getColor("inactiveCaptionText"), modelDefaults));
+            colors.add(new UIColor("inactiveCaptionBorder", defaults.getColor("inactiveCaptionBorder"), modelDefaults));
+            colors.add(new UIColor("window", defaults.getColor("window"), modelDefaults));
+            colors.add(new UIColor("windowBorder", defaults.getColor("windowBorder"), modelDefaults));
+            colors.add(new UIColor("windowText", defaults.getColor("windowText"), modelDefaults));
+            colors.add(new UIColor("menu", defaults.getColor("menu"), modelDefaults));
+            colors.add(new UIColor("menuText", defaults.getColor("menuText"), modelDefaults));
+            colors.add(new UIColor("text", defaults.getColor("text"), modelDefaults));
+            colors.add(new UIColor("textText", defaults.getColor("textText"), modelDefaults));
+            colors.add(new UIColor("textHighlight", defaults.getColor("textHighlight"), modelDefaults));
+            colors.add(new UIColor("textHighlightText", defaults.getColor("textHighlightText"), modelDefaults));
+            colors.add(new UIColor("textInactiveText", defaults.getColor("textInactiveText"), modelDefaults));
+            colors.add(new UIColor("control", defaults.getColor("control"), modelDefaults));
+            colors.add(new UIColor("controlText", defaults.getColor("controlText"), modelDefaults));
+            colors.add(new UIColor("controlHighlight", defaults.getColor("controlHighlight"), modelDefaults));
+            colors.add(new UIColor("controlLHighlight", defaults.getColor("controlLHighlight"), modelDefaults));
+            colors.add(new UIColor("controlShadow", defaults.getColor("controlShadow"), modelDefaults));
+            colors.add(new UIColor("controlDkShadow", defaults.getColor("controlDkShadow"), modelDefaults));
+            colors.add(new UIColor("scrollbar", defaults.getColor("scrollbar"), modelDefaults));
+            colors.add(new UIColor("info", defaults.getColor("info"), modelDefaults));
+            colors.add(new UIColor("infoText", defaults.getColor("infoText"), modelDefaults));
+
+            fonts.add(new UIFont("dialogPlain", defaults.getFont("Button.font"), modelDefaults));
+            fonts.add(new UIFont("serifPlain", defaults.getFont("TextPane.font"), modelDefaults));
+            fonts.add(new UIFont("sansSerifPlain", defaults.getFont("ToolTip.font"), modelDefaults));
+            fonts.add(new UIFont("monospacedPlain", defaults.getFont("TextArea.font"), modelDefaults));
+            fonts.add(new UIFont("dialogBold", defaults.getFont("InternalFrame.titleFont"), modelDefaults));
+
+            insets.add(new UIInsets("zeroInsets", new Insets(0, 0, 0, 0)));
+            insets.add(new UIInsets("twoInsets", new Insets(2, 2, 2, 2)));
+            insets.add(new UIInsets("threeInsets", new Insets(3, 3, 3, 3)));
+
+            borders.add(new UIBorder("marginBorder", defaults.getBorder("MenuItem.border")));
+            borders.add(new UIBorder("etchedBorder", defaults.getBorder("TitledBorder.border")));
+            borders.add(new UIBorder("loweredBevelBorder", defaults.getBorder("Table.scrollPaneBorder")));
+            borders.add(new UIBorder("blackLineBorder", defaults.getBorder("ToolTip.border")));
+
+            //TODO have to deal with the special arrow button region
+
+            //pre-init the list of UI components
+            UIComponent button = new UIComponent("Button", JButton.class.getName(), "ButtonUI");
+            addStates(this, button, DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(button);
+
+            UIComponent toggleButton =
+                    new UIComponent("ToggleButton", JToggleButton.class.getName(), "ToggleButtonUI");
+            addStates(this, toggleButton, DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED,
+                    SELECTED | PRESSED, SELECTED | MOUSE_OVER, DISABLED | SELECTED);
+            components.add(toggleButton);
+
+            UIComponent radioButton =
+                    new UIComponent("RadioButton", JRadioButton.class.getName(), "RadioButtonUI");
+            addStates(this, radioButton, DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED,
+                    SELECTED | PRESSED, SELECTED | MOUSE_OVER, DISABLED | SELECTED);
+            components.add(radioButton);
+
+            UIComponent checkBox =
+                    new UIComponent("CheckBox", JCheckBox.class.getName(), "CheckBoxUI");
+            addStates(this, checkBox, DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED,
+                    SELECTED | PRESSED, SELECTED | MOUSE_OVER, DISABLED | SELECTED);
+            components.add(checkBox);
+
+            UIComponent colorChooser =
+                    new UIComponent("ColorChooser", JColorChooser.class.getName(), "ColorChooserUI");
+            addStates(this, colorChooser, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(colorChooser);
+
+            UIComponent comboBox =
+                    new UIComponent("ComboBox", JComboBox.class.getName(), "ComboBoxUI");
+            addStates(this, comboBox, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(comboBox);
+
+            UIComponent fileChooser =
+                    new UIComponent("FileChooser", JFileChooser.class.getName(), "FileChooserUI");
+            addStates(this, fileChooser, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(fileChooser);
+
+            //not represented in Synth
+//        UIComponent  fileView = new UIComponent ("FileView",
+//                list(DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+
+            UIComponent internalFrame =
+                    new UIComponent("InternalFrame", JInternalFrame.class.getName(), "InternalFrameUI");
+            addStates(this, internalFrame, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has an internal frame title pane region
+            components.add(internalFrame);
+
+            //TODO DesktopIcon ???
+
+            UIComponent desktop =
+                    new UIComponent("Desktop", JDesktopPane.class.getName(), "DesktopPaneUI");
+            addStates(this, desktop, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(desktop);
+
+            UIComponent label = new UIComponent("Label", JLabel.class.getName(), "LabelUI");
+            addStates(this, label, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(label);
+
+            UIComponent list = new UIComponent("List", JList.class.getName(), "ListUI");
+            addStates(this, list, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(list);
+
+            UIComponent menuBar = new UIComponent("MenuBar", JMenuBar.class.getName(), "MenuBarUI");
+            addStates(this, menuBar, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(menuBar);
+
+            UIComponent menuItem =
+                    new UIComponent("MenuItem", JMenuItem.class.getName(), "MenuItemUI");
+            addStates(this, menuItem, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has a menuItemAccelerator region
+            components.add(menuItem);
+
+            UIComponent radioButtonMenuItem =
+                    new UIComponent("RadioButtonMenuItem", JRadioButtonMenuItem.class.getName(),
+                            "RadioButtonMenuItemUI");
+            addStates(this, radioButtonMenuItem, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(radioButtonMenuItem);
+
+            UIComponent checkBoxMenuItem =
+                    new UIComponent("CheckBoxMenuItem", JCheckBoxMenuItem.class.getName(),
+                            "CheckBoxMenuItemUI");
+            addStates(this, checkBoxMenuItem, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(checkBoxMenuItem);
+
+            UIComponent menu = new UIComponent("Menu", JMenu.class.getName(), "MenuUI");
+            addStates(this, menu, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(menu);
+
+            UIComponent popupMenu =
+                    new UIComponent("PopupMenu", JPopupMenu.class.getName(), "PopupMenuUI");
+            addStates(this, popupMenu, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has a popupMenuSeparator region
+            components.add(popupMenu);
+
+            UIComponent optionPane =
+                    new UIComponent("OptionPane", JOptionPane.class.getName(), "OptionPaneUI");
+            addStates(this, optionPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(optionPane);
+
+            UIComponent panel = new UIComponent("Panel", JPanel.class.getName(), "PanelUI");
+            addStates(this, panel, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(panel);
+
+            UIComponent progressBar =
+                    new UIComponent("ProgressBar", JProgressBar.class.getName(), "ProgressBarUI");
+            addStates(this, progressBar, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(progressBar);
+
+            UIComponent separator =
+                    new UIComponent("Separator", JSeparator.class.getName(), "SeparatorUI");
+            addStates(this, separator, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(separator);
+
+            UIRegion scrollBarThumb = new UIRegion("ScrollBar.Thumb");
+            addStates(this, scrollBarThumb, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            UIRegion scrollBarTrack = new UIRegion("ScrollBar.Track");
+            addStates(this, scrollBarTrack, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            UIComponent scrollBar =
+                    new UIComponent("ScrollBar", JScrollBar.class.getName(), "ScrollBarUI", scrollBarThumb,
+                            scrollBarTrack);
+            addStates(this, scrollBar, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(scrollBar);
+
+            UIComponent scrollPane =
+                    new UIComponent("ScrollPane", JScrollPane.class.getName(), "ScrollPaneUI");
+            addStates(this, scrollPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(scrollPane);
+
+            UIComponent viewport =
+                    new UIComponent("Viewport", JViewport.class.getName(), "ViewportUI");
+            addStates(this, viewport, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(viewport);
+
+            UIComponent slider = new UIComponent("Slider", JSlider.class.getName(), "SliderUI");
+            addStates(this, slider, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has sliderThumb and sliderTrack sub regions
+            components.add(slider);
+
+            UIComponent spinner = new UIComponent("Spinner", JSpinner.class.getName(), "SpinnerUI");
+            addStates(this, spinner, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(spinner);
+
+            UIComponent splitPane =
+                    new UIComponent("SplitPane", JSplitPane.class.getName(), "SplitPaneUI");
+            addStates(this, splitPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has splitPaneDivider sub region
+            components.add(splitPane);
+
+            UIComponent tabbedPane =
+                    new UIComponent("TabbedPane", JTabbedPane.class.getName(), "TabbedPaneUI");
+            addStates(this, tabbedPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //has tabbedPaneContent and tabbedPaneTab and TabbedPaneTabArea sub regions
+            components.add(tabbedPane);
+
+            UIComponent table = new UIComponent("Table", JTable.class.getName(), "TableUI");
+            addStates(this, table, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(table);
+
+            UIComponent tableHeader =
+                    new UIComponent("TableHeader", JTableHeader.class.getName(), "TableHeaderUI");
+            addStates(this, tableHeader, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(tableHeader);
+
+            UIComponent textField =
+                    new UIComponent("TextField", JTextField.class.getName(), "TextFieldUI");
+            addStates(this, textField, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(textField);
+
+            UIComponent formattedTextField =
+                    new UIComponent("FormattedTextField", JFormattedTextField.class.getName(),
+                            "FormattedTextFieldUI");
+            addStates(this, formattedTextField, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(formattedTextField);
+
+            UIComponent passwordField =
+                    new UIComponent("PasswordField", JPasswordField.class.getName(), "PasswordFieldUI");
+            addStates(this, passwordField, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(passwordField);
+
+            UIComponent textArea =
+                    new UIComponent("TextArea", JTextArea.class.getName(), "TextAreaUI");
+            addStates(this, textArea, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(textArea);
+
+            UIComponent textPane =
+                    new UIComponent("TextPane", JTextPane.class.getName(), "TextPaneUI");
+            addStates(this, textPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(textPane);
+
+            UIComponent editorPane =
+                    new UIComponent("EditorPane", JEditorPane.class.getName(), "EditorPaneUI");
+            addStates(this, editorPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(editorPane);
+
+            /*
+            * The only thing not represented in Synth as a region. I suppose we'll have
+            * to make it a CustomUIComponent
+            */
+//        UIComponent  titledBorder = new UIComponent ("TitledBorder",
+//                list(DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+
+            UIComponent toolBar = new UIComponent("ToolBar", JToolBar.class.getName(), "ToolBarUI");
+            addStates(this, toolBar, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //toolBarContent, toolBarDragWindow, toolBarSeparator sub regions
+            components.add(toolBar);
+
+            UIComponent toolTip = new UIComponent("ToolTip", JToolTip.class.getName(), "ToolTipUI");
+            addStates(this, toolTip, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(toolTip);
+
+            //tooltip manager
+
+            UIComponent tree = new UIComponent("Tree", JTree.class.getName(), "TreeUI");
+            addStates(this, tree, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            //treeCell sub region
+            components.add(tree);
+
+            UIComponent rootPane =
+                    new UIComponent("RootPane", JRootPane.class.getName(), "RootPaneUI");
+            addStates(this, rootPane, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED);
+            components.add(rootPane);
+        }
+    }
+
+    public List<UIPaint> getColorPalette() {
+        return colors;
+    }
+
+    public List<UIFont> getFontPalette() {
+        return fonts;
+    }
+
+    public List<UIInsets> getInsetPalette() {
+        return insets;
+    }
+
+    public List<UIBorder> getBorderPalette() {
+        return borders;
+    }
+
+    public List<UIDimension> getDimensionPalette() {
+        return dimensions;
+    }
+
+    public List<UIIcon> getIconPalette() {
+        return icons;
+    }
+
+    public List<UIComponent> getComponents() {
+        return components;
+    }
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in this synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     *
+     * @return The UIDefaults for the synth model
+     */
+    public UIDefaults getUiDefaults() {
+        return modelDefaults;
+    }
+
+    public UIStyle getStyle() {
+        return globalStyle;
+    }
+
+    // by default there are no painters assigned to the various states
+    private static void addStates(SynthModel model, UIRegion parentRegion, int... states) {
+        for (int state : states) {
+            List<String> stateList = new ArrayList<String>();
+            if ((state & ENABLED) != 0) {
+                stateList.add(UIStateType.ENABLED_KEY);
+            }
+            if ((state & MOUSE_OVER) != 0) {
+                stateList.add(UIStateType.MOUSE_OVER_KEY);
+            }
+            if ((state & PRESSED) != 0) {
+                stateList.add(UIStateType.PRESSED_KEY);
+            }
+            if ((state & DISABLED) != 0) {
+                stateList.add(UIStateType.DISABLED_KEY);
+            }
+            if ((state & FOCUSED) != 0) {
+                stateList.add(UIStateType.FOCUSED_KEY);
+            }
+            if ((state & SELECTED) != 0) {
+                stateList.add(UIStateType.SELECTED_KEY);
+            }
+            if ((state & DEFAULT) != 0) {
+                stateList.add(UIStateType.DEFAULT_KEY);
+            }
+            parentRegion.addBackgroundState(new UIState(model, parentRegion, stateList.toArray(new String[stateList.size()])));
+        }
+    }
+
+    public File getResourcesDir() {
+        return resourcesDir;
+    }
+
+    public void setResourcesDir(File resourcesDir) {
+        System.out.println("SynthModel.setResourcesDir(" + resourcesDir + ")");
+        File old = getResourcesDir();
+        this.resourcesDir = resourcesDir;
+        firePropertyChange("resourcesDir", old, getResourcesDir());
+    }
+
+    public File getImagesDir() {
+        return imagesDir;
+    }
+
+    public void setImagesDir(File imagesDir) {
+        System.out.println("SynthModel.setImagesDir(" + imagesDir + ")");
+        File old = getImagesDir();
+        this.imagesDir = imagesDir;
+        firePropertyChange("imagesDir", old, getImagesDir());
+    }
+
+    public File getTemplatesDir() {
+        return templatesDir;
+    }
+
+    public void setTemplatesDir(File templatesDir) {
+        System.out.println("SynthModel.setTemplatesDir(" + templatesDir + ")");
+        File old = getTemplatesDir();
+        this.templatesDir = templatesDir;
+        firePropertyChange("templatesDir", old, getTemplatesDir());
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    public void preSet(IUnmarshallingContext context) {
+        File resourcesDir = (File) context.getUserContext();
+        this.resourcesDir = resourcesDir;
+        this.imagesDir = new File(resourcesDir, "images");
+        this.templatesDir = new File(resourcesDir, "templates");
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.jibx.xml b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.jibx.xml
new file mode 100644
index 0000000..981772a
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/SynthModel.jibx.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+
+<!DOCTYPE binding SYSTEM "http://jibx.sourceforge.net">
+<binding>
+    <mapping class="org.jdesktop.synthdesigner.synthmodel.UIDefault" abstract="true" post-set="postSet">
+        <value name="name" field="name" style="attribute"/>
+    </mapping>
+    <!-- == AWT TYPES =========================================================================================== -->
+    <mapping class="java.awt.Color"
+             marshaller="org.jdesktop.swingx.designer.jibxhelpers.ColorMapper"
+             unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.ColorMapper"/>
+    <mapping class="java.lang.Class"
+             marshaller="org.jdesktop.synthdesigner.synthmodel.jibxhelpers.ClassMapper"
+             unmarshaller="org.jdesktop.synthdesigner.synthmodel.jibxhelpers.ClassMapper"/>
+    <!-- == UI FONT =========================================================================================== -->
+    <mapping name="typeface" class="org.jdesktop.swingx.designer.font.Typeface" post-set="postSet">
+        <value name="family" field="name" style="attribute" usage="optional"/>
+        <value name="bold" field="bold" style="attribute" usage="optional" default="Default"/>
+        <value name="italic" field="italic" style="attribute" usage="optional" default="Default"/>
+        <value name="size" field="size" style="attribute" usage="optional"/>
+        <value name="sizeOffset" field="sizeOffset" style="attribute" usage="optional" default="1"/>
+        <value name="uiDefaultParentName" field="uiDefaultParentName" style="attribute" usage="optional"/>
+    </mapping>
+    <mapping name="uiFont" class="org.jdesktop.synthdesigner.synthmodel.UIFont"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIDefault">
+        <structure map-as="org.jdesktop.synthdesigner.synthmodel.UIDefault"/>
+        <collection get-method="getFonts" set-method="setFonts" create-type="java.util.ArrayList"/>
+    </mapping>
+    <!-- == UI INSETS =========================================================================================== -->
+    <mapping name="uiInsets" class="org.jdesktop.synthdesigner.synthmodel.UIInsets"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIDefault">
+        <structure map-as="org.jdesktop.synthdesigner.synthmodel.UIDefault"/>
+        <structure name="insets" get-method="getInsets" set-method="setInsets"
+                   marshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"
+                   unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"/>
+    </mapping>
+    <!-- == UI PAINT =========================================================================================== -->
+    <mapping name="matte" class="org.jdesktop.swingx.designer.paint.Matte" post-set="postSet">
+        <value name="red" field="red" style="attribute"/>
+        <value name="green" field="green" style="attribute"/>
+        <value name="blue" field="blue" style="attribute"/>
+        <value name="alpha" field="alpha" style="attribute"/>
+        <value name="uiDefaultParentName" field="uiDefaultParentName" style="attribute" usage="optional"/>
+        <value name="componentPropertyName" field="componentPropertyName" style="attribute" usage="optional"/>
+        <value name="hueOffset" field="hueOffset" style="attribute"/>
+        <value name="saturationOffset" field="saturationOffset" style="attribute"/>
+        <value name="brightnessOffset" field="brightnessOffset" style="attribute"/>
+        <value name="alphaOffset" field="alphaOffset" style="attribute"/>
+        <value name="uiResource" field="uiResource" style="attribute" usage="optional" default="true"/>
+    </mapping>
+    <mapping class="org.jdesktop.synthdesigner.synthmodel.UIPaint" abstract="true" type-name="uipaint"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIDefault">
+        <structure map-as="org.jdesktop.synthdesigner.synthmodel.UIDefault"/>
+        <structure get-method="getPaint" set-method="setPaint"/>
+    </mapping>
+    <mapping name="uiPaint" class="org.jdesktop.synthdesigner.synthmodel.UIPaint"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIDefault">
+        <structure map-as="uipaint"/>
+    </mapping>
+    <mapping name="uiColor" class="org.jdesktop.synthdesigner.synthmodel.UIColor"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIPaint">
+        <structure map-as="uipaint"/>
+    </mapping>
+    <!-- == UI STYLE =========================================================================================== -->
+    <mapping class="org.jdesktop.synthdesigner.synthmodel.UIStyle" abstract="true" post-set="postSet">
+        <structure field="font" usage="optional"/>
+        <structure name="textForeground" usage="optional">
+            <structure field="textForeground" usage="optional"/>
+        </structure>
+        <structure name="textBackground" usage="optional">
+            <structure field="textBackground" usage="optional"/>
+        </structure>
+        <structure name="background" usage="optional">
+            <structure field="background" usage="optional"/>
+        </structure>
+        <value name="inherit-font" field="fontInherited" usage="optional" default="true"/>
+        <value name="inherit-textForeground" field="textForegroundInherited" usage="optional" default="true"/>
+        <value name="inherit-textBackground" field="textBackgroundInherited" usage="optional" default="true"/>
+        <value name="inherit-background" field="backgroundInherited" usage="optional" default="true"/>
+        <value name="hintAlphaInterpolation" field="hintAlphaInterpolation" usage="optional"/>
+        <value name="hintAntialiasing" field="hintAntialiasing" usage="optional"/>
+        <value name="hintColorRendering" field="hintColorRendering" usage="optional"/>
+        <value name="hintDithering" field="hintDithering" usage="optional"/>
+        <value name="hintFractionalMetrics" field="hintFractionalMetrics" usage="optional"/>
+        <value name="hintInterpolation" field="hintInterpolation" usage="optional"/>
+        <value name="hintRendering" field="hintRendering" usage="optional"/>
+        <value name="hintStrokeControl" field="hintStrokeControl" usage="optional"/>
+        <value name="hintTextAntialiasing" field="hintTextAntialiasing" usage="optional"/>
+        <value name="cacheSettingsInherited" field="cacheSettingsInherited" usage="optional" default="true"/>
+        <value name="cacheMode" field="cacheMode" usage="optional" default="FIXED_SIZES"/>
+        <value name="maxHozCachedImgScaling" field="maxHozCachedImgScaling" usage="optional" default="1"/>
+        <value name="maxVertCachedImgScaling" field="maxVertCachedImgScaling" usage="optional" default="1"/>
+        <collection name="uiproperties" field="uiProperties" create-type="java.util.ArrayList">
+            <structure marshaller="org.jdesktop.synthdesigner.synthmodel.jibxhelpers.UIPropertyMapper"
+                       unmarshaller="org.jdesktop.synthdesigner.synthmodel.jibxhelpers.UIPropertyMapper"/>
+        </collection>
+    </mapping>
+    <!-- == UI STATE =========================================================================================== -->
+    <mapping name="stateType" class="org.jdesktop.synthdesigner.synthmodel.UIStateType">
+        <value name="key" field="key" style="attribute"/>
+        <structure name="codeSnippet" usage="optional" test-method="hasCodeSnippet">
+            <value field="codeSnippet" style="cdata" usage="optional"/>
+        </structure>
+    </mapping>
+    <mapping name="state" class="org.jdesktop.synthdesigner.synthmodel.UIState" post-set="postSet" pre-set="preSet">
+        <value name="stateKeys" field="stateKeys" style="attribute" get-method="getStateKeys" set-method="setStateKeys"
+               serializer="org.jdesktop.synthdesigner.synthmodel.UIState.keysToString"
+               deserializer="org.jdesktop.synthdesigner.synthmodel.UIState.stringToKeys"/>
+        <value name="inverted" field="inverted" style="attribute" usage="optional"/>
+        <structure name="style" field="style"/>
+        <structure field="canvas"
+                   marshaller="org.jdesktop.swingx.designer.jibxhelpers.CanvasMapper"
+                   unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.CanvasMapper"/>
+    </mapping>
+    <!-- == REGIONS =========================================================================================== -->
+    <mapping class="org.jdesktop.synthdesigner.synthmodel.UIRegion" abstract="true"
+             type-name="region" pre-set="preSet">
+        <value name="name" field="name" style="attribute"/>
+        <value name="ui" field="ui" style="attribute" usage="optional"/>
+        <value name="subregion" field="subregion" style="attribute"/>
+        <value name="key" field="key" style="attribute" usage="optional"/>
+        <value name="title" field="title" style="attribute" usage="optional"/>
+        <structure name="contentMargins" field="contentMargins"
+                   marshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"
+                   unmarshaller="org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper"/>
+        <structure name="style" field="style"/>
+        <collection name="backgroundStates" field="backgroundStates" create-type="java.util.ArrayList"/>
+        <collection name="foregroundStates" field="foregroundStates" create-type="java.util.ArrayList"/>
+        <collection name="borderStates" field="borderStates" create-type="java.util.ArrayList"/>
+        <collection name="regions" field="subRegions" create-type="java.util.ArrayList"/>
+    </mapping>
+    <mapping name="region" class="org.jdesktop.synthdesigner.synthmodel.UIRegion">
+        <structure map-as="region"/>
+    </mapping>
+    <mapping name="uiIconRegion" class="org.jdesktop.synthdesigner.synthmodel.UIIconRegion"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIRegion">
+        <structure map-as="region"/>
+        <value name="basicKey" field="basicKey" style="attribute" usage="optional"/>
+    </mapping>
+    <mapping name="uiComponent" class="org.jdesktop.synthdesigner.synthmodel.UIComponent"
+             extends="org.jdesktop.synthdesigner.synthmodel.UIRegion">
+        <value name="opaque" field="opaque" style="attribute"/>
+        <value name="componentName" field="componentName" style="attribute" usage="optional"/>
+        <value name="type" field="type" style="attribute"/>
+        <collection name="stateTypes" field="stateTypes" create-type="java.util.ArrayList"/>
+        <structure map-as="region"/>
+    </mapping>
+    <!-- == BASE MODEL =========================================================================================== -->
+    <mapping name="synthModel" class="org.jdesktop.synthdesigner.synthmodel.SynthModel" pre-set="preSet">
+        <collection name="insets" field="insets" create-type="java.util.ArrayList"/>
+        <collection name="colors" field="colors" create-type="java.util.ArrayList"/>
+        <collection name="fonts" field="fonts" create-type="java.util.ArrayList"/>
+        <structure name="style" field="globalStyle"/>
+        <collection name="components" field="components" create-type="java.util.ArrayList"/>
+    </mapping>
+</binding>
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIBorder.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIBorder.java
new file mode 100644
index 0000000..46c35ed
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIBorder.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import javax.swing.border.Border;
+
+/**
+ * UIBorder
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIBorder extends UIDefault<Border> {
+
+    public UIBorder() {
+    }
+
+    public UIBorder(String id, Border b) {
+        super(id, b);
+    }
+
+    public Border getBorder() {
+        return super.getValue();
+    }
+
+    public void setBorder(Border b) {
+        Border old = getBorder();
+        super.setValue(b);
+        firePropertyChange("border", old, b);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIColor.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIColor.java
new file mode 100644
index 0000000..572d346
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIColor.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+
+import javax.swing.UIDefaults;
+import java.awt.Color;
+
+/**
+ * UIColor
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIColor extends UIPaint {
+
+    public UIColor() {
+    }
+
+    public UIColor(String id, Matte value) {
+        super(id, value);
+    }
+
+    public UIColor(String id, Color color, UIDefaults modelDefaults) {
+        this(id, new Matte(color, modelDefaults));
+    }
+
+    public Matte getPaint() {
+        return (Matte) super.getPaint();
+    }
+
+    public void setPaint(Matte c) {
+        super.setPaint(c);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIComponent.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIComponent.java
new file mode 100644
index 0000000..028124a
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIComponent.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * UIComponent - model node that represents the designs for a single swing component
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIComponent extends UIRegion implements HasUIDefaults {
+
+    /** The classname of the swing component that this UIComponent represents */
+    private String type;
+    /** The name of the component if its a named component or null if its a generic component */
+    private String componentName = null;
+    /** If this components is opaque which means that when it is painted all of its bounds are filled */
+    private boolean opaque = false;
+    /**
+     * A list of state types that are available to this region and sub regions of this component but not subcomponents
+     * of this component. If this list is empty then the standard synth set of state types are assumed.
+     */
+    private List<UIStateType> stateTypes;
+
+    // =================================================================================================================
+    // Contructors
+
+    /** no-args contructor for JIBX */
+    protected UIComponent() {
+        super();
+        // create new observable list for state types so we get events for when the model changes
+        stateTypes = new ArrayList<UIStateType>();
+    }
+
+    public UIComponent(String name, String type, String ui, UIRegion... subRegions) {
+        super(name, ui, subRegions);
+        this.type = type;
+        for (UIRegion r : subRegions) {
+            r.setRegion(this);
+        }
+        // create new observable list for state types so we get events for when the model changes
+        stateTypes = new ArrayList<UIStateType>();
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    public String getComponentName() {
+        return componentName;
+    }
+
+    public void setComponentName(String componentName) {
+        String old = getComponentName();
+        this.componentName = componentName;
+        firePropertyChange("componentName", old, getComponentName());
+    }
+
+    public boolean isOpaque() {
+        return opaque;
+    }
+
+    public void setOpaque(boolean opaque) {
+        boolean old = isOpaque();
+        this.opaque = opaque;
+        firePropertyChange("opaque", old, isOpaque());
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        String old = getType();
+        this.type = type;
+        firePropertyChange("type", old, getType());
+    }
+
+    /**
+     * Get the list of state types that are available to this region and sub regions of this component but not
+     * subcomponents of this component. If this list is empty then the standard synth set of state types are assumed.
+     *
+     * @return List of available state types
+     */
+    public List<UIStateType> getStateTypes() {
+        return stateTypes;
+    }
+
+    @Override public String getKey() {
+        if (key == null || "".equals(key)) {
+            if (componentName == null || "".equals(componentName)) {
+                return getName();
+            } else {
+                return "\"" + componentName + "\"";
+            }
+        } else {
+            return key;
+        }
+    }
+
+    @Override public String getTitle() {
+        if (title == null || "".equals(title)) {
+            if (componentName == null || "".equals(componentName)) {
+                return getName();
+            } else {
+                return componentName;
+            }
+        } else {
+            return title;
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDefault.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDefault.java
new file mode 100644
index 0000000..2f0bf09
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDefault.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.UIDefaults;
+
+/**
+ * Represents an entry in the UI defaults table.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIDefault<T> extends AbstractBean implements HasUIDefaults {
+    private String name;
+    private T value;
+    /**
+     * This is a local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     */
+    private transient UIDefaults modelDefaults = null;
+
+    public UIDefault() {
+    }
+
+    public UIDefault(String name, T value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public UIDefault(String name, T value, UIDefaults modelDefaults) {
+        this.name = name;
+        this.value = value;
+        this.modelDefaults = modelDefaults;
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void postSet(IUnmarshallingContext context) {
+        // walk up till we get synth model
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIDefaults) {
+                modelDefaults = ((HasUIDefaults) context.getStackObject(i)).getUiDefaults();
+                if (modelDefaults != null) break;
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     *
+     * @return The UIDefaults for the synth model
+     */
+    public UIDefaults getUiDefaults() {
+        return modelDefaults;
+    }
+
+    public void setValue(T t) {
+        T old = this.value;
+        this.value = t;
+        firePropertyChange("value", old, getValue());
+    }
+
+    public T getValue() {
+        return value;
+    }
+
+    public final String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        String old = this.name;
+        firePropertyChange("name", old, name);
+        this.name = name;
+        // update model defaults
+        if (old != null) modelDefaults.remove(old);
+        modelDefaults.put(getName(), getValue());
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDimension.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDimension.java
new file mode 100644
index 0000000..e611ad6
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIDimension.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import java.awt.Dimension;
+
+/**
+ * UIDimension
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIDimension extends UIDefault<Dimension> {
+    public UIDimension() {
+    }
+
+    public Dimension getDimension() {
+        return super.getValue();
+    }
+
+    public void setDimension(Dimension d) {
+        Dimension old = getDimension();
+        super.setValue(d);
+        firePropertyChange("dimension", old, d);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIFont.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIFont.java
new file mode 100644
index 0000000..efb6fdb
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIFont.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import java.awt.Font;
+import org.jdesktop.swingx.designer.font.Typeface;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ArrayList;
+import javax.swing.UIDefaults;
+
+/**
+ * Represents a single font entry in the UIDefaults table. Each UIFont takes a
+ * list of Typefaces. These typefaces are listed by order of preference. Thus,
+ * when putting a font into UIDefaults, the code can check whether each font
+ * exists, and when it finds the first font that does, insert it.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIFont extends UIDefault<List<Typeface>> implements Cloneable {
+
+    private void updateUIDefaults() {
+        if (getUiDefaults() != null) {
+            for (Typeface t : getFonts()) {
+                if (t.isFontSupported()) {
+                    getUiDefaults().put(getName(), t.getFont());
+                    return;
+                }
+            }
+        }
+
+        //TODO must not have found any. Default to the Default platform font
+        getUiDefaults().put(getName(), new Font("Arial", Font.PLAIN, 12));
+    }
+
+    public UIFont() {
+        setValue(new ArrayList<Typeface>());
+    }
+
+    public UIFont(String id, List<Typeface> values, UIDefaults defaults) {
+        super(id, values, defaults);
+        updateUIDefaults();
+    }
+
+    public UIFont(String id, Font font, UIDefaults modelDefaults) {
+        this(id, Arrays.asList(new Typeface(font, modelDefaults)), modelDefaults);
+    }
+
+    public List<Typeface> getFonts() {
+        return super.getValue();
+    }
+
+    private void setFonts(List<Typeface> values) {
+        super.setValue(values);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIcon.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIcon.java
new file mode 100644
index 0000000..d1a2583
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIcon.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import javax.swing.Icon;
+
+/**
+ * UIIcon
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIIcon extends UIDefault<Icon> {
+
+    public UIIcon() {
+    }
+
+    public Icon getIcon() {
+        return super.getValue();
+    }
+
+    public void setIcon(Icon i) {
+        Icon old = getIcon();
+        super.setValue(i);
+        firePropertyChange("icon", old, i);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIconRegion.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIconRegion.java
new file mode 100644
index 0000000..74590ee
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIIconRegion.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+/**
+ * A UIRegion subclass which is used for generating icons. For example, JRadioButton and JCheckBox represent themselves
+ * mainly via their icons. However, from the designers perspective, the main design isn't an "icon", but just a region
+ * on the button.
+ * <p/>
+ * That type of region is represented by a UIIconRegion. UIIconRegion contains a string which references the UIDefault
+ * value associated with this icon. For example, RadioButton.icon.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIIconRegion extends UIRegion {
+    /** The UiDefaults key which this icon should be stored for basic LaF to find it. This is absolute */
+    private String basicKey = null;
+
+    public UIIconRegion() {
+        super();
+    }
+
+    public String getBasicKey() {
+        return basicKey;
+    }
+
+    public void setBasicKey(String basicKey) {
+        String old = getBasicKey();
+        this.basicKey = basicKey;
+        firePropertyChange("basicKey",old,getBasicKey());
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIInsets.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIInsets.java
new file mode 100644
index 0000000..3e320de
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIInsets.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import java.awt.Insets;
+
+/**
+ * UIInsets
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIInsets extends UIDefault<Insets> {
+
+    public UIInsets() {
+    }
+
+    public UIInsets(String id, Insets value) {
+        super(id, value);
+    }
+
+    public Insets getInsets() {
+        return super.getValue();
+    }
+
+    public void setInsets(Insets i) {
+        Insets old = getInsets();
+        super.setValue(i);
+        firePropertyChange("insets", old, i);
+        // update model defaults
+        getUiDefaults().put(getName(), i);
+    }
+
+
+    public String toString() {
+        return "UiInset(" + getName() + ")" +
+                ((getInsets() == null) ? " NONE" : "(" + getInsets().top + "," + getInsets().left + "," +
+                        getInsets().bottom + "," + getInsets().right + ")");
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIPaint.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIPaint.java
new file mode 100644
index 0000000..931b3f4
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIPaint.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.swingx.designer.paint.Matte;
+import org.jdesktop.swingx.designer.paint.PaintModel;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/**
+ * UIPaint
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIPaint extends UIDefault<PaintModel> {
+
+    /** Listener to keep model UiDefaults up to date for this UiPaint */
+    private PropertyChangeListener matteListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            PaintModel paintModel = getValue();
+            if (paintModel instanceof Matte) {
+                getUiDefaults().put(getName(), ((Matte) paintModel).getColor());
+            }
+            // propogate the paint change up as PaintModel is a mutable object
+            if (evt.getPropertyName().equals("paint")) {
+                firePropertyChange("paint", null, getPaint());
+                firePropertyChange("value", null, getPaint());
+            }
+        }
+    };
+
+    public UIPaint() {}
+
+    public UIPaint(String id, PaintModel value) {
+        super(id, value, (value instanceof Matte) ? ((Matte) value).getUiDefaults() : null);
+        // update model defaults
+        if (value instanceof Matte) {
+            Matte matte = (Matte) value;
+            if (getUiDefaults() != null) getUiDefaults().put(getName(), matte.getColor());
+            matte.addPropertyChangeListener(matteListener);
+        }
+    }
+
+    public PaintModel getPaint() {
+        return super.getValue();
+    }
+
+    public void setPaint(PaintModel c) {
+        PaintModel old = getPaint();
+        if (old instanceof Matte) old.removePropertyChangeListener(matteListener);
+        super.setValue(c);
+        firePropertyChange("paint", old, c);
+        // update model defaults
+        if (c instanceof Matte) {
+            Matte matte = (Matte) c;
+            getUiDefaults().put(getName(), matte.getColor());
+            matte.addPropertyChangeListener(matteListener);
+        }
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIProperty.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIProperty.java
new file mode 100644
index 0000000..1a57a58
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIProperty.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+
+/**
+ * UIProperty
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIProperty extends AbstractBean {
+    public static enum PropertyType {
+        BOOLEAN, INT, FLOAT, DOUBLE, STRING, FONT, COLOR, INSETS, DIMENSION, BORDER
+    }
+
+    private String name;
+    private PropertyType type;
+    private Object value;
+
+    protected UIProperty() {
+    }
+
+    public UIProperty(String name, PropertyType type, Object value) {
+        this.name = name;
+        this.type = type;
+        this.value = value;
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        String old = getName();
+        this.name = name;
+        firePropertyChange("name", old, getName());
+    }
+
+    public PropertyType getType() {
+        return type;
+    }
+
+    public void setType(PropertyType type) {
+        PropertyType old = getType();
+        this.type = type;
+        firePropertyChange("type", old, getType());
+    }
+
+    public Object getValue() {
+        return value;
+    }
+
+    public void setValue(Object value) {
+        Object old = getValue();
+        this.value = value;
+        firePropertyChange("value", old, getValue());
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIRegion.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIRegion.java
new file mode 100644
index 0000000..1ee4f35
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIRegion.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.UIDefaults;
+import java.awt.Insets;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Represents a "Region" in synth, which also includes entire components.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIRegion extends AbstractBean implements HasUIDefaults, HasUIStyle {
+    private String name;//the code-wise name of the region
+    protected String key; //the UIdefaults key for this region
+    protected String title; //the user friendly name/title of this region
+    /** List of background states */
+    private List<UIState> backgroundStates;
+    /** List of foreground states */
+    private List<UIState> foregroundStates;
+    /** List of border states */
+    private List<UIState> borderStates;
+    private UIStyle style = new UIStyle();
+    protected Insets contentMargins = new Insets(0, 0, 0, 0);
+    /** Sub regions, if any */
+    private List<UIRegion> subRegions;
+
+    //together with name, these two fields allow me to reconstruct, in
+    //code, a synth Region, including a custom Region, if you make one.
+    private String ui;
+    private boolean subregion;
+    /**
+     * This is a local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     */
+    private transient UIDefaults modelDefaults = null;
+
+    private UIRegion region; //the region that this region belongs to
+
+    // =================================================================================================================
+    // Constructors
+
+    /** no-args contructor for JIBX */
+    protected UIRegion() {
+        subRegions = new ArrayList<UIRegion>();
+        backgroundStates = new ArrayList<UIState>();
+        foregroundStates = new ArrayList<UIState>();
+        borderStates = new ArrayList<UIState>();
+        style.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("style." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+            }
+        });
+    }
+
+    public UIRegion(String name, UIRegion... subRegions) {
+        this(name, null, true, subRegions);
+    }
+
+    public UIRegion(String name, String ui, UIRegion... subRegions) {
+        this(name, ui, false, subRegions);
+    }
+
+    public UIRegion(String name, String ui, boolean subregion, UIRegion... subRegions) {
+        this();
+        this.name = name;
+        this.ui = ui;
+        this.subregion = subregion;
+        if (subRegions != null) {
+            for (UIRegion r : subRegions) {
+                if (r != null) {
+                    this.subRegions.add(r);
+                    r.getStyle().setParentStyle(getStyle());
+                }
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void preSet(IUnmarshallingContext context) {
+        // walk up till we get synth model
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIDefaults) {
+                modelDefaults = ((HasUIDefaults) context.getStackObject(i)).getUiDefaults();
+                if (modelDefaults != null) break;
+            }
+        }
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof UIRegion && context.getStackObject(i) != this) {
+                region = (UIRegion) context.getStackObject(i);
+                break;
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    public Insets getContentMargins() {
+        return contentMargins;
+    }
+
+    public void setContentMargins(Insets contentMargins) {
+        Insets old = getContentMargins();
+        this.contentMargins = contentMargins;
+        firePropertyChange("contentMargins", old, getContentMargins());
+    }
+
+    void setRegion(UIRegion r) {
+        this.region = r;
+    }
+
+    public UIRegion getRegion() {
+        return region;
+    }
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     *
+     * @return The UIDefaults for the synth model
+     */
+    public UIDefaults getUiDefaults() {
+        return modelDefaults;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public final UIRegion[] getSubRegions() {
+        return subRegions.toArray(new UIRegion[0]);
+    }
+
+    public final UIState[] getBackgroundStates() {
+        return backgroundStates.toArray(new UIState[0]);
+    }
+
+    public final UIState[] getForegroundStates() {
+        return foregroundStates.toArray(new UIState[0]);
+    }
+
+    public final UIState[] getBorderStates() {
+        return borderStates.toArray(new UIState[0]);
+    }
+
+    public UIStyle getStyle() {
+        return style;
+    }
+
+    public final boolean isSubRegion() {
+        return subregion;
+    }
+
+    public final String getUi() {
+        return ui;
+    }
+
+    public void addBackgroundState(UIState state) {
+        // check if we already have that state
+        for (UIState uiState : backgroundStates) {
+            if (uiState.getName().equals(state.getName())) return;
+        }
+        backgroundStates.add(state);
+        state.setRegion(this);
+        firePropertyChange("backgroundStates", null, backgroundStates);
+    }
+
+    public void removeBackgroundState(UIState state) {
+        if (backgroundStates.remove(state)) {
+            firePropertyChange("backgroundStates", null, backgroundStates);
+        }
+    }
+
+    public void addForegroundState(UIState state) {
+        // check if we already have that state
+        for (UIState uiState : foregroundStates) {
+            if (uiState.getName().equals(state.getName())) return;
+        }
+        foregroundStates.add(state);
+        state.setRegion(this);
+        firePropertyChange("foregroundStates", null, foregroundStates);
+    }
+
+    public void removeForegroundState(UIState state) {
+        if (foregroundStates.remove(state)) {
+            firePropertyChange("foregroundStates", null, foregroundStates);
+        }
+    }
+
+    public void addBorderState(UIState state) {
+        // check if we already have that state
+        for (UIState uiState : borderStates) {
+            if (uiState.getName().equals(state.getName())) return;
+        }
+        borderStates.add(state);
+        state.setRegion(this);
+        firePropertyChange("borderStates", null, borderStates);
+    }
+
+    public void removeBorderState(UIState state) {
+        if (borderStates.remove(state)) {
+            firePropertyChange("borderStates", null, borderStates);
+        }
+    }
+
+
+    public String getKey() {
+        return key == null || "".equals(key) ? name : key;
+    }
+
+    public String getTitle() {
+        return title == null || "".equals(title) ? name : title;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIState.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIState.java
new file mode 100644
index 0000000..4d747a4
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIState.java
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.Canvas;
+import org.jdesktop.swingx.designer.utils.HasPath;
+import org.jdesktop.swingx.designer.utils.HasUIDefaults;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import javax.swing.UIDefaults;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Represents a State in the Synth LAF.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIState extends AbstractBean implements HasUIStyle, HasPath {
+
+    private List<String> stateKeys;
+    private boolean inverted; //indicates whether to invert the meaning of the 9-square stretching insets
+    /** A cached string representing the list of stateKeys deliminated with "+" */
+    private String cachedName = null;
+    private Canvas canvas;
+    private UIStyle style;
+    /** the region that this state belongs to */
+    private UIRegion region;
+    /**
+     * This is a local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     */
+    private transient UIDefaults modelDefaults = null;
+
+    // =================================================================================================================
+    // Contructors
+
+    public UIState() {
+        // Create state keys as event list so model changes are propogated
+        stateKeys = new ArrayList<String>();
+    }
+
+    public UIState(SynthModel model, UIRegion parentRegion, String... stateTypeKeys) {
+        // Create state keys as event list so model changes are propogated
+        stateKeys = new ArrayList<String>();
+        this.stateKeys.addAll(Arrays.asList(stateTypeKeys));
+        //
+        modelDefaults = model.getUiDefaults();
+        region = parentRegion;
+        // create new canvas
+        canvas = new Canvas(100, 30);
+        canvas.setUiDefaults(modelDefaults);
+        String canvasPath = getPath();
+        canvas.setResourcesDir(new File(model.getResourcesDir(), canvasPath));
+        canvas.setTemplatesDir(new File(model.getTemplatesDir(), canvasPath));
+        canvas.setImagesDir(new File(model.getImagesDir(), canvasPath));
+        canvas.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("canvas." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+            }
+        });
+        // create new style
+        style = new UIStyle();
+        style.setParentStyle(region.getStyle());
+        style.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("style." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+            }
+        });
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * JIBX needs this
+     *
+     * @param stateKeys The new list of states
+     */
+    private void setStateKeys(List<String> stateKeys) {
+        if (stateKeys != this.stateKeys) {
+            this.stateKeys.clear();
+            this.stateKeys.addAll(stateKeys);
+        }
+    }
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void preSet(IUnmarshallingContext context) {
+        // walk up till we get synth model
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIDefaults) {
+                modelDefaults = ((HasUIDefaults) context.getStackObject(i)).getUiDefaults();
+                if (modelDefaults != null) break;
+            }
+        }
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof UIRegion) {
+                region = (UIRegion) context.getStackObject(i);
+                break;
+            }
+        }
+    }
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void postSet(IUnmarshallingContext context) {
+        // add listeners to pass canvas and style events up tree
+        canvas.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("canvas." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+            }
+        });
+        style.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                firePropertyChange("style." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+            }
+        });
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get path to this UI State of the form /RegionA/RegionB/StateName
+     *
+     * @return Path to this state
+     */
+    public String getPath() {
+        StringBuilder buf = new StringBuilder(getName());
+        UIRegion region = getRegion();
+        // check if we are foreground background or border
+        boolean found = false;
+        for (UIState state : region.getBackgroundStates()) {
+            if (state == this) {
+                buf.insert(0, "Background/");
+                found = true;
+                break;
+            }
+        }
+        if (!found) {
+            for (UIState state : region.getForegroundStates()) {
+                if (state == this) {
+                    buf.insert(0, "Foreground/");
+                    found = true;
+                    break;
+                }
+            }
+        }
+        if (!found) {
+            for (UIState state : region.getBorderStates()) {
+                if (state == this) {
+                    buf.insert(0, "Border/");
+                    found = true;
+                    break;
+                }
+            }
+        }
+        // add parent regions
+        while (region != null) {
+            buf.insert(0, '/');
+            if (region instanceof UIComponent && ((UIComponent) region).getComponentName() != null) {
+                buf.insert(0, ((UIComponent) region).getComponentName());
+            } else {
+                buf.insert(0, region.getName());
+            }
+            region = region.getRegion();
+        }
+        return buf.toString();
+    }
+
+    void setRegion(UIRegion r) {
+        this.region = r;
+        this.style.setParentStyle(r.getStyle());
+    }
+
+    public UIRegion getRegion() {
+        return region;
+    }
+
+    /**
+     * Get the local UIDefaults that contains all the UIDefaults in the synth model. It is kept uptodate by the
+     * indervidual UIDefaults nodes
+     *
+     * @return The UIDefaults for the synth model
+     */
+    public UIDefaults getUIDefaults() {
+        return modelDefaults;
+    }
+
+
+    /**
+     * Get the list of state type keys for this state. This state is applied when the current component state matches as
+     * many as possible of these state types.
+     *
+     * @return List of state types that need to be true for this state. This is direct access to the data and changes to
+     *         the returned list will effect this UiState.
+     */
+    public List<String> getStateKeys() {
+        return stateKeys;
+    }
+
+    public void setInverted(boolean b) {
+        boolean old = inverted;
+        inverted = b;
+        firePropertyChange("invert", old, b);
+    }
+
+    public final boolean isInverted() {
+        return inverted;
+    }
+
+    /**
+     * Get the name of this state
+     *
+     * @return
+     */
+    public String getName() {
+        if (cachedName == null) {
+            StringBuilder buf = new StringBuilder();
+            List<String> keys = new ArrayList<String>(stateKeys);
+            Collections.sort(keys);
+            for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
+                buf.append(iter.next());
+                if (iter.hasNext()) buf.append('+');
+            }
+            cachedName = buf.toString();
+        }
+        return cachedName;
+    }
+
+    public final Canvas getCanvas() {
+        return canvas;
+    }
+
+    public void setCanvas(Canvas c) {
+        Canvas old = canvas;
+        canvas = c;
+        firePropertyChange("canvas", old, c);
+    }
+
+    public UIStyle getStyle() {
+        return style;
+    }
+
+    // =================================================================================================================
+    // JIBX Helper Methods
+
+    public static String keysToString(List<String> keys) {
+        StringBuilder buf = new StringBuilder();
+        for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
+            buf.append(iter.next());
+            if (iter.hasNext()) buf.append('+');
+        }
+        return buf.toString();
+    }
+
+    public static List<String> stringToKeys(String keysString) {
+        return Arrays.asList(keysString.split("\\+"));
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStateType.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStateType.java
new file mode 100644
index 0000000..811ca8f
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStateType.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+
+/**
+ * UIStateType - A UIComponents has a collection of these which constitute the avilables states which can be chosen in
+ * the components regions. A UIStateType can be either a custom state or one of the predefined standard states.
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIStateType extends AbstractBean {
+    /* Keys for standard synth states */
+    public static final String ENABLED_KEY = "Enabled";
+    public static final String MOUSE_OVER_KEY = "MouseOver";
+    public static final String PRESSED_KEY = "Pressed";
+    public static final String DISABLED_KEY = "Disabled";
+    public static final String FOCUSED_KEY = "Focused";
+    public static final String SELECTED_KEY = "Selected";
+    public static final String DEFAULT_KEY = "Default";
+    public static final String[] STANDARD_SYNTH_STATE_KEYS = new String[]{
+            ENABLED_KEY, MOUSE_OVER_KEY, PRESSED_KEY, DISABLED_KEY, FOCUSED_KEY, SELECTED_KEY, DEFAULT_KEY
+    };
+    public static final UIStateType[] STANDARD_SYNTH_STATES = new UIStateType[]{
+            new UIStateType(ENABLED_KEY),
+            new UIStateType(MOUSE_OVER_KEY),
+            new UIStateType(PRESSED_KEY),
+            new UIStateType(DISABLED_KEY),
+            new UIStateType(FOCUSED_KEY),
+            new UIStateType(SELECTED_KEY),
+            new UIStateType(DEFAULT_KEY)
+    };
+
+    /** Unique string for the ui key for this state, must be unique within a components set of UiStateTypes */
+    private String key;
+    /**
+     * Snippet of java code that defines calculates the value of this state for a particular component. The varaiable
+     * <code>c</code> is the component. You end with a return statement returning boolean true/false for the current
+     * value of this state for this component. This can be null if the key is one of that standard synth states defined
+     * in constants in this class.
+     */
+    private String codeSnippet;
+
+    /** JIBX no-args contructor */
+    private UIStateType() {}
+
+    private UIStateType(String key) {
+        this.key = key;
+        this.codeSnippet = null;
+    }
+
+    public UIStateType(String key, String codeSnippet) {
+        this.key = key;
+        this.codeSnippet = codeSnippet;
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    /**
+     * Get the ui defaults key for this state type. Unique string for the ui key for this state, must be unique within a
+     * components set of UiStateTypes.
+     *
+     * @return Unique ui default key
+     */
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * Get the snippet of java code that defines calculates the value of this state for a particular component. The
+     * varaiable <code>c</code> is the component. You end with a return statement returning boolean true/false for the
+     * current value of this state for this component. This can be null if the key is one of that standard synth states
+     * defined in constants in this class.
+     *
+     * @return Snippet of java code or null if this is a synth standard state
+     */
+    public String getCodeSnippet() {
+        return codeSnippet;
+    }
+
+    /**
+     * Set the snippet of java code that defines calculates the value of this state for a particular component. The
+     * varaiable <code>c</code> is the component. You end with a return statement returning boolean true/false for the
+     * current value of this state for this component. This can be null if the key is one of that standard synth states
+     * defined in constants in this class.
+     *
+     * @param codeSnippet Snippet of java code or null if this is a synth standard state
+     */
+    public void setCodeSnippet(String codeSnippet) {
+        this.codeSnippet = codeSnippet;
+    }
+
+    /**
+     * Returns if this state type is a standard synth type and has no code snippet or a custom type that has a code
+     * snippet. It is used by JIBX to determin if the code snippet should be written to XML.
+     *
+     * @return <code>true</code> if codeSnippet is non null
+     */
+    public boolean hasCodeSnippet() {
+        return codeSnippet != null;
+    }
+
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStyle.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStyle.java
new file mode 100644
index 0000000..3e926bf
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/UIStyle.java
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel;
+
+import org.jdesktop.beans.AbstractBean;
+import org.jdesktop.swingx.designer.font.Typeface;
+import org.jdesktop.swingx.designer.paint.Matte;
+import org.jibx.runtime.IUnmarshallingContext;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * UIStyle
+ *
+ * @author  Richard Bair
+ * @author  Jasper Potts
+ */
+public class UIStyle extends AbstractBean {
+    public static enum CacheMode {NO_CACHING,FIXED_SIZES,NINE_SQUARE_SCALE}
+    public static enum HintAlphaInterpolation {
+        DEFAULT, QUALITY, SPEED
+    }
+
+    public static enum HintAntialiasing {
+        DEFAULT, ON, OFF
+    }
+
+    public static enum HintColorRendering {
+        DEFAULT, QUALITY, SPEED
+    }
+
+    public static enum HintDithering {
+        DEFAULT, DISABLE, ENABLE
+    }
+
+    public static enum HintFractionalMetrics {
+        DEFAULT, ON, OFF
+    }
+
+    public static enum HintInterpolation {
+        NEAREST_NEIGHBOR, BILINEAR, BICUBIC
+    }
+
+    public static enum HintRendering {
+        DEFAULT, QUALITY, SPEED
+    }
+
+    public static enum HintStrokeControl {
+        DEFAULT, NORMALIZE, PURE
+    }
+
+    public static enum HintTextAntialiasing {
+        DEFAULT, ON, OFF, GASP, LCD_HBGR, LCD_HRGB, LCD_VBGR, LCD_VRGB
+    }
+
+    private Typeface font = null;
+    private boolean fontInherited = true;
+    private Matte textForeground = null;
+    private boolean textForegroundInherited = true;
+    private Matte textBackground = null;
+    private boolean textBackgroundInherited = true;
+    private Matte background = null;
+    private boolean backgroundInherited = true;
+
+    private boolean cacheSettingsInherited = true;
+    private CacheMode cacheMode = CacheMode.FIXED_SIZES;
+    private double maxHozCachedImgScaling = 1;
+    private double maxVertCachedImgScaling = 1;
+
+    private HintAlphaInterpolation hintAlphaInterpolation = null;
+    private HintAntialiasing hintAntialiasing = null;
+    private HintColorRendering hintColorRendering = null;
+    private HintDithering hintDithering = null;
+    private HintFractionalMetrics hintFractionalMetrics = null;
+    private HintInterpolation hintInterpolation = null;
+    private HintRendering hintRendering = null;
+    private HintStrokeControl hintStrokeControl = null;
+    private HintTextAntialiasing hintTextAntialiasing = null;
+    private List<UIProperty> uiProperties;
+    private UIStyle parentStyle = null;
+
+    private PropertyChangeListener textForegoundListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            firePropertyChange("textForeground." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+    private PropertyChangeListener textBackgroundListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            firePropertyChange("textBackground." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+    private PropertyChangeListener backgroundListener = new PropertyChangeListener() {
+        public void propertyChange(PropertyChangeEvent evt) {
+            firePropertyChange("background." + evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+        }
+    };
+
+    // =================================================================================================================
+    // Constructors
+
+    public UIStyle() {
+        uiProperties = new ArrayList<UIProperty>();
+    }
+
+    // =================================================================================================================
+    // JIBX Methods
+
+    /**
+     * Called by JIBX after all fields have been set
+     *
+     * @param context The JIBX Unmarshalling Context
+     */
+    private void postSet(IUnmarshallingContext context) {
+        // walk up till we get a parent style
+        for (int i = 0; i < context.getStackDepth(); i++) {
+            if (context.getStackObject(i) instanceof HasUIStyle) {
+                HasUIStyle hasStyle = (HasUIStyle) context.getStackObject(i);
+                if (hasStyle.getStyle() != this) {
+                    parentStyle = hasStyle.getStyle();
+                    if (parentStyle != null) break;
+                }
+            }
+        }
+    }
+
+    // =================================================================================================================
+    // Bean Methods
+
+    public UIStyle getParentStyle() {
+        return parentStyle;
+    }
+
+    public void setParentStyle(UIStyle parentStyle) {
+        UIStyle old = getParentStyle();
+        this.parentStyle = parentStyle;
+        firePropertyChange("parentStyle", old, getParentStyle());
+    }
+
+    public List<UIProperty> getUiProperties() {
+        return uiProperties;
+    }
+
+    public void addUiProperty(UIProperty uiProperty) {
+        uiProperties.add(uiProperty);
+        // todo not quite sure what events we want here
+        fireIndexedPropertyChange("uiProperties", uiProperties.size(), null, uiProperty);
+//        firePropertyChange("uiProperties", null, uiProperties);
+    }
+
+    public void removeUiProperty(UIProperty uiProperty) {
+        int index = uiProperties.indexOf(uiProperty);
+        if (index != -1) {
+            uiProperties.remove(uiProperty);
+            // todo not quite sure what events we want here
+            fireIndexedPropertyChange("uiProperties", index, null, uiProperty);
+//            firePropertyChange("uiProperties", null, uiProperties);
+        }
+    }
+
+    public Typeface getFont() {
+        if (isFontInherited()) {
+            return parentStyle == null ? font : parentStyle.getFont();
+        } else {
+            return font;
+        }
+    }
+
+    public void setFont(Typeface font) {
+        Typeface old = getFont();
+        this.font = font;
+        firePropertyChange("font", old, font);
+    }
+
+    public boolean isFontInherited() {
+        return fontInherited;
+    }
+
+    public void setFontInherited(boolean b) {
+        boolean old = isFontInherited();
+        fontInherited = b;
+        firePropertyChange("fontInherited", old, b);
+
+        if (!fontInherited && font == null && parentStyle != null && parentStyle.getFont() != null) {
+            font = parentStyle.getFont().clone();
+            firePropertyChange("font", null, font);
+        }
+    }
+
+    public Matte getTextForeground() {
+        if (isTextForegroundInherited()) {
+            return parentStyle == null ? null : parentStyle.getTextForeground();
+        } else {
+            return textForeground;
+        }
+    }
+
+    public boolean isTextForegroundInherited() {
+        return textForegroundInherited;
+    }
+
+    public void setTextForegroundInherited(boolean b) {
+        boolean old = isTextForegroundInherited();
+        textForegroundInherited = b;
+        firePropertyChange("foregroundInherited", old, b);
+
+        if (!textForegroundInherited && textForeground == null && parentStyle != null &&
+                parentStyle.getTextForeground() != null) {
+            textForeground = parentStyle.getTextForeground().clone();
+            firePropertyChange("textForeground", null, textForeground);
+        }
+    }
+
+    public void setTextForeground(Matte textForeground) {
+        Matte old = this.textForeground;
+        if (old != null) old.removePropertyChangeListener(textForegoundListener);
+        this.textForeground = textForeground;
+        if (this.textForeground != null) this.textForeground.addPropertyChangeListener(textForegoundListener);
+        firePropertyChange("textForeground", old, this.textForeground);
+    }
+
+    public Matte getTextBackground() {
+        if (isTextBackgroundInherited()) {
+            return parentStyle == null ? null : parentStyle.getBackground();
+        } else {
+            return textBackground;
+        }
+    }
+
+    public boolean isTextBackgroundInherited() {
+        return textBackgroundInherited;
+    }
+
+    public void setTextBackgroundInherited(boolean b) {
+        boolean old = isBackgroundInherited();
+        textBackgroundInherited = b;
+        firePropertyChange("textBackgroundInherited", old, b);
+
+        if (!textBackgroundInherited && textBackground == null && parentStyle != null &&
+                parentStyle.getTextBackground() != null) {
+            textBackground = parentStyle.getTextBackground().clone();
+            firePropertyChange("textBackground", null, textBackground);
+        }
+    }
+
+    public void setTextBackground(Matte textBackground) {
+        Matte old = this.textBackground;
+        if (old != null) old.removePropertyChangeListener(textBackgroundListener);
+        this.textBackground = textBackground;
+        if (this.textBackground != null) this.textBackground.addPropertyChangeListener(textBackgroundListener);
+        firePropertyChange("textBackground", old, this.textBackground);
+    }
+
+    public Matte getBackground() {
+        if (isBackgroundInherited()) {
+            return parentStyle == null ? null : parentStyle.getBackground();
+        } else {
+            return background;
+        }
+    }
+
+    public boolean isBackgroundInherited() {
+        return backgroundInherited;
+    }
+
+    public void setBackgroundInherited(boolean b) {
+        boolean old = isBackgroundInherited();
+        backgroundInherited = b;
+        firePropertyChange("backgroundInherited", old, b);
+
+        if (!backgroundInherited && background == null && parentStyle != null && parentStyle.getBackground() != null) {
+            background = parentStyle.getBackground().clone();
+            firePropertyChange("background", null, background);
+        }
+    }
+
+    public void setBackground(Matte background) {
+        Matte old = this.background;
+        if (old != null) old.removePropertyChangeListener(backgroundListener);
+        this.background = background;
+        if (this.background != null) this.background.addPropertyChangeListener(backgroundListener);
+        firePropertyChange("background", old, this.background);
+    }
+
+    public HintAlphaInterpolation getHintAlphaInterpolation() {
+        return hintAlphaInterpolation;
+    }
+
+    public void setHintAlphaInterpolation(HintAlphaInterpolation hintAlphaInterpolation) {
+        HintAlphaInterpolation old = getHintAlphaInterpolation();
+        this.hintAlphaInterpolation = hintAlphaInterpolation;
+        firePropertyChange("hintAlphaInterpolation", old, getHintAlphaInterpolation());
+    }
+
+    public HintAntialiasing getHintAntialiasing() {
+        return hintAntialiasing;
+    }
+
+    public void setHintAntialiasing(HintAntialiasing hintAntialiasing) {
+        HintAntialiasing old = getHintAntialiasing();
+        this.hintAntialiasing = hintAntialiasing;
+        firePropertyChange("hintAntialiasing", old, getHintAntialiasing());
+    }
+
+    public HintColorRendering getHintColorRendering() {
+        return hintColorRendering;
+    }
+
+    public void setHintColorRendering(HintColorRendering hintColorRendering) {
+        HintColorRendering old = getHintColorRendering();
+        this.hintColorRendering = hintColorRendering;
+        firePropertyChange("hintColorRendering", old, getHintColorRendering());
+    }
+
+    public HintDithering getHintDithering() {
+        return hintDithering;
+    }
+
+    public void setHintDithering(HintDithering hintDithering) {
+        HintDithering old = getHintDithering();
+        this.hintDithering = hintDithering;
+        firePropertyChange("hintDithering", old, getHintDithering());
+    }
+
+    public HintFractionalMetrics getHintFractionalMetrics() {
+        return hintFractionalMetrics;
+    }
+
+    public void setHintFractionalMetrics(HintFractionalMetrics hintFractionalMetrics) {
+        HintFractionalMetrics old = getHintFractionalMetrics();
+        this.hintFractionalMetrics = hintFractionalMetrics;
+        firePropertyChange("hintFractionalMetrics", old, getHintFractionalMetrics());
+    }
+
+    public HintInterpolation getHintInterpolation() {
+        return hintInterpolation;
+    }
+
+    public void setHintInterpolation(HintInterpolation hintInterpolation) {
+        HintInterpolation old = getHintInterpolation();
+        this.hintInterpolation = hintInterpolation;
+        firePropertyChange("hintInterpolation", old, getHintInterpolation());
+    }
+
+    public HintRendering getHintRendering() {
+        return hintRendering;
+    }
+
+    public void setHintRendering(HintRendering hintRendering) {
+        HintRendering old = getHintRendering();
+        this.hintRendering = hintRendering;
+        firePropertyChange("hintRendering", old, getHintRendering());
+    }
+
+    public HintStrokeControl getHintStrokeControl() {
+        return hintStrokeControl;
+    }
+
+    public void setHintStrokeControl(HintStrokeControl hintStrokeControl) {
+        HintStrokeControl old = getHintStrokeControl();
+        this.hintStrokeControl = hintStrokeControl;
+        firePropertyChange("hintStrokeControl", old, getHintStrokeControl());
+    }
+
+    public HintTextAntialiasing getHintTextAntialiasing() {
+        return hintTextAntialiasing;
+    }
+
+    public void setHintTextAntialiasing(HintTextAntialiasing hintTextAntialiasing) {
+        HintTextAntialiasing old = getHintTextAntialiasing();
+        this.hintTextAntialiasing = hintTextAntialiasing;
+        firePropertyChange("hintTextAntialiasing", old, getHintTextAntialiasing());
+    }
+
+    public boolean isCacheSettingsInherited() {
+        return cacheSettingsInherited;
+    }
+
+    public void setCacheSettingsInherited(boolean cacheSettingsInherited) {
+        boolean old = isCacheSettingsInherited();
+        this.cacheSettingsInherited = cacheSettingsInherited;
+        firePropertyChange("cacheSettingsInherited", old, isCacheSettingsInherited());
+    }
+
+    public CacheMode getCacheMode() {
+        if (isCacheSettingsInherited()) {
+            return (parentStyle == null)?CacheMode.FIXED_SIZES : parentStyle.getCacheMode();
+        } else {
+            return cacheMode;
+        }
+    }
+
+    public void setCacheMode(CacheMode cacheMode) {
+        CacheMode old = this.cacheMode;
+        this.cacheMode = cacheMode;
+        if (isCacheSettingsInherited()) {
+            setCacheSettingsInherited(false);
+            UIStyle parent = getParentStyle();
+            setMaxHozCachedImgScaling(parent == null ? 1 : parent.getMaxHozCachedImgScaling());
+            setMaxVertCachedImgScaling(parent == null ? 1 : parent.getMaxVertCachedImgScaling());
+        }
+        firePropertyChange("cacheMode",old,cacheMode);
+    }
+
+    public double getMaxHozCachedImgScaling() {
+        if (isCacheSettingsInherited()) {
+            return parentStyle == null ? 1 : parentStyle.getMaxHozCachedImgScaling();
+        } else {
+            return maxHozCachedImgScaling;
+        }
+    }
+
+    public void setMaxHozCachedImgScaling(double maxHozCachedImgScaling) {
+        double old = getMaxHozCachedImgScaling();
+        this.maxHozCachedImgScaling = maxHozCachedImgScaling;
+        if (isCacheSettingsInherited()) {
+            setCacheSettingsInherited(false);
+            setCacheMode((parentStyle == null)?CacheMode.FIXED_SIZES : parentStyle.getCacheMode());
+            setMaxVertCachedImgScaling(parentStyle == null ? 1 : parentStyle.getMaxVertCachedImgScaling());
+        }
+        firePropertyChange("maxHozCachedImgScaling", old, getMaxHozCachedImgScaling());
+    }
+
+    public double getMaxVertCachedImgScaling() {
+        if (isCacheSettingsInherited()) {
+            return parentStyle == null ? 1 : parentStyle.getMaxVertCachedImgScaling();
+        } else {
+            return maxVertCachedImgScaling;
+        }
+    }
+
+    public void setMaxVertCachedImgScaling(double maxVertCachedImgScaling) {
+        double old = getMaxVertCachedImgScaling();
+        this.maxVertCachedImgScaling = maxVertCachedImgScaling;
+        if (isCacheSettingsInherited()) {
+            setCacheSettingsInherited(false);
+            setCacheMode((parentStyle == null)?CacheMode.FIXED_SIZES : parentStyle.getCacheMode());
+            setMaxHozCachedImgScaling(parentStyle == null ? 1 : parentStyle.getMaxHozCachedImgScaling());
+        }
+        firePropertyChange("maxVertCachedImgScaling", old, getMaxVertCachedImgScaling());
+    }
+}
+
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/BorderMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/BorderMapper.java
new file mode 100644
index 0000000..da35f40
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/BorderMapper.java
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel.jibxhelpers;
+
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IAliasable;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+import org.jdesktop.swingx.designer.jibxhelpers.ColorMapper;
+
+import javax.swing.border.LineBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.MatteBorder;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.Border;
+import javax.swing.BorderFactory;
+import java.awt.Insets;
+import java.awt.Color;
+import org.jdesktop.synthdesigner.synthmodel.PainterBorder;
+
+/**
+ * BorderMapper - JIBX xml mapper for swing standard borders
+ *
+ * @author Jasper Potts
+ */
+public class BorderMapper implements IMarshaller, IUnmarshaller, IAliasable {
+    private static enum BorderType {
+        empty, line, etched, bevel, matte, compound, painter
+    }
+    private static enum SubType {
+        raised(EtchedBorder.RAISED), lowered(EtchedBorder.LOWERED);
+        private int subtype;
+
+        SubType(int type) {
+            this.subtype = type;
+        }
+
+        public int getSubType() {
+            return subtype;
+        }
+    }
+    private static final String ELEMENT_NAME = "border";
+    private static final String TYPE_NAME = "type";
+    private static final String SUB_TYPE_NAME = "subtype";
+    private static final String TOP_NAME = "top";
+    private static final String BOTTOM_NAME = "bottom";
+    private static final String LEFT_NAME = "left";
+    private static final String RIGHT_NAME = "right";
+    private static final String THICKNESS_NAME = "thickness";
+    private static final String INSIDE_NAME = "inside";
+    private static final String OUTSIDE_NAME = "outside";
+    private static final String PAINTER_NAME = "painter";
+
+    private String uri;
+    private int index;
+    private String name;
+
+    public BorderMapper() {
+        uri = null;
+        index = 0;
+        name = ELEMENT_NAME;
+    }
+
+    public BorderMapper(String uri, int index, String name) {
+        this.uri = uri;
+        this.index = index;
+        this.name = name;
+    }
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws
+            JiBXException {
+        return iUnmarshallingContext.isAt(uri, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext)
+            throws JiBXException {
+        if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            if (object instanceof PainterBorder) {
+                PainterBorder border = (PainterBorder) object;
+                Insets insets = border.getBorderInsets();
+                ctx.startTagAttributes(index, name)
+                        .attribute(index, TYPE_NAME, BorderType.painter.toString())
+                        .attribute(index, PAINTER_NAME, border.getPainterName())
+                        .attribute(index, TOP_NAME, insets.top)
+                        .attribute(index, BOTTOM_NAME, insets.bottom)
+                        .attribute(index, LEFT_NAME, insets.left)
+                        .attribute(index, RIGHT_NAME, insets.right)
+                        .closeStartContent();
+                ctx.endTag(index, name);
+            } else if (object instanceof EmptyBorder) {
+                Insets insets = ((EmptyBorder) object).getBorderInsets();
+                ctx.startTagAttributes(index, name)
+                        .attribute(index, TYPE_NAME,
+                                BorderType.empty.toString())
+                        .attribute(index, TOP_NAME, insets.top)
+                        .attribute(index, BOTTOM_NAME, insets.bottom)
+                        .attribute(index, LEFT_NAME, insets.left)
+                        .attribute(index, RIGHT_NAME, insets.right)
+                        .closeStartEmpty();
+            } else if (object instanceof LineBorder) {
+                LineBorder border = (LineBorder) object;
+                ctx.startTagAttributes(index, name).
+                        attribute(index, TYPE_NAME, BorderType.line.toString()).
+                        attribute(index, THICKNESS_NAME, border.getThickness()).
+                        closeStartContent();
+                new ColorMapper().marshal(border.getLineColor(), ctx);
+                ctx.endTag(index, name);
+            } else if (object instanceof EtchedBorder) {
+                EtchedBorder border = (EtchedBorder) object;
+                ctx.startTagAttributes(index, name).
+                        attribute(index, TYPE_NAME,
+                                BorderType.etched.toString()).
+                        attribute(index, SUB_TYPE_NAME,
+                                border.getEtchType()==EtchedBorder.RAISED?
+                                        SubType.raised.toString():
+                                        SubType.lowered.toString()).
+                        closeStartContent();
+                new ColorMapper().marshal(border.getHighlightColor(), ctx);
+                new ColorMapper().marshal(border.getShadowColor(), ctx);
+                ctx.endTag(index, name);
+            } else if (object instanceof BevelBorder) {
+                BevelBorder border = (BevelBorder) object;
+                ctx.startTagAttributes(index, name).
+                        attribute(index, TYPE_NAME,
+                                BorderType.bevel.toString()).
+                        attribute(index, SUB_TYPE_NAME,
+                                border.getBevelType()==BevelBorder.RAISED?
+                                        SubType.raised.toString():
+                                        SubType.lowered.toString()).
+                        closeStartContent();
+                new ColorMapper().marshal(border.getHighlightInnerColor(), ctx);
+                new ColorMapper().marshal(border.getHighlightOuterColor(), ctx);
+                new ColorMapper().marshal(border.getShadowInnerColor(), ctx);
+                new ColorMapper().marshal(border.getHighlightOuterColor(), ctx);
+                ctx.endTag(index, name);
+            } else if (object instanceof MatteBorder) {
+                MatteBorder border = (MatteBorder) object;
+                Insets insets = ((EmptyBorder) object).getBorderInsets();
+                ctx.startTagAttributes(index, name)
+                        .attribute(index, TYPE_NAME,
+                                BorderType.matte.toString())
+                        .attribute(index, TOP_NAME, insets.top)
+                        .attribute(index, BOTTOM_NAME, insets.bottom)
+                        .attribute(index, LEFT_NAME, insets.left)
+                        .attribute(index, RIGHT_NAME, insets.right)
+                        .closeStartContent();
+                new ColorMapper().marshal(border.getMatteColor(), ctx);
+                // todo: we should support tiled icons here to be 100% complete
+                ctx.endTag(index, name);
+            } else if (object instanceof CompoundBorder) {
+                CompoundBorder border = (CompoundBorder) object;
+                ctx.startTagAttributes(index, name)
+                        .attribute(index, TYPE_NAME,
+                                BorderType.compound.toString())
+                        .closeStartContent();
+                new BorderMapper(null,0, INSIDE_NAME).marshal(border.getInsideBorder(),ctx);
+                new BorderMapper(null,0, OUTSIDE_NAME).marshal(border.getOutsideBorder(),ctx);
+                ctx.endTag(index, name);
+            } else {
+                throw new JiBXException("Invalid object type for marshaller");
+            }
+        }
+    }
+
+    public Object unmarshal(Object object,
+                            IUnmarshallingContext iUnmarshallingContext)
+            throws JiBXException {
+        Border border = null;
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(uri, name)) {
+            ctx.throwStartTagNameError(uri, name);
+        }
+        // get type
+        BorderType type = BorderType.valueOf(ctx.attributeText(uri, TYPE_NAME)
+                .toLowerCase());
+        int top,bottom,left,right;
+        Color color;
+        switch(type){
+            case empty:
+                top = ctx.attributeInt(uri, TOP_NAME, index);
+                bottom = ctx.attributeInt(uri, BOTTOM_NAME, index);
+                left = ctx.attributeInt(uri, LEFT_NAME, index);
+                right = ctx.attributeInt(uri, RIGHT_NAME, index);
+                border = BorderFactory.createEmptyBorder(top,left,bottom,right);
+                break;
+            case line:
+                int thickness = ctx.attributeInt(uri, THICKNESS_NAME, index);
+                ctx.parsePastStartTag(uri,name);
+                color = (Color)new ColorMapper().unmarshal(null,ctx);
+                border = BorderFactory.createLineBorder(color,thickness);
+                break;
+            case etched:
+                SubType etchedType = SubType.valueOf(
+                        ctx.attributeText(uri, SUB_TYPE_NAME).toLowerCase());
+                ctx.parsePastStartTag(uri,name);
+                Color highColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                Color shadowColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                border = BorderFactory.createEtchedBorder(
+                        etchedType.getSubType(),highColor,shadowColor);
+                break;
+            case bevel:
+                SubType bevelType = SubType.valueOf(
+                        ctx.attributeText(uri, SUB_TYPE_NAME).toLowerCase());
+                ctx.parsePastStartTag(uri,name);
+                Color innerHighColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                Color outerHighColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                Color innerShadowColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                Color outerShadowColor = (Color)new ColorMapper()
+                        .unmarshal(null,ctx);
+                border = BorderFactory.createBevelBorder(
+                        bevelType.getSubType(),outerHighColor,innerHighColor,
+                        outerShadowColor,innerShadowColor);
+                break;
+            case matte:
+                top = ctx.attributeInt(uri, TOP_NAME, index);
+                bottom = ctx.attributeInt(uri, BOTTOM_NAME, index);
+                left = ctx.attributeInt(uri, LEFT_NAME, index);
+                right = ctx.attributeInt(uri, RIGHT_NAME, index);
+                ctx.parsePastStartTag(uri,name);
+                color = (Color)new ColorMapper().unmarshal(null,ctx);
+                border = BorderFactory.createMatteBorder(top,left,bottom,right,
+                        color);
+                break;
+            case compound:
+                ctx.parsePastStartTag(uri,name);
+                Border inside = (Border) new BorderMapper(null,0, INSIDE_NAME)
+                        .unmarshal(null,ctx);
+                Border outside = (Border) new BorderMapper(null,0, OUTSIDE_NAME)
+                        .unmarshal(null,ctx);
+                border = BorderFactory.createCompoundBorder(outside, inside);
+                break;
+            case painter:
+                String painterName = ctx.attributeText(uri, PAINTER_NAME);
+                top = ctx.attributeInt(uri, TOP_NAME, index);
+                bottom = ctx.attributeInt(uri, BOTTOM_NAME, index);
+                left = ctx.attributeInt(uri, LEFT_NAME, index);
+                right = ctx.attributeInt(uri, RIGHT_NAME, index);
+                border = new PainterBorder(painterName, top, left, bottom, right);
+        }
+        ctx.parsePastEndTag(uri, name);
+        return border;
+    }
+}
+
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassConverter.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassConverter.java
new file mode 100644
index 0000000..ca59d1a
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassConverter.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel.jibxhelpers;
+
+/**
+ * ClassConverter
+ *
+ * @author Created by Jasper Potts (Jul 16, 2007)
+ */
+public class ClassConverter {
+
+    public static String classToString(Class c) {
+        return c == null ? "" : c.getName();
+    }
+
+    public static Class stringToClass(String className) {
+        if (className == null || className.length() == 0) {
+            return null;
+        }
+        try {
+            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+            if (classLoader == null) classLoader = ClassConverter.class.getClassLoader();
+            return classLoader.loadClass(className);
+        } catch (ClassNotFoundException e) {
+            System.err.println("Failed to find class with name [" + className + "] in ClassConverter");
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassMapper.java
new file mode 100644
index 0000000..5d3d765
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/ClassMapper.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel.jibxhelpers;
+
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+
+public class ClassMapper implements IMarshaller, IUnmarshaller {
+    private static final String ELEMENT_NAME = "type";
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(null, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Class)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            Class clazz = (Class) object;
+            ctx.startTagAttributes(0, ELEMENT_NAME).
+                    attribute(0, "value", clazz.getName()).
+                    closeStartEmpty();
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(null, ELEMENT_NAME)) {
+            ctx.throwStartTagNameError(null, ELEMENT_NAME);
+        }
+        // get values
+        String value = ctx.attributeText(null, "value", null);
+        ctx.parsePastEndTag(null, ELEMENT_NAME);
+        // create
+        try {
+            return Class.forName(value);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/FontMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/FontMapper.java
new file mode 100644
index 0000000..b815c0c
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/FontMapper.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel.jibxhelpers;
+
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+import java.awt.Font;
+
+/**
+ * FontMapper
+ *
+ * @author Created by Jasper Potts (Jun 8, 2007)
+ */
+public class FontMapper implements IMarshaller, IUnmarshaller {
+    private static final String ELEMENT_NAME = "font";
+    private static final String FAMILY_NAME = "family";
+    private static final String STYLE_NAME = "style";
+    private static final String SIZE_NAME = "size";
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(null, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof Font)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            Font font = (Font) object;
+            ctx.startTagAttributes(0, ELEMENT_NAME).
+                    attribute(0, FAMILY_NAME, font.getFamily()).
+                    attribute(0, STYLE_NAME, font.getStyle()).
+                    attribute(0, SIZE_NAME, font.getSize()).
+                    closeStartEmpty();
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(null, ELEMENT_NAME)) {
+            ctx.throwStartTagNameError(null, ELEMENT_NAME);
+        }
+        // get values
+        String name = ctx.attributeText(null, FAMILY_NAME, null);
+        int style = ctx.attributeInt(null, STYLE_NAME, 0);
+        int size = ctx.attributeInt(null, SIZE_NAME, 0);
+        ctx.parsePastEndTag(null, ELEMENT_NAME);
+        // create
+        return new Font(name, style, size);
+    }
+}
diff --git a/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/UIPropertyMapper.java b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/UIPropertyMapper.java
new file mode 100644
index 0000000..002ab6b
--- /dev/null
+++ b/jdk/make/tools/swing-nimbus/classes/org/jdesktop/synthdesigner/synthmodel/jibxhelpers/UIPropertyMapper.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package org.jdesktop.synthdesigner.synthmodel.jibxhelpers;
+
+import org.jdesktop.swingx.designer.jibxhelpers.DimensionMapper;
+import org.jdesktop.swingx.designer.jibxhelpers.InsetsMapper;
+import org.jdesktop.synthdesigner.synthmodel.UIProperty;
+import org.jibx.runtime.IMarshallable;
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+
+/**
+ * UIPropertyMapper
+ *
+ * @author Created by Jasper Potts (Jul 10, 2007)
+ */
+public class UIPropertyMapper implements IMarshaller, IUnmarshaller {
+    private static final String ELEMENT_NAME = "uiProperty";
+    private static final String NAME_NAME = "name";
+    private static final String TYPE_NAME = "type";
+    private static final String VALUE_NAME = "value";
+
+    public boolean isExtension(int i) {
+        return false;
+    }
+
+    public boolean isPresent(IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        return iUnmarshallingContext.isAt(null, ELEMENT_NAME);
+    }
+
+    public void marshal(Object object, IMarshallingContext iMarshallingContext) throws JiBXException {
+        if (!(object instanceof UIProperty)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else if (!(iMarshallingContext instanceof MarshallingContext)) {
+            throw new JiBXException("Invalid object type for marshaller");
+        } else {
+            MarshallingContext ctx = (MarshallingContext) iMarshallingContext;
+            UIProperty property = (UIProperty) object;
+            ctx.startTagAttributes(0, ELEMENT_NAME);
+            ctx.attribute(0, NAME_NAME, property.getName());
+            ctx.attribute(0, TYPE_NAME, property.getType().toString());
+            switch (property.getType()) {
+                case BOOLEAN:
+                case DOUBLE:
+                case INT:
+                case FLOAT:
+                case STRING:
+                    ctx.attribute(0, VALUE_NAME, property.getValue().toString());
+                    ctx.closeStartEmpty();
+                    break;
+                case INSETS:
+                    ctx.closeStartContent();
+                    new InsetsMapper().marshal(property.getValue(), ctx);
+                    ctx.endTag(0, ELEMENT_NAME);
+                    break;
+                case COLOR:
+                case FONT:
+                    ctx.closeStartContent();
+                    if (property.getValue() instanceof IMarshallable) {
+                        ((IMarshallable) property.getValue()).marshal(ctx);
+                    } else {
+                        throw new JiBXException("Mapped value is not marshallable");
+                    }
+                    ctx.endTag(0, ELEMENT_NAME);
+                    break;
+                case DIMENSION:
+                    ctx.closeStartContent();
+                    new DimensionMapper().marshal(property.getValue(), ctx);
+                    ctx.endTag(0, ELEMENT_NAME);
+                    break;
+                case BORDER:
+                    ctx.closeStartContent();
+                    new BorderMapper().marshal(property.getValue(), ctx);
+                    ctx.endTag(0, ELEMENT_NAME);
+                    break;
+            }
+        }
+    }
+
+    public Object unmarshal(Object object, IUnmarshallingContext iUnmarshallingContext) throws JiBXException {
+        // make sure we're at the appropriate start tag
+        UnmarshallingContext ctx = (UnmarshallingContext) iUnmarshallingContext;
+        if (!ctx.isAt(null, ELEMENT_NAME)) {
+            ctx.throwStartTagNameError(null, ELEMENT_NAME);
+        }
+        // get values
+        Object value = null;
+        String name = ctx.attributeText(null, NAME_NAME, null);
+        UIProperty.PropertyType type = UIProperty.PropertyType.valueOf(ctx.attributeText(null, TYPE_NAME, null));
+        switch (type) {
+            case BOOLEAN:
+                value = Boolean.parseBoolean(ctx.attributeText(null, VALUE_NAME, null));
+                break;
+            case DOUBLE:
+                value = Double.parseDouble(ctx.attributeText(null, VALUE_NAME, null));
+                break;
+            case INT:
+                value = Integer.parseInt(ctx.attributeText(null, VALUE_NAME, null));
+                break;
+            case FLOAT:
+                value = Float.parseFloat(ctx.attributeText(null, VALUE_NAME, null));
+                break;
+            case STRING:
+                value = ctx.attributeText(null, VALUE_NAME, null);
+                break;
+            case INSETS:
+                ctx.parsePastStartTag(null, ELEMENT_NAME);
+                value = new InsetsMapper().unmarshal(value, ctx);
+                break;
+            case COLOR:
+            case FONT:
+                ctx.parsePastStartTag(null, ELEMENT_NAME);
+                value = ctx.unmarshalElement();
+                break;
+            case DIMENSION:
+                ctx.parsePastStartTag(null, ELEMENT_NAME);
+                value = new DimensionMapper().unmarshal(value, ctx);
+                break;
+            case BORDER:
+                ctx.parsePastStartTag(null, ELEMENT_NAME);
+                value = new BorderMapper().unmarshal(value, ctx);
+                break;
+        }
+        ctx.parsePastEndTag(null, ELEMENT_NAME);
+        // create
+        return new UIProperty(name, type, value);
+    }
+}
diff --git a/jdk/src/share/bin/emessages.h b/jdk/src/share/bin/emessages.h
index 311a8fa..dfb95a6 100644
--- a/jdk/src/share/bin/emessages.h
+++ b/jdk/src/share/bin/emessages.h
@@ -50,6 +50,12 @@
 #define JAR_ERROR2      "Error: Unable to access jarfile %s"
 #define JAR_ERROR3      "Error: Invalid or corrupt jarfile %s"
 
+#define CLS_ERROR1      "Error: Could not find the main class %s.\n" JNI_ERROR
+#define CLS_ERROR2      "Error: Failed to load Main Class: %s\n%s"
+#define CLS_ERROR3      "Error: No main method found in specified class.\n" GEN_ERROR
+#define CLS_ERROR4      "Error: Main method not public\n" GEN_ERROR
+#define CLS_ERROR5      "Error: main-class: attribute exceeds system limits of %d bytes\n" GEN_ERROR
+
 #define CFG_WARN1       "Warning: %s VM not supported; %s VM will be used"
 #define CFG_WARN2       "Warning: No leading - on line %d of `%s'"
 #define CFG_WARN3       "Warning: Missing VM type on line %d of `%s'"
diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c
index 0feafc1..1801633 100644
--- a/jdk/src/share/bin/java.c
+++ b/jdk/src/share/bin/java.c
@@ -915,8 +915,14 @@
      * to avoid locating, expanding and parsing the manifest extra
      * times.
      */
-    if (info.main_class != NULL)
-        (void)JLI_StrCat(env_entry, info.main_class);
+    if (info.main_class != NULL) {
+        if (JLI_StrLen(info.main_class) <= MAXNAMELEN) {
+            (void)JLI_StrCat(env_entry, info.main_class);
+        } else {
+            JLI_ReportErrorMessage(CLS_ERROR5, MAXNAMELEN);
+            exit(1);
+        }
+    }
     (void)putenv(env_entry);
     ExecJRE(jre, new_argv);
     JLI_FreeManifest();
diff --git a/jdk/src/share/classes/com/sun/java/swing/Painter.java b/jdk/src/share/classes/com/sun/java/swing/Painter.java
new file mode 100644
index 0000000..e424839
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/java/swing/Painter.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.java.swing;
+
+/**
+ * This class is preserved for backward compatibility with JDK 6.
+ *
+ * @deprecated Use {@link javax.swing.Painter} instead.
+ */
+public interface Painter<T> extends javax.swing.Painter {
+}
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
index acb944d..fa2b69c 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
@@ -134,6 +134,15 @@
         super(filechooser);
     }
 
+    protected ActionMap createActionMap() {
+        ActionMap map = new ActionMapUIResource();
+        map.put("approveSelection", getApproveSelectionAction());
+        map.put("cancelSelection", getCancelSelectionAction());
+        map.put("Go Up", getChangeToParentDirectoryAction());
+        map.put("fileNameCompletion", getFileNameCompletionAction());
+        return map;
+    }
+
     public String getFileName() {
         JFileChooser fc = getFileChooser();
         String typedInName = fileNameTextField != null ?
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java b/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java
new file mode 100644
index 0000000..b554dbd7
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.java.swing.plaf.nimbus;
+
+/**
+ * This class is preserved for backward compatibility with JDK 6.
+ *
+ * @deprecated Use {@link javax.swing.plaf.nimbus.AbstractRegionPainter} instead.
+ */
+public abstract class AbstractRegionPainter extends javax.swing.plaf.nimbus.AbstractRegionPainter {
+}
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java
new file mode 100644
index 0000000..bff3973
--- /dev/null
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.java.swing.plaf.nimbus;
+
+/**
+ * This class is preserved for backward compatibility with JDK 6.
+ *
+ * @deprecated Use {@link javax.swing.plaf.nimbus.NimbusLookAndFeel} instead.
+ */
+public class NimbusLookAndFeel extends javax.swing.plaf.nimbus.NimbusLookAndFeel {
+}
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
index 788fe9f..e24067e 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
@@ -1009,6 +1009,7 @@
             "PopupMenu.background", MenuBackgroundColor,
             "PopupMenu.foreground", MenuTextColor,
             "PopupMenu.popupSound", "win.sound.menuPopup",
+            "PopupMenu.consumeEventOnClose", Boolean.TRUE,
 
             // Menus
             "Menu.font", MenuFont,
diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
index cb94371..e10773a 100644
--- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
+++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
@@ -22,7 +22,6 @@
  * CA 95054 USA or visit www.sun.com if you need additional information or
  * have any questions.
  */
-
 package com.sun.jmx.remote.internal;
 
 import java.io.IOException;
@@ -34,6 +33,7 @@
 import java.util.Map;
 import java.util.concurrent.Executor;
 
+import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import javax.security.auth.Subject;
@@ -54,7 +54,10 @@
 
 
 public abstract class ClientNotifForwarder {
-    public ClientNotifForwarder(Map<String, ?> env) {
+
+    private final AccessControlContext acc;
+
+    public ClientNotifForwarder(Map env) {
         this(null, env);
     }
 
@@ -87,6 +90,8 @@
             this.command = command;
             if (thread == null) {
                 thread = new Thread() {
+
+                    @Override
                     public void run() {
                         while (true) {
                             Runnable r;
@@ -130,6 +135,7 @@
 
         this.defaultClassLoader = defaultClassLoader;
         this.executor = ex;
+        this.acc = AccessController.getContext();
     }
 
     /**
@@ -380,28 +386,85 @@
         setState(TERMINATED);
     }
 
-// -------------------------------------------------
-// private classes
-// -------------------------------------------------
+
+    // -------------------------------------------------
+    // private classes
+    // -------------------------------------------------
     //
+
     private class NotifFetcher implements Runnable {
+
+        private volatile boolean alreadyLogged = false;
+
+        private void logOnce(String msg, SecurityException x) {
+            if (alreadyLogged) return;
+            // Log only once.
+            logger.config("setContextClassLoader",msg);
+            if (x != null) logger.fine("setContextClassLoader", x);
+            alreadyLogged = true;
+        }
+
+        // Set new context class loader, returns previous one.
+        private final ClassLoader setContextClassLoader(final ClassLoader loader) {
+            final AccessControlContext ctxt = ClientNotifForwarder.this.acc;
+            // if ctxt is null, log a config message and throw a
+            // SecurityException.
+            if (ctxt == null) {
+                logOnce("AccessControlContext must not be null.",null);
+                throw new SecurityException("AccessControlContext must not be null");
+            }
+            return AccessController.doPrivileged(
+                new PrivilegedAction<ClassLoader>() {
+                    public ClassLoader run() {
+                        try {
+                            // get context class loader - may throw
+                            // SecurityException - though unlikely.
+                            final ClassLoader previous =
+                                Thread.currentThread().getContextClassLoader();
+
+                            // if nothing needs to be done, break here...
+                            if (loader == previous) return previous;
+
+                            // reset context class loader - may throw
+                            // SecurityException
+                            Thread.currentThread().setContextClassLoader(loader);
+                            return previous;
+                        } catch (SecurityException x) {
+                            logOnce("Permission to set ContextClassLoader missing. " +
+                                    "Notifications will not be dispatched. " +
+                                    "Please check your Java policy configuration: " +
+                                    x, x);
+                            throw x;
+                        }
+                    }
+                }, ctxt);
+        }
+
         public void run() {
+            final ClassLoader previous;
+            if (defaultClassLoader != null) {
+                previous = setContextClassLoader(defaultClassLoader);
+            } else {
+                previous = null;
+            }
+            try {
+                doRun();
+            } finally {
+                if (defaultClassLoader != null) {
+                    setContextClassLoader(previous);
+                }
+            }
+        }
+
+        private void doRun() {
             synchronized (ClientNotifForwarder.this) {
                 currentFetchThread = Thread.currentThread();
 
-                if (state == STARTING)
+                if (state == STARTING) {
                     setState(STARTED);
+                }
             }
 
-            if (defaultClassLoader != null) {
-                AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                        public Void run() {
-                            Thread.currentThread().
-                                setContextClassLoader(defaultClassLoader);
-                            return null;
-                        }
-                    });
-            }
 
             NotificationResult nr = null;
             if (!shouldStop() && (nr = fetchNotifs()) != null) {
@@ -434,8 +497,9 @@
                         // check if an mbean unregistration notif
                         if (!listenerID.equals(mbeanRemovedNotifID)) {
                             final ClientListenerInfo li = infoList.get(listenerID);
-                            if (li != null)
-                                listeners.put(listenerID,li);
+                            if (li != null) {
+                                listeners.put(listenerID, li);
+                            }
                             continue;
                         }
                         final Notification notif = tn.getNotification();
@@ -799,9 +863,7 @@
     private long clientSequenceNumber = -1;
     private final int maxNotifications;
     private final long timeout;
-
     private Integer mbeanRemovedNotifID = null;
-
     private Thread currentFetchThread;
 
     // state
diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerAccessController.java b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerAccessController.java
index d75f829..71e6f6f 100644
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerAccessController.java
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerAccessController.java
@@ -111,6 +111,22 @@
      */
     protected abstract void checkWrite();
 
+    /**
+     * Check if the caller can create the named class.  The default
+     * implementation of this method calls {@link #checkWrite()}.
+     */
+    protected void checkCreate(String className) {
+        checkWrite();
+    }
+
+    /**
+     * Check if the caller can unregister the named MBean.  The default
+     * implementation of this method calls {@link #checkWrite()}.
+     */
+    protected void checkUnregister(ObjectName name) {
+        checkWrite();
+    }
+
     //--------------------------------------------
     //--------------------------------------------
     //
@@ -148,7 +164,7 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public ObjectInstance createMBean(String className, ObjectName name)
@@ -158,7 +174,7 @@
         MBeanRegistrationException,
         MBeanException,
         NotCompliantMBeanException {
-        checkWrite();
+        checkCreate(className);
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             Object object = getMBeanServer().instantiate(className);
@@ -170,7 +186,7 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public ObjectInstance createMBean(String className, ObjectName name,
@@ -181,7 +197,7 @@
         MBeanRegistrationException,
         MBeanException,
         NotCompliantMBeanException {
-        checkWrite();
+        checkCreate(className);
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             Object object = getMBeanServer().instantiate(className,
@@ -196,7 +212,7 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public ObjectInstance createMBean(String className,
@@ -209,7 +225,7 @@
         MBeanException,
         NotCompliantMBeanException,
         InstanceNotFoundException {
-        checkWrite();
+        checkCreate(className);
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             Object object = getMBeanServer().instantiate(className,
@@ -222,7 +238,7 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public ObjectInstance createMBean(String className,
@@ -237,7 +253,7 @@
         MBeanException,
         NotCompliantMBeanException,
         InstanceNotFoundException {
-        checkWrite();
+        checkCreate(className);
         SecurityManager sm = System.getSecurityManager();
         if (sm == null) {
             Object object = getMBeanServer().instantiate(className,
@@ -394,45 +410,45 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public Object instantiate(String className)
         throws ReflectionException, MBeanException {
-        checkWrite();
+        checkCreate(className);
         return getMBeanServer().instantiate(className);
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public Object instantiate(String className,
                               Object params[],
                               String signature[])
         throws ReflectionException, MBeanException {
-        checkWrite();
+        checkCreate(className);
         return getMBeanServer().instantiate(className, params, signature);
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public Object instantiate(String className, ObjectName loaderName)
         throws ReflectionException, MBeanException, InstanceNotFoundException {
-        checkWrite();
+        checkCreate(className);
         return getMBeanServer().instantiate(className, loaderName);
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkCreate(className)</code>, then forward this method to the
      * wrapped object.
      */
     public Object instantiate(String className, ObjectName loaderName,
                               Object params[], String signature[])
         throws ReflectionException, MBeanException, InstanceNotFoundException {
-        checkWrite();
+        checkCreate(className);
         return getMBeanServer().instantiate(className, loaderName,
                                             params, signature);
     }
@@ -579,12 +595,12 @@
     }
 
     /**
-     * Call <code>checkWrite()</code>, then forward this method to the
+     * Call <code>checkUnregister()</code>, then forward this method to the
      * wrapped object.
      */
     public void unregisterMBean(ObjectName name)
         throws InstanceNotFoundException, MBeanRegistrationException {
-        checkWrite();
+        checkUnregister(name);
         getMBeanServer().unregisterMBean(name);
     }
 
diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
index 66c78f2..a753e3a 100644
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
@@ -31,11 +31,17 @@
 import java.security.AccessController;
 import java.security.Principal;
 import java.security.PrivilegedAction;
-import java.util.Collection;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.regex.Pattern;
 import javax.management.MBeanServer;
+import javax.management.ObjectName;
 import javax.security.auth.Subject;
 
 /**
@@ -46,7 +52,8 @@
  * not allowed; in this case the request is not forwarded to the
  * wrapped object.</p>
  *
- * <p>This class implements the {@link #checkRead()} and {@link #checkWrite()}
+ * <p>This class implements the {@link #checkRead()}, {@link #checkWrite()},
+ * {@link #checkCreate(String)}, and {@link #checkUnregister(ObjectName)}
  * methods based on an access level properties file containing username/access
  * level pairs. The set of username/access level pairs is passed either as a
  * filename which denotes a properties file on disk, or directly as an instance
@@ -56,14 +63,50 @@
  * has exactly one access level. The same access level can be shared by several
  * usernames.</p>
  *
- * <p>The supported access level values are <i>readonly</i> and
- * <i>readwrite</i>.</p>
+ * <p>The supported access level values are {@code readonly} and
+ * {@code readwrite}.  The {@code readwrite} access level can be
+ * qualified by one or more <i>clauses</i>, where each clause looks
+ * like <code>create <i>classNamePattern</i></code> or {@code
+ * unregister}.  For example:</p>
+ *
+ * <pre>
+ * monitorRole  readonly
+ * controlRole  readwrite \
+ *              create javax.management.timer.*,javax.management.monitor.* \
+ *              unregister
+ * </pre>
+ *
+ * <p>(The continuation lines with {@code \} come from the parser for
+ * Properties files.)</p>
  */
 public class MBeanServerFileAccessController
     extends MBeanServerAccessController {
 
-    public static final String READONLY = "readonly";
-    public static final String READWRITE = "readwrite";
+    static final String READONLY = "readonly";
+    static final String READWRITE = "readwrite";
+
+    static final String CREATE = "create";
+    static final String UNREGISTER = "unregister";
+
+    private enum AccessType {READ, WRITE, CREATE, UNREGISTER};
+
+    private static class Access {
+        final boolean write;
+        final String[] createPatterns;
+        private boolean unregister;
+
+        Access(boolean write, boolean unregister, List<String> createPatternList) {
+            this.write = write;
+            int npats = (createPatternList == null) ? 0 : createPatternList.size();
+            if (npats == 0)
+                this.createPatterns = NO_STRINGS;
+            else
+                this.createPatterns = createPatternList.toArray(new String[npats]);
+            this.unregister = unregister;
+        }
+
+        private final String[] NO_STRINGS = new String[0];
+    }
 
     /**
      * <p>Create a new MBeanServerAccessController that forwards all the
@@ -87,8 +130,8 @@
         throws IOException {
         super();
         this.accessFileName = accessFileName;
-        props = propertiesFromFile(accessFileName);
-        checkValues(props);
+        Properties props = propertiesFromFile(accessFileName);
+        parseProperties(props);
     }
 
     /**
@@ -123,14 +166,14 @@
      * #setMBeanServer} method after doing access checks based on read and
      * write permissions.</p>
      *
-     * <p>This instance is initialized from the specified properties instance.
-     * This constructor makes a copy of the properties instance using its
-     * <code>clone</code> method and it is the copy that is consulted to check
-     * the username and access level of an incoming connection. The original
-     * properties object can be modified without affecting the copy. If the
-     * {@link #refresh} method is then called, the
-     * <code>MBeanServerFileAccessController</code> will make a new copy of the
-     * properties object at that time.</p>
+     * <p>This instance is initialized from the specified properties
+     * instance.  This constructor makes a copy of the properties
+     * instance and it is the copy that is consulted to check the
+     * username and access level of an incoming connection. The
+     * original properties object can be modified without affecting
+     * the copy. If the {@link #refresh} method is then called, the
+     * <code>MBeanServerFileAccessController</code> will make a new
+     * copy of the properties object at that time.</p>
      *
      * @param accessFileProps properties list containing the username/access
      * level entries.
@@ -145,8 +188,7 @@
         if (accessFileProps == null)
             throw new IllegalArgumentException("Null properties");
         originalProps = accessFileProps;
-        props = (Properties) accessFileProps.clone();
-        checkValues(props);
+        parseProperties(accessFileProps);
     }
 
     /**
@@ -155,14 +197,14 @@
      * #setMBeanServer} method after doing access checks based on read and
      * write permissions.</p>
      *
-     * <p>This instance is initialized from the specified properties instance.
-     * This constructor makes a copy of the properties instance using its
-     * <code>clone</code> method and it is the copy that is consulted to check
-     * the username and access level of an incoming connection. The original
-     * properties object can be modified without affecting the copy. If the
-     * {@link #refresh} method is then called, the
-     * <code>MBeanServerFileAccessController</code> will make a new copy of the
-     * properties object at that time.</p>
+     * <p>This instance is initialized from the specified properties
+     * instance.  This constructor makes a copy of the properties
+     * instance and it is the copy that is consulted to check the
+     * username and access level of an incoming connection. The
+     * original properties object can be modified without affecting
+     * the copy. If the {@link #refresh} method is then called, the
+     * <code>MBeanServerFileAccessController</code> will make a new
+     * copy of the properties object at that time.</p>
      *
      * @param accessFileProps properties list containing the username/access
      * level entries.
@@ -184,16 +226,36 @@
      * Check if the caller can do read operations. This method does
      * nothing if so, otherwise throws SecurityException.
      */
+    @Override
     public void checkRead() {
-        checkAccessLevel(READONLY);
+        checkAccess(AccessType.READ, null);
     }
 
     /**
      * Check if the caller can do write operations.  This method does
      * nothing if so, otherwise throws SecurityException.
      */
+    @Override
     public void checkWrite() {
-        checkAccessLevel(READWRITE);
+        checkAccess(AccessType.WRITE, null);
+    }
+
+    /**
+     * Check if the caller can create MBeans or instances of the given class.
+     * This method does nothing if so, otherwise throws SecurityException.
+     */
+    @Override
+    public void checkCreate(String className) {
+        checkAccess(AccessType.CREATE, className);
+    }
+
+    /**
+     * Check if the caller can do unregister operations.  This method does
+     * nothing if so, otherwise throws SecurityException.
+     */
+    @Override
+    public void checkUnregister(ObjectName name) {
+        checkAccess(AccessType.UNREGISTER, null);
     }
 
     /**
@@ -218,14 +280,13 @@
      * @exception IllegalArgumentException if any of the supplied access
      * level values differs from "readonly" or "readwrite".
      */
-    public void refresh() throws IOException {
-        synchronized (props) {
-            if (accessFileName == null)
-                props = (Properties) originalProps.clone();
-            else
-                props = propertiesFromFile(accessFileName);
-            checkValues(props);
-        }
+    public synchronized void refresh() throws IOException {
+        Properties props;
+        if (accessFileName == null)
+            props = (Properties) originalProps;
+        else
+            props = propertiesFromFile(accessFileName);
+        parseProperties(props);
     }
 
     private static Properties propertiesFromFile(String fname)
@@ -240,7 +301,7 @@
         }
     }
 
-    private void checkAccessLevel(String accessLevel) {
+    private synchronized void checkAccess(AccessType requiredAccess, String arg) {
         final AccessControlContext acc = AccessController.getContext();
         final Subject s =
             AccessController.doPrivileged(new PrivilegedAction<Subject>() {
@@ -249,39 +310,235 @@
                     }
                 });
         if (s == null) return; /* security has not been enabled */
-        final Set<Principal> principals = s.getPrincipals();
-        for (Principal p : principals) {
-            String grantedAccessLevel;
-            synchronized (props) {
-                grantedAccessLevel = props.getProperty(p.getName());
-            }
-            if (grantedAccessLevel != null) {
-                if (accessLevel.equals(READONLY) &&
-                    (grantedAccessLevel.equals(READONLY) ||
-                     grantedAccessLevel.equals(READWRITE)))
-                    return;
-                if (accessLevel.equals(READWRITE) &&
-                    grantedAccessLevel.equals(READWRITE))
+        final Set principals = s.getPrincipals();
+        String newPropertyValue = null;
+        for (Iterator i = principals.iterator(); i.hasNext(); ) {
+            final Principal p = (Principal) i.next();
+            Access access = accessMap.get(p.getName());
+            if (access != null) {
+                boolean ok;
+                switch (requiredAccess) {
+                    case READ:
+                        ok = true;  // all access entries imply read
+                        break;
+                    case WRITE:
+                        ok = access.write;
+                        break;
+                    case UNREGISTER:
+                        ok = access.unregister;
+                        if (!ok && access.write)
+                            newPropertyValue = "unregister";
+                        break;
+                    case CREATE:
+                        ok = checkCreateAccess(access, arg);
+                        if (!ok && access.write)
+                            newPropertyValue = "create " + arg;
+                        break;
+                    default:
+                        throw new AssertionError();
+                }
+                if (ok)
                     return;
             }
         }
-        throw new SecurityException("Access denied! Invalid access level for " +
-                                    "requested MBeanServer operation.");
+        SecurityException se = new SecurityException("Access denied! Invalid " +
+                "access level for requested MBeanServer operation.");
+        // Add some more information to help people with deployments that
+        // worked before we required explicit create clauses. We're not giving
+        // any information to the bad guys, other than that the access control
+        // is based on a file, which they could have worked out from the stack
+        // trace anyway.
+        if (newPropertyValue != null) {
+            SecurityException se2 = new SecurityException("Access property " +
+                    "for this identity should be similar to: " + READWRITE +
+                    " " + newPropertyValue);
+            se.initCause(se2);
+        }
+        throw se;
     }
 
-    private void checkValues(Properties props) {
-        Collection<?> c = props.values();
-        for (Iterator<?> i = c.iterator(); i.hasNext(); ) {
-            final String accessLevel = (String) i.next();
-            if (!accessLevel.equals(READONLY) &&
-                !accessLevel.equals(READWRITE)) {
-                throw new IllegalArgumentException(
-                    "Syntax error in access level entry [" + accessLevel + "]");
-            }
+    private static boolean checkCreateAccess(Access access, String className) {
+        for (String classNamePattern : access.createPatterns) {
+            if (classNameMatch(classNamePattern, className))
+                return true;
+        }
+        return false;
+    }
+
+    private static boolean classNameMatch(String pattern, String className) {
+        // We studiously avoided regexes when parsing the properties file,
+        // because that is done whenever the VM is started with the
+        // appropriate -Dcom.sun.management options, even if nobody ever
+        // creates an MBean.  We don't want to incur the overhead of loading
+        // all the regex code whenever those options are specified, but if we
+        // get as far as here then the VM is already running and somebody is
+        // doing the very unusual operation of remotely creating an MBean.
+        // Because that operation is so unusual, we don't try to optimize
+        // by hand-matching or by caching compiled Pattern objects.
+        StringBuilder sb = new StringBuilder();
+        StringTokenizer stok = new StringTokenizer(pattern, "*", true);
+        while (stok.hasMoreTokens()) {
+            String tok = stok.nextToken();
+            if (tok.equals("*"))
+                sb.append("[^.]*");
+            else
+                sb.append(Pattern.quote(tok));
+        }
+        return className.matches(sb.toString());
+    }
+
+    private void parseProperties(Properties props) {
+        this.accessMap = new HashMap<String, Access>();
+        for (Map.Entry<Object, Object> entry : props.entrySet()) {
+            String identity = (String) entry.getKey();
+            String accessString = (String) entry.getValue();
+            Access access = Parser.parseAccess(identity, accessString);
+            accessMap.put(identity, access);
         }
     }
 
-    private Properties props;
+    private static class Parser {
+        private final static int EOS = -1;  // pseudo-codepoint "end of string"
+        static {
+            assert !Character.isWhitespace(EOS);
+        }
+
+        private final String identity;  // just for better error messages
+        private final String s;  // the string we're parsing
+        private final int len;   // s.length()
+        private int i;
+        private int c;
+        // At any point, either c is s.codePointAt(i), or i == len and
+        // c is EOS.  We use int rather than char because it is conceivable
+        // (if unlikely) that a classname in a create clause might contain
+        // "supplementary characters", the ones that don't fit in the original
+        // 16 bits for Unicode.
+
+        private Parser(String identity, String s) {
+            this.identity = identity;
+            this.s = s;
+            this.len = s.length();
+            this.i = 0;
+            if (i < len)
+                this.c = s.codePointAt(i);
+            else
+                this.c = EOS;
+        }
+
+        static Access parseAccess(String identity, String s) {
+            return new Parser(identity, s).parseAccess();
+        }
+
+        private Access parseAccess() {
+            skipSpace();
+            String type = parseWord();
+            Access access;
+            if (type.equals(READONLY))
+                access = new Access(false, false, null);
+            else if (type.equals(READWRITE))
+                access = parseReadWrite();
+            else {
+                throw syntax("Expected " + READONLY + " or " + READWRITE +
+                        ": " + type);
+            }
+            if (c != EOS)
+                throw syntax("Extra text at end of line");
+            return access;
+        }
+
+        private Access parseReadWrite() {
+            List<String> createClasses = new ArrayList<String>();
+            boolean unregister = false;
+            while (true) {
+                skipSpace();
+                if (c == EOS)
+                    break;
+                String type = parseWord();
+                if (type.equals(UNREGISTER))
+                    unregister = true;
+                else if (type.equals(CREATE))
+                    parseCreate(createClasses);
+                else
+                    throw syntax("Unrecognized keyword " + type);
+            }
+            return new Access(true, unregister, createClasses);
+        }
+
+        private void parseCreate(List<String> createClasses) {
+            while (true) {
+                skipSpace();
+                createClasses.add(parseClassName());
+                skipSpace();
+                if (c == ',')
+                    next();
+                else
+                    break;
+            }
+        }
+
+        private String parseClassName() {
+            // We don't check that classname components begin with suitable
+            // characters (so we accept 1.2.3 for example).  This means that
+            // there are only two states, which we can call dotOK and !dotOK
+            // according as a dot (.) is legal or not.  Initially we're in
+            // !dotOK since a classname can't start with a dot; after a dot
+            // we're in !dotOK again; and after any other characters we're in
+            // dotOK.  The classname is only accepted if we end in dotOK,
+            // so we reject an empty name or a name that ends with a dot.
+            final int start = i;
+            boolean dotOK = false;
+            while (true) {
+                if (c == '.') {
+                    if (!dotOK)
+                        throw syntax("Bad . in class name");
+                    dotOK = false;
+                } else if (c == '*' || Character.isJavaIdentifierPart(c))
+                    dotOK = true;
+                else
+                    break;
+                next();
+            }
+            String className = s.substring(start, i);
+            if (!dotOK)
+                throw syntax("Bad class name " + className);
+            return className;
+        }
+
+        // Advance c and i to the next character, unless already at EOS.
+        private void next() {
+            if (c != EOS) {
+                i += Character.charCount(c);
+                if (i < len)
+                    c = s.codePointAt(i);
+                else
+                    c = EOS;
+            }
+        }
+
+        private void skipSpace() {
+            while (Character.isWhitespace(c))
+                next();
+        }
+
+        private String parseWord() {
+            skipSpace();
+            if (c == EOS)
+                throw syntax("Expected word at end of line");
+            final int start = i;
+            while (c != EOS && !Character.isWhitespace(c))
+                next();
+            String word = s.substring(start, i);
+            skipSpace();
+            return word;
+        }
+
+        private IllegalArgumentException syntax(String msg) {
+            return new IllegalArgumentException(
+                    msg + " [" + identity + " " + s + "]");
+        }
+    }
+
+    private Map<String, Access> accessMap;
     private Properties originalProps;
     private String accessFileName;
 }
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
index bec6fd0..5f9462c 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java
@@ -302,7 +302,16 @@
 
         schemaTrees = new Hashtable(11, 0.75f);
         initEnv();
-        connect(false);
+        try {
+            connect(false);
+        } catch (NamingException e) {
+            try {
+                close();
+            } catch (Exception e2) {
+                // Nothing
+            }
+            throw e;
+        }
     }
 
     LdapCtx(LdapCtx existing, String newDN) throws NamingException {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
index a413116..0f6a70e 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,12 +33,33 @@
 
 final class VersionHelper12 extends VersionHelper {
 
+    // System property to control whether classes may be loaded from an
+    // arbitrary URL code base.
+    private static final String TRUST_URL_CODEBASE_PROPERTY =
+        "com.sun.jndi.ldap.object.trustURLCodebase";
+
+    // Determine whether classes may be loaded from an arbitrary URL code base.
+    private static final String trustURLCodebase =
+        AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                public String run() {
+                    return System.getProperty(TRUST_URL_CODEBASE_PROPERTY,
+                            "false");
+                }
+            }
+        );
+
     VersionHelper12() {} // Disallow external from creating one of these.
 
     ClassLoader getURLClassLoader(String[] url)
         throws MalformedURLException {
             ClassLoader parent = getContextClassLoader();
-            if (url != null) {
+            /*
+             * Classes may only be loaded from an arbitrary URL code base when
+             * the system property com.sun.jndi.ldap.object.trustURLCodebase
+             * has been set to "true".
+             */
+            if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) {
                 return URLClassLoader.newInstance(getUrlArray(url), parent);
             } else {
                 return parent;
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java b/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java
index d19ff41..4377334 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java
@@ -54,6 +54,7 @@
             return;
         active = true;
         audiothread = new Thread(this);
+        audiothread.setDaemon(true);
         audiothread.setPriority(Thread.MAX_PRIORITY);
         audiothread.start();
     }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java
index 8bb5f2e..96a575f 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java
@@ -93,7 +93,6 @@
     protected double portamento_time = 1; // keyschanges per control buffer time
     protected int[] portamento_lastnote = new int[128];
     protected int portamento_lastnote_ix = 0;
-    private int portamento_control_note = -1;
     private boolean portamento = false;
     private boolean mono = false;
     private boolean mute = false;
@@ -369,12 +368,12 @@
         voice.setSoloMute(solomute);
         if (releaseTriggered)
             return;
-        if (portamento_control_note != -1) {
+        if (controller[84] != 0) {
             voice.co_noteon_keynumber[0]
-                    = (tuning.getTuning(portamento_control_note) / 100.0)
+                    = (tuning.getTuning(controller[84]) / 100.0)
                     * (1f / 128f);
             voice.portamento = true;
-            portamento_control_note = -1;
+            controlChange(84, 0);
         } else if (portamento) {
             if (mono) {
                 if (portamento_lastnote[0] != -1) {
@@ -382,7 +381,7 @@
                             = (tuning.getTuning(portamento_lastnote[0]) / 100.0)
                             * (1f / 128f);
                     voice.portamento = true;
-                    portamento_control_note = -1;
+                    controlChange(84, 0);
                 }
                 portamento_lastnote[0] = noteNumber;
             } else {
@@ -449,19 +448,19 @@
                     }
                 }
 
-                if (portamento_control_note != -1) {
+                if (controller[84] != 0) {
                     boolean n_found = false;
                     for (int i = 0; i < voices.length; i++) {
                         if (voices[i].on && voices[i].channel == channel
                                 && voices[i].active
-                                && voices[i].note == portamento_control_note
+                                && voices[i].note == controller[84]
                                 && voices[i].releaseTriggered == false) {
                             voices[i].portamento = true;
                             voices[i].setNote(noteNumber);
                             n_found = true;
                         }
                     }
-                    portamento_control_note = -1;
+                    controlChange(84, 0);
                     if (n_found)
                         return;
                 }
@@ -556,6 +555,18 @@
                         && voices[i].releaseTriggered == false) {
                     voices[i].noteOff(velocity);
                 }
+                // We must also check stolen voices
+                if (voices[i].stealer_channel == this && voices[i].stealer_noteNumber == noteNumber) {
+                    SoftVoice v = voices[i];
+                    v.stealer_releaseTriggered = false;
+                    v.stealer_channel = null;
+                    v.stealer_performer = null;
+                    v.stealer_voiceID = -1;
+                    v.stealer_noteNumber = 0;
+                    v.stealer_velocity = 0;
+                    v.stealer_extendedConnectionBlocks = null;
+                    v.stealer_channelmixer = null;
+                }
             }
 
             // Try play back note-off triggered voices,
@@ -1141,9 +1152,6 @@
                     }
                 }
                 break;
-            case 84:
-                portamento_control_note = value;
-                break;
             case 98:
                 nrpn_control = (nrpn_control & (127 << 7)) + value;
                 rpn_control = RPN_NULL_VALUE;
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java b/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java
index 0a9f6443..59778cd 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java
@@ -38,11 +38,11 @@
 
         private float[] delaybuffer;
         private int rovepos = 0;
-        private volatile float gain = 1;
-        private volatile float rgain = 0;
-        private volatile float delay = 0;
+        private float gain = 1;
+        private float rgain = 0;
+        private float delay = 0;
         private float lastdelay = 0;
-        private volatile float feedback = 0;
+        private float feedback = 0;
 
         public VariableDelay(int maxbuffersize) {
             delaybuffer = new float[maxbuffersize];
@@ -115,10 +115,8 @@
 
     private static class LFODelay {
 
-        private volatile double c_cos_delta;
-        private volatile double c_sin_delta;
-        private double c_cos = 1;
-        private double c_sin = 0;
+        private double phase = 1;
+        private double phase_step = 0;
         private double depth = 0;
         private VariableDelay vdelay;
         private double samplerate;
@@ -139,13 +137,11 @@
 
         public void setRate(double rate) {
             double g = (Math.PI * 2) * (rate / controlrate);
-            c_cos_delta = Math.cos(g);
-            c_sin_delta = Math.sin(g);
+            phase_step = g;
         }
 
         public void setPhase(double phase) {
-            c_cos = Math.cos(phase);
-            c_sin = Math.sin(phase);
+            this.phase = phase;
         }
 
         public void setFeedBack(float feedback) {
@@ -161,16 +157,16 @@
         }
 
         public void processMix(float[] in, float[] out, float[] rout) {
-            c_cos = c_cos * c_cos_delta - c_sin * c_sin_delta;
-            c_sin = c_cos * c_sin_delta + c_sin * c_cos_delta;
-            vdelay.setDelay((float) (depth * 0.5 * (c_cos + 2)));
+            phase += phase_step;
+            while(phase > (Math.PI * 2)) phase -= (Math.PI * 2);
+            vdelay.setDelay((float) (depth * 0.5 * (Math.cos(phase) + 2)));
             vdelay.processMix(in, out, rout);
         }
 
         public void processReplace(float[] in, float[] out, float[] rout) {
-            c_cos = c_cos * c_cos_delta - c_sin * c_sin_delta;
-            c_sin = c_cos * c_sin_delta + c_sin * c_cos_delta;
-            vdelay.setDelay((float) (depth * 0.5 * (c_cos + 2)));
+            phase += phase_step;
+            while(phase > (Math.PI * 2)) phase -= (Math.PI * 2);
+            vdelay.setDelay((float) (depth * 0.5 * (Math.cos(phase) + 2)));
             vdelay.processReplace(in, out, rout);
 
         }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java b/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java
index 0468f15..c7ed487 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java
@@ -543,8 +543,6 @@
 
     public void filter1(SoftAudioBuffer sbuffer) {
 
-        float[] buffer = sbuffer.array();
-
         if (dirty) {
             filter1calc();
             dirty = false;
@@ -559,6 +557,7 @@
 
         if (wet > 0 || last_wet > 0) {
 
+            float[] buffer = sbuffer.array();
             int len = buffer.length;
             float a0 = this.last_a0;
             float q = this.last_q;
@@ -577,14 +576,16 @@
                     q += q_delta;
                     gain += gain_delta;
                     wet += wet_delta;
-                    y1 = (1 - q * a0) * y1 - (a0) * y2 + (a0) * buffer[i];
-                    y2 = (1 - q * a0) * y2 + (a0) * y1;
+                    float ga0 = (1 - q * a0);
+                    y1 = ga0 * y1 + (a0) * (buffer[i] - y2);
+                    y2 = ga0 * y2 + (a0) * y1;
                     buffer[i] = y2 * gain * wet + buffer[i] * (1 - wet);
                 }
             } else if (a0_delta == 0 && q_delta == 0) {
+                float ga0 = (1 - q * a0);
                 for (int i = 0; i < len; i++) {
-                    y1 = (1 - q * a0) * y1 - (a0) * y2 + (a0) * buffer[i];
-                    y2 = (1 - q * a0) * y2 + (a0) * y1;
+                    y1 = ga0 * y1 + (a0) * (buffer[i] - y2);
+                    y2 = ga0 * y2 + (a0) * y1;
                     buffer[i] = y2 * gain;
                 }
             } else {
@@ -592,8 +593,9 @@
                     a0 += a0_delta;
                     q += q_delta;
                     gain += gain_delta;
-                    y1 = (1 - q * a0) * y1 - (a0) * y2 + (a0) * buffer[i];
-                    y2 = (1 - q * a0) * y2 + (a0) * y1;
+                    float ga0 = (1 - q * a0);
+                    y1 = ga0 * y1 + (a0) * (buffer[i] - y2);
+                    y2 = ga0 * y2 + (a0) * y1;
                     buffer[i] = y2 * gain;
                 }
             }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java b/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java
index 98d205b..b647ba7 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java
@@ -216,6 +216,7 @@
             };
 
             thread = new Thread(runnable);
+            thread.setDaemon(true);
             thread.setPriority(Thread.MAX_PRIORITY);
             thread.start();
         }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java b/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java
index adfe9e0..5e2ea0b 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java
@@ -45,6 +45,13 @@
     private double sin_factor = 0;
     private static double PI2 = 2.0 * Math.PI;
 
+    public SoftLowFrequencyOscillator() {
+        // If sin_step is 0 then sin_stepfreq must be -INF
+        for (int i = 0; i < sin_stepfreq.length; i++) {
+            sin_stepfreq[i] = Double.NEGATIVE_INFINITY;
+        }
+    }
+
     public void reset() {
         for (int i = 0; i < used_count; i++) {
             out[i][0] = 0;
@@ -53,7 +60,8 @@
             freq[i][0] = 0;
             delay_counter[i] = 0;
             sin_phase[i] = 0;
-            sin_stepfreq[i] = 0;
+            // If sin_step is 0 then sin_stepfreq must be -INF
+            sin_stepfreq[i] = Double.NEGATIVE_INFINITY;
             sin_step[i] = 0;
         }
         used_count = 0;
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java
index 1f38058..b62d1d4 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java
@@ -48,16 +48,18 @@
 
     public final static int CHANNEL_LEFT = 0;
     public final static int CHANNEL_RIGHT = 1;
-    public final static int CHANNEL_EFFECT1 = 2;
-    public final static int CHANNEL_EFFECT2 = 3;
-    public final static int CHANNEL_EFFECT3 = 4;
-    public final static int CHANNEL_EFFECT4 = 5;
+    public final static int CHANNEL_MONO = 2;
+    public final static int CHANNEL_EFFECT1 = 3;
+    public final static int CHANNEL_EFFECT2 = 4;
+    public final static int CHANNEL_EFFECT3 = 5;
+    public final static int CHANNEL_EFFECT4 = 6;
     public final static int CHANNEL_LEFT_DRY = 10;
     public final static int CHANNEL_RIGHT_DRY = 11;
     public final static int CHANNEL_SCRATCH1 = 12;
     public final static int CHANNEL_SCRATCH2 = 13;
     public final static int CHANNEL_CHANNELMIXER_LEFT = 14;
     public final static int CHANNEL_CHANNELMIXER_RIGHT = 15;
+    public final static int CHANNEL_CHANNELMIXER_MONO = 16;
     protected boolean active_sensing_on = false;
     private long msec_last_activity = -1;
     private boolean pusher_silent = false;
@@ -485,8 +487,10 @@
             // to channelmixer left,right input/output
             SoftAudioBuffer leftbak = buffers[CHANNEL_LEFT];
             SoftAudioBuffer rightbak = buffers[CHANNEL_RIGHT];
+            SoftAudioBuffer monobak = buffers[CHANNEL_MONO];
             buffers[CHANNEL_LEFT] = buffers[CHANNEL_CHANNELMIXER_LEFT];
-            buffers[CHANNEL_RIGHT] = buffers[CHANNEL_CHANNELMIXER_LEFT];
+            buffers[CHANNEL_RIGHT] = buffers[CHANNEL_CHANNELMIXER_RIGHT];
+            buffers[CHANNEL_MONO] = buffers[CHANNEL_CHANNELMIXER_MONO];
 
             int bufferlen = buffers[CHANNEL_LEFT].getSize();
 
@@ -503,6 +507,7 @@
             for (ModelChannelMixer cmixer : act_registeredMixers) {
                 for (int i = 0; i < cbuffer.length; i++)
                     Arrays.fill(cbuffer[i], 0);
+                buffers[CHANNEL_MONO].clear();
                 boolean hasactivevoices = false;
                 for (int i = 0; i < voicestatus.length; i++)
                     if (voicestatus[i].active)
@@ -517,6 +522,26 @@
                     }
                 }
 
+                if(!buffers[CHANNEL_MONO].isSilent())
+                {
+                    float[] mono = buffers[CHANNEL_MONO].array();
+                    float[] left = buffers[CHANNEL_LEFT].array();
+                    if (nrofchannels != 1) {
+                        float[] right = buffers[CHANNEL_RIGHT].array();
+                        for (int i = 0; i < bufferlen; i++) {
+                            float v = mono[i];
+                            left[i] += v;
+                            right[i] += v;
+                        }
+                    }
+                    else
+                    {
+                        for (int i = 0; i < bufferlen; i++) {
+                            left[i] += mono[i];
+                        }
+                    }
+                }
+
                 for (int i = 0; i < cbuffer.length; i++) {
                     float[] cbuff = cbuffer[i];
                     float[] obuff = obuffer[i];
@@ -539,6 +564,7 @@
 
             buffers[CHANNEL_LEFT] = leftbak;
             buffers[CHANNEL_RIGHT] = rightbak;
+            buffers[CHANNEL_MONO] = monobak;
 
         }
 
@@ -547,6 +573,27 @@
                 if (voicestatus[i].channelmixer == null)
                     voicestatus[i].processAudioLogic(buffers);
 
+        if(!buffers[CHANNEL_MONO].isSilent())
+        {
+            float[] mono = buffers[CHANNEL_MONO].array();
+            float[] left = buffers[CHANNEL_LEFT].array();
+            int bufferlen = buffers[CHANNEL_LEFT].getSize();
+            if (nrofchannels != 1) {
+                float[] right = buffers[CHANNEL_RIGHT].array();
+                for (int i = 0; i < bufferlen; i++) {
+                    float v = mono[i];
+                    left[i] += v;
+                    right[i] += v;
+                }
+            }
+            else
+            {
+                for (int i = 0; i < bufferlen; i++) {
+                    left[i] += mono[i];
+                }
+            }
+        }
+
         // Run effects
         if (synth.chorus_on)
             chorus.processAudio();
@@ -665,7 +712,7 @@
                                 / synth.getControlRate());
 
         control_mutex = synth.control_mutex;
-        buffers = new SoftAudioBuffer[16];
+        buffers = new SoftAudioBuffer[17];
         for (int i = 0; i < buffers.length; i++) {
             buffers[i] = new SoftAudioBuffer(buffersize, synth.getFormat());
         }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
index 3f6c12f..ab46b2d 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
@@ -889,9 +889,12 @@
             return;
         }
         synchronized (control_mutex) {
+            Throwable causeException = null;
             try {
-                if (line != null)
+                if (line != null) {
+                    // can throw IllegalArgumentException
                     setFormat(line.getFormat());
+                }
 
                 AudioInputStream ais = openStream(getFormat(), info);
 
@@ -900,10 +903,13 @@
 
                 if (line == null)
                 {
-                    if(testline != null)
+                    if (testline != null) {
                         line = testline;
-                    else
+                    } else {
+                        // can throw LineUnavailableException,
+                        // IllegalArgumentException, SecurityException
                         line = AudioSystem.getSourceDataLine(getFormat());
+                    }
                 }
 
                 double latency = this.latency;
@@ -911,6 +917,8 @@
                 if (!line.isOpen()) {
                     int bufferSize = getFormat().getFrameSize()
                         * (int)(getFormat().getFrameRate() * (latency/1000000f));
+                    // can throw LineUnavailableException,
+                    // IllegalArgumentException, SecurityException
                     line.open(getFormat(), bufferSize);
 
                     // Remember that we opened that line
@@ -954,13 +962,22 @@
                     weakstream.sourceDataLine = sourceDataLine;
                 }
 
-
-
             } catch (LineUnavailableException e) {
+                causeException = e;
+            } catch (IllegalArgumentException e) {
+                causeException = e;
+            } catch (SecurityException e) {
+                causeException = e;
+            }
+
+            if (causeException != null) {
                 if (isOpen())
                     close();
                 // am: need MidiUnavailableException(Throwable) ctor!
-                throw new MidiUnavailableException(e.toString());
+                MidiUnavailableException ex = new MidiUnavailableException(
+                        "Can not open line");
+                ex.initCause(causeException);
+                throw ex;
             }
 
         }
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java
index 49662b7..cec2e30 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java
@@ -782,6 +782,7 @@
 
         SoftAudioBuffer left = buffer[SoftMainMixer.CHANNEL_LEFT];
         SoftAudioBuffer right = buffer[SoftMainMixer.CHANNEL_RIGHT];
+        SoftAudioBuffer mono = buffer[SoftMainMixer.CHANNEL_MONO];
         SoftAudioBuffer eff1 = buffer[SoftMainMixer.CHANNEL_EFFECT1];
         SoftAudioBuffer eff2 = buffer[SoftMainMixer.CHANNEL_EFFECT2];
         SoftAudioBuffer leftdry = buffer[SoftMainMixer.CHANNEL_LEFT_DRY];
@@ -803,13 +804,22 @@
                 mixAudioStream(rightdry, left, last_out_mixer_left,
                         out_mixer_left);
         } else {
-            mixAudioStream(leftdry, left, last_out_mixer_left, out_mixer_left);
-            if (rightdry != null)
-                mixAudioStream(rightdry, right, last_out_mixer_right,
-                        out_mixer_right);
+            if(rightdry == null &&
+                    last_out_mixer_left == last_out_mixer_right &&
+                    out_mixer_left == out_mixer_right)
+            {
+                mixAudioStream(leftdry, mono, last_out_mixer_left, out_mixer_left);
+            }
             else
-                mixAudioStream(leftdry, right, last_out_mixer_right,
+            {
+                mixAudioStream(leftdry, left, last_out_mixer_left, out_mixer_left);
+                if (rightdry != null)
+                    mixAudioStream(rightdry, right, last_out_mixer_right,
                         out_mixer_right);
+                else
+                    mixAudioStream(leftdry, right, last_out_mixer_right,
+                        out_mixer_right);
+            }
         }
 
         if (rightdry == null) {
diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java
index f99e2bf..0710dbb 100644
--- a/jdk/src/share/classes/java/awt/Color.java
+++ b/jdk/src/share/classes/java/awt/Color.java
@@ -687,7 +687,7 @@
      * @since   JDK1.0
      */
     public boolean equals(Object obj) {
-        return obj instanceof Color && ((Color)obj).value == this.value;
+        return obj instanceof Color && ((Color)obj).getRGB() == this.getRGB();
     }
 
     /**
diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java
index 0374333..84d7a81 100644
--- a/jdk/src/share/classes/java/awt/Component.java
+++ b/jdk/src/share/classes/java/awt/Component.java
@@ -6666,7 +6666,7 @@
 
 
             // Update stacking order
-            peer.setZOrder(getHWPeerAboveMe());
+            updateZOrder();
 
             if (!isAddNotifyComplete) {
                 mixOnShowing();
@@ -9838,4 +9838,11 @@
 
         return doesClassImplement(obj.getClass(), interfaceName);
     }
+
+    // Note that the method is overriden in the Window class,
+    // a window doesn't need to be updated in the Z-order.
+    void updateZOrder() {
+        peer.setZOrder(getHWPeerAboveMe());
+    }
+
 }
diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java
index 9a184a7..305a4fe 100644
--- a/jdk/src/share/classes/java/awt/Container.java
+++ b/jdk/src/share/classes/java/awt/Container.java
@@ -840,7 +840,7 @@
                     // Native container changed - need to reparent native widgets
                     newNativeContainer.reparentChild(comp);
                 }
-                comp.peer.setZOrder(comp.getHWPeerAboveMe());
+                comp.updateZOrder();
 
                 if (!comp.isLightweight() && isLightweight()) {
                     // If component is heavyweight and one of the containers is lightweight
@@ -3977,10 +3977,8 @@
             Component comp = getComponent(index);
             if (!comp.isLightweight()) {
                 comp.applyCurrentShape();
-                if (comp instanceof Container && ((Container)comp).getLayout() == null) {
-                    ((Container)comp).recursiveApplyCurrentShape();
-                }
-            } else if (comp instanceof Container &&
+            }
+            if (comp instanceof Container &&
                     ((Container)comp).hasHeavyweightDescendants()) {
                 ((Container)comp).recursiveApplyCurrentShape();
             }
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index 01f401e..f73e0e9 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -37,6 +37,8 @@
 import java.awt.peer.FontPeer;
 import java.io.*;
 import java.lang.ref.SoftReference;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
 import java.text.AttributedCharacterIterator.Attribute;
 import java.text.CharacterIterator;
 import java.text.StringCharacterIterator;
@@ -51,6 +53,7 @@
 import sun.font.AttributeValues;
 import sun.font.EAttribute;
 import sun.font.CompositeFont;
+import sun.font.CreatedFontTracker;
 import sun.font.Font2D;
 import sun.font.Font2DHandle;
 import sun.font.FontManager;
@@ -575,14 +578,16 @@
     }
 
     /* used to implement Font.createFont */
-    private Font(File fontFile, int fontFormat, boolean isCopy)
+    private Font(File fontFile, int fontFormat,
+                 boolean isCopy, CreatedFontTracker tracker)
         throws FontFormatException {
         this.createdFont = true;
         /* Font2D instances created by this method track their font file
          * so that when the Font2D is GC'd it can also remove the file.
          */
         this.font2DHandle =
-            FontManager.createFont2D(fontFile, fontFormat, isCopy).handle;
+            FontManager.createFont2D(fontFile, fontFormat,
+                                     isCopy, tracker).handle;
         this.name = this.font2DHandle.font2D.getFontName(Locale.getDefault());
         this.style = Font.PLAIN;
         this.size = 1;
@@ -788,6 +793,29 @@
     }
 
     /**
+     * Used with the byte count tracker for fonts created from streams.
+     * If a thread can create temp files anyway, no point in counting
+     * font bytes.
+     */
+    private static boolean hasTempPermission() {
+
+        if (System.getSecurityManager() == null) {
+            return true;
+        }
+        File f = null;
+        boolean hasPerm = false;
+        try {
+            f = File.createTempFile("+~JT", ".tmp", null);
+            f.delete();
+            f = null;
+            hasPerm = true;
+        } catch (Throwable t) {
+            /* inc. any kind of SecurityException */
+        }
+        return hasPerm;
+    }
+
+    /**
      * Returns a new <code>Font</code> using the specified font type
      * and input data.  The new <code>Font</code> is
      * created with a point size of 1 and style {@link #PLAIN PLAIN}.
@@ -822,58 +850,96 @@
             fontFormat != Font.TYPE1_FONT) {
             throw new IllegalArgumentException ("font format not recognized");
         }
-        final InputStream fStream = fontStream;
-        Object ret = java.security.AccessController.doPrivileged(
-           new java.security.PrivilegedAction() {
-              public Object run() {
-                  File tFile = null;
-                  FileOutputStream outStream = null;
-                  try {
-                      tFile = File.createTempFile("+~JF", ".tmp", null);
-                      /* Temp file deleted by font shutdown hook */
-                      BufferedInputStream inStream =
-                          new BufferedInputStream(fStream);
-                      outStream = new FileOutputStream(tFile);
-                      int bytesRead = 0;
-                      int bufSize = 8192;
-                      byte [] buf = new byte[bufSize];
-                      while (bytesRead != -1) {
-                          try {
-                              bytesRead = inStream.read(buf, 0, bufSize);
-                          } catch (Throwable t) {
-                              throw new IOException();
-                          }
-                          if (bytesRead != -1) {
-                              outStream.write(buf, 0, bytesRead);
-                          }
-                      }
-                      /* don't close the input stream */
-                      outStream.close();
-                  } catch (IOException e) {
-                      if (outStream != null) {
-                          try {
-                              outStream.close();
-                          } catch (Exception e1) {
-                          }
-                      }
-                      if (tFile != null) {
-                          try {
-                              tFile.delete();
-                          }  catch (Exception e2) {
-                          }
-                      }
-                      return e;
-                  }
-                  return tFile;
-              }
-          });
+        boolean copiedFontData = false;
 
-        if (ret instanceof File) {
-            return new Font((File)ret, fontFormat, true);
-        } else if (ret instanceof IOException) {
-            throw (IOException)ret;
-        } else {
-            throw new FontFormatException("Couldn't access font stream");
+        try {
+            final File tFile = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<File>() {
+                    public File run() throws IOException {
+                        return File.createTempFile("+~JF", ".tmp", null);
+                    }
+                }
+            );
+
+            int totalSize = 0;
+            CreatedFontTracker tracker = null;
+            try {
+                final OutputStream outStream =
+                    AccessController.doPrivileged(
+                        new PrivilegedExceptionAction<OutputStream>() {
+                            public OutputStream run() throws IOException {
+                                return new FileOutputStream(tFile);
+                            }
+                        }
+                    );
+                if (!hasTempPermission()) {
+                    tracker = CreatedFontTracker.getTracker();
+                }
+                try {
+                    byte[] buf = new byte[8192];
+                    for (;;) {
+                        int bytesRead = fontStream.read(buf);
+                        if (bytesRead < 0) {
+                            break;
+                        }
+                        if (tracker != null) {
+                            if (totalSize+bytesRead > tracker.MAX_FILE_SIZE) {
+                                throw new IOException("File too big.");
+                            }
+                            if (totalSize+tracker.getNumBytes() >
+                                tracker.MAX_TOTAL_BYTES)
+                              {
+                                throw new IOException("Total files too big.");
+                            }
+                            totalSize += bytesRead;
+                            tracker.addBytes(bytesRead);
+                        }
+                        outStream.write(buf, 0, bytesRead);
+                    }
+                    /* don't close the input stream */
+                } finally {
+                    outStream.close();
+                }
+                /* After all references to a Font2D are dropped, the file
+                 * will be removed. To support long-lived AppContexts,
+                 * we need to then decrement the byte count by the size
+                 * of the file.
+                 * If the data isn't a valid font, the implementation will
+                 * delete the tmp file and decrement the byte count
+                 * in the tracker object before returning from the
+                 * constructor, so we can set 'copiedFontData' to true here
+                 * without waiting for the results of that constructor.
+                 */
+                copiedFontData = true;
+                Font font = new Font(tFile, fontFormat, true, tracker);
+                return font;
+            } finally {
+                if (!copiedFontData) {
+                    if (tracker != null) {
+                        tracker.subBytes(totalSize);
+                    }
+                    AccessController.doPrivileged(
+                        new PrivilegedExceptionAction<Void>() {
+                            public Void run() {
+                                tFile.delete();
+                                return null;
+                            }
+                        }
+                    );
+                }
+            }
+        } catch (Throwable t) {
+            if (t instanceof FontFormatException) {
+                throw (FontFormatException)t;
+            }
+            if (t instanceof IOException) {
+                throw (IOException)t;
+            }
+            Throwable cause = t.getCause();
+            if (cause instanceof FontFormatException) {
+                throw (FontFormatException)cause;
+            }
+            throw new IOException("Problem reading font data.");
         }
     }
 
@@ -913,6 +979,9 @@
      */
     public static Font createFont(int fontFormat, File fontFile)
         throws java.awt.FontFormatException, java.io.IOException {
+
+        fontFile = new File(fontFile.getPath());
+
         if (fontFormat != Font.TRUETYPE_FONT &&
             fontFormat != Font.TYPE1_FONT) {
             throw new IllegalArgumentException ("font format not recognized");
@@ -926,7 +995,7 @@
         if (!fontFile.canRead()) {
             throw new IOException("Can't read " + fontFile);
         }
-        return new Font(fontFile, fontFormat, false);
+        return new Font(fontFile, fontFormat, false, null);
     }
 
     /**
diff --git a/jdk/src/share/classes/java/awt/GraphicsConfiguration.java b/jdk/src/share/classes/java/awt/GraphicsConfiguration.java
index c520d31..23afe8b 100644
--- a/jdk/src/share/classes/java/awt/GraphicsConfiguration.java
+++ b/jdk/src/share/classes/java/awt/GraphicsConfiguration.java
@@ -440,13 +440,14 @@
      * the {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
      * PERPIXEL_TRANSLUCENT} kind of translucency.
      *
-     * @param gc GraphicsConfiguration
-     * @throws NullPointerException if the gc argument is null
      * @return whether the given GraphicsConfiguration supports
      *         the translucency effects.
+     *
      * @see Window#setBackground(Color)
+     *
+     * @since 1.7
      */
-    /*public */boolean isTranslucencyCapable() {
+    public boolean isTranslucencyCapable() {
         // Overridden in subclasses
         return false;
     }
diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java
index 9206871..c7d9b13 100644
--- a/jdk/src/share/classes/java/awt/GraphicsDevice.java
+++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java
@@ -112,10 +112,14 @@
      */
     public final static int TYPE_IMAGE_BUFFER           = 2;
 
-    /** Kinds of translucency supported by the underlying system.
-     *  @see #isTranslucencySupported
+    /**
+     * Kinds of translucency supported by the underlying system.
+     *
+     * @see #isWindowTranslucencySupported
+     *
+     * @since 1.7
      */
-    /*public */static enum WindowTranslucency {
+    public static enum WindowTranslucency {
         /**
          * Represents support in the underlying system for windows each pixel
          * of which is guaranteed to be either completely opaque, with
@@ -246,38 +250,44 @@
      * full-screen window is not visible, this method will make it visible.
      * It will remain visible when returning to windowed mode.
      * <p>
-     * When returning to windowed mode from an exclusive full-screen window, any
-     * display changes made by calling <code>setDisplayMode</code> are
+     * When entering full-screen mode, all the translucency effects are reset for
+     * the window. Its shape is set to {@code null}, the opacity value is set to
+     * 1.0f, and the background color alpha is set to 255 (completely opaque).
+     * These values are not restored when returning to windowed mode.
+     * <p>
+     * When returning to windowed mode from an exclusive full-screen window,
+     * any display changes made by calling {@code setDisplayMode} are
      * automatically restored to their original state.
      *
-     * @param w a window to use as the full-screen window; <code>null</code>
+     * @param w a window to use as the full-screen window; {@code null}
      * if returning to windowed mode.  Some platforms expect the
      * fullscreen window to be a top-level component (i.e., a Frame);
      * therefore it is preferable to use a Frame here rather than a
      * Window.
+     *
      * @see #isFullScreenSupported
      * @see #getFullScreenWindow
      * @see #setDisplayMode
      * @see Component#enableInputMethods
      * @see Component#setVisible
+     *
      * @since 1.4
      */
     public void setFullScreenWindow(Window w) {
         if (w != null) {
-            //XXX: The actions should be documented in some non-update release.
-            /*
             if (w.getShape() != null) {
-                w.setShape(w, null);
-            }
-            if (!w.isOpaque()) {
-                w.setOpaque(false);
+                w.setShape(null);
             }
             if (w.getOpacity() < 1.0f) {
                 w.setOpacity(1.0f);
             }
-            */
+            Color bgColor = w.getBackground();
+            if (bgColor.getAlpha() < 255) {
+                bgColor = new Color(bgColor.getRed(), bgColor.getGreen(),
+                                    bgColor.getBlue(), 255);
+                w.setBackground(bgColor);
+            }
         }
-
         if (fullScreenWindow != null && windowedModeBounds != null) {
             // if the window went into fs mode before it was realized it may
             // have (0,0) dimensions
@@ -469,13 +479,15 @@
     }
 
     /**
-     * Returns whether the given level of translucency is supported
+     * Returns whether the given level of translucency is supported by
      * this graphics device.
      *
      * @param translucencyKind a kind of translucency support
      * @return whether the given translucency kind is supported
+     *
+     * @since 1.7
      */
-    /*public */boolean isWindowTranslucencySupported(WindowTranslucency translucencyKind) {
+    public boolean isWindowTranslucencySupported(WindowTranslucency translucencyKind) {
         switch (translucencyKind) {
             case PERPIXEL_TRANSPARENT:
                 return isWindowShapingSupported();
diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java
index 01d9ff5..d991647 100644
--- a/jdk/src/share/classes/java/awt/Window.java
+++ b/jdk/src/share/classes/java/awt/Window.java
@@ -25,6 +25,7 @@
 package java.awt;
 
 import java.awt.event.*;
+import java.awt.geom.Path2D;
 import java.awt.geom.Point2D;
 import java.awt.im.InputContext;
 import java.awt.image.BufferStrategy;
@@ -297,6 +298,7 @@
     /*
      * Opacity level of the window
      *
+     * @serial
      * @see #setOpacity(float)
      * @see #getOpacity()
      * @since 1.7
@@ -307,6 +309,7 @@
      * The shape assigned to this window. This field is set to null if
      * no shape is set (rectangular window).
      *
+     * @serial
      * @see #getShape()
      * @see #setShape(Shape)
      * @since 1.7
@@ -3340,32 +3343,78 @@
     // ******************** SHAPES & TRANSPARENCY CODE ********************
 
     /**
-     * JavaDoc
+     * Returns the opacity of the window.
+     *
+     * @return the opacity of the window
+     *
+     * @see Window#setOpacity
+     * @see GraphicsDevice.WindowTranslucency
+     *
+     * @since 1.7
      */
-    /*public */float getOpacity() {
+    public float getOpacity() {
         synchronized (getTreeLock()) {
             return opacity;
         }
     }
 
     /**
-     * JavaDoc
+     * Sets the opacity of the window.
+     * <p>
+     * The opacity value is in the range [0..1]. Note that setting the opacity
+     * level of 0 may or may not disable the mouse event handling on this
+     * window. This is a platform-dependent behavior.
+     * <p>
+     * In order for this method to enable the translucency effect, the {@link
+     * GraphicsDevice#isWindowTranslucencySupported()} method must indicate that
+     * the {@link GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}
+     * translucency is supported.
+     * <p>
+     * Also note that the window must not be in the full-screen mode when
+     * setting the opacity value &lt; 1.0f. Otherwise the {@code
+     * IllegalComponentStateException} is thrown.
+     * <p>
+     * The translucency levels of individual pixels may also be effected by the
+     * alpha component of their color (see {@link setBackground()}) and the
+     * current shape of this window (see {@link setShape()}).
+     *
+     * @param opacity the opacity level to set to the window
+     *
+     * @throws IllegalArgumentException if the opacity is out of the range
+     *     [0..1]
+     * @throws IllegalComponentStateException if the window is in full screen
+     *     mode, and the opacity is less than 1.0f
+     * @throws UnsupportedOperationException if the {@code
+     *     GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}
+     *     translucency kind is not supported and the opacity is less than 1.0f
+     *
+     * @see Window#getOpacity
+     * @see Window#setBackground()
+     * @see Window#setShape()
+     * @see GraphicsDevice.WindowTranslucency
+     * @see GraphicsDevice#isWindowTranslucencySupported()
+     *
+     * @since 1.7
      */
-    /*public */void setOpacity(float opacity) {
+    public void setOpacity(float opacity) {
         synchronized (getTreeLock()) {
             if (opacity < 0.0f || opacity > 1.0f) {
                 throw new IllegalArgumentException(
                     "The value of opacity should be in the range [0.0f .. 1.0f].");
             }
-            GraphicsConfiguration gc = getGraphicsConfiguration();
-            GraphicsDevice gd = gc.getDevice();
-            if (!gd.isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency.TRANSLUCENT)) {
-                throw new UnsupportedOperationException(
+            if (opacity < 1.0f) {
+                GraphicsConfiguration gc = getGraphicsConfiguration();
+                GraphicsDevice gd = gc.getDevice();
+                if (gc.getDevice().getFullScreenWindow() == this) {
+                    throw new IllegalComponentStateException(
+                        "Setting opacity for full-screen window is not supported.");
+                }
+                if (!gd.isWindowTranslucencySupported(
+                    GraphicsDevice.WindowTranslucency.TRANSLUCENT))
+                {
+                    throw new UnsupportedOperationException(
                         "TRANSLUCENT translucency is not supported.");
-            }
-            if ((gc.getDevice().getFullScreenWindow() == this) && (opacity < 1.0f)) {
-                throw new IllegalArgumentException(
-                    "Setting opacity for full-screen window is not supported.");
+                }
             }
             this.opacity = opacity;
             WindowPeer peer = (WindowPeer)getPeer();
@@ -3376,37 +3425,86 @@
     }
 
     /**
-     * JavaDoc
+     * Returns the shape of the window.
+     *
+     * The value returned by this method may not be the same as
+     * previously set with {@code setShape(shape)}, but it is guaranteed
+     * to represent the same shape.
+     *
+     * @return the shape of the window or {@code null} if no
+     *     shape is specified for the window
+     *
+     * @see Window#setShape
+     * @see GraphicsDevice.WindowTranslucency
+     *
+     * @since 1.7
      */
-    /*public */Shape getShape() {
+    public Shape getShape() {
         synchronized (getTreeLock()) {
-            return shape;
+            return shape == null ? null : new Path2D.Float(shape);
         }
     }
 
     /**
-     * JavaDoc
+     * Sets the shape of the window.
+     * <p>
+     * Setting a shape enables cutting off some parts of the window, leaving
+     * visible and clickable only those parts belonging to the given shape
+     * (see {@link Shape}). If the shape argument is null, this methods
+     * restores the default shape (making the window rectangular on most
+     * platforms.)
+     * <p>
+     * The following conditions must be met in order to set a non-null shape:
+     * <ul>
+     * <li>The {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSPARENT
+     * PERPIXEL_TRANSPARENT} translucency kind must be supported by the
+     * underlying system (see {@link })
+     * <i>and</i>
+     * <li>The window must not be in the full-screen mode (see
+     * {@link GraphicsDevice#setFullScreenWindow()})
+     * </ul>
+     * If a certain condition is not met, either the {@code
+     * UnsupportedOperationException} or {@code IllegalComponentStateException}
+     * is thrown.
+     * <p>
+     * The tranlucency levels of individual pixels may also be effected by the
+     * alpha component of their color (see {@link setBackground()}) and the
+     * opacity value (see {@link setOpacity()}). See {@link
+     * GraphicsDevice#WindowTranslucency} for more details.
      *
-     * @param window the window to set the shape to
      * @param shape the shape to set to the window
-     * @throws IllegalArgumentException if the window is in full screen mode,
-     *                                  and the shape is not null
+     *
+     * @throws IllegalComponentStateException if the shape is not {@code
+     *     null} and the window is in full-screen mode
+     * @throws UnsupportedOperationException if the shape is not {@code
+     *     null} and {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSPARENT
+     *     PERPIXEL_TRANSPARENT} translucency is not supported
+     *
+     * @see Window#getShape()
+     * @see Window#setBackgound()
+     * @see Window#setOpacity()
+     * @see GraphicsDevice.WindowTranslucency
+     * @see GraphicsDevice#isWindowTranslucencySupported()
+     *
+     * @since 1.7
      */
-    /*public */void setShape(Shape shape) {
+    public void setShape(Shape shape) {
         synchronized (getTreeLock()) {
-            GraphicsConfiguration gc = getGraphicsConfiguration();
-            GraphicsDevice gd = gc.getDevice();
-            if (!gd.isWindowTranslucencySupported(
-                    GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
-            {
-                throw new UnsupportedOperationException(
+            if (shape != null) {
+                GraphicsConfiguration gc = getGraphicsConfiguration();
+                GraphicsDevice gd = gc.getDevice();
+                if (gc.getDevice().getFullScreenWindow() == this) {
+                    throw new IllegalComponentStateException(
+                        "Setting shape for full-screen window is not supported.");
+                }
+                if (!gd.isWindowTranslucencySupported(
+                        GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSPARENT))
+                {
+                    throw new UnsupportedOperationException(
                         "PERPIXEL_TRANSPARENT translucency is not supported.");
+                }
             }
-            if ((gc.getDevice().getFullScreenWindow() == this) && (shape != null)) {
-                throw new IllegalArgumentException(
-                    "Setting shape for full-screen window is not supported.");
-            }
-            this.shape = shape;
+            this.shape = (shape == null) ? null : new Path2D.Float(shape);
             WindowPeer peer = (WindowPeer)getPeer();
             if (peer != null) {
                 peer.applyShape(shape == null ? null : Region.getInstance(shape, null));
@@ -3415,66 +3513,115 @@
     }
 
     /**
-     * JavaDoc
+     * Gets the background color of this window.
+     * <p>
+     * Note that the alpha component of the returned color indicates whether
+     * the window is in the non-opaque (per-pixel translucent) mode.
+     *
+     * @return this component's background color
+     *
+     * @see Window#setBackground
+     * @see GraphicsDevice.WindowTranslucency
      */
-/*
+    @Override
+    public Color getBackground() {
+        return super.getBackground();
+    }
+
+    /**
+     * Sets the background color of this window.
+     * <p>
+     * If the windowing system supports the {@link
+     * GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}
+     * tranclucency, the alpha component of the given background color
+     * may effect the mode of operation for this window: it indicates whether
+     * this window must be opaque (alpha == 1.0f) or per-pixel translucent
+     * (alpha &lt; 1.0f).  All the following conditions must be met in order
+     * to be able to enable the per-pixel transparency mode for this window:
+     * <ul>
+     * <li>The {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
+     * PERPIXEL_TRANSLUCENT} translucency must be supported
+     * by the graphics device where this window is located <i>and</i>
+     * <li>The window must not be in the full-screen mode (see {@link
+     * GraphicsDevice#setFullScreenWindow()})
+     * </ul>
+     * If a certain condition is not met at the time of calling this method,
+     * the alpha component of the given background color will not effect the
+     * mode of operation for this window.
+     * <p>
+     * When the window is per-pixel translucent, the drawing sub-system
+     * respects the alpha value of each individual pixel. If a pixel gets
+     * painted with the alpha color component equal to zero, it becomes
+     * visually transparent, if the alpha of the pixel is equal to 1.0f, the
+     * pixel is fully opaque. Interim values of the alpha color component make
+     * the pixel semi-transparent. In this mode the background of the window
+     * gets painted with the alpha value of the given background color (meaning
+     * that it is not painted at all if the alpha value of the argument of this
+     * method is equal to zero.)
+     * <p>
+     * The actual level of translucency of a given pixel also depends on window
+     * opacity (see {@link setOpacity()}), as well as the current shape of
+     * this window (see {@link setShape()}).
+     * <p>
+     * Note that painting a pixel with the alpha value of 0 may or may not
+     * disable the mouse event handling on this pixel. This is a
+     * platform-dependent behavior. To make sure the mouse clicks do not get
+     * dispatched to a particular pixel, the pixel must be excluded from the
+     * shape of the window.
+     * <p>
+     * Enabling the per-pixel translucency mode may change the graphics
+     * configuration of this window due to the native platform requirements.
+     *
+     * @param bgColor the color to become this window's background color.
+     *
+     * @throws IllegalComponentStateException if the alpha value of the given
+     *     background color is less than 1.0f and the window is in
+     *     full-screen mode
+     * @throws UnsupportedOperationException if the alpha value of the given
+     *     background color is less than 1.0f and
+     *     {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
+     *     PERPIXEL_TRANSLUCENT} translucency is not supported
+     *
+     * @see Window#getBackground
+     * @see Window#setOpacity()
+     * @see Window#setShape()
+     * @see GraphicsDevice.WindowTranslucency
+     * @see GraphicsDevice#isWindowTranslucencySupported()
+     * @see GraphicsConfiguration#isTranslucencyCapable()
+     */
     @Override
     public void setBackground(Color bgColor) {
+        Color oldBg = getBackground();
+        if (oldBg != null && oldBg.equals(bgColor)) {
+            return;
+        }
+        super.setBackground(bgColor);
+        int oldAlpha = oldBg != null ? oldBg.getAlpha() : 255;
         int alpha = bgColor.getAlpha();
-        if (alpha < 255) { // non-opaque window
+        if ((oldAlpha == 255) && (alpha < 255)) { // non-opaque window
             GraphicsConfiguration gc = getGraphicsConfiguration();
             GraphicsDevice gd = gc.getDevice();
             if (gc.getDevice().getFullScreenWindow() == this) {
-                throw new IllegalArgumentException(
+                throw new IllegalComponentStateException(
                     "Making full-screen window non opaque is not supported.");
             }
             if (!gc.isTranslucencyCapable()) {
                 GraphicsConfiguration capableGC = gd.getTranslucencyCapableGC();
                 if (capableGC == null) {
-                    throw new IllegalArgumentException(
+                    throw new UnsupportedOperationException(
                         "PERPIXEL_TRANSLUCENT translucency is not supported");
                 }
-                // TODO: change GC
+                setGraphicsConfiguration(capableGC);
             }
             setLayersOpaque(this, false);
+        } else if ((oldAlpha < 255) && (alpha == 255)) {
+            setLayersOpaque(this, true);
         }
-
-        super.setBackground(bgColor);
-
         WindowPeer peer = (WindowPeer)getPeer();
         if (peer != null) {
             peer.setOpaque(alpha == 255);
         }
     }
-*/
-
-    private transient boolean opaque = true;
-
-    void setOpaque(boolean opaque) {
-        synchronized (getTreeLock()) {
-            GraphicsConfiguration gc = getGraphicsConfiguration();
-            if (!opaque && !com.sun.awt.AWTUtilities.isTranslucencyCapable(gc)) {
-            throw new IllegalArgumentException(
-                    "The window must use a translucency-compatible graphics configuration");
-            }
-            if (!com.sun.awt.AWTUtilities.isTranslucencySupported(
-                    com.sun.awt.AWTUtilities.Translucency.PERPIXEL_TRANSLUCENT))
-            {
-                throw new UnsupportedOperationException(
-                        "PERPIXEL_TRANSLUCENT translucency is not supported.");
-            }
-            if ((gc.getDevice().getFullScreenWindow() == this) && !opaque) {
-                throw new IllegalArgumentException(
-                    "Making full-screen window non opaque is not supported.");
-            }
-            setLayersOpaque(this, opaque);
-            this.opaque = opaque;
-            WindowPeer peer = (WindowPeer)getPeer();
-            if (peer != null) {
-                peer.setOpaque(opaque);
-            }
-        }
-    }
 
     private void updateWindow(BufferedImage backBuffer) {
         synchronized (getTreeLock()) {
@@ -3505,10 +3652,10 @@
             }
             lp.setOpaque(isOpaque);
             root.setOpaque(isOpaque);
-            root.setDoubleBuffered(isOpaque); //XXX: the "white rect" workaround
+            root.setDoubleBuffered(isOpaque);
             if (content != null) {
                 content.setOpaque(isOpaque);
-                content.setDoubleBuffered(isOpaque); //XXX: the "white rect" workaround
+                content.setDoubleBuffered(isOpaque);
 
                 // Iterate down one level to see whether we have a JApplet
                 // (which is also a RootPaneContainer) which requires processing
@@ -3523,36 +3670,6 @@
                 }
             }
         }
-
-        Color bg = component.getBackground();
-        boolean hasTransparentBg = TRANSPARENT_BACKGROUND_COLOR.equals(bg);
-
-        Container container = null;
-        if (component instanceof Container) {
-            container = (Container) component;
-        }
-
-        if (isOpaque) {
-            if (hasTransparentBg) {
-                // Note: we use the SystemColor.window color as the default.
-                // This color is used in the WindowPeer implementations to
-                // initialize the background color of the window if it is null.
-                // (This might not be the right thing to do for other
-                // RootPaneContainers we might be invoked with)
-                Color newColor = null;
-                if (container != null && container.preserveBackgroundColor != null) {
-                    newColor = container.preserveBackgroundColor;
-                } else {
-                    newColor = SystemColor.window;
-                }
-                component.setBackground(newColor);
-            }
-        } else {
-            if (!hasTransparentBg && container != null) {
-                container.preserveBackgroundColor = bg;
-            }
-            component.setBackground(TRANSPARENT_BACKGROUND_COLOR);
-        }
     }
 
 
@@ -3620,20 +3737,16 @@
                 window.setShape(shape);
             }
             public boolean isOpaque(Window window) {
-                /*
-                return window.getBackground().getAlpha() < 255;
-                */
-                synchronized (window.getTreeLock()) {
-                    return window.opaque;
-                }
+                Color bg = window.getBackground();
+                return (bg != null) ? bg.getAlpha() == 255 : true;
             }
             public void setOpaque(Window window, boolean opaque) {
-                /*
                 Color bg = window.getBackground();
+                if (bg == null) {
+                    bg = new Color(0, 0, 0, 0);
+                }
                 window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(),
                                                opaque ? 255 : 0));
-                */
-                window.setOpaque(opaque);
             }
             public void updateWindow(Window window, BufferedImage backBuffer) {
                 window.updateWindow(backBuffer);
@@ -3674,6 +3787,10 @@
         }); // WindowAccessor
     } // static
 
+    // a window doesn't need to be updated in the Z-order.
+    @Override
+    void updateZOrder() {}
+
 } // class Window
 
 
diff --git a/jdk/src/share/classes/java/lang/NoSuchFieldError.java b/jdk/src/share/classes/java/lang/NoSuchFieldError.java
index 8b77c71..8adebca 100644
--- a/jdk/src/share/classes/java/lang/NoSuchFieldError.java
+++ b/jdk/src/share/classes/java/lang/NoSuchFieldError.java
@@ -41,14 +41,14 @@
     private static final long serialVersionUID = -3456430195886129035L;
 
     /**
-     * Constructs a <code>NoSuchFieldException</code> with no detail  message.
+     * Constructs a <code>NoSuchFieldError</code> with no detail message.
      */
     public NoSuchFieldError() {
         super();
     }
 
     /**
-     * Constructs a <code>NoSuchFieldException</code> with the specified
+     * Constructs a <code>NoSuchFieldError</code> with the specified
      * detail message.
      *
      * @param   s   the detail message.
diff --git a/jdk/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java b/jdk/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
index 1562642..60be747 100644
--- a/jdk/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
+++ b/jdk/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java
@@ -196,10 +196,12 @@
 
         if ((start < 0) || (end > len) || (start > end))
             throw new IndexOutOfBoundsException();
-        int sublen = end - start;
-        int off = offset + ((pos + start) << $LG_BYTES_PER_VALUE$);
-        assert (off >= 0);
-        return new ByteBufferAsCharBuffer$RW$$BO$(bb, -1, 0, sublen, sublen, off);
+        return new ByteBufferAsCharBuffer$RW$$BO$(bb,
+                                                  -1,
+                                                  pos + start,
+                                                  pos + end,
+                                                  capacity(),
+                                                  offset);
     }
 
 #end[char]
diff --git a/jdk/src/share/classes/java/nio/Direct-X-Buffer.java b/jdk/src/share/classes/java/nio/Direct-X-Buffer.java
index 5f738b7..a977626 100644
--- a/jdk/src/share/classes/java/nio/Direct-X-Buffer.java
+++ b/jdk/src/share/classes/java/nio/Direct-X-Buffer.java
@@ -412,10 +412,12 @@
 
         if ((start < 0) || (end > len) || (start > end))
             throw new IndexOutOfBoundsException();
-        int sublen = end - start;
-        int off = (pos + start) << $LG_BYTES_PER_VALUE$;
-        assert (off >= 0);
-        return new DirectCharBuffer$RW$$BO$(this, -1, 0, sublen, sublen, off);
+        return new DirectCharBuffer$RW$$BO$(this,
+                                            -1,
+                                            pos + start,
+                                            pos + end,
+                                            capacity(),
+                                            offset);
     }
 
 #end[char]
diff --git a/jdk/src/share/classes/java/nio/Heap-X-Buffer.java b/jdk/src/share/classes/java/nio/Heap-X-Buffer.java
index b615ba3..864161f 100644
--- a/jdk/src/share/classes/java/nio/Heap-X-Buffer.java
+++ b/jdk/src/share/classes/java/nio/Heap-X-Buffer.java
@@ -572,10 +572,13 @@
             || (end > length())
             || (start > end))
             throw new IndexOutOfBoundsException();
-        int len = end - start;
+        int pos = position();
         return new HeapCharBuffer$RW$(hb,
-                                      -1, 0, len, len,
-                                      offset + position() + start);
+                                      -1,
+                                      pos + start,
+                                      pos + end,
+                                      capacity(),
+                                      offset);
     }
 
 #end[char]
diff --git a/jdk/src/share/classes/java/nio/StringCharBuffer.java b/jdk/src/share/classes/java/nio/StringCharBuffer.java
index 648b198..8871b94 100644
--- a/jdk/src/share/classes/java/nio/StringCharBuffer.java
+++ b/jdk/src/share/classes/java/nio/StringCharBuffer.java
@@ -102,10 +102,12 @@
     public final CharBuffer subSequence(int start, int end) {
         try {
             int pos = position();
-            return new StringCharBuffer(str, -1,
+            return new StringCharBuffer(str,
+                                        -1,
                                         pos + checkIndex(start, pos),
                                         pos + checkIndex(end, pos),
-                                        remaining(), offset);
+                                        capacity(),
+                                        offset);
         } catch (IllegalArgumentException x) {
             throw new IndexOutOfBoundsException();
         }
diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousDatagramChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousDatagramChannel.java
index 6a9d9f0..65b90d0 100644
--- a/jdk/src/share/classes/java/nio/channels/AsynchronousDatagramChannel.java
+++ b/jdk/src/share/classes/java/nio/channels/AsynchronousDatagramChannel.java
@@ -443,7 +443,7 @@
      * at least care must be taken to ensure that the buffer is not accessed
      * while the channel remains open.
      *
-     * <p> If there is a security manager installed and the the channel is not
+     * <p> If there is a security manager installed and the channel is not
      * connected then this method verifies that the target address and port number
      * are permitted by the security manager's {@link SecurityManager#checkConnect
      * checkConnect} method.  The overhead of this security check can be avoided
diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java
index 55bf8fd..8f796b6 100644
--- a/jdk/src/share/classes/java/nio/file/Path.java
+++ b/jdk/src/share/classes/java/nio/file/Path.java
@@ -494,7 +494,7 @@
      * @throws  IOException
      *          if an I/O error occurs
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, it denies {@link LinkPermission}<tt>("symbolic")</tt>
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to the path of the symbolic link.
@@ -531,7 +531,7 @@
      * @throws  IOException
      *          if an I/O error occurs
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, it denies {@link LinkPermission}<tt>("hard")</tt>
      *          or its {@link SecurityManager#checkWrite(String) checkWrite}
      *          method denies write access to both this path and the path of the
@@ -560,7 +560,7 @@
      * @throws  IOException
      *          if an I/O error occurs
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, it checks that {@code FilePermission} has been
      *          granted with the "{@code readlink}" action to read the link.
      */
@@ -615,7 +615,7 @@
      *          obtained
      *
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, the {@link #toAbsolutePath toAbsolutePath} method
      *          throws a security exception.
      */
@@ -636,7 +636,7 @@
      * @throws  IOError
      *          if an I/O error occurs
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, its {@link SecurityManager#checkPropertyAccess(String)
      *          checkPropertyAccess} method is invoked to check access to the
      *          system property {@code user.dir}
@@ -677,7 +677,7 @@
      * @throws  IOException
      *          if the file does not exist or an I/O error occurs
      * @throws  SecurityException
-     *          In the case of the the default provider, and a security manager
+     *          In the case of the default provider, and a security manager
      *          is installed, its {@link SecurityManager#checkRead(String) checkRead}
      *          method is invoked to check read access to the file, and where
      *          this path is not absolute, its {@link SecurityManager#checkPropertyAccess(String)
diff --git a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java
index b2555c1..7268c41 100644
--- a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java
+++ b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java
@@ -208,7 +208,7 @@
      * @throws  ClosedDirectoryStreamException
      *          if the directory stream is closed
      * @throws  NoSuchFileException
-     *          if the the directory does not exist <i>(optional specific exception)</i>
+     *          if the directory does not exist <i>(optional specific exception)</i>
      * @throws  DirectoryNotEmptyException
      *          if the directory could not otherwise be deleted because it is
      *          not empty <i>(optional specific exception)</i>
diff --git a/jdk/src/share/classes/java/security/AccessController.java b/jdk/src/share/classes/java/security/AccessController.java
index dd49271..47b8a93 100644
--- a/jdk/src/share/classes/java/security/AccessController.java
+++ b/jdk/src/share/classes/java/security/AccessController.java
@@ -425,7 +425,7 @@
      * Performs the specified <code>PrivilegedExceptionAction</code> with
      * privileges enabled and restricted by the specified
      * <code>AccessControlContext</code>.  The action is performed with the
-     * intersection of the the permissions possessed by the caller's
+     * intersection of the permissions possessed by the caller's
      * protection domain, and those possessed by the domains represented by the
      * specified <code>AccessControlContext</code>.
      * <p>
diff --git a/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java b/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java
index 4bff86d..a70faf3 100644
--- a/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java
+++ b/jdk/src/share/classes/java/security/AlgorithmParametersSpi.java
@@ -102,7 +102,7 @@
      * parameters should be returned in an instance of the
      * <code>DSAParameterSpec</code> class.
      *
-     * @param paramSpec the the specification class in which
+     * @param paramSpec the specification class in which
      * the parameters should be returned.
      *
      * @return the parameter specification.
diff --git a/jdk/src/share/classes/java/security/PrivilegedActionException.java b/jdk/src/share/classes/java/security/PrivilegedActionException.java
index 4f42c02..d17d21a 100644
--- a/jdk/src/share/classes/java/security/PrivilegedActionException.java
+++ b/jdk/src/share/classes/java/security/PrivilegedActionException.java
@@ -87,7 +87,7 @@
     }
 
     /**
-     * Returns the the cause of this exception (the exception thrown by
+     * Returns the cause of this exception (the exception thrown by
      * the privileged computation that resulted in this
      * <code>PrivilegedActionException</code>).
      *
diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java
index 7ed7956..c7d6950 100644
--- a/jdk/src/share/classes/java/security/Security.java
+++ b/jdk/src/share/classes/java/security/Security.java
@@ -501,7 +501,7 @@
      * <li> <i>&lt;crypto_service>.&lt;algorithm_or_type>
      * &lt;attribute_name>:&lt attribute_value></i>
      * <p> The cryptographic service name must not contain any dots. There
-     * must be one or more space charaters between the the
+     * must be one or more space charaters between the
      * <i>&lt;algorithm_or_type></i> and the <i>&lt;attribute_name></i>.
      *  <p> A provider satisfies this selection criterion iff the
      * provider implements the specified algorithm or type for the specified
diff --git a/jdk/src/share/classes/java/security/SecurityPermission.java b/jdk/src/share/classes/java/security/SecurityPermission.java
index 41744ae..1d9049d 100644
--- a/jdk/src/share/classes/java/security/SecurityPermission.java
+++ b/jdk/src/share/classes/java/security/SecurityPermission.java
@@ -118,7 +118,7 @@
  *   <td>setProperty.{key}</td>
  *   <td>Setting of the security property with the specified key</td>
  *   <td>This could include setting a security provider or defining
- * the location of the the system-wide security policy.  Malicious
+ * the location of the system-wide security policy.  Malicious
  * code that has permission to set a new security provider may
  * set a rogue provider that steals confidential information such
  * as cryptographic private keys. In addition, malicious code with
diff --git a/jdk/src/share/classes/java/security/SignatureSpi.java b/jdk/src/share/classes/java/security/SignatureSpi.java
index 4b6049c..b6bf347 100644
--- a/jdk/src/share/classes/java/security/SignatureSpi.java
+++ b/jdk/src/share/classes/java/security/SignatureSpi.java
@@ -316,7 +316,7 @@
      * overridden by a provider
      *
      * @exception InvalidAlgorithmParameterException if this method is
-     * overridden by a provider and the the given parameters
+     * overridden by a provider and the given parameters
      * are inappropriate for this signature engine
      */
     protected void engineSetParameter(AlgorithmParameterSpec params)
diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactory.java b/jdk/src/share/classes/java/security/cert/CertificateFactory.java
index 961e15d..f1059d1 100644
--- a/jdk/src/share/classes/java/security/cert/CertificateFactory.java
+++ b/jdk/src/share/classes/java/security/cert/CertificateFactory.java
@@ -460,7 +460,7 @@
      * {@link java.io.InputStream#reset() reset}, this method will
      * consume the entire input stream. Otherwise, each call to this
      * method consumes one CRL and the read position of the input stream
-     * is positioned to the next available byte after the the inherent
+     * is positioned to the next available byte after the inherent
      * end-of-CRL marker. If the data in the
      * input stream does not contain an inherent end-of-CRL marker (other
      * than EOF) and there is trailing data after the CRL is parsed, a
diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java
index 5c24027..29eb74b 100644
--- a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java
+++ b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java
@@ -88,7 +88,7 @@
      * {@link java.io.InputStream#reset() reset}, this method will
      * consume the entire input stream. Otherwise, each call to this
      * method consumes one certificate and the read position of the input stream
-     * is positioned to the next available byte after the the inherent
+     * is positioned to the next available byte after the inherent
      * end-of-certificate marker. If the data in the
      * input stream does not contain an inherent end-of-certificate marker (other
      * than EOF) and there is trailing data after the certificate is parsed, a
@@ -261,7 +261,7 @@
      * {@link java.io.InputStream#reset() reset}, this method will
      * consume the entire input stream. Otherwise, each call to this
      * method consumes one CRL and the read position of the input stream
-     * is positioned to the next available byte after the the inherent
+     * is positioned to the next available byte after the inherent
      * end-of-CRL marker. If the data in the
      * input stream does not contain an inherent end-of-CRL marker (other
      * than EOF) and there is trailing data after the CRL is parsed, a
diff --git a/jdk/src/share/classes/java/util/Calendar.java b/jdk/src/share/classes/java/util/Calendar.java
index 7fa8296..5b7e275 100644
--- a/jdk/src/share/classes/java/util/Calendar.java
+++ b/jdk/src/share/classes/java/util/Calendar.java
@@ -41,9 +41,14 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.io.OptionalDataException;
 import java.io.Serializable;
+import java.security.AccessControlContext;
 import java.security.AccessController;
+import java.security.PermissionCollection;
+import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 import java.text.DateFormat;
 import java.text.DateFormatSymbols;
 import sun.util.BuddhistCalendar;
@@ -2628,6 +2633,18 @@
         }
     }
 
+    private static class CalendarAccessControlContext {
+        private static final AccessControlContext INSTANCE;
+        static {
+            RuntimePermission perm = new RuntimePermission("accessClassInPackage.sun.util.calendar");
+            PermissionCollection perms = perm.newPermissionCollection();
+            perms.add(perm);
+            INSTANCE = new AccessControlContext(new ProtectionDomain[] {
+                                                    new ProtectionDomain(null, perms)
+                                                });
+        }
+    }
+
     /**
      * Reconstitutes this object from a stream (i.e., deserialize it).
      */
@@ -2657,17 +2674,30 @@
         serialVersionOnStream = currentSerialVersion;
 
         // If there's a ZoneInfo object, use it for zone.
+        ZoneInfo zi = null;
         try {
-            ZoneInfo zi = (ZoneInfo) AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        return input.readObject();
-                    }
-                });
-            if (zi != null) {
-                zone = zi;
+            zi = AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<ZoneInfo>() {
+                        public ZoneInfo run() throws Exception {
+                            return (ZoneInfo) input.readObject();
+                        }
+                    },
+                    CalendarAccessControlContext.INSTANCE);
+        } catch (PrivilegedActionException pae) {
+            Exception e = pae.getException();
+            if (!(e instanceof OptionalDataException)) {
+                if (e instanceof RuntimeException) {
+                    throw (RuntimeException) e;
+                } else if (e instanceof IOException) {
+                    throw (IOException) e;
+                } else if (e instanceof ClassNotFoundException) {
+                    throw (ClassNotFoundException) e;
+                }
+                throw new RuntimeException(e);
             }
-        } catch (Exception e) {
+        }
+        if (zi != null) {
+            zone = zi;
         }
 
         // If the deserialized object has a SimpleTimeZone, try to
@@ -2676,9 +2706,9 @@
         // implementation as much as possible.
         if (zone instanceof SimpleTimeZone) {
             String id = zone.getID();
-            TimeZone zi = TimeZone.getTimeZone(id);
-            if (zi != null && zi.hasSameRules(zone) && zi.getID().equals(id)) {
-                zone = zi;
+            TimeZone tz = TimeZone.getTimeZone(id);
+            if (tz != null && tz.hasSameRules(zone) && tz.getID().equals(id)) {
+                zone = tz;
             }
         }
     }
diff --git a/jdk/src/share/classes/java/util/logging/LogRecord.java b/jdk/src/share/classes/java/util/logging/LogRecord.java
index 6eda211..0acf9fa 100644
--- a/jdk/src/share/classes/java/util/logging/LogRecord.java
+++ b/jdk/src/share/classes/java/util/logging/LogRecord.java
@@ -25,6 +25,8 @@
 
 package java.util.logging;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 import java.io.*;
 
 /**
@@ -64,9 +66,24 @@
  */
 
 public class LogRecord implements java.io.Serializable {
-    private static long globalSequenceNumber;
-    private static int nextThreadId=10;
-    private static ThreadLocal<Integer> threadIds = new ThreadLocal<Integer>();
+    private static final AtomicLong globalSequenceNumber
+        = new AtomicLong(0);
+
+    /**
+     * The default value of threadID will be the current thread's
+     * thread id, for ease of correlation, unless it is greater than
+     * MIN_SEQUENTIAL_THREAD_ID, in which case we try harder to keep
+     * our promise to keep threadIDs unique by avoiding collisions due
+     * to 32-bit wraparound.  Unfortunately, LogRecord.getThreadID()
+     * returns int, while Thread.getId() returns long.
+     */
+    private static final int MIN_SEQUENTIAL_THREAD_ID = Integer.MAX_VALUE / 2;
+
+    private static final AtomicInteger nextThreadId
+        = new AtomicInteger(MIN_SEQUENTIAL_THREAD_ID);
+
+    private static final ThreadLocal<Integer> threadIds
+        = new ThreadLocal<Integer>();
 
     /**
      * @serial Logging message level
@@ -123,6 +140,23 @@
     private transient ResourceBundle resourceBundle;
 
     /**
+     * Returns the default value for a new LogRecord's threadID.
+     */
+    private int defaultThreadID() {
+        long tid = Thread.currentThread().getId();
+        if (tid < MIN_SEQUENTIAL_THREAD_ID) {
+            return (int) tid;
+        } else {
+            Integer id = threadIds.get();
+            if (id == null) {
+                id = nextThreadId.getAndIncrement();
+                threadIds.set(id);
+            }
+            return id;
+        }
+    }
+
+    /**
      * Construct a LogRecord with the given level and message values.
      * <p>
      * The sequence property will be initialized with a new unique value.
@@ -144,15 +178,8 @@
         this.level = level;
         message = msg;
         // Assign a thread ID and a unique sequence number.
-        synchronized (LogRecord.class) {
-            sequenceNumber = globalSequenceNumber++;
-            Integer id = threadIds.get();
-            if (id == null) {
-                id = new Integer(nextThreadId++);
-                threadIds.set(id);
-            }
-            threadID = id.intValue();
-        }
+        sequenceNumber = globalSequenceNumber.getAndIncrement();
+        threadID = defaultThreadID();
         millis = System.currentTimeMillis();
         needToInferCaller = true;
    }
diff --git a/jdk/src/share/classes/java/util/logging/Logger.java b/jdk/src/share/classes/java/util/logging/Logger.java
index 28f942a..5ae2b42 100644
--- a/jdk/src/share/classes/java/util/logging/Logger.java
+++ b/jdk/src/share/classes/java/util/logging/Logger.java
@@ -477,7 +477,7 @@
 
         Logger logger = this;
         while (logger != null) {
-            for (Handler handler : logger.handlers) {
+            for (Handler handler : logger.getHandlers()) {
                 handler.publish(record);
             }
 
diff --git a/jdk/src/share/classes/java/util/zip/ZipCoder.java b/jdk/src/share/classes/java/util/zip/ZipCoder.java
new file mode 100644
index 0000000..6442bea
--- /dev/null
+++ b/jdk/src/share/classes/java/util/zip/ZipCoder.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.util.zip;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
+import java.nio.charset.CodingErrorAction;
+import java.util.Arrays;
+
+/**
+ * Utility class for zipfile name and comment decoding and encoding
+ */
+
+final class ZipCoder {
+
+    String toString(byte[] ba, int length) {
+        CharsetDecoder cd = decoder().reset();
+        int len = (int)(length * cd.maxCharsPerByte());
+        char[] ca = new char[len];
+        if (len == 0)
+            return new String(ca);
+        ByteBuffer bb = ByteBuffer.wrap(ba, 0, length);
+        CharBuffer cb = CharBuffer.wrap(ca);
+        CoderResult cr = cd.decode(bb, cb, true);
+        if (!cr.isUnderflow())
+            throw new IllegalArgumentException(cr.toString());
+        cr = cd.flush(cb);
+        if (!cr.isUnderflow())
+            throw new IllegalArgumentException(cr.toString());
+        return new String(ca, 0, cb.position());
+    }
+
+    String toString(byte[] ba) {
+        return toString(ba, ba.length);
+    }
+
+    byte[] getBytes(String s) {
+        CharsetEncoder ce = encoder().reset();
+        char[] ca = s.toCharArray();
+        int len = (int)(ca.length * ce.maxBytesPerChar());
+        byte[] ba = new byte[len];
+        if (len == 0)
+            return ba;
+        ByteBuffer bb = ByteBuffer.wrap(ba);
+        CharBuffer cb = CharBuffer.wrap(ca);
+        CoderResult cr = ce.encode(cb, bb, true);
+        if (!cr.isUnderflow())
+            throw new IllegalArgumentException(cr.toString());
+        cr = ce.flush(bb);
+        if (!cr.isUnderflow())
+            throw new IllegalArgumentException(cr.toString());
+        if (bb.position() == ba.length)  // defensive copy?
+            return ba;
+        else
+            return Arrays.copyOf(ba, bb.position());
+    }
+
+    // assume invoked only if "this" is not utf8
+    byte[] getBytesUTF8(String s) {
+        if (isutf8)
+            return getBytes(s);
+        if (utf8 == null)
+            utf8 = new ZipCoder(Charset.forName("UTF-8"));
+        return utf8.getBytes(s);
+    }
+
+
+    String toStringUTF8(byte[] ba, int len) {
+        if (isutf8)
+            return toString(ba, len);
+        if (utf8 == null)
+            utf8 = new ZipCoder(Charset.forName("UTF-8"));
+        return utf8.toString(ba, len);
+    }
+
+    boolean isUTF8() {
+        return isutf8;
+    }
+
+    private Charset cs;
+    private CharsetDecoder dec;
+    private CharsetEncoder enc;
+    private boolean isutf8;
+    private ZipCoder utf8;
+
+    private ZipCoder(Charset cs) {
+        this.cs = cs;
+        this.isutf8 = cs.name().equals("UTF-8");
+    }
+
+    static ZipCoder get(Charset charset) {
+        return new ZipCoder(charset);
+    }
+
+    private CharsetDecoder decoder() {
+        if (dec == null) {
+            dec = cs.newDecoder()
+              .onMalformedInput(CodingErrorAction.REPORT)
+              .onUnmappableCharacter(CodingErrorAction.REPORT);
+        }
+        return dec;
+    }
+
+    private CharsetEncoder encoder() {
+        if (enc == null) {
+            enc = cs.newEncoder()
+              .onMalformedInput(CodingErrorAction.REPORT)
+              .onUnmappableCharacter(CodingErrorAction.REPORT);
+        }
+        return enc;
+    }
+}
diff --git a/jdk/src/share/classes/java/util/zip/ZipConstants64.java b/jdk/src/share/classes/java/util/zip/ZipConstants64.java
index 1bf3b18..b844b2c 100644
--- a/jdk/src/share/classes/java/util/zip/ZipConstants64.java
+++ b/jdk/src/share/classes/java/util/zip/ZipConstants64.java
@@ -73,5 +73,12 @@
     static final int  ZIP64_EXTSIZ = 8;       // compressed size, 8-byte
     static final int  ZIP64_EXTLEN = 16;      // uncompressed size, 8-byte
 
+    /*
+     * Language encoding flag EFS
+     */
+    static final int EFS = 0x800;       // If this bit is set the filename and
+                                        // comment fields for this file must be
+                                        // encoded using UTF-8.
+
     private ZipConstants64() {}
 }
diff --git a/jdk/src/share/classes/java/util/zip/ZipEntry.java b/jdk/src/share/classes/java/util/zip/ZipEntry.java
index 6c16a9a..96e3b4d 100644
--- a/jdk/src/share/classes/java/util/zip/ZipEntry.java
+++ b/jdk/src/share/classes/java/util/zip/ZipEntry.java
@@ -40,6 +40,7 @@
     long size = -1;     // uncompressed size of entry data
     long csize = -1;    // compressed size of entry data
     int method = -1;    // compression method
+    int flag = 0;       // general purpose flag
     byte[] extra;       // optional extra field data for entry
     String comment;     // optional comment string for entry
 
@@ -53,13 +54,6 @@
      */
     public static final int DEFLATED = 8;
 
-    static {
-        /* Zip library is loaded from System.initializeSystemClass */
-        initIDs();
-    }
-
-    private static native void initIDs();
-
     /**
      * Creates a new zip entry with the specified name.
      *
@@ -90,28 +84,15 @@
         size = e.size;
         csize = e.csize;
         method = e.method;
+        flag = e.flag;
         extra = e.extra;
         comment = e.comment;
     }
 
     /*
-     * Creates a new zip entry for the given name with fields initialized
-     * from the specified jzentry data.
+     * Creates a new un-initialized zip entry
      */
-    ZipEntry(String name, long jzentry) {
-        this.name = name;
-        initFields(jzentry);
-    }
-
-    private native void initFields(long jzentry);
-
-    /*
-     * Creates a new zip entry with fields initialized from the specified
-     * jzentry data.
-     */
-    ZipEntry(long jzentry) {
-        initFields(jzentry);
-    }
+    ZipEntry() {}
 
     /**
      * Returns the name of the entry.
@@ -258,16 +239,16 @@
 
     /**
      * Sets the optional comment string for the entry.
+     *
+     * <p>ZIP entry comments have maximum length of 0xffff. If the length of the
+     * specified comment string is greater than 0xFFFF bytes after encoding, only
+     * the first 0xFFFF bytes are output to the ZIP file entry.
+     *
      * @param comment the comment string
-     * @exception IllegalArgumentException if the length of the specified
-     *            comment string is greater than 0xFFFF bytes
+     *
      * @see #getComment()
      */
     public void setComment(String comment) {
-        if (comment != null && comment.length() > 0xffff/3
-                    && ZipOutputStream.getUTF8Length(comment) > 0xffff) {
-            throw new IllegalArgumentException("invalid entry comment length");
-        }
         this.comment = comment;
     }
 
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
index 37e92dd..8ee0bc2 100644
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
@@ -29,9 +29,11 @@
 import java.io.IOException;
 import java.io.EOFException;
 import java.io.File;
+import java.nio.charset.Charset;
 import java.util.Vector;
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
+import static java.util.zip.ZipConstants64.*;
 
 /**
  * This class is used to read entries from a zip file.
@@ -76,16 +78,19 @@
     /**
      * Opens a zip file for reading.
      *
-     * <p>First, if there is a security
-     * manager, its <code>checkRead</code> method
-     * is called with the <code>name</code> argument
-     * as its argument to ensure the read is allowed.
+     * <p>First, if there is a security manager, its <code>checkRead</code>
+     * method is called with the <code>name</code> argument as its argument
+     * to ensure the read is allowed.
+     *
+     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
+     * decode the entry names and comments.
      *
      * @param name the name of the zip file
      * @throws ZipException if a ZIP format error has occurred
      * @throws IOException if an I/O error has occurred
      * @throws SecurityException if a security manager exists and its
      *         <code>checkRead</code> method doesn't allow read access to the file.
+     *
      * @see SecurityManager#checkRead(java.lang.String)
      */
     public ZipFile(String name) throws IOException {
@@ -101,6 +106,9 @@
      * method is called with the <code>name</code> argument as its argument to
      * ensure the read is allowed.
      *
+     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
+     * decode the entry names and comments
+     *
      * @param file the ZIP file to be opened for reading
      * @param mode the mode in which the file is to be opened
      * @throws ZipException if a ZIP format error has occurred
@@ -115,6 +123,59 @@
      * @since 1.3
      */
     public ZipFile(File file, int mode) throws IOException {
+        this(file, mode, Charset.forName("UTF-8"));
+    }
+
+    /**
+     * Opens a ZIP file for reading given the specified File object.
+     *
+     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
+     * decode the entry names and comments.
+     *
+     * @param file the ZIP file to be opened for reading
+     * @throws ZipException if a ZIP format error has occurred
+     * @throws IOException if an I/O error has occurred
+     */
+    public ZipFile(File file) throws ZipException, IOException {
+        this(file, OPEN_READ);
+    }
+
+    private ZipCoder zc;
+
+    /**
+     * Opens a new <code>ZipFile</code> to read from the specified
+     * <code>File</code> object in the specified mode.  The mode argument
+     * must be either <tt>OPEN_READ</tt> or <tt>OPEN_READ | OPEN_DELETE</tt>.
+     *
+     * <p>First, if there is a security manager, its <code>checkRead</code>
+     * method is called with the <code>name</code> argument as its argument to
+     * ensure the read is allowed.
+     *
+     * @param file the ZIP file to be opened for reading
+     * @param mode the mode in which the file is to be opened
+     * @param charset
+     *        the {@link java.nio.charset.Charset {@code charset}} to
+     *        be used to decode the ZIP entry name and comment that are not
+     *        encoded by using UTF-8 encoding (indicated by entry's general
+     *        purpose flag).
+     *
+     * @throws ZipException if a ZIP format error has occurred
+     * @throws IOException if an I/O error has occurred
+     *
+     * @throws SecurityException
+     *         if a security manager exists and its <code>checkRead</code>
+     *         method doesn't allow read access to the file,or its
+     *         <code>checkDelete</code> method doesn't allow deleting the
+     *         file when the <tt>OPEN_DELETE</tt> flag is set
+     *
+     * @throws IllegalArgumentException if the <tt>mode</tt> argument is invalid
+     *
+     * @see SecurityManager#checkRead(java.lang.String)
+     *
+     * @since 1.7
+     */
+    public ZipFile(File file, int mode, Charset charset) throws IOException
+    {
         if (((mode & OPEN_READ) == 0) ||
             ((mode & ~(OPEN_READ | OPEN_DELETE)) != 0)) {
             throw new IllegalArgumentException("Illegal mode: 0x"+
@@ -128,24 +189,61 @@
                 sm.checkDelete(name);
             }
         }
+        if (charset == null)
+            throw new NullPointerException("charset is null");
+        this.zc = ZipCoder.get(charset);
         jzfile = open(name, mode, file.lastModified());
-
         this.name = name;
         this.total = getTotal(jzfile);
     }
 
-    private static native long open(String name, int mode, long lastModified);
-    private static native int getTotal(long jzfile);
-
+    /**
+     * Opens a zip file for reading.
+     *
+     * <p>First, if there is a security manager, its <code>checkRead</code>
+     * method is called with the <code>name</code> argument as its argument
+     * to ensure the read is allowed.
+     *
+     * @param name the name of the zip file
+     * @param charset
+     *        the {@link java.nio.charset.Charset {@code charset}} to
+     *        be used to decode the ZIP entry name and comment that are not
+     *        encoded by using UTF-8 encoding (indicated by entry's general
+     *        purpose flag).
+     *
+     * @throws ZipException if a ZIP format error has occurred
+     * @throws IOException if an I/O error has occurred
+     * @throws SecurityException
+     *         if a security manager exists and its <code>checkRead</code>
+     *         method doesn't allow read access to the file
+     *
+     * @see SecurityManager#checkRead(java.lang.String)
+     *
+     * @since 1.7
+     */
+    public ZipFile(String name, Charset charset) throws IOException
+    {
+        this(new File(name), OPEN_READ, charset);
+    }
 
     /**
      * Opens a ZIP file for reading given the specified File object.
      * @param file the ZIP file to be opened for reading
-     * @throws ZipException if a ZIP error has occurred
+     * @param charset
+     *        The {@link java.nio.charset.Charset {@code charset}} to be
+     *        used to decode the ZIP entry name and comment (ignored if
+     *        the <a href="package-summary.html#lang_encoding"> language
+     *        encoding bit</a> of the ZIP entry's general purpose bit
+     *        flag is set).
+     *
+     * @throws ZipException if a ZIP format error has occurred
      * @throws IOException if an I/O error has occurred
+     *
+     * @since 1.7
      */
-    public ZipFile(File file) throws ZipException, IOException {
-        this(file, OPEN_READ);
+    public ZipFile(File file, Charset charset) throws IOException
+    {
+        this(file, OPEN_READ, charset);
     }
 
     /**
@@ -163,9 +261,9 @@
         long jzentry = 0;
         synchronized (this) {
             ensureOpen();
-            jzentry = getEntry(jzfile, name, true);
+            jzentry = getEntry(jzfile, zc.getBytes(name), true);
             if (jzentry != 0) {
-                ZipEntry ze = new ZipEntry(name, jzentry);
+                ZipEntry ze = getZipEntry(name, jzentry);
                 freeEntry(jzfile, jzentry);
                 return ze;
             }
@@ -173,7 +271,7 @@
         return null;
     }
 
-    private static native long getEntry(long jzfile, String name,
+    private static native long getEntry(long jzfile, byte[] name,
                                         boolean addSlash);
 
     // freeEntry releases the C jzentry struct.
@@ -194,36 +292,30 @@
      * @throws IllegalStateException if the zip file has been closed
      */
     public InputStream getInputStream(ZipEntry entry) throws IOException {
-        return getInputStream(entry.name);
-    }
-
-    /**
-     * Returns an input stream for reading the contents of the specified
-     * entry, or null if the entry was not found.
-     */
-    private InputStream getInputStream(String name) throws IOException {
-        if (name == null) {
-            throw new NullPointerException("name");
+        if (entry == null) {
+            throw new NullPointerException("entry");
         }
         long jzentry = 0;
         ZipFileInputStream in = null;
         synchronized (this) {
             ensureOpen();
-            jzentry = getEntry(jzfile, name, false);
+            if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
+                jzentry = getEntry(jzfile, zc.getBytesUTF8(entry.name), false);
+            } else {
+                jzentry = getEntry(jzfile, zc.getBytes(entry.name), false);
+            }
             if (jzentry == 0) {
                 return null;
             }
-
             in = new ZipFileInputStream(jzentry);
-
         }
         final ZipFileInputStream zfin = in;
-        switch (getMethod(jzentry)) {
+        switch (getEntryMethod(jzentry)) {
         case STORED:
             return zfin;
         case DEFLATED:
             // MORE: Compute good size for inflater stream:
-            long size = getSize(jzentry) + 2; // Inflater likes a bit of slack
+            long size = getEntrySize(jzentry) + 2; // Inflater likes a bit of slack
             if (size > 65536) size = 8192;
             if (size <= 0) size = 4096;
             return new InflaterInputStream(zfin, getInflater(), (int)size) {
@@ -267,8 +359,6 @@
         }
     }
 
-    private static native int getMethod(long jzentry);
-
     /*
      * Gets an inflater from the list of available inflaters or allocates
      * a new one.
@@ -343,7 +433,7 @@
                                                ",\n message = " + message
                                 );
                         }
-                        ZipEntry ze = new ZipEntry(jzentry);
+                        ZipEntry ze = getZipEntry(null, jzentry);
                         freeEntry(jzfile, jzentry);
                         return ze;
                     }
@@ -351,6 +441,38 @@
             };
     }
 
+    private ZipEntry getZipEntry(String name, long jzentry) {
+        ZipEntry e = new ZipEntry();
+        e.flag = getEntryFlag(jzentry);  // get the flag first
+        if (name != null) {
+            e.name = name;
+        } else {
+            byte[] bname = getEntryBytes(jzentry, JZENTRY_NAME);
+            if (!zc.isUTF8() && (e.flag & EFS) != 0) {
+                e.name = zc.toStringUTF8(bname, bname.length);
+            } else {
+                e.name = zc.toString(bname, bname.length);
+            }
+        }
+        e.time = getEntryTime(jzentry);
+        e.crc = getEntryCrc(jzentry);
+        e.size = getEntrySize(jzentry);
+        e. csize = getEntryCSize(jzentry);
+        e.method = getEntryMethod(jzentry);
+        e.extra = getEntryBytes(jzentry, JZENTRY_EXTRA);
+        byte[] bcomm = getEntryBytes(jzentry, JZENTRY_COMMENT);
+        if (bcomm == null) {
+            e.comment = null;
+        } else {
+            if (!zc.isUTF8() && (e.flag & EFS) != 0) {
+                e.comment = zc.toStringUTF8(bcomm, bcomm.length);
+            } else {
+                e.comment = zc.toString(bcomm, bcomm.length);
+            }
+        }
+        return e;
+    }
+
     private static native long getNextEntry(long jzfile, int i);
 
     /**
@@ -443,8 +565,8 @@
 
         ZipFileInputStream(long jzentry) {
             pos = 0;
-            rem = getCSize(jzentry);
-            size = getSize(jzentry);
+            rem = getEntryCSize(jzentry);
+            size = getEntrySize(jzentry);
             this.jzentry = jzentry;
         }
 
@@ -514,13 +636,25 @@
 
     }
 
+
+    private static native long open(String name, int mode, long lastModified)
+        throws IOException;
+    private static native int getTotal(long jzfile);
     private static native int read(long jzfile, long jzentry,
                                    long pos, byte[] b, int off, int len);
 
-    private static native long getCSize(long jzentry);
+    // access to the native zentry object
+    private static native long getEntryTime(long jzentry);
+    private static native long getEntryCrc(long jzentry);
+    private static native long getEntryCSize(long jzentry);
+    private static native long getEntrySize(long jzentry);
+    private static native int getEntryMethod(long jzentry);
+    private static native int getEntryFlag(long jzentry);
 
-    private static native long getSize(long jzentry);
+    private static final int JZENTRY_NAME = 0;
+    private static final int JZENTRY_EXTRA = 1;
+    private static final int JZENTRY_COMMENT = 2;
+    private static native byte[] getEntryBytes(long jzentry, int type);
 
-    // Temporary add on for bug troubleshooting
     private static native String getZipMessage(long jzfile);
 }
diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java
index 1b9b934..83f9ad4 100644
--- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java
+++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java
@@ -29,6 +29,7 @@
 import java.io.IOException;
 import java.io.EOFException;
 import java.io.PushbackInputStream;
+import java.nio.charset.Charset;
 import static java.util.zip.ZipConstants64.*;
 
 /**
@@ -54,6 +55,8 @@
     // one entry
     private boolean entryEOF = false;
 
+    private ZipCoder zc;
+
     /**
      * Check to make sure that this stream has not been closed
      */
@@ -65,14 +68,39 @@
 
     /**
      * Creates a new ZIP input stream.
+     *
+     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used to
+     * decode the entry names.
+     *
      * @param in the actual input stream
      */
     public ZipInputStream(InputStream in) {
+        this(in, Charset.forName("UTF-8"));
+    }
+
+    /**
+     * Creates a new ZIP input stream.
+     *
+     * @param in the actual input stream
+     *
+     * @param charset
+     *        The {@link java.nio.charset.Charset {@code charset}} to be
+     *        used to decode the ZIP entry name (ignored if the
+     *        <a href="package-summary.html#lang_encoding"> language
+     *        encoding bit</a> of the ZIP entry's general purpose bit
+     *        flag is set).
+     *
+     * @since 1.7
+     */
+    public ZipInputStream(InputStream in, Charset charset) {
         super(new PushbackInputStream(in, 512), new Inflater(true), 512);
         usesDefaultInflater = true;
         if(in == null) {
             throw new NullPointerException("in is null");
         }
+        if (charset == null)
+            throw new NullPointerException("charset is null");
+        this.zc = ZipCoder.get(charset);
     }
 
     /**
@@ -141,8 +169,8 @@
      * @param len the maximum number of bytes read
      * @return the actual number of bytes read, or -1 if the end of the
      *         entry is reached
-     * @exception  NullPointerException If <code>b</code> is <code>null</code>.
-     * @exception  IndexOutOfBoundsException If <code>off</code> is negative,
+     * @exception  NullPointerException if <code>b</code> is <code>null</code>.
+     * @exception  IndexOutOfBoundsException if <code>off</code> is negative,
      * <code>len</code> is negative, or <code>len</code> is greater than
      * <code>b.length - off</code>
      * @exception ZipException if a ZIP file error has occurred
@@ -252,6 +280,8 @@
         if (get32(tmpbuf, 0) != LOCSIG) {
             return null;
         }
+        // get flag first, we need check EFS.
+        flag = get16(tmpbuf, LOCFLG);
         // get the entry name and create the ZipEntry first
         int len = get16(tmpbuf, LOCNAM);
         int blen = b.length;
@@ -262,9 +292,11 @@
             b = new byte[blen];
         }
         readFully(b, 0, len);
-        ZipEntry e = createZipEntry(getUTF8String(b, 0, len));
+        // Force to use UTF-8 if the EFS bit is ON, even the cs is NOT UTF-8
+        ZipEntry e = createZipEntry(((flag & EFS) != 0)
+                                    ? zc.toStringUTF8(b, len)
+                                    : zc.toString(b, len));
         // now get the remaining fields for the entry
-        flag = get16(tmpbuf, LOCFLG);
         if ((flag & 1) == 1) {
             throw new ZipException("encrypted ZIP entry not supported");
         }
@@ -313,71 +345,6 @@
         return e;
     }
 
-    /*
-     * Fetches a UTF8-encoded String from the specified byte array.
-     */
-    private static String getUTF8String(byte[] b, int off, int len) {
-        // First, count the number of characters in the sequence
-        int count = 0;
-        int max = off + len;
-        int i = off;
-        while (i < max) {
-            int c = b[i++] & 0xff;
-            switch (c >> 4) {
-            case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
-                // 0xxxxxxx
-                count++;
-                break;
-            case 12: case 13:
-                // 110xxxxx 10xxxxxx
-                if ((b[i++] & 0xc0) != 0x80) {
-                    throw new IllegalArgumentException();
-                }
-                count++;
-                break;
-            case 14:
-                // 1110xxxx 10xxxxxx 10xxxxxx
-                if (((b[i++] & 0xc0) != 0x80) ||
-                    ((b[i++] & 0xc0) != 0x80)) {
-                    throw new IllegalArgumentException();
-                }
-                count++;
-                break;
-            default:
-                // 10xxxxxx, 1111xxxx
-                throw new IllegalArgumentException();
-            }
-        }
-        if (i != max) {
-            throw new IllegalArgumentException();
-        }
-        // Now decode the characters...
-        char[] cs = new char[count];
-        i = 0;
-        while (off < max) {
-            int c = b[off++] & 0xff;
-            switch (c >> 4) {
-            case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
-                // 0xxxxxxx
-                cs[i++] = (char)c;
-                break;
-            case 12: case 13:
-                // 110xxxxx 10xxxxxx
-                cs[i++] = (char)(((c & 0x1f) << 6) | (b[off++] & 0x3f));
-                break;
-            case 14:
-                // 1110xxxx 10xxxxxx 10xxxxxx
-                int t = (b[off++] & 0x3f) << 6;
-                cs[i++] = (char)(((c & 0x0f) << 12) | t | (b[off++] & 0x3f));
-                break;
-            default:
-                // 10xxxxxx, 1111xxxx
-                throw new IllegalArgumentException();
-            }
-        }
-        return new String(cs, 0, count);
-    }
-
     /**
      * Creates a new <code>ZipEntry</code> object for the specified
      * entry name.
diff --git a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
index bd44d32..da35ed9 100644
--- a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
+++ b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
@@ -27,6 +27,7 @@
 
 import java.io.OutputStream;
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.Vector;
 import java.util.HashSet;
 import static java.util.zip.ZipConstants64.*;
@@ -44,19 +45,9 @@
     private static class XEntry {
         public final ZipEntry entry;
         public final long offset;
-        public final int flag;
         public XEntry(ZipEntry entry, long offset) {
             this.entry = entry;
             this.offset = offset;
-            this.flag = (entry.method == DEFLATED &&
-                         (entry.size  == -1 ||
-                          entry.csize == -1 ||
-                          entry.crc   == -1))
-                // store size, compressed size, and crc-32 in data descriptor
-                // immediately following the compressed entry data
-                ? 8
-                // store size, compressed size, and crc-32 in LOC header
-                : 0;
         }
     }
 
@@ -66,12 +57,14 @@
     private CRC32 crc = new CRC32();
     private long written = 0;
     private long locoff = 0;
-    private String comment;
+    private byte[] comment;
     private int method = DEFLATED;
     private boolean finished;
 
     private boolean closed = false;
 
+    private final ZipCoder zc;
+
     private static int version(ZipEntry e) throws ZipException {
         switch (e.method) {
         case DEFLATED: return 20;
@@ -100,10 +93,31 @@
 
     /**
      * Creates a new ZIP output stream.
+     *
+     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used
+     * to encode the entry names and comments.
+     *
      * @param out the actual output stream
      */
     public ZipOutputStream(OutputStream out) {
+        this(out, Charset.forName("UTF-8"));
+    }
+
+    /**
+     * Creates a new ZIP output stream.
+     *
+     * @param out the actual output stream
+     *
+     * @param charset the {@link java.nio.charset.Charset </code>charset<code>}
+     *                to be used to encode the entry names and comments
+     *
+     * @since 1.7
+     */
+    public ZipOutputStream(OutputStream out, Charset charset) {
         super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true));
+        if (charset == null)
+            throw new NullPointerException("charset is null");
+        this.zc = ZipCoder.get(charset);
         usesDefaultDeflater = true;
     }
 
@@ -114,11 +128,11 @@
      *            ZIP file comment is greater than 0xFFFF bytes
      */
     public void setComment(String comment) {
-        if (comment != null && comment.length() > 0xffff/3
-                                           && getUTF8Length(comment) > 0xffff) {
-            throw new IllegalArgumentException("ZIP file comment too long.");
+        if (comment != null) {
+            this.comment = zc.getBytes(comment);
+            if (this.comment.length > 0xffff)
+                throw new IllegalArgumentException("ZIP file comment too long.");
         }
-        this.comment = comment;
     }
 
     /**
@@ -167,8 +181,15 @@
         if (e.method == -1) {
             e.method = method;  // use default method
         }
+        // store size, compressed size, and crc-32 in LOC header
+        e.flag = 0;
         switch (e.method) {
         case DEFLATED:
+            // store size, compressed size, and crc-32 in data descriptor
+            // immediately following the compressed entry data
+            if (e.size  == -1 || e.csize == -1 || e.crc   == -1)
+                e.flag = 8;
+
             break;
         case STORED:
             // compressed size, uncompressed size, and crc-32 must all be
@@ -192,6 +213,8 @@
         if (! names.add(e.name)) {
             throw new ZipException("duplicate entry: " + e.name);
         }
+        if (zc.isUTF8())
+            e.flag |= EFS;
         current = new XEntry(e, written);
         xentries.add(current);
         writeLOC(current);
@@ -213,7 +236,7 @@
                 while (!def.finished()) {
                     deflate();
                 }
-                if ((current.flag & 8) == 0) {
+                if ((e.flag & 8) == 0) {
                     // verify size, compressed size, and crc-32 settings
                     if (e.size != def.getBytesRead()) {
                         throw new ZipException(
@@ -343,11 +366,11 @@
      */
     private void writeLOC(XEntry xentry) throws IOException {
         ZipEntry e = xentry.entry;
-        int flag = xentry.flag;
+        int flag = e.flag;
         int elen = (e.extra != null) ? e.extra.length : 0;
         boolean hasZip64 = false;
 
-        writeInt(LOCSIG);           // LOC header signature
+        writeInt(LOCSIG);               // LOC header signature
 
         if ((flag & 8) == 8) {
             writeShort(version(e));     // version needed to extract
@@ -380,7 +403,7 @@
                 writeInt(e.size);   // uncompressed size
             }
         }
-        byte[] nameBytes = getUTF8Bytes(e.name);
+        byte[] nameBytes = zc.getBytes(e.name);
         writeShort(nameBytes.length);
         writeShort(elen);
         writeBytes(nameBytes, 0, nameBytes.length);
@@ -417,7 +440,7 @@
      */
     private void writeCEN(XEntry xentry) throws IOException {
         ZipEntry e  = xentry.entry;
-        int flag = xentry.flag;
+        int flag = e.flag;
         int version = version(e);
 
         long csize = e.csize;
@@ -454,7 +477,7 @@
         writeInt(e.crc);            // crc-32
         writeInt(csize);            // compressed size
         writeInt(size);             // uncompressed size
-        byte[] nameBytes = getUTF8Bytes(e.name);
+        byte[] nameBytes = zc.getBytes(e.name);
         writeShort(nameBytes.length);
         if (hasZip64) {
             // + headid(2) + datasize(2)
@@ -464,8 +487,8 @@
         }
         byte[] commentBytes;
         if (e.comment != null) {
-            commentBytes = getUTF8Bytes(e.comment);
-            writeShort(commentBytes.length);
+            commentBytes = zc.getBytes(e.comment);
+            writeShort(Math.min(commentBytes.length, 0xffff));
         } else {
             commentBytes = null;
             writeShort(0);
@@ -489,7 +512,7 @@
             writeBytes(e.extra, 0, e.extra.length);
         }
         if (commentBytes != null) {
-            writeBytes(commentBytes, 0, commentBytes.length);
+            writeBytes(commentBytes, 0, Math.min(commentBytes.length, 0xffff));
         }
     }
 
@@ -541,9 +564,8 @@
         writeInt(xlen);                   // length of central directory
         writeInt(xoff);                   // offset of central directory
         if (comment != null) {            // zip file comment
-            byte[] b = getUTF8Bytes(comment);
-            writeShort(b.length);
-            writeBytes(b, 0, b.length);
+            writeShort(comment.length);
+            writeBytes(comment, 0, comment.length);
         } else {
             writeShort(0);
         }
@@ -594,60 +616,4 @@
         super.out.write(b, off, len);
         written += len;
     }
-
-    /*
-     * Returns the length of String's UTF8 encoding.
-     */
-    static int getUTF8Length(String s) {
-        int count = 0;
-        for (int i = 0; i < s.length(); i++) {
-            char ch = s.charAt(i);
-            if (ch <= 0x7f) {
-                count++;
-            } else if (ch <= 0x7ff) {
-                count += 2;
-            } else {
-                count += 3;
-            }
-        }
-        return count;
-    }
-
-    /*
-     * Returns an array of bytes representing the UTF8 encoding
-     * of the specified String.
-     */
-    private static byte[] getUTF8Bytes(String s) {
-        char[] c = s.toCharArray();
-        int len = c.length;
-        // Count the number of encoded bytes...
-        int count = 0;
-        for (int i = 0; i < len; i++) {
-            int ch = c[i];
-            if (ch <= 0x7f) {
-                count++;
-            } else if (ch <= 0x7ff) {
-                count += 2;
-            } else {
-                count += 3;
-            }
-        }
-        // Now return the encoded bytes...
-        byte[] b = new byte[count];
-        int off = 0;
-        for (int i = 0; i < len; i++) {
-            int ch = c[i];
-            if (ch <= 0x7f) {
-                b[off++] = (byte)ch;
-            } else if (ch <= 0x7ff) {
-                b[off++] = (byte)((ch >> 6) | 0xc0);
-                b[off++] = (byte)((ch & 0x3f) | 0x80);
-            } else {
-                b[off++] = (byte)((ch >> 12) | 0xe0);
-                b[off++] = (byte)(((ch >> 6) & 0x3f) | 0x80);
-                b[off++] = (byte)((ch & 0x3f) | 0x80);
-            }
-        }
-        return b;
-    }
 }
diff --git a/jdk/src/share/classes/java/util/zip/package.html b/jdk/src/share/classes/java/util/zip/package.html
index d4b5926..83d117d 100644
--- a/jdk/src/share/classes/java/util/zip/package.html
+++ b/jdk/src/share/classes/java/util/zip/package.html
@@ -53,6 +53,11 @@
       PKWARE ZIP File Format Specification</a>. The ZIP64(tm) format extensions
       are used to overcome the size limitations of the original ZIP format.
 <p>
+  <a name="lang_encoding">
+  <li>APPENDIX D of <a href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
+      PKWARE ZIP File Format Specification</a> - Language Encoding Flag (EFS) to
+      encode ZIP entry filename and comment fields using UTF-8.
+<p>
   <li><a href="http://www.isi.edu/in-notes/rfc1950.txt">
       ZLIB Compressed Data Format Specification version 3.3</a>
       &nbsp;
diff --git a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java
index b27e57f..cb1244e 100644
--- a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java
+++ b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java
@@ -599,7 +599,7 @@
      */
     @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*
diff --git a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java
index ab71f10..2662c42 100644
--- a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java
+++ b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java
@@ -481,7 +481,7 @@
      */
     @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*
diff --git a/jdk/src/share/classes/javax/management/monitor/Monitor.java b/jdk/src/share/classes/javax/management/monitor/Monitor.java
index fb3e1a4..2e37d8f 100644
--- a/jdk/src/share/classes/javax/management/monitor/Monitor.java
+++ b/jdk/src/share/classes/javax/management/monitor/Monitor.java
@@ -32,7 +32,10 @@
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -163,7 +166,10 @@
     /**
      * AccessControlContext of the Monitor.start() caller.
      */
-    private AccessControlContext acc;
+    private static final AccessControlContext noPermissionsACC =
+            new AccessControlContext(
+            new ProtectionDomain[] {new ProtectionDomain(null, null)});
+    private volatile AccessControlContext acc = noPermissionsACC;
 
     /**
      * Scheduler Service.
@@ -173,14 +179,20 @@
             new DaemonThreadFactory("Scheduler"));
 
     /**
+     * Map containing the thread pool executor per thread group.
+     */
+    private static final Map<ThreadPoolExecutor, Void> executors =
+            new WeakHashMap<ThreadPoolExecutor, Void>();
+
+    /**
+     * Lock for executors map.
+     */
+    private static final Object executorsLock = new Object();
+
+    /**
      * Maximum Pool Size
      */
     private static final int maximumPoolSize;
-
-    /**
-     * Executor Service.
-     */
-    private static final ThreadPoolExecutor executor;
     static {
         final String maximumPoolSizeSysProp = "jmx.x.monitor.maximum.pool.size";
         final String maximumPoolSizeStr = AccessController.doPrivileged(
@@ -210,22 +222,9 @@
                 maximumPoolSize = maximumPoolSizeTmp;
             }
         }
-        executor = new ThreadPoolExecutor(
-                maximumPoolSize,
-                maximumPoolSize,
-                60L,
-                TimeUnit.SECONDS,
-                new LinkedBlockingQueue<Runnable>(),
-                new DaemonThreadFactory("Executor"));
-        executor.allowCoreThreadTimeOut(true);
     }
 
     /**
-     * Monitor task to be executed by the Executor Service.
-     */
-    private final MonitorTask monitorTask = new MonitorTask();
-
-    /**
      * Future associated to the current monitor task.
      */
     private Future<?> monitorFuture;
@@ -233,7 +232,7 @@
     /**
      * Scheduler task to be executed by the Scheduler Service.
      */
-    private final SchedulerTask schedulerTask = new SchedulerTask(monitorTask);
+    private final SchedulerTask schedulerTask = new SchedulerTask();
 
     /**
      * ScheduledFuture associated to the current scheduler task.
@@ -719,6 +718,7 @@
             // Start the scheduler.
             //
             cleanupFutures();
+            schedulerTask.setMonitorTask(new MonitorTask());
             schedulerFuture = scheduler.schedule(schedulerTask,
                                                  getGranularityPeriod(),
                                                  TimeUnit.MILLISECONDS);
@@ -748,7 +748,7 @@
 
             // Reset the AccessControlContext.
             //
-            acc = null;
+            acc = noPermissionsACC;
 
             // Reset the complex type attribute information
             // such that it is recalculated again.
@@ -1467,7 +1467,7 @@
      */
     private class SchedulerTask implements Runnable {
 
-        private Runnable task = null;
+        private MonitorTask task;
 
         /*
          * ------------------------------------------
@@ -1475,7 +1475,16 @@
          * ------------------------------------------
          */
 
-        public SchedulerTask(Runnable task) {
+        public SchedulerTask() {
+        }
+
+        /*
+         * ------------------------------------------
+         *  GETTERS/SETTERS
+         * ------------------------------------------
+         */
+
+        public void setMonitorTask(MonitorTask task) {
             this.task = task;
         }
 
@@ -1487,7 +1496,7 @@
 
         public void run() {
             synchronized (Monitor.this) {
-                Monitor.this.monitorFuture = executor.submit(task);
+                Monitor.this.monitorFuture = task.submit();
             }
         }
     }
@@ -1500,6 +1509,8 @@
      */
     private class MonitorTask implements Runnable {
 
+        private ThreadPoolExecutor executor;
+
         /*
          * ------------------------------------------
          *  CONSTRUCTORS
@@ -1507,6 +1518,38 @@
          */
 
         public MonitorTask() {
+            // Find out if there's already an existing executor for the calling
+            // thread and reuse it. Otherwise, create a new one and store it in
+            // the executors map. If there is a SecurityManager, the group of
+            // System.getSecurityManager() is used, else the group of the thread
+            // instantiating this MonitorTask, i.e. the group of the thread that
+            // calls "Monitor.start()".
+            SecurityManager s = System.getSecurityManager();
+            ThreadGroup group = (s != null) ? s.getThreadGroup() :
+                Thread.currentThread().getThreadGroup();
+            synchronized (executorsLock) {
+                for (ThreadPoolExecutor e : executors.keySet()) {
+                    DaemonThreadFactory tf =
+                            (DaemonThreadFactory) e.getThreadFactory();
+                    ThreadGroup tg = tf.getThreadGroup();
+                    if (tg == group) {
+                        executor = e;
+                        break;
+                    }
+                }
+                if (executor == null) {
+                    executor = new ThreadPoolExecutor(
+                            maximumPoolSize,
+                            maximumPoolSize,
+                            60L,
+                            TimeUnit.SECONDS,
+                            new LinkedBlockingQueue<Runnable>(),
+                            new DaemonThreadFactory("ThreadGroup<" +
+                            group.getName() + "> Executor", group));
+                    executor.allowCoreThreadTimeOut(true);
+                    executors.put(executor, null);
+                }
+            }
         }
 
         /*
@@ -1515,12 +1558,18 @@
          * ------------------------------------------
          */
 
+        public Future<?> submit() {
+            return executor.submit(this);
+        }
+
         public void run() {
             final ScheduledFuture<?> sf;
+            final AccessControlContext ac;
             synchronized (Monitor.this) {
                 sf = Monitor.this.schedulerFuture;
+                ac = Monitor.this.acc;
             }
-            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
                 public Void run() {
                     if (Monitor.this.isActive()) {
                         final int an[] = alreadyNotifieds;
@@ -1533,7 +1582,11 @@
                     }
                     return null;
                 }
-            }, Monitor.this.acc);
+            };
+            if (ac == null) {
+                throw new SecurityException("AccessControlContext cannot be null");
+            }
+            AccessController.doPrivileged(action, ac);
             synchronized (Monitor.this) {
                 if (Monitor.this.isActive() &&
                     Monitor.this.schedulerFuture == sf) {
@@ -1573,6 +1626,15 @@
             namePrefix = "JMX Monitor " + poolName + " Pool [Thread-";
         }
 
+        public DaemonThreadFactory(String poolName, ThreadGroup threadGroup) {
+            group = threadGroup;
+            namePrefix = "JMX Monitor " + poolName + " Pool [Thread-";
+        }
+
+        public ThreadGroup getThreadGroup() {
+            return group;
+        }
+
         public Thread newThread(Runnable r) {
             Thread t = new Thread(group,
                                   r,
diff --git a/jdk/src/share/classes/javax/management/monitor/StringMonitor.java b/jdk/src/share/classes/javax/management/monitor/StringMonitor.java
index 3c2bbc5..9b4af52 100644
--- a/jdk/src/share/classes/javax/management/monitor/StringMonitor.java
+++ b/jdk/src/share/classes/javax/management/monitor/StringMonitor.java
@@ -184,6 +184,7 @@
      * @return The derived gauge of the specified object.
      *
      */
+    @Override
     public synchronized String getDerivedGauge(ObjectName object) {
         return (String) super.getDerivedGauge(object);
     }
@@ -199,6 +200,7 @@
      * @return The derived gauge timestamp of the specified object.
      *
      */
+    @Override
     public synchronized long getDerivedGaugeTimeStamp(ObjectName object) {
         return super.getDerivedGaugeTimeStamp(object);
     }
@@ -341,8 +343,9 @@
      * the Java class of the notification and the notification types sent by
      * the string monitor.
      */
+    @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
-        return notifsInfo;
+        return notifsInfo.clone();
     }
 
     /*
diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
index 55cd1ae..3b6262d 100644
--- a/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
+++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaSize.java
@@ -123,8 +123,10 @@
         if (x > y) {
             throw new IllegalArgumentException("X dimension > Y dimension");
         }
-        mediaName = media;
-        mediaMap.put(mediaName, this);
+        if (media != null && mediaMap.get(media) == null) {
+            mediaName = media;
+            mediaMap.put(mediaName, this);
+        }
         sizeVector.add(this);
     }
 
@@ -147,8 +149,10 @@
         if (x > y) {
             throw new IllegalArgumentException("X dimension > Y dimension");
         }
-        mediaName = media;
-        mediaMap.put(mediaName, this);
+        if (media != null && mediaMap.get(media) == null) {
+            mediaName = media;
+            mediaMap.put(mediaName, this);
+        }
         sizeVector.add(this);
     }
 
diff --git a/jdk/src/share/classes/javax/sound/midi/MetaMessage.java b/jdk/src/share/classes/javax/sound/midi/MetaMessage.java
index 7718f8c..8b27fa1 100644
--- a/jdk/src/share/classes/javax/sound/midi/MetaMessage.java
+++ b/jdk/src/share/classes/javax/sound/midi/MetaMessage.java
@@ -102,6 +102,29 @@
         this(defaultMessage);
     }
 
+    /**
+     * Constructs a new {@code MetaMessage} and sets the message parameters.
+     * The contents of the message can be changed by using
+     * the {@code setMessage} method.
+     *
+     * @param type   meta-message type (must be less than 128)
+     * @param data   the data bytes in the MIDI message
+     * @param length an amount of bytes in the {@code data} byte array;
+     *     it should be non-negative and less than or equal to
+     *     {@code data.length}
+     * @throws InvalidMidiDataException if the parameter values do not specify
+     *     a valid MIDI meta message
+     * @see #setMessage(int, byte[], int)
+     * @see #getType()
+     * @see #getData()
+     * @since 1.7
+     */
+    public MetaMessage(int type, byte[] data, int length)
+            throws InvalidMidiDataException {
+        super(null);
+        setMessage(type, data, length); // can throw InvalidMidiDataException
+    }
+
 
     /**
      * Constructs a new <code>MetaMessage</code>.
diff --git a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java
index 716d7b0..2dddc3c 100644
--- a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java
+++ b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java
@@ -187,6 +187,83 @@
         length = 3;
     }
 
+    /**
+     * Constructs a new {@code ShortMessage} which represents a MIDI
+     * message that takes no data bytes.
+     * The contents of the message can be changed by using one of
+     * the {@code setMessage} methods.
+     *
+     * @param status the MIDI status byte
+     * @throws InvalidMidiDataException if {@code status} does not specify
+     *     a valid MIDI status byte for a message that requires no data bytes
+     * @see #setMessage(int)
+     * @see #setMessage(int, int, int)
+     * @see #setMessage(int, int, int, int)
+     * @see #getStatus()
+     * @since 1.7
+     */
+    public ShortMessage(int status) throws InvalidMidiDataException {
+        super(null);
+        setMessage(status); // can throw InvalidMidiDataException
+    }
+
+    /**
+     * Constructs a new {@code ShortMessage} which represents a MIDI message
+     * that takes up to two data bytes. If the message only takes one data byte,
+     * the second data byte is ignored. If the message does not take
+     * any data bytes, both data bytes are ignored.
+     * The contents of the message can be changed by using one of
+     * the {@code setMessage} methods.
+     *
+     * @param status   the MIDI status byte
+     * @param data1    the first data byte
+     * @param data2    the second data byte
+     * @throws InvalidMidiDataException if the status byte or all data bytes
+     *     belonging to the message do not specify a valid MIDI message
+     * @see #setMessage(int)
+     * @see #setMessage(int, int, int)
+     * @see #setMessage(int, int, int, int)
+     * @see #getStatus()
+     * @see #getData1()
+     * @see #getData2()
+     * @since 1.7
+     */
+    public ShortMessage(int status, int data1, int data2)
+            throws InvalidMidiDataException {
+        super(null);
+        setMessage(status, data1, data2); // can throw InvalidMidiDataException
+    }
+
+    /**
+     * Constructs a new {@code ShortMessage} which represents a channel
+     * MIDI message that takes up to two data bytes. If the message only takes
+     * one data byte, the second data byte is ignored. If the message does not
+     * take any data bytes, both data bytes are ignored.
+     * The contents of the message can be changed by using one of
+     * the {@code setMessage} methods.
+     *
+     * @param command  the MIDI command represented by this message
+     * @param channel  the channel associated with the message
+     * @param data1    the first data byte
+     * @param data2    the second data byte
+     * @throws InvalidMidiDataException if the command value, channel value
+     *     or all data bytes belonging to the message do not specify
+     *     a valid MIDI message
+     * @see #setMessage(int)
+     * @see #setMessage(int, int, int)
+     * @see #setMessage(int, int, int, int)
+     * @see #getCommand()
+     * @see #getChannel()
+     * @see #getData1()
+     * @see #getData2()
+     * @since 1.7
+     */
+    public ShortMessage(int command, int channel, int data1, int data2)
+            throws InvalidMidiDataException {
+        super(null);
+        setMessage(command, channel, data1, data2);
+    }
+
 
     /**
      * Constructs a new <code>ShortMessage</code>.
diff --git a/jdk/src/share/classes/javax/sound/midi/SysexMessage.java b/jdk/src/share/classes/javax/sound/midi/SysexMessage.java
index a3833ff..387d066 100644
--- a/jdk/src/share/classes/javax/sound/midi/SysexMessage.java
+++ b/jdk/src/share/classes/javax/sound/midi/SysexMessage.java
@@ -120,6 +120,54 @@
         data[1] = (byte) (ShortMessage.END_OF_EXCLUSIVE & 0xFF);
     }
 
+    /**
+     * Constructs a new {@code SysexMessage} and sets the data for
+     * the message. The first byte of the data array must be a valid system
+     * exclusive status byte (0xF0 or 0xF7).
+     * The contents of the message can be changed by using one of
+     * the {@code setMessage} methods.
+     *
+     * @param data the system exclusive message data including the status byte
+     * @param length the length of the valid message data in the array,
+     *     including the status byte; it should be non-negative and less than
+     *     or equal to {@code data.length}
+     * @throws InvalidMidiDataException if the parameter values
+     *     do not specify a valid MIDI meta message.
+     * @see #setMessage(byte[], int)
+     * @see #setMessage(int, byte[], int)
+     * @see #getData()
+     * @since 1.7
+     */
+    public SysexMessage(byte[] data, int length)
+            throws InvalidMidiDataException {
+        super(null);
+        setMessage(data, length);
+    }
+
+    /**
+     * Constructs a new {@code SysexMessage} and sets the data for the message.
+     * The contents of the message can be changed by using one of
+     * the {@code setMessage} methods.
+     *
+     * @param status the status byte for the message; it must be a valid system
+     *     exclusive status byte (0xF0 or 0xF7)
+     * @param data the system exclusive message data (without the status byte)
+     * @param length the length of the valid message data in the array;
+     *     it should be non-negative and less than or equal to
+     *     {@code data.length}
+     * @throws InvalidMidiDataException if the parameter values
+     *     do not specify a valid MIDI meta message.
+     * @see #setMessage(byte[], int)
+     * @see #setMessage(int, byte[], int)
+     * @see #getData()
+     * @since 1.7
+     */
+    public SysexMessage(int status, byte[] data, int length)
+            throws InvalidMidiDataException {
+        super(null);
+        setMessage(status, data, length);
+    }
+
 
     /**
      * Constructs a new <code>SysexMessage</code>.
diff --git a/jdk/src/share/classes/javax/sound/sampled/FloatControl.java b/jdk/src/share/classes/javax/sound/sampled/FloatControl.java
index 650ec49..12a3140 100644
--- a/jdk/src/share/classes/javax/sound/sampled/FloatControl.java
+++ b/jdk/src/share/classes/javax/sound/sampled/FloatControl.java
@@ -131,13 +131,31 @@
      * @param minLabel the label for the minimum value, such as "Left" or "Off"
      * @param midLabel the label for the midpoint value, such as "Center" or "Default"
      * @param maxLabel the label for the maximum value, such as "Right" or "Full"
+     *
+     * @throws IllegalArgumentException if {@code minimum} is greater
+     *     than {@code maximum} or {@code initialValue} does not fall
+     *     within the allowable range
      */
     protected FloatControl(Type type, float minimum, float maximum,
-                           float precision, int updatePeriod, float initialValue,
-                           String units, String minLabel, String midLabel, String maxLabel) {
+            float precision, int updatePeriod, float initialValue,
+            String units, String minLabel, String midLabel, String maxLabel) {
 
         super(type);
 
+        if (minimum > maximum) {
+            throw new IllegalArgumentException("Minimum value " + minimum
+                    + " exceeds maximum value " + maximum + ".");
+        }
+        if (initialValue < minimum) {
+            throw new IllegalArgumentException("Initial value " + initialValue
+                    + " smaller than allowable minimum value " + minimum + ".");
+        }
+        if (initialValue > maximum) {
+            throw new IllegalArgumentException("Initial value " + initialValue
+                    + " exceeds allowable maximum value " + maximum + ".");
+        }
+
+
         this.minimum = minimum;
         this.maximum = maximum;
 
@@ -167,10 +185,15 @@
      * @param initialValue the value that the control starts with when constructed
      * @param units the label for the units in which the control's values are expressed,
      * such as "dB" or "frames per second"
+     *
+     * @throws IllegalArgumentException if {@code minimum} is greater
+     *     than {@code maximum} or {@code initialValue} does not fall
+     *     within the allowable range
      */
     protected FloatControl(Type type, float minimum, float maximum,
-                           float precision, int updatePeriod, float initialValue, String units) {
-        this(type, minimum, maximum, precision, updatePeriod, initialValue, units, "", "", "");
+            float precision, int updatePeriod, float initialValue, String units) {
+        this(type, minimum, maximum, precision, updatePeriod,
+                initialValue, units, "", "", "");
     }
 
 
@@ -306,9 +329,21 @@
      * @param to final value after the shift
      * @param microseconds maximum duration of the shift in microseconds
      *
+     * @throws IllegalArgumentException if either {@code from} or {@code to}
+     *     value does not fall within the allowable range
+     *
      * @see #getUpdatePeriod
      */
     public void shift(float from, float to, int microseconds) {
+        // test "from" value, "to" value will be tested by setValue()
+        if (from < minimum) {
+            throw new IllegalArgumentException("Requested value " + from
+                    + " smaller than allowable minimum value " + minimum + ".");
+        }
+        if (from > maximum) {
+            throw new IllegalArgumentException("Requested value " + from
+                    + " exceeds allowable maximum value " + maximum + ".");
+        }
         setValue(to);
     }
 
diff --git a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java
index d5c161e..c79bb11 100644
--- a/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java
+++ b/jdk/src/share/classes/javax/sound/sampled/spi/MixerProvider.java
@@ -42,9 +42,15 @@
     /**
      * Indicates whether the mixer provider supports the mixer represented by
      * the specified mixer info object.
+     * <p>
+     * The full set of mixer info objects that represent the mixers supported
+     * by this {@code MixerProvider} may be obtained
+     * through the {@code getMixerInfo} method.
+     *
      * @param info an info object that describes the mixer for which support is queried
-     * @return <code>true</code> if the specified mixer is supported,
-     * otherwise <code>false</code>
+     * @return {@code true} if the specified mixer is supported,
+     *     otherwise {@code false}
+     * @see #getMixerInfo()
      */
     public boolean isMixerSupported(Mixer.Info info) {
 
@@ -62,17 +68,34 @@
     /**
      * Obtains the set of info objects representing the mixer
      * or mixers provided by this MixerProvider.
-     * @return set of mixer info objects
+     * <p>
+     * The {@code isMixerSupported} method returns {@code true}
+     * for all the info objects returned by this method.
+     * The corresponding mixer instances for the info objects
+     * are returned by the {@code getMixer} method.
+     *
+     * @return a set of mixer info objects
+     * @see #getMixer(javax.sound.sampled.Mixer.Info) getMixer(Mixer.Info)
+     * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
      */
     public abstract Mixer.Info[] getMixerInfo();
 
 
     /**
      * Obtains an instance of the mixer represented by the info object.
+     * <p>
+     * The full set of the mixer info objects that represent the mixers
+     * supported by this {@code MixerProvider} may be obtained
+     * through the {@code getMixerInfo} method.
+     * Use the {@code isMixerSupported} method to test whether
+     * this {@code MixerProvider} supports a particular mixer.
+     *
      * @param info an info object that describes the desired mixer
      * @return mixer instance
      * @throws IllegalArgumentException if the info object specified does not
-     * match the info object for a mixer supported by this MixerProvider.
+     *     match the info object for a mixer supported by this MixerProvider.
+     * @see #getMixerInfo()
+     * @see #isMixerSupported(javax.sound.sampled.Mixer.Info) isMixerSupported(Mixer.Info)
      */
     public abstract Mixer getMixer(Mixer.Info info);
 }
diff --git a/jdk/src/share/classes/javax/swing/DefaultCellEditor.java b/jdk/src/share/classes/javax/swing/DefaultCellEditor.java
index da1bbcc..3320d37 100644
--- a/jdk/src/share/classes/javax/swing/DefaultCellEditor.java
+++ b/jdk/src/share/classes/javax/swing/DefaultCellEditor.java
@@ -266,6 +266,26 @@
                                                  boolean isSelected,
                                                  int row, int column) {
         delegate.setValue(value);
+        if (editorComponent instanceof JCheckBox) {
+            //in order to avoid a "flashing" effect when clicking a checkbox
+            //in a table, it is important for the editor to have as a border
+            //the same border that the renderer has, and have as the background
+            //the same color as the renderer has. This is primarily only
+            //needed for JCheckBox since this editor doesn't fill all the
+            //visual space of the table cell, unlike a text field.
+            TableCellRenderer renderer = table.getCellRenderer(row, column);
+            Component c = renderer.getTableCellRendererComponent(table, value,
+                    isSelected, true, row, column);
+            if (c != null) {
+                editorComponent.setOpaque(true);
+                editorComponent.setBackground(c.getBackground());
+                if (c instanceof JComponent) {
+                    editorComponent.setBorder(((JComponent)c).getBorder());
+                }
+            } else {
+                editorComponent.setOpaque(false);
+            }
+        }
         return editorComponent;
     }
 
diff --git a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java
index 4d523e0..2cb4227 100644
--- a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java
+++ b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java
@@ -34,6 +34,7 @@
 import java.awt.Rectangle;
 
 import java.io.Serializable;
+import sun.swing.DefaultLookup;
 
 
 /**
@@ -79,8 +80,9 @@
     * <code>getListCellRendererComponent</code> method and set the border
     * of the returned component directly.
     */
-    protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
     private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    protected static Border noFocusBorder = DEFAULT_NO_FOCUS_BORDER;
 
     /**
      * Constructs a default renderer object for an item
@@ -90,14 +92,21 @@
         super();
         setOpaque(true);
         setBorder(getNoFocusBorder());
+        setName("List.cellRenderer");
     }
 
-
-    private static Border getNoFocusBorder() {
+    private Border getNoFocusBorder() {
+        Border border = DefaultLookup.getBorder(this, ui, "List.cellNoFocusBorder");
         if (System.getSecurityManager() != null) {
+            if (border != null) return border;
             return SAFE_NO_FOCUS_BORDER;
         } else {
-            return UIManager.getBorder("List.noFocusBorder");
+            if (border != null &&
+                    (noFocusBorder == null ||
+                    noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
+                return border;
+            }
+            return noFocusBorder;
         }
     }
 
@@ -118,8 +127,8 @@
                 && !dropLocation.isInsert()
                 && dropLocation.getIndex() == index) {
 
-            bg = UIManager.getColor("List.dropCellBackground");
-            fg = UIManager.getColor("List.dropCellForeground");
+            bg = DefaultLookup.getColor(this, ui, "List.dropCellBackground");
+            fg = DefaultLookup.getColor(this, ui, "List.dropCellForeground");
 
             isSelected = true;
         }
@@ -148,10 +157,10 @@
         Border border = null;
         if (cellHasFocus) {
             if (isSelected) {
-                border = UIManager.getBorder("List.focusSelectedCellHighlightBorder");
+                border = DefaultLookup.getBorder(this, ui, "List.focusSelectedCellHighlightBorder");
             }
             if (border == null) {
-                border = UIManager.getBorder("List.focusCellHighlightBorder");
+                border = DefaultLookup.getBorder(this, ui, "List.focusCellHighlightBorder");
             }
         } else {
             border = getNoFocusBorder();
@@ -161,7 +170,6 @@
         return this;
     }
 
-
     /**
      * Overridden for performance reasons.
      * See the <a href="#override">Implementation Note</a>
@@ -172,6 +180,7 @@
      *         and differs from the JList's background;
      *         <code>false</code> otherwise
      */
+    @Override
     public boolean isOpaque() {
         Color back = getBackground();
         Component p = getParent();
@@ -190,6 +199,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void validate() {}
 
    /**
@@ -199,6 +209,7 @@
     *
     * @since 1.5
     */
+    @Override
     public void invalidate() {}
 
    /**
@@ -208,6 +219,7 @@
     *
     * @since 1.5
     */
+    @Override
     public void repaint() {}
 
    /**
@@ -215,12 +227,14 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void revalidate() {}
    /**
     * Overridden for performance reasons.
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void repaint(long tm, int x, int y, int width, int height) {}
 
    /**
@@ -228,6 +242,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void repaint(Rectangle r) {}
 
    /**
@@ -235,6 +250,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
         // Strings get interned...
         if (propertyName == "text"
@@ -251,6 +267,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, byte oldValue, byte newValue) {}
 
    /**
@@ -258,6 +275,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, char oldValue, char newValue) {}
 
    /**
@@ -265,6 +283,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, short oldValue, short newValue) {}
 
    /**
@@ -272,6 +291,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, int oldValue, int newValue) {}
 
    /**
@@ -279,6 +299,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, long oldValue, long newValue) {}
 
    /**
@@ -286,6 +307,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, float oldValue, float newValue) {}
 
    /**
@@ -293,6 +315,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, double oldValue, double newValue) {}
 
    /**
@@ -300,6 +323,7 @@
     * See the <a href="#override">Implementation Note</a>
     * for more information.
     */
+    @Override
     public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {}
 
     /**
@@ -321,5 +345,4 @@
         implements javax.swing.plaf.UIResource
     {
     }
-
 }
diff --git a/jdk/src/share/classes/javax/swing/JComboBox.java b/jdk/src/share/classes/javax/swing/JComboBox.java
index 42ef646..838ce5d 100644
--- a/jdk/src/share/classes/javax/swing/JComboBox.java
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java
@@ -34,12 +34,10 @@
 
 import java.io.Serializable;
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
 
 import javax.swing.event.*;
 import javax.swing.plaf.*;
-import javax.swing.border.*;
 
 import javax.accessibility.*;
 
@@ -227,7 +225,7 @@
 
     private void init() {
         installAncestorListener();
-        setOpaque(true);
+        setUIProperty("opaque",true);
         updateUI();
     }
 
diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java
index 13c1365..b2be43c 100644
--- a/jdk/src/share/classes/javax/swing/JScrollPane.java
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java
@@ -32,15 +32,12 @@
 
 import java.awt.Component;
 import java.awt.ComponentOrientation;
-import java.awt.Graphics;
 import java.awt.Rectangle;
 import java.awt.Insets;
-import java.awt.Color;
 import java.awt.LayoutManager;
 import java.awt.Point;
 
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
 
 import java.beans.PropertyChangeEvent;
@@ -304,7 +301,7 @@
         if (view != null) {
             setViewportView(view);
         }
-        setOpaque(true);
+        setUIProperty("opaque",true);
         updateUI();
 
         if (!this.getComponentOrientation().isLeftToRight()) {
diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java
index ddd92b9..ed7bfc8 100644
--- a/jdk/src/share/classes/javax/swing/JSpinner.java
+++ b/jdk/src/share/classes/javax/swing/JSpinner.java
@@ -28,7 +28,6 @@
 import java.awt.*;
 import java.awt.event.*;
 
-import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
 import javax.swing.plaf.SpinnerUI;
@@ -154,7 +153,7 @@
         }
         this.model = model;
         this.editor = createEditor(model);
-        setOpaque(true);
+        setUIProperty("opaque",true);
         updateUI();
     }
 
diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java
index 1e38b9f..b5d8ec7 100644
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java
@@ -246,7 +246,8 @@
      * layout, using two buttons for the components.
      */
     public JSplitPane() {
-        this(JSplitPane.HORIZONTAL_SPLIT, false,
+        this(JSplitPane.HORIZONTAL_SPLIT,
+            UIManager.getBoolean("SplitPane.continuousLayout"),
             new JButton(UIManager.getString("SplitPane.leftButtonText")),
             new JButton(UIManager.getString("SplitPane.rightButtonText")));
     }
@@ -263,7 +264,8 @@
      */
     @ConstructorProperties({"orientation"})
     public JSplitPane(int newOrientation) {
-        this(newOrientation, false);
+        this(newOrientation,
+            UIManager.getBoolean("SplitPane.continuousLayout"));
     }
 
 
@@ -307,7 +309,9 @@
     public JSplitPane(int newOrientation,
                       Component newLeftComponent,
                       Component newRightComponent){
-        this(newOrientation, false, newLeftComponent, newRightComponent);
+        this(newOrientation,
+            UIManager.getBoolean("SplitPane.continuousLayout"),
+            newLeftComponent, newRightComponent);
     }
 
 
diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java
index 1b770d8..dc9adeb 100644
--- a/jdk/src/share/classes/javax/swing/JTable.java
+++ b/jdk/src/share/classes/javax/swing/JTable.java
@@ -731,6 +731,37 @@
                     return;
                 }
                 scrollPane.setColumnHeaderView(getTableHeader());
+                // configure the scrollpane for any LAF dependent settings
+                configureEnclosingScrollPaneUI();
+            }
+        }
+    }
+
+    /**
+     * This is a sub-part of configureEnclosingScrollPane() that configures
+     * anything on the scrollpane that may change when the look and feel
+     * changes. It needed to be split out from configureEnclosingScrollPane() so
+     * that it can be called from updateUI() when the LAF changes without
+     * causing the regression found in bug 6687962. This was because updateUI()
+     * is called from the constructor which then caused
+     * configureEnclosingScrollPane() to be called by the constructor which
+     * changes its contract for any subclass that overrides it. So by splitting
+     * it out in this way configureEnclosingScrollPaneUI() can be called both
+     * from configureEnclosingScrollPane() and updateUI() in a safe manor.
+     */
+    private void configureEnclosingScrollPaneUI() {
+        Container p = getParent();
+        if (p instanceof JViewport) {
+            Container gp = p.getParent();
+            if (gp instanceof JScrollPane) {
+                JScrollPane scrollPane = (JScrollPane)gp;
+                // Make certain we are the viewPort's view and not, for
+                // example, the rowHeaderView of the scrollPane -
+                // an implementor of fixed columns might do this.
+                JViewport viewport = scrollPane.getViewport();
+                if (viewport == null || viewport.getView() != this) {
+                    return;
+                }
                 //  scrollPane.getViewport().setBackingStoreEnabled(true);
                 Border border = scrollPane.getBorder();
                 if (border == null || border instanceof UIResource) {
@@ -740,6 +771,24 @@
                         scrollPane.setBorder(scrollPaneBorder);
                     }
                 }
+                // add JScrollBar corner component if available from LAF and not already set by the user
+                Component corner =
+                        scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER);
+                if (corner == null || corner instanceof UIResource){
+                    corner = null;
+                    Object componentClass = UIManager.get(
+                            "Table.scrollPaneCornerComponent");
+                    if (componentClass instanceof Class){
+                        try {
+                            corner = (Component)
+                                    ((Class)componentClass).newInstance();
+                        } catch (Exception e) {
+                            // just ignore and don't set corner
+                        }
+                    }
+                    scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
+                            corner);
+                }
             }
         }
     }
@@ -783,6 +832,13 @@
                     return;
                 }
                 scrollPane.setColumnHeaderView(null);
+                // remove ScrollPane corner if one was added by the LAF
+                Component corner =
+                        scrollPane.getCorner(JScrollPane.UPPER_TRAILING_CORNER);
+                if (corner instanceof UIResource){
+                    scrollPane.setCorner(JScrollPane.UPPER_TRAILING_CORNER,
+                            null);
+                }
             }
         }
     }
@@ -3592,6 +3648,9 @@
             tableHeader.updateUI();
         }
 
+        // Update UI applied to parent ScrollPane
+        configureEnclosingScrollPaneUI();
+
         setUI((TableUI)UIManager.getUI(this));
     }
 
diff --git a/jdk/src/share/classes/javax/swing/MultiUIDefaults.java b/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
index d5904d0..20eeeaf 100644
--- a/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
+++ b/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
@@ -26,7 +26,10 @@
 package javax.swing;
 
 import java.util.Enumeration;
+import java.util.HashSet;
 import java.util.Locale;
+import java.util.Map.Entry;
+import java.util.Set;
 
 
 
@@ -48,7 +51,7 @@
         tables = new UIDefaults[0];
     }
 
-
+    @Override
     public Object get(Object key)
     {
         Object value = super.get(key);
@@ -66,7 +69,7 @@
         return null;
     }
 
-
+    @Override
     public Object get(Object key, Locale l)
     {
         Object value = super.get(key,l);
@@ -84,7 +87,7 @@
         return null;
     }
 
-
+    @Override
     public int size() {
         int n = super.size();
         for (UIDefaults table : tables) {
@@ -93,12 +96,12 @@
         return n;
     }
 
-
+    @Override
     public boolean isEmpty() {
         return size() == 0;
     }
 
-
+    @Override
     public Enumeration<Object> keys()
     {
         Enumeration[] enums = new Enumeration[1 + tables.length];
@@ -112,7 +115,7 @@
         return new MultiUIDefaultsEnumerator(enums);
     }
 
-
+    @Override
     public Enumeration<Object> elements()
     {
         Enumeration[] enums = new Enumeration[1 + tables.length];
@@ -126,6 +129,19 @@
         return new MultiUIDefaultsEnumerator(enums);
     }
 
+    @Override
+    public Set<Entry<Object, Object>> entrySet() {
+        Set<Entry<Object, Object>> set = new HashSet<Entry<Object, Object>>();
+        if (tables == null) return set;
+        for (UIDefaults table : tables) {
+            if (table != null) {
+                set.addAll(table.entrySet());
+            }
+        }
+        return set;
+    }
+
+    @Override
     protected void getUIError(String msg) {
         if (tables.length > 0) {
             tables[0].getUIError(msg);
@@ -164,7 +180,7 @@
         }
     }
 
-
+    @Override
     public Object remove(Object key)
     {
         Object value = super.remove(key);
@@ -182,7 +198,7 @@
         return null;
     }
 
-
+    @Override
     public void clear() {
         super.clear();
         for (UIDefaults table : tables) {
@@ -192,6 +208,7 @@
         }
     }
 
+    @Override
     public synchronized String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("{");
diff --git a/jdk/src/share/classes/javax/swing/Painter.java b/jdk/src/share/classes/javax/swing/Painter.java
new file mode 100644
index 0000000..2c6135e
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/Painter.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing;
+
+import java.awt.Graphics2D;
+
+/**
+ * <p>A painting delegate. The Painter interface defines exactly one method,
+ * <code>paint</code>. It is used in situations where the developer can change
+ * the painting routine of a component without having to resort to subclassing
+ * the component. It is also generically useful when doing any form of painting
+ * delegation.</p>
+ *
+ * <p><code>Painter</code>s are simply encapsulations of Java2D code and make
+ * it fairly trivial to reuse existing <code>Painter</code>s or to combine
+ * them together. Implementations of this interface are also trivial to write,
+ * such that if you can't find a <code>Painter</code> that does what you need,
+ * you can write one with minimal effort. Writing a <code>Painter</code> requires
+ * knowledge of Java2D.</p>
+ *
+ * <p>A <code>Painter</code> may be created with a type parameter. This type will be
+ * expected in the <code>paint</code> method. For example, you may wish to write a
+ * <code>Painter</code> that only works with subclasses of {@link java.awt.Component}.
+ * In that case, when the <code>Painter</code> is declared, you may declare that
+ * it requires a <code>Component</code>, allowing the paint method to be type safe. Ex:
+ * <pre><code>
+ *     Painter<Component> p = new Painter<Component>() {
+ *         public void paint(Graphics2D g, Component c, int width, int height) {
+ *             g.setColor(c.getBackground());
+ *             //and so forth
+ *         }
+ *     }
+ * </code></pre></p>
+ *
+ * <p>This interface makes no guarantees of threadsafety.</p>
+ *
+ * @author rbair
+ */
+public interface Painter<T> {
+    /**
+     * <p>Renders to the given {@link java.awt.Graphics2D} object. Implementations
+     * of this method <em>may</em> modify state on the <code>Graphics2D</code>, and are not
+     * required to restore that state upon completion. In most cases, it is recommended
+     * that the caller pass in a scratch graphics object. The <code>Graphics2D</code>
+     * must never be null.</p>
+     *
+     * <p>State on the graphics object may be honored by the <code>paint</code> method,
+     * but may not be. For instance, setting the antialiasing rendering hint on the
+     * graphics may or may not be respected by the <code>Painter</code> implementation.</p>
+     *
+     * <p>The supplied object parameter acts as an optional configuration argument.
+     * For example, it could be of type <code>Component</code>. A <code>Painter</code>
+     * that expected it could then read state from that <code>Component</code> and
+     * use the state for painting. For example, an implementation may read the
+     * backgroundColor and use that.</p>
+     *
+     * <p>Generally, to enhance reusability, most standard <code>Painter</code>s ignore
+     * this parameter. They can thus be reused in any context. The <code>object</code>
+     * may be null. Implementations must not throw a NullPointerException if the object
+     * parameter is null.</p>
+     *
+     * <p>Finally, the <code>width</code> and <code>height</code> arguments specify the
+     * width and height that the <code>Painter</code> should paint into. More
+     * specifically, the specified width and height instruct the painter that it should
+     * paint fully within this width and height. Any specified clip on the
+     * <code>g</code> param will further constrain the region.</p>
+     *
+     * <p>For example, suppose I have a <code>Painter</code> implementation that draws
+     * a gradient. The gradient goes from white to black. It "stretches" to fill the
+     * painted region. Thus, if I use this <code>Painter</code> to paint a 500 x 500
+     * region, the far left would be black, the far right would be white, and a smooth
+     * gradient would be painted between. I could then, without modification, reuse the
+     * <code>Painter</code> to paint a region that is 20x20 in size. This region would
+     * also be black on the left, white on the right, and a smooth gradient painted
+     * between.</p>
+     *
+     * @param g The Graphics2D to render to. This must not be null.
+     * @param object an optional configuration parameter. This may be null.
+     * @param width width of the area to paint.
+     * @param height height of the area to paint.
+     */
+    public void paint(Graphics2D g, T object, int width, int height);
+}
diff --git a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java
index bd6f6ac..44388fe 100644
--- a/jdk/src/share/classes/javax/swing/UIManager.java
+++ b/jdk/src/share/classes/javax/swing/UIManager.java
@@ -383,6 +383,8 @@
         ArrayList<LookAndFeelInfo> iLAFs = new ArrayList<LookAndFeelInfo>(4);
         iLAFs.add(new LookAndFeelInfo(
                       "Metal", "javax.swing.plaf.metal.MetalLookAndFeel"));
+        iLAFs.add(new LookAndFeelInfo(
+                      "Nimbus", "javax.swing.plaf.nimbus.NimbusLookAndFeel"));
         iLAFs.add(new LookAndFeelInfo("CDE/Motif",
                   "com.sun.java.swing.plaf.motif.MotifLookAndFeel"));
 
diff --git a/jdk/src/share/classes/javax/swing/border/TitledBorder.java b/jdk/src/share/classes/javax/swing/border/TitledBorder.java
index eb50e95..7540bdf 100644
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java
@@ -133,7 +133,7 @@
      * @param title  the title the border should display
      */
     public TitledBorder(String title)     {
-        this(null, title, LEADING, TOP, null, null);
+        this(null, title, LEADING, DEFAULT_POSITION, null, null);
     }
 
     /**
@@ -143,7 +143,7 @@
      * @param border  the border
      */
     public TitledBorder(Border border)       {
-        this(border, "", LEADING, TOP, null, null);
+        this(border, "", LEADING, DEFAULT_POSITION, null, null);
     }
 
     /**
@@ -154,7 +154,7 @@
      * @param title  the title the border should display
      */
     public TitledBorder(Border border, String title) {
-        this(border, title, LEADING, TOP, null, null);
+        this(border, title, LEADING, DEFAULT_POSITION, null, null);
     }
 
     /**
@@ -502,7 +502,33 @@
     /**
      * Returns the title-position of the titled border.
      */
-    public int getTitlePosition()   {       return titlePosition;   }
+    public int getTitlePosition() {
+        if (titlePosition == DEFAULT_POSITION) {
+            Object value = UIManager.get("TitledBorder.position");
+            if (value instanceof String) {
+                String s = (String)value;
+                if ("ABOVE_TOP".equalsIgnoreCase(s)) {
+                    return ABOVE_TOP;
+                } else if ("TOP".equalsIgnoreCase(s)) {
+                    return TOP;
+                } else if ("BELOW_TOP".equalsIgnoreCase(s)) {
+                    return BELOW_TOP;
+                } else if ("ABOVE_BOTTOM".equalsIgnoreCase(s)) {
+                    return ABOVE_BOTTOM;
+                } else if ("BOTTOM".equalsIgnoreCase(s)) {
+                    return BOTTOM;
+                } else if ("BELOW_BOTTOM".equalsIgnoreCase(s)) {
+                    return BELOW_BOTTOM;
+                }
+            } else if (value instanceof Integer) {
+                int i = (Integer)value;
+                if (i >= 0 && i <= 6) {
+                    return i;
+                }
+            }
+        }
+        return titlePosition;
+    }
 
     /**
      * Returns the title-justification of the titled border.
@@ -613,7 +639,7 @@
         Font font = getFont(c);
         FontMetrics fm = c.getFontMetrics(font);
         JComponent jc = (c instanceof JComponent) ? (JComponent)c : null;
-        switch (titlePosition) {
+        switch (getTitlePosition()) {
           case ABOVE_TOP:
           case BELOW_BOTTOM:
               minSize.width = Math.max(SwingUtilities2.stringWidth(jc, fm,
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
index ef05d87..80b449c 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -29,7 +29,6 @@
 import java.awt.event.*;
 import javax.swing.*;
 import javax.accessibility.*;
-import javax.swing.FocusManager;
 import javax.swing.plaf.*;
 import javax.swing.border.*;
 import javax.swing.text.*;
@@ -187,6 +186,23 @@
      */
     private boolean sameBaseline;
 
+    /**
+     * Indicates whether or not the combo box button should be square.
+     * If square, then the width and height are equal, and are both set to
+     * the height of the combo (minus appropriate insets).
+     */
+    private boolean squareButton = true;
+
+    /**
+     * Optional: if specified, these insets act as padding around the cell
+     * renderer when laying out and painting the "selected" item in the
+     * combo box. BasicComboBoxUI uses a single combo box renderer for rendering
+     * both the main combo box item and also all the items in the dropdown
+     * for the combo box. padding allows you to specify addition insets in
+     * addition to those specified by the cell renderer.
+     */
+    private Insets padding;
+
     // Used for calculating the default size.
     private static ListCellRenderer getDefaultListCellRenderer() {
         ListCellRenderer renderer = (ListCellRenderer)AppContext.
@@ -226,6 +242,7 @@
         return new BasicComboBoxUI();
     }
 
+    @Override
     public void installUI( JComponent c ) {
         isMinimumSizeDirty = true;
 
@@ -265,6 +282,7 @@
         comboBox.setKeySelectionManager(keySelectionManager);
     }
 
+    @Override
     public void uninstallUI( JComponent c ) {
         setPopupVisible( comboBox, false);
         popup.uninstallingUI();
@@ -317,7 +335,13 @@
         LookAndFeel.installProperty( comboBox, "opaque", Boolean.TRUE);
 
         Long l = (Long)UIManager.get("ComboBox.timeFactor");
-        timeFactor = (l!=null) ? l.longValue() : 1000L;
+        timeFactor = l == null ? 1000L : l.longValue();
+
+        //NOTE: this needs to default to true if not specified
+        Boolean b = (Boolean)UIManager.get("ComboBox.squareButton");
+        squareButton = b == null ? true : b;
+
+        padding = UIManager.getInsets("ComboBox.padding");
     }
 
     /**
@@ -530,6 +554,7 @@
      * <code>BasicComboBoxUI</code>.
      */
     public class KeyHandler extends KeyAdapter {
+        @Override
         public void keyPressed( KeyEvent e ) {
             getHandler().keyPressed(e);
         }
@@ -761,6 +786,8 @@
         }
 
         comboBox.configureEditor(comboBox.getEditor(),comboBox.getSelectedItem());
+
+        editor.addPropertyChangeListener(propertyChangeListener);
     }
 
     /**
@@ -774,6 +801,7 @@
             editor.removeFocusListener(focusListener);
         }
 
+        editor.removePropertyChangeListener(propertyChangeListener);
         editor.removeFocusListener(getHandler());
         comboBox.getEditor().removeActionListener(getHandler());
     }
@@ -868,7 +896,7 @@
 
     //=================================
     // begin ComponentUI Implementation
-
+    @Override
     public void paint( Graphics g, JComponent c ) {
         hasFocus = comboBox.hasFocus();
         if ( !comboBox.isEditable() ) {
@@ -878,6 +906,7 @@
         }
     }
 
+    @Override
     public Dimension getPreferredSize( JComponent c ) {
         return getMinimumSize(c);
     }
@@ -885,15 +914,19 @@
     /**
      * The minumum size is the size of the display area plus insets plus the button.
      */
+    @Override
     public Dimension getMinimumSize( JComponent c ) {
         if ( !isMinimumSizeDirty ) {
             return new Dimension(cachedMinimumSize);
         }
         Dimension size = getDisplaySize();
         Insets insets = getInsets();
+        //calculate the width and height of the button
+        int buttonHeight = size.height;
+        int buttonWidth = squareButton ? buttonHeight : arrowButton.getPreferredSize().width;
+        //adjust the size based on the button width
         size.height += insets.top + insets.bottom;
-        int buttonSize = size.height - (insets.top + insets.bottom);
-        size.width +=  insets.left + insets.right + buttonSize;
+        size.width +=  insets.left + insets.right + buttonWidth;
 
         cachedMinimumSize.setSize( size.width, size.height );
         isMinimumSizeDirty = false;
@@ -901,6 +934,7 @@
         return new Dimension(size);
     }
 
+    @Override
     public Dimension getMaximumSize( JComponent c ) {
         return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
     }
@@ -913,6 +947,7 @@
      * @see javax.swing.JComponent#getBaseline(int, int)
      * @since 1.6
      */
+    @Override
     public int getBaseline(JComponent c, int width, int height) {
         super.getBaseline(c, width, height);
         int baseline = -1;
@@ -967,6 +1002,7 @@
      * @see javax.swing.JComponent#getBaseline(int, int)
      * @since 1.6
      */
+    @Override
     public Component.BaselineResizeBehavior getBaselineResizeBehavior(
             JComponent c) {
         super.getBaselineResizeBehavior(c);
@@ -1001,6 +1037,7 @@
     }
 
     // This is currently hacky...
+    @Override
     public int getAccessibleChildrenCount(JComponent c) {
         if ( comboBox.isEditable() ) {
             return 2;
@@ -1011,6 +1048,7 @@
     }
 
     // This is currently hacky...
+    @Override
     public Accessible getAccessibleChild(JComponent c, int i) {
         // 0 = the popup
         // 1 = the editor
@@ -1204,8 +1242,15 @@
             shouldValidate = true;
         }
 
-        currentValuePane.paintComponent(g,c,comboBox,bounds.x,bounds.y,
-                                        bounds.width,bounds.height, shouldValidate);
+        int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
+        if (padding != null) {
+            x = bounds.x + padding.left;
+            y = bounds.y + padding.top;
+            w = bounds.width - (padding.left + padding.right);
+            h = bounds.height - (padding.top + padding.bottom);
+        }
+
+        currentValuePane.paintComponent(g,c,comboBox,x,y,w,h,shouldValidate);
     }
 
     /**
@@ -1333,6 +1378,12 @@
             result.height = Math.max(result.height,d.height);
         }
 
+        // calculate in the padding
+        if (padding != null) {
+            result.width += padding.left + padding.right;
+            result.height += padding.top + padding.bottom;
+        }
+
         // Set the cached value
         cachedDisplaySize.setSize(result.width, result.height);
         isDisplaySizeDirty = false;
@@ -1591,91 +1642,99 @@
         //
         public void propertyChange(PropertyChangeEvent e) {
             String propertyName = e.getPropertyName();
-            JComboBox comboBox = (JComboBox)e.getSource();
-
-            if ( propertyName == "model" ) {
-                ComboBoxModel newModel = (ComboBoxModel)e.getNewValue();
-                ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue();
-
-                if ( oldModel != null && listDataListener != null ) {
-                    oldModel.removeListDataListener( listDataListener );
+            if (e.getSource() == editor){
+                // If the border of the editor changes then this can effect
+                // the size of the editor which can cause the combo's size to
+                // become invalid so we need to clear size caches
+                if ("border".equals(propertyName)){
+                    isMinimumSizeDirty = true;
+                    isDisplaySizeDirty = true;
+                    comboBox.revalidate();
                 }
+            } else {
+                JComboBox comboBox = (JComboBox)e.getSource();
+                if ( propertyName == "model" ) {
+                    ComboBoxModel newModel = (ComboBoxModel)e.getNewValue();
+                    ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue();
 
-                if ( newModel != null && listDataListener != null ) {
-                    newModel.addListDataListener( listDataListener );
-                }
+                    if ( oldModel != null && listDataListener != null ) {
+                        oldModel.removeListDataListener( listDataListener );
+                    }
 
-                if ( editor != null ) {
-                    comboBox.configureEditor( comboBox.getEditor(), comboBox.getSelectedItem() );
+                    if ( newModel != null && listDataListener != null ) {
+                        newModel.addListDataListener( listDataListener );
+                    }
+
+                    if ( editor != null ) {
+                        comboBox.configureEditor( comboBox.getEditor(), comboBox.getSelectedItem() );
+                    }
+                    isMinimumSizeDirty = true;
+                    isDisplaySizeDirty = true;
+                    comboBox.revalidate();
+                    comboBox.repaint();
                 }
-                isMinimumSizeDirty = true;
-                isDisplaySizeDirty = true;
-                comboBox.revalidate();
-                comboBox.repaint();
-            }
-            else if ( propertyName == "editor" && comboBox.isEditable() ) {
-                addEditor();
-                comboBox.revalidate();
-            }
-            else if ( propertyName == "editable" ) {
-                if ( comboBox.isEditable() ) {
-                    comboBox.setRequestFocusEnabled( false );
+                else if ( propertyName == "editor" && comboBox.isEditable() ) {
                     addEditor();
-                } else {
-                    comboBox.setRequestFocusEnabled( true );
-                    removeEditor();
+                    comboBox.revalidate();
                 }
-
-                updateToolTipTextForChildren();
-
-                comboBox.revalidate();
-            }
-            else if ( propertyName == "enabled" ) {
-                boolean enabled = comboBox.isEnabled();
-                if ( editor != null )
-                    editor.setEnabled(enabled);
-                if ( arrowButton != null )
-                    arrowButton.setEnabled(enabled);
-                comboBox.repaint();
-            }
-            else if ( propertyName == "focusable" ) {
-                boolean focusable = comboBox.isFocusable();
-                if ( editor != null )
-                    editor.setFocusable(focusable);
-                if ( arrowButton != null )
-                    arrowButton.setFocusable(focusable);
-                comboBox.repaint();
-            }
-            else if ( propertyName == "maximumRowCount" ) {
-                if ( isPopupVisible( comboBox ) ) {
-                    setPopupVisible(comboBox, false);
-                    setPopupVisible(comboBox, true);
+                else if ( propertyName == "editable" ) {
+                    if ( comboBox.isEditable() ) {
+                        comboBox.setRequestFocusEnabled( false );
+                        addEditor();
+                    } else {
+                        comboBox.setRequestFocusEnabled( true );
+                        removeEditor();
+                    }
+                    updateToolTipTextForChildren();
+                    comboBox.revalidate();
                 }
-            }
-            else if ( propertyName == "font" ) {
-                listBox.setFont( comboBox.getFont() );
-                if ( editor != null ) {
-                    editor.setFont( comboBox.getFont() );
+                else if ( propertyName == "enabled" ) {
+                    boolean enabled = comboBox.isEnabled();
+                    if ( editor != null )
+                        editor.setEnabled(enabled);
+                    if ( arrowButton != null )
+                        arrowButton.setEnabled(enabled);
+                    comboBox.repaint();
                 }
-                isMinimumSizeDirty = true;
-                comboBox.validate();
-            }
-            else if ( propertyName == JComponent.TOOL_TIP_TEXT_KEY ) {
-                updateToolTipTextForChildren();
-            }
-            else if ( propertyName == BasicComboBoxUI.IS_TABLE_CELL_EDITOR ) {
-                Boolean inTable = (Boolean)e.getNewValue();
-                isTableCellEditor = inTable.equals(Boolean.TRUE) ? true : false;
-            }
-            else if (propertyName == "prototypeDisplayValue") {
-                isMinimumSizeDirty = true;
-                isDisplaySizeDirty = true;
-                comboBox.revalidate();
-            }
-            else if (propertyName == "renderer") {
-                isMinimumSizeDirty = true;
-                isDisplaySizeDirty = true;
-                comboBox.revalidate();
+                else if ( propertyName == "focusable" ) {
+                    boolean focusable = comboBox.isFocusable();
+                    if ( editor != null )
+                        editor.setFocusable(focusable);
+                    if ( arrowButton != null )
+                        arrowButton.setFocusable(focusable);
+                    comboBox.repaint();
+                }
+                else if ( propertyName == "maximumRowCount" ) {
+                    if ( isPopupVisible( comboBox ) ) {
+                        setPopupVisible(comboBox, false);
+                        setPopupVisible(comboBox, true);
+                    }
+                }
+                else if ( propertyName == "font" ) {
+                    listBox.setFont( comboBox.getFont() );
+                    if ( editor != null ) {
+                        editor.setFont( comboBox.getFont() );
+                    }
+                    isMinimumSizeDirty = true;
+                    comboBox.validate();
+                }
+                else if ( propertyName == JComponent.TOOL_TIP_TEXT_KEY ) {
+                    updateToolTipTextForChildren();
+                }
+                else if ( propertyName == BasicComboBoxUI.IS_TABLE_CELL_EDITOR ) {
+                    Boolean inTable = (Boolean)e.getNewValue();
+                    isTableCellEditor = inTable.equals(Boolean.TRUE) ? true : false;
+                }
+                else if (propertyName == "prototypeDisplayValue") {
+                    isMinimumSizeDirty = true;
+                    isDisplaySizeDirty = true;
+                    comboBox.revalidate();
+                }
+                else if (propertyName == "renderer") {
+                    isMinimumSizeDirty = true;
+                    isDisplaySizeDirty = true;
+                    comboBox.revalidate();
+                }
             }
         }
 
@@ -1809,18 +1868,23 @@
             int height = cb.getHeight();
 
             Insets insets = getInsets();
-            int buttonSize = height - (insets.top + insets.bottom);
+            int buttonHeight = height - (insets.top + insets.bottom);
+            int buttonWidth = buttonHeight;
+            if (arrowButton != null) {
+                Insets arrowInsets = arrowButton.getInsets();
+                buttonWidth = squareButton ?
+                    buttonHeight :
+                    arrowButton.getPreferredSize().width + arrowInsets.left + arrowInsets.right;
+            }
             Rectangle cvb;
 
-            if ( arrowButton != null ) {
-                if(BasicGraphicsUtils.isLeftToRight(cb)) {
-                    arrowButton.setBounds( width - (insets.right + buttonSize),
-                                           insets.top,
-                                           buttonSize, buttonSize);
-                }
-                else {
-                    arrowButton.setBounds( insets.left, insets.top,
-                                           buttonSize, buttonSize);
+            if (arrowButton != null) {
+                if (BasicGraphicsUtils.isLeftToRight(cb)) {
+                    arrowButton.setBounds(width - (insets.right + buttonWidth),
+                            insets.top, buttonWidth, buttonHeight);
+                } else {
+                    arrowButton.setBounds(insets.left, insets.top,
+                            buttonWidth, buttonHeight);
                 }
             }
             if ( editor != null ) {
@@ -1829,7 +1893,6 @@
             }
         }
 
-
         //
         // ActionListener
         //
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
index a7ec888..7704d10 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java
@@ -480,6 +480,12 @@
         if (renderer == null) {
             ListCellRenderer lcr = (ListCellRenderer)UIManager.get(
                     "List.cellRenderer");
+
+            // fix for 6711072 some LAFs like Nimbus do not provide this
+            // UIManager key and we should not through a NPE here because of it
+            if (lcr == null) {
+                lcr = new DefaultListCellRenderer();
+            }
             renderer = lcr.getListCellRendererComponent(
                     list, "a", -1, false, false);
             lafDefaults.put(BASELINE_COMPONENT_KEY, renderer);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
index a58cc46..61c70c9 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -111,6 +111,11 @@
         String prefix = getPropertyPrefix();
 
         acceleratorFont = UIManager.getFont("MenuItem.acceleratorFont");
+        // use default if missing so that BasicMenuItemUI can be used in other
+        // LAFs like Nimbus
+        if (acceleratorFont == null) {
+            acceleratorFont = UIManager.getFont("MenuItem.font");
+        }
 
         Object opaque = UIManager.get(getPropertyPrefix() + ".opaque");
         if (opaque != null) {
@@ -130,7 +135,7 @@
         LookAndFeel.installBorder(menuItem, prefix + ".border");
         oldBorderPainted = menuItem.isBorderPainted();
         LookAndFeel.installProperty(menuItem, "borderPainted",
-                                    UIManager.get(prefix + ".borderPainted"));
+                                    UIManager.getBoolean(prefix + ".borderPainted"));
         LookAndFeel.installColorsAndFont(menuItem,
                                          prefix + ".background",
                                          prefix + ".foreground",
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
index e743602..0d31dc3 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
@@ -158,6 +158,7 @@
                                          "ProgressBar.foreground",
                                          "ProgressBar.font");
         cellLength = UIManager.getInt("ProgressBar.cellLength");
+        if (cellLength == 0) cellLength = 1;
         cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");
         selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
         selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
index 7db1e11..b22a587 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java
@@ -112,6 +112,24 @@
      */
     private int scrollBarValue;
 
+    /**
+     * Distance between the increment button and the track. This may be a negative
+     * number. If negative, then an overlap between the button and track will occur,
+     * which is useful for shaped buttons.
+     *
+     * TODO This should be made protected in a feature release
+     */
+    private int incrGap;
+
+    /**
+     * Distance between the decrement button and the track. This may be a negative
+     * number. If negative, then an overlap between the button and track will occur,
+     * which is useful for shaped buttons.
+     *
+     * TODO This should be made protected in a feature release
+     */
+    private int decrGap;
+
     static void loadActionMap(LazyActionMap map) {
         map.put(new Actions(Actions.POSITIVE_UNIT_INCREMENT));
         map.put(new Actions(Actions.POSITIVE_BLOCK_INCREMENT));
@@ -186,6 +204,31 @@
         LookAndFeel.installProperty(scrollbar, "opaque", Boolean.TRUE);
 
         scrollBarValue = scrollbar.getValue();
+
+        incrGap = UIManager.getInt("ScrollBar.incrementButtonGap");
+        decrGap = UIManager.getInt("ScrollBar.decrementButtonGap");
+
+        // TODO this can be removed when incrGap/decrGap become protected
+        // handle scaling for sizeVarients for special case components. The
+        // key "JComponent.sizeVariant" scales for large/small/mini
+        // components are based on Apples LAF
+        String scaleKey = (String)scrollbar.getClientProperty(
+                "JComponent.sizeVariant");
+        if (scaleKey != null){
+            if ("large".equals(scaleKey)){
+                scrollBarWidth *= 1.15;
+                incrGap *= 1.15;
+                decrGap *= 1.15;
+            } else if ("small".equals(scaleKey)){
+                scrollBarWidth *= 0.857;
+                incrGap *= 0.857;
+                decrGap *= 0.714;
+            } else if ("mini".equals(scaleKey)){
+                scrollBarWidth *= 0.714;
+                incrGap *= 0.714;
+                decrGap *= 0.714;
+            }
+        }
     }
 
 
@@ -442,20 +485,23 @@
         g.setColor(trackHighlightColor);
 
         if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+            //paint the distance between the start of the track and top of the thumb
             int x = insets.left;
-            int y = decrButton.getY() + decrButton.getHeight();
+            int y = trackRect.y;
             int w = scrollbar.getWidth() - (insets.left + insets.right);
             int h = thumbR.y - y;
             g.fillRect(x, y, w, h);
-        }
-        else    {
+        } else {
+            //if left-to-right, fill the area between the start of the track and
+            //the left edge of the thumb. If right-to-left, fill the area between
+            //the end of the thumb and end of the track.
             int x, w;
             if (scrollbar.getComponentOrientation().isLeftToRight()) {
-                x = decrButton.getX() + decrButton.getWidth();
+               x = trackRect.x;
                 w = thumbR.x - x;
             } else {
                 x = thumbR.x + thumbR.width;
-                w = decrButton.getX() - x;
+                w = trackRect.x + trackRect.width - x;
             }
             int y = insets.top;
             int h = scrollbar.getHeight() - (insets.top + insets.bottom);
@@ -471,19 +517,23 @@
         g.setColor(trackHighlightColor);
 
         if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+            //fill the area between the bottom of the thumb and the end of the track.
             int x = insets.left;
             int y = thumbR.y + thumbR.height;
             int w = scrollbar.getWidth() - (insets.left + insets.right);
-            int h = incrButton.getY() - y;
+            int h = trackRect.y + trackRect.height - y;
             g.fillRect(x, y, w, h);
         }
         else {
+            //if left-to-right, fill the area between the right of the thumb and the
+            //end of the track. If right-to-left, then fill the area to the left of
+            //the thumb and the start of the track.
             int x, w;
             if (scrollbar.getComponentOrientation().isLeftToRight()) {
                 x = thumbR.x + thumbR.width;
-                w = incrButton.getX() - x;
+                w = trackRect.x + trackRect.width - x;
             } else {
-                x = incrButton.getX() + incrButton.getWidth();
+                x = trackRect.x;
                 w = thumbR.x - x;
             }
             int y = insets.top;
@@ -610,11 +660,13 @@
         int incrButtonY = sbSize.height - (sbInsets.bottom + incrButtonH);
 
         /* The thumb must fit within the height left over after we
-         * subtract the preferredSize of the buttons and the insets.
+         * subtract the preferredSize of the buttons and the insets
+         * and the gaps
          */
         int sbInsetsH = sbInsets.top + sbInsets.bottom;
         int sbButtonsH = decrButtonH + incrButtonH;
-        float trackH = sbSize.height - (sbInsetsH + sbButtonsH);
+        int gaps = decrGap + incrGap;
+        float trackH = sbSize.height - (sbInsetsH + sbButtonsH) - gaps;
 
         /* Compute the height and origin of the thumb.   The case
          * where the thumb is at the bottom edge is handled specially
@@ -632,11 +684,11 @@
         thumbH = Math.max(thumbH, getMinimumThumbSize().height);
         thumbH = Math.min(thumbH, getMaximumThumbSize().height);
 
-        int thumbY = incrButtonY - thumbH;
+        int thumbY = incrButtonY - incrGap - thumbH;
         if (value < (sb.getMaximum() - sb.getVisibleAmount())) {
             float thumbRange = trackH - thumbH;
             thumbY = (int)(0.5f + (thumbRange * ((value - min) / (range - extent))));
-            thumbY +=  decrButtonY + decrButtonH;
+            thumbY +=  decrButtonY + decrButtonH + decrGap;
         }
 
         /* If the buttons don't fit, allocate half of the available
@@ -652,8 +704,8 @@
 
         /* Update the trackRect field.
          */
-        int itrackY = decrButtonY + decrButtonH;
-        int itrackH = incrButtonY - itrackY;
+        int itrackY = decrButtonY + decrButtonH + decrGap;
+        int itrackH = incrButtonY - incrGap - itrackY;
         trackRect.setBounds(itemX, itrackY, itemW, itrackH);
 
         /* If the thumb isn't going to fit, zero it's bounds.  Otherwise
@@ -671,11 +723,11 @@
             }
         }
         else {
-            if ((thumbY + thumbH) > incrButtonY) {
-                thumbY = incrButtonY - thumbH;
+            if ((thumbY + thumbH) > incrButtonY - incrGap) {
+                thumbY = incrButtonY - incrGap - thumbH;
             }
-            if (thumbY  < (decrButtonY + decrButtonH)) {
-                thumbY = decrButtonY + decrButtonH + 1;
+            if (thumbY  < (decrButtonY + decrButtonH + decrGap)) {
+                thumbY = decrButtonY + decrButtonH + decrGap + 1;
             }
             setThumbBounds(itemX, thumbY, itemW, thumbH);
         }
@@ -710,13 +762,16 @@
         }
         int leftButtonX = sbInsets.left;
         int rightButtonX = sbSize.width - (sbInsets.right + rightButtonW);
+        int leftGap = ltr ? decrGap : incrGap;
+        int rightGap = ltr ? incrGap : decrGap;
 
         /* The thumb must fit within the width left over after we
-         * subtract the preferredSize of the buttons and the insets.
+         * subtract the preferredSize of the buttons and the insets
+         * and the gaps
          */
         int sbInsetsW = sbInsets.left + sbInsets.right;
         int sbButtonsW = leftButtonW + rightButtonW;
-        float trackW = sbSize.width - (sbInsetsW + sbButtonsW);
+        float trackW = sbSize.width - (sbInsetsW + sbButtonsW) - (leftGap + rightGap);
 
         /* Compute the width and origin of the thumb.  Enforce
          * the thumbs min/max dimensions.  The case where the thumb
@@ -735,7 +790,7 @@
         thumbW = Math.max(thumbW, getMinimumThumbSize().width);
         thumbW = Math.min(thumbW, getMaximumThumbSize().width);
 
-        int thumbX = ltr ? rightButtonX - thumbW : leftButtonX + leftButtonW;
+        int thumbX = ltr ? rightButtonX - rightGap - thumbW : leftButtonX + leftButtonW + leftGap;
         if (value < (max - sb.getVisibleAmount())) {
             float thumbRange = trackW - thumbW;
             if( ltr ) {
@@ -743,7 +798,7 @@
             } else {
                 thumbX = (int)(0.5f + (thumbRange * ((max - extent - value) / (range - extent))));
             }
-            thumbX +=  leftButtonX + leftButtonW;
+            thumbX += leftButtonX + leftButtonW + leftGap;
         }
 
         /* If the buttons don't fit, allocate half of the available
@@ -752,7 +807,7 @@
         int sbAvailButtonW = (sbSize.width - sbInsetsW);
         if (sbAvailButtonW < sbButtonsW) {
             rightButtonW = leftButtonW = sbAvailButtonW / 2;
-            rightButtonX = sbSize.width - (sbInsets.right + rightButtonW);
+            rightButtonX = sbSize.width - (sbInsets.right + rightButtonW + rightGap);
         }
 
         (ltr ? decrButton : incrButton).setBounds(leftButtonX, itemY, leftButtonW, itemH);
@@ -760,8 +815,8 @@
 
         /* Update the trackRect field.
          */
-        int itrackX = leftButtonX + leftButtonW;
-        int itrackW = rightButtonX - itrackX;
+        int itrackX = leftButtonX + leftButtonW + leftGap;
+        int itrackW = rightButtonX - rightGap - itrackX;
         trackRect.setBounds(itrackX, itemY, itrackW, itemH);
 
         /* Make sure the thumb fits between the buttons.  Note
@@ -778,11 +833,11 @@
             }
         }
         else {
-            if (thumbX + thumbW > rightButtonX) {
-                thumbX = rightButtonX - thumbW;
+            if (thumbX + thumbW > rightButtonX - rightGap) {
+                thumbX = rightButtonX - rightGap - thumbW;
             }
-            if (thumbX  < leftButtonX + leftButtonW) {
-                thumbX = leftButtonX + leftButtonW + 1;
+            if (thumbX  < leftButtonX + leftButtonW + leftGap) {
+                thumbX = leftButtonX + leftButtonW + leftGap + 1;
             }
             setThumbBounds(thumbX, itemY, thumbW, itemH);
         }
@@ -1151,20 +1206,15 @@
             int thumbMin, thumbMax, thumbPos;
 
             if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
-                thumbMin = decrButton.getY() + decrButton.getHeight();
-                thumbMax = incrButton.getY() - thumbR.height;
+                thumbMin = trackRect.y;
+                thumbMax = trackRect.y + trackRect.height - thumbR.height;
                 thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getY() - offset)));
                 setThumbBounds(thumbR.x, thumbPos, thumbR.width, thumbR.height);
                 trackLength = getTrackBounds().height;
             }
             else {
-                if (scrollbar.getComponentOrientation().isLeftToRight()) {
-                    thumbMin = decrButton.getX() + decrButton.getWidth();
-                    thumbMax = incrButton.getX() - thumbR.width;
-                } else {
-                    thumbMin = incrButton.getX() + incrButton.getWidth();
-                    thumbMax = decrButton.getX() - thumbR.width;
-                }
+                thumbMin = trackRect.x;
+                thumbMax = trackRect.x + trackRect.width - thumbR.width;
                 thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getX() - offset)));
                 setThumbBounds(thumbPos, thumbR.y, thumbR.width, thumbR.height);
                 trackLength = getTrackBounds().width;
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java
index 0a858d4..97e2f60 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java
@@ -205,6 +205,9 @@
         focusColor = UIManager.getColor("Slider.focus");
 
         focusInsets = (Insets)UIManager.get( "Slider.focusInsets" );
+        // use default if missing so that BasicSliderUI can be used in other
+        // LAFs like Nimbus
+        if (focusInsets == null) focusInsets = new InsetsUIResource(2,2,2,2);
     }
 
     protected TrackListener createTrackListener(JSlider slider) {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
index 2f0bffa..b35a75e 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java
@@ -347,8 +347,9 @@
         // This plus 2 here is to provide backwards consistancy. Previously,
         // the old size did not include the 2 pixel border around the divider,
         // it now does.
-        LookAndFeel.installProperty(splitPane, "dividerSize",
-                                    UIManager.get("SplitPane.dividerSize"));
+        Integer dividerSize = (Integer)UIManager.get("SplitPane.dividerSize");
+        if (divider == null) dividerSize = 10;
+        LookAndFeel.installProperty(splitPane, "dividerSize", dividerSize);
 
         divider.setDividerSize(splitPane.getDividerSize());
         dividerSize = divider.getDividerSize();
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index a266b77..5a94a36 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -379,6 +379,14 @@
             opaque = Boolean.FALSE;
         }
         LookAndFeel.installProperty(tabPane, "opaque", opaque);
+
+        // Fix for 6711145 BasicTabbedPanuUI should not throw a NPE if these
+        // keys are missing. So we are setting them to there default values here
+        // if the keys are missing.
+        if (tabInsets == null) tabInsets = new Insets(0,4,1,4);
+        if (selectedTabPadInsets == null) selectedTabPadInsets = new Insets(2,2,2,1);
+        if (tabAreaInsets == null) tabAreaInsets = new Insets(3,2,0,2);
+        if (contentBorderInsets == null) contentBorderInsets = new Insets(2,2,3,3);
     }
 
     protected void uninstallDefaults() {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
index 585e01dc..16ceab7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
@@ -1414,17 +1414,20 @@
 
         Color sbg = table.getSelectionBackground();
         if (sbg == null || sbg instanceof UIResource) {
-            table.setSelectionBackground(UIManager.getColor("Table.selectionBackground"));
+            sbg = UIManager.getColor("Table.selectionBackground");
+            table.setSelectionBackground(sbg != null ? sbg : UIManager.getColor("textHighlight"));
         }
 
         Color sfg = table.getSelectionForeground();
         if (sfg == null || sfg instanceof UIResource) {
-            table.setSelectionForeground(UIManager.getColor("Table.selectionForeground"));
+            sfg = UIManager.getColor("Table.selectionForeground");
+            table.setSelectionForeground(sfg != null ? sfg : UIManager.getColor("textHighlightText"));
         }
 
         Color gridColor = table.getGridColor();
         if (gridColor == null || gridColor instanceof UIResource) {
-            table.setGridColor(UIManager.getColor("Table.gridColor"));
+            gridColor = UIManager.getColor("Table.gridColor");
+            table.setGridColor(gridColor != null ? gridColor : Color.GRAY);
         }
 
         // install the scrollpane border
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
index 166c6fc..cef9166 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java
@@ -27,13 +27,10 @@
 import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.font.*;
 import java.awt.datatransfer.*;
-import java.awt.dnd.*;
 import java.awt.im.InputContext;
 import java.beans.*;
 import java.io.*;
-import java.net.*;
 import javax.swing.*;
 import javax.swing.plaf.*;
 import javax.swing.text.*;
@@ -785,11 +782,15 @@
             installDefaults();
             installDefaults2();
 
-            // common case is background painted... this can
-            // easily be changed by subclasses or from outside
-            // of the component.
-            LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
-            LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
+            // This is a workaround as these should not override what synth has
+            // set them to
+            if (!(this instanceof sun.swing.plaf.synth.SynthUI)){
+                // common case is background painted... this can
+                // easily be changed by subclasses or from outside
+                // of the component.
+                LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
+                LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
+            }
 
             // attach to the model and editor
             editor.addPropertyChangeListener(updateHandler);
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
index 05e3183..8fdc88d 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
@@ -2402,15 +2402,25 @@
         }
         leadRow = getRowForPath(tree, newPath);
 
-        if(repaint) {
-            if(bounds != null)
-                tree.repaint(bounds);
+        if (repaint) {
+            if (bounds != null) {
+                tree.repaint(getRepaintPathBounds(bounds));
+            }
             bounds = getPathBounds(tree, newPath);
-            if(bounds != null)
-                tree.repaint(bounds);
+            if (bounds != null) {
+                tree.repaint(getRepaintPathBounds(bounds));
+            }
         }
     }
 
+    private Rectangle getRepaintPathBounds(Rectangle bounds) {
+        if (UIManager.getBoolean("Tree.repaintWholeRow")) {
+           bounds.x = 0;
+           bounds.width = tree.getWidth();
+        }
+        return bounds;
+    }
+
     private TreePath getLeadSelectionPath() {
         return tree.getLeadSelectionPath();
     }
@@ -3643,14 +3653,6 @@
             focusGained(e);
         }
 
-        private Rectangle getRepaintPathBounds(Rectangle bounds) {
-            if(UIManager.getBoolean("Tree.repaintWholeRow")) {
-               bounds.x = 0;
-               bounds.width = tree.getWidth();
-            }
-            return bounds;
-        }
-
         //
         // CellEditorListener
         //
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
new file mode 100644
index 0000000..55fb195
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
@@ -0,0 +1,735 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.*;
+import java.awt.image.*;
+import java.lang.reflect.Method;
+import javax.swing.*;
+import javax.swing.plaf.UIResource;
+import javax.swing.Painter;
+import java.awt.print.PrinterGraphics;
+import static javax.swing.plaf.nimbus.NimbusLookAndFeel.deriveARGB;
+
+/**
+ * Convenient base class for defining Painter instances for rendering a
+ * region or component in Nimbus.
+ *
+ * @author Jasper Potts
+ * @author Richard Bair
+ */
+public abstract class AbstractRegionPainter implements Painter<JComponent> {
+    /**
+     * PaintContext, which holds a lot of the state needed for cache hinting and x/y value decoding
+     * The data contained within the context is typically only computed once and reused over
+     * multiple paint calls, whereas the other values (w, h, f, leftWidth, etc) are recomputed
+     * for each call to paint.
+     *
+     * This field is retrieved from subclasses on each paint operation. It is up
+     * to the subclass to compute and cache the PaintContext over multiple calls.
+     */
+    private PaintContext ctx;
+    /**
+     * The scaling factor. Recomputed on each call to paint.
+     */
+    private float f;
+    /*
+      Various metrics used for decoding x/y values based on the canvas size
+      and stretching insets.
+
+      On each call to paint, we first ask the subclass for the PaintContext.
+      From the context we get the canvas size and stretching insets, and whether
+      the algorithm should be "inverted", meaning the center section remains
+      a fixed size and the other sections scale.
+
+      We then use these values to compute a series of metrics (listed below)
+      which are used to decode points in a specific axis (x or y).
+
+      The leftWidth represents the distance from the left edge of the region
+      to the first stretching inset, after accounting for any scaling factor
+      (such as DPI scaling). The centerWidth is the distance between the leftWidth
+      and the rightWidth. The rightWidth is the distance from the right edge,
+      to the right inset (after scaling has been applied).
+
+      The same logic goes for topHeight, centerHeight, and bottomHeight.
+
+      The leftScale represents the proportion of the width taken by the left section.
+      The same logic is applied to the other scales.
+
+      The various widths/heights are used to decode control points. The
+      various scales are used to decode bezier handles (or anchors).
+    */
+    /**
+     * The width of the left section. Recomputed on each call to paint.
+     */
+    private float leftWidth;
+    /**
+     * The height of the top section. Recomputed on each call to paint.
+     */
+    private float topHeight;
+    /**
+     * The width of the center section. Recomputed on each call to paint.
+     */
+    private float centerWidth;
+    /**
+     * The height of the center section. Recomputed on each call to paint.
+     */
+    private float centerHeight;
+    /**
+     * The width of the right section. Recomputed on each call to paint.
+     */
+    private float rightWidth;
+    /**
+     * The height of the bottom section. Recomputed on each call to paint.
+     */
+    private float bottomHeight;
+    /**
+     * The scaling factor to use for the left section. Recomputed on each call to paint.
+     */
+    private float leftScale;
+    /**
+     * The scaling factor to use for the top section. Recomputed on each call to paint.
+     */
+    private float topScale;
+    /**
+     * The scaling factor to use for the center section, in the horizontal
+     * direction. Recomputed on each call to paint.
+     */
+    private float centerHScale;
+    /**
+     * The scaling factor to use for the center section, in the vertical
+     * direction. Recomputed on each call to paint.
+     */
+    private float centerVScale;
+    /**
+     * The scaling factor to use for the right section. Recomputed on each call to paint.
+     */
+    private float rightScale;
+    /**
+     * The scaling factor to use for the bottom section. Recomputed on each call to paint.
+     */
+    private float bottomScale;
+
+    /**
+     * Create a new AbstractRegionPainter
+     */
+    protected AbstractRegionPainter() { }
+
+    /**
+     * @inheritDoc
+     */
+    @Override
+    public final void paint(Graphics2D g, JComponent c, int w, int h) {
+        //don't render if the width/height are too small
+        if (w <= 0 || h <=0) return;
+
+        Object[] extendedCacheKeys = getExtendedCacheKeys(c);
+        ctx = getPaintContext();
+        PaintContext.CacheMode cacheMode = ctx == null ? PaintContext.CacheMode.NO_CACHING : ctx.cacheMode;
+        if (cacheMode == PaintContext.CacheMode.NO_CACHING ||
+                !ImageCache.getInstance().isImageCachable(w, h) ||
+                g instanceof PrinterGraphics) {
+            // no caching so paint directly
+            paint0(g, c, w, h, extendedCacheKeys);
+        } else if (cacheMode == PaintContext.CacheMode.FIXED_SIZES) {
+            paintWithFixedSizeCaching(g, c, w, h, extendedCacheKeys);
+        } else {
+            // 9 Square caching
+            paintWith9SquareCaching(g, ctx, c, w, h, extendedCacheKeys);
+        }
+    }
+
+    /**
+     * Get any extra attributes which the painter implementation would like
+     * to include in the image cache lookups. This is checked for every call
+     * of the paint(g, c, w, h) method.
+     *
+     * @param c The component on the current paint call
+     * @return Array of extra objects to be included in the cache key
+     */
+    protected Object[] getExtendedCacheKeys(JComponent c) {
+        return null;
+    }
+
+    /**
+     * <p>Gets the PaintContext for this painting operation. This method is called on every
+     * paint, and so should be fast and produce no garbage. The PaintContext contains
+     * information such as cache hints. It also contains data necessary for decoding
+     * points at runtime, such as the stretching insets, the canvas size at which the
+     * encoded points were defined, and whether the stretching insets are inverted.</p>
+     *
+     * <p> This method allows for subclasses to package the painting of different states
+     * with possibly different canvas sizes, etc, into one AbstractRegionPainter implementation.</p>
+     *
+     * @return a PaintContext associated with this paint operation.
+     */
+    protected abstract PaintContext getPaintContext();
+
+    /**
+     * <p>Configures the given Graphics2D. Often, rendering hints or compositiing rules are
+     * applied to a Graphics2D object prior to painting, which should affect all of the
+     * subsequent painting operations. This method provides a convenient hook for configuring
+     * the Graphics object prior to rendering, regardless of whether the render operation is
+     * performed to an intermediate buffer or directly to the display.</p>
+     *
+     * @param g The Graphics2D object to configure. Will not be null.
+     */
+    protected void configureGraphics(Graphics2D g) {
+        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+    }
+
+    /**
+     * Actually performs the painting operation. Subclasses must implement this method.
+     * The graphics object passed may represent the actual surface being rendererd to,
+     * or it may be an intermediate buffer. It has also been pre-translated. Simply render
+     * the component as if it were located at 0, 0 and had a width of <code>width</code>
+     * and a height of <code>height</code>. For performance reasons, you may want to read
+     * the clip from the Graphics2D object and only render within that space.
+     *
+     * @param g The Graphics2D surface to paint to
+     * @param c The JComponent related to the drawing event. For example, if the
+     *          region being rendered is Button, then <code>c</code> will be a
+     *          JButton. If the region being drawn is ScrollBarSlider, then the
+     *          component will be JScrollBar. This value may be null.
+     * @param width The width of the region to paint. Note that in the case of
+     *              painting the foreground, this value may differ from c.getWidth().
+     * @param height The height of the region to paint. Note that in the case of
+     *               painting the foreground, this value may differ from c.getHeight().
+     * @param extendedCacheKeys The result of the call to getExtendedCacheKeys()
+     */
+    protected abstract void doPaint(Graphics2D g, JComponent c, int width,
+                                    int height, Object[] extendedCacheKeys);
+
+    /**
+     * Decodes and returns a float value representing the actual pixel location for
+     * the given encoded X value.
+     *
+     * @param x an encoded x value (0...1, or 1...2, or 2...3)
+     * @return the decoded x value
+     */
+    protected final float decodeX(float x) {
+        if (ctx.canvasSize == null) return x;
+
+        if (x >= 0 && x <= 1) {
+            return x * leftWidth;
+        } else if (x > 1 && x < 2) {
+            return ((x-1) * centerWidth) + leftWidth;
+        } else if (x >= 2 && x <= 3) {
+            return ((x-2) * rightWidth) + leftWidth + centerWidth;
+        } else {
+            throw new AssertionError("Invalid x");
+        }
+    }
+
+    /**
+     * Decodes and returns a float value representing the actual pixel location for
+     * the given encoded y value.
+     *
+     * @param y an encoded y value (0...1, or 1...2, or 2...3)
+     * @return the decoded y value
+     */
+    protected final float decodeY(float y) {
+        if (ctx.canvasSize == null) return y;
+
+        if (y >= 0 && y <= 1) {
+            return y * topHeight;
+        } else if (y > 1 && y < 2) {
+            return ((y-1) * centerHeight) + topHeight;
+        } else if (y >= 2 && y <= 3) {
+            return ((y-2) * bottomHeight) + topHeight + centerHeight;
+        } else {
+            throw new AssertionError("Invalid y");
+        }
+    }
+
+    /**
+     * Decodes and returns a float value representing the actual pixel location for
+     * the anchor point given the encoded X value of the control point, and the offset
+     * distance to the anchor from that control point.
+     *
+     * @param x an encoded x value of the bezier control point (0...1, or 1...2, or 2...3)
+     * @param dx the offset distance to the anchor from the control point x
+     * @return the decoded x location of the control point
+     */
+    protected final float decodeAnchorX(float x, float dx) {
+        if (ctx.canvasSize == null) return x + dx;
+
+        if (x >= 0 && x <= 1) {
+            return decodeX(x) + (dx * leftScale);
+        } else if (x > 1 && x < 2) {
+            return decodeX(x) + (dx * centerHScale);
+        } else if (x >= 2 && x <= 3) {
+            return decodeX(x) + (dx * rightScale);
+        } else {
+            throw new AssertionError("Invalid x");
+        }
+    }
+
+    /**
+     * Decodes and returns a float value representing the actual pixel location for
+     * the anchor point given the encoded Y value of the control point, and the offset
+     * distance to the anchor from that control point.
+     *
+     * @param y an encoded y value of the bezier control point (0...1, or 1...2, or 2...3)
+     * @param dy the offset distance to the anchor from the control point y
+     * @return the decoded y position of the control point
+     */
+    protected final float decodeAnchorY(float y, float dy) {
+        if (ctx.canvasSize == null) return y + dy;
+
+        if (y >= 0 && y <= 1) {
+            return decodeY(y) + (dy * topScale);
+        } else if (y > 1 && y < 2) {
+            return decodeY(y) + (dy * centerVScale);
+        } else if (y >= 2 && y <= 3) {
+            return decodeY(y) + (dy * bottomScale);
+        } else {
+            throw new AssertionError("Invalid y");
+        }
+    }
+
+    /**
+     * Decodes and returns a color, which is derived from a base color in UI
+     * defaults.
+     *
+     * @param key     A key corrosponding to the value in the UI Defaults table
+     *                of UIManager where the base color is defined
+     * @param hOffset The hue offset used for derivation.
+     * @param sOffset The saturation offset used for derivation.
+     * @param bOffset The brightness offset used for derivation.
+     * @param aOffset The alpha offset used for derivation. Between 0...255
+     * @return The derived color, whos color value will change if the parent
+     *         uiDefault color changes.
+     */
+    protected final Color decodeColor(String key, float hOffset, float sOffset,
+                                      float bOffset, int aOffset) {
+        if (UIManager.getLookAndFeel() instanceof NimbusLookAndFeel){
+            NimbusLookAndFeel laf = (NimbusLookAndFeel) UIManager.getLookAndFeel();
+            return laf.getDerivedColor(key, hOffset, sOffset, bOffset, aOffset, true);
+        } else {
+            // can not give a right answer as painter sould not be used outside
+            // of nimbus laf but do the best we can
+            return Color.getHSBColor(hOffset,sOffset,bOffset);
+        }
+    }
+
+    /**
+     * Decodes and returns a color, which is derived from a offset between two
+     * other colors.
+     *
+     * @param color1   The first color
+     * @param color2   The second color
+     * @param midPoint The offset between color 1 and color 2, a value of 0.0 is
+     *                 color 1 and 1.0 is color 2;
+     * @return The derived color
+     */
+    protected final Color decodeColor(Color color1, Color color2,
+                                      float midPoint) {
+        return new Color(deriveARGB(color1, color2, midPoint));
+    }
+
+    /**
+     * Given parameters for creating a LinearGradientPaint, this method will
+     * create and return a linear gradient paint. One primary purpose for this
+     * method is to avoid creating a LinearGradientPaint where the start and
+     * end points are equal. In such a case, the end y point is slightly
+     * increased to avoid the overlap.
+     *
+     * @param x1
+     * @param y1
+     * @param x2
+     * @param y2
+     * @param midpoints
+     * @param colors
+     * @return a valid LinearGradientPaint. This method never returns null.
+     */
+    protected final LinearGradientPaint decodeGradient(float x1, float y1, float x2, float y2, float[] midpoints, Color[] colors) {
+        if (x1 == x2 && y1 == y2) {
+            y2 += .00001f;
+        }
+        return new LinearGradientPaint(x1, y1, x2, y2, midpoints, colors);
+    }
+
+    /**
+     * Given parameters for creating a RadialGradientPaint, this method will
+     * create and return a radial gradient paint. One primary purpose for this
+     * method is to avoid creating a RadialGradientPaint where the radius
+     * is non-positive. In such a case, the radius is just slightly
+     * increased to avoid 0.
+     *
+     * @param x
+     * @param y
+     * @param r
+     * @param midpoints
+     * @param colors
+     * @return a valid RadialGradientPaint. This method never returns null.
+     */
+    protected final RadialGradientPaint decodeRadialGradient(float x, float y, float r, float[] midpoints, Color[] colors) {
+        if (r == 0f) {
+            r = .00001f;
+        }
+        return new RadialGradientPaint(x, y, r, midpoints, colors);
+    }
+
+    /**
+     * Get a color property from the given JComponent. First checks for a
+     * <code>getXXX()</code> method and if that fails checks for a client
+     * property with key <code>property</code>. If that still fails to return
+     * a Color then <code>defaultColor</code> is returned.
+     *
+     * @param c The component to get the color property from
+     * @param property The name of a bean style property or client property
+     * @param defaultColor The color to return if no color was obtained from
+     *        the component.
+     * @return The color that was obtained from the component or defaultColor
+     */
+    protected final Color getComponentColor(JComponent c, String property,
+                                            Color defaultColor,
+                                            float saturationOffset,
+                                            float brightnessOffset,
+                                            int alphaOffset) {
+        Color color = null;
+        if (c != null) {
+            // handle some special cases for performance
+            if ("background".equals(property)) {
+                color = c.getBackground();
+            } else if ("foreground".equals(property)) {
+                color = c.getForeground();
+            } else if (c instanceof JList && "selectionForeground".equals(property)) {
+                color = ((JList) c).getSelectionForeground();
+            } else if (c instanceof JList && "selectionBackground".equals(property)) {
+                color = ((JList) c).getSelectionBackground();
+            } else if (c instanceof JTable && "selectionForeground".equals(property)) {
+                color = ((JTable) c).getSelectionForeground();
+            } else if (c instanceof JTable && "selectionBackground".equals(property)) {
+                color = ((JTable) c).getSelectionBackground();
+            } else {
+                String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
+                try {
+                    Method method = c.getClass().getMethod(s);
+                    color = (Color) method.invoke(c);
+                } catch (Exception e) {
+                    //don't do anything, it just didn't work, that's all.
+                    //This could be a normal occurance if you use a property
+                    //name referring to a key in clientProperties instead of
+                    //a real property
+                }
+                if (color == null) {
+                    Object value = c.getClientProperty(property);
+                    if (value instanceof Color) {
+                        color = (Color) value;
+                    }
+                }
+            }
+        }
+        // we return the defaultColor if the color found is null, or if
+        // it is a UIResource. This is done because the color for the
+        // ENABLED state is set on the component, but you don't want to use
+        // that color for the over state. So we only respect the color
+        // specified for the property if it was set by the user, as opposed
+        // to set by us.
+        if (color == null || color instanceof UIResource) {
+            return defaultColor;
+        } else if (saturationOffset != 0 || brightnessOffset != 0 || alphaOffset != 0) {
+            float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
+            tmp[1] = clamp(tmp[1] + saturationOffset);
+            tmp[2] = clamp(tmp[2] + brightnessOffset);
+            int alpha = clamp(color.getAlpha() + alphaOffset);
+            return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF) | (alpha <<24));
+        } else {
+            return color;
+        }
+    }
+
+    /**
+     * A class encapsulating state useful when painting. Generally, instances of this
+     * class are created once, and reused for each paint request without modification.
+     * This class contains values useful when hinting the cache engine, and when decoding
+     * control points and bezier curve anchors.
+     */
+    protected static class PaintContext {
+        protected static enum CacheMode {
+            NO_CACHING, FIXED_SIZES, NINE_SQUARE_SCALE
+        }
+
+        private static Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
+
+        private Insets stretchingInsets;
+        private Dimension canvasSize;
+        private boolean inverted;
+        private CacheMode cacheMode;
+        private double maxHorizontalScaleFactor;
+        private double maxVerticalScaleFactor;
+
+        private float a; // insets.left
+        private float b; // canvasSize.width - insets.right
+        private float c; // insets.top
+        private float d; // canvasSize.height - insets.bottom;
+        private float aPercent; // only used if inverted == true
+        private float bPercent; // only used if inverted == true
+        private float cPercent; // only used if inverted == true
+        private float dPercent; // only used if inverted == true
+
+        /**
+         * Creates a new PaintContext which does not attempt to cache or scale any cached
+         * images.
+         *
+         * @param insets The stretching insets. May be null. If null, then assumed to be 0, 0, 0, 0.
+         * @param canvasSize The size of the canvas used when encoding the various x/y values. May be null.
+         *                   If null, then it is assumed that there are no encoded values, and any calls
+         *                   to one of the "decode" methods will return the passed in value.
+         * @param inverted Whether to "invert" the meaning of the 9-square grid and stretching insets
+         */
+        public PaintContext(Insets insets, Dimension canvasSize, boolean inverted) {
+            this(insets, canvasSize, inverted, null, 1, 1);
+        }
+
+        /**
+         * Creates a new PaintContext.
+         *
+         * @param insets The stretching insets. May be null. If null, then assumed to be 0, 0, 0, 0.
+         * @param canvasSize The size of the canvas used when encoding the various x/y values. May be null.
+         *                   If null, then it is assumed that there are no encoded values, and any calls
+         *                   to one of the "decode" methods will return the passed in value.
+         * @param inverted Whether to "invert" the meaning of the 9-square grid and stretching insets
+         * @param cacheMode A hint as to which caching mode to use. If null, then set to no caching.
+         * @param maxH The maximium scale in the horizontal direction to use before punting and redrawing from scratch.
+         *             For example, if maxH is 2, then we will attempt to scale any cached images up to 2x the canvas
+         *             width before redrawing from scratch. Reasonable maxH values may improve painting performance.
+         *             If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1.
+         * @param maxV The maximium scale in the vertical direction to use before punting and redrawing from scratch.
+         *             For example, if maxV is 2, then we will attempt to scale any cached images up to 2x the canvas
+         *             height before redrawing from scratch. Reasonable maxV values may improve painting performance.
+         *             If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1.
+         */
+        public PaintContext(Insets insets, Dimension canvasSize, boolean inverted,
+                            CacheMode cacheMode, double maxH, double maxV) {
+            if (maxH < 1 || maxH < 1) {
+                throw new IllegalArgumentException("Both maxH and maxV must be >= 1");
+            }
+
+            this.stretchingInsets = insets == null ? EMPTY_INSETS : insets;
+            this.canvasSize = canvasSize;
+            this.inverted = inverted;
+            this.cacheMode = cacheMode == null ? CacheMode.NO_CACHING : cacheMode;
+            this.maxHorizontalScaleFactor = maxH;
+            this.maxVerticalScaleFactor = maxV;
+
+            if (canvasSize != null) {
+                a = insets.left;
+                b = canvasSize.width - insets.right;
+                c = insets.top;
+                d = canvasSize.height - insets.bottom;
+                this.canvasSize = canvasSize;
+                this.inverted = inverted;
+                if (inverted) {
+                    float available = canvasSize.width - (b - a);
+                    aPercent = available > 0f ? a / available : 0f;
+                    bPercent = available > 0f ? b / available : 0f;
+                    available = canvasSize.height - (d - c);
+                    cPercent = available > 0f ? c / available : 0f;
+                    dPercent = available > 0f ? d / available : 0f;
+                }
+            }
+        }
+    }
+
+    //---------------------- private methods
+
+    //initializes the class to prepare it for being able to decode points
+    private void prepare(float w, float h) {
+        //if no PaintContext has been specified, reset the values and bail
+        //also bail if the canvasSize was not set (since decoding will not work)
+        if (ctx == null || ctx.canvasSize == null) {
+            f = 1f;
+            leftWidth = centerWidth = rightWidth = 0f;
+            topHeight = centerHeight = bottomHeight = 0f;
+            leftScale = centerHScale = rightScale = 0f;
+            topScale = centerVScale = bottomScale = 0f;
+            return;
+        }
+
+        //calculate the scaling factor, and the sizes for the various 9-square sections
+        Number scale = (Number)UIManager.get("scale");
+        f = scale == null ? 1f : scale.floatValue();
+
+        if (ctx.inverted) {
+            centerWidth = (ctx.b - ctx.a) * f;
+            float availableSpace = w - centerWidth;
+            leftWidth = availableSpace * ctx.aPercent;
+            rightWidth = availableSpace * ctx.bPercent;
+            centerHeight = (ctx.d - ctx.c) * f;
+            availableSpace = h - centerHeight;
+            topHeight = availableSpace * ctx.cPercent;
+            bottomHeight = availableSpace * ctx.dPercent;
+        } else {
+            leftWidth = ctx.a * f;
+            rightWidth = (float)(ctx.canvasSize.getWidth() - ctx.b) * f;
+            centerWidth = w - leftWidth - rightWidth;
+            topHeight = ctx.c * f;
+            bottomHeight = (float)(ctx.canvasSize.getHeight() - ctx.d) * f;
+            centerHeight = h - topHeight - bottomHeight;
+        }
+
+        leftScale = ctx.a == 0f ? 0f : leftWidth / ctx.a;
+        centerHScale = (ctx.b - ctx.a) == 0f ? 0f : centerWidth / (ctx.b - ctx.a);
+        rightScale = (ctx.canvasSize.width - ctx.b) == 0f ? 0f : rightWidth / (ctx.canvasSize.width - ctx.b);
+        topScale = ctx.c == 0f ? 0f : topHeight / ctx.c;
+        centerVScale = (ctx.d - ctx.c) == 0f ? 0f : centerHeight / (ctx.d - ctx.c);
+        bottomScale = (ctx.canvasSize.height - ctx.d) == 0f ? 0f : bottomHeight / (ctx.canvasSize.height - ctx.d);
+    }
+
+    private void paintWith9SquareCaching(Graphics2D g, PaintContext ctx,
+                                         JComponent c, int w, int h,
+                                         Object[] extendedCacheKeys) {
+        // check if we can scale to the requested size
+        Dimension canvas = ctx.canvasSize;
+        Insets insets = ctx.stretchingInsets;
+
+        if (w <= (canvas.width * ctx.maxHorizontalScaleFactor) && h <= (canvas.height * ctx.maxVerticalScaleFactor)) {
+            // get image at canvas size
+            VolatileImage img = getImage(g.getDeviceConfiguration(), c, canvas.width, canvas.height, extendedCacheKeys);
+            if (img != null) {
+                // calculate dst inserts
+                // todo: destination inserts need to take into acount scale factor for high dpi. Note: You can use f for this, I think
+                Insets dstInsets;
+                if (ctx.inverted){
+                    int leftRight = (w-(canvas.width-(insets.left+insets.right)))/2;
+                    int topBottom = (h-(canvas.height-(insets.top+insets.bottom)))/2;
+                    dstInsets = new Insets(topBottom,leftRight,topBottom,leftRight);
+                } else {
+                    dstInsets = insets;
+                }
+                // paint 9 square scaled
+                Object oldScaleingHints = g.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
+                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+                ImageScalingHelper.paint(g, 0, 0, w, h, img, insets, dstInsets,
+                        ImageScalingHelper.PaintType.PAINT9_STRETCH, ImageScalingHelper.PAINT_ALL);
+                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+                    oldScaleingHints!=null?oldScaleingHints:RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
+            } else {
+                // render directly
+                paint0(g, c, w, h, extendedCacheKeys);
+            }
+        } else {
+            // paint directly
+            paint0(g, c, w, h, extendedCacheKeys);
+        }
+    }
+
+    private void paintWithFixedSizeCaching(Graphics2D g, JComponent c, int w,
+                                           int h, Object[] extendedCacheKeys) {
+        VolatileImage img = getImage(g.getDeviceConfiguration(), c, w, h, extendedCacheKeys);
+        if (img != null) {
+            //render cached image
+            g.drawImage(img, 0, 0, null);
+        } else {
+            // render directly
+            paint0(g, c, w, h, extendedCacheKeys);
+        }
+    }
+
+    /** Gets the rendered image for this painter at the requested size, either from cache or create a new one */
+    private VolatileImage getImage(GraphicsConfiguration config, JComponent c,
+                                   int w, int h, Object[] extendedCacheKeys) {
+        ImageCache imageCache = ImageCache.getInstance();
+        //get the buffer for this component
+        VolatileImage buffer = (VolatileImage) imageCache.getImage(config, w, h, this, extendedCacheKeys);
+
+        int renderCounter = 0; //to avoid any potential, though unlikely, infinite loop
+        do {
+            //validate the buffer so we can check for surface loss
+            int bufferStatus = VolatileImage.IMAGE_INCOMPATIBLE;
+            if (buffer != null) {
+                bufferStatus = buffer.validate(config);
+            }
+
+            //If the buffer status is incompatible or restored, then we need to re-render to the volatile image
+            if (bufferStatus == VolatileImage.IMAGE_INCOMPATIBLE || bufferStatus == VolatileImage.IMAGE_RESTORED) {
+                //if the buffer is null (hasn't been created), or isn't the right size, or has lost its contents,
+                //then recreate the buffer
+                if (buffer == null || buffer.getWidth() != w || buffer.getHeight() != h ||
+                        bufferStatus == VolatileImage.IMAGE_INCOMPATIBLE) {
+                    //clear any resources related to the old back buffer
+                    if (buffer != null) {
+                        buffer.flush();
+                        buffer = null;
+                    }
+                    //recreate the buffer
+                    buffer = config.createCompatibleVolatileImage(w, h,
+                            Transparency.TRANSLUCENT);
+                    // put in cache for future
+                    imageCache.setImage(buffer, config, w, h, this, extendedCacheKeys);
+                }
+                //create the graphics context with which to paint to the buffer
+                Graphics2D bg = buffer.createGraphics();
+                //clear the background before configuring the graphics
+                bg.setComposite(AlphaComposite.Clear);
+                bg.fillRect(0, 0, w, h);
+                bg.setComposite(AlphaComposite.SrcOver);
+                configureGraphics(bg);
+                // paint the painter into buffer
+                paint0(bg, c, w, h, extendedCacheKeys);
+                //close buffer graphics
+                bg.dispose();
+            }
+        } while (buffer.contentsLost() && renderCounter++ < 3);
+        // check if we failed
+        if (renderCounter == 3) return null;
+        // return image
+        return buffer;
+    }
+
+    //convenience method which creates a temporary graphics object by creating a
+    //clone of the passed in one, configuring it, drawing with it, disposing it.
+    //These steps have to be taken to ensure that any hints set on the graphics
+    //are removed subsequent to painting.
+    private void paint0(Graphics2D g, JComponent c, int width, int height,
+                        Object[] extendedCacheKeys) {
+        prepare(width, height);
+        g = (Graphics2D)g.create();
+        configureGraphics(g);
+        doPaint(g, c, width, height, extendedCacheKeys);
+        g.dispose();
+    }
+
+    private float clamp(float value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 1) {
+            value = 1;
+        }
+        return value;
+    }
+
+    private int clamp(int value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 255) {
+            value = 255;
+        }
+        return value;
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template
new file mode 100644
index 0000000..a0f5afc
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template
@@ -0,0 +1,878 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package ${PACKAGE};
+
+import javax.swing.Painter;
+import java.awt.Graphics;
+import sun.font.FontManager;
+import sun.swing.plaf.synth.DefaultSynthStyle;
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.DimensionUIResource;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.plaf.InsetsUIResource;
+import javax.swing.plaf.synth.Region;
+import javax.swing.plaf.synth.SynthStyle;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.image.BufferedImage;
+import static java.awt.image.BufferedImage.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
+
+/**
+ * This class contains all the implementation details related to
+ * ${LAF_NAME}. It contains all the code for initializing the UIDefaults table,
+ * as well as for selecting
+ * a SynthStyle based on a JComponent/Region pair.
+ *
+ * @author Richard Bair
+ */
+final class ${LAF_NAME}Defaults {
+    /**
+     * The map of SynthStyles. This map is keyed by Region. Each Region maps
+     * to a List of LazyStyles. Each LazyStyle has a reference to the prefix
+     * that was registered with it. This reference can then be inspected to see
+     * if it is the proper lazy style.
+     * <p/>
+     * There can be more than one LazyStyle for a single Region if there is more
+     * than one prefix defined for a given region. For example, both Button and
+     * "MyButton" might be prefixes assigned to the Region.Button region.
+     */
+    private Map<Region, List<LazyStyle>> m;
+    /**
+     * A map of regions which have been registered.
+     * This mapping is maintained so that the Region can be found based on
+     * prefix in a very fast manner. This is used in the "matches" method of
+     * LazyStyle.
+     */
+    private Map<String, Region> registeredRegions =
+            new HashMap<String, Region>();
+    /**
+     * Our fallback style to avoid NPEs if the proper style cannot be found in
+     * this class. Not sure if relying on DefaultSynthStyle is the best choice.
+     */
+    private DefaultSynthStyle defaultStyle;
+    /**
+     * The default font that will be used. I store this value so that it can be
+     * set in the UIDefaults when requested.
+     */
+    private FontUIResource defaultFont;
+
+    /**
+     * Map of lists of derived colors keyed by the DerivedColorKeys
+     */
+    private Map<DerivedColorKey, DerivedColor> derivedColorsMap =
+            new HashMap<DerivedColorKey, DerivedColor>();
+
+    /** Tempory key used for fetching from the derivedColorsMap */
+    private final DerivedColorKey tmpDCKey = new DerivedColorKey();
+
+    /** Listener for changes to user defaults table */
+    private DefaultsListener defaultsListener = new DefaultsListener();
+
+    /** Called by UIManager when this look and feel is installed. */
+    void initialize() {
+        // add listener for derived colors
+        UIManager.addPropertyChangeListener(defaultsListener);
+        UIManager.getDefaults().addPropertyChangeListener(defaultsListener);
+    }
+
+    /** Called by UIManager when this look and feel is uninstalled. */
+    void uninitialize() {
+        // remove listener for derived colors
+        UIManager.getDefaults().removePropertyChangeListener(defaultsListener);
+        UIManager.removePropertyChangeListener(defaultsListener);
+    }
+
+    /**
+     * Create a new ${LAF_NAME}Defaults. This constructor is only called from
+     * within ${LAF_NAME}LookAndFeel.
+     */
+    ${LAF_NAME}Defaults() {
+        m = new HashMap<Region, List<LazyStyle>>();
+
+        //Create the default font and default style. Also register all of the
+        //regions and their states that this class will use for later lookup.
+        //Additional regions can be registered later by 3rd party components.
+        //These are simply the default registrations.
+        defaultFont = FontManager.getFontConfigFUIR("sans", Font.PLAIN, 12);
+        defaultStyle = new DefaultSynthStyle();
+        defaultStyle.setFont(defaultFont);
+
+        //initialize the map of styles
+${STYLE_INIT}
+    }
+
+    //--------------- Methods called by ${LAF_NAME}LookAndFeel
+
+    /**
+     * Called from ${LAF_NAME}LookAndFeel to initialize the UIDefaults.
+     *
+     * @param d UIDefaults table to initialize. This will never be null.
+     *          If listeners are attached to <code>d</code>, then you will
+     *          only receive notification of LookAndFeel level defaults, not
+     *          all defaults on the UIManager.
+     */
+    void initializeDefaults(UIDefaults d) {
+${UI_DEFAULT_INIT}
+    }
+
+    /**
+     * <p>Registers the given region and prefix. The prefix, if it contains
+     * quoted sections, refers to certain named components. If there are not
+     * quoted sections, then the prefix refers to a generic component type.</p>
+     *
+     * <p>If the given region/prefix combo has already been registered, then
+     * it will not be registered twice. The second registration attempt will
+     * fail silently.</p>
+     *
+     * @param region The Synth Region that is being registered. Such as Button,
+     *        or ScrollBarThumb.
+     * @param prefix The UIDefault prefix. For example, could be ComboBox, or if
+     *        a named components, "MyComboBox", or even something like
+     *        ToolBar:"MyComboBox":"ComboBox.arrowButton"
+     */
+    void register(Region region, String prefix) {
+        //validate the method arguments
+        if (region == null || prefix == null) {
+            throw new IllegalArgumentException(
+                    "Neither Region nor Prefix may be null");
+        }
+
+        //Add a LazyStyle for this region/prefix to m.
+        List<LazyStyle> styles = m.get(region);
+        if (styles == null) {
+            styles = new LinkedList<LazyStyle>();
+            styles.add(new LazyStyle(prefix));
+            m.put(region, styles);
+        } else {
+            //iterate over all the current styles and see if this prefix has
+            //already been registered. If not, then register it.
+            for (LazyStyle s : styles) {
+                if (prefix.equals(s.prefix)) {
+                    return;
+                }
+            }
+            styles.add(new LazyStyle(prefix));
+        }
+
+        //add this region to the map of registered regions
+        registeredRegions.put(region.getName(), region);
+    }
+
+    /**
+     * <p>Locate the style associated with the given region, and component.
+     * This is called from ${LAF_NAME}LookAndFeel in the SynthStyleFactory
+     * implementation.</p>
+     *
+     * <p>Lookup occurs as follows:<br/>
+     * Check the map of styles <code>m</code>. If the map contains no styles at
+     * all, then simply return the defaultStyle. If the map contains styles,
+     * then iterate over all of the styles for the Region <code>r</code> looking
+     * for the best match, based on prefix. If a match was made, then return
+     * that SynthStyle. Otherwise, return the defaultStyle.</p>
+     *
+     * @param comp The component associated with this region. For example, if
+     *        the Region is Region.Button then the component will be a JButton.
+     *        If the Region is a subregion, such as ScrollBarThumb, then the
+     *        associated component will be the component that subregion belongs
+     *        to, such as JScrollBar. The JComponent may be named. It may not be
+     *        null.
+     * @param r The region we are looking for a style for. May not be null.
+     */
+    SynthStyle getStyle(JComponent comp, Region r) {
+        //validate method arguments
+        if (comp == null || r == null) {
+            throw new IllegalArgumentException(
+                    "Neither comp nor r may be null");
+        }
+
+        //if there are no lazy styles registered for the region r, then return
+        //the default style
+        List<LazyStyle> styles = m.get(r);
+        if (styles == null || styles.size() == 0) {
+            return defaultStyle;
+        }
+
+        //Look for the best SynthStyle for this component/region pair.
+        LazyStyle foundStyle = null;
+        for (LazyStyle s : styles) {
+            if (s.matches(comp)) {
+                //replace the foundStyle if foundStyle is null, or
+                //if the new style "s" is more specific (ie, its path was
+                //longer), or if the foundStyle was "simple" and the new style
+                //was not (ie: the foundStyle was for something like Button and
+                //the new style was for something like "MyButton", hence, being
+                //more specific.) In all cases, favor the most specific style
+                //found.
+                if (foundStyle == null ||
+                   (foundStyle.parts.length < s.parts.length) ||
+                   (foundStyle.parts.length == s.parts.length 
+                    && foundStyle.simple && !s.simple)) {
+                    foundStyle = s;
+                }
+            }
+        }
+
+        //return the style, if found, or the default style if not found
+        return foundStyle == null ? defaultStyle : foundStyle.getStyle(comp);
+    }
+
+    /*
+        Various public helper classes.
+        These may be used to register 3rd party values into UIDefaults
+    */
+
+    /**
+     * <p>Derives its font value based on a parent font and a set of offsets and
+     * attributes. This class is an ActiveValue, meaning that it will recompute
+     * its value each time it is requested from UIDefaults. It is therefore
+     * recommended to read this value once and cache it in the UI delegate class
+     * until asked to reinitialize.</p>
+     *
+     * <p>To use this class, create an instance with the key of the font in the
+     * UI defaults table from which to derive this font, along with a size
+     * offset (if any), and whether it is to be bold, italic, or left in its
+     * default form.</p>
+     */
+    public static final class DerivedFont implements UIDefaults.ActiveValue {
+        private float sizeOffset;
+        private Boolean bold;
+        private Boolean italic;
+        private String parentKey;
+
+        /**
+         * Create a new DerivedFont.
+         *
+         * @param key The UIDefault key associated with this derived font's
+         *            parent or source. If this key leads to a null value, or a
+         *            value that is not a font, then null will be returned as
+         *            the derived font. The key must not be null.
+         * @param sizeOffset The size offset, as a percentage, to use. For
+         *                   example, if the source font was a 12pt font and the
+         *                   sizeOffset were specified as .9, then the new font
+         *                   will be 90% of what the source font was, or, 10.8
+         *                   pts which is rounded to 11pts. This fractional
+         *                   based offset allows for proper font scaling in high
+         *                   DPI or large system font scenarios.
+         * @param bold Whether the new font should be bold. If null, then this
+         *             new font will inherit the bold setting of the source
+         *             font.
+         * @param italic Whether the new font should be italicized. If null,
+         *               then this new font will inherit the italic setting of
+         *               the source font.
+         */
+        public DerivedFont(String key, float sizeOffset, Boolean bold,
+                           Boolean italic) {
+            //validate the constructor arguments
+            if (key == null) {
+                throw new IllegalArgumentException("You must specify a key");
+            }
+
+            //set the values
+            this.parentKey = key;
+            this.sizeOffset = sizeOffset;
+            this.bold = bold;
+            this.italic = italic;
+        }
+
+        /**
+         * @inheritDoc
+         */
+        @Override
+        public Object createValue(UIDefaults defaults) {
+            Font f = defaults.getFont(parentKey);
+            if (f != null) {
+                // always round size for now so we have exact int font size
+                // (or we may have lame looking fonts)
+                float size = Math.round(f.getSize2D() * sizeOffset);
+                int style = f.getStyle();
+                if (bold != null) {
+                    if (bold.booleanValue()) {
+                        style = style | Font.BOLD;
+                    } else {
+                        style = style & ~Font.BOLD;
+                    }
+                }
+                if (italic != null) {
+                    if (italic.booleanValue()) {
+                        style = style | Font.ITALIC;
+                    } else {
+                        style = style & ~Font.ITALIC;
+                    }
+                }
+                return f.deriveFont(style, size);
+            } else {
+                return null;
+            }
+        }
+    }
+
+
+    /**
+     * This class is private because it relies on the constructor of the
+     * auto-generated AbstractRegionPainter subclasses. Hence, it is not
+     * generally useful, and is private.
+     * <p/>
+     * LazyPainter is a LazyValue class. It will create the
+     * AbstractRegionPainter lazily, when asked. It uses reflection to load the
+     * proper class and invoke its constructor.
+     */
+    private static final class LazyPainter implements UIDefaults.LazyValue {
+        private int which;
+        private AbstractRegionPainter.PaintContext ctx;
+        private String className;
+
+        LazyPainter(String className, int which, Insets insets,
+                    Dimension canvasSize, boolean inverted) {
+            if (className == null) {
+                throw new IllegalArgumentException(
+                        "The className must be specified");
+            }
+
+            this.className = className;
+            this.which = which;
+            this.ctx = new AbstractRegionPainter.PaintContext(
+                insets, canvasSize, inverted);
+        }
+
+        LazyPainter(String className, int which, Insets insets,
+                    Dimension canvasSize, boolean inverted,
+                    AbstractRegionPainter.PaintContext.CacheMode cacheMode,
+                    double maxH, double maxV) {
+            if (className == null) {
+                throw new IllegalArgumentException(
+                        "The className must be specified");
+            }
+
+            this.className = className;
+            this.which = which;
+            this.ctx = new AbstractRegionPainter.PaintContext(
+                    insets, canvasSize, inverted, cacheMode, maxH, maxV);
+        }
+
+        @Override
+        public Object createValue(UIDefaults table) {
+            try {
+                Class c;
+                Object cl;
+                // See if we should use a separate ClassLoader
+                if (table == null || !((cl = table.get("ClassLoader"))
+                                       instanceof ClassLoader)) {
+                    cl = Thread.currentThread().
+                                getContextClassLoader();
+                    if (cl == null) {
+                        // Fallback to the system class loader.
+                        cl = ClassLoader.getSystemClassLoader();
+                    }
+                }
+
+                c = Class.forName(className, true, (ClassLoader)cl);
+                Constructor constructor = c.getConstructor(
+                        AbstractRegionPainter.PaintContext.class, int.class);
+                if (constructor == null) {
+                    throw new NullPointerException(
+                            "Failed to find the constructor for the class: " +
+                            className);
+                }
+                return constructor.newInstance(ctx, which);
+            } catch (Exception e) {
+                e.printStackTrace();
+                return null;
+            }
+        }
+    }
+
+    /**
+     * A class which creates the NimbusStyle associated with it lazily, but also
+     * manages a lot more information about the style. It is less of a LazyValue
+     * type of class, and more of an Entry or Item type of class, as it
+     * represents an entry in the list of LazyStyles in the map m.
+     *
+     * The primary responsibilities of this class include:
+     * <ul>
+     *   <li>Determining whether a given component/region pair matches this
+     *       style</li>
+     *   <li>Splitting the prefix specified in the constructor into its
+     *       constituent parts to facilitate quicker matching</li>
+     *   <li>Creating and vending a NimbusStyle lazily.</li>
+     * </ul>
+     */
+    private final class LazyStyle {
+        /**
+         * The prefix this LazyStyle was registered with. Something like
+         * Button or ComboBox:"ComboBox.arrowButton"
+         */
+        private String prefix;
+        /**
+         * Whether or not this LazyStyle represents an unnamed component
+         */
+        private boolean simple = true;
+        /**
+         * The various parts, or sections, of the prefix. For example,
+         * the prefix:
+         *     ComboBox:"ComboBox.arrowButton"
+         *
+         * will be broken into two parts,
+         *     ComboBox and "ComboBox.arrowButton"
+         */
+        private Part[] parts;
+        /**
+         * Cached shared style.
+         */
+        private NimbusStyle style;
+        /**
+         * A weakly referenced hash map such that if the reference JComponent
+         * key is garbage collected then the entry is removed from the map.
+         * This cache exists so that when a JComponent has nimbus overrides
+         * in its client map, a unique style will be created and returned
+         * for that JComponent instance, always. In such a situation each
+         * JComponent instance must have its own instance of NimbusStyle.
+         */
+        private WeakHashMap<JComponent, WeakReference<NimbusStyle>> overridesCache;
+
+        /**
+         * Create a new LazyStyle.
+         *
+         * @param prefix The prefix associated with this style. Cannot be null.
+         */
+        private LazyStyle(String prefix) {
+            if (prefix == null) {
+                throw new IllegalArgumentException(
+                        "The prefix must not be null");
+            }
+
+            this.prefix = prefix;
+
+            //there is one odd case that needs to be supported here: cell
+            //renderers. A cell renderer is defined as a named internal
+            //component, so for example:
+            // List."List.cellRenderer"
+            //The problem is that the component named List.cellRenderer is not a
+            //child of a JList. Rather, it is treated more as a direct component
+            //Thus, if the prefix ends with "cellRenderer", then remove all the
+            //previous dotted parts of the prefix name so that it becomes, for
+            //example: "List.cellRenderer"
+            //Likewise, we have a hacked work around for cellRenderer, renderer,
+            //and listRenderer.
+            String temp = prefix;
+            if (temp.endsWith("cellRenderer\"")
+                    || temp.endsWith("renderer\"")
+                    || temp.endsWith("listRenderer\"")) {
+                temp = temp.substring(temp.lastIndexOf(":\"") + 1);
+            }
+
+            //otherwise, normal code path
+            List<String> sparts = split(temp);
+            parts = new Part[sparts.size()];
+            for (int i = 0; i < parts.length; i++) {
+                parts[i] = new Part(sparts.get(i));
+                if (parts[i].named) {
+                    simple = false;
+                }
+            }
+        }
+
+        /**
+         * Gets the style. Creates it if necessary.
+         * @return the style
+         */
+        SynthStyle getStyle(JComponent c) {
+            // if the component has overrides, it gets its own unique style
+            // instead of the shared style.
+            if (c.getClientProperty("Nimbus.Overrides") != null) {
+                if (overridesCache == null)
+                    overridesCache = new WeakHashMap<JComponent, WeakReference<NimbusStyle>>();
+                WeakReference<NimbusStyle> ref = overridesCache.get(c);
+                NimbusStyle s = ref == null ? null : ref.get();
+                if (s == null) {
+                    s = new NimbusStyle(prefix, c);
+                    overridesCache.put(c, new WeakReference<NimbusStyle>(s));
+                }
+                return s;
+            }
+            
+            // lazily create the style if necessary
+            if (style == null)
+                style = new NimbusStyle(prefix, null);
+            
+            // return the style
+            return style;
+        }
+
+        /**
+         * This LazyStyle is a match for the given component if, and only if,
+         * for each part of the prefix the component hierarchy matches exactly.
+         * That is, if given "a":something:"b", then:
+         * c.getName() must equals "b"
+         * c.getParent() can be anything
+         * c.getParent().getParent().getName() must equal "a".
+         */
+        boolean matches(JComponent c) {
+            return matches(c, parts.length - 1);
+        }
+
+        private boolean matches(Component c, int partIndex) {
+            if (partIndex < 0) return true;
+            if (c == null) return false;
+            //only get here if partIndex > 0 and c == null
+
+            String name = c.getName();
+            if (parts[partIndex].named && parts[partIndex].s.equals(name)) {
+                //so far so good, recurse
+                return matches(c.getParent(), partIndex - 1);
+            } else if (!parts[partIndex].named) {
+                //if c is not named, and parts[partIndex] has an expected class
+                //type registered, then check to make sure c is of the
+                //right type;
+                Class clazz = parts[partIndex].c;
+                if (clazz != null && clazz.isAssignableFrom(c.getClass())) {
+                    //so far so good, recurse
+                    return matches(c.getParent(), partIndex - 1);
+                } else if (clazz == null &&
+                           registeredRegions.containsKey(parts[partIndex].s)) {
+                    Region r = registeredRegions.get(parts[partIndex].s);
+                    Component parent = r.isSubregion() ? c : c.getParent();
+                    //special case the JInternalFrameTitlePane, because it
+                    //doesn't fit the mold. very, very funky.
+                    if (r == Region.INTERNAL_FRAME_TITLE_PANE && parent != null
+                        && parent instanceof JInternalFrame.JDesktopIcon) {
+                        JInternalFrame.JDesktopIcon icon =
+                                (JInternalFrame.JDesktopIcon) parent;
+                        parent = icon.getInternalFrame();
+                    }
+                    //it was the name of a region. So far, so good. Recurse.
+                    return matches(parent, partIndex - 1);
+                }
+            }
+
+            return false;
+        }
+
+        /**
+         * Given some dot separated prefix, split on the colons that are
+         * not within quotes, and not within brackets.
+         *
+         * @param prefix
+         * @return
+         */
+        private List<String> split(String prefix) {
+            List<String> parts = new ArrayList<String>();
+            int bracketCount = 0;
+            boolean inquotes = false;
+            int lastIndex = 0;
+            for (int i = 0; i < prefix.length(); i++) {
+                char c = prefix.charAt(i);
+
+                if (c == '[') {
+                    bracketCount++;
+                    continue;
+                } else if (c == '"') {
+                    inquotes = !inquotes;
+                    continue;
+                } else if (c == ']') {
+                    bracketCount--;
+                    if (bracketCount < 0) {
+                        throw new RuntimeException(
+                                "Malformed prefix: " + prefix);
+                    }
+                    continue;
+                }
+
+                if (c == ':' && !inquotes && bracketCount == 0) {
+                    //found a character to split on.
+                    parts.add(prefix.substring(lastIndex, i));
+                    lastIndex = i + 1;
+                }
+            }
+            if (lastIndex < prefix.length() - 1 && !inquotes
+                    && bracketCount == 0) {
+                parts.add(prefix.substring(lastIndex));
+            }
+            return parts;
+
+        }
+
+        private final class Part {
+            private String s;
+            //true if this part represents a component name
+            private boolean named;
+            private Class c;
+
+            Part(String s) {
+                named = s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"';
+                if (named) {
+                    this.s = s.substring(1, s.length() - 1);
+                } else {
+                    this.s = s;
+                    //TODO use a map of known regions for Synth and Swing, and
+                    //then use [classname] instead of org_class_name style
+                    try {
+                        c = Class.forName("javax.swing.J" + s);
+                    } catch (Exception e) {
+                    }
+                    try {
+                        c = Class.forName(s.replace("_", "."));
+                    } catch (Exception e) {
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Get a derived color, derived colors are shared instances and will be
+     * updated when its parent UIDefault color changes.
+     *
+     * @param uiDefaultParentName The parent UIDefault key
+     * @param hOffset The hue offset
+     * @param sOffset The saturation offset
+     * @param bOffset The brightness offset
+     * @param aOffset The alpha offset
+     * @return The stored derived color
+     */
+    public DerivedColor getDerivedColor(String uiDefaultParentName,
+                                        float hOffset, float sOffset,
+                                        float bOffset, int aOffset){
+        return getDerivedColor(uiDefaultParentName, hOffset, sOffset,
+                               bOffset, aOffset, true);
+    }
+
+    /**
+     * Get a derived color, derived colors are shared instances and will be
+     * updated when its parent UIDefault color changes.
+     *
+     * @param uiDefaultParentName The parent UIDefault key
+     * @param hOffset The hue offset
+     * @param sOffset The saturation offset
+     * @param bOffset The brightness offset
+     * @param aOffset The alpha offset
+     * @param uiResource True if the derived color should be a UIResource,
+     *        false if it should not be a UIResource
+     * @return The stored derived color
+     */
+    public DerivedColor getDerivedColor(String uiDefaultParentName,
+                                        float hOffset, float sOffset,
+                                        float bOffset, int aOffset,
+                                        boolean uiResource){
+        tmpDCKey.set(uiDefaultParentName, hOffset, sOffset, bOffset, aOffset,
+            uiResource);
+        DerivedColor color = derivedColorsMap.get(tmpDCKey);
+        if (color == null){
+            if (uiResource) {
+                color = new DerivedColor.UIResource(uiDefaultParentName,
+                        hOffset, sOffset, bOffset, aOffset);
+            } else {
+                color = new DerivedColor(uiDefaultParentName, hOffset, sOffset,
+                    bOffset, aOffset);
+            }
+            // calculate the initial value
+            color.rederiveColor();
+            // add the listener so that if the color changes we'll propogate it
+            color.addPropertyChangeListener(defaultsListener);
+            // add to the derived colors table
+            derivedColorsMap.put(new DerivedColorKey(uiDefaultParentName,
+                    hOffset, sOffset, bOffset, aOffset, uiResource),color);
+        }
+        return color;
+    }
+
+    /**
+     * Key class for derived colors
+     */
+    private class DerivedColorKey {
+        private String uiDefaultParentName;
+        private float hOffset, sOffset, bOffset;
+        private int aOffset;
+        private boolean uiResource;
+
+        DerivedColorKey(){}
+
+        DerivedColorKey(String uiDefaultParentName, float hOffset,
+                        float sOffset, float bOffset, int aOffset,
+                        boolean uiResource) {
+            set(uiDefaultParentName, hOffset, sOffset, bOffset, aOffset, uiResource);
+        }
+
+        void set (String uiDefaultParentName, float hOffset,
+                        float sOffset, float bOffset, int aOffset,
+                        boolean uiResource) {
+            this.uiDefaultParentName = uiDefaultParentName;
+            this.hOffset = hOffset;
+            this.sOffset = sOffset;
+            this.bOffset = bOffset;
+            this.aOffset = aOffset;
+            this.uiResource = uiResource;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (!(o instanceof DerivedColorKey)) return false;
+            DerivedColorKey that = (DerivedColorKey) o;
+            if (aOffset != that.aOffset) return false;
+            if (Float.compare(that.bOffset, bOffset) != 0) return false;
+            if (Float.compare(that.hOffset, hOffset) != 0) return false;
+            if (Float.compare(that.sOffset, sOffset) != 0) return false;
+            if (uiDefaultParentName != null ?
+                !uiDefaultParentName.equals(that.uiDefaultParentName) :
+                that.uiDefaultParentName != null) return false;
+            if (this.uiResource != that.uiResource) return false;
+            return true;
+        }
+
+        @Override
+        public int hashCode() {
+            int result = super.hashCode();
+            result = 31 * result + uiDefaultParentName.hashCode();
+            result = 31 * result + hOffset != +0.0f ?
+                    Float.floatToIntBits(hOffset) : 0;
+            result = 31 * result + sOffset != +0.0f ?
+                    Float.floatToIntBits(sOffset) : 0;
+            result = 31 * result + bOffset != +0.0f ?
+                    Float.floatToIntBits(bOffset) : 0;
+            result = 31 * result + aOffset;
+            result = 31 * result + (uiResource ? 1 : 0);
+            return result;
+        }
+    }
+
+    /**
+     * Listener to update derived colors on UIManager Defaults changes
+     */
+    private class DefaultsListener implements PropertyChangeListener {
+        @Override
+        public void propertyChange(PropertyChangeEvent evt) {
+            Object src = evt.getSource();
+            String key = evt.getPropertyName();
+            if (key.equals("lookAndFeel")){
+                // LAF has been installed, this is the first point at which we
+                // can access our defaults table via UIManager so before now
+                // all derived colors will be incorrect.
+                // First we need to update
+                for (DerivedColor color : derivedColorsMap.values()) {
+                    color.rederiveColor();
+                }
+            } else if (src instanceof DerivedColor && key.equals("rgb")) {
+                // derived color that is in UIManager defaults has changed
+                // update all its dependent colors. Don't worry about doing
+                // this recursively since calling rederiveColor will cause
+                // another PCE to be fired, ending up here and essentially
+                // recursing
+                DerivedColor parentColor = (DerivedColor)src;
+                String parentKey = null;
+                Set<Map.Entry<Object,Object>> entries =
+                        UIManager.getDefaults().entrySet();
+                
+                for (Map.Entry entry : entries) {
+                    Object value = entry.getValue();
+                    if (value == parentColor) {
+                        parentKey = entry.getKey().toString();
+                    }
+                }
+                
+                if (parentKey == null) {
+                    //couldn't find the DerivedColor in the UIDefaults map,
+                    //so we just bail.
+                    return;
+                }
+                
+                for (Map.Entry entry : entries) {
+                    Object value = entry.getValue();
+                    if (value instanceof DerivedColor) {
+                        DerivedColor color = (DerivedColor)entry.getValue();
+                        if (parentKey.equals(color.getUiDefaultParentName())) {
+                            color.rederiveColor();
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private static final class PainterBorder implements Border, UIResource {
+        private Insets insets;
+        private Painter painter;
+        private String painterKey;
+        
+        PainterBorder(String painterKey, Insets insets) {
+            this.insets = insets;
+            this.painterKey = painterKey;
+        }
+        
+        @Override
+        public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
+            if (painter == null) {
+                painter = (Painter)UIManager.get(painterKey);
+                if (painter == null) return;
+            }
+            
+            g.translate(x, y);
+            if (g instanceof Graphics2D)
+                painter.paint((Graphics2D)g, c, w, h);
+            else {
+                BufferedImage img = new BufferedImage(w, h, TYPE_INT_ARGB);
+                Graphics2D gfx = img.createGraphics();
+                painter.paint(gfx, c, w, h);
+                gfx.dispose();
+                g.drawImage(img, x, y, null);
+                img = null;
+            }
+            g.translate(-x, -y);
+        }
+
+        @Override
+        public Insets getBorderInsets(Component c) {
+            return (Insets)insets.clone();
+        }
+
+        @Override
+        public boolean isBorderOpaque() {
+            return false;
+        }
+    }
+}
+
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
new file mode 100644
index 0000000..20b7b1a
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import javax.swing.UIManager;
+import java.awt.Color;
+import java.beans.PropertyChangeSupport;
+import java.beans.PropertyChangeListener;
+
+/**
+ * DerivedColor - A color implementation that is derived from a UIManager
+ * defaults table color and a set of offsets. It can be rederived at any point
+ * by calling rederiveColor(). For example when its parent color changes and it
+ * value will update to reflect the new derived color. Property change events
+ * are fired for the "rgb" property when the derived color changes.
+ *
+ * @author Jasper Potts
+ */
+class DerivedColor extends Color {
+    private final PropertyChangeSupport changeSupport =
+            new PropertyChangeSupport(this);
+    private final String uiDefaultParentName;
+    private final float hOffset, sOffset, bOffset;
+    private final int aOffset;
+    private int argbValue;
+
+    DerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset) {
+        super(0);
+        this.uiDefaultParentName = uiDefaultParentName;
+        this.hOffset = hOffset;
+        this.sOffset = sOffset;
+        this.bOffset = bOffset;
+        this.aOffset = aOffset;
+    }
+
+    public String getUiDefaultParentName() {
+        return uiDefaultParentName;
+    }
+
+    public float getHueOffset() {
+        return hOffset;
+    }
+
+    public float getSaturationOffset() {
+        return sOffset;
+    }
+
+    public float getBrightnessOffset() {
+        return bOffset;
+    }
+
+    public int getAlphaOffset() {
+        return aOffset;
+    }
+
+    /**
+     * Recalculate the derived color from the UIManager parent color and offsets
+     */
+    public void rederiveColor() {
+        int old = argbValue;
+        Color src = UIManager.getColor(uiDefaultParentName);
+        if (src != null) {
+            float[] tmp = Color.RGBtoHSB(src.getRed(), src.getGreen(), src.getBlue(), null);
+            // apply offsets
+            tmp[0] = clamp(tmp[0] + hOffset);
+            tmp[1] = clamp(tmp[1] + sOffset);
+            tmp[2] = clamp(tmp[2] + bOffset);
+            int alpha = clamp(src.getAlpha() + aOffset);
+            argbValue = (Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF) | (alpha << 24);
+        } else {
+            float[] tmp = new float[3];
+            tmp[0] = clamp(hOffset);
+            tmp[1] = clamp(sOffset);
+            tmp[2] = clamp(bOffset);
+            int alpha = clamp(aOffset);
+            argbValue = (Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF) | (alpha << 24);
+        }
+        changeSupport.firePropertyChange("rgb", old, argbValue);
+    }
+
+    /**
+     * Returns the RGB value representing the color in the default sRGB {@link java.awt.image.ColorModel}. (Bits 24-31
+     * are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).
+     *
+     * @return the RGB value of the color in the default sRGB <code>ColorModel</code>.
+     * @see java.awt.image.ColorModel#getRGBdefault
+     * @see #getRed
+     * @see #getGreen
+     * @see #getBlue
+     * @since JDK1.0
+     */
+    @Override public int getRGB() {
+        return argbValue;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof DerivedColor)) return false;
+        DerivedColor that = (DerivedColor) o;
+        if (aOffset != that.aOffset) return false;
+        if (Float.compare(that.bOffset, bOffset) != 0) return false;
+        if (Float.compare(that.hOffset, hOffset) != 0) return false;
+        if (Float.compare(that.sOffset, sOffset) != 0) return false;
+        if (!uiDefaultParentName.equals(that.uiDefaultParentName)) return false;
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = uiDefaultParentName.hashCode();
+        result = 31 * result + hOffset != +0.0f ?
+                Float.floatToIntBits(hOffset) : 0;
+        result = 31 * result + sOffset != +0.0f ?
+                Float.floatToIntBits(sOffset) : 0;
+        result = 31 * result + bOffset != +0.0f ?
+                Float.floatToIntBits(bOffset) : 0;
+        result = 31 * result + aOffset;
+        return result;
+    }
+
+     /**
+     * Add a PropertyChangeListener to the listener list.
+     * The listener is registered for all properties.
+     * The same listener object may be added more than once, and will be called
+     * as many times as it is added.
+     * If <code>listener</code> is null, no exception is thrown and no action
+     * is taken.
+     *
+     * @param listener  The PropertyChangeListener to be added
+     */
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        changeSupport.addPropertyChangeListener(listener);
+    }
+
+    /**
+     * Remove a PropertyChangeListener from the listener list.
+     * This removes a PropertyChangeListener that was registered
+     * for all properties.
+     * If <code>listener</code> was added more than once to the same event
+     * source, it will be notified one less time after being removed.
+     * If <code>listener</code> is null, or was never added, no exception is
+     * thrown and no action is taken.
+     *
+     * @param listener  The PropertyChangeListener to be removed
+     */
+    public void removePropertyChangeListener(PropertyChangeListener listener) {
+        changeSupport.removePropertyChangeListener(listener);
+    }
+
+    private float clamp(float value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 1) {
+            value = 1;
+        }
+        return value;
+    }
+
+    private int clamp(int value) {
+        if (value < 0) {
+            value = 0;
+        } else if (value > 255) {
+            value = 255;
+        }
+        return value;
+    }
+
+    /**
+     * Returns a string representation of this <code>Color</code>. This method
+     * is intended to be used only for debugging purposes. The content and
+     * format of the returned string might vary between implementations. The
+     * returned string might be empty but cannot be <code>null</code>.
+     *
+     * @return a String representation of this <code>Color</code>.
+     */
+    @Override
+    public String toString() {
+        Color src = UIManager.getColor(uiDefaultParentName);
+        String s = "DerivedColor(color=" + getRed() + "," + getGreen() + "," + getBlue() +
+                " parent=" + uiDefaultParentName +
+                " offsets=" + getHueOffset() + "," + getSaturationOffset() + ","
+                + getBrightnessOffset() + "," + getAlphaOffset();
+        return src == null ? s : s + " pColor=" + src.getRed() + "," + src.getGreen() + "," + src.getBlue();
+    }
+
+    static class UIResource extends DerivedColor implements javax.swing.plaf.UIResource {
+        UIResource(String uiDefaultParentName, float hOffset, float sOffset,
+                   float bOffset, int aOffset) {
+            super(uiDefaultParentName, hOffset, sOffset, bOffset, aOffset);
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java
new file mode 100644
index 0000000..b97a8e0
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Arrays;
+
+/**
+ * DropShadowEffect - This effect currently only works with ARGB type buffered
+ * images.
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+class DropShadowEffect extends ShadowEffect {
+
+    // =================================================================================================================
+    // Effect Methods
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    @Override
+    EffectType getEffectType() {
+        return EffectType.UNDER;
+    }
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The destination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return Image with the result of the effect
+     */
+    @Override
+    BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h) {
+        if (src == null || src.getType() != BufferedImage.TYPE_INT_ARGB){
+            throw new IllegalArgumentException("Effect only works with " +
+                    "source images of type BufferedImage.TYPE_INT_ARGB.");
+        }
+        if (dst != null && dst.getType() != BufferedImage.TYPE_INT_ARGB){
+            throw new IllegalArgumentException("Effect only works with " +
+                    "destination images of type BufferedImage.TYPE_INT_ARGB.");
+        }
+        // calculate offset
+        double trangleAngle = Math.toRadians(angle - 90);
+        int offsetX = (int) (Math.sin(trangleAngle) * distance);
+        int offsetY = (int) (Math.cos(trangleAngle) * distance);
+        // clac expanded size
+        int tmpOffX = offsetX + size;
+        int tmpOffY = offsetX + size;
+        int tmpW = w + offsetX + size + size;
+        int tmpH = h + offsetX + size;
+        // create tmp buffers
+        int[] lineBuf = getArrayCache().getTmpIntArray(w);
+        byte[] tmpBuf1 = getArrayCache().getTmpByteArray1(tmpW * tmpH);
+        Arrays.fill(tmpBuf1, (byte) 0x00);
+        byte[] tmpBuf2 = getArrayCache().getTmpByteArray2(tmpW * tmpH);
+        // extract src image alpha channel and inverse and offset
+        Raster srcRaster = src.getRaster();
+        for (int y = 0; y < h; y++) {
+            int dy = (y + tmpOffY);
+            int offset = dy * tmpW;
+            srcRaster.getDataElements(0, y, w, 1, lineBuf);
+            for (int x = 0; x < w; x++) {
+                int dx = x + tmpOffX;
+                tmpBuf1[offset + dx] = (byte) ((lineBuf[x] & 0xFF000000) >>> 24);
+            }
+        }
+        // blur
+        float[] kernel = EffectUtils.createGaussianKernel(size);
+        EffectUtils.blur(tmpBuf1, tmpBuf2, tmpW, tmpH, kernel, size); // horizontal pass
+        EffectUtils.blur(tmpBuf2, tmpBuf1, tmpH, tmpW, kernel, size);// vertical pass
+        //rescale
+        float spread = Math.min(1 / (1 - (0.01f * this.spread)), 255);
+        for (int i = 0; i < tmpBuf1.length; i++) {
+            int val = (int) (((int) tmpBuf1[i] & 0xFF) * spread);
+            tmpBuf1[i] = (val > 255) ? (byte) 0xFF : (byte) val;
+        }
+        // create color image with shadow color and greyscale image as alpha
+        if (dst == null) dst = new BufferedImage(w, h,
+                BufferedImage.TYPE_INT_ARGB);
+        WritableRaster shadowRaster = dst.getRaster();
+        int red = color.getRed(), green = color.getGreen(), blue = color.getBlue();
+        for (int y = 0; y < h; y++) {
+            int srcY = y + tmpOffY;
+            int shadowOffset = (srcY - offsetY) * tmpW;
+            for (int x = 0; x < w; x++) {
+                int srcX = x + tmpOffX;
+                lineBuf[x] = tmpBuf1[shadowOffset + (srcX - offsetX)] << 24 | red << 16 | green << 8 | blue;
+            }
+            shadowRaster.setDataElements(0, y, w, 1, lineBuf);
+        }
+        return dst;
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Effect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/Effect.java
new file mode 100644
index 0000000..8588ef8
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Effect.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import sun.awt.AppContext;
+
+import java.awt.image.BufferedImage;
+import java.lang.ref.SoftReference;
+
+/**
+ * Effect
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+abstract class Effect {
+    enum EffectType {
+        UNDER, BLENDED, OVER
+    }
+
+    // =================================================================================================================
+    // Abstract Methods
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    abstract EffectType getEffectType();
+
+    /**
+     * Get the opacity to use to paint the result effected image if the EffectType is UNDER or OVER.
+     *
+     * @return The opactity for the effect, 0.0f -> 1.0f
+     */
+    abstract float getOpacity();
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The dstination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return The result of appl
+     */
+    abstract BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h);
+
+    // =================================================================================================================
+    // Static data cache
+
+    protected static ArrayCache getArrayCache() {
+        ArrayCache cache = (ArrayCache)AppContext.getAppContext().get(ArrayCache.class);
+        if (cache == null){
+            cache = new ArrayCache();
+            AppContext.getAppContext().put(ArrayCache.class,cache);
+        }
+        return cache;
+    }
+
+    protected static class ArrayCache {
+        private SoftReference<int[]> tmpIntArray = null;
+        private SoftReference<byte[]> tmpByteArray1 = null;
+        private SoftReference<byte[]> tmpByteArray2 = null;
+        private SoftReference<byte[]> tmpByteArray3 = null;
+
+        protected int[] getTmpIntArray(int size) {
+            int[] tmp;
+            if (tmpIntArray == null || (tmp = tmpIntArray.get()) == null || tmp.length < size) {
+                // create new array
+                tmp = new int[size];
+                tmpIntArray = new SoftReference<int[]>(tmp);
+            }
+            return tmp;
+        }
+
+        protected byte[] getTmpByteArray1(int size) {
+            byte[] tmp;
+            if (tmpByteArray1 == null || (tmp = tmpByteArray1.get()) == null || tmp.length < size) {
+                // create new array
+                tmp = new byte[size];
+                tmpByteArray1 = new SoftReference<byte[]>(tmp);
+            }
+            return tmp;
+        }
+
+        protected byte[] getTmpByteArray2(int size) {
+            byte[] tmp;
+            if (tmpByteArray2 == null || (tmp = tmpByteArray2.get()) == null || tmp.length < size) {
+                // create new array
+                tmp = new byte[size];
+                tmpByteArray2 = new SoftReference<byte[]>(tmp);
+            }
+            return tmp;
+        }
+
+        protected byte[] getTmpByteArray3(int size) {
+            byte[] tmp;
+            if (tmpByteArray3 == null || (tmp = tmpByteArray3.get()) == null || tmp.length < size) {
+                // create new array
+                tmp = new byte[size];
+                tmpByteArray3 = new SoftReference<byte[]>(tmp);
+            }
+            return tmp;
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/EffectUtils.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/EffectUtils.java
new file mode 100644
index 0000000..94b4a12
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/EffectUtils.java
@@ -0,0 +1,426 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.AlphaComposite;
+import java.awt.Graphics2D;
+import java.awt.Transparency;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.awt.image.ColorModel;
+
+/**
+ * EffectUtils
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+class EffectUtils {
+
+    /**
+     * Clear a transparent image to 100% transparent
+     *
+     * @param img The image to clear
+     */
+    static void clearImage(BufferedImage img) {
+        Graphics2D g2 = img.createGraphics();
+        g2.setComposite(AlphaComposite.Clear);
+        g2.fillRect(0, 0, img.getWidth(), img.getHeight());
+        g2.dispose();
+    }
+
+    // =================================================================================================================
+    // Blur
+
+    /**
+     * Apply Gaussian Blur to Image
+     *
+     * @param src    The image tp
+     * @param dst    The destination image to draw blured src image into, null if you want a new one created
+     * @param radius The blur kernel radius
+     * @return The blured image
+     */
+    static BufferedImage gaussianBlur(BufferedImage src, BufferedImage dst, int radius) {
+        int width = src.getWidth();
+        int height = src.getHeight();
+        if (dst == null || dst.getWidth() != width || dst.getHeight() != height || src.getType() != dst.getType()) {
+            dst = createColorModelCompatibleImage(src);
+        }
+        float[] kernel = createGaussianKernel(radius);
+        if (src.getType() == BufferedImage.TYPE_INT_ARGB) {
+            int[] srcPixels = new int[width * height];
+            int[] dstPixels = new int[width * height];
+            getPixels(src, 0, 0, width, height, srcPixels);
+            // horizontal pass
+            blur(srcPixels, dstPixels, width, height, kernel, radius);
+            // vertical pass
+            //noinspection SuspiciousNameCombination
+            blur(dstPixels, srcPixels, height, width, kernel, radius);
+            // the result is now stored in srcPixels due to the 2nd pass
+            setPixels(dst, 0, 0, width, height, srcPixels);
+        } else if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {
+            byte[] srcPixels = new byte[width * height];
+            byte[] dstPixels = new byte[width * height];
+            getPixels(src, 0, 0, width, height, srcPixels);
+            // horizontal pass
+            blur(srcPixels, dstPixels, width, height, kernel, radius);
+            // vertical pass
+            //noinspection SuspiciousNameCombination
+            blur(dstPixels, srcPixels, height, width, kernel, radius);
+            // the result is now stored in srcPixels due to the 2nd pass
+            setPixels(dst, 0, 0, width, height, srcPixels);
+        } else {
+            throw new IllegalArgumentException("EffectUtils.gaussianBlur() src image is not a supported type, type=[" +
+                    src.getType() + "]");
+        }
+        return dst;
+    }
+
+    /**
+     * <p>Blurs the source pixels into the destination pixels. The force of the blur is specified by the radius which
+     * must be greater than 0.</p> <p>The source and destination pixels arrays are expected to be in the INT_ARGB
+     * format.</p> <p>After this method is executed, dstPixels contains a transposed and filtered copy of
+     * srcPixels.</p>
+     *
+     * @param srcPixels the source pixels
+     * @param dstPixels the destination pixels
+     * @param width     the width of the source picture
+     * @param height    the height of the source picture
+     * @param kernel    the kernel of the blur effect
+     * @param radius    the radius of the blur effect
+     */
+    private static void blur(int[] srcPixels, int[] dstPixels,
+                             int width, int height,
+                             float[] kernel, int radius) {
+        float a;
+        float r;
+        float g;
+        float b;
+
+        int ca;
+        int cr;
+        int cg;
+        int cb;
+
+        for (int y = 0; y < height; y++) {
+            int index = y;
+            int offset = y * width;
+
+            for (int x = 0; x < width; x++) {
+                a = r = g = b = 0.0f;
+
+                for (int i = -radius; i <= radius; i++) {
+                    int subOffset = x + i;
+                    if (subOffset < 0 || subOffset >= width) {
+                        subOffset = (x + width) % width;
+                    }
+
+                    int pixel = srcPixels[offset + subOffset];
+                    float blurFactor = kernel[radius + i];
+
+                    a += blurFactor * ((pixel >> 24) & 0xFF);
+                    r += blurFactor * ((pixel >> 16) & 0xFF);
+                    g += blurFactor * ((pixel >> 8) & 0xFF);
+                    b += blurFactor * ((pixel) & 0xFF);
+                }
+
+                ca = (int) (a + 0.5f);
+                cr = (int) (r + 0.5f);
+                cg = (int) (g + 0.5f);
+                cb = (int) (b + 0.5f);
+
+                dstPixels[index] = ((ca > 255 ? 255 : ca) << 24) |
+                        ((cr > 255 ? 255 : cr) << 16) |
+                        ((cg > 255 ? 255 : cg) << 8) |
+                        (cb > 255 ? 255 : cb);
+                index += height;
+            }
+        }
+    }
+
+    /**
+     * <p>Blurs the source pixels into the destination pixels. The force of the blur is specified by the radius which
+     * must be greater than 0.</p> <p>The source and destination pixels arrays are expected to be in the BYTE_GREY
+     * format.</p> <p>After this method is executed, dstPixels contains a transposed and filtered copy of
+     * srcPixels.</p>
+     *
+     * @param srcPixels the source pixels
+     * @param dstPixels the destination pixels
+     * @param width     the width of the source picture
+     * @param height    the height of the source picture
+     * @param kernel    the kernel of the blur effect
+     * @param radius    the radius of the blur effect
+     */
+    static void blur(byte[] srcPixels, byte[] dstPixels,
+                            int width, int height,
+                            float[] kernel, int radius) {
+        float p;
+        int cp;
+        for (int y = 0; y < height; y++) {
+            int index = y;
+            int offset = y * width;
+            for (int x = 0; x < width; x++) {
+                p = 0.0f;
+                for (int i = -radius; i <= radius; i++) {
+                    int subOffset = x + i;
+//                    if (subOffset < 0) subOffset = 0;
+//                    if (subOffset >= width) subOffset = width-1;
+                    if (subOffset < 0 || subOffset >= width) {
+                        subOffset = (x + width) % width;
+                    }
+                    int pixel = srcPixels[offset + subOffset] & 0xFF;
+                    float blurFactor = kernel[radius + i];
+                    p += blurFactor * pixel;
+                }
+                cp = (int) (p + 0.5f);
+                dstPixels[index] = (byte) (cp > 255 ? 255 : cp);
+                index += height;
+            }
+        }
+    }
+
+    static float[] createGaussianKernel(int radius) {
+        if (radius < 1) {
+            throw new IllegalArgumentException("Radius must be >= 1");
+        }
+
+        float[] data = new float[radius * 2 + 1];
+
+        float sigma = radius / 3.0f;
+        float twoSigmaSquare = 2.0f * sigma * sigma;
+        float sigmaRoot = (float) Math.sqrt(twoSigmaSquare * Math.PI);
+        float total = 0.0f;
+
+        for (int i = -radius; i <= radius; i++) {
+            float distance = i * i;
+            int index = i + radius;
+            data[index] = (float) Math.exp(-distance / twoSigmaSquare) / sigmaRoot;
+            total += data[index];
+        }
+
+        for (int i = 0; i < data.length; i++) {
+            data[i] /= total;
+        }
+
+        return data;
+    }
+
+    // =================================================================================================================
+    // Get/Set Pixels helper methods
+
+    /**
+     * <p>Returns an array of pixels, stored as integers, from a <code>BufferedImage</code>. The pixels are grabbed from
+     * a rectangular area defined by a location and two dimensions. Calling this method on an image of type different
+     * from <code>BufferedImage.TYPE_INT_ARGB</code> and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the
+     * image.</p>
+     *
+     * @param img    the source image
+     * @param x      the x location at which to start grabbing pixels
+     * @param y      the y location at which to start grabbing pixels
+     * @param w      the width of the rectangle of pixels to grab
+     * @param h      the height of the rectangle of pixels to grab
+     * @param pixels a pre-allocated array of pixels of size w*h; can be null
+     * @return <code>pixels</code> if non-null, a new array of integers otherwise
+     * @throws IllegalArgumentException is <code>pixels</code> is non-null and of length &lt; w*h
+     */
+    static byte[] getPixels(BufferedImage img,
+                                   int x, int y, int w, int h, byte[] pixels) {
+        if (w == 0 || h == 0) {
+            return new byte[0];
+        }
+
+        if (pixels == null) {
+            pixels = new byte[w * h];
+        } else if (pixels.length < w * h) {
+            throw new IllegalArgumentException("pixels array must have a length >= w*h");
+        }
+
+        int imageType = img.getType();
+        if (imageType == BufferedImage.TYPE_BYTE_GRAY) {
+            Raster raster = img.getRaster();
+            return (byte[]) raster.getDataElements(x, y, w, h, pixels);
+        } else {
+            throw new IllegalArgumentException("Only type BYTE_GRAY is supported");
+        }
+    }
+
+    /**
+     * <p>Writes a rectangular area of pixels in the destination <code>BufferedImage</code>. Calling this method on an
+     * image of type different from <code>BufferedImage.TYPE_INT_ARGB</code> and <code>BufferedImage.TYPE_INT_RGB</code>
+     * will unmanage the image.</p>
+     *
+     * @param img    the destination image
+     * @param x      the x location at which to start storing pixels
+     * @param y      the y location at which to start storing pixels
+     * @param w      the width of the rectangle of pixels to store
+     * @param h      the height of the rectangle of pixels to store
+     * @param pixels an array of pixels, stored as integers
+     * @throws IllegalArgumentException is <code>pixels</code> is non-null and of length &lt; w*h
+     */
+    static void setPixels(BufferedImage img,
+                                 int x, int y, int w, int h, byte[] pixels) {
+        if (pixels == null || w == 0 || h == 0) {
+            return;
+        } else if (pixels.length < w * h) {
+            throw new IllegalArgumentException("pixels array must have a length >= w*h");
+        }
+        int imageType = img.getType();
+        if (imageType == BufferedImage.TYPE_BYTE_GRAY) {
+            WritableRaster raster = img.getRaster();
+            raster.setDataElements(x, y, w, h, pixels);
+        } else {
+            throw new IllegalArgumentException("Only type BYTE_GRAY is supported");
+        }
+    }
+
+    /**
+     * <p>Returns an array of pixels, stored as integers, from a
+     * <code>BufferedImage</code>. The pixels are grabbed from a rectangular
+     * area defined by a location and two dimensions. Calling this method on
+     * an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code>
+     * and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the image.</p>
+     *
+     * @param img the source image
+     * @param x the x location at which to start grabbing pixels
+     * @param y the y location at which to start grabbing pixels
+     * @param w the width of the rectangle of pixels to grab
+     * @param h the height of the rectangle of pixels to grab
+     * @param pixels a pre-allocated array of pixels of size w*h; can be null
+     * @return <code>pixels</code> if non-null, a new array of integers
+     *   otherwise
+     * @throws IllegalArgumentException is <code>pixels</code> is non-null and
+     *   of length &lt; w*h
+     */
+    public static int[] getPixels(BufferedImage img,
+                                  int x, int y, int w, int h, int[] pixels) {
+        if (w == 0 || h == 0) {
+            return new int[0];
+        }
+
+        if (pixels == null) {
+            pixels = new int[w * h];
+        } else if (pixels.length < w * h) {
+            throw new IllegalArgumentException("pixels array must have a length" +
+                                               " >= w*h");
+        }
+
+        int imageType = img.getType();
+        if (imageType == BufferedImage.TYPE_INT_ARGB ||
+            imageType == BufferedImage.TYPE_INT_RGB) {
+            Raster raster = img.getRaster();
+            return (int[]) raster.getDataElements(x, y, w, h, pixels);
+        }
+
+        // Unmanages the image
+        return img.getRGB(x, y, w, h, pixels, 0, w);
+    }
+
+    /**
+     * <p>Writes a rectangular area of pixels in the destination
+     * <code>BufferedImage</code>. Calling this method on
+     * an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code>
+     * and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the image.</p>
+     *
+     * @param img the destination image
+     * @param x the x location at which to start storing pixels
+     * @param y the y location at which to start storing pixels
+     * @param w the width of the rectangle of pixels to store
+     * @param h the height of the rectangle of pixels to store
+     * @param pixels an array of pixels, stored as integers
+     * @throws IllegalArgumentException is <code>pixels</code> is non-null and
+     *   of length &lt; w*h
+     */
+    public static void setPixels(BufferedImage img,
+                                 int x, int y, int w, int h, int[] pixels) {
+        if (pixels == null || w == 0 || h == 0) {
+            return;
+        } else if (pixels.length < w * h) {
+            throw new IllegalArgumentException("pixels array must have a length" +
+                                               " >= w*h");
+        }
+
+        int imageType = img.getType();
+        if (imageType == BufferedImage.TYPE_INT_ARGB ||
+            imageType == BufferedImage.TYPE_INT_RGB) {
+            WritableRaster raster = img.getRaster();
+            raster.setDataElements(x, y, w, h, pixels);
+        } else {
+            // Unmanages the image
+            img.setRGB(x, y, w, h, pixels, 0, w);
+        }
+    }
+
+    /**
+     * <p>Returns a new <code>BufferedImage</code> using the same color model
+     * as the image passed as a parameter. The returned image is only compatible
+     * with the image passed as a parameter. This does not mean the returned
+     * image is compatible with the hardware.</p>
+     *
+     * @param image the reference image from which the color model of the new
+     *   image is obtained
+     * @return a new <code>BufferedImage</code>, compatible with the color model
+     *   of <code>image</code>
+     */
+    public static BufferedImage createColorModelCompatibleImage(BufferedImage image) {
+        ColorModel cm = image.getColorModel();
+        return new BufferedImage(cm,
+            cm.createCompatibleWritableRaster(image.getWidth(),
+                                              image.getHeight()),
+            cm.isAlphaPremultiplied(), null);
+    }
+
+    /**
+     * <p>Returns a new translucent compatible image of the specified width and
+     * height. That is, the returned <code>BufferedImage</code> is compatible with
+     * the graphics hardware. If the method is called in a headless
+     * environment, then the returned BufferedImage will be compatible with
+     * the source image.</p>
+     *
+     * @param width the width of the new image
+     * @param height the height of the new image
+     * @return a new translucent compatible <code>BufferedImage</code> of the
+     *   specified width and height
+     */
+    public static BufferedImage createCompatibleTranslucentImage(int width,
+                                                                 int height) {
+        return isHeadless() ?
+                new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB) :
+                getGraphicsConfiguration().createCompatibleImage(width, height,
+                                                   Transparency.TRANSLUCENT);
+    }
+
+    private static boolean isHeadless() {
+        return GraphicsEnvironment.isHeadless();
+    }
+
+    // Returns the graphics configuration for the primary screen
+    private static GraphicsConfiguration getGraphicsConfiguration() {
+        return GraphicsEnvironment.getLocalGraphicsEnvironment().
+                    getDefaultScreenDevice().getDefaultConfiguration();
+    }
+
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageCache.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageCache.java
new file mode 100644
index 0000000..abd3458
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageCache.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.Image;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * ImageCache - A fixed pixel count sized cache of Images keyed by arbitrary set of arguments. All images are held with
+ * SoftReferences so they will be dropped by the GC if heap memory gets tight. When our size hits max pixel count least
+ * recently requested images are removed first.
+ *
+ * @author Created by Jasper Potts (Aug 7, 2007)
+ */
+class ImageCache {
+    // Ordered Map keyed by args hash, ordered by most recent accessed entry.
+    private final LinkedHashMap<Integer, PixelCountSoftReference> map =
+            new LinkedHashMap<Integer, PixelCountSoftReference>(16, 0.75f, true);
+    // Maximum number of pixels to cache, this is used if maxCount
+    private final int maxPixelCount;
+    // Maximum cached image size in pxiels
+    private final int maxSingleImagePixelSize;
+    // The current number of pixels stored in the cache
+    private int currentPixelCount = 0;
+    // Lock for concurrent access to map
+    private ReadWriteLock lock = new ReentrantReadWriteLock();
+    // Reference queue for tracking lost softreferences to images in the cache
+    private ReferenceQueue<Image> referenceQueue = new ReferenceQueue<Image>();
+    // Singleton Instance
+    private static final ImageCache instance = new ImageCache();
+
+
+    /** Get static singleton instance */
+    static ImageCache getInstance() {
+        return instance;
+    }
+
+    public ImageCache() {
+        this.maxPixelCount = (8 * 1024 * 1024) / 4; // 8Mb of pixels
+        this.maxSingleImagePixelSize = 300 * 300;
+    }
+
+    public ImageCache(int maxPixelCount, int maxSingleImagePixelSize) {
+        this.maxPixelCount = maxPixelCount;
+        this.maxSingleImagePixelSize = maxSingleImagePixelSize;
+    }
+
+    /** Clear the cache */
+    public void flush() {
+        lock.readLock().lock();
+        try {
+            map.clear();
+        } finally {
+            lock.readLock().unlock();
+        }
+    }
+
+    /**
+     * Check if the image size is to big to be stored in the cache
+     *
+     * @param w The image width
+     * @param h The image height
+     * @return True if the image size is less than max
+     */
+    public boolean isImageCachable(int w, int h) {
+        return (w * h) < maxSingleImagePixelSize;
+    }
+
+    /**
+     * Get the cached image for given keys
+     *
+     * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key
+     * @param w      The image width, used as part of cache key
+     * @param h      The image height, used as part of cache key
+     * @param args   Other arguments to use as part of the cache key
+     * @return Returns the cached Image, or null there is no cached image for key
+     */
+    public Image getImage(GraphicsConfiguration config, int w, int h, Object... args) {
+        lock.readLock().lock();
+        try {
+            PixelCountSoftReference ref = map.get(hash(config, w, h, args));
+            // check reference has not been lost and the key truly matches, in case of false positive hash match
+            if (ref != null && ref.equals(config,w, h, args)) {
+                return ref.get();
+            } else {
+                return null;
+            }
+        } finally {
+            lock.readLock().unlock();
+        }
+    }
+
+    /**
+     * Sets the cached image for the specified constraints.
+     *
+     * @param image  The image to store in cache
+     * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key
+     * @param w      The image width, used as part of cache key
+     * @param h      The image height, used as part of cache key
+     * @param args   Other arguments to use as part of the cache key
+     * @return true if the image could be cached or false if the image is too big
+     */
+    public boolean setImage(Image image, GraphicsConfiguration config, int w, int h, Object... args) {
+        if (!isImageCachable(w, h)) return false;
+        int hash = hash(config, w, h, args);
+        lock.writeLock().lock();
+        try {
+            PixelCountSoftReference ref = map.get(hash);
+            // check if currently in map
+            if (ref != null && ref.get() == image) {
+                return true;
+            }
+            // clear out old
+            if (ref != null) {
+                currentPixelCount -= ref.pixelCount;
+                map.remove(hash);
+            }
+            // add new image to pixel count
+            int newPixelCount = image.getWidth(null) * image.getHeight(null);
+            currentPixelCount += newPixelCount;
+            // clean out lost references if not enough space
+            if (currentPixelCount > maxPixelCount) {
+                while ((ref = (PixelCountSoftReference)referenceQueue.poll()) != null){
+                    //reference lost
+                    map.remove(ref.hash);
+                    currentPixelCount -= ref.pixelCount;
+                }
+            }
+            // remove old items till there is enough free space
+            if (currentPixelCount > maxPixelCount) {
+                Iterator<Map.Entry<Integer, PixelCountSoftReference>> mapIter = map.entrySet().iterator();
+                while ((currentPixelCount > maxPixelCount) && mapIter.hasNext()) {
+                    Map.Entry<Integer, PixelCountSoftReference> entry = mapIter.next();
+                    mapIter.remove();
+                    Image img = entry.getValue().get();
+                    if (img != null) img.flush();
+                    currentPixelCount -= entry.getValue().pixelCount;
+                }
+            }
+            // finaly put new in map
+            map.put(hash, new PixelCountSoftReference(image, referenceQueue, newPixelCount,hash, config, w, h, args));
+            return true;
+        } finally {
+            lock.writeLock().unlock();
+        }
+    }
+
+    /** Create a unique hash from all the input */
+    private int hash(GraphicsConfiguration config, int w, int h, Object ... args) {
+        int hash;
+        hash = (config != null ? config.hashCode() : 0);
+        hash = 31 * hash + w;
+        hash = 31 * hash + h;
+        hash = 31 * hash + Arrays.deepHashCode(args);
+        return hash;
+    }
+
+
+    /** Extended SoftReference that stores the pixel count even after the image is lost */
+    private static class PixelCountSoftReference extends SoftReference<Image> {
+        private final int pixelCount;
+        private final int hash;
+        // key parts
+        private final GraphicsConfiguration config;
+        private final int w;
+        private final int h;
+        private final Object[] args;
+
+        public PixelCountSoftReference(Image referent, ReferenceQueue<? super Image> q, int pixelCount, int hash,
+                                       GraphicsConfiguration config, int w, int h, Object[] args) {
+            super(referent, q);
+            this.pixelCount = pixelCount;
+            this.hash = hash;
+            this.config = config;
+            this.w = w;
+            this.h = h;
+            this.args = args;
+        }
+
+        public boolean equals (GraphicsConfiguration config, int w, int h, Object[] args){
+            return config == this.config &&
+                            w == this.w &&
+                            h == this.h &&
+                            Arrays.equals(args, this.args);
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageScalingHelper.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageScalingHelper.java
new file mode 100644
index 0000000..a6f6f51a
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/ImageScalingHelper.java
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Insets;
+
+/**
+ * ImageScalingHelper
+ *
+ * @author Created by Jasper Potts (Aug 8, 2007)
+ */
+class ImageScalingHelper {
+
+    /** Enumeration for the types of painting this class can handle. */
+    enum PaintType {
+        /**
+         * Painting type indicating the image should be centered in the space provided.  When used the <code>mask</code>
+         * is ignored.
+         */
+        CENTER,
+
+        /**
+         * Painting type indicating the image should be tiled across the specified width and height.  When used the
+         * <code>mask</code> is ignored.
+         */
+        TILE,
+
+        /**
+         * Painting type indicating the image should be split into nine regions with the top, left, bottom and right
+         * areas stretched.
+         */
+        PAINT9_STRETCH,
+
+        /**
+         * Painting type indicating the image should be split into nine regions with the top, left, bottom and right
+         * areas tiled.
+         */
+        PAINT9_TILE
+    }
+
+    ;
+
+    private static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
+
+    static final int PAINT_TOP_LEFT = 1;
+    static final int PAINT_TOP = 2;
+    static final int PAINT_TOP_RIGHT = 4;
+    static final int PAINT_LEFT = 8;
+    static final int PAINT_CENTER = 16;
+    static final int PAINT_RIGHT = 32;
+    static final int PAINT_BOTTOM_RIGHT = 64;
+    static final int PAINT_BOTTOM = 128;
+    static final int PAINT_BOTTOM_LEFT = 256;
+    /**
+     * Specifies that all regions should be painted.  If this is set any other regions specified will not be painted.
+     * For example PAINT_ALL | PAINT_CENTER will paint all but the center.
+     */
+    static final int PAINT_ALL = 512;
+
+    /**
+     * Paints using the algorightm specified by <code>paintType</code>.
+     *
+     * @param g         Graphics to render to
+     * @param x         X-coordinate
+     * @param y         Y-coordinate
+     * @param w         Width to render to
+     * @param h         Height to render to
+     * @param image     Image to render from, if <code>null</code> this method will do nothing
+     * @param sInsets   Insets specifying the portion of the image that will be stretched or tiled, if <code>null</code>
+     *                  empty <code>Insets</code> will be used.
+     * @param dInsets   Destination insets specifying the portion of the image will be stretched or tiled, if
+     *                  <code>null</code> empty <code>Insets</code> will be used.
+     * @param paintType Specifies what type of algorithm to use in painting
+     * @param mask      Specifies portion of image to render, if <code>PAINT_ALL</code> is specified, any other regions
+     *                  specified will not be painted, for example PAINT_ALL | PAINT_CENTER paints everything but the
+     *                  center.
+     */
+    public static void paint(Graphics g, int x, int y, int w, int h,
+                      Image image, Insets sInsets,
+                      Insets dInsets, PaintType paintType, int mask) {
+        if (image == null || image.getWidth(null) <= 0 || image.getHeight(null) <= 0) {
+            return;
+        }
+        if (sInsets == null) {
+            sInsets = EMPTY_INSETS;
+        }
+        if (dInsets == null) {
+            dInsets = EMPTY_INSETS;
+        }
+        int iw = image.getWidth(null);
+        int ih = image.getHeight(null);
+
+        if (paintType == PaintType.CENTER) {
+            // Center the image
+            g.drawImage(image, x + (w - iw) / 2,
+                    y + (h - ih) / 2, null);
+        } else if (paintType == PaintType.TILE) {
+            // Tile the image
+            int lastIY = 0;
+            for (int yCounter = y, maxY = y + h; yCounter < maxY;
+                 yCounter += (ih - lastIY), lastIY = 0) {
+                int lastIX = 0;
+                for (int xCounter = x, maxX = x + w; xCounter < maxX;
+                     xCounter += (iw - lastIX), lastIX = 0) {
+                    int dx2 = Math.min(maxX, xCounter + iw - lastIX);
+                    int dy2 = Math.min(maxY, yCounter + ih - lastIY);
+                    g.drawImage(image, xCounter, yCounter, dx2, dy2,
+                            lastIX, lastIY, lastIX + dx2 - xCounter,
+                            lastIY + dy2 - yCounter, null);
+                }
+            }
+        } else {
+            int st = sInsets.top;
+            int sl = sInsets.left;
+            int sb = sInsets.bottom;
+            int sr = sInsets.right;
+
+            int dt = dInsets.top;
+            int dl = dInsets.left;
+            int db = dInsets.bottom;
+            int dr = dInsets.right;
+
+            // Constrain the insets to the size of the image
+            if (st + sb > ih) {
+                db = dt = sb = st = Math.max(0, ih / 2);
+            }
+            if (sl + sr > iw) {
+                dl = dr = sl = sr = Math.max(0, iw / 2);
+            }
+
+            // Constrain the insets to the size of the region we're painting
+            // in.
+            if (dt + db > h) {
+                dt = db = Math.max(0, h / 2 - 1);
+            }
+            if (dl + dr > w) {
+                dl = dr = Math.max(0, w / 2 - 1);
+            }
+
+            boolean stretch = (paintType == PaintType.PAINT9_STRETCH);
+            if ((mask & PAINT_ALL) != 0) {
+                mask = (PAINT_ALL - 1) & ~mask;
+            }
+
+            if ((mask & PAINT_LEFT) != 0) {
+                drawChunk(image, g, stretch, x, y + dt, x + dl, y + h - db,
+                        0, st, sl, ih - sb, false);
+            }
+            if ((mask & PAINT_TOP_LEFT) != 0) {
+                drawImage(image, g, x, y, x + dl, y + dt,
+                        0, 0, sl, st);
+            }
+            if ((mask & PAINT_TOP) != 0) {
+                drawChunk(image, g, stretch, x + dl, y, x + w - dr, y + dt,
+                        sl, 0, iw - sr, st, true);
+            }
+            if ((mask & PAINT_TOP_RIGHT) != 0) {
+                drawImage(image, g, x + w - dr, y, x + w, y + dt,
+                        iw - sr, 0, iw, st);
+            }
+            if ((mask & PAINT_RIGHT) != 0) {
+                drawChunk(image, g, stretch,
+                        x + w - dr, y + dt, x + w, y + h - db,
+                        iw - sr, st, iw, ih - sb, false);
+            }
+            if ((mask & PAINT_BOTTOM_RIGHT) != 0) {
+                drawImage(image, g, x + w - dr, y + h - db, x + w, y + h,
+                        iw - sr, ih - sb, iw, ih);
+            }
+            if ((mask & PAINT_BOTTOM) != 0) {
+                drawChunk(image, g, stretch,
+                        x + dl, y + h - db, x + w - dr, y + h,
+                        sl, ih - sb, iw - sr, ih, true);
+            }
+            if ((mask & PAINT_BOTTOM_LEFT) != 0) {
+                drawImage(image, g, x, y + h - db, x + dl, y + h,
+                        0, ih - sb, sl, ih);
+            }
+            if ((mask & PAINT_CENTER) != 0) {
+                drawImage(image, g, x + dl, y + dt, x + w - dr, y + h - db,
+                        sl, st, iw - sr, ih - sb);
+            }
+        }
+    }
+
+    /**
+     * Draws a portion of an image, stretched or tiled.
+     *
+     * @param image Image to render.
+     * @param g Graphics to render to
+     * @param stretch Whether the image should be stretched or timed in the
+     *                provided space.
+     * @param dx1 X origin to draw to
+     * @param dy1 Y origin to draw to
+     * @param dx2 End x location to draw to
+     * @param dy2 End y location to draw to
+     * @param sx1 X origin to draw from
+     * @param sy1 Y origin to draw from
+     * @param sx2 Max x location to draw from
+     * @param sy2 Max y location to draw from
+     * @param xDirection Used if the image is not stretched. If true it
+     *        indicates the image should be tiled along the x axis.
+     */
+    private static void drawChunk(Image image, Graphics g, boolean stretch,
+                           int dx1, int dy1, int dx2, int dy2, int sx1,
+                           int sy1, int sx2, int sy2,
+                           boolean xDirection) {
+        if (dx2 - dx1 <= 0 || dy2 - dy1 <= 0 || sx2 - sx1 <= 0 ||
+                              sy2 - sy1 <= 0) {
+            // Bogus location, nothing to paint
+            return;
+        }
+        if (stretch) {
+            g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
+        }
+        else {
+            int xSize = sx2 - sx1;
+            int ySize = sy2 - sy1;
+            int deltaX;
+            int deltaY;
+
+            if (xDirection) {
+                deltaX = xSize;
+                deltaY = 0;
+            }
+            else {
+                deltaX = 0;
+                deltaY = ySize;
+            }
+            while (dx1 < dx2 && dy1 < dy2) {
+                int newDX2 = Math.min(dx2, dx1 + xSize);
+                int newDY2 = Math.min(dy2, dy1 + ySize);
+
+                g.drawImage(image, dx1, dy1, newDX2, newDY2,
+                            sx1, sy1, sx1 + newDX2 - dx1,
+                            sy1 + newDY2 - dy1, null);
+                dx1 += deltaX;
+                dy1 += deltaY;
+            }
+        }
+    }
+
+    private static void drawImage(Image image, Graphics g,
+                           int dx1, int dy1, int dx2, int dy2, int sx1,
+                           int sy1, int sx2, int sy2) {
+        // PENDING: is this necessary, will G2D do it for me?
+        if (dx2 - dx1 <= 0 || dy2 - dy1 <= 0 || sx2 - sx1 <= 0 ||
+                sy2 - sy1 <= 0) {
+            // Bogus location, nothing to paint
+            return;
+        }
+        g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
+    }
+
+
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerGlowEffect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerGlowEffect.java
new file mode 100644
index 0000000..3847c9f
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerGlowEffect.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.Color;
+
+/**
+ * InnerGlowEffect
+ *
+ * @author Created by Jasper Potts (Jun 21, 2007)
+ */
+class InnerGlowEffect extends InnerShadowEffect {
+    InnerGlowEffect() {
+        distance = 0;
+        color = new Color(255, 255, 211);
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java
new file mode 100644
index 0000000..c578c1e
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Arrays;
+
+/**
+ * InnerShadowEffect - This effect currently only works with ARGB type buffered
+ * images.
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+class InnerShadowEffect extends ShadowEffect {
+
+    // =================================================================================================================
+    // Effect Methods
+
+    /**
+     * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted
+     * under the src image. BLENDED means the result of apply sffect contains a modified src image so just it should be
+     * painted. OVER means the result of apply effect should be painted over the src image.
+     *
+     * @return The effect type
+     */
+    Effect.EffectType getEffectType() {
+        return Effect.EffectType.OVER;
+    }
+
+    /**
+     * Apply the effect to the src image generating the result . The result image may or may not contain the source
+     * image depending on what the effect type is.
+     *
+     * @param src The source image for applying the effect to
+     * @param dst The dstination image to paint effect result into. If this is null then a new image will be created
+     * @param w   The width of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @param h   The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than
+     *            the area the need effect applied to it
+     * @return Image with the result of the effect
+     */
+    BufferedImage applyEffect(BufferedImage src, BufferedImage dst, int w, int h) {
+        if (src == null || src.getType() != BufferedImage.TYPE_INT_ARGB){
+            throw new IllegalArgumentException("Effect only works with " +
+                    "source images of type BufferedImage.TYPE_INT_ARGB.");
+        }
+        if (dst != null && dst.getType() != BufferedImage.TYPE_INT_ARGB){
+            throw new IllegalArgumentException("Effect only works with " +
+                    "destination images of type BufferedImage.TYPE_INT_ARGB.");
+        }
+        // calculate offset
+        double trangleAngle = Math.toRadians(angle - 90);
+        int offsetX = (int) (Math.sin(trangleAngle) * distance);
+        int offsetY = (int) (Math.cos(trangleAngle) * distance);
+        // clac expanded size
+        int tmpOffX = offsetX + size;
+        int tmpOffY = offsetX + size;
+        int tmpW = w + offsetX + size + size;
+        int tmpH = h + offsetX + size;
+        // create tmp buffers
+        int[] lineBuf = getArrayCache().getTmpIntArray(w);
+        byte[] srcAlphaBuf = getArrayCache().getTmpByteArray1(tmpW * tmpH);
+        Arrays.fill(srcAlphaBuf, (byte) 0xFF);
+        byte[] tmpBuf1 = getArrayCache().getTmpByteArray2(tmpW * tmpH);
+        byte[] tmpBuf2 = getArrayCache().getTmpByteArray3(tmpW * tmpH);
+        // extract src image alpha channel and inverse and offset
+        Raster srcRaster = src.getRaster();
+        for (int y = 0; y < h; y++) {
+            int dy = (y + tmpOffY);
+            int offset = dy * tmpW;
+            srcRaster.getDataElements(0, y, w, 1, lineBuf);
+            for (int x = 0; x < w; x++) {
+                int dx = x + tmpOffX;
+                srcAlphaBuf[offset + dx] = (byte) ((255 - ((lineBuf[x] & 0xFF000000) >>> 24)) & 0xFF);
+            }
+        }
+        // blur
+        float[] kernel = EffectUtils.createGaussianKernel(size * 2);
+        EffectUtils.blur(srcAlphaBuf, tmpBuf2, tmpW, tmpH, kernel, size * 2); // horizontal pass
+        EffectUtils.blur(tmpBuf2, tmpBuf1, tmpH, tmpW, kernel, size * 2);// vertical pass
+        //rescale
+        float spread = Math.min(1 / (1 - (0.01f * this.spread)), 255);
+        for (int i = 0; i < tmpBuf1.length; i++) {
+            int val = (int) (((int) tmpBuf1[i] & 0xFF) * spread);
+            tmpBuf1[i] = (val > 255) ? (byte) 0xFF : (byte) val;
+        }
+        // create color image with shadow color and greyscale image as alpha
+        if (dst == null) dst = new BufferedImage(w, h,
+                BufferedImage.TYPE_INT_ARGB);
+        WritableRaster shadowRaster = dst.getRaster();
+        int red = color.getRed(), green = color.getGreen(), blue = color.getBlue();
+        for (int y = 0; y < h; y++) {
+            int srcY = y + tmpOffY;
+            int offset = srcY * tmpW;
+            int shadowOffset = (srcY - offsetY) * tmpW;
+            for (int x = 0; x < w; x++) {
+                int srcX = x + tmpOffX;
+                int origianlAlphaVal = 255 - ((int) srcAlphaBuf[offset + srcX] & 0xFF);
+                int shadowVal = (int) tmpBuf1[shadowOffset + (srcX - offsetX)] & 0xFF;
+                int alphaVal = Math.min(origianlAlphaVal, shadowVal);
+                lineBuf[x] = ((byte) alphaVal & 0xFF) << 24 | red << 16 | green << 8 | blue;
+            }
+            shadowRaster.setDataElements(0, y, w, 1, lineBuf);
+        }
+        return dst;
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java
new file mode 100644
index 0000000..99bc834
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import javax.swing.border.Border;
+import javax.swing.JComponent;
+import javax.swing.plaf.UIResource;
+import java.awt.Insets;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Color;
+import java.awt.Transparency;
+import java.awt.RenderingHints;
+import java.awt.Dimension;
+import java.awt.image.BufferedImage;
+
+/**
+ * LoweredBorder - A recessed rounded inner shadowed border. Used as the
+ * standard Nimbus TitledBorder. This class is both a painter and a swing
+ * border.
+ *
+ * @author Jasper Potts
+ */
+class LoweredBorder extends AbstractRegionPainter implements Border {
+    private static final int IMG_SIZE = 30;
+    private static final int RADIUS = 13;
+    private static final Insets INSETS = new Insets(10,10,10,10);
+    private static final PaintContext PAINT_CONTEXT = new PaintContext(INSETS,
+            new Dimension(IMG_SIZE,IMG_SIZE),false,
+            PaintContext.CacheMode.NINE_SQUARE_SCALE,
+            Integer.MAX_VALUE, Integer.MAX_VALUE);
+
+    // =========================================================================
+    // Painter Methods
+
+    @Override
+    protected Object[] getExtendedCacheKeys(JComponent c) {
+        return new Object[] {c.getBackground()};
+    }
+
+    /**
+     * Actually performs the painting operation. Subclasses must implement this
+     * method. The graphics object passed may represent the actual surface being
+     * rendererd to, or it may be an intermediate buffer. It has also been
+     * pre-translated. Simply render the component as if it were located at 0, 0
+     * and had a width of <code>width</code> and a height of
+     * <code>height</code>. For performance reasons, you may want to read the
+     * clip from the Graphics2D object and only render within that space.
+     *
+     * @param g      The Graphics2D surface to paint to
+     * @param c      The JComponent related to the drawing event. For example,
+     *               if the region being rendered is Button, then <code>c</code>
+     *               will be a JButton. If the region being drawn is
+     *               ScrollBarSlider, then the component will be JScrollBar.
+     *               This value may be null.
+     * @param width  The width of the region to paint. Note that in the case of
+     *               painting the foreground, this value may differ from
+     *               c.getWidth().
+     * @param height The height of the region to paint. Note that in the case of
+     *               painting the foreground, this value may differ from
+     *               c.getHeight().
+     */
+    protected void doPaint(Graphics2D g, JComponent c, int width, int height,
+            Object[] extendedCacheKeys) {
+        BufferedImage img1 = new BufferedImage(IMG_SIZE,IMG_SIZE,
+                    BufferedImage.TYPE_INT_ARGB);
+        BufferedImage img2 = new BufferedImage(IMG_SIZE,IMG_SIZE,
+                    BufferedImage.TYPE_INT_ARGB);
+        // draw shadow shape
+        Graphics2D g2 = (Graphics2D)img1.getGraphics();
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+        g2.setColor(c.getBackground());
+        g2.fillRoundRect(2,0,26,26,RADIUS,RADIUS);
+        g2.dispose();
+        // draw shadow
+        InnerShadowEffect effect = new InnerShadowEffect();
+        effect.setDistance(1);
+        effect.setSize(3);
+        effect.setColor(getLighter(c.getBackground(),2.1f));
+        effect.setAngle(90);
+        effect.applyEffect(img1,img2,IMG_SIZE,IMG_SIZE);
+        // draw outline to img2
+        g2 = (Graphics2D)img2.getGraphics();
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+        g2.setClip(0,28,IMG_SIZE,1);
+        g2.setColor(getLighter(c.getBackground(),0.90f));
+        g2.drawRoundRect(2,1,25,25,RADIUS,RADIUS);
+        g2.dispose();
+        // draw final image
+        if (width != IMG_SIZE || height != IMG_SIZE){
+            ImageScalingHelper.paint(g,0,0,width,height,img2, INSETS, INSETS,
+                    ImageScalingHelper.PaintType.PAINT9_STRETCH,
+                    ImageScalingHelper.PAINT_ALL);
+        } else {
+            g.drawImage(img2,0,0,c);
+        }
+        img1 = null;
+        img2 = null;
+    }
+
+    /**
+     * <p>Gets the PaintContext for this painting operation. This method is
+     * called on every paint, and so should be fast and produce no garbage. The
+     * PaintContext contains information such as cache hints. It also contains
+     * data necessary for decoding points at runtime, such as the stretching
+     * insets, the canvas size at which the encoded points were defined, and
+     * whether the stretching insets are inverted.</p>
+     * <p/>
+     * <p> This method allows for subclasses to package the painting of
+     * different states with possibly different canvas sizes, etc, into one
+     * AbstractRegionPainter implementation.</p>
+     *
+     * @return a PaintContext associated with this paint operation.
+     */
+    protected PaintContext getPaintContext() {
+        return PAINT_CONTEXT;
+    }
+
+    // =========================================================================
+    // Border Methods
+
+    /**
+     * Returns the insets of the border.
+     *
+     * @param c the component for which this border insets value applies
+     */
+    public Insets getBorderInsets(Component c) {
+        return INSETS;
+    }
+
+    /**
+     * Returns whether or not the border is opaque.  If the border is opaque, it
+     * is responsible for filling in it's own background when painting.
+     */
+    public boolean isBorderOpaque() {
+        return false;
+    }
+
+    /**
+     * Paints the border for the specified component with the specified position
+     * and size.
+     *
+     * @param c      the component for which this border is being painted
+     * @param g      the paint graphics
+     * @param x      the x position of the painted border
+     * @param y      the y position of the painted border
+     * @param width  the width of the painted border
+     * @param height the height of the painted border
+     */
+    public void paintBorder(Component c, Graphics g, int x, int y, int width,
+                            int height) {
+        JComponent comp = (c instanceof JComponent)?(JComponent)c:null;
+        if (g instanceof Graphics2D){
+            Graphics2D g2 = (Graphics2D)g;
+            g2.translate(x,y);
+            paint(g2,comp, width, height);
+            g2.translate(-x,-y);
+        } else {
+            BufferedImage img =  new BufferedImage(IMG_SIZE,IMG_SIZE,
+                    BufferedImage.TYPE_INT_ARGB);
+            Graphics2D g2 = (Graphics2D)img.getGraphics();
+            paint(g2,comp, width, height);
+            g2.dispose();
+            ImageScalingHelper.paint(g,x,y,width,height,img,INSETS, INSETS,
+                    ImageScalingHelper.PaintType.PAINT9_STRETCH,
+                    ImageScalingHelper.PAINT_ALL);
+        }
+    }
+
+    private Color getLighter(Color c, float factor){
+        return new Color(Math.min((int)(c.getRed()/factor), 255),
+                         Math.min((int)(c.getGreen()/factor), 255),
+                         Math.min((int)(c.getBlue()/factor), 255));
+    }
+}
+
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java
new file mode 100644
index 0000000..921ca0e
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import javax.swing.Painter;
+import sun.swing.plaf.synth.SynthIcon;
+
+import javax.swing.plaf.synth.SynthContext;
+import javax.swing.*;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import javax.swing.plaf.UIResource;
+
+/**
+ * An icon that delegates to a painter.
+ * @author rbair
+ */
+class NimbusIcon extends SynthIcon {
+    private int width;
+    private int height;
+    private String prefix;
+    private String key;
+
+    NimbusIcon(String prefix, String key, int w, int h) {
+        this.width = w;
+        this.height = h;
+        this.prefix = prefix;
+        this.key = key;
+    }
+
+    @Override
+    public void paintIcon(SynthContext context, Graphics g, int x, int y,
+                          int w, int h) {
+        Painter painter = null;
+        if (context != null) {
+            painter = (Painter)context.getStyle().get(context, key);
+        }
+        if (painter == null){
+            painter = (Painter) UIManager.get(prefix + "[Enabled]." + key);
+        }
+
+        if (painter != null && context != null) {
+            JComponent c = context.getComponent();
+            boolean rotate = false;
+            boolean flip = false;
+            //translatex and translatey are additional translations that
+            //must occur on the graphics context when rendering a toolbar
+            //icon
+            int translatex = 0;
+            int translatey = 0;
+            if (c instanceof JToolBar) {
+                JToolBar toolbar = (JToolBar)c;
+                rotate = toolbar.getOrientation() == JToolBar.VERTICAL;
+                flip = !toolbar.getComponentOrientation().isLeftToRight();
+                Object o = NimbusLookAndFeel.resolveToolbarConstraint(toolbar);
+                //we only do the +1 hack for UIResource borders, assuming
+                //that the border is probably going to be our border
+                if (toolbar.getBorder() instanceof UIResource) {
+                    if (o == BorderLayout.SOUTH) {
+                        translatey = 1;
+                    } else if (o == BorderLayout.EAST) {
+                        translatex = 1;
+                    }
+                }
+            }
+            if (g instanceof Graphics2D){
+                Graphics2D gfx = (Graphics2D)g;
+                gfx.translate(x, y);
+                gfx.translate(translatex, translatey);
+                if (rotate) {
+                    gfx.rotate(Math.toRadians(90));
+                    gfx.translate(0, -w);
+                    painter.paint(gfx, context.getComponent(), h, w);
+                    gfx.translate(0, w);
+                    gfx.rotate(Math.toRadians(-90));
+                } else if (flip){
+                    gfx.scale(-1, 1);
+                    gfx.translate(-w,0);
+                    painter.paint(gfx, context.getComponent(), w, h);
+                    gfx.translate(w,0);
+                    gfx.scale(-1, 1);
+                } else {
+                    painter.paint(gfx, context.getComponent(), w, h);
+                }
+                gfx.translate(-translatex, -translatey);
+                gfx.translate(-x, -y);
+            } else {
+                // use image if we are printing to a Java 1.1 PrintGraphics as
+                // it is not a instance of Graphics2D
+                BufferedImage img = new BufferedImage(w,h,
+                        BufferedImage.TYPE_INT_ARGB);
+                Graphics2D gfx = img.createGraphics();
+                if (rotate) {
+                    gfx.rotate(Math.toRadians(90));
+                    gfx.translate(0, -w);
+                    painter.paint(gfx, context.getComponent(), h, w);
+                } else if (flip){
+                    gfx.scale(-1, 1);
+                    gfx.translate(-w,0);
+                    painter.paint(gfx, context.getComponent(), w, h);
+                } else {
+                    painter.paint(gfx, context.getComponent(), w, h);
+                }
+                gfx.dispose();
+                g.drawImage(img,x,y,null);
+                img = null;
+            }
+        }
+    }
+
+    /**
+     * Implements the standard Icon interface's paintIcon method as the standard
+     * synth stub passes null for the context and this will cause us to not
+     * paint any thing, so we override here so that we can paint the enabled
+     * state if no synth context is available
+     */
+    @Override
+    public void paintIcon(Component c, Graphics g, int x, int y) {
+        Painter painter = (Painter)UIManager.get(prefix + "[Enabled]." + key);
+        if (painter != null){
+            JComponent jc = (c instanceof JComponent) ? (JComponent)c : null;
+            Graphics2D gfx = (Graphics2D)g;
+            gfx.translate(x, y);
+            painter.paint(gfx, jc , width, height);
+            gfx.translate(-x, -y);
+        }
+    }
+
+    @Override
+    public int getIconWidth(SynthContext context) {
+        if (context == null) {
+            return width;
+        }
+        JComponent c = context.getComponent();
+        if (c instanceof JToolBar && ((JToolBar)c).getOrientation() == JToolBar.VERTICAL) {
+            //we only do the -1 hack for UIResource borders, assuming
+            //that the border is probably going to be our border
+            if (c.getBorder() instanceof UIResource) {
+                return c.getWidth() - 1;
+            } else {
+                return c.getWidth();
+            }
+        } else {
+            return scale(context, width);
+        }
+    }
+
+    @Override
+    public int getIconHeight(SynthContext context) {
+        if (context == null) {
+            return height;
+        }
+        JComponent c = context.getComponent();
+        if (c instanceof JToolBar){
+            JToolBar toolbar = (JToolBar)c;
+            if (toolbar.getOrientation() == JToolBar.HORIZONTAL) {
+                //we only do the -1 hack for UIResource borders, assuming
+                //that the border is probably going to be our border
+                if (toolbar.getBorder() instanceof UIResource) {
+                    return c.getHeight() - 1;
+                } else {
+                    return c.getHeight();
+                }
+            } else {
+                return scale(context, width);
+            }
+        } else {
+            return scale(context, height);
+        }
+    }
+
+    /**
+     * Scale a size based on the "JComponent.sizeVariant" client property of the
+     * component that is using this icon
+     *
+     * @param context The synthContext to get the component from
+     * @param size The size to scale
+     * @return The scaled size or original if "JComponent.sizeVariant" is not
+     *          set
+     */
+    private int scale(SynthContext context, int size) {
+        if (context == null || context.getComponent() == null){
+            return size;
+        }
+        // The key "JComponent.sizeVariant" is used to match Apple's LAF
+        String scaleKey = (String) context.getComponent().getClientProperty(
+                "JComponent.sizeVariant");
+        if (scaleKey != null) {
+            if (NimbusStyle.LARGE_KEY.equals(scaleKey)) {
+                size *= NimbusStyle.LARGE_SCALE;
+            } else if (NimbusStyle.SMALL_KEY.equals(scaleKey)) {
+                size *= NimbusStyle.SMALL_SCALE;
+            } else if (NimbusStyle.MINI_KEY.equals(scaleKey)) {
+                // mini is not quite as small for icons as full mini is
+                // just too tiny
+                size *= NimbusStyle.MINI_SCALE + 0.07;
+            }
+        }
+        return size;
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java
new file mode 100644
index 0000000..eae031b
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java
@@ -0,0 +1,520 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.BorderLayout;
+import static java.awt.BorderLayout.*;
+import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.synth.Region;
+import javax.swing.plaf.synth.SynthLookAndFeel;
+import javax.swing.plaf.synth.SynthStyle;
+import javax.swing.plaf.synth.SynthStyleFactory;
+import javax.swing.plaf.UIResource;
+import java.security.AccessController;
+import java.awt.Color;
+import java.awt.Container;
+import java.awt.Graphics2D;
+import java.awt.LayoutManager;
+import java.awt.image.BufferedImage;
+import javax.swing.GrayFilter;
+import javax.swing.Icon;
+import javax.swing.JToolBar;
+import javax.swing.border.TitledBorder;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.ColorUIResource;
+import sun.swing.ImageIconUIResource;
+import sun.swing.plaf.synth.SynthIcon;
+import sun.swing.plaf.GTKKeybindings;
+import sun.swing.plaf.WindowsKeybindings;
+import sun.security.action.GetPropertyAction;
+
+/**
+ * <p>The NimbusLookAndFeel class.</p>
+ *
+ * @author Jasper Potts
+ * @author Richard Bair
+ */
+public class NimbusLookAndFeel extends SynthLookAndFeel {
+
+    /** Set of standard region names for UIDefaults Keys */
+    private static final String[] COMPONENT_KEYS = new String[]{"ArrowButton", "Button",
+                    "CheckBox", "CheckBoxMenuItem", "ColorChooser", "ComboBox",
+                    "DesktopPane", "DesktopIcon", "EditorPane", "FileChooser",
+                    "FormattedTextField", "InternalFrame",
+                    "InternalFrameTitlePane", "Label", "List", "Menu",
+                    "MenuBar", "MenuItem", "OptionPane", "Panel",
+                    "PasswordField", "PopupMenu", "PopupMenuSeparator",
+                    "ProgressBar", "RadioButton", "RadioButtonMenuItem",
+                    "RootPane", "ScrollBar", "ScrollBarTrack", "ScrollBarThumb",
+                    "ScrollPane", "Separator", "Slider", "SliderTrack",
+                    "SliderThumb", "Spinner", "SplitPane", "TabbedPane",
+                    "Table", "TableHeader", "TextArea", "TextField", "TextPane",
+                    "ToggleButton", "ToolBar", "ToolTip", "Tree", "Viewport"};
+
+    /**
+     * A reference to the auto-generated file NimbusDefaults. This file contains
+     * the default mappings and values for the look and feel as specified in the
+     * visual designer.
+     */
+    private NimbusDefaults defaults;
+
+    /**
+     * Reference to populated LAD uidefaults
+     */
+    private UIDefaults uiDefaults;
+
+    /**
+     * Create a new NimbusLookAndFeel.
+     */
+    public NimbusLookAndFeel() {
+        super();
+        defaults = new NimbusDefaults();
+    }
+
+    /** Called by UIManager when this look and feel is installed. */
+    @Override public void initialize() {
+        super.initialize();
+        defaults.initialize();
+        // create synth style factory
+        setStyleFactory(new SynthStyleFactory() {
+            @Override
+            public SynthStyle getStyle(JComponent c, Region r) {
+                return defaults.getStyle(c, r);
+            }
+        });
+    }
+
+
+    /** Called by UIManager when this look and feel is uninstalled. */
+    @Override public void uninitialize() {
+        super.uninitialize();
+        defaults.uninitialize();
+        // clear all cached images to free memory
+        ImageCache.getInstance().flush();
+        // remove the listeners and things installed by NimbusStyle
+        NimbusStyle.uninitialize();
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public UIDefaults getDefaults() {
+        if (uiDefaults == null){
+            // Detect platform
+            String osName = getSystemProperty("os.name");
+            boolean isWindows = osName != null && osName.contains("Windows");
+
+            // We need to call super for basic's properties file.
+            uiDefaults = super.getDefaults();
+            defaults.initializeDefaults(uiDefaults);
+
+            // Install Keybindings
+            if (isWindows) {
+                WindowsKeybindings.installKeybindings(uiDefaults);
+            } else {
+                GTKKeybindings.installKeybindings(uiDefaults);
+            }
+
+            // Add Titled Border
+            uiDefaults.put("TitledBorder.titlePosition",
+                    TitledBorder.ABOVE_TOP);
+            uiDefaults.put("TitledBorder.border", new BorderUIResource(
+                    new LoweredBorder()));
+            uiDefaults.put("TitledBorder.titleColor",
+                    getDerivedColor("text",0.0f,0.0f,0.23f,0,true));
+            uiDefaults.put("TitledBorder.font",
+                    new NimbusDefaults.DerivedFont("defaultFont",
+                            1f, true, null));
+
+            // Choose Dialog button positions
+            uiDefaults.put("OptionPane.isYesLast", !isWindows);
+
+            // Store Table ScrollPane Corner Component
+            uiDefaults.put("Table.scrollPaneCornerComponent",
+                    TableScrollPaneCorner.class);
+
+            // Setup the settings for ToolBarSeparator which is custom
+            // installed for Nimbus
+            uiDefaults.put("ToolBarSeparator[Enabled].backgroundPainter",
+                    new ToolBarSeparatorPainter());
+
+            // Populate UIDefaults with a standard set of properties
+            for (String componentKey : COMPONENT_KEYS) {
+                String key = componentKey+".foreground";
+                if (!uiDefaults.containsKey(key)){
+                    uiDefaults.put(key,
+                            new NimbusProperty(componentKey,"textForeground"));
+                }
+                key = componentKey+".background";
+                if (!uiDefaults.containsKey(key)){
+                    uiDefaults.put(key,
+                            new NimbusProperty(componentKey,"background"));
+                }
+                key = componentKey+".font";
+                if (!uiDefaults.containsKey(key)){
+                    uiDefaults.put(key,
+                            new NimbusProperty(componentKey,"font"));
+                }
+                key = componentKey+".disabledText";
+                if (!uiDefaults.containsKey(key)){
+                    uiDefaults.put(key,
+                            new NimbusProperty(componentKey,"Disabled",
+                                   "textForeground"));
+                }
+                key = componentKey+".disabled";
+                if (!uiDefaults.containsKey(key)){
+                    uiDefaults.put(key,
+                            new NimbusProperty(componentKey,"Disabled",
+                                    "background"));
+                }
+            }
+
+            // FileView icon keys are used by some applications, we don't have
+            // a computer icon at the moment so using home icon for now
+            uiDefaults.put("FileView.computerIcon",
+                    new LinkProperty("FileChooser.homeFolderIcon"));
+            uiDefaults.put("FileView.directoryIcon",
+                    new LinkProperty("FileChooser.directoryIcon"));
+            uiDefaults.put("FileView.fileIcon",
+                    new LinkProperty("FileChooser.fileIcon"));
+            uiDefaults.put("FileView.floppyDriveIcon",
+                    new LinkProperty("FileChooser.floppyDriveIcon"));
+            uiDefaults.put("FileView.hardDriveIcon",
+                    new LinkProperty("FileChooser.hardDriveIcon"));
+        }
+        return uiDefaults;
+    }
+
+    /**
+     * Gets the style associated with the given component and region. This
+     * will never return null. If an appropriate component and region cannot
+     * be determined, then a default style is returned.
+     *
+     * @param c a non-null reference to a JComponent
+     * @param r a non-null reference to the region of the component c
+     * @return a non-null reference to a NimbusStyle.
+     */
+    public static NimbusStyle getStyle(JComponent c, Region r) {
+        return (NimbusStyle)SynthLookAndFeel.getStyle(c, r);
+    }
+
+    /**
+     * Return a short string that identifies this look and feel. This
+     * String will be the unquoted String "Nimbus".
+     *
+     * @return a short string identifying this look and feel.
+     */
+    @Override public String getName() {
+        return "Nimbus";
+    }
+
+    /**
+     * Return a string that identifies this look and feel. This String will
+     * be the unquoted String "Nimbus".
+     *
+     * @return a short string identifying this look and feel.
+     */
+    @Override public String getID() {
+        return "Nimbus";
+    }
+
+    /**
+     * Returns a textual description of this look and feel.
+     *
+     * @return textual description of this look and feel.
+     */
+    @Override public String getDescription() {
+        return "Nimbus Look and Feel";
+    }
+
+    /**
+     * @inheritDoc
+     * @return true
+     */
+    @Override public boolean shouldUpdateStyleOnAncestorChanged() {
+        return true;
+    }
+
+    /**
+     * <p>Registers a third party component with the NimbusLookAndFeel.</p>
+     *
+     * <p>Regions represent Components and areas within Components that act as
+     * independent painting areas. Once registered with the NimbusLookAndFeel,
+     * NimbusStyles for these Regions can be retrieved via the
+     * <code>getStyle</code> method.</p>
+     *
+     * <p>The NimbusLookAndFeel uses a standard naming scheme for entries in the
+     * UIDefaults table. The key for each property, state, painter, and other
+     * default registered in UIDefaults for a specific Region will begin with
+     * the specified <code>prefix</code></p>
+     *
+     * <p>For example, suppose I had a component named JFoo. Suppose I then registered
+     * this component with the NimbusLookAndFeel in this manner:</p>
+     *
+     * <pre><code>
+     *     laf.register(NimbusFooUI.FOO_REGION, "Foo");
+     * </code></pre>
+     *
+     * <p>In this case, I could then register properties for this component with
+     * UIDefaults in the following manner:</p>
+     *
+     * <pre><code>
+     *     UIManager.put("Foo.background", new ColorUIResource(Color.BLACK));
+     *     UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter());
+     * </code></pre>
+     *
+     * <p>It is also possible to register a named component with Nimbus.
+     * For example, suppose you wanted to style the background of a JPanel
+     * named "MyPanel" differently from other JPanels. You could accomplish this
+     * by doing the following:</p>
+     *
+     * <pre><code>
+     *     laf.register(Region.PANEL, "\"MyPanel\"");
+     *     UIManager.put("\"MyPanel\".background", new ColorUIResource(Color.RED));
+     * </code></pre>
+     *
+     * @param region The Synth Region that is being registered. Such as Button, or
+     *        ScrollBarThumb, or NimbusFooUI.FOO_REGION.
+     * @param prefix The UIDefault prefix. For example, could be ComboBox, or if
+     *        a named components, "MyComboBox", or even something like
+     *        ToolBar."MyComboBox"."ComboBox.arrowButton"
+     */
+    public void register(Region region, String prefix) {
+        defaults.register(region, prefix);
+    }
+
+    /**
+     * Simple utility method that reads system keys.
+     */
+    private String getSystemProperty(String key) {
+        return AccessController.doPrivileged(new GetPropertyAction(key));
+    }
+
+    @Override
+    public Icon getDisabledIcon(JComponent component, Icon icon) {
+        if (icon instanceof SynthIcon) {
+            SynthIcon si = (SynthIcon)icon;
+            BufferedImage img = EffectUtils.createCompatibleTranslucentImage(
+                    si.getIconWidth(), si.getIconHeight());
+            Graphics2D gfx = img.createGraphics();
+            si.paintIcon(component, gfx, 0, 0);
+            gfx.dispose();
+            return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
+        } else {
+            return super.getDisabledIcon(component, icon);
+        }
+    }
+
+    /**
+     * Get a derived color, derived colors are shared instances and is color
+     * value will change when its parent UIDefault color changes.
+     *
+     * @param uiDefaultParentName The parent UIDefault key
+     * @param hOffset             The hue offset
+     * @param sOffset             The saturation offset
+     * @param bOffset             The brightness offset
+     * @param aOffset             The alpha offset
+     * @param uiResource          True if the derived color should be a
+     *                            UIResource, false if it should not be
+     * @return The stored derived color
+     */
+    public Color getDerivedColor(String uiDefaultParentName,
+                                 float hOffset, float sOffset,
+                                 float bOffset, int aOffset,
+                                 boolean uiResource) {
+        return defaults.getDerivedColor(uiDefaultParentName, hOffset, sOffset,
+                bOffset, aOffset, uiResource);
+    }
+
+    /**
+     * Decodes and returns a color, which is derived from an offset between two
+     * other colors.
+     *
+     * @param color1   The first color
+     * @param color2   The second color
+     * @param midPoint The offset between color 1 and color 2, a value of 0.0 is
+     *                 color 1 and 1.0 is color 2;
+     * @param uiResource True if the derived color should be a UIResource
+     * @return The derived color
+     */
+    protected final Color getDerivedColor(Color color1, Color color2,
+                                      float midPoint, boolean uiResource) {
+        int argb = deriveARGB(color1, color2, midPoint);
+        if (uiResource) {
+            return new ColorUIResource(argb);
+        } else {
+            return new Color(argb);
+        }
+    }
+
+    /**
+     * Decodes and returns a color, which is derived from a offset between two
+     * other colors.
+     *
+     * @param color1   The first color
+     * @param color2   The second color
+     * @param midPoint The offset between color 1 and color 2, a value of 0.0 is
+     *                 color 1 and 1.0 is color 2;
+     * @return The derived color, which will be a UIResource
+     */
+    protected final Color getDerivedColor(Color color1, Color color2,
+                                      float midPoint) {
+        return getDerivedColor(color1, color2, midPoint, true);
+    }
+
+    /**
+     * Package private method which returns either BorderLayout.NORTH,
+     * BorderLayout.SOUTH, BorderLayout.EAST, or BorderLayout.WEST depending
+     * on the location of the toolbar in its parent. The toolbar might be
+     * in PAGE_START, PAGE_END, CENTER, or some other position, but will be
+     * resolved to either NORTH,SOUTH,EAST, or WEST based on where the toolbar
+     * actually IS, with CENTER being NORTH.
+     *
+     * This code is used to determine where the border line should be drawn
+     * by the custom toolbar states, and also used by NimbusIcon to determine
+     * whether the handle icon needs to be shifted to look correct.
+     *
+     * Toollbars are unfortunately odd in the way these things are handled,
+     * and so this code exists to unify the logic related to toolbars so it can
+     * be shared among the static files such as NimbusIcon and generated files
+     * such as the ToolBar state classes.
+     */
+    static Object resolveToolbarConstraint(JToolBar toolbar) {
+        //NOTE: we don't worry about component orientation or PAGE_END etc
+        //because the BasicToolBarUI always uses an absolute position of
+        //NORTH/SOUTH/EAST/WEST.
+        if (toolbar != null) {
+            Container parent = toolbar.getParent();
+            if (parent != null) {
+                LayoutManager m = parent.getLayout();
+                if (m instanceof BorderLayout) {
+                    BorderLayout b = (BorderLayout)m;
+                    Object con = b.getConstraints(toolbar);
+                    if (con == SOUTH || con == EAST || con == WEST) {
+                        return con;
+                    }
+                    return NORTH;
+                }
+            }
+        }
+        return NORTH;
+    }
+
+    /**
+     * Derives the ARGB value for a color based on an offset between two
+     * other colors.
+     *
+     * @param color1   The first color
+     * @param color2   The second color
+     * @param midPoint The offset between color 1 and color 2, a value of 0.0 is
+     *                 color 1 and 1.0 is color 2;
+     * @return the ARGB value for a new color based on this derivation
+     */
+    static int deriveARGB(Color color1, Color color2, float midPoint) {
+        int r = color1.getRed() +
+                (int) ((color2.getRed() - color1.getRed()) * midPoint + 0.5f);
+        int g = color1.getGreen() +
+                (int) ((color2.getGreen() - color1.getGreen()) * midPoint +
+                        0.5f);
+        int b = color1.getBlue() +
+                (int) ((color2.getBlue() - color1.getBlue()) * midPoint + 0.5f);
+        int a = color1.getAlpha() +
+                (int) ((color2.getAlpha() - color1.getAlpha()) * midPoint +
+                        0.5f);
+        return ((a & 0xFF) << 24) |
+                ((r & 0xFF) << 16) |
+                ((g & 0xFF) << 8) |
+                (b & 0xFF);
+    }
+
+    /**
+     * Simple Symbolic Link style UIDefalts Property
+     */
+    private class LinkProperty implements UIDefaults.ActiveValue, UIResource{
+        private String dstPropName;
+
+        private LinkProperty(String dstPropName) {
+            this.dstPropName = dstPropName;
+        }
+
+        @Override
+        public Object createValue(UIDefaults table) {
+            return UIManager.get(dstPropName);
+        }
+    }
+
+    /**
+     * Nimbus Property that looks up Nimbus keys for standard key names. For
+     * example "Button.background" --> "Button[Enabled].backgound"
+     */
+    private class NimbusProperty implements UIDefaults.ActiveValue, UIResource {
+        private String prefix;
+        private String state = null;
+        private String suffix;
+        private boolean isFont;
+
+        private NimbusProperty(String prefix, String suffix) {
+            this.prefix = prefix;
+            this.suffix = suffix;
+            isFont = "font".equals(suffix);
+        }
+
+        private NimbusProperty(String prefix, String state, String suffix) {
+            this(prefix,suffix);
+            this.state = state;
+        }
+
+        /**
+         * Creates the value retrieved from the <code>UIDefaults</code> table.
+         * The object is created each time it is accessed.
+         *
+         * @param table a <code>UIDefaults</code> table
+         * @return the created <code>Object</code>
+         */
+        @Override
+        public Object createValue(UIDefaults table) {
+            Object obj = null;
+            // check specified state
+            if (state!=null){
+                obj = uiDefaults.get(prefix+"["+state+"]."+suffix);
+            }
+            // check enabled state
+            if (obj==null){
+                obj = uiDefaults.get(prefix+"[Enabled]."+suffix);
+            }
+            // check for defaults
+            if (obj==null){
+                if (isFont) {
+                    obj = uiDefaults.get("defaultFont");
+                } else {
+                    obj = uiDefaults.get(suffix);
+                }
+            }
+            return obj;
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java
new file mode 100644
index 0000000..04efc91
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java
@@ -0,0 +1,1259 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import javax.swing.Painter;
+
+import java.beans.PropertyChangeEvent;
+import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.synth.ColorType;
+import static javax.swing.plaf.synth.SynthConstants.*;
+import javax.swing.plaf.synth.SynthContext;
+import javax.swing.plaf.synth.SynthPainter;
+import javax.swing.plaf.synth.SynthStyle;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Insets;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import sun.awt.AppContext;
+
+/**
+ * <p>A SynthStyle implementation used by Nimbus. Each Region that has been
+ * registered with the NimbusLookAndFeel will have an associated NimbusStyle.
+ * Third party components that are registered with the NimbusLookAndFeel will
+ * therefore be handed a NimbusStyle from the look and feel from the
+ * #getStyle(JComponent, Region) method.</p>
+ *
+ * <p>This class properly reads and retrieves values placed in the UIDefaults
+ * according to the standard Nimbus naming conventions. It will create and
+ * retrieve painters, fonts, colors, and other data stored there.</p>
+ *
+ * <p>NimbusStyle also supports the ability to override settings on a per
+ * component basis. NimbusStyle checks the component's client property map for
+ * "Nimbus.Overrides". If the value associated with this key is an instance of
+ * UIDefaults, then the values in that defaults table will override the standard
+ * Nimbus defaults in UIManager, but for that component instance only.</p>
+ *
+ * <p>Optionally, you may specify the client property
+ * "Nimbus.Overrides.InheritDefaults". If true, this client property indicates
+ * that the defaults located in UIManager should first be read, and then
+ * replaced with defaults located in the component client properties. If false,
+ * then only the defaults located in the component client property map will
+ * be used. If not specified, it is assumed to be true.</p>
+ *
+ * <p>You must specify "Nimbus.Overrides" for "Nimbus.Overrides.InheritDefaults"
+ * to have any effect. "Nimbus.Overrides" indicates whether there are any
+ * overrides, while "Nimbus.Overrides.InheritDefaults" indicates whether those
+ * overrides should first be initialized with the defaults from UIManager.</p>
+ *
+ * <p>The NimbusStyle is reloaded whenever a property change event is fired
+ * for a component for "Nimbus.Overrides" or "Nimbus.Overrides.InheritDefaults".
+ * So for example, setting a new UIDefaults on a component would cause the
+ * style to be reloaded.</p>
+ *
+ * <p>The values are only read out of UIManager once, and then cached. If
+ * you need to read the values again (for example, if the UI is being reloaded),
+ * then discard this NimbusStyle and read a new one from NimbusLookAndFeel
+ * using NimbusLookAndFeel.getStyle.</p>
+ *
+ * <p>The primary API of interest in this class for 3rd party component authors
+ * are the three methods which retrieve painters: #getBackgroundPainter,
+ * #getForegroundPainter, and #getBorderPainter.</p>
+ *
+ * <p>NimbusStyle allows you to specify custom states, or modify the order of
+ * states. Synth (and thus Nimbus) has the concept of a "state". For example,
+ * a JButton might be in the "MOUSE_OVER" state, or the "ENABLED" state, or the
+ * "DISABLED" state. These are all "standard" states which are defined in synth,
+ * and which apply to all synth Regions.</p>
+ *
+ * <p>Sometimes, however, you need to have a custom state. For example, you
+ * want JButton to render differently if it's parent is a JToolbar. In Nimbus,
+ * you specify these custom states by including a special key in UIDefaults.
+ * The following UIDefaults entries define three states for this button:</p>
+ *
+ * <pre><code>
+ *     JButton.States = Enabled, Disabled, Toolbar
+ *     JButton[Enabled].backgroundPainter = somePainter
+ *     JButton[Disabled].background = BLUE
+ *     JButton[Toolbar].backgroundPainter = someOtherPaint
+ * </code></pre>
+ *
+ * <p>As you can see, the <code>JButton.States</code> entry lists the states
+ * that the JButton style will support. You then specify the settings for
+ * each state. If you do not specify the <code>JButton.States</code> entry,
+ * then the standard Synth states will be assumed. If you specify the entry
+ * but the list of states is empty or null, then the standard synth states
+ * will be assumed.</p>
+ *
+ * @author Richard Bair
+ * @author Jasper Potts
+ */
+public final class NimbusStyle extends SynthStyle {
+    /* Keys and scales for large/small/mini components, based on Apples sizes */
+    public static final String LARGE_KEY = "large";
+    public static final String SMALL_KEY = "small";
+    public static final String MINI_KEY = "mini";
+    public static final double LARGE_SCALE = 1.15;
+    public static final double SMALL_SCALE = 0.857;
+    public static final double MINI_SCALE = 0.714;
+
+    /**
+     * Special constant used for performance reasons during the get() method.
+     * If get() runs through all of the search locations and determines that
+     * there is no value, then NULL will be placed into the values map. This way
+     * on subsequent lookups it will simply extract NULL, see it, and return
+     * null rather than continuing the lookup procedure.
+     */
+    private static final Object NULL = '\0';
+    /**
+     * <p>The Color to return from getColorForState if it would otherwise have
+     * returned null.</p>
+     *
+     * <p>Returning null from getColorForState is a very bad thing, as it causes
+     * the AWT peer for the component to install a SystemColor, which is not a
+     * UIResource. As a result, if <code>null</code> is returned from
+     * getColorForState, then thereafter the color is not updated for other
+     * states or on LAF changes or updates. This DEFAULT_COLOR is used to
+     * ensure that a ColorUIResource is always returned from
+     * getColorForState.</p>
+     */
+    private static final Color DEFAULT_COLOR = new ColorUIResource(Color.BLACK);
+    /**
+     * Simple Comparator for ordering the RuntimeStates according to their
+     * rank.
+     */
+    private static final Comparator<RuntimeState> STATE_COMPARATOR =
+        new Comparator<RuntimeState>() {
+            @Override
+            public int compare(RuntimeState a, RuntimeState b) {
+                return a.state - b.state;
+            }
+        };
+    /**
+     * The prefix for the component or region that this NimbusStyle
+     * represents. This prefix is used to lookup state in the UIManager.
+     * It should be something like Button or Slider.Thumb or "MyButton" or
+     * ComboBox."ComboBox.arrowButton" or "MyComboBox"."ComboBox.arrowButton"
+     */
+    private String prefix;
+    /**
+     * The SynthPainter that will be returned from this NimbusStyle. The
+     * SynthPainter returned will be a SynthPainterImpl, which will in turn
+     * delegate back to this NimbusStyle for the proper Painter (not
+     * SynthPainter) to use for painting the foreground, background, or border.
+     */
+    private SynthPainter painter;
+    /**
+     * Data structure containing all of the defaults, insets, states, and other
+     * values associated with this style. This instance refers to default
+     * values, and are used when no overrides are discovered in the client
+     * properties of a component. These values are lazily created on first
+     * access.
+     */
+    private Values values;
+
+    /**
+     * A temporary CacheKey used to perform lookups. This pattern avoids
+     * creating useless garbage keys, or concatenating strings, etc.
+     */
+    private CacheKey tmpKey = new CacheKey("", 0);
+
+    /**
+     * Some NimbusStyles are created for a specific component only. In Nimbus,
+     * this happens whenever the component has as a client property a
+     * UIDefaults which overrides (or supplements) those defaults found in
+     * UIManager.
+     */
+    private JComponent component;
+
+    /**
+     * Create a new NimbusStyle. Only the prefix must be supplied. At the
+     * appropriate time, installDefaults will be called. At that point, all of
+     * the state information will be pulled from UIManager and stored locally
+     * within this style.
+     *
+     * @param prefix Something like Button or Slider.Thumb or
+     *        org.jdesktop.swingx.JXStatusBar or ComboBox."ComboBox.arrowButton"
+     * @param c an optional reference to a component that this NimbusStyle
+     *        should be associated with. This is only used when the component
+     *        has Nimbus overrides registered in its client properties and
+     *        should be null otherwise.
+     */
+    NimbusStyle(String prefix, JComponent c) {
+        this.component = c;
+        this.prefix = prefix;
+        this.painter = new SynthPainterImpl(this);
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary.
+     */
+    @Override public void installDefaults(SynthContext ctx) {
+        validate();
+
+        //delegate to the superclass to install defaults such as background,
+        //foreground, font, and opaque onto the swing component.
+        super.installDefaults(ctx);
+    }
+
+    static String parsePrefix(String key) {
+       if (key == null) return null;
+       boolean inquotes = false;
+       for (int i=0; i<key.length(); i++) {
+           char c = key.charAt(i);
+           if (c == '"') {
+               inquotes = !inquotes;
+           } else if ((c == '[' || c == '.') && !inquotes) {
+               return key.substring(0, i);
+           }
+       }
+       return null;
+    }
+
+    /**
+     * Called by NimbusLookAndFeel when the look and feel is being uninstalled.
+     * Performs general cleanup of any app-context specific data.
+     */
+    static void uninitialize() {
+        // get the appcontext that we've stored data in
+        AppContext ctx = AppContext.getAppContext();
+
+        // get the pcl stored in app context
+        PropertyChangeListener pcl = (PropertyChangeListener)
+                ctx.get("NimbusStyle.defaults.pcl");
+
+        // if the pcl exists, uninstall it from the UIDefaults tables
+        if (pcl != null) {
+            UIManager.getDefaults().removePropertyChangeListener(pcl);
+            UIManager.getLookAndFeelDefaults().removePropertyChangeListener(pcl);
+        }
+
+        // clear out the compiled defaults
+        ctx.put("NimbusStyle.defaults", null);
+    }
+
+    /**
+     * Pulls data out of UIDefaults, if it has not done so already, and sets
+     * up the internal state.
+     */
+    private void validate() {
+        // a non-null values object is the flag we use to determine whether
+        // to reparse from UIManager.
+        if (values != null) return;
+
+        // reconstruct this NimbusStyle based on the entries in the UIManager
+        // and possibly based on any overrides within the component's
+        // client properties (assuming such a component exists and contains
+        // any Nimbus.Overrides)
+        values = new Values();
+
+        // the profiler revealed that a great deal of CPU time and useless
+        // garbage was being produced by this method and the init method. One
+        // culprit was the creation and reparsing of the entire UIDefaults
+        // map on each call to this method where "values" was null. It turns
+        // out this was happening a lot.
+        // To remove this bottleneck, we store the compiled TreeMaps of defaults
+        // in the appContext for reuse. It is nulled whenever the UIDefaults
+        // changes and recomputed when necessary.
+        final AppContext ctx = AppContext.getAppContext();
+
+        // fetch the defaults from the app context. If null, then create and
+        // store the compiled defaults
+        Map<String, TreeMap<String, Object>> compiledDefaults =
+                (Map<String, TreeMap<String, Object>>)
+                    ctx.get("NimbusStyle.defaults");
+
+        if (compiledDefaults == null) {
+            // the entire UIDefaults tables are parsed and compiled into
+            // this map of maps. The key of the compiledDefaults is the
+            // prefix for each style, while the value is a map of
+            // keys->values for that prefix.
+            compiledDefaults = new HashMap<String, TreeMap<String, Object>>();
+
+            // get all the defaults from UIManager.getDefaults() and put them
+            // into the compiledDefaults
+            compileDefaults(compiledDefaults, UIManager.getDefaults());
+
+            // This second statement pulls defaults from the laf defaults
+            UIDefaults lafDefaults = UIManager.getLookAndFeelDefaults();
+            compileDefaults(compiledDefaults, lafDefaults);
+
+            // if it has not already been done, add a listener to both
+            // UIManager.getDefaults() and UIManager.getLookAndFeelDefaults().
+            PropertyChangeListener pcl = (PropertyChangeListener)
+                    ctx.get("NimbusStyle.defaults.pcl");
+
+            // if pcl is null, then it has not yet been registered with
+            // the UIManager defaults for this app context
+            if (pcl == null) {
+                // create a PCL which will simply clear out the compiled
+                // defaults from the app context, causing it to be recomputed
+                // on subsequent passes
+                pcl = new DefaultsListener();
+                // add the PCL to both defaults tables that we pay attention
+                // to, so that if the UIDefaults are updated, then the
+                // precompiled defaults will be cleared from the app context
+                // and recomputed on subsequent passes
+                UIManager.getDefaults().addPropertyChangeListener(pcl);
+                UIManager.getLookAndFeelDefaults().addPropertyChangeListener(pcl);
+                // save the PCL to the app context as a marker indicating
+                // that the PCL has been registered so we don't end up adding
+                // more than one listener to the UIDefaults tables.
+                ctx.put("NimbusStyle.defaults.pcl", pcl);
+            }
+
+            // store the defaults for reuse
+            ctx.put("NimbusStyle.defaults", compiledDefaults);
+        }
+
+        TreeMap<String, Object> defaults = compiledDefaults.get(prefix);
+
+        // inspect the client properties for the key "Nimbus.Overrides". If the
+        // value is an instance of UIDefaults, then these defaults are used
+        // in place of, or in addition to, the defaults in UIManager.
+        if (component != null) {
+            Object o = component.getClientProperty("Nimbus.Overrides");
+            if (o instanceof UIDefaults) {
+                Object i = component.getClientProperty(
+                        "Nimbus.Overrides.InheritDefaults");
+                boolean inherit = i instanceof Boolean ? (Boolean)i : true;
+                UIDefaults d = (UIDefaults)o;
+                TreeMap<String, Object> map = new TreeMap<String, Object>();
+                for (Object obj : d.keySet()) {
+                    if (obj instanceof String) {
+                        String key = (String)obj;
+                        if (key.startsWith(prefix)) {
+                            map.put(key, d.get(key));
+                        }
+                    }
+                }
+                if (inherit) {
+                    defaults.putAll(map);
+                } else {
+                    defaults = map;
+                }
+            }
+        }
+
+        // Now that I've accumulated all the defaults pertaining to this
+        // style, call init which will read these defaults and configure
+        // the default "values".
+        init(values, defaults);
+    }
+
+    /**
+     * Iterates over all the keys in the specified UIDefaults and compiles
+     * those keys into the comiledDefaults data structure. It relies on
+     * parsing the "prefix" out of the key. If the key is not a String or is
+     * null then it is ignored. In all other cases a prefix is parsed out
+     * (even if that prefix is the empty String or is a "fake" prefix. That
+     * is, suppose you had a key Foo~~MySpecial.KeyThing~~. In this case this
+     * is not a Nimbus formatted key, but we don't care, we treat it as if it
+     * is. This doesn't pose any harm, it will simply never be used).
+     *
+     * @param compiledDefaults
+     * @param d
+     */
+    private void compileDefaults(
+            Map<String, TreeMap<String,Object>> compiledDefaults,
+            UIDefaults d) {
+        for (Object obj : new HashSet(d.keySet())) {
+            if (obj instanceof String) {
+                String key = (String)obj;
+                String kp = parsePrefix(key);
+                if (kp == null) continue;
+                TreeMap<String,Object> map = compiledDefaults.get(kp);
+                if (map == null) {
+                    map = new TreeMap<String,Object>();
+                    compiledDefaults.put(kp, map);
+                }
+                map.put(key, d.get(key));
+            }
+        }
+    }
+
+    /**
+     * Initializes the given <code>Values</code> object with the defaults
+     * contained in the given TreeMap.
+     *
+     * @param v The Values object to be initialized
+     * @param myDefaults a map of UIDefaults to use in initializing the Values.
+     *        This map must contain only keys associated with this Style.
+     */
+    private void init(Values v, TreeMap<String, Object> myDefaults) {
+        //a list of the different types of states used by this style. This
+        //list may contain only "standard" states (those defined by Synth),
+        //or it may contain custom states, or it may contain only "standard"
+        //states but list them in a non-standard order.
+        List<State> states = new ArrayList<State>();
+        //a map of state name to code
+        Map<String,Integer> stateCodes = new HashMap<String,Integer>();
+        //This is a list of runtime "state" context objects. These contain
+        //the values associated with each state.
+        List<RuntimeState> runtimeStates = new ArrayList<RuntimeState>();
+
+        //determine whether there are any custom states, or custom state
+        //order. If so, then read all those custom states and define the
+        //"values" stateTypes to be a non-null array.
+        //Otherwise, let the "values" stateTypes be null to indicate that
+        //there are no custom states or custom state ordering
+        String statesString = (String)myDefaults.get(prefix + ".States");
+        if (statesString != null) {
+            String s[] = statesString.split(",");
+            for (int i=0; i<s.length; i++) {
+                s[i] = s[i].trim();
+                if (!State.isStandardStateName(s[i])) {
+                    //this is a non-standard state name, so look for the
+                    //custom state associated with it
+                    String stateName = prefix + "." + s[i];
+                    State customState = (State)myDefaults.get(stateName);
+                    if (customState != null) {
+                        states.add(customState);
+                    }
+                } else {
+                    states.add(State.getStandardState(s[i]));
+                }
+            }
+
+            //if there were any states defined, then set the stateTypes array
+            //to be non-null. Otherwise, leave it null (meaning, use the
+            //standard synth states).
+            if (states.size() > 0) {
+                v.stateTypes = states.toArray(new State[states.size()]);
+            }
+
+            //assign codes for each of the state types
+            int code = 1;
+            for (State state : states) {
+                stateCodes.put(state.getName(), code);
+                code <<= 1;
+            }
+        } else {
+            //since there were no custom states defined, setup the list of
+            //standard synth states. Note that the "v.stateTypes" is not
+            //being set here, indicating that at runtime the state selection
+            //routines should use standard synth states instead of custom
+            //states. I do need to popuplate this temp list now though, so that
+            //the remainder of this method will function as expected.
+            states.add(State.Enabled);
+            states.add(State.MouseOver);
+            states.add(State.Pressed);
+            states.add(State.Disabled);
+            states.add(State.Focused);
+            states.add(State.Selected);
+            states.add(State.Default);
+
+            //assign codes for the states
+            stateCodes.put("Enabled", ENABLED);
+            stateCodes.put("MouseOver", MOUSE_OVER);
+            stateCodes.put("Pressed", PRESSED);
+            stateCodes.put("Disabled", DISABLED);
+            stateCodes.put("Focused", FOCUSED);
+            stateCodes.put("Selected", SELECTED);
+            stateCodes.put("Default", DEFAULT);
+        }
+
+        //Now iterate over all the keys in the defaults table
+        for (String key : myDefaults.keySet()) {
+            //The key is something like JButton.Enabled.backgroundPainter,
+            //or JButton.States, or JButton.background.
+            //Remove the "JButton." portion of the key
+            String temp = key.substring(prefix.length());
+            //if there is a " or : then we skip it because it is a subregion
+            //of some kind
+            if (temp.indexOf('"') != -1 || temp.indexOf(':') != -1) continue;
+            //remove the separator
+            temp = temp.substring(1);
+            //At this point, temp may be any of the following:
+            //background
+            //[Enabled].background
+            //[Enabled+MouseOver].background
+            //property.foo
+
+            //parse out the states and the property
+            String stateString = null;
+            String property = null;
+            int bracketIndex = temp.indexOf(']');
+            if (bracketIndex < 0) {
+                //there is not a state string, so property = temp
+                property = temp;
+            } else {
+                stateString = temp.substring(0, bracketIndex);
+                property = temp.substring(bracketIndex + 2);
+            }
+
+            //now that I have the state (if any) and the property, get the
+            //value for this property and install it where it belongs
+            if (stateString == null) {
+                //there was no state, just a property. Check for the custom
+                //"contentMargins" property (which is handled specially by
+                //Synth/Nimbus). Also check for the property being "States",
+                //in which case it is not a real property and should be ignored.
+                //otherwise, assume it is a property and install it on the
+                //values object
+                if ("contentMargins".equals(property)) {
+                    v.contentMargins = (Insets)myDefaults.get(key);
+                } else if ("States".equals(property)) {
+                    //ignore
+                } else {
+                    v.defaults.put(property, myDefaults.get(key));
+                }
+            } else {
+                //it is possible that the developer has a malformed UIDefaults
+                //entry, such that something was specified in the place of
+                //the State portion of the key but it wasn't a state. In this
+                //case, skip will be set to true
+                boolean skip = false;
+                //this variable keeps track of the int value associated with
+                //the state. See SynthState for details.
+                int componentState = 0;
+                //Multiple states may be specified in the string, such as
+                //Enabled+MouseOver
+                String[] stateParts = stateString.split("\\+");
+                //For each state, we need to find the State object associated
+                //with it, or skip it if it cannot be found.
+                for (String s : stateParts) {
+                    if (stateCodes.containsKey(s)) {
+                        componentState |= stateCodes.get(s);
+                    } else {
+                        //Was not a state. Maybe it was a subregion or something
+                        //skip it.
+                        skip = true;
+                        break;
+                    }
+                }
+
+                if (skip) continue;
+
+                //find the RuntimeState for this State
+                RuntimeState rs = null;
+                for (RuntimeState s : runtimeStates) {
+                    if (s.state == componentState) {
+                        rs = s;
+                        break;
+                    }
+                }
+
+                //couldn't find the runtime state, so create a new one
+                if (rs == null) {
+                    rs = new RuntimeState(componentState, stateString);
+                    runtimeStates.add(rs);
+                }
+
+                //check for a couple special properties, such as for the
+                //painters. If these are found, then set the specially on
+                //the runtime state. Else, it is just a normal property,
+                //so put it in the UIDefaults associated with that runtime
+                //state
+                if ("backgroundPainter".equals(property)) {
+                    rs.backgroundPainter = (Painter)myDefaults.get(key);
+                } else if ("foregroundPainter".equals(property)) {
+                    rs.foregroundPainter = (Painter) myDefaults.get(key);
+                } else if ("borderPainter".equals(property)) {
+                    rs.borderPainter = (Painter) myDefaults.get(key);
+                } else {
+                    rs.defaults.put(property, myDefaults.get(key));
+                }
+            }
+        }
+
+        //now that I've collected all the runtime states, I'll sort them based
+        //on their integer "state" (see SynthState for how this works).
+        Collections.sort(runtimeStates, STATE_COMPARATOR);
+
+        //finally, set the array of runtime states on the values object
+        v.states = runtimeStates.toArray(new RuntimeState[runtimeStates.size()]);
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary.
+     */
+    @Override public Insets getInsets(SynthContext ctx, Insets in) {
+        if (in == null) {
+            in = new Insets(0, 0, 0, 0);
+        }
+
+        Values v = getValues(ctx);
+
+        if (v.contentMargins == null) {
+            in.bottom = in.top = in.left = in.right = 0;
+            return in;
+        } else {
+            in.bottom = v.contentMargins.bottom;
+            in.top = v.contentMargins.top;
+            in.left = v.contentMargins.left;
+            in.right = v.contentMargins.right;
+            // Account for scale
+            // The key "JComponent.sizeVariant" is used to match Apple's LAF
+            String scaleKey = (String)ctx.getComponent().getClientProperty(
+                    "JComponent.sizeVariant");
+            if (scaleKey != null){
+                if (LARGE_KEY.equals(scaleKey)){
+                    in.bottom *= LARGE_SCALE;
+                    in.top *= LARGE_SCALE;
+                    in.left *= LARGE_SCALE;
+                    in.right *= LARGE_SCALE;
+                } else if (SMALL_KEY.equals(scaleKey)){
+                    in.bottom *= SMALL_SCALE;
+                    in.top *= SMALL_SCALE;
+                    in.left *= SMALL_SCALE;
+                    in.right *= SMALL_SCALE;
+                } else if (MINI_KEY.equals(scaleKey)){
+                    in.bottom *= MINI_SCALE;
+                    in.top *= MINI_SCALE;
+                    in.left *= MINI_SCALE;
+                    in.right *= MINI_SCALE;
+                }
+            }
+            return in;
+        }
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * <p>Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary.</p>
+     *
+     * <p>In addition, NimbusStyle handles ColorTypes slightly differently from
+     * Synth.</p>
+     * <ul>
+     *  <li>ColorType.BACKGROUND will equate to the color stored in UIDefaults
+     *      named "background".</li>
+     *  <li>ColorType.TEXT_BACKGROUND will equate to the color stored in
+     *      UIDefaults named "textBackground".</li>
+     *  <li>ColorType.FOREGROUND will equate to the color stored in UIDefaults
+     *      named "textForeground".</li>
+     *  <li>ColorType.TEXT_FOREGROUND will equate to the color stored in
+     *      UIDefaults named "textForeground".</li>
+     * </ul>
+     */
+    @Override protected Color getColorForState(SynthContext ctx, ColorType type) {
+        String key = null;
+        if (type == ColorType.BACKGROUND) {
+            key = "background";
+        } else if (type == ColorType.FOREGROUND) {
+            //map FOREGROUND as TEXT_FOREGROUND
+            key = "textForeground";
+        } else if (type == ColorType.TEXT_BACKGROUND) {
+            key = "textBackground";
+        } else if (type == ColorType.TEXT_FOREGROUND) {
+            key = "textForeground";
+        } else if (type == ColorType.FOCUS) {
+            key = "focus";
+        } else if (type != null) {
+            key = type.toString();
+        } else {
+            return DEFAULT_COLOR;
+        }
+        Color c = (Color) get(ctx, key);
+        //if all else fails, return a default color (which is a ColorUIResource)
+        if (c == null) c = DEFAULT_COLOR;
+        return c;
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary. If a value named "font" is not found in
+     * UIDefaults, then the "defaultFont" font in UIDefaults will be returned
+     * instead.
+     */
+    @Override protected Font getFontForState(SynthContext ctx) {
+        Font f = (Font)get(ctx, "font");
+        if (f == null) f = UIManager.getFont("defaultFont");
+
+        // Account for scale
+        // The key "JComponent.sizeVariant" is used to match Apple's LAF
+        String scaleKey = (String)ctx.getComponent().getClientProperty(
+                "JComponent.sizeVariant");
+        if (scaleKey != null){
+            if (LARGE_KEY.equals(scaleKey)){
+                f = f.deriveFont(Math.round(f.getSize2D()*LARGE_SCALE));
+            } else if (SMALL_KEY.equals(scaleKey)){
+                f = f.deriveFont(Math.round(f.getSize2D()*SMALL_SCALE));
+            } else if (MINI_KEY.equals(scaleKey)){
+                f = f.deriveFont(Math.round(f.getSize2D()*MINI_SCALE));
+            }
+        }
+        return f;
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * Returns the SynthPainter for this style, which ends up delegating to
+     * the Painters installed in this style.
+     */
+    @Override public SynthPainter getPainter(SynthContext ctx) {
+        return painter;
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary. If opacity is not specified in UI defaults,
+     * then it defaults to being non-opaque.
+     */
+    @Override public boolean isOpaque(SynthContext ctx) {
+        // Force Table CellRenderers to be opaque
+        if ("Table.cellRenderer".equals(ctx.getComponent().getName())) {
+            return true;
+        }
+        Boolean opaque = (Boolean)get(ctx, "opaque");
+        return opaque == null ? false : opaque;
+    }
+
+    /**
+     * @inheritDoc
+     *
+     * <p>Overridden to cause this style to populate itself with data from
+     * UIDefaults, if necessary.</p>
+     *
+     * <p>Properties in UIDefaults may be specified in a chained manner. For
+     * example:
+     * <pre>
+     * background
+     * Button.opacity
+     * Button.Enabled.foreground
+     * Button.Enabled+Selected.background
+     * </pre></p>
+     *
+     * <p>In this example, suppose you were in the Enabled+Selected state and
+     * searched for "foreground". In this case, we first check for
+     * Button.Enabled+Selected.foreground, but no such color exists. We then
+     * fall back to the next valid state, in this case,
+     * Button.Enabled.foreground, and have a match. So we return it.</p>
+     *
+     * <p>Again, if we were in the state Enabled and looked for "background", we
+     * wouldn't find it in Button.Enabled, or in Button, but would at the top
+     * level in UIManager. So we return that value.</p>
+     *
+     * <p>One special note: the "key" passed to this method could be of the form
+     * "background" or "Button.background" where "Button" equals the prefix
+     * passed to the NimbusStyle constructor. In either case, it looks for
+     * "background".</p>
+     *
+     * @param ctx
+     * @param key must not be null
+     */
+    @Override public Object get(SynthContext ctx, Object key) {
+        Values v = getValues(ctx);
+
+        // strip off the prefix, if there is one.
+        String fullKey = key.toString();
+        String partialKey = fullKey.substring(fullKey.indexOf(".") + 1);
+
+        Object obj = null;
+        int xstate = getExtendedState(ctx, v);
+
+        // check the cache
+        tmpKey.init(partialKey, xstate);
+        obj = v.cache.get(tmpKey);
+        boolean wasInCache = obj != null;
+        if (!wasInCache){
+            // Search exact matching states and then lesser matching states
+            RuntimeState s = null;
+            int[] lastIndex = new int[] {-1};
+            while (obj == null &&
+                    (s = getNextState(v.states, lastIndex, xstate)) != null) {
+                obj = s.defaults.get(partialKey);
+            }
+            // Search Region Defaults
+            if (obj == null && v.defaults != null) {
+                obj = v.defaults.get(partialKey);
+            }
+            // return found object
+            // Search UIManager Defaults
+            if (obj == null) obj = UIManager.get(fullKey);
+            // Search Synth Defaults for InputMaps
+            if (obj == null && partialKey.equals("focusInputMap")) {
+                obj = super.get(ctx, fullKey);
+            }
+            // if all we got was a null, store this fact for later use
+            v.cache.put(new CacheKey(partialKey, xstate),
+                    obj == null ? NULL : obj);
+        }
+        // return found object
+        return obj == NULL ? null : obj;
+    }
+
+    /**
+     * Gets the appropriate background Painter, if there is one, for the state
+     * specified in the given SynthContext. This method does appropriate
+     * fallback searching, as described in #get.
+     *
+     * @param ctx The SynthContext. Must not be null.
+     * @return The background painter associated for the given state, or null if
+     * none could be found.
+     */
+    public Painter getBackgroundPainter(SynthContext ctx) {
+        Values v = getValues(ctx);
+        int xstate = getExtendedState(ctx, v);
+        Painter p = null;
+
+        // check the cache
+        tmpKey.init("backgroundPainter$$instance", xstate);
+        p = (Painter)v.cache.get(tmpKey);
+        if (p != null) return p;
+
+        // not in cache, so lookup and store in cache
+        RuntimeState s = null;
+        int[] lastIndex = new int[] {-1};
+        while ((s = getNextState(v.states, lastIndex, xstate)) != null) {
+            if (s.backgroundPainter != null) {
+                p = s.backgroundPainter;
+                break;
+            }
+        }
+        if (p == null) p = (Painter)get(ctx, "backgroundPainter");
+        if (p != null) {
+            v.cache.put(new CacheKey("backgroundPainter$$instance", xstate), p);
+        }
+        return p;
+    }
+
+    /**
+     * Gets the appropriate foreground Painter, if there is one, for the state
+     * specified in the given SynthContext. This method does appropriate
+     * fallback searching, as described in #get.
+     *
+     * @param ctx The SynthContext. Must not be null.
+     * @return The foreground painter associated for the given state, or null if
+     * none could be found.
+     */
+    public Painter getForegroundPainter(SynthContext ctx) {
+        Values v = getValues(ctx);
+        int xstate = getExtendedState(ctx, v);
+        Painter p = null;
+
+        // check the cache
+        tmpKey.init("foregroundPainter$$instance", xstate);
+        p = (Painter)v.cache.get(tmpKey);
+        if (p != null) return p;
+
+        // not in cache, so lookup and store in cache
+        RuntimeState s = null;
+        int[] lastIndex = new int[] {-1};
+        while ((s = getNextState(v.states, lastIndex, xstate)) != null) {
+            if (s.foregroundPainter != null) {
+                p = s.foregroundPainter;
+                break;
+            }
+        }
+        if (p == null) p = (Painter)get(ctx, "foregroundPainter");
+        if (p != null) {
+            v.cache.put(new CacheKey("foregroundPainter$$instance", xstate), p);
+        }
+        return p;
+    }
+
+    /**
+     * Gets the appropriate border Painter, if there is one, for the state
+     * specified in the given SynthContext. This method does appropriate
+     * fallback searching, as described in #get.
+     *
+     * @param ctx The SynthContext. Must not be null.
+     * @return The border painter associated for the given state, or null if
+     * none could be found.
+     */
+    public Painter getBorderPainter(SynthContext ctx) {
+        Values v = getValues(ctx);
+        int xstate = getExtendedState(ctx, v);
+        Painter p = null;
+
+        // check the cache
+        tmpKey.init("borderPainter$$instance", xstate);
+        p = (Painter)v.cache.get(tmpKey);
+        if (p != null) return p;
+
+        // not in cache, so lookup and store in cache
+        RuntimeState s = null;
+        int[] lastIndex = new int[] {-1};
+        while ((s = getNextState(v.states, lastIndex, xstate)) != null) {
+            if (s.borderPainter != null) {
+                p = s.borderPainter;
+                break;
+            }
+        }
+        if (p == null) p = (Painter)get(ctx, "borderPainter");
+        if (p != null) {
+            v.cache.put(new CacheKey("borderPainter$$instance", xstate), p);
+        }
+        return p;
+    }
+
+    /**
+     * Utility method which returns the proper Values based on the given
+     * SynthContext. Ensures that parsing of the values has occurred, or
+     * reoccurs as necessary.
+     *
+     * @param ctx The SynthContext
+     * @return a non-null values reference
+     */
+    private Values getValues(SynthContext ctx) {
+        validate();
+        return values;
+    }
+
+    /**
+     * Simple utility method that searchs the given array of Strings for the
+     * given string. This method is only called from getExtendedState if
+     * the developer has specified a specific state for the component to be
+     * in (ie, has "wedged" the component in that state) by specifying
+     * they client property "Nimbus.State".
+     *
+     * @param names a non-null array of strings
+     * @param name the name to look for in the array
+     * @return true or false based on whether the given name is in the array
+     */
+    private boolean contains(String[] names, String name) {
+        assert name != null;
+        for (int i=0; i<names.length; i++) {
+            if (name.equals(names[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * <p>Gets the extended state for a given synth context. Nimbus supports the
+     * ability to define custom states. The algorithm used for choosing what
+     * style information to use for a given state requires a single integer
+     * bit string where each bit in the integer represents a different state
+     * that the component is in. This method uses the componentState as
+     * reported in the SynthContext, in addition to custom states, to determine
+     * what this extended state is.</p>
+     *
+     * <p>In addition, this method checks the component in the given context
+     * for a client property called "Nimbus.State". If one exists, then it will
+     * decompose the String associated with that property to determine what
+     * state to return. In this way, the developer can force a component to be
+     * in a specific state, regardless of what the "real" state of the component
+     * is.</p>
+     *
+     * <p>The string associated with "Nimbus.State" would be of the form:
+     * <pre>Enabled+CustomState+MouseOver</pre></p>
+     *
+     * @param ctx
+     * @param v
+     * @return
+     */
+    private int getExtendedState(SynthContext ctx, Values v) {
+        JComponent c = ctx.getComponent();
+        int xstate = 0;
+        int mask = 1;
+        //check for the Nimbus.State client property
+        //Performance NOTE: getClientProperty ends up inside a synchronized
+        //block, so there is some potential for performance issues here, however
+        //I'm not certain that there is one on a modern VM.
+        Object property = c.getClientProperty("Nimbus.State");
+        if (property != null) {
+            String stateNames = property.toString();
+            String[] states = stateNames.split("\\+");
+            if (v.stateTypes == null){
+                // standard states only
+                for (String stateStr : states) {
+                    State.StandardState s = State.getStandardState(stateStr);
+                    if (s != null) xstate |= s.getState();
+                }
+            } else {
+                // custom states
+                for (State s : v.stateTypes) {
+                    if (contains(states, s.getName())) {
+                        xstate |= mask;
+                    }
+                    mask <<= 1;
+                }
+            }
+        } else {
+            //if there are no custom states defined, then simply return the
+            //state that Synth reported
+            if (v.stateTypes == null) return ctx.getComponentState();
+
+            //there are custom states on this values, so I'll have to iterate
+            //over them all and return a custom extended state
+            int state = ctx.getComponentState();
+            for (State s : v.stateTypes) {
+                if (s.isInState(c, state)) {
+                    xstate |= mask;
+                }
+                mask <<= 1;
+            }
+        }
+        return xstate;
+    }
+
+    /**
+     * <p>Gets the RuntimeState that most closely matches the state in the given
+     * context, but is less specific than the given "lastState". Essentially,
+     * this allows you to search for the next best state.</p>
+     *
+     * <p>For example, if you had the following three states:
+     * <pre>
+     * Enabled
+     * Enabled+Pressed
+     * Disabled
+     * </pre>
+     * And you wanted to find the state that best represented
+     * ENABLED+PRESSED+FOCUSED and <code>lastState</code> was null (or an
+     * empty array, or an array with a single int with index == -1), then
+     * Enabled+Pressed would be returned. If you then call this method again but
+     * pass the index of Enabled+Pressed as the "lastState", then
+     * Enabled would be returned. If you call this method a third time and pass
+     * the index of Enabled in as the <code>lastState</code>, then null would be
+     * returned.</p>
+     *
+     * <p>The actual code path for determining the proper state is the same as
+     * in Synth.</p>
+     *
+     * @param ctx
+     * @param lastState a 1 element array, allowing me to do pass-by-reference.
+     * @return
+     */
+    private RuntimeState getNextState(RuntimeState[] states,
+                                      int[] lastState,
+                                      int xstate) {
+        // Use the StateInfo with the most bits that matches that of state.
+        // If there are none, then fallback to
+        // the StateInfo with a state of 0, indicating it'll match anything.
+
+        // Consider if we have 3 StateInfos a, b and c with states:
+        // SELECTED, SELECTED | ENABLED, 0
+        //
+        // Input                          Return Value
+        // -----                          ------------
+        // SELECTED                       a
+        // SELECTED | ENABLED             b
+        // MOUSE_OVER                     c
+        // SELECTED | ENABLED | FOCUSED   b
+        // ENABLED                        c
+
+        if (states != null && states.length > 0) {
+            int bestCount = 0;
+            int bestIndex = -1;
+            int wildIndex = -1;
+
+            //if xstate is 0, then search for the runtime state with component
+            //state of 0. That is, find the exact match and return it.
+            if (xstate == 0) {
+                for (int counter = states.length - 1; counter >= 0; counter--) {
+                    if (states[counter].state == 0) {
+                        lastState[0] = counter;
+                        return states[counter];
+                    }
+                }
+                //an exact match couldn't be found, so there was no match.
+                lastState[0] = -1;
+                return null;
+            }
+
+            //xstate is some value != 0
+
+            //determine from which index to start looking. If lastState[0] is -1
+            //then we know to start from the end of the state array. Otherwise,
+            //we start at the lastIndex - 1.
+            int lastStateIndex = lastState == null || lastState[0] == -1 ?
+                states.length : lastState[0];
+
+            for (int counter = lastStateIndex - 1; counter >= 0; counter--) {
+                int oState = states[counter].state;
+
+                if (oState == 0) {
+                    if (wildIndex == -1) {
+                        wildIndex = counter;
+                    }
+                } else if ((xstate & oState) == oState) {
+                    // This is key, we need to make sure all bits of the
+                    // StateInfo match, otherwise a StateInfo with
+                    // SELECTED | ENABLED would match ENABLED, which we
+                    // don't want.
+
+                    // This comes from BigInteger.bitCnt
+                    int bitCount = oState;
+                    bitCount -= (0xaaaaaaaa & bitCount) >>> 1;
+                    bitCount = (bitCount & 0x33333333) + ((bitCount >>> 2) &
+                            0x33333333);
+                    bitCount = bitCount + (bitCount >>> 4) & 0x0f0f0f0f;
+                    bitCount += bitCount >>> 8;
+                    bitCount += bitCount >>> 16;
+                    bitCount = bitCount & 0xff;
+                    if (bitCount > bestCount) {
+                        bestIndex = counter;
+                        bestCount = bitCount;
+                    }
+                }
+            }
+            if (bestIndex != -1) {
+                lastState[0] = bestIndex;
+                return states[bestIndex];
+            }
+            if (wildIndex != -1) {
+                lastState[0] = wildIndex;
+                return states[wildIndex];
+            }
+        }
+        lastState[0] = -1;
+        return null;
+    }
+
+    /**
+     * Contains values such as the UIDefaults and painters asssociated with
+     * a state. Whereas <code>State</code> represents a distinct state that a
+     * component can be in (such as Enabled), this class represents the colors,
+     * fonts, painters, etc associated with some state for this
+     * style.
+     */
+    private final class RuntimeState implements Cloneable {
+        int state;
+        Painter backgroundPainter;
+        Painter foregroundPainter;
+        Painter borderPainter;
+        String stateName;
+        UIDefaults defaults = new UIDefaults(10, .7f);
+
+        private RuntimeState(int state, String stateName) {
+            this.state = state;
+            this.stateName = stateName;
+        }
+
+        @Override
+        public String toString() {
+            return stateName;
+        }
+
+        @Override
+        public RuntimeState clone() {
+            RuntimeState clone = new RuntimeState(state, stateName);
+            clone.backgroundPainter = backgroundPainter;
+            clone.foregroundPainter = foregroundPainter;
+            clone.borderPainter = borderPainter;
+            clone.defaults.putAll(defaults);
+            return clone;
+        }
+    }
+
+    /**
+     * Essentially a struct of data for a style. A default instance of this
+     * class is used by NimbusStyle. Additional instances exist for each
+     * component that has overrides.
+     */
+    private static final class Values {
+        /**
+         * The list of State types. A State represents a type of state, such
+         * as Enabled, Default, WindowFocused, etc. These can be custom states.
+         */
+        State[] stateTypes = null;
+        /**
+         * The list of actual runtime state representations. These can represent things such
+         * as Enabled + Focused. Thus, they differ from States in that they contain
+         * several states together, and have associated properties, data, etc.
+         */
+        RuntimeState[] states = null;
+        /**
+         * The content margins for this region.
+         */
+        Insets contentMargins;
+        /**
+         * Defaults on the region/component level.
+         */
+        UIDefaults defaults = new UIDefaults(10, .7f);
+        /**
+         * Simple cache. After a value has been looked up, it is stored
+         * in this cache for later retrieval. The key is a concatenation of
+         * the property being looked up, two dollar signs, and the extended
+         * state. So for example:
+         *
+         * foo.bar$$2353
+         */
+        Map<CacheKey,Object> cache = new HashMap<CacheKey,Object>();
+    }
+
+    /**
+     * This implementation presupposes that key is never null and that
+     * the two keys being checked for equality are never null
+     */
+    private static final class CacheKey {
+        private String key;
+        private int xstate;
+
+        CacheKey(Object key, int xstate) {
+            init(key, xstate);
+        }
+
+        void init(Object key, int xstate) {
+            this.key = key.toString();
+            this.xstate = xstate;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            final CacheKey other = (CacheKey) obj;
+            if (obj == null) return false;
+            if (this.xstate != other.xstate) return false;
+            if (!this.key.equals(other.key)) return false;
+            return true;
+        }
+
+        @Override
+        public int hashCode() {
+            int hash = 3;
+            hash = 29 * hash + this.key.hashCode();
+            hash = 29 * hash + this.xstate;
+            return hash;
+        }
+    }
+
+    /**
+     * This listener is used to listen to the UIDefaults tables and clear out
+     * the cached-precompiled map of defaults in that case.
+     */
+    private static final class DefaultsListener implements PropertyChangeListener {
+        @Override
+        public void propertyChange(PropertyChangeEvent evt) {
+            AppContext.getAppContext().put("NimbusStyle.defaults", null);
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/OuterGlowEffect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/OuterGlowEffect.java
new file mode 100644
index 0000000..26f8350
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/OuterGlowEffect.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.Color;
+
+/**
+ * InnerGlowEffect
+ *
+ * @author Created by Jasper Potts (Jun 21, 2007)
+ */
+class OuterGlowEffect extends DropShadowEffect {
+    OuterGlowEffect() {
+        distance = 0;
+        color = new Color(255, 255, 211);
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template
new file mode 100644
index 0000000..2afa000
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/PainterImpl.template
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package ${PACKAGE};
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+import javax.swing.*;
+import javax.swing.Painter;
+
+
+public final class ${PAINTER_NAME} extends AbstractRegionPainter {
+    //package private integers representing the available states that
+    //this painter will paint. These are used when creating a new instance
+    //of ${PAINTER_NAME} to determine which region/state is being painted
+    //by that instance.
+${STATIC_DECL}
+
+    private int state; //refers to one of the static final ints above
+    private PaintContext ctx;
+
+    //the following 4 variables are reused during the painting code of the layers
+    private Path2D path = new Path2D.Float();
+    private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0);
+    private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0);
+    private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0);
+
+    //All Colors used for painting are stored here. Ideally, only those colors being used
+    //by a particular instance of ${PAINTER_NAME} would be created. For the moment at least,
+    //however, all are created for each instance.
+${COLORS_DECL}
+
+    //Array of current component colors, updated in each paint call
+    private Object[] componentColors;
+
+    public ${PAINTER_NAME}(PaintContext ctx, int state) {
+        super();
+        this.state = state;
+        this.ctx = ctx;
+    }
+
+    @Override
+    protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
+        //populate componentColors array with colors calculated in getExtendedCacheKeys call
+        componentColors = extendedCacheKeys;
+        //generate this entire method. Each state/bg/fg/border combo that has
+        //been painted gets its own KEY and paint method.
+        switch(state) {
+${DO_PAINT_SWITCH_BODY}
+        }
+    }
+        
+${GET_EXTENDED_CACHE_KEYS}
+
+    @Override
+    protected final PaintContext getPaintContext() {
+        return ctx;
+    }
+
+${PAINTING_DECL}
+
+${SHAPES_DECL}
+
+${GRADIENTS_DECL}
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/ShadowEffect.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/ShadowEffect.java
new file mode 100644
index 0000000..03a1e3d
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/ShadowEffect.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.Color;
+
+/**
+ * ShadowEffect - base class with all the standard properties for shadow effects
+ *
+ * @author Created by Jasper Potts (Jun 18, 2007)
+ */
+abstract class ShadowEffect extends Effect {
+    protected Color color = Color.BLACK;
+    /** Opacity a float 0-1 for percentage */
+    protected float opacity = 0.75f;
+    /** Angle in degrees between 0-360 */
+    protected int angle = 135;
+    /** Distance in pixels */
+    protected int distance = 5;
+    /** The shadow spread between 0-100 % */
+    protected int spread = 0;
+    /** Size in pixels */
+    protected int size = 5;
+
+    // =================================================================================================================
+    // Bean methods
+
+    Color getColor() {
+        return color;
+    }
+
+    void setColor(Color color) {
+        Color old = getColor();
+        this.color = color;
+    }
+
+    float getOpacity() {
+        return opacity;
+    }
+
+    void setOpacity(float opacity) {
+        float old = getOpacity();
+        this.opacity = opacity;
+    }
+
+    int getAngle() {
+        return angle;
+    }
+
+    void setAngle(int angle) {
+        int old = getAngle();
+        this.angle = angle;
+    }
+
+    int getDistance() {
+        return distance;
+    }
+
+    void setDistance(int distance) {
+        int old = getDistance();
+        this.distance = distance;
+    }
+
+    int getSpread() {
+        return spread;
+    }
+
+    void setSpread(int spread) {
+        int old = getSpread();
+        this.spread = spread;
+    }
+
+    int getSize() {
+        return size;
+    }
+
+    void setSize(int size) {
+        int old = getSize();
+        this.size = size;
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/State.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/State.java
new file mode 100644
index 0000000..92b4081
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/State.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.JComponent;
+import javax.swing.plaf.synth.SynthConstants;
+
+/**
+ * <p>Represents a built in, or custom, state in Nimbus.</p>
+ *
+ * <p>Synth provides several built in states, which are:
+ * <ul>
+ *  <li>Enabled</li>
+ *  <li>Mouse Over</li>
+ *  <li>Pressed</li>
+ *  <li>Disabled</li>
+ *  <li>Focused</li>
+ *  <li>Selected</li>
+ *  <li>Default</li>
+ * </ul>
+ *
+ * <p>However, there are many more states that could be described in a LookAndFeel, and it
+ * would be nice to style components differently based on these different states.
+ * For example, a progress bar could be "indeterminate". It would be very convenient
+ * to allow this to be defined as a "state".</p>
+ *
+ * <p>This class, State, is intended to be used for such situations.
+ * Simply implement the abstract #isInState method. It returns true if the given
+ * JComponent is "in this state", false otherwise. This method will be called
+ * <em>many</em> times in <em>performance sensitive loops</em>. It must execute
+ * very quickly.</p>
+ *
+ * <p>For example, the following might be an implementation of a custom
+ * "Indeterminate" state for JProgressBars:</p>
+ *
+ * <pre><code>
+ *     public final class IndeterminateState extends State&lt;JProgressBar&gt; {
+ *         public IndeterminateState() {
+ *             super("Indeterminate");
+ *         }
+ *
+ *         &#64;Override
+ *         protected boolean isInState(JProgressBar c) {
+ *             return c.isIndeterminate();
+ *         }
+ *     }
+ * </code></pre>
+ */
+public abstract class State<T extends JComponent>{
+    static final Map<String, StandardState> standardStates = new HashMap<String, StandardState>(7);
+    static final State Enabled = new StandardState(SynthConstants.ENABLED);
+    static final State MouseOver = new StandardState(SynthConstants.MOUSE_OVER);
+    static final State Pressed = new StandardState(SynthConstants.PRESSED);
+    static final State Disabled = new StandardState(SynthConstants.DISABLED);
+    static final State Focused = new StandardState(SynthConstants.FOCUSED);
+    static final State Selected = new StandardState(SynthConstants.SELECTED);
+    static final State Default = new StandardState(SynthConstants.DEFAULT);
+
+    private String name;
+
+    /**
+     * <p>Create a new custom State. Specify the name for the state. The name should
+     * be unique within the states set for any one particular component.
+     * The name of the state should coincide with the name used in UIDefaults.</p>
+     *
+     * <p>For example, the following would be correct:</p>
+     * <pre><code>
+     *     defaults.put("Button.States", "Enabled, Foo, Disabled");
+     *     defaults.put("Button.Foo", new FooState("Foo"));
+     * </code></pre>
+     *
+     * @param name a simple user friendly name for the state, such as "Indeterminate"
+     *        or "EmbeddedPanel" or "Blurred". It is customary to use camel case,
+     *        with the first letter capitalized.
+     */
+    protected State(String name) {
+        this.name = name;
+    }
+
+    @Override public String toString() { return name; }
+
+    /**
+     * <p>This is the main entry point, called by NimbusStyle.</p>
+     *
+     * <p>There are both custom states and standard states. Standard states
+     * correlate to the states defined in SynthConstants. When a UI delegate
+     * constructs a SynthContext, it specifies the state that the component is
+     * in according to the states defined in SynthConstants. Our NimbusStyle
+     * will then take this state, and query each State instance in the style
+     * asking whether isInState(c, s).</p>
+     *
+     * <p>Now, only the standard states care about the "s" param. So we have
+     * this odd arrangement:</p>
+     * <ul>
+     *     <li>NimbusStyle calls State.isInState(c, s)</li>
+     *     <li>State.isInState(c, s) simply delegates to State.isInState(c)</li>
+     *     <li><em>EXCEPT</em>, StandardState overrides State.isInState(c, s) and
+     *         returns directly from that method after checking its state, and
+     *         does not call isInState(c) (since it is not needed for standard states).</li>
+     * </ul>
+     */
+    boolean isInState(T c, int s) {
+        return isInState(c);
+    }
+
+    /**
+     * <p>Gets whether the specified JComponent is in the custom state represented
+     * by this class. <em>This is an extremely performance sensitive loop.</em>
+     * Please take proper precautions to ensure that it executes quickly.</p>
+     *
+     * <p>Nimbus uses this method to help determine what state a JComponent is
+     * in. For example, a custom State could exist for JProgressBar such that
+     * it would return <code>true</code> when the progress bar is indeterminate.
+     * Such an implementation of this method would simply be:</p>
+     *
+     * <pre><code> return c.isIndeterminate();</code></pre>
+     *
+     * @param c the JComponent to test. This will never be null.
+     * @return true if <code>c</code> is in the custom state represented by
+     *         this <code>State</code> instance
+     */
+    protected abstract boolean isInState(T c);
+
+    String getName() { return name; }
+
+    static boolean isStandardStateName(String name) {
+        return standardStates.containsKey(name);
+    }
+
+    static StandardState getStandardState(String name) {
+        return standardStates.get(name);
+    }
+
+    static final class StandardState extends State<JComponent> {
+        private int state;
+
+        private StandardState(int state) {
+            super(toString(state));
+            this.state = state;
+            standardStates.put(getName(), this);
+        }
+
+        public int getState() {
+            return state;
+        }
+
+        @Override
+        boolean isInState(JComponent c, int s) {
+            return (s & state) == state;
+        }
+
+        @Override
+        protected boolean isInState(JComponent c) {
+            throw new AssertionError("This method should never be called");
+        }
+
+        private static String toString(int state) {
+            StringBuffer buffer = new StringBuffer();
+            if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
+                buffer.append("Default");
+            }
+            if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("Disabled");
+            }
+            if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("Enabled");
+            }
+            if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("Focused");
+            }
+            if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("MouseOver");
+            }
+            if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("Pressed");
+            }
+            if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
+                if (buffer.length() > 0) buffer.append("+");
+                buffer.append("Selected");
+            }
+            return buffer.toString();
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template
new file mode 100644
index 0000000..74ddc93
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/StateImpl.template
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package ${PACKAGE};
+
+import java.awt.*;
+import javax.swing.*;
+
+
+class ${STATE_NAME} extends State {
+    ${STATE_NAME}() {
+        super("${STATE_KEY}");
+    }
+
+    @Override protected boolean isInState(JComponent c) {
+${BODY}
+    }
+}
+
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java
new file mode 100644
index 0000000..6abec9a
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java
@@ -0,0 +1,2802 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import java.awt.*;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.image.BufferedImage;
+import java.util.*;
+import javax.swing.*;
+import javax.swing.plaf.synth.SynthContext;
+import javax.swing.plaf.synth.SynthPainter;
+import javax.swing.plaf.synth.SynthConstants;
+
+import javax.swing.Painter;
+
+
+class SynthPainterImpl extends SynthPainter {
+    private NimbusStyle style;
+
+    SynthPainterImpl(NimbusStyle style) {
+        this.style = style;
+    }
+
+    /**
+     * Paint the provided painter using the provided transform at the specified
+     * position and size. Handles if g is a non 2D Graphics by painting via a
+     * BufferedImage.
+     */
+    private void paint(Painter p, SynthContext ctx, Graphics g, int x, int y,
+                       int w, int h, AffineTransform transform) {
+        if (p != null) {
+            if (g instanceof Graphics2D){
+                Graphics2D gfx = (Graphics2D)g;
+                if (transform!=null){
+                    gfx.transform(transform);
+                }
+                gfx.translate(x, y);
+                p.paint(gfx, ctx.getComponent(), w, h);
+                gfx.translate(-x, -y);
+                if (transform!=null){
+                    try {
+                        gfx.transform(transform.createInverse());
+                    } catch (NoninvertibleTransformException e) {
+                        // this should never happen as we are in control of all
+                        // calls into this method and only ever pass in simple
+                        // transforms of rotate, flip and translates
+                        e.printStackTrace();
+                    }
+                }
+            } else {
+                // use image if we are printing to a Java 1.1 PrintGraphics as
+                // it is not a instance of Graphics2D
+                BufferedImage img = new BufferedImage(w,h,
+                        BufferedImage.TYPE_INT_ARGB);
+                Graphics2D gfx = img.createGraphics();
+                if (transform!=null){
+                    gfx.transform(transform);
+                }
+                p.paint(gfx, ctx.getComponent(), w, h);
+                gfx.dispose();
+                g.drawImage(img,x,y,null);
+                img = null;
+            }
+        }
+    }
+
+    private void paintBackground(SynthContext ctx, Graphics g, int x, int y,
+                                 int w, int h, AffineTransform transform) {
+        // if the background color of the component is 100% transparent
+        // then we should not paint any background graphics. This is a solution
+        // for there being no way of turning off Nimbus background painting as
+        // basic components are all non-opaque by default.
+        Component c = ctx.getComponent();
+        Color bg = (c != null) ? c.getBackground() : null;
+        if (bg == null || bg.getAlpha() > 0){
+            Painter backgroundPainter = style.getBackgroundPainter(ctx);
+            if (backgroundPainter != null) {
+                paint(backgroundPainter, ctx, g, x, y, w, h,transform);
+            }
+        }
+    }
+
+    private void paintForeground(SynthContext ctx, Graphics g, int x, int y,
+                                 int w, int h, AffineTransform transform) {
+        Painter foregroundPainter = style.getForegroundPainter(ctx);
+        if (foregroundPainter != null) {
+            paint(foregroundPainter, ctx, g, x, y, w, h,transform);
+        }
+    }
+
+    private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w,
+                             int h, AffineTransform transform) {
+        Painter borderPainter = style.getBorderPainter(ctx);
+        if (borderPainter != null) {
+            paint(borderPainter, ctx, g, x, y, w, h,transform);
+        }
+    }
+
+    private void paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
+        Component c = ctx.getComponent();
+        boolean ltr = c.getComponentOrientation().isLeftToRight();
+        // Don't RTL flip JSpliders as they handle it internaly
+        if (ctx.getComponent() instanceof JSlider) ltr = true;
+
+        if (orientation == SwingConstants.VERTICAL && ltr) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintBackground(ctx, g, y, x, h, w, transform);
+        } else if (orientation == SwingConstants.VERTICAL) {
+            AffineTransform transform = new AffineTransform();
+            transform.rotate(Math.toRadians(90));
+            transform.translate(0,-(x+w));
+            paintBackground(ctx, g, y, x, h, w, transform);
+        } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
+            paintBackground(ctx, g, x, y, w, h, null);
+        } else {
+            //horizontal and right-to-left orientation
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBackground(ctx, g, 0, 0, w, h, transform);
+        }
+    }
+
+    private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
+        Component c = ctx.getComponent();
+        boolean ltr = c.getComponentOrientation().isLeftToRight();
+        if (orientation == SwingConstants.VERTICAL && ltr) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintBorder(ctx, g, y, x, h, w, transform);
+        } else if (orientation == SwingConstants.VERTICAL) {
+            AffineTransform transform = new AffineTransform();
+            transform.rotate(Math.toRadians(90));
+            transform.translate(0, -(x + w));
+            paintBorder(ctx, g, y, 0, h, w, transform);
+        } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
+            paintBorder(ctx, g, x, y, w, h, null);
+        } else {
+            //horizontal and right-to-left orientation
+            paintBorder(ctx, g, x, y, w, h, null);
+        }
+    }
+
+    private void paintForeground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
+        Component c = ctx.getComponent();
+        boolean ltr = c.getComponentOrientation().isLeftToRight();
+        if (orientation == SwingConstants.VERTICAL && ltr) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintForeground(ctx, g, y, x, h, w, transform);
+        } else if (orientation == SwingConstants.VERTICAL) {
+            AffineTransform transform = new AffineTransform();
+            transform.rotate(Math.toRadians(90));
+            transform.translate(0, -(x + w));
+            paintForeground(ctx, g, y, 0, h, w, transform);
+        } else if (orientation == SwingConstants.HORIZONTAL && ltr) {
+            paintForeground(ctx, g, x, y, w, h, null);
+        } else {
+            //horizontal and right-to-left orientation
+            paintForeground(ctx, g, x, y, w, h, null);
+        }
+    }
+
+    /**
+     * Paints the background of an arrow button. Arrow buttons are created by
+     * some components, such as <code>JScrollBar</code>.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintArrowButtonBackground(SynthContext context,
+                                           Graphics g, int x, int y,
+                                           int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBackground(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the border of an arrow button. Arrow buttons are created by
+     * some components, such as <code>JScrollBar</code>.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintArrowButtonBorder(SynthContext context,
+                                       Graphics g, int x, int y,
+                                       int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the foreground of an arrow button. This method is responsible
+     * for drawing a graphical representation of a direction, typically
+     * an arrow. Arrow buttons are created by
+     * some components, such as <code>JScrollBar</code>
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param direction One of SwingConstants.NORTH, SwingConstants.SOUTH
+     *                  SwingConstants.EAST or SwingConstants.WEST
+     */
+    public void paintArrowButtonForeground(SynthContext context,
+                                           Graphics g, int x, int y,
+                                           int w, int h,
+                                           int direction) {
+        //assume that the painter is arranged with the arrow pointing... LEFT?
+        String compName = context.getComponent().getName();
+        boolean ltr = context.getComponent().
+                getComponentOrientation().isLeftToRight();
+        // The hard coding for spinners here needs to be replaced by a more
+        // general method for disabling rotation
+        if ("Spinner.nextButton".equals(compName) ||
+                "Spinner.previousButton".equals(compName)) {
+            if (ltr){
+                paintForeground(context, g, x, y, w, h, null);
+            } else {
+                AffineTransform transform = new AffineTransform();
+                transform.translate(w, 0);
+                transform.scale(-1, 1);
+                paintForeground(context, g, x, y, w, h, transform);
+            }
+        } else if (direction == SwingConstants.WEST) {
+            paintForeground(context, g, x, y, w, h, null);
+        } else if (direction == SwingConstants.NORTH) {
+            if (ltr){
+                AffineTransform transform = new AffineTransform();
+                transform.scale(-1, 1);
+                transform.rotate(Math.toRadians(90));
+                paintForeground(context, g, y, 0, h, w, transform);
+            } else {
+                AffineTransform transform = new AffineTransform();
+                transform.rotate(Math.toRadians(90));
+                transform.translate(0, -(x + w));
+                paintForeground(context, g, y, 0, h, w, transform);
+            }
+        } else if (direction == SwingConstants.EAST) {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(w, 0);
+            transform.scale(-1, 1);
+            paintForeground(context, g, x, y, w, h, transform);
+        } else if (direction == SwingConstants.SOUTH) {
+            if (ltr){
+                AffineTransform transform = new AffineTransform();
+                transform.rotate(Math.toRadians(-90));
+                transform.translate(-h, 0);
+                paintForeground(context, g, y, x, h, w, transform);
+            } else {
+                AffineTransform transform = new AffineTransform();
+                transform.scale(-1, 1);
+                transform.rotate(Math.toRadians(-90));
+                transform.translate(-(h+y), -(w+x));
+                paintForeground(context, g, y, x, h, w, transform);
+            }
+        }
+    }
+
+    /**
+     * Paints the background of a button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintButtonBackground(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintButtonBorder(SynthContext context,
+                                  Graphics g, int x, int y,
+                                  int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a check box menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintCheckBoxMenuItemBackground(SynthContext context,
+                                                Graphics g, int x, int y,
+                                                int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a check box menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintCheckBoxMenuItemBorder(SynthContext context,
+                                            Graphics g, int x, int y,
+                                            int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a check box.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintCheckBoxBackground(SynthContext context,
+                                        Graphics g, int x, int y,
+                                        int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a check box.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintCheckBoxBorder(SynthContext context,
+                                    Graphics g, int x, int y,
+                                    int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a color chooser.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintColorChooserBackground(SynthContext context,
+                                            Graphics g, int x, int y,
+                                            int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a color chooser.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintColorChooserBorder(SynthContext context,
+                                        Graphics g, int x, int y,
+                                        int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a combo box.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintComboBoxBackground(SynthContext context,
+                                        Graphics g, int x, int y,
+                                        int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBackground(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the border of a combo box.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintComboBoxBorder(SynthContext context,
+                                        Graphics g, int x, int y,
+                                        int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a desktop icon.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintDesktopIconBackground(SynthContext context,
+                                        Graphics g, int x, int y,
+                                        int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a desktop icon.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintDesktopIconBorder(SynthContext context,
+                                           Graphics g, int x, int y,
+                                           int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a desktop pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintDesktopPaneBackground(SynthContext context,
+                                           Graphics g, int x, int y,
+                                           int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a desktop pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintDesktopPaneBorder(SynthContext context,
+                                       Graphics g, int x, int y,
+                                       int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of an editor pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintEditorPaneBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of an editor pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintEditorPaneBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a file chooser.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintFileChooserBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a file chooser.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintFileChooserBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a formatted text field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintFormattedTextFieldBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBackground(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the border of a formatted text field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintFormattedTextFieldBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBorder(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBorder(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the background of an internal frame title pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintInternalFrameTitlePaneBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of an internal frame title pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintInternalFrameTitlePaneBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of an internal frame.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintInternalFrameBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of an internal frame.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintInternalFrameBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a label.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintLabelBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a label.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintLabelBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a list.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintListBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a list.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintListBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a menu bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a menu bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuItemBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuItemBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a menu.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a menu.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintMenuBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of an option pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintOptionPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of an option pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintOptionPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a panel.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPanelBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a panel.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPanelBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a password field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPasswordFieldBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a password field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPasswordFieldBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a popup menu.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPopupMenuBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a popup menu.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintPopupMenuBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a progress bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintProgressBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a progress bar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
+     *                    <code>JProgressBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintProgressBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of a progress bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintProgressBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a progress bar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
+     *                    <code>JProgressBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintProgressBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the foreground of a progress bar. is responsible for
+     * providing an indication of the progress of the progress bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation one of <code>JProgressBar.HORIZONTAL</code> or
+     *                    <code>JProgressBar.VERTICAL</code>
+     */
+    public void paintProgressBarForeground(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintForeground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of a radio button menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRadioButtonMenuItemBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a radio button menu item.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRadioButtonMenuItemBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a radio button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRadioButtonBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a radio button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRadioButtonBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a root pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRootPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a root pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintRootPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a scrollbar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a scrollbar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintScrollBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of a scrollbar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a scrollbar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintScrollBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the thumb of a scrollbar. The thumb provides
+     * a graphical indication as to how much of the Component is visible in a
+     * <code>JScrollPane</code>.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     */
+    public void paintScrollBarThumbBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of the thumb of a scrollbar. The thumb provides
+     * a graphical indication as to how much of the Component is visible in a
+     * <code>JScrollPane</code>.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     */
+    public void paintScrollBarThumbBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the track of a scrollbar. The track contains
+     * the thumb.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollBarTrackBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the track of a scrollbar. The track contains
+     * the thumb. This implementation invokes the method of the same name without
+     * the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintScrollBarTrackBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of the track of a scrollbar. The track contains
+     * the thumb.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollBarTrackBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the track of a scrollbar. The track contains
+     * the thumb. This implementation invokes the method of the same name without
+     * the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation Orientation of the JScrollBar, one of
+     *                    <code>JScrollBar.HORIZONTAL</code> or
+     *                    <code>JScrollBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintScrollBarTrackBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of a scroll pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a scroll pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintScrollPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a separator.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSeparatorBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a separator. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
+     *                           <code>JSeparator.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSeparatorBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of a separator.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSeparatorBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a separator. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
+     *                           <code>JSeparator.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSeparatorBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the foreground of a separator.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSeparator.HORIZONTAL</code> or
+     *                           <code>JSeparator.VERTICAL</code>
+     */
+    public void paintSeparatorForeground(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintForeground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSliderBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a slider. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSliderBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSliderBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a slider. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSliderBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the thumb of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     */
+    public void paintSliderThumbBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        if (context.getComponent().getClientProperty(
+                "Slider.paintThumbArrowShape") == Boolean.TRUE){
+            if (orientation == JSlider.HORIZONTAL){
+                orientation = JSlider.VERTICAL;
+            } else {
+                orientation = JSlider.HORIZONTAL;
+            }
+            paintBackground(context, g, x, y, w, h, orientation);
+        } else {
+            paintBackground(context, g, x, y, w, h, orientation);
+        }
+    }
+
+    /**
+     * Paints the border of the thumb of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     */
+    public void paintSliderThumbBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the track of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSliderTrackBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the track of a slider. This implementation invokes
+     * the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSliderTrackBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of the track of a slider.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSliderTrackBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the track of a slider. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSlider.HORIZONTAL</code> or
+     *                           <code>JSlider.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintSliderTrackBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of a spinner.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSpinnerBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a spinner.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSpinnerBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the divider of a split pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSplitPaneDividerBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the divider of a split pane. This implementation
+     * invokes the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
+     *                           <code>JSplitPane.VERTICAL_SPLIT</code>
+     * @since 1.6
+     */
+    public void paintSplitPaneDividerBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+       if (orientation == JSplitPane.HORIZONTAL_SPLIT) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintBackground(context, g, y, x, h, w, transform);
+       } else {
+            paintBackground(context, g, x, y, w, h, null);
+        }
+    }
+
+    /**
+     * Paints the foreground of the divider of a split pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
+     *                           <code>JSplitPane.VERTICAL_SPLIT</code>
+     */
+    public void paintSplitPaneDividerForeground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintForeground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the divider, when the user is dragging the divider, of a
+     * split pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JSplitPane.HORIZONTAL_SPLIT</code> or
+     *                           <code>JSplitPane.VERTICAL_SPLIT</code>
+     */
+    public void paintSplitPaneDragDivider(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a split pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSplitPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a split pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintSplitPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the area behind the tabs of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneTabAreaBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the area behind the tabs of a tabbed pane.
+     * This implementation invokes the method of the same name without the
+     * orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JTabbedPane.TOP</code>,
+     *                    <code>JTabbedPane.LEFT</code>,
+     *                    <code>JTabbedPane.BOTTOM</code>, or
+     *                    <code>JTabbedPane.RIGHT</code>
+     * @since 1.6
+     */
+    public void paintTabbedPaneTabAreaBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        if (orientation == JTabbedPane.LEFT) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintBackground(context, g, y, x, h, w, transform);
+        } else if (orientation == JTabbedPane.RIGHT) {
+            AffineTransform transform = new AffineTransform();
+            transform.rotate(Math.toRadians(90));
+            transform.translate(0, -(x + w));
+            paintBackground(context, g, y, 0, h, w, transform);
+        } else if (orientation == JTabbedPane.BOTTOM) {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(1, -1);
+            transform.translate(0,-h);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        } else {
+            paintBackground(context, g, x, y, w, h, null);
+        }
+    }
+
+    /**
+     * Paints the border of the area behind the tabs of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneTabAreaBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the area behind the tabs of a tabbed pane. This
+     * implementation invokes the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JTabbedPane.TOP</code>,
+     *                    <code>JTabbedPane.LEFT</code>,
+     *                    <code>JTabbedPane.BOTTOM</code>, or
+     *                    <code>JTabbedPane.RIGHT</code>
+     * @since 1.6
+     */
+    public void paintTabbedPaneTabAreaBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tab of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param tabIndex Index of tab being painted.
+     */
+    public void paintTabbedPaneTabBackground(SynthContext context, Graphics g,
+                                         int x, int y, int w, int h,
+                                         int tabIndex) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tab of a tabbed pane. This implementation
+     * invokes the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param tabIndex Index of tab being painted.
+     * @param orientation One of <code>JTabbedPane.TOP</code>,
+     *                    <code>JTabbedPane.LEFT</code>,
+     *                    <code>JTabbedPane.BOTTOM</code>, or
+     *                    <code>JTabbedPane.RIGHT</code>
+     * @since 1.6
+     */
+    public void paintTabbedPaneTabBackground(SynthContext context, Graphics g,
+                                         int x, int y, int w, int h,
+                                         int tabIndex, int orientation) {
+        if (orientation == JTabbedPane.LEFT) {
+            AffineTransform transform = new AffineTransform();
+            transform.scale(-1, 1);
+            transform.rotate(Math.toRadians(90));
+            paintBackground(context, g, y, x, h, w, transform);
+        } else if (orientation == JTabbedPane.RIGHT) {
+            AffineTransform transform = new AffineTransform();
+            transform.rotate(Math.toRadians(90));
+            transform.translate(0, -(x + w));
+            paintBackground(context, g, y, 0, h, w, transform);
+        } else if (orientation == JTabbedPane.BOTTOM) {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(1, -1);
+            transform.translate(0,-h);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        } else {
+            paintBackground(context, g, x, y, w, h, null);
+        }
+    }
+
+    /**
+     * Paints the border of a tab of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param tabIndex Index of tab being painted.
+     */
+    public void paintTabbedPaneTabBorder(SynthContext context, Graphics g,
+                                         int x, int y, int w, int h,
+                                         int tabIndex) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a tab of a tabbed pane. This implementation invokes
+     * the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param tabIndex Index of tab being painted.
+     * @param orientation One of <code>JTabbedPane.TOP</code>,
+     *                    <code>JTabbedPane.LEFT</code>,
+     *                    <code>JTabbedPane.BOTTOM</code>, or
+     *                    <code>JTabbedPane.RIGHT</code>
+     * @since 1.6
+     */
+    public void paintTabbedPaneTabBorder(SynthContext context, Graphics g,
+                                         int x, int y, int w, int h,
+                                         int tabIndex, int orientation) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the area that contains the content of the
+     * selected tab of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneContentBackground(SynthContext context,
+                                         Graphics g, int x, int y, int w,
+                                         int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the area that contains the content of the
+     * selected tab of a tabbed pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTabbedPaneContentBorder(SynthContext context, Graphics g,
+                                         int x, int y, int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the header of a table.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTableHeaderBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the header of a table.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTableHeaderBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a table.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTableBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a table.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTableBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a text area.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextAreaBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a text area.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextAreaBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a text pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextPaneBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a text pane.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextPaneBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a text field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextFieldBackground(SynthContext context,
+                                          Graphics g, int x, int y,
+                                          int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBackground(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBackground(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the border of a text field.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTextFieldBorder(SynthContext context,
+                                      Graphics g, int x, int y,
+                                      int w, int h) {
+        if (context.getComponent().getComponentOrientation().isLeftToRight()){
+            paintBorder(context, g, x, y, w, h, null);
+        } else {
+            AffineTransform transform = new AffineTransform();
+            transform.translate(x,y);
+            transform.scale(-1, 1);
+            transform.translate(-w,0);
+            paintBorder(context, g, 0, 0, w, h, transform);
+        }
+    }
+
+    /**
+     * Paints the background of a toggle button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToggleButtonBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a toggle button.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToggleButtonBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tool bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tool bar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of a tool bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a tool bar. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the tool bar's content area.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarContentBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the tool bar's content area. This implementation
+     * invokes the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarContentBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of the content area of a tool bar.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarContentBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the content area of a tool bar. This implementation
+     * invokes the method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarContentBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of the window containing the tool bar when it
+     * has been detached from its primary frame.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarDragWindowBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the window containing the tool bar when it
+     * has been detached from its primary frame. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarDragWindowBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h, int orientation) {
+        paintBackground(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the border of the window containing the tool bar when it
+     * has been detached from it's primary frame.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolBarDragWindowBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the window containing the tool bar when it
+     * has been detached from it's primary frame. This implementation invokes the
+     * method of the same name without the orientation.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
+     *                           <code>JToolBar.VERTICAL</code>
+     * @since 1.6
+     */
+    public void paintToolBarDragWindowBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h, int orientation) {
+        paintBorder(context, g, x, y, w, h, orientation);
+    }
+
+    /**
+     * Paints the background of a tool tip.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolTipBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a tool tip.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintToolTipBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of a tree.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTreeBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a tree.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTreeBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the background of the row containing a cell in a tree.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTreeCellBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of the row containing a cell in a tree.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTreeCellBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the focus indicator for a cell in a tree when it has focus.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintTreeCellFocus(SynthContext context,
+                                   Graphics g, int x, int y,
+                                   int w, int h) {
+        //TODO
+    }
+
+    /**
+     * Paints the background of the viewport.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintViewportBackground(SynthContext context,
+                                     Graphics g, int x, int y,
+                                     int w, int h) {
+        paintBackground(context, g, x, y, w, h, null);
+    }
+
+    /**
+     * Paints the border of a viewport.
+     *
+     * @param context SynthContext identifying the <code>JComponent</code> and
+     *        <code>Region</code> to paint to
+     * @param g <code>Graphics</code> to paint to
+     * @param x X coordinate of the area to paint to
+     * @param y Y coordinate of the area to paint to
+     * @param w Width of the area to paint to
+     * @param h Height of the area to paint to
+     */
+    public void paintViewportBorder(SynthContext context,
+                                 Graphics g, int x, int y,
+                                 int w, int h) {
+        paintBorder(context, g, x, y, w, h, null);
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/TableScrollPaneCorner.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/TableScrollPaneCorner.java
new file mode 100644
index 0000000..367fbff
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/TableScrollPaneCorner.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.swing.plaf.nimbus;
+
+import javax.swing.Painter;
+
+import javax.swing.JComponent;
+import javax.swing.UIManager;
+import javax.swing.plaf.UIResource;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+
+/**
+ * TableScrollPaneCorner - A simple component that paints itself using the table
+ * header background painter. It is used to fill the top right corner of
+ * scrollpane.
+ *
+ * @author Created by Jasper Potts (Jan 28, 2008)
+ */
+class TableScrollPaneCorner extends JComponent implements UIResource{
+
+    /**
+     * Paint the component using the Nimbus Table Header Background Painter
+     */
+    @Override protected void paintComponent(Graphics g) {
+        Painter painter = (Painter) UIManager.get(
+            "TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter");
+        if (painter != null){
+            if (g instanceof Graphics2D){
+                painter.paint((Graphics2D)g,this,getWidth()+1,getHeight());
+            } else {
+                // paint using image to not Graphics2D to support
+                // Java 1.1 printing API
+                BufferedImage img =  new BufferedImage(getWidth(),getHeight(),
+                        BufferedImage.TYPE_INT_ARGB);
+                Graphics2D g2 = (Graphics2D)img.getGraphics();
+                painter.paint(g2,this,getWidth()+1,getHeight());
+                g2.dispose();
+                g.drawImage(img,0,0,null);
+                img = null;
+            }
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/ToolBarSeparatorPainter.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/ToolBarSeparatorPainter.java
new file mode 100644
index 0000000..4ea45e1
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/ToolBarSeparatorPainter.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.swing.plaf.nimbus;
+
+import javax.swing.plaf.nimbus.AbstractRegionPainter.PaintContext.CacheMode;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import javax.swing.JComponent;
+
+/**
+ * A special painter implementation for tool bar separators in Nimbus.
+ * The designer tool doesn't have support for painters which render
+ * repeated patterns, but that's exactly what the toolbar separator design
+ * is for Nimbus. This custom painter is designed to handle this situation.
+ * When support is added to the design tool / code generator to deal with
+ * repeated patterns, then we can remove this class.
+ * <p>
+ */
+final class ToolBarSeparatorPainter extends AbstractRegionPainter {
+    private static final int SPACE = 3;
+    private static final int INSET = 2;
+
+    @Override
+    protected PaintContext getPaintContext() {
+        //the paint context returned will have a few dummy values. The
+        //implementation of doPaint doesn't bother with the "decode" methods
+        //but calculates where to paint the circles manually. As such, we
+        //only need to indicate in our PaintContext that we don't want this
+        //to ever be cached
+        return new PaintContext(
+                new Insets(1, 0, 1, 0),
+                new Dimension(38, 7),
+                false, CacheMode.NO_CACHING, 1, 1);
+    }
+
+    @Override
+    protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
+        //it is assumed that in the normal orientation the separator renders
+        //horizontally. Other code rotates it as necessary for a vertical
+        //separator.
+        g.setColor(c.getForeground());
+        int y = height / 2;
+        for (int i=INSET; i<=width-INSET; i+=SPACE) {
+            g.fillRect(i, y, 1, 1);
+        }
+    }
+}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html
new file mode 100644
index 0000000..1e170c4
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html
@@ -0,0 +1,207 @@
+<html>
+<head>
+<link href="style.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<h1 id="primaryColors">Primary Colors</h1>
+<table>
+<tr><th>Key</th><th>Value</th><th>Preview</th></tr>
+<tr>
+<td width="250"><code>control</code></td>
+<td><pre>#d6d9df (214,217,223)</pre></td>
+
+<td width="100" bgcolor="#d6d9df">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>info</code></td>
+<td><pre>#f2f2bd (242,242,189)</pre></td>
+<td width="100" bgcolor="#f2f2bd">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusAlertYellow</code></td>
+<td><pre>#ffdc23 (255,220,35)</pre></td>
+<td width="100" bgcolor="#ffdc23">&nbsp;</td>
+</tr>
+<tr>
+
+<td width="250"><code>nimbusBase</code></td>
+<td><pre>#33628c (51,98,140)</pre></td>
+<td width="100" bgcolor="#33628c">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusDisabledText</code></td>
+<td><pre>#8e8f91 (142,143,145)</pre></td>
+<td width="100" bgcolor="#8e8f91">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusFocus</code></td>
+<td><pre>#73a4d1 (115,164,209)</pre></td>
+
+<td width="100" bgcolor="#73a4d1">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusGreen</code></td>
+<td><pre>#b0b332 (176,179,50)</pre></td>
+<td width="100" bgcolor="#b0b332">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusInfoBlue</code></td>
+<td><pre>#2f5cb4 (47,92,180)</pre></td>
+<td width="100" bgcolor="#2f5cb4">&nbsp;</td>
+</tr>
+<tr>
+
+<td width="250"><code>nimbusLightBackground</code></td>
+<td><pre>#ffffff (255,255,255)</pre></td>
+<td width="100" bgcolor="#ffffff">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusOrange</code></td>
+<td><pre>#bf6204 (191,98,4)</pre></td>
+<td width="100" bgcolor="#bf6204">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusRed</code></td>
+<td><pre>#a92e22 (169,46,34)</pre></td>
+
+<td width="100" bgcolor="#a92e22">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusSelectedText</code></td>
+<td><pre>#ffffff (255,255,255)</pre></td>
+<td width="100" bgcolor="#ffffff">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusSelectionBackground</code></td>
+<td><pre>#39698a (57,105,138)</pre></td>
+<td width="100" bgcolor="#39698a">&nbsp;</td>
+</tr>
+<tr>
+
+<td width="250"><code>text</code></td>
+<td><pre>#000000 (0,0,0)</pre></td>
+<td width="100" bgcolor="#000000">&nbsp;</td>
+</tr>
+</table>
+
+<h1 id="secondaryColors">Secondary Colors</h1>
+<table>
+<tr><th>Key</th><th>Value</th><th>Preview</th></tr>
+<tr>
+<td width="250"><code>activeCaption</code></td>
+
+<td><pre>#babec6 (186,190,198)</pre></td>
+<td width="100" bgcolor="#babec6">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>background</code></td>
+<td><pre>#d6d9df (214,217,223)</pre></td>
+<td width="100" bgcolor="#d6d9df">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>controlDkShadow</code></td>
+<td><pre>#a4abb8 (164,171,184)</pre></td>
+<td width="100" bgcolor="#a4abb8">&nbsp;</td>
+
+</tr>
+<tr>
+<td width="250"><code>controlHighlight</code></td>
+<td><pre>#e9ecf2 (233,236,242)</pre></td>
+<td width="100" bgcolor="#e9ecf2">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>controlLHighlight</code></td>
+<td><pre>#f7f8fa (247,248,250)</pre></td>
+<td width="100" bgcolor="#f7f8fa">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>controlShadow</code></td>
+
+<td><pre>#ccd3e0 (204,211,224)</pre></td>
+<td width="100" bgcolor="#ccd3e0">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>controlText</code></td>
+<td><pre>#000000 (0,0,0)</pre></td>
+<td width="100" bgcolor="#000000">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>desktop</code></td>
+<td><pre>#3d6079 (61,96,121)</pre></td>
+<td width="100" bgcolor="#3d6079">&nbsp;</td>
+
+</tr>
+<tr>
+<td width="250"><code>inactiveCaption</code></td>
+<td><pre>#bdc1c8 (189,193,200)</pre></td>
+<td width="100" bgcolor="#bdc1c8">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>infoText</code></td>
+<td><pre>#000000 (0,0,0)</pre></td>
+<td width="100" bgcolor="#000000">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>menu</code></td>
+
+<td><pre>#edeff2 (237,239,242)</pre></td>
+<td width="100" bgcolor="#edeff2">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>menuText</code></td>
+<td><pre>#000000 (0,0,0)</pre></td>
+<td width="100" bgcolor="#000000">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusBlueGrey</code></td>
+<td><pre>#a9b0be (169,176,190)</pre></td>
+<td width="100" bgcolor="#a9b0be">&nbsp;</td>
+
+</tr>
+<tr>
+<td width="250"><code>nimbusBorder</code></td>
+<td><pre>#9297a1 (146,151,161)</pre></td>
+<td width="100" bgcolor="#9297a1">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>nimbusSelection</code></td>
+<td><pre>#39698a (57,105,138)</pre></td>
+<td width="100" bgcolor="#39698a">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>scrollbar</code></td>
+
+<td><pre>#cdd0d5 (205,208,213)</pre></td>
+<td width="100" bgcolor="#cdd0d5">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>textBackground</code></td>
+<td><pre>#39698a (57,105,138)</pre></td>
+<td width="100" bgcolor="#39698a">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>textForeground</code></td>
+<td><pre>#000000 (0,0,0)</pre></td>
+<td width="100" bgcolor="#000000">&nbsp;</td>
+
+</tr>
+<tr>
+<td width="250"><code>textHighlight</code></td>
+<td><pre>#39698a (57,105,138)</pre></td>
+<td width="100" bgcolor="#39698a">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>textHighlightText</code></td>
+<td><pre>#ffffff (255,255,255)</pre></td>
+<td width="100" bgcolor="#ffffff">&nbsp;</td>
+</tr>
+<tr>
+<td width="250"><code>textInactiveText</code></td>
+
+<td><pre>#8e8f91 (142,143,145)</pre></td>
+<td width="100" bgcolor="#8e8f91">&nbsp;</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html
new file mode 100644
index 0000000..bd3a0f4
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+Copyright 1998-2001 Sun Microsystems, Inc.  All Rights Reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Sun designates this
+particular file as subject to the "Classpath" exception as provided
+by Sun in the LICENSE file that accompanied this code.
+
+This code 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
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+CA 95054 USA or visit www.sun.com if you need additional information or
+have any questions.
+-->
+
+</head>
+<body bgcolor="white">
+
+Provides user interface objects built according to the cross-platform
+Nimbus look and feel.
+
+<p>Nimbus uses instances of the {@link javax.swing.Painter} interface to paint
+components. With each Swing component it associates a foreground and a
+background {@code Painter}, and there may be several painters for different
+component states.
+
+<p>Nimbus allows customizing many of its properties, including painters, by
+altering the {@link UIDefaults} table. Here's an example:
+<code><pre>
+    UIManager.put("ProgressBar.tileWidth", myTileWidth);
+    UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);
+    UIManager.put("ProgressBar[Enabled].foregroundPainter", myFgPainter);
+</pre></code>
+
+<p>Per-component customization is also possible. When rendering a component,
+Nimbus checks its client property named "Nimbus.Overrides". The value of this
+property should be an instance of {@code UIDefaults}. Settings from that table
+override the UIManager settings, but for that particular component instance
+only. An optional client property, "Nimbus.Overrides.InheritDefaults" of type
+Boolean, specifies whether the overriding settings should be merged with
+default ones ({@code true}), or replace them ({@code false}). By default they
+are merged:
+<code><pre>
+    JProgressBar bar = new JProgressBar();
+    UIDefaults overrides = new UIDefaults();
+    overrides.put("ProgressBar.cycleTime", 330);
+    ...
+    bar.putClientProperty("Nimbus.Overrides", overrides);
+    bar.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
+</pre></code>
+
+<p>Colors in Nimbus are derived from a core set of
+<a href="doc-files/properties.html#primaryColors">primary colors</a>. There are also
+<a href="doc-files/properties.html#secondaryColors">secondary colors</a>, which are
+derived from primary ones, but serve themselves as base colors for other
+derived colors. The derivation mechanism allows for runtime customization,
+i.e. if a primary or secondary color is changed, all colors that are derived
+from it are automatically updated. The method
+{@link javax.swing.plaf.nimbus.NimbusLookAndFeel#getDerivedColor(java.lang.String, float, float, float, int, boolean)}
+may be used to create a derived color.
+
+<p>These classes are designed to be used while the
+corresponding <code>LookAndFeel</code> class has been
+installed
+(<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
+Using them while a different <code>LookAndFeel</code> is installed
+may produce unexpected results, including exceptions.
+Additionally, changing the <code>LookAndFeel</code>
+maintained by the <code>UIManager</code> without updating the
+corresponding <code>ComponentUI</code> of any
+<code>JComponent</code>s may also produce unexpected results,
+such as the wrong colors showing up, and is generally not
+encouraged.
+
+<p><strong>Note:</strong>
+Most of the Swing API is <em>not</em> thread safe.
+For details, see
+<a
+href="http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html"
+target="_top">Threads and Swing</a>,
+a section in
+<em><a href="http://java.sun.com/docs/books/tutorial/"
+target="_top">The Java Tutorial</a></em>.
+
+@since 1.7
+@serial exclude
+
+</body>
+</html>
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf
new file mode 100644
index 0000000..ac2867b
--- /dev/null
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf
@@ -0,0 +1,28332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.  Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun in the LICENSE file that accompanied this code.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+
+<synthModel>
+   <insets>
+      <uiInsets name="zeroInsets">
+         <insets top="0" bottom="0" left="0" right="0"/>
+      </uiInsets>
+      <uiInsets name="twoInsets">
+         <insets top="2" bottom="2" left="2" right="2"/>
+      </uiInsets>
+      <uiInsets name="threeInsets">
+         <insets top="3" bottom="3" left="3" right="3"/>
+      </uiInsets>
+   </insets>
+   <colors>
+      <uiColor name="text">
+         <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="control">
+         <matte red="214" green="217" blue="223" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusBase">
+         <matte red="51" green="98" blue="140" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusBlueGrey">
+         <matte red="169" green="176" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.52518797" brightnessOffset="0.19607842" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusOrange">
+         <matte red="191" green="98" blue="4" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusGreen">
+         <matte red="176" green="179" blue="50" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusRed">
+         <matte red="169" green="46" blue="34" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusBorder">
+         <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusSelection">
+         <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.010750473" saturationOffset="-0.04875779" brightnessOffset="-0.007843137" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusInfoBlue">
+         <matte red="47" green="92" blue="180" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusAlertYellow">
+         <matte red="255" green="220" blue="35" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusFocus">
+         <matte red="115" green="164" blue="209" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusSelectedText">
+         <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusSelectionBackground">
+         <matte red="57" green="105" blue="138" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusDisabledText">
+         <matte red="142" green="143" blue="145" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="nimbusLightBackground">
+         <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="infoText">
+         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="info">
+         <matte red="242" green="242" blue="189" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="menuText">
+         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="menu">
+         <matte red="237" green="239" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6150531" brightnessOffset="0.39999998" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="scrollbar">
+         <matte red="205" green="208" blue="213" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07296763" brightnessOffset="0.09019607" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="controlText">
+         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="controlHighlight">
+         <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="controlLHighlight">
+         <matte red="247" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="controlShadow">
+         <matte red="204" green="211" blue="224" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+      </uiColor>
+       <uiColor name="controlDkShadow">
+         <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="textHighlight">
+         <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="textHighlightText">
+         <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="textInactiveText">
+         <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="desktop">
+         <matte red="61" green="96" blue="121" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.009207249" saturationOffset="-0.13984653" brightnessOffset="-0.07450983" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="activeCaption">
+         <matte red="186" green="190" blue="198" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049920253" brightnessOffset="0.031372547" alphaOffset="0"/>
+      </uiColor>
+      <uiColor name="inactiveCaption">
+         <matte red="189" green="193" blue="200" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.055526316" brightnessOffset="0.039215684" alphaOffset="0"/>
+      </uiColor>
+   </colors>
+   <fonts>
+      <uiFont name="InternalFrame.titleFont">
+        <typeface uiDefaultParentName="defaultFont" bold="On"/>
+      </uiFont>
+   </fonts>
+   <style>
+      <textForeground>
+         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </textForeground>
+      <textBackground>
+         <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </textBackground>
+      <background>
+         <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+      </background>
+      <inherit-textForeground>false</inherit-textForeground>
+      <inherit-textBackground>false</inherit-textBackground>
+      <inherit-background>false</inherit-background>
+      <cacheSettingsInherited>false</cacheSettingsInherited>
+      <uiproperties>
+          <uiProperty name="TitledBorder.position" type="STRING" value="ABOVE_TOP"/>
+          <uiProperty name="FileView.fullRowSelection" type="BOOLEAN" value="TRUE"/>
+      </uiproperties>
+   </style>
+   <components>
+      <uiComponent opaque="false" type="javax.swing.plaf.synth.SynthArrowButton" name="ArrowButton" ui="SynthArrowButtonUI" subregion="true">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <uiproperties>
+               <uiProperty name="size" type="INT" value="16"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="10" height="10"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="10" height="10"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="167" green="171" blue="178" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.57391655" brightnessOffset="0.1490196" alphaOffset="0"/>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="2.0" cp1x="8.0" cp1y="2.0" cp2x="8.0" cp2y="2.0"/>
+                              <point x="2.0" y="5.0" cp1x="2.0" cp1y="5.0" cp2x="2.0" cp2y="5.0"/>
+                              <point x="8.0" y="8.0" cp1x="8.0" cp1y="8.0" cp2x="8.0" cp2y="8.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="10" height="10"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="45" green="45" blue="45" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.37254906" alphaOffset="0"/>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="2.0" cp1x="8.0" cp1y="2.0" cp2x="8.0" cp2y="2.0"/>
+                              <point x="2.0" y="5.0" cp1x="2.0" cp1y="5.0" cp2x="2.0" cp2y="5.0"/>
+                              <point x="8.0" y="8.0" cp1x="8.0" cp1y="8.0" cp2x="8.0" cp2y="8.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </foregroundStates>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="14" right="14"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+            <uiproperties>
+               <uiProperty name="defaultButtonFollowsFocus" type="BOOLEAN" value="false"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Default">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="246" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="223" green="230" blue="237" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5766426" brightnessOffset="0.38039213" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="193" green="214" blue="233" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46404046" brightnessOffset="0.36470586" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="213" green="234" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47761154" brightnessOffset="0.44313723" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Default+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="246" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="223" green="230" blue="237" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5766426" brightnessOffset="0.38039213" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="193" green="214" blue="233" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46404046" brightnessOffset="0.36470586" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="213" green="234" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47761154" brightnessOffset="0.44313723" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Default">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="248" green="250" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="230" green="237" blue="243" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.5822163" brightnessOffset="0.40392154" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="212" green="233" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47698414" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="232" green="253" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.06415892" saturationOffset="-0.5455182" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="9.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Default+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="248" green="250" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="230" green="237" blue="243" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.5822163" brightnessOffset="0.40392154" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="212" green="233" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47698414" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="232" green="253" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.06415892" saturationOffset="-0.5455182" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Default">
+               <style>
+                  <textForeground>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="143" green="169" blue="192" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="118" green="149" blue="178" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.001903832" saturationOffset="-0.29863563" brightnessOffset="0.1490196" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="51" green="98" blue="140" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="51" green="98" blue="140" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="91" green="137" blue="180" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0018727183" saturationOffset="-0.14126986" brightnessOffset="0.15686274" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="118" green="164" blue="206" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.20852983" brightnessOffset="0.2588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="255" green="255" blue="255" alpha="160" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-95"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Default+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="143" green="169" blue="192" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="118" green="149" blue="178" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.001903832" saturationOffset="-0.29863563" brightnessOffset="0.1490196" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="51" green="98" blue="140" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="51" green="98" blue="140" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="91" green="137" blue="180" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0018727183" saturationOffset="-0.14126986" brightnessOffset="0.15686274" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="118" green="164" blue="206" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.20852983" brightnessOffset="0.2588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08477524" brightnessOffset="0.16862744" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.5">
+                                 <matte red="223" green="226" blue="230" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.080091536" brightnessOffset="0.15686274" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="216" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07052632" brightnessOffset="0.1372549" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="218" green="221" blue="227" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.070878744" brightnessOffset="0.14509803" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="0.07843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="188" green="191" blue="197" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06484103" brightnessOffset="0.027450979" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="23" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-232"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="241" green="242" blue="244" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.09823123" brightnessOffset="0.2117647" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="244" green="247" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0749532" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.6">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="149" green="155" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0147816315" brightnessOffset="-0.3764706" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.5">
+                                 <matte red="241" green="242" blue="244" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.09823123" brightnessOffset="0.2117647" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="244" green="247" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0749532" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="149" green="155" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0147816315" brightnessOffset="-0.3764706" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="247" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background"  uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background"  uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="247" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="194" green="199" blue="207" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="204" green="211" blue="224" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="231" green="237" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="5.847961E-4" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="245" green="250" blue="255" alpha="160" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="194" green="199" blue="207" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="204" green="211" blue="224" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="231" green="237" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="5.847961E-4" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JToggleButton" name="ToggleButton" ui="ToggleButtonUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="14" right="14"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08477524" brightnessOffset="0.16862744" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.5">
+                                 <matte red="223" green="226" blue="230" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.080091536" brightnessOffset="0.15686274" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="216" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07052632" brightnessOffset="0.1372549" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="218" green="221" blue="227" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.070878744" brightnessOffset="0.14509803" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="0.07843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="188" green="191" blue="197" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06484103" brightnessOffset="0.027450979" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="23" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-232"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="241" green="242" blue="244" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.09823123" brightnessOffset="0.2117647" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="244" green="247" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0749532" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.6">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="149" green="155" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0147816315" brightnessOffset="-0.3764706" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.5">
+                                 <matte red="241" green="242" blue="244" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.09823123" brightnessOffset="0.2117647" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="244" green="247" blue="253" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0749532" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="149" green="155" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0147816315" brightnessOffset="-0.3764706" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="247" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="92" green="94" blue="96" alpha="65" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-190"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="247" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.09" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="194" green="199" blue="207" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="204" green="211" blue="224" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="231" green="237" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="5.847961E-4" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                           <matte red="245" green="250" blue="255" alpha="160" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Button Layer">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.4">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.06" midpoint="0.4">
+                                 <matte red="194" green="199" blue="207" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.7" midpoint="0.6">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.96" midpoint="0.6">
+                                 <matte red="204" green="211" blue="224" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="231" green="237" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.95" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="5.847961E-4" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="164" green="166" blue="172" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.06401469" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="190" green="193" blue="199" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06530018" brightnessOffset="0.035294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="189" green="192" blue="198" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06507177" brightnessOffset="0.031372547" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="125" green="127" blue="131" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06472479" brightnessOffset="-0.23137254" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="164" green="166" blue="171" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.06959064" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="9.0">
+                           <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139ecfc04b.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="164" green="166" blue="172" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.06401469" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="190" green="193" blue="199" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06530018" brightnessOffset="0.035294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="189" green="192" blue="198" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06507177" brightnessOffset="0.031372547" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="125" green="127" blue="131" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06472479" brightnessOffset="-0.23137254" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="164" green="166" blue="171" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.06959064" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Selected">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="117" green="121" blue="126" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.018518567" saturationOffset="-0.03909774" brightnessOffset="-0.2509804" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="145" green="149" blue="156" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.040013492" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="144" green="147" blue="155" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.039558575" brightnessOffset="-0.1372549" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="66" green="68" blue="70" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.05338346" brightnessOffset="-0.47058824" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="92" green="94" blue="98" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049301825" brightnessOffset="-0.36078432" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="9.0">
+                           <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139ed92ed8.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Selected+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="117" green="121" blue="126" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.018518567" saturationOffset="-0.03909774" brightnessOffset="-0.2509804" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="145" green="149" blue="156" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.040013492" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="144" green="147" blue="155" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.039558575" brightnessOffset="-0.1372549" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="66" green="68" blue="70" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.05338346" brightnessOffset="-0.47058824" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="92" green="94" blue="98" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049301825" brightnessOffset="-0.36078432" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Selected">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="149" green="152" blue="157" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="173" green="176" blue="182" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="172" green="175" blue="181" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="9.0">
+                           <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139eda6220.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Selected+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="149" green="152" blue="157" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="173" green="176" blue="182" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="172" green="175" blue="181" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="11.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+Selected">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="72" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="7.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="203" green="206" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06807348" brightnessOffset="0.086274505" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.13368984" midpoint="0.5">
+                                 <matte red="209" green="212" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06924191" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="209" green="212" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06924191" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="9.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="195" green="198" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.066408664" brightnessOffset="0.054901958" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="203" green="206" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06807348" brightnessOffset="0.086274505" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="9.0">
+                           <matte red="255" green="255" blue="255" alpha="35" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-220"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139edb5619.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JRadioButton" name="RadioButton" ui="RadioButtonUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="7" bottom="7" left="7" right="7"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="Icon" subregion="true" key="icon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="226" green="228" blue="232" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08466425" brightnessOffset="0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36858007" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.72809666" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.82175225" midpoint="0.5">
+                                       <matte red="217" green="220" blue="226" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.070703305" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="216" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07052632" brightnessOffset="0.1372549" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="185" green="188" blue="194" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06413457" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="250" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10654225" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43674698" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.52409637" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="225" green="228" blue="234" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07206477" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="148" green="151" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.053201474" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="68" green="71" blue="77" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.006356798" brightnessOffset="-0.44313726" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="169" green="176" blue="190" alpha="143" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-112"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138ddc021b.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="250" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10654225" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43674698" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.52409637" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="225" green="228" blue="234" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07206477" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="148" green="151" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.053201474" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="68" green="71" blue="77" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.006356798" brightnessOffset="-0.44313726" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="251" green="252" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36858007" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.72809666" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.82175225" midpoint="0.5">
+                                       <matte red="246" green="244" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.08585858" saturationOffset="-0.067389056" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="235" green="236" blue="236" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10628903" brightnessOffset="0.18039215" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="126" blue="133" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.027819552" brightnessOffset="-0.2235294" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="22" green="26" blue="34" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.24241486" brightnessOffset="-0.6117647" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="169" green="176" blue="190" alpha="143" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-112"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138de7a9a7.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="251" green="252" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36858007" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.72809666" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.82175225" midpoint="0.5">
+                                       <matte red="246" green="244" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.08585858" saturationOffset="-0.067389056" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="235" green="236" blue="236" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10628903" brightnessOffset="0.18039215" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="126" blue="133" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.027819552" brightnessOffset="-0.2235294" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="22" green="26" blue="34" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.24241486" brightnessOffset="-0.6117647" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="206" green="209" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06866585" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.35240963" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5481928" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9487952" midpoint="0.5">
+                                       <matte red="192" green="198" blue="211" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.002924025" saturationOffset="-0.02047892" brightnessOffset="0.082352936" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="13" green="13" blue="20" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.23947367" brightnessOffset="-0.6666667" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="113" green="117" blue="118" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0777778" saturationOffset="-0.06815343" brightnessOffset="-0.28235295" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138e896368.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.06344411" midpoint="0.5">
+                                       <matte red="206" green="209" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06866585" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.35240963" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5481928" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9487952" midpoint="0.5">
+                                       <matte red="192" green="198" blue="211" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.002924025" saturationOffset="-0.02047892" brightnessOffset="0.082352936" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="13" green="13" blue="20" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.23947367" brightnessOffset="-0.6666667" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="113" green="117" blue="118" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0777778" saturationOffset="-0.06815343" brightnessOffset="-0.28235295" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="101" green="103" blue="105" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07243107" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0813253" midpoint="0.5">
+                                       <matte red="244" green="246" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6195853" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12048193" midpoint="0.5">
+                                       <matte red="217" green="225" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.56704473" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45783132" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.77409637" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="174" green="195" blue="214" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44879842" brightnessOffset="0.29019606" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="100" green="120" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.36035198" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="20" green="40" blue="58" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="0.019458115" brightnessOffset="-0.32156867" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="169" green="176" blue="190" alpha="143" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-112"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138e15047c.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="101" green="103" blue="105" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07243107" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0813253" midpoint="0.5">
+                                       <matte red="244" green="246" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6195853" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12048193" midpoint="0.5">
+                                       <matte red="217" green="225" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.56704473" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45783132" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.77409637" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="174" green="195" blue="214" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44879842" brightnessOffset="0.29019606" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="100" green="120" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.36035198" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="20" green="40" blue="58" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="0.019458115" brightnessOffset="-0.32156867" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="64" green="65" blue="66" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.080223285" brightnessOffset="-0.4862745" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.039156627" midpoint="0.5">
+                                       <matte red="157" green="178" blue="196" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4367347" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11746988" midpoint="0.5">
+                                       <matte red="122" green="153" blue="180" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0010654926" saturationOffset="-0.31349206" brightnessOffset="0.15686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45783132" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.66566265" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="82" green="127" blue="168" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.05676E-4" saturationOffset="-0.12380952" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="13" green="13" blue="13" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.49803925" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="20" green="40" blue="58" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="0.019458115" brightnessOffset="-0.32156867" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="49" green="75" blue="100" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0030477047" saturationOffset="-0.1257143" brightnessOffset="-0.15686277" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138e817331.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="64" green="65" blue="66" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.080223285" brightnessOffset="-0.4862745" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.039156627" midpoint="0.5">
+                                       <matte red="157" green="178" blue="196" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4367347" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11746988" midpoint="0.5">
+                                       <matte red="122" green="153" blue="180" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0010654926" saturationOffset="-0.31349206" brightnessOffset="0.15686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45783132" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.66566265" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="82" green="127" blue="168" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.05676E-4" saturationOffset="-0.12380952" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="13" green="13" blue="13" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.49803925" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="20" green="40" blue="58" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="0.019458115" brightnessOffset="-0.32156867" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="49" green="75" blue="100" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0030477047" saturationOffset="-0.1257143" brightnessOffset="-0.15686277" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="101" green="103" blue="105" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07243107" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0813253" midpoint="0.5">
+                                       <matte red="245" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.011985004" saturationOffset="-0.6157143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12048193" midpoint="0.5">
+                                       <matte red="225" green="233" blue="241" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.56932425" brightnessOffset="0.3960784" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.28313252" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7018072" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.810241" midpoint="0.5">
+                                       <matte red="195" green="216" blue="235" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46550155" brightnessOffset="0.372549" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="190" green="209" blue="227" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0024294257" saturationOffset="-0.47271872" brightnessOffset="0.34117645" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="62" green="87" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-6.374717E-4" saturationOffset="-0.20452163" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="11" green="11" blue="11" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.5058824" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="16.0" y1="3.0" y2="17.0">
+                                 <matte red="169" green="176" blue="190" alpha="143" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-112"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138e7b96f2.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="101" green="103" blue="105" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07243107" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="30" blue="33" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="0.07129187" brightnessOffset="-0.6156863" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0813253" midpoint="0.5">
+                                       <matte red="245" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.011985004" saturationOffset="-0.6157143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12048193" midpoint="0.5">
+                                       <matte red="225" green="233" blue="241" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.56932425" brightnessOffset="0.3960784" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.28313252" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7018072" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.810241" midpoint="0.5">
+                                       <matte red="195" green="216" blue="235" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46550155" brightnessOffset="0.372549" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="190" green="209" blue="227" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0024294257" saturationOffset="-0.47271872" brightnessOffset="0.34117645" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="62" green="87" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-6.374717E-4" saturationOffset="-0.20452163" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="11" green="11" blue="11" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.5058824" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="17.4" y1="0.6" y2="17.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="6.0" x2="12.0" y1="6.0" y2="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="181" green="185" blue="191" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.058170296" brightnessOffset="0.0039215684" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46385542" midpoint="0.5">
+                                       <matte red="163" green="168" blue="175" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.04195489" brightnessOffset="-0.058823526" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="170" green="175" blue="188" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.009259284" saturationOffset="-0.0147816315" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5049019607843137" y1="0.0" x2="0.4950980392156863" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="15.0" y1="3.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0813253" midpoint="0.5">
+                                       <matte red="219" green="223" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5878882" brightnessOffset="0.35294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45783132" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88554215" midpoint="0.5">
+                                       <matte red="206" green="212" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.567841" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49754901960784303" y1="0.004901960784313727" x2="0.507352941176471" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="16.0" y1="2.0" y2="16.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="191" green="198" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.56289876" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="176" green="182" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.016586483" saturationOffset="-0.5620301" brightnessOffset="0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.49789915966386533" y1="-0.0042016806722689065" x2="0.5000000000000002" y2="0.9978991596638656"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138e83122d.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JCheckBox" name="CheckBox" ui="CheckBoxUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="104" height="33"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="Icon" subregion="true" key="icon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.60996324" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="214" green="217" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02551502" saturationOffset="-0.5996783" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="219" green="222" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.59624064" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="188" green="191" blue="197" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06484103" brightnessOffset="0.027450979" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.63174605" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="239" green="242" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.59942394" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="86" green="89" blue="95" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.015789472" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="169" green="176" blue="190" alpha="166" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-89"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138ec6661e.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.63174605" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="239" green="242" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.59942394" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="158" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.05356429" brightnessOffset="-0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="86" green="89" blue="95" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.015789472" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5985242" brightnessOffset="0.39999998" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="44" green="47" blue="55" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="0.08947369" brightnessOffset="-0.5294118" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="169" green="176" blue="190" alpha="166" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-89"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5985242" brightnessOffset="0.39999998" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="44" green="47" blue="55" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="0.08947369" brightnessOffset="-0.5294118" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.52701867" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="184" green="191" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.5376751" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="95" green="99" blue="107" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0016232133" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="169" green="176" blue="190" alpha="166" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-89"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.52701867" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="184" green="191" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.5376751" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="0.8894737" brightnessOffset="-0.7176471" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="95" green="99" blue="107" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0016232133" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="166" green="187" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44153953" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="188" green="209" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4602757" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="35" green="56" blue="75" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.10238093" brightnessOffset="-0.25490198" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="169" green="176" blue="190" alpha="166" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-89"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1138ed19809.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="166" green="187" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44153953" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="188" green="209" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4602757" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="35" green="56" blue="75" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.10238093" brightnessOffset="-0.25490198" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11550152" midpoint="0.5">
+                                       <matte red="115" green="148" blue="176" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0021489263" saturationOffset="-0.2891234" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="51" green="98" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.006362498" saturationOffset="-0.016311288" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="106" green="153" blue="195" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.17930403" brightnessOffset="0.21568626" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="55" blue="80" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.026785731" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11550152" midpoint="0.5">
+                                       <matte red="115" green="148" blue="176" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0021489263" saturationOffset="-0.2891234" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="51" green="98" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.006362498" saturationOffset="-0.016311288" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="106" green="153" blue="195" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.17930403" brightnessOffset="0.21568626" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="27" green="55" blue="80" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.026785731" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="207" green="228" blue="247" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47377098" brightnessOffset="0.41960782" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="6" blue="30" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="0.3642857" brightnessOffset="-0.43137258" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="11.0" y2="17.0" rounding="5.176470588235279">
+                                 <matte red="169" green="176" blue="190" alpha="166" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-89"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="207" green="228" blue="247" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47377098" brightnessOffset="0.41960782" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="6" blue="30" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="0.3642857" brightnessOffset="-0.43137258" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="17.4" y1="0.6" y2="17.4" rounding="7.999999999999999">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="18"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="166" green="170" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5735674" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="5.029411764705882" y="8.058823529411764" cp1x="5.029411764705882" cp1y="8.058823529411764" cp2x="5.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="7.029411764705882" y="8.058823529411764" cp1x="7.029411764705882" cp1y="8.058823529411764" cp2x="7.029411764705882" cp2y="8.058823529411764"/>
+                                    <point x="8.441176470588236" y="11.058823529411764" cp1x="8.441176470588236" cp1y="11.058823529411764" cp2x="8.441176470588236" cp2y="11.058823529411764"/>
+                                    <point x="11.588235294117647" y="3.117647058823529" cp1x="11.588235294117647" cp1y="3.117647058823529" cp2x="11.588235294117647" cp2y="3.117647058823529"/>
+                                    <point x="14.0" y="3.0882352941176467" cp1x="14.0" cp1y="3.0882352941176467" cp2x="14.0" cp2y="3.0882352941176467"/>
+                                    <point x="8.941176470588236" y="13.029411764705882" cp1x="8.941176470588236" cp1y="13.029411764705882" cp2x="8.941176470588236" cp2y="13.029411764705882"/>
+                                    <point x="8.058823529411764" y="13.029411764705882" cp1x="8.058823529411764" cp1y="13.029411764705882" cp2x="8.058823529411764" cp2y="13.029411764705882"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="15.0" y1="3.0" y2="15.0" rounding="3.764705882352935">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="224" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.59223604" brightnessOffset="0.35294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64457834" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="209" green="215" blue="224" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56875" brightnessOffset="0.32941175" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2500000000000003" y2="0.9975490196078431"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="16.0" y1="2.0" y2="16.0" rounding="3.705882352941174">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="191" green="197" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.03771078" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="178" green="185" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02222222" saturationOffset="-0.032806106" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25210084033613445" y2="0.9957983193277311"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JColorChooser" name="ColorChooser" ui="ColorChooserUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="5" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="swatchesDefaultRecentColor" type="COLOR">
+                  <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="false" componentName="ColorChooser.previewPanelHolder" type="javax.swing.JPanel" name="Panel" ui="PanelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="10" left="5" right="5"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions>
+                  <uiComponent opaque="false" componentName="OptionPane.label" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+                     <stateTypes/>
+                     <contentMargins top="0" bottom="10" left="10" right="10"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="100" height="30"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes/>
+                                 <effects/>
+                              </layer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </uiComponent>
+               </regions>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JComboBox" name="ComboBox" ui="ComboBoxUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="MouseOver"/>
+            <stateType key="Pressed"/>
+            <stateType key="Selected"/>
+            <stateType key="Disabled"/>
+            <stateType key="Focused"/>
+            <stateType key="Editable">
+               <codeSnippet><![CDATA[
+                          return ((JComboBox)c).isEditable();]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+            <uiproperties>
+               <uiProperty name="forceOpaque" type="BOOLEAN" value="true"/>
+               <uiProperty name="buttonWhenNotEditable" type="BOOLEAN" value="true"/>
+               <uiProperty name="rendererUseListColors" type="BOOLEAN" value="false"/>
+               <uiProperty name="pressedWhenPopupVisible" type="BOOLEAN" value="true"/>
+               <uiProperty name="squareButton" type="BOOLEAN" value="false"/>
+               <uiProperty name="popupInsets" type="INSETS">
+                  <insets top="-2" bottom="0" left="2" right="2"/>
+               </uiProperty>
+               <uiProperty name="padding" type="INSETS">
+                  <insets top="3" bottom="3" left="3" right="3"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="220" green="224" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.59223604" brightnessOffset="0.35294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="210" green="215" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02391243" saturationOffset="-0.5774183" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="206" green="212" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.567841" brightnessOffset="0.31764704" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="191" green="197" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56289876" brightnessOffset="0.2588235" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="178" green="185" blue="193" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.55799407" brightnessOffset="0.20784312" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.60996324" brightnessOffset="0.36470586" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="219" green="221" blue="226" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.60474086" brightnessOffset="0.33725488" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="216" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5957143" brightnessOffset="0.3333333" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5928571" brightnessOffset="0.2745098" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="188" green="191" blue="197" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.590029" brightnessOffset="0.2235294" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="0" green="0" blue="0" alpha="8" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-247"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cff8896a.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="220" green="224" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.59223604" brightnessOffset="0.35294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="210" green="215" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02391243" saturationOffset="-0.5774183" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="206" green="212" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.567841" brightnessOffset="0.31764704" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="191" green="197" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56289876" brightnessOffset="0.2588235" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="178" green="185" blue="193" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.55799407" brightnessOffset="0.20784312" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.60996324" brightnessOffset="0.36470586" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="219" green="221" blue="226" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.60474086" brightnessOffset="0.33725488" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="216" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5957143" brightnessOffset="0.3333333" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5928571" brightnessOffset="0.2745098" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="188" green="191" blue="197" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.590029" brightnessOffset="0.2235294" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="0" green="0" blue="0" alpha="8" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-247"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cff8896a.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="246" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="179" green="197" blue="212" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.4800539" brightnessOffset="0.28235292" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="191" green="212" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.63174605" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="224" green="226" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.6054113" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="242" green="245" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5998577" brightnessOffset="0.4352941" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="149" green="152" blue="158" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5787523" brightnessOffset="0.07058823" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5399696" brightnessOffset="-0.18039218" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="119" green="124" blue="134" alpha="79" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.22" alphaOffset="-176"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cfe59bd4.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="246" green="248" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="179" green="197" blue="212" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.4800539" brightnessOffset="0.28235292" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="163" green="184" blue="203" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="191" green="212" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="251" green="251" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.63174605" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="224" green="226" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.6054113" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="214" green="217" blue="223" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="242" green="245" blue="251" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5998577" brightnessOffset="0.4352941" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="149" green="152" blue="158" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5787523" brightnessOffset="0.07058823" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="85" green="88" blue="94" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5399696" brightnessOffset="-0.18039218" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.6" x2="82.4" y1="0.6" y2="23.4" rounding="13.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="248" green="250" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="200" green="216" blue="230" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.50527954" brightnessOffset="0.35294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="191" green="212" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="231" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4757143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="240" green="242" blue="246" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.6113241" brightnessOffset="0.41568625" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5985242" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.54616207" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.41349208" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.6" x2="82.4" y1="0.6" y2="23.4" rounding="13.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cffce35a.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="248" green="250" blue="252" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="200" green="216" blue="230" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.50527954" brightnessOffset="0.35294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="182" green="203" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="191" green="212" blue="231" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="231" blue="250" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4757143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="253" green="253" blue="254" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="240" green="242" blue="246" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.6113241" brightnessOffset="0.41568625" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="233" green="236" blue="242" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5985242" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.54616207" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.41349208" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="119" green="124" blue="134" alpha="79" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.22" alphaOffset="-176"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cffce35a.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="143" green="169" blue="192" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="76" green="117" blue="154" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="4.081726E-4" saturationOffset="-0.12922078" brightnessOffset="0.054901958" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="53" green="100" blue="142" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="146" blue="189" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0015907288" saturationOffset="-0.1436508" brightnessOffset="0.19215685" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="172" green="179" blue="191" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.026611507" saturationOffset="-0.53623784" brightnessOffset="0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.52701867" brightnessOffset="0.17254901" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="202" green="208" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.03801495" saturationOffset="-0.5456242" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.52156866" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5246032" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.6" x2="82.4" y1="0.6" y2="23.4" rounding="13.0">
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cfff3c26.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="143" green="169" blue="192" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="76" green="117" blue="154" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="4.081726E-4" saturationOffset="-0.12922078" brightnessOffset="0.054901958" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="53" green="100" blue="142" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="146" blue="189" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0015907288" saturationOffset="-0.1436508" brightnessOffset="0.19215685" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="172" green="179" blue="191" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.026611507" saturationOffset="-0.53623784" brightnessOffset="0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.52701867" brightnessOffset="0.17254901" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="202" green="208" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.03801495" saturationOffset="-0.5456242" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.52156866" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5246032" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="255" green="255" blue="255" alpha="172" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-83"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cfff3c26.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Selected">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="83" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="8" bottom="8" left="9" right="19"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="143" green="169" blue="192" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.34375" midpoint="0.5">
+                                 <matte red="76" green="117" blue="154" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="4.081726E-4" saturationOffset="-0.12922078" brightnessOffset="0.054901958" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.6193182" midpoint="0.5">
+                                 <matte red="53" green="100" blue="142" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="146" blue="189" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="-0.0015907288" saturationOffset="-0.1436508" brightnessOffset="0.19215685" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.25" y="3.0" cp1x="64.25" cp1y="3.0" cp2x="64.25" cp2y="3.0"/>
+                              <point x="75.0" y="3.0" cp1x="75.0" cp1y="3.0" cp2x="79.0" cp2y="3.0"/>
+                              <point x="80.0" y="8.0" cp1x="80.0" cp1y="4.0" cp2x="80.0" cp2y="8.0"/>
+                              <point x="80.0" y="16.0" cp1x="80.0" cp1y="16.0" cp2x="80.0" cp2y="20.0"/>
+                              <point x="75.0" y="21.0" cp1x="79.0" cp1y="21.0" cp2x="75.0" cp2y="21.0"/>
+                              <point x="64.25" y="21.0" cp1x="64.25" cp1y="21.0" cp2x="64.25" cp2y="21.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="76.0" y="2.0" cp1x="76.0" cp1y="2.0" cp2x="79.0" cp2y="2.0"/>
+                              <point x="81.0" y="7.0" cp1x="81.0" cp1y="4.0" cp2x="81.0" cp2y="7.0"/>
+                              <point x="81.0" y="17.0" cp1x="81.0" cp1y="17.0" cp2x="81.0" cp2y="20.0"/>
+                              <point x="76.0" y="22.0" cp1x="79.0" cp1y="22.0" cp2x="76.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="205" green="209" blue="216" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4005682" midpoint="0.5">
+                                 <matte red="172" green="179" blue="191" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.026611507" saturationOffset="-0.53623784" brightnessOffset="0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.66477275" midpoint="0.5">
+                                 <matte red="164" green="171" blue="184" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.52701867" brightnessOffset="0.17254901" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="202" green="208" blue="222" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusBase" hueOffset="0.03801495" saturationOffset="-0.5456242" brightnessOffset="0.3215686" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="8.0" y="3.0" cp1x="4.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                              <point x="64.0" y="3.0" cp1x="64.0" cp1y="3.0" cp2x="64.0" cp2y="3.0"/>
+                              <point x="64.0" y="21.0" cp1x="64.0" cp1y="21.0" cp2x="64.0" cp2y="21.0"/>
+                              <point x="8.0" y="21.0" cp1x="8.0" cp1y="21.0" cp2x="4.0" cp2y="21.0"/>
+                              <point x="3.0" y="16.0" cp1x="3.0" cp1y="20.0" cp2x="3.0" cp2y="16.0"/>
+                              <point x="3.0" y="7.0" cp1x="3.0" cp1y="7.0" cp2x="3.0" cp2y="4.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.52156866" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="96" green="100" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5246032" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="7.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="7.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="20.0"/>
+                              <point x="7.0" y="22.0" cp1x="4.0" cp1y="22.0" cp2x="7.0" cp2y="22.0"/>
+                              <point x="64.0" y="22.0" cp1x="64.0" cp1y="22.0" cp2x="64.0" cp2y="22.0"/>
+                              <point x="64.0" y="2.0" cp1x="64.0" cp1y="2.0" cp2x="64.0" cp2y="2.0"/>
+                              <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="4.0" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="255" green="255" blue="255" alpha="167" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-88"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                              <point x="2.0" y="18.0" cp1x="2.0" cp1y="18.0" cp2x="2.0" cp2y="21.0"/>
+                              <point x="7.0" y="23.0" cp1x="4.0" cp1y="23.0" cp2x="7.0" cp2y="23.0"/>
+                              <point x="76.0" y="23.0" cp1x="76.0" cp1y="23.0" cp2x="79.0" cp2y="23.0"/>
+                              <point x="81.0" y="18.0" cp1x="81.0" cp1y="21.0" cp2x="81.0" cp2y="18.0"/>
+                              <point x="81.0" y="16.0" cp1x="81.0" cp1y="16.0" cp2x="81.0" cp2y="16.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113cfff3c26.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+Editable">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="79" height="21"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="6" bottom="6" left="5" right="17"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="30.0" x2="30.0" y1="10.0" y2="10.0" rounding="0.0">
+                           <matte red="51" green="53" blue="57" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.005263157" brightnessOffset="-0.52156866" alphaOffset="-191"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Editable">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="79" height="21"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="6" bottom="6" left="5" right="17"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="30.0" x2="30.0" y1="10.0" y2="10.0" rounding="0.0">
+                           <matte red="51" green="53" blue="57" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.005263157" brightnessOffset="-0.52156866" alphaOffset="-191"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused+Editable">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="142" height="27"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="136.4" y="0.6" cp1x="136.4" cp1y="0.6" cp2x="139.4" cp2y="0.6"/>
+                              <point x="141.4" y="6.6" cp1x="141.4" cp1y="3.6" cp2x="141.4" cp2y="6.6"/>
+                              <point x="141.4" y="21.4" cp1x="141.4" cp1y="21.4" cp2x="141.4" cp2y="24.4"/>
+                              <point x="136.4" y="26.4" cp1x="139.4" cp1y="26.4" cp2x="136.4" cp2y="26.4"/>
+                              <point x="0.6" y="26.4" cp1x="0.6" cp1y="26.4" cp2x="0.6" cp2y="26.4"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="114d94654dc.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver+Editable">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="79" height="21"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="4" bottom="5" left="5" right="17"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="30.0" x2="30.0" y1="10.0" y2="10.0" rounding="0.0">
+                           <matte red="51" green="53" blue="57" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.005263157" brightnessOffset="-0.52156866" alphaOffset="-191"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed+Editable">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="79" height="21"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="4" bottom="5" left="5" right="17"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="30.0" x2="30.0" y1="10.0" y2="10.0" rounding="0.0">
+                           <matte red="51" green="53" blue="57" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.005263157" brightnessOffset="-0.52156866" alphaOffset="-191"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="false" componentName="ComboBox.textField" type="javax.swing.JTextField" name="TextField" ui="TextFieldUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="6" right="3"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.016586483" saturationOffset="-0.6051466" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.60315615" brightnessOffset="0.29411763" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="222" blue="227" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07968931" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="1.0" x2="0.5" y2="0.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="202" green="204" blue="209" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07703349" brightnessOffset="0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113cfe4e021.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.1" midpoint="0.5">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113cfe52151.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                       <textForeground>
+                          <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                       </textForeground>
+                       <textBackground/>
+                       <background/>
+                       <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.1" midpoint="0.5">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" componentName="ComboBox.arrowButton" type="javax.swing.plaf.synth.SynthArrowButton" name="ArrowButton" ui="ArrowButtonUI" subregion="true">
+               <stateTypes>
+                  <stateType key="Enabled"/>
+                  <stateType key="MouseOver"/>
+                  <stateType key="Pressed"/>
+                  <stateType key="Disabled"/>
+                  <stateType key="Editable">
+                     <codeSnippet><![CDATA[
+                                Component parent = c.getParent();
+                                return parent instanceof JComboBox && ((JComboBox)parent).isEditable();]]></codeSnippet>
+                  </stateType>
+               </stateTypes>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties>
+                     <uiProperty name="size" type="INT" value="19"/>
+                  </uiproperties>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="4" left="1" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="4" left="1" right="6"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="4" left="1" right="6"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="4" left="1" right="6"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+Editable">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="8" bottom="8" left="1" right="8"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="224" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.59223604" brightnessOffset="0.35294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.34375" midpoint="0.5">
+                                       <matte red="210" green="215" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02391243" saturationOffset="-0.5774183" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6193182" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="206" green="212" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.567841" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="12.0" y="3.0" cp1x="12.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="8.0" cp1x="17.0" cp1y="4.0" cp2x="17.0" cp2y="8.0"/>
+                                    <point x="17.0" y="16.0" cp1x="17.0" cp1y="16.0" cp2x="17.0" cp2y="20.0"/>
+                                    <point x="12.0" y="21.0" cp1x="16.0" cp1y="21.0" cp2x="12.0" cp2y="21.0"/>
+                                    <point x="1.0" y="21.0" cp1x="1.0" cp1y="21.0" cp2x="1.0" cp2y="21.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.8529411764705883" y="21.11764705882353" cp1x="0.8529411764705883" cp1y="21.11764705882353" cp2x="0.8529411764705883" cp2y="21.11764705882353"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="191" green="197" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56289876" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="178" green="185" blue="193" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.55799407" brightnessOffset="0.20784312" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="18.0" cp1y="4.0" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="17.0" cp1x="18.0" cp1y="17.0" cp2x="18.0" cp2y="20.0"/>
+                                    <point x="13.0" y="22.0" cp1x="16.0" cp1y="22.0" cp2x="13.0" cp2y="22.0"/>
+                                    <point x="0.0" y="22.0" cp1x="0.0" cp1y="22.0" cp2x="0.0" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="8" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-247"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="18.0" y="16.0" cp1x="18.0" cp1y="16.0" cp2x="18.0" cp2y="16.0"/>
+                                    <point x="18.0" y="18.0" cp1x="18.0" cp1y="18.0" cp2x="18.0" cp2y="22.0"/>
+                                    <point x="13.0" y="23.0" cp1x="16.0" cp1y="23.0" cp2x="13.0" cp2y="23.0"/>
+                                    <point x="0.0" y="23.0" cp1x="0.0" cp1y="23.0" cp2x="0.0" cp2y="23.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113c77d1eb8.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Editable">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="8" bottom="8" left="1" right="8"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.2754491">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.44652405" midpoint="0.5">
+                                       <matte red="174" green="192" blue="209" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.46825016" brightnessOffset="0.27058822" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64171124" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="191" green="212" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="12.0" y="3.0" cp1x="12.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="8.0" cp1x="17.0" cp1y="4.0" cp2x="17.0" cp2y="8.0"/>
+                                    <point x="17.0" y="16.0" cp1x="17.0" cp1y="16.0" cp2x="17.0" cp2y="20.0"/>
+                                    <point x="12.0" y="21.0" cp1x="16.0" cp1y="21.0" cp2x="12.0" cp2y="21.0"/>
+                                    <point x="1.0" y="21.0" cp1x="1.0" cp1y="21.0" cp2x="1.0" cp2y="21.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.8529411764705883" y="21.11764705882353" cp1x="0.8529411764705883" cp1y="21.11764705882353" cp2x="0.8529411764705883" cp2y="21.11764705882353"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="18.0" cp1y="4.0" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="17.0" cp1x="18.0" cp1y="17.0" cp2x="18.0" cp2y="20.0"/>
+                                    <point x="13.0" y="22.0" cp1x="16.0" cp1y="22.0" cp2x="13.0" cp2y="22.0"/>
+                                    <point x="0.0" y="22.0" cp1x="0.0" cp1y="22.0" cp2x="0.0" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-191"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="18.0" y="16.0" cp1x="18.0" cp1y="16.0" cp2x="18.0" cp2y="16.0"/>
+                                    <point x="18.0" y="18.0" cp1x="18.0" cp1y="18.0" cp2x="18.0" cp2y="22.0"/>
+                                    <point x="13.0" y="23.0" cp1x="16.0" cp1y="23.0" cp2x="13.0" cp2y="23.0"/>
+                                    <point x="0.0" y="23.0" cp1x="0.0" cp1y="23.0" cp2x="0.0" cp2y="23.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113c761dccf.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Editable">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="8" bottom="8" left="1" right="8"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.2754491">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.44652405" midpoint="0.5">
+                                       <matte red="191" green="209" blue="226" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.48084703" brightnessOffset="0.33725488" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64171124" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.98395723" midpoint="0.5">
+                                       <matte red="210" green="231" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4757143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="12.0" y="3.0" cp1x="12.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="8.0" cp1x="17.0" cp1y="4.0" cp2x="17.0" cp2y="8.0"/>
+                                    <point x="17.0" y="16.0" cp1x="17.0" cp1y="16.0" cp2x="17.0" cp2y="20.0"/>
+                                    <point x="12.0" y="21.0" cp1x="16.0" cp1y="21.0" cp2x="12.0" cp2y="21.0"/>
+                                    <point x="1.0" y="21.0" cp1x="1.0" cp1y="21.0" cp2x="1.0" cp2y="21.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.8529411764705883" y="21.11764705882353" cp1x="0.8529411764705883" cp1y="21.11764705882353" cp2x="0.8529411764705883" cp2y="21.11764705882353"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="18.0" cp1y="4.0" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="17.0" cp1x="18.0" cp1y="17.0" cp2x="18.0" cp2y="20.0"/>
+                                    <point x="13.0" y="22.0" cp1x="16.0" cp1y="22.0" cp2x="13.0" cp2y="22.0"/>
+                                    <point x="0.0" y="22.0" cp1x="0.0" cp1y="22.0" cp2x="0.0" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-191"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="18.0" y="16.0" cp1x="18.0" cp1y="16.0" cp2x="18.0" cp2y="16.0"/>
+                                    <point x="18.0" y="18.0" cp1x="18.0" cp1y="18.0" cp2x="18.0" cp2y="22.0"/>
+                                    <point x="13.0" y="23.0" cp1x="16.0" cp1y="23.0" cp2x="13.0" cp2y="23.0"/>
+                                    <point x="0.0" y="23.0" cp1x="0.0" cp1y="23.0" cp2x="0.0" cp2y="23.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113c77f1a58.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Editable">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="8" bottom="8" left="1" right="8"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.2754491">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.44652405" midpoint="0.5">
+                                       <matte red="63" green="107" blue="147" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.064285696" brightnessOffset="0.027450979" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64171124" midpoint="0.5">
+                                       <matte red="53" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="89" green="135" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.13853917" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="12.0" y="3.0" cp1x="12.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="8.0" cp1x="17.0" cp1y="4.0" cp2x="17.0" cp2y="8.0"/>
+                                    <point x="17.0" y="16.0" cp1x="17.0" cp1y="16.0" cp2x="17.0" cp2y="20.0"/>
+                                    <point x="12.0" y="21.0" cp1x="16.0" cp1y="21.0" cp2x="12.0" cp2y="21.0"/>
+                                    <point x="1.0" y="21.0" cp1x="1.0" cp1y="21.0" cp2x="1.0" cp2y="21.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.8529411764705883" y="21.11764705882353" cp1x="0.8529411764705883" cp1y="21.11764705882353" cp2x="0.8529411764705883" cp2y="21.11764705882353"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="18.0" cp1y="4.0" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="17.0" cp1x="18.0" cp1y="17.0" cp2x="18.0" cp2y="20.0"/>
+                                    <point x="13.0" y="22.0" cp1x="16.0" cp1y="22.0" cp2x="13.0" cp2y="22.0"/>
+                                    <point x="0.0" y="22.0" cp1x="0.0" cp1y="22.0" cp2x="0.0" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-191"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="18.0" y="16.0" cp1x="18.0" cp1y="16.0" cp2x="18.0" cp2y="16.0"/>
+                                    <point x="18.0" y="18.0" cp1x="18.0" cp1y="18.0" cp2x="18.0" cp2y="22.0"/>
+                                    <point x="13.0" y="23.0" cp1x="16.0" cp1y="23.0" cp2x="13.0" cp2y="23.0"/>
+                                    <point x="0.0" y="23.0" cp1x="0.0" cp1y="23.0" cp2x="0.0" cp2y="23.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d8d17d13.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Editable">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="8" bottom="8" left="1" right="8"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.2754491">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.44652405" midpoint="0.5">
+                                       <matte red="63" green="107" blue="147" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.064285696" brightnessOffset="0.027450979" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64171124" midpoint="0.5">
+                                       <matte red="53" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="89" green="135" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.13853917" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="12.0" y="3.0" cp1x="12.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="8.0" cp1x="17.0" cp1y="4.0" cp2x="17.0" cp2y="8.0"/>
+                                    <point x="17.0" y="16.0" cp1x="17.0" cp1y="16.0" cp2x="17.0" cp2y="20.0"/>
+                                    <point x="12.0" y="21.0" cp1x="16.0" cp1y="21.0" cp2x="12.0" cp2y="21.0"/>
+                                    <point x="1.0" y="21.0" cp1x="1.0" cp1y="21.0" cp2x="1.0" cp2y="21.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.8529411764705883" y="21.11764705882353" cp1x="0.8529411764705883" cp1y="21.11764705882353" cp2x="0.8529411764705883" cp2y="21.11764705882353"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="18.0" cp1y="4.0" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="17.0" cp1x="18.0" cp1y="17.0" cp2x="18.0" cp2y="20.0"/>
+                                    <point x="13.0" y="22.0" cp1x="16.0" cp1y="22.0" cp2x="13.0" cp2y="22.0"/>
+                                    <point x="0.0" y="22.0" cp1x="0.0" cp1y="22.0" cp2x="0.0" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="64" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-191"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="18.0" y="16.0" cp1x="18.0" cp1y="16.0" cp2x="18.0" cp2y="16.0"/>
+                                    <point x="18.0" y="18.0" cp1x="18.0" cp1y="18.0" cp2x="18.0" cp2y="22.0"/>
+                                    <point x="13.0" y="23.0" cp1x="16.0" cp1y="23.0" cp2x="13.0" cp2y="23.0"/>
+                                    <point x="0.0" y="23.0" cp1x="0.0" cp1y="23.0" cp2x="0.0" cp2y="23.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113c7808b08.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates>
+                  <state stateKeys="Enabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="24" height="19"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="9" right="10"/>
+                        <layer name="Arrow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="45" green="45" blue="45" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.37254906" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="6" green="6" blue="6" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.5254902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="1.0" y1="0.5" x2="0.0" y2="0.5"/>
+                                 <points>
+                                    <point x="8.996323529411764" y="8.531250000000004" cp1x="8.996323529411764" cp1y="8.531250000000004" cp2x="8.996323529411764" cp2y="8.531250000000004"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d842ecfd.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="24" height="19"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="9" right="10"/>
+                        <layer name="Arrow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="45" green="45" blue="45" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.37254906" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="6" green="6" blue="6" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.5254902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="1.0" y1="0.5" x2="0.0" y2="0.5"/>
+                                 <points>
+                                    <point x="9.03125" y="8.46875" cp1x="9.03125" cp1y="8.46875" cp2x="9.03125" cp2y="8.46875"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d842ecfd.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="24" height="19"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="9" right="10"/>
+                        <layer name="Arrow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="167" green="171" blue="178" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.57391655" brightnessOffset="0.1490196" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.5" x2="0.0" y2="0.5"/>
+                                 <points>
+                                    <point x="9.058823529411764" y="8.531250000000004" cp1x="9.058823529411764" cp1y="8.531250000000004" cp2x="9.058823529411764" cp2y="8.531250000000004"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d85fec10.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="24" height="19"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="9" right="10"/>
+                        <layer name="Arrow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.5" x2="0.0" y2="0.5"/>
+                                 <points>
+                                    <point x="9.121323529411764" y="8.468750000000004" cp1x="9.121323529411764" cp1y="8.468750000000004" cp2x="9.121323529411764" cp2y="8.468750000000004"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d861c1b2.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="24" height="19"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="9" right="10"/>
+                        <layer name="Arrow">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.5" x2="0.0" y2="0.5"/>
+                                 <points>
+                                    <point x="9.058823529411764" y="8.531250000000004" cp1x="9.058823529411764" cp1y="8.531250000000004" cp2x="9.058823529411764" cp2y="8.531250000000004"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d861c1b2.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </foregroundStates>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="true" componentName="ComboBox.listRenderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="2" bottom="2" left="4" right="4"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </background>
+                  <inherit-background>false</inherit-background>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </background>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <inherit-background>false</inherit-background>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" componentName="ComboBox.renderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="2" bottom="2" left="4" right="4"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </background>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <inherit-background>false</inherit-background>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" componentName="ComboBox.scrollPane" type="javax.swing.JScrollPane" name="ScrollPane" ui="ScrollPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JFileChooser" name="FileChooser" ui="FileChooserUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="10" bottom="10" left="10" right="10"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="usesSingleFilePane" type="BOOLEAN" value="true"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="fileIcon" subregion="true" key="fileIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="128" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-127"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="10.0" y="2.0" cp1x="10.0" cp1y="2.0" cp2x="10.0" cp2y="2.0"/>
+                                    <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                    <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                    <point x="2.0" y="15.0" cp1x="2.0" cp1y="15.0" cp2x="2.0" cp2y="15.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                    <point x="13.0" y="14.0" cp1x="13.0" cp1y="14.0" cp2x="13.0" cp2y="14.0"/>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="138" green="157" blue="176" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.4198052" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                    <point x="8.74074074074074" y="1.0" cp1x="8.74074074074074" cp1y="1.0" cp2x="8.74074074074074" cp2y="1.0"/>
+                                    <point x="8.777777777777777" y="6.222222222222219" cp1x="8.777777777777777" cp1y="6.222222222222219" cp2x="8.777777777777777" cp2y="6.222222222222219"/>
+                                    <point x="14.0" y="6.2037037037037" cp1x="14.0" cp1y="6.2037037037037" cp2x="14.0" cp2y="6.2037037037037"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="238" green="242" blue="247" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.013940871" saturationOffset="-0.599277" brightnessOffset="0.41960782" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                    <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                    <point x="2.0" y="15.0" cp1x="2.0" cp1y="15.0" cp2x="2.0" cp2y="15.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="236" green="245" blue="253" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.032679737" saturationOffset="-0.043332636" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.04629629629629636" y1="0.9675925925925929" x2="0.48611111111111094" y2="0.5324074074074074"/>
+                                 <points>
+                                    <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                    <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                    <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                 </points>
+                              </path>
+                              <rectangle x1="2.0" x2="14.0" y1="15.0" y2="16.0" rounding="0.0">
+                                 <matte red="97" green="98" blue="102" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <matte red="149" green="151" blue="156" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.065654516" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                    <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                                    <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                    <point x="10.518518518518523" y="0.9999999999999999" cp1x="10.518518518518523" cp1y="0.9999999999999999" cp2x="10.518518518518523" cp2y="0.9999999999999999"/>
+                                    <point x="14.000000000000002" y="4.5" cp1x="14.000000000000002" cp1y="4.5" cp2x="14.000000000000002" cp2y="4.5"/>
+                                    <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                    <point x="15.0" y="16.0" cp1x="15.0" cp1y="16.0" cp2x="15.0" cp2y="16.0"/>
+                                    <point x="15.0" y="4.444444444444441" cp1x="15.0" cp1y="4.444444444444441" cp2x="15.0" cp2y="4.444444444444441"/>
+                                    <point x="10.722222222222225" y="0.0" cp1x="10.722222222222225" cp1y="0.0" cp2x="10.722222222222225" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="directoryIcon" subregion="true" key="directoryIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="12.0" y="12.0" cp1x="12.0" cp1y="12.0" cp2x="12.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="100" green="122" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0027436614" saturationOffset="-0.335015" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.25449103" midpoint="0.5">
+                                       <matte red="111" green="130" blue="148" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0024294257" saturationOffset="-0.3857143" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="76" green="91" blue="105" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018081069" saturationOffset="-0.3595238" brightnessOffset="-0.13725492" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                    <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                    <point x="3.7407407407407405" y="3.9999999999999996" cp1x="3.7407407407407405" cp1y="3.9999999999999996" cp2x="3.7407407407407405" cp2y="3.9999999999999996"/>
+                                    <point x="2.0185185185185137" y="10.05555555555555" cp1x="2.0185185185185137" cp1y="10.05555555555555" cp2x="2.0185185185185137" cp2y="10.05555555555555"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="2.9629629629629632" y="12.129629629629632" cp1x="2.9629629629629632" cp1y="12.129629629629632" cp2x="2.9629629629629632" cp2y="12.129629629629632"/>
+                                    <point x="4.579999999999991" y="4.98" cp1x="4.579999999999991" cp1y="4.98" cp2x="4.579999999999991" cp2y="4.98"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="72" green="97" blue="120" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0012094378" saturationOffset="-0.23571429" brightnessOffset="-0.0784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="35" green="55" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.115166366" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="16.0" y="4.0" cp1x="16.0" cp1y="4.0" cp2x="16.0" cp2y="4.0"/>
+                                    <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                    <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="2.9444444444444438" y="1.0185185185185186" cp1x="2.9444444444444438" cp1y="1.0185185185185186" cp2x="2.9444444444444438" cp2y="1.0185185185185186"/>
+                                    <point x="2.9814814814814814" y="1.7407407407407403" cp1x="2.9814814814814814" cp1y="1.7407407407407403" cp2x="2.9814814814814814" cp2y="1.7407407407407403"/>
+                                    <point x="1.7407407407407407" y="3.0" cp1x="1.7407407407407407" cp1y="3.0" cp2x="1.7407407407407407" cp2y="3.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                    <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                    <point x="14.0" y="7.0" cp1x="14.0" cp1y="7.0" cp2x="14.0" cp2y="7.0"/>
+                                    <point x="14.87037037037037" y="5.962962962962965" cp1x="14.87037037037037" cp1y="5.962962962962965" cp2x="14.87037037037037" cp2y="5.962962962962965"/>
+                                    <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                    <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                    <point x="15.462962962962967" y="6.129629629629629" cp1x="15.462962962962967" cp1y="6.129629629629629" cp2x="15.462962962962967" cp2y="6.129629629629629"/>
+                                    <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                    <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                    <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                    <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                    <point x="0.0" y="3.25925925925926" cp1x="0.0" cp1y="3.25925925925926" cp2x="0.0" cp2y="3.25925925925926"/>
+                                    <point x="3.1851851851851856" y="0.0" cp1x="3.1851851851851856" cp1y="0.0" cp2x="3.1851851851851856" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="8.55555555555555" y="2.0000000000000004" cp1x="8.55555555555555" cp1y="2.0000000000000004" cp2x="8.55555555555555" cp2y="2.0000000000000004"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="13.0" cp2y="2.0"/>
+                                    <point x="14.0" y="3.0" cp1x="14.0" cp1y="3.0" cp2x="14.0" cp2y="3.0"/>
+                                    <point x="14.0" y="4.0" cp1x="14.0" cp1y="4.0" cp2x="14.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="8.0" x2="13.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="155" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-100"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="7.0" y1="1.0" y2="2.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="205" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-50"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="2.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="130" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-125"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="2.041666666666667" y="10.187499999999998" cp1x="2.041666666666667" cp1y="10.187499999999998" cp2x="2.041666666666667" cp2y="10.187499999999998"/>
+                                    <point x="3.979166666666668" y="4.0" cp1x="3.979166666666668" cp1y="4.0" cp2x="3.979166666666668" cp2y="4.0"/>
+                                    <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="3.0" y="1.0" cp1x="3.0" cp1y="1.0" cp2x="3.0" cp2y="1.0"/>
+                                    <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                    <point x="2.0" y="3.0" cp1x="2.0" cp1y="3.0" cp2x="2.0" cp2y="3.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.04191617" midpoint="0.5">
+                                       <matte red="178" green="198" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.45978838" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.16467066" midpoint="0.5">
+                                       <matte red="134" green="162" blue="188" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.34848025" brightnessOffset="0.18823528" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3263473" midpoint="0.5">
+                                       <matte red="111" green="139" blue="165" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.30844158" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="95" green="123" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.27329817" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="3.0185185185185186" y="10.055555555555559" cp1x="3.0185185185185186" cp1y="10.055555555555559" cp2x="3.0185185185185186" cp2y="10.055555555555559"/>
+                                    <point x="4.0" y="5.0" cp1x="4.0" cp1y="5.0" cp2x="4.0" cp2y="5.0"/>
+                                    <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                    <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                    <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="121" green="126" blue="136" alpha="156" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.21" alphaOffset="-99"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="13.0" cp1x="0.0" cp1y="13.0" cp2x="0.0" cp2y="13.0"/>
+                                    <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                    <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                    <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                    <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="upFolderIcon" subregion="true" key="upFolderIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>12</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Icon">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="154" green="211" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.006044388" saturationOffset="-0.23963585" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="85" green="175" blue="244" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0063245893" saturationOffset="0.01592505" brightnessOffset="0.4078431" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="10.0" y="9.0" cp1x="10.0" cp1y="9.0" cp2x="10.0" cp2y="9.0"/>
+                                    <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                    <point x="7.3478260869565215" y="5.0" cp1x="7.3478260869565215" cp1y="5.0" cp2x="7.3478260869565215" cp2y="5.0"/>
+                                    <point x="10.978260869565217" y="1.2826086956521732" cp1x="10.978260869565217" cp1y="1.2826086956521732" cp2x="10.978260869565217" cp2y="1.2826086956521732"/>
+                                    <point x="14.304347826086948" y="4.999999999999999" cp1x="14.304347826086948" cp1y="4.999999999999999" cp2x="14.304347826086948" cp2y="4.999999999999999"/>
+                                    <point x="12.0" y="5.0" cp1x="12.0" cp1y="5.0" cp2x="12.0" cp2y="5.0"/>
+                                    <point x="12.0" y="9.0" cp1x="12.0" cp1y="9.0" cp2x="12.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="6.630434782608702" y="4.978260869565218" cp1x="6.630434782608702" cp1y="4.978260869565218" cp2x="6.630434782608702" cp2y="4.978260869565218"/>
+                                    <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                    <point x="10.0" y="9.0" cp1x="10.0" cp1y="9.0" cp2x="10.0" cp2y="9.0"/>
+                                    <point x="12.0" y="9.0" cp1x="12.0" cp1y="9.0" cp2x="12.0" cp2y="9.0"/>
+                                    <point x="12.0" y="5.0" cp1x="12.0" cp1y="5.0" cp2x="12.0" cp2y="5.0"/>
+                                    <point x="15.326086956521742" y="5.0" cp1x="15.326086956521742" cp1y="5.0" cp2x="15.326086956521742" cp2y="5.0"/>
+                                    <point x="11.0" y="0.6521739130434785" cp1x="11.0" cp1y="0.6521739130434785" cp2x="11.0" cp2y="0.6521739130434785"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="100" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0061469674" saturationOffset="0.3642857" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="58" blue="117" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0053939223" saturationOffset="0.3642857" brightnessOffset="-0.0901961" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                    <point x="6.0" y="4.565217391304342" cp1x="6.0" cp1y="4.565217391304342" cp2x="6.0" cp2y="4.565217391304342"/>
+                                    <point x="10.673913043478265" y="0.0" cp1x="10.673913043478265" cp1y="0.0" cp2x="10.673913043478265" cp2y="0.0"/>
+                                    <point x="11.304347826086955" y="-8.326672684688674E-17" cp1x="11.304347826086955" cp1y="-8.326672684688674E-17" cp2x="11.304347826086955" cp2y="-8.326672684688674E-17"/>
+                                    <point x="15.978260869565217" y="4.565217391304343" cp1x="15.978260869565217" cp1y="4.565217391304343" cp2x="15.978260869565217" cp2y="4.565217391304343"/>
+                                    <point x="16.0" y="6.0" cp1x="16.0" cp1y="6.0" cp2x="16.0" cp2y="6.0"/>
+                                    <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                    <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                    <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                    <point x="10.0" y="10.0" cp1x="10.0" cp1y="10.0" cp2x="10.0" cp2y="10.0"/>
+                                    <point x="9.0" y="9.0" cp1x="9.0" cp1y="9.0" cp2x="9.0" cp2y="9.0"/>
+                                    <point x="9.0" y="6.0" cp1x="9.0" cp1y="6.0" cp2x="9.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="120" green="125" blue="135" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="5.847961E-4" brightnessOffset="-0.21568626" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.021739130434783" y="6.521739130434782" cp1x="6.021739130434783" cp1y="6.521739130434782" cp2x="6.021739130434783" cp2y="6.521739130434782"/>
+                                    <point x="6.0" y="5.369565217391304" cp1x="6.0" cp1y="5.369565217391304" cp2x="6.0" cp2y="5.369565217391304"/>
+                                    <point x="16.0" y="5.58695652173913" cp1x="16.0" cp1y="5.58695652173913" cp2x="16.0" cp2y="5.58695652173913"/>
+                                    <point x="14.891304347826086" y="6.499999999999999" cp1x="14.891304347826086" cp1y="6.499999999999999" cp2x="14.891304347826086" cp2y="6.499999999999999"/>
+                                    <point x="12.956521739130434" y="6.91304347826087" cp1x="12.956521739130434" cp1y="6.91304347826087" cp2x="12.956521739130434" cp2y="6.91304347826087"/>
+                                    <point x="12.91304347826087" y="9.34782608695652" cp1x="12.91304347826087" cp1y="9.34782608695652" cp2x="12.91304347826087" cp2y="9.34782608695652"/>
+                                    <point x="11.869565217391303" y="10.608695652173914" cp1x="11.869565217391303" cp1y="10.608695652173914" cp2x="11.869565217391303" cp2y="10.608695652173914"/>
+                                    <point x="10.217391304347826" y="10.543478260869566" cp1x="10.217391304347826" cp1y="10.543478260869566" cp2x="10.217391304347826" cp2y="10.543478260869566"/>
+                                    <point x="9.26086956521739" y="9.34782608695652" cp1x="9.26086956521739" cp1y="9.34782608695652" cp2x="9.26086956521739" cp2y="9.34782608695652"/>
+                                    <point x="9.26086956521739" y="6.869565217391304" cp1x="9.26086956521739" cp1y="6.869565217391304" cp2x="9.26086956521739" cp2y="6.869565217391304"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="178" green="198" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.45978838" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13068181" midpoint="0.5">
+                                       <matte red="134" green="162" blue="188" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.34848025" brightnessOffset="0.18823528" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.48863637" midpoint="0.5">
+                                       <matte red="98" green="126" blue="152" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.28045115" brightnessOffset="0.04705882" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="95" green="123" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.27329817" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0" y="15.0" cp1x="3.0" cp1y="15.0" cp2x="3.0" cp2y="15.0"/>
+                                    <point x="3.0" y="11.0" cp1x="3.0" cp1y="11.0" cp2x="3.0" cp2y="11.0"/>
+                                    <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                    <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                    <point x="14.0" y="11.0" cp1x="14.0" cp1y="11.0" cp2x="14.0" cp2y="11.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="87" green="112" blue="135" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0012094378" saturationOffset="-0.28015873" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="30" green="50" blue="69" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.00254488" saturationOffset="-0.07049692" brightnessOffset="-0.2784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="2.0" y="11.0" cp1x="2.0" cp1y="11.0" cp2x="2.0" cp2y="11.0"/>
+                                    <point x="3.0" y="6.0" cp1x="3.0" cp1y="6.0" cp2x="3.0" cp2y="6.0"/>
+                                    <point x="4.0" y="5.0" cp1x="4.0" cp1y="5.0" cp2x="4.0" cp2y="5.0"/>
+                                    <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                    <point x="15.0" y="15.0" cp1x="15.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="13.0" y="16.0" cp1x="13.0" cp1y="16.0" cp2x="13.0" cp2y="16.0"/>
+                                    <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="244" green="247" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6117143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.09659091" midpoint="0.5">
+                                       <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                    <point x="1.0" y="4.0" cp1x="1.0" cp1y="4.0" cp2x="1.0" cp2y="4.0"/>
+                                    <point x="2.0" y="4.0" cp1x="2.0" cp1y="4.0" cp2x="2.0" cp2y="4.0"/>
+                                    <point x="3.0" y="3.0" cp1x="3.0" cp1y="3.0" cp2x="3.0" cp2y="3.0"/>
+                                    <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                    <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                    <point x="7.0" y="3.0" cp1x="7.0" cp1y="3.0" cp2x="7.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="8.0" y="15.0" cp1x="8.0" cp1y="15.0" cp2x="8.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="136" blue="150" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.44904763" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.1278409" midpoint="0.5">
+                                       <matte red="109" green="123" blue="136" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.43718487" brightnessOffset="-0.015686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.91477275" midpoint="0.5">
+                                       <matte red="59" green="69" blue="78" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.39212453" brightnessOffset="-0.24313727" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                    <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                    <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                    <point x="15.0" y="15.0" cp1x="15.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="15.0" y="10.0" cp1x="15.0" cp1y="10.0" cp2x="15.0" cp2y="10.0"/>
+                                    <point x="16.0" y="7.0" cp1x="16.0" cp1y="7.0" cp2x="16.0" cp2y="7.0"/>
+                                    <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                    <point x="8.0" y="5.0" cp1x="8.0" cp1y="5.0" cp2x="8.0" cp2y="5.0"/>
+                                    <point x="8.0" y="2.0" cp1x="8.0" cp1y="2.0" cp2x="8.0" cp2y="2.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="3.0" y="1.0" cp1x="3.0" cp1y="1.0" cp2x="3.0" cp2y="1.0"/>
+                                    <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                                    <point x="2.0" y="3.0" cp1x="2.0" cp1y="3.0" cp2x="2.0" cp2y="3.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="0.0" y="4.0" cp1x="0.0" cp1y="4.0" cp2x="0.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11498ffda35.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="newFolderIcon" subregion="true" key="newFolderIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 4">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <radialGradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.11290322" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.23548387" midpoint="0.5">
+                                       <matte red="252" green="255" blue="92" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.38709676" midpoint="0.5">
+                                       <matte red="252" green="255" blue="92" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.57096773" midpoint="0.5">
+                                       <matte red="253" green="191" blue="4" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </radialGradient>
+                                 <paintPoints x1="0.5" y1="1.0" x2="0.4491017940819012" y2="0.46327683734537634"/>
+                                 <points>
+                                    <point x="2.9230769230769225" y="3.307692307692308" cp1x="2.9230769230769225" cp1y="3.307692307692308" cp2x="2.9230769230769225" cp2y="3.307692307692308"/>
+                                    <point x="3.4423076923076916" y="2.8461538461538463" cp1x="3.4423076923076916" cp1y="2.8461538461538463" cp2x="3.4423076923076916" cp2y="2.8461538461538463"/>
+                                    <point x="4.9423076923076925" y="4.038461538461538" cp1x="4.9423076923076925" cp1y="4.038461538461538" cp2x="4.9423076923076925" cp2y="4.038461538461538"/>
+                                    <point x="5.211538461538462" y="2.153846153846154" cp1x="5.211538461538462" cp1y="2.153846153846154" cp2x="5.211538461538462" cp2y="2.153846153846154"/>
+                                    <point x="5.76923076923077" y="2.1923076923076925" cp1x="5.76923076923077" cp1y="2.1923076923076925" cp2x="5.76923076923077" cp2y="2.1923076923076925"/>
+                                    <point x="6.134615384615385" y="4.038461538461538" cp1x="6.134615384615385" cp1y="4.038461538461538" cp2x="6.134615384615385" cp2y="4.038461538461538"/>
+                                    <point x="7.403846153846154" y="2.9807692307692313" cp1x="7.403846153846154" cp1y="2.9807692307692313" cp2x="7.403846153846154" cp2y="2.9807692307692313"/>
+                                    <point x="7.980769230769231" y="3.5192307692307696" cp1x="7.980769230769231" cp1y="3.5192307692307696" cp2x="7.980769230769231" cp2y="3.5192307692307696"/>
+                                    <point x="6.903846153846154" y="4.6923076923076925" cp1x="6.903846153846154" cp1y="4.6923076923076925" cp2x="6.903846153846154" cp2y="4.6923076923076925"/>
+                                    <point x="8.750000000000007" y="5.153846153846154" cp1x="8.750000000000007" cp1y="5.153846153846154" cp2x="8.750000000000007" cp2y="5.153846153846154"/>
+                                    <point x="8.769230769230775" y="5.8076923076923075" cp1x="8.769230769230775" cp1y="5.8076923076923075" cp2x="8.769230769230775" cp2y="5.8076923076923075"/>
+                                    <point x="6.538461538461539" y="6.057692307692308" cp1x="6.538461538461539" cp1y="6.057692307692308" cp2x="6.538461538461539" cp2y="6.057692307692308"/>
+                                    <point x="7.826923076923079" y="7.346153846153846" cp1x="7.826923076923079" cp1y="7.346153846153846" cp2x="7.826923076923079" cp2y="7.346153846153846"/>
+                                    <point x="7.442307692307692" y="7.884615384615384" cp1x="7.442307692307692" cp1y="7.884615384615384" cp2x="7.442307692307692" cp2y="7.884615384615384"/>
+                                    <point x="6.115384615384617" y="6.634615384615385" cp1x="6.115384615384617" cp1y="6.634615384615385" cp2x="6.115384615384617" cp2y="6.634615384615385"/>
+                                    <point x="5.884615384615385" y="8.961538461538462" cp1x="5.884615384615385" cp1y="8.961538461538462" cp2x="5.884615384615385" cp2y="8.961538461538462"/>
+                                    <point x="5.25" y="8.961538461538462" cp1x="5.25" cp1y="8.961538461538462" cp2x="5.25" cp2y="8.961538461538462"/>
+                                    <point x="4.884615384615385" y="6.730769230769231" cp1x="4.884615384615385" cp1y="6.730769230769231" cp2x="4.884615384615385" cp2y="6.730769230769231"/>
+                                    <point x="3.461538461538461" y="8.0" cp1x="3.461538461538461" cp1y="8.0" cp2x="3.461538461538461" cp2y="8.0"/>
+                                    <point x="3.211538461538461" y="7.269230769230769" cp1x="3.211538461538461" cp1y="7.269230769230769" cp2x="3.211538461538461" cp2y="7.269230769230769"/>
+                                    <point x="4.153846153846153" y="6.0576923076923075" cp1x="4.153846153846153" cp1y="6.0576923076923075" cp2x="4.153846153846153" cp2y="6.0576923076923075"/>
+                                    <point x="2.3461538461538454" y="5.884615384615385" cp1x="2.3461538461538454" cp1y="5.884615384615385" cp2x="2.3461538461538454" cp2y="5.884615384615385"/>
+                                    <point x="2.4038461538461533" y="5.038461538461538" cp1x="2.4038461538461533" cp1y="5.038461538461538" cp2x="2.4038461538461533" cp2y="5.038461538461538"/>
+                                    <point x="4.115384615384615" y="4.923076923076923" cp1x="4.115384615384615" cp1y="4.923076923076923" cp2x="4.115384615384615" cp2y="4.923076923076923"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="85" blue="10" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.032758567" saturationOffset="-0.018273294" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="1.1730769230769234" y="1.653846153846154" cp1x="1.1730769230769234" cp1y="1.653846153846154" cp2x="1.1730769230769234" cp2y="1.653846153846154"/>
+                                    <point x="1.6346153846153852" y="1.0769230769230773" cp1x="1.6346153846153852" cp1y="1.0769230769230773" cp2x="1.6346153846153852" cp2y="1.0769230769230773"/>
+                                    <point x="4.826923076923077" y="3.7307692307692313" cp1x="4.826923076923077" cp1y="3.7307692307692313" cp2x="4.826923076923077" cp2y="3.7307692307692313"/>
+                                    <point x="5.096153846153847" y="0.09615384615384615" cp1x="5.096153846153847" cp1y="0.09615384615384615" cp2x="5.096153846153847" cp2y="0.09615384615384615"/>
+                                    <point x="5.903846153846154" y="0.09615384615384615" cp1x="5.903846153846154" cp1y="0.09615384615384615" cp2x="5.903846153846154" cp2y="0.09615384615384615"/>
+                                    <point x="6.365384615384615" y="3.6153846153846154" cp1x="6.365384615384615" cp1y="3.6153846153846154" cp2x="6.365384615384615" cp2y="3.6153846153846154"/>
+                                    <point x="9.192307692307693" y="1.0384615384615385" cp1x="9.192307692307693" cp1y="1.0384615384615385" cp2x="9.192307692307693" cp2y="1.0384615384615385"/>
+                                    <point x="9.942307692307693" y="1.8846153846153846" cp1x="9.942307692307693" cp1y="1.8846153846153846" cp2x="9.942307692307693" cp2y="1.8846153846153846"/>
+                                    <point x="7.326923076923077" y="4.711538461538463" cp1x="7.326923076923077" cp1y="4.711538461538463" cp2x="7.326923076923077" cp2y="4.711538461538463"/>
+                                    <point x="10.865384615384613" y="5.153846153846153" cp1x="10.865384615384613" cp1y="5.153846153846153" cp2x="10.865384615384613" cp2y="5.153846153846153"/>
+                                    <point x="10.903846153846155" y="5.884615384615384" cp1x="10.903846153846155" cp1y="5.884615384615384" cp2x="10.903846153846155" cp2y="5.884615384615384"/>
+                                    <point x="7.4423076923076925" y="6.25" cp1x="7.4423076923076925" cp1y="6.25" cp2x="7.4423076923076925" cp2y="6.25"/>
+                                    <point x="9.788461538461547" y="9.384615384615397" cp1x="9.788461538461547" cp1y="9.384615384615397" cp2x="9.788461538461547" cp2y="9.384615384615397"/>
+                                    <point x="9.519230769230782" y="9.961538461538474" cp1x="9.519230769230782" cp1y="9.961538461538474" cp2x="9.519230769230782" cp2y="9.961538461538474"/>
+                                    <point x="6.3269230769230775" y="7.019230769230769" cp1x="6.3269230769230775" cp1y="7.019230769230769" cp2x="6.3269230769230775" cp2y="7.019230769230769"/>
+                                    <point x="5.903846153846154" y="10.903846153846153" cp1x="5.903846153846154" cp1y="10.903846153846153" cp2x="5.903846153846154" cp2y="10.903846153846153"/>
+                                    <point x="5.173076923076923" y="10.865384615384615" cp1x="5.173076923076923" cp1y="10.865384615384615" cp2x="5.173076923076923" cp2y="10.865384615384615"/>
+                                    <point x="4.76923076923077" y="7.0576923076923075" cp1x="4.76923076923077" cp1y="7.0576923076923075" cp2x="4.76923076923077" cp2y="7.0576923076923075"/>
+                                    <point x="1.442307692307693" y="9.807692307692314" cp1x="1.442307692307693" cp1y="9.807692307692314" cp2x="1.442307692307693" cp2y="9.807692307692314"/>
+                                    <point x="1.0384615384615392" y="9.423076923076923" cp1x="1.0384615384615392" cp1y="9.423076923076923" cp2x="1.0384615384615392" cp2y="9.423076923076923"/>
+                                    <point x="3.75" y="6.038461538461538" cp1x="3.75" cp1y="6.038461538461538" cp2x="3.75" cp2y="6.038461538461538"/>
+                                    <point x="0.05769230769230782" y="5.980769230769231" cp1x="0.05769230769230782" cp1y="5.980769230769231" cp2x="0.05769230769230782" cp2y="5.980769230769231"/>
+                                    <point x="0.07692307692307698" y="5.134615384615384" cp1x="0.07692307692307698" cp1y="5.134615384615384" cp2x="0.07692307692307698" cp2y="5.134615384615384"/>
+                                    <point x="3.980769230769231" y="4.711538461538461" cp1x="3.980769230769231" cp1y="4.711538461538461" cp2x="3.980769230769231" cp2y="4.711538461538461"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="85" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-170"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="1.1346153846153861" y="0.30769230769230765" cp1x="1.1346153846153861" cp1y="0.30769230769230765" cp2x="1.1346153846153861" cp2y="0.30769230769230765"/>
+                                    <point x="3.769230769230771" y="1.8846153846153846" cp1x="3.769230769230771" cp1y="1.8846153846153846" cp2x="3.769230769230771" cp2y="1.8846153846153846"/>
+                                    <point x="4.596153846153848" y="0.09615384615384615" cp1x="4.596153846153848" cp1y="0.09615384615384615" cp2x="4.596153846153848" cp2y="0.09615384615384615"/>
+                                    <point x="6.519230769230771" y="2.0384615384615388" cp1x="6.519230769230771" cp1y="2.0384615384615388" cp2x="6.519230769230771" cp2y="2.0384615384615388"/>
+                                    <point x="9.269230769230756" y="0.6923076923076925" cp1x="9.269230769230756" cp1y="0.6923076923076925" cp2x="9.269230769230756" cp2y="0.6923076923076925"/>
+                                    <point x="9.15384615384614" y="4.25" cp1x="9.15384615384614" cp1y="4.25" cp2x="9.15384615384614" cp2y="4.25"/>
+                                    <point x="11.846153846153834" y="4.5576923076923075" cp1x="11.846153846153834" cp1y="4.5576923076923075" cp2x="11.846153846153834" cp2y="4.5576923076923075"/>
+                                    <point x="9.71153846153845" y="7.0" cp1x="9.71153846153845" cp1y="7.0" cp2x="9.71153846153845" cp2y="7.0"/>
+                                    <point x="10.499999999999988" y="10.807692307692308" cp1x="10.499999999999988" cp1y="10.807692307692308" cp2x="10.499999999999988" cp2y="10.807692307692308"/>
+                                    <point x="7.2115384615384635" y="9.980769230769232" cp1x="7.2115384615384635" cp1y="9.980769230769232" cp2x="7.2115384615384635" cp2y="9.980769230769232"/>
+                                    <point x="5.78846153846154" y="12.057692307692308" cp1x="5.78846153846154" cp1y="12.057692307692308" cp2x="5.78846153846154" cp2y="12.057692307692308"/>
+                                    <point x="3.153846153846155" y="9.923076923076923" cp1x="3.153846153846155" cp1y="9.923076923076923" cp2x="3.153846153846155" cp2y="9.923076923076923"/>
+                                    <point x="1.1346153846153861" y="10.557692307692308" cp1x="1.1346153846153861" cp1y="10.557692307692308" cp2x="1.1346153846153861" cp2y="10.557692307692308"/>
+                                    <point x="1.5576923076923088" y="7.923076923076923" cp1x="1.5576923076923088" cp1y="7.923076923076923" cp2x="1.5576923076923088" cp2y="7.923076923076923"/>
+                                    <point x="0.0" y="5.923076923076923" cp1x="0.0" cp1y="5.923076923076923" cp2x="0.0" cp2y="5.923076923076923"/>
+                                    <point x="1.9230769230769242" y="3.403846153846154" cp1x="1.9230769230769242" cp1y="3.403846153846154" cp2x="1.9230769230769242" cp2y="3.403846153846154"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="12.0" y="12.0" cp1x="12.0" cp1y="12.0" cp2x="12.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="100" green="122" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0027436614" saturationOffset="-0.335015" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.25449103" midpoint="0.5">
+                                       <matte red="111" green="130" blue="148" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0024294257" saturationOffset="-0.3857143" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="76" green="91" blue="105" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018081069" saturationOffset="-0.3595238" brightnessOffset="-0.13725492" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                    <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                    <point x="3.7407407407407405" y="3.9999999999999996" cp1x="3.7407407407407405" cp1y="3.9999999999999996" cp2x="3.7407407407407405" cp2y="3.9999999999999996"/>
+                                    <point x="2.0185185185185137" y="10.05555555555555" cp1x="2.0185185185185137" cp1y="10.05555555555555" cp2x="2.0185185185185137" cp2y="10.05555555555555"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="2.9629629629629632" y="12.129629629629632" cp1x="2.9629629629629632" cp1y="12.129629629629632" cp2x="2.9629629629629632" cp2y="12.129629629629632"/>
+                                    <point x="4.579999999999991" y="4.98" cp1x="4.579999999999991" cp1y="4.98" cp2x="4.579999999999991" cp2y="4.98"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="72" green="97" blue="120" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0012094378" saturationOffset="-0.23571429" brightnessOffset="-0.0784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="35" green="55" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.115166366" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="16.0" y="4.0" cp1x="16.0" cp1y="4.0" cp2x="16.0" cp2y="4.0"/>
+                                    <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                    <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="2.9444444444444438" y="1.0185185185185186" cp1x="2.9444444444444438" cp1y="1.0185185185185186" cp2x="2.9444444444444438" cp2y="1.0185185185185186"/>
+                                    <point x="2.9814814814814814" y="1.7407407407407403" cp1x="2.9814814814814814" cp1y="1.7407407407407403" cp2x="2.9814814814814814" cp2y="1.7407407407407403"/>
+                                    <point x="1.7407407407407407" y="3.0" cp1x="1.7407407407407407" cp1y="3.0" cp2x="1.7407407407407407" cp2y="3.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                    <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                    <point x="14.0" y="7.0" cp1x="14.0" cp1y="7.0" cp2x="14.0" cp2y="7.0"/>
+                                    <point x="14.87037037037037" y="5.962962962962965" cp1x="14.87037037037037" cp1y="5.962962962962965" cp2x="14.87037037037037" cp2y="5.962962962962965"/>
+                                    <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                    <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                    <point x="15.462962962962967" y="6.129629629629629" cp1x="15.462962962962967" cp1y="6.129629629629629" cp2x="15.462962962962967" cp2y="6.129629629629629"/>
+                                    <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                    <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                    <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                    <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                    <point x="0.0" y="3.25925925925926" cp1x="0.0" cp1y="3.25925925925926" cp2x="0.0" cp2y="3.25925925925926"/>
+                                    <point x="3.1851851851851856" y="0.0" cp1x="3.1851851851851856" cp1y="0.0" cp2x="3.1851851851851856" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="8.55555555555555" y="2.0000000000000004" cp1x="8.55555555555555" cp1y="2.0000000000000004" cp2x="8.55555555555555" cp2y="2.0000000000000004"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="13.0" cp2y="2.0"/>
+                                    <point x="14.0" y="3.0" cp1x="14.0" cp1y="3.0" cp2x="14.0" cp2y="3.0"/>
+                                    <point x="14.0" y="4.0" cp1x="14.0" cp1y="4.0" cp2x="14.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="8.0" x2="13.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="155" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-100"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="7.0" y1="1.0" y2="2.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="205" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-50"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="2.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="130" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-125"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="2.041666666666667" y="10.187499999999998" cp1x="2.041666666666667" cp1y="10.187499999999998" cp2x="2.041666666666667" cp2y="10.187499999999998"/>
+                                    <point x="3.979166666666668" y="4.0" cp1x="3.979166666666668" cp1y="4.0" cp2x="3.979166666666668" cp2y="4.0"/>
+                                    <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="3.0" y="1.0" cp1x="3.0" cp1y="1.0" cp2x="3.0" cp2y="1.0"/>
+                                    <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                    <point x="2.0" y="3.0" cp1x="2.0" cp1y="3.0" cp2x="2.0" cp2y="3.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.04191617" midpoint="0.5">
+                                       <matte red="178" green="198" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.45978838" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.16467066" midpoint="0.5">
+                                       <matte red="134" green="162" blue="188" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.34848025" brightnessOffset="0.18823528" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3263473" midpoint="0.5">
+                                       <matte red="111" green="139" blue="165" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.30844158" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="95" green="123" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.27329817" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="3.0185185185185186" y="10.055555555555559" cp1x="3.0185185185185186" cp1y="10.055555555555559" cp2x="3.0185185185185186" cp2y="10.055555555555559"/>
+                                    <point x="4.0" y="5.0" cp1x="4.0" cp1y="5.0" cp2x="4.0" cp2y="5.0"/>
+                                    <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                    <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                    <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="121" green="126" blue="136" alpha="156" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.21" alphaOffset="-99"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="13.0" cp1x="0.0" cp1y="13.0" cp2x="0.0" cp2y="13.0"/>
+                                    <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                    <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                    <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                    <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140f3e73ba.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="computerIcon" subregion="true" key="computerIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="hardDriveIcon" subregion="true" key="hardDriveIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>6</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 5">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="8.0" x2="9.0" y1="12.0" y2="14.0" rounding="0.0">
+                                 <matte red="59" green="62" blue="66" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="6.0" x2="7.0" y1="12.0" y2="14.0" rounding="0.0">
+                                 <matte red="59" green="62" blue="66" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="5.0" y1="12.0" y2="14.0" rounding="0.0">
+                                 <matte red="59" green="62" blue="66" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <ellipse x1="3.0" x2="4.0" y1="5.0" y2="6.0">
+                                 <matte red="152" green="155" blue="158" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="4.0" y1="9.0" y2="10.0">
+                                 <matte red="152" green="155" blue="158" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="12.0" x2="13.0" y1="9.0" y2="10.0">
+                                 <matte red="152" green="155" blue="158" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="12.0" x2="13.0" y1="5.0" y2="6.0">
+                                 <matte red="170" green="172" blue="175" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="12.0" x2="13.0" y1="1.0" y2="2.0">
+                                 <matte red="191" green="193" blue="194" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="4.0" y1="1.0" y2="2.0">
+                                 <matte red="191" green="193" blue="194" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 4">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="243" green="245" blue="246" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7967742" midpoint="0.5">
+                                       <matte red="208" green="212" blue="216" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="243" green="245" blue="246" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="5.0" y="2.0" cp1x="4.0" cp1y="3.0" cp2x="6.0" cp2y="1.0"/>
+                                    <point x="11.0" y="2.0" cp1x="10.0" cp1y="1.0" cp2x="12.0" cp2y="3.0"/>
+                                    <point x="12.0" y="5.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="6.0"/>
+                                    <point x="12.0" y="8.0" cp1x="12.0" cp1y="6.0" cp2x="12.0" cp2y="10.0"/>
+                                    <point x="9.0" y="10.0" cp1x="10.0" cp1y="10.0" cp2x="8.0" cp2y="10.0"/>
+                                    <point x="7.0" y="10.0" cp1x="8.0" cp1y="10.0" cp2x="6.0" cp2y="10.0"/>
+                                    <point x="4.0" y="8.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="6.0"/>
+                                    <point x="4.0" y="5.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects>
+                              <dropShadow blendingMode="NORMAL" opacity="0.4" angle="135" distance="0" spread="0" size="4">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </dropShadow>
+                              <innerShadow blendingMode="NORMAL" opacity="0.51" angle="291" distance="3" spread="0" size="2">
+                                 <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </innerShadow>
+                           </effects>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="4.0" y1="13.0" y2="14.0">
+                                 <matte red="144" green="255" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <rectangle x1="10.0" x2="13.0" y1="15.0" y2="16.0" rounding="0.0">
+                                 <matte red="56" green="51" blue="25" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="9.0" y1="15.0" y2="16.0" rounding="0.0">
+                                 <matte red="56" green="51" blue="25" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="105" green="110" blue="118" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="63" green="67" blue="72" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="2.0" y="12.0" cp1x="2.0" cp1y="12.0" cp2x="2.0" cp2y="12.0"/>
+                                    <point x="2.0" y="15.0" cp1x="2.0" cp1y="15.0" cp2x="2.0" cp2y="15.0"/>
+                                    <point x="3.0" y="15.0" cp1x="3.0" cp1y="15.0" cp2x="3.0" cp2y="15.0"/>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="13.0" y="14.0" cp1x="13.0" cp1y="14.0" cp2x="13.0" cp2y="14.0"/>
+                                    <point x="13.0" y="15.0" cp1x="13.0" cp1y="15.0" cp2x="13.0" cp2y="15.0"/>
+                                    <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                    <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <rectangle x1="2.0" x2="14.0" y1="1.0" y2="12.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="239" green="241" blue="243" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="197" green="201" blue="205" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="15.0" y1="12.0" y2="16.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="15.0" y1="0.0" y2="12.0" rounding="0.0">
+                                 <matte red="160" green="161" blue="163" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140f48945c.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="floppyDriveIcon" subregion="true" key="floppyDriveIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="13.0" x2="14.0" y1="13.0" y2="14.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="3.0" y1="13.0" y2="14.0" rounding="0.0">
+                                 <matte red="54" green="78" blue="122" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="12.884615384615381" x2="14.192307692307693" y1="12.903846153846153" y2="14.423076923076929" rounding="0.0">
+                                 <matte red="231" green="234" blue="237" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.807692307692308" x2="3.1730769230769234" y1="12.78846153846154" y2="14.403846153846157" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="12.0" y1="14.0" y2="15.0" rounding="0.0">
+                                 <matte red="255" green="122" blue="101" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <matte red="149" green="153" blue="156" alpha="54" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="4.0" y="1.0" cp1x="4.0" cp1y="1.0" cp2x="4.0" cp2y="1.0"/>
+                                    <point x="5.0" y="1.0" cp1x="5.0" cp1y="1.0" cp2x="5.0" cp2y="1.0"/>
+                                    <point x="5.0" y="5.0" cp1x="5.0" cp1y="5.0" cp2x="5.0" cp2y="5.0"/>
+                                    <point x="7.0" y="5.0" cp1x="7.0" cp1y="5.0" cp2x="7.0" cp2y="5.0"/>
+                                    <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                    <point x="8.0" y="1.0" cp1x="8.0" cp1y="1.0" cp2x="8.0" cp2y="1.0"/>
+                                    <point x="8.0" y="5.0" cp1x="8.0" cp1y="5.0" cp2x="8.0" cp2y="5.0"/>
+                                    <point x="9.0" y="5.0" cp1x="9.0" cp1y="5.0" cp2x="9.0" cp2y="5.0"/>
+                                    <point x="9.0" y="6.0" cp1x="9.0" cp1y="6.0" cp2x="9.0" cp2y="6.0"/>
+                                    <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="231" green="234" blue="237" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="231" green="234" blue="237" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="205" green="211" blue="215" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="1.0" cp1x="6.0" cp1y="1.0" cp2x="6.0" cp2y="1.0"/>
+                                    <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                    <point x="12.0" y="6.0" cp1x="12.0" cp1y="6.0" cp2x="12.0" cp2y="6.0"/>
+                                    <point x="12.0" y="2.0" cp1x="12.0" cp1y="2.0" cp2x="12.0" cp2y="2.0"/>
+                                    <point x="11.0" y="2.0" cp1x="11.0" cp1y="2.0" cp2x="11.0" cp2y="2.0"/>
+                                    <point x="11.0" y="5.0" cp1x="11.0" cp1y="5.0" cp2x="11.0" cp2y="5.0"/>
+                                    <point x="9.0" y="5.0" cp1x="9.0" cp1y="5.0" cp2x="9.0" cp2y="5.0"/>
+                                    <point x="9.0" y="2.0" cp1x="9.0" cp1y="2.0" cp2x="9.0" cp2y="2.0"/>
+                                    <point x="12.0" y="2.0" cp1x="12.0" cp1y="2.0" cp2x="12.0" cp2y="2.0"/>
+                                    <point x="12.0" y="1.0" cp1x="12.0" cp1y="1.0" cp2x="12.0" cp2y="1.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.058064517" midpoint="0.5">
+                                       <matte red="224" green="224" blue="224" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12258065" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.19032258" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.26451612" midpoint="0.5">
+                                       <matte red="224" green="224" blue="224" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36129034" midpoint="0.5">
+                                       <matte red="224" green="224" blue="224" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.4032258" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.516129" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.56774193" midpoint="0.5">
+                                       <matte red="232" green="232" blue="232" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.66129035" midpoint="0.5">
+                                       <matte red="232" green="232" blue="232" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7516129" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.0" y="9.0" cp1x="4.0" cp1y="9.0" cp2x="4.0" cp2y="9.0"/>
+                                    <point x="5.0" y="8.0" cp1x="5.0" cp1y="8.0" cp2x="5.0" cp2y="8.0"/>
+                                    <point x="11.0" y="8.0" cp1x="11.0" cp1y="8.0" cp2x="11.0" cp2y="8.0"/>
+                                    <point x="12.0" y="9.0" cp1x="12.0" cp1y="9.0" cp2x="12.0" cp2y="9.0"/>
+                                    <point x="12.0" y="14.0" cp1x="12.0" cp1y="14.0" cp2x="12.0" cp2y="14.0"/>
+                                    <point x="4.0" y="14.0" cp1x="4.0" cp1y="14.0" cp2x="4.0" cp2y="14.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="164" green="179" blue="206" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.1" midpoint="0.5">
+                                       <matte red="97" green="123" blue="170" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.28387097" midpoint="0.5">
+                                       <matte red="53" green="86" blue="146" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7580645" midpoint="0.5">
+                                       <matte red="48" green="82" blue="144" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="71" green="99" blue="150" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="2.0" cp1x="1.0" cp1y="2.0" cp2x="1.0" cp2y="2.0"/>
+                                    <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                    <point x="13.0" y="1.0" cp1x="13.0" cp1y="1.0" cp2x="13.0" cp2y="1.0"/>
+                                    <point x="15.0" y="3.0" cp1x="15.0" cp1y="3.0" cp2x="15.0" cp2y="3.0"/>
+                                    <point x="15.0" y="15.0" cp1x="15.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="46" green="46" blue="46" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12258065" midpoint="0.5">
+                                       <matte red="64" green="64" blue="64" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88064516" midpoint="0.5">
+                                       <matte red="43" green="43" blue="43" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="1.0"/>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="14.0" y="0.0" cp1x="14.0" cp1y="0.0" cp2x="14.0" cp2y="0.0"/>
+                                    <point x="16.0" y="2.0" cp1x="16.0" cp1y="2.0" cp2x="16.0" cp2y="2.0"/>
+                                    <point x="16.0" y="15.0" cp1x="16.0" cp1y="15.0" cp2x="16.0" cp2y="15.0"/>
+                                    <point x="15.0" y="16.0" cp1x="15.0" cp1y="16.0" cp2x="15.0" cp2y="16.0"/>
+                                    <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140f577f59.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="homeFolderIcon" subregion="true" key="homeFolderIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="160" green="161" blue="162" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="221" green="225" blue="230" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.630769230769231" y1="0.36217948717948706" x2="0.28846153846153844" y2="0.7339743589743591"/>
+                                 <points>
+                                    <point x="9.0" y="3.0" cp1x="9.0" cp1y="3.0" cp2x="9.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="8.0" y="6.0" cp1x="8.0" cp1y="6.0" cp2x="8.0" cp2y="6.0"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                    <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                    <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="160" green="161" blue="162" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="226" green="230" blue="233" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4307692307692308" y1="0.3782051282051281" x2="0.7076923076923081" y2="0.6730769230769232"/>
+                                 <points>
+                                    <point x="3.0" y="8.0" cp1x="3.0" cp1y="8.0" cp2x="3.0" cp2y="8.0"/>
+                                    <point x="7.0" y="3.0" cp1x="7.0" cp1y="3.0" cp2x="7.0" cp2y="3.0"/>
+                                    <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                    <point x="8.0" y="6.0" cp1x="8.0" cp1y="6.0" cp2x="8.0" cp2y="6.0"/>
+                                    <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                    <point x="3.0" y="9.0" cp1x="3.0" cp1y="9.0" cp2x="3.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="244" green="222" blue="143" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="1.2884615384615383" y="7.23076923076923" cp1x="1.2884615384615383" cp1y="7.23076923076923" cp2x="1.2884615384615383" cp2y="7.23076923076923"/>
+                                    <point x="1.0" y="8.0" cp1x="1.0" cp1y="8.0" cp2x="1.0" cp2y="8.0"/>
+                                    <point x="1.6153846153846154" y="7.8269230769230775" cp1x="1.6153846153846154" cp1y="7.8269230769230775" cp2x="1.6153846153846154" cp2y="7.8269230769230775"/>
+                                    <point x="7.403846153846156" y="2.019230769230769" cp1x="7.403846153846156" cp1y="2.019230769230769" cp2x="7.403846153846156" cp2y="2.019230769230769"/>
+                                    <point x="8.557692307692301" y="2.0" cp1x="8.557692307692301" cp1y="2.0" cp2x="8.557692307692301" cp2y="2.0"/>
+                                    <point x="14.30769230769231" y="7.76923076923077" cp1x="14.30769230769231" cp1y="7.76923076923077" cp2x="14.30769230769231" cp2y="7.76923076923077"/>
+                                    <point x="15.0" y="8.0" cp1x="15.0" cp1y="8.0" cp2x="15.0" cp2y="8.0"/>
+                                    <point x="14.730769230769223" y="7.192307692307692" cp1x="14.730769230769223" cp1y="7.192307692307692" cp2x="14.730769230769223" cp2y="7.192307692307692"/>
+                                    <point x="8.65384615384615" y="0.9807692307692306" cp1x="8.65384615384615" cp1y="0.9807692307692306" cp2x="8.65384615384615" cp2y="0.9807692307692306"/>
+                                    <point x="7.442307692307691" y="1.0" cp1x="7.442307692307691" cp1y="1.0" cp2x="7.442307692307691" cp2y="1.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="114" green="92" blue="13" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="64" green="48" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="7.0" cp1x="0.0" cp1y="7.0" cp2x="0.0" cp2y="7.0"/>
+                                    <point x="0.0" y="9.0" cp1x="0.0" cp1y="9.0" cp2x="0.0" cp2y="9.0"/>
+                                    <point x="2.0" y="9.0" cp1x="2.0" cp1y="9.0" cp2x="2.0" cp2y="9.0"/>
+                                    <point x="7.384615384615392" y="2.9999999999999987" cp1x="7.384615384615392" cp1y="2.9999999999999987" cp2x="7.384615384615392" cp2y="2.9999999999999987"/>
+                                    <point x="8.576923076923077" y="3.0" cp1x="8.576923076923077" cp1y="3.0" cp2x="8.576923076923077" cp2y="3.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                    <point x="16.0" y="9.0" cp1x="16.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="16.0" y="7.0" cp1x="16.0" cp1y="7.0" cp2x="16.0" cp2y="7.0"/>
+                                    <point x="9.0" y="0.0" cp1x="9.0" cp1y="0.0" cp2x="9.0" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 4">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="6.0" x2="7.0" y1="10.0" y2="14.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="137" green="115" blue="60" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="174" green="151" blue="91" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="81" green="59" blue="7" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="97" green="74" blue="18" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="5.0" y="15.0" cp1x="5.0" cp1y="15.0" cp2x="5.0" cp2y="15.0"/>
+                                    <point x="8.0" y="15.0" cp1x="8.0" cp1y="15.0" cp2x="8.0" cp2y="15.0"/>
+                                    <point x="8.0" y="10.0" cp1x="8.0" cp1y="10.0" cp2x="8.0" cp2y="10.0"/>
+                                    <point x="7.0" y="9.0" cp1x="7.0" cp1y="9.0" cp2x="7.0" cp2y="9.0"/>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="5.0" y="10.0" cp1x="5.0" cp1y="10.0" cp2x="5.0" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                              <rectangle x1="10.0" x2="11.0" y1="10.0" y2="11.0" rounding="0.0">
+                                 <matte red="77" green="133" blue="185" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="9.0" x2="12.0" y1="9.0" y2="12.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="27" green="57" blue="87" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="75" green="109" blue="137" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <matte red="228" green="232" blue="237" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0" y="8.0" cp1x="3.0" cp1y="8.0" cp2x="3.0" cp2y="8.0"/>
+                                    <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                    <point x="13.0" y="14.0" cp1x="13.0" cp1y="14.0" cp2x="13.0" cp2y="14.0"/>
+                                    <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                    <point x="8.0" y="4.0" cp1x="8.0" cp1y="4.0" cp2x="8.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="51" green="60" blue="70" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="2.0" y="8.0" cp1x="2.0" cp1y="8.0" cp2x="2.0" cp2y="8.0"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="3.0" y="15.0" cp1x="3.0" cp1y="15.0" cp2x="3.0" cp2y="15.0"/>
+                                    <point x="13.0" y="15.0" cp1x="13.0" cp1y="15.0" cp2x="13.0" cp2y="15.0"/>
+                                    <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                    <point x="14.0" y="8.0" cp1x="14.0" cp1y="8.0" cp2x="14.0" cp2y="8.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140f660775.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="detailsViewIcon" subregion="true" key="detailsViewIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>7</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 6">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="5.0" x2="7.0" y1="9.0" y2="10.0" rounding="0.0">
+                                 <matte red="69" green="78" blue="85" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.00573498" saturationOffset="-0.447479" brightnessOffset="-0.21568629" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="8.0" x2="10.0" y1="9.0" y2="10.0" rounding="0.0">
+                                 <matte red="93" green="106" blue="117" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0022627711" saturationOffset="-0.4305861" brightnessOffset="-0.0901961" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="8.0" x2="10.0" y1="7.0" y2="8.0" rounding="0.0">
+                                 <matte red="103" green="109" blue="113" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.011985004" saturationOffset="-0.54721874" brightnessOffset="-0.10588238" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="5.0" x2="7.0" y1="7.0" y2="8.0" rounding="0.0">
+                                 <matte red="105" green="111" blue="116" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5408867" brightnessOffset="-0.09411767" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 5">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.12215909" midpoint="0.5">
+                                       <matte red="16" green="16" blue="16" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.48627454" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.19886364" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.32670453" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.53409094" midpoint="0.5">
+                                       <matte red="138" green="138" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="1.0" y1="0.0" x2="0.0" y2="1.0"/>
+                                 <points>
+                                    <point x="0.9130434782608696" y="14.608695652173912" cp1x="0.9130434782608696" cp1y="14.608695652173912" cp2x="0.9130434782608696" cp2y="14.608695652173912"/>
+                                    <point x="1.4130434782608694" y="15.108695652173912" cp1x="1.4130434782608694" cp1y="15.108695652173912" cp2x="1.4130434782608694" cp2y="15.108695652173912"/>
+                                    <point x="5.108695652173911" y="11.478260869565219" cp1x="5.108695652173911" cp1y="11.478260869565219" cp2x="5.108695652173911" cp2y="11.478260869565219"/>
+                                    <point x="4.5652173913043494" y="10.934782608695649" cp1x="4.5652173913043494" cp1y="10.934782608695649" cp2x="4.5652173913043494" cp2y="10.934782608695649"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.38352272" midpoint="0.5">
+                                       <matte red="64" green="64" blue="64" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.29803923" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.45454547" midpoint="0.5">
+                                       <matte red="171" green="171" blue="171" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="0.12156862" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.51420456" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.0" x2="1.0" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                    <point x="0.0" y="16.0" cp1x="0.0" cp1y="16.0" cp2x="0.0" cp2y="16.0"/>
+                                    <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                                    <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                    <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                              <ellipse x1="4.0" x2="11.0" y1="5.0" y2="12.0">
+                                 <radialGradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.40625">
+                                       <matte red="229" green="240" blue="249" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0036516786" saturationOffset="-0.555393" brightnessOffset="0.42745095" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="155" green="186" blue="213" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0010654926" saturationOffset="-0.3634138" brightnessOffset="0.2862745" alphaOffset="0"/>
+                                    </stop>
+                                 </radialGradient>
+                                 <paintPoints x1="0.4922360248447207" y1="0.975155279503105" x2="0.47826086956521735" y2="0.23913043478260873"/>
+                              </ellipse>
+                              <ellipse x1="3.0" x2="12.0" y1="4.0" y2="13.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="102" green="102" blue="104" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6164835" brightnessOffset="-0.14117649" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="12" green="12" blue="12" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.5019608" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Icon">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="8.0" x2="13.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="178" green="183" blue="189" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.012257397" saturationOffset="-0.5775132" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="8.0" x2="13.0" y1="7.0" y2="8.0" rounding="0.0">
+                                 <matte red="163" green="174" blue="184" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.52158386" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="8.0" x2="13.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="163" green="174" blue="184" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.52158386" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="5.0" x2="7.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="163" green="174" blue="184" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.52158386" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="15.0" y1="1.0" y2="14.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="233" green="239" blue="244" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5906323" brightnessOffset="0.4078431" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11363637" midpoint="0.5">
+                                       <matte red="200" green="214" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.51290727" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.57102275" midpoint="0.5">
+                                       <matte red="221" green="229" blue="238" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.009583652" saturationOffset="-0.5642857" brightnessOffset="0.3843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="241" green="245" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0072231293" saturationOffset="-0.6074885" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="16.0" y1="0.0" y2="15.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="161" green="175" blue="189" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.48756614" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="123" green="134" blue="145" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.48399013" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11499160af7.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="listViewIcon" subregion="true" key="listViewIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="16" height="16"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Icon">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="7.0" x2="12.0" y1="12.0" y2="13.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="40" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="12.0" y2="13.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="40" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="10.0" y2="11.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="50" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="11.0" y1="10.0" y2="11.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="40" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="12.0" y1="8.0" y2="9.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="40" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="8.0" y2="9.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="50" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="11.0" y1="6.0" y2="7.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="40" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="6.0" y2="7.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="50" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="12.0" y1="4.0" y2="5.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="50" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="4.0" y2="5.0" rounding="0.0">
+                                 <matte red="186" green="186" blue="186" alpha="50" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="70" green="75" blue="79" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.52179027" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="12.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="70" green="75" blue="79" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.52179027" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42897728" midpoint="0.5">
+                                       <matte red="93" green="98" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.547479" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="70" green="75" blue="79" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.52179027" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.0" x2="1.0" y2="0.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="11.0" y1="9.0" y2="10.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="108" green="114" blue="120" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.4346591" midpoint="0.5">
+                                       <matte red="77" green="82" blue="87" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.0" x2="1.0" y2="0.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="9.0" y2="10.0" rounding="0.0">
+                                 <matte red="77" green="82" blue="87" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.52077174" brightnessOffset="-0.20784315" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="12.0" y1="7.0" y2="8.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="87" green="93" blue="98" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5234694" brightnessOffset="-0.1647059" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.48295453" midpoint="0.5">
+                                       <matte red="106" green="112" blue="118" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.53401935" brightnessOffset="-0.086274534" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="87" green="93" blue="98" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5234694" brightnessOffset="-0.1647059" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="7.0" y2="8.0" rounding="0.0">
+                                 <matte red="90" green="95" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.010526314" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="5.0" y2="6.0" rounding="0.0">
+                                 <matte red="97" green="103" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.03535354" saturationOffset="-0.008674465" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="11.0" y1="5.0" y2="6.0" rounding="0.0">
+                                 <matte red="97" green="103" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5338625" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="7.0" x2="12.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.25" midpoint="0.5">
+                                       <matte red="99" green="105" blue="111" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5276062" brightnessOffset="-0.11372551" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42045453" midpoint="0.5">
+                                       <matte red="124" green="132" blue="139" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.5278006" brightnessOffset="-0.0039215684" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5823864" midpoint="0.5">
+                                       <matte red="99" green="105" blue="111" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5276062" brightnessOffset="-0.11372551" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.0" x2="1.0" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="4.0" x2="6.0" y1="3.0" y2="4.0" rounding="0.0">
+                                 <matte red="99" green="105" blue="111" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5276062" brightnessOffset="-0.11372551" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="15.0" y1="1.0" y2="14.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="233" green="239" blue="244" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.5906323" brightnessOffset="0.4078431" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.07670455" midpoint="0.5">
+                                       <matte red="200" green="214" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.51290727" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.4090909" midpoint="0.5">
+                                       <matte red="209" green="221" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.53271" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="241" green="245" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0072231293" saturationOffset="-0.6074885" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="16.0" y1="0.0" y2="15.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="161" green="175" blue="189" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.48756614" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="123" green="134" blue="145" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.48399013" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114997c75bc.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.plaf.synth.SynthInternalFrameTitlePane" name="InternalFrameTitlePane" ui="ComponentUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties>
+               <uiProperty name="maxFrameIconSize" type="DIMENSION">
+                  <dimension width="18" height="18"/>
+               </uiProperty>
+           </uiproperties>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JInternalFrame" name="InternalFrame" ui="InternalFrameUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="WindowFocused">
+               <codeSnippet><![CDATA[
+                         return c instanceof JInternalFrame && ((JInternalFrame)c).isSelected();]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="1" bottom="6" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="25" height="36"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="25" bottom="6" left="6" right="6"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="23.0" y1="34.0" y2="35.0" rounding="0.0">
+                           <matte red="211" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07399663" brightnessOffset="0.11372548" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="6.0" x2="19.0" y1="25.0" y2="30.0" rounding="0.0">
+                           <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="158" green="163" blue="173" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.023821115" brightnessOffset="-0.06666666" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="20.0" y="25.0" cp1x="20.0" cp1y="25.0" cp2x="20.0" cp2y="25.0"/>
+                              <point x="6.0" y="25.0" cp1x="6.0" cp1y="25.0" cp2x="6.0" cp2y="25.0"/>
+                              <point x="6.0" y="30.0" cp1x="6.0" cp1y="30.0" cp2x="6.0" cp2y="30.0"/>
+                              <point x="19.0" y="30.0" cp1x="19.0" cp1y="30.0" cp2x="19.0" cp2y="30.0"/>
+                              <point x="19.0" y="25.0" cp1x="19.0" cp1y="25.0" cp2x="19.0" cp2y="25.0"/>
+                              <point x="20.0" y="25.0" cp1x="20.0" cp1y="25.0" cp2x="20.0" cp2y="25.0"/>
+                              <point x="20.0" y="31.0" cp1x="20.0" cp1y="31.0" cp2x="20.0" cp2y="31.0"/>
+                              <point x="5.0" y="31.0" cp1x="5.0" cp1y="31.0" cp2x="5.0" cp2y="31.0"/>
+                              <point x="5.0" y="24.0" cp1x="5.0" cp1y="24.0" cp2x="5.0" cp2y="24.0"/>
+                              <point x="20.0" y="24.0" cp1x="20.0" cp1y="24.0" cp2x="20.0" cp2y="24.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="203" green="207" blue="213" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.06357796" brightnessOffset="0.09019607" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="5.0" y="24.0" cp1x="5.0" cp1y="24.0" cp2x="5.0" cp2y="24.0"/>
+                              <point x="4.0" y="24.0" cp1x="4.0" cp1y="24.0" cp2x="4.0" cp2y="24.0"/>
+                              <point x="4.0" y="32.0" cp1x="4.0" cp1y="32.0" cp2x="4.0" cp2y="32.0"/>
+                              <point x="21.0" y="32.0" cp1x="21.0" cp1y="32.0" cp2x="21.0" cp2y="32.0"/>
+                              <point x="21.0" y="24.0" cp1x="21.0" cp1y="24.0" cp2x="21.0" cp2y="24.0"/>
+                              <point x="20.0" y="24.0" cp1x="20.0" cp1y="24.0" cp2x="20.0" cp2y="24.0"/>
+                              <point x="20.0" y="31.0" cp1x="20.0" cp1y="31.0" cp2x="20.0" cp2y="31.0"/>
+                              <point x="5.0" y="31.0" cp1x="5.0" cp1y="31.0" cp2x="5.0" cp2y="31.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="192" green="196" blue="203" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.056339122" brightnessOffset="0.05098039" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="4.0" y="24.0" cp1x="4.0" cp1y="24.0" cp2x="4.0" cp2y="24.0"/>
+                              <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                              <point x="1.0" y="33.0" cp1x="1.0" cp1y="32.0" cp2x="1.0" cp2y="34.0"/>
+                              <point x="3.0" y="35.0" cp1x="2.0" cp1y="35.0" cp2x="4.0" cp2y="35.0"/>
+                              <point x="22.0" y="35.0" cp1x="21.0" cp1y="35.0" cp2x="23.0" cp2y="35.0"/>
+                              <point x="24.0" y="33.0" cp1x="24.0" cp1y="34.0" cp2x="24.0" cp2y="32.0"/>
+                              <point x="24.0" y="24.0" cp1x="24.0" cp1y="24.0" cp2x="24.0" cp2y="24.0"/>
+                              <point x="21.0" y="24.0" cp1x="21.0" cp1y="24.0" cp2x="21.0" cp2y="24.0"/>
+                              <point x="21.0" y="32.0" cp1x="21.0" cp1y="32.0" cp2x="21.0" cp2y="32.0"/>
+                              <point x="4.0" y="32.0" cp1x="4.0" cp1y="32.0" cp2x="4.0" cp2y="32.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.3203593">
+                                 <matte red="170" green="174" blue="183" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.004273474" saturationOffset="-0.039488062" brightnessOffset="-0.027450979" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="192" green="196" blue="203" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.056339122" brightnessOffset="0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="1.0" y="3.0" cp1x="1.0" cp1y="4.0" cp2x="1.0" cp2y="2.0"/>
+                              <point x="3.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="4.0" cp2y="1.0"/>
+                              <point x="22.0" y="1.0" cp1x="21.0" cp1y="1.0" cp2x="23.0" cp2y="1.0"/>
+                              <point x="24.0" y="3.0" cp1x="24.0" cp1y="2.0" cp2x="24.0" cp2y="4.0"/>
+                              <point x="24.0" y="24.0" cp1x="24.0" cp1y="24.0" cp2x="24.0" cp2y="24.0"/>
+                              <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.0" x2="25.0" y1="0.0" y2="36.0" rounding="4.666666666666666">
+                           <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.53637654" brightnessOffset="0.043137252" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113e0dd2c60.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+WindowFocused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="25" height="36"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="25" bottom="6" left="6" right="6"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="23.0" y1="34.0" y2="35.0" rounding="0.0">
+                           <matte red="235" green="236" blue="238" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="23.0" y1="2.0" y2="24.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.24251497">
+                                 <matte red="227" green="229" blue="232" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.61416256" brightnessOffset="0.3607843" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="170" green="175" blue="185" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5546332" brightnessOffset="0.17647058" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                           <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                           <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                           <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="6.0" x2="19.0" y1="25.0" y2="30.0" rounding="0.0">
+                           <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="108" green="114" blue="128" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03801495" saturationOffset="-0.4794643" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="5.0" y="25.0" cp1x="5.0" cp1y="25.0" cp2x="5.0" cp2y="25.0"/>
+                              <point x="5.0" y="31.0" cp1x="5.0" cp1y="31.0" cp2x="5.0" cp2y="31.0"/>
+                              <point x="20.0" y="31.0" cp1x="20.0" cp1y="31.0" cp2x="20.0" cp2y="31.0"/>
+                              <point x="20.0" y="24.0" cp1x="20.0" cp1y="24.0" cp2x="20.0" cp2y="24.0"/>
+                              <point x="5.0" y="24.0" cp1x="5.0" cp1y="24.0" cp2x="5.0" cp2y="24.0"/>
+                              <point x="5.0" y="25.0" cp1x="5.0" cp1y="25.0" cp2x="5.0" cp2y="25.0"/>
+                              <point x="19.0" y="25.0" cp1x="19.0" cp1y="25.0" cp2x="19.0" cp2y="25.0"/>
+                              <point x="19.0" y="30.0" cp1x="19.0" cp1y="30.0" cp2x="19.0" cp2y="30.0"/>
+                              <point x="6.0" y="30.0" cp1x="6.0" cp1y="30.0" cp2x="6.0" cp2y="30.0"/>
+                              <point x="6.0" y="25.0" cp1x="6.0" cp1y="25.0" cp2x="6.0" cp2y="25.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="149" green="158" blue="167" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.52792984" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="21.0" y="24.0" cp1x="21.0" cp1y="24.0" cp2x="21.0" cp2y="24.0"/>
+                              <point x="20.0" y="24.0" cp1x="20.0" cp1y="24.0" cp2x="20.0" cp2y="24.0"/>
+                              <point x="20.0" y="31.0" cp1x="20.0" cp1y="31.0" cp2x="20.0" cp2y="31.0"/>
+                              <point x="5.0" y="31.0" cp1x="5.0" cp1y="31.0" cp2x="5.0" cp2y="31.0"/>
+                              <point x="5.0" y="24.0" cp1x="5.0" cp1y="24.0" cp2x="5.0" cp2y="24.0"/>
+                              <point x="4.0" y="24.0" cp1x="4.0" cp1y="24.0" cp2x="4.0" cp2y="24.0"/>
+                              <point x="4.0" y="32.0" cp1x="4.0" cp1y="32.0" cp2x="4.0" cp2y="32.0"/>
+                              <point x="21.0" y="32.0" cp1x="21.0" cp1y="32.0" cp2x="21.0" cp2y="32.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="171" green="176" blue="186" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.55506915" brightnessOffset="0.18039215" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="4.0" y="24.0" cp1x="4.0" cp1y="24.0" cp2x="4.0" cp2y="24.0"/>
+                              <point x="2.0" y="24.0" cp1x="2.0" cp1y="24.0" cp2x="2.0" cp2y="24.0"/>
+                              <point x="2.0" y="32.0" cp1x="2.0" cp1y="31.0" cp2x="2.0" cp2y="33.0"/>
+                              <point x="4.0" y="34.0" cp1x="3.0" cp1y="34.0" cp2x="5.0" cp2y="34.0"/>
+                              <point x="21.0" y="34.0" cp1x="20.0" cp1y="34.0" cp2x="22.0" cp2y="34.0"/>
+                              <point x="23.0" y="32.0" cp1x="23.0" cp1y="33.0" cp2x="23.0" cp2y="31.0"/>
+                              <point x="23.0" y="24.0" cp1x="23.0" cp1y="24.0" cp2x="23.0" cp2y="24.0"/>
+                              <point x="21.0" y="24.0" cp1x="21.0" cp1y="24.0" cp2x="21.0" cp2y="24.0"/>
+                              <point x="21.0" y="32.0" cp1x="21.0" cp1y="32.0" cp2x="21.0" cp2y="32.0"/>
+                              <point x="4.0" y="32.0" cp1x="4.0" cp1y="32.0" cp2x="4.0" cp2y="32.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="204" green="207" blue="213" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="3.0" y="24.0" cp1x="3.0" cp1y="24.0" cp2x="3.0" cp2y="24.0"/>
+                              <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                              <point x="1.0" y="33.0" cp1x="1.0" cp1y="32.0" cp2x="1.0" cp2y="34.0"/>
+                              <point x="3.0" y="35.0" cp1x="2.0" cp1y="35.0" cp2x="4.0" cp2y="35.0"/>
+                              <point x="22.0" y="35.0" cp1x="21.0" cp1y="35.0" cp2x="23.0" cp2y="35.0"/>
+                              <point x="24.0" y="33.0" cp1x="24.0" cp1y="34.0" cp2x="24.0" cp2y="32.0"/>
+                              <point x="24.0" y="24.0" cp1x="24.0" cp1y="24.0" cp2x="24.0" cp2y="24.0"/>
+                              <point x="22.0" y="24.0" cp1x="22.0" cp1y="24.0" cp2x="22.0" cp2y="24.0"/>
+                              <point x="22.0" y="33.0" cp1x="22.0" cp1y="33.0" cp2x="22.0" cp2y="33.0"/>
+                              <point x="3.0" y="33.0" cp1x="3.0" cp1y="33.0" cp2x="3.0" cp2y="33.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="240" green="241" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6274498" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="204" green="207" blue="213" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5934608" brightnessOffset="0.2862745" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="1.0" y="3.0" cp1x="1.0" cp1y="4.0" cp2x="1.0" cp2y="2.0"/>
+                              <point x="3.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="4.0" cp2y="1.0"/>
+                              <point x="22.0" y="1.0" cp1x="21.0" cp1y="1.0" cp2x="23.0" cp2y="1.0"/>
+                              <point x="24.0" y="3.0" cp1x="24.0" cp1y="2.0" cp2x="24.0" cp2y="4.0"/>
+                              <point x="24.0" y="24.0" cp1x="24.0" cp1y="24.0" cp2x="24.0" cp2y="24.0"/>
+                              <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="1.0" y="2.0" cp1x="1.0" cp1y="1.0" cp2x="1.0" cp2y="3.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.0" x2="25.0" y1="0.0" y2="36.0" rounding="4.833333333333332">
+                           <matte red="43" green="46" blue="51" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02551502" saturationOffset="-0.47885156" brightnessOffset="-0.34901965" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113e0e9b602.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="InternalFrameTitlePane" subregion="false">
+               <contentMargins top="3" bottom="3" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties>
+                     <uiProperty name="titleAlignment" type="STRING" value="CENTER"/>
+                  </uiproperties>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions>
+                  <uiComponent opaque="false" componentName="InternalFrameTitlePane.menuButton" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="true">
+                     <stateTypes>
+                        <stateType key="Enabled"/>
+                        <stateType key="MouseOver"/>
+                        <stateType key="Pressed"/>
+                        <stateType key="Disabled"/>
+                        <stateType key="Focused"/>
+                        <stateType key="Selected"/>
+                        <stateType key="WindowNotFocused">
+                           <codeSnippet><![CDATA[
+                               Component parent = c;
+                               while (parent.getParent() != null) {
+                                   if (parent instanceof JInternalFrame) {
+                                       break;
+                                   }
+                                   parent = parent.getParent();
+                               }
+                               if (parent instanceof JInternalFrame) {
+                                   return !(((JInternalFrame)parent).isSelected());
+                               }
+                               return false;]]></codeSnippet>
+                        </stateType>
+                     </stateTypes>
+                     <contentMargins top="0" bottom="0" left="0" right="0"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties>
+                           <uiProperty name="test" type="STRING" value="am InternalFrameTitlePane.menuButton"/>
+                        </uiproperties>
+                     </style>
+                     <backgroundStates/>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions>
+                        <uiIconRegion name="Icon" subregion="true" key="icon">
+                                 <contentMargins top="9" bottom="9" left="10" right="9"/>
+                                 <style>
+                                    <textForeground/>
+                                    <textBackground/>
+                                    <background/>
+                                    <cacheSettingsInherited>false</cacheSettingsInherited>
+                                    <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                                    <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                                    <uiproperties/>
+                                 </style>
+                                 <backgroundStates>
+                                    <state stateKeys="Enabled">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="54" green="66" blue="88" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.24935067" brightnessOffset="-0.20392159" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="54" green="66" blue="88" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.24935067" brightnessOffset="-0.20392159" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="54" green="66" blue="88" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.24935067" brightnessOffset="-0.20392159" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="8.0" cp1x="6.0" cp1y="8.0" cp2x="6.0" cp2y="8.0"/>
+                                                      <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                                      <point x="9.524999999999995" y="12.975" cp1x="9.524999999999995" cp1y="12.975" cp2x="9.524999999999995" cp2y="12.975"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="157" green="163" blue="174" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.53801316" brightnessOffset="0.13333333" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="87" green="97" blue="116" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.3857143" brightnessOffset="-0.09411767" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="86" green="96" blue="115" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.3835404" brightnessOffset="-0.09803924" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="113" green="123" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.43148893" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="0" green="0" blue="12" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.5019608" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="86" green="96" blue="115" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.3835404" brightnessOffset="-0.09803924" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0d626ac.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="Disabled">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5760128" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="185" green="188" blue="193" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02551502" saturationOffset="-0.5942635" brightnessOffset="0.20784312" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.62215906" midpoint="0.5">
+                                                         <matte red="158" green="163" blue="173" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5490091" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5469569" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="47" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-208"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0e8c4f9.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="MouseOver">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="8.0" cp1x="6.0" cp1y="8.0" cp2x="6.0" cp2y="8.0"/>
+                                                      <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                                      <point x="9.524999999999995" y="12.975" cp1x="9.524999999999995" cp1y="12.975" cp2x="9.524999999999995" cp2y="12.975"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="168" green="174" blue="185" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.5438224" brightnessOffset="0.17647058" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="105" green="115" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.41929638" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="105" green="115" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.41929638" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="132" green="142" blue="161" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.45559007" brightnessOffset="0.082352936" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="0" green="0" blue="15" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4901961" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="44" green="56" blue="80" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.1857143" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0eacd3f.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="Pressed">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="8.0" cp1x="6.0" cp1y="8.0" cp2x="6.0" cp2y="8.0"/>
+                                                      <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                                      <point x="9.524999999999995" y="12.975" cp1x="9.524999999999995" cp1y="12.975" cp2x="9.524999999999995" cp2y="12.975"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="112" green="120" blue="136" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.4592437" brightnessOffset="-0.015686274" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="56" green="68" blue="90" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.2579365" brightnessOffset="-0.19607845" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="56" green="68" blue="90" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.2579365" brightnessOffset="-0.19607845" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="72" green="83" blue="106" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.3149596" brightnessOffset="-0.13333336" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="13" green="27" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.031104386" saturationOffset="0.12354499" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0ec1755.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="Enabled+WindowNotFocused">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="100" green="104" blue="110" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.54480517" brightnessOffset="-0.11764708" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="181" green="185" blue="192" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5784226" brightnessOffset="0.20392156" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="148" green="151" blue="159" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.042560518" saturationOffset="-0.5665319" brightnessOffset="0.0745098" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="169" green="173" blue="182" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.036732912" saturationOffset="-0.5642857" brightnessOffset="0.16470587" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="7.0" cp1x="6.0" cp1y="7.0" cp2x="6.0" cp2y="7.0"/>
+                                                      <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                                      <point x="9.409090909090903" y="11.795454545454545" cp1x="9.409090909090903" cp1y="11.795454545454545" cp2x="9.409090909090903" cp2y="11.795454545454545"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999995">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="219" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6133929" brightnessOffset="0.32941175" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="188" green="191" blue="199" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.042560518" saturationOffset="-0.5804379" brightnessOffset="0.23137254" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.57417583" brightnessOffset="0.21568626" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5760128" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.53637654" brightnessOffset="0.043137252" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.49935067" brightnessOffset="-0.11764708" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.49935067" brightnessOffset="-0.11764708" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113fc39fc2b.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="MouseOver+WindowNotFocused">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="77" green="88" blue="111" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.329408" brightnessOffset="-0.11372551" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="8.0" cp1x="6.0" cp1y="8.0" cp2x="6.0" cp2y="8.0"/>
+                                                      <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                                      <point x="9.524999999999995" y="12.975" cp1x="9.524999999999995" cp1y="12.975" cp2x="9.524999999999995" cp2y="12.975"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="168" green="174" blue="185" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.5438224" brightnessOffset="0.17647058" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="105" green="115" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.41929638" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="105" green="115" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.41929638" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="132" green="142" blue="161" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.030543745" saturationOffset="-0.45559007" brightnessOffset="0.082352936" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="0" green="0" blue="15" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4901961" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="44" green="56" blue="80" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.1857143" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0eacd3f.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                    <state stateKeys="Pressed+WindowNotFocused">
+                                       <style>
+                                          <textForeground/>
+                                          <textBackground/>
+                                          <background/>
+                                          <uiproperties/>
+                                       </style>
+                                       <canvas>
+                                          <size width="19" height="18"/>
+                                          <nextLayerNameIndex>2</nextLayerNameIndex>
+                                          <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                                          <layer name="Layer 1">
+                                             <opacity>1.0</opacity>
+                                             <fillOpacity>1.0</fillOpacity>
+                                             <blendingMode>NORMAL</blendingMode>
+                                             <locked>false</locked>
+                                             <visible>true</visible>
+                                             <shapes>
+                                                <path>
+                                                   <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                   <points>
+                                                      <point x="6.0" y="6.0" cp1x="6.0" cp1y="6.0" cp2x="6.0" cp2y="6.0"/>
+                                                      <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                                      <point x="9.500000000000004" y="10.95" cp1x="9.500000000000004" cp1y="10.95" cp2x="9.500000000000004" cp2y="10.95"/>
+                                                   </points>
+                                                </path>
+                                                <path>
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="123" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="-132"/>
+                                                      </stop>
+                                                      <stop position="0.48579547" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="16" green="30" blue="56" alpha="132" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="0.07857144" brightnessOffset="-0.3294118" alphaOffset="-123"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.5071428571428569" y1="0.09499999999999999" x2="0.49285714285714344" y2="0.9099999999999999"/>
+                                                   <points>
+                                                      <point x="6.0" y="8.0" cp1x="6.0" cp1y="8.0" cp2x="6.0" cp2y="8.0"/>
+                                                      <point x="13.0" y="8.0" cp1x="13.0" cp1y="8.0" cp2x="13.0" cp2y="8.0"/>
+                                                      <point x="9.524999999999995" y="12.975" cp1x="9.524999999999995" cp1y="12.975" cp2x="9.524999999999995" cp2y="12.975"/>
+                                                   </points>
+                                                </path>
+                                                <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="112" green="120" blue="136" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.4592437" brightnessOffset="-0.015686274" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.53977275" midpoint="0.5">
+                                                         <matte red="56" green="68" blue="90" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.2579365" brightnessOffset="-0.19607845" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="0.6505682" midpoint="0.5">
+                                                         <matte red="56" green="68" blue="90" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029191494" saturationOffset="-0.2579365" brightnessOffset="-0.19607845" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="72" green="83" blue="106" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03409344" saturationOffset="-0.3149596" brightnessOffset="-0.13333336" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                                   <gradient cycleMethod="NO_CYCLE">
+                                                      <stop position="0.0" midpoint="0.5">
+                                                         <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                                      </stop>
+                                                      <stop position="1.0" midpoint="0.5">
+                                                         <matte red="13" green="27" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.031104386" saturationOffset="0.12354499" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                                                      </stop>
+                                                   </gradient>
+                                                   <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                                </rectangle>
+                                                <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                                   <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                                   <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                                </rectangle>
+                                             </shapes>
+                                             <effects/>
+                                          </layer>
+                                          <templateLayer fileName="113d0ec1755.png">
+                                             <layer name="Template" type="template">
+                                                <opacity>1.0</opacity>
+                                                <fillOpacity>1.0</fillOpacity>
+                                                <blendingMode>NORMAL</blendingMode>
+                                                <locked>false</locked>
+                                                <visible>false</visible>
+                                                <shapes/>
+                                                <effects/>
+                                             </layer>
+                                          </templateLayer>
+                                       </canvas>
+                                    </state>
+                                 </backgroundStates>
+                                 <foregroundStates/>
+                                 <borderStates/>
+                                 <regions/>
+                            </uiIconRegion>
+                     </regions>
+                  </uiComponent>
+                  <uiComponent opaque="false" componentName="InternalFrameTitlePane.iconifyButton" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="true">
+                     <stateTypes>
+                        <stateType key="Enabled"/>
+                        <stateType key="MouseOver"/>
+                        <stateType key="Pressed"/>
+                        <stateType key="Disabled"/>
+                        <stateType key="Focused"/>
+                        <stateType key="Selected"/>
+                        <stateType key="WindowNotFocused">
+                           <codeSnippet><![CDATA[
+                               Component parent = c;
+                               while (parent.getParent() != null) {
+                                   if (parent instanceof JInternalFrame) {
+                                       break;
+                                   }
+                                   parent = parent.getParent();
+                               }
+                               if (parent instanceof JInternalFrame) {
+                                   return !(((JInternalFrame)parent).isSelected());
+                               }
+                               return false;]]></codeSnippet>
+                        </stateType>
+                     </stateTypes>
+                     <contentMargins top="9" bottom="9" left="9" right="9"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.250000000000004" y1="11.931818181818182" y2="13.477272727272728" rounding="0.0">
+                                       <matte red="88" green="0" blue="0" alpha="149" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.40392157" alphaOffset="-106"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="218" green="164" blue="110" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.48364475" brightnessOffset="0.10588235" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="191" green="98" blue="4" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="192" green="99" blue="5" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.0050992966" brightnessOffset="0.0039215684" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="218" green="125" blue="31" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.12125945" brightnessOffset="0.10588235" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="88" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.40392157" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="191" green="98" blue="4" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113d100d389.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>true</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Disabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="178" green="183" blue="192" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.003968239" saturationOffset="-0.03760965" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.250000000000004" y1="11.931818181818182" y2="13.477272727272728" rounding="0.0">
+                                       <matte red="76" green="85" blue="87" alpha="39" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0808081" saturationOffset="0.015910469" brightnessOffset="-0.40392157" alphaOffset="-216"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="190" blue="196" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.93313926" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="162" green="166" blue="176" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.53526866" saturationOffset="-0.8995122" brightnessOffset="-0.058823526" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="157" green="162" blue="171" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5233639" saturationOffset="-0.8971863" brightnessOffset="-0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.8903002" brightnessOffset="-0.086274505" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="185" green="188" blue="193" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5203877" saturationOffset="-0.9376068" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.8903002" brightnessOffset="-0.086274505" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e23f6ea0.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.250000000000004" y1="11.931818181818182" y2="13.477272727272728" rounding="0.0">
+                                       <matte red="204" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.025772434" saturationOffset="0.02094239" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="229" green="175" blue="121" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.5074419" brightnessOffset="0.1490196" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="211" green="120" blue="28" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="9.745359E-6" saturationOffset="-0.11175901" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="211" green="118" blue="24" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.09280169" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="237" green="144" blue="50" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.19002807" brightnessOffset="0.18039215" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="110" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.31764707" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="175" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.02758849" saturationOffset="0.02094239" brightnessOffset="-0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e2450ed9.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.272727272727275" y1="11.749999999999998" y2="14.0909090909091" rounding="0.0">
+                                       <matte red="154" green="0" blue="0" alpha="164" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.14509803" alphaOffset="-91"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="201" green="123" blue="72" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.017887495" saturationOffset="-0.33726656" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="180" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.018038228" saturationOffset="0.02094239" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="184" green="75" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015844189" saturationOffset="0.02094239" brightnessOffset="-0.027450979" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="195" green="86" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.010274701" saturationOffset="0.02094239" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="89" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.4" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="163" green="30" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.053104125" saturationOffset="0.02094239" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e247bc76.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="98" green="102" blue="108" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.017933726" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.250000000000004" y1="11.931818181818182" y2="13.477272727272728" rounding="0.0">
+                                       <matte red="76" green="85" blue="87" alpha="39" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0808081" saturationOffset="0.015910469" brightnessOffset="-0.40392157" alphaOffset="-216"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="219" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.516221" saturationOffset="-0.9567362" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="185" green="189" blue="196" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5222816" saturationOffset="-0.9229352" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.91751915" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.9161677" midpoint="0.5">
+                                             <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.9193561" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.87971985" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.5273321" saturationOffset="-0.842694" brightnessOffset="-0.31764707" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc294735.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.250000000000004" y1="11.931818181818182" y2="13.477272727272728" rounding="0.0">
+                                       <matte red="204" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.025772434" saturationOffset="0.02094239" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="229" green="175" blue="121" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.5074419" brightnessOffset="0.1490196" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="211" green="120" blue="28" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="9.745359E-6" saturationOffset="-0.11175901" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="211" green="118" blue="24" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.09280169" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="237" green="144" blue="50" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="-0.19002807" brightnessOffset="0.18039215" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="110" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.31764707" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="175" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.02758849" saturationOffset="0.02094239" brightnessOffset="-0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e2450ed9.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.454545454545454" x2="13.613636363636363" y1="11.022727272727273" y2="13.000000000000002" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.750000000000001" x2="14.272727272727275" y1="11.749999999999998" y2="14.0909090909091" rounding="0.0">
+                                       <matte red="154" green="0" blue="0" alpha="164" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.14509803" alphaOffset="-91"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="201" green="123" blue="72" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.017887495" saturationOffset="-0.33726656" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="180" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.018038228" saturationOffset="0.02094239" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="184" green="75" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015844189" saturationOffset="0.02094239" brightnessOffset="-0.027450979" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="195" green="86" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.010274701" saturationOffset="0.02094239" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="89" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.08377897" saturationOffset="0.02094239" brightnessOffset="-0.4" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="163" green="30" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.053104125" saturationOffset="0.02094239" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e247bc76.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </uiComponent>
+                  <uiComponent opaque="false" componentName="InternalFrameTitlePane.maximizeButton" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="true">
+                     <stateTypes>
+                        <stateType key="Enabled"/>
+                        <stateType key="MouseOver"/>
+                        <stateType key="Pressed"/>
+                        <stateType key="Disabled"/>
+                        <stateType key="Focused"/>
+                        <stateType key="Selected"/>
+                        <stateType key="WindowNotFocused">
+                           <codeSnippet><![CDATA[
+                               Component parent = c;
+                               while (parent.getParent() != null) {
+                                   if (parent instanceof JInternalFrame) {
+                                       break;
+                                   }
+                                   parent = parent.getParent();
+                               }
+                               if (parent instanceof JInternalFrame) {
+                                   return !(((JInternalFrame)parent).isSelected());
+                               }
+                               return false;]]></codeSnippet>
+                        </stateType>
+                        <stateType key="WindowMaximized">
+                           <codeSnippet><![CDATA[
+                               Component parent = c;
+                               while (parent.getParent() != null) {
+                                   if (parent instanceof JInternalFrame) {
+                                       break;
+                                   }
+                                   parent = parent.getParent();
+                               }
+                               if (parent instanceof JInternalFrame) {
+                                   return ((JInternalFrame)parent).isMaximum();
+                               }
+                               return false;]]></codeSnippet>
+                        </stateType>
+                     </stateTypes>
+                     <contentMargins top="9" bottom="9" left="9" right="9"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Disabled+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="186" green="190" blue="198" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049920253" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="198" green="201" blue="208" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.062449392" brightnessOffset="0.07058823" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="176" green="181" blue="189" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04174325" brightnessOffset="-0.0039215684" alphaOffset="-13"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="166" green="170" blue="179" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44484192" saturationOffset="-0.6480447" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="153" green="157" blue="166" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44484192" saturationOffset="-0.6423572" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.0" x2="8.0" y1="11.0" y2="14.0" rounding="0.0">
+                                       <matte red="153" green="158" blue="167" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4366002" saturationOffset="-0.6368381" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="166" green="170" blue="179" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44484192" saturationOffset="-0.6480447" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="158" green="162" blue="171" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44484192" saturationOffset="-0.644647" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="158" green="162" blue="171" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44484192" saturationOffset="-0.644647" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="165" green="169" blue="176" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4355179" saturationOffset="-0.6581704" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="190" blue="196" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.67475206" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.631913" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="185" green="188" blue="193" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.43362403" saturationOffset="-0.6792196" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.631913" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbedca6b.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="15.045454545454545" x2="15.863636363636363" y1="13.954545454545455" y2="7.590909090909091" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.25" x2="8.295454545454547" y1="11.0" y2="13.931818181818183" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="97" green="95" blue="28" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.0087068975" saturationOffset="-0.009330213" brightnessOffset="-0.32156864" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="164" green="176" blue="110" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.02642706" saturationOffset="-0.3456704" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="98" green="118" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2454313" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="99" green="119" blue="5" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2373128" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="125" green="145" blue="31" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.0655365" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="15" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.6431373" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="98" green="118" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2454313" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e1f88fc4.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="125" green="136" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009604409" saturationOffset="0.2793296" brightnessOffset="-0.16862744" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="15.045454545454545" x2="15.863636363636363" y1="13.954545454545455" y2="7.590909090909091" rounding="0.0">
+                                       <matte red="129" green="140" blue="3" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009506017" saturationOffset="0.257901" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="124" green="137" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.011939123" saturationOffset="0.2793296" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.25" x2="8.295454545454547" y1="11.0" y2="13.931818181818183" rounding="0.0">
+                                       <matte red="127" green="140" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.011600211" saturationOffset="0.2793296" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="125" green="136" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009604409" saturationOffset="0.2793296" brightnessOffset="-0.16862744" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="113" green="126" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.013319805" saturationOffset="0.2793296" brightnessOffset="-0.20784315" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="117" green="130" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.01279068" saturationOffset="0.2793296" brightnessOffset="-0.19215685" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="108" green="122" blue="0" alpha="206" uiDefaultParentName="nimbusGreen" hueOffset="0.015249729" saturationOffset="0.2793296" brightnessOffset="-0.22352943" alphaOffset="-49"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="193" blue="120" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009822637" saturationOffset="-0.34243205" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="138" green="149" blue="22" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.13167858" brightnessOffset="-0.11764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="139" green="150" blue="23" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.12599629" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="165" green="176" blue="49" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="9.2053413E-4" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="19" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.627451" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="59" green="84" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.04572721" saturationOffset="0.2793296" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbf3eb8c.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="45" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.057156876" saturationOffset="0.2793296" brightnessOffset="-0.42352942" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="15.045454545454545" x2="15.863636363636363" y1="13.954545454545455" y2="7.590909090909091" rounding="0.0">
+                                       <matte red="55" green="80" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.048207358" saturationOffset="0.2793296" brightnessOffset="-0.3882353" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="41" green="69" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06375685" saturationOffset="0.2793296" brightnessOffset="-0.43137255" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.0" x2="8.0" y1="11.0" y2="14.0" rounding="0.0">
+                                       <matte red="42" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06419912" saturationOffset="0.2793296" brightnessOffset="-0.42352942" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="41" green="67" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.060800627" saturationOffset="0.2793296" brightnessOffset="-0.4392157" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="36" green="63" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.0675526" saturationOffset="0.2793296" brightnessOffset="-0.454902" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="38" green="65" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06535478" saturationOffset="0.2793296" brightnessOffset="-0.44705883" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="19" green="48" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.09681849" saturationOffset="0.2793296" brightnessOffset="-0.5137255" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="123" green="139" blue="72" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03592503" saturationOffset="-0.23865601" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="74" green="96" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.035979107" saturationOffset="0.23766291" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="71" green="94" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03690417" saturationOffset="0.2793296" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="125" green="145" blue="31" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.0655365" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.17054264" saturationOffset="-0.7206704" brightnessOffset="-0.7019608" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="30" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.07804492" saturationOffset="0.2793296" brightnessOffset="-0.47058827" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbfaf2cf.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled+WindowNotFocused+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="100" green="103" blue="109" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.027957506" brightnessOffset="-0.31764707" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="102" green="105" blue="111" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.029445238" brightnessOffset="-0.30980393" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="185" green="189" blue="196" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4355179" saturationOffset="-0.664548" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="181" green="185" blue="192" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4355179" saturationOffset="-0.6633787" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="179" green="183" blue="191" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.6578432" brightnessOffset="0.04705882" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="219" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4294573" saturationOffset="-0.698349" brightnessOffset="0.17647058" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="188" green="191" blue="199" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.45066953" saturationOffset="-0.665394" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.65913194" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.6609689" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.62133265" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.5843068" brightnessOffset="-0.27058825" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbfe1ab1.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver+WindowNotFocused+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="125" green="136" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009604409" saturationOffset="0.2793296" brightnessOffset="-0.16862744" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="15.045454545454545" x2="15.863636363636363" y1="13.954545454545455" y2="7.590909090909091" rounding="0.0">
+                                       <matte red="129" green="140" blue="3" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009506017" saturationOffset="0.257901" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="124" green="137" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.011939123" saturationOffset="0.2793296" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.25" x2="8.295454545454547" y1="11.0" y2="13.931818181818183" rounding="0.0">
+                                       <matte red="127" green="140" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.011600211" saturationOffset="0.2793296" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="125" green="136" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009604409" saturationOffset="0.2793296" brightnessOffset="-0.16862744" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="113" green="126" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.013319805" saturationOffset="0.2793296" brightnessOffset="-0.20784315" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="117" green="130" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.01279068" saturationOffset="0.2793296" brightnessOffset="-0.19215685" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="108" green="122" blue="0" alpha="206" uiDefaultParentName="nimbusGreen" hueOffset="0.015249729" saturationOffset="0.2793296" brightnessOffset="-0.22352943" alphaOffset="-49"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="193" blue="120" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009822637" saturationOffset="-0.34243205" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="138" green="149" blue="22" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.13167858" brightnessOffset="-0.11764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="139" green="150" blue="23" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.12599629" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="165" green="176" blue="49" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="9.2053413E-4" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="19" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.627451" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="59" green="84" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.04572721" saturationOffset="0.2793296" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbf3eb8c.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed+WindowNotFocused+WindowMaximized">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>5</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="222" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-33"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="9.0" cp1x="13.0" cp1y="9.0" cp2x="13.0" cp2y="9.0"/>
+                                          <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="14.0" cp2y="9.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="8.0" y="12.0" cp1x="8.0" cp1y="12.0" cp2x="8.0" cp2y="12.0"/>
+                                          <point x="8.0" y="11.0" cp1x="8.0" cp1y="11.0" cp2x="8.0" cp2y="11.0"/>
+                                          <point x="7.0" y="11.0" cp1x="7.0" cp1y="11.0" cp2x="7.0" cp2y="11.0"/>
+                                          <point x="7.0" y="13.0" cp1x="7.0" cp1y="13.0" cp2x="7.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="242" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-13"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                          <point x="12.0" y="10.0" cp1x="12.0" cp1y="10.0" cp2x="12.0" cp2y="10.0"/>
+                                          <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="5.0" y="9.0" cp1x="5.0" cp1y="9.0" cp2x="5.0" cp2y="9.0"/>
+                                          <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                          <point x="11.0" y="6.0" cp1x="11.0" cp1y="6.0" cp2x="11.0" cp2y="6.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                    <rectangle x1="10.727272727272727" x2="14.954545454545457" y1="7.340909090909091" y2="9.431818181818183" rounding="0.0">
+                                       <matte red="45" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.057156876" saturationOffset="0.2793296" brightnessOffset="-0.42352942" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="15.045454545454545" x2="15.863636363636363" y1="13.954545454545455" y2="7.590909090909091" rounding="0.0">
+                                       <matte red="55" green="80" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.048207358" saturationOffset="0.2793296" brightnessOffset="-0.3882353" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="8.340909090909092" x2="14.97727272727273" y1="12.977272727272727" y2="13.977272727272728" rounding="0.0">
+                                       <matte red="41" green="69" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06375685" saturationOffset="0.2793296" brightnessOffset="-0.43137255" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="7.0" x2="8.0" y1="11.0" y2="14.0" rounding="0.0">
+                                       <matte red="42" green="71" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06419912" saturationOffset="0.2793296" brightnessOffset="-0.42352942" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="11.909090909090908" x2="12.795454545454547" y1="7.0" y2="10.954545454545455" rounding="0.0">
+                                       <matte red="41" green="67" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.060800627" saturationOffset="0.2793296" brightnessOffset="-0.4392157" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="5.0227272727272725" x2="12.0" y1="9.977272727272727" y2="10.795454545454547" rounding="0.0">
+                                       <matte red="36" green="63" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.0675526" saturationOffset="0.2793296" brightnessOffset="-0.454902" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.204545454545454" x2="5.136363636363637" y1="10.886363636363637" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="38" green="65" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.06535478" saturationOffset="0.2793296" brightnessOffset="-0.44705883" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="4.113636363636363" x2="12.818181818181822" y1="5.0227272727272725" y2="6.9772727272727275" rounding="0.0">
+                                       <matte red="19" green="48" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.09681849" saturationOffset="0.2793296" brightnessOffset="-0.5137255" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="123" green="139" blue="72" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03592503" saturationOffset="-0.23865601" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="74" green="96" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.035979107" saturationOffset="0.23766291" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="71" green="94" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03690417" saturationOffset="0.2793296" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="125" green="145" blue="31" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.0655365" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.17054264" saturationOffset="-0.7206704" brightnessOffset="-0.7019608" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="30" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.07804492" saturationOffset="0.2793296" brightnessOffset="-0.47058827" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fbfaf2cf.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Disabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.26047903" midpoint="0.5">
+                                             <matte red="195" green="199" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.057128258" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="172" green="177" blue="186" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.003968239" saturationOffset="-0.035257496" brightnessOffset="-0.015686274" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="165" green="169" blue="176" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="190" blue="196" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.67475206" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="164" green="169" blue="177" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.43202144" saturationOffset="-0.64722407" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6766467" midpoint="0.5">
+                                             <matte red="158" green="163" blue="173" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.6339652" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.631913" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="185" green="188" blue="193" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.43362403" saturationOffset="-0.6792196" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.631913" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc0648fb.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="64" green="88" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="164" green="176" blue="110" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.02642706" saturationOffset="-0.3456704" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="98" green="118" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2454313" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="99" green="119" blue="5" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2373128" brightnessOffset="-0.23529413" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="125" green="145" blue="31" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.0655365" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="15" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.6431373" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="98" green="118" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.025363803" saturationOffset="0.2454313" brightnessOffset="-0.2392157" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e1feba05.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="113" green="125" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="193" blue="120" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009822637" saturationOffset="-0.34243205" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="141" green="151" blue="27" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009564877" saturationOffset="0.100521624" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="138" green="149" blue="22" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.13167858" brightnessOffset="-0.11764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="165" green="176" blue="49" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="9.2053413E-4" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="19" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.627451" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="59" green="84" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.04572721" saturationOffset="0.2793296" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="204" green="211" blue="227" alpha="154" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.004830897" saturationOffset="-0.00920473" brightnessOffset="0.14509803" alphaOffset="-101"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc0c6be3.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="19" green="48" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="123" green="139" blue="72" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03592503" saturationOffset="-0.23865601" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="74" green="96" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.035979107" saturationOffset="0.23766291" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.79341316" midpoint="0.5">
+                                             <matte red="71" green="94" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03690417" saturationOffset="0.2793296" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="86" green="109" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03129223" saturationOffset="0.2793296" brightnessOffset="-0.27450982" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.17054264" saturationOffset="-0.7206704" brightnessOffset="-0.7019608" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="30" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.07804492" saturationOffset="0.2793296" brightnessOffset="-0.47058827" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="190" green="197" blue="212" alpha="190" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0025252104" saturationOffset="-0.0067527294" brightnessOffset="0.086274505" alphaOffset="-65"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc1017c9.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="102" green="105" blue="111" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.029445238" brightnessOffset="-0.30980393" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="219" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.4294573" saturationOffset="-0.698349" brightnessOffset="0.17647058" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.65913194" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.7185629" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.65913194" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.6609689" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.62133265" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.44056845" saturationOffset="-0.5843068" brightnessOffset="-0.27058825" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc12e4cb.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="113" green="125" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="187" green="193" blue="120" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009822637" saturationOffset="-0.34243205" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="141" green="151" blue="27" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.009564877" saturationOffset="0.100521624" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="138" green="149" blue="22" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="0.13167858" brightnessOffset="-0.11764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="165" green="176" blue="49" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.010559708" saturationOffset="9.2053413E-4" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="19" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.1627907" saturationOffset="0.2793296" brightnessOffset="-0.627451" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="59" green="84" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.04572721" saturationOffset="0.2793296" brightnessOffset="-0.37254903" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="204" green="211" blue="227" alpha="154" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.004830897" saturationOffset="-0.00920473" brightnessOffset="0.14509803" alphaOffset="-101"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc0c6be3.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>6</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 5">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.0" y="4.0" cp1x="4.0" cp1y="4.0" cp2x="4.0" cp2y="4.0"/>
+                                          <point x="4.0" y="13.0" cp1x="4.0" cp1y="13.0" cp2x="4.0" cp2y="13.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                          <point x="14.0" y="12.0" cp1x="14.0" cp1y="12.0" cp2x="14.0" cp2y="12.0"/>
+                                          <point x="5.0" y="12.0" cp1x="5.0" cp1y="12.0" cp2x="5.0" cp2y="12.0"/>
+                                          <point x="5.0" y="6.0" cp1x="5.0" cp1y="6.0" cp2x="5.0" cp2y="6.0"/>
+                                          <point x="15.0" y="6.0" cp1x="15.0" cp1y="6.0" cp2x="15.0" cp2y="6.0"/>
+                                          <point x="15.0" y="4.0" cp1x="15.0" cp1y="4.0" cp2x="15.0" cp2y="4.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="19" green="48" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="3.636363636363636" y="5.25" cp1x="3.636363636363636" cp1y="5.25" cp2x="3.636363636363636" cp2y="5.25"/>
+                                          <point x="3.6590909090909083" y="13.431818181818185" cp1x="3.6590909090909083" cp1y="13.431818181818185" cp2x="3.6590909090909083" cp2y="13.431818181818185"/>
+                                          <point x="15.500000000000004" y="13.40909090909091" cp1x="15.500000000000004" cp1y="13.40909090909091" cp2x="15.500000000000004" cp2y="13.40909090909091"/>
+                                          <point x="15.56818181818182" y="5.25" cp1x="15.56818181818182" cp1y="5.25" cp2x="15.56818181818182" cp2y="5.25"/>
+                                          <point x="13.727272727272725" y="5.25" cp1x="13.727272727272725" cp1y="5.25" cp2x="13.727272727272725" cp2y="5.25"/>
+                                          <point x="13.90909090909091" y="12.045454545454547" cp1x="13.90909090909091" cp1y="12.045454545454547" cp2x="13.90909090909091" cp2y="12.045454545454547"/>
+                                          <point x="5.318181818181818" y="11.81818181818182" cp1x="5.318181818181818" cp1y="11.81818181818182" cp2x="5.318181818181818" cp2y="11.81818181818182"/>
+                                          <point x="5.409090909090909" y="6.954545454545454" cp1x="5.409090909090909" cp1y="6.954545454545454" cp2x="5.409090909090909" cp2y="6.954545454545454"/>
+                                          <point x="13.795454545454543" y="6.931818181818181" cp1x="13.795454545454543" cp1y="6.931818181818181" cp2x="13.795454545454543" cp2y="6.931818181818181"/>
+                                          <point x="13.727272727272734" y="5.2272727272727275" cp1x="13.727272727272734" cp1y="5.2272727272727275" cp2x="13.727272727272734" cp2y="5.2272727272727275"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="18.0" y1="1.0" y2="16.0" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="123" green="139" blue="72" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03592503" saturationOffset="-0.23865601" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="74" green="96" blue="4" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.035979107" saturationOffset="0.23766291" brightnessOffset="-0.3254902" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.79341316" midpoint="0.5">
+                                             <matte red="71" green="94" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03690417" saturationOffset="0.2793296" brightnessOffset="-0.33333334" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="86" green="109" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.03129223" saturationOffset="0.2793296" brightnessOffset="-0.27450982" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="-0.17054264" saturationOffset="-0.7206704" brightnessOffset="-0.7019608" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="30" green="59" blue="0" alpha="255" uiDefaultParentName="nimbusGreen" hueOffset="0.07804492" saturationOffset="0.2793296" brightnessOffset="-0.47058827" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="190" green="197" blue="212" alpha="190" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0025252104" saturationOffset="-0.0067527294" brightnessOffset="0.086274505" alphaOffset="-65"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc1017c9.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </uiComponent>
+                  <uiComponent opaque="false" componentName="InternalFrameTitlePane.closeButton" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="true">
+                     <stateTypes>
+                        <stateType key="Enabled"/>
+                        <stateType key="MouseOver"/>
+                        <stateType key="Pressed"/>
+                        <stateType key="Disabled"/>
+                        <stateType key="Focused"/>
+                        <stateType key="Selected"/>
+                        <stateType key="WindowNotFocused">
+                           <codeSnippet><![CDATA[
+                               Component parent = c;
+                               while (parent.getParent() != null) {
+                                   if (parent instanceof JInternalFrame) {
+                                       break;
+                                   }
+                                   parent = parent.getParent();
+                               }
+                               if (parent instanceof JInternalFrame) {
+                                   return !(((JInternalFrame)parent).isSelected());
+                               }
+                               return false;]]></codeSnippet>
+                        </stateType>
+                     </stateTypes>
+                     <contentMargins top="9" bottom="9" left="9" right="9"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Disabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="198" green="201" blue="208" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.062449392" brightnessOffset="0.07058823" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="152" green="156" blue="165" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="0.6005698" saturationOffset="-0.7200287" brightnessOffset="-0.015686274" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="185" green="188" blue="193" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5893519" saturationOffset="-0.75736576" brightnessOffset="0.09411764" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="154" green="159" blue="169" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.71005917" brightnessOffset="0.0" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc2cb661.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="71" green="21" blue="14" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="0.0056530247" saturationOffset="0.0040003657" brightnessOffset="-0.38431373" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9545454545454546" y2="15.954545454545455" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="199" green="121" blue="113" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="6.890595E-4" saturationOffset="-0.36665577" brightnessOffset="0.11764705" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="161" green="28" blue="16" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.001021713" saturationOffset="0.101804554" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="160" green="24" blue="11" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="0.13243341" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="186" green="50" blue="37" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="0.002258718" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="56" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.4431373" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="159" green="23" blue="10" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="0.13829035" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113e1ff5a78.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="170" green="0" blue="0" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="0.0039215684" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9318181818181819" y2="15.931818181818182" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="210" green="132" blue="124" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="6.890595E-4" saturationOffset="-0.38929275" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="180" green="47" blue="34" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="2.537202E-5" saturationOffset="0.012294531" brightnessOffset="0.043137252" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="179" green="43" blue="30" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="0.033585668" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.97904193" midpoint="0.5">
+                                             <matte red="205" green="69" blue="56" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="-0.07198727" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="70" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.3882353" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="135" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc301011.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="88" green="0" blue="0" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.31764707" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9545454545454546" y2="15.954545454545455" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="174" green="72" blue="72" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="-0.21260965" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="144" green="4" blue="4" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.17340565" brightnessOffset="-0.09803921" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="142" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.10588235" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.98203593" midpoint="0.5">
+                                             <matte red="157" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="43" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.49411768" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="117" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.20392159" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="255" green="255" blue="255" alpha="115" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-140"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc32c397.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="100" green="103" blue="109" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.027957506" brightnessOffset="-0.31764707" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9545454545454546" y2="15.954545454545455" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="219" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.58518517" saturationOffset="-0.77649516" brightnessOffset="0.21568626" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.48203593" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.7372781" brightnessOffset="0.10196078" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6856288" midpoint="0.5">
+                                             <matte red="183" green="187" blue="195" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.7372781" brightnessOffset="0.10196078" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="189" green="193" blue="201" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.73911506" brightnessOffset="0.12549019" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="136" green="141" blue="151" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.6994788" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="95" green="100" blue="110" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="0.5962963" saturationOffset="-0.66245294" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc34f80e.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="170" green="0" blue="0" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="0.0039215684" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9318181818181819" y2="15.931818181818182" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="210" green="132" blue="124" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="6.890595E-4" saturationOffset="-0.38929275" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="180" green="47" blue="34" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="2.537202E-5" saturationOffset="0.012294531" brightnessOffset="0.043137252" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="179" green="43" blue="30" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="0.033585668" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.97904193" midpoint="0.5">
+                                             <matte red="205" green="69" blue="56" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-2.7342606E-4" saturationOffset="-0.07198727" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="70" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.3882353" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="135" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="83" green="86" blue="93" alpha="70" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.0029994324" brightnessOffset="-0.38039216" alphaOffset="-185"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc301011.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Pressed+WindowNotFocused">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="19" height="18"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.886363636363638" y="5.09090909090909" cp1x="4.886363636363638" cp1y="5.09090909090909" cp2x="4.886363636363638" cp2y="5.09090909090909"/>
+                                          <point x="6.113636363636362" y="3.84090909090909" cp1x="6.113636363636362" cp1y="3.84090909090909" cp2x="6.113636363636362" cp2y="3.84090909090909"/>
+                                          <point x="9.5" y="7.272727272727275" cp1x="9.5" cp1y="7.272727272727275" cp2x="9.5" cp2y="7.272727272727275"/>
+                                          <point x="12.795454545454541" y="3.7954545454545436" cp1x="12.795454545454541" cp1y="3.7954545454545436" cp2x="12.795454545454541" cp2y="3.7954545454545436"/>
+                                          <point x="14.13636363636364" y="5.136363636363635" cp1x="14.13636363636364" cp1y="5.136363636363635" cp2x="14.13636363636364" cp2y="5.136363636363635"/>
+                                          <point x="10.772727272727279" y="8.477272727272728" cp1x="10.772727272727279" cp1y="8.477272727272728" cp2x="10.772727272727279" cp2y="8.477272727272728"/>
+                                          <point x="14.227272727272732" y="11.749999999999996" cp1x="14.227272727272732" cp1y="11.749999999999996" cp2x="14.227272727272732" cp2y="11.749999999999996"/>
+                                          <point x="12.795454545454543" y="13.31818181818182" cp1x="12.795454545454543" cp1y="13.31818181818182" cp2x="12.795454545454543" cp2y="13.31818181818182"/>
+                                          <point x="9.477272727272725" y="9.749999999999993" cp1x="9.477272727272725" cp1y="9.749999999999993" cp2x="9.477272727272725" cp2y="9.749999999999993"/>
+                                          <point x="6.295454545454543" y="13.36363636363637" cp1x="6.295454545454543" cp1y="13.36363636363637" cp2x="6.295454545454543" cp2y="13.36363636363637"/>
+                                          <point x="4.795454545454548" y="11.818181818181813" cp1x="4.795454545454548" cp1y="11.818181818181813" cp2x="4.795454545454548" cp2y="11.818181818181813"/>
+                                          <point x="8.295454545454541" y="8.499999999999998" cp1x="8.295454545454541" cp1y="8.499999999999998" cp2x="8.295454545454541" cp2y="8.499999999999998"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="88" green="0" blue="0" alpha="133" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.31764707" alphaOffset="-122"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="4.749999999999998" y="13.27272727272728" cp1x="4.749999999999998" cp1y="13.27272727272728" cp2x="4.749999999999998" cp2y="13.27272727272728"/>
+                                          <point x="5.704545454545453" y="14.295454545454552" cp1x="5.704545454545453" cp1y="14.295454545454552" cp2x="5.704545454545453" cp2y="14.295454545454552"/>
+                                          <point x="9.590909090909095" y="10.636363636363644" cp1x="9.590909090909095" cp1y="10.636363636363644" cp2x="9.590909090909095" cp2y="10.636363636363644"/>
+                                          <point x="13.000000000000005" y="14.318181818181825" cp1x="13.000000000000005" cp1y="14.318181818181825" cp2x="13.000000000000005" cp2y="14.318181818181825"/>
+                                          <point x="14.431818181818185" y="12.954545454545462" cp1x="14.431818181818185" cp1y="12.954545454545462" cp2x="14.431818181818185" cp2y="12.954545454545462"/>
+                                          <point x="11.318181818181822" y="9.431818181818189" cp1x="11.318181818181822" cp1y="9.431818181818189" cp2x="11.318181818181822" cp2y="9.431818181818189"/>
+                                          <point x="14.318181818181822" y="6.136363636363636" cp1x="14.318181818181822" cp1y="6.136363636363636" cp2x="14.318181818181822" cp2y="6.136363636363636"/>
+                                          <point x="12.977272727272732" y="4.5681818181818175" cp1x="12.977272727272732" cp1y="4.5681818181818175" cp2x="12.977272727272732" cp2y="4.5681818181818175"/>
+                                          <point x="9.659090909090912" y="7.931818181818182" cp1x="9.659090909090912" cp1y="7.931818181818182" cp2x="9.659090909090912" cp2y="7.931818181818182"/>
+                                          <point x="6.272727272727272" y="4.613636363636363" cp1x="6.272727272727272" cp1y="4.613636363636363" cp2x="6.272727272727272" cp2y="4.613636363636363"/>
+                                          <point x="4.886363636363635" y="5.977272727272727" cp1x="4.886363636363635" cp1y="5.977272727272727" cp2x="4.886363636363635" cp2y="5.977272727272727"/>
+                                          <point x="8.113636363636365" y="9.454545454545467" cp1x="8.113636363636365" cp1y="9.454545454545467" cp2x="8.113636363636365" cp2y="9.454545454545467"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="1.0" x2="18.0" y1="0.9545454545454546" y2="15.954545454545455" rounding="6.749999999999993">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="174" green="72" blue="72" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="-0.21260965" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.53977275" midpoint="0.5">
+                                             <matte red="144" green="4" blue="4" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.17340565" brightnessOffset="-0.09803921" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.6505682" midpoint="0.5">
+                                             <matte red="142" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.10588235" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.98203593" midpoint="0.5">
+                                             <matte red="157" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.2544117647058825" y2="1.0016666666666667"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="0.0" y2="17.0" rounding="8.600000000000014">
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="43" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.49411768" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="117" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.20118344" brightnessOffset="-0.20392159" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.24868421052631579" y1="0.0014705882352941176" x2="0.2486842105263158" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="0.0" x2="19.0" y1="11.0" y2="18.0" rounding="6.0">
+                                       <matte red="255" green="255" blue="255" alpha="115" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-140"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fc32c397.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </uiComponent>
+               </regions>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JInternalFrame.JDesktopIcon" name="DesktopIcon" ui="DesktopIconUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="4" bottom="5" left="6" right="4"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="28" height="26"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="4.0" x2="25.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.24">
+                                 <matte red="227" green="229" blue="232" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.088974595" brightnessOffset="0.16470587" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="170" green="175" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.029445238" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="27.0" y1="1.0" y2="23.0" rounding="3.1000000000000005">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="240" green="241" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.102261856" brightnessOffset="0.20392156" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="204" green="207" blue="213" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0682728" brightnessOffset="0.09019607" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="27.0" y1="0.0" y2="24.0" rounding="4.833333333333331">
+                           <matte red="43" green="46" blue="51" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.02551502" saturationOffset="-0.47885156" brightnessOffset="-0.34901965" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JDesktopPane" name="DesktopPane" ui="DesktopPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="300" height="232"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="49" green="81" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.012613952" saturationOffset="-0.11610645" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="35" green="62" blue="84" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0038217902" saturationOffset="-0.05238098" brightnessOffset="-0.21960786" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="0.0" y="232.0" cp1x="0.0" cp1y="232.0" cp2x="0.0" cp2y="232.0"/>
+                              <point x="0.0" y="138.5" cp1x="0.0" cp1y="138.5" cp2x="0.0" cp2y="138.5"/>
+                              <point x="22.0" y="185.0" cp1x="12.0" cp1y="165.5" cp2x="32.0" cp2y="204.5"/>
+                              <point x="50.0" y="232.0" cp1x="50.0" cp1y="231.5" cp2x="50.0" cp2y="232.5"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="70" green="110" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.12867206" brightnessOffset="0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="35" green="63" blue="86" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0034883022" saturationOffset="-0.042691052" brightnessOffset="-0.21176472" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="82.0" y="232.0" cp1x="82.0" cp1y="232.0" cp2x="82.0" cp2y="232.0"/>
+                              <point x="79.0" y="153.0" cp1x="84.0" cp1y="190.0" cp2x="74.0" cp2y="116.0"/>
+                              <point x="58.0" y="52.0" cp1x="67.0" cp1y="85.5" cp2x="49.0" cp2y="18.5"/>
+                              <point x="40.0" y="0.0" cp1x="40.0" cp1y="0.0" cp2x="40.0" cp2y="0.0"/>
+                              <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                              <point x="0.0" y="142.0" cp1x="0.0" cp1y="142.0" cp2x="0.0" cp2y="142.0"/>
+                              <point x="45.0" y="232.0" cp1x="45.0" cp1y="231.5" cp2x="45.0" cp2y="232.5"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="55" green="88" blue="112" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.008476257" saturationOffset="-0.1267857" brightnessOffset="-0.109803945" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="53" green="85" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.008954704" saturationOffset="-0.12645501" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.35483870967741926" y1="0.1142857142857143" x2="0.4838709677419357" y2="0.980952380952381"/>
+                           <points>
+                              <point x="182.0" y="232.0" cp1x="182.0" cp1y="232.0" cp2x="182.0" cp2y="232.0"/>
+                              <point x="192.0" y="204.5" cp1x="185.0" cp1y="221.5" cp2x="199.0" cp2y="187.5"/>
+                              <point x="203.25" y="179.75" cp1x="203.25" cp1y="179.75" cp2x="203.25" cp2y="179.75"/>
+                              <point x="222.5" y="205.0" cp1x="211.5" cp1y="190.0" cp2x="233.5" cp2y="220.0"/>
+                              <point x="244.0" y="232.0" cp1x="244.0" cp1y="231.5" cp2x="244.0" cp2y="232.5"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="61" green="96" blue="121" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.009207249" saturationOffset="-0.13984653" brightnessOffset="-0.07450983" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="54" green="86" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.010750473" saturationOffset="-0.13571429" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.3511235955056181" y1="0.09326424870466325" x2="0.33426966292134835" y2="0.9846153846153847"/>
+                           <points>
+                              <point x="156.5" y="232.0" cp1x="156.5" cp1y="232.0" cp2x="156.5" cp2y="232.0"/>
+                              <point x="166.5" y="180.5" cp1x="164.5" cp1y="203.0" cp2x="168.5" cp2y="158.0"/>
+                              <point x="170.5" y="133.75" cp1x="170.5" cp1y="133.75" cp2x="170.5" cp2y="133.75"/>
+                              <point x="203.25" y="179.75" cp1x="203.25" cp1y="179.75" cp2x="203.25" cp2y="179.75"/>
+                              <point x="195.25" y="207.0" cp1x="201.25" cp1y="193.0" cp2x="189.25" cp2y="221.0"/>
+                              <point x="182.5" y="232.0" cp1x="182.5" cp1y="232.0" cp2x="182.5" cp2y="232.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="57" green="94" blue="127" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.028746E-5" saturationOffset="-0.084533215" brightnessOffset="-0.05098042" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="57" green="92" blue="115" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.012559712" saturationOffset="-0.13136649" brightnessOffset="-0.09803924" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.8659695817490493" y1="0.011049723756906077" x2="0.24809885931558942" y2="0.9502762430939229"/>
+                           <points>
+                              <point x="170.5" y="134.5" cp1x="170.5" cp1y="134.5" cp2x="170.5" cp2y="134.5"/>
+                              <point x="172.5" y="55.5" cp1x="172.5" cp1y="88.5" cp2x="172.5" cp2y="22.5"/>
+                              <point x="168.5" y="0.0" cp1x="168.5" cp1y="0.0" cp2x="168.5" cp2y="0.0"/>
+                              <point x="300.0" y="0.0" cp1x="300.0" cp1y="0.0" cp2x="300.0" cp2y="0.0"/>
+                              <point x="300.0" y="46.0" cp1x="300.0" cp1y="46.0" cp2x="300.0" cp2y="46.0"/>
+                              <point x="242.0" y="117.0" cp1x="269.5" cp1y="78.5" cp2x="214.5" cp2y="155.5"/>
+                              <point x="203.0" y="180.5" cp1x="203.0" cp1y="180.5" cp2x="203.0" cp2y="180.5"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="57" green="94" blue="127" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.028746E-5" saturationOffset="-0.084533215" brightnessOffset="-0.05098042" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="56" green="89" blue="115" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0052053332" saturationOffset="-0.12267083" brightnessOffset="-0.09803924" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.8353658536585367" y2="0.9522058823529412"/>
+                           <points>
+                              <point x="101.5" y="0.0" cp1x="101.5" cp1y="0.0" cp2x="101.5" cp2y="0.0"/>
+                              <point x="132.5" y="72.0" cp1x="111.5" cp1y="34.5" cp2x="153.5" cp2y="109.5"/>
+                              <point x="172.0" y="135.5" cp1x="172.0" cp1y="135.5" cp2x="172.0" cp2y="135.5"/>
+                              <point x="182.0" y="56.0" cp1x="183.5" cp1y="85.5" cp2x="180.5" cp2y="26.5"/>
+                              <point x="181.5" y="0.0" cp1x="181.5" cp1y="0.0" cp2x="181.5" cp2y="0.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <matte red="255" green="200" blue="0" alpha="6" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="170.0" y="0.0" cp1x="170.0" cp1y="0.0" cp2x="170.0" cp2y="0.0"/>
+                              <point x="170.0" y="132.0" cp1x="170.0" cp1y="132.0" cp2x="170.0" cp2y="132.0"/>
+                              <point x="202.5" y="179.0" cp1x="202.5" cp1y="179.0" cp2x="202.5" cp2y="179.0"/>
+                              <point x="243.5" y="115.5" cp1x="220.0" cp1y="149.0" cp2x="267.0" cp2y="82.0"/>
+                              <point x="300.0" y="46.5" cp1x="300.0" cp1y="46.5" cp2x="300.0" cp2y="46.5"/>
+                              <point x="300.0" y="0.0" cp1x="300.0" cp1y="0.0" cp2x="300.0" cp2y="0.0"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="48" green="83" blue="114" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.6883354E-4" saturationOffset="-0.056766927" brightnessOffset="-0.10196081" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="53" green="85" blue="108" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.008954704" saturationOffset="-0.12645501" brightnessOffset="-0.12549022" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.9567307692307692" y1="0.06835443037974684" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="236.5" y="232.0" cp1x="236.5" cp1y="231.5" cp2x="236.5" cp2y="232.5"/>
+                              <point x="196.0" y="179.5" cp1x="196.0" cp1y="179.5" cp2x="196.0" cp2y="179.5"/>
+                              <point x="300.0" y="34.0" cp1x="300.0" cp1y="34.0" cp2x="300.0" cp2y="34.0"/>
+                              <point x="300.0" y="232.0" cp1x="300.0" cp1y="231.5" cp2x="300.5" cp2y="232.5"/>
+                           </points>
+                        </path>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="70" green="110" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.004577577" saturationOffset="-0.12867206" brightnessOffset="0.007843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="43" green="73" blue="96" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0063245893" saturationOffset="-0.08363098" brightnessOffset="-0.17254904" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="81.5" y="232.0" cp1x="81.5" cp1y="231.5" cp2x="81.5" cp2y="232.5"/>
+                              <point x="38.5" y="0.0" cp1x="38.5" cp1y="0.0" cp2x="38.5" cp2y="0.0"/>
+                              <point x="105.5" y="0.0" cp1x="105.5" cp1y="0.0" cp2x="105.5" cp2y="0.0"/>
+                              <point x="176.0" y="133.5" cp1x="176.0" cp1y="133.5" cp2x="176.0" cp2y="133.5"/>
+                              <point x="162.5" y="232.0" cp1x="162.5" cp1y="232.0" cp2x="162.5" cp2y="232.0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113e0997434.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JList" name="List" ui="ListUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="rendererUseListColors" type="BOOLEAN" value="true"/>
+               <uiProperty name="rendererUseUIBorder" type="BOOLEAN" value="true"/>
+               <uiProperty name="cellNoFocusBorder" type="BORDER">
+                   <border type="empty" top="2" left="5" bottom="2" right="5"/>
+               </uiProperty>
+               <uiProperty name="focusCellHighlightBorder" type="BORDER">
+                   <border type="painter" painter="Tree:TreeCell[Enabled+Focused].backgroundPainter" top="2" left="5" bottom="2" right="5" />
+               </uiProperty>
+               <uiProperty name="dropLineColor" type="COLOR">
+                  <matte red="242" green="242" blue="242" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Selected">
+                <style>
+                   <textForeground>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textForeground>
+                   <textBackground>
+                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textBackground>
+                   <background/>
+                   <inherit-textForeground>false</inherit-textForeground>
+                   <inherit-textBackground>false</inherit-textBackground>
+                   <uiproperties/>
+                </style>
+                <canvas>
+                   <size width="100" height="30"/>
+                   <nextLayerNameIndex>2</nextLayerNameIndex>
+                   <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                   <layer name="Layer 1">
+                      <opacity>1.0</opacity>
+                      <fillOpacity>1.0</fillOpacity>
+                      <blendingMode>NORMAL</blendingMode>
+                      <locked>false</locked>
+                      <visible>true</visible>
+                      <shapes/>
+                      <effects/>
+                   </layer>
+                </canvas>
+            </state>
+            <state stateKeys="Disabled+Selected">
+                <style>
+                   <textForeground/>
+                   <textBackground>
+                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textBackground>
+                   <background/>
+                   <inherit-textBackground>false</inherit-textBackground>
+                   <uiproperties/>
+                </style>
+                <canvas>
+                   <size width="100" height="30"/>
+                   <nextLayerNameIndex>2</nextLayerNameIndex>
+                   <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                   <layer name="Layer 1">
+                      <opacity>1.0</opacity>
+                      <fillOpacity>1.0</fillOpacity>
+                      <blendingMode>NORMAL</blendingMode>
+                      <locked>false</locked>
+                      <visible>true</visible>
+                      <shapes/>
+                      <effects/>
+                   </layer>
+                </canvas>
+            </state>
+            <state stateKeys="Disabled">
+                <style>
+                   <textForeground>
+                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textForeground>
+                   <textBackground/>
+                   <background/>
+                   <inherit-textForeground>false</inherit-textForeground>
+                   <uiproperties/>
+                </style>
+                <canvas>
+                   <size width="100" height="30"/>
+                   <nextLayerNameIndex>2</nextLayerNameIndex>
+                   <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                   <layer name="Layer 1">
+                      <opacity>1.0</opacity>
+                      <fillOpacity>1.0</fillOpacity>
+                      <blendingMode>NORMAL</blendingMode>
+                      <locked>false</locked>
+                      <visible>true</visible>
+                      <shapes/>
+                      <effects/>
+                   </layer>
+                </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="true" componentName="List.cellRenderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                        </background>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <inherit-background>false</inherit-background>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JMenuBar" name="MenuBar" ui="MenuBarUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="2" bottom="2" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="18" height="22"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="18.0" y1="0.0" y2="22.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="249" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.10255819" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.03" midpoint="0.28">
+                                 <matte red="250" green="251" blue="251" alpha="226" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10654225" brightnessOffset="0.23921567" alphaOffset="-29"/>
+                              </stop>
+                              <stop position="0.7569444" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="0" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-255"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="18.0" y1="0.0" y2="21.0" rounding="0.0">
+                           <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                           <paintPoints x1="0.0" y1="0.0" x2="0.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113c675ba35.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="30" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="1" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="30.0" y1="29.0" y2="30.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions>
+            <uiComponent opaque="false" type="javax.swing.JMenu" name="Menu" ui="MenuUI" subregion="false">
+               <stateTypes/>
+               <contentMargins top="1" bottom="2" left="4" right="4"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground>
+                           <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                                 <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.010750473" saturationOffset="-0.04875779" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions>
+                  <region name="MenuItemAccelerator" subregion="true">
+                     <contentMargins top="0" bottom="0" left="0" right="0"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Disabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="80" height="30"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes/>
+                                 <effects/>
+                              </layer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="80" height="30"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes/>
+                                 <effects/>
+                              </layer>
+                           </canvas>
+                        </state>
+                        <state stateKeys="MouseOver">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="80" height="30"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes/>
+                                 <effects/>
+                              </layer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </region>
+               </regions>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JMenuItem" name="MenuItem" ui="MenuItemUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="1" bottom="2" left="12" right="13"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="textIconGap" type="INT" value="5"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground>
+                     <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="3.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="MenuItemAccelerator" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <cacheMode>NO_CACHING</cacheMode>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JRadioButtonMenuItem" name="RadioButtonMenuItem" ui="RadioButtonMenuItemUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="1" bottom="2" left="12" right="13"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="textIconGap" type="INT" value="5"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground>
+                     <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="3.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected+MouseOver">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="3.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="checkIcon" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08983666" brightnessOffset="-0.17647058" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.487804878048781" cp1x="0.0" cp1y="5.487804878048781" cp2x="0.0" cp2y="5.487804878048781"/>
+                                    <point x="4.548780487804878" y="1.0121951219512197" cp1x="4.548780487804878" cp1y="1.0121951219512197" cp2x="4.548780487804878" cp2y="1.0121951219512197"/>
+                                    <point x="9.0" y="5.51219512195122" cp1x="9.0" cp1y="5.51219512195122" cp2x="9.0" cp2y="5.51219512195122"/>
+                                    <point x="4.536585365853659" y="10.0" cp1x="4.536585365853659" cp1y="10.0" cp2x="4.536585365853659" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="71" green="71" blue="72" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.09663743" brightnessOffset="-0.4627451" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.012195121951219523" y="5.487804878048781" cp1x="0.012195121951219523" cp1y="5.487804878048781" cp2x="0.012195121951219523" cp2y="5.487804878048781"/>
+                                    <point x="4.548780487804878" y="1.0121951219512197" cp1x="4.548780487804878" cp1y="1.0121951219512197" cp2x="4.548780487804878" cp2y="1.0121951219512197"/>
+                                    <point x="9.0" y="5.51219512195122" cp1x="9.0" cp1y="5.51219512195122" cp2x="9.0" cp2y="5.51219512195122"/>
+                                    <point x="4.536585365853659" y="10.0" cp1x="4.536585365853659" cp1y="10.0" cp2x="4.536585365853659" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e58e00fd.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.012195121951219523" y="5.487804878048781" cp1x="0.012195121951219523" cp1y="5.487804878048781" cp2x="0.012195121951219523" cp2y="5.487804878048781"/>
+                                    <point x="4.548780487804878" y="1.0121951219512197" cp1x="4.548780487804878" cp1y="1.0121951219512197" cp2x="4.548780487804878" cp2y="1.0121951219512197"/>
+                                    <point x="9.0" y="5.51219512195122" cp1x="9.0" cp1y="5.51219512195122" cp2x="9.0" cp2y="5.51219512195122"/>
+                                    <point x="4.536585365853659" y="10.0" cp1x="4.536585365853659" cp1y="10.0" cp2x="4.536585365853659" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e593f3d0.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <region name="MenuItemAccelerator" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <uiIconRegion name="Icon" subregion="true" key="icon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <cacheMode>NO_CACHING</cacheMode>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="14" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <cacheMode>NO_CACHING</cacheMode>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="14" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <cacheMode>NO_CACHING</cacheMode>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="14" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JCheckBoxMenuItem" name="CheckBoxMenuItem" ui="CheckBoxMenuItemUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="1" bottom="2" left="12" right="13"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="textIconGap" type="INT" value="5"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground>
+                     <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="3.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected+MouseOver">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="3.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="checkIcon" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08983666" brightnessOffset="-0.17647058" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="5.0" cp2x="0.0" cp2y="5.0"/>
+                                    <point x="2.1463414634146343" y="5.0" cp1x="2.1463414634146343" cp1y="5.0" cp2x="2.1463414634146343" cp2y="5.0"/>
+                                    <point x="3.560975609756098" y="7.390243902439032" cp1x="3.560975609756098" cp1y="7.390243902439032" cp2x="3.560975609756098" cp2y="7.390243902439032"/>
+                                    <point x="6.963414634146344" y="0.0" cp1x="6.963414634146344" cp1y="0.0" cp2x="6.963414634146344" cp2y="0.0"/>
+                                    <point x="9.0" y="0.0" cp1x="9.0" cp1y="0.0" cp2x="9.0" cp2y="0.0"/>
+                                    <point x="9.0" y="0.9999999999999998" cp1x="9.0" cp1y="0.9999999999999998" cp2x="9.0" cp2y="0.9999999999999998"/>
+                                    <point x="8.158536585365859" y="1.9756097560975614" cp1x="8.158536585365859" cp1y="1.9756097560975614" cp2x="8.158536585365859" cp2y="1.9756097560975614"/>
+                                    <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                    <point x="2.8658536585365852" y="10.0" cp1x="2.8658536585365852" cp1y="10.0" cp2x="2.8658536585365852" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="72" green="72" blue="73" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.096827686" brightnessOffset="-0.45882353" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="5.0" cp2x="0.0" cp2y="5.0"/>
+                                    <point x="2.1463414634146343" y="5.0" cp1x="2.1463414634146343" cp1y="5.0" cp2x="2.1463414634146343" cp2y="5.0"/>
+                                    <point x="3.560975609756098" y="7.390243902439032" cp1x="3.560975609756098" cp1y="7.390243902439032" cp2x="3.560975609756098" cp2y="7.390243902439032"/>
+                                    <point x="6.963414634146344" y="0.0" cp1x="6.963414634146344" cp1y="0.0" cp2x="6.963414634146344" cp2y="0.0"/>
+                                    <point x="9.0" y="0.0" cp1x="9.0" cp1y="0.0" cp2x="9.0" cp2y="0.0"/>
+                                    <point x="9.0" y="0.9999999999999998" cp1x="9.0" cp1y="0.9999999999999998" cp2x="9.0" cp2y="0.9999999999999998"/>
+                                    <point x="8.158536585365859" y="1.9756097560975614" cp1x="8.158536585365859" cp1y="1.9756097560975614" cp2x="8.158536585365859" cp2y="1.9756097560975614"/>
+                                    <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                    <point x="2.8658536585365852" y="10.0" cp1x="2.8658536585365852" cp1y="10.0" cp2x="2.8658536585365852" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e58b199e.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="5.0" cp2x="0.0" cp2y="5.0"/>
+                                    <point x="2.1463414634146343" y="5.0" cp1x="2.1463414634146343" cp1y="5.0" cp2x="2.1463414634146343" cp2y="5.0"/>
+                                    <point x="3.560975609756098" y="7.390243902439032" cp1x="3.560975609756098" cp1y="7.390243902439032" cp2x="3.560975609756098" cp2y="7.390243902439032"/>
+                                    <point x="6.963414634146344" y="0.0" cp1x="6.963414634146344" cp1y="0.0" cp2x="6.963414634146344" cp2y="0.0"/>
+                                    <point x="9.0" y="0.0" cp1x="9.0" cp1y="0.0" cp2x="9.0" cp2y="0.0"/>
+                                    <point x="9.0" y="0.9999999999999998" cp1x="9.0" cp1y="0.9999999999999998" cp2x="9.0" cp2y="0.9999999999999998"/>
+                                    <point x="8.158536585365859" y="1.9756097560975614" cp1x="8.158536585365859" cp1y="1.9756097560975614" cp2x="8.158536585365859" cp2y="1.9756097560975614"/>
+                                    <point x="4.0" y="10.0" cp1x="4.0" cp1y="10.0" cp2x="4.0" cp2y="10.0"/>
+                                    <point x="2.8658536585365852" y="10.0" cp1x="2.8658536585365852" cp1y="10.0" cp2x="2.8658536585365852" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e5925910.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <region name="MenuItemAccelerator" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JMenu" name="Menu" ui="MenuUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="1" bottom="2" left="12" right="5"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground>
+                     <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelection" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="arrowIcon" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08983666" brightnessOffset="-0.17647058" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="1.0"/>
+                                    <point x="7.756097560975589" y="5.512195121951206" cp1x="7.756097560975589" cp1y="5.512195121951206" cp2x="7.756097560975589" cp2y="5.512195121951206"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="71" green="71" blue="72" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.09663743" brightnessOffset="-0.4627451" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="1.0"/>
+                                    <point x="7.756097560975589" y="5.512195121951206" cp1x="7.756097560975589" cp1y="5.512195121951206" cp2x="7.756097560975589" cp2y="5.512195121951206"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e57f255e.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="9" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="1.0"/>
+                                    <point x="7.670731707317066" y="5.499999999999998" cp1x="7.670731707317066" cp1y="5.499999999999998" cp2x="7.670731707317066" cp2y="5.499999999999998"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e58a275a.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <region name="MenuItemAccelerator" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="80" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JPopupMenu" name="PopupMenu" ui="PopupMenuUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="1" right="1"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties>
+               <uiProperty name="consumeEventOnClose" type="BOOLEAN" value="true"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="220" height="313"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="9" bottom="11" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="1.0" x2="219.0" y1="1.0" y2="312.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.15">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.02" midpoint="0.5">
+                                 <matte red="237" green="239" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6150531" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.98" midpoint="0.8">
+                                 <matte red="237" green="239" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6150531" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.72">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="220.0" y1="0.0" y2="313.0" rounding="0.0">
+                           <matte red="89" green="89" blue="89" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.39607844" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="220" height="313"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="11" bottom="11" left="2" right="2"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="1.0" x2="219.0" y1="1.0" y2="312.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.15">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.02" midpoint="0.5">
+                                 <matte red="237" green="239" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6150531" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.98" midpoint="0.8">
+                                 <matte red="237" green="239" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.6150531" brightnessOffset="0.39999998" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.72">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="220.0" y1="0.0" y2="313.0" rounding="0.0">
+                           <matte red="89" green="89" blue="89" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.39607844" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="113dbeb51c2.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JPopupMenu$Separator" name="PopupMenuSeparator" ui="PopupMenuSeparatorUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="1" bottom="2" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled" inverted="true">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="3" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="3.0" y1="1.0" y2="2.0" rounding="0.0">
+                           <matte red="167" green="172" blue="180" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.03830409" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="1.0" x2="0.75" y2="2.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JOptionPane" name="OptionPane" ui="OptionPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="15" bottom="15" left="15" right="15"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="buttonOrientation" type="INT" value="4"/>
+               <uiProperty name="messageAnchor" type="INT" value="17"/>
+               <uiProperty name="separatorPadding" type="INT" value="0"/>
+               <uiProperty name="sameSizeButtons" type="BOOLEAN" value="false"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="false" componentName="OptionPane.separator" type="javax.swing.JSeparator" name="Separator" ui="SeparatorUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="1" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <cacheMode>NO_CACHING</cacheMode>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" componentName="OptionPane.messageArea" type="javax.swing.JPanel" name="Panel" ui="PanelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="10" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions>
+                  <uiComponent opaque="false" componentName="OptionPane.label" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+                     <stateTypes/>
+                     <contentMargins top="0" bottom="10" left="10" right="10"/>
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <backgroundStates>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="100" height="30"/>
+                              <nextLayerNameIndex>2</nextLayerNameIndex>
+                              <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                              <layer name="Layer 1">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                                       <matte red="0" green="0" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                           </canvas>
+                        </state>
+                     </backgroundStates>
+                     <foregroundStates/>
+                     <borderStates/>
+                     <regions/>
+                  </uiComponent>
+               </regions>
+            </uiComponent>
+            <uiIconRegion name="ErrorIcon" subregion="true" key="errorIcon" basicKey="OptionPane.errorIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="48" height="48"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 4">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="68" uiDefaultParentName="nimbusRed" hueOffset="0.0" saturationOffset="-0.79881656" brightnessOffset="0.33725488" alphaOffset="-187"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="13.6875" cp1x="1.0" cp1y="13.6875" cp2x="1.0" cp2y="13.6875"/>
+                                    <point x="13.4375" y="1.0" cp1x="13.4375" cp1y="1.0" cp2x="13.4375" cp2y="1.0"/>
+                                    <point x="32.5625" y="1.0" cp1x="32.5625" cp1y="1.0" cp2x="32.5625" cp2y="1.0"/>
+                                    <point x="45.0" y="13.5" cp1x="45.0" cp1y="13.5" cp2x="45.0" cp2y="13.5"/>
+                                    <point x="45.0" y="32.0" cp1x="45.0" cp1y="32.0" cp2x="45.0" cp2y="32.0"/>
+                                    <point x="32.0" y="45.0" cp1x="32.0" cp1y="45.0" cp2x="32.0" cp2y="45.0"/>
+                                    <point x="13.6875" y="44.9375" cp1x="13.6875" cp1y="44.9375" cp2x="13.6875" cp2y="44.9375"/>
+                                    <point x="1.0625" y="32.3125" cp1x="1.0625" cp1y="32.3125" cp2x="1.0625" cp2y="32.3125"/>
+                                    <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                                    <point x="2.0" y="24.0" cp1x="2.0" cp1y="24.0" cp2x="2.0" cp2y="24.0"/>
+                                    <point x="2.0" y="32.0" cp1x="2.0" cp1y="32.0" cp2x="2.0" cp2y="32.0"/>
+                                    <point x="14.0" y="44.0" cp1x="14.0" cp1y="44.0" cp2x="14.0" cp2y="44.0"/>
+                                    <point x="32.0" y="44.0" cp1x="32.0" cp1y="44.0" cp2x="32.0" cp2y="44.0"/>
+                                    <point x="44.0" y="32.0" cp1x="44.0" cp1y="32.0" cp2x="44.0" cp2y="32.0"/>
+                                    <point x="44.0" y="14.0" cp1x="44.0" cp1y="14.0" cp2x="44.0" cp2y="14.0"/>
+                                    <point x="32.0" y="2.0" cp1x="32.0" cp1y="2.0" cp2x="32.0" cp2y="2.0"/>
+                                    <point x="14.0" y="2.0" cp1x="14.0" cp1y="2.0" cp2x="14.0" cp2y="2.0"/>
+                                    <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                    <point x="2.0" y="24.0" cp1x="2.0" cp1y="24.0" cp2x="2.0" cp2y="24.0"/>
+                                    <point x="1.0" y="24.0" cp1x="1.0" cp1y="24.0" cp2x="1.0" cp2y="24.0"/>
+                                 </points>
+                              </path>
+                              <ellipse x1="20.0" x2="26.0" y1="32.0" y2="38.0">
+                                 <matte red="250" green="250" blue="250" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.22745097" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <path>
+                                 <matte red="250" green="250" blue="250" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.22745097" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="20.0" y="11.0" cp1x="20.0" cp1y="13.0" cp2x="20.0" cp2y="9.0"/>
+                                    <point x="23.0" y="8.0" cp1x="21.0" cp1y="8.0" cp2x="25.0" cp2y="8.0"/>
+                                    <point x="26.0" y="11.0" cp1x="26.0" cp1y="9.0" cp2x="26.0" cp2y="13.0"/>
+                                    <point x="24.0" y="29.0" cp1x="24.0" cp1y="29.0" cp2x="24.0" cp2y="29.0"/>
+                                    <point x="22.0" y="29.0" cp1x="22.0" cp1y="29.0" cp2x="22.0" cp2y="29.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="225" green="136" blue="136" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="-0.403261" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3451613" midpoint="0.5">
+                                       <matte red="198" green="54" blue="54" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="-0.07154381" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.683871" midpoint="0.68367344">
+                                       <matte red="187" green="17" blue="17" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.110274374" brightnessOffset="0.07058823" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="235" green="60" blue="60" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="-0.05413574" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                    <point x="14.0" y="1.0" cp1x="14.0" cp1y="1.0" cp2x="14.0" cp2y="1.0"/>
+                                    <point x="32.0" y="1.0" cp1x="32.0" cp1y="1.0" cp2x="32.0" cp2y="1.0"/>
+                                    <point x="45.0" y="14.0" cp1x="45.0" cp1y="14.0" cp2x="45.0" cp2y="14.0"/>
+                                    <point x="45.0" y="32.0" cp1x="45.0" cp1y="32.0" cp2x="45.0" cp2y="32.0"/>
+                                    <point x="32.0" y="45.0" cp1x="32.0" cp1y="45.0" cp2x="32.0" cp2y="45.0"/>
+                                    <point x="14.0" y="45.0" cp1x="14.0" cp1y="45.0" cp2x="14.0" cp2y="45.0"/>
+                                    <point x="1.0" y="32.0" cp1x="1.0" cp1y="32.0" cp2x="1.0" cp2y="32.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="173" green="3" blue="3" alpha="255" uiDefaultParentName="nimbusRed" hueOffset="-0.014814814" saturationOffset="0.18384242" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="13.0" cp1x="0.0" cp1y="13.0" cp2x="0.0" cp2y="13.0"/>
+                                    <point x="13.0" y="0.0" cp1x="13.0" cp1y="0.0" cp2x="13.0" cp2y="0.0"/>
+                                    <point x="33.0" y="0.0" cp1x="33.0" cp1y="0.0" cp2x="33.0" cp2y="0.0"/>
+                                    <point x="46.0" y="13.0" cp1x="46.0" cp1y="13.0" cp2x="46.0" cp2y="13.0"/>
+                                    <point x="46.0" y="33.0" cp1x="46.0" cp1y="33.0" cp2x="46.0" cp2y="33.0"/>
+                                    <point x="33.0" y="46.0" cp1x="33.0" cp1y="46.0" cp2x="33.0" cp2y="46.0"/>
+                                    <point x="13.0" y="46.0" cp1x="13.0" cp1y="46.0" cp2x="13.0" cp2y="46.0"/>
+                                    <point x="0.0" y="33.0" cp1x="0.0" cp1y="33.0" cp2x="0.0" cp2y="33.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects>
+                              <dropShadow blendingMode="NORMAL" opacity="0.28" angle="135" distance="2" spread="0" size="3">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </dropShadow>
+                           </effects>
+                        </layer>
+                        <templateLayer fileName="11406393ebc.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="InformationIcon" subregion="true" key="informationIcon" basicKey="OptionPane.informationIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="48" height="48"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="20.0" x2="26.0" y1="8.0" y2="14.0">
+                                 <matte red="250" green="250" blue="250" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.2235294" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <path>
+                                 <matte red="250" green="250" blue="250" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="18.0" y="18.0" cp1x="15.5" cp1y="18.0" cp2x="20.5" cp2y="18.0"/>
+                                    <point x="24.0" y="18.0" cp1x="22.8125" cp1y="18.0" cp2x="25.1875" cp2y="18.0"/>
+                                    <point x="26.0" y="21.0" cp1x="26.0" cp1y="19.0" cp2x="26.0" cp2y="23.0"/>
+                                    <point x="26.0" y="33.0" cp1x="26.0" cp1y="33.0" cp2x="26.0" cp2y="33.0"/>
+                                    <point x="28.9375" y="33.0" cp1x="26.375" cp1y="33.0625" cp2x="31.5" cp2y="32.9375"/>
+                                    <point x="29.0" y="37.0" cp1x="31.5625" cp1y="37.0" cp2x="26.4375" cp2y="37.0"/>
+                                    <point x="17.125" y="37.0" cp1x="19.625" cp1y="37.0625" cp2x="14.625" cp2y="36.9375"/>
+                                    <point x="17.0" y="33.0" cp1x="14.5625" cp1y="33.0" cp2x="19.4375" cp2y="33.0"/>
+                                    <point x="20.0" y="33.0" cp1x="20.0" cp1y="33.0" cp2x="20.0" cp2y="33.0"/>
+                                    <point x="20.0" y="22.0" cp1x="20.0" cp1y="22.0" cp2x="20.0" cp2y="22.0"/>
+                                    <point x="18.0" y="22.0" cp1x="20.75" cp1y="22.0" cp2x="15.25" cp2y="22.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="44.0" y1="2.0" y2="44.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="150" green="175" blue="222" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="-0.0014793873" saturationOffset="-0.41456455" brightnessOffset="0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.28424656" midpoint="0.5">
+                                       <matte red="78" green="116" blue="191" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="3.437996E-4" saturationOffset="-0.14726585" brightnessOffset="0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5" midpoint="0.5">
+                                       <matte red="48" green="93" blue="180" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="-4.271865E-4" saturationOffset="-0.0055555105" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7191781" midpoint="0.5">
+                                       <matte red="47" green="92" blue="180" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="87" green="134" blue="224" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="-7.866621E-4" saturationOffset="-0.12728173" brightnessOffset="0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="1.0" x2="45.0" y1="1.0" y2="45.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="162" green="185" blue="229" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="-8.2296133E-4" saturationOffset="-0.44631243" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.48287672" midpoint="0.5">
+                                       <matte red="64" green="106" blue="191" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="0.0012729168" saturationOffset="-0.0739674" brightnessOffset="0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="93" green="139" blue="231" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="8.354187E-4" saturationOffset="-0.14148629" brightnessOffset="0.19999999" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="0.0" x2="46.0" y1="0.0" y2="46.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="33" green="78" blue="166" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="0.0" saturationOffset="0.06231594" brightnessOffset="-0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="24" green="60" blue="131" alpha="255" uiDefaultParentName="nimbusInfoBlue" hueOffset="3.1620264E-4" saturationOffset="0.07790506" brightnessOffset="-0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="0.0" x2="0.0" y1="0.0" y2="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="0.0" x2="0.0" y1="0.0" y2="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="0.0" x2="0.0" y1="0.0" y2="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects>
+                              <dropShadow blendingMode="NORMAL" opacity="0.35" angle="135" distance="2" spread="0" size="4">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </dropShadow>
+                           </effects>
+                        </layer>
+                        <templateLayer fileName="11409fd0ae1.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="QuestionIcon" subregion="true" key="questionIcon" basicKey="OptionPane.questionIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="48" height="48"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="20.0" x2="26.0" y1="32.0" y2="38.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="15.0" y="17.875" cp1x="13.5" cp1y="16.5" cp2x="16.5" cp2y="19.25"/>
+                                    <point x="19.1875" y="17.1875" cp1x="18.4375" cp1y="18.375" cp2x="19.9375" cp2y="16.0"/>
+                                    <point x="22.5" y="13.9375" cp1x="20.6875" cp1y="13.9375" cp2x="24.3125" cp2y="13.9375"/>
+                                    <point x="25.6875" y="16.8125" cp1x="25.6875" cp1y="15.25" cp2x="25.6875" cp2y="18.375"/>
+                                    <point x="22.5625" y="20.5625" cp1x="23.8125" cp1y="19.375" cp2x="21.3125" cp2y="21.75"/>
+                                    <point x="20.0625" y="26.125" cp1x="20.0" cp1y="24.625" cp2x="20.125" cp2y="27.625"/>
+                                    <point x="22.875" y="28.9375" cp1x="21.5625" cp1y="28.9375" cp2x="24.1875" cp2y="28.9375"/>
+                                    <point x="25.9375" y="26.25" cp1x="25.9375" cp1y="27.875" cp2x="25.9375" cp2y="24.625"/>
+                                    <point x="29.4375" y="22.3125" cp1x="28.25" cp1y="23.5625" cp2x="30.625" cp2y="21.0625"/>
+                                    <point x="32.0" y="16.625" cp1x="32.0625" cp1y="19.9375" cp2x="31.9375" cp2y="13.3125"/>
+                                    <point x="23.1875" y="8.0625" cp1x="29.3125" cp1y="8.0" cp2x="17.0625" cp2y="8.125"/>
+                                    <point x="14.625" y="13.875" cp1x="15.0625" cp1y="12.625" cp2x="14.1875" cp2y="15.125"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="2.0" x2="44.0" y1="2.0" y2="44.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="159" green="163" blue="168" alpha="255" hueOffset="-0.018518567" saturationOffset="-0.056954887" brightnessOffset="-0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.30479452" midpoint="0.5">
+                                       <matte red="116" green="122" blue="130" alpha="255" hueOffset="-0.015872955" saturationOffset="-0.0028340071" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6541096" midpoint="0.5">
+                                       <matte red="96" green="104" blue="112" alpha="255" hueOffset="-0.027777791" saturationOffset="0.032330833" brightnessOffset="-0.30588236" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="118" green="128" blue="138" alpha="255" hueOffset="-0.027777791" saturationOffset="0.034401216" brightnessOffset="-0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="1.0" x2="45.0" y1="1.0" y2="45.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="168" green="173" blue="178" alpha="255" hueOffset="-0.027777791" saturationOffset="-0.05434654" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="101" green="109" blue="118" alpha="255" hueOffset="-0.022875786" saturationOffset="0.03354148" brightnessOffset="-0.28235295" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="0.0" x2="46.0" y1="0.0" y2="46.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="115" green="120" blue="126" alpha="255" hueOffset="-0.02020204" saturationOffset="-0.023224726" brightnessOffset="-0.2509804" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="26" green="34" blue="43" alpha="255" hueOffset="-0.022875786" saturationOffset="0.28482252" brightnessOffset="-0.5764706" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects>
+                              <dropShadow blendingMode="NORMAL" opacity="0.43" angle="135" distance="2" spread="0" size="3">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </dropShadow>
+                           </effects>
+                        </layer>
+                        <templateLayer fileName="11409f1bdec.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="WarningIcon" subregion="true" key="warningIcon" basicKey="OptionPane.warningIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="48" height="48"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="21.0" x2="27.0" y1="35.0" y2="41.0">
+                                 <matte red="16" green="16" blue="16" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.68235296" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="69" green="69" blue="69" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.4745098" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="24.0" y="11.0" cp1x="22.0" cp1y="11.0" cp2x="26.0" cp2y="11.0"/>
+                                    <point x="27.0" y="15.0" cp1x="27.0" cp1y="13.0" cp2x="27.0" cp2y="17.0"/>
+                                    <point x="24.0" y="32.0" cp1x="25.3125" cp1y="32.0" cp2x="22.6875" cp2y="32.0"/>
+                                    <point x="21.0" y="15.0" cp1x="21.0" cp1y="17.0" cp2x="21.0" cp2y="13.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="255" green="237" blue="139" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="6.530881E-4" saturationOffset="-0.40784314" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3458904" midpoint="0.5">
+                                       <matte red="255" green="224" blue="63" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="-3.9456785E-4" saturationOffset="-0.109803915" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64041096" midpoint="0.5">
+                                       <matte red="255" green="220" blue="35" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8253425" midpoint="0.5">
+                                       <matte red="255" green="232" blue="47" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="0.008085668" saturationOffset="-0.04705882" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="82" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="0.026515156" saturationOffset="-0.18431371" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="23.9375" y="2.0625" cp1x="22.1875" cp1y="2.0625" cp2x="25.6875" cp2y="2.0625"/>
+                                    <point x="26.625" y="4.5625" cp1x="26.625" cp1y="4.5625" cp2x="26.625" cp2y="4.5625"/>
+                                    <point x="44.75" y="38.4375" cp1x="44.75" cp1y="38.4375" cp2x="44.75" cp2y="38.4375"/>
+                                    <point x="45.9375" y="42.0" cp1x="45.9375" cp1y="40.5625" cp2x="45.9375" cp2y="43.4375"/>
+                                    <point x="42.4375" y="44.0" cp1x="42.4375" cp1y="44.0" cp2x="42.4375" cp2y="44.0"/>
+                                    <point x="4.8125" y="44.0" cp1x="4.8125" cp1y="44.0" cp2x="4.8125" cp2y="44.0"/>
+                                    <point x="2.1875" y="41.875" cp1x="2.25" cp1y="43.5" cp2x="2.125" cp2y="40.25"/>
+                                    <point x="3.625" y="37.9375" cp1x="3.625" cp1y="37.9375" cp2x="3.625" cp2y="37.9375"/>
+                                    <point x="21.1875" y="4.9375" cp1x="21.1875" cp1y="4.9375" cp2x="21.1875" cp2y="4.9375"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="216" green="181" blue="0" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="-4.9102306E-4" saturationOffset="0.1372549" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="166" green="138" blue="0" alpha="255" uiDefaultParentName="nimbusAlertYellow" hueOffset="-0.0015973002" saturationOffset="0.1372549" brightnessOffset="-0.3490196" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="24.0" y="1.0" cp1x="22.0" cp1y="1.0" cp2x="26.0" cp2y="1.0"/>
+                                    <point x="27.1875" y="3.9375" cp1x="27.1875" cp1y="3.9375" cp2x="27.1875" cp2y="3.9375"/>
+                                    <point x="45.25" y="37.4375" cp1x="45.25" cp1y="37.4375" cp2x="45.25" cp2y="37.4375"/>
+                                    <point x="46.8125" y="42.25" cp1x="46.8125" cp1y="39.875" cp2x="46.8125" cp2y="44.625"/>
+                                    <point x="44.0" y="45.0" cp1x="44.0" cp1y="45.0" cp2x="44.0" cp2y="45.0"/>
+                                    <point x="4.0" y="45.0" cp1x="4.0" cp1y="45.0" cp2x="4.0" cp2y="45.0"/>
+                                    <point x="1.1875" y="42.3125" cp1x="1.3125" cp1y="44.5625" cp2x="1.0625" cp2y="40.0625"/>
+                                    <point x="2.875" y="37.5" cp1x="2.875" cp1y="37.5" cp2x="2.875" cp2y="37.5"/>
+                                    <point x="21.0" y="4.0" cp1x="21.0" cp1y="4.0" cp2x="21.0" cp2y="4.0"/>
+                                 </points>
+                              </path>
+                              <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects>
+                              <dropShadow blendingMode="NORMAL" opacity="0.22" angle="135" distance="2" spread="0" size="3">
+                                 <matte red="0" green="0" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </dropShadow>
+                           </effects>
+                        </layer>
+                        <templateLayer fileName="1140a08420a.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JPanel" name="Panel" ui="PanelUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JProgressBar" name="ProgressBar" ui="ProgressBarUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="Disabled"/>
+            <stateType key="Indeterminate">
+               <codeSnippet><![CDATA[
+                        return ((JProgressBar)c).isIndeterminate();
+               ]]></codeSnippet>
+            </stateType>
+            <stateType key="Finished">
+               <codeSnippet><![CDATA[
+                        return ((JProgressBar)c).getPercentComplete() == 1.0;
+                ]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+            <uiproperties>
+               <uiProperty name="tileWhenIndeterminate" type="BOOLEAN" value="true"/>
+               <uiProperty name="tileWidth" type="INT" value="27"/>
+               <uiProperty name="paintOutsideClip" type="BOOLEAN" value="true"/>
+               <uiProperty name="rotateText" type="BOOLEAN" value="true"/>
+               <uiProperty name="vertictalSize" type="DIMENSION">
+                  <dimension width="19" height="150"/>
+               </uiProperty>
+               <uiProperty name="horizontalSize" type="DIMENSION">
+                  <dimension width="150" height="19"/>
+               </uiProperty>
+               <uiProperty name="cycleTime" type="INT" value="250"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="29" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="26.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08064516" midpoint="0.5">
+                                 <matte red="235" green="236" blue="238" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.097921275" brightnessOffset="0.18823528" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.3935484" midpoint="0.5">
+                                 <matte red="218" green="219" blue="222" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.0925083" brightnessOffset="0.12549019" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.43870968" midpoint="0.5">
+                                 <matte red="206" green="208" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08222443" brightnessOffset="0.086274505" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.90967745" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08477524" brightnessOffset="0.16862744" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.91935486" midpoint="0.5">
+                                 <matte red="249" green="251" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.086996906" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="27.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="136" green="139" blue="145" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.04845735" brightnessOffset="-0.17647058" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="174" green="177" blue="183" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061345987" brightnessOffset="-0.027450979" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1140514801d.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="29" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="26.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="235" green="236" blue="239" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.09378991" brightnessOffset="0.19215685" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08064516" midpoint="0.5">
+                                 <matte red="225" green="227" blue="231" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08455229" brightnessOffset="0.1607843" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.3935484" midpoint="0.5">
+                                 <matte red="217" green="220" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.08362049" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.43870968" midpoint="0.5">
+                                 <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.90967745" midpoint="0.5">
+                                 <matte red="221" green="223" blue="228" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07982456" brightnessOffset="0.1490196" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.92258066" midpoint="0.5">
+                                 <matte red="230" green="232" blue="237" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.08099045" brightnessOffset="0.18431371" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="27.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.05483871" midpoint="0.5">
+                                 <matte red="175" green="178" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061613273" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9516129" midpoint="0.5">
+                                 <matte red="193" green="197" blue="203" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.061265234" brightnessOffset="0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1141fe7dbd7.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="27" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="26.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="236" green="209" blue="179" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.003940329" saturationOffset="-0.7375322" brightnessOffset="0.17647058" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08387097" midpoint="0.5">
+                                 <matte red="219" green="167" blue="107" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.005506739" saturationOffset="-0.46764207" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.46129033" midpoint="0.5">
+                                 <matte red="203" green="127" blue="42" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0042127445" saturationOffset="-0.18595415" brightnessOffset="0.04705882" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5193548" midpoint="0.5">
+                                 <matte red="192" green="102" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="0.02094239" brightnessOffset="0.0039215684" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.91612905" midpoint="0.5">
+                                 <matte red="232" green="142" blue="40" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="-0.15147138" brightnessOffset="0.1607843" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.93225807" midpoint="0.5">
+                                 <matte red="255" green="177" blue="75" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.010665476" saturationOffset="-0.27317524" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="27.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="152" green="62" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015796512" saturationOffset="0.02094239" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.07096774" midpoint="0.5">
+                                 <matte red="172" green="82" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.004321605" saturationOffset="0.02094239" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4903226" midpoint="0.5">
+                                 <matte red="165" green="75" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.008021399" saturationOffset="0.02094239" brightnessOffset="-0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="185" green="101" blue="37" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.011706904" saturationOffset="-0.1790576" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9451613" midpoint="0.5">
+                                 <matte red="114" green="24" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.048691254" saturationOffset="0.02094239" brightnessOffset="-0.3019608" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="191" green="98" blue="4" alpha="99" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-156"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="3.0" y="0.6333333333333334" cp1x="5.0" cp1y="0.6333333333333334" cp2x="1.0" cp2y="0.6333333333333334"/>
+                              <point x="0.6333333333333334" y="3.0" cp1x="0.6333333333333334" cp1y="1.0" cp2x="0.6333333333333334" cp2y="5.0"/>
+                              <point x="0.6333333333333334" y="16.0" cp1x="0.6333333333333334" cp1y="14.0" cp2x="0.6333333333333334" cp2y="18.0"/>
+                              <point x="3.0" y="18.46666666666669" cp1x="1.0" cp1y="18.46666666666669" cp2x="5.0" cp2y="18.46666666666669"/>
+                              <point x="27.0" y="18.46666666666669" cp1x="27.0" cp1y="18.46666666666669" cp2x="27.0" cp2y="18.46666666666669"/>
+                              <point x="27.0" y="17.0" cp1x="27.0" cp1y="17.0" cp2x="27.0" cp2y="17.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="17.0"/>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="27.0" y="2.0" cp1x="27.0" cp1y="2.0" cp2x="27.0" cp2y="2.0"/>
+                              <point x="27.0" y="0.6000000000000001" cp1x="27.0" cp1y="0.6000000000000001" cp2x="27.0" cp2y="0.6000000000000001"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1140518fed0.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Finished">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="27" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="24.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="236" green="209" blue="179" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.003940329" saturationOffset="-0.7375322" brightnessOffset="0.17647058" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08387097" midpoint="0.5">
+                                 <matte red="219" green="167" blue="107" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.005506739" saturationOffset="-0.46764207" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.46129033" midpoint="0.5">
+                                 <matte red="203" green="127" blue="42" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0042127445" saturationOffset="-0.18595415" brightnessOffset="0.04705882" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5193548" midpoint="0.5">
+                                 <matte red="192" green="102" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="0.02094239" brightnessOffset="0.0039215684" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.91612905" midpoint="0.5">
+                                 <matte red="232" green="142" blue="40" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="-0.15147138" brightnessOffset="0.1607843" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.93225807" midpoint="0.5">
+                                 <matte red="255" green="177" blue="75" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.010665476" saturationOffset="-0.27317524" brightnessOffset="0.25098038" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="25.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="152" green="62" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015796512" saturationOffset="0.02094239" brightnessOffset="-0.15294117" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.07096774" midpoint="0.5">
+                                 <matte red="172" green="82" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.004321605" saturationOffset="0.02094239" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4903226" midpoint="0.5">
+                                 <matte red="165" green="75" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.008021399" saturationOffset="0.02094239" brightnessOffset="-0.10196078" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="185" green="101" blue="37" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.011706904" saturationOffset="-0.1790576" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9451613" midpoint="0.5">
+                                 <matte red="114" green="24" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.048691254" saturationOffset="0.02094239" brightnessOffset="-0.3019608" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="191" green="98" blue="4" alpha="99" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="-156"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.7333333333333343" y="0.6333333333333334" cp1x="2.7333333333333343" cp1y="0.6333333333333334" cp2x="0.7333333333333334" cp2y="0.6333333333333334"/>
+                              <point x="0.6000000000000001" y="3.033333333333333" cp1x="0.6000000000000001" cp1y="1.0333333333333334" cp2x="0.6000000000000001" cp2y="3.033333333333333"/>
+                              <point x="0.6000000000000001" y="16.13333333333334" cp1x="0.6000000000000001" cp1y="16.13333333333334" cp2x="0.6000000000000001" cp2y="18.13333333333334"/>
+                              <point x="2.9" y="18.400000000000016" cp1x="0.9" cp1y="18.400000000000016" cp2x="2.9" cp2y="18.400000000000016"/>
+                              <point x="23.999999999999986" y="18.366666666666678" cp1x="23.999999999999986" cp1y="18.366666666666678" cp2x="25.970929244126516" cp2y="18.386523706031824"/>
+                              <point x="26.33333333333335" y="16.166666666666664" cp1x="26.300000000000015" cp1y="18.10000000000005" cp2x="26.33333333333335" cp2y="16.166666666666664"/>
+                              <point x="26.366666666666678" y="13.46666666666666" cp1x="26.366666666666678" cp1y="13.46666666666666" cp2x="26.366666666666678" cp2y="13.46666666666666"/>
+                              <point x="26.333333333333343" y="6.633333333333332" cp1x="26.333333333333343" cp1y="6.633333333333332" cp2x="26.333333333333343" cp2y="6.633333333333332"/>
+                              <point x="26.33333333333332" y="3.0333333333333328" cp1x="26.33333333333332" cp1y="3.0333333333333328" cp2x="26.337550663750736" cp2y="1.0829955749951623"/>
+                              <point x="24.300000000000004" y="0.6666666666666667" cp1x="26.265946019413946" cp1y="0.6837889338880168" cp2x="24.300000000000004" cp2y="0.6666666666666667"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Indeterminate">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties>
+                     <uiProperty name="progressPadding" type="INT" value="3"/>
+                  </uiproperties>
+               </style>
+               <canvas>
+                  <size width="30" height="13"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="20.0" x2="21.0" y1="0.0" y2="13.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="85" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-170"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="10.0" x2="11.0" y1="0.0" y2="13.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="82" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-173"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="219" green="167" blue="107" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.005506739" saturationOffset="-0.46764207" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.41290322" midpoint="0.5">
+                                 <matte red="203" green="127" blue="42" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0042127445" saturationOffset="-0.18595415" brightnessOffset="0.04705882" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.47096774" midpoint="0.5">
+                                 <matte red="192" green="102" blue="0" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="0.02094239" brightnessOffset="0.0039215684" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="252" green="162" blue="60" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0047626942" saturationOffset="-0.21715283" brightnessOffset="0.23921567" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="0.0" y="6.0" cp1x="0.0" cp1y="6.0" cp2x="2.678571428571433" cp2y="6.000000000000001"/>
+                              <point x="12.357142857142872" y="1.0357142857142834" cp1x="6.142857142857157" cp1y="1.0000000000000004" cp2x="12.357142857142872" cp2y="1.0357142857142834"/>
+                              <point x="16.28571428571428" y="1.0357142857142858" cp1x="16.28571428571428" cp1y="1.0357142857142858" cp2x="24.615384615384638" cp2y="1.0384615384615354"/>
+                              <point x="28.0" y="6.0" cp1x="22.71428571428573" cp1y="6.035714285714286" cp2x="28.0" cp2y="6.0"/>
+                              <point x="30.0" y="6.0" cp1x="30.0" cp1y="6.0" cp2x="30.0" cp2y="6.0"/>
+                              <point x="30.0" y="7.0" cp1x="30.0" cp1y="7.0" cp2x="30.0" cp2y="7.0"/>
+                              <point x="28.0" y="7.0" cp1x="28.0" cp1y="7.0" cp2x="22.67857142857143" cp2y="7.035714285714285"/>
+                              <point x="16.285714285714295" y="12.000000000000007" cp1x="25.26923076923079" cp1y="12.038461538461538" cp2x="16.285714285714295" cp2y="12.000000000000007"/>
+                              <point x="12.785714285714295" y="12.0" cp1x="12.785714285714295" cp1y="12.0" cp2x="6.071428571428592" cp2y="12.0"/>
+                              <point x="0.0" y="7.0" cp1x="2.6071428571428568" cp1y="7.035714285714286" cp2x="0.0" cp2y="7.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.0" x2="30.0" y1="0.0" y2="13.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.051612902" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08064516" midpoint="0.5">
+                                 <matte red="235" green="236" blue="238" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.097921275" brightnessOffset="0.18823528" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5064516" midpoint="0.5">
+                                 <matte red="217" green="214" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.54444444" saturationOffset="-0.08748484" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.87419355" midpoint="0.5">
+                                 <matte red="227" green="229" blue="233" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08477524" brightnessOffset="0.16862744" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="249" green="251" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.086996906" brightnessOffset="0.25490195" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11405266ab0.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>true</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="27" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="26.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="220" green="215" blue="211" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.009704903" saturationOffset="-0.9381485" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08387097" midpoint="0.5">
+                                 <matte red="215" green="203" blue="191" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.86742973" brightnessOffset="0.09411764" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.46129033" midpoint="0.5">
+                                 <matte red="211" green="192" blue="173" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.79896283" brightnessOffset="0.07843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5193548" midpoint="0.5">
+                                 <matte red="208" green="185" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0013274103" saturationOffset="-0.7530961" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.91612905" midpoint="0.5">
+                                 <matte red="219" green="196" blue="172" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0013274103" saturationOffset="-0.7644457" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.93225807" midpoint="0.5">
+                                 <matte red="225" green="206" blue="182" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.009244293" saturationOffset="-0.78794646" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="27.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="197" green="174" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.023593787" saturationOffset="-0.7963165" brightnessOffset="0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.07096774" midpoint="0.5">
+                                 <matte red="202" green="179" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.010608241" saturationOffset="-0.7760873" brightnessOffset="0.043137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4903226" midpoint="0.5">
+                                 <matte red="200" green="177" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015402906" saturationOffset="-0.7840576" brightnessOffset="0.035294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="206" green="185" blue="171" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.017112307" saturationOffset="-0.8091547" brightnessOffset="0.058823526" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9451613" midpoint="0.5">
+                                 <matte red="186" green="163" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.07044564" saturationOffset="-0.844649" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="218" green="211" blue="198" alpha="99" uiDefaultParentName="nimbusOrange" hueOffset="0.024554357" saturationOffset="-0.8873145" brightnessOffset="0.10588235" alphaOffset="-156"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="3.0" y="0.6333333333333334" cp1x="5.0" cp1y="0.6333333333333334" cp2x="1.0" cp2y="0.6333333333333334"/>
+                              <point x="0.6333333333333334" y="3.0" cp1x="0.6333333333333334" cp1y="1.0" cp2x="0.6333333333333334" cp2y="5.0"/>
+                              <point x="0.6333333333333334" y="16.0" cp1x="0.6333333333333334" cp1y="14.0" cp2x="0.6333333333333334" cp2y="18.0"/>
+                              <point x="3.0" y="18.46666666666669" cp1x="1.0" cp1y="18.46666666666669" cp2x="5.0" cp2y="18.46666666666669"/>
+                              <point x="27.0" y="18.46666666666669" cp1x="27.0" cp1y="18.46666666666669" cp2x="27.0" cp2y="18.46666666666669"/>
+                              <point x="27.0" y="17.0" cp1x="27.0" cp1y="17.0" cp2x="27.0" cp2y="17.0"/>
+                              <point x="2.0" y="17.0" cp1x="2.0" cp1y="17.0" cp2x="2.0" cp2y="17.0"/>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="27.0" y="2.0" cp1x="27.0" cp1y="2.0" cp2x="27.0" cp2y="2.0"/>
+                              <point x="27.0" y="0.6000000000000001" cp1x="27.0" cp1y="0.6000000000000001" cp2x="27.0" cp2y="0.6000000000000001"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+Finished">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="27" height="19"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="24.0" y1="3.0" y2="16.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="220" green="215" blue="211" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.009704903" saturationOffset="-0.9381485" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08387097" midpoint="0.5">
+                                 <matte red="215" green="203" blue="191" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.86742973" brightnessOffset="0.09411764" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.46129033" midpoint="0.5">
+                                 <matte red="211" green="192" blue="173" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.79896283" brightnessOffset="0.07843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5193548" midpoint="0.5">
+                                 <matte red="208" green="185" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0013274103" saturationOffset="-0.7530961" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.91612905" midpoint="0.5">
+                                 <matte red="219" green="196" blue="172" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0013274103" saturationOffset="-0.7644457" brightnessOffset="0.109803915" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.93225807" midpoint="0.5">
+                                 <matte red="225" green="206" blue="182" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.009244293" saturationOffset="-0.78794646" brightnessOffset="0.13333333" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="25.0" y1="2.0" y2="17.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.038709678" midpoint="0.5">
+                                 <matte red="197" green="174" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.023593787" saturationOffset="-0.7963165" brightnessOffset="0.02352941" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.07096774" midpoint="0.5">
+                                 <matte red="202" green="179" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.010608241" saturationOffset="-0.7760873" brightnessOffset="0.043137252" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.4903226" midpoint="0.5">
+                                 <matte red="200" green="177" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.015402906" saturationOffset="-0.7840576" brightnessOffset="0.035294116" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="206" green="185" blue="171" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.017112307" saturationOffset="-0.8091547" brightnessOffset="0.058823526" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9451613" midpoint="0.5">
+                                 <matte red="186" green="163" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-0.07044564" saturationOffset="-0.844649" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <path>
+                           <matte red="218" green="211" blue="198" alpha="99" uiDefaultParentName="nimbusOrange" hueOffset="0.024554357" saturationOffset="-0.8873145" brightnessOffset="0.10588235" alphaOffset="-156"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.9666666666666637" y="0.5999999999999999" cp1x="4.966666666666667" cp1y="0.5999999999999999" cp2x="0.9666666666666643" cp2y="0.5999999999999999"/>
+                              <point x="0.5999999999999989" y="2.966666666666667" cp1x="0.5999999999999989" cp1y="0.9666666666666661" cp2x="0.5999999999999989" cp2y="4.966666666666666"/>
+                              <point x="0.5999999999999989" y="15.966666666666676" cp1x="0.5999999999999989" cp1y="13.96666666666667" cp2x="0.5999999999999989" cp2y="17.966666666666683"/>
+                              <point x="2.9666666666666637" y="18.433333333333373" cp1x="0.9666666666666643" cp1y="18.433333333333373" cp2x="4.966666666666667" cp2y="18.433333333333373"/>
+                              <point x="25.500000000000025" y="18.400000000000038" cp1x="25.500000000000025" cp1y="18.400000000000038" cp2x="25.500000000000025" cp2y="18.400000000000038"/>
+                              <point x="26.23333333333335" y="17.466666666666697" cp1x="26.23333333333335" cp1y="17.466666666666697" cp2x="26.23333333333335" cp2y="17.466666666666697"/>
+                              <point x="26.266666666666662" y="10.53333333333335" cp1x="26.266666666666662" cp1y="10.53333333333335" cp2x="26.266666666666662" cp2y="10.53333333333335"/>
+                              <point x="26.299999999999997" y="8.666666666666663" cp1x="26.299999999999997" cp1y="8.666666666666663" cp2x="26.299999999999997" cp2y="8.666666666666663"/>
+                              <point x="26.299999999999986" y="1.8666666666666663" cp1x="26.299999999999986" cp1y="1.8666666666666663" cp2x="26.299999999999986" cp2y="1.8666666666666663"/>
+                              <point x="25.799999999999983" y="0.6666666666666657" cp1x="25.799999999999983" cp1y="0.6666666666666657" cp2x="25.799999999999983" cp2y="0.6666666666666657"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+Indeterminate">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties>
+                     <uiProperty name="progressPadding" type="INT" value="3"/>
+                  </uiproperties>
+               </style>
+               <canvas>
+                  <size width="30" height="13"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="215" green="203" blue="191" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.86742973" brightnessOffset="0.09411764" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.41290322" midpoint="0.5">
+                                 <matte red="211" green="192" blue="173" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="-4.4563413E-4" saturationOffset="-0.79896283" brightnessOffset="0.07843137" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.47096774" midpoint="0.5">
+                                 <matte red="208" green="185" blue="161" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0013274103" saturationOffset="-0.7530961" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="224" green="202" blue="179" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0014062226" saturationOffset="-0.77816474" brightnessOffset="0.12941176" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                           <points>
+                              <point x="0.0" y="6.0" cp1x="0.0" cp1y="6.0" cp2x="2.678571428571433" cp2y="6.000000000000001"/>
+                              <point x="12.357142857142872" y="1.0357142857142834" cp1x="6.0" cp1y="1.0" cp2x="12.357142857142872" cp2y="1.0357142857142834"/>
+                              <point x="16.28571428571428" y="1.0357142857142858" cp1x="16.28571428571428" cp1y="1.0357142857142858" cp2x="20.285714285714278" cp2y="1.0357142857142858"/>
+                              <point x="28.0" y="6.0" cp1x="22.71428571428573" cp1y="6.035714285714286" cp2x="28.0" cp2y="6.0"/>
+                              <point x="30.0" y="6.0" cp1x="30.0" cp1y="6.0" cp2x="30.0" cp2y="6.0"/>
+                              <point x="30.0" y="7.0" cp1x="30.0" cp1y="7.0" cp2x="30.0" cp2y="7.0"/>
+                              <point x="28.0" y="7.0" cp1x="28.0" cp1y="7.0" cp2x="22.67857142857143" cp2y="7.035714285714285"/>
+                              <point x="16.285714285714295" y="12.000000000000007" cp1x="20.28571428571428" cp1y="12.000000000000007" cp2x="16.285714285714295" cp2y="12.000000000000007"/>
+                              <point x="12.785714285714295" y="12.0" cp1x="12.785714285714295" cp1y="12.0" cp2x="6.214285714285712" cp2y="11.964285714285714"/>
+                              <point x="0.0" y="7.0" cp1x="2.6071428571428568" cp1y="7.035714285714286" cp2x="0.0" cp2y="7.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="0.0" x2="30.0" y1="0.0" y2="13.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.051612902" midpoint="0.5">
+                                 <matte red="225" green="228" blue="232" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.0803539" brightnessOffset="0.16470587" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.08064516" midpoint="0.5">
+                                 <matte red="220" green="222" blue="227" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07968931" brightnessOffset="0.14509803" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.5064516" midpoint="0.5">
+                                 <matte red="215" green="216" blue="220" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.02222228" saturationOffset="-0.08779904" brightnessOffset="0.11764705" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.87419355" midpoint="0.5">
+                                 <matte red="218" green="220" blue="226" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.075128086" brightnessOffset="0.14117646" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9032258" midpoint="0.5">
+                                 <matte red="224" green="226" blue="232" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.07604356" brightnessOffset="0.16470587" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1141fee46ff.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </foregroundStates>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JSeparator" name="Separator" ui="SeparatorUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled" inverted="true">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="3"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="0" left="40" right="40"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="1.0" y2="2.0" rounding="0.0">
+                           <matte red="167" green="172" blue="180" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.03830409" brightnessOffset="-0.039215684" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JScrollBar" name="ScrollBar" ui="ScrollBarUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties>
+               <uiProperty name="incrementButtonGap" type="INT" value="-8"/>
+               <uiProperty name="decrementButtonGap" type="INT" value="-8"/>
+               <uiProperty name="thumbHeight" type="INT" value="15"/>
+               <uiProperty name="minimumThumbSize" type="DIMENSION">
+                  <dimension width="29" height="29"/>
+               </uiProperty>
+               <uiProperty name="maximumThumbSize" type="DIMENSION">
+                  <dimension width="1000" height="1000"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="false" componentName="ScrollBar.button" type="javax.swing.plaf.synth.SynthArrowButton" name="ArrowButton" ui="SynthArrowButtonUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties>
+                     <uiProperty name="size" type="INT" value="25"/>
+                  </uiproperties>
+               </style>
+               <backgroundStates/>
+               <foregroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="25" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="90" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-165"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="16.441176470588236" y="2.0" cp1x="15.705882352941176" cp1y="2.0" cp2x="17.176470588235297" cp2y="2.0"/>
+                                    <point x="17.52941176470588" y="6.323529411764706" cp1x="16.617647058823525" cp1y="4.117647058823527" cp2x="18.441176470588236" cp2y="8.529411764705884"/>
+                                    <point x="20.41176470588234" y="11.323529411764707" cp1x="18.05882352941175" cp1y="9.47058823529412" cp2x="22.76470588235293" cp2y="13.176470588235293"/>
+                                    <point x="24.499999999999993" y="14.235294117647056" cp1x="24.499999999999993" cp1y="14.235294117647056" cp2x="24.499999999999993" cp2y="14.235294117647056"/>
+                                    <point x="24.352941176470587" y="14.823529411764707" cp1x="24.352941176470587" cp1y="14.823529411764707" cp2x="24.352941176470587" cp2y="14.823529411764707"/>
+                                    <point x="19.823529411764667" y="11.970588235294116" cp1x="21.382352941176432" cp1y="13.352941176470583" cp2x="18.264705882352903" cp2y="10.588235294117649"/>
+                                    <point x="16.970588235294116" y="7.294117647058823" cp1x="17.76470588235294" cp1y="9.294117647058822" cp2x="16.176470588235293" cp2y="5.294117647058824"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="45" green="45" blue="46" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.08878718" brightnessOffset="-0.5647059" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5928144" midpoint="0.5">
+                                       <matte red="64" green="65" blue="66" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.080223285" brightnessOffset="-0.4862745" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.994012" midpoint="0.5">
+                                       <matte red="129" green="131" blue="131" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.09525914" brightnessOffset="-0.23137254" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.924999994635583" y1="0.9285714285714283" x2="0.9249999986092253" y2="0.004201680672268871"/>
+                                 <points>
+                                    <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                    <point x="12.0" y="11.0" cp1x="12.0" cp1y="11.0" cp2x="12.0" cp2y="11.0"/>
+                                    <point x="4.9411764705882355" y="7.499999999999999" cp1x="4.9411764705882355" cp1y="7.499999999999999" cp2x="4.9411764705882355" cp2y="7.499999999999999"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="112" green="114" blue="115" alpha="119" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.08443936" brightnessOffset="-0.29411766" alphaOffset="-136"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="252" green="254" blue="255" alpha="77" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.09876161" brightnessOffset="0.25490195" alphaOffset="-178"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.5" x2="0.573529411764707" y2="0.5"/>
+                                 <points>
+                                    <point x="-0.058823529411764705" y="1.0294117647058822" cp1x="-0.058823529411764705" cp1y="1.0294117647058822" cp2x="-0.058823529411764705" cp2y="1.0294117647058822"/>
+                                    <point x="0.9705882352941175" y="1.4999999999999987" cp1x="0.9705882352941175" cp1y="1.4999999999999987" cp2x="0.9705882352941175" cp2y="1.4999999999999987"/>
+                                    <point x="1.9411764705882355" y="2.0294117647058822" cp1x="1.9411764705882355" cp1y="2.0294117647058822" cp2x="1.9411764705882355" cp2y="2.0294117647058822"/>
+                                    <point x="1.9411764705882355" y="15.029411764705882" cp1x="1.9411764705882355" cp1y="15.029411764705882" cp2x="1.9411764705882355" cp2y="15.029411764705882"/>
+                                    <point x="-0.058823529411764705" y="15.029411764705882" cp1x="-0.058823529411764705" cp1y="15.029411764705882" cp2x="-0.058823529411764705" cp2y="15.029411764705882"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="147" green="149" blue="152" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.07763158" brightnessOffset="-0.1490196" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.065868266" midpoint="0.5">
+                                       <matte red="211" green="212" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.10580933" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11377245" midpoint="0.5">
+                                       <matte red="240" green="241" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.102261856" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3473054" midpoint="0.5">
+                                       <matte red="217" green="221" blue="224" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.039682567" saturationOffset="-0.079276316" brightnessOffset="0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6407186" midpoint="0.5">
+                                       <matte red="210" green="214" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07382907" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.92814374" midpoint="0.5">
+                                       <matte red="242" green="246" blue="249" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.039682567" saturationOffset="-0.08241387" brightnessOffset="0.23137254" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                    <point x="17.0" y="5.0" cp1x="16.294117647058837" cp1y="1.9705882352941178" cp2x="17.705882352941163" cp2y="8.029411764705882"/>
+                                    <point x="20.0" y="11.0" cp1x="18.0" cp1y="9.058823529411764" cp2x="22.0" cp2y="12.941176470588236"/>
+                                    <point x="25.0" y="14.0" cp1x="25.0" cp1y="14.0" cp2x="25.0" cp2y="14.0"/>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e702fdf8.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="25" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="25" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="90" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-165"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="16.441176470588236" y="2.0" cp1x="15.705882352941176" cp1y="2.0" cp2x="17.176470588235297" cp2y="2.0"/>
+                                    <point x="17.52941176470588" y="6.323529411764706" cp1x="16.617647058823525" cp1y="4.117647058823527" cp2x="18.441176470588236" cp2y="8.529411764705884"/>
+                                    <point x="20.41176470588234" y="11.323529411764707" cp1x="18.05882352941175" cp1y="9.47058823529412" cp2x="22.76470588235293" cp2y="13.176470588235293"/>
+                                    <point x="24.499999999999993" y="14.235294117647056" cp1x="24.499999999999993" cp1y="14.235294117647056" cp2x="24.499999999999993" cp2y="14.235294117647056"/>
+                                    <point x="24.352941176470587" y="14.823529411764707" cp1x="24.352941176470587" cp1y="14.823529411764707" cp2x="24.352941176470587" cp2y="14.823529411764707"/>
+                                    <point x="19.823529411764667" y="11.970588235294116" cp1x="21.382352941176432" cp1y="13.352941176470583" cp2x="18.264705882352903" cp2y="10.588235294117649"/>
+                                    <point x="16.970588235294116" y="7.294117647058823" cp1x="17.76470588235294" cp1y="9.294117647058822" cp2x="16.176470588235293" cp2y="5.294117647058824"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="64" green="64" blue="65" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.0951417" brightnessOffset="-0.49019608" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5928144" midpoint="0.5">
+                                       <matte red="83" green="84" blue="85" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.086996906" brightnessOffset="-0.4117647" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.994012" midpoint="0.5">
+                                       <matte red="148" green="150" blue="150" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.09719298" brightnessOffset="-0.15686274" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.924999994635583" y1="0.9285714285714283" x2="0.9249999986092253" y2="0.004201680672268871"/>
+                                 <points>
+                                    <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                    <point x="12.0" y="11.0" cp1x="12.0" cp1y="11.0" cp2x="12.0" cp2y="11.0"/>
+                                    <point x="4.9411764705882355" y="7.499999999999999" cp1x="4.9411764705882355" cp1y="7.499999999999999" cp2x="4.9411764705882355" cp2y="7.499999999999999"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.19518717" midpoint="0.5">
+                                       <matte red="160" green="163" blue="165" alpha="186" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.04444444" saturationOffset="-0.080223285" brightnessOffset="-0.09803921" alphaOffset="-69"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="252" green="254" blue="255" alpha="215" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.09876161" brightnessOffset="0.25490195" alphaOffset="-39"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.5" x2="0.573529411764707" y2="0.5"/>
+                                 <points>
+                                    <point x="-0.058823529411764705" y="1.0294117647058822" cp1x="-0.058823529411764705" cp1y="1.0294117647058822" cp2x="-0.058823529411764705" cp2y="1.0294117647058822"/>
+                                    <point x="0.9705882352941175" y="1.4999999999999987" cp1x="0.9705882352941175" cp1y="1.4999999999999987" cp2x="0.9705882352941175" cp2y="1.4999999999999987"/>
+                                    <point x="1.9411764705882355" y="2.0294117647058822" cp1x="1.9411764705882355" cp1y="2.0294117647058822" cp2x="1.9411764705882355" cp2y="2.0294117647058822"/>
+                                    <point x="1.9411764705882355" y="15.029411764705882" cp1x="1.9411764705882355" cp1y="15.029411764705882" cp2x="1.9411764705882355" cp2y="15.029411764705882"/>
+                                    <point x="-0.058823529411764705" y="15.029411764705882" cp1x="-0.058823529411764705" cp1y="15.029411764705882" cp2x="-0.058823529411764705" cp2y="15.029411764705882"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="160" green="163" blue="165" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.04444444" saturationOffset="-0.080223285" brightnessOffset="-0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.065868266" midpoint="0.5">
+                                       <matte red="217" green="217" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.10588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11377245" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3473054" midpoint="0.5">
+                                       <matte red="236" green="240" blue="243" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.039682567" saturationOffset="-0.081719734" brightnessOffset="0.20784312" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6407186" midpoint="0.5">
+                                       <matte red="229" green="233" blue="237" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07677104" brightnessOffset="0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.92814374" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                    <point x="17.0" y="5.0" cp1x="16.294117647058837" cp1y="1.9705882352941178" cp2x="17.705882352941163" cp2y="8.029411764705882"/>
+                                    <point x="20.0" y="11.0" cp1x="18.0" cp1y="9.058823529411764" cp2x="22.0" cp2y="12.941176470588236"/>
+                                    <point x="25.0" y="14.0" cp1x="25.0" cp1y="14.0" cp2x="25.0" cp2y="14.0"/>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d988b120.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="25" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="90" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-165"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="16.441176470588236" y="2.0" cp1x="15.705882352941176" cp1y="2.0" cp2x="17.176470588235297" cp2y="2.0"/>
+                                    <point x="17.52941176470588" y="6.323529411764706" cp1x="16.617647058823525" cp1y="4.117647058823527" cp2x="18.441176470588236" cp2y="8.529411764705884"/>
+                                    <point x="20.41176470588234" y="11.323529411764707" cp1x="18.05882352941175" cp1y="9.47058823529412" cp2x="22.76470588235293" cp2y="13.176470588235293"/>
+                                    <point x="24.499999999999993" y="14.235294117647056" cp1x="24.499999999999993" cp1y="14.235294117647056" cp2x="24.499999999999993" cp2y="14.235294117647056"/>
+                                    <point x="24.352941176470587" y="14.823529411764707" cp1x="24.352941176470587" cp1y="14.823529411764707" cp2x="24.352941176470587" cp2y="14.823529411764707"/>
+                                    <point x="19.823529411764667" y="11.970588235294116" cp1x="21.382352941176432" cp1y="13.352941176470583" cp2x="18.264705882352903" cp2y="10.588235294117649"/>
+                                    <point x="16.970588235294116" y="7.294117647058823" cp1x="17.76470588235294" cp1y="9.294117647058822" cp2x="16.176470588235293" cp2y="5.294117647058824"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="0"/>
+                                 <paintPoints x1="0.924999994635583" y1="0.9285714285714283" x2="0.9249999986092253" y2="0.004201680672268871"/>
+                                 <points>
+                                    <point x="12.0" y="4.0" cp1x="12.0" cp1y="4.0" cp2x="12.0" cp2y="4.0"/>
+                                    <point x="12.0" y="11.0" cp1x="12.0" cp1y="11.0" cp2x="12.0" cp2y="11.0"/>
+                                    <point x="4.9411764705882355" y="7.499999999999999" cp1x="4.9411764705882355" cp1y="7.499999999999999" cp2x="4.9411764705882355" cp2y="7.499999999999999"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="126" green="131" blue="135" alpha="211" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.037037015" saturationOffset="-0.043859646" brightnessOffset="-0.21568626" alphaOffset="-44"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="252" green="254" blue="255" alpha="77" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.055555522" saturationOffset="-0.09876161" brightnessOffset="0.25490195" alphaOffset="-178"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.5" x2="0.573529411764707" y2="0.5"/>
+                                 <points>
+                                    <point x="-0.058823529411764705" y="1.0294117647058822" cp1x="-0.058823529411764705" cp1y="1.0294117647058822" cp2x="-0.058823529411764705" cp2y="1.0294117647058822"/>
+                                    <point x="0.9705882352941175" y="1.4999999999999987" cp1x="0.9705882352941175" cp1y="1.4999999999999987" cp2x="0.9705882352941175" cp2y="1.4999999999999987"/>
+                                    <point x="1.9411764705882355" y="2.0294117647058822" cp1x="1.9411764705882355" cp1y="2.0294117647058822" cp2x="1.9411764705882355" cp2y="2.0294117647058822"/>
+                                    <point x="1.9411764705882355" y="15.029411764705882" cp1x="1.9411764705882355" cp1y="15.029411764705882" cp2x="1.9411764705882355" cp2y="15.029411764705882"/>
+                                    <point x="-0.058823529411764705" y="15.029411764705882" cp1x="-0.058823529411764705" cp1y="15.029411764705882" cp2x="-0.058823529411764705" cp2y="15.029411764705882"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="126" green="131" blue="135" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.037037015" saturationOffset="-0.043859646" brightnessOffset="-0.21568626" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.065868266" midpoint="0.5">
+                                       <matte red="180" green="185" blue="187" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.06349206" saturationOffset="-0.07309316" brightnessOffset="-0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11377245" midpoint="0.5">
+                                       <matte red="205" green="210" blue="213" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.048611104" saturationOffset="-0.07296763" brightnessOffset="0.09019607" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.3473054" midpoint="0.5">
+                                       <matte red="187" green="193" blue="198" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.03535354" saturationOffset="-0.05497076" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6407186" midpoint="0.5">
+                                       <matte red="180" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.034188032" saturationOffset="-0.043168806" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.92814374" midpoint="0.5">
+                                       <matte red="207" green="213" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.03535354" saturationOffset="-0.0600676" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                    <point x="17.0" y="5.0" cp1x="16.294117647058837" cp1y="1.9705882352941178" cp2x="17.705882352941163" cp2y="8.029411764705882"/>
+                                    <point x="20.0" y="11.0" cp1x="18.0" cp1y="9.058823529411764" cp2x="22.0" cp2y="12.941176470588236"/>
+                                    <point x="25.0" y="14.0" cp1x="25.0" cp1y="14.0" cp2x="25.0" cp2y="14.0"/>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                    <point x="0.0" y="15.0" cp1x="0.0" cp1y="15.0" cp2x="0.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="25.0" y="15.0" cp1x="25.0" cp1y="15.0" cp2x="25.0" cp2y="15.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d98aee62.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </foregroundStates>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <region name="ScrollBarThumb" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="38" height="15"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="15" right="15"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="0" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="-255"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.940909090909089" y1="0.03592814412291934" x2="0.5954545454545457" y2="0.26347304548015776"/>
+                                 <points>
+                                    <point x="37.04545454545455" y="0.0" cp1x="37.04545454545455" cp1y="0.0" cp2x="37.04545454545455" cp2y="0.0"/>
+                                    <point x="32.04545454545455" y="0.0" cp1x="32.04545454545455" cp1y="0.0" cp2x="32.04545454545455" cp2y="0.0"/>
+                                    <point x="34.681818181818194" y="2.0" cp1x="34.00000000000002" cp1y="0.7727272727272729" cp2x="35.36363636363637" cp2y="3.227272727272727"/>
+                                    <point x="35.59090909090908" y="7.590909090909094" cp1x="35.59090909090908" cp1y="7.590909090909094" cp2x="35.59090909090908" cp2y="7.590909090909094"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="29.363636363636367" y="7.681818181818182" cp1x="29.363636363636367" cp1y="7.681818181818182" cp2x="29.363636363636367" cp2y="7.681818181818182"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="129" green="148" blue="165" alpha="33" uiDefaultParentName="nimbusBase" hueOffset="5.2034855E-5" saturationOffset="-0.41753247" brightnessOffset="0.09803921" alphaOffset="-222"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.06818181818181814" y1="-0.005952381053749398" x2="0.36890908871182554" y2="0.23929171756874906"/>
+                                 <points>
+                                    <point x="6.0" y="0.0" cp1x="6.0" cp1y="0.0" cp2x="6.0" cp2y="0.0"/>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="2.4090909090909083" y="7.636363636363642" cp1x="2.4090909090909083" cp1y="7.636363636363642" cp2x="2.4090909090909083" cp2y="7.636363636363642"/>
+                                    <point x="3.0000000000000004" y="2.0454545454545503" cp1x="2.045454545454544" cp1y="3.5909090909090975" cp2x="3.954545454545457" cp2y="0.5000000000000031"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.038922157" midpoint="0.5">
+                                       <matte red="183" green="194" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.53277314" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06287425" midpoint="0.5">
+                                       <matte red="252" green="253" blue="253" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.07865167" saturationOffset="-0.6317617" brightnessOffset="0.44313723" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.32934132" midpoint="0.5">
+                                       <matte red="168" green="189" blue="208" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44340658" brightnessOffset="0.26666665" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6497006" midpoint="0.5">
+                                       <matte red="197" green="218" blue="237" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4669379" brightnessOffset="0.38039213" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="237" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.07865167" saturationOffset="-0.56512606" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="1.0" cp1x="1.0" cp1y="1.0" cp2x="0.9545454545454546" cp2y="9.45454545454545"/>
+                                    <point x="15.0" y="14.0" cp1x="9.136363636363646" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="23.0" y="14.0" cp1x="23.0" cp1y="14.0" cp2x="28.909090909090935" cp2y="13.999999999999996"/>
+                                    <point x="37.0" y="1.0" cp1x="36.95454545454545" cp1y="9.36363636363636" cp2x="37.0" cp2y="1.0"/>
+                                    <point x="37.0" y="0.0" cp1x="37.0" cp1y="0.0" cp2x="37.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="9" green="30" blue="49" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="0.18061227" brightnessOffset="-0.35686278" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="54" green="75" blue="94" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.21018237" brightnessOffset="-0.18039218" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="7.0"/>
+                                    <point x="15.0" y="15.0" cp1x="5.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="23.0" y="15.0" cp1x="23.0" cp1y="15.0" cp2x="33.0" cp2y="15.0"/>
+                                    <point x="38.0" y="1.0" cp1x="38.0" cp1y="7.0" cp2x="38.0" cp2y="1.0"/>
+                                    <point x="38.0" y="0.0" cp1x="38.0" cp1y="0.0" cp2x="38.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113e6a24589.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="38" height="15"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="15" right="15"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="0" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="-255"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.940909090909089" y1="0.03592814412291934" x2="0.5954545454545457" y2="0.26347304548015776"/>
+                                 <points>
+                                    <point x="37.04545454545455" y="0.0" cp1x="37.04545454545455" cp1y="0.0" cp2x="37.04545454545455" cp2y="0.0"/>
+                                    <point x="32.04545454545455" y="0.0" cp1x="32.04545454545455" cp1y="0.0" cp2x="32.04545454545455" cp2y="0.0"/>
+                                    <point x="34.681818181818194" y="2.0" cp1x="34.00000000000002" cp1y="0.7727272727272729" cp2x="35.36363636363637" cp2y="3.227272727272727"/>
+                                    <point x="35.59090909090908" y="7.590909090909094" cp1x="35.59090909090908" cp1y="7.590909090909094" cp2x="35.59090909090908" cp2y="7.590909090909094"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="29.363636363636367" y="7.681818181818182" cp1x="29.363636363636367" cp1y="7.681818181818182" cp2x="29.363636363636367" cp2y="7.681818181818182"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="129" green="148" blue="165" alpha="33" uiDefaultParentName="nimbusBase" hueOffset="5.2034855E-5" saturationOffset="-0.41753247" brightnessOffset="0.09803921" alphaOffset="-222"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.06818181818181814" y1="-0.005952381053749398" x2="0.36890908871182554" y2="0.23929171756874906"/>
+                                 <points>
+                                    <point x="6.0" y="0.0" cp1x="6.0" cp1y="0.0" cp2x="6.0" cp2y="0.0"/>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="2.4090909090909083" y="7.636363636363642" cp1x="2.4090909090909083" cp1y="7.636363636363642" cp2x="2.4090909090909083" cp2y="7.636363636363642"/>
+                                    <point x="3.0000000000000004" y="2.0454545454545503" cp1x="2.045454545454544" cp1y="3.5909090909090975" cp2x="3.954545454545457" cp2y="0.5000000000000031"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.038922157" midpoint="0.5">
+                                       <matte red="189" green="196" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.5621849" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06287425" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.32934132" midpoint="0.5">
+                                       <matte red="187" green="208" blue="227" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.45950285" brightnessOffset="0.34117645" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6497006" midpoint="0.5">
+                                       <matte red="216" green="237" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.48277313" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="1.0" cp1x="1.0" cp1y="1.0" cp2x="0.9545454545454546" cp2y="9.45454545454545"/>
+                                    <point x="15.0" y="14.0" cp1x="9.136363636363646" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="23.0" y="14.0" cp1x="23.0" cp1y="14.0" cp2x="28.909090909090935" cp2y="13.999999999999996"/>
+                                    <point x="37.0" y="1.0" cp1x="36.95454545454545" cp1y="9.36363636363636" cp2x="37.0" cp2y="1.0"/>
+                                    <point x="37.0" y="0.0" cp1x="37.0" cp1y="0.0" cp2x="37.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="9" green="30" blue="49" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="0.18061227" brightnessOffset="-0.35686278" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="54" green="75" blue="94" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.21018237" brightnessOffset="-0.18039218" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="7.0"/>
+                                    <point x="15.0" y="15.0" cp1x="5.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="23.0" y="15.0" cp1x="23.0" cp1y="15.0" cp2x="33.0" cp2y="15.0"/>
+                                    <point x="38.0" y="1.0" cp1x="38.0" cp1y="7.0" cp2x="38.0" cp2y="1.0"/>
+                                    <point x="38.0" y="0.0" cp1x="38.0" cp1y="0.0" cp2x="38.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1141ec296f1.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="38" height="15"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="15" right="15"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="36" green="42" blue="48" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.3857143" brightnessOffset="-0.36078435" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="104" green="125" blue="143" alpha="0" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.362987" brightnessOffset="0.011764705" alphaOffset="-255"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.940909090909089" y1="0.03592814412291934" x2="0.3761563291933634" y2="0.3491017889731149"/>
+                                 <points>
+                                    <point x="37.04545454545455" y="0.0" cp1x="37.04545454545455" cp1y="0.0" cp2x="37.04545454545455" cp2y="0.0"/>
+                                    <point x="31.34545454545454" y="0.0" cp1x="31.34545454545454" cp1y="0.0" cp2x="31.34545454545454" cp2y="0.0"/>
+                                    <point x="34.38181818181821" y="2.0999999999999996" cp1x="33.70000000000004" cp1y="0.872727272727273" cp2x="35.063636363636384" cp2y="3.3272727272727267"/>
+                                    <point x="35.59090909090908" y="7.590909090909094" cp1x="35.59090909090908" cp1y="7.590909090909094" cp2x="35.59090909090908" cp2y="7.590909090909094"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="29.363636363636367" y="7.681818181818182" cp1x="29.363636363636367" cp1y="7.681818181818182" cp2x="29.363636363636367" cp2y="7.681818181818182"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="39" green="47" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.3579365" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="129" green="148" blue="165" alpha="33" uiDefaultParentName="nimbusBase" hueOffset="5.2034855E-5" saturationOffset="-0.41753247" brightnessOffset="0.09803921" alphaOffset="-222"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.06818181818181814" y1="-0.005952381053749398" x2="0.36890908871182554" y2="0.23929171756874906"/>
+                                 <points>
+                                    <point x="6.0" y="0.0" cp1x="6.0" cp1y="0.0" cp2x="6.0" cp2y="0.0"/>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="2.4090909090909083" y="7.636363636363642" cp1x="2.4090909090909083" cp1y="7.636363636363642" cp2x="2.4090909090909083" cp2y="7.636363636363642"/>
+                                    <point x="3.0000000000000004" y="2.0454545454545503" cp1x="2.045454545454544" cp1y="3.5909090909090975" cp2x="3.954545454545457" cp2y="0.5000000000000031"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.038922157" midpoint="0.5">
+                                       <matte red="89" green="113" blue="136" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.002908647" saturationOffset="-0.29012606" brightnessOffset="-0.015686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06287425" midpoint="0.5">
+                                       <matte red="151" green="175" blue="196" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.40612245" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.32934132" midpoint="0.5">
+                                       <matte red="55" green="102" blue="144" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.01765871" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6497006" midpoint="0.5">
+                                       <matte red="86" green="133" blue="175" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.12714285" brightnessOffset="0.1372549" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="131" green="177" blue="220" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018727183" saturationOffset="-0.23116884" brightnessOffset="0.31372547" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="1.0" cp1x="1.0" cp1y="1.0" cp2x="0.9545454545454546" cp2y="9.45454545454545"/>
+                                    <point x="15.0" y="14.0" cp1x="9.136363636363646" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                    <point x="23.0" y="14.0" cp1x="23.0" cp1y="14.0" cp2x="28.909090909090935" cp2y="13.999999999999996"/>
+                                    <point x="37.0" y="1.0" cp1x="36.95454545454545" cp1y="9.36363636363636" cp2x="37.0" cp2y="1.0"/>
+                                    <point x="37.0" y="0.0" cp1x="37.0" cp1y="0.0" cp2x="37.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="4" green="30" blue="54" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="0.29021162" brightnessOffset="-0.33725494" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="1.0" cp1x="0.0" cp1y="1.0" cp2x="0.0" cp2y="7.0"/>
+                                    <point x="15.0" y="15.0" cp1x="5.0" cp1y="15.0" cp2x="15.0" cp2y="15.0"/>
+                                    <point x="23.0" y="15.0" cp1x="23.0" cp1y="15.0" cp2x="33.0" cp2y="15.0"/>
+                                    <point x="38.0" y="1.0" cp1x="38.0" cp1y="7.0" cp2x="38.0" cp2y="1.0"/>
+                                    <point x="38.0" y="0.0" cp1x="38.0" cp1y="0.0" cp2x="38.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114d984fa41.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <region name="ScrollBarTrack" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="15"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="18.0" y1="0.0" y2="15.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.016129032" midpoint="0.5">
+                                       <matte red="191" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.10016362" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.061290324" midpoint="0.49019608">
+                                       <matte red="197" green="198" blue="199" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.100476064" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.26451612" midpoint="0.27979276">
+                                       <matte red="223" green="223" blue="224" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10606203" brightnessOffset="0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88387096" midpoint="0.5">
+                                       <matte red="253" green="253" blue="253" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140138e9be.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="34" height="15"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="10" right="9"/>
+                        <layer name="Layer 2">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="160" green="163" blue="167" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.06861015" brightnessOffset="-0.09019607" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="201" green="204" blue="210" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="0.07843137" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.8645834554400952" y1="0.20952380952380953" x2="0.020833188460903894" y2="0.9523809523809526"/>
+                                 <points>
+                                    <point x="25.99999999999998" y="13.499999999999998" cp1x="25.571428571428548" cp1y="12.85714285714286" cp2x="26.42857142857141" cp2y="14.142857142857137"/>
+                                    <point x="30.642857142857142" y="10.999999999999996" cp1x="29.07142857142857" cp1y="12.642857142857135" cp2x="32.214285714285715" cp2y="9.357142857142858"/>
+                                    <point x="32.57142857142857" y="6.928571428571431" cp1x="33.28571428571429" cp1y="7.5714285714285765" cp2x="31.857142857142847" cp2y="6.285714285714285"/>
+                                    <point x="29.71428571428571" y="10.285714285714285" cp1x="30.428571428571423" cp1y="9.42857142857143" cp2x="29.0" cp2y="11.142857142857139"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="155" green="158" blue="162" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.06731644" brightnessOffset="-0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="209" green="212" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06924191" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.12719298862023998" y1="0.1315789407640286" x2="0.907894728916834" y2="0.8771929886202403"/>
+                                 <points>
+                                    <point x="1.1428571428571428" y="6.857142857142858" cp1x="0.3571428571428572" cp1y="7.428571428571431" cp2x="1.9285714285714284" cp2y="6.285714285714285"/>
+                                    <point x="4.642857142857142" y="10.35714285714286" cp1x="3.285714285714285" cp1y="8.78571428571429" cp2x="6.0" cp2y="11.928571428571429"/>
+                                    <point x="8.714285714285712" y="13.64285714285714" cp1x="8.928571428571425" cp1y="12.64285714285714" cp2x="8.499999999999998" cp2y="14.64285714285714"/>
+                                    <point x="3.5714285714285707" y="11.571428571428573" cp1x="5.071428571428571" cp1y="13.214285714285719" cp2x="2.0714285714285703" cp2y="9.928571428571427"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.87096775">
+                                       <matte red="60" green="61" blue="62" alpha="0" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.07826825" brightnessOffset="-0.5019608" alphaOffset="-255"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="56" green="57" blue="59" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.05967886" brightnessOffset="-0.5137255" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="-0.045918367346938736" y1="0.1833642539170922" x2="0.8724489795918368" y2="0.040507111059949225"/>
+                                 <points>
+                                    <point x="34.0" y="0.0" cp1x="34.0" cp1y="0.0" cp2x="34.0" cp2y="0.0"/>
+                                    <point x="27.0" y="0.0" cp1x="27.0" cp1y="0.0" cp2x="27.0" cp2y="0.0"/>
+                                    <point x="27.0" y="14.0" cp1x="27.0" cp1y="14.0" cp2x="27.0" cp2y="14.0"/>
+                                    <point x="31.07142857142855" y="10.928571428571425" cp1x="30.07142857142855" cp1y="11.928571428571425" cp2x="32.071428571428555" cp2y="9.928571428571425"/>
+                                    <point x="34.0" y="6.0" cp1x="34.0" cp1y="6.0" cp2x="34.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.1">
+                                       <matte red="56" green="57" blue="59" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.05967886" brightnessOffset="-0.5137255" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="56" green="57" blue="59" alpha="0" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.05967886" brightnessOffset="-0.5137255" alphaOffset="-255"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.0" x2="0.9285714285714282" y2="0.12244897959183673"/>
+                                 <points>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="6.0" cp1x="0.0" cp1y="6.0" cp2x="0.0" cp2y="6.0"/>
+                                    <point x="3.0" y="11.0" cp1x="2.0" cp1y="10.0" cp2x="4.0" cp2y="12.0"/>
+                                    <point x="6.785714285714284" y="13.999999999999995" cp1x="6.785714285714284" cp1y="13.999999999999995" cp2x="6.785714285714284" cp2y="13.999999999999995"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="34.0" y1="0.0" y2="15.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="105" blue="109" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.02222228" saturationOffset="-0.06465475" brightnessOffset="-0.31764707" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.061290324" midpoint="0.5">
+                                       <matte red="134" green="136" blue="140" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06766917" brightnessOffset="-0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13225806" midpoint="0.5">
+                                       <matte red="170" green="173" blue="178" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0655825" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.30967742" midpoint="0.32105264">
+                                       <matte red="195" green="197" blue="203" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.071117446" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.82258064" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140122fb90.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JScrollPane" name="ScrollPane" ui="ScrollPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="3" bottom="3" left="3" right="3"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="useChildTextComponentFocus" type="BOOLEAN" value="true"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Enabled+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="2.0" y="22.0" cp1x="2.0" cp1y="22.0" cp2x="2.0" cp2y="22.0"/>
+                              <point x="120.0" y="22.0" cp1x="120.0" cp1y="22.0" cp2x="120.0" cp2y="22.0"/>
+                              <point x="120.0" y="2.0" cp1x="120.0" cp1y="2.0" cp2x="120.0" cp2y="2.0"/>
+                              <point x="121.4" y="2.0" cp1x="121.5" cp1y="2.0" cp2x="121.5" cp2y="2.0"/>
+                              <point x="121.4" y="23.4" cp1x="121.4" cp1y="23.4" cp2x="121.4" cp2y="23.4"/>
+                              <point x="0.6" y="23.4" cp1x="0.6" cp1y="23.4" cp2x="0.6" cp2y="23.4"/>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="121.4" y="0.6" cp1x="121.4" cp1y="0.6" cp2x="121.4" cp2y="0.6"/>
+                              <point x="121.4" y="2.0" cp1x="121.4" cp1y="2.0" cp2x="121.4" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="2.0" y2="3.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="2.0" y2="3.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JViewport" name="Viewport" ui="ViewportUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JSlider" name="Slider" ui="SliderUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="MouseOver"/>
+            <stateType key="Pressed"/>
+            <stateType key="Disabled"/>
+            <stateType key="Focused"/>
+            <stateType key="Selected"/>
+            <stateType key="ArrowShape">
+               <codeSnippet><![CDATA[ return c.getClientProperty("Slider.paintThumbArrowShape") == Boolean.TRUE; ]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties>
+               <uiProperty name="thumbWidth" type="INT" value="17"/>
+               <uiProperty name="thumbHeight" type="INT" value="17"/>
+               <uiProperty name="trackBorder" type="INT" value="0"/>
+               <uiProperty name="paintValue" type="BOOLEAN" value="false"/>
+               <uiProperty name="tickColor" type="COLOR">
+                  <matte red="35" green="40" blue="48" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="SliderThumb" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="221" green="225" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.5924243" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="208" green="214" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56844974" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5023510971786834" y1="0.0015673981191222587" x2="0.5023510971786838" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="190" green="196" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.5625436" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="173" green="180" blue="189" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.015098333" saturationOffset="-0.55105823" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.510610079575597" y1="-4.553649124439119E-18" x2="0.4993368700265251" y2="1.0039787798408488"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ea2c125.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="249" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.6238095" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="184" green="205" blue="224" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.45714286" brightnessOffset="0.32941175" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0015673981191222587" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="36" green="57" blue="75" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.11571431" brightnessOffset="-0.25490198" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.51" y1="-4.553649124439119E-18" x2="0.51" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="3.0" y2="16.0">
+                                 <matte red="111" green="116" blue="125" alpha="99" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.003968239" saturationOffset="0.0014736876" brightnessOffset="-0.25490198" alphaOffset="-156"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139e25a3ea.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="249" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.6238095" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="184" green="205" blue="224" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.45714286" brightnessOffset="0.32941175" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0015673981191222587" x2="0.5" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="36" green="57" blue="75" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.11571431" brightnessOffset="-0.25490198" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.51" y1="-4.553649124439119E-18" x2="0.51" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="16.4" y1="0.6" y2="16.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="252" blue="253" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.62780917" brightnessOffset="0.44313723" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="185" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.4653107" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="183" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4563421" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="201" green="222" blue="240" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4732143" brightnessOffset="0.39215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5023510971786834" y1="0.0015673981191222587" x2="0.5023510971786838" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="53" green="80" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0038217902" saturationOffset="-0.15532213" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.510610079575597" y1="-4.553649124439119E-18" x2="0.4993368700265251" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="16.4" y1="0.6" y2="16.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ea4a6e6.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused+Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="166" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.44943976" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.47593582" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5962567" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="83" green="129" blue="171" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.121094406" brightnessOffset="0.12156862" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5023510971786834" y1="0.0015673981191222587" x2="0.5023510971786838" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="38" green="66" blue="92" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.04875779" brightnessOffset="-0.18823531" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.510610079575597" y1="-4.553649124439119E-18" x2="0.4993368700265251" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="0.6" x2="16.4" y1="0.6" y2="16.4">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ea77546.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="252" blue="253" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.62780917" brightnessOffset="0.44313723" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="185" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.4653107" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="183" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4563421" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="201" green="222" blue="240" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4732143" brightnessOffset="0.39215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5023510971786834" y1="0.0015673981191222587" x2="0.5023510971786838" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="53" green="80" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0038217902" saturationOffset="-0.15532213" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.510610079575597" y1="-4.553649124439119E-18" x2="0.4993368700265251" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="3.0" y2="16.0">
+                                 <matte red="111" green="116" blue="125" alpha="99" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.003968239" saturationOffset="0.0014736876" brightnessOffset="-0.25490198" alphaOffset="-156"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ea4a6e6.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <ellipse x1="3.0" x2="14.0" y1="3.0" y2="14.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="166" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.44943976" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.47593582" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5962567" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="83" green="129" blue="171" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.121094406" brightnessOffset="0.12156862" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5023510971786834" y1="0.0015673981191222587" x2="0.5023510971786838" y2="1.0"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="2.0" y2="15.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="38" green="66" blue="92" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.04875779" brightnessOffset="-0.18823531" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.510610079575597" y1="-4.553649124439119E-18" x2="0.4993368700265251" y2="1.0039787798408488"/>
+                              </ellipse>
+                              <ellipse x1="2.0" x2="15.0" y1="3.0" y2="16.0">
+                                 <matte red="255" green="255" blue="255" alpha="134" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-121"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </ellipse>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ea77546.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.061290324" midpoint="0.5">
+                                       <matte red="248" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.62376213" brightnessOffset="0.4352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.14193548" midpoint="0.5">
+                                       <matte red="232" green="237" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.594392" brightnessOffset="0.39999998" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46129033" midpoint="0.5">
+                                       <matte red="166" green="187" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4454704" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7354839" midpoint="0.5">
+                                       <matte red="191" green="212" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8516129" midpoint="0.5">
+                                       <matte red="208" green="229" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47442397" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="121" blue="135" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0033828616" saturationOffset="-0.40608466" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.48064515" midpoint="0.5">
+                                       <matte red="47" green="68" blue="87" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.17594418" brightnessOffset="-0.20784315" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="32" green="50" blue="67" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.11332625" brightnessOffset="-0.28627452" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="150" green="156" blue="168" alpha="146" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="4.083333333333332" y="2.503787878787879" cp1x="2.2198078146656997" cp1y="2.872783314232221" cp2x="5.647660212943894" cp2y="2.194036564766758"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="16.020900857276246" cp1y="8.817054690620388" cp2x="15.621858714169313" cp2y="12.005103372910728"/>
+                                    <point x="3.5031818181818175" y="15.846818181818183" cp1x="8.071309735244107" cp1y="15.840803266669884" cp2x="-0.020213740918331703" cp2y="15.85145748389261"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="221" green="225" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.5924243" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="208" green="214" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56844974" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="190" green="196" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.5625436" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="173" green="180" blue="189" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.015098333" saturationOffset="-0.55105823" brightnessOffset="0.19215685" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="252" blue="253" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.62780917" brightnessOffset="0.44313723" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="185" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.4653107" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="183" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4563421" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="201" green="222" blue="240" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4732143" brightnessOffset="0.39215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="53" green="80" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0038217902" saturationOffset="-0.15532213" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="150" green="156" blue="168" alpha="146" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="4.083333333333332" y="2.503787878787879" cp1x="2.2198078146656997" cp1y="2.872783314232221" cp2x="5.647660212943894" cp2y="2.194036564766758"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="16.020900857276246" cp1y="8.817054690620388" cp2x="15.621858714169313" cp2y="12.005103372910728"/>
+                                    <point x="3.5031818181818175" y="15.846818181818183" cp1x="8.071309735244107" cp1y="15.840803266669884" cp2x="-0.020213740918331703" cp2y="15.85145748389261"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="166" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.44943976" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.47593582" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5962567" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="83" green="129" blue="171" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.121094406" brightnessOffset="0.12156862" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="38" green="66" blue="92" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.04875779" brightnessOffset="-0.18823531" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="150" green="156" blue="168" alpha="146" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="4.083333333333332" y="2.503787878787879" cp1x="2.2198078146656997" cp1y="2.872783314232221" cp2x="5.647660212943894" cp2y="2.194036564766758"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="16.020900857276246" cp1y="8.817054690620388" cp2x="15.621858714169313" cp2y="12.005103372910728"/>
+                                    <point x="3.5031818181818175" y="15.846818181818183" cp1x="8.071309735244107" cp1y="15.840803266669884" cp2x="-0.020213740918331703" cp2y="15.85145748389261"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.061290324" midpoint="0.5">
+                                       <matte red="248" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.62376213" brightnessOffset="0.4352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.14193548" midpoint="0.5">
+                                       <matte red="232" green="237" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.594392" brightnessOffset="0.39999998" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.46129033" midpoint="0.5">
+                                       <matte red="166" green="187" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4454704" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7354839" midpoint="0.5">
+                                       <matte red="191" green="212" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8516129" midpoint="0.5">
+                                       <matte red="208" green="229" blue="248" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47442397" brightnessOffset="0.4235294" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4925773044082732" y1="0.08201986267797506" x2="0.4925773044082731" y2="0.9179801373220249"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="104" green="121" blue="135" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0033828616" saturationOffset="-0.40608466" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.48064515" midpoint="0.5">
+                                       <matte red="47" green="68" blue="87" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.17594418" brightnessOffset="-0.20784315" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="32" green="50" blue="67" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.11332625" brightnessOffset="-0.28627452" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0029761904761894" y="0.5863771645021645" cp1x="1.139450671808557" cp1y="0.9553725999465068" cp2x="4.5673030700867505" cp2y="0.27662585048104366"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="15.967133116737259" cp1y="8.093702027571416" cp2x="15.955362732066009" cp2y="11.267800824067251"/>
+                                    <point x="3.5031818181818175" y="16.34681818181818" cp1x="6.274868164827076" cp1y="16.33784359983059" cp2x="-0.25171732582327255" cp2y="16.358976357747352"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused+MouseOver+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="252" blue="253" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.62780917" brightnessOffset="0.44313723" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.42513368" midpoint="0.5">
+                                       <matte red="185" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.4653107" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.69786096" midpoint="0.5">
+                                       <matte red="183" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4563421" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="201" green="222" blue="240" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4732143" brightnessOffset="0.39215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="53" green="80" blue="102" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0038217902" saturationOffset="-0.15532213" brightnessOffset="-0.14901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0029761904761894" y="0.5863771645021645" cp1x="1.139450671808557" cp1y="0.9553725999465068" cp2x="4.5673030700867505" cp2y="0.27662585048104366"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="15.967133116737259" cp1y="8.093702027571416" cp2x="15.955362732066009" cp2y="11.267800824067251"/>
+                                    <point x="3.5031818181818175" y="16.34681818181818" cp1x="6.274868164827076" cp1y="16.33784359983059" cp2x="-0.25171732582327255" cp2y="16.358976357747352"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused+Pressed+ArrowShape">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="17" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="166" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.44943976" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.47593582" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5962567" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="83" green="129" blue="171" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.121094406" brightnessOffset="0.12156862" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="4.027803030303029" y="3.004848484848486" cp1x="3.032649021149256" cp1y="4.6674981382317355" cp2x="4.536011975539247" cp2y="2.155760385045938"/>
+                                    <point x="13.846363636363638" y="9.291818181818181" cp1x="13.849548242977425" cp1y="8.685129924076254" cp2x="13.842473440242545" cp2y="10.03292582656201"/>
+                                    <point x="3.9727272727272753" y="13.966363636363635" cp1x="4.359824654142523" cp1y="15.207145646334764" cp2x="3.5863614419930605" cp2y="12.727926501268922"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="1" green="1" blue="1" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54509807" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="38" green="66" blue="92" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.04875779" brightnessOffset="-0.18823531" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="3.077651515151513" y="14.977272727272723" cp1x="2.3276635759026876" cp1y="13.892921695242634" cp2x="3.9874604605873967" cp2y="16.29269690585581"/>
+                                    <point x="15.07575757575758" y="9.278409090909093" cp1x="15.090346383854083" cp1y="10.207961161875609" cp2x="15.062102395509116" cp2y="8.408344792618548"/>
+                                    <point x="3.046195652173914" y="2.035820158102767" cp1x="4.019189127078684" cp1y="0.6109557613825192" cp2x="2.297674764597527" cp2y="3.1319639559976284"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="3.0029761904761894" y="0.5863771645021645" cp1x="1.139450671808557" cp1y="0.9553725999465068" cp2x="4.5673030700867505" cp2y="0.27662585048104366"/>
+                                    <point x="15.962727272727284" y="9.281818181818181" cp1x="15.967133116737259" cp1y="8.093702027571416" cp2x="15.955362732066009" cp2y="11.267800824067251"/>
+                                    <point x="3.5031818181818175" y="16.34681818181818" cp1x="6.274868164827076" cp1y="16.33784359983059" cp2x="-0.25171732582327255" cp2y="16.358976357747352"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <region name="SliderTrack" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>2.0</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="23" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.4705882352941173" x2="21.529411764705873" y1="7.0" y2="11.0" rounding="3.999999999999999">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="196" green="200" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.061982628" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.27540106" midpoint="0.5">
+                                       <matte red="201" green="205" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.058639523" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="206" green="209" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.059835073" brightnessOffset="0.10588235" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="23.0" y1="6.0" y2="11.0" rounding="4.941176470588243">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="193" green="196" blue="203" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.061265234" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="206" green="209" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.059835073" brightnessOffset="0.10588235" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.07647058823529412" x2="0.25" y2="0.9117647058823533"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="22.0" y1="9.0" y2="16.0" rounding="8.705882352941174">
+                                 <matte red="255" green="255" blue="255" alpha="10" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-245"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139e90e32c.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="23" height="17"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.441176470588235" x2="21.49999999999999" y1="7.0" y2="11.0" rounding="3.999999999999999">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="155" green="160" blue="168" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.03314536" brightnessOffset="-0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.27540106" midpoint="0.5">
+                                       <matte red="172" green="176" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.004273474" saturationOffset="-0.040256046" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7058824" midpoint="0.5">
+                                       <matte red="187" green="192" blue="202" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.03626889" brightnessOffset="0.04705882" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="23.0" y1="6.0" y2="11.0" rounding="4.941176470588243">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="145" green="149" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.034093194" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="158" green="162" blue="173" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01111114" saturationOffset="-0.023821115" brightnessOffset="-0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.07647058823529412" x2="0.25" y2="0.9117647058823533"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="22.0" y1="9.0" y2="12.0" rounding="8.705882352941174">
+                                 <matte red="255" green="255" blue="255" alpha="144" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-111"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139e0a2168.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JSpinner" name="Spinner" ui="SpinnerUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="false" componentName="Spinner.editor" type="javax.swing.JPanel" name="Panel" ui="PanelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates/>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" type="javax.swing.JFormattedTextField" name="FormattedTextField" ui="FormattedTextFieldUI" subregion="true" key="Panel:&quot;Spinner.formattedTextField&quot;">
+               <stateTypes/>
+               <contentMargins top="6" bottom="5" left="6" right="6"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.016586483" saturationOffset="-0.6051466" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.040395975" saturationOffset="-0.60315615" brightnessOffset="0.29411763" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="222" blue="227" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07968931" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="1.0" x2="0.5" y2="0.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="202" green="204" blue="209" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07703349" brightnessOffset="0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.1684492">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105624355" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="196" green="196" blue="194" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.08" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.1684492">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105624355" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.6666666666666666" x2="63.91666666666666" y1="0.6666666666666666" y2="23.249999999999996" rounding="0.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.1684492">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105624355" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="196" green="196" blue="194" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.08" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="22.0" y2="23.0" rounding="0.0">
+                                 <matte red="0" green="0" blue="0" alpha="18" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.74509805" alphaOffset="-237"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="64" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="3" right="1"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="64.0" y1="5.0" y2="21.0" rounding="0.0">
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="5.0" y2="22.0" rounding="0.0">
+                                 <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="64.0" y1="3.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.1684492">
+                                       <matte red="203" green="203" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105624355" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="64.0" y1="2.0" y2="5.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.99147725" midpoint="0.5">
+                                       <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.6666666666666666" x2="63.91666666666666" y1="0.6666666666666666" y2="23.249999999999996" rounding="0.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" componentName="Spinner.previousButton" type="javax.swing.plaf.synth.SynthArrowButton" name="ArrowButton" ui="SynthArrowButtonUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties>
+                     <uiProperty name="size" type="INT" value="20"/>
+                  </uiproperties>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="212" green="217" blue="224" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.018570602" saturationOffset="-0.5821429" brightnessOffset="0.32941175" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="204" green="210" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56722116" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="206" green="212" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.567841" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="184" green="191" blue="200" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.015098333" saturationOffset="-0.5557143" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="178" green="185" blue="193" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.55799407" brightnessOffset="0.20784312" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3d47f23.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="204" green="215" blue="226" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5383692" brightnessOffset="0.33725488" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="165" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.44453782" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="191" green="212" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="66" green="87" blue="106" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.2583558" brightnessOffset="-0.13333336" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="100" green="104" blue="112" alpha="107" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.0033834577" brightnessOffset="-0.30588236" alphaOffset="-148"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="0.0" y="11.0" cp1x="0.0" cp1y="11.0" cp2x="0.0" cp2y="11.0"/>
+                                    <point x="13.227272727272727" y="11.0" cp1x="13.227272727272727" cp1y="11.0" cp2x="15.340909090909106" cp2y="11.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="9.0" cp2x="18.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3b7c40b.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="204" green="215" blue="226" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.5383692" brightnessOffset="0.33725488" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="165" green="186" blue="204" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.44453782" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="191" green="212" blue="231" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4625541" brightnessOffset="0.35686272" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="66" green="87" blue="106" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.2583558" brightnessOffset="-0.13333336" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="34" green="55" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.095173776" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="11.4" cp1x="0.0" cp1y="11.4" cp2x="0.0" cp2y="11.4"/>
+                                    <point x="14.4" y="11.4" cp1x="14.4" cp1y="11.4" cp2x="17.4" cp2y="11.4"/>
+                                    <point x="19.4" y="7.4" cp1x="19.4" cp1y="10.4" cp2x="19.4" cp2y="7.4"/>
+                                    <point x="19.4" y="0.0" cp1x="19.4" cp1y="0.0" cp2x="19.4" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="221" green="233" blue="244" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0010585189" saturationOffset="-0.541452" brightnessOffset="0.4078431" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="184" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.00254488" saturationOffset="-0.4608264" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="210" green="231" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4757143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="19" green="45" blue="69" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="0.088923395" brightnessOffset="-0.2784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="11.4" cp1x="0.0" cp1y="11.4" cp2x="0.0" cp2y="11.4"/>
+                                    <point x="14.4" y="11.4" cp1x="14.4" cp1y="11.4" cp2x="17.4" cp2y="11.4"/>
+                                    <point x="19.4" y="7.4" cp1x="19.4" cp1y="10.4" cp2x="19.4" cp2y="7.4"/>
+                                    <point x="19.4" y="0.0" cp1x="19.4" cp1y="0.0" cp2x="19.4" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="107" green="141" blue="172" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.354783E-4" saturationOffset="-0.2578073" brightnessOffset="0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="54" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.01599598" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="53" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="89" green="135" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.13853917" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="5" blue="31" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.061133325" saturationOffset="0.3642857" brightnessOffset="-0.427451" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="11.4" cp1x="0.0" cp1y="11.4" cp2x="0.0" cp2y="11.4"/>
+                                    <point x="14.4" y="11.4" cp1x="14.4" cp1y="11.4" cp2x="17.4" cp2y="11.4"/>
+                                    <point x="19.4" y="7.4" cp1x="19.4" cp1y="10.4" cp2x="19.4" cp2y="7.4"/>
+                                    <point x="19.4" y="0.0" cp1x="19.4" cp1y="0.0" cp2x="19.4" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="221" green="233" blue="244" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0010585189" saturationOffset="-0.541452" brightnessOffset="0.4078431" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="184" green="204" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.00254488" saturationOffset="-0.4608264" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="210" green="231" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4757143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="19" green="45" blue="69" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="0.088923395" brightnessOffset="-0.2784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="5" blue="29" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.059279382" saturationOffset="0.3642857" brightnessOffset="-0.43529415" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="28" green="28" blue="28" alpha="76" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.63529414" alphaOffset="-179"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="0.0" y="11.0" cp1x="0.0" cp1y="11.0" cp2x="0.0" cp2y="11.0"/>
+                                    <point x="13.227272727272727" y="11.0" cp1x="13.227272727272727" cp1y="11.0" cp2x="15.340909090909106" cp2y="11.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="9.0" cp2x="18.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3d6c675.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="107" green="141" blue="172" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.354783E-4" saturationOffset="-0.2578073" brightnessOffset="0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.11497326" midpoint="0.5">
+                                       <matte red="54" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.01599598" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.36898395" midpoint="0.5">
+                                       <matte red="53" green="100" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.00895375" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="89" green="135" blue="177" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="8.9377165E-4" saturationOffset="-0.13853917" brightnessOffset="0.14509803" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                    <point x="1.0" y="9.0" cp1x="1.0" cp1y="9.0" cp2x="1.0" cp2y="9.0"/>
+                                    <point x="14.0" y="9.0" cp1x="14.0" cp1y="9.0" cp2x="16.0" cp2y="9.0"/>
+                                    <point x="17.0" y="6.0" cp1x="17.0" cp1y="7.0" cp2x="17.0" cp2y="6.0"/>
+                                    <point x="17.0" y="0.0" cp1x="17.0" cp1y="0.0" cp2x="17.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="5" blue="31" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.061133325" saturationOffset="0.3642857" brightnessOffset="-0.427451" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="28" green="56" blue="81" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-3.528595E-5" saturationOffset="0.018606722" brightnessOffset="-0.23137257" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="17.0" cp2y="10.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="8.0" cp2x="18.0" cp2y="6.0"/>
+                                    <point x="18.0" y="0.0" cp1x="18.0" cp1y="0.0" cp2x="18.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="69" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-186"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="10.0" cp1x="0.0" cp1y="10.0" cp2x="0.0" cp2y="10.0"/>
+                                    <point x="0.0" y="11.0" cp1x="0.0" cp1y="11.0" cp2x="0.0" cp2y="11.0"/>
+                                    <point x="13.227272727272727" y="11.0" cp1x="11.113636363636347" cp1y="11.0" cp2x="15.340909090909106" cp2y="11.0"/>
+                                    <point x="18.0" y="6.0" cp1x="18.0" cp1y="9.0" cp2x="18.0" cp2y="6.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3d7e1c5.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates>
+                  <state stateKeys="Disabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="163" green="168" blue="175" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.018570602" saturationOffset="-0.56714284" brightnessOffset="0.1372549" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="5" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="6.0" y="3.0" cp1x="6.0" cp1y="3.0" cp2x="6.0" cp2y="3.0"/>
+                                    <point x="8.522727272727263" y="6.9772727272727275" cp1x="8.522727272727263" cp1y="6.9772727272727275" cp2x="8.522727272727263" cp2y="6.9772727272727275"/>
+                                    <point x="11.0" y="3.0" cp1x="11.0" cp1y="3.0" cp2x="11.0" cp2y="3.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </foregroundStates>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" componentName="Spinner.nextButton" type="javax.swing.plaf.synth.SynthArrowButton" name="ArrowButton" ui="SynthArrowButtonUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties>
+                     <uiProperty name="size" type="INT" value="20"/>
+                  </uiproperties>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="188" green="194" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56182265" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="224" blue="230" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.59223604" brightnessOffset="0.35294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="207" green="213" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.016586483" saturationOffset="-0.5723659" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="10.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="9.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="191" green="197" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.56289876" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="185" green="192" blue="200" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.010237217" saturationOffset="-0.5607143" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="9.36363636363636" cp1y="2.0" cp2x="16.63636363636364" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.250000000000001" cp2x="18.022727272727273" cp2y="10.75"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3cf2041.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="93" green="111" blue="128" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.3622768" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.72994655" midpoint="0.5">
+                                       <matte red="191" green="206" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0012707114" saturationOffset="-0.5078604" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="179" green="197" blue="212" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.4800539" brightnessOffset="0.28235292" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="70" green="91" blue="110" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.27207792" brightnessOffset="-0.11764708" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.63636363636364" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.250000000000001" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3c06513.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="93" green="111" blue="128" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0023007393" saturationOffset="-0.3622768" brightnessOffset="-0.04705882" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7513369" midpoint="0.5">
+                                       <matte red="191" green="206" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0012707114" saturationOffset="-0.5078604" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="179" green="197" blue="212" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0028941035" saturationOffset="-0.4800539" brightnessOffset="0.28235292" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="98" green="119" blue="138" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.34585923" brightnessOffset="-0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="70" green="91" blue="110" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.27207792" brightnessOffset="-0.11764708" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.63636363636364" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.250000000000001" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="0.6" cp1x="0.0" cp1y="0.6" cp2x="0.0" cp2y="0.6"/>
+                                    <point x="14.0" y="0.6" cp1x="14.0" cp1y="0.6" cp2x="17.4" cp2y="0.6"/>
+                                    <point x="19.4" y="7.0" cp1x="19.4" cp1y="3.6" cp2x="19.4" cp2y="7.0"/>
+                                    <point x="19.4" y="12.0" cp1x="19.4" cp1y="12.0" cp2x="19.4" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="109" green="128" blue="145" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.2034855E-5" saturationOffset="-0.38743842" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7593583" midpoint="0.5">
+                                       <matte red="204" green="219" blue="232" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0012707114" saturationOffset="-0.51502466" brightnessOffset="0.3607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="195" green="212" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0021564364" saturationOffset="-0.49097747" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="24" green="50" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="0.039961398" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.63636363636364" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.250000000000001" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="0.6" cp1x="0.0" cp1y="0.6" cp2x="0.0" cp2y="0.6"/>
+                                    <point x="14.0" y="0.6" cp1x="14.0" cp1y="0.6" cp2x="17.4" cp2y="0.6"/>
+                                    <point x="19.4" y="7.0" cp1x="19.4" cp1y="3.6" cp2x="19.4" cp2y="7.0"/>
+                                    <point x="19.4" y="12.0" cp1x="19.4" cp1y="12.0" cp2x="19.4" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="15" green="43" blue="82" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.018363237" saturationOffset="0.18135887" brightnessOffset="-0.227451" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7433155" midpoint="0.5">
+                                       <matte red="82" green="122" blue="158" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.15470162" brightnessOffset="0.07058823" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="69" green="112" blue="150" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.6235323E-4" saturationOffset="-0.09571427" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="24" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.454902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.454545454545453" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.5227272727272734" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="0.6" cp1x="0.0" cp1y="0.6" cp2x="0.0" cp2y="0.6"/>
+                                    <point x="14.0" y="0.6" cp1x="14.0" cp1y="0.6" cp2x="17.4" cp2y="0.6"/>
+                                    <point x="19.4" y="7.0" cp1x="19.4" cp1y="3.6" cp2x="19.4" cp2y="7.0"/>
+                                    <point x="19.4" y="12.0" cp1x="19.4" cp1y="12.0" cp2x="19.4" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="109" green="128" blue="145" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.2034855E-5" saturationOffset="-0.38743842" brightnessOffset="0.019607842" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7941176" midpoint="0.5">
+                                       <matte red="204" green="219" blue="232" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0012707114" saturationOffset="-0.51502466" brightnessOffset="0.3607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="195" green="212" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0021564364" saturationOffset="-0.49097747" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="59" green="85" blue="109" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.1769987" brightnessOffset="-0.12156865" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="24" green="50" blue="74" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="0.039961398" brightnessOffset="-0.25882354" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.63636363636364" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.250000000000001" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3d0fda8.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="1" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="1.0" x2="17.0" y1="11.0" y2="12.0" rounding="0.0">
+                                 <matte red="15" green="43" blue="82" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.018363237" saturationOffset="0.18135887" brightnessOffset="-0.227451" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8636364" midpoint="0.5">
+                                       <matte red="82" green="122" blue="158" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.15470162" brightnessOffset="0.07058823" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.033333335">
+                                       <matte red="69" green="112" blue="150" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.6235323E-4" saturationOffset="-0.09571427" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="11.0" cp1x="1.0" cp1y="11.0" cp2x="1.0" cp2y="11.0"/>
+                                    <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="16.0" cp2y="3.0"/>
+                                    <point x="17.0" y="7.0" cp1x="17.0" cp1y="5.0" cp2x="17.0" cp2y="7.0"/>
+                                    <point x="17.0" y="11.0" cp1x="17.0" cp1y="11.0" cp2x="17.0" cp2y="11.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="24" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.454902" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="12.0" cp1x="0.0" cp1y="12.0" cp2x="0.0" cp2y="12.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="16.454545454545453" cp2y="2.0"/>
+                                    <point x="18.0" y="7.0" cp1x="17.977272727272727" cp1y="3.5227272727272734" cp2x="18.0" cp2y="7.0"/>
+                                    <point x="18.0" y="12.0" cp1x="18.0" cp1y="12.0" cp2x="18.0" cp2y="12.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113a3d22070.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates>
+                  <state stateKeys="Disabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="173" green="177" blue="183" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.58106947" brightnessOffset="0.16862744" alphaOffset="0"/>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.454545454545453" y="5.1136363636363615" cp1x="8.454545454545453" cp1y="5.1136363636363615" cp2x="8.454545454545453" cp2y="5.1136363636363615"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="129" green="129" blue="129" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="78" green="78" blue="78" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.24313727" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.454545454545453" y="5.1136363636363615" cp1x="8.454545454545453" cp1y="5.1136363636363615" cp2x="8.454545454545453" cp2y="5.1136363636363615"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="129" green="129" blue="129" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="78" green="78" blue="78" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.24313727" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.454545454545453" y="5.1136363636363615" cp1x="8.454545454545453" cp1y="5.1136363636363615" cp2x="8.454545454545453" cp2y="5.1136363636363615"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="129" green="129" blue="129" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="78" green="78" blue="78" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.24313727" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.454545454545453" y="5.1136363636363615" cp1x="8.454545454545453" cp1y="5.1136363636363615" cp2x="8.454545454545453" cp2y="5.1136363636363615"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.522727272727273" y="5.318181818181818" cp1x="8.522727272727273" cp1y="5.318181818181818" cp2x="8.522727272727273" cp2y="5.318181818181818"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="129" green="129" blue="129" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="78" green="78" blue="78" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.24313727" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.454545454545453" y="5.1136363636363615" cp1x="8.454545454545453" cp1y="5.1136363636363615" cp2x="8.454545454545453" cp2y="5.1136363636363615"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="20" height="12"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="3" left="6" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="0"/>
+                                 <paintPoints x1="0.4863636363636362" y1="0.011695906106605689" x2="0.4909090909090911" y2="0.888888891987246"/>
+                                 <points>
+                                    <point x="6.0" y="9.0" cp1x="6.0" cp1y="9.0" cp2x="6.0" cp2y="9.0"/>
+                                    <point x="8.522727272727273" y="5.318181818181818" cp1x="8.522727272727273" cp1y="5.318181818181818" cp2x="8.522727272727273" cp2y="5.318181818181818"/>
+                                    <point x="11.0" y="9.0" cp1x="11.0" cp1y="9.0" cp2x="11.0" cp2y="9.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </foregroundStates>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JSplitPane" name="SplitPane" ui="SplitPaneUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="MouseOver"/>
+            <stateType key="Pressed"/>
+            <stateType key="Disabled"/>
+            <stateType key="Focused"/>
+            <stateType key="Selected"/>
+            <stateType key="Vertical">
+               <codeSnippet><![CDATA[
+                        return c instanceof JSplitPane && (((JSplitPane)c).getOrientation() == 1);]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="1" bottom="1" left="1" right="1"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties>
+               <uiProperty name="size" type="INT" value="10"/>
+	       <uiProperty name="dividerSize" type="INT" value="10"/>
+               <uiProperty name="centerOneTouchButtons" type="BOOLEAN" value="true"/>
+               <uiProperty name="oneTouchButtonOffset" type="INT" value="30"/>
+               <uiProperty name="oneTouchExpandable" type="BOOLEAN" value="false"/>
+               <uiProperty name="continuousLayout" type="BOOLEAN" value="true"/>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="18" height="15"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="SplitPaneDivider" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="68" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="3" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="68.0" y1="0.0" y2="10.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.058064517" midpoint="0.5">
+                                       <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.103225805" midpoint="0.5">
+                                       <matte red="244" green="244" blue="246" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.102396235" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.12903225" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7387097" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.81935483" midpoint="0.5">
+                                       <matte red="244" green="244" blue="246" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.102396235" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8967742" midpoint="0.5">
+                                       <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140562314d.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="68" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="3" bottom="3" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="68.0" y1="0.0" y2="10.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.058064517" midpoint="0.5">
+                                       <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.103225805" midpoint="0.5">
+                                       <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.73" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.81935483" midpoint="0.5">
+                                       <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.8967742" midpoint="0.5">
+                                       <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140562314d.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates>
+                  <state stateKeys="Enabled" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="68" height="10"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="24" right="24"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="26.0" x2="42.0" y1="4.0" y2="7.0" rounding="4.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.090322584" midpoint="0.5">
+                                       <matte red="180" green="184" blue="192" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.048026316" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.5" midpoint="0.5">
+                                       <matte red="235" green="238" blue="245" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.06970999" brightnessOffset="0.21568626" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.66451615" midpoint="0.5">
+                                       <matte red="198" green="201" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06704806" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="25.0" x2="43.0" y1="3.0" y2="8.0" rounding="3.6666666666666927">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.20645161" midpoint="0.5">
+                                       <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7935484" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140562314d.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Vertical" inverted="true">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="10" height="38"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="0" right="0"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <!--<rectangle x1="3.9545454545454546" x2="6.0" y1="26.49999999999998" y2="10.772727272727275" rounding="2.000000000000001">-->
+                                 
+                              <rectangle x1="4" x2="6.0" y1="10" y2="26.5" rounding="2">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="184" green="188" blue="196" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049301825" brightnessOffset="0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.16129032" midpoint="0.5">
+                                       <matte red="211" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07399663" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.86451614" midpoint="0.5">
+                                       <matte red="213" green="217" blue="222" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.018518567" saturationOffset="-0.06998578" brightnessOffset="0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.90645164" midpoint="0.5">
+                                       <matte red="188" green="192" blue="200" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.050526317" brightnessOffset="0.039215684" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="3.0" x2="7.0" y1="9.0" y2="28.0" rounding="4.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="150" green="155" blue="165" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.019617222" brightnessOffset="-0.09803921" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.84193546" midpoint="0.5">
+                                       <matte red="166" green="170" blue="179" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.004273474" saturationOffset="-0.03790062" brightnessOffset="-0.043137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9483871" midpoint="0.5">
+                                       <matte red="252" green="253" blue="253" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.111111104" saturationOffset="-0.106573746" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114056ef58e.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </foregroundStates>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JTabbedPane" name="TabbedPane" ui="TabbedPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <uiproperties>
+               <uiProperty name="tabAreaStatesMatchSelectedTab" type="BOOLEAN" value="true"/>
+               <uiProperty name="nudgeSelectedLabel" type="BOOLEAN" value="false"/>
+               <uiProperty name="tabRunOverlay" type="INT" value="2"/>
+               <uiProperty name="tabOverlap" type="INT" value="-1"/>
+               <uiProperty name="extendTabsToBase" type="BOOLEAN" value="true"/>
+               <uiProperty name="useBasicArrows" type="BOOLEAN" value="true"/>
+               <uiProperty name="shadow" type="COLOR">
+                  <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+               </uiProperty>
+               <uiProperty name="darkShadow" type="COLOR">
+                  <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+               </uiProperty>
+               <uiProperty name="highlight" type="COLOR">
+                  <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="MouseOver">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Pressed">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="TabbedPaneTab" subregion="true">
+               <contentMargins top="2" bottom="3" left="8" right="8"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.63174605" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2" midpoint="0.5">
+                                       <matte red="231" green="232" blue="236" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="-0.6145278" brightnessOffset="0.37647057" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="19.0" cp1x="1.0" cp1y="19.0" cp2x="1.0" cp2y="19.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="19.0" cp1x="43.0" cp1y="19.0" cp2x="43.0" cp2y="19.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="103" green="106" blue="112" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.55535716" brightnessOffset="-0.109803945" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11404048a3e.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="-0.6317773" brightnessOffset="0.4470588" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2" midpoint="0.5">
+                                       <matte red="242" green="244" blue="247" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.021348298" saturationOffset="-0.61547136" brightnessOffset="0.41960782" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5985242" brightnessOffset="0.39999998" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="19.0" cp1x="1.0" cp1y="19.0" cp2x="1.0" cp2y="19.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="19.0" cp1x="43.0" cp1y="19.0" cp2x="43.0" cp2y="19.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.54616207" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041a814c.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="1" left="6" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.027408898" saturationOffset="-0.5847884" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2" midpoint="0.5">
+                                       <matte red="183" green="188" blue="199" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.035931647" saturationOffset="-0.5553123" brightnessOffset="0.23137254" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.64193547" midpoint="0.5">
+                                       <matte red="166" green="173" blue="186" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.029681683" saturationOffset="-0.5281874" brightnessOffset="0.18039215" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="202" green="208" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.03801495" saturationOffset="-0.5456242" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="19.0" cp1x="1.0" cp1y="19.0" cp2x="1.0" cp2y="19.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.666666666666664" cp2x="1.0" cp2y="2.3333333333333357"/>
+                                    <point x="6.0" y="1.0" cp1x="2.4444444444444464" cp1y="1.0" cp2x="9.555555555555554" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.499999999999986" cp1y="1.0555555555555556" cp2x="41.500000000000014" cp2y="0.9444444444444444"/>
+                                    <point x="43.0" y="6.0" cp1x="43.05555555555556" cp1y="2.3333333333333357" cp2x="42.94444444444444" cp2y="9.666666666666664"/>
+                                    <point x="43.0" y="19.0" cp1x="43.0" cp1y="19.0" cp2x="43.0" cp2y="19.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="7" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.52156866" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="-0.05555555555555555" cp1y="2.3888888888888875" cp2x="0.05555555555555555" cp2y="7.6111111111111125"/>
+                                    <point x="5.0" y="0.0" cp1x="2.4999999999999982" cp1y="0.0" cp2x="7.500000000000002" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.277777777777786" cp1y="0.0" cp2x="41.722222222222214" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="43.94444444444444" cp1y="2.277777777777777" cp2x="44.05555555555556" cp2y="7.722222222222223"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041b7f56.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="6" bottom="1" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="220" green="222" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.046348333" saturationOffset="-0.6006266" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2" midpoint="0.5">
+                                       <matte red="217" green="219" blue="225" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.046348333" saturationOffset="-0.60015875" brightnessOffset="0.3333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.5953556" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="19.0" cp1x="1.0" cp1y="19.0" cp2x="1.0" cp2y="19.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="19.0" cp1x="43.0" cp1y="19.0" cp2x="43.0" cp2y="19.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="196" green="199" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.59181184" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="180" green="182" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="-0.58308274" brightnessOffset="0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041da636.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="0" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="207" green="218" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.543609" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="169" green="189" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0020751357" saturationOffset="-0.45610264" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="174" green="195" blue="214" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44879842" brightnessOffset="0.29019606" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="196" green="199" blue="205" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.032459438" saturationOffset="-0.59181184" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="180" green="182" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="-0.58308274" brightnessOffset="0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041e82d1.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="0" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="207" green="218" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.543609" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="169" green="189" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0020751357" saturationOffset="-0.45610264" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="174" green="195" blue="214" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44879842" brightnessOffset="0.29019606" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="33" green="54" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.08776909" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041e82d1.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="0" left="9" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="211" green="224" blue="235" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0022627711" saturationOffset="-0.5335866" brightnessOffset="0.372549" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="184" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4608264" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9677419" midpoint="0.5">
+                                       <matte red="193" green="214" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46404046" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="4" blue="27" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.06332368" saturationOffset="0.3642857" brightnessOffset="-0.4431373" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11404247138.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Pressed">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="0" left="9" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="84" green="123" blue="159" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.16401619" brightnessOffset="0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="54" green="101" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0010001659" saturationOffset="-0.01599598" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9419355" midpoint="0.5">
+                                       <matte red="60" green="106" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018727183" saturationOffset="-0.038398862" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="4" blue="27" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.06332368" saturationOffset="0.3642857" brightnessOffset="-0.4431373" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140425bba6.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="3" left="7" right="7"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="20.916666666666664" y="17.749999999999996" cp1x="20.916666666666664" cp1y="17.749999999999996" cp2x="20.916666666666664" cp2y="17.749999999999996"/>
+                                    <point x="20.958333333333332" y="19.333333333333332" cp1x="20.958333333333332" cp1y="19.333333333333332" cp2x="20.958333333333332" cp2y="19.333333333333332"/>
+                                    <point x="2.6666666666666665" y="19.33333333333334" cp1x="2.6666666666666665" cp1y="19.33333333333334" cp2x="2.6666666666666665" cp2y="19.33333333333334"/>
+                                    <point x="2.6249999999999987" y="6.166666666666665" cp1x="2.6249999999999987" cp1y="6.166666666666665" cp2x="2.6249999999999987" cp2y="3.9166666666666647"/>
+                                    <point x="5.916666666666664" y="2.666666666666665" cp1x="3.9999999999999996" cp1y="2.666666666666665" cp2x="5.916666666666664" cp2y="2.666666666666665"/>
+                                    <point x="37.70833333333333" y="2.6666666666666665" cp1x="37.70833333333333" cp1y="2.6666666666666665" cp2x="39.833333333333314" cp2y="2.6666666666666665"/>
+                                    <point x="41.416666666666664" y="6.041666666666667" cp1x="41.416666666666664" cp1y="3.4583333333333353" cp2x="41.416666666666664" cp2y="6.041666666666667"/>
+                                    <point x="41.37500000000001" y="19.291666666666657" cp1x="41.37500000000001" cp1y="19.291666666666657" cp2x="41.37500000000001" cp2y="19.291666666666657"/>
+                                    <point x="21.000000000000007" y="19.33333333333333" cp1x="21.000000000000007" cp1y="19.33333333333333" cp2x="21.000000000000007" cp2y="19.33333333333333"/>
+                                    <point x="20.916666666666668" y="17.708333333333332" cp1x="20.916666666666668" cp1y="17.708333333333332" cp2x="20.916666666666668" cp2y="17.708333333333332"/>
+                                    <point x="39.70833333333333" y="17.666666666666668" cp1x="39.70833333333333" cp1y="17.666666666666668" cp2x="39.70833333333333" cp2y="17.666666666666668"/>
+                                    <point x="39.625" y="6.083333333333332" cp1x="39.625" cp1y="6.083333333333332" cp2x="39.62499999999999" cp2y="5.166666666666664"/>
+                                    <point x="37.666666666666664" y="4.249999999999999" cp1x="38.75" cp1y="4.249999999999997" cp2x="37.666666666666664" cp2y="4.249999999999999"/>
+                                    <point x="5.833333333333332" y="4.291666666666666" cp1x="5.833333333333332" cp1y="4.291666666666666" cp2x="4.833333333333332" cp2y="4.291666666666666"/>
+                                    <point x="4.374999999999998" y="6.08333333333333" cp1x="4.416666666666665" cp1y="5.1249999999999964" cp2x="4.374999999999998" cp2y="6.08333333333333"/>
+                                    <point x="4.291666666666664" y="17.708333333333334" cp1x="4.291666666666664" cp1y="17.708333333333334" cp2x="4.291666666666664" cp2y="17.708333333333334"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="246" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6197143" brightnessOffset="0.43137252" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="207" green="218" blue="228" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="7.13408E-4" saturationOffset="-0.543609" brightnessOffset="0.34509802" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="169" green="189" blue="206" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0020751357" saturationOffset="-0.45610264" brightnessOffset="0.2588235" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="163" green="184" blue="203" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.43866998" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="174" green="195" blue="214" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.44879842" brightnessOffset="0.29019606" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="33" green="54" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.08776909" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114041e82d1.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="3" left="9" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="20.916666666666664" y="17.749999999999996" cp1x="20.916666666666664" cp1y="17.749999999999996" cp2x="20.916666666666664" cp2y="17.749999999999996"/>
+                                    <point x="20.958333333333332" y="19.333333333333332" cp1x="20.958333333333332" cp1y="19.333333333333332" cp2x="20.958333333333332" cp2y="19.333333333333332"/>
+                                    <point x="2.6666666666666665" y="19.33333333333334" cp1x="2.6666666666666665" cp1y="19.33333333333334" cp2x="2.6666666666666665" cp2y="19.33333333333334"/>
+                                    <point x="2.6249999999999987" y="6.166666666666665" cp1x="2.6249999999999987" cp1y="6.166666666666665" cp2x="2.6249999999999987" cp2y="3.9166666666666647"/>
+                                    <point x="5.916666666666664" y="2.666666666666665" cp1x="3.9999999999999996" cp1y="2.666666666666665" cp2x="5.916666666666664" cp2y="2.666666666666665"/>
+                                    <point x="37.70833333333333" y="2.6666666666666665" cp1x="37.70833333333333" cp1y="2.6666666666666665" cp2x="39.833333333333314" cp2y="2.6666666666666665"/>
+                                    <point x="41.416666666666664" y="6.041666666666667" cp1x="41.416666666666664" cp1y="3.4583333333333353" cp2x="41.416666666666664" cp2y="6.041666666666667"/>
+                                    <point x="41.37500000000001" y="19.291666666666657" cp1x="41.37500000000001" cp1y="19.291666666666657" cp2x="41.37500000000001" cp2y="19.291666666666657"/>
+                                    <point x="21.000000000000007" y="19.33333333333333" cp1x="21.000000000000007" cp1y="19.33333333333333" cp2x="21.000000000000007" cp2y="19.33333333333333"/>
+                                    <point x="20.916666666666668" y="17.708333333333332" cp1x="20.916666666666668" cp1y="17.708333333333332" cp2x="20.916666666666668" cp2y="17.708333333333332"/>
+                                    <point x="39.70833333333333" y="17.666666666666668" cp1x="39.70833333333333" cp1y="17.666666666666668" cp2x="39.70833333333333" cp2y="17.666666666666668"/>
+                                    <point x="39.625" y="6.083333333333332" cp1x="39.625" cp1y="6.083333333333332" cp2x="39.62499999999999" cp2y="5.166666666666664"/>
+                                    <point x="37.666666666666664" y="4.249999999999999" cp1x="38.75" cp1y="4.249999999999997" cp2x="37.666666666666664" cp2y="4.249999999999999"/>
+                                    <point x="5.833333333333332" y="4.291666666666666" cp1x="5.833333333333332" cp1y="4.291666666666666" cp2x="4.833333333333332" cp2y="4.291666666666666"/>
+                                    <point x="4.374999999999998" y="6.08333333333333" cp1x="4.416666666666665" cp1y="5.1249999999999964" cp2x="4.374999999999998" cp2y="6.08333333333333"/>
+                                    <point x="4.291666666666664" y="17.708333333333334" cp1x="4.291666666666664" cp1y="17.708333333333334" cp2x="4.291666666666664" cp2y="17.708333333333334"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="211" green="224" blue="235" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0022627711" saturationOffset="-0.5335866" brightnessOffset="0.372549" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="184" green="205" blue="223" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0017285943" saturationOffset="-0.4608264" brightnessOffset="0.32549018" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="182" green="203" blue="222" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4555341" brightnessOffset="0.3215686" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9677419" midpoint="0.5">
+                                       <matte red="193" green="214" blue="233" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.46404046" brightnessOffset="0.36470586" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="4" blue="27" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.06332368" saturationOffset="0.3642857" brightnessOffset="-0.4431373" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11404247138.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Pressed+Focused">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                        <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="44" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="7" bottom="3" left="9" right="9"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="20.916666666666664" y="17.749999999999996" cp1x="20.916666666666664" cp1y="17.749999999999996" cp2x="20.916666666666664" cp2y="17.749999999999996"/>
+                                    <point x="20.958333333333332" y="19.333333333333332" cp1x="20.958333333333332" cp1y="19.333333333333332" cp2x="20.958333333333332" cp2y="19.333333333333332"/>
+                                    <point x="2.6666666666666665" y="19.33333333333334" cp1x="2.6666666666666665" cp1y="19.33333333333334" cp2x="2.6666666666666665" cp2y="19.33333333333334"/>
+                                    <point x="2.6249999999999987" y="6.166666666666665" cp1x="2.6249999999999987" cp1y="6.166666666666665" cp2x="2.6249999999999987" cp2y="3.9166666666666647"/>
+                                    <point x="5.916666666666664" y="2.666666666666665" cp1x="3.9999999999999996" cp1y="2.666666666666665" cp2x="5.916666666666664" cp2y="2.666666666666665"/>
+                                    <point x="37.70833333333333" y="2.6666666666666665" cp1x="37.70833333333333" cp1y="2.6666666666666665" cp2x="39.833333333333314" cp2y="2.6666666666666665"/>
+                                    <point x="41.416666666666664" y="6.041666666666667" cp1x="41.416666666666664" cp1y="3.4583333333333353" cp2x="41.416666666666664" cp2y="6.041666666666667"/>
+                                    <point x="41.37500000000001" y="19.291666666666657" cp1x="41.37500000000001" cp1y="19.291666666666657" cp2x="41.37500000000001" cp2y="19.291666666666657"/>
+                                    <point x="21.000000000000007" y="19.33333333333333" cp1x="21.000000000000007" cp1y="19.33333333333333" cp2x="21.000000000000007" cp2y="19.33333333333333"/>
+                                    <point x="20.916666666666668" y="17.708333333333332" cp1x="20.916666666666668" cp1y="17.708333333333332" cp2x="20.916666666666668" cp2y="17.708333333333332"/>
+                                    <point x="39.70833333333333" y="17.666666666666668" cp1x="39.70833333333333" cp1y="17.666666666666668" cp2x="39.70833333333333" cp2y="17.666666666666668"/>
+                                    <point x="39.625" y="6.083333333333332" cp1x="39.625" cp1y="6.083333333333332" cp2x="39.62499999999999" cp2y="5.166666666666664"/>
+                                    <point x="37.666666666666664" y="4.249999999999999" cp1x="38.75" cp1y="4.249999999999997" cp2x="37.666666666666664" cp2y="4.249999999999999"/>
+                                    <point x="5.833333333333332" y="4.291666666666666" cp1x="5.833333333333332" cp1y="4.291666666666666" cp2x="4.833333333333332" cp2y="4.291666666666666"/>
+                                    <point x="4.374999999999998" y="6.08333333333333" cp1x="4.416666666666665" cp1y="5.1249999999999964" cp2x="4.374999999999998" cp2y="6.08333333333333"/>
+                                    <point x="4.291666666666664" y="17.708333333333334" cp1x="4.291666666666664" cp1y="17.708333333333334" cp2x="4.291666666666664" cp2y="17.708333333333334"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="143" green="169" blue="192" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-4.2033195E-4" saturationOffset="-0.38050595" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2483871" midpoint="0.5">
+                                       <matte red="84" green="123" blue="159" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0013483167" saturationOffset="-0.16401619" brightnessOffset="0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6032258" midpoint="0.5">
+                                       <matte red="54" green="101" blue="142" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0010001659" saturationOffset="-0.01599598" brightnessOffset="0.007843137" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7677419" midpoint="0.5">
+                                       <matte red="51" green="98" blue="140" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.9419355" midpoint="0.5">
+                                       <matte red="60" green="106" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018727183" saturationOffset="-0.038398862" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="1.0" y="20.0" cp1x="1.0" cp1y="20.0" cp2x="1.0" cp2y="20.0"/>
+                                    <point x="1.0" y="6.0" cp1x="1.0" cp1y="9.555555555555554" cp2x="1.0" cp2y="2.4444444444444464"/>
+                                    <point x="6.0" y="1.0" cp1x="2.555555555555557" cp1y="1.0" cp2x="9.444444444444443" cp2y="1.0"/>
+                                    <point x="38.0" y="1.0" cp1x="34.66666666666666" cp1y="1.0" cp2x="41.33333333333334" cp2y="1.0"/>
+                                    <point x="43.0" y="6.0" cp1x="43.0" cp1y="2.722222222222223" cp2x="43.0" cp2y="9.277777777777777"/>
+                                    <point x="43.0" y="20.0" cp1x="43.0" cp1y="20.0" cp2x="43.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="0" green="4" blue="27" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.06332368" saturationOffset="0.3642857" brightnessOffset="-0.4431373" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="5.0" cp1x="0.0" cp1y="8.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="5.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="8.0" cp2y="0.0"/>
+                                    <point x="39.0" y="0.0" cp1x="36.0" cp1y="0.0" cp2x="42.0" cp2y="0.0"/>
+                                    <point x="44.0" y="5.0" cp1x="44.0" cp1y="2.0" cp2x="44.0" cp2y="8.0"/>
+                                    <point x="44.0" y="20.0" cp1x="44.0" cp1y="20.0" cp2x="44.0" cp2y="20.0"/>
+                                    <point x="0.0" y="20.0" cp1x="0.0" cp1y="20.0" cp2x="0.0" cp2y="20.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140425bba6.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <region name="TabbedPaneTabArea" subregion="true">
+               <contentMargins top="3" bottom="4" left="10" right="10"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="5" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="5.0" y1="19.0" y2="24.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.08387097" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.10967742" midpoint="0.5">
+                                       <matte red="181" green="202" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.45471883" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7645161" midpoint="0.5">
+                                       <matte red="192" green="213" blue="232" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4633005" brightnessOffset="0.3607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7870968" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="0.0" y1="0.0" y2="0.0" rounding="0.0">
+                                 <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11404091c22.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="5" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="5.0" y1="19.0" y2="24.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.08387097" midpoint="0.5">
+                                       <matte red="180" green="182" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="-0.58308274" brightnessOffset="0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.10967742" midpoint="0.5">
+                                       <matte red="181" green="202" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.45471883" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7645161" midpoint="0.5">
+                                       <matte red="192" green="213" blue="232" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4633005" brightnessOffset="0.3607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7870968" midpoint="0.5">
+                                       <matte red="180" green="182" blue="190" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.05468172" saturationOffset="-0.58308274" brightnessOffset="0.19607842" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11404091c22.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="5" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="5.0" y1="19.0" y2="24.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.08387097" midpoint="0.5">
+                                       <matte red="0" green="0" blue="0" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.57865167" saturationOffset="-0.6357143" brightnessOffset="-0.54901963" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.10967742" midpoint="0.5">
+                                       <matte red="200" green="221" blue="240" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.4690476" brightnessOffset="0.39215684" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7645161" midpoint="0.5">
+                                       <matte red="211" green="232" blue="251" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="5.1498413E-4" saturationOffset="-0.47635174" brightnessOffset="0.4352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7870968" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140418c3be.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="5" height="24"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="6" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="5.0" y1="19.0" y2="24.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.08387097" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.10967742" midpoint="0.5">
+                                       <matte red="64" green="111" blue="153" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.05401492" brightnessOffset="0.05098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7645161" midpoint="0.5">
+                                       <matte red="75" green="122" blue="164" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.09303135" brightnessOffset="0.09411764" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7870968" midpoint="0.5">
+                                       <matte red="0" green="0" blue="18" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.08801502" saturationOffset="0.3642857" brightnessOffset="-0.4784314" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1140419f9fa.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <region name="TabbedPaneContent" subregion="true">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NO_CACHING</cacheMode>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="15"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JTable" name="Table" ui="TableUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground>
+               <matte red="35" green="35" blue="36" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </textForeground>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-textForeground>false</inherit-textForeground>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="showGrid" type="BOOLEAN" value="false"/>
+               <uiProperty name="intercellSpacing" type="DIMENSION">
+                  <dimension width="0" height="0"/>
+               </uiProperty>
+               <uiProperty name="alternateRowColor" type="COLOR">
+                  <matte red="242" green="242" blue="242" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.05098039" alphaOffset="0" uiResource="false"/>
+               </uiProperty>
+               <uiProperty name="rendererUseTableColors" type="BOOLEAN" value="true"/>
+               <uiProperty name="rendererUseUIBorder" type="BOOLEAN" value="true"/>
+               <uiProperty name="cellNoFocusBorder" type="BORDER">
+                   <border type="empty" top="2" left="5" bottom="2" right="5"/>
+               </uiProperty>
+               <uiProperty name="focusCellHighlightBorder" type="BORDER">
+                   <border type="painter" painter="Tree:TreeCell[Enabled+Focused].backgroundPainter" top="2" left="5" bottom="2" right="5" />
+               </uiProperty>
+               <uiProperty name="dropLineColor" type="COLOR">
+                  <matte red="242" green="242" blue="242" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0" alphaOffset="0"/>
+               </uiProperty>
+               <uiProperty name="dropLineShortColor" type="COLOR">
+                  <matte red="242" green="242" blue="242" alpha="255" uiDefaultParentName="nimbusOrange" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled+Selected">
+                <style>
+                   <textForeground>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textForeground>
+                   <textBackground>
+                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textBackground>
+                   <background/>
+                   <inherit-textForeground>false</inherit-textForeground>
+                   <inherit-textBackground>false</inherit-textBackground>
+                   <uiproperties/>
+                </style>
+                <canvas>
+                   <size width="100" height="30"/>
+                   <nextLayerNameIndex>2</nextLayerNameIndex>
+                   <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                   <layer name="Layer 1">
+                      <opacity>1.0</opacity>
+                      <fillOpacity>1.0</fillOpacity>
+                      <blendingMode>NORMAL</blendingMode>
+                      <locked>false</locked>
+                      <visible>true</visible>
+                      <shapes/>
+                      <effects/>
+                   </layer>
+                </canvas>
+            </state>
+            <state stateKeys="Disabled+Selected">
+                <style>
+                   <textForeground/>
+                   <textBackground>
+                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                   </textBackground>
+                   <background/>
+                   <inherit-textBackground>false</inherit-textBackground>
+                   <uiproperties/>
+                </style>
+                <canvas>
+                   <size width="100" height="30"/>
+                   <nextLayerNameIndex>2</nextLayerNameIndex>
+                   <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                   <layer name="Layer 1">
+                      <opacity>1.0</opacity>
+                      <fillOpacity>1.0</fillOpacity>
+                      <blendingMode>NORMAL</blendingMode>
+                      <locked>false</locked>
+                      <visible>true</visible>
+                      <shapes/>
+                      <effects/>
+                   </layer>
+                </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiComponent opaque="true" componentName="Table.cellRenderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                  </background>
+                  <inherit-background>false</inherit-background>
+                  <uiproperties/>
+               </style>
+               <backgroundStates/>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.table.JTableHeader" name="TableHeader" ui="TableHeaderUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+                <uiProperty name="rightAlignSortArrow" type="BOOLEAN" value="true"/>
+            </uiproperties>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <uiIconRegion name="AscendingSortIcon" subregion="true" key="ascendingSortIcon" basicKey="Table.ascendingSortIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="7" height="7"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="2"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="105" green="142" blue="180" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0057927966" saturationOffset="-0.21904764" brightnessOffset="0.15686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="53" green="104" blue="154" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0038565993" saturationOffset="0.02012986" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="7.0" cp1x="0.0" cp1y="7.0" cp2x="0.0" cp2y="7.0"/>
+                                    <point x="3.5350877192982466" y="-0.008771929824561403" cp1x="3.5350877192982466" cp1y="-0.008771929824561403" cp2x="3.5350877192982466" cp2y="-0.008771929824561403"/>
+                                    <point x="7.0" y="7.0" cp1x="7.0" cp1y="7.0" cp2x="7.0" cp2y="7.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11423a6c52f.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="DescendingSortIcon" subregion="true" key="descendingSortIcon" basicKey="Table.descendingSortIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="7" height="7"/>
+                        <nextLayerNameIndex>5</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="0" right="0"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="105" green="142" blue="180" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0057927966" saturationOffset="-0.21904764" brightnessOffset="0.15686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="53" green="104" blue="154" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0038565993" saturationOffset="0.02012986" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="3.5175438596491224" y="7.0" cp1x="3.5175438596491224" cp1y="7.0" cp2x="3.5175438596491224" cp2y="7.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11423ac362a.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiComponent opaque="true" componentName="TableHeader.renderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes>
+                  <stateType key="Enabled"/>
+                  <stateType key="MouseOver"/>
+                  <stateType key="Pressed"/>
+                  <stateType key="Disabled"/>
+                  <stateType key="Focused"/>
+                  <stateType key="Selected"/>
+                  <stateType key="Sorted">
+                     <codeSnippet><![CDATA[
+                    String sortOrder = (String)c.getClientProperty("Table.sortOrder");
+                    return  sortOrder != null && ("ASCENDING".equals(sortOrder) || "DESCENDING".equals(sortOrder)); ]]></codeSnippet>
+                  </stateType>
+               </stateTypes>
+               <contentMargins top="2" bottom="4" left="5" right="5"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="225" green="227" blue="231" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08455229" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="242" green="245" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07466974" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="225" green="227" blue="231" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08455229" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="242" green="245" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07466974" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114235956c5.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                   <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                                   <point x="0" y="20" cp1x="0" cp1y="20" cp2x="0" cp2y="20"/>
+                                   <point x="22" y="20" cp1x="22" cp1y="20" cp2x="22" cp2y="20"/>
+                                   <point x="22" y="0" cp1x="22" cp1y="0" cp2x="22" cp2y="0"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                   <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                                   <point x="20.8" y="1.2" cp1x="20.8" cp1y="1.2" cp2x="20.8" cp2y="1.2"/>
+                                   <point x="20.8" y="18.8" cp1x="20.8" cp1y="18.8" cp2x="20.8" cp2y="18.8"/>
+                                   <point x="1.2" y="18.8" cp1x="1.2" cp1y="18.8" cp2x="1.2" cp2y="18.8"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                </points>
+                              </path>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="225" green="227" blue="231" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08455229" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="242" green="245" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07466974" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="240" green="242" blue="246" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08613607" brightnessOffset="0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.88013697" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114235b929b.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="176" green="182" blue="194" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017742813" brightnessOffset="0.015686274" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="202" green="208" blue="222" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.020436227" brightnessOffset="0.12549019" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11423668ee0.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Sorted">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="248" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.62376213" brightnessOffset="0.4352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.32534248" midpoint="0.6272727">
+                                       <matte red="193" green="208" blue="221" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0012707114" saturationOffset="-0.50901747" brightnessOffset="0.31764704" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="178" green="197" blue="213" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.002461195" saturationOffset="-0.47139505" brightnessOffset="0.2862745" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.97602737" midpoint="0.5">
+                                       <matte red="201" green="220" blue="235" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.0051222444" saturationOffset="-0.49103343" brightnessOffset="0.372549" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="11423677dfd.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Focused+Sorted">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                   <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                                   <point x="0" y="20" cp1x="0" cp1y="20" cp2x="0" cp2y="20"/>
+                                   <point x="22" y="20" cp1x="22" cp1y="20" cp2x="22" cp2y="20"/>
+                                   <point x="22" y="0" cp1x="22" cp1y="0" cp2x="22" cp2y="0"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                   <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                                   <point x="20.8" y="1.2" cp1x="20.8" cp1y="1.2" cp2x="20.8" cp2y="1.2"/>
+                                   <point x="20.8" y="18.8" cp1x="20.8" cp1y="18.8" cp2x="20.8" cp2y="18.8"/>
+                                   <point x="1.2" y="18.8" cp1x="1.2" cp1y="18.8" cp2x="1.2" cp2y="18.8"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                </points>
+                              </path>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="248" green="250" blue="251" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.023096085" saturationOffset="-0.62376213" brightnessOffset="0.4352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="189" green="205" blue="219" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-8.738637E-4" saturationOffset="-0.49872798" brightnessOffset="0.3098039" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="178" green="197" blue="213" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-0.002461195" saturationOffset="-0.47139505" brightnessOffset="0.2862745" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="202" green="220" blue="236" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="-2.2029877E-4" saturationOffset="-0.4916465" brightnessOffset="0.37647057" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects>
+                              <innerShadow blendingMode="NORMAL" opacity="0.75" angle="135" distance="0" spread="53" size="3">
+                                 <matte red="49" green="150" blue="239" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="0.16" brightnessOffset="0.39" alphaOffset="0"/>
+                              </innerShadow>
+                           </effects>
+                        </layer>
+                        <templateLayer fileName="1142368f212.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+Sorted">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="22" height="20"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="21.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.24742268">
+                                       <matte red="251" green="251" blue="252" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10655806" brightnessOffset="0.24313724" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.2888889" midpoint="0.6272727">
+                                       <matte red="225" green="227" blue="231" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.08455229" brightnessOffset="0.1607843" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7037037" midpoint="0.5">
+                                       <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07016757" brightnessOffset="0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="242" green="245" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07466974" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="21.0" x2="22.0" y1="0.0" y2="19.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.33043477">
+                                       <matte red="201" green="203" blue="206" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.08625447" brightnessOffset="0.062745094" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.43703705" midpoint="0.5">
+                                       <matte red="134" green="139" blue="146" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.028334536" brightnessOffset="-0.17254901" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.75185186" midpoint="0.5">
+                                       <matte red="136" green="141" blue="148" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.013888836" saturationOffset="-0.029445238" brightnessOffset="-0.16470587" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="182" green="187" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.02020204" saturationOffset="-0.053531498" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="22.0" y1="19.0" y2="20.0" rounding="0.0">
+                                 <matte red="116" green="121" blue="128" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="-0.013888836" saturationOffset="5.823001E-4" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" componentName="Table.editor" type="javax.swing.JTextField" name="TextField" ui="TextFieldUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="3" bottom="3" left="5" right="5"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                              <point x="0" y="30" cp1x="0" cp1y="30" cp2x="0" cp2y="30"/>
+                              <point x="100" y="30" cp1x="100" cp1y="30" cp2x="100" cp2y="30"/>
+                              <point x="100" y="0" cp1x="100" cp1y="0" cp2x="100" cp2y="0"/>
+                              <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                              <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                              <point x="98.8" y="1.2" cp1x="98.8" cp1y="1.2" cp2x="98.8" cp2y="1.2"/>
+                              <point x="98.8" y="28.8" cp1x="98.8" cp1y="28.8" cp2x="98.8" cp2y="28.8"/>
+                              <point x="1.2" y="28.8" cp1x="1.2" cp1y="28.8" cp2x="1.2" cp2y="28.8"/>
+                              <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" componentName="Tree.cellEditor" type="javax.swing.JTextField" name="TextField" ui="TextFieldUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="2" bottom="2" left="5" right="5"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.017358616" brightnessOffset="-0.11372548" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                              <point x="0" y="30" cp1x="0" cp1y="30" cp2x="0" cp2y="30"/>
+                              <point x="100" y="30" cp1x="100" cp1y="30" cp2x="100" cp2y="30"/>
+                              <point x="100" y="0" cp1x="100" cp1y="0" cp2x="100" cp2y="0"/>
+                              <point x="1" y="0" cp1x="1" cp1y="0" cp2x="1" cp2y="0"/>
+                              <point x="1" y="1" cp1x="1" cp1y="1" cp2x="1" cp2y="1"/>
+                              <point x="99" y="1" cp1x="99" cp1y="1" cp2x="99" cp2y="1"/>
+                              <point x="99" y="29" cp1x="99" cp1y="29" cp2x="99" cp2y="29"/>
+                              <point x="1" y="29" cp1x="1" cp1y="29" cp2x="1" cp2y="29"/>
+                              <point x="1" y="0" cp1x="1" cp1y="0" cp2x="1" cp2y="0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                              <point x="0" y="30" cp1x="0" cp1y="30" cp2x="0" cp2y="30"/>
+                              <point x="100" y="30" cp1x="100" cp1y="30" cp2x="100" cp2y="30"/>
+                              <point x="100" y="0" cp1x="100" cp1y="0" cp2x="100" cp2y="0"/>
+                              <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                              <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                              <point x="98.8" y="1.2" cp1x="98.8" cp1y="1.2" cp2x="98.8" cp2y="1.2"/>
+                              <point x="98.8" y="28.8" cp1x="98.8" cp1y="28.8" cp2x="98.8" cp2y="28.8"/>
+                              <point x="1.2" y="28.8" cp1x="1.2" cp1y="28.8" cp2x="1.2" cp2y="28.8"/>
+                              <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                           </points>
+                        </path>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JTextField" name="TextField" ui="TextFieldUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="0.1500000000000001"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="3" left="3" right="3"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="22.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07796818" brightnessOffset="0.09803921" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="2.0" y="22.0" cp1x="2.0" cp1y="22.0" cp2x="2.0" cp2y="22.0"/>
+                              <point x="120.0" y="22.0" cp1x="120.0" cp1y="22.0" cp2x="120.0" cp2y="22.0"/>
+                              <point x="120.0" y="2.0" cp1x="120.0" cp1y="2.0" cp2x="120.0" cp2y="2.0"/>
+                              <point x="121.4" y="2.0" cp1x="121.5" cp1y="2.0" cp2x="121.5" cp2y="2.0"/>
+                              <point x="121.4" y="23.4" cp1x="121.4" cp1y="23.4" cp2x="121.4" cp2y="23.4"/>
+                              <point x="0.6" y="23.4" cp1x="0.6" cp1y="23.4" cp2x="0.6" cp2y="23.4"/>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="121.4" y="0.6" cp1x="121.4" cp1y="0.6" cp2x="121.4" cp2y="0.6"/>
+                              <point x="121.4" y="2.0" cp1x="121.4" cp1y="2.0" cp2x="121.4" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JFormattedTextField" name="FormattedTextField" ui="FormattedTextFieldUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="0.1500000000000001"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="3" left="3" right="3"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="22.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07796818" brightnessOffset="0.09803921" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="2.0" y="22.0" cp1x="2.0" cp1y="22.0" cp2x="2.0" cp2y="22.0"/>
+                              <point x="120.0" y="22.0" cp1x="120.0" cp1y="22.0" cp2x="120.0" cp2y="22.0"/>
+                              <point x="120.0" y="2.0" cp1x="120.0" cp1y="2.0" cp2x="120.0" cp2y="2.0"/>
+                              <point x="121.4" y="2.0" cp1x="121.5" cp1y="2.0" cp2x="121.5" cp2y="2.0"/>
+                              <point x="121.4" y="23.4" cp1x="121.4" cp1y="23.4" cp2x="121.4" cp2y="23.4"/>
+                              <point x="0.6" y="23.4" cp1x="0.6" cp1y="23.4" cp2x="0.6" cp2y="23.4"/>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="121.4" y="0.6" cp1x="121.4" cp1y="0.6" cp2x="121.4" cp2y="0.6"/>
+                              <point x="121.4" y="2.0" cp1x="121.4" cp1y="2.0" cp2x="121.4" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JPasswordField" name="PasswordField" ui="PasswordFieldUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="6" bottom="6" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="0.1500000000000001"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="3" left="3" right="3"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="22.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07796818" brightnessOffset="0.09803921" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="1139927b26e.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="2.0" y="22.0" cp1x="2.0" cp1y="22.0" cp2x="2.0" cp2y="22.0"/>
+                              <point x="120.0" y="22.0" cp1x="120.0" cp1y="22.0" cp2x="120.0" cp2y="22.0"/>
+                              <point x="120.0" y="2.0" cp1x="120.0" cp1y="2.0" cp2x="120.0" cp2y="2.0"/>
+                              <point x="121.4" y="2.0" cp1x="121.5" cp1y="2.0" cp2x="121.5" cp2y="2.0"/>
+                              <point x="121.4" y="23.4" cp1x="121.4" cp1y="23.4" cp2x="121.4" cp2y="23.4"/>
+                              <point x="0.6" y="23.4" cp1x="0.6" cp1y="23.4" cp2x="0.6" cp2y="23.4"/>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="121.4" y="0.6" cp1x="121.4" cp1y="0.6" cp2x="121.4" cp2y="0.6"/>
+                              <point x="121.4" y="2.0" cp1x="121.4" cp1y="2.0" cp2x="121.4" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+                  <templateLayer fileName="11399201d79.png">
+                     <layer name="Template" type="template">
+                        <opacity>1.0</opacity>
+                        <fillOpacity>1.0</fillOpacity>
+                        <blendingMode>NORMAL</blendingMode>
+                        <locked>false</locked>
+                        <visible>false</visible>
+                        <shapes/>
+                        <effects/>
+                     </layer>
+                  </templateLayer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JTextArea" name="TextArea" ui="TextAreaUI" subregion="false">
+         <stateTypes>
+            <stateType key="Enabled"/>
+            <stateType key="MouseOver"/>
+            <stateType key="Pressed"/>
+            <stateType key="Selected"/>
+            <stateType key="Disabled"/>
+            <stateType key="Focused"/>
+            <stateType key="NotInScrollPane">
+               <codeSnippet><![CDATA[
+                          return !(c.getParent() instanceof javax.swing.JViewport);]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="6" bottom="6" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="122.0" y1="0.0" y2="24.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="0.1500000000000001"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="122.0" y1="0.0" y2="24.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Disabled+NotInScrollPane">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25" y2="0.1500000000000001"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+NotInScrollPane">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="22.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="Disabled+NotInScrollPane">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="3" left="3" right="3"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="22.0" y2="21.0" rounding="0.0">
+                           <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="21.0" rounding="0.0">
+                           <matte red="208" green="210" blue="215" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07796818" brightnessOffset="0.09803921" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="212" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07856284" brightnessOffset="0.11372548" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.0" midpoint="0.5">
+                                 <matte red="199" green="202" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07187897" brightnessOffset="0.06666666" alphaOffset="0"/>
+                              </stop>
+                              <stop position="1.0" midpoint="0.5">
+                                 <matte red="210" green="212" blue="217" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.07826825" brightnessOffset="0.10588235" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Focused+NotInScrollPane">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <path>
+                           <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                           <points>
+                              <point x="2.0" y="2.0" cp1x="2.0" cp1y="2.0" cp2x="2.0" cp2y="2.0"/>
+                              <point x="2.0" y="22.0" cp1x="2.0" cp1y="22.0" cp2x="2.0" cp2y="22.0"/>
+                              <point x="120.0" y="22.0" cp1x="120.0" cp1y="22.0" cp2x="120.0" cp2y="22.0"/>
+                              <point x="120.0" y="2.0" cp1x="120.0" cp1y="2.0" cp2x="120.0" cp2y="2.0"/>
+                              <point x="121.4" y="2.0" cp1x="121.5" cp1y="2.0" cp2x="121.5" cp2y="2.0"/>
+                              <point x="121.4" y="23.4" cp1x="121.4" cp1y="23.4" cp2x="121.4" cp2y="23.4"/>
+                              <point x="0.6" y="23.4" cp1x="0.6" cp1y="23.4" cp2x="0.6" cp2y="23.4"/>
+                              <point x="0.6" y="0.6" cp1x="0.6" cp1y="0.6" cp2x="0.6" cp2y="0.6"/>
+                              <point x="121.4" y="0.6" cp1x="121.4" cp1y="0.6" cp2x="121.4" cp2y="0.6"/>
+                              <point x="121.4" y="2.0" cp1x="121.4" cp1y="2.0" cp2x="121.4" cp2y="2.0"/>
+                           </points>
+                        </path>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.25000000000000044" y2="0.16250000000000006"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+NotInScrollPane">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="122" height="24"/>
+                  <nextLayerNameIndex>3</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="3.0" x2="119.0" y1="21.0" y2="22.0" rounding="0.0">
+                           <matte red="192" green="192" blue="193" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.105344966" brightnessOffset="0.011764705" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="119.0" x2="120.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="3.0" y1="5.0" y2="22.0" rounding="0.0">
+                           <matte red="184" green="184" blue="185" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10512091" brightnessOffset="-0.019607842" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="3.0" x2="119.0" y1="3.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="203" green="203" blue="204" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.6666667" saturationOffset="0.004901961" brightnessOffset="-0.19999999" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="255" green="255" blue="255" alpha="255" componentPropertyName="background" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="2.0" x2="120.0" y1="2.0" y2="5.0" rounding="0.0">
+                           <gradient cycleMethod="NO_CYCLE">
+                              <stop position="0.1" midpoint="0.5">
+                                 <matte red="141" green="142" blue="143" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.0965403" brightnessOffset="-0.18431371" alphaOffset="0"/>
+                              </stop>
+                              <stop position="0.9" midpoint="0.5">
+                                 <matte red="176" green="176" blue="177" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.1048766" brightnessOffset="-0.05098039" alphaOffset="0"/>
+                              </stop>
+                           </gradient>
+                           <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JTextPane" name="TextPane" ui="TextPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="4" bottom="4" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.2" y2="0.1"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.2" y2="0.1"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JEditorPane" name="EditorPane" ui="EditorPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="4" bottom="4" left="6" right="6"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground>
+                     <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="222" green="225" blue="229" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.015872955" saturationOffset="-0.07995863" brightnessOffset="0.15294117" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.2" y2="0.1"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 2">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.2" y2="0.1"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Selected">
+               <style>
+                  <textForeground>
+                     <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                  </textForeground>
+                  <textBackground/>
+                  <background/>
+                  <inherit-textForeground>false</inherit-textForeground>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JToolBar" name="ToolBar" ui="ToolBarUI" subregion="false">
+         <stateTypes>
+            <stateType key="North">
+               <codeSnippet><![CDATA[
+        JToolBar toolbar = (JToolBar)c;
+        return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.NORTH;
+               ]]></codeSnippet>
+            </stateType>
+            <stateType key="East">
+               <codeSnippet><![CDATA[
+        JToolBar toolbar = (JToolBar)c;
+        return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.EAST;
+               ]]></codeSnippet>
+            </stateType>
+            <stateType key="West">
+               <codeSnippet><![CDATA[
+        JToolBar toolbar = (JToolBar)c;
+        return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.WEST;
+               ]]></codeSnippet>
+            </stateType>
+            <stateType key="South">
+               <codeSnippet><![CDATA[
+        JToolBar toolbar = (JToolBar)c;
+        return NimbusLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.SOUTH;
+               ]]></codeSnippet>
+            </stateType>
+         </stateTypes>
+         <contentMargins top="2" bottom="2" left="2" right="2"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates>
+            <state stateKeys="North">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="30" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="1" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="30.0" y1="29.0" y2="30.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="South">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="30" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="30.0" y1="0.0" y2="1.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="East">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="30" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="0" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="30.0" y1="0.0" y2="1.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="West">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="30" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="0" bottom="1" left="0" right="0"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="0.0" x2="30.0" y1="29.0" y2="30.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </borderStates>
+         <regions>
+            <uiIconRegion name="HandleIcon" subregion="true" key="handleIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>2.0</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="11" height="38"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="159" green="164" blue="172" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.03494492" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="38.0" cp1x="0.0" cp1y="38.0" cp2x="0.0" cp2y="38.0"/>
+                                    <point x="0.0" y="36.0" cp1x="0.0" cp1y="36.0" cp2x="0.0" cp2y="36.0"/>
+                                    <point x="2.0" y="38.0" cp1x="2.0" cp1y="38.0" cp2x="2.0" cp2y="38.0"/>
+                                 </points>
+                              </path>
+                              <path>
+                                 <matte red="159" green="164" blue="172" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.03494492" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="0.0" y="2.0" cp1x="0.0" cp1y="2.0" cp2x="0.0" cp2y="2.0"/>
+                                    <point x="2.0" y="0.0" cp1x="2.0" cp1y="0.0" cp2x="2.0" cp2y="0.0"/>
+                                 </points>
+                              </path>
+                              <rectangle x1="10.0" x2="11.0" y1="0.0" y2="38.0" rounding="0.0">
+                                 <matte red="177" green="181" blue="189" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="-0.029675633" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.0" x2="10.0" y1="0.0" y2="38.0" rounding="0.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="211" green="214" blue="219" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.07399663" brightnessOffset="0.11372548" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.0" y1="0.5" x2="1.0" y2="0.5"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="114286d62c0.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>true</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiComponent opaque="false" type="javax.swing.JButton" name="Button" ui="ButtonUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="4" bottom="4" left="4" right="4"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>2.0</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>4</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 3">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="43.85714285714286" y="0.6" cp1x="43.85714285714286" cp1y="0.6" cp2x="43.85714285714286" cp2y="0.6"/>
+                                    <point x="98.0" y="0.6" cp1x="98.0" cp1y="0.6" cp2x="101.0" cp2y="0.6"/>
+                                    <point x="103.42857142857142" y="6.0" cp1x="103.42857142857142" cp1y="3.0" cp2x="103.42857142857142" cp2y="6.0"/>
+                                    <point x="103.49999999999999" y="27.0" cp1x="103.49999999999999" cp1y="27.0" cp2x="103.49999999999999" cp2y="30.0"/>
+                                    <point x="98.0" y="32.35714285714285" cp1x="101.0" cp1y="32.35714285714285" cp2x="98.0" cp2y="32.35714285714285"/>
+                                    <point x="6.0" y="32.35714285714285" cp1x="6.0" cp1y="32.35714285714285" cp2x="3.0" cp2y="32.35714285714285"/>
+                                    <point x="0.6" y="27.0" cp1x="0.6" cp1y="30.0" cp2x="0.6" cp2y="27.0"/>
+                                    <point x="0.6" y="6.071428571428572" cp1x="0.6" cp1y="6.071428571428572" cp2x="0.6" cp2y="3.071428571428571"/>
+                                    <point x="6.0" y="0.6" cp1x="3.0" cp1y="0.6" cp2x="6.0" cp2y="0.6"/>
+                                    <point x="44.0" y="0.6" cp1x="44.0" cp1y="0.6" cp2x="44.0" cp2y="0.6"/>
+                                    <point x="44.0" y="2.4285714285714297" cp1x="44.0" cp1y="2.4285714285714297" cp2x="44.0" cp2y="2.4285714285714297"/>
+                                    <point x="6.0" y="2.4285714285714297" cp1x="6.0" cp1y="2.4285714285714297" cp2x="4.071428571428573" cp2y="2.4285714285714297"/>
+                                    <point x="2.357142857142858" y="5.928571428571429" cp1x="2.312863373522748" cp1y="3.499353333829805" cp2x="2.357142857142858" cp2y="5.928571428571429"/>
+                                    <point x="2.357142857142858" y="27.0" cp1x="2.357142857142858" cp1y="27.0" cp2x="2.357142857142858" cp2y="29.214285714285698"/>
+                                    <point x="6.0" y="30.571428571428562" cp1x="4.214285714285715" cp1y="30.571428571428562" cp2x="6.0" cp2y="30.571428571428562"/>
+                                    <point x="98.0" y="30.571428571428562" cp1x="98.0" cp1y="30.571428571428562" cp2x="100.0714285714286" cp2y="30.571428571428562"/>
+                                    <point x="101.50000000000001" y="27.0" cp1x="101.50000000000001" cp1y="29.214285714285705" cp2x="101.50000000000001" cp2y="27.0"/>
+                                    <point x="101.57142857142858" y="6.0" cp1x="101.57142857142858" cp1y="6.0" cp2x="101.57142857142858" cp2y="3.8571428571428594"/>
+                                    <point x="98.07142857142857" y="2.357142857142858" cp1x="100.21428571428574" cp1y="2.357142857142858" cp2x="98.07142857142857" cp2y="2.357142857142858"/>
+                                    <point x="44.0" y="2.4285714285714297" cp1x="44.0" cp1y="2.4285714285714297" cp2x="44.0" cp2y="2.4285714285714297"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="247" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                                 <matte red="92" green="94" blue="96" alpha="102" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-153"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="247" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="194" green="199" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="204" green="211" blue="224" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="231" green="237" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                                 <matte red="92" green="94" blue="96" alpha="102" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-153"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="33"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="205" green="209" blue="216" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.05960039" brightnessOffset="0.10196078" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="194" green="199" blue="207" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.008547008" saturationOffset="-0.04772438" brightnessOffset="0.06666666" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="164" green="171" blue="184" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0018306673" brightnessOffset="-0.02352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="204" green="211" blue="224" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.0027777553" saturationOffset="-0.0212406" brightnessOffset="0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="231" green="237" blue="251" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0055555105" saturationOffset="-0.030845039" brightnessOffset="0.23921567" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiComponent opaque="false" type="javax.swing.JToggleButton" name="ToggleButton" ui="ToggleButtonUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="4" bottom="4" left="4" right="4"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <cacheMode>NINE_SQUARE_SCALE</cacheMode>
+                  <maxHozCachedImgScaling>2.0</maxHozCachedImgScaling>
+                  <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="34"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="34"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="43.85714285714286" y="0.6" cp1x="43.85714285714286" cp1y="0.6" cp2x="43.85714285714286" cp2y="0.6"/>
+                                    <point x="98.0" y="0.6" cp1x="98.0" cp1y="0.6" cp2x="101.0" cp2y="0.6"/>
+                                    <point x="103.42857142857142" y="6.0" cp1x="103.42857142857142" cp1y="3.0" cp2x="103.42857142857142" cp2y="6.0"/>
+                                    <point x="103.49999999999999" y="27.0" cp1x="103.49999999999999" cp1y="27.0" cp2x="103.49999999999999" cp2y="30.0"/>
+                                    <point x="98.0" y="32.35714285714285" cp1x="101.0" cp1y="32.35714285714285" cp2x="98.0" cp2y="32.35714285714285"/>
+                                    <point x="6.0" y="32.35714285714285" cp1x="6.0" cp1y="32.35714285714285" cp2x="3.0" cp2y="32.35714285714285"/>
+                                    <point x="0.6" y="27.0" cp1x="0.6" cp1y="30.0" cp2x="0.6" cp2y="27.0"/>
+                                    <point x="0.6" y="6.071428571428572" cp1x="0.6" cp1y="6.071428571428572" cp2x="0.6" cp2y="3.071428571428571"/>
+                                    <point x="6.0" y="0.6" cp1x="3.0" cp1y="0.6" cp2x="6.0" cp2y="0.6"/>
+                                    <point x="44.0" y="0.6" cp1x="44.0" cp1y="0.6" cp2x="44.0" cp2y="0.6"/>
+                                    <point x="44.0" y="2.4285714285714297" cp1x="44.0" cp1y="2.4285714285714297" cp2x="44.0" cp2y="2.4285714285714297"/>
+                                    <point x="6.0" y="2.4285714285714297" cp1x="6.0" cp1y="2.4285714285714297" cp2x="4.071428571428573" cp2y="2.4285714285714297"/>
+                                    <point x="2.357142857142858" y="5.928571428571429" cp1x="2.312863373522748" cp1y="3.499353333829805" cp2x="2.357142857142858" cp2y="5.928571428571429"/>
+                                    <point x="2.357142857142858" y="27.0" cp1x="2.357142857142858" cp1y="27.0" cp2x="2.357142857142858" cp2y="29.214285714285698"/>
+                                    <point x="6.0" y="30.571428571428562" cp1x="4.214285714285715" cp1y="30.571428571428562" cp2x="6.0" cp2y="30.571428571428562"/>
+                                    <point x="98.0" y="30.571428571428562" cp1x="98.0" cp1y="30.571428571428562" cp2x="100.0714285714286" cp2y="30.571428571428562"/>
+                                    <point x="101.50000000000001" y="27.0" cp1x="101.50000000000001" cp1y="29.214285714285705" cp2x="101.50000000000001" cp2y="27.0"/>
+                                    <point x="101.57142857142858" y="6.0" cp1x="101.57142857142858" cp1y="6.0" cp2x="101.57142857142858" cp2y="3.8571428571428594"/>
+                                    <point x="98.07142857142857" y="2.357142857142858" cp1x="100.21428571428574" cp1y="2.357142857142858" cp2x="98.07142857142857" cp2y="2.357142857142858"/>
+                                    <point x="44.0" y="2.4285714285714297" cp1x="44.0" cp1y="2.4285714285714297" cp2x="44.0" cp2y="2.4285714285714297"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="34"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="247" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <layer name="Shadow Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="2.0" x2="102.0" y1="3.0" y2="32.0" rounding="12.0">
+                                 <matte red="92" green="94" blue="96" alpha="102" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.06885965" brightnessOffset="-0.36862746" alphaOffset="-153"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="104" height="34"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button Layer">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="101.0" y1="3.0" y2="30.0" rounding="9.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="253" green="253" blue="254" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.055555582" saturationOffset="-0.10658931" brightnessOffset="0.25098038" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.06" midpoint="0.5">
+                                       <matte red="247" green="248" blue="250" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.098526314" brightnessOffset="0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.6" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.7" midpoint="0.5">
+                                       <matte red="233" green="236" blue="242" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.07333623" brightnessOffset="0.20392156" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="102.0" y1="2.0" y2="31.0" rounding="12.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.09" midpoint="0.5">
+                                       <matte red="122" green="126" blue="134" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.020974077" brightnessOffset="-0.21960783" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.95" midpoint="0.5">
+                                       <matte red="42" green="46" blue="54" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.11169591" brightnessOffset="-0.53333336" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="103.4" y1="0.6" y2="32.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="173" green="176" blue="182" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="172" green="175" blue="181" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="10.0">
+                                 <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="173" green="176" blue="182" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="172" green="175" blue="181" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="164" green="166" blue="172" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.06401469" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="190" green="193" blue="199" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06530018" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="189" green="192" blue="198" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06507177" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="125" green="127" blue="131" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06472479" brightnessOffset="-0.23137254" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="164" green="166" blue="171" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.06959064" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="10.0">
+                                 <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ecfc04b.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="164" green="166" blue="172" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0138888955" saturationOffset="-0.06401469" brightnessOffset="-0.07058823" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="190" green="193" blue="199" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06530018" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="189" green="192" blue="198" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06507177" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="125" green="127" blue="131" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06472479" brightnessOffset="-0.23137254" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="164" green="166" blue="171" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.06959064" brightnessOffset="-0.0745098" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="117" green="121" blue="126" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.018518567" saturationOffset="-0.03909774" brightnessOffset="-0.2509804" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="145" green="149" blue="156" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.040013492" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="144" green="147" blue="155" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.039558575" brightnessOffset="-0.1372549" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="66" green="68" blue="70" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.05338346" brightnessOffset="-0.47058824" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="92" green="94" blue="98" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049301825" brightnessOffset="-0.36078432" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="10.0">
+                                 <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139ed92ed8.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Pressed+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="117" green="121" blue="126" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.018518567" saturationOffset="-0.03909774" brightnessOffset="-0.2509804" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="145" green="149" blue="156" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.00505054" saturationOffset="-0.040013492" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="144" green="147" blue="155" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.01010108" saturationOffset="-0.039558575" brightnessOffset="-0.1372549" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="66" green="68" blue="70" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.027777791" saturationOffset="-0.05338346" brightnessOffset="-0.47058824" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="92" green="94" blue="98" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.049301825" brightnessOffset="-0.36078432" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="173" green="176" blue="182" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="172" green="175" blue="181" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="10.0">
+                                 <matte red="255" green="255" blue="255" alpha="169" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-86"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139eda6220.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="MouseOver+Selected+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="149" green="152" blue="157" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.006944418" saturationOffset="-0.0595709" brightnessOffset="-0.12941176" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="173" green="176" blue="182" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.061075766" brightnessOffset="-0.031372547" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="172" green="175" blue="181" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06080256" brightnessOffset="-0.035294116" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="95" green="97" blue="100" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.01111114" saturationOffset="-0.060526315" brightnessOffset="-0.3529412" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="124" green="126" blue="130" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.064372465" brightnessOffset="-0.2352941" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="0.6" x2="71.4" y1="0.6" y2="23.4" rounding="13.0">
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Disabled+Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="72" height="25"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="3.0" x2="69.0" y1="3.0" y2="21.0" rounding="8.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="203" green="206" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06807348" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="0.13368984" midpoint="0.5">
+                                       <matte red="209" green="212" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06924191" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="209" green="212" blue="218" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06924191" brightnessOffset="0.109803915" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.2512626262626261" y2="1.0092592592592593"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="2.0" y2="22.0" rounding="10.0">
+                                 <gradient cycleMethod="NO_CYCLE">
+                                    <stop position="0.0" midpoint="0.5">
+                                       <matte red="195" green="198" blue="204" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.066408664" brightnessOffset="0.054901958" alphaOffset="0"/>
+                                    </stop>
+                                    <stop position="1.0" midpoint="0.5">
+                                       <matte red="203" green="206" blue="212" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.06807348" brightnessOffset="0.086274505" alphaOffset="0"/>
+                                    </stop>
+                                 </gradient>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.24999999999999994" y2="1.0041666666666667"/>
+                              </rectangle>
+                              <rectangle x1="2.0" x2="70.0" y1="3.0" y2="23.0" rounding="10.0">
+                                 <matte red="255" green="255" blue="255" alpha="35" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="-220"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="1139edb5619.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JToolBar$Separator" name="ToolBarSeparator" ui="ToolBarSeparatorUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="2" bottom="3" left="0" right="0"/>
+         <style>
+            <textForeground>
+               <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </textForeground>
+            <textBackground/>
+            <background/>
+            <inherit-textForeground>false</inherit-textForeground>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <maxHozCachedImgScaling>INF</maxHozCachedImgScaling>
+            <maxVertCachedImgScaling>INF</maxVertCachedImgScaling>
+            <uiproperties/>
+         </style>
+         <backgroundStates/>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="false" type="javax.swing.JToolTip" name="ToolTip" ui="ToolTipUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="4" bottom="4" left="4" right="4"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background/>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="10" height="10"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes>
+                        <rectangle x1="1.0" x2="9.0" y1="1.0" y2="9.0" rounding="0.0">
+                           <matte red="242" green="242" blue="189" alpha="255" uiDefaultParentName="info" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="10.0" y1="0.0" y2="1.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="10.0" y1="9.0" y2="10.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="0.0" x2="1.0" y1="1.0" y2="9.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                        <rectangle x1="9.0" x2="10.0" y1="1.0" y2="9.0" rounding="0.0">
+                           <matte red="146" green="151" blue="161" alpha="255" uiDefaultParentName="nimbusBorder" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                           <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                        </rectangle>
+                     </shapes>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JTree" name="Tree" ui="TreeUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground>
+               <matte red="0" green="0" blue="0" alpha="0" uiDefaultParentName="text" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+            </textForeground>
+            <textBackground>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+            </textBackground>
+            <background>
+               <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-textForeground>false</inherit-textForeground>
+            <inherit-textBackground>false</inherit-textBackground>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties>
+               <uiProperty name="rendererFillBackground" type="BOOLEAN" value="false"/>
+               <uiProperty name="leftChildIndent" type="INT" value="12"/>
+               <uiProperty name="rightChildIndent" type="INT" value="4"/>
+               <uiProperty name="drawHorizontalLines" type="BOOLEAN" value="false"/>
+               <uiProperty name="drawVerticalLines" type="BOOLEAN" value="false"/>
+               <uiProperty name="showRootHandles" type="BOOLEAN" value="false"/>
+               <uiProperty name="rendererUseTreeColors" type="BOOLEAN" value="true"/>
+               <uiProperty name="repaintWholeRow" type="BOOLEAN" value="true"/>
+               <uiProperty name="rowHeight" type="INT" value="0"/>
+               <uiProperty name="rendererMargins" type="INSETS">
+                   <insets top="2" left="0" bottom="1" right="5"/>
+               </uiProperty>
+               <uiProperty name="selectionForeground" type="COLOR">
+                  <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusSelectedText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+               </uiProperty>
+               <uiProperty name="selectionBackground" type="COLOR">
+                  <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+               </uiProperty>
+               <uiProperty name="dropLineColor" type="COLOR">
+                  <matte red="242" green="242" blue="242" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0" alphaOffset="0"/>
+               </uiProperty>
+            </uiproperties>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Disabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+            <state stateKeys="Enabled+Selected">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="1" bottom="1" left="1" right="1"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions>
+            <region name="TreeCell" subregion="true" title="Tree Cell">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </background>
+                        <inherit-background>false</inherit-background>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="0" bottom="0" left="15" right="15"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Focused">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background>
+                           <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </background>
+                        <inherit-background>false</inherit-background>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                   <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                                   <point x="0" y="30" cp1x="0" cp1y="30" cp2x="0" cp2y="30"/>
+                                   <point x="100" y="30" cp1x="100" cp1y="30" cp2x="100" cp2y="30"/>
+                                   <point x="100" y="0" cp1x="100" cp1y="0" cp2x="100" cp2y="0"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                   <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                                   <point x="98.8" y="1.2" cp1x="98.8" cp1y="1.2" cp2x="98.8" cp2y="1.2"/>
+                                   <point x="98.8" y="28.8" cp1x="98.8" cp1y="28.8" cp2x="98.8" cp2y="28.8"/>
+                                   <point x="1.2" y="28.8" cp1x="1.2" cp1y="28.8" cp2x="1.2" cp2y="28.8"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                                 <matte red="129" green="129" blue="129" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Selected+Focused">
+                     <style>
+                        <textForeground>
+                           <matte red="255" green="255" blue="255" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="115" green="164" blue="209" alpha="255" uiDefaultParentName="nimbusFocus" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                   <point x="0" y="0" cp1x="0" cp1y="0" cp2x="0" cp2y="0"/>
+                                   <point x="0" y="30" cp1x="0" cp1y="30" cp2x="0" cp2y="30"/>
+                                   <point x="100" y="30" cp1x="100" cp1y="30" cp2x="100" cp2y="30"/>
+                                   <point x="100" y="0" cp1x="100" cp1y="0" cp2x="100" cp2y="0"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                   <point x="1.2" y="1.2" cp1x="1.2" cp1y="1.2" cp2x="1.2" cp2y="1.2"/>
+                                   <point x="98.8" y="1.2" cp1x="98.8" cp1y="1.2" cp2x="98.8" cp2y="1.2"/>
+                                   <point x="98.8" y="28.8" cp1x="98.8" cp1y="28.8" cp2x="98.8" cp2y="28.8"/>
+                                   <point x="1.2" y="28.8" cp1x="1.2" cp1y="28.8" cp2x="1.2" cp2y="28.8"/>
+                                   <point x="1.2" y="0" cp1x="1.2" cp1y="0" cp2x="1.2" cp2y="0"/>
+                                </points>
+                              </path>
+                              <rectangle x1="0.0" x2="100.0" y1="0.0" y2="30.0" rounding="0.0">
+                                 <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                 <paintPoints x1="1.0" y1="0.0" x2="1.0" y2="1.0"/>
+                              </rectangle>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </region>
+            <uiComponent opaque="false" componentName="Tree.cellRenderer" type="javax.swing.JLabel" name="Label" ui="LabelUI" subregion="true">
+               <stateTypes/>
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Disabled">
+                     <style>
+                        <textForeground>
+                           <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                        </textForeground>
+                        <textBackground/>
+                        <background/>
+                        <inherit-textForeground>false</inherit-textForeground>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="100" height="30"/>
+                        <nextLayerNameIndex>2</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Layer 1">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes/>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiComponent>
+            <uiIconRegion name="leafIcon" subregion="true" key="leafIcon" basicKey="Tree.leafIcon">
+                <contentMargins top="0" bottom="0" left="0" right="0"/>
+                <style>
+                    <textForeground/>
+                    <textBackground/>
+                    <background/>
+                    <cacheSettingsInherited>false</cacheSettingsInherited>
+                    <uiproperties/>
+                </style>
+                <backgroundStates>
+                    <state stateKeys="Enabled">
+                        <style>
+                            <textForeground/>
+                            <textBackground/>
+                            <background/>
+                            <uiproperties/>
+                        </style>
+                        <canvas>
+                            <size width="16" height="16"/>
+                            <nextLayerNameIndex>3</nextLayerNameIndex>
+                            <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                            <layer name="Button">
+                                <opacity>1.0</opacity>
+                                <fillOpacity>1.0</fillOpacity>
+                                <blendingMode>NORMAL</blendingMode>
+                                <locked>false</locked>
+                                <visible>true</visible>
+                                <shapes>
+                                <path>
+                                    <matte red="255" green="255" blue="255" alpha="128" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-127"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    <points>
+                                        <point x="10.0" y="2.0" cp1x="10.0" cp1y="2.0" cp2x="10.0" cp2y="2.0"/>
+                                        <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                        <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                        <point x="2.0" y="15.0" cp1x="2.0" cp1y="15.0" cp2x="2.0" cp2y="15.0"/>
+                                        <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                        <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                        <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                        <point x="13.0" y="14.0" cp1x="13.0" cp1y="14.0" cp2x="13.0" cp2y="14.0"/>
+                                        <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                        <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <matte red="138" green="157" blue="176" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.4198052" brightnessOffset="0.14117646" alphaOffset="0"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    <points>
+                                        <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                        <point x="8.74074074074074" y="1.0" cp1x="8.74074074074074" cp1y="1.0" cp2x="8.74074074074074" cp2y="1.0"/>
+                                        <point x="8.777777777777777" y="6.222222222222219" cp1x="8.777777777777777" cp1y="6.222222222222219" cp2x="8.777777777777777" cp2y="6.222222222222219"/>
+                                        <point x="14.0" y="6.2037037037037" cp1x="14.0" cp1y="6.2037037037037" cp2x="14.0" cp2y="6.2037037037037"/>
+                                        <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                        <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.0" midpoint="0.5">
+                                            <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="238" green="242" blue="247" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.013940871" saturationOffset="-0.599277" brightnessOffset="0.41960782" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                    <points>
+                                        <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                        <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                        <point x="2.0" y="15.0" cp1x="2.0" cp1y="15.0" cp2x="2.0" cp2y="15.0"/>
+                                        <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                        <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                        <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.0" midpoint="0.5">
+                                            <matte red="236" green="245" blue="253" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.032679737" saturationOffset="-0.043332636" brightnessOffset="0.24705881" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.04629629629629636" y1="0.9675925925925929" x2="0.48611111111111094" y2="0.5324074074074074"/>
+                                    <points>
+                                        <point x="10.0" y="1.0" cp1x="10.0" cp1y="1.0" cp2x="10.0" cp2y="1.0"/>
+                                        <point x="10.0" y="5.0" cp1x="10.0" cp1y="5.0" cp2x="10.0" cp2y="5.0"/>
+                                        <point x="14.0" y="5.0" cp1x="14.0" cp1y="5.0" cp2x="14.0" cp2y="5.0"/>
+                                    </points>
+                                </path>
+                                <rectangle x1="2.0" x2="14.0" y1="15.0" y2="16.0" rounding="0.0">
+                                    <matte red="97" green="98" blue="102" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                </rectangle>
+                                <path>
+                                    <matte red="149" green="151" blue="156" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.007936537" saturationOffset="-0.065654516" brightnessOffset="-0.13333333" alphaOffset="0"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    <points>
+                                        <point x="1.0" y="0.0" cp1x="1.0" cp1y="0.0" cp2x="1.0" cp2y="0.0"/>
+                                        <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                        <point x="2.0" y="16.0" cp1x="2.0" cp1y="16.0" cp2x="2.0" cp2y="16.0"/>
+                                        <point x="2.0" y="1.0" cp1x="2.0" cp1y="1.0" cp2x="2.0" cp2y="1.0"/>
+                                        <point x="10.518518518518523" y="0.9999999999999999" cp1x="10.518518518518523" cp1y="0.9999999999999999" cp2x="10.518518518518523" cp2y="0.9999999999999999"/>
+                                        <point x="14.000000000000002" y="4.5" cp1x="14.000000000000002" cp1y="4.5" cp2x="14.000000000000002" cp2y="4.5"/>
+                                        <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                        <point x="15.0" y="16.0" cp1x="15.0" cp1y="16.0" cp2x="15.0" cp2y="16.0"/>
+                                        <point x="15.0" y="4.444444444444441" cp1x="15.0" cp1y="4.444444444444441" cp2x="15.0" cp2y="4.444444444444441"/>
+                                        <point x="10.722222222222225" y="0.0" cp1x="10.722222222222225" cp1y="0.0" cp2x="10.722222222222225" cp2y="0.0"/>
+                                    </points>
+                                </path>
+                                </shapes>
+                                <effects/>
+                            </layer>
+                            <templateLayer fileName="113fe634ff9.png">
+                                <layer name="Template" type="template">
+                                <opacity>1.0</opacity>
+                                <fillOpacity>1.0</fillOpacity>
+                                <blendingMode>NORMAL</blendingMode>
+                                <locked>false</locked>
+                                <visible>false</visible>
+                                <shapes/>
+                                <effects/>
+                                </layer>
+                            </templateLayer>
+                        </canvas>
+                    </state>
+                </backgroundStates>
+                <foregroundStates/>
+                <borderStates/>
+                <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="closedIcon" subregion="true" key="closedIcon" basicKey="Tree.closedIcon">
+                <contentMargins top="0" bottom="0" left="0" right="0"/>
+                <style>
+                    <textForeground/>
+                    <textBackground/>
+                    <background/>
+                    <cacheSettingsInherited>false</cacheSettingsInherited>
+                    <uiproperties/>
+                </style>
+                <backgroundStates>
+                    <state stateKeys="Enabled">
+                        <style>
+                            <textForeground/>
+                            <textBackground/>
+                            <background/>
+                            <uiproperties/>
+                        </style>
+                        <canvas>
+                            <size width="16" height="16"/>
+                            <nextLayerNameIndex>4</nextLayerNameIndex>
+                            <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                            <layer name="Button">
+                                <opacity>1.0</opacity>
+                                <fillOpacity>1.0</fillOpacity>
+                                <blendingMode>NORMAL</blendingMode>
+                                <locked>false</locked>
+                                <visible>true</visible>
+                                <shapes>
+                                <path>
+                                    <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    <points>
+                                        <point x="12.0" y="12.0" cp1x="12.0" cp1y="12.0" cp2x="12.0" cp2y="12.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.0" midpoint="0.5">
+                                            <matte red="100" green="122" blue="143" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0027436614" saturationOffset="-0.335015" brightnessOffset="0.011764705" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="0.25449103" midpoint="0.5">
+                                            <matte red="111" green="130" blue="148" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0024294257" saturationOffset="-0.3857143" brightnessOffset="0.031372547" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="76" green="91" blue="105" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0018081069" saturationOffset="-0.3595238" brightnessOffset="-0.13725492" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                    <points>
+                                        <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                        <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                        <point x="3.7407407407407405" y="3.9999999999999996" cp1x="3.7407407407407405" cp1y="3.9999999999999996" cp2x="3.7407407407407405" cp2y="3.9999999999999996"/>
+                                        <point x="2.0185185185185137" y="10.05555555555555" cp1x="2.0185185185185137" cp1y="10.05555555555555" cp2x="2.0185185185185137" cp2y="10.05555555555555"/>
+                                        <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                        <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                        <point x="2.9629629629629632" y="12.129629629629632" cp1x="2.9629629629629632" cp1y="12.129629629629632" cp2x="2.9629629629629632" cp2y="12.129629629629632"/>
+                                        <point x="4.579999999999991" y="4.98" cp1x="4.579999999999991" cp1y="4.98" cp2x="4.579999999999991" cp2y="4.98"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.0" midpoint="0.5">
+                                            <matte red="72" green="97" blue="120" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0012094378" saturationOffset="-0.23571429" brightnessOffset="-0.0784314" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="35" green="55" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.115166366" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                    <points>
+                                        <point x="16.0" y="4.0" cp1x="16.0" cp1y="4.0" cp2x="16.0" cp2y="4.0"/>
+                                        <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                        <point x="13.0" y="5.0" cp1x="13.0" cp1y="5.0" cp2x="13.0" cp2y="5.0"/>
+                                        <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                        <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                        <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                        <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                        <point x="2.9444444444444438" y="1.0185185185185186" cp1x="2.9444444444444438" cp1y="1.0185185185185186" cp2x="2.9444444444444438" cp2y="1.0185185185185186"/>
+                                        <point x="2.9814814814814814" y="1.7407407407407403" cp1x="2.9814814814814814" cp1y="1.7407407407407403" cp2x="2.9814814814814814" cp2y="1.7407407407407403"/>
+                                        <point x="1.7407407407407407" y="3.0" cp1x="1.7407407407407407" cp1y="3.0" cp2x="1.7407407407407407" cp2y="3.0"/>
+                                        <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                        <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                        <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                        <point x="14.0" y="7.0" cp1x="14.0" cp1y="7.0" cp2x="14.0" cp2y="7.0"/>
+                                        <point x="14.87037037037037" y="5.962962962962965" cp1x="14.87037037037037" cp1y="5.962962962962965" cp2x="14.87037037037037" cp2y="5.962962962962965"/>
+                                        <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                        <point x="16.0" y="5.0" cp1x="16.0" cp1y="5.0" cp2x="16.0" cp2y="5.0"/>
+                                        <point x="15.462962962962967" y="6.129629629629629" cp1x="15.462962962962967" cp1y="6.129629629629629" cp2x="15.462962962962967" cp2y="6.129629629629629"/>
+                                        <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                        <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                        <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                        <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                        <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                        <point x="0.0" y="3.25925925925926" cp1x="0.0" cp1y="3.25925925925926" cp2x="0.0" cp2y="3.25925925925926"/>
+                                        <point x="3.1851851851851856" y="0.0" cp1x="3.1851851851851856" cp1y="0.0" cp2x="3.1851851851851856" cp2y="0.0"/>
+                                        <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                        <point x="8.55555555555555" y="2.0000000000000004" cp1x="8.55555555555555" cp1y="2.0000000000000004" cp2x="8.55555555555555" cp2y="2.0000000000000004"/>
+                                        <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="13.0" cp2y="2.0"/>
+                                        <point x="14.0" y="3.0" cp1x="14.0" cp1y="3.0" cp2x="14.0" cp2y="3.0"/>
+                                        <point x="14.0" y="4.0" cp1x="14.0" cp1y="4.0" cp2x="14.0" cp2y="4.0"/>
+                                    </points>
+                                </path>
+                                </shapes>
+                                <effects/>
+                            </layer>
+                            <layer name="Layer 3">
+                                <opacity>1.0</opacity>
+                                <fillOpacity>1.0</fillOpacity>
+                                <blendingMode>NORMAL</blendingMode>
+                                <locked>false</locked>
+                                <visible>true</visible>
+                                <shapes>
+                                <rectangle x1="8.0" x2="13.0" y1="3.0" y2="4.0" rounding="0.0">
+                                    <matte red="255" green="255" blue="255" alpha="155" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-100"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                </rectangle>
+                                <rectangle x1="3.0" x2="7.0" y1="1.0" y2="2.0" rounding="0.0">
+                                    <matte red="255" green="255" blue="255" alpha="205" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-50"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                </rectangle>
+                                <rectangle x1="1.0" x2="2.0" y1="3.0" y2="4.0" rounding="0.0">
+                                    <matte red="255" green="255" blue="255" alpha="130" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-125"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                </rectangle>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.0" midpoint="0.5">
+                                            <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                    <points>
+                                        <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                        <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                        <point x="2.041666666666667" y="10.187499999999998" cp1x="2.041666666666667" cp1y="10.187499999999998" cp2x="2.041666666666667" cp2y="10.187499999999998"/>
+                                        <point x="3.979166666666668" y="4.0" cp1x="3.979166666666668" cp1y="4.0" cp2x="3.979166666666668" cp2y="4.0"/>
+                                        <point x="13.0" y="4.0" cp1x="13.0" cp1y="4.0" cp2x="13.0" cp2y="4.0"/>
+                                        <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                        <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                        <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                        <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                        <point x="3.0" y="1.0" cp1x="3.0" cp1y="1.0" cp2x="3.0" cp2y="1.0"/>
+                                        <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                        <point x="2.0" y="3.0" cp1x="2.0" cp1y="3.0" cp2x="2.0" cp2y="3.0"/>
+                                        <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <gradient cycleMethod="NO_CYCLE">
+                                        <stop position="0.04191617" midpoint="0.5">
+                                            <matte red="178" green="198" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.45978838" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="0.16467066" midpoint="0.5">
+                                            <matte red="134" green="162" blue="188" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.34848025" brightnessOffset="0.18823528" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="0.3263473" midpoint="0.5">
+                                            <matte red="111" green="139" blue="165" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.30844158" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                        </stop>
+                                        <stop position="1.0" midpoint="0.5">
+                                            <matte red="95" green="123" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.27329817" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                        </stop>
+                                    </gradient>
+                                    <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                    <points>
+                                        <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                        <point x="3.0185185185185186" y="10.055555555555559" cp1x="3.0185185185185186" cp1y="10.055555555555559" cp2x="3.0185185185185186" cp2y="10.055555555555559"/>
+                                        <point x="4.0" y="5.0" cp1x="4.0" cp1y="5.0" cp2x="4.0" cp2y="5.0"/>
+                                        <point x="15.0" y="5.0" cp1x="15.0" cp1y="5.0" cp2x="15.0" cp2y="5.0"/>
+                                        <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                        <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                    </points>
+                                </path>
+                                <path>
+                                    <matte red="121" green="126" blue="136" alpha="156" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.21" alphaOffset="-99"/>
+                                    <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    <points>
+                                        <point x="0.0" y="13.0" cp1x="0.0" cp1y="13.0" cp2x="0.0" cp2y="13.0"/>
+                                        <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                        <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                        <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                        <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                        <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                    </points>
+                                </path>
+                                </shapes>
+                                <effects/>
+                            </layer>
+                            <templateLayer fileName="113fe6c9b39.png">
+                                <layer name="Template" type="template">
+                                <opacity>1.0</opacity>
+                                <fillOpacity>1.0</fillOpacity>
+                                <blendingMode>NORMAL</blendingMode>
+                                <locked>false</locked>
+                                <visible>false</visible>
+                                <shapes/>
+                                <effects/>
+                                </layer>
+                            </templateLayer>
+                        </canvas>
+                    </state>
+                </backgroundStates>
+                <foregroundStates/>
+                <borderStates/>
+                <regions/>
+            </uiIconRegion>
+                <uiIconRegion name="openIcon" subregion="true" key="openIcon" basicKey="Tree.openIcon">
+                    <contentMargins top="0" bottom="0" left="0" right="0"/>
+                    <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <cacheSettingsInherited>false</cacheSettingsInherited>
+                        <uiproperties/>
+                    </style>
+                    <backgroundStates>
+                        <state stateKeys="Enabled">
+                           <style>
+                              <textForeground/>
+                              <textBackground/>
+                              <background/>
+                              <uiproperties/>
+                           </style>
+                           <canvas>
+                              <size width="16" height="16"/>
+                              <nextLayerNameIndex>4</nextLayerNameIndex>
+                              <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                              <layer name="Button">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <path>
+                                       <matte red="255" green="200" blue="0" alpha="255" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="12.0" y="12.0" cp1x="12.0" cp1y="12.0" cp2x="12.0" cp2y="12.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="93" green="113" blue="133" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.33496243" brightnessOffset="-0.027450979" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="82" green="98" blue="113" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0019934773" saturationOffset="-0.361378" brightnessOffset="-0.10588238" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                          <point x="3.6999999999999997" y="6.0" cp1x="3.6999999999999997" cp1y="6.0" cp2x="3.6999999999999997" cp2y="6.0"/>
+                                          <point x="2.0" y="11.0" cp1x="2.0" cp1y="11.0" cp2x="2.0" cp2y="11.0"/>
+                                          <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                          <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                          <point x="2.9629629629629632" y="12.129629629629632" cp1x="2.9629629629629632" cp1y="12.129629629629632" cp2x="2.9629629629629632" cp2y="12.129629629629632"/>
+                                          <point x="4.0" y="7.0" cp1x="4.0" cp1y="7.0" cp2x="4.0" cp2y="7.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="72" green="97" blue="120" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0012094378" saturationOffset="-0.23571429" brightnessOffset="-0.0784314" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="35" green="55" blue="73" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.115166366" brightnessOffset="-0.2627451" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="16.0" y="6.0" cp1x="16.0" cp1y="6.0" cp2x="16.0" cp2y="6.0"/>
+                                          <point x="16.0" y="7.0" cp1x="16.0" cp1y="7.0" cp2x="16.0" cp2y="7.0"/>
+                                          <point x="13.0" y="7.0" cp1x="13.0" cp1y="7.0" cp2x="13.0" cp2y="7.0"/>
+                                          <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                          <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                          <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                          <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                          <point x="2.9444444444444438" y="1.0185185185185186" cp1x="2.9444444444444438" cp1y="1.0185185185185186" cp2x="2.9444444444444438" cp2y="1.0185185185185186"/>
+                                          <point x="2.9814814814814814" y="1.7407407407407403" cp1x="2.9814814814814814" cp1y="1.7407407407407403" cp2x="2.9814814814814814" cp2y="1.7407407407407403"/>
+                                          <point x="1.7407407407407407" y="3.0" cp1x="1.7407407407407407" cp1y="3.0" cp2x="1.7407407407407407" cp2y="3.0"/>
+                                          <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                          <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                          <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                          <point x="14.0" y="11.0" cp1x="14.0" cp1y="11.0" cp2x="14.0" cp2y="11.0"/>
+                                          <point x="14.0" y="10.0" cp1x="14.0" cp1y="10.0" cp2x="14.0" cp2y="10.0"/>
+                                          <point x="15.579999999999997" y="7.120000000000004" cp1x="15.579999999999997" cp1y="7.120000000000004" cp2x="15.579999999999997" cp2y="7.120000000000004"/>
+                                          <point x="15.900000000000007" y="7.260000000000004" cp1x="15.900000000000007" cp1y="7.260000000000004" cp2x="15.900000000000007" cp2y="7.260000000000004"/>
+                                          <point x="15.0" y="10.0" cp1x="15.0" cp1y="10.0" cp2x="15.0" cp2y="10.0"/>
+                                          <point x="15.0" y="11.0" cp1x="15.0" cp1y="11.0" cp2x="15.0" cp2y="11.0"/>
+                                          <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                          <point x="14.0" y="15.0" cp1x="14.0" cp1y="15.0" cp2x="14.0" cp2y="15.0"/>
+                                          <point x="1.0" y="15.0" cp1x="1.0" cp1y="15.0" cp2x="1.0" cp2y="15.0"/>
+                                          <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                          <point x="0.0" y="3.25925925925926" cp1x="0.0" cp1y="3.25925925925926" cp2x="0.0" cp2y="3.25925925925926"/>
+                                          <point x="3.1851851851851856" y="0.0" cp1x="3.1851851851851856" cp1y="0.0" cp2x="3.1851851851851856" cp2y="0.0"/>
+                                          <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                          <point x="8.55555555555555" y="2.0000000000000004" cp1x="8.55555555555555" cp1y="2.0000000000000004" cp2x="8.55555555555555" cp2y="2.0000000000000004"/>
+                                          <point x="13.0" y="2.0" cp1x="13.0" cp1y="2.0" cp2x="13.0" cp2y="2.0"/>
+                                          <point x="14.0" y="3.0" cp1x="14.0" cp1y="3.0" cp2x="14.0" cp2y="3.0"/>
+                                          <point x="14.0" y="6.0" cp1x="14.0" cp1y="6.0" cp2x="14.0" cp2y="6.0"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <layer name="Layer 3">
+                                 <opacity>1.0</opacity>
+                                 <fillOpacity>1.0</fillOpacity>
+                                 <blendingMode>NORMAL</blendingMode>
+                                 <locked>false</locked>
+                                 <visible>true</visible>
+                                 <shapes>
+                                    <rectangle x1="8.0" x2="13.0" y1="3.0" y2="4.0" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="155" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-100"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="3.0" x2="7.0" y1="1.0" y2="2.0" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="205" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-50"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <rectangle x1="1.0" x2="2.0" y1="3.0" y2="4.0" rounding="0.0">
+                                       <matte red="255" green="255" blue="255" alpha="130" uiDefaultParentName="nimbusBase" hueOffset="0.0" saturationOffset="-0.6357143" brightnessOffset="0.45098037" alphaOffset="-125"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                    </rectangle>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.0" midpoint="0.5">
+                                             <matte red="202" green="215" blue="229" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0077680945" saturationOffset="-0.51781034" brightnessOffset="0.3490196" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="248" green="250" blue="252" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.004681647" saturationOffset="-0.6198413" brightnessOffset="0.43921566" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="1.0" y="14.0" cp1x="1.0" cp1y="14.0" cp2x="1.0" cp2y="14.0"/>
+                                          <point x="2.0" y="14.0" cp1x="2.0" cp1y="14.0" cp2x="2.0" cp2y="14.0"/>
+                                          <point x="2.0" y="11.0" cp1x="2.0" cp1y="11.0" cp2x="2.0" cp2y="11.0"/>
+                                          <point x="4.0" y="6.0" cp1x="4.0" cp1y="6.0" cp2x="4.0" cp2y="6.0"/>
+                                          <point x="13.0" y="6.0" cp1x="13.0" cp1y="6.0" cp2x="13.0" cp2y="6.0"/>
+                                          <point x="13.0" y="3.0" cp1x="13.0" cp1y="3.0" cp2x="13.0" cp2y="3.0"/>
+                                          <point x="8.0" y="3.0" cp1x="8.0" cp1y="3.0" cp2x="8.0" cp2y="3.0"/>
+                                          <point x="7.0" y="2.0" cp1x="7.0" cp1y="2.0" cp2x="7.0" cp2y="2.0"/>
+                                          <point x="7.0" y="1.0" cp1x="7.0" cp1y="1.0" cp2x="7.0" cp2y="1.0"/>
+                                          <point x="3.0" y="1.0" cp1x="3.0" cp1y="1.0" cp2x="3.0" cp2y="1.0"/>
+                                          <point x="3.0" y="2.0" cp1x="3.0" cp1y="2.0" cp2x="3.0" cp2y="2.0"/>
+                                          <point x="2.0" y="3.0" cp1x="2.0" cp1y="3.0" cp2x="2.0" cp2y="3.0"/>
+                                          <point x="1.0" y="3.0" cp1x="1.0" cp1y="3.0" cp2x="1.0" cp2y="3.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <gradient cycleMethod="NO_CYCLE">
+                                          <stop position="0.04191617" midpoint="0.5">
+                                             <matte red="178" green="198" blue="216" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="2.9569864E-4" saturationOffset="-0.45978838" brightnessOffset="0.2980392" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.16467066" midpoint="0.5">
+                                             <matte red="134" green="162" blue="188" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.34848025" brightnessOffset="0.18823528" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="0.3263473" midpoint="0.5">
+                                             <matte red="111" green="139" blue="165" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.30844158" brightnessOffset="0.09803921" alphaOffset="0"/>
+                                          </stop>
+                                          <stop position="1.0" midpoint="0.5">
+                                             <matte red="95" green="123" blue="149" alpha="255" uiDefaultParentName="nimbusBase" hueOffset="0.0015952587" saturationOffset="-0.27329817" brightnessOffset="0.035294116" alphaOffset="0"/>
+                                          </stop>
+                                       </gradient>
+                                       <paintPoints x1="0.5" y1="0.0" x2="0.5" y2="1.0"/>
+                                       <points>
+                                          <point x="3.0" y="14.0" cp1x="3.0" cp1y="14.0" cp2x="3.0" cp2y="14.0"/>
+                                          <point x="3.0" y="12.0" cp1x="3.0" cp1y="12.0" cp2x="3.0" cp2y="12.0"/>
+                                          <point x="4.0" y="7.0" cp1x="4.0" cp1y="7.0" cp2x="4.0" cp2y="7.0"/>
+                                          <point x="15.0" y="7.0" cp1x="15.0" cp1y="7.0" cp2x="15.0" cp2y="7.0"/>
+                                          <point x="15.0" y="9.0" cp1x="15.0" cp1y="9.0" cp2x="15.0" cp2y="9.0"/>
+                                          <point x="14.0" y="14.0" cp1x="14.0" cp1y="14.0" cp2x="14.0" cp2y="14.0"/>
+                                       </points>
+                                    </path>
+                                    <path>
+                                       <matte red="121" green="126" blue="136" alpha="156" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="-0.21" alphaOffset="-99"/>
+                                       <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                       <points>
+                                          <point x="0.0" y="13.0" cp1x="0.0" cp1y="13.0" cp2x="0.0" cp2y="13.0"/>
+                                          <point x="0.0" y="14.0" cp1x="0.0" cp1y="14.0" cp2x="0.0" cp2y="14.0"/>
+                                          <point x="1.0" y="16.0" cp1x="1.0" cp1y="16.0" cp2x="1.0" cp2y="16.0"/>
+                                          <point x="14.0" y="16.0" cp1x="14.0" cp1y="16.0" cp2x="14.0" cp2y="16.0"/>
+                                          <point x="15.0" y="14.0" cp1x="15.0" cp1y="14.0" cp2x="15.0" cp2y="14.0"/>
+                                          <point x="15.0" y="13.0" cp1x="15.0" cp1y="13.0" cp2x="15.0" cp2y="13.0"/>
+                                       </points>
+                                    </path>
+                                 </shapes>
+                                 <effects/>
+                              </layer>
+                              <templateLayer fileName="113fe83f65c.png">
+                                 <layer name="Template" type="template">
+                                    <opacity>1.0</opacity>
+                                    <fillOpacity>1.0</fillOpacity>
+                                    <blendingMode>NORMAL</blendingMode>
+                                    <locked>false</locked>
+                                    <visible>false</visible>
+                                    <shapes/>
+                                    <effects/>
+                                 </layer>
+                              </templateLayer>
+                           </canvas>
+                    </state>
+                </backgroundStates>
+                <foregroundStates/>
+                <borderStates/>
+                <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="collapsedIcon" subregion="true" key="collapsedIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="7"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="102" green="102" blue="102" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.34509805" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="6.918032786885245" y="3.5081967213114753" cp1x="6.918032786885245" cp1y="3.5081967213114753" cp2x="6.918032786885245" cp2y="3.5081967213114753"/>
+                                    <point x="0.0" y="7.0" cp1x="0.0" cp1y="7.0" cp2x="0.0" cp2y="7.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113fe61c072.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="7"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="6.918032786885245" y="3.5081967213114753" cp1x="6.918032786885245" cp1y="3.5081967213114753" cp2x="6.918032786885245" cp2y="3.5081967213114753"/>
+                                    <point x="0.0" y="7.0" cp1x="0.0" cp1y="7.0" cp2x="0.0" cp2y="7.0"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+            <uiIconRegion name="expandedIcon" subregion="true" key="expandedIcon">
+               <contentMargins top="0" bottom="0" left="0" right="0"/>
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <cacheSettingsInherited>false</cacheSettingsInherited>
+                  <uiproperties/>
+               </style>
+               <backgroundStates>
+                  <state stateKeys="Enabled">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="7"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="102" green="102" blue="102" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="-0.6111111" saturationOffset="-0.110526316" brightnessOffset="-0.34509805" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="3.5409836065573774" y="6.950819672131146" cp1x="3.5409836065573774" cp1y="6.950819672131146" cp2x="3.5409836065573774" cp2y="6.950819672131146"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                        <templateLayer fileName="113fe6289fa.png">
+                           <layer name="Template" type="template">
+                              <opacity>1.0</opacity>
+                              <fillOpacity>1.0</fillOpacity>
+                              <blendingMode>NORMAL</blendingMode>
+                              <locked>false</locked>
+                              <visible>false</visible>
+                              <shapes/>
+                              <effects/>
+                           </layer>
+                        </templateLayer>
+                     </canvas>
+                  </state>
+                  <state stateKeys="Enabled+Selected">
+                     <style>
+                        <textForeground/>
+                        <textBackground/>
+                        <background/>
+                        <uiproperties/>
+                     </style>
+                     <canvas>
+                        <size width="18" height="7"/>
+                        <nextLayerNameIndex>3</nextLayerNameIndex>
+                        <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                        <layer name="Button">
+                           <opacity>1.0</opacity>
+                           <fillOpacity>1.0</fillOpacity>
+                           <blendingMode>NORMAL</blendingMode>
+                           <locked>false</locked>
+                           <visible>true</visible>
+                           <shapes>
+                              <path>
+                                 <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusBlueGrey" hueOffset="0.0" saturationOffset="-0.110526316" brightnessOffset="0.25490195" alphaOffset="0"/>
+                                 <paintPoints x1="0.25" y1="0.0" x2="0.75" y2="1.0"/>
+                                 <points>
+                                    <point x="0.0" y="0.0" cp1x="0.0" cp1y="0.0" cp2x="0.0" cp2y="0.0"/>
+                                    <point x="7.0" y="0.0" cp1x="7.0" cp1y="0.0" cp2x="7.0" cp2y="0.0"/>
+                                    <point x="3.5409836065573774" y="6.950819672131146" cp1x="3.5409836065573774" cp1y="6.950819672131146" cp2x="3.5409836065573774" cp2y="6.950819672131146"/>
+                                 </points>
+                              </path>
+                           </shapes>
+                           <effects/>
+                        </layer>
+                     </canvas>
+                  </state>
+               </backgroundStates>
+               <foregroundStates/>
+               <borderStates/>
+               <regions/>
+            </uiIconRegion>
+         </regions>
+      </uiComponent>
+      <uiComponent opaque="true" type="javax.swing.JRootPane" name="RootPane" ui="RootPaneUI" subregion="false">
+         <stateTypes/>
+         <contentMargins top="0" bottom="0" left="0" right="0"/>
+         <style>
+            <textForeground/>
+            <textBackground/>
+            <background>
+               <matte red="214" green="217" blue="223" alpha="255" uiDefaultParentName="control" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
+            </background>
+            <inherit-background>false</inherit-background>
+            <cacheSettingsInherited>false</cacheSettingsInherited>
+            <cacheMode>NO_CACHING</cacheMode>
+            <uiproperties/>
+         </style>
+         <backgroundStates>
+            <state stateKeys="Enabled">
+               <style>
+                  <textForeground/>
+                  <textBackground/>
+                  <background/>
+                  <uiproperties/>
+               </style>
+               <canvas>
+                  <size width="100" height="30"/>
+                  <nextLayerNameIndex>2</nextLayerNameIndex>
+                  <stretchingInsets top="5" bottom="5" left="5" right="5"/>
+                  <layer name="Layer 1">
+                     <opacity>1.0</opacity>
+                     <fillOpacity>1.0</fillOpacity>
+                     <blendingMode>NORMAL</blendingMode>
+                     <locked>false</locked>
+                     <visible>true</visible>
+                     <shapes/>
+                     <effects/>
+                  </layer>
+               </canvas>
+            </state>
+         </backgroundStates>
+         <foregroundStates/>
+         <borderStates/>
+         <regions/>
+      </uiComponent>
+   </components>
+</synthModel>
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java
index 33adfc5..edfd896 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java
@@ -113,6 +113,31 @@
                     context.getStyle().getInt(context, "ArrowButton.size", 16);
                 dim = new Dimension(size, size);
             }
+
+            // handle scaling for sizeVarients for special case components. The
+            // key "JComponent.sizeVariant" scales for large/small/mini
+            // components are based on Apples LAF
+            Container parent = context.getComponent().getParent();
+            if (parent instanceof JComponent && !(parent instanceof JComboBox)) {
+                Object scaleKey = ((JComponent)parent).
+                                    getClientProperty("JComponent.sizeVariant");
+                if (scaleKey != null){
+                    if ("large".equals(scaleKey)){
+                        dim = new Dimension(
+                                (int)(dim.width * 1.15),
+                                (int)(dim.height * 1.15));
+                    } else if ("small".equals(scaleKey)){
+                        dim = new Dimension(
+                                (int)(dim.width * 0.857),
+                                (int)(dim.height * 0.857));
+                    } else if ("mini".equals(scaleKey)){
+                        dim = new Dimension(
+                                (int)(dim.width * 0.714),
+                                (int)(dim.height * 0.714));
+                    }
+                }
+            }
+
             context.dispose();
             return dim;
         }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java
index 6b8d4bbc..7687a0d 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java
@@ -29,16 +29,11 @@
 import java.awt.event.*;
 import java.lang.reflect.*;
 import javax.swing.*;
-import javax.accessibility.*;
-import javax.swing.FocusManager;
 import javax.swing.plaf.*;
-import javax.swing.border.*;
-import javax.swing.text.*;
 import javax.swing.event.*;
 import javax.swing.plaf.basic.*;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
-import sun.awt.AppContext;
 import sun.swing.plaf.synth.SynthUI;
 
 /**
@@ -51,11 +46,93 @@
     private SynthStyle style;
     private boolean useListColors;
 
+    /**
+     * Used to adjust the location and size of the popup. Very useful for
+     * situations such as we find in Nimbus where part of the border is used
+     * to paint the focus. In such cases, the border is empty space, and not
+     * part of the "visual" border, and in these cases, you'd like the popup
+     * to be adjusted such that it looks as if it were next to the visual border.
+     * You may want to use negative insets to get the right look.
+     */
+    Insets popupInsets;
+
+    /**
+     * This flag may be set via UIDefaults. By default, it is false, to
+     * preserve backwards compatibility. If true, then the combo will
+     * "act as a button" when it is not editable.
+     */
+    private boolean buttonWhenNotEditable;
+
+    /**
+     * A flag to indicate that the combo box and combo box button should
+     * remain in the PRESSED state while the combo popup is visible.
+     */
+    private boolean pressedWhenPopupVisible;
+
+    /**
+     * When buttonWhenNotEditable is true, this field is used to help make
+     * the combo box appear and function as a button when the combo box is
+     * not editable. In such a state, you can click anywhere on the button
+     * to get it to open the popup. Also, anywhere you hover over the combo
+     * will cause the entire combo to go into "rollover" state, and anywhere
+     * you press will go into "pressed" state. This also keeps in sync the
+     * state of the combo and the arrowButton.
+     */
+    private ButtonHandler buttonHandler;
+
+    /**
+     * Handler for repainting combo when editor component gains/looses focus
+     */
+    private EditorFocusHandler editorFocusHandler;
+
+    /**
+     * If true, then the cell renderer will be forced to be non-opaque when
+     * used for rendering the selected item in the combo box (not in the list),
+     * and forced to opaque after rendering the selected value.
+     */
+    private boolean forceOpaque = false;
+
+    /**
+     * NOTE: This serves the same purpose as the same field in BasicComboBoxUI.
+     * It is here because I could not give the padding field in
+     * BasicComboBoxUI protected access in an update release.
+     */
+    private Insets padding;
+
     public static ComponentUI createUI(JComponent c) {
         return new SynthComboBoxUI();
     }
 
+    /**
+     * @inheritDoc
+     *
+     * Overridden to ensure that ButtonHandler is created prior to any of
+     * the other installXXX methods, since several of them reference
+     * buttonHandler.
+     */
+    @Override
+    public void installUI(JComponent c) {
+        buttonHandler = new ButtonHandler();
+        super.installUI(c);
+    }
+
+    @Override
     protected void installDefaults() {
+        //NOTE: This next line of code was added because, since squareButton in
+        //BasicComboBoxUI is private, I need to have some way of reading it from UIManager.
+        //This is an incomplete solution (since it implies that squareButons,
+        //once set, cannot be reset per state. Probably ok, but not always ok).
+        //This line of code should be removed at the same time that squareButton
+        //is made protected in the super class.
+        super.installDefaults();
+
+        //This is here instead of in updateStyle because the value for padding
+        //needs to remain consistent with the value for padding in
+        //BasicComboBoxUI. I wouldn't have this value here at all if not
+        //for the fact that I cannot make "padding" protected in any way
+        //for an update release. This *should* be fixed in Java 7
+        padding = UIManager.getInsets("ComboBox.padding");
+
         updateStyle(comboBox);
     }
 
@@ -65,12 +142,20 @@
 
         style = SynthLookAndFeel.updateStyle(context, this);
         if (style != oldStyle) {
+            popupInsets = (Insets)style.get(context, "ComboBox.popupInsets");
             useListColors = style.getBoolean(context,
-                                  "ComboBox.rendererUseListColors", true);
+                    "ComboBox.rendererUseListColors", true);
+            buttonWhenNotEditable = style.getBoolean(context,
+                    "ComboBox.buttonWhenNotEditable", false);
+            pressedWhenPopupVisible = style.getBoolean(context,
+                    "ComboBox.pressedWhenPopupVisible", false);
+
             if (oldStyle != null) {
                 uninstallKeyboardActions();
                 installKeyboardActions();
             }
+            forceOpaque = style.getBoolean(context,
+                    "ComboBox.forceOpaque", false);
         }
         context.dispose();
 
@@ -79,11 +164,24 @@
         }
     }
 
+    @Override
     protected void installListeners() {
         comboBox.addPropertyChangeListener(this);
+        comboBox.addMouseListener(buttonHandler);
+        editorFocusHandler = new EditorFocusHandler(comboBox);
         super.installListeners();
     }
 
+    @Override
+    public void uninstallUI(JComponent c) {
+        if (popup instanceof SynthComboPopup) {
+            ((SynthComboPopup)popup).removePopupMenuListener(buttonHandler);
+        }
+        super.uninstallUI(c);
+        buttonHandler = null;
+    }
+
+    @Override
     protected void uninstallDefaults() {
         SynthContext context = getContext(comboBox, ENABLED);
 
@@ -92,11 +190,17 @@
         style = null;
     }
 
+    @Override
     protected void uninstallListeners() {
+        editorFocusHandler.unregister();
         comboBox.removePropertyChangeListener(this);
+        comboBox.removeMouseListener(buttonHandler);
+        buttonHandler.pressed = false;
+        buttonHandler.over = false;
         super.uninstallListeners();
     }
 
+    @Override
     public SynthContext getContext(JComponent c) {
         return getContext(c, getComponentState(c));
     }
@@ -111,18 +215,56 @@
     }
 
     private int getComponentState(JComponent c) {
-        return SynthLookAndFeel.getComponentState(c);
+        // currently we have a broken situation where if a developer
+        // takes the border from a JComboBox and sets it on a JTextField
+        // then the codepath will eventually lead back to this method
+        // but pass in a JTextField instead of JComboBox! In case this
+        // happens, we just return the normal synth state for the component
+        // instead of doing anything special
+        if (!(c instanceof JComboBox)) return SynthLookAndFeel.getComponentState(c);
+
+        JComboBox box = (JComboBox)c;
+        if (shouldActLikeButton()) {
+            int state = ENABLED;
+            if ((!c.isEnabled())) {
+                state = DISABLED;
+            }
+            if (buttonHandler.isPressed()) {
+                state |= PRESSED;
+            }
+            if (buttonHandler.isRollover()) {
+                state |= MOUSE_OVER;
+            }
+            if (box.isFocusOwner()) {
+                state |= FOCUSED;
+            }
+            return state;
+        } else {
+            // for editable combos the editor component has the focus not the
+            // combo box its self, so we should make the combo paint focused
+            // when its editor has focus
+            int basicState = SynthLookAndFeel.getComponentState(c);
+            if (box.isEditable() &&
+                     box.getEditor().getEditorComponent().isFocusOwner()) {
+                basicState |= FOCUSED;
+            }
+            return basicState;
+        }
     }
 
+    @Override
     protected ComboPopup createPopup() {
-        SynthComboPopup popup = new SynthComboPopup( comboBox );
-        return popup;
+        SynthComboPopup p = new SynthComboPopup(comboBox);
+        p.addPopupMenuListener(buttonHandler);
+        return p;
     }
 
+    @Override
     protected ListCellRenderer createRenderer() {
         return new SynthComboBoxRenderer();
     }
 
+    @Override
     protected ComboBoxEditor createEditor() {
         return new SynthComboBoxEditor();
     }
@@ -131,22 +273,25 @@
     // end UI Initialization
     //======================
 
-
+    @Override
     public void propertyChange(PropertyChangeEvent e) {
         if (SynthLookAndFeel.shouldUpdateStyle(e)) {
             updateStyle(comboBox);
         }
     }
 
+    @Override
     protected JButton createArrowButton() {
         SynthArrowButton button = new SynthArrowButton(SwingConstants.SOUTH);
         button.setName("ComboBox.arrowButton");
+        button.setModel(buttonHandler);
         return button;
     }
 
     //=================================
     // begin ComponentUI Implementation
 
+    @Override
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -157,6 +302,7 @@
         context.dispose();
     }
 
+    @Override
     public void paint(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -172,33 +318,23 @@
         }
     }
 
+    @Override
     public void paintBorder(SynthContext context, Graphics g, int x,
                             int y, int w, int h) {
         context.getPainter().paintComboBoxBorder(context, g, x, y, w, h);
     }
 
-
     /**
      * Paints the currently selected item.
      */
+    @Override
     public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) {
         ListCellRenderer renderer = comboBox.getRenderer();
         Component c;
 
-        if ( hasFocus && !isPopupVisible(comboBox) ) {
-            c = renderer.getListCellRendererComponent( listBox,
-                                                       comboBox.getSelectedItem(),
-                                                       -1,
-                                                       false,
-                                                       false );
-        }
-        else {
-            c = renderer.getListCellRendererComponent( listBox,
-                                                       comboBox.getSelectedItem(),
-                                                       -1,
-                                                       false,
-                                                       false );
-        }
+        c = renderer.getListCellRendererComponent(
+                listBox, comboBox.getSelectedItem(), -1, false, false );
+
         // Fix for 4238829: should lay out the JPanel.
         boolean shouldValidate = false;
         if (c instanceof JPanel)  {
@@ -207,36 +343,88 @@
 
         if (c instanceof UIResource) {
             c.setName("ComboBox.renderer");
-            currentValuePane.paintComponent(g,c,comboBox,bounds.x,bounds.y,
-                                        bounds.width,bounds.height, shouldValidate);
         }
-        else {
-            currentValuePane.paintComponent(g,c,comboBox,bounds.x,bounds.y,
-                                        bounds.width,bounds.height, shouldValidate);
+
+        boolean force = forceOpaque && c instanceof JComponent;
+        if (force) {
+            ((JComponent)c).setOpaque(false);
+        }
+
+        int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
+        if (padding != null) {
+            x = bounds.x + padding.left;
+            y = bounds.y + padding.top;
+            w = bounds.width - (padding.left + padding.right);
+            h = bounds.height - (padding.top + padding.bottom);
+        }
+
+        currentValuePane.paintComponent(g, c, comboBox, x, y, w, h, shouldValidate);
+
+        if (force) {
+            ((JComponent)c).setOpaque(true);
         }
     }
 
     /**
+     * @return true if this combo box should act as one big button. Typically
+     * only happens when buttonWhenNotEditable is true, and comboBox.isEditable
+     * is false.
+     */
+    private boolean shouldActLikeButton() {
+        return buttonWhenNotEditable && !comboBox.isEditable();
+    }
+
+    /**
+     * Return the default size of an empty display area of the combo box using
+     * the current renderer and font.
+     *
+     * This method was overridden to use SynthComboBoxRenderer instead of
+     * DefaultListCellRenderer as the default renderer when calculating the
+     * size of the combo box. This is used in the case of the combo not having
+     * any data.
+     *
+     * @return the size of an empty display area
+     * @see #getDisplaySize
+     */
+    @Override
+    protected Dimension getDefaultSize() {
+        SynthComboBoxRenderer r = new SynthComboBoxRenderer();
+        Dimension d = getSizeForComponent(r.getListCellRendererComponent(listBox, " ", -1, false, false));
+        return new Dimension(d.width, d.height);
+    }
+
+    /**
+     * This has been refactored out in hopes that it may be investigated and
+     * simplified for the next major release. adding/removing
+     * the component to the currentValuePane and changing the font may be
+     * redundant operations.
+     *
+     * NOTE: This method was copied in its entirety from BasicComboBoxUI. Might
+     * want to make it protected in BasicComboBoxUI in Java 7
+     */
+    private Dimension getSizeForComponent(Component comp) {
+        currentValuePane.add(comp);
+        comp.setFont(comboBox.getFont());
+        Dimension d = comp.getPreferredSize();
+        currentValuePane.remove(comp);
+        return d;
+    }
+
+    /**
      * From BasicComboBoxRenderer v 1.18.
+     *
+     * Be aware that SynthFileChooserUIImpl relies on the fact that the default
+     * renderer installed on a Synth combo box is a JLabel. If this is changed,
+     * then an assert will fail in SynthFileChooserUIImpl
      */
     private class SynthComboBoxRenderer extends JLabel implements ListCellRenderer, UIResource {
         public SynthComboBoxRenderer() {
             super();
+            setName("ComboBox.renderer");
             setText(" ");
         }
 
-        public String getName() {
-            // As SynthComboBoxRenderer's are asked for a size BEFORE they
-            // are parented getName is overriden to force the name to be
-            // ComboBox.renderer if it isn't set. If we didn't do this the
-            // wrong style could be used for size calculations.
-            String name = super.getName();
-            if (name == null) {
-                return "ComboBox.renderer";
-            }
-            return name;
-        }
-
+        @Override
         public Component getListCellRendererComponent(JList list, Object value,
                          int index, boolean isSelected, boolean cellHasFocus) {
             setName("ComboBox.listRenderer");
@@ -250,8 +438,7 @@
                          SynthLabelUI.class), isSelected, cellHasFocus,
                          list.isEnabled(), false);
                 }
-            }
-            else {
+            } else {
                 setBackground(list.getBackground());
                 setForeground(list.getForeground());
             }
@@ -261,8 +448,7 @@
             if (value instanceof Icon) {
                 setIcon((Icon)value);
                 setText("");
-            }
-            else {
+            } else {
                 String text = (value == null) ? " " : value.toString();
 
                 if ("".equals(text)) {
@@ -276,12 +462,15 @@
             // especially needed for GTK comboboxes, where the
             // ListCellRenderer's state determines the visual state
             // of the combobox.
-            setEnabled(comboBox.isEnabled());
-            setComponentOrientation(comboBox.getComponentOrientation());
+            if (comboBox != null){
+                setEnabled(comboBox.isEnabled());
+                setComponentOrientation(comboBox.getComponentOrientation());
+            }
 
             return this;
         }
 
+        @Override
         public void paint(Graphics g) {
             super.paint(g);
             SynthLookAndFeel.resetSelectedUI();
@@ -302,6 +491,7 @@
             editor.setName("ComboBox.textField");
         }
 
+        @Override
         public Component getEditorComponent() {
             return editor;
         }
@@ -311,6 +501,7 @@
          *
          * @param anObject the displayed value of the editor
          */
+        @Override
         public void setItem(Object anObject) {
             String text;
 
@@ -326,6 +517,7 @@
             }
         }
 
+        @Override
         public Object getItem() {
             Object newValue = editor.getText();
 
@@ -348,17 +540,261 @@
             return newValue;
         }
 
+        @Override
         public void selectAll() {
             editor.selectAll();
             editor.requestFocus();
         }
 
+        @Override
         public void addActionListener(ActionListener l) {
             editor.addActionListener(l);
         }
 
+        @Override
         public void removeActionListener(ActionListener l) {
             editor.removeActionListener(l);
         }
     }
+
+    /**
+     * Handles all the logic for treating the combo as a button when it is
+     * not editable, and when shouldActLikeButton() is true. This class is a
+     * special ButtonModel, and installed on the arrowButton when appropriate.
+     * It also is installed as a mouse listener and mouse motion listener on
+     * the combo box. In this way, the state between the button and combo
+     * are in sync. Whenever one is "over" both are. Whenever one is pressed,
+     * both are.
+     */
+    private final class ButtonHandler extends DefaultButtonModel
+            implements MouseListener, PopupMenuListener {
+        /**
+         * Indicates that the mouse is over the combo or the arrow button.
+         * This field only has meaning if buttonWhenNotEnabled is true.
+         */
+        private boolean over;
+        /**
+         * Indicates that the combo or arrow button has been pressed. This
+         * field only has meaning if buttonWhenNotEnabled is true.
+         */
+        private boolean pressed;
+
+        //------------------------------------------------------------------
+        // State Methods
+        //------------------------------------------------------------------
+
+        /**
+         * <p>Updates the internal "pressed" state. If shouldActLikeButton()
+         * is true, and if this method call will change the internal state,
+         * then the combo and button will be repainted.</p>
+         *
+         * <p>Note that this method is called either when a press event
+         * occurs on the combo box, or on the arrow button.</p>
+         */
+        private void updatePressed(boolean p) {
+            this.pressed = p && isEnabled();
+            if (shouldActLikeButton()) {
+                comboBox.repaint();
+            }
+        }
+
+        /**
+         * <p>Updates the internal "over" state. If shouldActLikeButton()
+         * is true, and if this method call will change the internal state,
+         * then the combo and button will be repainted.</p>
+         *
+         * <p>Note that this method is called either when a mouseover/mouseoff event
+         * occurs on the combo box, or on the arrow button.</p>
+         */
+        private void updateOver(boolean o) {
+            boolean old = isRollover();
+            this.over = o && isEnabled();
+            boolean newo = isRollover();
+            if (shouldActLikeButton() && old != newo) {
+                comboBox.repaint();
+            }
+        }
+
+        //------------------------------------------------------------------
+        // DefaultButtonModel Methods
+        //------------------------------------------------------------------
+
+        /**
+         * {@inheritDoc}
+         *
+         * Ensures that isPressed() will return true if the combo is pressed,
+         * or the arrowButton is pressed, <em>or</em> if the combo popup is
+         * visible. This is the case because a combo box looks pressed when
+         * the popup is visible, and so should the arrow button.
+         */
+        @Override
+        public boolean isPressed() {
+            boolean b = shouldActLikeButton() ? pressed : super.isPressed();
+            return b || (pressedWhenPopupVisible && comboBox.isPopupVisible());
+        }
+
+        /**
+         * {@inheritDoc}
+         *
+         * Ensures that the armed state is in sync with the pressed state
+         * if shouldActLikeButton is true. Without this method, the arrow
+         * button will not look pressed when the popup is open, regardless
+         * of the result of isPressed() alone.
+         */
+        @Override
+        public boolean isArmed() {
+            boolean b = shouldActLikeButton() ||
+                        (pressedWhenPopupVisible && comboBox.isPopupVisible());
+            return b ? isPressed() : super.isArmed();
+        }
+
+        /**
+         * {@inheritDoc}
+         *
+         * Ensures that isRollover() will return true if the combo is
+         * rolled over, or the arrowButton is rolled over.
+         */
+        @Override
+        public boolean isRollover() {
+            return shouldActLikeButton() ? over : super.isRollover();
+        }
+
+        /**
+         * {@inheritDoc}
+         *
+         * Forwards pressed states to the internal "pressed" field
+         */
+        @Override
+        public void setPressed(boolean b) {
+            super.setPressed(b);
+            updatePressed(b);
+        }
+
+        /**
+         * {@inheritDoc}
+         *
+         * Forwards rollover states to the internal "over" field
+         */
+        @Override
+        public void setRollover(boolean b) {
+            super.setRollover(b);
+            updateOver(b);
+        }
+
+        //------------------------------------------------------------------
+        // MouseListener/MouseMotionListener Methods
+        //------------------------------------------------------------------
+
+        @Override
+        public void mouseEntered(MouseEvent mouseEvent) {
+            updateOver(true);
+        }
+
+        @Override
+        public void mouseExited(MouseEvent mouseEvent) {
+            updateOver(false);
+        }
+
+        @Override
+        public void mousePressed(MouseEvent mouseEvent) {
+            updatePressed(true);
+        }
+
+        @Override
+        public void mouseReleased(MouseEvent mouseEvent) {
+            updatePressed(false);
+        }
+
+        @Override
+        public void mouseClicked(MouseEvent e) {}
+
+        //------------------------------------------------------------------
+        // PopupMenuListener Methods
+        //------------------------------------------------------------------
+
+        /**
+         * @inheritDoc
+         *
+         * Ensures that the combo box is repainted when the popup is closed.
+         * This avoids a bug where clicking off the combo wasn't causing a repaint,
+         * and thus the combo box still looked pressed even when it was not.
+         *
+         * This bug was only noticed when acting as a button, but may be generally
+         * present. If so, remove the if() block
+         */
+        @Override
+        public void popupMenuCanceled(PopupMenuEvent e) {
+            if (shouldActLikeButton() || pressedWhenPopupVisible) {
+                comboBox.repaint();
+            }
+        }
+
+        @Override
+        public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
+        @Override
+        public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
+    }
+
+    /**
+     * Handler for repainting combo when editor component gains/looses focus
+     */
+    private static class EditorFocusHandler implements FocusListener,
+            PropertyChangeListener {
+        private JComboBox comboBox;
+        private ComboBoxEditor editor = null;
+        private Component editorComponent = null;
+
+        private EditorFocusHandler(JComboBox comboBox) {
+            this.comboBox = comboBox;
+            editor = comboBox.getEditor();
+            if (editor != null){
+                editorComponent = editor.getEditorComponent();
+                if (editorComponent != null){
+                    editorComponent.addFocusListener(this);
+                }
+            }
+            comboBox.addPropertyChangeListener("editor",this);
+        }
+
+        public void unregister(){
+            comboBox.removePropertyChangeListener(this);
+            if (editorComponent!=null){
+                editorComponent.removeFocusListener(this);
+            }
+        }
+
+        /** Invoked when a component gains the keyboard focus. */
+        public void focusGained(FocusEvent e) {
+            // repaint whole combo on focus gain
+            comboBox.repaint();
+        }
+
+        /** Invoked when a component loses the keyboard focus. */
+        public void focusLost(FocusEvent e) {
+            // repaint whole combo on focus loss
+            comboBox.repaint();
+        }
+
+        /**
+         * Called when the combos editor changes
+         *
+         * @param evt A PropertyChangeEvent object describing the event source and
+         *            the property that has changed.
+         */
+        public void propertyChange(PropertyChangeEvent evt) {
+            ComboBoxEditor newEditor = comboBox.getEditor();
+            if (editor != newEditor){
+                if (editorComponent!=null){
+                    editorComponent.removeFocusListener(this);
+                }
+                editor = newEditor;
+                if (editor != null){
+                    editorComponent = editor.getEditorComponent();
+                    if (editorComponent != null){
+                        editorComponent.addFocusListener(this);
+                    }
+                }
+            }
+        }
+    }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
index 178981f..976ec0a 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
@@ -138,9 +138,9 @@
             }
         }
         else {
-            selectedUIState = SynthConstants.FOCUSED;
             if (enabled) {
                 selectedUIState |= SynthConstants.ENABLED;
+                selectedUIState = SynthConstants.FOCUSED;
             }
             else {
                 selectedUIState |= SynthConstants.DISABLED;
@@ -251,6 +251,26 @@
                     ((SynthLookAndFeel)laf).
                      shouldUpdateStyleOnAncestorChanged());
         }
+        // Note: The following two nimbus based overrides should be refactored
+        // to be in the Nimbus LAF. Due to constraints in an update release,
+        // we couldn't actually provide the public API necessary to allow
+        // NimbusLookAndFeel (a subclass of SynthLookAndFeel) to provide its
+        // own rules for shouldUpdateStyle.
+        else if ("Nimbus.Overrides" == eName) {
+            // Always update when the Nimbus.Overrides client property has
+            // been changed
+            return true;
+        }
+        else if ("Nimbus.Overrides.InheritDefaults" == eName) {
+            // Always update when the Nimbus.Overrides.InheritDefaults
+            // client property has changed
+            return true;
+        }
+        else if ("JComponent.sizeVariant" == eName) {
+            // Always update when the JComponent.sizeVariant
+            // client property has changed
+            return true;
+        }
         return false;
     }
 
@@ -622,6 +642,7 @@
     /**
      * Called by UIManager when this look and feel is installed.
      */
+    @Override
     public void initialize() {
         super.initialize();
         DefaultLookup.setDefaultLookup(new SynthDefaultLookup());
@@ -633,6 +654,7 @@
     /**
      * Called by UIManager when this look and feel is uninstalled.
      */
+    @Override
     public void uninitialize() {
         KeyboardFocusManager.getCurrentKeyboardFocusManager().
             removePropertyChangeListener(_handler);
@@ -647,6 +669,7 @@
      *
      * @return Defaults table.
      */
+    @Override
     public UIDefaults getDefaults() {
         UIDefaults table = new UIDefaults(60, 0.75f);
 
@@ -704,6 +727,7 @@
      *
      * @return true.
      */
+    @Override
     public boolean isSupportedLookAndFeel() {
         return true;
     }
@@ -713,6 +737,7 @@
      *
      * @return false
      */
+    @Override
     public boolean isNativeLookAndFeel() {
         return false;
     }
@@ -722,6 +747,7 @@
      *
      * @return textual description of synth.
      */
+    @Override
     public String getDescription() {
         return "Synth look and feel";
     }
@@ -731,6 +757,7 @@
      *
      * @return a short string identifying this look and feel.
      */
+    @Override
     public String getName() {
         return "Synth look and feel";
     }
@@ -740,6 +767,7 @@
      *
      * @return a short string identifying this look and feel.
      */
+    @Override
     public String getID() {
         return "Synth";
     }
@@ -805,6 +833,7 @@
             tk.addPropertyChangeListener(key, this);
         }
 
+        @Override
         public void propertyChange(PropertyChangeEvent pce) {
             UIDefaults defaults = UIManager.getLookAndFeelDefaults();
             if (defaults.getBoolean("Synth.doNotSetTextAA")) {
@@ -873,6 +902,7 @@
             if (!isUpdatePending()) {
                 setUpdatePending(true);
                 Runnable uiUpdater = new Runnable() {
+                    @Override
                     public void run() {
                         updateAllUIs();
                         setUpdatePending(false);
@@ -889,6 +919,7 @@
     }
 
     private class Handler implements PropertyChangeListener {
+        @Override
         public void propertyChange(PropertyChangeEvent evt) {
             String propertyName = evt.getPropertyName();
             Object newValue = evt.getNewValue();
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
index 93c66c3..c6a7537 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
@@ -27,14 +27,11 @@
 
 import java.awt.*;
 import java.awt.geom.AffineTransform;
-import java.awt.event.*;
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicProgressBarUI;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
-import java.io.Serializable;
 import sun.swing.plaf.synth.SynthUI;
 import sun.swing.SwingUtilities2;
 
@@ -46,24 +43,29 @@
 class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI,
         PropertyChangeListener {
     private SynthStyle style;
-
     private int progressPadding;
+    private boolean rotateText; // added for Nimbus LAF
     private boolean paintOutsideClip;
+    private boolean tileWhenIndeterminate; //whether to tile indeterminate painting
+    private int tileWidth; //the width of each tile
 
     public static ComponentUI createUI(JComponent x) {
         return new SynthProgressBarUI();
     }
 
+    @Override
     protected void installListeners() {
         super.installListeners();
         progressBar.addPropertyChangeListener(this);
     }
 
+    @Override
     protected void uninstallListeners() {
         super.uninstallListeners();
         progressBar.removePropertyChangeListener(this);
     }
 
+    @Override
     protected void installDefaults() {
         updateStyle(progressBar);
     }
@@ -72,17 +74,34 @@
         SynthContext context = getContext(c, ENABLED);
         SynthStyle oldStyle = style;
         style = SynthLookAndFeel.updateStyle(context, this);
-        if (style != oldStyle) {
-            setCellLength(style.getInt(context, "ProgressBar.cellLength", 1));
-            setCellSpacing(style.getInt(context, "ProgressBar.cellSpacing", 0));
-            progressPadding = style.getInt(context,
-                    "ProgressBar.progressPadding", 0);
-            paintOutsideClip = style.getBoolean(context,
-                    "ProgressBar.paintOutsideClip", false);
+        setCellLength(style.getInt(context, "ProgressBar.cellLength", 1));
+        setCellSpacing(style.getInt(context, "ProgressBar.cellSpacing", 0));
+        progressPadding = style.getInt(context,
+                "ProgressBar.progressPadding", 0);
+        paintOutsideClip = style.getBoolean(context,
+                "ProgressBar.paintOutsideClip", false);
+        rotateText = style.getBoolean(context,
+                "ProgressBar.rotateText", false);
+        tileWhenIndeterminate = style.getBoolean(context, "ProgressBar.tileWhenIndeterminate", false);
+        tileWidth = style.getInt(context, "ProgressBar.tileWidth", 15);
+        // handle scaling for sizeVarients for special case components. The
+        // key "JComponent.sizeVariant" scales for large/small/mini
+        // components are based on Apples LAF
+        String scaleKey = (String)progressBar.getClientProperty(
+                "JComponent.sizeVariant");
+        if (scaleKey != null){
+            if ("large".equals(scaleKey)){
+                tileWidth *= 1.15;
+            } else if ("small".equals(scaleKey)){
+                tileWidth *= 0.857;
+            } else if ("mini".equals(scaleKey)){
+                tileWidth *= 0.784;
+            }
         }
         context.dispose();
     }
 
+    @Override
     protected void uninstallDefaults() {
         SynthContext context = getContext(progressBar, ENABLED);
 
@@ -108,6 +127,7 @@
         return SynthLookAndFeel.getComponentState(c);
     }
 
+    @Override
     public int getBaseline(JComponent c, int width, int height) {
         super.getBaseline(c, width, height);
         if (progressBar.isStringPainted() &&
@@ -122,6 +142,16 @@
         return -1;
     }
 
+    @Override
+    protected Rectangle getBox(Rectangle r) {
+        if (tileWhenIndeterminate) {
+            return SwingUtilities.calculateInnerArea(progressBar, r);
+        } else {
+            return super.getBox(r);
+        }
+    }
+
+    @Override
     protected void setAnimationIndex(int newValue) {
         if (paintOutsideClip) {
             if (getAnimationIndex() == newValue) {
@@ -134,6 +164,7 @@
         }
     }
 
+    @Override
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -145,6 +176,7 @@
         context.dispose();
     }
 
+    @Override
     public void paint(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -196,44 +228,98 @@
             width = boxRect.width - progressPadding - progressPadding;
             height = boxRect.height - progressPadding - progressPadding;
         }
-        context.getPainter().paintProgressBarForeground(context, g,
-                x, y, width, height, pBar.getOrientation());
 
-        if (pBar.isStringPainted() && !pBar.isIndeterminate()) {
+        //if tiling and indeterminate, then paint the progress bar foreground a
+        //bit wider than it should be. Shift as needed to ensure that there is
+        //an animated effect
+        if (tileWhenIndeterminate && pBar.isIndeterminate()) {
+            double percentComplete = (double)getAnimationIndex() / (double)getFrameCount();
+            int offset = (int)(percentComplete * tileWidth);
+            Shape clip = g.getClip();
+            g.clipRect(x, y, width, height);
+            if (pBar.getOrientation() == JProgressBar.HORIZONTAL) {
+                //paint each tile horizontally
+                for (int i=x-tileWidth+offset; i<=width; i+=tileWidth) {
+                    context.getPainter().paintProgressBarForeground(
+                            context, g, i, y, tileWidth, height, pBar.getOrientation());
+                }
+            } else { //JProgressBar.VERTICAL
+                //paint each tile vertically
+                for (int i=y-offset; i<height+tileWidth; i+=tileWidth) {
+                    context.getPainter().paintProgressBarForeground(
+                            context, g, x, i, width, tileWidth, pBar.getOrientation());
+                }
+            }
+            g.setClip(clip);
+        } else {
+            context.getPainter().paintProgressBarForeground(context, g,
+                    x, y, width, height, pBar.getOrientation());
+        }
+
+        if (pBar.isStringPainted()) {
             paintText(context, g, pBar.getString());
         }
     }
 
     protected void paintText(SynthContext context, Graphics g,
             String title) {
-        Font font = context.getStyle().getFont(context);
-        FontMetrics metrics = SwingUtilities2.getFontMetrics(progressBar, g,
-                                                             font);
-
         if (progressBar.isStringPainted()) {
-            String pBarString = progressBar.getString();
-            Rectangle bounds = progressBar.getBounds();
-            int strLength = context.getStyle().getGraphicsUtils(context).
-                computeStringWidth(context, font, metrics, pBarString);
-
-            // Calculate the bounds for the text.
-            Rectangle textRect = new Rectangle(
-                (bounds.width / 2) - (strLength / 2),
-                (bounds.height -
-                    (metrics.getAscent() + metrics.getDescent())) / 2,
-                0, 0);
-
-            // Progress bar isn't tall enough for the font.  Don't paint it.
-            if (textRect.y < 0) {
-                return;
-            }
-
-            // Paint the text.
             SynthStyle style = context.getStyle();
-            g.setColor(style.getColor(context, ColorType.TEXT_FOREGROUND));
-            g.setFont(style.getFont(context));
-            style.getGraphicsUtils(context).paintText(context, g, title,
-                                                 textRect.x, textRect.y, -1);
+            Font font = style.getFont(context);
+            FontMetrics fm = SwingUtilities2.getFontMetrics(
+                    progressBar, g, font);
+            int strLength = style.getGraphicsUtils(context).
+                computeStringWidth(context, font, fm, title);
+            Rectangle bounds = progressBar.getBounds();
+
+            if (rotateText &&
+                    progressBar.getOrientation() == JProgressBar.VERTICAL){
+                Graphics2D g2 = (Graphics2D)g;
+                // Calculate the position for the text.
+                Point textPos;
+                AffineTransform rotation;
+                if (progressBar.getComponentOrientation().isLeftToRight()){
+                    rotation = AffineTransform.getRotateInstance(-Math.PI/2);
+                    textPos = new Point(
+                        (bounds.width+fm.getAscent()-fm.getDescent())/2,
+                           (bounds.height+strLength)/2);
+                } else {
+                    rotation = AffineTransform.getRotateInstance(Math.PI/2);
+                    textPos = new Point(
+                        (bounds.width-fm.getAscent()+fm.getDescent())/2,
+                           (bounds.height-strLength)/2);
+                }
+
+                // Progress bar isn't wide enough for the font.  Don't paint it.
+                if (textPos.x < 0) {
+                    return;
+                }
+
+                // Paint the text.
+                font = font.deriveFont(rotation);
+                g2.setFont(font);
+                g2.setColor(style.getColor(context, ColorType.TEXT_FOREGROUND));
+                style.getGraphicsUtils(context).paintText(context, g, title,
+                                                     textPos.x, textPos.y, -1);
+            } else {
+                // Calculate the bounds for the text.
+                Rectangle textRect = new Rectangle(
+                    (bounds.width / 2) - (strLength / 2),
+                    (bounds.height -
+                        (fm.getAscent() + fm.getDescent())) / 2,
+                    0, 0);
+
+                // Progress bar isn't tall enough for the font.  Don't paint it.
+                if (textRect.y < 0) {
+                    return;
+                }
+
+                // Paint the text.
+                g.setColor(style.getColor(context, ColorType.TEXT_FOREGROUND));
+                g.setFont(font);
+                style.getGraphicsUtils(context).paintText(context, g, title,
+                                                     textRect.x, textRect.y, -1);
+            }
         }
     }
 
@@ -244,34 +330,67 @@
     }
 
     public void propertyChange(PropertyChangeEvent e) {
-        if (SynthLookAndFeel.shouldUpdateStyle(e)) {
+        if (SynthLookAndFeel.shouldUpdateStyle(e) ||
+                "indeterminate".equals(e.getPropertyName())) {
             updateStyle((JProgressBar)e.getSource());
         }
     }
 
+    @Override
     public Dimension getPreferredSize(JComponent c) {
-        Dimension       size;
-        Insets          border = progressBar.getInsets();
-        FontMetrics     fontSizer = progressBar.getFontMetrics(
-                                                  progressBar.getFont());
+        Dimension size = null;
+        Insets border = progressBar.getInsets();
+        FontMetrics fontSizer = progressBar.getFontMetrics(progressBar.getFont());
+        String progString = progressBar.getString();
+        int stringHeight = fontSizer.getHeight() + fontSizer.getDescent();
+
         if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
             size = new Dimension(getPreferredInnerHorizontal());
+            if (progressBar.isStringPainted()) {
+                // adjust the height if necessary to make room for the string
+                if (stringHeight > size.height) {
+                    size.height = stringHeight;
+                }
+
+                // adjust the width if necessary to make room for the string
+                int stringWidth = SwingUtilities2.stringWidth(
+                                       progressBar, fontSizer, progString);
+                if (stringWidth > size.width) {
+                    size.width = stringWidth;
+                }
+            }
         } else {
             size = new Dimension(getPreferredInnerVertical());
-        }
-        // Ensure that the progress string will fit.
-        if (progressBar.isStringPainted()) {
-            String progString = progressBar.getString();
-            int stringHeight = fontSizer.getHeight() +
-                    fontSizer.getDescent();
-            if (stringHeight > size.height) {
-                size.height = stringHeight;
+            if (progressBar.isStringPainted()) {
+                // make sure the width is big enough for the string
+                if (stringHeight > size.width) {
+                    size.width = stringHeight;
+                }
+
+                // make sure the height is big enough for the string
+                int stringWidth = SwingUtilities2.stringWidth(
+                                       progressBar, fontSizer, progString);
+                if (stringWidth > size.height) {
+                    size.height = stringWidth;
+                }
             }
-            // This is also for completeness.
-            int stringWidth = SwingUtilities2.stringWidth(
-                                   progressBar, fontSizer, progString);
-            if (stringWidth > size.width) {
-                size.width = stringWidth;
+        }
+
+        // handle scaling for sizeVarients for special case components. The
+        // key "JComponent.sizeVariant" scales for large/small/mini
+        // components are based on Apples LAF
+        String scaleKey = (String)progressBar.getClientProperty(
+                "JComponent.sizeVariant");
+        if (scaleKey != null){
+            if ("large".equals(scaleKey)){
+                size.width *= 1.15f;
+                size.height *= 1.15f;
+            } else if ("small".equals(scaleKey)){
+                size.width *= 0.90f;
+                size.height *= 0.90f;
+            } else if ("mini".equals(scaleKey)){
+                size.width *= 0.784f;
+                size.height *= 0.784f;
             }
         }
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java
index 603810c..6a4b2d7 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java
@@ -26,12 +26,8 @@
 package javax.swing.plaf.synth;
 
 import java.awt.*;
-import java.awt.event.*;
-
 import java.beans.*;
-
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.*;
 import sun.swing.plaf.synth.SynthUI;
@@ -52,12 +48,23 @@
     private boolean validMinimumThumbSize;
     private int scrollBarWidth;
 
+    //These two variables should be removed when the corrosponding ones in BasicScrollBarUI are made protected
+    private int incrGap;
+    private int decrGap;
 
     public static ComponentUI createUI(JComponent c)    {
         return new SynthScrollBarUI();
     }
 
     protected void installDefaults() {
+        //NOTE: This next line of code was added because, since incrGap and decrGap in
+        //BasicScrollBarUI are private, I need to have some way of updating them.
+        //This is an incomplete solution (since it implies that the incrGap and decrGap
+        //are set once, and not reset per state. Probably ok, but not always ok).
+        //This line of code should be removed at the same time that incrGap and
+        //decrGap are removed and made protected in the super class.
+        super.installDefaults();
+
         trackHighlight = NO_HIGHLIGHT;
         if (scrollbar.getLayout() == null ||
                      (scrollbar.getLayout() instanceof UIResource)) {
@@ -89,6 +96,31 @@
             if (maximumThumbSize == null) {
                 maximumThumbSize = new Dimension(4096, 4097);
             }
+
+            incrGap = style.getInt(context, "ScrollBar.incrementButtonGap", 0);
+            decrGap = style.getInt(context, "ScrollBar.decrementButtonGap", 0);
+
+            // handle scaling for sizeVarients for special case components. The
+            // key "JComponent.sizeVariant" scales for large/small/mini
+            // components are based on Apples LAF
+            String scaleKey = (String)scrollbar.getClientProperty(
+                    "JComponent.sizeVariant");
+            if (scaleKey != null){
+                if ("large".equals(scaleKey)){
+                    scrollBarWidth *= 1.15;
+                    incrGap *= 1.15;
+                    decrGap *= 1.15;
+                } else if ("small".equals(scaleKey)){
+                    scrollBarWidth *= 0.857;
+                    incrGap *= 0.857;
+                    decrGap *= 0.857;
+                } else if ("mini".equals(scaleKey)){
+                    scrollBarWidth *= 0.714;
+                    incrGap *= 0.714;
+                    decrGap *= 0.714;
+                }
+            }
+
             if (oldStyle != null) {
                 uninstallKeyboardActions();
                 installKeyboardActions();
@@ -274,18 +306,56 @@
             }
         }
         return minimumThumbSize;
-
     }
 
-
     protected JButton createDecreaseButton(int orientation)  {
-        SynthArrowButton synthArrowButton = new SynthArrowButton(orientation);
+        SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) {
+            @Override
+            public boolean contains(int x, int y) {
+                if (decrGap < 0) { //there is an overlap between the track and button
+                    int width = getWidth();
+                    int height = getHeight();
+                    if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+                        //adjust the height by decrGap
+                        //Note: decrGap is negative!
+                        height += decrGap;
+                    } else {
+                        //adjust the width by decrGap
+                        //Note: decrGap is negative!
+                        width += decrGap;
+                    }
+                    return (x >= 0) && (x < width) && (y >= 0) && (y < height);
+                }
+                return super.contains(x, y);
+            }
+        };
         synthArrowButton.setName("ScrollBar.button");
         return synthArrowButton;
     }
 
     protected JButton createIncreaseButton(int orientation)  {
-        SynthArrowButton synthArrowButton = new SynthArrowButton(orientation);
+        SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) {
+            @Override
+            public boolean contains(int x, int y) {
+                if (incrGap < 0) { //there is an overlap between the track and button
+                    int width = getWidth();
+                    int height = getHeight();
+                    if (scrollbar.getOrientation() == JScrollBar.VERTICAL) {
+                        //adjust the height and y by incrGap
+                        //Note: incrGap is negative!
+                        height += incrGap;
+                        y += incrGap;
+                    } else {
+                        //adjust the width and x by incrGap
+                        //Note: incrGap is negative!
+                        width += incrGap;
+                        x += incrGap;
+                    }
+                    return (x >= 0) && (x < width) && (y >= 0) && (y < height);
+                }
+                return super.contains(x, y);
+            }
+        };
         synthArrowButton.setName("ScrollBar.button");
         return synthArrowButton;
     }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java
index 62f732c..1dfdad6 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java
@@ -26,7 +26,7 @@
 package javax.swing.plaf.synth;
 
 import javax.swing.*;
-import javax.swing.event.*;
+import javax.swing.text.JTextComponent;
 import javax.swing.border.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.*;
@@ -35,7 +35,11 @@
 import java.beans.PropertyChangeEvent;
 
 import java.awt.*;
-import java.awt.event.*;
+import java.awt.event.ContainerListener;
+import java.awt.event.ContainerEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.FocusEvent;
+
 import sun.swing.plaf.synth.SynthUI;
 
 
@@ -47,11 +51,14 @@
 class SynthScrollPaneUI extends BasicScrollPaneUI implements
                  PropertyChangeListener, SynthUI {
     private SynthStyle style;
+    private boolean viewportViewHasFocus = false;
+    private ViewportViewFocusHandler viewportViewFocusHandler;
 
     public static ComponentUI createUI(JComponent x) {
         return new SynthScrollPaneUI();
     }
 
+    @Override
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -62,6 +69,7 @@
         context.dispose();
     }
 
+    @Override
     public void paint(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -83,6 +91,7 @@
         context.getPainter().paintScrollPaneBorder(context, g, x, y, w, h);
     }
 
+    @Override
     protected void installDefaults(JScrollPane scrollpane) {
         updateStyle(scrollpane);
     }
@@ -106,11 +115,21 @@
     }
 
 
+    @Override
     protected void installListeners(JScrollPane c) {
         super.installListeners(c);
         c.addPropertyChangeListener(this);
+        if (UIManager.getBoolean("ScrollPane.useChildTextComponentFocus")){
+            viewportViewFocusHandler = new ViewportViewFocusHandler();
+            c.getViewport().addContainerListener(viewportViewFocusHandler);
+            Component view = c.getViewport().getView();
+            if (view instanceof JTextComponent) {
+                view.addFocusListener(viewportViewFocusHandler);
+            }
+        }
     }
 
+    @Override
     protected void uninstallDefaults(JScrollPane c) {
         SynthContext context = getContext(c, ENABLED);
 
@@ -123,9 +142,18 @@
     }
 
 
+    @Override
     protected void uninstallListeners(JComponent c) {
         super.uninstallListeners(c);
         c.removePropertyChangeListener(this);
+        if (viewportViewFocusHandler != null) {
+            JViewport viewport = ((JScrollPane) c).getViewport();
+            viewport.removeContainerListener(viewportViewFocusHandler);
+            if (viewport.getView()!= null) {
+                viewport.getView().removeFocusListener(viewportViewFocusHandler);
+            }
+            viewportViewFocusHandler = null;
+        }
     }
 
 
@@ -145,7 +173,11 @@
 
 
     private int getComponentState(JComponent c) {
-        return SynthLookAndFeel.getComponentState(c);
+        int baseState = SynthLookAndFeel.getComponentState(c);
+        if (viewportViewFocusHandler!=null && viewportViewHasFocus){
+            baseState = baseState | FOCUSED;
+        }
+        return baseState;
     }
 
     public void propertyChange(PropertyChangeEvent e) {
@@ -167,6 +199,7 @@
             }
         }
 
+        @Override
         public void paintBorder(Component c, Graphics g, int x, int y,
                             int width, int height) {
             JComponent jc = (JComponent)c;
@@ -182,6 +215,7 @@
             context.dispose();
         }
 
+        @Override
         public Insets getBorderInsets(Component c, Insets insets) {
             if (insets == null) {
                 return new Insets(this.insets.top, this.insets.left,
@@ -194,8 +228,39 @@
             return insets;
         }
 
+        @Override
         public boolean isBorderOpaque() {
             return false;
         }
     }
+
+    /**
+     * Handle keeping track of the viewport's view's focus
+     */
+    private class ViewportViewFocusHandler implements ContainerListener,
+            FocusListener{
+        public void componentAdded(ContainerEvent e) {
+            if (e.getChild() instanceof JTextComponent) {
+                e.getChild().addFocusListener(this);
+                viewportViewHasFocus = e.getChild().isFocusOwner();
+                scrollpane.repaint();
+            }
+        }
+
+        public void componentRemoved(ContainerEvent e) {
+            if (e.getChild() instanceof JTextComponent) {
+                e.getChild().removeFocusListener(this);
+            }
+        }
+
+        public void focusGained(FocusEvent e) {
+            viewportViewHasFocus = true;
+            scrollpane.repaint();
+        }
+
+        public void focusLost(FocusEvent e) {
+            viewportViewHasFocus = false;
+            scrollpane.repaint();
+        }
+    }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
index 58fb537..78d0bb1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java
@@ -53,6 +53,20 @@
     protected Rectangle valueRect = new Rectangle();
     protected boolean paintValue;
 
+    /**
+     * When a JSlider is used as a renderer in a JTable, its layout is not
+     * being recomputed even though the size is changing. Even though there
+     * is a ComponentListener installed, it is not being notified. As such,
+     * at times when being asked to paint the layout should first be redone.
+     * At the end of the layout method we set this lastSize variable, which
+     * represents the size of the slider the last time it was layed out.
+     *
+     * In the paint method we then check to see that this is accurate, that
+     * the slider has not changed sizes since being last layed out. If necessary
+     * we recompute the layout.
+     */
+    private Dimension lastSize = null;
+
     private int trackHeight;
     private int trackBorder;
     private int thumbWidth;
@@ -63,7 +77,8 @@
     private SynthStyle sliderThumbStyle;
 
     /** Used to determine the color to paint the thumb. */
-    private transient boolean thumbActive;
+    private transient boolean thumbActive; //happens on rollover, and when pressed
+    private transient boolean thumbPressed; //happens when mouse was depressed while over thumb
 
     ///////////////////////////////////////////////////
     // ComponentUI Interface Implementation methods
@@ -119,6 +134,24 @@
             thumbHeight =
                 style.getInt(context, "Slider.thumbHeight", 14);
 
+            // handle scaling for sizeVarients for special case components. The
+            // key "JComponent.sizeVariant" scales for large/small/mini
+            // components are based on Apples LAF
+            String scaleKey = (String)slider.getClientProperty(
+                    "JComponent.sizeVariant");
+            if (scaleKey != null){
+                if ("large".equals(scaleKey)){
+                    thumbWidth *= 1.15;
+                    thumbHeight *= 1.15;
+                } else if ("small".equals(scaleKey)){
+                    thumbWidth *= 0.857;
+                    thumbHeight *= 0.857;
+                } else if ("mini".equals(scaleKey)){
+                    thumbWidth *= 0.784;
+                    thumbHeight *= 0.784;
+                }
+            }
+
             trackBorder =
                 style.getInt(context, "Slider.trackBorder", 1);
 
@@ -152,6 +185,11 @@
         setThumbActive(thumbRect.contains(x, y));
     }
 
+    private void updateThumbState(int x, int y, boolean pressed) {
+        updateThumbState(x, y);
+        setThumbPressed(pressed);
+    }
+
     private void setThumbActive(boolean active) {
         if (thumbActive != active) {
             thumbActive = active;
@@ -159,6 +197,13 @@
         }
     }
 
+    private void setThumbPressed(boolean pressed) {
+        if (thumbPressed != pressed) {
+            thumbPressed = pressed;
+            slider.repaint(thumbRect);
+        }
+    }
+
     public int getBaseline(JComponent c, int width, int height) {
         if (c == null) {
             throw new NullPointerException("Component must be non-null");
@@ -418,6 +463,7 @@
             }
         }
         context.dispose();
+        lastSize = slider.getSize();
     }
 
     /**
@@ -667,7 +713,9 @@
 
     private int getComponentState(JComponent c, Region region) {
         if (region == Region.SLIDER_THUMB && thumbActive &&c.isEnabled()) {
-            return MOUSE_OVER;
+            int state = thumbPressed ? PRESSED : MOUSE_OVER;
+            if (c.isFocusOwner()) state |= FOCUSED;
+            return state;
         }
         return SynthLookAndFeel.getComponentState(c);
     }
@@ -693,6 +741,10 @@
         recalculateIfOrientationChanged();
         Rectangle clip = g.getClipBounds();
 
+        if (lastSize == null || !lastSize.equals(slider.getSize())) {
+            calculateGeometry();
+        }
+
         if (paintValue) {
             FontMetrics fm = SwingUtilities2.getFontMetrics(slider, g);
             int labelWidth = context.getStyle().getGraphicsUtils(context).
@@ -781,9 +833,14 @@
             setThumbActive(false);
         }
 
+        public void mousePressed(MouseEvent e) {
+            super.mousePressed(e);
+            setThumbPressed(thumbRect.contains(e.getX(), e.getY()));
+        }
+
         public void mouseReleased(MouseEvent e) {
             super.mouseReleased(e);
-            updateThumbState(e.getX(), e.getY());
+            updateThumbState(e.getX(), e.getY(), false);
         }
 
         public void mouseDragged(MouseEvent e) {
@@ -814,6 +871,7 @@
 
                 if (drawInverted()) {
                     trackBottom = vMax;
+                    trackTop = trackTop + halfThumbHeight;
                 } else {
                     trackTop = vMax;
                 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java
index c794999..d0dd44b 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java
@@ -26,17 +26,12 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.text.ParseException;
 
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicSpinnerUI;
-import javax.swing.text.*;
 
 import java.beans.*;
-import java.text.*;
-import java.util.*;
 import sun.swing.plaf.synth.SynthUI;
 
 /**
@@ -48,7 +43,16 @@
 class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener,
         SynthUI {
     private SynthStyle style;
-
+    /**
+     * A FocusListener implementation which causes the entire spinner to be
+     * repainted whenever the editor component (typically a text field) becomes
+     * focused, or loses focus. This is necessary because since SynthSpinnerUI
+     * is composed of an editor and two buttons, it is necessary that all three
+     * components indicate that they are "focused" so that they can be drawn
+     * appropriately. The repaint is used to ensure that the buttons are drawn
+     * in the new focused or unfocused state, mirroring that of the editor.
+     */
+    private EditorFocusHandler editorFocusHandler = new EditorFocusHandler();
 
     /**
      * Returns a new instance of SynthSpinnerUI.
@@ -61,9 +65,17 @@
         return new SynthSpinnerUI();
     }
 
+    @Override
     protected void installListeners() {
         super.installListeners();
         spinner.addPropertyChangeListener(this);
+        JComponent editor = spinner.getEditor();
+        if (editor instanceof JSpinner.DefaultEditor) {
+            JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField();
+            if (tf != null) {
+                tf.addFocusListener(editorFocusHandler);
+            }
+        }
     }
 
     /**
@@ -74,9 +86,17 @@
      *
      * @see #installListeners
      */
+    @Override
     protected void uninstallListeners() {
         super.uninstallListeners();
         spinner.removePropertyChangeListener(this);
+        JComponent editor = spinner.getEditor();
+        if (editor instanceof JSpinner.DefaultEditor) {
+            JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField();
+            if (tf != null) {
+                tf.removeFocusListener(editorFocusHandler);
+            }
+        }
     }
 
     /**
@@ -233,6 +253,18 @@
     protected void replaceEditor(JComponent oldEditor, JComponent newEditor) {
         spinner.remove(oldEditor);
         spinner.add(newEditor, "Editor");
+        if (oldEditor instanceof JSpinner.DefaultEditor) {
+            JTextField tf = ((JSpinner.DefaultEditor)oldEditor).getTextField();
+            if (tf != null) {
+                tf.removeFocusListener(editorFocusHandler);
+            }
+        }
+        if (newEditor instanceof JSpinner.DefaultEditor) {
+            JTextField tf = ((JSpinner.DefaultEditor)newEditor).getTextField();
+            if (tf != null) {
+                tf.addFocusListener(editorFocusHandler);
+            }
+        }
     }
 
     private void updateEditorAlignment(JComponent editor) {
@@ -240,10 +272,14 @@
             SynthContext context = getContext(spinner);
             Integer alignment = (Integer)context.getStyle().get(
                     context, "Spinner.editorAlignment");
+            JTextField text = ((JSpinner.DefaultEditor)editor).getTextField();
             if (alignment != null) {
-                JTextField text = ((JSpinner.DefaultEditor)editor).getTextField();
                 text.setHorizontalAlignment(alignment);
+
             }
+            // copy across the sizeVariant property to the editor
+            text.putClientProperty("JComponent.sizeVariant",
+                    spinner.getClientProperty("JComponent.sizeVariant"));
         }
     }
 
@@ -404,4 +440,38 @@
             }
         }
     }
+
+    /** Listen to editor text field focus changes and repaint whole spinner */
+    private class EditorFocusHandler implements FocusListener{
+        /** Invoked when a editor text field gains the keyboard focus. */
+        public void focusGained(FocusEvent e) {
+            spinner.repaint();
+        }
+
+        /** Invoked when a editor text field loses the keyboard focus. */
+        public void focusLost(FocusEvent e) {
+            spinner.repaint();
+        }
+    }
+
+    /** Override the arrowbuttons focus handling to follow the text fields focus */
+    private class SpinnerArrowButton extends SynthArrowButton{
+        public SpinnerArrowButton(int direction) {
+            super(direction);
+        }
+
+        @Override
+        public boolean isFocusOwner() {
+            if (spinner == null){
+                return super.isFocusOwner();
+            } else if (spinner.getEditor() instanceof JSpinner.DefaultEditor){
+                return ((JSpinner.DefaultEditor)spinner.getEditor())
+                        .getTextField().isFocusOwner();
+            } else if (spinner.getEditor()!= null) {
+                return spinner.getEditor().isFocusOwner();
+            } else {
+                return super.isFocusOwner();
+            }
+        }
+    }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
index d595ef6..52e9ef1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java
@@ -32,6 +32,7 @@
 import javax.swing.text.DefaultEditorKit;
 import java.util.HashMap;
 import java.util.Map;
+import javax.swing.text.JTextComponent;
 import sun.swing.plaf.synth.SynthUI;
 
 /**
@@ -758,28 +759,48 @@
     public Color getColor(SynthContext context, ColorType type) {
         JComponent c = context.getComponent();
         Region id = context.getRegion();
-        int cs = context.getComponentState();
-        // For the enabled state, prefer the widget's colors
-        if (!id.isSubregion() && cs == SynthConstants.ENABLED) {
-            if (type == ColorType.BACKGROUND) {
-                return c.getBackground();
-            }
-            else if (type == ColorType.FOREGROUND) {
-                return c.getForeground();
-            }
-            else if (type == ColorType.TEXT_FOREGROUND) {
-                // If getForeground returns a non-UIResource it means the
-                // developer has explicitly set the foreground, use it over
-                // that of TEXT_FOREGROUND as that is typically the expected
-                // behavior.
-                Color color = c.getForeground();
-                if (!(color instanceof UIResource)) {
-                    return color;
+
+        if ((context.getComponentState() & SynthConstants.DISABLED) != 0) {
+            //This component is disabled, so return the disabled color.
+            //In some cases this means ignoring the color specified by the
+            //developer on the component. In other cases it means using a
+            //specified disabledTextColor, such as on JTextComponents.
+            //For example, JLabel doesn't specify a disabled color that the
+            //developer can set, yet it should have a disabled color to the
+            //text when the label is disabled. This code allows for that.
+            if (c instanceof JTextComponent) {
+                JTextComponent txt = (JTextComponent)c;
+                Color disabledColor = txt.getDisabledTextColor();
+                if (disabledColor == null || disabledColor instanceof UIResource) {
+                    return getColorForState(context, type);
                 }
+            } else if (c instanceof JLabel &&
+                            (type == ColorType.FOREGROUND ||
+                             type == ColorType.TEXT_FOREGROUND)) {
+                return getColorForState(context, type);
             }
         }
-        // Then use what we've locally defined
-        Color color = getColorForState(context, type);
+
+        // If the developer has specified a color, prefer it. Otherwise, get
+        // the color for the state.
+        Color color = null;
+        if (!id.isSubregion()) {
+            if (type == ColorType.BACKGROUND) {
+                color = c.getBackground();
+            }
+            else if (type == ColorType.FOREGROUND) {
+                color = c.getForeground();
+            }
+            else if (type == ColorType.TEXT_FOREGROUND) {
+                color = c.getForeground();
+            }
+        }
+
+        if (color == null || color instanceof UIResource) {
+            // Then use what we've locally defined
+            color = getColorForState(context, type);
+        }
+
         if (color == null) {
             // No color, fallback to that of the widget.
             if (type == ColorType.BACKGROUND ||
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
index ac91419..cef94e1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
@@ -26,7 +26,6 @@
 package javax.swing.plaf.synth;
 
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.*;
 import javax.swing.text.View;
@@ -35,8 +34,6 @@
 import java.awt.event.*;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
-import java.util.Vector;
-import java.util.Hashtable;
 import sun.swing.plaf.synth.SynthUI;
 import sun.swing.SwingUtilities2;
 
@@ -50,6 +47,40 @@
  * insets for the selected tab.
  */
 class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyChangeListener  {
+    /**
+     * <p>If non-zero, tabOverlap indicates the amount that the tab bounds
+     * should be altered such that they would overlap with a tab on either the
+     * leading or trailing end of a run (ie: in TOP, this would be on the left
+     * or right).</p>
+
+     * <p>A positive overlap indicates that tabs should overlap right/down,
+     * while a negative overlap indicates tha tabs should overlap left/up.</p>
+     *
+     * <p>When tabOverlap is specified, it both changes the x position and width
+     * of the tab if in TOP or BOTTOM placement, and changes the y position and
+     * height if in LEFT or RIGHT placement.</p>
+     *
+     * <p>This is done for the following reason. Consider a run of 10 tabs.
+     * There are 9 gaps between these tabs. If you specified a tabOverlap of
+     * "-1", then each of the tabs "x" values will be shifted left. This leaves
+     * 9 pixels of space to the right of the right-most tab unpainted. So, each
+     * tab's width is also extended by 1 pixel to make up the difference.</p>
+     *
+     * <p>This property respects the RTL component orientation.</p>
+     */
+    private int tabOverlap = 0;
+
+    /**
+     * When a tabbed pane has multiple rows of tabs, this indicates whether
+     * the tabs in the upper row(s) should extend to the base of the tab area,
+     * or whether they should remain at their normal tab height. This does not
+     * affect the bounds of the tabs, only the bounds of area painted by the
+     * tabs. The text position does not change. The result is that the bottom
+     * border of the upper row of tabs becomes fully obscured by the lower tabs,
+     * resulting in a cleaner look.
+     */
+    private boolean extendTabsToBase = false;
+
     private SynthContext tabAreaContext;
     private SynthContext tabContext;
     private SynthContext tabContentContext;
@@ -64,6 +95,14 @@
 
     private Rectangle tabAreaBounds = new Rectangle();
 
+    //added for the Nimbus look and feel, where the tab area is painted differently depending on the
+    //state for the selected tab
+    private boolean tabAreaStatesMatchSelectedTab = false;
+    //added for the Nimbus LAF to ensure that the labels don't move whether the tab is selected or not
+    private boolean nudgeSelectedLabel = true;
+
+    private boolean selectedTabIsPressed = false;
+
     public static ComponentUI createUI(JComponent c) {
         return new SynthTabbedPaneUI();
     }
@@ -90,12 +129,19 @@
         if (style != oldStyle) {
             tabRunOverlay =
                 style.getInt(context, "TabbedPane.tabRunOverlay", 0);
+            tabOverlap = style.getInt(context, "TabbedPane.tabOverlap", 0);
+            extendTabsToBase = style.getBoolean(context,
+                    "TabbedPane.extendTabsToBase", false);
             textIconGap = style.getInt(context, "TabbedPane.textIconGap", 0);
             selectedTabPadInsets = (Insets)style.get(context,
                 "TabbedPane.selectedTabPadInsets");
             if (selectedTabPadInsets == null) {
                 selectedTabPadInsets = new Insets(0, 0, 0, 0);
             }
+            tabAreaStatesMatchSelectedTab = style.getBoolean(context,
+                    "TabbedPane.tabAreaStatesMatchSelectedTab", false);
+            nudgeSelectedLabel = style.getBoolean(context,
+                    "TabbedPane.nudgeSelectedLabel", true);
             if (oldStyle != null) {
                 uninstallKeyboardActions();
                 installKeyboardActions();
@@ -199,6 +245,14 @@
     }
 
     protected JButton createScrollButton(int direction) {
+        // added for Nimbus LAF so that it can use the basic arrow buttons
+        // UIManager is queried directly here because this is called before
+        // updateStyle is called so the style can not be queried directly
+        if (UIManager.getBoolean("TabbedPane.useBasicArrows")) {
+            JButton btn = super.createScrollButton(direction);
+            btn.setBorder(BorderFactory.createEmptyBorder());
+            return btn;
+        }
         return new SynthScrollableTabButton(direction);
     }
 
@@ -208,6 +262,75 @@
         }
     }
 
+    /**
+     * @inheritDoc
+     *
+     * Overridden to keep track of whether the selected tab is also pressed.
+     */
+    @Override
+    protected MouseListener createMouseListener() {
+        final MouseListener delegate = super.createMouseListener();
+        final MouseMotionListener delegate2 = (MouseMotionListener)delegate;
+        return new MouseListener() {
+            public void mouseClicked(MouseEvent e) { delegate.mouseClicked(e); }
+            public void mouseEntered(MouseEvent e) { delegate.mouseEntered(e); }
+            public void mouseExited(MouseEvent e) { delegate.mouseExited(e); }
+
+            public void mousePressed(MouseEvent e) {
+                if (!tabPane.isEnabled()) {
+                    return;
+                }
+
+                int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY());
+                if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) {
+                    if (tabIndex == tabPane.getSelectedIndex()) {
+                        // Clicking on selected tab
+                        selectedTabIsPressed = true;
+                        //TODO need to just repaint the tab area!
+                        tabPane.repaint();
+                    }
+                }
+
+                //forward the event (this will set the selected index, or none at all
+                delegate.mousePressed(e);
+            }
+
+            public void mouseReleased(MouseEvent e) {
+                if (selectedTabIsPressed) {
+                    selectedTabIsPressed = false;
+                    //TODO need to just repaint the tab area!
+                    tabPane.repaint();
+                }
+                //forward the event
+                delegate.mouseReleased(e);
+
+                //hack: The super method *should* be setting the mouse-over property correctly
+                //here, but it doesn't. That is, when the mouse is released, whatever tab is below the
+                //released mouse should be in rollover state. But, if you select a tab and don't
+                //move the mouse, this doesn't happen. Hence, forwarding the event.
+                delegate2.mouseMoved(e);
+            }
+        };
+    }
+
+    @Override
+    protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) {
+        if (nudgeSelectedLabel) {
+            return super.getTabLabelShiftX(tabPlacement, tabIndex, isSelected);
+        } else {
+            return 0;
+        }
+    }
+
+    @Override
+    protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) {
+        if (nudgeSelectedLabel) {
+            return super.getTabLabelShiftY(tabPlacement, tabIndex, isSelected);
+        } else {
+            return 0;
+        }
+    }
+
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -321,6 +444,20 @@
                                 Rectangle tabAreaBounds) {
         Rectangle clipRect = g.getClipBounds();
 
+        //if the tab area's states should match that of the selected tab, then
+        //first update the selected tab's states, then set the state
+        //for the tab area to match
+        //otherwise, restore the tab area's state to ENABLED (which is the
+        //only supported state otherwise).
+        if (tabAreaStatesMatchSelectedTab && selectedIndex >= 0) {
+            updateTabContext(selectedIndex, true, selectedTabIsPressed,
+                              (getRolloverTab() == selectedIndex),
+                              (getFocusIndex() == selectedIndex));
+            ss.setComponentState(tabContext.getComponentState());
+        } else {
+            ss.setComponentState(SynthConstants.ENABLED);
+        }
+
         // Paint the tab area.
         SynthLookAndFeel.updateSubregion(ss, g, tabAreaBounds);
         ss.getPainter().paintTabbedPaneTabAreaBackground(ss, g,
@@ -362,17 +499,22 @@
 
         Rectangle r = null;
 
-        if ((oldRolloverTab >= 0) && (oldRolloverTab < tabPane.getTabCount())) {
-            r = getTabBounds(tabPane, oldRolloverTab);
-            if (r != null) {
-                tabPane.repaint(r);
+        if (oldRolloverTab != index && tabAreaStatesMatchSelectedTab) {
+            //TODO need to just repaint the tab area!
+            tabPane.repaint();
+        } else {
+            if ((oldRolloverTab >= 0) && (oldRolloverTab < tabPane.getTabCount())) {
+                r = getTabBounds(tabPane, oldRolloverTab);
+                if (r != null) {
+                    tabPane.repaint(r);
+                }
             }
-        }
 
-        if (index >= 0) {
-            r = getTabBounds(tabPane, index);
-            if (r != null) {
-                tabPane.repaint(r);
+            if (index >= 0) {
+                r = getTabBounds(tabPane, index);
+                if (r != null) {
+                    tabPane.repaint(r);
+                }
             }
         }
     }
@@ -383,18 +525,51 @@
         Rectangle tabRect = rects[tabIndex];
         int selectedIndex = tabPane.getSelectedIndex();
         boolean isSelected = selectedIndex == tabIndex;
-        updateTabContext(tabIndex, isSelected,
-                          (getRolloverTab() == tabIndex),
-                          (getFocusIndex() == tabIndex));
+        updateTabContext(tabIndex, isSelected, isSelected && selectedTabIsPressed,
+                            (getRolloverTab() == tabIndex),
+                            (getFocusIndex() == tabIndex));
 
         SynthLookAndFeel.updateSubregion(ss, g, tabRect);
-        tabContext.getPainter().paintTabbedPaneTabBackground(tabContext,
-                                g, tabRect.x, tabRect.y, tabRect.width,
-                                tabRect.height, tabIndex,
-                                tabPane.getTabPlacement());
+        int x = tabRect.x;
+        int y = tabRect.y;
+        int height = tabRect.height;
+        int width = tabRect.width;
+        int placement = tabPane.getTabPlacement();
+        if (extendTabsToBase && runCount > 1) {
+            //paint this tab such that its edge closest to the base is equal to
+            //edge of the selected tab closest to the base. In terms of the TOP
+            //tab placement, this will cause the bottom of each tab to be
+            //painted even with the bottom of the selected tab. This is because
+            //in each tab placement (TOP, LEFT, BOTTOM, RIGHT) the selected tab
+            //is closest to the base.
+            if (selectedIndex >= 0) {
+                Rectangle r = rects[selectedIndex];
+                switch (placement) {
+                    case TOP:
+                        int bottomY = r.y + r.height;
+                        height = bottomY - tabRect.y;
+                        break;
+                    case LEFT:
+                        int rightX = r.x + r.width;
+                        width = rightX - tabRect.x;
+                        break;
+                    case BOTTOM:
+                        int topY = r.y;
+                        height = (tabRect.y + tabRect.height) - topY;
+                        y = topY;
+                        break;
+                    case RIGHT:
+                        int leftX = r.x;
+                        width = (tabRect.x + tabRect.width) - leftX;
+                        x = leftX;
+                        break;
+                }
+            }
+        }
+        tabContext.getPainter().paintTabbedPaneTabBackground(tabContext, g,
+                x, y, width, height, tabIndex, placement);
         tabContext.getPainter().paintTabbedPaneTabBorder(tabContext, g,
-                   tabRect.x, tabRect.y, tabRect.width, tabRect.height,
-                   tabIndex, tabPane.getTabPlacement());
+                x, y, width, height, tabIndex, placement);
 
         if (tabPane.getTabComponentAt(tabIndex) == null) {
             String title = tabPane.getTitleAt(tabIndex);
@@ -561,7 +736,7 @@
     }
 
     protected Insets getTabInsets(int tabPlacement, int tabIndex) {
-        updateTabContext(tabIndex, false, false,
+        updateTabContext(tabIndex, false, false, false,
                           (getFocusIndex() == tabIndex));
         return tabInsets;
     }
@@ -575,7 +750,7 @@
     }
 
     private void updateTabContext(int index, boolean selected,
-                                  boolean isMouseOver, boolean hasFocus) {
+                                  boolean isMouseDown, boolean isMouseOver, boolean hasFocus) {
         int state = 0;
         if (!tabPane.isEnabled() || !tabPane.isEnabledAt(index)) {
             state |= SynthConstants.DISABLED;
@@ -599,9 +774,68 @@
         if (hasFocus && tabPane.hasFocus()) {
             state |= SynthConstants.FOCUSED; // individual tab has focus
         }
+        if (isMouseDown) {
+            state |= SynthConstants.PRESSED;
+        }
+
         tabContext.setComponentState(state);
     }
 
+    /**
+     * @inheritDoc
+     *
+     * Overridden to create a TabbedPaneLayout subclass which takes into
+     * account tabOverlap.
+     */
+    @Override protected LayoutManager createLayoutManager() {
+        if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) {
+            return super.createLayoutManager();
+        } else { /* WRAP_TAB_LAYOUT */
+            return new TabbedPaneLayout() {
+                @Override
+                public void calculateLayoutInfo() {
+                    super.calculateLayoutInfo();
+                    //shift all the tabs, if necessary
+                    if (tabOverlap != 0) {
+                        int tabCount = tabPane.getTabCount();
+                        //left-to-right/right-to-left only affects layout
+                        //when placement is TOP or BOTTOM
+                        boolean ltr = tabPane.getComponentOrientation().isLeftToRight();
+                        for (int i = runCount - 1; i >= 0; i--) {
+                            int start = tabRuns[i];
+                            int next = tabRuns[(i == runCount - 1)? 0 : i + 1];
+                            int end = (next != 0? next - 1: tabCount - 1);
+                            for (int j = start+1; j <= end; j++) {
+                                // xshift and yshift represent the amount &
+                                // direction to shift the tab in their
+                                // respective axis.
+                                int xshift = 0;
+                                int yshift = 0;
+                                // configure xshift and y shift based on tab
+                                // position and ltr/rtl
+                                switch (tabPane.getTabPlacement()) {
+                                    case JTabbedPane.TOP:
+                                    case JTabbedPane.BOTTOM:
+                                        xshift = ltr ? tabOverlap : -tabOverlap;
+                                        break;
+                                    case JTabbedPane.LEFT:
+                                    case JTabbedPane.RIGHT:
+                                        yshift = tabOverlap;
+                                        break;
+                                    default: //do nothing
+                                }
+                                rects[j].x += xshift;
+                                rects[j].y += yshift;
+                                rects[j].width += Math.abs(xshift);
+                                rects[j].height += Math.abs(yshift);
+                            }
+                        }
+                    }
+                }
+            };
+        }
+    }
+
     private class SynthScrollableTabButton extends SynthArrowButton implements
             UIResource {
         public SynthScrollableTabButton(int direction) {
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java
index 20d3c01..b37d9f1 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java
@@ -33,6 +33,7 @@
 import javax.swing.plaf.basic.*;
 import javax.swing.table.*;
 
+import sun.swing.DefaultLookup;
 import sun.swing.plaf.synth.*;
 import sun.swing.table.*;
 
@@ -160,6 +161,7 @@
     private class HeaderRenderer extends DefaultTableCellHeaderRenderer {
         HeaderRenderer() {
             setHorizontalAlignment(JLabel.LEADING);
+            setName("TableHeader.renderer");
         }
 
         @Override
@@ -178,24 +180,40 @@
                 SynthLookAndFeel.resetSelectedUI();
             }
 
+            //stuff a variable into the client property of this renderer indicating the sort order,
+            //so that different rendering can be done for the header based on sorted state.
+            RowSorter rs = table == null ? null : table.getRowSorter();
+            java.util.List<? extends RowSorter.SortKey> sortKeys = rs == null ? null : rs.getSortKeys();
+            if (sortKeys != null && sortKeys.size() > 0 && sortKeys.get(0).getColumn() ==
+                    table.convertColumnIndexToModel(column)) {
+                switch(sortKeys.get(0).getSortOrder()) {
+                    case ASCENDING:
+                        putClientProperty("Table.sortOrder", "ASCENDING");
+                        break;
+                    case DESCENDING:
+                        putClientProperty("Table.sortOrder", "DESCENDING");
+                        break;
+                    case UNSORTED:
+                        putClientProperty("Table.sortOrder", "UNSORTED");
+                        break;
+                    default:
+                        throw new AssertionError("Cannot happen");
+                }
+            } else {
+                putClientProperty("Table.sortOrder", "UNSORTED");
+            }
+
             super.getTableCellRendererComponent(table, value, isSelected,
                                                 hasFocus, row, column);
 
             return this;
         }
 
+        @Override
         public void setBorder(Border border) {
             if (border instanceof SynthBorder) {
                 super.setBorder(border);
             }
         }
-
-        public String getName() {
-            String name = super.getName();
-            if (name == null) {
-                return "TableHeader.renderer";
-            }
-            return name;
-        }
     }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java
index be90ac5..1b8cf98 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java
@@ -27,6 +27,7 @@
 
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Dimension;
 import java.awt.Graphics;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -70,6 +71,7 @@
 
     private boolean useTableColors;
     private boolean useUIBorder;
+    private Color alternateColor; //the background color to use for cells for alternate cells
 
     // TableCellRenderer installed on the JTable at the time we're installed,
     // cached so that we can reinstall them at uninstallUI time.
@@ -161,6 +163,21 @@
             if (rowHeight != null) {
                 LookAndFeel.installProperty(table, "rowHeight", rowHeight);
             }
+            boolean showGrid = style.getBoolean(context, "Table.showGrid", true);
+            if (!showGrid) {
+                table.setShowGrid(false);
+            }
+            Dimension d = table.getIntercellSpacing();
+//            if (d == null || d instanceof UIResource) {
+            if (d != null) {
+                d = (Dimension)style.get(context, "Table.intercellSpacing");
+            }
+            alternateColor = (Color)style.get(context, "Table.alternateRowColor");
+            if (d != null) {
+                table.setIntercellSpacing(d);
+            }
+
+
             if (oldStyle != null) {
                 uninstallKeyboardActions();
                 installKeyboardActions();
@@ -617,6 +634,14 @@
         else {
             TableCellRenderer renderer = table.getCellRenderer(row, column);
             Component component = table.prepareRenderer(renderer, row, column);
+            Color b = component.getBackground();
+            if ((b == null || b instanceof UIResource
+                    || component instanceof SynthBooleanTableCellRenderer)
+                    && !table.isCellSelected(row, column)) {
+                if (alternateColor != null && row % 2 == 0) {
+                    component.setBackground(alternateColor);
+                }
+            }
             rendererPane.paintComponent(g, component, table, cellRect.x,
                     cellRect.y, cellRect.width, cellRect.height, true);
         }
@@ -634,16 +659,8 @@
         private boolean isRowSelected;
 
         public SynthBooleanTableCellRenderer() {
-            super();
             setHorizontalAlignment(JLabel.CENTER);
-        }
-
-        public String getName() {
-            String name = super.getName();
-            if (name == null) {
-                return "Table.cellRenderer";
-            }
-            return name;
+            setName("Table.cellRenderer");
         }
 
         public Component getTableCellRendererComponent(
@@ -652,17 +669,24 @@
             isRowSelected = isSelected;
 
             if (isSelected) {
-                setForeground(table.getSelectionForeground());
-                setBackground(table.getSelectionBackground());
+                setForeground(unwrap(table.getSelectionForeground()));
+                setBackground(unwrap(table.getSelectionBackground()));
             } else {
-                setForeground(table.getForeground());
-                setBackground(table.getBackground());
+                setForeground(unwrap(table.getForeground()));
+                setBackground(unwrap(table.getBackground()));
             }
 
             setSelected((value != null && ((Boolean)value).booleanValue()));
             return this;
         }
 
+        private Color unwrap(Color c) {
+            if (c instanceof UIResource) {
+                return new Color(c.getRGB());
+            }
+            return c;
+        }
+
         public boolean isOpaque() {
             return isRowSelected ? true : super.isOpaque();
         }
@@ -732,7 +756,7 @@
             }
             else if (columnClass == Icon.class || columnClass == ImageIcon.class) {
                 setHorizontalAlignment(JLabel.CENTER);
-                setIcon((Icon)value);
+                setIcon((value instanceof Icon) ? (Icon)value : null);
                 setText("");
             }
             else if (columnClass == Date.class) {
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java
index 3a650d2..0194765 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java
@@ -27,10 +27,11 @@
 
 import javax.swing.*;
 import javax.swing.text.*;
-import javax.swing.event.*;
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicTextAreaUI;
 import java.awt.*;
+import java.awt.event.FocusListener;
+import java.awt.event.FocusEvent;
 import java.beans.PropertyChangeEvent;
 import sun.swing.plaf.synth.SynthUI;
 
@@ -50,7 +51,7 @@
  *
  * @author  Shannon Hickey
  */
-class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI {
+class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener {
     private SynthStyle style;
 
     /**
@@ -63,16 +64,26 @@
         return new SynthTextAreaUI();
     }
 
+    public void focusGained(FocusEvent e) {
+        getComponent().repaint();
+    }
+
+    public void focusLost(FocusEvent e) {
+        getComponent().repaint();
+    }
+
     protected void installDefaults() {
         // Installs the text cursor on the component
         super.installDefaults();
         updateStyle(getComponent());
+        getComponent().addFocusListener(this);
     }
 
     protected void uninstallDefaults() {
         SynthContext context = getContext(getComponent(), ENABLED);
 
         getComponent().putClientProperty("caretAspectRatio", null);
+        getComponent().removeFocusListener(this);
 
         style.uninstallDefaults(context);
         context.dispose();
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java
index 74b9f7c..d4b22ba 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java
@@ -25,12 +25,10 @@
 
 package javax.swing.plaf.synth;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.*;
-import javax.swing.text.View;
+import java.awt.Graphics;
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
 
 /**
  * Synth's ToggleButtonUI.
@@ -45,15 +43,21 @@
         return new SynthToggleButtonUI();
     }
 
+    @Override
     protected String getPropertyPrefix() {
         return "ToggleButton.";
     }
 
+    @Override
     void paintBackground(SynthContext context, Graphics g, JComponent c) {
-        context.getPainter().paintToggleButtonBackground(context, g, 0, 0,
-                                                c.getWidth(), c.getHeight());
+        if (((AbstractButton) c).isContentAreaFilled()) {
+            int x = 0, y = 0, w = c.getWidth(), h = c.getHeight();
+            SynthPainter painter = context.getPainter();
+            painter.paintToggleButtonBackground(context, g, x, y, w, h);
+        }
     }
 
+    @Override
     public void paintBorder(SynthContext context, Graphics g, int x,
                             int y, int w, int h) {
         context.getPainter().paintToggleButtonBorder(context, g, x, y, w, h);
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java
index 60aa951..c49536c 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java
@@ -25,18 +25,24 @@
 
 package javax.swing.plaf.synth;
 
-import javax.swing.*;
-import javax.swing.event.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import java.beans.*;
-
-import javax.swing.border.*;
-import javax.swing.plaf.*;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.Box;
+import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.JSeparator;
+import javax.swing.JToolBar;
+import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.basic.BasicToolBarUI;
-import sun.swing.plaf.synth.*;
-
+import sun.swing.plaf.synth.SynthIcon;
+import sun.swing.plaf.synth.SynthUI;
 
 /**
  * A Synth L&F implementation of ToolBarUI.  This implementation
@@ -57,23 +63,35 @@
         return new SynthToolBarUI();
     }
 
+    @Override
     protected void installDefaults() {
         toolBar.setLayout(createLayout());
         updateStyle(toolBar);
     }
 
+    @Override
     protected void installListeners() {
         super.installListeners();
         toolBar.addPropertyChangeListener(this);
     }
 
+    @Override
     protected void uninstallListeners() {
         super.uninstallListeners();
         toolBar.removePropertyChangeListener(this);
     }
 
     private void updateStyle(JToolBar c) {
-        SynthContext context = getContext(c, ENABLED);
+        SynthContext context = getContext(
+                c, Region.TOOL_BAR_CONTENT, null, ENABLED);
+        contentStyle = SynthLookAndFeel.updateStyle(context, this);
+        context.dispose();
+
+        context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED);
+        dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);
+        context.dispose();
+
+        context = getContext(c, ENABLED);
         SynthStyle oldStyle = style;
 
         style = SynthLookAndFeel.updateStyle(context, this);
@@ -86,16 +104,9 @@
             }
         }
         context.dispose();
-
-        context = getContext(c, Region.TOOL_BAR_CONTENT, ENABLED);
-        contentStyle = SynthLookAndFeel.updateStyle(context, this);
-        context.dispose();
-
-        context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, ENABLED);
-        dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);
-        context.dispose();
     }
 
+    @Override
     protected void uninstallDefaults() {
         SynthContext context = getContext(toolBar, ENABLED);
 
@@ -105,12 +116,14 @@
 
         handleIcon = null;
 
-        context = getContext(toolBar, Region.TOOL_BAR_CONTENT, ENABLED);
+        context = getContext(toolBar, Region.TOOL_BAR_CONTENT,
+                             contentStyle, ENABLED);
         contentStyle.uninstallDefaults(context);
         context.dispose();
         contentStyle = null;
 
-        context = getContext(toolBar, Region.TOOL_BAR_DRAG_WINDOW, ENABLED);
+        context = getContext(toolBar, Region.TOOL_BAR_DRAG_WINDOW,
+                             dragWindowStyle, ENABLED);
         dragWindowStyle.uninstallDefaults(context);
         context.dispose();
         dragWindowStyle = null;
@@ -118,11 +131,11 @@
         toolBar.setLayout(null);
     }
 
-    protected void installComponents() {
-    }
+    @Override
+    protected void installComponents() {}
 
-    protected void uninstallComponents() {
-    }
+    @Override
+    protected void uninstallComponents() {}
 
     protected LayoutManager createLayout() {
         return new SynthToolBarLayoutManager();
@@ -137,13 +150,15 @@
                     SynthLookAndFeel.getRegion(c), style, state);
     }
 
-    private SynthContext getContext(JComponent c, Region region) {
-        return getContext(c, region, getComponentState(c, region));
+    private SynthContext getContext(JComponent c, Region region, SynthStyle style) {
+        return SynthContext.getContext(SynthContext.class, c, region,
+                                       style, getComponentState(c, region));
     }
 
-    private SynthContext getContext(JComponent c, Region region, int state) {
+    private SynthContext getContext(JComponent c, Region region,
+                                    SynthStyle style, int state) {
         return SynthContext.getContext(SynthContext.class, c, region,
-                                       dragWindowStyle, state);
+                                       style, state);
     }
 
     private Region getRegion(JComponent c) {
@@ -158,6 +173,7 @@
         return SynthLookAndFeel.getComponentState(c);
     }
 
+    @Override
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -169,6 +185,7 @@
         context.dispose();
     }
 
+    @Override
     public void paint(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -183,12 +200,15 @@
     }
 
     // Overloaded to do nothing so we can share listeners.
+    @Override
     protected void setBorderToNonRollover(Component c) {}
 
     // Overloaded to do nothing so we can share listeners.
+    @Override
     protected void setBorderToRollover(Component c) {}
 
     // Overloaded to do nothing so we can share listeners.
+    @Override
     protected void setBorderToNormal(Component c) {}
 
     protected void paint(SynthContext context, Graphics g) {
@@ -201,7 +221,8 @@
                     SynthIcon.getIconHeight(handleIcon, context));
         }
 
-        SynthContext subcontext = getContext(toolBar, Region.TOOL_BAR_CONTENT);
+        SynthContext subcontext = getContext(
+                toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
         paintContent(subcontext, g, contentRect);
         subcontext.dispose();
     }
@@ -217,12 +238,14 @@
                              toolBar.getOrientation());
     }
 
+    @Override
     protected void paintDragWindow(Graphics g) {
         int w = dragWindow.getWidth();
         int h = dragWindow.getHeight();
-        SynthContext context = getContext(toolBar,Region.TOOL_BAR_DRAG_WINDOW);
-        SynthLookAndFeel.updateSubregion(context, g, new Rectangle(
-                         0, 0, w, h));
+        SynthContext context = getContext(
+                toolBar, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle);
+        SynthLookAndFeel.updateSubregion(
+                context, g, new Rectangle(0, 0, w, h));
         context.getPainter().paintToolBarDragWindowBackground(context,
                                                            g, 0, 0, w, h,
                                                            dragWindow.getOrientation());
@@ -319,6 +342,19 @@
 
             Component c;
             Dimension d;
+
+            // JToolBar by default uses a somewhat modified BoxLayout as
+            // its layout manager. For compatibility reasons, we want to
+            // support Box "glue" as a way to move things around on the
+            // toolbar. "glue" is represented in BoxLayout as a Box.Filler
+            // with a minimum and preferred size of (0,0).
+            // So what we do here is find the number of such glue fillers
+            // and figure out how much space should be allocated to them.
+            int glueCount = 0;
+            for (int i=0; i<tb.getComponentCount(); i++) {
+                if (isGlue(tb.getComponent(i))) glueCount++;
+            }
+
             if (tb.getOrientation() == JToolBar.HORIZONTAL) {
                 int handleWidth = tb.isFloatable() ?
                     SynthIcon.getIconWidth(handleIcon, context) : 0;
@@ -339,6 +375,16 @@
                 int baseY = insets.top;
                 int baseH = tb.getHeight() - insets.top - insets.bottom;
 
+                // we need to get the minimum width for laying things out
+                // so that we can calculate how much empty space needs to
+                // be distributed among the "glue", if any
+                int extraSpacePerGlue = 0;
+                if (glueCount > 0) {
+                    int minWidth = minimumLayoutSize(parent).width;
+                    extraSpacePerGlue = (tb.getWidth() - minWidth) / glueCount;
+                    if (extraSpacePerGlue < 0) extraSpacePerGlue = 0;
+                }
+
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
                     d = c.getPreferredSize();
@@ -352,6 +398,9 @@
                         y = baseY + (baseH / 2) - (d.height / 2);
                         h = d.height;
                     }
+                    //if the component is a "glue" component then add to its
+                    //width the extraSpacePerGlue it is due
+                    if (isGlue(c)) d.width += extraSpacePerGlue;
                     c.setBounds(ltr ? x : x - d.width, y, d.width, h);
                     x = ltr ? x + d.width : x - d.width;
                 }
@@ -369,6 +418,16 @@
                 int baseW = tb.getWidth() - insets.left - insets.right;
                 int y = handleHeight + insets.top;
 
+                // we need to get the minimum height for laying things out
+                // so that we can calculate how much empty space needs to
+                // be distributed among the "glue", if any
+                int extraSpacePerGlue = 0;
+                if (glueCount > 0) {
+                    int minHeight = minimumLayoutSize(parent).height;
+                    extraSpacePerGlue = (tb.getHeight() - minHeight) / glueCount;
+                    if (extraSpacePerGlue < 0) extraSpacePerGlue = 0;
+                }
+
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
                     d = c.getPreferredSize();
@@ -382,11 +441,25 @@
                         x = baseX + (baseW / 2) - (d.width / 2);
                         w = d.width;
                     }
+                    //if the component is a "glue" component then add to its
+                    //height the extraSpacePerGlue it is due
+                    if (isGlue(c)) d.height += extraSpacePerGlue;
                     c.setBounds(x, y, w, d.height);
                     y += d.height;
                 }
             }
             context.dispose();
         }
+
+        private boolean isGlue(Component c) {
+            if (c instanceof Box.Filler) {
+                Box.Filler f = (Box.Filler)c;
+                Dimension min = f.getMinimumSize();
+                Dimension pref = f.getPreferredSize();
+                return min.width == 0 &&  min.height == 0 &&
+                        pref.width == 0 && pref.height == 0;
+            }
+            return false;
+        }
     }
 }
diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java
index 5603c20..47011a8 100644
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java
@@ -24,20 +24,31 @@
  */
 package javax.swing.plaf.synth;
 
-import javax.swing.*;
-import javax.swing.event.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.datatransfer.*;
-import java.awt.dnd.*;
-import java.beans.*;
-import java.io.*;
-import java.util.*;
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.tree.*;
-import javax.swing.text.Position;
-import sun.swing.plaf.synth.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Enumeration;
+import javax.swing.DefaultCellEditor;
+import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.LookAndFeel;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.UIResource;
+import javax.swing.plaf.basic.BasicTreeUI;
+import javax.swing.tree.DefaultTreeCellEditor;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreeCellEditor;
+import javax.swing.tree.TreeCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+import sun.swing.plaf.synth.SynthIcon;
+import sun.swing.plaf.synth.SynthUI;
 
 /**
  * Skinnable TreeUI.
@@ -72,10 +83,12 @@
         expandedIconWrapper = new ExpandedIconWrapper();
     }
 
+    @Override
     public Icon getExpandedIcon() {
         return expandedIconWrapper;
     }
 
+    @Override
     protected void installDefaults() {
         updateStyle(tree);
     }
@@ -135,11 +148,13 @@
         context.dispose();
     }
 
+    @Override
     protected void installListeners() {
         super.installListeners();
         tree.addPropertyChangeListener(this);
     }
 
+    @Override
     public SynthContext getContext(JComponent c) {
         return getContext(c, getComponentState(c));
     }
@@ -172,6 +187,7 @@
         return ENABLED | SELECTED;
     }
 
+    @Override
     protected TreeCellEditor createDefaultCellEditor() {
         TreeCellRenderer renderer = tree.getCellRenderer();
         DefaultTreeCellEditor editor;
@@ -186,10 +202,12 @@
         return editor;
     }
 
+    @Override
     protected TreeCellRenderer createDefaultCellRenderer() {
         return new SynthTreeCellRenderer();
     }
 
+    @Override
     protected void uninstallDefaults() {
         SynthContext context = getContext(tree, ENABLED);
 
@@ -208,11 +226,13 @@
         }
     }
 
+    @Override
     protected void uninstallListeners() {
         super.uninstallListeners();
         tree.removePropertyChangeListener(this);
     }
 
+    @Override
     public void update(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -228,6 +248,7 @@
         context.getPainter().paintTreeBorder(context, g, x, y, w, h);
     }
 
+    @Override
     public void paint(Graphics g, JComponent c) {
         SynthContext context = getContext(c);
 
@@ -481,6 +502,7 @@
         }
     }
 
+    @Override
     protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds,
                                             Insets insets, Rectangle bounds,
                                             TreePath path, int row,
@@ -494,12 +516,14 @@
         }
     }
 
+    @Override
     protected void paintHorizontalLine(Graphics g, JComponent c, int y,
                                       int left, int right) {
         paintContext.getStyle().getGraphicsUtils(paintContext).drawLine(
             paintContext, "Tree.horizontalLine", g, left, y, right, y, linesStyle);
     }
 
+    @Override
     protected void paintVerticalPartOfLeg(Graphics g,
                                           Rectangle clipBounds, Insets insets,
                                           TreePath path) {
@@ -508,6 +532,7 @@
         }
     }
 
+    @Override
     protected void paintVerticalLine(Graphics g, JComponent c, int x, int top,
                                     int bottom) {
         paintContext.getStyle().getGraphicsUtils(paintContext).drawLine(
@@ -528,12 +553,17 @@
                          && dropLocation.getChildIndex() == -1
                          && path == dropLocation.getPath();
 
+        int state = ENABLED;
         if (selected || isDrop) {
-            cellContext.setComponentState(ENABLED | SELECTED);
+            state |= SELECTED;
         }
-        else {
-            cellContext.setComponentState(ENABLED);
+
+        if (tree.isFocusOwner() && row == leadRow) {
+            state |= FOCUSED;
         }
+
+        cellContext.setComponentState(state);
+
         if (dtcr != null && (dtcr.getBorderSelectionColor() instanceof
                              UIResource)) {
             dtcr.setBorderSelectionColor(style.getColor(
@@ -574,6 +604,28 @@
                : x - (int)Math.floor(iconWidth / 2.0);
     }
 
+    /**
+     * @inheritDoc
+     */
+    @Override
+    protected void paintExpandControl(Graphics g, Rectangle clipBounds,
+            Insets insets, Rectangle bounds, TreePath path, int row,
+            boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) {
+        //modify the paintContext's state to match the state for the row
+        //this is a hack in that it requires knowledge of the subsequent
+        //method calls. The point is, the context used in drawCentered
+        //should reflect the state of the row, not of the tree.
+        boolean isSelected = tree.getSelectionModel().isPathSelected(path);
+        int state = paintContext.getComponentState();
+        if (isSelected) {
+            paintContext.setComponentState(state | SynthConstants.SELECTED);
+        }
+        super.paintExpandControl(g, clipBounds, insets, bounds, path, row,
+                isExpanded, hasBeenExpanded, isLeaf);
+        paintContext.setComponentState(state);
+    }
+
+    @Override
     protected void drawCentered(Component c, Graphics graphics, Icon icon,
                                 int x, int y) {
         int w = SynthIcon.getIconWidth(icon, paintContext);
@@ -618,6 +670,7 @@
         }
     }
 
+    @Override
     protected int getRowX(int row, int depth) {
         return super.getRowX(row, depth) + padding;
     }
@@ -627,9 +680,13 @@
                                implements UIResource {
         SynthTreeCellRenderer() {
         }
+
+        @Override
         public String getName() {
             return "Tree.cellRenderer";
         }
+
+        @Override
         public Component getTreeCellRendererComponent(JTree tree, Object value,
                                                       boolean sel,
                                                       boolean expanded,
@@ -646,6 +703,8 @@
             return super.getTreeCellRendererComponent(tree, value, sel,
                                                       expanded, leaf, row, hasFocus);
         }
+
+        @Override
         public void paint(Graphics g) {
             paintComponent(g);
             if (hasFocus) {
@@ -692,8 +751,10 @@
             setBorderSelectionColor(null);
         }
 
+        @Override
         protected TreeCellEditor createTreeCellEditor() {
             JTextField tf = new JTextField() {
+                @Override
                 public String getName() {
                     return "Tree.cellEditor";
                 }
@@ -706,7 +767,6 @@
         }
     }
 
-
     //
     // BasicTreeUI directly uses expandIcon outside of the Synth methods.
     // To get the correct context we return an instance of this that fetches
diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
index a1ac5fe..c203178 100644
--- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
+++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java
@@ -26,7 +26,6 @@
 package javax.swing.table;
 
 import javax.swing.*;
-import javax.swing.table.TableCellRenderer;
 import javax.swing.border.*;
 
 import java.awt.Component;
@@ -34,6 +33,7 @@
 import java.awt.Rectangle;
 
 import java.io.Serializable;
+import sun.swing.DefaultLookup;
 
 
 /**
@@ -92,8 +92,9 @@
     * <code>getTableCellRendererComponent</code> method and set the border
     * of the returned component directly.
     */
-    protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
     private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
+    protected static Border noFocusBorder = DEFAULT_NO_FOCUS_BORDER;
 
     // We need a place to store the color the JLabel should be returned
     // to after its foreground and background colors have been set
@@ -109,12 +110,18 @@
         super();
         setOpaque(true);
         setBorder(getNoFocusBorder());
+        setName("Table.cellRenderer");
     }
 
-    private static Border getNoFocusBorder() {
+    private Border getNoFocusBorder() {
+        Border border = DefaultLookup.getBorder(this, ui, "Table.cellNoFocusBorder");
         if (System.getSecurityManager() != null) {
+            if (border != null) return border;
             return SAFE_NO_FOCUS_BORDER;
         } else {
+            if (noFocusBorder == null || noFocusBorder == DEFAULT_NO_FOCUS_BORDER) {
+                return border;
+            }
             return noFocusBorder;
         }
     }
@@ -190,8 +197,8 @@
                 && dropLocation.getRow() == row
                 && dropLocation.getColumn() == column) {
 
-            fg = UIManager.getColor("Table.dropCellForeground");
-            bg = UIManager.getColor("Table.dropCellBackground");
+            fg = DefaultLookup.getColor(this, ui, "Table.dropCellForeground");
+            bg = DefaultLookup.getColor(this, ui, "Table.dropCellBackground");
 
             isSelected = true;
         }
@@ -202,12 +209,18 @@
             super.setBackground(bg == null ? table.getSelectionBackground()
                                            : bg);
         } else {
+            Color background = unselectedBackground != null
+                                    ? unselectedBackground
+                                    : table.getBackground();
+            if (background == null || background instanceof javax.swing.plaf.UIResource) {
+                Color alternateColor = DefaultLookup.getColor(this, ui, "Table.alternateRowColor");
+                if (alternateColor != null && row % 2 == 0)
+                    background = alternateColor;
+            }
             super.setForeground(unselectedForeground != null
                                     ? unselectedForeground
                                     : table.getForeground());
-            super.setBackground(unselectedBackground != null
-                                    ? unselectedBackground
-                                    : table.getBackground());
+            super.setBackground(background);
         }
 
         setFont(table.getFont());
@@ -215,20 +228,20 @@
         if (hasFocus) {
             Border border = null;
             if (isSelected) {
-                border = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
+                border = DefaultLookup.getBorder(this, ui, "Table.focusSelectedCellHighlightBorder");
             }
             if (border == null) {
-                border = UIManager.getBorder("Table.focusCellHighlightBorder");
+                border = DefaultLookup.getBorder(this, ui, "Table.focusCellHighlightBorder");
             }
             setBorder(border);
 
             if (!isSelected && table.isCellEditable(row, column)) {
                 Color col;
-                col = UIManager.getColor("Table.focusCellForeground");
+                col = DefaultLookup.getColor(this, ui, "Table.focusCellForeground");
                 if (col != null) {
                     super.setForeground(col);
                 }
-                col = UIManager.getColor("Table.focusCellBackground");
+                col = DefaultLookup.getColor(this, ui, "Table.focusCellBackground");
                 if (col != null) {
                     super.setBackground(col);
                 }
@@ -261,6 +274,7 @@
         if (p != null) {
             p = p.getParent();
         }
+
         // p should now be the JTable.
         boolean colorMatch = (back != null) && (p != null) &&
             back.equals(p.getBackground()) &&
diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java
index 6363ae9..dd7a1ca 100644
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java
@@ -25,16 +25,24 @@
 
 package javax.swing.tree;
 
-import javax.swing.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
 import javax.swing.plaf.ColorUIResource;
 import javax.swing.plaf.FontUIResource;
 import javax.swing.plaf.UIResource;
 import javax.swing.plaf.basic.BasicGraphicsUtils;
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-import java.io.*;
-import java.util.*;
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JTree;
+import javax.swing.LookAndFeel;
+import javax.swing.UIManager;
+import javax.swing.border.EmptyBorder;
+import sun.swing.DefaultLookup;
 
 /**
  * Displays an entry in a tree.
@@ -148,6 +156,7 @@
     protected Color borderSelectionColor;
 
     private boolean isDropCell;
+    private boolean fillBackground = true;
 
     /**
      * Set to true after the constructor has run.
@@ -177,41 +186,48 @@
         // null. As such, if the value is null, this does not reset the
         // value.
         if (!inited || (getLeafIcon() instanceof UIResource)) {
-            setLeafIcon(UIManager.getIcon("Tree.leafIcon"));
+            setLeafIcon(DefaultLookup.getIcon(this, ui, "Tree.leafIcon"));
         }
         if (!inited || (getClosedIcon() instanceof UIResource)) {
-            setClosedIcon(UIManager.getIcon("Tree.closedIcon"));
+            setClosedIcon(DefaultLookup.getIcon(this, ui, "Tree.closedIcon"));
         }
         if (!inited || (getOpenIcon() instanceof UIManager)) {
-            setOpenIcon(UIManager.getIcon("Tree.openIcon"));
+            setOpenIcon(DefaultLookup.getIcon(this, ui, "Tree.openIcon"));
         }
         if (!inited || (getTextSelectionColor() instanceof UIResource)) {
             setTextSelectionColor(
-                    UIManager.getColor("Tree.selectionForeground"));
+                    DefaultLookup.getColor(this, ui, "Tree.selectionForeground"));
         }
         if (!inited || (getTextNonSelectionColor() instanceof UIResource)) {
             setTextNonSelectionColor(
-                UIManager.getColor("Tree.textForeground"));
+                    DefaultLookup.getColor(this, ui, "Tree.textForeground"));
         }
         if (!inited || (getBackgroundSelectionColor() instanceof UIResource)) {
             setBackgroundSelectionColor(
-                UIManager.getColor("Tree.selectionBackground"));
+                    DefaultLookup.getColor(this, ui, "Tree.selectionBackground"));
         }
         if (!inited ||
                 (getBackgroundNonSelectionColor() instanceof UIResource)) {
             setBackgroundNonSelectionColor(
-                    UIManager.getColor("Tree.textBackground"));
+                    DefaultLookup.getColor(this, ui, "Tree.textBackground"));
         }
         if (!inited || (getBorderSelectionColor() instanceof UIResource)) {
             setBorderSelectionColor(
-                UIManager.getColor("Tree.selectionBorderColor"));
+                    DefaultLookup.getColor(this, ui, "Tree.selectionBorderColor"));
         }
-        Object value = UIManager.get("Tree.drawsFocusBorderAroundIcon");
-        drawsFocusBorderAroundIcon = (value != null && ((Boolean)value).
-                                      booleanValue());
-        value = UIManager.get("Tree.drawDashedFocusIndicator");
-        drawDashedFocusIndicator = (value != null && ((Boolean)value).
-                                    booleanValue());
+        drawsFocusBorderAroundIcon = DefaultLookup.getBoolean(
+                this, ui, "Tree.drawsFocusBorderAroundIcon", false);
+        drawDashedFocusIndicator = DefaultLookup.getBoolean(
+                this, ui, "Tree.drawDashedFocusIndicator", false);
+
+        fillBackground = DefaultLookup.getBoolean(this, ui, "Tree.rendererFillBackground", true);
+        Insets margins = DefaultLookup.getInsets(this, ui, "Tree.rendererMargins");
+        if (margins != null) {
+            setBorder(new EmptyBorder(margins.top, margins.left,
+                    margins.bottom, margins.right));
+        }
+
+        setName("Tree.cellRenderer");
     }
 
 
@@ -220,7 +236,7 @@
       * represent non-leaf nodes that are expanded.
       */
     public Icon getDefaultOpenIcon() {
-        return UIManager.getIcon("Tree.openIcon");
+        return DefaultLookup.getIcon(this, ui, "Tree.openIcon");
     }
 
     /**
@@ -228,7 +244,7 @@
       * represent non-leaf nodes that are not expanded.
       */
     public Icon getDefaultClosedIcon() {
-        return UIManager.getIcon("Tree.closedIcon");
+        return DefaultLookup.getIcon(this, ui, "Tree.closedIcon");
     }
 
     /**
@@ -236,7 +252,7 @@
       * represent leaf nodes.
       */
     public Icon getDefaultLeafIcon() {
-        return UIManager.getIcon("Tree.leafIcon");
+        return DefaultLookup.getIcon(this, ui, "Tree.leafIcon");
     }
 
     /**
@@ -425,7 +441,7 @@
                 && dropLocation.getChildIndex() == -1
                 && tree.getRowForPath(dropLocation.getPath()) == row) {
 
-            Color col = UIManager.getColor("Tree.dropCellForeground");
+            Color col = DefaultLookup.getColor(this, ui, "Tree.dropCellForeground");
             if (col != null) {
                 fg = col;
             } else {
@@ -441,26 +457,24 @@
 
         setForeground(fg);
 
-        // There needs to be a way to specify disabled icons.
+        Icon icon = null;
+        if (leaf) {
+            icon = getLeafIcon();
+        } else if (expanded) {
+            icon = getOpenIcon();
+        } else {
+            icon = getClosedIcon();
+        }
+
         if (!tree.isEnabled()) {
             setEnabled(false);
-            if (leaf) {
-                setDisabledIcon(getLeafIcon());
-            } else if (expanded) {
-                setDisabledIcon(getOpenIcon());
-            } else {
-                setDisabledIcon(getClosedIcon());
-            }
-        }
-        else {
+            LookAndFeel laf = UIManager.getLookAndFeel();
+            Icon disabledIcon = laf.getDisabledIcon(tree, icon);
+            if (disabledIcon != null) icon = disabledIcon;
+            setDisabledIcon(icon);
+        } else {
             setEnabled(true);
-            if (leaf) {
-                setIcon(getLeafIcon());
-            } else if (expanded) {
-                setIcon(getOpenIcon());
-            } else {
-                setIcon(getClosedIcon());
-            }
+            setIcon(icon);
         }
         setComponentOrientation(tree.getComponentOrientation());
 
@@ -476,7 +490,7 @@
         Color bColor;
 
         if (isDropCell) {
-            bColor = UIManager.getColor("Tree.dropCellBackground");
+            bColor = DefaultLookup.getColor(this, ui, "Tree.dropCellBackground");
             if (bColor == null) {
                 bColor = getBackgroundSelectionColor();
             }
@@ -490,9 +504,7 @@
         }
 
         int imageOffset = -1;
-        if(bColor != null) {
-            Icon currentI = getIcon();
-
+        if (bColor != null && fillBackground) {
             imageOffset = getLabelStart();
             g.setColor(bColor);
             if(getComponentOrientation().isLeftToRight()) {
diff --git a/jdk/src/share/classes/sun/applet/AppletPanel.java b/jdk/src/share/classes/sun/applet/AppletPanel.java
index 99b85a7..911324e 100644
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java
@@ -45,7 +45,6 @@
 import java.util.Collections;
 import java.util.Locale;
 import java.util.WeakHashMap;
-import javax.swing.SwingUtilities;
 import sun.awt.AppContext;
 import sun.awt.EmbeddedFrame;
 import sun.awt.SunToolkit;
@@ -450,7 +449,7 @@
                       try {
                           final AppletPanel p = this;
 
-                          SwingUtilities.invokeAndWait(new Runnable() {
+                          EventQueue.invokeAndWait(new Runnable() {
                                   public void run() {
                                       p.validate();
                                   }
@@ -480,7 +479,7 @@
                           final AppletPanel p = this;
                           final Applet a = applet;
 
-                          SwingUtilities.invokeAndWait(new Runnable() {
+                          EventQueue.invokeAndWait(new Runnable() {
                                   public void run() {
                                       p.validate();
                                       a.setVisible(true);
@@ -514,7 +513,7 @@
                     try {
                         final Applet a = applet;
 
-                        SwingUtilities.invokeAndWait(new Runnable() {
+                        EventQueue.invokeAndWait(new Runnable() {
                                 public void run()
                                 {
                                     a.setVisible(false);
diff --git a/jdk/src/share/classes/sun/awt/EmbeddedFrame.java b/jdk/src/share/classes/sun/awt/EmbeddedFrame.java
index 7b77862..ee9a1e7 100644
--- a/jdk/src/share/classes/sun/awt/EmbeddedFrame.java
+++ b/jdk/src/share/classes/sun/awt/EmbeddedFrame.java
@@ -588,9 +588,11 @@
 
         public void setOpacity(float opacity) {
         }
+
         public void setOpaque(boolean isOpaque) {
         }
-        public void updateWindow(BufferedImage backBuffer) {
+
+        public void updateWindow(BufferedImage bi) {
         }
         public void repositionSecurityWarning() {
         }
diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java
index ac99f4b..a6e1cb1 100644
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java
@@ -2038,37 +2038,34 @@
     /**
      * Returns whether or not a containing top level window for the passed
      * component is
-     * {@link com.sun.awt.AWTUtilities.Translucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}.
+     * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT}.
      *
      * @param c a Component which toplevel's to check
      * @return {@code true}  if the passed component is not null and has a
      * containing toplevel window which is opaque (so per-pixel translucency
      * is not enabled), {@code false} otherwise
-     * @see com.sun.awt.AWTUtilities.Translucency#PERPIXEL_TRANSLUCENT
-     * @see com.sun.awt.AWTUtilities#isWindowOpaque(Window)
+     * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
      */
     public static boolean isContainingTopLevelOpaque(Component c) {
         Window w = getContainingWindow(c);
-        // return w != null && (w).isOpaque();
-        return w != null && com.sun.awt.AWTUtilities.isWindowOpaque(w);
+        return w != null && ((Window)w).getBackground() != null &&
+            ((Window)w).getBackground().getAlpha() == 255;
     }
 
     /**
      * Returns whether or not a containing top level window for the passed
      * component is
-     * {@link com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT TRANSLUCENT}.
+     * {@link GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT}.
      *
      * @param c a Component which toplevel's to check
      * @return {@code true} if the passed component is not null and has a
      * containing toplevel window which has opacity less than
      * 1.0f (which means that it is translucent), {@code false} otherwise
-     * @see com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT
-     * @see com.sun.awt.AWTUtilities#getWindowOpacity(Window)
+     * @see GraphicsDevice.WindowTranslucency#TRANSLUCENT
      */
     public static boolean isContainingTopLevelTranslucent(Component c) {
         Window w = getContainingWindow(c);
-        // return w != null && (w).getOpacity() < 1.0f;
-        return w != null && com.sun.awt.AWTUtilities.getWindowOpacity((Window)w) < 1.0f;
+        return w != null && ((Window)w).getOpacity() < 1.0f;
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java
index d960083..cfe0190 100644
--- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java
+++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java
@@ -65,10 +65,13 @@
 
 import java.rmi.MarshalledObject;
 
+import java.security.AccessControlContext;
+import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.security.ProtectionDomain;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -111,6 +114,8 @@
 import sun.awt.image.ImageRepresentation;
 import sun.awt.image.ToolkitImage;
 
+import java.io.FilePermission;
+
 
 /**
  * Provides a set of functions to be shared among the DataFlavor class and
@@ -1177,8 +1182,10 @@
             (String.class.equals(flavor.getRepresentationClass()) &&
              isFlavorCharsetTextType(flavor) && isTextFormat(format))) {
 
+            String str = removeSuspectedData(flavor, contents, (String)obj);
+
             return translateTransferableString(
-                (String)obj,
+                str,
                 format);
 
         // Source data is a Reader. Convert to a String and recur. In the
@@ -1286,6 +1293,11 @@
                 throw new IOException("data translation failed");
             }
             final List list = (List)obj;
+
+            final ArrayList fileList = new ArrayList();
+
+            final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents);
+
             int nFiles = 0;
             for (int i = 0; i < list.size(); i++) {
                 Object o = list.get(i);
@@ -1293,17 +1305,18 @@
                     nFiles++;
                 }
             }
-            final String[] files = new String[nFiles];
 
             try {
                 AccessController.doPrivileged(new PrivilegedExceptionAction() {
                     public Object run() throws IOException {
-                        for (int i = 0, j = 0; i < list.size(); i++) {
-                            Object o = list.get(i);
-                            if (o instanceof File) {
-                                files[j++] = ((File)o).getCanonicalPath();
-                            } else if (o instanceof String) {
-                                files[j++] = (String)o;
+                        for (Object fileObject : list)
+                        {
+                            File file = castToFile(fileObject);
+                            if (null == System.getSecurityManager() ||
+                                !(isFileInWebstartedCache(file) ||
+                                isForbiddenToRead(file, userProtectionDomain)))
+                            {
+                                fileList.add(file.getCanonicalPath());
                             }
                         }
                         return null;
@@ -1313,10 +1326,11 @@
                 throw new IOException(pae.getMessage());
             }
 
-            for (int i = 0; i < files.length; i++) {
-                 byte[] bytes = files[i].getBytes();
-                 if (i != 0) bos.write(0);
-                 bos.write(bytes, 0, bytes.length);
+            for (int i = 0; i < fileList.size(); i++)
+            {
+                byte[] bytes = ((String)fileList.get(i)).getBytes();
+                if (i != 0) bos.write(0);
+                bos.write(bytes, 0, bytes.length);
             }
 
         // Source data is an InputStream. For arbitrary flavors, just grab the
@@ -1366,6 +1380,123 @@
         return ret;
     }
 
+    private String removeSuspectedData(DataFlavor flavor, final Transferable contents, final String str)
+            throws IOException
+    {
+        if (null == System.getSecurityManager()
+            || !flavor.isMimeTypeEqual("text/uri-list"))
+        {
+            return str;
+        }
+
+
+        String ret_val = "";
+        final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents);
+
+        try {
+            ret_val = (String) AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    public Object run() {
+
+                        StringBuffer allowedFiles = new StringBuffer(str.length());
+                        String [] uriArray = str.split("(\\s)+");
+
+                        for (String fileName : uriArray)
+                        {
+                            File file = new File(fileName);
+                            if (file.exists() &&
+                                !(isFileInWebstartedCache(file) ||
+                                isForbiddenToRead(file, userProtectionDomain)))
+                            {
+
+                                if (0 != allowedFiles.length())
+                                {
+                                    allowedFiles.append("\\r\\n");
+                                }
+
+                                allowedFiles.append(fileName);
+                            }
+                        }
+
+                        return allowedFiles.toString();
+                    }
+                });
+        } catch (PrivilegedActionException pae) {
+            throw new IOException(pae.getMessage(), pae);
+        }
+
+        return ret_val;
+    }
+
+    private static ProtectionDomain getUserProtectionDomain(Transferable contents) {
+        return contents.getClass().getProtectionDomain();
+    }
+
+    private boolean isForbiddenToRead (File file, ProtectionDomain protectionDomain)
+    {
+        if (null == protectionDomain) {
+            return false;
+        }
+        try {
+            FilePermission filePermission =
+                    new FilePermission(file.getCanonicalPath(), "read, delete");
+            if (protectionDomain.implies(filePermission)) {
+                return false;
+            }
+        } catch (IOException e) {}
+
+        return true;
+    }
+
+    // It is important do not use user's successors
+    // of File class.
+    private File castToFile(Object fileObject) throws IOException {
+        String filePath = null;
+        if (fileObject instanceof File) {
+            filePath = ((File)fileObject).getCanonicalPath();
+        } else if (fileObject instanceof String) {
+           filePath = (String) fileObject;
+        }
+        return new File(filePath);
+    }
+
+    private final static String[] DEPLOYMENT_CACHE_PROPERTIES = {
+        "deployment.system.cachedir",
+        "deployment.user.cachedir",
+        "deployment.javaws.cachedir",
+        "deployment.javapi.cachedir"
+    };
+
+    private final static ArrayList <File> deploymentCacheDirectoryList =
+            new ArrayList<File>();
+
+    private static boolean isFileInWebstartedCache(File f) {
+
+        if (deploymentCacheDirectoryList.isEmpty()) {
+            for (String cacheDirectoryProperty : DEPLOYMENT_CACHE_PROPERTIES) {
+                String cacheDirectoryPath = System.getProperty(cacheDirectoryProperty);
+                if (cacheDirectoryPath != null) {
+                    try {
+                        File cacheDirectory = (new File(cacheDirectoryPath)).getCanonicalFile();
+                        if (cacheDirectory != null) {
+                            deploymentCacheDirectoryList.add(cacheDirectory);
+                        }
+                    } catch (IOException ioe) {}
+                }
+            }
+        }
+
+        for (File deploymentCacheDirectory : deploymentCacheDirectoryList) {
+            for (File dir = f; dir != null; dir = dir.getParentFile()) {
+                if (dir.equals(deploymentCacheDirectory)) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+
     public Object translateBytes(byte[] bytes, DataFlavor flavor,
                                  long format, Transferable localeTransferable)
         throws IOException
diff --git a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java
index aa87fb8..b0679af 100644
--- a/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java
+++ b/jdk/src/share/classes/sun/awt/image/GifImageDecoder.java
@@ -585,9 +585,16 @@
             System.out.print("Reading a " + width + " by " + height + " " +
                       (interlace ? "" : "non-") + "interlaced image...");
         }
-
+        int initCodeSize = ExtractByte(block, 9);
+        if (initCodeSize >= 12) {
+            if (verbose) {
+                System.out.println("Invalid initial code size: " +
+                                   initCodeSize);
+            }
+            return false;
+        }
         boolean ret = parseImage(x, y, width, height,
-                                 interlace, ExtractByte(block, 9),
+                                 interlace, initCodeSize,
                                  block, rasline, model);
 
         if (!ret) {
diff --git a/jdk/src/share/classes/sun/font/CreatedFontTracker.java b/jdk/src/share/classes/sun/font/CreatedFontTracker.java
new file mode 100644
index 0000000..741337d
--- /dev/null
+++ b/jdk/src/share/classes/sun/font/CreatedFontTracker.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.font;
+
+public class CreatedFontTracker {
+
+    public static final int MAX_FILE_SIZE = 32 * 1024 * 1024;
+    public static final int MAX_TOTAL_BYTES = 10 * MAX_FILE_SIZE;
+
+    static int numBytes;
+    static CreatedFontTracker tracker;
+
+    public static synchronized CreatedFontTracker getTracker() {
+        if (tracker == null) {
+            tracker = new CreatedFontTracker();
+        }
+        return tracker;
+    }
+
+    public synchronized int getNumBytes() {
+        return numBytes;
+    }
+
+    public synchronized void addBytes(int sz) {
+        numBytes += sz;
+    }
+
+    public synchronized void subBytes(int sz) {
+        numBytes -= sz;
+    }
+}
diff --git a/jdk/src/share/classes/sun/font/FileFont.java b/jdk/src/share/classes/sun/font/FileFont.java
index b6a2099..5aad11b 100644
--- a/jdk/src/share/classes/sun/font/FileFont.java
+++ b/jdk/src/share/classes/sun/font/FileFont.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -125,9 +125,9 @@
         return true;
     }
 
-    void setFileToRemove(File file) {
+    void setFileToRemove(File file, CreatedFontTracker tracker) {
         Disposer.addObjectRecord(this,
-                                 new CreatedFontFileDisposerRecord(file));
+                         new CreatedFontFileDisposerRecord(file, tracker));
     }
 
     /* This is called when a font scaler is determined to
@@ -246,12 +246,16 @@
         return getScaler().getUnitsPerEm();
     }
 
-    private static class CreatedFontFileDisposerRecord implements DisposerRecord {
+    private static class CreatedFontFileDisposerRecord
+        implements DisposerRecord {
 
         File fontFile = null;
+        CreatedFontTracker tracker;
 
-        private CreatedFontFileDisposerRecord(File file) {
+        private CreatedFontFileDisposerRecord(File file,
+                                              CreatedFontTracker tracker) {
             fontFile = file;
+            this.tracker = tracker;
         }
 
         public void dispose() {
@@ -260,6 +264,9 @@
                       public Object run() {
                           if (fontFile != null) {
                               try {
+                                  if (tracker != null) {
+                                      tracker.subBytes((int)fontFile.length());
+                                  }
                                   /* REMIND: is it possible that the file is
                                    * still open? It will be closed when the
                                    * font2D is disposed but could this code
diff --git a/jdk/src/share/classes/sun/font/FontManager.java b/jdk/src/share/classes/sun/font/FontManager.java
index a8b721d..6ac8962 100644
--- a/jdk/src/share/classes/sun/font/FontManager.java
+++ b/jdk/src/share/classes/sun/font/FontManager.java
@@ -2357,19 +2357,21 @@
     static Vector<File> tmpFontFiles = null;
 
     public static Font2D createFont2D(File fontFile, int fontFormat,
-                                      boolean isCopy)
+                                      boolean isCopy,
+                                      CreatedFontTracker tracker)
         throws FontFormatException {
 
         String fontFilePath = fontFile.getPath();
         FileFont font2D = null;
         final File fFile = fontFile;
+        final CreatedFontTracker _tracker = tracker;
         try {
             switch (fontFormat) {
             case Font.TRUETYPE_FONT:
                 font2D = new TrueTypeFont(fontFilePath, null, 0, true);
                 break;
             case Font.TYPE1_FONT:
-                font2D = new Type1Font(fontFilePath, null);
+                font2D = new Type1Font(fontFilePath, null, isCopy);
                 break;
             default:
                 throw new FontFormatException("Unrecognised Font Format");
@@ -2379,6 +2381,9 @@
                 java.security.AccessController.doPrivileged(
                      new java.security.PrivilegedAction() {
                           public Object run() {
+                              if (_tracker != null) {
+                                  _tracker.subBytes((int)fFile.length());
+                              }
                               fFile.delete();
                               return null;
                           }
@@ -2387,7 +2392,7 @@
             throw(e);
         }
         if (isCopy) {
-            font2D.setFileToRemove(fontFile);
+            font2D.setFileToRemove(fontFile, tracker);
             synchronized (FontManager.class) {
 
                 if (tmpFontFiles == null) {
diff --git a/jdk/src/share/classes/sun/font/TrueTypeFont.java b/jdk/src/share/classes/sun/font/TrueTypeFont.java
index 5d9477b..13f0f69 100644
--- a/jdk/src/share/classes/sun/font/TrueTypeFont.java
+++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java
@@ -175,8 +175,17 @@
         super(platname, nativeNames);
         useJavaRasterizer = javaRasterizer;
         fontRank = Font2D.TTF_RANK;
-        verify();
-        init(fIndex);
+        try {
+            verify();
+            init(fIndex);
+        } catch (Throwable t) {
+            close();
+            if (t instanceof FontFormatException) {
+                throw (FontFormatException)t;
+            } else {
+                throw new FontFormatException("Unexpected runtime exception.");
+            }
+        }
         Disposer.addObjectRecord(this, disposerRecord);
     }
 
diff --git a/jdk/src/share/classes/sun/font/Type1Font.java b/jdk/src/share/classes/sun/font/Type1Font.java
index 36841b6..a117310 100644
--- a/jdk/src/share/classes/sun/font/Type1Font.java
+++ b/jdk/src/share/classes/sun/font/Type1Font.java
@@ -39,6 +39,7 @@
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.FileChannel;
 import sun.java2d.Disposer;
+import sun.java2d.DisposerRecord;
 import java.util.HashSet;
 import java.util.HashMap;
 import java.awt.Font;
@@ -76,6 +77,27 @@
  */
 public class Type1Font extends FileFont {
 
+     private static class T1DisposerRecord  implements DisposerRecord {
+        String fileName = null;
+
+        T1DisposerRecord(String name) {
+            fileName = name;
+        }
+
+        public synchronized void dispose() {
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction() {
+                    public Object run() {
+
+                        if (fileName != null) {
+                            (new java.io.File(fileName)).delete();
+                        }
+                        return null;
+                    }
+             });
+        }
+    }
+
     WeakReference bufferRef = new WeakReference(null);
 
     private String psName = null;
@@ -125,18 +147,42 @@
 
 
     /**
+     * Constructs a Type1 Font.
+     * @param platname - Platform identifier of the font. Typically file name.
+     * @param nativeNames - Native names - typically XLFDs on Unix.
+     */
+    public Type1Font(String platname, Object nativeNames)
+        throws FontFormatException {
+
+        this(platname, nativeNames, false);
+    }
+
+    /**
      * - does basic verification of the file
      * - reads the names (full, family).
      * - determines the style of the font.
      * @throws FontFormatException - if the font can't be opened
      * or fails verification,  or there's no usable cmap
      */
-    public Type1Font(String platname, Object nativeNames)
+    public Type1Font(String platname, Object nativeNames, boolean createdCopy)
         throws FontFormatException {
         super(platname, nativeNames);
         fontRank = Font2D.TYPE1_RANK;
         checkedNatives = true;
-        verify();
+        try {
+            verify();
+        } catch (Throwable t) {
+            if (createdCopy) {
+                T1DisposerRecord ref = new T1DisposerRecord(platname);
+                Disposer.addObjectRecord(bufferRef, ref);
+                bufferRef = null;
+            }
+            if (t instanceof FontFormatException) {
+                throw (FontFormatException)t;
+            } else {
+                throw new FontFormatException("Unexpected runtime exception.");
+            }
+        }
     }
 
     private synchronized ByteBuffer getBuffer() throws FontFormatException {
diff --git a/jdk/src/share/classes/sun/io/ByteToCharBig5.java b/jdk/src/share/classes/sun/io/ByteToCharBig5.java
index 1857023..50951e4 100644
--- a/jdk/src/share/classes/sun/io/ByteToCharBig5.java
+++ b/jdk/src/share/classes/sun/io/ByteToCharBig5.java
@@ -26,6 +26,8 @@
 
 package sun.io;
 
+import sun.nio.cs.ext.Big5;
+
 /**
  * Tables and data to convert Big5 to Unicode
  *
@@ -34,2179 +36,16 @@
 
 public class ByteToCharBig5 extends ByteToCharDoubleByte {
 
+    private final static Big5 nioCoder = new Big5();
+
     public String getCharacterEncoding() {
         return "Big5";
     }
 
     public ByteToCharBig5() {
-        super.index1 = index1;
-        super.index2 = index2;
+        super.index1 = nioCoder.getDecoderIndex1();
+        super.index2 = nioCoder.getDecoderIndex2();
         start = 0x40;
         end = 0xFE;
     }
-
-    private final static String innerIndex0=
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u3000"+
-        "\uFF0C\u3001\u3002\uFF0E\u2022\uFF1B\uFF1A\uFF1F"+
-        "\uFF01\uFE30\u2026\u2025\uFE50\uFF64\uFE52\u00B7"+
-        "\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014"+
-        "\uFE33\uFF3F\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36"+
-        "\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A"+
-        "\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E"+
-        "\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42"+
-        "\u300E\u300F\uFE43\uFE44\uFE59\uFE5A\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFE5B\uFE5C\uFE5D\uFE5E\u2018\u2019\u201C\u201D"+
-        "\u301D\u301E\u2035\u2032\uFF03\uFF06\uFF0A\u203B"+
-        "\u00A7\u3003\u25CB\u25CF\u25B3\u25B2\u25CE\u2606"+
-        "\u2605\u25C7\u25C6\u25A1\u25A0\u25BD\u25BC\u32A3"+
-        "\u2105\u203E\uFFFD\uFF3F\uFFFD\uFE49\uFE4A\uFE4D"+
-        "\uFE4E\uFE4B\uFE4C\uFE5F\uFE60\uFE61\uFF0B\uFF0D"+
-        "\u00D7\u00F7\u00B1\u221A\uFF1C\uFF1E\uFF1D\u2266"+
-        "\u2267\u2260\u221E\u2252\u2261\uFE62\uFE63\uFE64"+
-        "\uFE65\uFE66\u223C\u2229\u222A\u22A5\u2220\u221F"+
-        "\u22BF\u33D2\u33D1\u222B\u222E\u2235\u2234\u2640"+
-        "\u2642\u2641\u2609\u2191\u2193\u2190\u2192\u2196"+
-        "\u2197\u2199\u2198\u2225\u2223\u2571\u2572\uFF0F"+
-        "\uFF3C\uFF04\u00A5\u3012\u00A2\u00A3\uFF05\uFF20"+
-        "\u2103\u2109\uFE69\uFE6A\uFE6B\u33D5\u339C\u339D"+
-        "\u339E\u33CE\u33A1\u338E\u338F\u33C4\u00B0\u5159"+
-        "\u515B\u515E\u515D\u5161\u5163\u55E7\u74E9\u7CCE"+
-        "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588"+
-        "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u253C"+
-        "\u2534\u252C\u2524\u251C\u2594\u2500\u2502\u2595"+
-        "\u250C\u2510\u2514\u2518\u256D\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u256E"+
-        "\u2570\u256F\u2550\u255E\u256A\u2561\u25E2\u25E3"+
-        "\u25E5\u25E4\u2571\u2572\u2573\uFF10\uFF11\uFF12"+
-        "\uFF13\uFF14\uFF15\uFF16\uFF17\uFF18\uFF19\u2160"+
-        "\u2161\u2162\u2163\u2164\u2165\u2166\u2167\u2168"+
-        "\u2169\u3021\u3022\u3023\u3024\u3025\u3026\u3027"+
-        "\u3028\u3029\u5341\u5344\u5345\uFF21\uFF22\uFF23"+
-        "\uFF24\uFF25\uFF26\uFF27\uFF28\uFF29\uFF2A\uFF2B"+
-        "\uFF2C\uFF2D\uFF2E\uFF2F\uFF30\uFF31\uFF32\uFF33"+
-        "\uFF34\uFF35\uFF36\uFF37\uFF38\uFF39\uFF3A\uFF41"+
-        "\uFF42\uFF43\uFF44\uFF45\uFF46\uFF47\uFF48\uFF49"+
-        "\uFF4A\uFF4B\uFF4C\uFF4D\uFF4E\uFF4F\uFF50\uFF51"+
-        "\uFF52\uFF53\uFF54\uFF55\uFF56\uFF57\uFF58\uFF59"+
-        "\uFF5A\u0391\u0392\u0393\u0394\u0395\u0396\u0397"+
-        "\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F"+
-        "\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8"+
-        "\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7"+
-        "\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF"+
-        "\u03C0\u03C1\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8"+
-        "\u03C9\u3105\u3106\u3107\u3108\u3109\u310A\u310B"+
-        "\u310C\u310D\u310E\u310F\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u3110\u3111"+
-        "\u3112\u3113\u3114\u3115\u3116\u3117\u3118\u3119"+
-        "\u311A\u311B\u311C\u311D\u311E\u311F\u3120\u3121"+
-        "\u3122\u3123\u3124\u3125\u3126\u3127\u3128\u3129"+
-        "\u02D9\u02C9\u02CA\u02C7\u02CB\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u4E00\u4E59\u4E01\u4E03"+
-        "\u4E43\u4E5D\u4E86\u4E8C\u4EBA\u513F\u5165\u516B"+
-        "\u51E0\u5200\u5201\u529B\u5315\u5341\u535C\u53C8"+
-        "\u4E09\u4E0B\u4E08\u4E0A\u4E2B\u4E38\u51E1\u4E45"+
-        "\u4E48\u4E5F\u4E5E\u4E8E\u4EA1\u5140\u5203\u52FA"+
-        "\u5343\u53C9\u53E3\u571F\u58EB\u5915\u5927\u5973"+
-        "\u5B50\u5B51\u5B53\u5BF8\u5C0F\u5C22\u5C38\u5C71"+
-        "\u5DDD\u5DE5\u5DF1\u5DF2\u5DF3\u5DFE\u5E72\u5EFE"+
-        "\u5F0B\u5F13\u624D\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u4E11\u4E10\u4E0D"+
-        "\u4E2D\u4E30\u4E39\u4E4B\u5C39\u4E88\u4E91\u4E95"+
-        "\u4E92\u4E94\u4EA2\u4EC1\u4EC0\u4EC3\u4EC6\u4EC7"+
-        "\u4ECD\u4ECA\u4ECB\u4EC4\u5143\u5141\u5167\u516D"+
-        "\u516E\u516C\u5197\u51F6\u5206\u5207\u5208\u52FB"+
-        "\u52FE\u52FF\u5316\u5339\u5348\u5347\u5345\u535E"+
-        "\u5384\u53CB\u53CA\u53CD\u58EC\u5929\u592B\u592A"+
-        "\u592D\u5B54\u5C11\u5C24\u5C3A\u5C6F\u5DF4\u5E7B"+
-        "\u5EFF\u5F14\u5F15\u5FC3\u6208\u6236\u624B\u624E"+
-        "\u652F\u6587\u6597\u65A4\u65B9\u65E5\u66F0\u6708"+
-        "\u6728\u6B20\u6B62\u6B79\u6BCB\u6BD4\u6BDB\u6C0F"+
-        "\u6C34\u706B\u722A\u7236\u723B\u7247\u7259\u725B"+
-        "\u72AC\u738B\u4E19\u4E16\u4E15\u4E14\u4E18\u4E3B"+
-        "\u4E4D\u4E4F\u4E4E\u4EE5\u4ED8\u4ED4\u4ED5\u4ED6"+
-        "\u4ED7\u4EE3\u4EE4\u4ED9\u4EDE\u5145\u5144\u5189"+
-        "\u518A\u51AC\u51F9\u51FA\u51F8\u520A\u52A0\u529F"+
-        "\u5305\u5306\u5317\u531D\u4EDF\u534A\u5349\u5361"+
-        "\u5360\u536F\u536E\u53BB\u53EF\u53E4\u53F3\u53EC"+
-        "\u53EE\u53E9\u53E8\u53FC\u53F8\u53F5\u53EB\u53E6"+
-        "\u53EA\u53F2\u53F1\u53F0\u53E5\u53ED\u53FB\u56DB"+
-        "\u56DA\u5916\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u592E\u5931\u5974\u5976"+
-        "\u5B55\u5B83\u5C3C\u5DE8\u5DE7\u5DE6\u5E02\u5E03"+
-        "\u5E73\u5E7C\u5F01\u5F18\u5F17\u5FC5\u620A\u6253"+
-        "\u6254\u6252\u6251\u65A5\u65E6\u672E\u672C\u672A"+
-        "\u672B\u672D\u6B63\u6BCD\u6C11\u6C10\u6C38\u6C41"+
-        "\u6C40\u6C3E\u72AF\u7384\u7389\u74DC\u74E6\u7518"+
-        "\u751F\u7528\u7529\u7530\u7531\u7532\u7533\u758B"+
-        "\u767D\u76AE\u76BF\u76EE\u77DB\u77E2\u77F3\u793A"+
-        "\u79BE\u7A74\u7ACB\u4E1E\u4E1F\u4E52\u4E53\u4E69"+
-        "\u4E99\u4EA4\u4EA6\u4EA5\u4EFF\u4F09\u4F19\u4F0A"+
-        "\u4F15\u4F0D\u4F10\u4F11\u4F0F\u4EF2\u4EF6\u4EFB"+
-        "\u4EF0\u4EF3\u4EFD\u4F01\u4F0B\u5149\u5147\u5146"+
-        "\u5148\u5168\u5171\u518D\u51B0\u5217\u5211\u5212"+
-        "\u520E\u5216\u52A3\u5308\u5321\u5320\u5370\u5371"+
-        "\u5409\u540F\u540C\u540A\u5410\u5401\u540B\u5404"+
-        "\u5411\u540D\u5408\u5403\u540E\u5406\u5412\u56E0"+
-        "\u56DE\u56DD\u5733\u5730\u5728\u572D\u572C\u572F"+
-        "\u5729\u5919\u591A\u5937\u5938\u5984\u5978\u5983"+
-        "\u597D\u5979\u5982\u5981\u5B57\u5B58\u5B87\u5B88"+
-        "\u5B85\u5B89\u5BFA\u5C16\u5C79\u5DDE\u5E06\u5E76"+
-        "\u5E74\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u5F0F\u5F1B\u5FD9\u5FD6\u620E"+
-        "\u620C\u620D\u6210\u6263\u625B\u6258\u6536\u65E9"+
-        "\u65E8\u65EC\u65ED\u66F2\u66F3\u6709\u673D\u6734"+
-        "\u6731\u6735\u6B21\u6B64\u6B7B\u6C16\u6C5D\u6C57"+
-        "\u6C59\u6C5F\u6C60\u6C50\u6C55\u6C61\u6C5B\u6C4D"+
-        "\u6C4E\u7070\u725F\u725D\u767E\u7AF9\u7C73\u7CF8"+
-        "\u7F36\u7F8A\u7FBD\u8001\u8003\u800C\u8012\u8033"+
-        "\u807F\u8089\u808B\u808C\u81E3\u81EA\u81F3\u81FC"+
-        "\u820C\u821B\u821F\u826E\u8272\u827E\u866B\u8840"+
-        "\u884C\u8863\u897F\u9621\u4E32\u4EA8\u4F4D\u4F4F"+
-        "\u4F47\u4F57\u4F5E\u4F34\u4F5B\u4F55\u4F30\u4F50"+
-        "\u4F51\u4F3D\u4F3A\u4F38\u4F43\u4F54\u4F3C\u4F46"+
-        "\u4F63\u4F5C\u4F60\u4F2F\u4F4E\u4F36\u4F59\u4F5D"+
-        "\u4F48\u4F5A\u514C\u514B\u514D\u5175\u51B6\u51B7"+
-        "\u5225\u5224\u5229\u522A\u5228\u52AB\u52A9\u52AA"+
-        "\u52AC\u5323\u5373\u5375\u541D\u542D\u541E\u543E"+
-        "\u5426\u544E\u5427\u5446\u5443\u5433\u5448\u5442"+
-        "\u541B\u5429\u544A\u5439\u543B\u5438\u542E\u5435"+
-        "\u5436\u5420\u543C\u5440\u5431\u542B\u541F\u542C"+
-        "\u56EA\u56F0\u56E4\u56EB\u574A\u5751\u5740\u574D"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u5747\u574E\u573E\u5750\u574F\u573B"+
-        "\u58EF\u593E\u599D\u5992\u59A8\u599E\u59A3\u5999"+
-        "\u5996\u598D\u59A4\u5993\u598A\u59A5\u5B5D\u5B5C"+
-        "\u5B5A\u5B5B\u5B8C\u5B8B\u5B8F\u5C2C\u5C40\u5C41"+
-        "\u5C3F\u5C3E\u5C90\u5C91\u5C94\u5C8C\u5DEB\u5E0C"+
-        "\u5E8F\u5E87\u5E8A\u5EF7\u5F04\u5F1F\u5F64\u5F62"+
-        "\u5F77\u5F79\u5FD8\u5FCC\u5FD7\u5FCD\u5FF1\u5FEB"+
-        "\u5FF8\u5FEA\u6212\u6211\u6284\u6297\u6296\u6280"+
-        "\u6276\u6289\u626D\u628A\u627C\u627E\u6279\u6273"+
-        "\u6292\u626F\u6298\u626E\u6295\u6293\u6291\u6286"+
-        "\u6539\u653B\u6538\u65F1\u66F4\u675F\u674E\u674F"+
-        "\u6750\u6751\u675C\u6756\u675E\u6749\u6746\u6760"+
-        "\u6753\u6757\u6B65\u6BCF\u6C42\u6C5E\u6C99\u6C81"+
-        "\u6C88\u6C89\u6C85\u6C9B\u6C6A\u6C7A\u6C90\u6C70"+
-        "\u6C8C\u6C68\u6C96\u6C92\u6C7D\u6C83\u6C72\u6C7E"+
-        "\u6C74\u6C86\u6C76\u6C8D\u6C94\u6C98\u6C82\u7076"+
-        "\u707C\u707D\u7078\u7262\u7261\u7260\u72C4\u72C2"+
-        "\u7396\u752C\u752B\u7537\u7538\u7682\u76EF\u77E3"+
-        "\u79C1\u79C0\u79BF\u7A76\u7CFB\u7F55\u8096\u8093"+
-        "\u809D\u8098\u809B\u809A\u80B2\u826F\u8292\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u828B\u828D\u898B\u89D2\u8A00\u8C37\u8C46"+
-        "\u8C55\u8C9D\u8D64\u8D70\u8DB3\u8EAB\u8ECA\u8F9B"+
-        "\u8FB0\u8FC2\u8FC6\u8FC5\u8FC4\u5DE1\u9091\u90A2"+
-        "\u90AA\u90A6\u90A3\u9149\u91C6\u91CC\u9632\u962E"+
-        "\u9631\u962A\u962C\u4E26\u4E56\u4E73\u4E8B\u4E9B"+
-        "\u4E9E\u4EAB\u4EAC\u4F6F\u4F9D\u4F8D\u4F73\u4F7F"+
-        "\u4F6C\u4F9B\u4F8B\u4F86\u4F83\u4F70\u4F75\u4F88"+
-        "\u4F69\u4F7B\u4F96\u4F7E\u4F8F\u4F91\u4F7A\u5154"+
-        "\u5152\u5155\u5169\u5177\u5176\u5178\u51BD\u51FD"+
-        "\u523B\u5238\u5237\u523A\u5230\u522E\u5236\u5241"+
-        "\u52BE\u52BB\u5352\u5354\u5353\u5351\u5366\u5377"+
-        "\u5378\u5379\u53D6\u53D4\u53D7\u5473\u5475\u5496"+
-        "\u5478\u5495\u5480\u547B\u5477\u5484\u5492\u5486"+
-        "\u547C\u5490\u5471\u5476\u548C\u549A\u5462\u5468"+
-        "\u548B\u547D\u548E\u56FA\u5783\u5777\u576A\u5769"+
-        "\u5761\u5766\u5764\u577C\u591C\u5949\u5947\u5948"+
-        "\u5944\u5954\u59BE\u59BB\u59D4\u59B9\u59AE\u59D1"+
-        "\u59C6\u59D0\u59CD\u59CB\u59D3\u59CA\u59AF\u59B3"+
-        "\u59D2\u59C5\u5B5F\u5B64\u5B63\u5B97\u5B9A\u5B98"+
-        "\u5B9C\u5B99\u5B9B\u5C1A\u5C48\u5C45\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u5C46\u5CB7\u5CA1\u5CB8\u5CA9\u5CAB\u5CB1\u5CB3"+
-        "\u5E18\u5E1A\u5E16\u5E15\u5E1B\u5E11\u5E78\u5E9A"+
-        "\u5E97\u5E9C\u5E95\u5E96\u5EF6\u5F26\u5F27\u5F29"+
-        "\u5F80\u5F81\u5F7F\u5F7C\u5FDD\u5FE0\u5FFD\u5FF5"+
-        "\u5FFF\u600F\u6014\u602F\u6035\u6016\u602A\u6015"+
-        "\u6021\u6027\u6029\u602B\u601B\u6216\u6215\u623F"+
-        "\u623E\u6240\u627F\u62C9\u62CC\u62C4\u62BF\u62C2"+
-        "\u62B9\u62D2\u62DB\u62AB\u62D3\u62D4\u62CB\u62C8"+
-        "\u62A8\u62BD\u62BC\u62D0\u62D9\u62C7\u62CD\u62B5"+
-        "\u62DA\u62B1\u62D8\u62D6\u62D7\u62C6\u62AC\u62CE"+
-        "\u653E\u65A7\u65BC\u65FA\u6614\u6613\u660C\u6606"+
-        "\u6602\u660E\u6600\u660F\u6615\u660A\u6607\u670D"+
-        "\u670B\u676D\u678B\u6795\u6771\u679C\u6773\u6777"+
-        "\u6787\u679D\u6797\u676F\u6770\u677F\u6789\u677E"+
-        "\u6790\u6775\u679A\u6793\u677C\u676A\u6772\u6B23"+
-        "\u6B66\u6B67\u6B7F\u6C13\u6C1B\u6CE3\u6CE8\u6CF3"+
-        "\u6CB1\u6CCC\u6CE5\u6CB3\u6CBD\u6CBE\u6CBC\u6CE2"+
-        "\u6CAB\u6CD5\u6CD3\u6CB8\u6CC4\u6CB9\u6CC1\u6CAE"+
-        "\u6CD7\u6CC5\u6CF1\u6CBF\u6CBB\u6CE1\u6CDB\u6CCA"+
-        "\u6CAC\u6CEF\u6CDC\u6CD6\u6CE0\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u7095"+
-        "\u708E\u7092\u708A\u7099\u722C\u722D\u7238\u7248"+
-        "\u7267\u7269\u72C0\u72CE\u72D9\u72D7\u72D0\u73A9"+
-        "\u73A8\u739F\u73AB\u73A5\u753D\u759D\u7599\u759A"+
-        "\u7684\u76C2\u76F2\u76F4\u77E5\u77FD\u793E\u7940"+
-        "\u7941\u79C9\u79C8\u7A7A\u7A79\u7AFA\u7CFE\u7F54"+
-        "\u7F8C\u7F8B\u8005\u80BA\u80A5\u80A2\u80B1\u80A1"+
-        "\u80AB\u80A9\u80B4\u80AA\u80AF\u81E5\u81FE\u820D"+
-        "\u82B3\u829D\u8299\u82AD\u82BD\u829F\u82B9\u82B1"+
-        "\u82AC\u82A5\u82AF\u82B8\u82A3\u82B0\u82BE\u82B7"+
-        "\u864E\u8671\u521D\u8868\u8ECB\u8FCE\u8FD4\u8FD1"+
-        "\u90B5\u90B8\u90B1\u90B6\u91C7\u91D1\u9577\u9580"+
-        "\u961C\u9640\u963F\u963B\u9644\u9642\u96B9\u96E8"+
-        "\u9752\u975E\u4E9F\u4EAD\u4EAE\u4FE1\u4FB5\u4FAF"+
-        "\u4FBF\u4FE0\u4FD1\u4FCF\u4FDD\u4FC3\u4FB6\u4FD8"+
-        "\u4FDF\u4FCA\u4FD7\u4FAE\u4FD0\u4FC4\u4FC2\u4FDA"+
-        "\u4FCE\u4FDE\u4FB7\u5157\u5192\u5191\u51A0\u524E"+
-        "\u5243\u524A\u524D\u524C\u524B\u5247\u52C7\u52C9"+
-        "\u52C3\u52C1\u530D\u5357\u537B\u539A\u53DB\u54AC"+
-        "\u54C0\u54A8\u54CE\u54C9\u54B8\u54A6\u54B3\u54C7"+
-        "\u54C2\u54BD\u54AA\u54C1\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u54C4\u54C8"+
-        "\u54AF\u54AB\u54B1\u54BB\u54A9\u54A7\u54BF\u56FF"+
-        "\u5782\u578B\u57A0\u57A3\u57A2\u57CE\u57AE\u5793"+
-        "\u5955\u5951\u594F\u594E\u5950\u59DC\u59D8\u59FF"+
-        "\u59E3\u59E8\u5A03\u59E5\u59EA\u59DA\u59E6\u5A01"+
-        "\u59FB\u5B69\u5BA3\u5BA6\u5BA4\u5BA2\u5BA5\u5C01"+
-        "\u5C4E\u5C4F\u5C4D\u5C4B\u5CD9\u5CD2\u5DF7\u5E1D"+
-        "\u5E25\u5E1F\u5E7D\u5EA0\u5EA6\u5EFA\u5F08\u5F2D"+
-        "\u5F65\u5F88\u5F85\u5F8A\u5F8B\u5F87\u5F8C\u5F89"+
-        "\u6012\u601D\u6020\u6025\u600E\u6028\u604D\u6070"+
-        "\u6068\u6062\u6046\u6043\u606C\u606B\u606A\u6064"+
-        "\u6241\u62DC\u6316\u6309\u62FC\u62ED\u6301\u62EE"+
-        "\u62FD\u6307\u62F1\u62F7\u62EF\u62EC\u62FE\u62F4"+
-        "\u6311\u6302\u653F\u6545\u65AB\u65BD\u65E2\u6625"+
-        "\u662D\u6620\u6627\u662F\u661F\u6628\u6631\u6624"+
-        "\u66F7\u67FF\u67D3\u67F1\u67D4\u67D0\u67EC\u67B6"+
-        "\u67AF\u67F5\u67E9\u67EF\u67C4\u67D1\u67B4\u67DA"+
-        "\u67E5\u67B8\u67CF\u67DE\u67F3\u67B0\u67D9\u67E2"+
-        "\u67DD\u67D2\u6B6A\u6B83\u6B86\u6BB5\u6BD2\u6BD7"+
-        "\u6C1F\u6CC9\u6D0B\u6D32\u6D2A\u6D41\u6D25\u6D0C"+
-        "\u6D31\u6D1E\u6D17\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u6D3B\u6D3D\u6D3E"+
-        "\u6D36\u6D1B\u6CF5\u6D39\u6D27\u6D38\u6D29\u6D2E"+
-        "\u6D35\u6D0E\u6D2B\u70AB\u70BA\u70B3\u70AC\u70AF"+
-        "\u70AD\u70B8\u70AE\u70A4\u7230\u7272\u726F\u7274"+
-        "\u72E9\u72E0\u72E1\u73B7\u73CA\u73BB\u73B2\u73CD"+
-        "\u73C0\u73B3\u751A\u752D\u754F\u754C\u754E\u754B"+
-        "\u75AB\u75A4\u75A5\u75A2\u75A3\u7678\u7686\u7687"+
-        "\u7688\u76C8\u76C6\u76C3\u76C5\u7701\u76F9\u76F8"+
-        "\u7709\u770B\u76FE\u76FC\u7707\u77DC\u7802\u7814"+
-        "\u780C\u780D\u7946\u7949\u7948\u7947\u79B9\u79BA"+
-        "\u79D1\u79D2\u79CB\u7A7F\u7A81\u7AFF\u7AFD\u7C7D"+
-        "\u7D02\u7D05\u7D00\u7D09\u7D07\u7D04\u7D06\u7F38"+
-        "\u7F8E\u7FBF\u8004\u8010\u800D\u8011\u8036\u80D6"+
-        "\u80E5\u80DA\u80C3\u80C4\u80CC\u80E1\u80DB\u80CE"+
-        "\u80DE\u80E4\u80DD\u81F4\u8222\u82E7\u8303\u8305"+
-        "\u82E3\u82DB\u82E6\u8304\u82E5\u8302\u8309\u82D2"+
-        "\u82D7\u82F1\u8301\u82DC\u82D4\u82D1\u82DE\u82D3"+
-        "\u82DF\u82EF\u8306\u8650\u8679\u867B\u867A\u884D"+
-        "\u886B\u8981\u89D4\u8A08\u8A02\u8A03\u8C9E\u8CA0"+
-        "\u8D74\u8D73\u8DB4\u8ECD\u8ECC\u8FF0\u8FE6\u8FE2"+
-        "\u8FEA\u8FE5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u8FED\u8FEB\u8FE4\u8FE8"+
-        "\u90CA\u90CE\u90C1\u90C3\u914B\u914A\u91CD\u9582"+
-        "\u9650\u964B\u964C\u964D\u9762\u9769\u97CB\u97ED"+
-        "\u97F3\u9801\u98A8\u98DB\u98DF\u9996\u9999\u4E58"+
-        "\u4EB3\u500C\u500D\u5023\u4FEF\u5026\u5025\u4FF8"+
-        "\u5029\u5016\u5006\u503C\u501F\u501A\u5012\u5011"+
-        "\u4FFA\u5000\u5014\u5028\u4FF1\u5021\u500B\u5019"+
-        "\u5018\u4FF3\u4FEE\u502D\u502A\u4FFE\u502B\u5009"+
-        "\u517C\u51A4\u51A5\u51A2\u51CD\u51CC\u51C6\u51CB"+
-        "\u5256\u525C\u5254\u525B\u525D\u532A\u537F\u539F"+
-        "\u539D\u53DF\u54E8\u5510\u5501\u5537\u54FC\u54E5"+
-        "\u54F2\u5506\u54FA\u5514\u54E9\u54ED\u54E1\u5509"+
-        "\u54EE\u54EA\u54E6\u5527\u5507\u54FD\u550F\u5703"+
-        "\u5704\u57C2\u57D4\u57CB\u57C3\u5809\u590F\u5957"+
-        "\u5958\u595A\u5A11\u5A18\u5A1C\u5A1F\u5A1B\u5A13"+
-        "\u59EC\u5A20\u5A23\u5A29\u5A25\u5A0C\u5A09\u5B6B"+
-        "\u5C58\u5BB0\u5BB3\u5BB6\u5BB4\u5BAE\u5BB5\u5BB9"+
-        "\u5BB8\u5C04\u5C51\u5C55\u5C50\u5CED\u5CFD\u5CFB"+
-        "\u5CEA\u5CE8\u5CF0\u5CF6\u5D01\u5CF4\u5DEE\u5E2D"+
-        "\u5E2B\u5EAB\u5EAD\u5EA7\u5F31\u5F92\u5F91\u5F90"+
-        "\u6059\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u6063\u6065\u6050\u6055\u606D"+
-        "\u6069\u606F\u6084\u609F\u609A\u608D\u6094\u608C"+
-        "\u6085\u6096\u6247\u62F3\u6308\u62FF\u634E\u633E"+
-        "\u632F\u6355\u6342\u6346\u634F\u6349\u633A\u6350"+
-        "\u633D\u632A\u632B\u6328\u634D\u634C\u6548\u6549"+
-        "\u6599\u65C1\u65C5\u6642\u6649\u664F\u6643\u6652"+
-        "\u664C\u6645\u6641\u66F8\u6714\u6715\u6717\u6821"+
-        "\u6838\u6848\u6846\u6853\u6839\u6842\u6854\u6829"+
-        "\u68B3\u6817\u684C\u6851\u683D\u67F4\u6850\u6840"+
-        "\u683C\u6843\u682A\u6845\u6813\u6818\u6841\u6B8A"+
-        "\u6B89\u6BB7\u6C23\u6C27\u6C28\u6C26\u6C24\u6CF0"+
-        "\u6D6A\u6D95\u6D88\u6D87\u6D66\u6D78\u6D77\u6D59"+
-        "\u6D93\u6D6C\u6D89\u6D6E\u6D5A\u6D74\u6D69\u6D8C"+
-        "\u6D8A\u6D79\u6D85\u6D65\u6D94\u70CA\u70D8\u70E4"+
-        "\u70D9\u70C8\u70CF\u7239\u7279\u72FC\u72F9\u72FD"+
-        "\u72F8\u72F7\u7386\u73ED\u7409\u73EE\u73E0\u73EA"+
-        "\u73DE\u7554\u755D\u755C\u755A\u7559\u75BE\u75C5"+
-        "\u75C7\u75B2\u75B3\u75BD\u75BC\u75B9\u75C2\u75B8"+
-        "\u768B\u76B0\u76CA\u76CD\u76CE\u7729\u771F\u7720"+
-        "\u7728\u77E9\u7830\u7827\u7838\u781D\u7834\u7837"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u7825\u782D\u7820\u781F\u7832\u7955"+
-        "\u7950\u7960\u795F\u7956\u795E\u795D\u7957\u795A"+
-        "\u79E4\u79E3\u79E7\u79DF\u79E6\u79E9\u79D8\u7A84"+
-        "\u7A88\u7AD9\u7B06\u7B11\u7C89\u7D21\u7D17\u7D0B"+
-        "\u7D0A\u7D20\u7D22\u7D14\u7D10\u7D15\u7D1A\u7D1C"+
-        "\u7D0D\u7D19\u7D1B\u7F3A\u7F5F\u7F94\u7FC5\u7FC1"+
-        "\u8006\u8018\u8015\u8019\u8017\u803D\u803F\u80F1"+
-        "\u8102\u80F0\u8105\u80ED\u80F4\u8106\u80F8\u80F3"+
-        "\u8108\u80FD\u810A\u80FC\u80EF\u81ED\u81EC\u8200"+
-        "\u8210\u822A\u822B\u8228\u822C\u82BB\u832B\u8352"+
-        "\u8354\u834A\u8338\u8350\u8349\u8335\u8334\u834F"+
-        "\u8332\u8339\u8336\u8317\u8340\u8331\u8328\u8343";
-
-    private final static String innerIndex1=
-        "\u8654\u868A\u86AA\u8693\u86A4\u86A9\u868C\u86A3"+
-        "\u869C\u8870\u8877\u8881\u8882\u887D\u8879\u8A18"+
-        "\u8A10\u8A0E\u8A0C\u8A15\u8A0A\u8A17\u8A13\u8A16"+
-        "\u8A0F\u8A11\u8C48\u8C7A\u8C79\u8CA1\u8CA2\u8D77"+
-        "\u8EAC\u8ED2\u8ED4\u8ECF\u8FB1\u9001\u9006\u8FF7"+
-        "\u9000\u8FFA\u8FF4\u9003\u8FFD\u9005\u8FF8\u9095"+
-        "\u90E1\u90DD\u90E2\u9152\u914D\u914C\u91D8\u91DD"+
-        "\u91D7\u91DC\u91D9\u9583\u9662\u9663\u9661\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u965B\u965D\u9664\u9658\u965E\u96BB\u98E2"+
-        "\u99AC\u9AA8\u9AD8\u9B25\u9B32\u9B3C\u4E7E\u507A"+
-        "\u507D\u505C\u5047\u5043\u504C\u505A\u5049\u5065"+
-        "\u5076\u504E\u5055\u5075\u5074\u5077\u504F\u500F"+
-        "\u506F\u506D\u515C\u5195\u51F0\u526A\u526F\u52D2"+
-        "\u52D9\u52D8\u52D5\u5310\u530F\u5319\u533F\u5340"+
-        "\u533E\u53C3\u66FC\u5546\u556A\u5566\u5544\u555E"+
-        "\u5561\u5543\u554A\u5531\u5556\u554F\u5555\u552F"+
-        "\u5564\u5538\u552E\u555C\u552C\u5563\u5533\u5541"+
-        "\u5557\u5708\u570B\u5709\u57DF\u5805\u580A\u5806"+
-        "\u57E0\u57E4\u57FA\u5802\u5835\u57F7\u57F9\u5920"+
-        "\u5962\u5A36\u5A41\u5A49\u5A66\u5A6A\u5A40\u5A3C"+
-        "\u5A62\u5A5A\u5A46\u5A4A\u5B70\u5BC7\u5BC5\u5BC4"+
-        "\u5BC2\u5BBF\u5BC6\u5C09\u5C08\u5C07\u5C60\u5C5C"+
-        "\u5C5D\u5D07\u5D06\u5D0E\u5D1B\u5D16\u5D22\u5D11"+
-        "\u5D29\u5D14\u5D19\u5D24\u5D27\u5D17\u5DE2\u5E38"+
-        "\u5E36\u5E33\u5E37\u5EB7\u5EB8\u5EB6\u5EB5\u5EBE"+
-        "\u5F35\u5F37\u5F57\u5F6C\u5F69\u5F6B\u5F97\u5F99"+
-        "\u5F9E\u5F98\u5FA1\u5FA0\u5F9C\u607F\u60A3\u6089"+
-        "\u60A0\u60A8\u60CB\u60B4\u60E6\u60BD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u60C5\u60BB\u60B5\u60DC\u60BC\u60D8\u60D5\u60C6"+
-        "\u60DF\u60B8\u60DA\u60C7\u621A\u621B\u6248\u63A0"+
-        "\u63A7\u6372\u6396\u63A2\u63A5\u6377\u6367\u6398"+
-        "\u63AA\u6371\u63A9\u6389\u6383\u639B\u636B\u63A8"+
-        "\u6384\u6388\u6399\u63A1\u63AC\u6392\u638F\u6380"+
-        "\u637B\u6369\u6368\u637A\u655D\u6556\u6551\u6559"+
-        "\u6557\u555F\u654F\u6558\u6555\u6554\u659C\u659B"+
-        "\u65AC\u65CF\u65CB\u65CC\u65CE\u665D\u665A\u6664"+
-        "\u6668\u6666\u665E\u66F9\u52D7\u671B\u6881\u68AF"+
-        "\u68A2\u6893\u68B5\u687F\u6876\u68B1\u68A7\u6897"+
-        "\u68B0\u6883\u68C4\u68AD\u6886\u6885\u6894\u689D"+
-        "\u68A8\u689F\u68A1\u6882\u6B32\u6BBA\u6BEB\u6BEC"+
-        "\u6C2B\u6D8E\u6DBC\u6DF3\u6DD9\u6DB2\u6DE1\u6DCC"+
-        "\u6DE4\u6DFB\u6DFA\u6E05\u6DC7\u6DCB\u6DAF\u6DD1"+
-        "\u6DAE\u6DDE\u6DF9\u6DB8\u6DF7\u6DF5\u6DC5\u6DD2"+
-        "\u6E1A\u6DB5\u6DDA\u6DEB\u6DD8\u6DEA\u6DF1\u6DEE"+
-        "\u6DE8\u6DC6\u6DC4\u6DAA\u6DEC\u6DBF\u6DE6\u70F9"+
-        "\u7109\u710A\u70FD\u70EF\u723D\u727D\u7281\u731C"+
-        "\u731B\u7316\u7313\u7319\u7387\u7405\u740A\u7403"+
-        "\u7406\u73FE\u740D\u74E0\u74F6\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u74F7"+
-        "\u751C\u7522\u7565\u7566\u7562\u7570\u758F\u75D4"+
-        "\u75D5\u75B5\u75CA\u75CD\u768E\u76D4\u76D2\u76DB"+
-        "\u7737\u773E\u773C\u7736\u7738\u773A\u786B\u7843"+
-        "\u784E\u7965\u7968\u796D\u79FB\u7A92\u7A95\u7B20"+
-        "\u7B28\u7B1B\u7B2C\u7B26\u7B19\u7B1E\u7B2E\u7C92"+
-        "\u7C97\u7C95\u7D46\u7D43\u7D71\u7D2E\u7D39\u7D3C"+
-        "\u7D40\u7D30\u7D33\u7D44\u7D2F\u7D42\u7D32\u7D31"+
-        "\u7F3D\u7F9E\u7F9A\u7FCC\u7FCE\u7FD2\u801C\u804A"+
-        "\u8046\u812F\u8116\u8123\u812B\u8129\u8130\u8124"+
-        "\u8202\u8235\u8237\u8236\u8239\u838E\u839E\u8398"+
-        "\u8378\u83A2\u8396\u83BD\u83AB\u8392\u838A\u8393"+
-        "\u8389\u83A0\u8377\u837B\u837C\u8386\u83A7\u8655"+
-        "\u5F6A\u86C7\u86C0\u86B6\u86C4\u86B5\u86C6\u86CB"+
-        "\u86B1\u86AF\u86C9\u8853\u889E\u8888\u88AB\u8892"+
-        "\u8896\u888D\u888B\u8993\u898F\u8A2A\u8A1D\u8A23"+
-        "\u8A25\u8A31\u8A2D\u8A1F\u8A1B\u8A22\u8C49\u8C5A"+
-        "\u8CA9\u8CAC\u8CAB\u8CA8\u8CAA\u8CA7\u8D67\u8D66"+
-        "\u8DBE\u8DBA\u8EDB\u8EDF\u9019\u900D\u901A\u9017"+
-        "\u9023\u901F\u901D\u9010\u9015\u901E\u9020\u900F"+
-        "\u9022\u9016\u901B\u9014\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u90E8\u90ED"+
-        "\u90FD\u9157\u91CE\u91F5\u91E6\u91E3\u91E7\u91ED"+
-        "\u91E9\u9589\u966A\u9675\u9673\u9678\u9670\u9674"+
-        "\u9676\u9677\u966C\u96C0\u96EA\u96E9\u7AE0\u7ADF"+
-        "\u9802\u9803\u9B5A\u9CE5\u9E75\u9E7F\u9EA5\u9EBB"+
-        "\u50A2\u508D\u5085\u5099\u5091\u5080\u5096\u5098"+
-        "\u509A\u6700\u51F1\u5272\u5274\u5275\u5269\u52DE"+
-        "\u52DD\u52DB\u535A\u53A5\u557B\u5580\u55A7\u557C"+
-        "\u558A\u559D\u5598\u5582\u559C\u55AA\u5594\u5587"+
-        "\u558B\u5583\u55B3\u55AE\u559F\u553E\u55B2\u559A"+
-        "\u55BB\u55AC\u55B1\u557E\u5589\u55AB\u5599\u570D"+
-        "\u582F\u582A\u5834\u5824\u5830\u5831\u5821\u581D"+
-        "\u5820\u58F9\u58FA\u5960\u5A77\u5A9A\u5A7F\u5A92"+
-        "\u5A9B\u5AA7\u5B73\u5B71\u5BD2\u5BCC\u5BD3\u5BD0"+
-        "\u5C0A\u5C0B\u5C31\u5D4C\u5D50\u5D34\u5D47\u5DFD"+
-        "\u5E45\u5E3D\u5E40\u5E43\u5E7E\u5ECA\u5EC1\u5EC2"+
-        "\u5EC4\u5F3C\u5F6D\u5FA9\u5FAA\u5FA8\u60D1\u60E1"+
-        "\u60B2\u60B6\u60E0\u611C\u6123\u60FA\u6115\u60F0"+
-        "\u60FB\u60F4\u6168\u60F1\u610E\u60F6\u6109\u6100"+
-        "\u6112\u621F\u6249\u63A3\u638C\u63CF\u63C0\u63E9"+
-        "\u63C9\u63C6\u63CD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u63D2\u63E3\u63D0"+
-        "\u63E1\u63D6\u63ED\u63EE\u6376\u63F4\u63EA\u63DB"+
-        "\u6452\u63DA\u63F9\u655E\u6566\u6562\u6563\u6591"+
-        "\u6590\u65AF\u666E\u6670\u6674\u6676\u666F\u6691"+
-        "\u667A\u667E\u6677\u66FE\u66FF\u671F\u671D\u68FA"+
-        "\u68D5\u68E0\u68D8\u68D7\u6905\u68DF\u68F5\u68EE"+
-        "\u68E7\u68F9\u68D2\u68F2\u68E3\u68CB\u68CD\u690D"+
-        "\u6912\u690E\u68C9\u68DA\u696E\u68FB\u6B3E\u6B3A"+
-        "\u6B3D\u6B98\u6B96\u6BBC\u6BEF\u6C2E\u6C2F\u6C2C"+
-        "\u6E2F\u6E38\u6E54\u6E21\u6E32\u6E67\u6E4A\u6E20"+
-        "\u6E25\u6E23\u6E1B\u6E5B\u6E58\u6E24\u6E56\u6E6E"+
-        "\u6E2D\u6E26\u6E6F\u6E34\u6E4D\u6E3A\u6E2C\u6E43"+
-        "\u6E1D\u6E3E\u6ECB\u6E89\u6E19\u6E4E\u6E63\u6E44"+
-        "\u6E72\u6E69\u6E5F\u7119\u711A\u7126\u7130\u7121"+
-        "\u7136\u716E\u711C\u724C\u7284\u7280\u7336\u7325"+
-        "\u7334\u7329\u743A\u742A\u7433\u7422\u7425\u7435"+
-        "\u7436\u7434\u742F\u741B\u7426\u7428\u7525\u7526"+
-        "\u756B\u756A\u75E2\u75DB\u75E3\u75D9\u75D8\u75DE"+
-        "\u75E0\u767B\u767C\u7696\u7693\u76B4\u76DC\u774F"+
-        "\u77ED\u785D\u786C\u786F\u7A0D\u7A08\u7A0B\u7A05"+
-        "\u7A00\u7A98\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u7A97\u7A96\u7AE5\u7AE3"+
-        "\u7B49\u7B56\u7B46\u7B50\u7B52\u7B54\u7B4D\u7B4B"+
-        "\u7B4F\u7B51\u7C9F\u7CA5\u7D5E\u7D50\u7D68\u7D55"+
-        "\u7D2B\u7D6E\u7D72\u7D61\u7D66\u7D62\u7D70\u7D73"+
-        "\u5584\u7FD4\u7FD5\u800B\u8052\u8085\u8155\u8154"+
-        "\u814B\u8151\u814E\u8139\u8146\u813E\u814C\u8153"+
-        "\u8174\u8212\u821C\u83E9\u8403\u83F8\u840D\u83E0"+
-        "\u83C5\u840B\u83C1\u83EF\u83F1\u83F4\u8457\u840A"+
-        "\u83F0\u840C\u83CC\u83FD\u83F2\u83CA\u8438\u840E"+
-        "\u8404\u83DC\u8407\u83D4\u83DF\u865B\u86DF\u86D9"+
-        "\u86ED\u86D4\u86DB\u86E4\u86D0\u86DE\u8857\u88C1"+
-        "\u88C2\u88B1\u8983\u8996\u8A3B\u8A60\u8A55\u8A5E"+
-        "\u8A3C\u8A41\u8A54\u8A5B\u8A50\u8A46\u8A34\u8A3A"+
-        "\u8A36\u8A56\u8C61\u8C82\u8CAF\u8CBC\u8CB3\u8CBD"+
-        "\u8CC1\u8CBB\u8CC0\u8CB4\u8CB7\u8CB6\u8CBF\u8CB8"+
-        "\u8D8A\u8D85\u8D81\u8DCE\u8DDD\u8DCB\u8DDA\u8DD1"+
-        "\u8DCC\u8DDB\u8DC6\u8EFB\u8EF8\u8EFC\u8F9C\u902E"+
-        "\u9035\u9031\u9038\u9032\u9036\u9102\u90F5\u9109"+
-        "\u90FE\u9163\u9165\u91CF\u9214\u9215\u9223\u9209"+
-        "\u921E\u920D\u9210\u9207\u9211\u9594\u958F\u958B"+
-        "\u9591\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u9593\u9592\u958E\u968A\u968E"+
-        "\u968B\u967D\u9685\u9686\u968D\u9672\u9684\u96C1"+
-        "\u96C5\u96C4\u96C6\u96C7\u96EF\u96F2\u97CC\u9805"+
-        "\u9806\u9808\u98E7\u98EA\u98EF\u98E9\u98F2\u98ED"+
-        "\u99AE\u99AD\u9EC3\u9ECD\u9ED1\u4E82\u50AD\u50B5"+
-        "\u50B2\u50B3\u50C5\u50BE\u50AC\u50B7\u50BB\u50AF"+
-        "\u50C7\u527F\u5277\u527D\u52DF\u52E6\u52E4\u52E2"+
-        "\u52E3\u532F\u55DF\u55E8\u55D3\u55E6\u55CE\u55DC"+
-        "\u55C7\u55D1\u55E3\u55E4\u55EF\u55DA\u55E1\u55C5"+
-        "\u55C6\u55E5\u55C9\u5712\u5713\u585E\u5851\u5858"+
-        "\u5857\u585A\u5854\u586B\u584C\u586D\u584A\u5862"+
-        "\u5852\u584B\u5967\u5AC1\u5AC9\u5ACC\u5ABE\u5ABD"+
-        "\u5ABC\u5AB3\u5AC2\u5AB2\u5D69\u5D6F\u5E4C\u5E79"+
-        "\u5EC9\u5EC8\u5F12\u5F59\u5FAC\u5FAE\u611A\u610F"+
-        "\u6148\u611F\u60F3\u611B\u60F9\u6101\u6108\u614E"+
-        "\u614C\u6144\u614D\u613E\u6134\u6127\u610D\u6106"+
-        "\u6137\u6221\u6222\u6413\u643E\u641E\u642A\u642D"+
-        "\u643D\u642C\u640F\u641C\u6414\u640D\u6436\u6416"+
-        "\u6417\u6406\u656C\u659F\u65B0\u6697\u6689\u6687"+
-        "\u6688\u6696\u6684\u6698\u668D\u6703\u6994\u696D"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u695A\u6977\u6960\u6954\u6975\u6930"+
-        "\u6982\u694A\u6968\u696B\u695E\u6953\u6979\u6986"+
-        "\u695D\u6963\u695B\u6B47\u6B72\u6BC0\u6BBF\u6BD3"+
-        "\u6BFD\u6EA2\u6EAF\u6ED3\u6EB6\u6EC2\u6E90\u6E9D"+
-        "\u6EC7\u6EC5\u6EA5\u6E98\u6EBC\u6EBA\u6EAB\u6ED1"+
-        "\u6E96\u6E9C\u6EC4\u6ED4\u6EAA\u6EA7\u6EB4\u714E"+
-        "\u7159\u7169\u7164\u7149\u7167\u715C\u716C\u7166"+
-        "\u714C\u7165\u715E\u7146\u7168\u7156\u723A\u7252"+
-        "\u7337\u7345\u733F\u733E\u746F\u745A\u7455\u745F"+
-        "\u745E\u7441\u743F\u7459\u745B\u745C\u7576\u7578"+
-        "\u7600\u75F0\u7601\u75F2\u75F1\u75FA\u75FF\u75F4"+
-        "\u75F3\u76DE\u76DF\u775B\u776B\u7766\u775E\u7763"+
-        "\u7779\u776A\u776C\u775C\u7765\u7768\u7762\u77EE"+
-        "\u788E\u78B0\u7897\u7898\u788C\u7889\u787C\u7891"+
-        "\u7893\u787F\u797A\u797F\u7981\u842C\u79BD\u7A1C"+
-        "\u7A1A\u7A20\u7A14\u7A1F\u7A1E\u7A9F\u7AA0\u7B77"+
-        "\u7BC0\u7B60\u7B6E\u7B67\u7CB1\u7CB3\u7CB5\u7D93"+
-        "\u7D79\u7D91\u7D81\u7D8F\u7D5B\u7F6E\u7F69\u7F6A"+
-        "\u7F72\u7FA9\u7FA8\u7FA4\u8056\u8058\u8086\u8084"+
-        "\u8171\u8170\u8178\u8165\u816E\u8173\u816B\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u8179\u817A\u8166\u8205\u8247\u8482\u8477"+
-        "\u843D\u8431\u8475\u8466\u846B\u8449\u846C\u845B"+
-        "\u843C\u8435\u8461\u8463\u8469\u846D\u8446\u865E"+
-        "\u865C\u865F\u86F9\u8713\u8708\u8707\u8700\u86FE"+
-        "\u86FB\u8702\u8703\u8706\u870A\u8859\u88DF\u88D4"+
-        "\u88D9\u88DC\u88D8\u88DD\u88E1\u88CA\u88D5\u88D2"+
-        "\u899C\u89E3\u8A6B\u8A72\u8A73\u8A66\u8A69\u8A70"+
-        "\u8A87\u8A7C\u8A63\u8AA0\u8A71\u8A85\u8A6D\u8A62"+
-        "\u8A6E\u8A6C\u8A79\u8A7B\u8A3E\u8A68\u8C62\u8C8A"+
-        "\u8C89\u8CCA\u8CC7\u8CC8\u8CC4\u8CB2\u8CC3\u8CC2"+
-        "\u8CC5\u8DE1\u8DDF\u8DE8\u8DEF\u8DF3\u8DFA\u8DEA"+
-        "\u8DE4\u8DE6\u8EB2\u8F03\u8F09\u8EFE\u8F0A\u8F9F"+
-        "\u8FB2\u904B\u904A\u9053\u9042\u9054\u903C\u9055"+
-        "\u9050\u9047\u904F\u904E\u904D\u9051\u903E\u9041"+
-        "\u9112\u9117\u916C\u916A\u9169\u91C9\u9237\u9257"+
-        "\u9238\u923D\u9240\u923E\u925B\u924B\u9264\u9251"+
-        "\u9234\u9249\u924D\u9245\u9239\u923F\u925A\u9598"+
-        "\u9698\u9694\u9695\u96CD\u96CB\u96C9\u96CA\u96F7"+
-        "\u96FB\u96F9\u96F6\u9756\u9774\u9776\u9810\u9811"+
-        "\u9813\u980A\u9812\u980C\u98FC\u98F4\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u98FD\u98FE\u99B3\u99B1\u99B4\u9AE1\u9CE9\u9E82"+
-        "\u9F0E\u9F13\u9F20\u50E7\u50EE\u50E5\u50D6\u50ED"+
-        "\u50DA\u50D5\u50CF\u50D1\u50F1\u50CE\u50E9\u5162"+
-        "\u51F3\u5283\u5282\u5331\u53AD\u55FE\u5600\u561B"+
-        "\u5617\u55FD\u5614\u5606\u5609\u560D\u560E\u55F7"+
-        "\u5616\u561F\u5608\u5610\u55F6\u5718\u5716\u5875"+
-        "\u587E\u5883\u5893\u588A\u5879\u5885\u587D\u58FD"+
-        "\u5925\u5922\u5924\u596A\u5969\u5AE1\u5AE6\u5AE9"+
-        "\u5AD7\u5AD6\u5AD8\u5AE3\u5B75\u5BDE\u5BE7\u5BE1"+
-        "\u5BE5\u5BE6\u5BE8\u5BE2\u5BE4\u5BDF\u5C0D\u5C62"+
-        "\u5D84\u5D87\u5E5B\u5E63\u5E55\u5E57\u5E54\u5ED3"+
-        "\u5ED6\u5F0A\u5F46\u5F70\u5FB9\u6147\u613F\u614B"+
-        "\u6177\u6162\u6163\u615F\u615A\u6158\u6175\u622A"+
-        "\u6487\u6458\u6454\u64A4\u6478\u645F\u647A\u6451"+
-        "\u6467\u6434\u646D\u647B\u6572\u65A1\u65D7\u65D6"+
-        "\u66A2\u66A8\u669D\u699C\u69A8\u6995\u69C1\u69AE"+
-        "\u69D3\u69CB\u699B\u69B7\u69BB\u69AB\u69B4\u69D0"+
-        "\u69CD\u69AD\u69CC\u69A6\u69C3\u69A3\u6B49\u6B4C"+
-        "\u6C33\u6F33\u6F14\u6EFE\u6F13\u6EF4\u6F29\u6F3E"+
-        "\u6F20\u6F2C\u6F0F\u6F02\u6F22\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u6EFF"+
-        "\u6EEF\u6F06\u6F31\u6F38\u6F32\u6F23\u6F15\u6F2B"+
-        "\u6F2F\u6F88\u6F2A\u6EEC\u6F01\u6EF2\u6ECC\u6EF7"+
-        "\u7194\u7199\u717D\u718A\u7184\u7192\u723E\u7292"+
-        "\u7296\u7344\u7350\u7464\u7463\u746A\u7470\u746D"+
-        "\u7504\u7591\u7627\u760D\u760B\u7609\u7613\u76E1"+
-        "\u76E3\u7784\u777D\u777F\u7761\u78C1\u789F\u78A7"+
-        "\u78B3\u78A9\u78A3\u798E\u798F\u798D\u7A2E\u7A31"+
-        "\u7AAA\u7AA9\u7AED\u7AEF\u7BA1\u7B95\u7B8B\u7B75"+
-        "\u7B97\u7B9D\u7B94\u7B8F\u7BB8\u7B87\u7B84\u7CB9"+
-        "\u7CBD\u7CBE\u7DBB\u7DB0\u7D9C\u7DBD\u7DBE\u7DA0"+
-        "\u7DCA\u7DB4\u7DB2\u7DB1\u7DBA\u7DA2\u7DBF\u7DB5"+
-        "\u7DB8\u7DAD\u7DD2\u7DC7\u7DAC\u7F70\u7FE0\u7FE1"+
-        "\u7FDF\u805E\u805A\u8087\u8150\u8180\u818F\u8188"+
-        "\u818A\u817F\u8182\u81E7\u81FA\u8207\u8214\u821E"+
-        "\u824B\u84C9\u84BF\u84C6\u84C4\u8499\u849E\u84B2"+
-        "\u849C\u84CB\u84B8\u84C0\u84D3\u8490\u84BC\u84D1"+
-        "\u84CA\u873F\u871C\u873B\u8722\u8725\u8734\u8718"+
-        "\u8755\u8737\u8729\u88F3\u8902\u88F4\u88F9\u88F8"+
-        "\u88FD\u88E8\u891A\u88EF\u8AA6\u8A8C\u8A9E\u8AA3"+
-        "\u8A8D\u8AA1\u8A93\u8AA4\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u8AAA\u8AA5"+
-        "\u8AA8\u8A98\u8A91\u8A9A\u8AA7\u8C6A\u8C8D\u8C8C"+
-        "\u8CD3\u8CD1\u8CD2\u8D6B\u8D99\u8D95\u8DFC\u8F14"+
-        "\u8F12\u8F15\u8F13\u8FA3\u9060\u9058\u905C\u9063"+
-        "\u9059\u905E\u9062\u905D\u905B\u9119\u9118\u911E"+
-        "\u9175\u9178\u9177\u9174\u9278\u9280\u9285\u9298"+
-        "\u9296\u927B\u9293\u929C\u92A8\u927C\u9291\u95A1"+
-        "\u95A8\u95A9\u95A3\u95A5\u95A4\u9699\u969C\u969B"+
-        "\u96CC\u96D2\u9700\u977C\u9785\u97F6\u9817\u9818"+
-        "\u98AF\u98B1\u9903\u9905\u990C\u9909\u99C1\u9AAF"+
-        "\u9AB0\u9AE6\u9B41\u9B42\u9CF4\u9CF6\u9CF3\u9EBC"+
-        "\u9F3B\u9F4A\u5104\u5100\u50FB\u50F5\u50F9\u5102"+
-        "\u5108\u5109\u5105\u51DC\u5287\u5288\u5289\u528D"+
-        "\u528A\u52F0\u53B2\u562E\u563B\u5639\u5632\u563F"+
-        "\u5634\u5629\u5653\u564E\u5657\u5674\u5636\u562F"+
-        "\u5630\u5880\u589F\u589E\u58B3\u589C\u58AE\u58A9"+
-        "\u58A6\u596D\u5B09\u5AFB\u5B0B\u5AF5\u5B0C\u5B08"+
-        "\u5BEE\u5BEC\u5BE9\u5BEB\u5C64\u5C65\u5D9D\u5D94"+
-        "\u5E62\u5E5F\u5E61\u5EE2\u5EDA\u5EDF\u5EDD\u5EE3"+
-        "\u5EE0\u5F48\u5F71\u5FB7\u5FB5\u6176\u6167\u616E"+
-        "\u615D\u6155\u6182\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u617C\u6170\u616B"+
-        "\u617E\u61A7\u6190\u61AB\u618E\u61AC\u619A\u61A4"+
-        "\u6194\u61AE\u622E\u6469\u646F\u6479\u649E\u64B2"+
-        "\u6488\u6490\u64B0\u64A5\u6493\u6495\u64A9\u6492"+
-        "\u64AE\u64AD\u64AB\u649A\u64AC\u6499\u64A2\u64B3"+
-        "\u6575\u6577\u6578\u66AE\u66AB\u66B4\u66B1\u6A23"+
-        "\u6A1F\u69E8\u6A01\u6A1E\u6A19\u69FD\u6A21\u6A13"+
-        "\u6A0A\u69F3\u6A02\u6A05\u69ED\u6A11\u6B50\u6B4E"+
-        "\u6BA4\u6BC5\u6BC6\u6F3F\u6F7C\u6F84\u6F51\u6F66"+
-        "\u6F54\u6F86\u6F6D\u6F5B\u6F78\u6F6E\u6F8E\u6F7A"+
-        "\u6F70\u6F64\u6F97\u6F58\u6ED5\u6F6F\u6F60\u6F5F"+
-        "\u719F\u71AC\u71B1\u71A8\u7256\u729B\u734E\u7357"+
-        "\u7469\u748B\u7483\u747E\u7480\u757F\u7620\u7629"+
-        "\u761F\u7624\u7626\u7621\u7622\u769A\u76BA\u76E4"+
-        "\u778E\u7787\u778C\u7791\u778B\u78CB\u78C5\u78BA"+
-        "\u78CA\u78BE\u78D5\u78BC\u78D0\u7A3F\u7A3C\u7A40"+
-        "\u7A3D\u7A37\u7A3B\u7AAF\u7AAE\u7BAD\u7BB1\u7BC4"+
-        "\u7BB4\u7BC6\u7BC7\u7BC1\u7BA0\u7BCC\u7CCA\u7DE0"+
-        "\u7DF4\u7DEF\u7DFB\u7DD8\u7DEC\u7DDD\u7DE8\u7DE3"+
-        "\u7DDA\u7DDE\u7DE9\u7D9E\u7DD9\u7DF2\u7DF9\u7F75"+
-        "\u7F77\u7FAF\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u7FE9\u8026\u819B\u819C"+
-        "\u819D\u81A0\u819A\u8198\u8517\u853D\u851A\u84EE"+
-        "\u852C\u852D\u8513\u8511\u8523\u8521\u8514\u84EC"+
-        "\u8525\u84FF\u8506\u8782\u8774\u8776\u8760\u8766"+
-        "\u8778\u8768\u8759\u8757\u874C\u8753\u885B\u885D"+
-        "\u8910\u8907\u8912\u8913\u8915\u890A\u8ABC\u8AD2"+
-        "\u8AC7\u8AC4\u8A95\u8ACB\u8AF8\u8AB2\u8AC9\u8AC2"+
-        "\u8ABF\u8AB0\u8AD6\u8ACD\u8AB6\u8AB9\u8ADB\u8C4C"+
-        "\u8C4E\u8C6C\u8CE0\u8CDE\u8CE6\u8CE4\u8CEC\u8CED"+
-        "\u8CE2\u8CE3\u8CDC\u8CEA\u8CE1\u8D6D\u8D9F\u8DA3"+
-        "\u8E2B\u8E10\u8E1D\u8E22\u8E0F\u8E29\u8E1F\u8E21"+
-        "\u8E1E\u8EBA\u8F1D\u8F1B\u8F1F\u8F29\u8F26\u8F2A"+
-        "\u8F1C\u8F1E\u8F25\u9069\u906E\u9068\u906D\u9077"+
-        "\u9130\u912D\u9127\u9131\u9187\u9189\u918B\u9183"+
-        "\u92C5\u92BB\u92B7\u92EA\u92AC\u92E4\u92C1\u92B3"+
-        "\u92BC\u92D2\u92C7\u92F0\u92B2\u95AD\u95B1\u9704"+
-        "\u9706\u9707\u9709\u9760\u978D\u978B\u978F\u9821"+
-        "\u982B\u981C\u98B3\u990A\u9913\u9912\u9918\u99DD"+
-        "\u99D0\u99DF\u99DB\u99D1\u99D5\u99D2\u99D9\u9AB7"+
-        "\u9AEE\u9AEF\u9B27\u9B45\u9B44\u9B77\u9B6F\u9D06"+
-        "\u9D09\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u9D03\u9EA9\u9EBE\u9ECE\u58A8"+
-        "\u9F52\u5112\u5118\u5114\u5110\u5115\u5180\u51AA"+
-        "\u51DD\u5291\u5293\u52F3\u5659\u566B\u5679\u5669"+
-        "\u5664\u5678\u566A\u5668\u5665\u5671\u566F\u566C"+
-        "\u5662\u5676\u58C1\u58BE\u58C7\u58C5\u596E\u5B1D"+
-        "\u5B34\u5B78\u5BF0\u5C0E\u5F4A\u61B2\u6191\u61A9"+
-        "\u618A\u61CD\u61B6\u61BE\u61CA\u61C8\u6230\u64C5"+
-        "\u64C1\u64CB\u64BB\u64BC\u64DA\u64C4\u64C7\u64C2"+
-        "\u64CD\u64BF\u64D2\u64D4\u64BE\u6574\u66C6\u66C9"+
-        "\u66B9\u66C4\u66C7\u66B8\u6A3D\u6A38\u6A3A\u6A59"+
-        "\u6A6B\u6A58\u6A39\u6A44\u6A62\u6A61\u6A4B\u6A47"+
-        "\u6A35\u6A5F\u6A48\u6B59\u6B77\u6C05\u6FC2\u6FB1"+
-        "\u6FA1\u6FC3\u6FA4\u6FC1\u6FA7\u6FB3\u6FC0\u6FB9"+
-        "\u6FB6\u6FA6\u6FA0\u6FB4\u71BE\u71C9\u71D0\u71D2"+
-        "\u71C8\u71D5\u71B9\u71CE\u71D9\u71DC\u71C3\u71C4"+
-        "\u7368\u749C\u74A3\u7498\u749F\u749E\u74E2\u750C"+
-        "\u750D\u7634\u7638\u763A\u76E7\u76E5\u77A0\u779E"+
-        "\u779F\u77A5\u78E8\u78DA\u78EC\u78E7\u79A6\u7A4D"+
-        "\u7A4E\u7A46\u7A4C\u7A4B\u7ABA\u7BD9\u7C11\u7BC9"+
-        "\u7BE4\u7BDB\u7BE1\u7BE9\u7BE6\u7CD5\u7CD6\u7E0A"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u7E11\u7E08\u7E1B\u7E23\u7E1E\u7E1D"+
-        "\u7E09\u7E10\u7F79\u7FB2\u7FF0\u7FF1\u7FEE\u8028"+
-        "\u81B3\u81A9\u81A8\u81FB\u8208\u8258\u8259\u854A"+
-        "\u8559\u8548\u8568\u8569\u8543\u8549\u856D\u856A"+
-        "\u855E\u8783\u879F\u879E\u87A2\u878D\u8861\u892A"+
-        "\u8932\u8925\u892B\u8921\u89AA\u89A6\u8AE6\u8AFA"+
-        "\u8AEB\u8AF1\u8B00\u8ADC\u8AE7\u8AEE\u8AFE\u8B01"+
-        "\u8B02\u8AF7\u8AED\u8AF3\u8AF6\u8AFC\u8C6B\u8C6D"+
-        "\u8C93\u8CF4\u8E44\u8E31\u8E34\u8E42\u8E39\u8E35"+
-        "\u8F3B\u8F2F\u8F38\u8F33\u8FA8\u8FA6\u9075\u9074"+
-        "\u9078\u9072\u907C\u907A\u9134\u9192\u9320\u9336"+
-        "\u92F8\u9333\u932F\u9322\u92FC\u932B\u9304\u931A";
-
-    private final static String innerIndex2=
-        "\u9310\u9326\u9321\u9315\u932E\u9319\u95BB\u96A7"+
-        "\u96A8\u96AA\u96D5\u970E\u9711\u9716\u970D\u9713"+
-        "\u970F\u975B\u975C\u9766\u9798\u9830\u9838\u983B"+
-        "\u9837\u982D\u9839\u9824\u9910\u9928\u991E\u991B"+
-        "\u9921\u991A\u99ED\u99E2\u99F1\u9AB8\u9ABC\u9AFB"+
-        "\u9AED\u9B28\u9B91\u9D15\u9D23\u9D26\u9D28\u9D12"+
-        "\u9D1B\u9ED8\u9ED4\u9F8D\u9F9C\u512A\u511F\u5121"+
-        "\u5132\u52F5\u568E\u5680\u5690\u5685\u5687\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u568F\u58D5\u58D3\u58D1\u58CE\u5B30\u5B2A"+
-        "\u5B24\u5B7A\u5C37\u5C68\u5DBC\u5DBA\u5DBD\u5DB8"+
-        "\u5E6B\u5F4C\u5FBD\u61C9\u61C2\u61C7\u61E6\u61CB"+
-        "\u6232\u6234\u64CE\u64CA\u64D8\u64E0\u64F0\u64E6"+
-        "\u64EC\u64F1\u64E2\u64ED\u6582\u6583\u66D9\u66D6"+
-        "\u6A80\u6A94\u6A84\u6AA2\u6A9C\u6ADB\u6AA3\u6A7E"+
-        "\u6A97\u6A90\u6AA0\u6B5C\u6BAE\u6BDA\u6C08\u6FD8"+
-        "\u6FF1\u6FDF\u6FE0\u6FDB\u6FE4\u6FEB\u6FEF\u6F80"+
-        "\u6FEC\u6FE1\u6FE9\u6FD5\u6FEE\u6FF0\u71E7\u71DF"+
-        "\u71EE\u71E6\u71E5\u71ED\u71EC\u71F4\u71E0\u7235"+
-        "\u7246\u7370\u7372\u74A9\u74B0\u74A6\u74A8\u7646"+
-        "\u7642\u764C\u76EA\u77B3\u77AA\u77B0\u77AC\u77A7"+
-        "\u77AD\u77EF\u78F7\u78FA\u78F4\u78EF\u7901\u79A7"+
-        "\u79AA\u7A57\u7ABF\u7C07\u7C0D\u7BFE\u7BF7\u7C0C"+
-        "\u7BE0\u7CE0\u7CDC\u7CDE\u7CE2\u7CDF\u7CD9\u7CDD"+
-        "\u7E2E\u7E3E\u7E46\u7E37\u7E32\u7E43\u7E2B\u7E3D"+
-        "\u7E31\u7E45\u7E41\u7E34\u7E39\u7E48\u7E35\u7E3F"+
-        "\u7E2F\u7F44\u7FF3\u7FFC\u8071\u8072\u8070\u806F"+
-        "\u8073\u81C6\u81C3\u81BA\u81C2\u81C0\u81BF\u81BD"+
-        "\u81C9\u81BE\u81E8\u8209\u8271\u85AA\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u8584\u857E\u859C\u8591\u8594\u85AF\u859B\u8587"+
-        "\u85A8\u858A\u8667\u87C0\u87D1\u87B3\u87D2\u87C6"+
-        "\u87AB\u87BB\u87BA\u87C8\u87CB\u893B\u8936\u8944"+
-        "\u8938\u893D\u89AC\u8B0E\u8B17\u8B19\u8B1B\u8B0A"+
-        "\u8B20\u8B1D\u8B04\u8B10\u8C41\u8C3F\u8C73\u8CFA"+
-        "\u8CFD\u8CFC\u8CF8\u8CFB\u8DA8\u8E49\u8E4B\u8E48"+
-        "\u8E4A\u8F44\u8F3E\u8F42\u8F45\u8F3F\u907F\u907D"+
-        "\u9084\u9081\u9082\u9080\u9139\u91A3\u919E\u919C"+
-        "\u934D\u9382\u9328\u9375\u934A\u9365\u934B\u9318"+
-        "\u937E\u936C\u935B\u9370\u935A\u9354\u95CA\u95CB"+
-        "\u95CC\u95C8\u95C6\u96B1\u96B8\u96D6\u971C\u971E"+
-        "\u97A0\u97D3\u9846\u98B6\u9935\u9A01\u99FF\u9BAE"+
-        "\u9BAB\u9BAA\u9BAD\u9D3B\u9D3F\u9E8B\u9ECF\u9EDE"+
-        "\u9EDC\u9EDD\u9EDB\u9F3E\u9F4B\u53E2\u5695\u56AE"+
-        "\u58D9\u58D8\u5B38\u5F5D\u61E3\u6233\u64F4\u64F2"+
-        "\u64FE\u6506\u64FA\u64FB\u64F7\u65B7\u66DC\u6726"+
-        "\u6AB3\u6AAC\u6AC3\u6ABB\u6AB8\u6AC2\u6AAE\u6AAF"+
-        "\u6B5F\u6B78\u6BAF\u7009\u700B\u6FFE\u7006\u6FFA"+
-        "\u7011\u700F\u71FB\u71FC\u71FE\u71F8\u7377\u7375"+
-        "\u74A7\u74BF\u7515\u7656\u7658\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u7652"+
-        "\u77BD\u77BF\u77BB\u77BC\u790E\u79AE\u7A61\u7A62"+
-        "\u7A60\u7AC4\u7AC5\u7C2B\u7C27\u7C2A\u7C1E\u7C23"+
-        "\u7C21\u7CE7\u7E54\u7E55\u7E5E\u7E5A\u7E61\u7E52"+
-        "\u7E59\u7F48\u7FF9\u7FFB\u8077\u8076\u81CD\u81CF"+
-        "\u820A\u85CF\u85A9\u85CD\u85D0\u85C9\u85B0\u85BA"+
-        "\u85B9\u85A6\u87EF\u87EC\u87F2\u87E0\u8986\u89B2"+
-        "\u89F4\u8B28\u8B39\u8B2C\u8B2B\u8C50\u8D05\u8E59"+
-        "\u8E63\u8E66\u8E64\u8E5F\u8E55\u8EC0\u8F49\u8F4D"+
-        "\u9087\u9083\u9088\u91AB\u91AC\u91D0\u9394\u938A"+
-        "\u9396\u93A2\u93B3\u93AE\u93AC\u93B0\u9398\u939A"+
-        "\u9397\u95D4\u95D6\u95D0\u95D5\u96E2\u96DC\u96D9"+
-        "\u96DB\u96DE\u9724\u97A3\u97A6\u97AD\u97F9\u984D"+
-        "\u984F\u984C\u984E\u9853\u98BA\u993E\u993F\u993D"+
-        "\u992E\u99A5\u9A0E\u9AC1\u9B03\u9B06\u9B4F\u9B4E"+
-        "\u9B4D\u9BCA\u9BC9\u9BFD\u9BC8\u9BC0\u9D51\u9D5D"+
-        "\u9D60\u9EE0\u9F15\u9F2C\u5133\u56A5\u58DE\u58DF"+
-        "\u58E2\u5BF5\u9F90\u5EEC\u61F2\u61F7\u61F6\u61F5"+
-        "\u6500\u650F\u66E0\u66DD\u6AE5\u6ADD\u6ADA\u6AD3"+
-        "\u701B\u701F\u7028\u701A\u701D\u7015\u7018\u7206"+
-        "\u720D\u7258\u72A2\u7378\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u737A\u74BD"+
-        "\u74CA\u74E3\u7587\u7586\u765F\u7661\u77C7\u7919"+
-        "\u79B1\u7A6B\u7A69\u7C3E\u7C3F\u7C38\u7C3D\u7C37"+
-        "\u7C40\u7E6B\u7E6D\u7E79\u7E69\u7E6A\u7F85\u7E73"+
-        "\u7FB6\u7FB9\u7FB8\u81D8\u85E9\u85DD\u85EA\u85D5"+
-        "\u85E4\u85E5\u85F7\u87FB\u8805\u880D\u87F9\u87FE"+
-        "\u8960\u895F\u8956\u895E\u8B41\u8B5C\u8B58\u8B49"+
-        "\u8B5A\u8B4E\u8B4F\u8B46\u8B59\u8D08\u8D0A\u8E7C"+
-        "\u8E72\u8E87\u8E76\u8E6C\u8E7A\u8E74\u8F54\u8F4E"+
-        "\u8FAD\u908A\u908B\u91B1\u91AE\u93E1\u93D1\u93DF"+
-        "\u93C3\u93C8\u93DC\u93DD\u93D6\u93E2\u93CD\u93D8"+
-        "\u93E4\u93D7\u93E8\u95DC\u96B4\u96E3\u972A\u9727"+
-        "\u9761\u97DC\u97FB\u985E\u9858\u985B\u98BC\u9945"+
-        "\u9949\u9A16\u9A19\u9B0D\u9BE8\u9BE7\u9BD6\u9BDB"+
-        "\u9D89\u9D61\u9D72\u9D6A\u9D6C\u9E92\u9E97\u9E93"+
-        "\u9EB4\u52F8\u56A8\u56B7\u56B6\u56B4\u56BC\u58E4"+
-        "\u5B40\u5B43\u5B7D\u5BF6\u5DC9\u61F8\u61FA\u6518"+
-        "\u6514\u6519\u66E6\u6727\u6AEC\u703E\u7030\u7032"+
-        "\u7210\u737B\u74CF\u7662\u7665\u7926\u792A\u792C"+
-        "\u792B\u7AC7\u7AF6\u7C4C\u7C43\u7C4D\u7CEF\u7CF0"+
-        "\u8FAE\u7E7D\u7E7C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u7E82\u7F4C\u8000"+
-        "\u81DA\u8266\u85FB\u85F9\u8611\u85FA\u8606\u860B"+
-        "\u8607\u860A\u8814\u8815\u8964\u89BA\u89F8\u8B70"+
-        "\u8B6C\u8B66\u8B6F\u8B5F\u8B6B\u8D0F\u8D0D\u8E89"+
-        "\u8E81\u8E85\u8E82\u91B4\u91CB\u9418\u9403\u93FD"+
-        "\u95E1\u9730\u98C4\u9952\u9951\u99A8\u9A2B\u9A30"+
-        "\u9A37\u9A35\u9C13\u9C0D\u9E79\u9EB5\u9EE8\u9F2F"+
-        "\u9F5F\u9F63\u9F61\u5137\u5138\u56C1\u56C0\u56C2"+
-        "\u5914\u5C6C\u5DCD\u61FC\u61FE\u651D\u651C\u6595"+
-        "\u66E9\u6AFB\u6B04\u6AFA\u6BB2\u704C\u721B\u72A7"+
-        "\u74D6\u74D4\u7669\u77D3\u7C50\u7E8F\u7E8C\u7FBC"+
-        "\u8617\u862D\u861A\u8823\u8822\u8821\u881F\u896A"+
-        "\u896C\u89BD\u8B74\u8B77\u8B7D\u8D13\u8E8A\u8E8D"+
-        "\u8E8B\u8F5F\u8FAF\u91BA\u942E\u9433\u9435\u943A"+
-        "\u9438\u9432\u942B\u95E2\u9738\u9739\u9732\u97FF"+
-        "\u9867\u9865\u9957\u9A45\u9A43\u9A40\u9A3E\u9ACF"+
-        "\u9B54\u9B51\u9C2D\u9C25\u9DAF\u9DB4\u9DC2\u9DB8"+
-        "\u9E9D\u9EEF\u9F19\u9F5C\u9F66\u9F67\u513C\u513B"+
-        "\u56C8\u56CA\u56C9\u5B7F\u5DD4\u5DD2\u5F4E\u61FF"+
-        "\u6524\u6B0A\u6B61\u7051\u7058\u7380\u74E4\u758A"+
-        "\u766E\u766C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u79B3\u7C60\u7C5F\u807E"+
-        "\u807D\u81DF\u8972\u896F\u89FC\u8B80\u8D16\u8D17"+
-        "\u8E91\u8E93\u8F61\u9148\u9444\u9451\u9452\u973D"+
-        "\u973E\u97C3\u97C1\u986B\u9955\u9A55\u9A4D\u9AD2"+
-        "\u9B1A\u9C49\u9C31\u9C3E\u9C3B\u9DD3\u9DD7\u9F34"+
-        "\u9F6C\u9F6A\u9F94\u56CC\u5DD6\u6200\u6523\u652B"+
-        "\u652A\u66EC\u6B10\u74DA\u7ACA\u7C64\u7C63\u7C65"+
-        "\u7E93\u7E96\u7E94\u81E2\u8638\u863F\u8831\u8B8A"+
-        "\u9090\u908F\u9463\u9460\u9464\u9768\u986F\u995C"+
-        "\u9A5A\u9A5B\u9A57\u9AD3\u9AD4\u9AD1\u9C54\u9C57"+
-        "\u9C56\u9DE5\u9E9F\u9EF4\u56D1\u58E9\u652C\u705E"+
-        "\u7671\u7672\u77D7\u7F50\u7F88\u8836\u8839\u8862"+
-        "\u8B93\u8B92\u8B96\u8277\u8D1B\u91C0\u946A\u9742"+
-        "\u9748\u9744\u97C6\u9870\u9A5F\u9B22\u9B58\u9C5F"+
-        "\u9DF9\u9DFA\u9E7C\u9E7D\u9F07\u9F77\u9F72\u5EF3"+
-        "\u6B16\u7063\u7C6C\u7C6E\u883B\u89C0\u8EA1\u91C1"+
-        "\u9472\u9470\u9871\u995E\u9AD6\u9B23\u9ECC\u7064"+
-        "\u77DA\u8B9A\u9477\u97C9\u9A62\u9A65\u7E9C\u8B9C"+
-        "\u8EAA\u91C5\u947D\u947E\u947C\u9C77\u9C78\u9EF7"+
-        "\u8C54\u947F\u9E1A\u7228\u9A6A\u9B31\u9E1B\u9E1E"+
-        "\u7C72\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u30FE\u309D\u309E\u3005\u3041"+
-        "\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049"+
-        "\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051"+
-        "\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059"+
-        "\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061"+
-        "\u3062\u3063\u3064\u3065\u3066\u3067\u3068\u3069"+
-        "\u306A\u306B\u306C\u306D\u306E\u306F\u3070\u3071"+
-        "\u3072\u3073\u3074\u3075\u3076\u3077\u3078\u3079"+
-        "\u307A\u307B\u307C\u307D\u307E\u307F\u3080\u3081"+
-        "\u3082\u3083\u3084\u3085\u3086\u3087\u3088\u3089"+
-        "\u308A\u308B\u308C\u308D\u308E\u308F\u3090\u3091"+
-        "\u3092\u3093\u30A1\u30A2\u30A3\u30A4\u30A5\u30A6"+
-        "\u30A7\u30A8\u30A9\u30AA\u30AB\u30AC\u30AD\u30AE"+
-        "\u30AF\u30B0\u30B1\u30B2\u30B3\u30B4\u30B5\u30B6"+
-        "\u30B7\u30B8\u30B9\u30BA\u30BB\u30BC\u30BD\u30BE"+
-        "\u30BF\u30C0\u30C1\u30C2\u30C3\u30C4\u30C5\u30C6"+
-        "\u30C7\u30C8\u30C9\u30CA\u30CB\u30CC\u30CD\u30CE"+
-        "\u30CF\u30D0\u30D1\u30D2\u30D3\u30D4\u30D5\u30D6"+
-        "\u30D7\u30D8\u30D9\u30DA\u30DB\u30DC\u30DD\u30DE"+
-        "\u30DF\u30E0\u30E1\u30E2\u30E3\u30E4\u30E5\u30E6"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u30E7\u30E8\u30E9\u30EA\u30EB\u30EC"+
-        "\u30ED\u30EE\u30EF\u30F0\u30F1\u30F2\u30F3\u30F4"+
-        "\u30F5\u30F6\u0414\u0415\u0401\u0416\u0417\u0418"+
-        "\u0419\u041A\u041B\u041C\u0423\u0424\u0425\u0426"+
-        "\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E"+
-        "\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0451"+
-        "\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D"+
-        "\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445"+
-        "\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D"+
-        "\u044E\u044F\u2460\u2461\u2462\u2463\u2464\u2465"+
-        "\u2466\u2467\u2468\u2469\u2474\u2475\u2476\u2477"+
-        "\u2478\u2479\u247A\u247B\u247C\u247D\uFFFD\uFFFD"+
-        "\u4E42\u4E5C\u51F5\u531A\u5382\u4E07\u4E0C\u4E47"+
-        "\u4E8D\u56D7\uFA0C\u5C6E\u5F73\u4E0F\u5187\u4E0E"+
-        "\u4E2E\u4E93\u4EC2\u4EC9\u4EC8\u5198\u52FC\u536C"+
-        "\u53B9\u5720\u5903\u592C\u5C10\u5DFF\u65E1\u6BB3"+
-        "\u6BCC\u6C14\u723F\u4E31\u4E3C\u4EE8\u4EDC\u4EE9"+
-        "\u4EE1\u4EDD\u4EDA\u520C\u531C\u534C\u5722\u5723"+
-        "\u5917\u592F\u5B81\u5B84\u5C12\u5C3B\u5C74\u5C73"+
-        "\u5E04\u5E80\u5E82\u5FC9\u6209\u6250\u6C15\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u6C36\u6C43\u6C3F\u6C3B\u72AE\u72B0\u738A"+
-        "\u79B8\u808A\u961E\u4F0E\u4F18\u4F2C\u4EF5\u4F14"+
-        "\u4EF1\u4F00\u4EF7\u4F08\u4F1D\u4F02\u4F05\u4F22"+
-        "\u4F13\u4F04\u4EF4\u4F12\u51B1\u5213\u5209\u5210"+
-        "\u52A6\u5322\u531F\u534D\u538A\u5407\u56E1\u56DF"+
-        "\u572E\u572A\u5734\u593C\u5980\u597C\u5985\u597B"+
-        "\u597E\u5977\u597F\u5B56\u5C15\u5C25\u5C7C\u5C7A"+
-        "\u5C7B\u5C7E\u5DDF\u5E75\u5E84\u5F02\u5F1A\u5F74"+
-        "\u5FD5\u5FD4\u5FCF\u625C\u625E\u6264\u6261\u6266"+
-        "\u6262\u6259\u6260\u625A\u6265\u65EF\u65EE\u673E"+
-        "\u6739\u6738\u673B\u673A\u673F\u673C\u6733\u6C18"+
-        "\u6C46\u6C52\u6C5C\u6C4F\u6C4A\u6C54\u6C4B\u6C4C"+
-        "\u7071\u725E\u72B4\u72B5\u738E\u752A\u767F\u7A75"+
-        "\u7F51\u8278\u827C\u8280\u827D\u827F\u864D\u897E"+
-        "\u9099\u9097\u9098\u909B\u9094\u9622\u9624\u9620"+
-        "\u9623\u4F56\u4F3B\u4F62\u4F49\u4F53\u4F64\u4F3E"+
-        "\u4F67\u4F52\u4F5F\u4F41\u4F58\u4F2D\u4F33\u4F3F"+
-        "\u4F61\u518F\u51B9\u521C\u521E\u5221\u52AD\u52AE"+
-        "\u5309\u5363\u5372\u538E\u538F\u5430\u5437\u542A"+
-        "\u5454\u5445\u5419\u541C\u5425\u5418\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u543D\u544F\u5441\u5428\u5424\u5447\u56EE\u56E7"+
-        "\u56E5\u5741\u5745\u574C\u5749\u574B\u5752\u5906"+
-        "\u5940\u59A6\u5998\u59A0\u5997\u598E\u59A2\u5990"+
-        "\u598F\u59A7\u59A1\u5B8E\u5B92\u5C28\u5C2A\u5C8D"+
-        "\u5C8F\u5C88\u5C8B\u5C89\u5C92\u5C8A\u5C86\u5C93"+
-        "\u5C95\u5DE0\u5E0A\u5E0E\u5E8B\u5E89\u5E8C\u5E88"+
-        "\u5E8D\u5F05\u5F1D\u5F78\u5F76\u5FD2\u5FD1\u5FD0"+
-        "\u5FED\u5FE8\u5FEE\u5FF3\u5FE1\u5FE4\u5FE3\u5FFA"+
-        "\u5FEF\u5FF7\u5FFB\u6000\u5FF4\u623A\u6283\u628C"+
-        "\u628E\u628F\u6294\u6287\u6271\u627B\u627A\u6270"+
-        "\u6281\u6288\u6277\u627D\u6272\u6274\u6537\u65F0"+
-        "\u65F4\u65F3\u65F2\u65F5\u6745\u6747\u6759\u6755"+
-        "\u674C\u6748\u675D\u674D\u675A\u674B\u6BD0\u6C19"+
-        "\u6C1A\u6C78\u6C67\u6C6B\u6C84\u6C8B\u6C8F\u6C71"+
-        "\u6C6F\u6C69\u6C9A\u6C6D\u6C87\u6C95\u6C9C\u6C66"+
-        "\u6C73\u6C65\u6C7B\u6C8E\u7074\u707A\u7263\u72BF"+
-        "\u72BD\u72C3\u72C6\u72C1\u72BA\u72C5\u7395\u7397"+
-        "\u7393\u7394\u7392\u753A\u7539\u7594\u7595\u7681"+
-        "\u793D\u8034\u8095\u8099\u8090\u8092\u809C\u8290"+
-        "\u828F\u8285\u828E\u8291\u8293\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u828A"+
-        "\u8283\u8284\u8C78\u8FC9\u8FBF\u909F\u90A1\u90A5"+
-        "\u909E\u90A7\u90A0\u9630\u9628\u962F\u962D\u4E33"+
-        "\u4F98\u4F7C\u4F85\u4F7D\u4F80\u4F87\u4F76\u4F74"+
-        "\u4F89\u4F84\u4F77\u4F4C\u4F97\u4F6A\u4F9A\u4F79"+
-        "\u4F81\u4F78\u4F90\u4F9C\u4F94\u4F9E\u4F92\u4F82"+
-        "\u4F95\u4F6B\u4F6E\u519E\u51BC\u51BE\u5235\u5232"+
-        "\u5233\u5246\u5231\u52BC\u530A\u530B\u533C\u5392"+
-        "\u5394\u5487\u547F\u5481\u5491\u5482\u5488\u546B"+
-        "\u547A\u547E\u5465\u546C\u5474\u5466\u548D\u546F"+
-        "\u5461\u5460\u5498\u5463\u5467\u5464\u56F7\u56F9"+
-        "\u576F\u5772\u576D\u576B\u5771\u5770\u5776\u5780"+
-        "\u5775\u577B\u5773\u5774\u5762\u5768\u577D\u590C"+
-        "\u5945\u59B5\u59BA\u59CF\u59CE\u59B2\u59CC\u59C1"+
-        "\u59B6\u59BC\u59C3\u59D6\u59B1\u59BD\u59C0\u59C8"+
-        "\u59B4\u59C7\u5B62\u5B65\u5B93\u5B95\u5C44\u5C47"+
-        "\u5CAE\u5CA4\u5CA0\u5CB5\u5CAF\u5CA8\u5CAC\u5C9F"+
-        "\u5CA3\u5CAD\u5CA2\u5CAA\u5CA7\u5C9D\u5CA5\u5CB6"+
-        "\u5CB0\u5CA6\u5E17\u5E14\u5E19\u5F28\u5F22\u5F23"+
-        "\u5F24\u5F54\u5F82\u5F7E\u5F7D\u5FDE\u5FE5\u602D"+
-        "\u6026\u6019\u6032\u600B\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u6034\u600A"+
-        "\u6017\u6033\u601A\u601E\u602C\u6022\u600D\u6010"+
-        "\u602E\u6013\u6011\u600C\u6009\u601C\u6214\u623D"+
-        "\u62AD\u62B4\u62D1\u62BE\u62AA\u62B6\u62CA\u62AE"+
-        "\u62B3\u62AF\u62BB\u62A9\u62B0\u62B8\u653D\u65A8"+
-        "\u65BB\u6609\u65FC\u6604\u6612\u6608\u65FB\u6603"+
-        "\u660B\u660D\u6605\u65FD\u6611\u6610\u66F6\u670A"+
-        "\u6785\u676C\u678E\u6792\u6776\u677B\u6798\u6786"+
-        "\u6784\u6774\u678D\u678C\u677A\u679F\u6791\u6799"+
-        "\u6783\u677D\u6781\u6778\u6779\u6794\u6B25\u6B80"+
-        "\u6B7E\u6BDE\u6C1D\u6C93\u6CEC\u6CEB\u6CEE\u6CD9"+
-        "\u6CB6\u6CD4\u6CAD\u6CE7\u6CB7\u6CD0\u6CC2\u6CBA"+
-        "\u6CC3\u6CC6\u6CED\u6CF2\u6CD2\u6CDD\u6CB4\u6C8A"+
-        "\u6C9D\u6C80\u6CDE\u6CC0\u6D30\u6CCD\u6CC7\u6CB0"+
-        "\u6CF9\u6CCF\u6CE9\u6CD1\u7094\u7098\u7085\u7093"+
-        "\u7086\u7084\u7091\u7096\u7082\u709A\u7083\u726A"+
-        "\u72D6\u72CB\u72D8\u72C9\u72DC\u72D2\u72D4\u72DA"+
-        "\u72CC\u72D1\u73A4\u73A1\u73AD\u73A6\u73A2\u73A0"+
-        "\u73AC\u739D\u74DD\u74E8\u753F\u7540\u753E\u758C"+
-        "\u7598\u76AF\u76F3\u76F1\u76F0\u76F5\u77F8\u77FC"+
-        "\u77F9\u77FB\u77FA\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u77F7\u7942\u793F"+
-        "\u79C5\u7A78\u7A7B\u7AFB\u7C75\u7CFD\u8035\u808F"+
-        "\u80AE\u80A3\u80B8\u80B5\u80AD\u8220\u82A0\u82C0"+
-        "\u82AB\u829A\u8298\u829B\u82B5\u82A7\u82AE\u82BC"+
-        "\u829E\u82BA\u82B4\u82A8\u82A1\u82A9\u82C2\u82A4"+
-        "\u82C3\u82B6\u82A2\u8670\u866F\u866D\u866E\u8C56"+
-        "\u8FD2\u8FCB\u8FD3\u8FCD\u8FD6\u8FD5\u8FD7\u90B2"+
-        "\u90B4\u90AF\u90B3\u90B0\u9639\u963D\u963C\u963A"+
-        "\u9643\u4FCD\u4FC5\u4FD3\u4FB2\u4FC9\u4FCB\u4FC1"+
-        "\u4FD4\u4FDC\u4FD9\u4FBB\u4FB3\u4FDB\u4FC7\u4FD6"+
-        "\u4FBA\u4FC0\u4FB9\u4FEC\u5244\u5249\u52C0\u52C2"+
-        "\u533D\u537C\u5397\u5396\u5399\u5398\u54BA\u54A1"+
-        "\u54AD\u54A5\u54CF\u54C3\u830D\u54B7\u54AE\u54D6"+
-        "\u54B6\u54C5\u54C6\u54A0\u5470\u54BC\u54A2\u54BE"+
-        "\u5472\u54DE\u54B0\u57B5\u579E\u579F\u57A4\u578C"+
-        "\u5797\u579D\u579B\u5794\u5798\u578F\u5799\u57A5"+
-        "\u579A\u5795\u58F4\u590D\u5953\u59E1\u59DE\u59EE"+
-        "\u5A00\u59F1\u59DD\u59FA\u59FD\u59FC\u59F6\u59E4"+
-        "\u59F2\u59F7\u59DB\u59E9\u59F3\u59F5\u59E0\u59FE"+
-        "\u59F4\u59ED\u5BA8\u5C4C\u5CD0\u5CD8\u5CCC\u5CD7"+
-        "\u5CCB\u5CDB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u5CDE\u5CDA\u5CC9\u5CC7"+
-        "\u5CCA\u5CD6\u5CD3\u5CD4\u5CCF\u5CC8\u5CC6\u5CCE"+
-        "\u5CDF\u5CF8\u5DF9\u5E21\u5E22\u5E23\u5E20\u5E24"+
-        "\u5EB0\u5EA4\u5EA2\u5E9B\u5EA3\u5EA5\u5F07\u5F2E"+
-        "\u5F56\u5F86\u6037\u6039\u6054\u6072\u605E\u6045"+
-        "\u6053\u6047\u6049\u605B\u604C\u6040\u6042\u605F"+
-        "\u6024\u6044\u6058\u6066\u606E\u6242\u6243\u62CF"+
-        "\u630D\u630B\u62F5\u630E\u6303\u62EB\u62F9\u630F"+
-        "\u630C\u62F8\u62F6\u6300\u6313\u6314\u62FA\u6315"+
-        "\u62FB\u62F0\u6541\u6543\u65AA\u65BF\u6636\u6621"+
-        "\u6632\u6635\u661C\u6626\u6622\u6633\u662B\u663A"+
-        "\u661D\u6634\u6639\u662E\u670F\u6710\u67C1\u67F2"+
-        "\u67C8\u67BA\u67DC\u67BB\u67F8\u67D8\u67C0\u67B7"+
-        "\u67C5\u67EB\u67E4\u67DF\u67B5\u67CD\u67B3\u67F7"+
-        "\u67F6\u67EE\u67E3\u67C2\u67B9\u67CE\u67E7\u67F0"+
-        "\u67B2\u67FC\u67C6\u67ED\u67CC\u67AE\u67E6\u67DB"+
-        "\u67FA\u67C9\u67CA\u67C3\u67EA\u67CB\u6B28\u6B82"+
-        "\u6B84\u6BB6\u6BD6\u6BD8\u6BE0\u6C20\u6C21\u6D28"+
-        "\u6D34\u6D2D\u6D1F\u6D3C\u6D3F\u6D12\u6D0A\u6CDA"+
-        "\u6D33\u6D04\u6D19\u6D3A\u6D1A\u6D11\u6D00\u6D1D"+
-        "\u6D42\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u6D01\u6D18\u6D37\u6D03\u6D0F"+
-        "\u6D40\u6D07\u6D20\u6D2C\u6D08\u6D22\u6D09\u6D10"+
-        "\u70B7\u709F\u70BE\u70B1\u70B0\u70A1\u70B4\u70B5"+
-        "\u70A9\u7241\u7249\u724A\u726C\u7270\u7273\u726E"+
-        "\u72CA\u72E4\u72E8\u72EB\u72DF\u72EA\u72E6\u72E3"+
-        "\u7385\u73CC\u73C2\u73C8\u73C5\u73B9\u73B6\u73B5"+
-        "\u73B4\u73EB\u73BF\u73C7\u73BE\u73C3\u73C6\u73B8"+
-        "\u73CB\u74EC\u74EE\u752E\u7547\u7548\u75A7\u75AA"+
-        "\u7679\u76C4\u7708\u7703\u7704\u7705\u770A\u76F7"+
-        "\u76FB\u76FA\u77E7\u77E8\u7806\u7811\u7812\u7805"+
-        "\u7810\u780F\u780E\u7809\u7803\u7813\u794A\u794C"+
-        "\u794B\u7945\u7944\u79D5\u79CD\u79CF\u79D6\u79CE"+
-        "\u7A80\u7A7E\u7AD1\u7B00\u7B01\u7C7A\u7C78\u7C79"+
-        "\u7C7F\u7C80\u7C81\u7D03\u7D08\u7D01\u7F58\u7F91"+
-        "\u7F8D\u7FBE\u8007\u800E\u800F\u8014\u8037\u80D8"+
-        "\u80C7\u80E0\u80D1\u80C8\u80C2\u80D0\u80C5\u80E3"+
-        "\u80D9\u80DC\u80CA\u80D5\u80C9\u80CF\u80D7\u80E6"+
-        "\u80CD\u81FF\u8221\u8294\u82D9\u82FE\u82F9\u8307"+
-        "\u82E8\u8300\u82D5\u833A\u82EB\u82D6\u82F4\u82EC"+
-        "\u82E1\u82F2\u82F5\u830C\u82FB\u82F6\u82F0\u82EA"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u82E4\u82E0\u82FA\u82F3\u82ED\u8677"+
-        "\u8674\u867C\u8673\u8841\u884E\u8867\u886A\u8869"+
-        "\u89D3\u8A04\u8A07\u8D72\u8FE3\u8FE1\u8FEE\u8FE0"+
-        "\u90F1\u90BD\u90BF\u90D5\u90C5\u90BE\u90C7\u90CB"+
-        "\u90C8\u91D4\u91D3\u9654\u964F\u9651\u9653\u964A"+
-        "\u964E\u501E\u5005\u5007\u5013\u5022\u5030\u501B"+
-        "\u4FF5\u4FF4\u5033\u5037\u502C\u4FF6\u4FF7\u5017"+
-        "\u501C\u5020\u5027\u5035\u502F\u5031\u500E\u515A"+
-        "\u5194\u5193\u51CA\u51C4\u51C5\u51C8\u51CE\u5261"+
-        "\u525A\u5252\u525E\u525F\u5255\u5262\u52CD\u530E"+
-        "\u539E\u5526\u54E2\u5517\u5512\u54E7\u54F3\u54E4"+
-        "\u551A\u54FF\u5504\u5508\u54EB\u5511\u5505\u54F1";
-
-    private final static String innerIndex3=
-        "\u550A\u54FB\u54F7\u54F8\u54E0\u550E\u5503\u550B"+
-        "\u5701\u5702\u57CC\u5832\u57D5\u57D2\u57BA\u57C6"+
-        "\u57BD\u57BC\u57B8\u57B6\u57BF\u57C7\u57D0\u57B9"+
-        "\u57C1\u590E\u594A\u5A19\u5A16\u5A2D\u5A2E\u5A15"+
-        "\u5A0F\u5A17\u5A0A\u5A1E\u5A33\u5B6C\u5BA7\u5BAD"+
-        "\u5BAC\u5C03\u5C56\u5C54\u5CEC\u5CFF\u5CEE\u5CF1"+
-        "\u5CF7\u5D00\u5CF9\u5E29\u5E28\u5EA8\u5EAE\u5EAA"+
-        "\u5EAC\u5F33\u5F30\u5F67\u605D\u605A\u6067\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u6041\u60A2\u6088\u6080\u6092\u6081\u609D"+
-        "\u6083\u6095\u609B\u6097\u6087\u609C\u608E\u6219"+
-        "\u6246\u62F2\u6310\u6356\u632C\u6344\u6345\u6336"+
-        "\u6343\u63E4\u6339\u634B\u634A\u633C\u6329\u6341"+
-        "\u6334\u6358\u6354\u6359\u632D\u6347\u6333\u635A"+
-        "\u6351\u6338\u6357\u6340\u6348\u654A\u6546\u65C6"+
-        "\u65C3\u65C4\u65C2\u664A\u665F\u6647\u6651\u6712"+
-        "\u6713\u681F\u681A\u6849\u6832\u6833\u683B\u684B"+
-        "\u684F\u6816\u6831\u681C\u6835\u682B\u682D\u682F"+
-        "\u684E\u6844\u6834\u681D\u6812\u6814\u6826\u6828"+
-        "\u682E\u684D\u683A\u6825\u6820\u6B2C\u6B2F\u6B2D"+
-        "\u6B31\u6B34\u6B6D\u8082\u6B88\u6BE6\u6BE4\u6BE8"+
-        "\u6BE3\u6BE2\u6BE7\u6C25\u6D7A\u6D63\u6D64\u6D76"+
-        "\u6D0D\u6D61\u6D92\u6D58\u6D62\u6D6D\u6D6F\u6D91"+
-        "\u6D8D\u6DEF\u6D7F\u6D86\u6D5E\u6D67\u6D60\u6D97"+
-        "\u6D70\u6D7C\u6D5F\u6D82\u6D98\u6D2F\u6D68\u6D8B"+
-        "\u6D7E\u6D80\u6D84\u6D16\u6D83\u6D7B\u6D7D\u6D75"+
-        "\u6D90\u70DC\u70D3\u70D1\u70DD\u70CB\u7F39\u70E2"+
-        "\u70D7\u70D2\u70DE\u70E0\u70D4\u70CD\u70C5\u70C6"+
-        "\u70C7\u70DA\u70CE\u70E1\u7242\u7278\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u7277\u7276\u7300\u72FA\u72F4\u72FE\u72F6\u72F3"+
-        "\u72FB\u7301\u73D3\u73D9\u73E5\u73D6\u73BC\u73E7"+
-        "\u73E3\u73E9\u73DC\u73D2\u73DB\u73D4\u73DD\u73DA"+
-        "\u73D7\u73D8\u73E8\u74DE\u74DF\u74F4\u74F5\u7521"+
-        "\u755B\u755F\u75B0\u75C1\u75BB\u75C4\u75C0\u75BF"+
-        "\u75B6\u75BA\u768A\u76C9\u771D\u771B\u7710\u7713"+
-        "\u7712\u7723\u7711\u7715\u7719\u771A\u7722\u7727"+
-        "\u7823\u782C\u7822\u7835\u782F\u7828\u782E\u782B"+
-        "\u7821\u7829\u7833\u782A\u7831\u7954\u795B\u794F"+
-        "\u795C\u7953\u7952\u7951\u79EB\u79EC\u79E0\u79EE"+
-        "\u79ED\u79EA\u79DC\u79DE\u79DD\u7A86\u7A89\u7A85"+
-        "\u7A8B\u7A8C\u7A8A\u7A87\u7AD8\u7B10\u7B04\u7B13"+
-        "\u7B05\u7B0F\u7B08\u7B0A\u7B0E\u7B09\u7B12\u7C84"+
-        "\u7C91\u7C8A\u7C8C\u7C88\u7C8D\u7C85\u7D1E\u7D1D"+
-        "\u7D11\u7D0E\u7D18\u7D16\u7D13\u7D1F\u7D12\u7D0F"+
-        "\u7D0C\u7F5C\u7F61\u7F5E\u7F60\u7F5D\u7F5B\u7F96"+
-        "\u7F92\u7FC3\u7FC2\u7FC0\u8016\u803E\u8039\u80FA"+
-        "\u80F2\u80F9\u80F5\u8101\u80FB\u8100\u8201\u822F"+
-        "\u8225\u8333\u832D\u8344\u8319\u8351\u8325\u8356"+
-        "\u833F\u8341\u8326\u831C\u8322\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u8342"+
-        "\u834E\u831B\u832A\u8308\u833C\u834D\u8316\u8324"+
-        "\u8320\u8337\u832F\u8329\u8347\u8345\u834C\u8353"+
-        "\u831E\u832C\u834B\u8327\u8348\u8653\u8652\u86A2"+
-        "\u86A8\u8696\u868D\u8691\u869E\u8687\u8697\u8686"+
-        "\u868B\u869A\u8685\u86A5\u8699\u86A1\u86A7\u8695"+
-        "\u8698\u868E\u869D\u8690\u8694\u8843\u8844\u886D"+
-        "\u8875\u8876\u8872\u8880\u8871\u887F\u886F\u8883"+
-        "\u887E\u8874\u887C\u8A12\u8C47\u8C57\u8C7B\u8CA4"+
-        "\u8CA3\u8D76\u8D78\u8DB5\u8DB7\u8DB6\u8ED1\u8ED3"+
-        "\u8FFE\u8FF5\u9002\u8FFF\u8FFB\u9004\u8FFC\u8FF6"+
-        "\u90D6\u90E0\u90D9\u90DA\u90E3\u90DF\u90E5\u90D8"+
-        "\u90DB\u90D7\u90DC\u90E4\u9150\u914E\u914F\u91D5"+
-        "\u91E2\u91DA\u965C\u965F\u96BC\u98E3\u9ADF\u9B2F"+
-        "\u4E7F\u5070\u506A\u5061\u505E\u5060\u5053\u504B"+
-        "\u505D\u5072\u5048\u504D\u5041\u505B\u504A\u5062"+
-        "\u5015\u5045\u505F\u5069\u506B\u5063\u5064\u5046"+
-        "\u5040\u506E\u5073\u5057\u5051\u51D0\u526B\u526D"+
-        "\u526C\u526E\u52D6\u52D3\u532D\u539C\u5575\u5576"+
-        "\u553C\u554D\u5550\u5534\u552A\u5551\u5562\u5536"+
-        "\u5535\u5530\u5552\u5545\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u550C\u5532"+
-        "\u5565\u554E\u5539\u5548\u552D\u553B\u5540\u554B"+
-        "\u570A\u5707\u57FB\u5814\u57E2\u57F6\u57DC\u57F4"+
-        "\u5800\u57ED\u57FD\u5808\u57F8\u580B\u57F3\u57CF"+
-        "\u5807\u57EE\u57E3\u57F2\u57E5\u57EC\u57E1\u580E"+
-        "\u57FC\u5810\u57E7\u5801\u580C\u57F1\u57E9\u57F0"+
-        "\u580D\u5804\u595C\u5A60\u5A58\u5A55\u5A67\u5A5E"+
-        "\u5A38\u5A35\u5A6D\u5A50\u5A5F\u5A65\u5A6C\u5A53"+
-        "\u5A64\u5A57\u5A43\u5A5D\u5A52\u5A44\u5A5B\u5A48"+
-        "\u5A8E\u5A3E\u5A4D\u5A39\u5A4C\u5A70\u5A69\u5A47"+
-        "\u5A51\u5A56\u5A42\u5A5C\u5B72\u5B6E\u5BC1\u5BC0"+
-        "\u5C59\u5D1E\u5D0B\u5D1D\u5D1A\u5D20\u5D0C\u5D28"+
-        "\u5D0D\u5D26\u5D25\u5D0F\u5D30\u5D12\u5D23\u5D1F"+
-        "\u5D2E\u5E3E\u5E34\u5EB1\u5EB4\u5EB9\u5EB2\u5EB3"+
-        "\u5F36\u5F38\u5F9B\u5F96\u5F9F\u608A\u6090\u6086"+
-        "\u60BE\u60B0\u60BA\u60D3\u60D4\u60CF\u60E4\u60D9"+
-        "\u60DD\u60C8\u60B1\u60DB\u60B7\u60CA\u60BF\u60C3"+
-        "\u60CD\u60C0\u6332\u6365\u638A\u6382\u637D\u63BD"+
-        "\u639E\u63AD\u639D\u6397\u63AB\u638E\u636F\u6387"+
-        "\u6390\u636E\u63AF\u6375\u639C\u636D\u63AE\u637C"+
-        "\u63A4\u633B\u639F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u6378\u6385\u6381"+
-        "\u6391\u638D\u6370\u6553\u65CD\u6665\u6661\u665B"+
-        "\u6659\u665C\u6662\u6718\u6879\u6887\u6890\u689C"+
-        "\u686D\u686E\u68AE\u68AB\u6956\u686F\u68A3\u68AC"+
-        "\u68A9\u6875\u6874\u68B2\u688F\u6877\u6892\u687C"+
-        "\u686B\u6872\u68AA\u6880\u6871\u687E\u689B\u6896"+
-        "\u688B\u68A0\u6889\u68A4\u6878\u687B\u6891\u688C"+
-        "\u688A\u687D\u6B36\u6B33\u6B37\u6B38\u6B91\u6B8F"+
-        "\u6B8D\u6B8E\u6B8C\u6C2A\u6DC0\u6DAB\u6DB4\u6DB3"+
-        "\u6E74\u6DAC\u6DE9\u6DE2\u6DB7\u6DF6\u6DD4\u6E00"+
-        "\u6DC8\u6DE0\u6DDF\u6DD6\u6DBE\u6DE5\u6DDC\u6DDD"+
-        "\u6DDB\u6DF4\u6DCA\u6DBD\u6DED\u6DF0\u6DBA\u6DD5"+
-        "\u6DC2\u6DCF\u6DC9\u6DD0\u6DF2\u6DD3\u6DFD\u6DD7"+
-        "\u6DCD\u6DE3\u6DBB\u70FA\u710D\u70F7\u7117\u70F4"+
-        "\u710C\u70F0\u7104\u70F3\u7110\u70FC\u70FF\u7106"+
-        "\u7113\u7100\u70F8\u70F6\u710B\u7102\u710E\u727E"+
-        "\u727B\u727C\u727F\u731D\u7317\u7307\u7311\u7318"+
-        "\u730A\u7308\u72FF\u730F\u731E\u7388\u73F6\u73F8"+
-        "\u73F5\u7404\u7401\u73FD\u7407\u7400\u73FA\u73FC"+
-        "\u73FF\u740C\u740B\u73F4\u7408\u7564\u7563\u75CE"+
-        "\u75D2\u75CF\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u75CB\u75CC\u75D1\u75D0"+
-        "\u768F\u7689\u76D3\u7739\u772F\u772D\u7731\u7732"+
-        "\u7734\u7733\u773D\u7725\u773B\u7735\u7848\u7852"+
-        "\u7849\u784D\u784A\u784C\u7826\u7845\u7850\u7964"+
-        "\u7967\u7969\u796A\u7963\u796B\u7961\u79BB\u79FA"+
-        "\u79F8\u79F6\u79F7\u7A8F\u7A94\u7A90\u7B35\u7B47"+
-        "\u7B34\u7B25\u7B30\u7B22\u7B24\u7B33\u7B18\u7B2A"+
-        "\u7B1D\u7B31\u7B2B\u7B2D\u7B2F\u7B32\u7B38\u7B1A"+
-        "\u7B23\u7C94\u7C98\u7C96\u7CA3\u7D35\u7D3D\u7D38"+
-        "\u7D36\u7D3A\u7D45\u7D2C\u7D29\u7D41\u7D47\u7D3E"+
-        "\u7D3F\u7D4A\u7D3B\u7D28\u7F63\u7F95\u7F9C\u7F9D"+
-        "\u7F9B\u7FCA\u7FCB\u7FCD\u7FD0\u7FD1\u7FC7\u7FCF"+
-        "\u7FC9\u801F\u801E\u801B\u8047\u8043\u8048\u8118"+
-        "\u8125\u8119\u811B\u812D\u811F\u812C\u811E\u8121"+
-        "\u8115\u8127\u811D\u8122\u8211\u8238\u8233\u823A"+
-        "\u8234\u8232\u8274\u8390\u83A3\u83A8\u838D\u837A"+
-        "\u8373\u83A4\u8374\u838F\u8381\u8395\u8399\u8375"+
-        "\u8394\u83A9\u837D\u8383\u838C\u839D\u839B\u83AA"+
-        "\u838B\u837E\u83A5\u83AF\u8388\u8397\u83B0\u837F"+
-        "\u83A6\u8387\u83AE\u8376\u839A\u8659\u8656\u86BF"+
-        "\u86B7\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u86C2\u86C1\u86C5\u86BA\u86B0"+
-        "\u86C8\u86B9\u86B3\u86B8\u86CC\u86B4\u86BB\u86BC"+
-        "\u86C3\u86BD\u86BE\u8852\u8889\u8895\u88A8\u88A2"+
-        "\u88AA\u889A\u8891\u88A1\u889F\u8898\u88A7\u8899"+
-        "\u889B\u8897\u88A4\u88AC\u888C\u8893\u888E\u8982"+
-        "\u89D6\u89D9\u89D5\u8A30\u8A27\u8A2C\u8A1E\u8C39"+
-        "\u8C3B\u8C5C\u8C5D\u8C7D\u8CA5\u8D7D\u8D7B\u8D79"+
-        "\u8DBC\u8DC2\u8DB9\u8DBF\u8DC1\u8ED8\u8EDE\u8EDD"+
-        "\u8EDC\u8ED7\u8EE0\u8EE1\u9024\u900B\u9011\u901C"+
-        "\u900C\u9021\u90EF\u90EA\u90F0\u90F4\u90F2\u90F3"+
-        "\u90D4\u90EB\u90EC\u90E9\u9156\u9158\u915A\u9153"+
-        "\u9155\u91EC\u91F4\u91F1\u91F3\u91F8\u91E4\u91F9"+
-        "\u91EA\u91EB\u91F7\u91E8\u91EE\u957A\u9586\u9588"+
-        "\u967C\u966D\u966B\u9671\u966F\u96BF\u976A\u9804"+
-        "\u98E5\u9997\u509B\u5095\u5094\u509E\u508B\u50A3"+
-        "\u5083\u508C\u508E\u509D\u5068\u509C\u5092\u5082"+
-        "\u5087\u515F\u51D4\u5312\u5311\u53A4\u53A7\u5591"+
-        "\u55A8\u55A5\u55AD\u5577\u5645\u55A2\u5593\u5588"+
-        "\u558F\u55B5\u5581\u55A3\u5592\u55A4\u557D\u558C"+
-        "\u55A6\u557F\u5595\u55A1\u558E\u570C\u5829\u5837"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u5819\u581E\u5827\u5823\u5828\u57F5"+
-        "\u5848\u5825\u581C\u581B\u5833\u583F\u5836\u582E"+
-        "\u5839\u5838\u582D\u582C\u583B\u5961\u5AAF\u5A94"+
-        "\u5A9F\u5A7A\u5AA2\u5A9E\u5A78\u5AA6\u5A7C\u5AA5"+
-        "\u5AAC\u5A95\u5AAE\u5A37\u5A84\u5A8A\u5A97\u5A83"+
-        "\u5A8B\u5AA9\u5A7B\u5A7D\u5A8C\u5A9C\u5A8F\u5A93"+
-        "\u5A9D\u5BEA\u5BCD\u5BCB\u5BD4\u5BD1\u5BCA\u5BCE"+
-        "\u5C0C\u5C30\u5D37\u5D43\u5D6B\u5D41\u5D4B\u5D3F"+
-        "\u5D35\u5D51\u5D4E\u5D55\u5D33\u5D3A\u5D52\u5D3D"+
-        "\u5D31\u5D59\u5D42\u5D39\u5D49\u5D38\u5D3C\u5D32"+
-        "\u5D36\u5D40\u5D45\u5E44\u5E41\u5F58\u5FA6\u5FA5"+
-        "\u5FAB\u60C9\u60B9\u60CC\u60E2\u60CE\u60C4\u6114"+
-        "\u60F2\u610A\u6116\u6105\u60F5\u6113\u60F8\u60FC"+
-        "\u60FE\u60C1\u6103\u6118\u611D\u6110\u60FF\u6104"+
-        "\u610B\u624A\u6394\u63B1\u63B0\u63CE\u63E5\u63E8"+
-        "\u63EF\u63C3\u649D\u63F3\u63CA\u63E0\u63F6\u63D5"+
-        "\u63F2\u63F5\u6461\u63DF\u63BE\u63DD\u63DC\u63C4"+
-        "\u63D8\u63D3\u63C2\u63C7\u63CC\u63CB\u63C8\u63F0"+
-        "\u63D7\u63D9\u6532\u6567\u656A\u6564\u655C\u6568"+
-        "\u6565\u658C\u659D\u659E\u65AE\u65D0\u65D2\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u667C\u666C\u667B\u6680\u6671\u6679\u666A"+
-        "\u6672\u6701\u690C\u68D3\u6904\u68DC\u692A\u68EC"+
-        "\u68EA\u68F1\u690F\u68D6\u68F7\u68EB\u68E4\u68F6"+
-        "\u6913\u6910\u68F3\u68E1\u6907\u68CC\u6908\u6970"+
-        "\u68B4\u6911\u68EF\u68C6\u6914\u68F8\u68D0\u68FD"+
-        "\u68FC\u68E8\u690B\u690A\u6917\u68CE\u68C8\u68DD"+
-        "\u68DE\u68E6\u68F4\u68D1\u6906\u68D4\u68E9\u6915"+
-        "\u6925\u68C7\u6B39\u6B3B\u6B3F\u6B3C\u6B94\u6B97"+
-        "\u6B99\u6B95\u6BBD\u6BF0\u6BF2\u6BF3\u6C30\u6DFC"+
-        "\u6E46\u6E47\u6E1F\u6E49\u6E88\u6E3C\u6E3D\u6E45"+
-        "\u6E62\u6E2B\u6E3F\u6E41\u6E5D\u6E73\u6E1C\u6E33"+
-        "\u6E4B\u6E40\u6E51\u6E3B\u6E03\u6E2E\u6E5E\u6E68"+
-        "\u6E5C\u6E61\u6E31\u6E28\u6E60\u6E71\u6E6B\u6E39"+
-        "\u6E22\u6E30\u6E53\u6E65\u6E27\u6E78\u6E64\u6E77"+
-        "\u6E55\u6E79\u6E52\u6E66\u6E35\u6E36\u6E5A\u7120"+
-        "\u711E\u712F\u70FB\u712E\u7131\u7123\u7125\u7122"+
-        "\u7132\u711F\u7128\u713A\u711B\u724B\u725A\u7288"+
-        "\u7289\u7286\u7285\u728B\u7312\u730B\u7330\u7322"+
-        "\u7331\u7333\u7327\u7332\u732D\u7326\u7323\u7335"+
-        "\u730C\u742E\u742C\u7430\u742B\u7416\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u741A\u7421\u742D\u7431\u7424\u7423\u741D\u7429"+
-        "\u7420\u7432\u74FB\u752F\u756F\u756C\u75E7\u75DA"+
-        "\u75E1\u75E6\u75DD\u75DF\u75E4\u75D7\u7695\u7692"+
-        "\u76DA\u7746\u7747\u7744\u774D\u7745\u774A\u774E"+
-        "\u774B\u774C\u77DE\u77EC\u7860\u7864\u7865\u785C"+
-        "\u786D\u7871\u786A\u786E\u7870\u7869\u7868\u785E"+
-        "\u7862\u7974\u7973\u7972\u7970\u7A02\u7A0A\u7A03"+
-        "\u7A0C\u7A04\u7A99\u7AE6\u7AE4\u7B4A\u7B3B\u7B44"+
-        "\u7B48\u7B4C\u7B4E\u7B40\u7B58\u7B45\u7CA2\u7C9E"+
-        "\u7CA8\u7CA1\u7D58\u7D6F\u7D63\u7D53\u7D56\u7D67"+
-        "\u7D6A\u7D4F\u7D6D\u7D5C\u7D6B\u7D52\u7D54\u7D69"+
-        "\u7D51\u7D5F\u7D4E\u7F3E\u7F3F\u7F65\u7F66\u7FA2"+
-        "\u7FA0\u7FA1\u7FD7\u8051\u804F\u8050\u80FE\u80D4"+
-        "\u8143\u814A\u8152\u814F\u8147\u813D\u814D\u813A"+
-        "\u81E6\u81EE\u81F7\u81F8\u81F9\u8204\u823C\u823D"+
-        "\u823F\u8275\u833B\u83CF\u83F9\u8423\u83C0\u83E8"+
-        "\u8412\u83E7\u83E4\u83FC\u83F6\u8410\u83C6\u83C8"+
-        "\u83EB\u83E3\u83BF\u8401\u83DD\u83E5\u83D8\u83FF"+
-        "\u83E1\u83CB\u83CE\u83D6\u83F5\u83C9\u8409\u840F"+
-        "\u83DE\u8411\u8406\u83C2\u83F3\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u83D5"+
-        "\u83FA\u83C7\u83D1\u83EA\u8413\u83C3\u83EC\u83EE"+
-        "\u83C4\u83FB\u83D7\u83E2\u841B\u83DB\u83FE\u86D8"+
-        "\u86E2\u86E6\u86D3\u86E3\u86DA\u86EA\u86DD\u86EB"+
-        "\u86DC\u86EC\u86E9\u86D7\u86E8\u86D1\u8848\u8856"+
-        "\u8855\u88BA\u88D7\u88B9\u88B8\u88C0\u88BE\u88B6"+
-        "\u88BC\u88B7\u88BD\u88B2\u8901\u88C9\u8995\u8998"+
-        "\u8997\u89DD\u89DA\u89DB\u8A4E\u8A4D\u8A39\u8A59"+
-        "\u8A40\u8A57\u8A58\u8A44\u8A45\u8A52\u8A48\u8A51"+
-        "\u8A4A\u8A4C\u8A4F\u8C5F\u8C81\u8C80\u8CBA\u8CBE"+
-        "\u8CB0\u8CB9\u8CB5\u8D84\u8D80\u8D89\u8DD8\u8DD3"+
-        "\u8DCD\u8DC7\u8DD6\u8DDC\u8DCF\u8DD5\u8DD9\u8DC8"+
-        "\u8DD7\u8DC5\u8EEF\u8EF7\u8EFA\u8EF9\u8EE6\u8EEE"+
-        "\u8EE5\u8EF5\u8EE7\u8EE8\u8EF6\u8EEB\u8EF1\u8EEC"+
-        "\u8EF4\u8EE9\u902D\u9034\u902F\u9106\u912C\u9104"+
-        "\u90FF\u90FC\u9108\u90F9\u90FB\u9101\u9100\u9107"+
-        "\u9105\u9103\u9161\u9164\u915F\u9162\u9160\u9201"+
-        "\u920A\u9225\u9203\u921A\u9226\u920F\u920C\u9200"+
-        "\u9212\u91FF\u91FD\u9206\u9204\u9227\u9202\u921C"+
-        "\u9224\u9219\u9217\u9205\u9216\u957B\u958D\u958C"+
-        "\u9590\u9687\u967E\u9688\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u9689\u9683"+
-        "\u9680\u96C2\u96C8\u96C3\u96F1\u96F0\u976C\u9770"+
-        "\u976E\u9807\u98A9\u98EB\u9CE6\u9EF9\u4E83\u4E84"+
-        "\u4EB6\u50BD\u50BF\u50C6\u50AE\u50C4\u50CA\u50B4"+
-        "\u50C8\u50C2\u50B0\u50C1\u50BA\u50B1\u50CB\u50C9"+
-        "\u50B6\u50B8\u51D7\u527A\u5278\u527B\u527C\u55C3"+
-        "\u55DB\u55CC\u55D0\u55CB\u55CA\u55DD\u55C0\u55D4"+
-        "\u55C4\u55E9\u55BF\u55D2\u558D\u55CF\u55D5\u55E2"+
-        "\u55D6\u55C8\u55F2\u55CD\u55D9\u55C2\u5714\u5853"+
-        "\u5868\u5864\u584F\u584D\u5849\u586F\u5855\u584E"+
-        "\u585D\u5859\u5865\u585B\u583D\u5863\u5871\u58FC"+
-        "\u5AC7\u5AC4\u5ACB\u5ABA\u5AB8\u5AB1\u5AB5\u5AB0"+
-        "\u5ABF\u5AC8\u5ABB\u5AC6\u5AB7\u5AC0\u5ACA\u5AB4"+
-        "\u5AB6\u5ACD\u5AB9\u5A90\u5BD6\u5BD8\u5BD9\u5C1F"+
-        "\u5C33\u5D71\u5D63\u5D4A\u5D65\u5D72\u5D6C\u5D5E"+
-        "\u5D68\u5D67\u5D62\u5DF0\u5E4F\u5E4E\u5E4A\u5E4D"+
-        "\u5E4B\u5EC5\u5ECC\u5EC6\u5ECB\u5EC7\u5F40\u5FAF"+
-        "\u5FAD\u60F7\u6149\u614A\u612B\u6145\u6136\u6132"+
-        "\u612E\u6146\u612F\u614F\u6129\u6140\u6220\u9168"+
-        "\u6223\u6225\u6224\u63C5\u63F1\u63EB\u6410\u6412"+
-        "\u6409\u6420\u6424\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u6433\u6443\u641F"+
-        "\u6415\u6418\u6439\u6437\u6422\u6423\u640C\u6426"+
-        "\u6430\u6428\u6441\u6435\u642F\u640A\u641A\u6440"+
-        "\u6425\u6427\u640B\u63E7\u641B\u642E\u6421\u640E"+
-        "\u656F\u6592\u65D3\u6686\u668C\u6695\u6690\u668B"+
-        "\u668A\u6699\u6694\u6678\u6720\u6966\u695F\u6938"+
-        "\u694E\u6962\u6971\u693F\u6945\u696A\u6939\u6942"+
-        "\u6957\u6959\u697A\u6948\u6949\u6935\u696C\u6933"+
-        "\u693D\u6965\u68F0\u6978\u6934\u6969\u6940\u696F"+
-        "\u6944\u6976\u6958\u6941\u6974\u694C\u693B\u694B"+
-        "\u6937\u695C\u694F\u6951\u6932\u6952\u692F\u697B"+
-        "\u693C\u6B46\u6B45\u6B43\u6B42\u6B48\u6B41\u6B9B"+
-        "\uFA0D\u6BFB\u6BFC\u6BF9\u6BF7\u6BF8\u6E9B\u6ED6"+
-        "\u6EC8\u6E8F\u6EC0\u6E9F\u6E93\u6E94\u6EA0\u6EB1"+
-        "\u6EB9\u6EC6\u6ED2\u6EBD\u6EC1\u6E9E\u6EC9\u6EB7"+
-        "\u6EB0\u6ECD\u6EA6\u6ECF\u6EB2\u6EBE\u6EC3\u6EDC"+
-        "\u6ED8\u6E99\u6E92\u6E8E\u6E8D\u6EA4\u6EA1\u6EBF"+
-        "\u6EB3\u6ED0\u6ECA\u6E97\u6EAE\u6EA3\u7147\u7154"+
-        "\u7152\u7163\u7160\u7141\u715D\u7162\u7172\u7178"+
-        "\u716A\u7161\u7142\u7158\u7143\u714B\u7170\u715F"+
-        "\u7150\u7153\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u7144\u714D\u715A\u724F"+
-        "\u728D\u728C\u7291\u7290\u728E\u733C\u7342\u733B"+
-        "\u733A\u7340\u734A\u7349\u7444\u744A\u744B\u7452"+
-        "\u7451\u7457\u7440\u744F\u7450\u744E\u7442\u7446"+
-        "\u744D\u7454\u74E1\u74FF\u74FE\u74FD\u751D\u7579"+
-        "\u7577\u6983\u75EF\u760F\u7603\u75F7\u75FE\u75FC"+
-        "\u75F9\u75F8\u7610\u75FB\u75F6\u75ED\u75F5\u75FD"+
-        "\u7699\u76B5\u76DD\u7755\u775F\u7760\u7752\u7756"+
-        "\u775A\u7769\u7767\u7754\u7759\u776D\u77E0\u7887"+
-        "\u789A\u7894\u788F\u7884\u7895\u7885\u7886\u78A1"+
-        "\u7883\u7879\u7899\u7880\u7896\u787B\u797C\u7982"+
-        "\u797D\u7979\u7A11\u7A18\u7A19\u7A12\u7A17\u7A15"+
-        "\u7A22\u7A13\u7A1B\u7A10\u7AA3\u7AA2\u7A9E\u7AEB"+
-        "\u7B66\u7B64\u7B6D\u7B74\u7B69\u7B72\u7B65\u7B73"+
-        "\u7B71\u7B70\u7B61\u7B78\u7B76\u7B63\u7CB2\u7CB4"+
-        "\u7CAF\u7D88\u7D86\u7D80\u7D8D\u7D7F\u7D85\u7D7A"+
-        "\u7D8E\u7D7B\u7D83\u7D7C\u7D8C\u7D94\u7D84\u7D7D"+
-        "\u7D92\u7F6D\u7F6B\u7F67\u7F68\u7F6C\u7FA6\u7FA5"+
-        "\u7FA7\u7FDB\u7FDC\u8021\u8164\u8160\u8177\u815C"+
-        "\u8169\u815B\u8162\u8172\u6721\u815E\u8176\u8167"+
-        "\u816F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u8144\u8161\u821D\u8249\u8244"+
-        "\u8240\u8242\u8245\u84F1\u843F\u8456\u8476\u8479"+
-        "\u848F\u848D\u8465\u8451\u8440\u8486\u8467\u8430"+
-        "\u844D\u847D\u845A\u8459\u8474\u8473\u845D\u8507"+
-        "\u845E\u8437\u843A\u8434\u847A\u8443\u8478\u8432"+
-        "\u8445\u8429\u83D9\u844B\u842F\u8442\u842D\u845F"+
-        "\u8470\u8439\u844E\u844C\u8452\u846F\u84C5\u848E"+
-        "\u843B\u8447\u8436\u8433\u8468\u847E\u8444\u842B"+
-        "\u8460\u8454\u846E\u8450\u870B\u8704\u86F7\u870C"+
-        "\u86FA\u86D6\u86F5\u874D\u86F8\u870E\u8709\u8701"+
-        "\u86F6\u870D\u8705\u88D6\u88CB\u88CD\u88CE\u88DE"+
-        "\u88DB\u88DA\u88CC\u88D0\u8985\u899B\u89DF\u89E5"+
-        "\u89E4\u89E1\u89E0\u89E2\u89DC\u89E6\u8A76\u8A86"+
-        "\u8A7F\u8A61\u8A3F\u8A77\u8A82\u8A84\u8A75\u8A83"+
-        "\u8A81\u8A74\u8A7A\u8C3C\u8C4B\u8C4A\u8C65\u8C64"+
-        "\u8C66\u8C86\u8C84\u8C85\u8CCC\u8D68\u8D69\u8D91"+
-        "\u8D8C\u8D8E\u8D8F\u8D8D\u8D93\u8D94\u8D90\u8D92"+
-        "\u8DF0\u8DE0\u8DEC\u8DF1\u8DEE\u8DD0\u8DE9\u8DE3"+
-        "\u8DE2\u8DE7\u8DF2\u8DEB\u8DF4\u8F06\u8EFF\u8F01"+
-        "\u8F00\u8F05\u8F07\u8F08\u8F02\u8F0B\u9052\u903F"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u9044\u9049\u903D\u9110\u910D\u910F"+
-        "\u9111\u9116\u9114\u910B\u910E\u916E\u916F\u9248"+
-        "\u9252\u9230\u923A\u9266\u9233\u9265\u925E\u9283"+
-        "\u922E\u924A\u9246\u926D\u926C\u924F\u9260\u9267"+
-        "\u926F\u9236\u9261\u9270\u9231\u9254\u9263\u9250"+
-        "\u9272\u924E\u9253\u924C\u9256\u9232\u959F\u959C"+
-        "\u959E\u959B\u9692\u9693\u9691\u9697\u96CE\u96FA"+
-        "\u96FD\u96F8\u96F5\u9773\u9777\u9778\u9772\u980F"+
-        "\u980D\u980E\u98AC\u98F6\u98F9\u99AF\u99B2\u99B0"+
-        "\u99B5\u9AAD\u9AAB\u9B5B\u9CEA\u9CED\u9CE7\u9E80"+
-        "\u9EFD\u50E6\u50D4\u50D7\u50E8\u50F3\u50DB\u50EA"+
-        "\u50DD\u50E4\u50D3\u50EC\u50F0\u50EF\u50E3\u50E0";
-
-    private final static String innerIndex4=
-        "\u51D8\u5280\u5281\u52E9\u52EB\u5330\u53AC\u5627"+
-        "\u5615\u560C\u5612\u55FC\u560F\u561C\u5601\u5613"+
-        "\u5602\u55FA\u561D\u5604\u55FF\u55F9\u5889\u587C"+
-        "\u5890\u5898\u5886\u5881\u587F\u5874\u588B\u587A"+
-        "\u5887\u5891\u588E\u5876\u5882\u5888\u587B\u5894"+
-        "\u588F\u58FE\u596B\u5ADC\u5AEE\u5AE5\u5AD5\u5AEA"+
-        "\u5ADA\u5AED\u5AEB\u5AF3\u5AE2\u5AE0\u5ADB\u5AEC"+
-        "\u5ADE\u5ADD\u5AD9\u5AE8\u5ADF\u5B77\u5BE0\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u5BE3\u5C63\u5D82\u5D80\u5D7D\u5D86\u5D7A"+
-        "\u5D81\u5D77\u5D8A\u5D89\u5D88\u5D7E\u5D7C\u5D8D"+
-        "\u5D79\u5D7F\u5E58\u5E59\u5E53\u5ED8\u5ED1\u5ED7"+
-        "\u5ECE\u5EDC\u5ED5\u5ED9\u5ED2\u5ED4\u5F44\u5F43"+
-        "\u5F6F\u5FB6\u612C\u6128\u6141\u615E\u6171\u6173"+
-        "\u6152\u6153\u6172\u616C\u6180\u6174\u6154\u617A"+
-        "\u615B\u6165\u613B\u616A\u6161\u6156\u6229\u6227"+
-        "\u622B\u642B\u644D\u645B\u645D\u6474\u6476\u6472"+
-        "\u6473\u647D\u6475\u6466\u64A6\u644E\u6482\u645E"+
-        "\u645C\u644B\u6453\u6460\u6450\u647F\u643F\u646C"+
-        "\u646B\u6459\u6465\u6477\u6573\u65A0\u66A1\u66A0"+
-        "\u669F\u6705\u6704\u6722\u69B1\u69B6\u69C9\u69A0"+
-        "\u69CE\u6996\u69B0\u69AC\u69BC\u6991\u6999\u698E"+
-        "\u69A7\u698D\u69A9\u69BE\u69AF\u69BF\u69C4\u69BD"+
-        "\u69A4\u69D4\u69B9\u69CA\u699A\u69CF\u69B3\u6993"+
-        "\u69AA\u69A1\u699E\u69D9\u6997\u6990\u69C2\u69B5"+
-        "\u69A5\u69C6\u6B4A\u6B4D\u6B4B\u6B9E\u6B9F\u6BA0"+
-        "\u6BC3\u6BC4\u6BFE\u6ECE\u6EF5\u6EF1\u6F03\u6F25"+
-        "\u6EF8\u6F37\u6EFB\u6F2E\u6F09\u6F4E\u6F19\u6F1A"+
-        "\u6F27\u6F18\u6F3B\u6F12\u6EED\u6F0A\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u6F36\u6F73\u6EF9\u6EEE\u6F2D\u6F40\u6F30\u6F3C"+
-        "\u6F35\u6EEB\u6F07\u6F0E\u6F43\u6F05\u6EFD\u6EF6"+
-        "\u6F39\u6F1C\u6EFC\u6F3A\u6F1F\u6F0D\u6F1E\u6F08"+
-        "\u6F21\u7187\u7190\u7189\u7180\u7185\u7182\u718F"+
-        "\u717B\u7186\u7181\u7197\u7244\u7253\u7297\u7295"+
-        "\u7293\u7343\u734D\u7351\u734C\u7462\u7473\u7471"+
-        "\u7475\u7472\u7467\u746E\u7500\u7502\u7503\u757D"+
-        "\u7590\u7616\u7608\u760C\u7615\u7611\u760A\u7614"+
-        "\u76B8\u7781\u777C\u7785\u7782\u776E\u7780\u776F"+
-        "\u777E\u7783\u78B2\u78AA\u78B4\u78AD\u78A8\u787E"+
-        "\u78AB\u789E\u78A5\u78A0\u78AC\u78A2\u78A4\u7998"+
-        "\u798A\u798B\u7996\u7995\u7994\u7993\u7997\u7988"+
-        "\u7992\u7990\u7A2B\u7A4A\u7A30\u7A2F\u7A28\u7A26"+
-        "\u7AA8\u7AAB\u7AAC\u7AEE\u7B88\u7B9C\u7B8A\u7B91"+
-        "\u7B90\u7B96\u7B8D\u7B8C\u7B9B\u7B8E\u7B85\u7B98"+
-        "\u5284\u7B99\u7BA4\u7B82\u7CBB\u7CBF\u7CBC\u7CBA"+
-        "\u7DA7\u7DB7\u7DC2\u7DA3\u7DAA\u7DC1\u7DC0\u7DC5"+
-        "\u7D9D\u7DCE\u7DC4\u7DC6\u7DCB\u7DCC\u7DAF\u7DB9"+
-        "\u7D96\u7DBC\u7D9F\u7DA6\u7DAE\u7DA9\u7DA1\u7DC9"+
-        "\u7F73\u7FE2\u7FE3\u7FE5\u7FDE\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u8024"+
-        "\u805D\u805C\u8189\u8186\u8183\u8187\u818D\u818C"+
-        "\u818B\u8215\u8497\u84A4\u84A1\u849F\u84BA\u84CE"+
-        "\u84C2\u84AC\u84AE\u84AB\u84B9\u84B4\u84C1\u84CD"+
-        "\u84AA\u849A\u84B1\u84D0\u849D\u84A7\u84BB\u84A2"+
-        "\u8494\u84C7\u84CC\u849B\u84A9\u84AF\u84A8\u84D6"+
-        "\u8498\u84B6\u84CF\u84A0\u84D7\u84D4\u84D2\u84DB"+
-        "\u84B0\u8491\u8661\u8733\u8723\u8728\u876B\u8740"+
-        "\u872E\u871E\u8721\u8719\u871B\u8743\u872C\u8741"+
-        "\u873E\u8746\u8720\u8732\u872A\u872D\u873C\u8712"+
-        "\u873A\u8731\u8735\u8742\u8726\u8727\u8738\u8724"+
-        "\u871A\u8730\u8711\u88F7\u88E7\u88F1\u88F2\u88FA"+
-        "\u88FE\u88EE\u88FC\u88F6\u88FB\u88F0\u88EC\u88EB"+
-        "\u899D\u89A1\u899F\u899E\u89E9\u89EB\u89E8\u8AAB"+
-        "\u8A99\u8A8B\u8A92\u8A8F\u8A96\u8C3D\u8C68\u8C69"+
-        "\u8CD5\u8CCF\u8CD7\u8D96\u8E09\u8E02\u8DFF\u8E0D"+
-        "\u8DFD\u8E0A\u8E03\u8E07\u8E06\u8E05\u8DFE\u8E00"+
-        "\u8E04\u8F10\u8F11\u8F0E\u8F0D\u9123\u911C\u9120"+
-        "\u9122\u911F\u911D\u911A\u9124\u9121\u911B\u917A"+
-        "\u9172\u9179\u9173\u92A5\u92A4\u9276\u929B\u927A"+
-        "\u92A0\u9294\u92AA\u928D\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u92A6\u929A"+
-        "\u92AB\u9279\u9297\u927F\u92A3\u92EE\u928E\u9282"+
-        "\u9295\u92A2\u927D\u9288\u92A1\u928A\u9286\u928C"+
-        "\u9299\u92A7\u927E\u9287\u92A9\u929D\u928B\u922D"+
-        "\u969E\u96A1\u96FF\u9758\u977D\u977A\u977E\u9783"+
-        "\u9780\u9782\u977B\u9784\u9781\u977F\u97CE\u97CD"+
-        "\u9816\u98AD\u98AE\u9902\u9900\u9907\u999D\u999C"+
-        "\u99C3\u99B9\u99BB\u99BA\u99C2\u99BD\u99C7\u9AB1"+
-        "\u9AE3\u9AE7\u9B3E\u9B3F\u9B60\u9B61\u9B5F\u9CF1"+
-        "\u9CF2\u9CF5\u9EA7\u50FF\u5103\u5130\u50F8\u5106"+
-        "\u5107\u50F6\u50FE\u510B\u510C\u50FD\u510A\u528B"+
-        "\u528C\u52F1\u52EF\u5648\u5642\u564C\u5635\u5641"+
-        "\u564A\u5649\u5646\u5658\u565A\u5640\u5633\u563D"+
-        "\u562C\u563E\u5638\u562A\u563A\u571A\u58AB\u589D"+
-        "\u58B1\u58A0\u58A3\u58AF\u58AC\u58A5\u58A1\u58FF"+
-        "\u5AFF\u5AF4\u5AFD\u5AF7\u5AF6\u5B03\u5AF8\u5B02"+
-        "\u5AF9\u5B01\u5B07\u5B05\u5B0F\u5C67\u5D99\u5D97"+
-        "\u5D9F\u5D92\u5DA2\u5D93\u5D95\u5DA0\u5D9C\u5DA1"+
-        "\u5D9A\u5D9E\u5E69\u5E5D\u5E60\u5E5C\u7DF3\u5EDB"+
-        "\u5EDE\u5EE1\u5F49\u5FB2\u618B\u6183\u6179\u61B1"+
-        "\u61B0\u61A2\u6189\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u619B\u6193\u61AF"+
-        "\u61AD\u619F\u6192\u61AA\u61A1\u618D\u6166\u61B3"+
-        "\u622D\u646E\u6470\u6496\u64A0\u6485\u6497\u649C"+
-        "\u648F\u648B\u648A\u648C\u64A3\u649F\u6468\u64B1"+
-        "\u6498\u6576\u657A\u6579\u657B\u65B2\u65B3\u66B5"+
-        "\u66B0\u66A9\u66B2\u66B7\u66AA\u66AF\u6A00\u6A06"+
-        "\u6A17\u69E5\u69F8\u6A15\u69F1\u69E4\u6A20\u69FF"+
-        "\u69EC\u69E2\u6A1B\u6A1D\u69FE\u6A27\u69F2\u69EE"+
-        "\u6A14\u69F7\u69E7\u6A40\u6A08\u69E6\u69FB\u6A0D"+
-        "\u69FC\u69EB\u6A09\u6A04\u6A18\u6A25\u6A0F\u69F6"+
-        "\u6A26\u6A07\u69F4\u6A16\u6B51\u6BA5\u6BA3\u6BA2"+
-        "\u6BA6\u6C01\u6C00\u6BFF\u6C02\u6F41\u6F26\u6F7E"+
-        "\u6F87\u6FC6\u6F92\u6F8D\u6F89\u6F8C\u6F62\u6F4F"+
-        "\u6F85\u6F5A\u6F96\u6F76\u6F6C\u6F82\u6F55\u6F72"+
-        "\u6F52\u6F50\u6F57\u6F94\u6F93\u6F5D\u6F00\u6F61"+
-        "\u6F6B\u6F7D\u6F67\u6F90\u6F53\u6F8B\u6F69\u6F7F"+
-        "\u6F95\u6F63\u6F77\u6F6A\u6F7B\u71B2\u71AF\u719B"+
-        "\u71B0\u71A0\u719A\u71A9\u71B5\u719D\u71A5\u719E"+
-        "\u71A4\u71A1\u71AA\u719C\u71A7\u71B3\u7298\u729A"+
-        "\u7358\u7352\u735E\u735F\u7360\u735D\u735B\u7361"+
-        "\u735A\u7359\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u7362\u7487\u7489\u748A"+
-        "\u7486\u7481\u747D\u7485\u7488\u747C\u7479\u7508"+
-        "\u7507\u757E\u7625\u761E\u7619\u761D\u761C\u7623"+
-        "\u761A\u7628\u761B\u769C\u769D\u769E\u769B\u778D"+
-        "\u778F\u7789\u7788\u78CD\u78BB\u78CF\u78CC\u78D1"+
-        "\u78CE\u78D4\u78C8\u78C3\u78C4\u78C9\u799A\u79A1"+
-        "\u79A0\u799C\u79A2\u799B\u6B76\u7A39\u7AB2\u7AB4"+
-        "\u7AB3\u7BB7\u7BCB\u7BBE\u7BAC\u7BCE\u7BAF\u7BB9"+
-        "\u7BCA\u7BB5\u7CC5\u7CC8\u7CCC\u7CCB\u7DF7\u7DDB"+
-        "\u7DEA\u7DE7\u7DD7\u7DE1\u7E03\u7DFA\u7DE6\u7DF6"+
-        "\u7DF1\u7DF0\u7DEE\u7DDF\u7F76\u7FAC\u7FB0\u7FAD"+
-        "\u7FED\u7FEB\u7FEA\u7FEC\u7FE6\u7FE8\u8064\u8067"+
-        "\u81A3\u819F\u819E\u8195\u81A2\u8199\u8197\u8216"+
-        "\u824F\u8253\u8252\u8250\u824E\u8251\u8524\u853B"+
-        "\u850F\u8500\u8529\u850E\u8509\u850D\u851F\u850A"+
-        "\u8527\u851C\u84FB\u852B\u84FA\u8508\u850C\u84F4"+
-        "\u852A\u84F2\u8515\u84F7\u84EB\u84F3\u84FC\u8512"+
-        "\u84EA\u84E9\u8516\u84FE\u8528\u851D\u852E\u8502"+
-        "\u84FD\u851E\u84F6\u8531\u8526\u84E7\u84E8\u84F0"+
-        "\u84EF\u84F9\u8518\u8520\u8530\u850B\u8519\u852F"+
-        "\u8662\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u8756\u8763\u8764\u8777\u87E1"+
-        "\u8773\u8758\u8754\u875B\u8752\u8761\u875A\u8751"+
-        "\u875E\u876D\u876A\u8750\u874E\u875F\u875D\u876F"+
-        "\u876C\u877A\u876E\u875C\u8765\u874F\u877B\u8775"+
-        "\u8762\u8767\u8769\u885A\u8905\u890C\u8914\u890B"+
-        "\u8917\u8918\u8919\u8906\u8916\u8911\u890E\u8909"+
-        "\u89A2\u89A4\u89A3\u89ED\u89F0\u89EC\u8ACF\u8AC6"+
-        "\u8AB8\u8AD3\u8AD1\u8AD4\u8AD5\u8ABB\u8AD7\u8ABE"+
-        "\u8AC0\u8AC5\u8AD8\u8AC3\u8ABA\u8ABD\u8AD9\u8C3E"+
-        "\u8C4D\u8C8F\u8CE5\u8CDF\u8CD9\u8CE8\u8CDA\u8CDD"+
-        "\u8CE7\u8DA0\u8D9C\u8DA1\u8D9B\u8E20\u8E23\u8E25"+
-        "\u8E24\u8E2E\u8E15\u8E1B\u8E16\u8E11\u8E19\u8E26"+
-        "\u8E27\u8E14\u8E12\u8E18\u8E13\u8E1C\u8E17\u8E1A"+
-        "\u8F2C\u8F24\u8F18\u8F1A\u8F20\u8F23\u8F16\u8F17"+
-        "\u9073\u9070\u906F\u9067\u906B\u912F\u912B\u9129"+
-        "\u912A\u9132\u9126\u912E\u9185\u9186\u918A\u9181"+
-        "\u9182\u9184\u9180\u92D0\u92C3\u92C4\u92C0\u92D9"+
-        "\u92B6\u92CF\u92F1\u92DF\u92D8\u92E9\u92D7\u92DD"+
-        "\u92CC\u92EF\u92C2\u92E8\u92CA\u92C8\u92CE\u92E6"+
-        "\u92CD\u92D5\u92C9\u92E0\u92DE\u92E7\u92D1\u92D3"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u92B5\u92E1\u92C6\u92B4\u957C\u95AC"+
-        "\u95AB\u95AE\u95B0\u96A4\u96A2\u96D3\u9705\u9708"+
-        "\u9702\u975A\u978A\u978E\u9788\u97D0\u97CF\u981E"+
-        "\u981D\u9826\u9829\u9828\u9820\u981B\u9827\u98B2"+
-        "\u9908\u98FA\u9911\u9914\u9916\u9917\u9915\u99DC"+
-        "\u99CD\u99CF\u99D3\u99D4\u99CE\u99C9\u99D6\u99D8"+
-        "\u99CB\u99D7\u99CC\u9AB3\u9AEC\u9AEB\u9AF3\u9AF2"+
-        "\u9AF1\u9B46\u9B43\u9B67\u9B74\u9B71\u9B66\u9B76"+
-        "\u9B75\u9B70\u9B68\u9B64\u9B6C\u9CFC\u9CFA\u9CFD"+
-        "\u9CFF\u9CF7\u9D07\u9D00\u9CF9\u9CFB\u9D08\u9D05"+
-        "\u9D04\u9E83\u9ED3\u9F0F\u9F10\u511C\u5113\u5117"+
-        "\u511A\u5111\u51DE\u5334\u53E1\u5670\u5660\u566E"+
-        "\u5673\u5666\u5663\u566D\u5672\u565E\u5677\u571C"+
-        "\u571B\u58C8\u58BD\u58C9\u58BF\u58BA\u58C2\u58BC"+
-        "\u58C6\u5B17\u5B19\u5B1B\u5B21\u5B14\u5B13\u5B10"+
-        "\u5B16\u5B28\u5B1A\u5B20\u5B1E\u5BEF\u5DAC\u5DB1"+
-        "\u5DA9\u5DA7\u5DB5\u5DB0\u5DAE\u5DAA\u5DA8\u5DB2"+
-        "\u5DAD\u5DAF\u5DB4\u5E67\u5E68\u5E66\u5E6F\u5EE9"+
-        "\u5EE7\u5EE6\u5EE8\u5EE5\u5F4B\u5FBC\u619D\u61A8"+
-        "\u6196\u61C5\u61B4\u61C6\u61C1\u61CC\u61BA\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u61BF\u61B8\u618C\u64D7\u64D6\u64D0\u64CF"+
-        "\u64C9\u64BD\u6489\u64C3\u64DB\u64F3\u64D9\u6533"+
-        "\u657F\u657C\u65A2\u66C8\u66BE\u66C0\u66CA\u66CB"+
-        "\u66CF\u66BD\u66BB\u66BA\u66CC\u6723\u6A34\u6A66"+
-        "\u6A49\u6A67\u6A32\u6A68\u6A3E\u6A5D\u6A6D\u6A76"+
-        "\u6A5B\u6A51\u6A28\u6A5A\u6A3B\u6A3F\u6A41\u6A6A"+
-        "\u6A64\u6A50\u6A4F\u6A54\u6A6F\u6A69\u6A60\u6A3C"+
-        "\u6A5E\u6A56\u6A55\u6A4D\u6A4E\u6A46\u6B55\u6B54"+
-        "\u6B56\u6BA7\u6BAA\u6BAB\u6BC8\u6BC7\u6C04\u6C03"+
-        "\u6C06\u6FAD\u6FCB\u6FA3\u6FC7\u6FBC\u6FCE\u6FC8"+
-        "\u6F5E\u6FC4\u6FBD\u6F9E\u6FCA\u6FA8\u7004\u6FA5"+
-        "\u6FAE\u6FBA\u6FAC\u6FAA\u6FCF\u6FBF\u6FB8\u6FA2"+
-        "\u6FC9\u6FAB\u6FCD\u6FAF\u6FB2\u6FB0\u71C5\u71C2"+
-        "\u71BF\u71B8\u71D6\u71C0\u71C1\u71CB\u71D4\u71CA"+
-        "\u71C7\u71CF\u71BD\u71D8\u71BC\u71C6\u71DA\u71DB"+
-        "\u729D\u729E\u7369\u7366\u7367\u736C\u7365\u736B"+
-        "\u736A\u747F\u749A\u74A0\u7494\u7492\u7495\u74A1"+
-        "\u750B\u7580\u762F\u762D\u7631\u763D\u7633\u763C"+
-        "\u7635\u7632\u7630\u76BB\u76E6\u779A\u779D\u77A1"+
-        "\u779C\u779B\u77A2\u77A3\u7795\u7799\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u7797\u78DD\u78E9\u78E5\u78EA\u78DE\u78E3\u78DB"+
-        "\u78E1\u78E2\u78ED\u78DF\u78E0\u79A4\u7A44\u7A48"+
-        "\u7A47\u7AB6\u7AB8\u7AB5\u7AB1\u7AB7\u7BDE\u7BE3"+
-        "\u7BE7\u7BDD\u7BD5\u7BE5\u7BDA\u7BE8\u7BF9\u7BD4"+
-        "\u7BEA\u7BE2\u7BDC\u7BEB\u7BD8\u7BDF\u7CD2\u7CD4"+
-        "\u7CD7\u7CD0\u7CD1\u7E12\u7E21\u7E17\u7E0C\u7E1F"+
-        "\u7E20\u7E13\u7E0E\u7E1C\u7E15\u7E1A\u7E22\u7E0B"+
-        "\u7E0F\u7E16\u7E0D\u7E14\u7E25\u7E24\u7F43\u7F7B"+
-        "\u7F7C\u7F7A\u7FB1\u7FEF\u802A\u8029\u806C\u81B1"+
-        "\u81A6\u81AE\u81B9\u81B5\u81AB\u81B0\u81AC\u81B4"+
-        "\u81B2\u81B7\u81A7\u81F2\u8255\u8256\u8257\u8556"+
-        "\u8545\u856B\u854D\u8553\u8561\u8558\u8540\u8546"+
-        "\u8564\u8541\u8562\u8544\u8551\u8547\u8563\u853E"+
-        "\u855B\u8571\u854E\u856E\u8575\u8555\u8567\u8560"+
-        "\u858C\u8566\u855D\u8554\u8565\u856C\u8663\u8665"+
-        "\u8664\u879B\u878F\u8797\u8793\u8792\u8788\u8781"+
-        "\u8796\u8798\u8779\u8787\u87A3\u8785\u8790\u8791"+
-        "\u879D\u8784\u8794\u879C\u879A\u8789\u891E\u8926"+
-        "\u8930\u892D\u892E\u8927\u8931\u8922\u8929\u8923"+
-        "\u892F\u892C\u891F\u89F1\u8AE0\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u8AE2"+
-        "\u8AF2\u8AF4\u8AF5\u8ADD\u8B14\u8AE4\u8ADF\u8AF0"+
-        "\u8AC8\u8ADE\u8AE1\u8AE8\u8AFF\u8AEF\u8AFB\u8C91"+
-        "\u8C92\u8C90\u8CF5\u8CEE\u8CF1\u8CF0\u8CF3\u8D6C"+
-        "\u8D6E\u8DA5\u8DA7\u8E33\u8E3E\u8E38\u8E40\u8E45"+
-        "\u8E36\u8E3C\u8E3D\u8E41\u8E30\u8E3F\u8EBD\u8F36"+
-        "\u8F2E\u8F35\u8F32\u8F39\u8F37\u8F34\u9076\u9079"+
-        "\u907B\u9086\u90FA\u9133\u9135\u9136\u9193\u9190"+
-        "\u9191\u918D\u918F\u9327\u931E\u9308\u931F\u9306"+
-        "\u930F\u937A\u9338\u933C\u931B\u9323\u9312\u9301"+
-        "\u9346\u932D\u930E\u930D\u92CB\u931D\u92FA\u9325"+
-        "\u9313\u92F9\u92F7\u9334\u9302\u9324\u92FF\u9329"+
-        "\u9339\u9335\u932A\u9314\u930C\u930B\u92FE\u9309"+
-        "\u9300\u92FB\u9316\u95BC\u95CD\u95BE\u95B9\u95BA"+
-        "\u95B6\u95BF\u95B5\u95BD\u96A9\u96D4\u970B\u9712"+
-        "\u9710\u9799\u9797\u9794\u97F0\u97F8\u9835\u982F"+
-        "\u9832\u9924\u991F\u9927\u9929\u999E\u99EE\u99EC"+
-        "\u99E5\u99E4\u99F0\u99E3\u99EA\u99E9\u99E7\u9AB9"+
-        "\u9ABF\u9AB4\u9ABB\u9AF6\u9AFA\u9AF9\u9AF7\u9B33"+
-        "\u9B80\u9B85\u9B87\u9B7C\u9B7E\u9B7B\u9B82\u9B93"+
-        "\u9B92\u9B90\u9B7A\u9B95\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u9B7D\u9B88"+
-        "\u9D25\u9D17\u9D20\u9D1E\u9D14\u9D29\u9D1D\u9D18"+
-        "\u9D22\u9D10\u9D19\u9D1F\u9E88\u9E86\u9E87\u9EAE"+
-        "\u9EAD\u9ED5\u9ED6\u9EFA\u9F12\u9F3D\u5126\u5125"+
-        "\u5122\u5124\u5120\u5129\u52F4\u5693\u568C\u568D"+
-        "\u5686\u5684\u5683\u567E\u5682\u567F\u5681\u58D6"+
-        "\u58D4\u58CF\u58D2\u5B2D\u5B25\u5B32\u5B23\u5B2C"+
-        "\u5B27\u5B26\u5B2F\u5B2E\u5B7B\u5BF1\u5BF2\u5DB7"+
-        "\u5E6C\u5E6A\u5FBE\u5FBB\u61C3\u61B5\u61BC\u61E7"+
-        "\u61E0\u61E5\u61E4\u61E8\u61DE\u64EF\u64E9\u64E3"+
-        "\u64EB\u64E4\u64E8\u6581\u6580\u65B6\u65DA\u66D2"+
-        "\u6A8D\u6A96\u6A81\u6AA5\u6A89\u6A9F\u6A9B\u6AA1"+
-        "\u6A9E\u6A87\u6A93\u6A8E\u6A95\u6A83\u6AA8\u6AA4"+
-        "\u6A91\u6A7F\u6AA6\u6A9A\u6A85\u6A8C\u6A92\u6B5B"+
-        "\u6BAD\u6C09\u6FCC\u6FA9\u6FF4\u6FD4\u6FE3\u6FDC"+
-        "\u6FED\u6FE7\u6FE6\u6FDE\u6FF2\u6FDD\u6FE2\u6FE8"+
-        "\u71E1\u71F1\u71E8\u71F2\u71E4\u71F0\u71E2\u7373"+
-        "\u736E\u736F\u7497\u74B2\u74AB\u7490\u74AA\u74AD"+
-        "\u74B1\u74A5\u74AF\u7510\u7511\u7512\u750F\u7584"+
-        "\u7643\u7648\u7649\u7647\u76A4\u76E9\u77B5\u77AB"+
-        "\u77B2\u77B7\u77B6\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u77B4\u77B1\u77A8"+
-        "\u77F0\u78F3\u78FD\u7902\u78FB\u78FC\u78F2\u7905"+
-        "\u78F9\u78FE\u7904\u79AB\u79A8\u7A5C\u7A5B\u7A56"+
-        "\u7A58\u7A54\u7A5A\u7ABE\u7AC0\u7AC1\u7C05\u7C0F"+
-        "\u7BF2\u7C00\u7BFF\u7BFB\u7C0E\u7BF4\u7C0B\u7BF3"+
-        "\u7C02\u7C09\u7C03\u7C01\u7BF8\u7BFD\u7C06\u7BF0"+
-        "\u7BF1\u7C10\u7C0A\u7CE8\u7E2D\u7E3C\u7E42\u7E33"+
-        "\u9848\u7E38\u7E2A\u7E49\u7E40\u7E47\u7E29\u7E4C"+
-        "\u7E30\u7E3B\u7E36\u7E44\u7E3A\u7F45\u7F7F\u7F7E"+
-        "\u7F7D\u7FF4\u7FF2\u802C\u81BB\u81C4\u81CC\u81CA"+
-        "\u81C5\u81C7\u81BC\u81E9\u825B\u825A\u825C\u8583"+
-        "\u8580\u858F\u85A7\u8595\u85A0\u858B\u85A3\u857B"+
-        "\u85A4\u859A\u859E\u8577\u857C\u8589\u85A1\u857A"+
-        "\u8578\u8557\u858E\u8596\u8586\u858D\u8599\u859D"+
-        "\u8581\u85A2\u8582\u8588\u8585\u8579\u8576\u8598"+
-        "\u8590\u859F\u8668\u87BE\u87AA\u87AD\u87C5\u87B0"+
-        "\u87AC\u87B9\u87B5\u87BC\u87AE\u87C9\u87C3\u87C2"+
-        "\u87CC\u87B7\u87AF\u87C4\u87CA\u87B4\u87B6\u87BF"+
-        "\u87B8\u87BD\u87DE\u87B2\u8935\u8933\u893C\u893E"+
-        "\u8941\u8952\u8937\u8942\u89AD\u89AF\u89AE\u89F2"+
-        "\u89F3\u8B1E\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u8B18\u8B16\u8B11\u8B05"+
-        "\u8B0B\u8B22\u8B0F\u8B12\u8B15\u8B07\u8B0D\u8B08"+
-        "\u8B06\u8B1C\u8B13\u8B1A\u8C4F\u8C70\u8C72\u8C71"+
-        "\u8C6F\u8C95\u8C94\u8CF9\u8D6F\u8E4E\u8E4D\u8E53"+
-        "\u8E50\u8E4C\u8E47\u8F43\u8F40\u9085\u907E\u9138"+
-        "\u919A\u91A2\u919B\u9199\u919F\u91A1\u919D\u91A0"+
-        "\u93A1\u9383\u93AF\u9364\u9356\u9347\u937C\u9358"+
-        "\u935C\u9376\u9349\u9350\u9351\u9360\u936D\u938F"+
-        "\u934C\u936A\u9379\u9357\u9355\u9352\u934F\u9371"+
-        "\u9377\u937B\u9361\u935E\u9363\u9367\u9380\u934E"+
-        "\u9359\u95C7\u95C0\u95C9\u95C3\u95C5\u95B7\u96AE"+
-        "\u96B0\u96AC\u9720\u971F\u9718\u971D\u9719\u979A"+
-        "\u97A1\u979C\u979E\u979D\u97D5\u97D4\u97F1\u9841"+
-        "\u9844\u984A\u9849\u9845\u9843\u9925\u992B\u992C"+
-        "\u992A\u9933\u9932\u992F\u992D\u9931\u9930\u9998"+
-        "\u99A3\u99A1\u9A02\u99FA\u99F4\u99F7\u99F9\u99F8"+
-        "\u99F6\u99FB\u99FD\u99FE\u99FC\u9A03\u9ABE\u9AFE"+
-        "\u9AFD\u9B01\u9AFC\u9B48\u9B9A\u9BA8\u9B9E\u9B9B"+
-        "\u9BA6\u9BA1\u9BA5\u9BA4\u9B86\u9BA2\u9BA0\u9BAF"+
-        "\u9D33\u9D41\u9D67\u9D36\u9D2E\u9D2F\u9D31\u9D38"+
-        "\u9D30\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u9D45\u9D42\u9D43\u9D3E\u9D37"+
-        "\u9D40\u9D3D\u7FF5\u9D2D\u9E8A\u9E89\u9E8D\u9EB0"+
-        "\u9EC8\u9EDA\u9EFB\u9EFF\u9F24\u9F23\u9F22\u9F54"+
-        "\u9FA0\u5131\u512D\u512E\u5698\u569C\u5697\u569A"+
-        "\u569D\u5699\u5970\u5B3C\u5C69\u5C6A\u5DC0\u5E6D"+
-        "\u5E6E\u61D8\u61DF\u61ED\u61EE\u61F1\u61EA\u61F0"+
-        "\u61EB\u61D6\u61E9\u64FF\u6504\u64FD\u64F8\u6501"+
-        "\u6503\u64FC\u6594\u65DB\u66DA\u66DB\u66D8\u6AC5"+
-        "\u6AB9\u6ABD\u6AE1\u6AC6\u6ABA\u6AB6\u6AB7\u6AC7"+
-        "\u6AB4\u6AAD\u6B5E\u6BC9\u6C0B\u7007\u700C\u700D"+
-        "\u7001\u7005\u7014\u700E\u6FFF\u7000\u6FFB\u7026"+
-        "\u6FFC\u6FF7\u700A\u7201\u71FF\u71F9\u7203\u71FD"+
-        "\u7376\u74B8\u74C0\u74B5\u74C1\u74BE\u74B6\u74BB"+
-        "\u74C2\u7514\u7513\u765C\u7664\u7659\u7650\u7653"+
-        "\u7657\u765A\u76A6\u76BD\u76EC\u77C2\u77BA\u78FF"+
-        "\u790C\u7913\u7914\u7909\u7910\u7912\u7911\u79AD"+
-        "\u79AC\u7A5F\u7C1C\u7C29\u7C19\u7C20\u7C1F\u7C2D"+
-        "\u7C1D\u7C26\u7C28\u7C22\u7C25\u7C30\u7E5C\u7E50"+
-        "\u7E56\u7E63\u7E58\u7E62\u7E5F\u7E51\u7E60\u7E57"+
-        "\u7E53\u7FB5\u7FB3\u7FF7\u7FF8\u8075\u81D1\u81D2"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u81D0\u825F\u825E\u85B4\u85C6\u85C0"+
-        "\u85C3\u85C2\u85B3\u85B5\u85BD\u85C7\u85C4\u85BF"+
-        "\u85CB\u85CE\u85C8\u85C5\u85B1\u85B6\u85D2\u8624"+
-        "\u85B8\u85B7\u85BE\u8669\u87E7\u87E6\u87E2\u87DB"+
-        "\u87EB\u87EA\u87E5\u87DF\u87F3\u87E4\u87D4\u87DC"+
-        "\u87D3\u87ED\u87D8\u87E3\u87A4\u87D7\u87D9\u8801"+
-        "\u87F4\u87E8\u87DD\u8953\u894B\u894F\u894C\u8946"+
-        "\u8950\u8951\u8949\u8B2A\u8B27\u8B23\u8B33\u8B30"+
-        "\u8B35\u8B47\u8B2F\u8B3C\u8B3E\u8B31\u8B25\u8B37"+
-        "\u8B26\u8B36\u8B2E\u8B24\u8B3B\u8B3D\u8B3A\u8C42"+
-        "\u8C75\u8C99\u8C98\u8C97\u8CFE\u8D04\u8D02\u8D00"+
-        "\u8E5C\u8E62\u8E60\u8E57\u8E56\u8E5E\u8E65\u8E67";
-
-    private final static String innerIndex5=
-        "\u8E5B\u8E5A\u8E61\u8E5D\u8E69\u8E54\u8F46\u8F47"+
-        "\u8F48\u8F4B\u9128\u913A\u913B\u913E\u91A8\u91A5"+
-        "\u91A7\u91AF\u91AA\u93B5\u938C\u9392\u93B7\u939B"+
-        "\u939D\u9389\u93A7\u938E\u93AA\u939E\u93A6\u9395"+
-        "\u9388\u9399\u939F\u938D\u93B1\u9391\u93B2\u93A4"+
-        "\u93A8\u93B4\u93A3\u93A5\u95D2\u95D3\u95D1\u96B3"+
-        "\u96D7\u96DA\u5DC2\u96DF\u96D8\u96DD\u9723\u9722"+
-        "\u9725\u97AC\u97AE\u97A8\u97AB\u97A4\u97AA\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u97A2\u97A5\u97D7\u97D9\u97D6\u97D8\u97FA"+
-        "\u9850\u9851\u9852\u98B8\u9941\u993C\u993A\u9A0F"+
-        "\u9A0B\u9A09\u9A0D\u9A04\u9A11\u9A0A\u9A05\u9A07"+
-        "\u9A06\u9AC0\u9ADC\u9B08\u9B04\u9B05\u9B29\u9B35"+
-        "\u9B4A\u9B4C\u9B4B\u9BC7\u9BC6\u9BC3\u9BBF\u9BC1"+
-        "\u9BB5\u9BB8\u9BD3\u9BB6\u9BC4\u9BB9\u9BBD\u9D5C"+
-        "\u9D53\u9D4F\u9D4A\u9D5B\u9D4B\u9D59\u9D56\u9D4C"+
-        "\u9D57\u9D52\u9D54\u9D5F\u9D58\u9D5A\u9E8E\u9E8C"+
-        "\u9EDF\u9F01\u9F00\u9F16\u9F25\u9F2B\u9F2A\u9F29"+
-        "\u9F28\u9F4C\u9F55\u5134\u5135\u5296\u52F7\u53B4"+
-        "\u56AB\u56AD\u56A6\u56A7\u56AA\u56AC\u58DA\u58DD"+
-        "\u58DB\u5912\u5B3D\u5B3E\u5B3F\u5DC3\u5E70\u5FBF"+
-        "\u61FB\u6507\u6510\u650D\u6509\u650C\u650E\u6584"+
-        "\u65DE\u65DD\u66DE\u6AE7\u6AE0\u6ACC\u6AD1\u6AD9"+
-        "\u6ACB\u6ADF\u6ADC\u6AD0\u6AEB\u6ACF\u6ACD\u6ADE"+
-        "\u6B60\u6BB0\u6C0C\u7019\u7027\u7020\u7016\u702B"+
-        "\u7021\u7022\u7023\u7029\u7017\u7024\u701C\u702A"+
-        "\u720C\u720A\u7207\u7202\u7205\u72A5\u72A6\u72A4"+
-        "\u72A3\u72A1\u74CB\u74C5\u74B7\u74C3\u7516\u7660"+
-        "\u77C9\u77CA\u77C4\u77F1\u791D\u791B\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\u7921\u791C\u7917\u791E\u79B0\u7A67\u7A68\u7C33"+
-        "\u7C3C\u7C39\u7C2C\u7C3B\u7CEC\u7CEA\u7E76\u7E75"+
-        "\u7E78\u7E70\u7E77\u7E6F\u7E7A\u7E72\u7E74\u7E68"+
-        "\u7F4B\u7F4A\u7F83\u7F86\u7FB7\u7FFD\u7FFE\u8078"+
-        "\u81D7\u81D5\u8264\u8261\u8263\u85EB\u85F1\u85ED"+
-        "\u85D9\u85E1\u85E8\u85DA\u85D7\u85EC\u85F2\u85F8"+
-        "\u85D8\u85DF\u85E3\u85DC\u85D1\u85F0\u85E6\u85EF"+
-        "\u85DE\u85E2\u8800\u87FA\u8803\u87F6\u87F7\u8809"+
-        "\u880C\u880B\u8806\u87FC\u8808\u87FF\u880A\u8802"+
-        "\u8962\u895A\u895B\u8957\u8961\u895C\u8958\u895D"+
-        "\u8959\u8988\u89B7\u89B6\u89F6\u8B50\u8B48\u8B4A"+
-        "\u8B40\u8B53\u8B56\u8B54\u8B4B\u8B55\u8B51\u8B42"+
-        "\u8B52\u8B57\u8C43\u8C77\u8C76\u8C9A\u8D06\u8D07"+
-        "\u8D09\u8DAC\u8DAA\u8DAD\u8DAB\u8E6D\u8E78\u8E73"+
-        "\u8E6A\u8E6F\u8E7B\u8EC2\u8F52\u8F51\u8F4F\u8F50"+
-        "\u8F53\u8FB4\u9140\u913F\u91B0\u91AD\u93DE\u93C7"+
-        "\u93CF\u93C2\u93DA\u93D0\u93F9\u93EC\u93CC\u93D9"+
-        "\u93A9\u93E6\u93CA\u93D4\u93EE\u93E3\u93D5\u93C4"+
-        "\u93CE\u93C0\u93D2\u93E7\u957D\u95DA\u95DB\u96E1"+
-        "\u9729\u972B\u972C\u9728\u9726\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u97B3"+
-        "\u97B7\u97B6\u97DD\u97DE\u97DF\u985C\u9859\u985D"+
-        "\u9857\u98BF\u98BD\u98BB\u98BE\u9948\u9947\u9943"+
-        "\u99A6\u99A7\u9A1A\u9A15\u9A25\u9A1D\u9A24\u9A1B"+
-        "\u9A22\u9A20\u9A27\u9A23\u9A1E\u9A1C\u9A14\u9AC2"+
-        "\u9B0B\u9B0A\u9B0E\u9B0C\u9B37\u9BEA\u9BEB\u9BE0"+
-        "\u9BDE\u9BE4\u9BE6\u9BE2\u9BF0\u9BD4\u9BD7\u9BEC"+
-        "\u9BDC\u9BD9\u9BE5\u9BD5\u9BE1\u9BDA\u9D77\u9D81"+
-        "\u9D8A\u9D84\u9D88\u9D71\u9D80\u9D78\u9D86\u9D8B"+
-        "\u9D8C\u9D7D\u9D6B\u9D74\u9D75\u9D70\u9D69\u9D85"+
-        "\u9D73\u9D7B\u9D82\u9D6F\u9D79\u9D7F\u9D87\u9D68"+
-        "\u9E94\u9E91\u9EC0\u9EFC\u9F2D\u9F40\u9F41\u9F4D"+
-        "\u9F56\u9F57\u9F58\u5337\u56B2\u56B5\u56B3\u58E3"+
-        "\u5B45\u5DC6\u5DC7\u5EEE\u5EEF\u5FC0\u5FC1\u61F9"+
-        "\u6517\u6516\u6515\u6513\u65DF\u66E8\u66E3\u66E4"+
-        "\u6AF3\u6AF0\u6AEA\u6AE8\u6AF9\u6AF1\u6AEE\u6AEF"+
-        "\u703C\u7035\u702F\u7037\u7034\u7031\u7042\u7038"+
-        "\u703F\u703A\u7039\u7040\u703B\u7033\u7041\u7213"+
-        "\u7214\u72A8\u737D\u737C\u74BA\u76AB\u76AA\u76BE"+
-        "\u76ED\u77CC\u77CE\u77CF\u77CD\u77F2\u7925\u7923"+
-        "\u7927\u7928\u7924\u7929\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u79B2\u7A6E"+
-        "\u7A6C\u7A6D\u7AF7\u7C49\u7C48\u7C4A\u7C47\u7C45"+
-        "\u7CEE\u7E7B\u7E7E\u7E81\u7E80\u7FBA\u7FFF\u8079"+
-        "\u81DB\u81D9\u820B\u8268\u8269\u8622\u85FF\u8601"+
-        "\u85FE\u861B\u8600\u85F6\u8604\u8609\u8605\u860C"+
-        "\u85FD\u8819\u8810\u8811\u8817\u8813\u8816\u8963"+
-        "\u8966\u89B9\u89F7\u8B60\u8B6A\u8B5D\u8B68\u8B63"+
-        "\u8B65\u8B67\u8B6D\u8DAE\u8E86\u8E88\u8E84\u8F59"+
-        "\u8F56\u8F57\u8F55\u8F58\u8F5A\u908D\u9143\u9141"+
-        "\u91B7\u91B5\u91B2\u91B3\u940B\u9413\u93FB\u9420"+
-        "\u940F\u9414\u93FE\u9415\u9410\u9428\u9419\u940D"+
-        "\u93F5\u9400\u93F7\u9407\u940E\u9416\u9412\u93FA"+
-        "\u9409\u93F8\u940A\u93FF\u93FC\u940C\u93F6\u9411"+
-        "\u9406\u95DE\u95E0\u95DF\u972E\u972F\u97B9\u97BB"+
-        "\u97FD\u97FE\u9860\u9862\u9863\u985F\u98C1\u98C2"+
-        "\u9950\u994E\u9959\u994C\u994B\u9953\u9A32\u9A34"+
-        "\u9A31\u9A2C\u9A2A\u9A36\u9A29\u9A2E\u9A38\u9A2D"+
-        "\u9AC7\u9ACA\u9AC6\u9B10\u9B12\u9B11\u9C0B\u9C08"+
-        "\u9BF7\u9C05\u9C12\u9BF8\u9C40\u9C07\u9C0E\u9C06"+
-        "\u9C17\u9C14\u9C09\u9D9F\u9D99\u9DA4\u9D9D\u9D92"+
-        "\u9D98\u9D90\u9D9B\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u9DA0\u9D94\u9D9C"+
-        "\u9DAA\u9D97\u9DA1\u9D9A\u9DA2\u9DA8\u9D9E\u9DA3"+
-        "\u9DBF\u9DA9\u9D96\u9DA6\u9DA7\u9E99\u9E9B\u9E9A"+
-        "\u9EE5\u9EE4\u9EE7\u9EE6\u9F30\u9F2E\u9F5B\u9F60"+
-        "\u9F5E\u9F5D\u9F59\u9F91\u513A\u5139\u5298\u5297"+
-        "\u56C3\u56BD\u56BE\u5B48\u5B47\u5DCB\u5DCF\u5EF1"+
-        "\u61FD\u651B\u6B02\u6AFC\u6B03\u6AF8\u6B00\u7043"+
-        "\u7044\u704A\u7048\u7049\u7045\u7046\u721D\u721A"+
-        "\u7219\u737E\u7517\u766A\u77D0\u792D\u7931\u792F"+
-        "\u7C54\u7C53\u7CF2\u7E8A\u7E87\u7E88\u7E8B\u7E86"+
-        "\u7E8D\u7F4D\u7FBB\u8030\u81DD\u8618\u862A\u8626"+
-        "\u861F\u8623\u861C\u8619\u8627\u862E\u8621\u8620"+
-        "\u8629\u861E\u8625\u8829\u881D\u881B\u8820\u8824"+
-        "\u881C\u882B\u884A\u896D\u8969\u896E\u896B\u89FA"+
-        "\u8B79\u8B78\u8B45\u8B7A\u8B7B\u8D10\u8D14\u8DAF"+
-        "\u8E8E\u8E8C\u8F5E\u8F5B\u8F5D\u9146\u9144\u9145"+
-        "\u91B9\u943F\u943B\u9436\u9429\u943D\u943C\u9430"+
-        "\u9439\u942A\u9437\u942C\u9440\u9431\u95E5\u95E4"+
-        "\u95E3\u9735\u973A\u97BF\u97E1\u9864\u98C9\u98C6"+
-        "\u98C0\u9958\u9956\u9A39\u9A3D\u9A46\u9A44\u9A42"+
-        "\u9A41\u9A3A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\u9A3F\u9ACD\u9B15\u9B17"+
-        "\u9B18\u9B16\u9B3A\u9B52\u9C2B\u9C1D\u9C1C\u9C2C"+
-        "\u9C23\u9C28\u9C29\u9C24\u9C21\u9DB7\u9DB6\u9DBC"+
-        "\u9DC1\u9DC7\u9DCA\u9DCF\u9DBE\u9DC5\u9DC3\u9DBB"+
-        "\u9DB5\u9DCE\u9DB9\u9DBA\u9DAC\u9DC8\u9DB1\u9DAD"+
-        "\u9DCC\u9DB3\u9DCD\u9DB2\u9E7A\u9E9C\u9EEB\u9EEE"+
-        "\u9EED\u9F1B\u9F18\u9F1A\u9F31\u9F4E\u9F65\u9F64"+
-        "\u9F92\u4EB9\u56C6\u56C5\u56CB\u5971\u5B4B\u5B4C"+
-        "\u5DD5\u5DD1\u5EF2\u6521\u6520\u6526\u6522\u6B0B"+
-        "\u6B08\u6B09\u6C0D\u7055\u7056\u7057\u7052\u721E"+
-        "\u721F\u72A9\u737F\u74D8\u74D5\u74D9\u74D7\u766D"+
-        "\u76AD\u7935\u79B4\u7A70\u7A71\u7C57\u7C5C\u7C59"+
-        "\u7C5B\u7C5A\u7CF4\u7CF1\u7E91\u7F4F\u7F87\u81DE"+
-        "\u826B\u8634\u8635\u8633\u862C\u8632\u8636\u882C"+
-        "\u8828\u8826\u882A\u8825\u8971\u89BF\u89BE\u89FB"+
-        "\u8B7E\u8B84\u8B82\u8B86\u8B85\u8B7F\u8D15\u8E95"+
-        "\u8E94\u8E9A\u8E92\u8E90\u8E96\u8E97\u8F60\u8F62"+
-        "\u9147\u944C\u9450\u944A\u944B\u944F\u9447\u9445"+
-        "\u9448\u9449\u9446\u973F\u97E3\u986A\u9869\u98CB"+
-        "\u9954\u995B\u9A4E\u9A53\u9A54\u9A4C\u9A4F\u9A48"+
-        "\u9A4A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\u9A49\u9A52\u9A50\u9AD0\u9B19"+
-        "\u9B2B\u9B3B\u9B56\u9B55\u9C46\u9C48\u9C3F\u9C44"+
-        "\u9C39\u9C33\u9C41\u9C3C\u9C37\u9C34\u9C32\u9C3D"+
-        "\u9C36\u9DDB\u9DD2\u9DDE\u9DDA\u9DCB\u9DD0\u9DDC"+
-        "\u9DD1\u9DDF\u9DE9\u9DD9\u9DD8\u9DD6\u9DF5\u9DD5"+
-        "\u9DDD\u9EB6\u9EF0\u9F35\u9F33\u9F32\u9F42\u9F6B"+
-        "\u9F95\u9FA2\u513D\u5299\u58E8\u58E7\u5972\u5B4D"+
-        "\u5DD8\u882F\u5F4F\u6201\u6203\u6204\u6529\u6525"+
-        "\u6596\u66EB\u6B11\u6B12\u6B0F\u6BCA\u705B\u705A"+
-        "\u7222\u7382\u7381\u7383\u7670\u77D4\u7C67\u7C66"+
-        "\u7E95\u826C\u863A\u8640\u8639\u863C\u8631\u863B"+
-        "\u863E\u8830\u8832\u882E\u8833\u8976\u8974\u8973"+
-        "\u89FE\u8B8C\u8B8E\u8B8B\u8B88\u8C45\u8D19\u8E98"+
-        "\u8F64\u8F63\u91BC\u9462\u9455\u945D\u9457\u945E"+
-        "\u97C4\u97C5\u9800\u9A56\u9A59\u9B1E\u9B1F\u9B20"+
-        "\u9C52\u9C58\u9C50\u9C4A\u9C4D\u9C4B\u9C55\u9C59"+
-        "\u9C4C\u9C4E\u9DFB\u9DF7\u9DEF\u9DE3\u9DEB\u9DF8"+
-        "\u9DE4\u9DF6\u9DE1\u9DEE\u9DE6\u9DF2\u9DF0\u9DE2"+
-        "\u9DEC\u9DF4\u9DF3\u9DE8\u9DED\u9EC2\u9ED0\u9EF2"+
-        "\u9EF3\u9F06\u9F1C\u9F38\u9F37\u9F36\u9F43\u9F4F"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\u9F71\u9F70\u9F6E\u9F6F\u56D3\u56CD"+
-        "\u5B4E\u5C6D\u652D\u66ED\u66EE\u6B13\u705F\u7061"+
-        "\u705D\u7060\u7223\u74DB\u74E5\u77D5\u7938\u79B7"+
-        "\u79B6\u7C6A\u7E97\u7F89\u826D\u8643\u8838\u8837"+
-        "\u8835\u884B\u8B94\u8B95\u8E9E\u8E9F\u8EA0\u8E9D"+
-        "\u91BE\u91BD\u91C2\u946B\u9468\u9469\u96E5\u9746"+
-        "\u9743\u9747\u97C7\u97E5\u9A5E\u9AD5\u9B59\u9C63"+
-        "\u9C67\u9C66\u9C62\u9C5E\u9C60\u9E02\u9DFE\u9E07"+
-        "\u9E03\u9E06\u9E05\u9E00\u9E01\u9E09\u9DFF\u9DFD"+
-        "\u9E04\u9EA0\u9F1E\u9F46\u9F74\u9F75\u9F76\u56D4"+
-        "\u652E\u65B8\u6B18\u6B19\u6B17\u6B1A\u7062\u7226"+
-        "\u72AA\u77D8\u77D9\u7939\u7C69\u7C6B\u7CF6\u7E9A"+
-        "\u7E98\u7E9B\u7E99\u81E0\u81E1\u8646\u8647\u8648"+
-        "\u8979\u897A\u897C\u897B\u89FF\u8B98\u8B99\u8EA5"+
-        "\u8EA4\u8EA3\u946E\u946D\u946F\u9471\u9473\u9749"+
-        "\u9872\u995F\u9C68\u9C6E\u9C6D\u9E0B\u9E0D\u9E10"+
-        "\u9E0F\u9E12\u9E11\u9EA1\u9EF5\u9F09\u9F47\u9F78"+
-        "\u9F7B\u9F7A\u9F79\u571E\u7066\u7C6F\u883C\u8DB2"+
-        "\u8EA6\u91C3\u9474\u9478\u9476\u9475\u9A60\u9C74"+
-        "\u9C73\u9C71\u9C75\u9E14\u9E13\u9EF6\u9F0A\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\u9FA4\u7068\u7065\u7CF7\u866A\u883E\u883D"+
-        "\u883F\u8B9E\u8C9C\u8EA9\u8EC9\u974B\u9873\u9874"+
-        "\u98CC\u9961\u99AB\u9A64\u9A66\u9A67\u9B24\u9E15"+
-        "\u9E17\u9F48\u6207\u6B1E\u7227\u864C\u8EA8\u9482"+
-        "\u9480\u9481\u9A69\u9A68\u9B2E\u9E19\u7229\u864B"+
-        "\u8B9F\u9483\u9C79\u9EB7\u7675\u9A6B\u9C7A\u9E1D"+
-        "\u7069\u706A\u9EA4\u9F7E\u9F49\u9F98\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"+
-        "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD";
-
-    private final static short index1[] = {
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
-        16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-        32, 33, 34, 35, 36, 37, 38, 39, 0, 40, 41, 42, 43, 44, 45, 46,
-        47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-        63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
-        79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 0, 0, 0, 0, 0, 0
-    };
-
-    String index2[] = {
-        innerIndex0,
-        innerIndex1,
-        innerIndex2,
-        innerIndex3,
-        innerIndex4,
-        innerIndex5
-    };
 }
diff --git a/jdk/src/share/classes/sun/io/CharToByteJohab.java b/jdk/src/share/classes/sun/io/CharToByteJohab.java
index 37ed253..b3b609d 100644
--- a/jdk/src/share/classes/sun/io/CharToByteJohab.java
+++ b/jdk/src/share/classes/sun/io/CharToByteJohab.java
@@ -46,4728 +46,4 @@
         super.index1 = nioCoder.getEncoderIndex1();
         super.index2 = nioCoder.getEncoderIndex2();
     }
-
-    private final static String innerIndex0=
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0020\u0021\"\u0023\u0024\u0025\u0026\'"+
-        "\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F"+
-        "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037"+
-        "\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F"+
-        "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047"+
-        "\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F"+
-        "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057"+
-        "\u0058\u0059\u005A\u005B\\\u005D\u005E\u005F"+
-        "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067"+
-        "\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F"+
-        "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077"+
-        "\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uD9AE\u0000\u0000\uD9B4\u0000\u0000\uD967"+
-        "\uD937\u0000\uDCA3\u0000\u0000\uD939\u0000\u0000"+
-        "\uD956\uD94E\uDD99\uDD9A\uD9A5\u0000\uD9D2\uD934"+
-        "\uD9AC\uDD98\uDCAC\u0000\uDCF9\uDCF6\uDCFA\uD9AF"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uDCA1\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDCA2\u0000\u0000\u0000\u0000\u0000\u0000\uD94F"+
-        "\uDCAA\u0000\u0000\u0000\u0000\u0000\uDCAD\uDD3C"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uDD31\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDD33\u0000\u0000\u0000\u0000\u0000\u0000\uD950"+
-        "\uDD3A\u0000\u0000\u0000\u0000\u0000\uDD3D\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDD32\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uDCA4\uDD34"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDD35\uDCA6\uDD36\u0000\u0000\u0000\u0000"+
-        "\uDD37\u0000\u0000\u0000\u0000\u0000\u0000\uDCA8"+
-        "\uDD38\uDCA9\uDD39\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDD40\uDCAF\uDD3F\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uDCAB\uDD3B\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uDCAE\uDD3E"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uD9A7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD9B0\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD9A8\uD9AB\uD9AA\uD9AD\u0000\uD9A9\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDB51\uDB52\uDB53\uDB54\uDB55\uDB56\uDB57"+
-        "\uDB58\uDB59\uDB5A\uDB5B\uDB5C\uDB5D\uDB5E\uDB5F"+
-        "\uDB60\uDB61\u0000\uDB62\uDB63\uDB64\uDB65\uDB66"+
-        "\uDB67\uDB68\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDB71\uDB72\uDB73\uDB74\uDB75\uDB76\uDB77"+
-        "\uDB78\uDB79\uDB7A\uDB7B\uDB7C\uDB7D\uDB7E\uDB91"+
-        "\uDB92\uDB93\u0000\uDB94\uDB95\uDB96\uDB97\uDB98"+
-        "\uDB99\uDB9A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDEA7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDEA1\uDEA2\uDEA3\uDEA4\uDEA5\uDEA6\uDEA8\uDEA9"+
-        "\uDEAA\uDEAB\uDEAC\uDEAD\uDEAE\uDEAF\uDEB0\uDEB1"+
-        "\uDEB2\uDEB3\uDEB4\uDEB5\uDEB6\uDEB7\uDEB8\uDEB9"+
-        "\uDEBA\uDEBB\uDEBC\uDEBD\uDEBE\uDEBF\uDEC0\uDEC1"+
-        "\uDED1\uDED2\uDED3\uDED4\uDED5\uDED6\uDED8\uDED9"+
-        "\uDEDA\uDEDB\uDEDC\uDEDD\uDEDE\uDEDF\uDEE0\uDEE1"+
-        "\uDEE2\uDEE3\uDEE4\uDEE5\uDEE6\uDEE7\uDEE8\uDEE9"+
-        "\uDEEA\uDEEB\uDEEC\uDEED\uDEEE\uDEEF\uDEF0\uDEF1"+
-        "\u0000\uDED7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uD93A\u0000\u0000"+
-        "\uD93E\uD93F\u0000\u0000\uD940\uD941\u0000\u0000"+
-        "\uD9D3\uD9D4\u0000\u0000\u0000\uD935\uD936\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD9B6\u0000\uD957\uD958\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uD968\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uDD9B\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uDD9C"+
-        "\u0000\uDD9D\uDD9E\uDD9F\uDDA0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uD959\u0000\u0000\u0000\u0000"+
-        "\u0000\uD9B5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uDC34\u0000\u0000\uD9E0\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uD9E5\uD9E2\u0000\u0000\u0000\uDC69\u0000"+
-        "\u0000\u0000\u0000\uD95A\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uDCF7\uDCF8\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uDCFB\uDCFC\uDCFD\uDCFE\u0000"+
-        "\uDB40\uDB41\uDB42\uDB43\uDB44\uDB45\uDB46\uDB47"+
-        "\uDB48\uDB49\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDB31\uDB32\uDB33\uDB34\uDB35\uDB36\uDB37\uDB38"+
-        "\uDB39\uDB3A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD977\uD978\uD976\uD979\uD97A\uD9D5\uD9D8\uD9D6"+
-        "\uD9D9\uD9D7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD9A1\u0000\uD9A2\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD9A3\u0000\uD963\uD9A4\u0000\u0000\u0000\uD964"+
-        "\uD996\u0000\u0000\uD997\u0000\u0000\u0000\uD9B3"+
-        "\u0000\uD9B2\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD97E\u0000\u0000\uD992\uD954\u0000"+
-        "\uD960\u0000\u0000\u0000\u0000\uD93B\u0000\uD99E"+
-        "\uD99F\uD99D\uD99C\uD994\uD995\u0000\uD9B1\u0000"+
-        "\u0000\u0000\u0000\u0000\uD955\uD993\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uD93D\uD991\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD966\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD951\uD965\u0000\u0000\uD952\uD953\u0000\u0000"+
-        "\u0000\u0000\uD97C\uD97D\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD99A\uD99B\u0000\u0000\uD998\uD999"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uD9C1\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uD961\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD962\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDCE7\uDCE8\uDCE9\uDCEA\uDCEB\uDCEC\uDCED\uDCEE"+
-        "\uDCEF\uDCF0\uDCF1\uDCF2\uDCF3\uDCF4\uDCF5\u0000"+
-        "\u0000\u0000\u0000\u0000\uDD77\uDD78\uDD79\uDD7A"+
-        "\uDD7B\uDD7C\uDD7D\uDD7E\uDD91\uDD92\uDD93\uDD94"+
-        "\uDD95\uDD96\uDD97\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uDD5D\uDD5E\uDD5F\uDD60"+
-        "\uDD61\uDD62\uDD63\uDD64\uDD65\uDD66\uDD67\uDD68"+
-        "\uDD69\uDD6A\uDD6B\uDD6C\uDD6D\uDD6E\uDD6F\uDD70"+
-        "\uDD71\uDD72\uDD73\uDD74\uDD75\uDD76\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDCCD\uDCCE\uDCCF\uDCD0\uDCD1\uDCD2\uDCD3\uDCD4"+
-        "\uDCD5\uDCD6\uDCD7\uDCD8\uDCD9\uDCDA\uDCDB\uDCDC"+
-        "\uDCDD\uDCDE\uDCDF\uDCE0\uDCE1\uDCE2\uDCE3\uDCE4"+
-        "\uDCE5\uDCE6\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDBA1\uDBAC\uDBA2\uDBAD\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uDBA3\uDBC8\uDBC7\uDBAE"+
-        "\uDBA4\uDBC2\uDBC1\uDBAF\uDBA6\uDBC6\uDBC5\uDBB1"+
-        "\uDBA5\uDBC4\uDBC3\uDBB0\uDBA7\uDBBC\uDBC9\uDBCA"+
-        "\uDBB7\uDBCB\uDBCC\uDBB2\uDBA9\uDBBE\uDBCD\uDBCE"+
-        "\uDBB9\uDBCF\uDBD0\uDBB4\uDBA8\uDBD1\uDBD2\uDBB8"+
-        "\uDBBD\uDBD3\uDBD4\uDBB3\uDBAA\uDBD5\uDBD6\uDBBA"+
-        "\uDBBF\uDBD7\uDBD8\uDBB5\uDBAB\uDBD9\uDBDA\uDBBB"+
-        "\uDBDB\uDBDC\uDBC0\uDBDD\uDBDE\uDBDF\uDBE0\uDBE1"+
-        "\uDBE2\uDBE3\uDBE4\uDBB6\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD9C6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD971\uD970\u0000\uD9C3\uD9C7\uD9C8\uD9CB\uD9CA"+
-        "\uD9C9\uD9CC\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uD973\uD972\u0000\u0000\uD9BA\uD9B9"+
-        "\u0000\u0000\u0000\u0000\uD975\uD974\u0000\u0000"+
-        "\uD9B8\uD9B7\u0000\u0000\u0000\u0000\uD96F\uD96E"+
-        "\uD9C2\u0000\u0000\uD96B\u0000\u0000\uD96D\uD96C"+
-        "\uD9C4\uD9C5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uD96A\uD969\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uD9CF\uD9CE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uD9D0\u0000\uD9D1\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD95F\u0000\uD95E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD9BC\uD9BD\u0000\uD9C0\uD9BB\uD9BE\u0000\uD9BF"+
-        "\uD9CD\uD9DB\uD9DC\u0000\uD9DD\uD9DA\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD931\uD932\uD933\uD938\u0000\u0000\u0000\u0000"+
-        "\uD944\uD945\uD946\uD947\uD948\uD949\uD94A\uD94B"+
-        "\uD94C\uD94D\u0000\uD97B\uD942\uD943\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDDA1\uDDA2\uDDA3\uDDA4\uDDA5\uDDA6\uDDA7"+
-        "\uDDA8\uDDA9\uDDAA\uDDAB\uDDAC\uDDAD\uDDAE\uDDAF"+
-        "\uDDB0\uDDB1\uDDB2\uDDB3\uDDB4\uDDB5\uDDB6\uDDB7"+
-        "\uDDB8\uDDB9\uDDBA\uDDBB\uDDBC\uDDBD\uDDBE\uDDBF"+
-        "\uDDC0\uDDC1\uDDC2\uDDC3\uDDC4\uDDC5\uDDC6\uDDC7"+
-        "\uDDC8\uDDC9\uDDCA\uDDCB\uDDCC\uDDCD\uDDCE\uDDCF"+
-        "\uDDD0\uDDD1\uDDD2\uDDD3\uDDD4\uDDD5\uDDD6\uDDD7"+
-        "\uDDD8\uDDD9\uDDDA\uDDDB\uDDDC\uDDDD\uDDDE\uDDDF"+
-        "\uDDE0\uDDE1\uDDE2\uDDE3\uDDE4\uDDE5\uDDE6\uDDE7"+
-        "\uDDE8\uDDE9\uDDEA\uDDEB\uDDEC\uDDED\uDDEE\uDDEF"+
-        "\uDDF0\uDDF1\uDDF2\uDDF3\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDE31\uDE32\uDE33\uDE34\uDE35\uDE36\uDE37"+
-        "\uDE38\uDE39\uDE3A\uDE3B\uDE3C\uDE3D\uDE3E\uDE3F"+
-        "\uDE40\uDE41\uDE42\uDE43\uDE44\uDE45\uDE46\uDE47"+
-        "\uDE48\uDE49\uDE4A\uDE4B\uDE4C\uDE4D\uDE4E\uDE4F"+
-        "\uDE50\uDE51\uDE52\uDE53\uDE54\uDE55\uDE56\uDE57"+
-        "\uDE58\uDE59\uDE5A\uDE5B\uDE5C\uDE5D\uDE5E\uDE5F"+
-        "\uDE60\uDE61\uDE62\uDE63\uDE64\uDE65\uDE66\uDE67"+
-        "\uDE68\uDE69\uDE6A\uDE6B\uDE6C\uDE6D\uDE6E\uDE6F"+
-        "\uDE70\uDE71\uDE72\uDE73\uDE74\uDE75\uDE76\uDE77"+
-        "\uDE78\uDE79\uDE7A\uDE7B\uDE7C\uDE7D\uDE7E\uDE91"+
-        "\uDE92\uDE93\uDE94\uDE95\uDE96\uDE97\uDE98\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u8841\u8C41\u8444\u9041\u8446\u8447\u9441"+
-        "\u9841\u9C41\u844A\u844B\u844C\u844D\u844E\u844F"+
-        "\u8450\uA041\uA441\uA841\u8454\uAC41\uB041\uB441"+
-        "\uB841\uBC41\uC041\uC441\uC841\uCC41\uD041\u8461"+
-        "\u8481\u84A1\u84C1\u84E1\u8541\u8561\u8581\u85A1"+
-        "\u85C1\u85E1\u8641\u8661\u8681\u86A1\u86C1\u86E1"+
-        "\u8741\u8761\u8781\u87A1\uDAD4\uDAD5\uDAD6\uDAD7"+
-        "\uDAD8\uDAD9\uDADA\uDADB\uDADC\uDADD\uDADE\uDADF"+
-        "\uDAE0\uDAE1\uDAE2\uDAE3\uDAE4\uDAE5\uDAE6\uDAE7"+
-        "\uDAE8\uDAE9\uDAEA\uDAEB\uDAEC\uDAED\uDAEE\uDAEF"+
-        "\uDAF0\uDAF1\uDAF2\uDAF3\uDAF4\uDAF5\uDAF6\uDAF7"+
-        "\uDAF8\uDAF9\uDAFA\uDAFB\uDAFC\uDAFD\uDAFE\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDD41\uDD42\uDD43\uDD44\uDD45\uDD46\uDD47\uDD48"+
-        "\uDD49\uDD4A\uDD4B\uDD4C\uDD4D\uDD4E\uDD4F\uDD50"+
-        "\uDD51\uDD52\uDD53\uDD54\uDD55\uDD56\uDD57\uDD58"+
-        "\uDD59\uDD5A\uDD5B\uDD5C\uD9DF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDCB1\uDCB2\uDCB3\uDCB4\uDCB5\uDCB6\uDCB7\uDCB8"+
-        "\uDCB9\uDCBA\uDCBB\uDCBC\uDCBD\uDCBE\uDCBF\uDCC0"+
-        "\uDCC1\uDCC2\uDCC3\uDCC4\uDCC5\uDCC6\uDCC7\uDCC8"+
-        "\uDCC9\uDCCA\uDCCB\uDCCC\u0000\u0000\u0000\uD9DE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
-
-    private final static String innerIndex1=
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uDC59\uDC5A\uDC5B\uDC5C\uDC5D\u0000\u0000\u0000"+
-        "\uDC4A\uDC4B\uDC6C\uDC6D\uDC6E\uDC46\uDC47\uDC48"+
-        "\uDC64\uDC65\uDC66\uDC67\uDC68\uDC31\uDC32\uDC33"+
-        "\uDC35\uDC3B\uDC3C\uDC3D\uDC3E\uDC3F\uDC40\uDC41"+
-        "\uDC42\uDC43\uDC44\uDC37\uDC38\uDC39\uDC3A\uDC4D"+
-        "\uDC4E\uDC75\uDC76\uDC77\uDC78\uDC71\uDC72\uDC73"+
-        "\uDC4F\uDC50\uDC51\uDC52\uDC53\uDC54\uDC55\uDC56"+
-        "\uDC57\uDC58\uDC5E\uDC5F\uDC60\uDC61\uDC62\uDC63"+
-        "\uDC6A\uDC6B\uD9E3\uDC7C\uDC36\uDC70\uDC91\uD9E1"+
-        "\uDC4C\uDC7D\uDC45\u0000\u0000\u0000\u0000\uDC49"+
-        "\uDC7A\u0000\u0000\uDC7B\u0000\u0000\uDC6F\u0000"+
-        "\uD9E4\u0000\u0000\uDC74\uDC7E\uDC79\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF179\uF2CB\u0000\uF662\u0000\u0000\u0000\uE742"+
-        "\uF1DB\uEAB2\uEABE\uF7BB\u0000\uE996\u0000\u0000"+
-        "\u0000\uF5E4\u0000\u0000\uF4A6\uE9E0\uEBA6\u0000"+
-        "\uE29A\uE940\u0000\u0000\u0000\u0000\uECAA\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF3E9\u0000\u0000"+
-        "\u0000\u0000\uE1FA\u0000\u0000\u0000\u0000\u0000"+
-        "\uF93F\uE4A1\u0000\uF3AB\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEED1\uE43C\u0000\uE29B\u0000\u0000"+
-        "\u0000\u0000\u0000\uF3FD\u0000\uEA4F\uF8BA\uF7B9"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE262\u0000"+
-        "\uECAB\uF0E0\u0000\u0000\u0000\uE29C\uE0F7\uEDA5"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE071\u0000\uE55C\u0000\u0000"+
-        "\u0000\u0000\u0000\uF071\u0000\u0000\uE973\uEAAD"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE0EB\u0000"+
-        "\u0000\u0000\uE5AF\u0000\u0000\u0000\uE697\u0000"+
-        "\uEDF8\u0000\u0000\uEA50\uF133\u0000\uEFCD\u0000"+
-        "\uF037\uEFF6\uF8BB\u0000\uEEE9\uF2CC\u0000\u0000"+
-        "\uE376\u0000\u0000\uEA51\u0000\u0000\uED3C\u0000"+
-        "\u0000\uE75C\uF7F1\u0000\uE26F\uF834\uEE42\u0000"+
-        "\uF89D\u0000\u0000\uF84D\uE158\uF2CD\uE5D5\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE4A2\u0000"+
-        "\u0000\u0000\uF161\u0000\u0000\u0000\u0000\u0000"+
-        "\uED37\uF162\u0000\u0000\uF641\u0000\u0000\uE29D"+
-        "\u0000\u0000\uE361\uE0BF\u0000\uF1A4\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF1A8\uEA52\uF672\uF1DC"+
-        "\uE997\uEB49\u0000\u0000\u0000\uE55E\u0000\uF545"+
-        "\u0000\u0000\u0000\uE4DB\uE645\uF134\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uED76\u0000\uF3EA\u0000\u0000\u0000\uE0EC\uE0C0"+
-        "\u0000\u0000\u0000\uF194\u0000\u0000\u0000\u0000"+
-        "\u0000\uE37A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF7F2\uF135\uE36F\u0000\uEEEA\uE37B\uE961"+
-        "\uE8E9\uF9CC\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE8D7"+
-        "\u0000\u0000\u0000\u0000\uE871\u0000\uE646\u0000"+
-        "\uECDF\u0000\uEA53\u0000\uEA54\uE031\u0000\u0000"+
-        "\u0000\u0000\u0000\uF27C\u0000\u0000\uE4A3\uF247"+
-        "\uF75F\u0000\u0000\u0000\u0000\uF058\uF248\uF3AC"+
-        "\uF3A5\uEFCE\u0000\u0000\u0000\uF7BC\u0000\u0000"+
-        "\u0000\uEDF9\uF17A\uE9D6\uF1C2\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF735\u0000\u0000\u0000\u0000\u0000\uEDBA"+
-        "\uE8D8\u0000\u0000\uE032\u0000\u0000\uE3CD\u0000"+
-        "\u0000\u0000\uF27D\u0000\u0000\u0000\uF17B\uEA55"+
-        "\u0000\uECE0\u0000\uE059\uF479\u0000\uE5CE\u0000"+
-        "\uF646\u0000\uE252\uE657\u0000\uECB4\u0000\uF3AD"+
-        "\u0000\uF072\u0000\u0000\u0000\u0000\uE6C2\u0000"+
-        "\uF4A7\u0000\u0000\uE1EA\u0000\uF0EE\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE7B2\uF9A5"+
-        "\u0000\u0000\u0000\u0000\u0000\uF665\uE5E2\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF745"+
-        "\u0000\u0000\uE197\uF5B5\uED3D\u0000\u0000\u0000"+
-        "\u0000\uEEEB\uF3D5\u0000\u0000\u0000\uF34B\u0000"+
-        "\u0000\uEFB5\u0000\uE159\uF865\u0000\u0000\uEBD4"+
-        "\u0000\u0000\uE6D6\u0000\u0000\uE951\u0000\uEA56"+
-        "\uF891\uECE1\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEBF3\uE998"+
-        "\u0000\uE29E\u0000\uE8C4\u0000\uF793\u0000\u0000"+
-        "\uE974\u0000\uEDEF\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE941\u0000\u0000\u0000\uE5D6\u0000"+
-        "\u0000\uF4DA\u0000\uE0C1\u0000\uE8C3\u0000\u0000"+
-        "\u0000\uE7FA\uE4EE\u0000\u0000\u0000\uF848\u0000"+
-        "\u0000\uF9A6\uF0EF\u0000\uF536\u0000\uE15A\uF4A8"+
-        "\u0000\uF4DB\u0000\uE8A7\uF647\u0000\uE2E6\uF394"+
-        "\uE0DA\u0000\uEED2\uE6C3\uF692\uEF6E\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEDA6\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEDE7\u0000\u0000\u0000\uE033"+
-        "\uE137\uF059\u0000\u0000\u0000\u0000\u0000\uF746"+
-        "\u0000\u0000\u0000\u0000\u0000\uF835\u0000\u0000"+
-        "\u0000\u0000\uF3AE\u0000\uF2CE\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE0ED\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF640\uF2CF\uEFCF\u0000"+
-        "\uF6DE\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE263\u0000\u0000\u0000\u0000\uE999\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE8A8\u0000\u0000"+
-        "\u0000\uE0F8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEAA1\uE9E1\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF5CA\uEFB6\u0000\u0000"+
-        "\u0000\u0000\uEEEC\uF27E\u0000\uF4F0\u0000\uEABF"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE15B\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE351\u0000\u0000"+
-        "\u0000\uF562\uEB4A\u0000\u0000\u0000\u0000\uEAC0"+
-        "\u0000\uE270\u0000\u0000\u0000\uE962\uF9EA\u0000"+
-        "\u0000\u0000\uE698\u0000\u0000\u0000\uF05A\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEF79\u0000\uECAC"+
-        "\u0000\u0000\u0000\u0000\u0000\uF4D0\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE034\u0000\uE8F8\u0000\u0000\u0000\uEA57"+
-        "\uF0F0\uF3D6\u0000\u0000\uEDE2\u0000\uE15C\u0000"+
-        "\u0000\uE0FB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF073\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEAC1"+
-        "\u0000\uE67D\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEFD0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF249\u0000\u0000\u0000\u0000\uE5E3"+
-        "\u0000\u0000\uE3D3\u0000\uEDF0\u0000\u0000\u0000"+
-        "\uEF44\uF0C3\u0000\uF03A\uF89E\uF5F6\uF34C\uF9D4"+
-        "\uEB4B\uE253\u0000\uE34A\uF6BA\uE795\uF6CD\u0000"+
-        "\u0000\u0000\uED3E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE56F\u0000\u0000\u0000"+
-        "\u0000\u0000\uE377\u0000\u0000\uF19F\u0000\uE43E"+
-        "\uF291\uE5D7\uF074\uF732\uE1EB\uE6BF\uF8B1\u0000"+
-        "\u0000\uE1EC\u0000\u0000\u0000\uE942\uE37C\uE29F"+
-        "\uF292\u0000\u0000\u0000\uE152\u0000\u0000\u0000"+
-        "\uE37D\u0000\u0000\u0000\u0000\u0000\uEDF7\u0000"+
-        "\u0000\u0000\uF4FC\u0000\u0000\uF232\u0000\u0000"+
-        "\u0000\u0000\uE7B3\u0000\u0000\uE796\u0000\uEFB7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE23E\u0000\u0000\u0000\u0000\uE7A2\u0000\u0000"+
-        "\u0000\u0000\uE793\u0000\uE55F\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEDA7\uE5D2"+
-        "\u0000\u0000\u0000\u0000\u0000\uE639\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF532\u0000\uF3D7\u0000"+
-        "\u0000\uE5D8\u0000\uF34D\uE6D0\uE560\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE6CF\uF0EA\uF9EB\u0000"+
-        "\u0000\uE8ED\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF955\uE0C2\u0000\u0000\u0000\u0000\uF9D5\u0000"+
-        "\uF558\uEF7A\uF5F3\u0000\u0000\uF7DE\u0000\u0000"+
-        "\uE4EF\u0000\u0000\uF163\u0000\u0000\uE9C2\uF2B7"+
-        "\uEED4\u0000\uE05A\u0000\u0000\u0000\uE7FB\u0000"+
-        "\u0000\uF89F\u0000\u0000\u0000\u0000\u0000\uE63A"+
-        "\u0000\u0000\u0000\u0000\u0000\uF59A\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF6F7\uE93C\u0000\u0000"+
-        "\u0000\uE6D7\uEAA2\u0000\u0000\u0000\uE24E\u0000"+
-        "\uE4F0\u0000\u0000\u0000\u0000\u0000\uF334\uEBEC"+
-        "\uE2E7\uF4CB\uF1A9\uE04E\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF591\u0000\u0000\u0000\uF65E"+
-        "\u0000\u0000\uEA9D\uE34B\uE5B7\uF293\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF538\u0000\uE99A\u0000"+
-        "\u0000\u0000\u0000\uE0A7\u0000\uE85E\u0000\u0000"+
-        "\u0000\uEB76\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF1A5\uF294\u0000\u0000\u0000\u0000\uE99B"+
-        "\u0000\u0000\uF7DC\u0000\u0000\uF4DC\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF794\u0000\uF59B"+
-        "\u0000\u0000\u0000\uF993\u0000\u0000\u0000\uE34C"+
-        "\uE8F9\uE6B1\u0000\u0000\u0000\uE0FC\u0000\u0000"+
-        "\u0000\uF335\uE0FD\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE5F4\u0000\u0000\u0000\uE1ED"+
-        "\uE035\u0000\u0000\uE63B\uE352\u0000\u0000\u0000"+
-        "\u0000\uF34E\uE44D\uE134\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF846\u0000"+
-        "\u0000\uE15D\u0000\uE89C\u0000\uF65F\u0000\uEFB8"+
-        "\u0000\uE797\u0000\u0000\u0000\uE15E\u0000\u0000"+
-        "\u0000\u0000\uE6CD\u0000\u0000\uE561\uEFED\u0000"+
-        "\uE07B\uE7E2\u0000\uF9B2\u0000\uECAD\uE65C\uE7B4"+
-        "\u0000\u0000\uEBA7\uF263\uE353\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF9B3\u0000\uE5E4\u0000\u0000"+
-        "\uE2E8\u0000\uF1C3\uE342\u0000\u0000\uE2A0\uE838"+
-        "\u0000\u0000\u0000\u0000\u0000\uF760\u0000\u0000"+
-        "\uF9D6\u0000\u0000\u0000\u0000\uF761\u0000\uF762"+
-        "\uE963\u0000\u0000\u0000\u0000\uE9E2\uF8F9\uE9C1"+
-        "\u0000\uECB5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF1DD\uE254\u0000\uE0A1\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9E3\u0000\u0000\u0000\u0000\uF96D"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF7AF\u0000\u0000\u0000\u0000\u0000\uE49D"+
-        "\uE2A1\uED38\u0000\uF546\uF1A0\u0000\u0000\uECAE"+
-        "\uEEED\uF9C1\uE872\u0000\u0000\uE743\u0000\u0000"+
-        "\u0000\uE9E4\uF391\uF693\uF892\u0000\u0000\uE3F5"+
-        "\u0000\u0000\uE85F\u0000\uE964\u0000\uE936\u0000"+
-        "\uF2BF\u0000\u0000\u0000\u0000\u0000\uE25F\u0000"+
-        "\uEB69\u0000\u0000\u0000\u0000\u0000\u0000\uE7D6"+
-        "\uF164\uF05B\u0000\u0000\uE04F\uE5B0\u0000\uE2E9"+
-        "\u0000\u0000\u0000\u0000\u0000\uF3ED\u0000\uE15F"+
-        "\u0000\u0000\u0000\u0000\uED9A\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uED7D\u0000\u0000\u0000\u0000"+
-        "\uE6D8\u0000\uF9A7\u0000\u0000\u0000\u0000\uF03B"+
-        "\uF642\u0000\u0000\u0000\u0000\uE2F0\uF7BD\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE96\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE0DB\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF4D1\u0000\u0000\u0000\u0000"+
-        "\uEFD1\uF4A9\uE370\uEFD2\u0000\uE873\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEC62\u0000\uF632\uEBF4"+
-        "\u0000\u0000\u0000\uE874\u0000\u0000\u0000\u0000"+
-        "\u0000\uEED5\uF5BF\uE2A2\uE1AF\uE2A3\u0000\u0000"+
-        "\u0000\uE1B0\uF3FE\uE333\uEBAF\uF733\u0000\uE036"+
-        "\uF6BB\uF47A\uEA58\uEFD3\u0000\u0000\u0000\u0000"+
-        "\uEA59\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF9DE\uE050\u0000\u0000\u0000"+
-        "\uF7EA\uE3CE\uF264\u0000\uE562\uE7A3\uF9A8\uE6D9"+
-        "\uF6CE\uF84E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE2D6\u0000\uE6F0\u0000\uF0E1"+
-        "\uF755\u0000\u0000\u0000\u0000\u0000\uE99C\u0000"+
-        "\u0000\uE9C3\u0000\uF7DF\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEEEF\u0000\u0000\u0000\u0000"+
-        "\uF9E5\uF633\u0000\uE7FC\uF9A9\u0000\uEEEE\u0000"+
-        "\u0000\u0000\uE5E5\u0000\u0000\u0000\u0000\u0000"+
-        "\uF2D0\u0000\uE1B1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF6A2\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF3B2\u0000\uF3B1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE1B2\u0000\uE83B\u0000\uE037\u0000\u0000"+
-        "\u0000\u0000\u0000\uECE2\uF8BC\uE7A4\u0000\u0000"+
-        "\uF24A\u0000\u0000\u0000\u0000\u0000\uF763\u0000"+
-        "\u0000\u0000\u0000\u0000\uF8FA\u0000\uE2A4\u0000"+
-        "\uE99D\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF673\u0000\u0000\u0000"+
-        "\uF1AA\u0000\u0000\uF431\uE271\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF836\u0000\u0000\u0000\u0000"+
-        "\uF7E0\u0000\u0000\u0000\u0000\uF166\u0000\u0000"+
-        "\uED7E\uF7A1\u0000\u0000\uF8EF\u0000\u0000\u0000"+
-        "\uF7EB\uF233\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF03C\u0000\u0000\u0000\uE038\u0000\u0000"+
-        "\uF59C\u0000\u0000\u0000\u0000\uE1D6\uF998\u0000"+
-        "\u0000\u0000\uF559\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF764\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF736\u0000\uEA5A\uF456"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE6DA\u0000"+
-        "\uE4D0\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE755\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF076"+
-        "\u0000\uF4DD\u0000\u0000\u0000\uED6A\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF674\u0000"+
-        "\u0000\u0000\u0000\u0000\uF694\u0000\uEAC2\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7FD"+
-        "\u0000\u0000\u0000\uE198\u0000\u0000\uE4BA\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uED3F\u0000"+
-        "\u0000\u0000\u0000\uF7E1\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF336\u0000\u0000\u0000"+
-        "\uE0D3\u0000\u0000\u0000\uEB4C\u0000\uF55A\uE59C"+
-        "\u0000\uF9AA\uF7E2\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF547\uF9C2\uF940\u0000\uF9EC\uE072\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF9BD"+
-        "\u0000\uF077\uEAC3\uE3D2\uE272\u0000\uE4A4\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF9AB\u0000\uEAE0"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF457\u0000\u0000\u0000"+
-        "\u0000\u0000\uEEF0\u0000\uE37E\u0000\u0000\uF4AA"+
-        "\u0000\u0000\u0000\uEA5B\uF648\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEBF5\uF3B3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF6A3\u0000"+
-        "\u0000\uE039\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE2A5\u0000\u0000\uEAC4"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEBB0"+
-        "\u0000\u0000\uF34F\u0000\uF634\u0000\uECB6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF856\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE391\u0000\u0000\uF9ED\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE9C4\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF999\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE4F\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEA3D\u0000\uF84F\u0000"+
-        "\u0000\u0000\u0000\u0000\uEDF1\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF1C4\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE435\u0000\u0000\uF9EE\u0000\u0000"+
-        "\u0000\uF5B6\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEBF6\uEA5C\u0000\u0000\uF96E\u0000"+
-        "\uF167\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE1DD\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE647\uE1B3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF765\uEDD8\u0000\u0000\u0000"+
-        "\uE2EA\u0000\u0000\uE2D0\u0000\uF05C\u0000\u0000"+
-        "\u0000\u0000\uF03E\uF03D\u0000\u0000\uE4F1\u0000"+
-        "\uE4A5\u0000\u0000\u0000\u0000\u0000\u0000\uF6CF"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF234\u0000\u0000\u0000\u0000\uE334\u0000\u0000"+
-        "\uF432\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE392\u0000\u0000\u0000\u0000"+
-        "\uF433\u0000\uF6F8\u0000\u0000\u0000\u0000\uE343"+
-        "\u0000\u0000\uE8A9\u0000\u0000\uE4BB\uE07C\u0000"+
-        "\uF3A6\uE0D5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF6E7\u0000\u0000\uE1DE\u0000\uF6A4\u0000"+
-        "\u0000\u0000\uF750\u0000\u0000\u0000\uE4DD\u0000"+
-        "\uE160\u0000\u0000\u0000\u0000\uE2A6\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF695\u0000\u0000\u0000"+
-        "\u0000\u0000\uEBF7\u0000\u0000\u0000\u0000\u0000"+
-        "\uE4DC\u0000\u0000\uF8A0\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF837\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF0D9\u0000\uE2A7\uF03F\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uED91\u0000\u0000\u0000\uEFB9"+
-        "\uF3D8\u0000\u0000\uE768\u0000\u0000\uEB94\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEE44"+
-        "\uE99E\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF4F1\u0000\u0000\u0000\uECD0\u0000\u0000\uF49D"+
-        "\u0000\uE8C6\uE393\u0000\uE394\u0000\u0000\u0000"+
-        "\uE2DC\u0000\uE4D1\u0000\u0000\uE141\uF6D8\u0000"+
-        "\uE0A8\uF0BC\uED4E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF56C\u0000"+
-        "\u0000\uE952\u0000\u0000\uF337\u0000\u0000\uEE50"+
-        "\u0000\u0000\uE07D\u0000\u0000\u0000\u0000\uEF7B"+
-        "\uEDE8\uE953\u0000\u0000\uF1DE\uE4F2\u0000\u0000"+
-        "\u0000\u0000\uE199\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE264\uEEAB\u0000\u0000\u0000\uE0C3"+
-        "\u0000\uEBB1\u0000\u0000\uF6B2\u0000\u0000\uE4F3"+
-        "\uE4D2\u0000\uF5C0\u0000\u0000\u0000\uEADD\u0000"+
-        "\u0000\uF295\uEEF1\u0000\uF9B4\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF458\u0000\u0000"+
-        "\u0000\uF4D2\u0000\u0000\uF296\u0000\uEC63\u0000"+
-        "\u0000\u0000\u0000\uE161\u0000\uEAEA\u0000\u0000"+
-        "\u0000\uEFBA\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE7D7\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF5CD\u0000\uF3F2\uF857"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE7F8\uE552\u0000\u0000\u0000\u0000\uF675\u0000"+
-        "\u0000\u0000\u0000\uE9C5\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEEF2\uF1DF\u0000\u0000\uE05B\u0000"+
-        "\u0000\uE8FA\u0000\u0000\u0000\uEF45\u0000\uE4A6"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF9B5\u0000"+
-        "\u0000\uF7C9\u0000\uED72\u0000\uF8BD\u0000\u0000"+
-        "\uE6A4\uE255\u0000\u0000\u0000\u0000\uE265\uE676"+
-        "\u0000\u0000\u0000\u0000\uEDBD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEA5D\uF195\u0000\u0000\uF1E0"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF17C\uF8BE\uEAEB\u0000\uEBF8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF7BE"+
-        "\u0000\u0000\u0000\u0000\uE395\uEB3A\uEF72\u0000"+
-        "\u0000\uEC64\uE49F\u0000\uEDA8\u0000\u0000\u0000"+
-        "\u0000\u0000\uE7D3\u0000\u0000\u0000\u0000\uE4DE"+
-        "\u0000\uF548\uF6BC\uE99F\u0000\uEF7C\uED77\u0000"+
-        "\u0000\uECF7\u0000\u0000\u0000\u0000\u0000\uF138"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF893\u0000"+
-        "\u0000\u0000\u0000\u0000\uEDF2\u0000\u0000\uE396"+
-        "\uE43F\uE975\u0000\u0000\u0000\u0000\uE335\uF3B4"+
-        "\uF941\uE19A\u0000\u0000\uE9C6\uF861\u0000\uF6DF"+
-        "\u0000\u0000\uF838\u0000\u0000\u0000\u0000\u0000"+
-        "\uF297\u0000\uEA5E\u0000\u0000\u0000\u0000\uEEF3"+
-        "\u0000\u0000\uF6AC\uF0C4\uF1E1\uEB3B\uE9C7\u0000"+
-        "\u0000\u0000\u0000\uE443\uE44F\u0000\u0000\u0000"+
-        "\uE05C\u0000\u0000\u0000\u0000\uF8BF\u0000\u0000"+
-        "\u0000\u0000\uEDFD\uE9E5\uE75D\u0000\u0000\u0000"+
-        "\u0000\u0000\uF196\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE397\u0000\u0000\uEF7D\uE362"+
-        "\u0000\uE7D8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF676\u0000\u0000"+
-        "\uE8AA\u0000\u0000\u0000\uF6E0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE769\u0000\uF533\u0000\u0000\uF56D\u0000"+
-        "\u0000\u0000\u0000\uF2D1\u0000\u0000\uE7B5\u0000"+
-        "\u0000\uF1AB\u0000\uECB7\u0000\u0000\u0000\u0000"+
-        "\uF24B\uE1B4\u0000\uEB95\uF05D\u0000\u0000\u0000"+
-        "\u0000\uF197\uEF7E\u0000\uE0A9\uF3AF\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE05D\u0000"+
-        "\uF139\u0000\uF47B\u0000\uF9EF\u0000\uF7F3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEE51\u0000\u0000\uF168\u0000\u0000\u0000\uF1AC"+
-        "\u0000\uF05E\u0000\uEF6F\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEA5F\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE436\u0000\u0000\uEEF4\uE3D6\u0000\u0000\uEE52"+
-        "\uECE3\u0000\u0000\u0000\u0000\uED40\u0000\u0000"+
-        "\u0000\uE744\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF635\u0000"+
-        "\u0000\u0000\u0000\u0000\uF4DE\u0000\u0000\u0000"+
-        "\u0000\uE6A5\u0000\u0000\u0000\u0000\uF6E8\u0000"+
-        "\u0000\uEF56\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8E6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9E6\u0000\u0000\u0000\uE9A0\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE76A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE83C\uF040\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uECB8\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE03A\uEBF9\u0000\uF041\u0000\u0000\u0000"+
-        "\u0000\uF47C\u0000\u0000\uF87E\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF265\u0000\u0000\u0000\u0000\uF7F4\u0000"+
-        "\u0000\uE47C\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF8FB\u0000\u0000"+
-        "\u0000\uF9F0\u0000\uEB4D\uE273\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF756\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEA3E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEAC5\u0000\u0000\uEDBE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF1AD\uF87A\u0000\u0000\uE1EE\uF1A6\u0000\uF1AE"+
-        "\uF37D\u0000\uE9A1\u0000\uF1AF\uF99A\u0000\uE77B"+
-        "\u0000\u0000\u0000\uE19B\uE1B5\u0000\u0000\u0000"+
-        "\u0000\uF839\u0000\uEBDD\u0000\u0000\u0000\u0000"+
-        "\uEC65\uF1CF\u0000\u0000\u0000\uE9A2\u0000\u0000"+
-        "\uF7CA\u0000\uF078\u0000\uEDED\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE4EB\u0000\uEFD4"+
-        "\uEBFA\uED5C\u0000\uEBE4\uEF57\u0000\u0000\uE26B"+
-        "\u0000\u0000\u0000\uE965\u0000\uF6B5\uF995\uF395"+
-        "\uE23F\uF3B5\uF2D2\uEF58\uF0F1\u0000\u0000\u0000"+
-        "\u0000\u0000\uE0D4\uEB4E\uECF8\uF079\uF942\u0000"+
-        "\u0000\u0000\u0000\u0000\uEB96\u0000\uE2E0\u0000"+
-        "\uF235\u0000\u0000\uF83A\uEE53\uEBB2\uE03B\u0000"+
-        "\uECE4\uEFBB\u0000\u0000\u0000\u0000\u0000\uEC66"+
-        "\uF4F2\u0000\uF266\uF042\uE398\uF169\uE85B\uE2A8"+
-        "\u0000\u0000\u0000\u0000\uE9A3\u0000\u0000\u0000"+
-        "\uE76B\u0000\uF7CE\uEFD5\uECD1\u0000\u0000\uE44C"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE73C\uF4CC"+
-        "\u0000\uE1FB\uF666\u0000\uEEF5\uEF91\uECF9\uE44B"+
-        "\uF4F3\uECFB\u0000\uEA60\uE240\u0000\uE699\uF3D9"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5C1\uE954\u0000"+
-        "\uF5BB\u0000\uEA61\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE976\u0000\u0000\uEA62\u0000\u0000\uF1E2"+
-        "\uF298\uF05F\uF37E\uECFC\u0000\uE4DF\uE4F4\uEBB3"+
-        "\u0000\uEBB4\u0000\u0000\u0000\u0000\uF563\u0000"+
-        "\u0000\uEAC6\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEFD6\u0000\u0000\u0000"+
-        "\uE8AB\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF636\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uECB9\uF0C5\uF539\uE1B6\uE49B\u0000\uE83D\uE473"+
-        "\uE2D1\u0000\u0000\u0000\u0000\uE0DC\uE19C\u0000"+
-        "\uE2DD\u0000\u0000\uEF39\u0000\uECBB\uECBA\u0000"+
-        "\u0000\uEB6A\u0000\u0000\u0000\uF299\u0000\u0000"+
-        "\u0000\u0000\u0000\uE943\u0000\u0000\u0000\u0000"+
-        "\uE4F5\u0000\uE6A6\u0000\uF645\uE6DB\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEBD5\u0000\u0000\uE57A"+
-        "\u0000\uEAA3\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF9DF\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE399\uF1D4\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE0AA\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uED6B\u0000\uEBFB\uE0A2\u0000\u0000\u0000"+
-        "\u0000\uE4E0\u0000\uED4F\u0000\uF8C0\u0000\uE84E"+
-        "\uED5D\u0000\uE649\u0000\u0000\u0000\uF2C0\u0000"+
-        "\uEBFC\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF649\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEAC7\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uED41\u0000\u0000\u0000\u0000\u0000\u0000\uE977"+
-        "\uE978\u0000\u0000\u0000\uF866\u0000\uE4F6\u0000"+
-        "\u0000\u0000\u0000\uF3DA\u0000\uF894\u0000\u0000";
-
-    private final static String innerIndex2=
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEC9F"+
-        "\u0000\u0000\u0000\u0000\u0000\uE5CF\uE39A\u0000"+
-        "\u0000\uE1DF\u0000\u0000\uF5CB\u0000\uED92\uE0AB"+
-        "\u0000\uE6C4\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uECA0"+
-        "\u0000\uE9DA\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE83E\uE07E\u0000\u0000\u0000"+
-        "\uE5B9\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uECA1\u0000\u0000\uEF73\u0000\u0000\uF4AB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE2A9"+
-        "\u0000\u0000\u0000\uE4F7\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE593\u0000\u0000"+
-        "\uE274\u0000\uEF94\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEDF5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEEAE\u0000\uE64A\u0000\uEAEC\uED50\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEF74\u0000\u0000"+
-        "\u0000\u0000\uE745\u0000\u0000\u0000\uED6C\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF549\uF3B6\u0000"+
-        "\u0000\uEC6E\uEBB5\u0000\u0000\uE1EF\uF3A7\uE275"+
-        "\uE0DD\u0000\u0000\uE7E3\u0000\u0000\uF4AC\u0000"+
-        "\u0000\uE39B\uF13B\uEA63\uF6E9\u0000\u0000\uF7F5"+
-        "\u0000\u0000\u0000\u0000\u0000\uEBDE\uE0EE\u0000"+
-        "\u0000\u0000\uECBC\uF766\u0000\u0000\uE8EE\u0000"+
-        "\u0000\u0000\u0000\u0000\uF9F1\u0000\u0000\u0000"+
-        "\u0000\uF6B6\u0000\u0000\u0000\u0000\uF56E\u0000"+
-        "\u0000\uF47D\u0000\uE8D9\u0000\uF338\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEBFD\u0000\u0000"+
-        "\u0000\u0000\u0000\uEA64\u0000\uEB3C\u0000\u0000"+
-        "\u0000\u0000\u0000\uF1E3\u0000\u0000\uE4E1\u0000"+
-        "\uEAC8\u0000\u0000\u0000\u0000\uE7B6\u0000\uF9AC"+
-        "\uF2D3\u0000\u0000\u0000\uED51\uF77B\u0000\uE8AC"+
-        "\u0000\u0000\u0000\u0000\uF956\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE73D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF64A"+
-        "\u0000\uE8DF\uE4D3\uF757\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE05E\uF751\uE444\u0000\u0000\uE944"+
-        "\uF849\uE05F\u0000\uF943\uF07A\uF07B\uE39C\u0000"+
-        "\u0000\u0000\u0000\u0000\uF1E4\u0000\u0000\uE9E7"+
-        "\u0000\u0000\uEAC9\u0000\u0000\u0000\u0000\uEAED"+
-        "\u0000\u0000\u0000\u0000\u0000\uF24C\u0000\uF2C1"+
-        "\u0000\u0000\uE162\u0000\uE9A4\u0000\u0000\u0000"+
-        "\uEACA\u0000\u0000\u0000\u0000\u0000\uE4F8\uF3A8"+
-        "\u0000\u0000\u0000\uE1B7\u0000\uF2D4\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uED6D\uEAEE\uE0AC"+
-        "\uEFBC\u0000\u0000\u0000\u0000\u0000\uF07C\u0000"+
-        "\u0000\u0000\uEACB\u0000\u0000\u0000\u0000\u0000"+
-        "\uF7BF\uE63F\uE5C6\u0000\u0000\u0000\u0000\u0000"+
-        "\uE2AA\u0000\u0000\uE239\u0000\u0000\uE69A\u0000"+
-        "\u0000\u0000\uF3B7\uF29A\u0000\u0000\u0000\uE7D9"+
-        "\uF4DF\u0000\uF758\uE256\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE5E6\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF576\u0000\u0000\uEE55\uF2D5"+
-        "\u0000\u0000\uE0EF\uF96F\u0000\u0000\u0000\u0000"+
-        "\u0000\uE937\u0000\u0000\uE677\u0000\u0000\u0000"+
-        "\u0000\u0000\uF759\u0000\u0000\u0000\u0000\uECD2"+
-        "\u0000\uECBD\u0000\uE2E1\uF350\uF16A\u0000\uE9D7"+
-        "\uF8F0\u0000\u0000\uF13C\u0000\u0000\u0000\uF339"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF867\uF8C1"+
-        "\u0000\uE450\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEDB0\u0000\u0000\u0000\uF1E5\u0000\u0000"+
-        "\u0000\u0000\uE0AD\u0000\uF7B0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF6A5\u0000\uE0AE\u0000\uE83F\u0000\uE746\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE4A7\uF8B2"+
-        "\u0000\uF9C4\u0000\uF13D\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8A1\u0000\u0000\u0000\uEDE9\uEFEE"+
-        "\u0000\uF4F4\uF795\uF351\uEA3F\uF740\u0000\u0000"+
-        "\uF4E0\uEEAF\u0000\u0000\u0000\u0000\u0000\uE8AD"+
-        "\u0000\uEE45\u0000\u0000\uF7A8\u0000\u0000\uE9D8"+
-        "\uEF69\uF2D6\u0000\u0000\u0000\uE4E2\u0000\uEC6F"+
-        "\u0000\u0000\uF970\uE6C8\uF9AD\u0000\u0000\u0000"+
-        "\uEAEF\uE163\uE4F9\u0000\u0000\u0000\u0000\uE592"+
-        "\uE8C7\uEA65\u0000\u0000\u0000\u0000\uF396\u0000"+
-        "\uE5D0\uEDD9\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF957\uE966\uEC70\u0000\u0000\u0000\uE840\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF4A3\u0000\uE4EC"+
-        "\u0000\uF55B\u0000\u0000\u0000\uF9C5\u0000\u0000"+
-        "\u0000\u0000\u0000\uECFD\u0000\uF7B1\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE39D\uF16B\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF5BC\uF434"+
-        "\uE75E\uE75F\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF5F7\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF671\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE447\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF8EC\u0000\uE9C8"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uED78"+
-        "\u0000\u0000\uE451\u0000\u0000\u0000\uF767\u0000"+
-        "\u0000\u0000\u0000\u0000\uE64B\uEA66\u0000\u0000"+
-        "\uF6BD\uF13E\u0000\u0000\u0000\uE371\u0000\uEB97"+
-        "\uF043\u0000\uE266\u0000\u0000\u0000\u0000\uE135"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF198\uEC71\uECBE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF958\u0000\u0000"+
-        "\uE1F0\u0000\uF7F6\u0000\u0000\uEAF0\u0000\u0000"+
-        "\u0000\uEDBF\u0000\u0000\u0000\uE24F\u0000\u0000"+
-        "\u0000\u0000\uF971\uF1B0\uF9D1\uF64B\u0000\u0000"+
-        "\uF7CF\uF0DA\uE051\u0000\uE448\uE1F1\u0000\uECD3"+
-        "\uF9E6\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE7D\u0000\u0000"+
-        "\u0000\uECFA\u0000\u0000\uF33A\uF7D0\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF972\u0000\uF737\u0000"+
-        "\u0000\u0000\uEBE5\uF29B\u0000\u0000\u0000\uEEF6"+
-        "\uF07D\u0000\u0000\uF944\uF5C2\u0000\u0000\uE6DC"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF397\u0000\uE9E8\uE4ED\uF5FC\u0000\uE84F\u0000"+
-        "\uE19D\u0000\u0000\u0000\uE4FA\uF534\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF2D7\u0000\uE553"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF8E3\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8ED\u0000\uEB3D\u0000\u0000\uF07E"+
-        "\uF8B3\uED52\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF677\uE46D\u0000\uEACC\u0000\u0000\uF959\u0000"+
-        "\u0000\uEDA9\uEB98\uF643\u0000\u0000\u0000\u0000"+
-        "\u0000\uEBFE\u0000\u0000\u0000\u0000\uE0F0\u0000"+
-        "\uF091\uF092\u0000\u0000\u0000\uE850\uF744\uF0F2"+
-        "\u0000\u0000\u0000\u0000\u0000\uED53\u0000\u0000"+
-        "\u0000\u0000\uEFD7\uED93\u0000\u0000\u0000\uE091"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE267"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF95A\u0000\u0000\u0000\uF4E1\u0000\u0000\uE0C4"+
-        "\u0000\u0000\u0000\u0000\uECE5\u0000\uE0C5\uF044"+
-        "\u0000\u0000\uEFBD\u0000\uE6C9\u0000\u0000\uF0DB"+
-        "\uF1B1\u0000\uE153\uF6BE\uF95B\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF796\u0000\uE7B7\u0000\u0000"+
-        "\uF4D3\uF4D4\u0000\u0000\u0000\uF6E4\u0000\uF6D1"+
-        "\u0000\u0000\uE747\uE241\uE052\u0000\u0000\uF8B4"+
-        "\uE0C6\u0000\u0000\uF398\u0000\u0000\uE5E7\u0000"+
-        "\uF060\u0000\u0000\u0000\u0000\u0000\uE164\uE0AF"+
-        "\u0000\u0000\u0000\u0000\u0000\uF53A\uEFAF\u0000"+
-        "\u0000\uF5C3\uEFD8\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9E9\u0000\u0000\u0000\uF3F3\u0000"+
-        "\uE5FB\uEA4B\u0000\u0000\uF59D\u0000\u0000\u0000"+
-        "\uF9F3\uF9F2\uF6A6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE9C9\u0000\u0000\uE563"+
-        "\u0000\uE138\u0000\uE851\uE165\u0000\uE7E4\u0000"+
-        "\u0000\u0000\uF85A\u0000\u0000\u0000\uEDE3\u0000"+
-        "\u0000\u0000\uE4BC\u0000\u0000\u0000\uE092\u0000"+
-        "\u0000\u0000\u0000\uE354\u0000\u0000\u0000\uE060"+
-        "\uF83B\uF0EB\uEEF8\uE7E5\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE3D7\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF4A4\u0000\u0000\u0000\uE59D\uF973"+
-        "\uF868\u0000\uF4D5\u0000\uE2AB\u0000\u0000\uF0F3"+
-        "\uE5FC\u0000\u0000\u0000\u0000\u0000\u0000\uE4D4"+
-        "\uE1FC\u0000\uE7E6\u0000\uEC9B\uEC31\uF0D4\u0000"+
-        "\uEB99\uED42\uE19E\u0000\u0000\u0000\uF8E4\u0000"+
-        "\u0000\u0000\uF53B\u0000\u0000\u0000\u0000\uE34D"+
-        "\u0000\uE093\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF2B8\u0000\u0000\u0000\uE6C0\u0000"+
-        "\uF29C\uF9F4\u0000\u0000\uE4E3\u0000\uF8C2\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE5E8\uE8AE"+
-        "\uEBB6\uF747\u0000\u0000\u0000\u0000\u0000\uEB4F"+
-        "\uF8C3\uE9EA\u0000\uEC32\u0000\uF236\u0000\u0000"+
-        "\u0000\u0000\u0000\uF678\u0000\u0000\u0000\u0000"+
-        "\uF697\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE9CA\u0000"+
-        "\u0000\uE372\u0000\u0000\u0000\u0000\uE9A6\u0000"+
-        "\u0000\uE9EB\u0000\u0000\uED9B\u0000\u0000\uECAF"+
-        "\uE39E\u0000\u0000\u0000\uF59E\u0000\u0000\u0000"+
-        "\u0000\uE14C\uF6EA\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEDE4\uEAF1\u0000\u0000\uF6E1\u0000\uF7F7"+
-        "\uF2B9\u0000\u0000\uF768\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7A9\u0000\u0000\u0000\u0000"+
-        "\u0000\uF769\u0000\u0000\u0000\uF24D\u0000\u0000"+
-        "\u0000\uE756\u0000\u0000\uED73\uF5CE\u0000\u0000"+
-        "\u0000\u0000\uE9D9\u0000\u0000\u0000\u0000\uE7E7"+
-        "\uE449\uE5C3\u0000\u0000\uE875\uE860\u0000\uE3D9"+
-        "\uE268\u0000\uE0DE\uF53C\uE89D\u0000\uF679\uEF95"+
-        "\uE2AC\uF392\u0000\uF59F\uE8C8\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE250\uECD4\uE3CF\uF3F5"+
-        "\u0000\uE1F2\u0000\uE2EB\u0000\u0000\u0000\uE1B8"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uECA6\uE3DA"+
-        "\u0000\uF435\u0000\u0000\u0000\u0000\u0000\uF436"+
-        "\u0000\uED5E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE4FB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF3A9\u0000\u0000\u0000\uF459"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF2D8\uEE59\u0000\uE748\uF895\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF4B5\u0000\u0000\uF734\u0000\u0000\uE3F3"+
-        "\uEE58\u0000\u0000\u0000\u0000\uF76A\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE979"+
-        "\uEA67\u0000\u0000\u0000\u0000\u0000\uE0DF\u0000"+
-        "\u0000\u0000\uE2EC\u0000\u0000\u0000\u0000\uF56F"+
-        "\u0000\u0000\uE3F4\uE44A\u0000\u0000\u0000\uEAF2"+
-        "\u0000\u0000\u0000\uEBB7\u0000\u0000\u0000\u0000"+
-        "\uEC33\uE4FC\u0000\u0000\uF1E6\u0000\u0000\u0000"+
-        "\u0000\u0000\uE8C9\u0000\u0000\u0000\uED9C\u0000"+
-        "\uE2DE\u0000\u0000\uE260\u0000\u0000\u0000\u0000"+
-        "\uE5D3\uF4F5\uF6AE\u0000\u0000\uF2C8\u0000\uE1F3"+
-        "\uF5CF\uEDF3\uF352\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE061\u0000\u0000\u0000\uF093\u0000\uE336\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7DA"+
-        "\uF33B\u0000\u0000\u0000\u0000\u0000\uF0E7\u0000"+
-        "\u0000\u0000\uEDC0\uF945\u0000\u0000\u0000\u0000"+
-        "\u0000\uED54\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE139\uF9C6\u0000"+
-        "\u0000\u0000\u0000\u0000\uF045\u0000\uEDAA\uEABA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEBDF\u0000\uE861"+
-        "\u0000\u0000\u0000\u0000\uEBB8\u0000\uEF96\uE4FD"+
-        "\u0000\u0000\u0000\u0000\uEC34\u0000\u0000\u0000"+
-        "\u0000\u0000\uF45A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE876\uF6B3\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF9CD\u0000\u0000\u0000\uF4B6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF267\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF5C4\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE734\u0000\u0000\u0000\u0000\u0000\uF437"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE7B8\uE7B9\uF2C9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE65E\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF6CB\uEAAE\uEF97\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE445\u0000\u0000\u0000\uE4D5\u0000"+
-        "\u0000\u0000\u0000\u0000\uF55C\uE89E\u0000\u0000"+
-        "\u0000\u0000\u0000\uE7E8\u0000\uF6EB\uF5C9\u0000"+
-        "\uF4BC\u0000\uE862\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE4B5\u0000\u0000\u0000\u0000"+
-        "\u0000\uEF46\u0000\u0000\uE65F\uF54A\u0000\uF6C9"+
-        "\u0000\u0000\uE13A\u0000\u0000\uF353\uE166\u0000"+
-        "\u0000\u0000\uE363\u0000\uE4BD\u0000\u0000\u0000"+
-        "\uE8FB\u0000\uE0E0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE4E4\uF699\u0000\u0000\uE5BA\uF4CD\uE0E1"+
-        "\u0000\u0000\u0000\u0000\uF0F4\u0000\u0000\u0000"+
-        "\u0000\u0000\uF53D\u0000\uF93A\u0000\u0000\u0000"+
-        "\u0000\u0000\uF6EC\u0000\u0000\u0000\uEF98\u0000"+
-        "\uE877\u0000\u0000\u0000\uF6CC\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEDC1\u0000\u0000\u0000\u0000\uEB7E\u0000\u0000"+
-        "\u0000\u0000\u0000\uE5FD\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE276\uF93B\uE5BB\u0000\u0000\uF438"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEC35\uE1B9"+
-        "\uF094\uE0C7\u0000\uE1F4\u0000\u0000\uE8AF\uF2D9"+
-        "\u0000\u0000\u0000\u0000\u0000\uE1BA\u0000\u0000"+
-        "\uF99B\u0000\u0000\u0000\u0000\uEAF3\uE277\uE852"+
-        "\u0000\uE2AD\u0000\u0000\u0000\u0000\uEEF9\uF738"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF4E2\u0000"+
-        "\u0000\u0000\uE094\uEAA4\u0000\u0000\uE554\u0000"+
-        "\u0000\u0000\u0000\u0000\uE167\uEDC2\u0000\u0000"+
-        "\u0000\u0000\uE1BB\u0000\uF2DA\uF268\u0000\uE9A7"+
-        "\uEC36\u0000\u0000\u0000\u0000\u0000\uEB50\u0000"+
-        "\u0000\u0000\uE640\uF75A\u0000\uF99C\u0000\uE7FE"+
-        "\u0000\u0000\u0000\u0000\uEA40\u0000\u0000\u0000"+
-        "\uE9EC\uE878\u0000\u0000\u0000\u0000\u0000\uE570"+
-        "\u0000\uE69B\u0000\uE1D7\uEA68\u0000\u0000\uF49A"+
-        "\u0000\uED66\u0000\u0000\uE355\uF53E\u0000\uE9A8"+
-        "\u0000\u0000\u0000\uF1C5\uF4D6\u0000\u0000\uEA69"+
-        "\uECE6\u0000\u0000\u0000\u0000\u0000\u0000\uE4A8"+
-        "\u0000\uE8B0\u0000\u0000\uEDDA\uECBF\u0000\u0000"+
-        "\u0000\uE8B1\u0000\u0000\u0000\uE5E9\u0000\u0000"+
-        "\u0000\u0000\u0000\uEB51\uF2DB\u0000\u0000\uF379"+
-        "\u0000\u0000\uE6B2\u0000\u0000\u0000\u0000\uE39F"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE7E9\u0000\u0000\uE3A0\u0000\uF17D\uE4A9\u0000"+
-        "\uF439\uF354\u0000\u0000\uEC72\uEFEF\u0000\u0000"+
-        "\u0000\uF7D1\u0000\u0000\uEFD9\u0000\u0000\u0000"+
-        "\u0000\u0000\uEF6A\uE853\uE854\uE555\u0000\uEEFA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE1E0\uECB0"+
-        "\u0000\uE8B2\uF8C4\u0000\uF4E3\u0000\uE7A5\uF8E7"+
-        "\uE9CB\uE364\u0000\uEE46\uEB3E\uF9DA\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE945\uEB9A"+
-        "\uEEB1\u0000\u0000\u0000\u0000\uF5F0\u0000\uE76C"+
-        "\uF1C6\u0000\u0000\u0000\u0000\uEBB9\u0000\uECC0"+
-        "\uF7C0\uEFF0\u0000\u0000\uE7DB\u0000\uF4E4\u0000"+
-        "\u0000\u0000\uE946\uED79\u0000\u0000\u0000\u0000"+
-        "\u0000\uF355\uECC1\uF95C\uF95D\u0000\u0000\u0000"+
-        "\u0000\uF45B\u0000\uF45C\u0000\u0000\u0000\uED5F"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF3DB\u0000\uF869\u0000\uF3B8\uF9F5\uEB9B"+
-        "\u0000\u0000\u0000\u0000\uEEFB\uF947\uF974\uF8C5"+
-        "\uECE7\uE749\u0000\uF69A\u0000\u0000\uE955\uE168"+
-        "\u0000\u0000\u0000\uEB3F\uF577\u0000\uF2DC\uE2FC"+
-        "\uF2DD\u0000\uF43A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF9BE\u0000\u0000\uE03C"+
-        "\uF9BB\uF9C7\u0000\u0000\u0000\u0000\uEEB2\u0000"+
-        "\uF061\uEAF4\u0000\u0000\u0000\u0000\uE3EC\uED6E"+
-        "\uEDC3\u0000\u0000\u0000\u0000\uE7A6\u0000\u0000"+
-        "\uE1BC\u0000\uF4E5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF1D5\u0000\u0000\uE7BA\u0000"+
-        "\u0000\u0000\uF1E7\uF8B5\uF77C\u0000\u0000\u0000"+
-        "\u0000\uEB77\u0000\uE169\u0000\u0000\uE556\u0000"+
-        "\u0000\u0000\u0000\u0000\uEEA5\u0000\uE5F5\uE4BE"+
-        "\u0000\uF99D\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uED94\u0000"+
-        "\u0000\uEAF5\u0000\u0000\uEF9A\uF77D\u0000\u0000"+
-        "\uE257\u0000\u0000\u0000\u0000\u0000\uF9F6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEF68\u0000\uE1D8\uEED6\uE16A\u0000\u0000\uE073"+
-        "\uEAF6\uF357\uF356\u0000\uE74A\u0000\uF3F4\uF592"+
-        "\uF5CC\u0000\u0000\uF975\u0000\u0000\u0000\u0000"+
-        "\uF055\uF095\u0000\uE9DB\u0000\uE967\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEA9F\uF49B\u0000\uE5C7"+
-        "\u0000\u0000\u0000\uE760\u0000\uF358\uE3A1\uE3A2"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE7D4\uE678"+
-        "\uE7CA\u0000\uE841\uE757\uE972\uF4CE\uF5F4\u0000"+
-        "\u0000\uF3B9\u0000\u0000\uE863\u0000\uF67A\u0000"+
-        "\u0000\u0000\uE2F5\u0000\u0000\uF9AE\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE062\u0000"+
-        "\u0000\uEAB4\u0000\u0000\u0000\u0000\uE6DD\uF84A"+
-        "\uF237\uF5BD\u0000\uF797\u0000\u0000\uF1E8\u0000"+
-        "\u0000\u0000\u0000\u0000\uE571\u0000\uE3A3\uEBD6"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF7F8\u0000\uE8CA"+
-        "\uE0F9\uE564\u0000\uE7DC\u0000\uF24E\u0000\uF6ED"+
-        "\u0000\u0000\u0000\uE47E\u0000\u0000\uEBE6\uF6F9"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE9ED"+
-        "\u0000\uEF6B\u0000\uE8B3\u0000\u0000\u0000\uE3F7"+
-        "\uEB40\u0000\u0000\uE572\u0000\uF667\u0000\uE6F9"+
-        "\u0000\u0000\uE76D\u0000\uE1FD\uF43B\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE1BD"+
-        "\uF752\u0000\u0000\uF43C\u0000\u0000\uE03D\uE03E"+
-        "\uE2AE\u0000\u0000\u0000\u0000\u0000\uECC2\u0000"+
-        "\u0000\u0000\u0000\u0000\uE947\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE8DA"+
-        "\uE7BB\uE095\uF663\uEE9A\uF097\u0000\u0000\u0000"+
-        "\u0000\u0000\uF098\u0000\u0000\uF69B\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE2AF\u0000\u0000\uE063\u0000\u0000\uE03F"+
-        "\uE440\uF3BA\u0000\uE6B3\uECC3\uF4FD\uEA6A\u0000"+
-        "\u0000\u0000\u0000\uEA6B\u0000\u0000\uF2DE\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEC73\uF29D\u0000\u0000\uEAF7\uE6CA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE278\uE8DB\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3BB\u0000\u0000\u0000\u0000\uEFF1"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF847\uE356\u0000\u0000\uE13B\uF238\u0000\u0000"+
-        "\uE0FA\uF7F9\uE19F\uE4FE\u0000\u0000\u0000\u0000"+
-        "\uED60\u0000\u0000\u0000\u0000\u0000\uF47E\u0000"+
-        "\uE565\uEACD\u0000\uF948\uE3D0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF45D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF6D2\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE064"+
-        "\u0000\uE5D9\u0000\u0000\u0000\uE76E\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE1D9"+
-        "\u0000\u0000\u0000\uF239\uF64C\u0000\u0000\uE16B"+
-        "\u0000\u0000\u0000\u0000\u0000\uF359\u0000\uF99E"+
-        "\u0000\uEF59\uF5A0\u0000\u0000\u0000\u0000\uEEFC"+
-        "\uE6DE\u0000\u0000\u0000\u0000\uEA6C\u0000\uF33C"+
-        "\uE1A0\uE1E1\u0000\uEBBA\u0000\uE8EF\uE842\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE3A5\uE948\u0000\u0000"+
-        "\u0000\uE798\u0000\uE3A4\u0000\uE1E2\u0000\u0000"+
-        "\u0000\u0000\uE97A\u0000\u0000\uF399\u0000\uF35A"+
-        "\uE34E\u0000\uE9DC\u0000\u0000\u0000\u0000\uE566"+
-        "\uE4D6\u0000\u0000\u0000\u0000\u0000\u0000\uF1D0"+
-        "\uE1A1\u0000\u0000\u0000\u0000\u0000\uEAB5\u0000"+
-        "\u0000\u0000\uEAF8\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE531\uE242\u0000\u0000\u0000\u0000\u0000"+
-        "\uEF5A\u0000\u0000\u0000\u0000\uF0F5\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uECD5\uF5D0\u0000"+
-        "\u0000\u0000\uF5A1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7A7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEDAB\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE5B\u0000\uF5F1"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEDC5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7A3\uEB6B\uF67B\u0000\uE0F1"+
-        "\u0000\uE7EA\uF5A2\u0000\u0000\u0000\uE6D1\u0000"+
-        "\uE3F8\uF09A\uF09B\uE843\u0000\u0000\u0000\u0000"+
-        "\uF2DF\u0000\u0000\uF3EF\u0000\uEDF6\uF24F\uEC74"+
-        "\u0000\u0000\u0000\u0000\u0000\uE34F\u0000\uF83C"+
-        "\uF5D1\uEEB3\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEFBE\u0000\u0000"+
-        "\u0000\u0000\u0000\uF45E\uE8B4\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF95E\u0000\uE9EE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEEB4\u0000"+
-        "\u0000\u0000\u0000\u0000\uE6B4\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF6B4\u0000\u0000\u0000\u0000"+
-        "\u0000\uE1BE\u0000\uE879\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE2B0\uF6D9\uF4E6\u0000\u0000"+
-        "\uE269\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE23A\u0000\uE0C8\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE337\u0000\uF35B\u0000\uE357"+
-        "\u0000\u0000\uED55\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE8E0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE5DA\u0000\uE6A7\u0000\u0000\u0000\uF250"+
-        "\u0000\uF798\u0000\u0000\u0000\u0000\uF5D2\uF1E9"+
-        "\u0000\uE7BC\u0000\uEDC6\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5A3\u0000\u0000"+
-        "\uE864\uEC37\uF8FC\u0000\u0000\uF3DC\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE096\u0000\u0000\u0000"+
-        "\uEF9C\u0000\u0000\uE279\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEFF8\uEC75\u0000\u0000\u0000\u0000"+
-        "\uE349\uE594\u0000\u0000\u0000\u0000\u0000\uE3A6"+
-        "\u0000\uEACE\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF996\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE4AA\u0000\u0000\u0000\uE13C\u0000\u0000\u0000"+
-        "\u0000\uF2E0\u0000\u0000\u0000\uEDE5\uE365\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE8FC"+
-        "\u0000\u0000\u0000\u0000\uF976\u0000\u0000\u0000"+
-        "\u0000\u0000\uE0FE\uF1EA\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEA41\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7E3\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE532\uE2F6\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE660\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5EA\uF3EE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF85B\u0000"+
-        "\u0000\u0000\u0000\uEDA1\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE5B1\u0000\u0000\u0000"+
-        "\u0000\u0000\uE2ED\u0000\uF1EB\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5B2\u0000\u0000\u0000\uE5BC\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF9E2\uF4AD\u0000\uF9DB\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEFB0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE3A7\u0000\u0000\uF9E3\uE243\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF9E4\uF85E"+
-        "\u0000\u0000\u0000\u0000\uE040\u0000\uF6A7\u0000"+
-        "\uE2B1\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEE32"+
-        "\u0000\uF946\uF43D\uF2E1\uF4AE\uE956\uE7EB\u0000"+
-        "\u0000\u0000\uEF70\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEBA8\u0000\u0000\u0000\u0000\uE5F6"+
-        "\uE2FD\u0000\u0000\uEA6D\u0000\u0000\u0000\uE7D1"+
-        "\u0000\u0000\u0000\uED7A\uF45F\u0000\uF6BF\u0000"+
-        "\u0000\uEC76\uEC38\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uECD6\u0000"+
-        "\uF1D1\u0000\u0000\u0000\u0000\u0000\uEFF9\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE641\uEA42"+
-        "\u0000\u0000\uEB78\u0000\u0000\uE4AB\u0000\uF0DC"+
-        "\u0000\u0000\uEAAF\u0000\uE053\u0000\u0000\uF29E"+
-        "\u0000\uF9C3\u0000\u0000\u0000\uF0F6\uE2B2\u0000"+
-        "\u0000\u0000\u0000\uE7EC\u0000\uE7BD\u0000\uE76F"+
-        "\u0000\u0000\uE548\uF0BE\uE9EF\u0000\uE9F0\uE9F1"+
-        "\uE9F2\u0000\u0000\uE7BE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8C6\uE2B3\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF29F\u0000\u0000\u0000\u0000\u0000\u0000\uED3B"+
-        "\u0000\uE855\u0000\uE77C\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE3A8\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEC39\u0000\u0000\uEA4C"+
-        "\uEEB5\u0000\u0000\u0000\u0000\u0000\uE8F0\u0000"+
-        "\uF2E2\uF3F0\uE2B4\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE8F1\u0000"+
-        "\uEB41\u0000\u0000\u0000\u0000\uEAA5\u0000\uF7D2"+
-        "\u0000\u0000\uEEFD\u0000\u0000\uEE33\uF8F1\uE0B0"+
-        "\uF43E\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE1E7\u0000\uEF6C\u0000\u0000\uEED7\u0000\u0000"+
-        "\uF6C0\u0000\uE373\u0000\u0000\u0000\uE831\u0000"+
-        "\u0000\u0000\uE14D\u0000\u0000\uE3A9\uE9CC\u0000"+
-        "\u0000\uECFE\uE3AA\uEF3A\u0000\uF046\uF7FA\uEE5C"+
-        "\uF668\u0000\u0000\u0000\uE557\u0000\u0000\u0000"+
-        "\uE7CB\u0000\uE7D2\uE4CB\uE799\uE839\uF5F8\u0000"+
-        "\u0000\uEA6E\uF43F\uF739\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE758\u0000\u0000\uF251\u0000"+
-        "\u0000\u0000\u0000\uF7C1\u0000\u0000\u0000\u0000"+
-        "\uE9F3\uF09C\u0000\uF64D\uEBBB\uE1BF\uF564\uEE5D"+
-        "\u0000\uF95F\uF8A2\u0000\uEB6C\u0000\u0000\u0000"+
-        "\u0000\uF54B\uE865\u0000\uF7B2\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8F2\u0000\uE8F6\u0000\uEA6F"+
-        "\u0000\u0000\u0000\uE8F2\u0000\u0000\u0000\u0000"+
-        "\u0000\uF76C\uF6EE\uF0E8\u0000\uE49C\u0000\u0000"+
-        "\uF3BC\u0000\u0000\uF86A\u0000\u0000\uE87A\uE856"+
-        "\uF6C1\u0000\u0000\uEEB6\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
-
-    private final static String innerIndex3=
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEDC7\uE63C\u0000\u0000\u0000"+
-        "\u0000\uE957\u0000\u0000\u0000\u0000\u0000\uEBA9"+
-        "\u0000\uEC3A\u0000\uE5A6\u0000\u0000\uE567\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF460\u0000\uF09D"+
-        "\u0000\uEB6D\uF8F3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3BD\u0000\u0000\uEC77\uF9D7\u0000"+
-        "\uE258\uF047\u0000\uF950\u0000\uF9E7\uF6EF\u0000"+
-        "\u0000\uE6B5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF2BA\uF3DD\u0000\uEA43\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEF5B\u0000\u0000\uF76D\u0000"+
-        "\u0000\uF8C7\uE5C8\u0000\uE6DF\u0000\uE9A9\u0000"+
-        "\u0000\u0000\u0000\u0000\uEFB1\u0000\u0000\uF83D"+
-        "\uF669\uF896\u0000\u0000\u0000\u0000\u0000\uF73A"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE7E\u0000\uE16C"+
-        "\uEBBC\uEB91\u0000\u0000\uEFBF\uF99F\uEE5E\u0000"+
-        "\u0000\uEBD7\u0000\uEE5F\u0000\uF593\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uED95"+
-        "\u0000\u0000\uED9D\u0000\u0000\uF7E4\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF2E3\u0000\u0000\uE2EE\uF64E\uEB42\uF9A0\uE3AB"+
-        "\u0000\u0000\u0000\uE6FA\u0000\u0000\u0000\uF8C8"+
-        "\u0000\uEC67\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE533\uF39A\uE6A8\u0000\u0000\u0000\uEBE7\u0000"+
-        "\u0000\uE4BF\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF2E4\u0000\uE6C5\uF0E2\u0000\u0000\uF977\u0000"+
-        "\u0000\uED32\u0000\uEC78\u0000\uEE60\u0000\uF8E8"+
-        "\uF578\uEDF4\uF54C\uF565\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEAB6"+
-        "\u0000\uF949\uF252\uE097\u0000\u0000\u0000\uF2E5"+
-        "\uE0E2\uE534\u0000\uEA70\uE89F\uED56\uEF4E\u0000"+
-        "\u0000\u0000\u0000\uEB6E\uF644\uF062\u0000\uF7FB"+
-        "\u0000\u0000\uEB52\u0000\uE074\u0000\uEEB7\u0000"+
-        "\uF09F\u0000\uE7DD\u0000\uE844\uF23A\uF8E9\u0000"+
-        "\u0000\u0000\u0000\uE8CB\uE845\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3BE\u0000\u0000\uE4AC\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF8C9\u0000"+
-        "\uEACF\u0000\u0000\uE4C0\uECD7\u0000\uF2E6\uF960"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEFC0"+
-        "\u0000\u0000\u0000\uF5D3\u0000\u0000\uF16C\uF6B7"+
-        "\u0000\u0000\uF048\uE3F9\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE958\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF049\u0000\u0000\u0000\u0000\u0000\uF3DE\u0000"+
-        "\u0000\u0000\u0000\u0000\uE6B6\uE2B5\u0000\uE7A8"+
-        "\u0000\u0000\uF17E\u0000\u0000\uE9AA\u0000\u0000"+
-        "\u0000\u0000\uE1A2\uEF3E\u0000\u0000\u0000\uEBBD"+
-        "\u0000\uF461\u0000\u0000\u0000\u0000\uEFC1\u0000"+
-        "\u0000\u0000\uE49E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE8B5\u0000\uF4E7\uE7A0\u0000\u0000"+
-        "\u0000\uF961\u0000\uF1B2\uF53F\u0000\uF8A3\u0000"+
-        "\u0000\uF951\u0000\uF23B\uE535\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF594"+
-        "\u0000\u0000\u0000\u0000\uF269\u0000\u0000\u0000"+
-        "\uF8CA\u0000\u0000\u0000\u0000\u0000\uE1E3\uE74B"+
-        "\u0000\uEDDB\uF799\u0000\u0000\u0000\uF664\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE6A9"+
-        "\u0000\uE0C9\u0000\u0000\uEE61\uF35C\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE73E\u0000\uF7D3\uE5FE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE74C\uF440\u0000\u0000\u0000"+
-        "\u0000\uEC3B\uF4E8\u0000\u0000\u0000\u0000\u0000"+
-        "\uF2C2\u0000\u0000\u0000\u0000\u0000\u0000\uF1EC"+
-        "\u0000\uEEB8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE8A0\u0000\u0000\uE14E\u0000\u0000\uF49E"+
-        "\uE87B\u0000\uEC68\uF1D6\u0000\u0000\uE661\uEB43"+
-        "\u0000\u0000\uF962\u0000\uF0C8\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE4C1\uF35D\u0000"+
-        "\uE2F7\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF1D2\u0000\uE568\uE959\uE6F1\u0000"+
-        "\u0000\uEABB\u0000\u0000\uF4A5\u0000\u0000\u0000"+
-        "\uF55D\u0000\u0000\u0000\u0000\uF3BF\uF741\u0000"+
-        "\uEFFA\u0000\u0000\u0000\uF8CB\u0000\u0000\uE065"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7D4\uF6CA\u0000\u0000\uE658"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF978\uF4BD"+
-        "\u0000\uF2A0\u0000\uEEFE\u0000\u0000\u0000\u0000"+
-        "\u0000\uE4C2\u0000\u0000\u0000\u0000\uE4B6\u0000"+
-        "\uE13D\uF69C\uE642\uE468\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEED8\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uECA5\u0000\u0000"+
-        "\u0000\u0000\uEEB9\u0000\u0000\u0000\u0000\uF33D"+
-        "\uF8CC\uF0A1\u0000\u0000\uE536\u0000\u0000\u0000"+
-        "\u0000\uF8CD\u0000\uE5BD\uF3DF\u0000\u0000\uF69D"+
-        "\u0000\uEA44\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE5EB\u0000"+
-        "\u0000\uEDC8\u0000\u0000\u0000\uF8A4\uE549\u0000"+
-        "\u0000\uEA71\u0000\uED33\u0000\u0000\u0000\uE6B7"+
-        "\u0000\uF77E\u0000\u0000\u0000\uEA45\u0000\u0000"+
-        "\uE662\u0000\uF7D5\uEEBA\uF0D5\uE5F7\uF2E7\uEBBE"+
-        "\u0000\u0000\u0000\uF83E\u0000\u0000\u0000\uE679"+
-        "\uE67E\u0000\u0000\u0000\u0000\u0000\u0000\uEEBB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF15B"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE5B3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE244\u0000\u0000\u0000"+
-        "\uF8A5\uEBEE\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF6A8\u0000\u0000\u0000\u0000\uF8CE\u0000\u0000"+
-        "\u0000\u0000\u0000\uE74D\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8FD\u0000\u0000\u0000\u0000"+
-        "\uF979\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE2B6\u0000\u0000\u0000\uF1C7\uF23C\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE16D\u0000\u0000"+
-        "\u0000\u0000\uF637\u0000\u0000\u0000\uEE9C\u0000"+
-        "\u0000\u0000\uF5A4\u0000\u0000\u0000\u0000\u0000"+
-        "\uF9DC\uF1B3\uE259\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF2E8\u0000\u0000\uEBBF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF86B\uE0E3\uF6A9\u0000\uF8A6"+
-        "\u0000\u0000\u0000\uE949\u0000\u0000\u0000\uF3C0"+
-        "\uF1C8\uF2C3\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE63D\u0000\u0000\uF9CE\u0000\u0000\u0000\uEF31"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF8F4\uE5A7\u0000\u0000\u0000\uF3F6\u0000\uEE63"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE16E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF742\u0000\u0000\u0000\uE97B\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF9B6\u0000\u0000\u0000"+
-        "\u0000\uEDEA\u0000\u0000\uF3E0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE8CC\uE9CD\u0000\u0000\u0000\uE558\u0000"+
-        "\u0000\uE7ED\u0000\u0000\u0000\u0000\uF5A5\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEE9D\u0000\u0000\u0000\u0000\u0000\uEE64\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF9C8"+
-        "\u0000\uE631\uF9BF\u0000\uF963\u0000\uF2A1\u0000"+
-        "\uEEBC\u0000\u0000\u0000\u0000\u0000\uE3EE\u0000"+
-        "\u0000\uEE65\u0000\u0000\uEFF2\u0000\uEAB0\u0000"+
-        "\u0000\u0000\u0000\u0000\uE770\uF94A\uF9AF\uF35E"+
-        "\u0000\uE8E1\u0000\u0000\uEDC9\u0000\uF1B4\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEB53\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uECD8\u0000\u0000\u0000"+
-        "\u0000\uEFFB\uF038\u0000\u0000\u0000\u0000\uF9B7"+
-        "\u0000\u0000\uF8A7\u0000\uEFC2\u0000\u0000\u0000"+
-        "\u0000\uF9F7\u0000\u0000\u0000\u0000\u0000\uEC69"+
-        "\u0000\u0000\uE97C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEF32\u0000\u0000\u0000"+
-        "\u0000\uEE92\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF9F8\uF9F9\u0000\u0000\u0000\uF64F\u0000"+
-        "\u0000\uEEA7\u0000\uEE67\u0000\u0000\u0000\u0000"+
-        "\uE595\uE559\u0000\u0000\u0000\u0000\uE69C\u0000"+
-        "\uE6F2\u0000\uEBC0\u0000\uE8E2\uEE68\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEEBD"+
-        "\u0000\u0000\u0000\u0000\u0000\uF35F\uF4BE\uEC3C"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5B7\uEB92\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF9B8\uECE8\u0000\uE537\uEF9E"+
-        "\uF862\u0000\u0000\u0000\u0000\u0000\uF791\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE663\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE5B4\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF360\u0000\uF6F0\uF243\u0000\u0000"+
-        "\uF04A\u0000\uF063\u0000\u0000\uF1C9\uE9AB\u0000"+
-        "\u0000\u0000\uEDAC\uF9A1\u0000\uEAD0\uF143\u0000"+
-        "\uEAD1\u0000\u0000\u0000\u0000\u0000\uF1ED\uF748"+
-        "\uF6FA\u0000\u0000\u0000\uF73B\u0000\u0000\u0000"+
-        "\u0000\u0000\uF570\u0000\u0000\u0000\u0000\u0000"+
-        "\uE54A\uED43\u0000\uEFDA\u0000\uEA46\u0000\uE7BF"+
-        "\u0000\uE7C0\uE691\u0000\u0000\u0000\u0000\uE7CC"+
-        "\u0000\uE83A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEAE5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF6E5\u0000\u0000\u0000\uE142\u0000\u0000"+
-        "\uEAF9\uE6E0\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE54B\u0000\u0000\u0000\u0000\uF9FA"+
-        "\u0000\u0000\u0000\u0000\uE143\u0000\u0000\uE8F3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEAD2\u0000\uE25A\u0000\uF26A\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uED74\u0000"+
-        "\uF8CF\u0000\u0000\u0000\u0000\u0000\u0000\uE2B7"+
-        "\u0000\uF253\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE27A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEC3D\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE6E1\uF897\u0000\u0000\uE5C9\uF73C\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEED9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF4E9\u0000"+
-        "\u0000\u0000\u0000\uE77D\uECC4\uF393\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEF75\u0000\u0000"+
-        "\u0000\uEB9C\uF254\uE7DE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF0A2\uF0A3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF952\uF04B"+
-        "\u0000\u0000\u0000\u0000\uEF3B\uEA72\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF1EF\u0000\uEF33\u0000\u0000\u0000\u0000\uE2F1"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE54C\u0000\uF97A\u0000\u0000\u0000\u0000\u0000"+
-        "\uEEBE\u0000\uF994\u0000\u0000\uE644\u0000\u0000"+
-        "\uEC3E\u0000\uE4B7\uF85C\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF86C\u0000\uF1B5\uEBE3"+
-        "\u0000\uEF3C\u0000\uEF6D\u0000\u0000\uF2E9\u0000"+
-        "\u0000\u0000\u0000\u0000\uF54D\u0000\uE2B8\uEFDB"+
-        "\uE3AC\u0000\u0000\u0000\u0000\u0000\u0000\uE857"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF0C9"+
-        "\u0000\uEF5C\u0000\u0000\u0000\uEA47\u0000\u0000"+
-        "\u0000\u0000\uE64C\uE4E5\u0000\u0000\u0000\u0000"+
-        "\u0000\uF86D\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE866\u0000\uE041\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE858\uEAA6\u0000\uF7B3\uF462\u0000\uE054"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE25B\u0000"+
-        "\u0000\uE1F5\u0000\u0000\u0000\uF9B0\uE5A8\u0000"+
-        "\uF3C1\u0000\u0000\uEC79\uE95A\uF144\uF850\u0000"+
-        "\u0000\uF8A8\uE338\u0000\u0000\uE87C\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7EE"+
-        "\u0000\uEB9D\u0000\u0000\u0000\uF2EA\uF86E\u0000"+
-        "\u0000\uEB54\u0000\uE2B9\u0000\uE5CA\uE6E2\uEC3F"+
-        "\u0000\uE6B8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEF5D\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF66A\u0000\u0000\u0000\u0000"+
-        "\uF2A2\uEC6A\uF69E\u0000\u0000\uF8D0\uE3AD\u0000"+
-        "\uE1E4\u0000\uE3AE\uE97D\uEF5E\u0000\uF39B\uE245"+
-        "\uEE9E\u0000\u0000\uE6FB\uE366\uE9F5\uF6F1\u0000"+
-        "\uF69F\u0000\uE8F7\u0000\u0000\u0000\u0000\uF8EA"+
-        "\uEFDC\uE7C1\u0000\uF5F2\uEB55\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF064\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF7C2\u0000\uF04C"+
-        "\u0000\uE455\uF8D1\uEEC0\uF0A5\u0000\uEAFA\uECA2"+
-        "\uE6B9\u0000\uEFC3\u0000\uEF9F\uEF3F\u0000\u0000"+
-        "\uF463\uF8A9\uE735\u0000\u0000\u0000\u0000\uE5CB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE358\u0000"+
-        "\u0000\u0000\uE3AF\uE6E3\u0000\u0000\u0000\uEB56"+
-        "\u0000\uE632\u0000\uF1F0\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE6F3\u0000\u0000\u0000\uF964\u0000\uE867\uE16F"+
-        "\u0000\uF464\u0000\uE3B0\u0000\uE170\u0000\uE8FD"+
-        "\uF4BF\u0000\uF361\u0000\u0000\u0000\u0000\u0000"+
-        "\uF94B\u0000\uEC40\u0000\u0000\uEE35\u0000\u0000"+
-        "\u0000\uEC6B\u0000\u0000\u0000\uEADE\u0000\uEB57"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF491\u0000"+
-        "\u0000\u0000\uE171\u0000\u0000\u0000\u0000\uE67A"+
-        "\u0000\u0000\u0000\u0000\uEEC2\u0000\u0000\u0000"+
-        "\uE246\u0000\uF4C0\u0000\uE1FE\u0000\u0000\u0000"+
-        "\uF8D2\u0000\uF79A\uF6FB\u0000\u0000\uEF4F\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEF47\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF1B6"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE94A\u0000\u0000\uE144\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF3F7\u0000\u0000\u0000\uEF48\u0000\u0000"+
-        "\uE098\u0000\uED34\uF566\u0000\u0000\u0000\uEAE6"+
-        "\u0000\u0000\u0000\uEAA7\u0000\uEAE7\uEBC1\u0000"+
-        "\uEFC4\u0000\u0000\uE95B\uEFC5\u0000\u0000\u0000"+
-        "\uF2A3\uF0A6\uE0A3\uECE9\u0000\u0000\u0000\uE3FB"+
-        "\uF2A4\u0000\uF2EB\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE344"+
-        "\u0000\u0000\u0000\u0000\uE1A3\u0000\u0000\uEF76"+
-        "\u0000\uF2A5\u0000\uE4CC\uE87D\u0000\u0000\u0000"+
-        "\u0000\uE6BA\u0000\uF465\uF5E5\uE7EF\u0000\u0000"+
-        "\u0000\u0000\uF7B4\u0000\u0000\uE5D4\uF9CF\u0000"+
-        "\u0000\u0000\uE8E3\u0000\u0000\u0000\u0000\uF3E1"+
-        "\uF146\u0000\u0000\u0000\u0000\uF8FE\uE4D7\u0000"+
-        "\uE3B1\u0000\uE0B1\u0000\u0000\u0000\u0000\uE3B2"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE0B2\uF3C2"+
-        "\u0000\u0000\uF571\uF7B5\u0000\u0000\uEBC3\uEBC2"+
-        "\u0000\uF0F7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEAA8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE0CA\u0000\u0000"+
-        "\u0000\u0000\u0000\uEE49\u0000\u0000\u0000\u0000"+
-        "\u0000\uF76E\uF7AA\uE099\u0000\uF1B7\u0000\u0000"+
-        "\uE4B8\uF466\u0000\u0000\uE569\uF255\uF492\u0000"+
-        "\u0000\u0000\uE042\u0000\u0000\uE94B\u0000\uF3F8"+
-        "\u0000\u0000\u0000\u0000\u0000\uF147\u0000\u0000"+
-        "\u0000\u0000\uEDCA\u0000\uF650\uF9DD\u0000\u0000"+
-        "\uE573\uE172\u0000\uF6D4\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE6E5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE4C3\u0000\uE736\u0000\uF651\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9F6\u0000\uE1C0\u0000\u0000\u0000"+
-        "\uEDDC\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEDCB\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEBC4\u0000\u0000\u0000\u0000\u0000\uEF40"+
-        "\uF540\uF4EA\uE87E\u0000\uE6BB\u0000\uEC41\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE6AA\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE69D\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uED6F\u0000\uE066\u0000"+
-        "\u0000\u0000\uF0A8\u0000\u0000\u0000\uE8FE\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF652\u0000\u0000\uF2BB\u0000\u0000\u0000"+
-        "\u0000\uE59F\u0000\u0000\uEB58\u0000\u0000\u0000"+
-        "\uEF49\u0000\uF2A6\u0000\u0000\u0000\u0000\u0000"+
-        "\uE1A4\u0000\u0000\uE596\uE8A1\uE8DC\uE8DD\u0000"+
-        "\u0000\u0000\u0000\u0000\uF26C\u0000\uE0CB\uF965"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE27B\u0000"+
-        "\uE1C1\u0000\u0000\uF8D3\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF7AB\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF5D4\u0000\u0000\u0000\u0000\uE7A9"+
-        "\u0000\u0000\uEFDD\uE8CD\u0000\u0000\uE9CE\u0000"+
-        "\uEEC3\u0000\uF15C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF7EC\u0000\u0000\u0000\uE0CC\u0000"+
-        "\u0000\u0000\u0000\uEB9E\uE538\u0000\uF1D3\uE791"+
-        "\u0000\uF467\u0000\uE09A\uE891\u0000\u0000\uE664"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE7CD\u0000"+
-        "\u0000\u0000\uE77E\u0000\uF451\u0000\u0000\u0000"+
-        "\uEAD3\u0000\u0000\u0000\uE892\u0000\uEC7A\u0000"+
-        "\u0000\uEB9F\u0000\u0000\uE79A\u0000\u0000\u0000"+
-        "\uF6AF\uE846\u0000\uE067\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF468\u0000"+
-        "\uE79B\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF86F\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE2EF"+
-        "\uE7C2\u0000\uF362\u0000\uED61\u0000\u0000\u0000"+
-        "\uF4B7\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF870\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF2EC\u0000\u0000\u0000\u0000"+
-        "\u0000\uEC42\u0000\uE54D\u0000\u0000\uE7CE\u0000"+
-        "\u0000\u0000\u0000\uF572\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE539\u0000\u0000\u0000\u0000\uE1C2\uEEDA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF469\u0000\u0000\u0000\u0000"+
-        "\u0000\uE7AA\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE74E\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE93D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEC7B\uE69E\u0000\u0000"+
-        "\uE09B\u0000\u0000\uE56A\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF567\uE131\u0000\u0000\uE2BA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF5B8"+
-        "\u0000\u0000\u0000\uE7C3\uE378\u0000\u0000\u0000"+
-        "\u0000\u0000\uECC5\uF0F8\u0000\uF441\u0000\u0000"+
-        "\u0000\uE2BB\u0000\u0000\u0000\uE4AD\uEF71\uE27C"+
-        "\u0000\u0000\u0000\uEB44\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEA73\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9F7\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF442\uF4F6\uF66B"+
-        "\u0000\u0000\u0000\u0000\uE6FE\u0000\u0000\u0000"+
-        "\u0000\u0000\uF76F\u0000\uF6F2\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE339\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEE6A"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5A6\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE6BC\uE173\u0000\u0000\uEE6B"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE9DD\u0000\u0000\u0000"+
-        "\u0000\uE3B3\u0000\u0000\u0000\u0000\u0000\uF2ED"+
-        "\u0000\u0000\u0000\u0000\uE66E\uED96\uEBEF\u0000"+
-        "\u0000\uE9F8\u0000\u0000\u0000\u0000\u0000\uEF5F"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE075\u0000\u0000\u0000\uE931"+
-        "\u0000\uEB45\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF93C\uF93D\uE737\u0000\u0000\u0000"+
-        "\u0000\uF1B8\u0000\u0000\u0000\uE8B6\u0000\u0000"+
-        "\u0000\u0000\uE692\uF4AF\u0000\u0000\uE1A5\u0000"+
-        "\uE893\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE738\u0000\u0000\u0000\uE174\u0000\u0000\uE3B4"+
-        "\u0000\u0000\u0000\u0000\u0000\uE068\u0000\u0000"+
-        "\u0000\u0000\u0000\uE894\u0000\u0000\u0000\u0000"+
-        "\u0000\uF5A7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF5A8\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEE36\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5EC\uE5F8\uE895\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uECC6\u0000\u0000\u0000\uEA74\u0000"+
-        "\uEA75\uE3B5\u0000\u0000\u0000\u0000\u0000\uE3B6"+
-        "\uE3B7\uF443\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEFDE\u0000\u0000\u0000\u0000\u0000\uF363\uF444"+
-        "\u0000\u0000\uF364\uE0E4\uF8D4\uF5E6\uECEA\u0000"+
-        "\uEA76\u0000\u0000\u0000\u0000\uEAD4\u0000\u0000"+
-        "\uF79B\u0000\u0000\u0000\u0000\uF33E\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE3B8\u0000\u0000\u0000\u0000\uE66F"+
-        "\u0000\uE367\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF931\uF2EE\uE968"+
-        "\u0000\uEFDF\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEDDD\uF9FB"+
-        "\u0000\u0000\uEB59\u0000\u0000\u0000\uE659\u0000"+
-        "\u0000\uE53A\u0000\uEDCC\u0000\u0000\u0000\u0000"+
-        "\u0000\uEFE0\u0000\u0000\u0000\uE368\uF932\uE54E"+
-        "\uEC43\uEA77\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE94C\uE446\uF5D5\u0000\u0000\u0000\u0000"+
-        "\u0000\uE231\uF5A9\u0000\u0000\uE9F9\u0000\u0000"+
-        "\uE9FA\u0000\u0000\u0000\u0000\u0000\u0000\uF365"+
-        "\u0000\u0000\u0000\u0000\uF66F\u0000\uF46A\uED7B"+
-        "\u0000\uF493\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF149\u0000\u0000\u0000\u0000"+
-        "\uF9FC\u0000\u0000\u0000\u0000\uEBAA\u0000\u0000"+
-        "\uE069\u0000\u0000\uF2EF\u0000\uF5AA\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF19B\u0000\u0000\uF73D"+
-        "\u0000\uF452\uF653\u0000\uE6D2\u0000\u0000\uF7A2"+
-        "\uF366\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF39C\u0000"+
-        "\u0000\uF670\u0000\u0000\u0000\u0000\uEFF3\uF453"+
-        "\u0000\u0000\u0000\uE53B\uE043\uE1A6\u0000\uE1C3"+
-        "\uE1DA\u0000\u0000\u0000\u0000\u0000\uE7CF\u0000"+
-        "\u0000\uF654\u0000\u0000\u0000\uF26D\uEEC4\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEC44"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEAE2\uEEDB\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEF41\u0000\uF93E\u0000\u0000\u0000\u0000"+
-        "\uEDCD\u0000\u0000\u0000\uF87B\u0000\uE2BC\u0000"+
-        "\u0000\uE2E2\uE1F6\u0000\u0000\uF2F0\u0000\uF54E"+
-        "\u0000\uE55D\u0000\u0000\uF4B8\u0000\u0000\u0000"+
-        "\uEFA1\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF494\uF4EB\u0000\uF367\u0000\u0000"+
-        "\uE2D7\u0000\u0000\u0000\u0000\u0000\u0000\uE2DF"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEF50\uEF51\u0000\u0000\u0000\uE2E3\uEFA2"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE33A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF4C1\uE33B\u0000\uE574"+
-        "\u0000\u0000\uF2BC\uE731\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7DF"+
-        "\u0000\uF4D7\u0000\u0000\u0000\uE94D\u0000\uE175"+
-        "\uF1F1\u0000\u0000\uF3E2\u0000\uE56B\u0000\u0000"+
-        "\u0000\u0000\uEC45\u0000\u0000\uE076\u0000\uE4AE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE176\u0000"+
-        "\u0000\uF3D3\uF5E7\u0000\u0000\u0000\u0000\uE06A"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF8EE"+
-        "\u0000\uEBC5\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEAE9\u0000\uF26E\u0000\u0000\uF6C2\u0000"+
-        "\uE732\u0000\u0000\u0000\u0000\u0000\uE9AC\u0000"+
-        "\u0000\u0000\u0000\u0000\uF33F\uE64D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEBAB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF7B6\u0000"+
-        "\u0000\uE597\u0000\uE359\uF2A7\uEC7C\u0000\uE8EA"+
-        "\uE25C\uF5E8\uF6D5\u0000\uE4CD\u0000\uF4FE\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE345\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEBA0\u0000\uEAFB\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE6D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEF34\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE0CD"+
-        "\u0000\u0000\u0000\uF2A8\u0000\u0000\u0000\uF244"+
-        "\u0000\u0000\u0000\u0000\uE868\uE3B9\u0000\uEAA9"+
-        "\u0000\u0000\uF4B0\u0000\u0000\uE154\u0000\u0000"+
-        "\u0000\uE247\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF2A9\u0000\u0000"+
-        "\u0000\uEAD5\u0000\u0000\uF1D7\u0000\u0000\u0000"+
-        "\uF256\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF2BD\uF966\u0000\u0000\uE8F4\u0000\uF2AA\uF749"+
-        "\u0000\uF5E9\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uECD9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEBC6\u0000\u0000\u0000\uE54F\u0000\u0000\u0000"+
-        "\u0000\uEA78\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF37A"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF4C2\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE4AF\u0000"+
-        "\u0000\uE06B\u0000\u0000\u0000\u0000\u0000\uF967"+
-        "\u0000\u0000\uF1D8\uEBC7\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF568\uE643\uE9AD"+
-        "\u0000\u0000\u0000\uE5BE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF3C3\uF26F\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE67B\u0000\u0000\u0000\uF569\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE6E6\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE847\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE9FB\u0000\u0000\u0000\u0000"+
-        "\u0000\uE9CF\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE733\u0000\u0000\uE869\u0000\uF368"+
-        "\uF2C4\u0000\u0000\u0000\u0000\u0000\u0000\uEBD8"+
-        "\u0000\u0000\u0000\u0000\u0000\uF3D4\u0000\uF1F2"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE5DB\u0000"+
-        "\u0000\uE5DC\uF4C4\uE0D7\u0000\u0000\u0000\u0000"+
-        "\u0000\uEC46\u0000\u0000\u0000\u0000\uF2F1\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8D5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE4D8\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE9D0\uF369"+
-        "\uE0B3\u0000\u0000\u0000\u0000\u0000\u0000\uE5DD"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE1A7\u0000\u0000\uE33C\u0000";
-
-    private final static String innerIndex4=
-        "\uE3BA\u0000\uF3C4\u0000\uEDB3\uF8F5\uEFE1\uF9E0"+
-        "\uF94C\u0000\uE832\uE833\u0000\uE431\u0000\u0000"+
-        "\uE491\u0000\u0000\u0000\uEC7D\u0000\u0000\uEA79"+
-        "\uE26C\uF445\uE374\uE9D1\u0000\u0000\u0000\u0000"+
-        "\uEBC8\uE8B7\uEAE3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF1B9\uF3C5\u0000\uF4CF\uE6AB"+
-        "\uEBAC\u0000\u0000\uECEB\u0000\uF257\u0000\u0000"+
-        "\u0000\uEBC9\uE09C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF39D\uF871\uF36A\uE177\uE896\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE14F\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE27D\u0000"+
-        "\u0000\uE5A9\uF872\u0000\u0000\u0000\uE375\u0000"+
-        "\uF0D6\u0000\uF16F\u0000\u0000\u0000\uEAFC\u0000"+
-        "\u0000\uF6D6\uEA7A\uE0B4\u0000\u0000\uF2BE\u0000"+
-        "\u0000\uE145\u0000\u0000\u0000\u0000\u0000\uE2BD"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF2F2\uEC47"+
-        "\u0000\u0000\u0000\uE178\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF39E\u0000\u0000\u0000"+
-        "\uE670\u0000\uF3C6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEC48\uF0AB\u0000\u0000"+
-        "\u0000\uE0B5\uE761\u0000\uF55E\uF4F7\u0000\u0000"+
-        "\uE6C6\u0000\uE3BB\uF6AA\u0000\uF1CA\uE6D3\uE79C"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF655"+
-        "\u0000\u0000\uE3CC\uE9FC\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEAFD\u0000"+
-        "\uF7E5\u0000\uEB5A\u0000\u0000\uF49F\uE4B0\u0000"+
-        "\uF595\uE859\u0000\uEE6E\u0000\u0000\u0000\u0000"+
-        "\uF74A\uEF60\u0000\u0000\uE79D\u0000\u0000\uF065"+
-        "\u0000\u0000\u0000\u0000\uE633\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF656\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF46B\uED9E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEF42\u0000\u0000"+
-        "\u0000\u0000\u0000\uE86A\u0000\uF46C\uF8D6\uEFB2"+
-        "\u0000\uF23D\u0000\uF873\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE97E\u0000\u0000\uF5EA\uEE70"+
-        "\u0000\uF39F\u0000\u0000\u0000\u0000\u0000\uE6AC"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5C5\uF270\u0000"+
-        "\u0000\uE8E5\u0000\uE9DE\u0000\u0000\uE7F0\uEFA3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3F9\u0000\uF454\uEB5B\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEFA4\u0000"+
-        "\u0000\uEC49\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uECB1\uF97B\uE1A8\u0000\uE146\u0000\u0000"+
-        "\uF36B\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEE4A\u0000\u0000\uE1A9\u0000\u0000\u0000"+
-        "\u0000\u0000\uF4C3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEBD9\u0000\u0000\uF2AB"+
-        "\u0000\u0000\u0000\uEEC5\u0000\u0000\uEB79\u0000"+
-        "\uF4C5\u0000\u0000\uE550\uE5BF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE9AE\u0000"+
-        "\uF7FC\u0000\uE150\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEDA2\u0000\u0000\u0000"+
-        "\uE248\u0000\u0000\u0000\uE762\uF7D6\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3AA\uE261\u0000\u0000\uF657\u0000"+
-        "\uE8EB\u0000\uEAFE\u0000\u0000\uE771\u0000\uF6F3"+
-        "\u0000\uE6E7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE5A0\u0000\u0000"+
-        "\uE3BC\u0000\uEDCF\u0000\uE0B6\u0000\uE848\u0000"+
-        "\u0000\u0000\u0000\u0000\uE1C4\u0000\u0000\u0000"+
-        "\u0000\u0000\uE64E\u0000\u0000\u0000\uEC4A\u0000"+
-        "\u0000\u0000\u0000\u0000\uE2D8\u0000\u0000\u0000"+
-        "\uEB5C\uF0F9\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF9FD\u0000\u0000\u0000\u0000\u0000"+
-        "\uE6E8\uE0D8\u0000\u0000\u0000\uEFE2\u0000\u0000"+
-        "\u0000\uEF4A\u0000\u0000\u0000\uECC7\u0000\u0000"+
-        "\u0000\u0000\uF15D\u0000\uF15E\u0000\uE64F\u0000"+
-        "\u0000\u0000\uECA7\u0000\uEAD6\uF9E8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF271"+
-        "\uF638\uE9FD\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF74B\u0000\uEF61\u0000\u0000\u0000\u0000"+
-        "\uF7D7\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE27E\u0000\u0000\uF15F\u0000\u0000\u0000"+
-        "\uEFA5\uE665\u0000\uE1C5\u0000\uF1BA\uE3BD\u0000"+
-        "\u0000\uE2BE\u0000\u0000\uF14B\u0000\u0000\u0000"+
-        "\uE441\u0000\u0000\u0000\u0000\uE179\u0000\uE7C4"+
-        "\uEFFC\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE3BE\u0000\u0000"+
-        "\u0000\u0000\u0000\uF14C\u0000\u0000\uEDAD\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF6B0\u0000\uE17A"+
-        "\u0000\u0000\u0000\uE4C4\u0000\u0000\uE650\u0000"+
-        "\u0000\u0000\uE69F\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEBA1\u0000"+
-        "\uEA4D\u0000\uF639\u0000\u0000\u0000\uE834\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE634"+
-        "\uF5C6\u0000\uEBA2\uEFC6\u0000\u0000\u0000\uF455"+
-        "\u0000\u0000\u0000\u0000\u0000\uF579\uE67C\uF0D3"+
-        "\u0000\u0000\u0000\u0000\uF14D\uEC6C\uEA7B\uF36C"+
-        "\u0000\uF0BF\u0000\uE6CE\uE3BF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF5AB\u0000"+
-        "\u0000\u0000\u0000\uF7FD\u0000\uE06C\u0000\u0000"+
-        "\u0000\uE1C6\uF446\u0000\u0000\uE9FE\u0000\u0000"+
-        "\u0000\uE147\uE8B8\u0000\u0000\u0000\u0000\uE379"+
-        "\u0000\uE26D\uF0C0\u0000\uF9A2\u0000\u0000\u0000"+
-        "\u0000\u0000\uF75B\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF066\uF3B0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE8CE\u0000\uF6C3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE8CF\uE0A4\u0000\u0000\uF770\u0000"+
-        "\u0000\uF8D7\u0000\u0000\uF0CA\uEB31\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE25D\u0000\u0000\uE56C\u0000\u0000\u0000"+
-        "\uF9D8\u0000\u0000\u0000\u0000\uE498\u0000\u0000"+
-        "\u0000\u0000\uF447\u0000\u0000\uF898\uF63A\uF899"+
-        "\uE776\u0000\uF541\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEF62\u0000\uE055\uE17B\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEC7E\u0000\u0000\u0000\u0000"+
-        "\u0000\uEC4B\u0000\uF6AD\u0000\u0000\u0000\uF771"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF4EC\u0000\u0000\u0000\u0000\uEA31\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uED9F\u0000\u0000\uECEC\u0000"+
-        "\uE9AF\uE9B0\u0000\u0000\uE0B7\uEF63\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEBA3\uE470\u0000"+
-        "\u0000\u0000\u0000\uF3A0\u0000\u0000\u0000\u0000"+
-        "\uEFA6\uE0F2\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF1F3\uE969\uEB5D\u0000\u0000\u0000\u0000\uF6DA"+
-        "\uE8B9\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE13E\u0000\uE86B\u0000\u0000\u0000\u0000\uE1C7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9B1\u0000\uE73F\uECA3\u0000\u0000"+
-        "\uE291\u0000\u0000\uF495\u0000\u0000\u0000\u0000"+
-        "\uF743\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEB5E\u0000\uF5FD\u0000\u0000"+
-        "\u0000\u0000\uF0EC\u0000\u0000\uE4C5\uF97C\uE46B"+
-        "\uE57B\u0000\uEA32\u0000\u0000\u0000\uEDE6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF340\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE5C4\u0000\u0000\u0000\u0000\u0000\u0000\uF1F4"+
-        "\u0000\u0000\u0000\uECED\u0000\uEF52\u0000\uF1F5"+
-        "\uE6FC\u0000\uF1BB\u0000\u0000\uF63B\u0000\u0000"+
-        "\u0000\u0000\u0000\uF448\uF658\u0000\u0000\u0000"+
-        "\u0000\u0000\uE4E6\uF46D\uE2BF\u0000\uF0AC\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE2C0\u0000\uEE38"+
-        "\uF9E9\u0000\uE2C1\u0000\uEB6F\uEA7C\u0000\u0000"+
-        "\u0000\u0000\uEB32\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF54F\uEC91\u0000\uE7F1\uF3C7"+
-        "\u0000\uE0B8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF7FE\uE8BA\uE897\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF67C\uE86C\uF874"+
-        "\u0000\uEB5F\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE9B2\u0000\u0000\u0000\u0000\uEE39\u0000\uF2F3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF4ED\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF0FA\u0000\uF7E6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE06D\uE5DE"+
-        "\u0000\uE06E\uEAE4\u0000\u0000\u0000\uEE9F\u0000"+
-        "\uF5AC\u0000\u0000\u0000\u0000\u0000\uED97\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEFE3\u0000\uF1CB\uE2E4\u0000"+
-        "\u0000\u0000\uE763\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE9B3\uE57C\u0000\u0000\uF449\u0000\uEAB7"+
-        "\u0000\u0000\u0000\u0000\u0000\uE0CE\uF8D8\u0000"+
-        "\u0000\uE369\u0000\u0000\uE9D2\uF6F4\uEEDC\uED35"+
-        "\u0000\uF933\u0000\uE8BB\u0000\u0000\u0000\uF44A"+
-        "\uEFFD\uE35A\u0000\uF5D6\uE7C5\uED44\u0000\uF1A7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF04D\uEEA0\u0000\uF6C4\uF5AD\u0000\uE7E0"+
-        "\u0000\u0000\u0000\uE044\u0000\u0000\uF772\uE2C2"+
-        "\u0000\uF14E\u0000\u0000\u0000\uEDB4\uE1C8\uF258"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEEC8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE1C9\uF7B7\u0000"+
-        "\u0000\uF3E8\uE7F2\uE8F5\uE045\uE7C6\u0000\u0000"+
-        "\u0000\uE759\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7AB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF1BC\u0000\u0000\uE764\u0000\u0000\u0000\uE96A"+
-        "\u0000\uEC4C\u0000\u0000\uF97D\uF170\uE4A0\u0000"+
-        "\uEFC7\uEE3A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEC92\u0000\u0000\u0000\u0000\u0000\u0000\uF84B"+
-        "\u0000\uF5AE\uF8AA\u0000\u0000\u0000\u0000\uF19D"+
-        "\u0000\uF14F\uF968\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE575\u0000\u0000\u0000\uF7C3"+
-        "\u0000\u0000\u0000\uF272\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE6E9\uF1F6\u0000\u0000\u0000\uEA7D\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE17C\u0000"+
-        "\uECEE\u0000\u0000\u0000\u0000\u0000\uEF64\u0000"+
-        "\u0000\u0000\uF89A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE9B4\uED45\uE740\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE765\u0000\u0000"+
-        "\u0000\uF57A\u0000\u0000\u0000\uE249\u0000\u0000"+
-        "\u0000\uE671\uE2D2\u0000\uE346\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE232\u0000\u0000\uF4EE\u0000"+
-        "\u0000\u0000\u0000\u0000\uF4F8\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE95C\u0000\uE35B\u0000\u0000\u0000\uF934"+
-        "\uE1CA\uE6D4\uEA33\u0000\uED70\u0000\u0000\u0000"+
-        "\u0000\uF259\u0000\u0000\u0000\uEC6D\u0000\u0000"+
-        "\u0000\u0000\u0000\uF5FE\uE53C\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5D1\u0000\uE792\uF753\uF067\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF5D7\u0000\u0000\uE74F\u0000\u0000\u0000"+
-        "\u0000\uF9C0\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF0AD\u0000\u0000\u0000\u0000\uE5AA\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEEA8\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF25A"+
-        "\u0000\u0000\u0000\uE077\u0000\u0000\u0000\u0000"+
-        "\u0000\uF773\u0000\uE56D\u0000\u0000\uF068\u0000"+
-        "\u0000\u0000\u0000\uF8D9\uF1F7\u0000\u0000\uEDB5"+
-        "\u0000\u0000\u0000\u0000\u0000\uE33D\u0000\u0000"+
-        "\u0000\u0000\uF3F1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEC4D\u0000\u0000\u0000\uECC8\u0000\u0000\u0000"+
-        "\u0000\uE7D5\u0000\u0000\uEAAA\u0000\u0000\u0000"+
-        "\u0000\uE8BC\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF774\u0000\u0000\u0000\u0000\u0000"+
-        "\uF3FA\u0000\u0000\uEDB6\uF4EF\u0000\u0000\uF8DA"+
-        "\uEBE0\u0000\uE7AC\u0000\uF5EB\u0000\uEB46\u0000"+
-        "\u0000\uEFC8\u0000\uE0CF\u0000\uECC9\u0000\u0000"+
-        "\u0000\uEA7E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEC4E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE991\u0000\uE635\u0000"+
-        "\u0000\u0000\u0000\u0000\uEC93\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE6A0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE7A1\u0000\uE750\uE96B\u0000\u0000\uF1BD"+
-        "\uEAB8\u0000\uF035\u0000\u0000\u0000\uE6AD\u0000"+
-        "\u0000\uF4F9\u0000\uF1F8\u0000\uF5C7\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEBCA\uF0E3\u0000\uF46E"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF75C\u0000\uF069"+
-        "\u0000\uE4C6\u0000\uE8E6\u0000\u0000\u0000\u0000"+
-        "\u0000\uF5AF\u0000\u0000\u0000\u0000\uE292\u0000"+
-        "\u0000\u0000\u0000\uEFFE\u0000\u0000\u0000\u0000"+
-        "\u0000\uF8B6\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEC94\u0000\u0000\u0000\u0000"+
-        "\uE2F2\uF6B9\uE7F3\u0000\u0000\uEBCB\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE86D\u0000\u0000\uE849"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF0FB"+
-        "\u0000\uE0B9\u0000\u0000\uF1F9\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEB70\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF550\u0000"+
-        "\uF9BC\uEAB1\uECEF\u0000\u0000\u0000\u0000\uEB33"+
-        "\uF9B9\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF341\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE1CB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF1BE\u0000\u0000\u0000\uE5C0\uECF0\uF1FA"+
-        "\u0000\u0000\u0000\u0000\u0000\uEFE4\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE5ED\uEEDD\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE598\uEDB7\u0000\u0000"+
-        "\u0000\uE8E7\uEC4F\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF25B"+
-        "\u0000\u0000\uE6F4\uF36D\u0000\u0000\u0000\uE23B"+
-        "\u0000\u0000\uEEDE\u0000\u0000\u0000\uE666\uEBCC"+
-        "\u0000\u0000\uEF43\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEDEE\uE932"+
-        "\u0000\u0000\uEB60\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE5B5\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE5A1"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF8DB\u0000"+
-        "\uF7CB\u0000\u0000\u0000\uE0F3\uF535\u0000\u0000"+
-        "\u0000\u0000\u0000\uF858\uE667\u0000\uEFE5\uF8DC"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF9D0"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF8F6\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE835\u0000\uE8BD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF172\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE1F7\uF36E\u0000\u0000\u0000"+
-        "\u0000\uF659\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEA91"+
-        "\u0000\u0000\u0000\uE4B1\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF97E\u0000\u0000\u0000"+
-        "\u0000\uEF53\u0000\uF3C8\u0000\u0000\u0000\uE293"+
-        "\u0000\u0000\u0000\u0000\uF7ED\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF496\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uED46\u0000"+
-        "\uF5B9\u0000\uE992\uECF1\u0000\u0000\u0000\u0000"+
-        "\uEF35\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF44B\u0000\uEA34\u0000\uE85C\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE079\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uECDA\u0000\uF969"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF06A"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF7C4\u0000"+
-        "\uECA4\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF8DD\u0000\uF2CA\u0000"+
-        "\uEF54\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5CC\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF0D7\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7AD"+
-        "\u0000\u0000\uF8AB\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE4D9\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE5A2\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF66E\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE898\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEB61\u0000\u0000\uEFA8"+
-        "\u0000\u0000\uF5F9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF83F\u0000\uF0FC\u0000\u0000\uEB7A\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uECB2\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE5C5"+
-        "\u0000\u0000\uF3E3\uE5EE\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE1CC\u0000\u0000\u0000\u0000\uF1D9\u0000"+
-        "\u0000\u0000\u0000\uE751\u0000\u0000\u0000\u0000"+
-        "\uF87C\u0000\u0000\u0000\u0000\u0000\uF3EB\u0000"+
-        "\u0000\u0000\u0000\u0000\uF84C\uEE72\u0000\u0000"+
-        "\u0000\u0000\uF875\uEC9C\u0000\u0000\u0000\uE046"+
-        "\u0000\uED47\u0000\uF06B\u0000\uF5FA\u0000\u0000"+
-        "\u0000\uF8AC\uE2C3\uF0FD\u0000\u0000\u0000\u0000"+
-        "\uF79C\u0000\u0000\uEAB9\u0000\u0000\u0000\u0000"+
-        "\uEBF1\u0000\uE434\u0000\u0000\u0000\u0000\uF5FB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE36A\uE36B"+
-        "\u0000\uF04E\uE7B1\u0000\u0000\u0000\u0000\u0000"+
-        "\uE047\u0000\u0000\uE4E7\u0000\uF775\u0000\u0000"+
-        "\u0000\u0000\uE4B2\u0000\u0000\u0000\uEC50\uF46F"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE1E5\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7AC\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE1CD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF23E\uE63E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE6EA"+
-        "\u0000\u0000\u0000\u0000\uEEE0\uF0AE\u0000\u0000"+
-        "\u0000\uE2D9\u0000\u0000\uE95D\uF1FB\u0000\uEA92"+
-        "\u0000\uE6EB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEA35\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEAD7\uE8D0\uE8D1\u0000\u0000"+
-        "\uE5A3\u0000\u0000\u0000\u0000\uF342\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE96C"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE078\u0000\uF776\uE95E\u0000\u0000\u0000\u0000"+
-        "\uF06C\uE8D2\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEFB3\u0000\u0000"+
-        "\u0000\u0000\uF6DB\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uECA8\u0000"+
-        "\uE6AE\u0000\u0000\uEB71\u0000\u0000\u0000\u0000"+
-        "\u0000\uE0BA\u0000\u0000\uEDD1\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE36C"+
-        "\u0000\u0000\u0000\u0000\uE5C1\u0000\u0000\u0000"+
-        "\u0000\u0000\uE75A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uECA9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEB34"+
-        "\u0000\uEFA9\u0000\uE4C7\u0000\u0000\uE96D\uF73E"+
-        "\u0000\u0000\u0000\uE148\u0000\u0000\u0000\uE33E"+
-        "\u0000\u0000\u0000\uE794\u0000\u0000\uECCA\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE13F\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE53D\uF661\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE35C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE056\u0000\u0000\uE5C2\u0000\u0000"+
-        "\uE24A\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE057\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF840\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEAD8\u0000\u0000\u0000"+
-        "\uF5BA\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEDEB\u0000\uF2F4\uE9B5\u0000\u0000\u0000\u0000"+
-        "\uE1AA\u0000\uECF2\u0000\uF8F7\u0000\uF6D0\u0000"+
-        "\u0000\u0000\u0000\uF9BA\u0000\u0000\uF9E1\uF6A0"+
-        "\uE3C0\u0000\u0000\uEF55\u0000\uED48\u0000\uEBE8"+
-        "\u0000\u0000\u0000\uE151\u0000\uE47D\u0000\u0000"+
-        "\u0000\u0000\uE8BE\u0000\u0000\uEB72\u0000\u0000"+
-        "\u0000\uF859\u0000\u0000\uEBCD\u0000\uE048\u0000"+
-        "\u0000\u0000\uF470\uF3C9\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEA93\u0000\u0000\u0000\uF36F\uF754\u0000\u0000"+
-        "\u0000\u0000\u0000\uF25C\u0000\u0000\uEA94\u0000"+
-        "\uEEC9\u0000\uEC95\uEEE1\u0000\u0000\uECCB\u0000"+
-        "\u0000\uECCC\u0000\u0000\u0000\uE2F8\uF2AC\u0000"+
-        "\uF9FE\uF935\uF841\uEAD9\u0000\uEB62\u0000\u0000"+
-        "\u0000\uF56A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF3CA\u0000\uE233"+
-        "\u0000\u0000\u0000\u0000\uF44C\uF173\u0000\u0000"+
-        "\u0000\u0000\u0000\uEB35\u0000\uF6AB\u0000\u0000"+
-        "\uF0AF\u0000\u0000\u0000\u0000\u0000\uEDDE\u0000"+
-        "\uEBA4\uE1AB\u0000\uE7F4\uEF36\uE1CE\uEBE9\u0000"+
-        "\uF991\u0000\uEB73\u0000\u0000\u0000\u0000\u0000"+
-        "\uEC51\u0000\uE234\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEA36\u0000\u0000\uF0FE\u0000\uF0DD\uF370"+
-        "\u0000\u0000\uF56B\u0000\uEC96\u0000\u0000\uE4C8"+
-        "\u0000\u0000\u0000\uF57B\u0000\uF245\u0000\uF5D8"+
-        "\u0000\u0000\uE5DF\u0000\u0000\u0000\uE675\u0000"+
-        "\u0000\u0000\u0000\uF0B0\uF573\u0000\u0000\u0000"+
-        "\u0000\uECCD\u0000\u0000\u0000\u0000\uF596\uF842"+
-        "\u0000\u0000\uF2F5\uE06F\u0000\uF0B1\uF1BF\u0000"+
-        "\u0000\uF9C9\u0000\u0000\u0000\u0000\uED36\uF7A4"+
-        "\uF343\u0000\uEDEC\u0000\u0000\u0000\uE3E7\u0000"+
-        "\uE7C7\uED67\uF06D\u0000\uE599\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE84A\u0000"+
-        "\uE85D\u0000\u0000\u0000\uF7CC\u0000\uEBDA\uE8BF"+
-        "\u0000\uE155\uF160\uE0BB\u0000\uEA95\u0000\u0000"+
-        "\uEFAA\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE7C8\u0000\u0000\uF273\uE6BD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE2C4\u0000\u0000\u0000\u0000"+
-        "\u0000\uE35D\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF936\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF3FB\u0000\u0000\u0000\u0000\uF9D2\uE3C1"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uECDB\u0000\uE4C9\u0000\uE95F\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE17D\u0000"+
-        "\u0000\u0000\u0000\u0000\uEA37\u0000\u0000\uEE4B"+
-        "\uF131\u0000\u0000\u0000\uE149\u0000\u0000\uF8DE"+
-        "\u0000\u0000\u0000\u0000\u0000\uEEE2\u0000\u0000"+
-        "\uE551\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE938\u0000\u0000\u0000\u0000\u0000"+
-        "\uEC52\u0000\uF4D8\uEDD3\u0000\u0000\uF4D9\u0000"+
-        "\u0000\u0000\uF4C6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE1DB"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE1AC"+
-        "\u0000\uF953\u0000\u0000\u0000\u0000\uE577\u0000"+
-        "\uE3C2\u0000\uF7A5\u0000\uEF65\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uECCE\u0000\u0000"+
-        "\u0000\u0000\uE55A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEADA\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8DF\uEEE3\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF79D\uECCF\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF5B0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE777\u0000\uE7C9\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF73F\uF2F6\u0000"+
-        "\uE9B6\uF23F\uE1F8\u0000\u0000\u0000\u0000\uEA48"+
-        "\uF937\uF6FC\uF6B1\uE24B\uF531\u0000\u0000\uF25D"+
-        "\uEBAE\u0000\u0000\uF153\uE2FE\u0000\uF74F\uE772"+
-        "\uE4E8\u0000\u0000\uEA38\uF574\uF152\u0000\uE7F5"+
-        "\uF7C5\uE9D3\uE693\uF19E\uF992\u0000\u0000\uF1C0"+
-        "\uE049\u0000\uF274\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF471\u0000\uEA49\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE694\u0000\uEA96\u0000\uEADB\u0000"+
-        "\uE8D3\u0000\uF877\uE773\uF551\u0000\uE9B7\u0000"+
-        "\u0000\u0000\uF497\u0000\u0000\uE53E\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE695\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE9B8\uE2C5\uEADF\u0000\u0000";
-
-    private final static String innerIndex5=
-        "\u0000\u0000\u0000\u0000\uF44E\uF631\u0000\uF0CB"+
-        "\uF3FC\u0000\uF4C7\u0000\u0000\uEB7B\u0000\u0000"+
-        "\u0000\u0000\u0000\uF1FC\u0000\u0000\uEBDB\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF275\u0000\uEA97\u0000"+
-        "\u0000\u0000\u0000\uF863\u0000\u0000\u0000\u0000"+
-        "\uF3CB\u0000\u0000\uE33F\uE9B9\u0000\u0000\uE3C3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5B1\u0000\u0000"+
-        "\u0000\u0000\uF056\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF371\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF63C\u0000\u0000\u0000\u0000"+
-        "\uF5D9\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF37B\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE9BA\u0000\u0000\u0000\uF44F\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF6C5\u0000"+
-        "\u0000\u0000\u0000\uE8A2\uF498\u0000\u0000\uE04A"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF6F5\u0000\uE0E5\u0000\u0000"+
-        "\u0000\uF276\u0000\uEB63\u0000\u0000\u0000\u0000"+
-        "\uE235\u0000\u0000\u0000\u0000\u0000\u0000\uE668"+
-        "\u0000\u0000\u0000\uE53F\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEFC9\u0000\u0000\u0000\u0000\uE4CE"+
-        "\uF552\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE0E6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF3A1\u0000\u0000\u0000\u0000\u0000"+
-        "\uF0B2\u0000\u0000\u0000\u0000\uF3A2\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF0B3\u0000\uF344\u0000\u0000\uE0F4"+
-        "\uE540\uF4B2\uF8B7\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF5EC\u0000\u0000\u0000\u0000\u0000\uF277"+
-        "\uF542\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF5ED\u0000\uE2F3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF372\u0000\u0000\u0000\u0000\u0000\uF25E"+
-        "\u0000\u0000\uF3CC\u0000\u0000\uEDB8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE6F5\uECF3\uE2E5\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE2C6\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF4B3\uED68\uE2F9\uE2DA\u0000\u0000"+
-        "\u0000\u0000\uF85D\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEE73"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF472\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF5EE\u0000\u0000\uE04B\u0000\u0000\uECDC\u0000"+
-        "\u0000\u0000\u0000\uE294\u0000\uE669\u0000\u0000"+
-        "\u0000\uF240\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF575\uE752\uE960\uE17E\u0000\u0000"+
-        "\u0000\u0000\u0000\uE5E0\uF65A\uF9CA\uE766\uF55F"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE636\uE94E"+
-        "\u0000\uE8D4\uE6C7\u0000\u0000\u0000\u0000\uF4A0"+
-        "\u0000\u0000\u0000\uF3CD\u0000\u0000\u0000\u0000"+
-        "\uEC53\uE96E\u0000\uE96F\u0000\u0000\uF2AD\uEE3B"+
-        "\u0000\u0000\u0000\u0000\uF7DD\uF04F\u0000\u0000"+
-        "\u0000\uF2AE\u0000\u0000\u0000\uF560\uE295\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEE3C\u0000\uE26E"+
-        "\u0000\u0000\uE5F9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uECF4\uE1D0\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE5B8\u0000\u0000\uF6FD\u0000"+
-        "\uE939\u0000\u0000\u0000\u0000\uEA98\u0000\uE93A"+
-        "\uF473\uEFB4\uE46C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEFE6\u0000\u0000\uECF6\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEECA\u0000"+
-        "\u0000\uE35E\u0000\u0000\uE899\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE04C\u0000"+
-        "\u0000\u0000\uF278\uE86E\u0000\uF499\u0000\u0000"+
-        "\uEC9D\u0000\uE136\u0000\u0000\u0000\u0000\uE84B"+
-        "\u0000\uF279\u0000\u0000\u0000\uF5DA\u0000\u0000"+
-        "\uF6DC\uEBEA\uE251\uE541\u0000\uF9B1\uEE4D\u0000"+
-        "\uF8AD\u0000\u0000\uF777\u0000\uEBCE\u0000\uF6E2"+
-        "\uF5EF\uE2C7\u0000\u0000\uE542\uE191\u0000\uE578"+
-        "\u0000\uF25F\uF6D7\u0000\u0000\uEB36\uE651\uEBDC"+
-        "\uF373\uF3E4\uE993\uE637\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF597\u0000"+
-        "\u0000\uF3CE\uF474\u0000\u0000\uE340\u0000\u0000"+
-        "\uF191\u0000\u0000\u0000\uF7BA\u0000\uF0B5\u0000"+
-        "\u0000\uE57D\uEC54\u0000\u0000\u0000\u0000\uEFE7"+
-        "\u0000\u0000\uF0B4\uF031\u0000\uF74C\uE236\u0000"+
-        "\uF7C6\uF96A\u0000\uE543\uE4B9\uF06E\u0000\u0000"+
-        "\u0000\uEFAB\u0000\u0000\uEBE1\uE4CF\uF598\u0000"+
-        "\uF050\uEBCF\u0000\uE14A\u0000\u0000\u0000\u0000"+
-        "\u0000\uF27A\u0000\u0000\u0000\uF374\uF4B4\uE57E"+
-        "\u0000\u0000\uF450\u0000\u0000\uF3E5\u0000\uF553"+
-        "\uEB64\u0000\uF0B6\u0000\uE6A1\uE0E8\u0000\uF7AD"+
-        "\uEFAD\uE774\uF843\uEC55\uF94D\u0000\u0000\uF154"+
-        "\uE741\u0000\uE93B\u0000\u0000\u0000\u0000\uE5A4"+
-        "\u0000\uF0E9\u0000\u0000\u0000\uEF4B\u0000\u0000"+
-        "\u0000\uE767\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF8AE\uE3E1\u0000\u0000\uE8C0\u0000"+
-        "\uF5BE\u0000\uEA99\u0000\u0000\u0000\u0000\uE09D"+
-        "\uF6C6\uE2C8\u0000\u0000\u0000\uEBD0\u0000\u0000"+
-        "\uF260\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEFF4\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE296\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE5CD\u0000"+
-        "\u0000\uE2DB\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE9BB\u0000\u0000\u0000\u0000\uE23C\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEFE8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE544\u0000\u0000"+
-        "\u0000\u0000\uED57\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF5DB\u0000\u0000\uF851\u0000\u0000"+
-        "\u0000\uEA39\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE59A"+
-        "\u0000\u0000\u0000\u0000\u0000\uF2F7\u0000\u0000"+
-        "\u0000\u0000\uE4B3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF0B7\uF2F8\uF5DC\uF1CC\uE8D5\uF3CF\u0000"+
-        "\u0000\u0000\uF3D0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF5B2\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE7AE\uE5AC\u0000\uEC56\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF9A3\u0000\uF8E5"+
-        "\uEAAB\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEC97"+
-        "\u0000\uF63D\u0000\uF5B3\u0000\uF345\u0000\u0000"+
-        "\u0000\u0000\uEBA5\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF5DD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF132\uF1FD\u0000\uF5B4\uF8B8"+
-        "\u0000\uE8A3\u0000\u0000\uE65A\uE0D9\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEDD4\u0000\u0000\u0000\u0000\u0000\u0000\uF4FA"+
-        "\u0000\uF0B8\u0000\uEB47\uE6EC\uF3EC\uEDAF\uE5E1"+
-        "\uE6ED\uE3D1\u0000\u0000\u0000\u0000\u0000\uEBF2"+
-        "\uF2F9\u0000\u0000\u0000\uE9BC\uF66C\u0000\u0000"+
-        "\u0000\u0000\u0000\uF375\u0000\u0000\u0000\uF554"+
-        "\u0000\u0000\uEFE9\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF4FB\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE591\u0000\u0000"+
-        "\uE132\uF6FE\uEABC\u0000\u0000\u0000\u0000\uF0CD"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE347\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE652\u0000\u0000\u0000"+
-        "\u0000\u0000\uEF3D\u0000\u0000\u0000\u0000\uF2AF"+
-        "\uE0A5\u0000\u0000\u0000\u0000\uE0E9\u0000\u0000"+
-        "\u0000\uF878\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE156"+
-        "\u0000\u0000\u0000\uEE77\u0000\u0000\uF057\u0000"+
-        "\u0000\u0000\uE8A4\u0000\uE2C9\uEC9E\uF2FA\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF0DE\u0000\u0000\uF5C8\u0000\uE56E\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uEB65\u0000\uF2B0\u0000\u0000\uEC57\u0000"+
-        "\uE7AF\u0000\u0000\u0000\uF7E7\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEEE5\u0000\u0000\uE2CA\uEBD1"+
-        "\u0000\uEC58\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF2FB\u0000\u0000\uF89B"+
-        "\u0000\u0000\uE994\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEB37\u0000\u0000\u0000"+
-        "\u0000\u0000\uF778\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE0EA\u0000\u0000\u0000\uE0BC\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE672\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF5DE\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF5DF\u0000\uF246\u0000\u0000\u0000\uEC98\uE4CA"+
-        "\uF2FC\uE3C4\uF2B1\u0000\uE3C5\u0000\uE36E\u0000"+
-        "\uE7E1\u0000\u0000\uEB48\u0000\u0000\uE1D1\uF4B9"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEECC\u0000\uE638\uE237\u0000\uE545\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uED58\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE4B4\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF0B9\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE0F5\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF66D\u0000\uF3A3\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE157\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEFCA\u0000\uEBF0\u0000"+
-        "\u0000\u0000\uF5E0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8AF\u0000\u0000\u0000\uE0D1"+
-        "\u0000\u0000\u0000\u0000\uF8E0\uF475\u0000\u0000"+
-        "\uF192\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF37C\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF27B\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEFCB\u0000"+
-        "\u0000\uE192\u0000\u0000\uE6AF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF4A1\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF997\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF3A4\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEB66\u0000\u0000"+
-        "\u0000\u0000\u0000\uF2B2\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF561\u0000\u0000"+
-        "\uF6A1\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF3D1\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE09E\uE09F\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE25E\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF4C8\u0000\uF4BA"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF1FE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE836\u0000\u0000\uEB7C\u0000\u0000\u0000\u0000"+
-        "\u0000\uF75D\u0000\uE0D2\u0000\u0000\u0000\uF0CE"+
-        "\u0000\uF7D8\uF7D9\uE070\uE85A\u0000\u0000\u0000"+
-        "\uE0A6\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE058\uF7EE\uE8EC\u0000\u0000"+
-        "\uE341\u0000\u0000\u0000\u0000\uE5EF\u0000\u0000"+
-        "\u0000\uEE95\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEEA2\uED69\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uED71"+
-        "\u0000\u0000\uF954\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF7EF\uE2F4\uF6E6\u0000"+
-        "\u0000\u0000\u0000\u0000\uE24C\u0000\u0000\u0000"+
-        "\u0000\uF555\uE933\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE9BD\u0000\u0000\u0000"+
-        "\u0000\uF556\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF731\u0000\u0000\u0000\uEF66\u0000"+
-        "\u0000\u0000\uE8C1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF376\u0000\u0000\u0000\uED49"+
-        "\uF67D\u0000\uF7AE\u0000\uE9BE\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE6B0\uE778\uE0BD\u0000\u0000"+
-        "\uF7DA\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF75E\uF7F0\uEB7D\uECB3\uF543"+
-        "\u0000\u0000\uF052\uF476\uF346\u0000\u0000\u0000"+
-        "\u0000\u0000\uE8D6\u0000\u0000\u0000\u0000\u0000"+
-        "\uF0E4\u0000\u0000\uF477\u0000\uE6D5\uE546\uF7E8"+
-        "\uE6C1\u0000\u0000\u0000\u0000\uEDD5\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEFEA\uE6CC\u0000"+
-        "\u0000\u0000\uE4E9\uEC59\u0000\uF96B\uE1AD\u0000"+
-        "\u0000\u0000\u0000\u0000\uE140\uF032\u0000\u0000"+
-        "\uED98\uE350\u0000\uF347\uF231\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE6F6\u0000\u0000\u0000\uEC5A"+
-        "\uEC5B\u0000\uF85F\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF0DF\u0000\u0000\u0000\u0000\u0000\uE65B"+
-        "\u0000\u0000\u0000\uF544\u0000\u0000\u0000\u0000"+
-        "\uF1CD\uED62\u0000\u0000\uF039\uED4A\uF4A2\uE1D2"+
-        "\u0000\uF65B\u0000\uF3E6\uF1C1\uEF4C\uF261\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF377\uEC5C\u0000"+
-        "\u0000\uED3A\u0000\uF5E1\uF1DA\u0000\u0000\u0000"+
-        "\u0000\u0000\uE6EE\uE3F1\u0000\u0000\u0000\u0000"+
-        "\uEFEB\uEFEC\uEB74\u0000\u0000\u0000\u0000\uE837"+
-        "\uE9D4\u0000\uF033\u0000\u0000\u0000\uE653\uE696"+
-        "\u0000\uE86F\u0000\uF2B3\u0000\u0000\u0000\u0000"+
-        "\uEC5D\u0000\u0000\u0000\u0000\u0000\uF2FD\uF478"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF2C5\u0000\uEEE7\u0000\u0000\uE6FD\u0000"+
-        "\u0000\uEECE\u0000\u0000\uEADC\u0000\uF7C7\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE7F6"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEAAC\u0000\uE66A\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE934\u0000\u0000\u0000\uF348\u0000\u0000"+
-        "\u0000\u0000\uE5FA\u0000\uED99\u0000\u0000\u0000"+
-        "\uE654\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF57C\u0000\u0000\u0000\u0000\uF2FE\u0000"+
-        "\u0000\u0000\u0000\u0000\uF331\u0000\uEA3A\u0000"+
-        "\u0000\uE84C\uE79E\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF864\u0000\u0000\u0000\uF175\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF938\u0000\u0000\uF176"+
-        "\u0000\u0000\uE75B\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8B9\u0000\uED63\u0000\uE1F9"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE2D3\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE07A\u0000\u0000\uE2D4\u0000\uF74D\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF557\u0000"+
-        "\u0000\u0000\u0000\uF06F\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF7DB\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE547\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF0E5\u0000\u0000\uEBD2\u0000"+
-        "\u0000\u0000\u0000\uF034\u0000\u0000\u0000\uF852"+
-        "\uF8E1\uF87D\uF332\uE193\u0000\uF833\uEC99\u0000"+
-        "\uEC5E\u0000\uEFF5\u0000\uEBEB\u0000\u0000\u0000"+
-        "\uEEE8\uEF67\uE89A\uE55B\u0000\u0000\u0000\uF6F6"+
-        "\uE655\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE579\u0000\u0000"+
-        "\uF89C\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE194\uF6DD\u0000\uEA4A\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE238\u0000"+
-        "\u0000\u0000\u0000\u0000\uF349\uEDA0\uED59\u0000"+
-        "\u0000\u0000\u0000\u0000\uED64\u0000\u0000\u0000"+
-        "\uF053\u0000\uF2B4\u0000\u0000\u0000\uE6BE\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF8E2\u0000\uE1D3"+
-        "\u0000\u0000\u0000\uF2B5\u0000\u0000\u0000\uF879"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF7A6\u0000\u0000\u0000\u0000\u0000\u0000\uEABD"+
-        "\u0000\uF6C7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uF79F\u0000\u0000\uF79E"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEA3B\uE8E8\u0000\u0000\uECDD"+
-        "\u0000\uEBE2\uE3C6\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF660\uF0E6\uE89B"+
-        "\u0000\u0000\u0000\u0000\uF157\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uEA9A\uF779\uECDE\u0000"+
-        "\u0000\u0000\u0000\uE297\u0000\u0000\u0000\u0000"+
-        "\u0000\uF853\uEDD7\u0000\uF158\u0000\u0000\u0000"+
-        "\uF4C9\u0000\u0000\uED4B\u0000\u0000\u0000\u0000"+
-        "\uEE3E\u0000\u0000\u0000\u0000\u0000\uF2B6\u0000"+
-        "\uE94F\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE24D\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE753\u0000\u0000"+
-        "\u0000\uE35F\u0000\uE2FA\uF4CA\uEB67\u0000\u0000"+
-        "\u0000\uE3C7\uEFAE\u0000\uEF4D\u0000\u0000\uF854"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uEC5F\u0000"+
-        "\u0000\uF855\u0000\u0000\u0000\uF7B8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE970\u0000\u0000"+
-        "\uF8B0\u0000\u0000\u0000\uE739\uEDDF\uF7A7\u0000"+
-        "\u0000\uF67E\u0000\uF65C\uEC9A\u0000\u0000\u0000"+
-        "\u0000\uF193\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE870\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF3D2\uE45C\uE2CB\u0000\u0000\uE04D\u0000\u0000"+
-        "\u0000\uE9BF\u0000\u0000\u0000\uF691\u0000\uEA9B"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF844\u0000\u0000"+
-        "\u0000\uE5AD\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF3E7"+
-        "\u0000\uEA4E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE950\u0000\u0000\u0000\u0000\u0000\uE3C8\uE3C9"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF74E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE0F6\u0000\u0000\u0000\u0000"+
-        "\uE59B\u0000\u0000\u0000\u0000\u0000\uF5E2\uEBD3"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE779\u0000\u0000\uF7A0\u0000\uE2CC\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF9A4\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE298\u0000\uF860"+
-        "\u0000\u0000\uE195\uEE4E\u0000\u0000\u0000\uF63E"+
-        "\u0000\u0000\uE5F0\u0000\u0000\uE3CA\u0000\u0000"+
-        "\u0000\uF94E\uE5F1\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE1E9\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uF845\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEC60\uF599\u0000\u0000\u0000"+
-        "\uE1D4\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEEA3\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uE8A5\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEC61\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE6A2"+
-        "\u0000\u0000\uF6E3\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uF036\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE331\u0000\u0000\u0000"+
-        "\u0000\uE26A\uF8EB\uE8A6\uE8DE\uE775\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF070"+
-        "\u0000\u0000\u0000\u0000\uE73A\u0000\u0000\u0000"+
-        "\u0000\u0000\uEDE0\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE66B"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF2C6\u0000"+
-        "\u0000\uF77A\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uED65"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE299\u0000\u0000\uEB68\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE6EF\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uF57D\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE1E6\u0000\u0000\u0000"+
-        "\uE196\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF5E3\u0000\u0000"+
-        "\uED5A\u0000\uE971\u0000\u0000\uF7C8\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF94F\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEF37\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE754\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE0BE"+
-        "\u0000\uE93E\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE6F7"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uF378\u0000\uE9C0"+
-        "\u0000\uE2CD\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uE995\uE7B0\u0000\uEE79\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
-
-    private final static String innerIndex6=
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uED4C\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF054\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\uED7C\u0000"+
-        "\uED75\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uF8F8\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE14B\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uED4D\u0000\u0000"+
-        "\uE1DC\uE7F7\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE9DF\u0000\u0000\u0000"+
-        "\u0000\u0000\uF1CE\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uE7D0\u0000\u0000\u0000\u0000\u0000\uEDA3"+
-        "\u0000\u0000\u0000\u0000\uF7CD\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE1AE\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uE2CE"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF63F\u0000\u0000\u0000\u0000\u0000"+
-        "\uF9D3\uF0ED\uE66C\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uEDA4\u0000\u0000\u0000\uE5B6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE66D\u0000\u0000"+
-        "\u0000\uF7E9\u0000\u0000\u0000\uEEA4\u0000\uE673"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uE3CB\uE674\u0000\u0000\u0000\uE5F2"+
-        "\u0000\u0000\u0000\u0000\u0000\uEA9C\u0000\uE6F8"+
-        "\u0000\u0000\u0000\u0000\u0000\uE77A\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE2D5\uE79F\u0000\u0000"+
-        "\u0000\u0000\u0000\uE73B\u0000\u0000\uF9CB\u0000"+
-        "\u0000\u0000\u0000\uF96C\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uEB38\uE5F3\u0000"+
-        "\u0000\uF9D9\u0000\u0000\uE133\u0000\u0000\u0000"+
-        "\uE7F9\u0000\u0000\uE4EA\uF5F5\u0000\uF2C7\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE4DA\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE84D\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uEF38"+
-        "\uE93F\u0000\u0000\u0000\u0000\u0000\uF333\u0000"+
-        "\u0000\u0000\u0000\uE1D5\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uEB39\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\uEA3C\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\uF34A\uF241\u0000\u0000\uF242\u0000"+
-        "\u0000\u0000\uF65D\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uF262"+
-        "\u0000\uE656\u0000\u0000\u0000\u0000\u0000\uEB75"+
-        "\u0000\u0000\uF4BB\u0000\uEDE1\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\uED5B"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\uE6A3\u0000\u0000"+
-        "\uE8C2\u0000\u0000\u0000\u0000\uE0A0\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\uE2CF\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u8861\u8862\u8863\u8864\u8865\u8866\u8867\u8868"+
-        "\u8869\u886A\u886B\u886C\u886D\u886E\u886F\u8870"+
-        "\u8871\u8873\u8874\u8875\u8876\u8877\u8878\u8879"+
-        "\u887A\u887B\u887C\u887D\u8881\u8882\u8883\u8884"+
-        "\u8885\u8886\u8887\u8888\u8889\u888A\u888B\u888C"+
-        "\u888D\u888E\u888F\u8890\u8891\u8893\u8894\u8895"+
-        "\u8896\u8897\u8898\u8899\u889A\u889B\u889C\u889D"+
-        "\u88A1\u88A2\u88A3\u88A4\u88A5\u88A6\u88A7\u88A8"+
-        "\u88A9\u88AA\u88AB\u88AC\u88AD\u88AE\u88AF\u88B0"+
-        "\u88B1\u88B3\u88B4\u88B5\u88B6\u88B7\u88B8\u88B9"+
-        "\u88BA\u88BB\u88BC\u88BD\u88C1\u88C2\u88C3\u88C4"+
-        "\u88C5\u88C6\u88C7\u88C8\u88C9\u88CA\u88CB\u88CC"+
-        "\u88CD\u88CE\u88CF\u88D0\u88D1\u88D3\u88D4\u88D5"+
-        "\u88D6\u88D7\u88D8\u88D9\u88DA\u88DB\u88DC\u88DD"+
-        "\u88E1\u88E2\u88E3\u88E4\u88E5\u88E6\u88E7\u88E8"+
-        "\u88E9\u88EA\u88EB\u88EC\u88ED\u88EE\u88EF\u88F0"+
-        "\u88F1\u88F3\u88F4\u88F5\u88F6\u88F7\u88F8\u88F9"+
-        "\u88FA\u88FB\u88FC\u88FD\u8941\u8942\u8943\u8944"+
-        "\u8945\u8946\u8947\u8948\u8949\u894A\u894B\u894C"+
-        "\u894D\u894E\u894F\u8950\u8951\u8953\u8954\u8955"+
-        "\u8956\u8957\u8958\u8959\u895A\u895B\u895C\u895D"+
-        "\u8961\u8962\u8963\u8964\u8965\u8966\u8967\u8968"+
-        "\u8969\u896A\u896B\u896C\u896D\u896E\u896F\u8970"+
-        "\u8971\u8973\u8974\u8975\u8976\u8977\u8978\u8979"+
-        "\u897A\u897B\u897C\u897D\u8981\u8982\u8983\u8984"+
-        "\u8985\u8986\u8987\u8988\u8989\u898A\u898B\u898C"+
-        "\u898D\u898E\u898F\u8990\u8991\u8993\u8994\u8995"+
-        "\u8996\u8997\u8998\u8999\u899A\u899B\u899C\u899D"+
-        "\u89A1\u89A2\u89A3\u89A4\u89A5\u89A6\u89A7\u89A8"+
-        "\u89A9\u89AA\u89AB\u89AC\u89AD\u89AE\u89AF\u89B0"+
-        "\u89B1\u89B3\u89B4\u89B5\u89B6\u89B7\u89B8\u89B9"+
-        "\u89BA\u89BB\u89BC\u89BD\u89C1\u89C2\u89C3\u89C4"+
-        "\u89C5\u89C6\u89C7\u89C8\u89C9\u89CA\u89CB\u89CC"+
-        "\u89CD\u89CE\u89CF\u89D0\u89D1\u89D3\u89D4\u89D5"+
-        "\u89D6\u89D7\u89D8\u89D9\u89DA\u89DB\u89DC\u89DD"+
-        "\u89E1\u89E2\u89E3\u89E4\u89E5\u89E6\u89E7\u89E8"+
-        "\u89E9\u89EA\u89EB\u89EC\u89ED\u89EE\u89EF\u89F0"+
-        "\u89F1\u89F3\u89F4\u89F5\u89F6\u89F7\u89F8\u89F9"+
-        "\u89FA\u89FB\u89FC\u89FD\u8A41\u8A42\u8A43\u8A44"+
-        "\u8A45\u8A46\u8A47\u8A48\u8A49\u8A4A\u8A4B\u8A4C"+
-        "\u8A4D\u8A4E\u8A4F\u8A50\u8A51\u8A53\u8A54\u8A55"+
-        "\u8A56\u8A57\u8A58\u8A59\u8A5A\u8A5B\u8A5C\u8A5D"+
-        "\u8A61\u8A62\u8A63\u8A64\u8A65\u8A66\u8A67\u8A68"+
-        "\u8A69\u8A6A\u8A6B\u8A6C\u8A6D\u8A6E\u8A6F\u8A70"+
-        "\u8A71\u8A73\u8A74\u8A75\u8A76\u8A77\u8A78\u8A79"+
-        "\u8A7A\u8A7B\u8A7C\u8A7D\u8A81\u8A82\u8A83\u8A84"+
-        "\u8A85\u8A86\u8A87\u8A88\u8A89\u8A8A\u8A8B\u8A8C"+
-        "\u8A8D\u8A8E\u8A8F\u8A90\u8A91\u8A93\u8A94\u8A95"+
-        "\u8A96\u8A97\u8A98\u8A99\u8A9A\u8A9B\u8A9C\u8A9D"+
-        "\u8AA1\u8AA2\u8AA3\u8AA4\u8AA5\u8AA6\u8AA7\u8AA8"+
-        "\u8AA9\u8AAA\u8AAB\u8AAC\u8AAD\u8AAE\u8AAF\u8AB0"+
-        "\u8AB1\u8AB3\u8AB4\u8AB5\u8AB6\u8AB7\u8AB8\u8AB9"+
-        "\u8ABA\u8ABB\u8ABC\u8ABD\u8AC1\u8AC2\u8AC3\u8AC4"+
-        "\u8AC5\u8AC6\u8AC7\u8AC8\u8AC9\u8ACA\u8ACB\u8ACC"+
-        "\u8ACD\u8ACE\u8ACF\u8AD0\u8AD1\u8AD3\u8AD4\u8AD5"+
-        "\u8AD6\u8AD7\u8AD8\u8AD9\u8ADA\u8ADB\u8ADC\u8ADD"+
-        "\u8AE1\u8AE2\u8AE3\u8AE4\u8AE5\u8AE6\u8AE7\u8AE8"+
-        "\u8AE9\u8AEA\u8AEB\u8AEC\u8AED\u8AEE\u8AEF\u8AF0"+
-        "\u8AF1\u8AF3\u8AF4\u8AF5\u8AF6\u8AF7\u8AF8\u8AF9"+
-        "\u8AFA\u8AFB\u8AFC\u8AFD\u8B41\u8B42\u8B43\u8B44"+
-        "\u8B45\u8B46\u8B47\u8B48\u8B49\u8B4A\u8B4B\u8B4C"+
-        "\u8B4D\u8B4E\u8B4F\u8B50\u8B51\u8B53\u8B54\u8B55"+
-        "\u8B56\u8B57\u8B58\u8B59\u8B5A\u8B5B\u8B5C\u8B5D"+
-        "\u8B61\u8B62\u8B63\u8B64\u8B65\u8B66\u8B67\u8B68"+
-        "\u8B69\u8B6A\u8B6B\u8B6C\u8B6D\u8B6E\u8B6F\u8B70"+
-        "\u8B71\u8B73\u8B74\u8B75\u8B76\u8B77\u8B78\u8B79"+
-        "\u8B7A\u8B7B\u8B7C\u8B7D\u8B81\u8B82\u8B83\u8B84"+
-        "\u8B85\u8B86\u8B87\u8B88\u8B89\u8B8A\u8B8B\u8B8C"+
-        "\u8B8D\u8B8E\u8B8F\u8B90\u8B91\u8B93\u8B94\u8B95"+
-        "\u8B96\u8B97\u8B98\u8B99\u8B9A\u8B9B\u8B9C\u8B9D"+
-        "\u8BA1\u8BA2\u8BA3\u8BA4\u8BA5\u8BA6\u8BA7\u8BA8"+
-        "\u8BA9\u8BAA\u8BAB\u8BAC\u8BAD\u8BAE\u8BAF\u8BB0"+
-        "\u8BB1\u8BB3\u8BB4\u8BB5\u8BB6\u8BB7\u8BB8\u8BB9"+
-        "\u8BBA\u8BBB\u8BBC\u8BBD\u8C61\u8C62\u8C63\u8C64"+
-        "\u8C65\u8C66\u8C67\u8C68\u8C69\u8C6A\u8C6B\u8C6C"+
-        "\u8C6D\u8C6E\u8C6F\u8C70\u8C71\u8C73\u8C74\u8C75"+
-        "\u8C76\u8C77\u8C78\u8C79\u8C7A\u8C7B\u8C7C\u8C7D"+
-        "\u8C81\u8C82\u8C83\u8C84\u8C85\u8C86\u8C87\u8C88"+
-        "\u8C89\u8C8A\u8C8B\u8C8C\u8C8D\u8C8E\u8C8F\u8C90"+
-        "\u8C91\u8C93\u8C94\u8C95\u8C96\u8C97\u8C98\u8C99"+
-        "\u8C9A\u8C9B\u8C9C\u8C9D\u8CA1\u8CA2\u8CA3\u8CA4"+
-        "\u8CA5\u8CA6\u8CA7\u8CA8\u8CA9\u8CAA\u8CAB\u8CAC"+
-        "\u8CAD\u8CAE\u8CAF\u8CB0\u8CB1\u8CB3\u8CB4\u8CB5"+
-        "\u8CB6\u8CB7\u8CB8\u8CB9\u8CBA\u8CBB\u8CBC\u8CBD"+
-        "\u8CC1\u8CC2\u8CC3\u8CC4\u8CC5\u8CC6\u8CC7\u8CC8"+
-        "\u8CC9\u8CCA\u8CCB\u8CCC\u8CCD\u8CCE\u8CCF\u8CD0"+
-        "\u8CD1\u8CD3\u8CD4\u8CD5\u8CD6\u8CD7\u8CD8\u8CD9"+
-        "\u8CDA\u8CDB\u8CDC\u8CDD\u8CE1\u8CE2\u8CE3\u8CE4"+
-        "\u8CE5\u8CE6\u8CE7\u8CE8\u8CE9\u8CEA\u8CEB\u8CEC"+
-        "\u8CED\u8CEE\u8CEF\u8CF0\u8CF1\u8CF3\u8CF4\u8CF5"+
-        "\u8CF6\u8CF7\u8CF8\u8CF9\u8CFA\u8CFB\u8CFC\u8CFD"+
-        "\u8D41\u8D42\u8D43\u8D44\u8D45\u8D46\u8D47\u8D48"+
-        "\u8D49\u8D4A\u8D4B\u8D4C\u8D4D\u8D4E\u8D4F\u8D50"+
-        "\u8D51\u8D53\u8D54\u8D55\u8D56\u8D57\u8D58\u8D59"+
-        "\u8D5A\u8D5B\u8D5C\u8D5D\u8D61\u8D62\u8D63\u8D64"+
-        "\u8D65\u8D66\u8D67\u8D68\u8D69\u8D6A\u8D6B\u8D6C"+
-        "\u8D6D\u8D6E\u8D6F\u8D70\u8D71\u8D73\u8D74\u8D75"+
-        "\u8D76\u8D77\u8D78\u8D79\u8D7A\u8D7B\u8D7C\u8D7D"+
-        "\u8D81\u8D82\u8D83\u8D84\u8D85\u8D86\u8D87\u8D88"+
-        "\u8D89\u8D8A\u8D8B\u8D8C\u8D8D\u8D8E\u8D8F\u8D90"+
-        "\u8D91\u8D93\u8D94\u8D95\u8D96\u8D97\u8D98\u8D99"+
-        "\u8D9A\u8D9B\u8D9C\u8D9D\u8DA1\u8DA2\u8DA3\u8DA4"+
-        "\u8DA5\u8DA6\u8DA7\u8DA8\u8DA9\u8DAA\u8DAB\u8DAC"+
-        "\u8DAD\u8DAE\u8DAF\u8DB0\u8DB1\u8DB3\u8DB4\u8DB5"+
-        "\u8DB6\u8DB7\u8DB8\u8DB9\u8DBA\u8DBB\u8DBC\u8DBD"+
-        "\u8DC1\u8DC2\u8DC3\u8DC4\u8DC5\u8DC6\u8DC7\u8DC8"+
-        "\u8DC9\u8DCA\u8DCB\u8DCC\u8DCD\u8DCE\u8DCF\u8DD0"+
-        "\u8DD1\u8DD3\u8DD4\u8DD5\u8DD6\u8DD7\u8DD8\u8DD9"+
-        "\u8DDA\u8DDB\u8DDC\u8DDD\u8DE1\u8DE2\u8DE3\u8DE4"+
-        "\u8DE5\u8DE6\u8DE7\u8DE8\u8DE9\u8DEA\u8DEB\u8DEC"+
-        "\u8DED\u8DEE\u8DEF\u8DF0\u8DF1\u8DF3\u8DF4\u8DF5"+
-        "\u8DF6\u8DF7\u8DF8\u8DF9\u8DFA\u8DFB\u8DFC\u8DFD"+
-        "\u8E41\u8E42\u8E43\u8E44\u8E45\u8E46\u8E47\u8E48"+
-        "\u8E49\u8E4A\u8E4B\u8E4C\u8E4D\u8E4E\u8E4F\u8E50"+
-        "\u8E51\u8E53\u8E54\u8E55\u8E56\u8E57\u8E58\u8E59"+
-        "\u8E5A\u8E5B\u8E5C\u8E5D\u8E61\u8E62\u8E63\u8E64"+
-        "\u8E65\u8E66\u8E67\u8E68\u8E69\u8E6A\u8E6B\u8E6C"+
-        "\u8E6D\u8E6E\u8E6F\u8E70\u8E71\u8E73\u8E74\u8E75"+
-        "\u8E76\u8E77\u8E78\u8E79\u8E7A\u8E7B\u8E7C\u8E7D"+
-        "\u8E81\u8E82\u8E83\u8E84\u8E85\u8E86\u8E87\u8E88"+
-        "\u8E89\u8E8A\u8E8B\u8E8C\u8E8D\u8E8E\u8E8F\u8E90"+
-        "\u8E91\u8E93\u8E94\u8E95\u8E96\u8E97\u8E98\u8E99"+
-        "\u8E9A\u8E9B\u8E9C\u8E9D\u8EA1\u8EA2\u8EA3\u8EA4"+
-        "\u8EA5\u8EA6\u8EA7\u8EA8\u8EA9\u8EAA\u8EAB\u8EAC"+
-        "\u8EAD\u8EAE\u8EAF\u8EB0\u8EB1\u8EB3\u8EB4\u8EB5"+
-        "\u8EB6\u8EB7\u8EB8\u8EB9\u8EBA\u8EBB\u8EBC\u8EBD"+
-        "\u8EC1\u8EC2\u8EC3\u8EC4\u8EC5\u8EC6\u8EC7\u8EC8"+
-        "\u8EC9\u8ECA\u8ECB\u8ECC\u8ECD\u8ECE\u8ECF\u8ED0"+
-        "\u8ED1\u8ED3\u8ED4\u8ED5\u8ED6\u8ED7\u8ED8\u8ED9"+
-        "\u8EDA\u8EDB\u8EDC\u8EDD\u8EE1\u8EE2\u8EE3\u8EE4"+
-        "\u8EE5\u8EE6\u8EE7\u8EE8\u8EE9\u8EEA\u8EEB\u8EEC"+
-        "\u8EED\u8EEE\u8EEF\u8EF0\u8EF1\u8EF3\u8EF4\u8EF5"+
-        "\u8EF6\u8EF7\u8EF8\u8EF9\u8EFA\u8EFB\u8EFC\u8EFD"+
-        "\u8F41\u8F42\u8F43\u8F44\u8F45\u8F46\u8F47\u8F48"+
-        "\u8F49\u8F4A\u8F4B\u8F4C\u8F4D\u8F4E\u8F4F\u8F50"+
-        "\u8F51\u8F53\u8F54\u8F55\u8F56\u8F57\u8F58\u8F59"+
-        "\u8F5A\u8F5B\u8F5C\u8F5D\u8F61\u8F62\u8F63\u8F64"+
-        "\u8F65\u8F66\u8F67\u8F68\u8F69\u8F6A\u8F6B\u8F6C"+
-        "\u8F6D\u8F6E\u8F6F\u8F70\u8F71\u8F73\u8F74\u8F75"+
-        "\u8F76\u8F77\u8F78\u8F79\u8F7A\u8F7B\u8F7C\u8F7D"+
-        "\u8F81\u8F82\u8F83\u8F84\u8F85\u8F86\u8F87\u8F88"+
-        "\u8F89\u8F8A\u8F8B\u8F8C\u8F8D\u8F8E\u8F8F\u8F90"+
-        "\u8F91\u8F93\u8F94\u8F95\u8F96\u8F97\u8F98\u8F99"+
-        "\u8F9A\u8F9B\u8F9C\u8F9D\u8FA1\u8FA2\u8FA3\u8FA4"+
-        "\u8FA5\u8FA6\u8FA7\u8FA8\u8FA9\u8FAA\u8FAB\u8FAC"+
-        "\u8FAD\u8FAE\u8FAF\u8FB0\u8FB1\u8FB3\u8FB4\u8FB5"+
-        "\u8FB6\u8FB7\u8FB8\u8FB9\u8FBA\u8FBB\u8FBC\u8FBD"+
-        "\u9061\u9062\u9063\u9064\u9065\u9066\u9067\u9068"+
-        "\u9069\u906A\u906B\u906C\u906D\u906E\u906F\u9070"+
-        "\u9071\u9073\u9074\u9075\u9076\u9077\u9078\u9079"+
-        "\u907A\u907B\u907C\u907D\u9081\u9082\u9083\u9084"+
-        "\u9085\u9086\u9087\u9088\u9089\u908A\u908B\u908C"+
-        "\u908D\u908E\u908F\u9090\u9091\u9093\u9094\u9095"+
-        "\u9096\u9097\u9098\u9099\u909A\u909B\u909C\u909D"+
-        "\u90A1\u90A2\u90A3\u90A4\u90A5\u90A6\u90A7\u90A8"+
-        "\u90A9\u90AA\u90AB\u90AC\u90AD\u90AE\u90AF\u90B0"+
-        "\u90B1\u90B3\u90B4\u90B5\u90B6\u90B7\u90B8\u90B9"+
-        "\u90BA\u90BB\u90BC\u90BD\u90C1\u90C2\u90C3\u90C4"+
-        "\u90C5\u90C6\u90C7\u90C8\u90C9\u90CA\u90CB\u90CC"+
-        "\u90CD\u90CE\u90CF\u90D0\u90D1\u90D3\u90D4\u90D5"+
-        "\u90D6\u90D7\u90D8\u90D9\u90DA\u90DB\u90DC\u90DD"+
-        "\u90E1\u90E2\u90E3\u90E4\u90E5\u90E6\u90E7\u90E8"+
-        "\u90E9\u90EA\u90EB\u90EC\u90ED\u90EE\u90EF\u90F0"+
-        "\u90F1\u90F3\u90F4\u90F5\u90F6\u90F7\u90F8\u90F9"+
-        "\u90FA\u90FB\u90FC\u90FD\u9141\u9142\u9143\u9144"+
-        "\u9145\u9146\u9147\u9148\u9149\u914A\u914B\u914C"+
-        "\u914D\u914E\u914F\u9150\u9151\u9153\u9154\u9155"+
-        "\u9156\u9157\u9158\u9159\u915A\u915B\u915C\u915D"+
-        "\u9161\u9162\u9163\u9164\u9165\u9166\u9167\u9168"+
-        "\u9169\u916A\u916B\u916C\u916D\u916E\u916F\u9170"+
-        "\u9171\u9173\u9174\u9175\u9176\u9177\u9178\u9179"+
-        "\u917A\u917B\u917C\u917D\u9181\u9182\u9183\u9184"+
-        "\u9185\u9186\u9187\u9188\u9189\u918A\u918B\u918C"+
-        "\u918D\u918E\u918F\u9190\u9191\u9193\u9194\u9195"+
-        "\u9196\u9197\u9198\u9199\u919A\u919B\u919C\u919D"+
-        "\u91A1\u91A2\u91A3\u91A4\u91A5\u91A6\u91A7\u91A8"+
-        "\u91A9\u91AA\u91AB\u91AC\u91AD\u91AE\u91AF\u91B0"+
-        "\u91B1\u91B3\u91B4\u91B5\u91B6\u91B7\u91B8\u91B9"+
-        "\u91BA\u91BB\u91BC\u91BD\u91C1\u91C2\u91C3\u91C4"+
-        "\u91C5\u91C6\u91C7\u91C8\u91C9\u91CA\u91CB\u91CC"+
-        "\u91CD\u91CE\u91CF\u91D0\u91D1\u91D3\u91D4\u91D5"+
-        "\u91D6\u91D7\u91D8\u91D9\u91DA\u91DB\u91DC\u91DD"+
-        "\u91E1\u91E2\u91E3\u91E4\u91E5\u91E6\u91E7\u91E8"+
-        "\u91E9\u91EA\u91EB\u91EC\u91ED\u91EE\u91EF\u91F0"+
-        "\u91F1\u91F3\u91F4\u91F5\u91F6\u91F7\u91F8\u91F9"+
-        "\u91FA\u91FB\u91FC\u91FD\u9241\u9242\u9243\u9244"+
-        "\u9245\u9246\u9247\u9248\u9249\u924A\u924B\u924C"+
-        "\u924D\u924E\u924F\u9250\u9251\u9253\u9254\u9255"+
-        "\u9256\u9257\u9258\u9259\u925A\u925B\u925C\u925D"+
-        "\u9261\u9262\u9263\u9264\u9265\u9266\u9267\u9268"+
-        "\u9269\u926A\u926B\u926C\u926D\u926E\u926F\u9270"+
-        "\u9271\u9273\u9274\u9275\u9276\u9277\u9278\u9279"+
-        "\u927A\u927B\u927C\u927D\u9281\u9282\u9283\u9284"+
-        "\u9285\u9286\u9287\u9288\u9289\u928A\u928B\u928C"+
-        "\u928D\u928E\u928F\u9290\u9291\u9293\u9294\u9295"+
-        "\u9296\u9297\u9298\u9299\u929A\u929B\u929C\u929D"+
-        "\u92A1\u92A2\u92A3\u92A4\u92A5\u92A6\u92A7\u92A8"+
-        "\u92A9\u92AA\u92AB\u92AC\u92AD\u92AE\u92AF\u92B0"+
-        "\u92B1\u92B3\u92B4\u92B5\u92B6\u92B7\u92B8\u92B9"+
-        "\u92BA\u92BB\u92BC\u92BD\u92C1\u92C2\u92C3\u92C4"+
-        "\u92C5\u92C6\u92C7\u92C8\u92C9\u92CA\u92CB\u92CC"+
-        "\u92CD\u92CE\u92CF\u92D0\u92D1\u92D3\u92D4\u92D5"+
-        "\u92D6\u92D7\u92D8\u92D9\u92DA\u92DB\u92DC\u92DD"+
-        "\u92E1\u92E2\u92E3\u92E4\u92E5\u92E6\u92E7\u92E8"+
-        "\u92E9\u92EA\u92EB\u92EC\u92ED\u92EE\u92EF\u92F0"+
-        "\u92F1\u92F3\u92F4\u92F5\u92F6\u92F7\u92F8\u92F9"+
-        "\u92FA\u92FB\u92FC\u92FD\u9341\u9342\u9343\u9344"+
-        "\u9345\u9346\u9347\u9348\u9349\u934A\u934B\u934C"+
-        "\u934D\u934E\u934F\u9350\u9351\u9353\u9354\u9355"+
-        "\u9356\u9357\u9358\u9359\u935A\u935B\u935C\u935D"+
-        "\u9361\u9362\u9363\u9364\u9365\u9366\u9367\u9368"+
-        "\u9369\u936A\u936B\u936C\u936D\u936E\u936F\u9370"+
-        "\u9371\u9373\u9374\u9375\u9376\u9377\u9378\u9379"+
-        "\u937A\u937B\u937C\u937D\u9381\u9382\u9383\u9384"+
-        "\u9385\u9386\u9387\u9388\u9389\u938A\u938B\u938C"+
-        "\u938D\u938E\u938F\u9390\u9391\u9393\u9394\u9395"+
-        "\u9396\u9397\u9398\u9399\u939A\u939B\u939C\u939D"+
-        "\u93A1\u93A2\u93A3\u93A4\u93A5\u93A6\u93A7\u93A8"+
-        "\u93A9\u93AA\u93AB\u93AC\u93AD\u93AE\u93AF\u93B0"+
-        "\u93B1\u93B3\u93B4\u93B5\u93B6\u93B7\u93B8\u93B9"+
-        "\u93BA\u93BB\u93BC\u93BD\u9461\u9462\u9463\u9464"+
-        "\u9465\u9466\u9467\u9468\u9469\u946A\u946B\u946C"+
-        "\u946D\u946E\u946F\u9470\u9471\u9473\u9474\u9475"+
-        "\u9476\u9477\u9478\u9479\u947A\u947B\u947C\u947D"+
-        "\u9481\u9482\u9483\u9484\u9485\u9486\u9487\u9488"+
-        "\u9489\u948A\u948B\u948C\u948D\u948E\u948F\u9490"+
-        "\u9491\u9493\u9494\u9495\u9496\u9497\u9498\u9499"+
-        "\u949A\u949B\u949C\u949D\u94A1\u94A2\u94A3\u94A4"+
-        "\u94A5\u94A6\u94A7\u94A8\u94A9\u94AA\u94AB\u94AC"+
-        "\u94AD\u94AE\u94AF\u94B0\u94B1\u94B3\u94B4\u94B5"+
-        "\u94B6\u94B7\u94B8\u94B9\u94BA\u94BB\u94BC\u94BD"+
-        "\u94C1\u94C2\u94C3\u94C4\u94C5\u94C6\u94C7\u94C8"+
-        "\u94C9\u94CA\u94CB\u94CC\u94CD\u94CE\u94CF\u94D0"+
-        "\u94D1\u94D3\u94D4\u94D5\u94D6\u94D7\u94D8\u94D9"+
-        "\u94DA\u94DB\u94DC\u94DD\u94E1\u94E2\u94E3\u94E4"+
-        "\u94E5\u94E6\u94E7\u94E8\u94E9\u94EA\u94EB\u94EC"+
-        "\u94ED\u94EE\u94EF\u94F0\u94F1\u94F3\u94F4\u94F5"+
-        "\u94F6\u94F7\u94F8\u94F9\u94FA\u94FB\u94FC\u94FD"+
-        "\u9541\u9542\u9543\u9544\u9545\u9546\u9547\u9548"+
-        "\u9549\u954A\u954B\u954C\u954D\u954E\u954F\u9550"+
-        "\u9551\u9553\u9554\u9555\u9556\u9557\u9558\u9559"+
-        "\u955A\u955B\u955C\u955D\u9561\u9562\u9563\u9564"+
-        "\u9565\u9566\u9567\u9568\u9569\u956A\u956B\u956C"+
-        "\u956D\u956E\u956F\u9570\u9571\u9573\u9574\u9575"+
-        "\u9576\u9577\u9578\u9579\u957A\u957B\u957C\u957D"+
-        "\u9581\u9582\u9583\u9584\u9585\u9586\u9587\u9588"+
-        "\u9589\u958A\u958B\u958C\u958D\u958E\u958F\u9590"+
-        "\u9591\u9593\u9594\u9595\u9596\u9597\u9598\u9599"+
-        "\u959A\u959B\u959C\u959D\u95A1\u95A2\u95A3\u95A4"+
-        "\u95A5\u95A6\u95A7\u95A8\u95A9\u95AA\u95AB\u95AC"+
-        "\u95AD\u95AE\u95AF\u95B0\u95B1\u95B3\u95B4\u95B5"+
-        "\u95B6\u95B7\u95B8\u95B9\u95BA\u95BB\u95BC\u95BD"+
-        "\u95C1\u95C2\u95C3\u95C4\u95C5\u95C6\u95C7\u95C8"+
-        "\u95C9\u95CA\u95CB\u95CC\u95CD\u95CE\u95CF\u95D0"+
-        "\u95D1\u95D3\u95D4\u95D5\u95D6\u95D7\u95D8\u95D9"+
-        "\u95DA\u95DB\u95DC\u95DD\u95E1\u95E2\u95E3\u95E4"+
-        "\u95E5\u95E6\u95E7\u95E8\u95E9\u95EA\u95EB\u95EC"+
-        "\u95ED\u95EE\u95EF\u95F0\u95F1\u95F3\u95F4\u95F5"+
-        "\u95F6\u95F7\u95F8\u95F9\u95FA\u95FB\u95FC\u95FD"+
-        "\u9641\u9642\u9643\u9644\u9645\u9646\u9647\u9648"+
-        "\u9649\u964A\u964B\u964C\u964D\u964E\u964F\u9650"+
-        "\u9651\u9653\u9654\u9655\u9656\u9657\u9658\u9659"+
-        "\u965A\u965B\u965C\u965D\u9661\u9662\u9663\u9664"+
-        "\u9665\u9666\u9667\u9668\u9669\u966A\u966B\u966C"+
-        "\u966D\u966E\u966F\u9670\u9671\u9673\u9674\u9675"+
-        "\u9676\u9677\u9678\u9679\u967A\u967B\u967C\u967D"+
-        "\u9681\u9682\u9683\u9684\u9685\u9686\u9687\u9688"+
-        "\u9689\u968A\u968B\u968C\u968D\u968E\u968F\u9690"+
-        "\u9691\u9693\u9694\u9695\u9696\u9697\u9698\u9699"+
-        "\u969A\u969B\u969C\u969D\u96A1\u96A2\u96A3\u96A4"+
-        "\u96A5\u96A6\u96A7\u96A8\u96A9\u96AA\u96AB\u96AC"+
-        "\u96AD\u96AE\u96AF\u96B0\u96B1\u96B3\u96B4\u96B5"+
-        "\u96B6\u96B7\u96B8\u96B9\u96BA\u96BB\u96BC\u96BD"+
-        "\u96C1\u96C2\u96C3\u96C4\u96C5\u96C6\u96C7\u96C8"+
-        "\u96C9\u96CA\u96CB\u96CC\u96CD\u96CE\u96CF\u96D0"+
-        "\u96D1\u96D3\u96D4\u96D5\u96D6\u96D7\u96D8\u96D9"+
-        "\u96DA\u96DB\u96DC\u96DD\u96E1\u96E2\u96E3\u96E4"+
-        "\u96E5\u96E6\u96E7\u96E8\u96E9\u96EA\u96EB\u96EC"+
-        "\u96ED\u96EE\u96EF\u96F0\u96F1\u96F3\u96F4\u96F5"+
-        "\u96F6\u96F7\u96F8\u96F9\u96FA\u96FB\u96FC\u96FD"+
-        "\u9741\u9742\u9743\u9744\u9745\u9746\u9747\u9748"+
-        "\u9749\u974A\u974B\u974C\u974D\u974E\u974F\u9750"+
-        "\u9751\u9753\u9754\u9755\u9756\u9757\u9758\u9759"+
-        "\u975A\u975B\u975C\u975D\u9761\u9762\u9763\u9764"+
-        "\u9765\u9766\u9767\u9768\u9769\u976A\u976B\u976C"+
-        "\u976D\u976E\u976F\u9770\u9771\u9773\u9774\u9775"+
-        "\u9776\u9777\u9778\u9779\u977A\u977B\u977C\u977D"+
-        "\u9781\u9782\u9783\u9784\u9785\u9786\u9787\u9788"+
-        "\u9789\u978A\u978B\u978C\u978D\u978E\u978F\u9790"+
-        "\u9791\u9793\u9794\u9795\u9796\u9797\u9798\u9799"+
-        "\u979A\u979B\u979C\u979D\u97A1\u97A2\u97A3\u97A4"+
-        "\u97A5\u97A6\u97A7\u97A8\u97A9\u97AA\u97AB\u97AC"+
-        "\u97AD\u97AE\u97AF\u97B0\u97B1\u97B3\u97B4\u97B5"+
-        "\u97B6\u97B7\u97B8\u97B9\u97BA\u97BB\u97BC\u97BD"+
-        "\u9861\u9862\u9863\u9864\u9865\u9866\u9867\u9868"+
-        "\u9869\u986A\u986B\u986C\u986D\u986E\u986F\u9870"+
-        "\u9871\u9873\u9874\u9875\u9876\u9877\u9878\u9879"+
-        "\u987A\u987B\u987C\u987D\u9881\u9882\u9883\u9884"+
-        "\u9885\u9886\u9887\u9888\u9889\u988A\u988B\u988C"+
-        "\u988D\u988E\u988F\u9890\u9891\u9893\u9894\u9895"+
-        "\u9896\u9897\u9898\u9899\u989A\u989B\u989C\u989D"+
-        "\u98A1\u98A2\u98A3\u98A4\u98A5\u98A6\u98A7\u98A8"+
-        "\u98A9\u98AA\u98AB\u98AC\u98AD\u98AE\u98AF\u98B0"+
-        "\u98B1\u98B3\u98B4\u98B5\u98B6\u98B7\u98B8\u98B9"+
-        "\u98BA\u98BB\u98BC\u98BD\u98C1\u98C2\u98C3\u98C4"+
-        "\u98C5\u98C6\u98C7\u98C8\u98C9\u98CA\u98CB\u98CC"+
-        "\u98CD\u98CE\u98CF\u98D0\u98D1\u98D3\u98D4\u98D5"+
-        "\u98D6\u98D7\u98D8\u98D9\u98DA\u98DB\u98DC\u98DD"+
-        "\u98E1\u98E2\u98E3\u98E4\u98E5\u98E6\u98E7\u98E8"+
-        "\u98E9\u98EA\u98EB\u98EC\u98ED\u98EE\u98EF\u98F0"+
-        "\u98F1\u98F3\u98F4\u98F5\u98F6\u98F7\u98F8\u98F9"+
-        "\u98FA\u98FB\u98FC\u98FD\u9941\u9942\u9943\u9944"+
-        "\u9945\u9946\u9947\u9948\u9949\u994A\u994B\u994C"+
-        "\u994D\u994E\u994F\u9950\u9951\u9953\u9954\u9955"+
-        "\u9956\u9957\u9958\u9959\u995A\u995B\u995C\u995D"+
-        "\u9961\u9962\u9963\u9964\u9965\u9966\u9967\u9968"+
-        "\u9969\u996A\u996B\u996C\u996D\u996E\u996F\u9970"+
-        "\u9971\u9973\u9974\u9975\u9976\u9977\u9978\u9979"+
-        "\u997A\u997B\u997C\u997D\u9981\u9982\u9983\u9984"+
-        "\u9985\u9986\u9987\u9988\u9989\u998A\u998B\u998C"+
-        "\u998D\u998E\u998F\u9990\u9991\u9993\u9994\u9995"+
-        "\u9996\u9997\u9998\u9999\u999A\u999B\u999C\u999D"+
-        "\u99A1\u99A2\u99A3\u99A4\u99A5\u99A6\u99A7\u99A8"+
-        "\u99A9\u99AA\u99AB\u99AC\u99AD\u99AE\u99AF\u99B0"+
-        "\u99B1\u99B3\u99B4\u99B5\u99B6\u99B7\u99B8\u99B9"+
-        "\u99BA\u99BB\u99BC\u99BD\u99C1\u99C2\u99C3\u99C4"+
-        "\u99C5\u99C6\u99C7\u99C8\u99C9\u99CA\u99CB\u99CC"+
-        "\u99CD\u99CE\u99CF\u99D0\u99D1\u99D3\u99D4\u99D5"+
-        "\u99D6\u99D7\u99D8\u99D9\u99DA\u99DB\u99DC\u99DD"+
-        "\u99E1\u99E2\u99E3\u99E4\u99E5\u99E6\u99E7\u99E8"+
-        "\u99E9\u99EA\u99EB\u99EC\u99ED\u99EE\u99EF\u99F0"+
-        "\u99F1\u99F3\u99F4\u99F5\u99F6\u99F7\u99F8\u99F9"+
-        "\u99FA\u99FB\u99FC\u99FD\u9A41\u9A42\u9A43\u9A44"+
-        "\u9A45\u9A46\u9A47\u9A48\u9A49\u9A4A\u9A4B\u9A4C"+
-        "\u9A4D\u9A4E\u9A4F\u9A50\u9A51\u9A53\u9A54\u9A55"+
-        "\u9A56\u9A57\u9A58\u9A59\u9A5A\u9A5B\u9A5C\u9A5D"+
-        "\u9A61\u9A62\u9A63\u9A64\u9A65\u9A66\u9A67\u9A68"+
-        "\u9A69\u9A6A\u9A6B\u9A6C\u9A6D\u9A6E\u9A6F\u9A70"+
-        "\u9A71\u9A73\u9A74\u9A75\u9A76\u9A77\u9A78\u9A79"+
-        "\u9A7A\u9A7B\u9A7C\u9A7D\u9A81\u9A82\u9A83\u9A84"+
-        "\u9A85\u9A86\u9A87\u9A88\u9A89\u9A8A\u9A8B\u9A8C"+
-        "\u9A8D\u9A8E\u9A8F\u9A90\u9A91\u9A93\u9A94\u9A95"+
-        "\u9A96\u9A97\u9A98\u9A99\u9A9A\u9A9B\u9A9C\u9A9D"+
-        "\u9AA1\u9AA2\u9AA3\u9AA4\u9AA5\u9AA6\u9AA7\u9AA8"+
-        "\u9AA9\u9AAA\u9AAB\u9AAC\u9AAD\u9AAE\u9AAF\u9AB0"+
-        "\u9AB1\u9AB3\u9AB4\u9AB5\u9AB6\u9AB7\u9AB8\u9AB9"+
-        "\u9ABA\u9ABB\u9ABC\u9ABD\u9AC1\u9AC2\u9AC3\u9AC4"+
-        "\u9AC5\u9AC6\u9AC7\u9AC8\u9AC9\u9ACA\u9ACB\u9ACC"+
-        "\u9ACD\u9ACE\u9ACF\u9AD0\u9AD1\u9AD3\u9AD4\u9AD5"+
-        "\u9AD6\u9AD7\u9AD8\u9AD9\u9ADA\u9ADB\u9ADC\u9ADD"+
-        "\u9AE1\u9AE2\u9AE3\u9AE4\u9AE5\u9AE6\u9AE7\u9AE8"+
-        "\u9AE9\u9AEA\u9AEB\u9AEC\u9AED\u9AEE\u9AEF\u9AF0"+
-        "\u9AF1\u9AF3\u9AF4\u9AF5\u9AF6\u9AF7\u9AF8\u9AF9"+
-        "\u9AFA\u9AFB\u9AFC\u9AFD\u9B41\u9B42\u9B43\u9B44"+
-        "\u9B45\u9B46\u9B47\u9B48\u9B49\u9B4A\u9B4B\u9B4C"+
-        "\u9B4D\u9B4E\u9B4F\u9B50\u9B51\u9B53\u9B54\u9B55"+
-        "\u9B56\u9B57\u9B58\u9B59\u9B5A\u9B5B\u9B5C\u9B5D"+
-        "\u9B61\u9B62\u9B63\u9B64\u9B65\u9B66\u9B67\u9B68"+
-        "\u9B69\u9B6A\u9B6B\u9B6C\u9B6D\u9B6E\u9B6F\u9B70"+
-        "\u9B71\u9B73\u9B74\u9B75\u9B76\u9B77\u9B78\u9B79"+
-        "\u9B7A\u9B7B\u9B7C\u9B7D\u9B81\u9B82\u9B83\u9B84"+
-        "\u9B85\u9B86\u9B87\u9B88\u9B89\u9B8A\u9B8B\u9B8C"+
-        "\u9B8D\u9B8E\u9B8F\u9B90\u9B91\u9B93\u9B94\u9B95"+
-        "\u9B96\u9B97\u9B98\u9B99\u9B9A\u9B9B\u9B9C\u9B9D"+
-        "\u9BA1\u9BA2\u9BA3\u9BA4\u9BA5\u9BA6\u9BA7\u9BA8"+
-        "\u9BA9\u9BAA\u9BAB\u9BAC\u9BAD\u9BAE\u9BAF\u9BB0"+
-        "\u9BB1\u9BB3\u9BB4\u9BB5\u9BB6\u9BB7\u9BB8\u9BB9"+
-        "\u9BBA\u9BBB\u9BBC\u9BBD\u9C61\u9C62\u9C63\u9C64"+
-        "\u9C65\u9C66\u9C67\u9C68\u9C69\u9C6A\u9C6B\u9C6C"+
-        "\u9C6D\u9C6E\u9C6F\u9C70\u9C71\u9C73\u9C74\u9C75"+
-        "\u9C76\u9C77\u9C78\u9C79\u9C7A\u9C7B\u9C7C\u9C7D"+
-        "\u9C81\u9C82\u9C83\u9C84\u9C85\u9C86\u9C87\u9C88"+
-        "\u9C89\u9C8A\u9C8B\u9C8C\u9C8D\u9C8E\u9C8F\u9C90"+
-        "\u9C91\u9C93\u9C94\u9C95\u9C96\u9C97\u9C98\u9C99"+
-        "\u9C9A\u9C9B\u9C9C\u9C9D\u9CA1\u9CA2\u9CA3\u9CA4"+
-        "\u9CA5\u9CA6\u9CA7\u9CA8\u9CA9\u9CAA\u9CAB\u9CAC"+
-        "\u9CAD\u9CAE\u9CAF\u9CB0\u9CB1\u9CB3\u9CB4\u9CB5"+
-        "\u9CB6\u9CB7\u9CB8\u9CB9\u9CBA\u9CBB\u9CBC\u9CBD"+
-        "\u9CC1\u9CC2\u9CC3\u9CC4\u9CC5\u9CC6\u9CC7\u9CC8"+
-        "\u9CC9\u9CCA\u9CCB\u9CCC\u9CCD\u9CCE\u9CCF\u9CD0"+
-        "\u9CD1\u9CD3\u9CD4\u9CD5\u9CD6\u9CD7\u9CD8\u9CD9"+
-        "\u9CDA\u9CDB\u9CDC\u9CDD\u9CE1\u9CE2\u9CE3\u9CE4"+
-        "\u9CE5\u9CE6\u9CE7\u9CE8\u9CE9\u9CEA\u9CEB\u9CEC"+
-        "\u9CED\u9CEE\u9CEF\u9CF0\u9CF1\u9CF3\u9CF4\u9CF5"+
-        "\u9CF6\u9CF7\u9CF8\u9CF9\u9CFA\u9CFB\u9CFC\u9CFD"+
-        "\u9D41\u9D42\u9D43\u9D44\u9D45\u9D46\u9D47\u9D48"+
-        "\u9D49\u9D4A\u9D4B\u9D4C\u9D4D\u9D4E\u9D4F\u9D50"+
-        "\u9D51\u9D53\u9D54\u9D55\u9D56\u9D57\u9D58\u9D59"+
-        "\u9D5A\u9D5B\u9D5C\u9D5D\u9D61\u9D62\u9D63\u9D64"+
-        "\u9D65\u9D66\u9D67\u9D68\u9D69\u9D6A\u9D6B\u9D6C"+
-        "\u9D6D\u9D6E\u9D6F\u9D70\u9D71\u9D73\u9D74\u9D75"+
-        "\u9D76\u9D77\u9D78\u9D79\u9D7A\u9D7B\u9D7C\u9D7D"+
-        "\u9D81\u9D82\u9D83\u9D84\u9D85\u9D86\u9D87\u9D88"+
-        "\u9D89\u9D8A\u9D8B\u9D8C\u9D8D\u9D8E\u9D8F\u9D90"+
-        "\u9D91\u9D93\u9D94\u9D95\u9D96\u9D97\u9D98\u9D99"+
-        "\u9D9A\u9D9B\u9D9C\u9D9D\u9DA1\u9DA2\u9DA3\u9DA4"+
-        "\u9DA5\u9DA6\u9DA7\u9DA8\u9DA9\u9DAA\u9DAB\u9DAC"+
-        "\u9DAD\u9DAE\u9DAF\u9DB0\u9DB1\u9DB3\u9DB4\u9DB5"+
-        "\u9DB6\u9DB7\u9DB8\u9DB9\u9DBA\u9DBB\u9DBC\u9DBD"+
-        "\u9DC1\u9DC2\u9DC3\u9DC4\u9DC5\u9DC6\u9DC7\u9DC8"+
-        "\u9DC9\u9DCA\u9DCB\u9DCC\u9DCD\u9DCE\u9DCF\u9DD0"+
-        "\u9DD1\u9DD3\u9DD4\u9DD5\u9DD6\u9DD7\u9DD8\u9DD9"+
-        "\u9DDA\u9DDB\u9DDC\u9DDD\u9DE1\u9DE2\u9DE3\u9DE4"+
-        "\u9DE5\u9DE6\u9DE7\u9DE8\u9DE9\u9DEA\u9DEB\u9DEC"+
-        "\u9DED\u9DEE\u9DEF\u9DF0\u9DF1\u9DF3\u9DF4\u9DF5"+
-        "\u9DF6\u9DF7\u9DF8\u9DF9\u9DFA\u9DFB\u9DFC\u9DFD"+
-        "\u9E41\u9E42\u9E43\u9E44\u9E45\u9E46\u9E47\u9E48"+
-        "\u9E49\u9E4A\u9E4B\u9E4C\u9E4D\u9E4E\u9E4F\u9E50"+
-        "\u9E51\u9E53\u9E54\u9E55\u9E56\u9E57\u9E58\u9E59"+
-        "\u9E5A\u9E5B\u9E5C\u9E5D\u9E61\u9E62\u9E63\u9E64"+
-        "\u9E65\u9E66\u9E67\u9E68\u9E69\u9E6A\u9E6B\u9E6C"+
-        "\u9E6D\u9E6E\u9E6F\u9E70\u9E71\u9E73\u9E74\u9E75"+
-        "\u9E76\u9E77\u9E78\u9E79\u9E7A\u9E7B\u9E7C\u9E7D"+
-        "\u9E81\u9E82\u9E83\u9E84\u9E85\u9E86\u9E87\u9E88"+
-        "\u9E89\u9E8A\u9E8B\u9E8C\u9E8D\u9E8E\u9E8F\u9E90"+
-        "\u9E91\u9E93\u9E94\u9E95\u9E96\u9E97\u9E98\u9E99";
-
-    private final static String innerIndex7=
-        "\u9E9A\u9E9B\u9E9C\u9E9D\u9EA1\u9EA2\u9EA3\u9EA4"+
-        "\u9EA5\u9EA6\u9EA7\u9EA8\u9EA9\u9EAA\u9EAB\u9EAC"+
-        "\u9EAD\u9EAE\u9EAF\u9EB0\u9EB1\u9EB3\u9EB4\u9EB5"+
-        "\u9EB6\u9EB7\u9EB8\u9EB9\u9EBA\u9EBB\u9EBC\u9EBD"+
-        "\u9EC1\u9EC2\u9EC3\u9EC4\u9EC5\u9EC6\u9EC7\u9EC8"+
-        "\u9EC9\u9ECA\u9ECB\u9ECC\u9ECD\u9ECE\u9ECF\u9ED0"+
-        "\u9ED1\u9ED3\u9ED4\u9ED5\u9ED6\u9ED7\u9ED8\u9ED9"+
-        "\u9EDA\u9EDB\u9EDC\u9EDD\u9EE1\u9EE2\u9EE3\u9EE4"+
-        "\u9EE5\u9EE6\u9EE7\u9EE8\u9EE9\u9EEA\u9EEB\u9EEC"+
-        "\u9EED\u9EEE\u9EEF\u9EF0\u9EF1\u9EF3\u9EF4\u9EF5"+
-        "\u9EF6\u9EF7\u9EF8\u9EF9\u9EFA\u9EFB\u9EFC\u9EFD"+
-        "\u9F41\u9F42\u9F43\u9F44\u9F45\u9F46\u9F47\u9F48"+
-        "\u9F49\u9F4A\u9F4B\u9F4C\u9F4D\u9F4E\u9F4F\u9F50"+
-        "\u9F51\u9F53\u9F54\u9F55\u9F56\u9F57\u9F58\u9F59"+
-        "\u9F5A\u9F5B\u9F5C\u9F5D\u9F61\u9F62\u9F63\u9F64"+
-        "\u9F65\u9F66\u9F67\u9F68\u9F69\u9F6A\u9F6B\u9F6C"+
-        "\u9F6D\u9F6E\u9F6F\u9F70\u9F71\u9F73\u9F74\u9F75"+
-        "\u9F76\u9F77\u9F78\u9F79\u9F7A\u9F7B\u9F7C\u9F7D"+
-        "\u9F81\u9F82\u9F83\u9F84\u9F85\u9F86\u9F87\u9F88"+
-        "\u9F89\u9F8A\u9F8B\u9F8C\u9F8D\u9F8E\u9F8F\u9F90"+
-        "\u9F91\u9F93\u9F94\u9F95\u9F96\u9F97\u9F98\u9F99"+
-        "\u9F9A\u9F9B\u9F9C\u9F9D\u9FA1\u9FA2\u9FA3\u9FA4"+
-        "\u9FA5\u9FA6\u9FA7\u9FA8\u9FA9\u9FAA\u9FAB\u9FAC"+
-        "\u9FAD\u9FAE\u9FAF\u9FB0\u9FB1\u9FB3\u9FB4\u9FB5"+
-        "\u9FB6\u9FB7\u9FB8\u9FB9\u9FBA\u9FBB\u9FBC\u9FBD"+
-        "\uA061\uA062\uA063\uA064\uA065\uA066\uA067\uA068"+
-        "\uA069\uA06A\uA06B\uA06C\uA06D\uA06E\uA06F\uA070"+
-        "\uA071\uA073\uA074\uA075\uA076\uA077\uA078\uA079"+
-        "\uA07A\uA07B\uA07C\uA07D\uA081\uA082\uA083\uA084"+
-        "\uA085\uA086\uA087\uA088\uA089\uA08A\uA08B\uA08C"+
-        "\uA08D\uA08E\uA08F\uA090\uA091\uA093\uA094\uA095"+
-        "\uA096\uA097\uA098\uA099\uA09A\uA09B\uA09C\uA09D"+
-        "\uA0A1\uA0A2\uA0A3\uA0A4\uA0A5\uA0A6\uA0A7\uA0A8"+
-        "\uA0A9\uA0AA\uA0AB\uA0AC\uA0AD\uA0AE\uA0AF\uA0B0"+
-        "\uA0B1\uA0B3\uA0B4\uA0B5\uA0B6\uA0B7\uA0B8\uA0B9"+
-        "\uA0BA\uA0BB\uA0BC\uA0BD\uA0C1\uA0C2\uA0C3\uA0C4"+
-        "\uA0C5\uA0C6\uA0C7\uA0C8\uA0C9\uA0CA\uA0CB\uA0CC"+
-        "\uA0CD\uA0CE\uA0CF\uA0D0\uA0D1\uA0D3\uA0D4\uA0D5"+
-        "\uA0D6\uA0D7\uA0D8\uA0D9\uA0DA\uA0DB\uA0DC\uA0DD"+
-        "\uA0E1\uA0E2\uA0E3\uA0E4\uA0E5\uA0E6\uA0E7\uA0E8"+
-        "\uA0E9\uA0EA\uA0EB\uA0EC\uA0ED\uA0EE\uA0EF\uA0F0"+
-        "\uA0F1\uA0F3\uA0F4\uA0F5\uA0F6\uA0F7\uA0F8\uA0F9"+
-        "\uA0FA\uA0FB\uA0FC\uA0FD\uA141\uA142\uA143\uA144"+
-        "\uA145\uA146\uA147\uA148\uA149\uA14A\uA14B\uA14C"+
-        "\uA14D\uA14E\uA14F\uA150\uA151\uA153\uA154\uA155"+
-        "\uA156\uA157\uA158\uA159\uA15A\uA15B\uA15C\uA15D"+
-        "\uA161\uA162\uA163\uA164\uA165\uA166\uA167\uA168"+
-        "\uA169\uA16A\uA16B\uA16C\uA16D\uA16E\uA16F\uA170"+
-        "\uA171\uA173\uA174\uA175\uA176\uA177\uA178\uA179"+
-        "\uA17A\uA17B\uA17C\uA17D\uA181\uA182\uA183\uA184"+
-        "\uA185\uA186\uA187\uA188\uA189\uA18A\uA18B\uA18C"+
-        "\uA18D\uA18E\uA18F\uA190\uA191\uA193\uA194\uA195"+
-        "\uA196\uA197\uA198\uA199\uA19A\uA19B\uA19C\uA19D"+
-        "\uA1A1\uA1A2\uA1A3\uA1A4\uA1A5\uA1A6\uA1A7\uA1A8"+
-        "\uA1A9\uA1AA\uA1AB\uA1AC\uA1AD\uA1AE\uA1AF\uA1B0"+
-        "\uA1B1\uA1B3\uA1B4\uA1B5\uA1B6\uA1B7\uA1B8\uA1B9"+
-        "\uA1BA\uA1BB\uA1BC\uA1BD\uA1C1\uA1C2\uA1C3\uA1C4"+
-        "\uA1C5\uA1C6\uA1C7\uA1C8\uA1C9\uA1CA\uA1CB\uA1CC"+
-        "\uA1CD\uA1CE\uA1CF\uA1D0\uA1D1\uA1D3\uA1D4\uA1D5"+
-        "\uA1D6\uA1D7\uA1D8\uA1D9\uA1DA\uA1DB\uA1DC\uA1DD"+
-        "\uA1E1\uA1E2\uA1E3\uA1E4\uA1E5\uA1E6\uA1E7\uA1E8"+
-        "\uA1E9\uA1EA\uA1EB\uA1EC\uA1ED\uA1EE\uA1EF\uA1F0"+
-        "\uA1F1\uA1F3\uA1F4\uA1F5\uA1F6\uA1F7\uA1F8\uA1F9"+
-        "\uA1FA\uA1FB\uA1FC\uA1FD\uA241\uA242\uA243\uA244"+
-        "\uA245\uA246\uA247\uA248\uA249\uA24A\uA24B\uA24C"+
-        "\uA24D\uA24E\uA24F\uA250\uA251\uA253\uA254\uA255"+
-        "\uA256\uA257\uA258\uA259\uA25A\uA25B\uA25C\uA25D"+
-        "\uA261\uA262\uA263\uA264\uA265\uA266\uA267\uA268"+
-        "\uA269\uA26A\uA26B\uA26C\uA26D\uA26E\uA26F\uA270"+
-        "\uA271\uA273\uA274\uA275\uA276\uA277\uA278\uA279"+
-        "\uA27A\uA27B\uA27C\uA27D\uA281\uA282\uA283\uA284"+
-        "\uA285\uA286\uA287\uA288\uA289\uA28A\uA28B\uA28C"+
-        "\uA28D\uA28E\uA28F\uA290\uA291\uA293\uA294\uA295"+
-        "\uA296\uA297\uA298\uA299\uA29A\uA29B\uA29C\uA29D"+
-        "\uA2A1\uA2A2\uA2A3\uA2A4\uA2A5\uA2A6\uA2A7\uA2A8"+
-        "\uA2A9\uA2AA\uA2AB\uA2AC\uA2AD\uA2AE\uA2AF\uA2B0"+
-        "\uA2B1\uA2B3\uA2B4\uA2B5\uA2B6\uA2B7\uA2B8\uA2B9"+
-        "\uA2BA\uA2BB\uA2BC\uA2BD\uA2C1\uA2C2\uA2C3\uA2C4"+
-        "\uA2C5\uA2C6\uA2C7\uA2C8\uA2C9\uA2CA\uA2CB\uA2CC"+
-        "\uA2CD\uA2CE\uA2CF\uA2D0\uA2D1\uA2D3\uA2D4\uA2D5"+
-        "\uA2D6\uA2D7\uA2D8\uA2D9\uA2DA\uA2DB\uA2DC\uA2DD"+
-        "\uA2E1\uA2E2\uA2E3\uA2E4\uA2E5\uA2E6\uA2E7\uA2E8"+
-        "\uA2E9\uA2EA\uA2EB\uA2EC\uA2ED\uA2EE\uA2EF\uA2F0"+
-        "\uA2F1\uA2F3\uA2F4\uA2F5\uA2F6\uA2F7\uA2F8\uA2F9"+
-        "\uA2FA\uA2FB\uA2FC\uA2FD\uA341\uA342\uA343\uA344"+
-        "\uA345\uA346\uA347\uA348\uA349\uA34A\uA34B\uA34C"+
-        "\uA34D\uA34E\uA34F\uA350\uA351\uA353\uA354\uA355"+
-        "\uA356\uA357\uA358\uA359\uA35A\uA35B\uA35C\uA35D"+
-        "\uA361\uA362\uA363\uA364\uA365\uA366\uA367\uA368"+
-        "\uA369\uA36A\uA36B\uA36C\uA36D\uA36E\uA36F\uA370"+
-        "\uA371\uA373\uA374\uA375\uA376\uA377\uA378\uA379"+
-        "\uA37A\uA37B\uA37C\uA37D\uA381\uA382\uA383\uA384"+
-        "\uA385\uA386\uA387\uA388\uA389\uA38A\uA38B\uA38C"+
-        "\uA38D\uA38E\uA38F\uA390\uA391\uA393\uA394\uA395"+
-        "\uA396\uA397\uA398\uA399\uA39A\uA39B\uA39C\uA39D"+
-        "\uA3A1\uA3A2\uA3A3\uA3A4\uA3A5\uA3A6\uA3A7\uA3A8"+
-        "\uA3A9\uA3AA\uA3AB\uA3AC\uA3AD\uA3AE\uA3AF\uA3B0"+
-        "\uA3B1\uA3B3\uA3B4\uA3B5\uA3B6\uA3B7\uA3B8\uA3B9"+
-        "\uA3BA\uA3BB\uA3BC\uA3BD\uA461\uA462\uA463\uA464"+
-        "\uA465\uA466\uA467\uA468\uA469\uA46A\uA46B\uA46C"+
-        "\uA46D\uA46E\uA46F\uA470\uA471\uA473\uA474\uA475"+
-        "\uA476\uA477\uA478\uA479\uA47A\uA47B\uA47C\uA47D"+
-        "\uA481\uA482\uA483\uA484\uA485\uA486\uA487\uA488"+
-        "\uA489\uA48A\uA48B\uA48C\uA48D\uA48E\uA48F\uA490"+
-        "\uA491\uA493\uA494\uA495\uA496\uA497\uA498\uA499"+
-        "\uA49A\uA49B\uA49C\uA49D\uA4A1\uA4A2\uA4A3\uA4A4"+
-        "\uA4A5\uA4A6\uA4A7\uA4A8\uA4A9\uA4AA\uA4AB\uA4AC"+
-        "\uA4AD\uA4AE\uA4AF\uA4B0\uA4B1\uA4B3\uA4B4\uA4B5"+
-        "\uA4B6\uA4B7\uA4B8\uA4B9\uA4BA\uA4BB\uA4BC\uA4BD"+
-        "\uA4C1\uA4C2\uA4C3\uA4C4\uA4C5\uA4C6\uA4C7\uA4C8"+
-        "\uA4C9\uA4CA\uA4CB\uA4CC\uA4CD\uA4CE\uA4CF\uA4D0"+
-        "\uA4D1\uA4D3\uA4D4\uA4D5\uA4D6\uA4D7\uA4D8\uA4D9"+
-        "\uA4DA\uA4DB\uA4DC\uA4DD\uA4E1\uA4E2\uA4E3\uA4E4"+
-        "\uA4E5\uA4E6\uA4E7\uA4E8\uA4E9\uA4EA\uA4EB\uA4EC"+
-        "\uA4ED\uA4EE\uA4EF\uA4F0\uA4F1\uA4F3\uA4F4\uA4F5"+
-        "\uA4F6\uA4F7\uA4F8\uA4F9\uA4FA\uA4FB\uA4FC\uA4FD"+
-        "\uA541\uA542\uA543\uA544\uA545\uA546\uA547\uA548"+
-        "\uA549\uA54A\uA54B\uA54C\uA54D\uA54E\uA54F\uA550"+
-        "\uA551\uA553\uA554\uA555\uA556\uA557\uA558\uA559"+
-        "\uA55A\uA55B\uA55C\uA55D\uA561\uA562\uA563\uA564"+
-        "\uA565\uA566\uA567\uA568\uA569\uA56A\uA56B\uA56C"+
-        "\uA56D\uA56E\uA56F\uA570\uA571\uA573\uA574\uA575"+
-        "\uA576\uA577\uA578\uA579\uA57A\uA57B\uA57C\uA57D"+
-        "\uA581\uA582\uA583\uA584\uA585\uA586\uA587\uA588"+
-        "\uA589\uA58A\uA58B\uA58C\uA58D\uA58E\uA58F\uA590"+
-        "\uA591\uA593\uA594\uA595\uA596\uA597\uA598\uA599"+
-        "\uA59A\uA59B\uA59C\uA59D\uA5A1\uA5A2\uA5A3\uA5A4"+
-        "\uA5A5\uA5A6\uA5A7\uA5A8\uA5A9\uA5AA\uA5AB\uA5AC"+
-        "\uA5AD\uA5AE\uA5AF\uA5B0\uA5B1\uA5B3\uA5B4\uA5B5"+
-        "\uA5B6\uA5B7\uA5B8\uA5B9\uA5BA\uA5BB\uA5BC\uA5BD"+
-        "\uA5C1\uA5C2\uA5C3\uA5C4\uA5C5\uA5C6\uA5C7\uA5C8"+
-        "\uA5C9\uA5CA\uA5CB\uA5CC\uA5CD\uA5CE\uA5CF\uA5D0"+
-        "\uA5D1\uA5D3\uA5D4\uA5D5\uA5D6\uA5D7\uA5D8\uA5D9"+
-        "\uA5DA\uA5DB\uA5DC\uA5DD\uA5E1\uA5E2\uA5E3\uA5E4"+
-        "\uA5E5\uA5E6\uA5E7\uA5E8\uA5E9\uA5EA\uA5EB\uA5EC"+
-        "\uA5ED\uA5EE\uA5EF\uA5F0\uA5F1\uA5F3\uA5F4\uA5F5"+
-        "\uA5F6\uA5F7\uA5F8\uA5F9\uA5FA\uA5FB\uA5FC\uA5FD"+
-        "\uA641\uA642\uA643\uA644\uA645\uA646\uA647\uA648"+
-        "\uA649\uA64A\uA64B\uA64C\uA64D\uA64E\uA64F\uA650"+
-        "\uA651\uA653\uA654\uA655\uA656\uA657\uA658\uA659"+
-        "\uA65A\uA65B\uA65C\uA65D\uA661\uA662\uA663\uA664"+
-        "\uA665\uA666\uA667\uA668\uA669\uA66A\uA66B\uA66C"+
-        "\uA66D\uA66E\uA66F\uA670\uA671\uA673\uA674\uA675"+
-        "\uA676\uA677\uA678\uA679\uA67A\uA67B\uA67C\uA67D"+
-        "\uA681\uA682\uA683\uA684\uA685\uA686\uA687\uA688"+
-        "\uA689\uA68A\uA68B\uA68C\uA68D\uA68E\uA68F\uA690"+
-        "\uA691\uA693\uA694\uA695\uA696\uA697\uA698\uA699"+
-        "\uA69A\uA69B\uA69C\uA69D\uA6A1\uA6A2\uA6A3\uA6A4"+
-        "\uA6A5\uA6A6\uA6A7\uA6A8\uA6A9\uA6AA\uA6AB\uA6AC"+
-        "\uA6AD\uA6AE\uA6AF\uA6B0\uA6B1\uA6B3\uA6B4\uA6B5"+
-        "\uA6B6\uA6B7\uA6B8\uA6B9\uA6BA\uA6BB\uA6BC\uA6BD"+
-        "\uA6C1\uA6C2\uA6C3\uA6C4\uA6C5\uA6C6\uA6C7\uA6C8"+
-        "\uA6C9\uA6CA\uA6CB\uA6CC\uA6CD\uA6CE\uA6CF\uA6D0"+
-        "\uA6D1\uA6D3\uA6D4\uA6D5\uA6D6\uA6D7\uA6D8\uA6D9"+
-        "\uA6DA\uA6DB\uA6DC\uA6DD\uA6E1\uA6E2\uA6E3\uA6E4"+
-        "\uA6E5\uA6E6\uA6E7\uA6E8\uA6E9\uA6EA\uA6EB\uA6EC"+
-        "\uA6ED\uA6EE\uA6EF\uA6F0\uA6F1\uA6F3\uA6F4\uA6F5"+
-        "\uA6F6\uA6F7\uA6F8\uA6F9\uA6FA\uA6FB\uA6FC\uA6FD"+
-        "\uA741\uA742\uA743\uA744\uA745\uA746\uA747\uA748"+
-        "\uA749\uA74A\uA74B\uA74C\uA74D\uA74E\uA74F\uA750"+
-        "\uA751\uA753\uA754\uA755\uA756\uA757\uA758\uA759"+
-        "\uA75A\uA75B\uA75C\uA75D\uA761\uA762\uA763\uA764"+
-        "\uA765\uA766\uA767\uA768\uA769\uA76A\uA76B\uA76C"+
-        "\uA76D\uA76E\uA76F\uA770\uA771\uA773\uA774\uA775"+
-        "\uA776\uA777\uA778\uA779\uA77A\uA77B\uA77C\uA77D"+
-        "\uA781\uA782\uA783\uA784\uA785\uA786\uA787\uA788"+
-        "\uA789\uA78A\uA78B\uA78C\uA78D\uA78E\uA78F\uA790"+
-        "\uA791\uA793\uA794\uA795\uA796\uA797\uA798\uA799"+
-        "\uA79A\uA79B\uA79C\uA79D\uA7A1\uA7A2\uA7A3\uA7A4"+
-        "\uA7A5\uA7A6\uA7A7\uA7A8\uA7A9\uA7AA\uA7AB\uA7AC"+
-        "\uA7AD\uA7AE\uA7AF\uA7B0\uA7B1\uA7B3\uA7B4\uA7B5"+
-        "\uA7B6\uA7B7\uA7B8\uA7B9\uA7BA\uA7BB\uA7BC\uA7BD"+
-        "\uA861\uA862\uA863\uA864\uA865\uA866\uA867\uA868"+
-        "\uA869\uA86A\uA86B\uA86C\uA86D\uA86E\uA86F\uA870"+
-        "\uA871\uA873\uA874\uA875\uA876\uA877\uA878\uA879"+
-        "\uA87A\uA87B\uA87C\uA87D\uA881\uA882\uA883\uA884"+
-        "\uA885\uA886\uA887\uA888\uA889\uA88A\uA88B\uA88C"+
-        "\uA88D\uA88E\uA88F\uA890\uA891\uA893\uA894\uA895"+
-        "\uA896\uA897\uA898\uA899\uA89A\uA89B\uA89C\uA89D"+
-        "\uA8A1\uA8A2\uA8A3\uA8A4\uA8A5\uA8A6\uA8A7\uA8A8"+
-        "\uA8A9\uA8AA\uA8AB\uA8AC\uA8AD\uA8AE\uA8AF\uA8B0"+
-        "\uA8B1\uA8B3\uA8B4\uA8B5\uA8B6\uA8B7\uA8B8\uA8B9"+
-        "\uA8BA\uA8BB\uA8BC\uA8BD\uA8C1\uA8C2\uA8C3\uA8C4"+
-        "\uA8C5\uA8C6\uA8C7\uA8C8\uA8C9\uA8CA\uA8CB\uA8CC"+
-        "\uA8CD\uA8CE\uA8CF\uA8D0\uA8D1\uA8D3\uA8D4\uA8D5"+
-        "\uA8D6\uA8D7\uA8D8\uA8D9\uA8DA\uA8DB\uA8DC\uA8DD"+
-        "\uA8E1\uA8E2\uA8E3\uA8E4\uA8E5\uA8E6\uA8E7\uA8E8"+
-        "\uA8E9\uA8EA\uA8EB\uA8EC\uA8ED\uA8EE\uA8EF\uA8F0"+
-        "\uA8F1\uA8F3\uA8F4\uA8F5\uA8F6\uA8F7\uA8F8\uA8F9"+
-        "\uA8FA\uA8FB\uA8FC\uA8FD\uA941\uA942\uA943\uA944"+
-        "\uA945\uA946\uA947\uA948\uA949\uA94A\uA94B\uA94C"+
-        "\uA94D\uA94E\uA94F\uA950\uA951\uA953\uA954\uA955"+
-        "\uA956\uA957\uA958\uA959\uA95A\uA95B\uA95C\uA95D"+
-        "\uA961\uA962\uA963\uA964\uA965\uA966\uA967\uA968"+
-        "\uA969\uA96A\uA96B\uA96C\uA96D\uA96E\uA96F\uA970"+
-        "\uA971\uA973\uA974\uA975\uA976\uA977\uA978\uA979"+
-        "\uA97A\uA97B\uA97C\uA97D\uA981\uA982\uA983\uA984"+
-        "\uA985\uA986\uA987\uA988\uA989\uA98A\uA98B\uA98C"+
-        "\uA98D\uA98E\uA98F\uA990\uA991\uA993\uA994\uA995"+
-        "\uA996\uA997\uA998\uA999\uA99A\uA99B\uA99C\uA99D"+
-        "\uA9A1\uA9A2\uA9A3\uA9A4\uA9A5\uA9A6\uA9A7\uA9A8"+
-        "\uA9A9\uA9AA\uA9AB\uA9AC\uA9AD\uA9AE\uA9AF\uA9B0"+
-        "\uA9B1\uA9B3\uA9B4\uA9B5\uA9B6\uA9B7\uA9B8\uA9B9"+
-        "\uA9BA\uA9BB\uA9BC\uA9BD\uA9C1\uA9C2\uA9C3\uA9C4"+
-        "\uA9C5\uA9C6\uA9C7\uA9C8\uA9C9\uA9CA\uA9CB\uA9CC"+
-        "\uA9CD\uA9CE\uA9CF\uA9D0\uA9D1\uA9D3\uA9D4\uA9D5"+
-        "\uA9D6\uA9D7\uA9D8\uA9D9\uA9DA\uA9DB\uA9DC\uA9DD"+
-        "\uA9E1\uA9E2\uA9E3\uA9E4\uA9E5\uA9E6\uA9E7\uA9E8"+
-        "\uA9E9\uA9EA\uA9EB\uA9EC\uA9ED\uA9EE\uA9EF\uA9F0"+
-        "\uA9F1\uA9F3\uA9F4\uA9F5\uA9F6\uA9F7\uA9F8\uA9F9"+
-        "\uA9FA\uA9FB\uA9FC\uA9FD\uAA41\uAA42\uAA43\uAA44"+
-        "\uAA45\uAA46\uAA47\uAA48\uAA49\uAA4A\uAA4B\uAA4C"+
-        "\uAA4D\uAA4E\uAA4F\uAA50\uAA51\uAA53\uAA54\uAA55"+
-        "\uAA56\uAA57\uAA58\uAA59\uAA5A\uAA5B\uAA5C\uAA5D"+
-        "\uAA61\uAA62\uAA63\uAA64\uAA65\uAA66\uAA67\uAA68"+
-        "\uAA69\uAA6A\uAA6B\uAA6C\uAA6D\uAA6E\uAA6F\uAA70"+
-        "\uAA71\uAA73\uAA74\uAA75\uAA76\uAA77\uAA78\uAA79"+
-        "\uAA7A\uAA7B\uAA7C\uAA7D\uAA81\uAA82\uAA83\uAA84"+
-        "\uAA85\uAA86\uAA87\uAA88\uAA89\uAA8A\uAA8B\uAA8C"+
-        "\uAA8D\uAA8E\uAA8F\uAA90\uAA91\uAA93\uAA94\uAA95"+
-        "\uAA96\uAA97\uAA98\uAA99\uAA9A\uAA9B\uAA9C\uAA9D"+
-        "\uAAA1\uAAA2\uAAA3\uAAA4\uAAA5\uAAA6\uAAA7\uAAA8"+
-        "\uAAA9\uAAAA\uAAAB\uAAAC\uAAAD\uAAAE\uAAAF\uAAB0"+
-        "\uAAB1\uAAB3\uAAB4\uAAB5\uAAB6\uAAB7\uAAB8\uAAB9"+
-        "\uAABA\uAABB\uAABC\uAABD\uAAC1\uAAC2\uAAC3\uAAC4"+
-        "\uAAC5\uAAC6\uAAC7\uAAC8\uAAC9\uAACA\uAACB\uAACC"+
-        "\uAACD\uAACE\uAACF\uAAD0\uAAD1\uAAD3\uAAD4\uAAD5"+
-        "\uAAD6\uAAD7\uAAD8\uAAD9\uAADA\uAADB\uAADC\uAADD"+
-        "\uAAE1\uAAE2\uAAE3\uAAE4\uAAE5\uAAE6\uAAE7\uAAE8"+
-        "\uAAE9\uAAEA\uAAEB\uAAEC\uAAED\uAAEE\uAAEF\uAAF0"+
-        "\uAAF1\uAAF3\uAAF4\uAAF5\uAAF6\uAAF7\uAAF8\uAAF9"+
-        "\uAAFA\uAAFB\uAAFC\uAAFD\uAB41\uAB42\uAB43\uAB44"+
-        "\uAB45\uAB46\uAB47\uAB48\uAB49\uAB4A\uAB4B\uAB4C"+
-        "\uAB4D\uAB4E\uAB4F\uAB50\uAB51\uAB53\uAB54\uAB55"+
-        "\uAB56\uAB57\uAB58\uAB59\uAB5A\uAB5B\uAB5C\uAB5D"+
-        "\uAB61\uAB62\uAB63\uAB64\uAB65\uAB66\uAB67\uAB68"+
-        "\uAB69\uAB6A\uAB6B\uAB6C\uAB6D\uAB6E\uAB6F\uAB70"+
-        "\uAB71\uAB73\uAB74\uAB75\uAB76\uAB77\uAB78\uAB79"+
-        "\uAB7A\uAB7B\uAB7C\uAB7D\uAB81\uAB82\uAB83\uAB84"+
-        "\uAB85\uAB86\uAB87\uAB88\uAB89\uAB8A\uAB8B\uAB8C"+
-        "\uAB8D\uAB8E\uAB8F\uAB90\uAB91\uAB93\uAB94\uAB95"+
-        "\uAB96\uAB97\uAB98\uAB99\uAB9A\uAB9B\uAB9C\uAB9D"+
-        "\uABA1\uABA2\uABA3\uABA4\uABA5\uABA6\uABA7\uABA8"+
-        "\uABA9\uABAA\uABAB\uABAC\uABAD\uABAE\uABAF\uABB0"+
-        "\uABB1\uABB3\uABB4\uABB5\uABB6\uABB7\uABB8\uABB9"+
-        "\uABBA\uABBB\uABBC\uABBD\uAC61\uAC62\uAC63\uAC64"+
-        "\uAC65\uAC66\uAC67\uAC68\uAC69\uAC6A\uAC6B\uAC6C"+
-        "\uAC6D\uAC6E\uAC6F\uAC70\uAC71\uAC73\uAC74\uAC75"+
-        "\uAC76\uAC77\uAC78\uAC79\uAC7A\uAC7B\uAC7C\uAC7D"+
-        "\uAC81\uAC82\uAC83\uAC84\uAC85\uAC86\uAC87\uAC88"+
-        "\uAC89\uAC8A\uAC8B\uAC8C\uAC8D\uAC8E\uAC8F\uAC90"+
-        "\uAC91\uAC93\uAC94\uAC95\uAC96\uAC97\uAC98\uAC99"+
-        "\uAC9A\uAC9B\uAC9C\uAC9D\uACA1\uACA2\uACA3\uACA4"+
-        "\uACA5\uACA6\uACA7\uACA8\uACA9\uACAA\uACAB\uACAC"+
-        "\uACAD\uACAE\uACAF\uACB0\uACB1\uACB3\uACB4\uACB5"+
-        "\uACB6\uACB7\uACB8\uACB9\uACBA\uACBB\uACBC\uACBD"+
-        "\uACC1\uACC2\uACC3\uACC4\uACC5\uACC6\uACC7\uACC8"+
-        "\uACC9\uACCA\uACCB\uACCC\uACCD\uACCE\uACCF\uACD0"+
-        "\uACD1\uACD3\uACD4\uACD5\uACD6\uACD7\uACD8\uACD9"+
-        "\uACDA\uACDB\uACDC\uACDD\uACE1\uACE2\uACE3\uACE4"+
-        "\uACE5\uACE6\uACE7\uACE8\uACE9\uACEA\uACEB\uACEC"+
-        "\uACED\uACEE\uACEF\uACF0\uACF1\uACF3\uACF4\uACF5"+
-        "\uACF6\uACF7\uACF8\uACF9\uACFA\uACFB\uACFC\uACFD"+
-        "\uAD41\uAD42\uAD43\uAD44\uAD45\uAD46\uAD47\uAD48"+
-        "\uAD49\uAD4A\uAD4B\uAD4C\uAD4D\uAD4E\uAD4F\uAD50"+
-        "\uAD51\uAD53\uAD54\uAD55\uAD56\uAD57\uAD58\uAD59"+
-        "\uAD5A\uAD5B\uAD5C\uAD5D\uAD61\uAD62\uAD63\uAD64"+
-        "\uAD65\uAD66\uAD67\uAD68\uAD69\uAD6A\uAD6B\uAD6C"+
-        "\uAD6D\uAD6E\uAD6F\uAD70\uAD71\uAD73\uAD74\uAD75"+
-        "\uAD76\uAD77\uAD78\uAD79\uAD7A\uAD7B\uAD7C\uAD7D"+
-        "\uAD81\uAD82\uAD83\uAD84\uAD85\uAD86\uAD87\uAD88"+
-        "\uAD89\uAD8A\uAD8B\uAD8C\uAD8D\uAD8E\uAD8F\uAD90"+
-        "\uAD91\uAD93\uAD94\uAD95\uAD96\uAD97\uAD98\uAD99"+
-        "\uAD9A\uAD9B\uAD9C\uAD9D\uADA1\uADA2\uADA3\uADA4"+
-        "\uADA5\uADA6\uADA7\uADA8\uADA9\uADAA\uADAB\uADAC"+
-        "\uADAD\uADAE\uADAF\uADB0\uADB1\uADB3\uADB4\uADB5"+
-        "\uADB6\uADB7\uADB8\uADB9\uADBA\uADBB\uADBC\uADBD"+
-        "\uADC1\uADC2\uADC3\uADC4\uADC5\uADC6\uADC7\uADC8"+
-        "\uADC9\uADCA\uADCB\uADCC\uADCD\uADCE\uADCF\uADD0"+
-        "\uADD1\uADD3\uADD4\uADD5\uADD6\uADD7\uADD8\uADD9"+
-        "\uADDA\uADDB\uADDC\uADDD\uADE1\uADE2\uADE3\uADE4"+
-        "\uADE5\uADE6\uADE7\uADE8\uADE9\uADEA\uADEB\uADEC"+
-        "\uADED\uADEE\uADEF\uADF0\uADF1\uADF3\uADF4\uADF5"+
-        "\uADF6\uADF7\uADF8\uADF9\uADFA\uADFB\uADFC\uADFD"+
-        "\uAE41\uAE42\uAE43\uAE44\uAE45\uAE46\uAE47\uAE48"+
-        "\uAE49\uAE4A\uAE4B\uAE4C\uAE4D\uAE4E\uAE4F\uAE50"+
-        "\uAE51\uAE53\uAE54\uAE55\uAE56\uAE57\uAE58\uAE59"+
-        "\uAE5A\uAE5B\uAE5C\uAE5D\uAE61\uAE62\uAE63\uAE64"+
-        "\uAE65\uAE66\uAE67\uAE68\uAE69\uAE6A\uAE6B\uAE6C"+
-        "\uAE6D\uAE6E\uAE6F\uAE70\uAE71\uAE73\uAE74\uAE75"+
-        "\uAE76\uAE77\uAE78\uAE79\uAE7A\uAE7B\uAE7C\uAE7D"+
-        "\uAE81\uAE82\uAE83\uAE84\uAE85\uAE86\uAE87\uAE88"+
-        "\uAE89\uAE8A\uAE8B\uAE8C\uAE8D\uAE8E\uAE8F\uAE90"+
-        "\uAE91\uAE93\uAE94\uAE95\uAE96\uAE97\uAE98\uAE99"+
-        "\uAE9A\uAE9B\uAE9C\uAE9D\uAEA1\uAEA2\uAEA3\uAEA4"+
-        "\uAEA5\uAEA6\uAEA7\uAEA8\uAEA9\uAEAA\uAEAB\uAEAC"+
-        "\uAEAD\uAEAE\uAEAF\uAEB0\uAEB1\uAEB3\uAEB4\uAEB5"+
-        "\uAEB6\uAEB7\uAEB8\uAEB9\uAEBA\uAEBB\uAEBC\uAEBD"+
-        "\uAEC1\uAEC2\uAEC3\uAEC4\uAEC5\uAEC6\uAEC7\uAEC8"+
-        "\uAEC9\uAECA\uAECB\uAECC\uAECD\uAECE\uAECF\uAED0"+
-        "\uAED1\uAED3\uAED4\uAED5\uAED6\uAED7\uAED8\uAED9"+
-        "\uAEDA\uAEDB\uAEDC\uAEDD\uAEE1\uAEE2\uAEE3\uAEE4"+
-        "\uAEE5\uAEE6\uAEE7\uAEE8\uAEE9\uAEEA\uAEEB\uAEEC"+
-        "\uAEED\uAEEE\uAEEF\uAEF0\uAEF1\uAEF3\uAEF4\uAEF5"+
-        "\uAEF6\uAEF7\uAEF8\uAEF9\uAEFA\uAEFB\uAEFC\uAEFD"+
-        "\uAF41\uAF42\uAF43\uAF44\uAF45\uAF46\uAF47\uAF48"+
-        "\uAF49\uAF4A\uAF4B\uAF4C\uAF4D\uAF4E\uAF4F\uAF50"+
-        "\uAF51\uAF53\uAF54\uAF55\uAF56\uAF57\uAF58\uAF59"+
-        "\uAF5A\uAF5B\uAF5C\uAF5D\uAF61\uAF62\uAF63\uAF64"+
-        "\uAF65\uAF66\uAF67\uAF68\uAF69\uAF6A\uAF6B\uAF6C"+
-        "\uAF6D\uAF6E\uAF6F\uAF70\uAF71\uAF73\uAF74\uAF75"+
-        "\uAF76\uAF77\uAF78\uAF79\uAF7A\uAF7B\uAF7C\uAF7D"+
-        "\uAF81\uAF82\uAF83\uAF84\uAF85\uAF86\uAF87\uAF88"+
-        "\uAF89\uAF8A\uAF8B\uAF8C\uAF8D\uAF8E\uAF8F\uAF90"+
-        "\uAF91\uAF93\uAF94\uAF95\uAF96\uAF97\uAF98\uAF99"+
-        "\uAF9A\uAF9B\uAF9C\uAF9D\uAFA1\uAFA2\uAFA3\uAFA4"+
-        "\uAFA5\uAFA6\uAFA7\uAFA8\uAFA9\uAFAA\uAFAB\uAFAC"+
-        "\uAFAD\uAFAE\uAFAF\uAFB0\uAFB1\uAFB3\uAFB4\uAFB5"+
-        "\uAFB6\uAFB7\uAFB8\uAFB9\uAFBA\uAFBB\uAFBC\uAFBD"+
-        "\uB061\uB062\uB063\uB064\uB065\uB066\uB067\uB068"+
-        "\uB069\uB06A\uB06B\uB06C\uB06D\uB06E\uB06F\uB070"+
-        "\uB071\uB073\uB074\uB075\uB076\uB077\uB078\uB079"+
-        "\uB07A\uB07B\uB07C\uB07D\uB081\uB082\uB083\uB084"+
-        "\uB085\uB086\uB087\uB088\uB089\uB08A\uB08B\uB08C"+
-        "\uB08D\uB08E\uB08F\uB090\uB091\uB093\uB094\uB095"+
-        "\uB096\uB097\uB098\uB099\uB09A\uB09B\uB09C\uB09D"+
-        "\uB0A1\uB0A2\uB0A3\uB0A4\uB0A5\uB0A6\uB0A7\uB0A8"+
-        "\uB0A9\uB0AA\uB0AB\uB0AC\uB0AD\uB0AE\uB0AF\uB0B0"+
-        "\uB0B1\uB0B3\uB0B4\uB0B5\uB0B6\uB0B7\uB0B8\uB0B9"+
-        "\uB0BA\uB0BB\uB0BC\uB0BD\uB0C1\uB0C2\uB0C3\uB0C4"+
-        "\uB0C5\uB0C6\uB0C7\uB0C8\uB0C9\uB0CA\uB0CB\uB0CC"+
-        "\uB0CD\uB0CE\uB0CF\uB0D0\uB0D1\uB0D3\uB0D4\uB0D5"+
-        "\uB0D6\uB0D7\uB0D8\uB0D9\uB0DA\uB0DB\uB0DC\uB0DD"+
-        "\uB0E1\uB0E2\uB0E3\uB0E4\uB0E5\uB0E6\uB0E7\uB0E8"+
-        "\uB0E9\uB0EA\uB0EB\uB0EC\uB0ED\uB0EE\uB0EF\uB0F0"+
-        "\uB0F1\uB0F3\uB0F4\uB0F5\uB0F6\uB0F7\uB0F8\uB0F9"+
-        "\uB0FA\uB0FB\uB0FC\uB0FD\uB141\uB142\uB143\uB144"+
-        "\uB145\uB146\uB147\uB148\uB149\uB14A\uB14B\uB14C"+
-        "\uB14D\uB14E\uB14F\uB150\uB151\uB153\uB154\uB155"+
-        "\uB156\uB157\uB158\uB159\uB15A\uB15B\uB15C\uB15D"+
-        "\uB161\uB162\uB163\uB164\uB165\uB166\uB167\uB168"+
-        "\uB169\uB16A\uB16B\uB16C\uB16D\uB16E\uB16F\uB170"+
-        "\uB171\uB173\uB174\uB175\uB176\uB177\uB178\uB179"+
-        "\uB17A\uB17B\uB17C\uB17D\uB181\uB182\uB183\uB184"+
-        "\uB185\uB186\uB187\uB188\uB189\uB18A\uB18B\uB18C"+
-        "\uB18D\uB18E\uB18F\uB190\uB191\uB193\uB194\uB195"+
-        "\uB196\uB197\uB198\uB199\uB19A\uB19B\uB19C\uB19D"+
-        "\uB1A1\uB1A2\uB1A3\uB1A4\uB1A5\uB1A6\uB1A7\uB1A8"+
-        "\uB1A9\uB1AA\uB1AB\uB1AC\uB1AD\uB1AE\uB1AF\uB1B0"+
-        "\uB1B1\uB1B3\uB1B4\uB1B5\uB1B6\uB1B7\uB1B8\uB1B9"+
-        "\uB1BA\uB1BB\uB1BC\uB1BD\uB1C1\uB1C2\uB1C3\uB1C4"+
-        "\uB1C5\uB1C6\uB1C7\uB1C8\uB1C9\uB1CA\uB1CB\uB1CC"+
-        "\uB1CD\uB1CE\uB1CF\uB1D0\uB1D1\uB1D3\uB1D4\uB1D5"+
-        "\uB1D6\uB1D7\uB1D8\uB1D9\uB1DA\uB1DB\uB1DC\uB1DD"+
-        "\uB1E1\uB1E2\uB1E3\uB1E4\uB1E5\uB1E6\uB1E7\uB1E8"+
-        "\uB1E9\uB1EA\uB1EB\uB1EC\uB1ED\uB1EE\uB1EF\uB1F0"+
-        "\uB1F1\uB1F3\uB1F4\uB1F5\uB1F6\uB1F7\uB1F8\uB1F9"+
-        "\uB1FA\uB1FB\uB1FC\uB1FD\uB241\uB242\uB243\uB244"+
-        "\uB245\uB246\uB247\uB248\uB249\uB24A\uB24B\uB24C"+
-        "\uB24D\uB24E\uB24F\uB250\uB251\uB253\uB254\uB255"+
-        "\uB256\uB257\uB258\uB259\uB25A\uB25B\uB25C\uB25D"+
-        "\uB261\uB262\uB263\uB264\uB265\uB266\uB267\uB268"+
-        "\uB269\uB26A\uB26B\uB26C\uB26D\uB26E\uB26F\uB270"+
-        "\uB271\uB273\uB274\uB275\uB276\uB277\uB278\uB279"+
-        "\uB27A\uB27B\uB27C\uB27D\uB281\uB282\uB283\uB284"+
-        "\uB285\uB286\uB287\uB288\uB289\uB28A\uB28B\uB28C"+
-        "\uB28D\uB28E\uB28F\uB290\uB291\uB293\uB294\uB295"+
-        "\uB296\uB297\uB298\uB299\uB29A\uB29B\uB29C\uB29D"+
-        "\uB2A1\uB2A2\uB2A3\uB2A4\uB2A5\uB2A6\uB2A7\uB2A8"+
-        "\uB2A9\uB2AA\uB2AB\uB2AC\uB2AD\uB2AE\uB2AF\uB2B0"+
-        "\uB2B1\uB2B3\uB2B4\uB2B5\uB2B6\uB2B7\uB2B8\uB2B9"+
-        "\uB2BA\uB2BB\uB2BC\uB2BD\uB2C1\uB2C2\uB2C3\uB2C4"+
-        "\uB2C5\uB2C6\uB2C7\uB2C8\uB2C9\uB2CA\uB2CB\uB2CC"+
-        "\uB2CD\uB2CE\uB2CF\uB2D0\uB2D1\uB2D3\uB2D4\uB2D5"+
-        "\uB2D6\uB2D7\uB2D8\uB2D9\uB2DA\uB2DB\uB2DC\uB2DD"+
-        "\uB2E1\uB2E2\uB2E3\uB2E4\uB2E5\uB2E6\uB2E7\uB2E8"+
-        "\uB2E9\uB2EA\uB2EB\uB2EC\uB2ED\uB2EE\uB2EF\uB2F0"+
-        "\uB2F1\uB2F3\uB2F4\uB2F5\uB2F6\uB2F7\uB2F8\uB2F9"+
-        "\uB2FA\uB2FB\uB2FC\uB2FD\uB341\uB342\uB343\uB344"+
-        "\uB345\uB346\uB347\uB348\uB349\uB34A\uB34B\uB34C"+
-        "\uB34D\uB34E\uB34F\uB350\uB351\uB353\uB354\uB355"+
-        "\uB356\uB357\uB358\uB359\uB35A\uB35B\uB35C\uB35D"+
-        "\uB361\uB362\uB363\uB364\uB365\uB366\uB367\uB368"+
-        "\uB369\uB36A\uB36B\uB36C\uB36D\uB36E\uB36F\uB370"+
-        "\uB371\uB373\uB374\uB375\uB376\uB377\uB378\uB379"+
-        "\uB37A\uB37B\uB37C\uB37D\uB381\uB382\uB383\uB384"+
-        "\uB385\uB386\uB387\uB388\uB389\uB38A\uB38B\uB38C"+
-        "\uB38D\uB38E\uB38F\uB390\uB391\uB393\uB394\uB395"+
-        "\uB396\uB397\uB398\uB399\uB39A\uB39B\uB39C\uB39D"+
-        "\uB3A1\uB3A2\uB3A3\uB3A4\uB3A5\uB3A6\uB3A7\uB3A8"+
-        "\uB3A9\uB3AA\uB3AB\uB3AC\uB3AD\uB3AE\uB3AF\uB3B0"+
-        "\uB3B1\uB3B3\uB3B4\uB3B5\uB3B6\uB3B7\uB3B8\uB3B9"+
-        "\uB3BA\uB3BB\uB3BC\uB3BD\uB461\uB462\uB463\uB464"+
-        "\uB465\uB466\uB467\uB468\uB469\uB46A\uB46B\uB46C"+
-        "\uB46D\uB46E\uB46F\uB470\uB471\uB473\uB474\uB475"+
-        "\uB476\uB477\uB478\uB479\uB47A\uB47B\uB47C\uB47D"+
-        "\uB481\uB482\uB483\uB484\uB485\uB486\uB487\uB488"+
-        "\uB489\uB48A\uB48B\uB48C\uB48D\uB48E\uB48F\uB490"+
-        "\uB491\uB493\uB494\uB495\uB496\uB497\uB498\uB499"+
-        "\uB49A\uB49B\uB49C\uB49D\uB4A1\uB4A2\uB4A3\uB4A4"+
-        "\uB4A5\uB4A6\uB4A7\uB4A8\uB4A9\uB4AA\uB4AB\uB4AC"+
-        "\uB4AD\uB4AE\uB4AF\uB4B0\uB4B1\uB4B3\uB4B4\uB4B5"+
-        "\uB4B6\uB4B7\uB4B8\uB4B9\uB4BA\uB4BB\uB4BC\uB4BD"+
-        "\uB4C1\uB4C2\uB4C3\uB4C4\uB4C5\uB4C6\uB4C7\uB4C8"+
-        "\uB4C9\uB4CA\uB4CB\uB4CC\uB4CD\uB4CE\uB4CF\uB4D0"+
-        "\uB4D1\uB4D3\uB4D4\uB4D5\uB4D6\uB4D7\uB4D8\uB4D9"+
-        "\uB4DA\uB4DB\uB4DC\uB4DD\uB4E1\uB4E2\uB4E3\uB4E4"+
-        "\uB4E5\uB4E6\uB4E7\uB4E8\uB4E9\uB4EA\uB4EB\uB4EC"+
-        "\uB4ED\uB4EE\uB4EF\uB4F0\uB4F1\uB4F3\uB4F4\uB4F5"+
-        "\uB4F6\uB4F7\uB4F8\uB4F9\uB4FA\uB4FB\uB4FC\uB4FD"+
-        "\uB541\uB542\uB543\uB544\uB545\uB546\uB547\uB548"+
-        "\uB549\uB54A\uB54B\uB54C\uB54D\uB54E\uB54F\uB550"+
-        "\uB551\uB553\uB554\uB555\uB556\uB557\uB558\uB559"+
-        "\uB55A\uB55B\uB55C\uB55D\uB561\uB562\uB563\uB564"+
-        "\uB565\uB566\uB567\uB568\uB569\uB56A\uB56B\uB56C"+
-        "\uB56D\uB56E\uB56F\uB570\uB571\uB573\uB574\uB575"+
-        "\uB576\uB577\uB578\uB579\uB57A\uB57B\uB57C\uB57D"+
-        "\uB581\uB582\uB583\uB584\uB585\uB586\uB587\uB588"+
-        "\uB589\uB58A\uB58B\uB58C\uB58D\uB58E\uB58F\uB590"+
-        "\uB591\uB593\uB594\uB595\uB596\uB597\uB598\uB599"+
-        "\uB59A\uB59B\uB59C\uB59D\uB5A1\uB5A2\uB5A3\uB5A4"+
-        "\uB5A5\uB5A6\uB5A7\uB5A8\uB5A9\uB5AA\uB5AB\uB5AC"+
-        "\uB5AD\uB5AE\uB5AF\uB5B0\uB5B1\uB5B3\uB5B4\uB5B5"+
-        "\uB5B6\uB5B7\uB5B8\uB5B9\uB5BA\uB5BB\uB5BC\uB5BD"+
-        "\uB5C1\uB5C2\uB5C3\uB5C4\uB5C5\uB5C6\uB5C7\uB5C8"+
-        "\uB5C9\uB5CA\uB5CB\uB5CC\uB5CD\uB5CE\uB5CF\uB5D0"+
-        "\uB5D1\uB5D3\uB5D4\uB5D5\uB5D6\uB5D7\uB5D8\uB5D9"+
-        "\uB5DA\uB5DB\uB5DC\uB5DD\uB5E1\uB5E2\uB5E3\uB5E4"+
-        "\uB5E5\uB5E6\uB5E7\uB5E8\uB5E9\uB5EA\uB5EB\uB5EC"+
-        "\uB5ED\uB5EE\uB5EF\uB5F0\uB5F1\uB5F3\uB5F4\uB5F5"+
-        "\uB5F6\uB5F7\uB5F8\uB5F9\uB5FA\uB5FB\uB5FC\uB5FD"+
-        "\uB641\uB642\uB643\uB644\uB645\uB646\uB647\uB648"+
-        "\uB649\uB64A\uB64B\uB64C\uB64D\uB64E\uB64F\uB650"+
-        "\uB651\uB653\uB654\uB655\uB656\uB657\uB658\uB659"+
-        "\uB65A\uB65B\uB65C\uB65D\uB661\uB662\uB663\uB664"+
-        "\uB665\uB666\uB667\uB668\uB669\uB66A\uB66B\uB66C"+
-        "\uB66D\uB66E\uB66F\uB670\uB671\uB673\uB674\uB675"+
-        "\uB676\uB677\uB678\uB679\uB67A\uB67B\uB67C\uB67D"+
-        "\uB681\uB682\uB683\uB684\uB685\uB686\uB687\uB688"+
-        "\uB689\uB68A\uB68B\uB68C\uB68D\uB68E\uB68F\uB690"+
-        "\uB691\uB693\uB694\uB695\uB696\uB697\uB698\uB699"+
-        "\uB69A\uB69B\uB69C\uB69D\uB6A1\uB6A2\uB6A3\uB6A4"+
-        "\uB6A5\uB6A6\uB6A7\uB6A8\uB6A9\uB6AA\uB6AB\uB6AC"+
-        "\uB6AD\uB6AE\uB6AF\uB6B0\uB6B1\uB6B3\uB6B4\uB6B5"+
-        "\uB6B6\uB6B7\uB6B8\uB6B9\uB6BA\uB6BB\uB6BC\uB6BD"+
-        "\uB6C1\uB6C2\uB6C3\uB6C4\uB6C5\uB6C6\uB6C7\uB6C8"+
-        "\uB6C9\uB6CA\uB6CB\uB6CC\uB6CD\uB6CE\uB6CF\uB6D0"+
-        "\uB6D1\uB6D3\uB6D4\uB6D5\uB6D6\uB6D7\uB6D8\uB6D9"+
-        "\uB6DA\uB6DB\uB6DC\uB6DD\uB6E1\uB6E2\uB6E3\uB6E4"+
-        "\uB6E5\uB6E6\uB6E7\uB6E8\uB6E9\uB6EA\uB6EB\uB6EC"+
-        "\uB6ED\uB6EE\uB6EF\uB6F0\uB6F1\uB6F3\uB6F4\uB6F5"+
-        "\uB6F6\uB6F7\uB6F8\uB6F9\uB6FA\uB6FB\uB6FC\uB6FD"+
-        "\uB741\uB742\uB743\uB744\uB745\uB746\uB747\uB748"+
-        "\uB749\uB74A\uB74B\uB74C\uB74D\uB74E\uB74F\uB750"+
-        "\uB751\uB753\uB754\uB755\uB756\uB757\uB758\uB759"+
-        "\uB75A\uB75B\uB75C\uB75D\uB761\uB762\uB763\uB764"+
-        "\uB765\uB766\uB767\uB768\uB769\uB76A\uB76B\uB76C"+
-        "\uB76D\uB76E\uB76F\uB770\uB771\uB773\uB774\uB775"+
-        "\uB776\uB777\uB778\uB779\uB77A\uB77B\uB77C\uB77D"+
-        "\uB781\uB782\uB783\uB784\uB785\uB786\uB787\uB788"+
-        "\uB789\uB78A\uB78B\uB78C\uB78D\uB78E\uB78F\uB790"+
-        "\uB791\uB793\uB794\uB795\uB796\uB797\uB798\uB799"+
-        "\uB79A\uB79B\uB79C\uB79D\uB7A1\uB7A2\uB7A3\uB7A4"+
-        "\uB7A5\uB7A6\uB7A7\uB7A8\uB7A9\uB7AA\uB7AB\uB7AC"+
-        "\uB7AD\uB7AE\uB7AF\uB7B0\uB7B1\uB7B3\uB7B4\uB7B5"+
-        "\uB7B6\uB7B7\uB7B8\uB7B9\uB7BA\uB7BB\uB7BC\uB7BD"+
-        "\uB861\uB862\uB863\uB864\uB865\uB866\uB867\uB868"+
-        "\uB869\uB86A\uB86B\uB86C\uB86D\uB86E\uB86F\uB870"+
-        "\uB871\uB873\uB874\uB875\uB876\uB877\uB878\uB879"+
-        "\uB87A\uB87B\uB87C\uB87D\uB881\uB882\uB883\uB884"+
-        "\uB885\uB886\uB887\uB888\uB889\uB88A\uB88B\uB88C"+
-        "\uB88D\uB88E\uB88F\uB890\uB891\uB893\uB894\uB895"+
-        "\uB896\uB897\uB898\uB899\uB89A\uB89B\uB89C\uB89D"+
-        "\uB8A1\uB8A2\uB8A3\uB8A4\uB8A5\uB8A6\uB8A7\uB8A8"+
-        "\uB8A9\uB8AA\uB8AB\uB8AC\uB8AD\uB8AE\uB8AF\uB8B0"+
-        "\uB8B1\uB8B3\uB8B4\uB8B5\uB8B6\uB8B7\uB8B8\uB8B9"+
-        "\uB8BA\uB8BB\uB8BC\uB8BD\uB8C1\uB8C2\uB8C3\uB8C4"+
-        "\uB8C5\uB8C6\uB8C7\uB8C8\uB8C9\uB8CA\uB8CB\uB8CC"+
-        "\uB8CD\uB8CE\uB8CF\uB8D0\uB8D1\uB8D3\uB8D4\uB8D5"+
-        "\uB8D6\uB8D7\uB8D8\uB8D9\uB8DA\uB8DB\uB8DC\uB8DD"+
-        "\uB8E1\uB8E2\uB8E3\uB8E4\uB8E5\uB8E6\uB8E7\uB8E8"+
-        "\uB8E9\uB8EA\uB8EB\uB8EC\uB8ED\uB8EE\uB8EF\uB8F0"+
-        "\uB8F1\uB8F3\uB8F4\uB8F5\uB8F6\uB8F7\uB8F8\uB8F9"+
-        "\uB8FA\uB8FB\uB8FC\uB8FD\uB941\uB942\uB943\uB944"+
-        "\uB945\uB946\uB947\uB948\uB949\uB94A\uB94B\uB94C"+
-        "\uB94D\uB94E\uB94F\uB950\uB951\uB953\uB954\uB955"+
-        "\uB956\uB957\uB958\uB959\uB95A\uB95B\uB95C\uB95D"+
-        "\uB961\uB962\uB963\uB964\uB965\uB966\uB967\uB968"+
-        "\uB969\uB96A\uB96B\uB96C\uB96D\uB96E\uB96F\uB970"+
-        "\uB971\uB973\uB974\uB975\uB976\uB977\uB978\uB979"+
-        "\uB97A\uB97B\uB97C\uB97D\uB981\uB982\uB983\uB984"+
-        "\uB985\uB986\uB987\uB988\uB989\uB98A\uB98B\uB98C"+
-        "\uB98D\uB98E\uB98F\uB990\uB991\uB993\uB994\uB995"+
-        "\uB996\uB997\uB998\uB999\uB99A\uB99B\uB99C\uB99D"+
-        "\uB9A1\uB9A2\uB9A3\uB9A4\uB9A5\uB9A6\uB9A7\uB9A8"+
-        "\uB9A9\uB9AA\uB9AB\uB9AC\uB9AD\uB9AE\uB9AF\uB9B0"+
-        "\uB9B1\uB9B3\uB9B4\uB9B5\uB9B6\uB9B7\uB9B8\uB9B9"+
-        "\uB9BA\uB9BB\uB9BC\uB9BD\uB9C1\uB9C2\uB9C3\uB9C4"+
-        "\uB9C5\uB9C6\uB9C7\uB9C8\uB9C9\uB9CA\uB9CB\uB9CC"+
-        "\uB9CD\uB9CE\uB9CF\uB9D0\uB9D1\uB9D3\uB9D4\uB9D5"+
-        "\uB9D6\uB9D7\uB9D8\uB9D9\uB9DA\uB9DB\uB9DC\uB9DD"+
-        "\uB9E1\uB9E2\uB9E3\uB9E4\uB9E5\uB9E6\uB9E7\uB9E8"+
-        "\uB9E9\uB9EA\uB9EB\uB9EC\uB9ED\uB9EE\uB9EF\uB9F0"+
-        "\uB9F1\uB9F3\uB9F4\uB9F5\uB9F6\uB9F7\uB9F8\uB9F9"+
-        "\uB9FA\uB9FB\uB9FC\uB9FD\uBA41\uBA42\uBA43\uBA44"+
-        "\uBA45\uBA46\uBA47\uBA48\uBA49\uBA4A\uBA4B\uBA4C"+
-        "\uBA4D\uBA4E\uBA4F\uBA50\uBA51\uBA53\uBA54\uBA55"+
-        "\uBA56\uBA57\uBA58\uBA59\uBA5A\uBA5B\uBA5C\uBA5D"+
-        "\uBA61\uBA62\uBA63\uBA64\uBA65\uBA66\uBA67\uBA68"+
-        "\uBA69\uBA6A\uBA6B\uBA6C\uBA6D\uBA6E\uBA6F\uBA70"+
-        "\uBA71\uBA73\uBA74\uBA75\uBA76\uBA77\uBA78\uBA79"+
-        "\uBA7A\uBA7B\uBA7C\uBA7D\uBA81\uBA82\uBA83\uBA84";
-
-    private final static String innerIndex8=
-        "\uBA85\uBA86\uBA87\uBA88\uBA89\uBA8A\uBA8B\uBA8C"+
-        "\uBA8D\uBA8E\uBA8F\uBA90\uBA91\uBA93\uBA94\uBA95"+
-        "\uBA96\uBA97\uBA98\uBA99\uBA9A\uBA9B\uBA9C\uBA9D"+
-        "\uBAA1\uBAA2\uBAA3\uBAA4\uBAA5\uBAA6\uBAA7\uBAA8"+
-        "\uBAA9\uBAAA\uBAAB\uBAAC\uBAAD\uBAAE\uBAAF\uBAB0"+
-        "\uBAB1\uBAB3\uBAB4\uBAB5\uBAB6\uBAB7\uBAB8\uBAB9"+
-        "\uBABA\uBABB\uBABC\uBABD\uBAC1\uBAC2\uBAC3\uBAC4"+
-        "\uBAC5\uBAC6\uBAC7\uBAC8\uBAC9\uBACA\uBACB\uBACC"+
-        "\uBACD\uBACE\uBACF\uBAD0\uBAD1\uBAD3\uBAD4\uBAD5"+
-        "\uBAD6\uBAD7\uBAD8\uBAD9\uBADA\uBADB\uBADC\uBADD"+
-        "\uBAE1\uBAE2\uBAE3\uBAE4\uBAE5\uBAE6\uBAE7\uBAE8"+
-        "\uBAE9\uBAEA\uBAEB\uBAEC\uBAED\uBAEE\uBAEF\uBAF0"+
-        "\uBAF1\uBAF3\uBAF4\uBAF5\uBAF6\uBAF7\uBAF8\uBAF9"+
-        "\uBAFA\uBAFB\uBAFC\uBAFD\uBB41\uBB42\uBB43\uBB44"+
-        "\uBB45\uBB46\uBB47\uBB48\uBB49\uBB4A\uBB4B\uBB4C"+
-        "\uBB4D\uBB4E\uBB4F\uBB50\uBB51\uBB53\uBB54\uBB55"+
-        "\uBB56\uBB57\uBB58\uBB59\uBB5A\uBB5B\uBB5C\uBB5D"+
-        "\uBB61\uBB62\uBB63\uBB64\uBB65\uBB66\uBB67\uBB68"+
-        "\uBB69\uBB6A\uBB6B\uBB6C\uBB6D\uBB6E\uBB6F\uBB70"+
-        "\uBB71\uBB73\uBB74\uBB75\uBB76\uBB77\uBB78\uBB79"+
-        "\uBB7A\uBB7B\uBB7C\uBB7D\uBB81\uBB82\uBB83\uBB84"+
-        "\uBB85\uBB86\uBB87\uBB88\uBB89\uBB8A\uBB8B\uBB8C"+
-        "\uBB8D\uBB8E\uBB8F\uBB90\uBB91\uBB93\uBB94\uBB95"+
-        "\uBB96\uBB97\uBB98\uBB99\uBB9A\uBB9B\uBB9C\uBB9D"+
-        "\uBBA1\uBBA2\uBBA3\uBBA4\uBBA5\uBBA6\uBBA7\uBBA8"+
-        "\uBBA9\uBBAA\uBBAB\uBBAC\uBBAD\uBBAE\uBBAF\uBBB0"+
-        "\uBBB1\uBBB3\uBBB4\uBBB5\uBBB6\uBBB7\uBBB8\uBBB9"+
-        "\uBBBA\uBBBB\uBBBC\uBBBD\uBC61\uBC62\uBC63\uBC64"+
-        "\uBC65\uBC66\uBC67\uBC68\uBC69\uBC6A\uBC6B\uBC6C"+
-        "\uBC6D\uBC6E\uBC6F\uBC70\uBC71\uBC73\uBC74\uBC75"+
-        "\uBC76\uBC77\uBC78\uBC79\uBC7A\uBC7B\uBC7C\uBC7D"+
-        "\uBC81\uBC82\uBC83\uBC84\uBC85\uBC86\uBC87\uBC88"+
-        "\uBC89\uBC8A\uBC8B\uBC8C\uBC8D\uBC8E\uBC8F\uBC90"+
-        "\uBC91\uBC93\uBC94\uBC95\uBC96\uBC97\uBC98\uBC99"+
-        "\uBC9A\uBC9B\uBC9C\uBC9D\uBCA1\uBCA2\uBCA3\uBCA4"+
-        "\uBCA5\uBCA6\uBCA7\uBCA8\uBCA9\uBCAA\uBCAB\uBCAC"+
-        "\uBCAD\uBCAE\uBCAF\uBCB0\uBCB1\uBCB3\uBCB4\uBCB5"+
-        "\uBCB6\uBCB7\uBCB8\uBCB9\uBCBA\uBCBB\uBCBC\uBCBD"+
-        "\uBCC1\uBCC2\uBCC3\uBCC4\uBCC5\uBCC6\uBCC7\uBCC8"+
-        "\uBCC9\uBCCA\uBCCB\uBCCC\uBCCD\uBCCE\uBCCF\uBCD0"+
-        "\uBCD1\uBCD3\uBCD4\uBCD5\uBCD6\uBCD7\uBCD8\uBCD9"+
-        "\uBCDA\uBCDB\uBCDC\uBCDD\uBCE1\uBCE2\uBCE3\uBCE4"+
-        "\uBCE5\uBCE6\uBCE7\uBCE8\uBCE9\uBCEA\uBCEB\uBCEC"+
-        "\uBCED\uBCEE\uBCEF\uBCF0\uBCF1\uBCF3\uBCF4\uBCF5"+
-        "\uBCF6\uBCF7\uBCF8\uBCF9\uBCFA\uBCFB\uBCFC\uBCFD"+
-        "\uBD41\uBD42\uBD43\uBD44\uBD45\uBD46\uBD47\uBD48"+
-        "\uBD49\uBD4A\uBD4B\uBD4C\uBD4D\uBD4E\uBD4F\uBD50"+
-        "\uBD51\uBD53\uBD54\uBD55\uBD56\uBD57\uBD58\uBD59"+
-        "\uBD5A\uBD5B\uBD5C\uBD5D\uBD61\uBD62\uBD63\uBD64"+
-        "\uBD65\uBD66\uBD67\uBD68\uBD69\uBD6A\uBD6B\uBD6C"+
-        "\uBD6D\uBD6E\uBD6F\uBD70\uBD71\uBD73\uBD74\uBD75"+
-        "\uBD76\uBD77\uBD78\uBD79\uBD7A\uBD7B\uBD7C\uBD7D"+
-        "\uBD81\uBD82\uBD83\uBD84\uBD85\uBD86\uBD87\uBD88"+
-        "\uBD89\uBD8A\uBD8B\uBD8C\uBD8D\uBD8E\uBD8F\uBD90"+
-        "\uBD91\uBD93\uBD94\uBD95\uBD96\uBD97\uBD98\uBD99"+
-        "\uBD9A\uBD9B\uBD9C\uBD9D\uBDA1\uBDA2\uBDA3\uBDA4"+
-        "\uBDA5\uBDA6\uBDA7\uBDA8\uBDA9\uBDAA\uBDAB\uBDAC"+
-        "\uBDAD\uBDAE\uBDAF\uBDB0\uBDB1\uBDB3\uBDB4\uBDB5"+
-        "\uBDB6\uBDB7\uBDB8\uBDB9\uBDBA\uBDBB\uBDBC\uBDBD"+
-        "\uBDC1\uBDC2\uBDC3\uBDC4\uBDC5\uBDC6\uBDC7\uBDC8"+
-        "\uBDC9\uBDCA\uBDCB\uBDCC\uBDCD\uBDCE\uBDCF\uBDD0"+
-        "\uBDD1\uBDD3\uBDD4\uBDD5\uBDD6\uBDD7\uBDD8\uBDD9"+
-        "\uBDDA\uBDDB\uBDDC\uBDDD\uBDE1\uBDE2\uBDE3\uBDE4"+
-        "\uBDE5\uBDE6\uBDE7\uBDE8\uBDE9\uBDEA\uBDEB\uBDEC"+
-        "\uBDED\uBDEE\uBDEF\uBDF0\uBDF1\uBDF3\uBDF4\uBDF5"+
-        "\uBDF6\uBDF7\uBDF8\uBDF9\uBDFA\uBDFB\uBDFC\uBDFD"+
-        "\uBE41\uBE42\uBE43\uBE44\uBE45\uBE46\uBE47\uBE48"+
-        "\uBE49\uBE4A\uBE4B\uBE4C\uBE4D\uBE4E\uBE4F\uBE50"+
-        "\uBE51\uBE53\uBE54\uBE55\uBE56\uBE57\uBE58\uBE59"+
-        "\uBE5A\uBE5B\uBE5C\uBE5D\uBE61\uBE62\uBE63\uBE64"+
-        "\uBE65\uBE66\uBE67\uBE68\uBE69\uBE6A\uBE6B\uBE6C"+
-        "\uBE6D\uBE6E\uBE6F\uBE70\uBE71\uBE73\uBE74\uBE75"+
-        "\uBE76\uBE77\uBE78\uBE79\uBE7A\uBE7B\uBE7C\uBE7D"+
-        "\uBE81\uBE82\uBE83\uBE84\uBE85\uBE86\uBE87\uBE88"+
-        "\uBE89\uBE8A\uBE8B\uBE8C\uBE8D\uBE8E\uBE8F\uBE90"+
-        "\uBE91\uBE93\uBE94\uBE95\uBE96\uBE97\uBE98\uBE99"+
-        "\uBE9A\uBE9B\uBE9C\uBE9D\uBEA1\uBEA2\uBEA3\uBEA4"+
-        "\uBEA5\uBEA6\uBEA7\uBEA8\uBEA9\uBEAA\uBEAB\uBEAC"+
-        "\uBEAD\uBEAE\uBEAF\uBEB0\uBEB1\uBEB3\uBEB4\uBEB5"+
-        "\uBEB6\uBEB7\uBEB8\uBEB9\uBEBA\uBEBB\uBEBC\uBEBD"+
-        "\uBEC1\uBEC2\uBEC3\uBEC4\uBEC5\uBEC6\uBEC7\uBEC8"+
-        "\uBEC9\uBECA\uBECB\uBECC\uBECD\uBECE\uBECF\uBED0"+
-        "\uBED1\uBED3\uBED4\uBED5\uBED6\uBED7\uBED8\uBED9"+
-        "\uBEDA\uBEDB\uBEDC\uBEDD\uBEE1\uBEE2\uBEE3\uBEE4"+
-        "\uBEE5\uBEE6\uBEE7\uBEE8\uBEE9\uBEEA\uBEEB\uBEEC"+
-        "\uBEED\uBEEE\uBEEF\uBEF0\uBEF1\uBEF3\uBEF4\uBEF5"+
-        "\uBEF6\uBEF7\uBEF8\uBEF9\uBEFA\uBEFB\uBEFC\uBEFD"+
-        "\uBF41\uBF42\uBF43\uBF44\uBF45\uBF46\uBF47\uBF48"+
-        "\uBF49\uBF4A\uBF4B\uBF4C\uBF4D\uBF4E\uBF4F\uBF50"+
-        "\uBF51\uBF53\uBF54\uBF55\uBF56\uBF57\uBF58\uBF59"+
-        "\uBF5A\uBF5B\uBF5C\uBF5D\uBF61\uBF62\uBF63\uBF64"+
-        "\uBF65\uBF66\uBF67\uBF68\uBF69\uBF6A\uBF6B\uBF6C"+
-        "\uBF6D\uBF6E\uBF6F\uBF70\uBF71\uBF73\uBF74\uBF75"+
-        "\uBF76\uBF77\uBF78\uBF79\uBF7A\uBF7B\uBF7C\uBF7D"+
-        "\uBF81\uBF82\uBF83\uBF84\uBF85\uBF86\uBF87\uBF88"+
-        "\uBF89\uBF8A\uBF8B\uBF8C\uBF8D\uBF8E\uBF8F\uBF90"+
-        "\uBF91\uBF93\uBF94\uBF95\uBF96\uBF97\uBF98\uBF99"+
-        "\uBF9A\uBF9B\uBF9C\uBF9D\uBFA1\uBFA2\uBFA3\uBFA4"+
-        "\uBFA5\uBFA6\uBFA7\uBFA8\uBFA9\uBFAA\uBFAB\uBFAC"+
-        "\uBFAD\uBFAE\uBFAF\uBFB0\uBFB1\uBFB3\uBFB4\uBFB5"+
-        "\uBFB6\uBFB7\uBFB8\uBFB9\uBFBA\uBFBB\uBFBC\uBFBD"+
-        "\uC061\uC062\uC063\uC064\uC065\uC066\uC067\uC068"+
-        "\uC069\uC06A\uC06B\uC06C\uC06D\uC06E\uC06F\uC070"+
-        "\uC071\uC073\uC074\uC075\uC076\uC077\uC078\uC079"+
-        "\uC07A\uC07B\uC07C\uC07D\uC081\uC082\uC083\uC084"+
-        "\uC085\uC086\uC087\uC088\uC089\uC08A\uC08B\uC08C"+
-        "\uC08D\uC08E\uC08F\uC090\uC091\uC093\uC094\uC095"+
-        "\uC096\uC097\uC098\uC099\uC09A\uC09B\uC09C\uC09D"+
-        "\uC0A1\uC0A2\uC0A3\uC0A4\uC0A5\uC0A6\uC0A7\uC0A8"+
-        "\uC0A9\uC0AA\uC0AB\uC0AC\uC0AD\uC0AE\uC0AF\uC0B0"+
-        "\uC0B1\uC0B3\uC0B4\uC0B5\uC0B6\uC0B7\uC0B8\uC0B9"+
-        "\uC0BA\uC0BB\uC0BC\uC0BD\uC0C1\uC0C2\uC0C3\uC0C4"+
-        "\uC0C5\uC0C6\uC0C7\uC0C8\uC0C9\uC0CA\uC0CB\uC0CC"+
-        "\uC0CD\uC0CE\uC0CF\uC0D0\uC0D1\uC0D3\uC0D4\uC0D5"+
-        "\uC0D6\uC0D7\uC0D8\uC0D9\uC0DA\uC0DB\uC0DC\uC0DD"+
-        "\uC0E1\uC0E2\uC0E3\uC0E4\uC0E5\uC0E6\uC0E7\uC0E8"+
-        "\uC0E9\uC0EA\uC0EB\uC0EC\uC0ED\uC0EE\uC0EF\uC0F0"+
-        "\uC0F1\uC0F3\uC0F4\uC0F5\uC0F6\uC0F7\uC0F8\uC0F9"+
-        "\uC0FA\uC0FB\uC0FC\uC0FD\uC141\uC142\uC143\uC144"+
-        "\uC145\uC146\uC147\uC148\uC149\uC14A\uC14B\uC14C"+
-        "\uC14D\uC14E\uC14F\uC150\uC151\uC153\uC154\uC155"+
-        "\uC156\uC157\uC158\uC159\uC15A\uC15B\uC15C\uC15D"+
-        "\uC161\uC162\uC163\uC164\uC165\uC166\uC167\uC168"+
-        "\uC169\uC16A\uC16B\uC16C\uC16D\uC16E\uC16F\uC170"+
-        "\uC171\uC173\uC174\uC175\uC176\uC177\uC178\uC179"+
-        "\uC17A\uC17B\uC17C\uC17D\uC181\uC182\uC183\uC184"+
-        "\uC185\uC186\uC187\uC188\uC189\uC18A\uC18B\uC18C"+
-        "\uC18D\uC18E\uC18F\uC190\uC191\uC193\uC194\uC195"+
-        "\uC196\uC197\uC198\uC199\uC19A\uC19B\uC19C\uC19D"+
-        "\uC1A1\uC1A2\uC1A3\uC1A4\uC1A5\uC1A6\uC1A7\uC1A8"+
-        "\uC1A9\uC1AA\uC1AB\uC1AC\uC1AD\uC1AE\uC1AF\uC1B0"+
-        "\uC1B1\uC1B3\uC1B4\uC1B5\uC1B6\uC1B7\uC1B8\uC1B9"+
-        "\uC1BA\uC1BB\uC1BC\uC1BD\uC1C1\uC1C2\uC1C3\uC1C4"+
-        "\uC1C5\uC1C6\uC1C7\uC1C8\uC1C9\uC1CA\uC1CB\uC1CC"+
-        "\uC1CD\uC1CE\uC1CF\uC1D0\uC1D1\uC1D3\uC1D4\uC1D5"+
-        "\uC1D6\uC1D7\uC1D8\uC1D9\uC1DA\uC1DB\uC1DC\uC1DD"+
-        "\uC1E1\uC1E2\uC1E3\uC1E4\uC1E5\uC1E6\uC1E7\uC1E8"+
-        "\uC1E9\uC1EA\uC1EB\uC1EC\uC1ED\uC1EE\uC1EF\uC1F0"+
-        "\uC1F1\uC1F3\uC1F4\uC1F5\uC1F6\uC1F7\uC1F8\uC1F9"+
-        "\uC1FA\uC1FB\uC1FC\uC1FD\uC241\uC242\uC243\uC244"+
-        "\uC245\uC246\uC247\uC248\uC249\uC24A\uC24B\uC24C"+
-        "\uC24D\uC24E\uC24F\uC250\uC251\uC253\uC254\uC255"+
-        "\uC256\uC257\uC258\uC259\uC25A\uC25B\uC25C\uC25D"+
-        "\uC261\uC262\uC263\uC264\uC265\uC266\uC267\uC268"+
-        "\uC269\uC26A\uC26B\uC26C\uC26D\uC26E\uC26F\uC270"+
-        "\uC271\uC273\uC274\uC275\uC276\uC277\uC278\uC279"+
-        "\uC27A\uC27B\uC27C\uC27D\uC281\uC282\uC283\uC284"+
-        "\uC285\uC286\uC287\uC288\uC289\uC28A\uC28B\uC28C"+
-        "\uC28D\uC28E\uC28F\uC290\uC291\uC293\uC294\uC295"+
-        "\uC296\uC297\uC298\uC299\uC29A\uC29B\uC29C\uC29D"+
-        "\uC2A1\uC2A2\uC2A3\uC2A4\uC2A5\uC2A6\uC2A7\uC2A8"+
-        "\uC2A9\uC2AA\uC2AB\uC2AC\uC2AD\uC2AE\uC2AF\uC2B0"+
-        "\uC2B1\uC2B3\uC2B4\uC2B5\uC2B6\uC2B7\uC2B8\uC2B9"+
-        "\uC2BA\uC2BB\uC2BC\uC2BD\uC2C1\uC2C2\uC2C3\uC2C4"+
-        "\uC2C5\uC2C6\uC2C7\uC2C8\uC2C9\uC2CA\uC2CB\uC2CC"+
-        "\uC2CD\uC2CE\uC2CF\uC2D0\uC2D1\uC2D3\uC2D4\uC2D5"+
-        "\uC2D6\uC2D7\uC2D8\uC2D9\uC2DA\uC2DB\uC2DC\uC2DD"+
-        "\uC2E1\uC2E2\uC2E3\uC2E4\uC2E5\uC2E6\uC2E7\uC2E8"+
-        "\uC2E9\uC2EA\uC2EB\uC2EC\uC2ED\uC2EE\uC2EF\uC2F0"+
-        "\uC2F1\uC2F3\uC2F4\uC2F5\uC2F6\uC2F7\uC2F8\uC2F9"+
-        "\uC2FA\uC2FB\uC2FC\uC2FD\uC341\uC342\uC343\uC344"+
-        "\uC345\uC346\uC347\uC348\uC349\uC34A\uC34B\uC34C"+
-        "\uC34D\uC34E\uC34F\uC350\uC351\uC353\uC354\uC355"+
-        "\uC356\uC357\uC358\uC359\uC35A\uC35B\uC35C\uC35D"+
-        "\uC361\uC362\uC363\uC364\uC365\uC366\uC367\uC368"+
-        "\uC369\uC36A\uC36B\uC36C\uC36D\uC36E\uC36F\uC370"+
-        "\uC371\uC373\uC374\uC375\uC376\uC377\uC378\uC379"+
-        "\uC37A\uC37B\uC37C\uC37D\uC381\uC382\uC383\uC384"+
-        "\uC385\uC386\uC387\uC388\uC389\uC38A\uC38B\uC38C"+
-        "\uC38D\uC38E\uC38F\uC390\uC391\uC393\uC394\uC395"+
-        "\uC396\uC397\uC398\uC399\uC39A\uC39B\uC39C\uC39D"+
-        "\uC3A1\uC3A2\uC3A3\uC3A4\uC3A5\uC3A6\uC3A7\uC3A8"+
-        "\uC3A9\uC3AA\uC3AB\uC3AC\uC3AD\uC3AE\uC3AF\uC3B0"+
-        "\uC3B1\uC3B3\uC3B4\uC3B5\uC3B6\uC3B7\uC3B8\uC3B9"+
-        "\uC3BA\uC3BB\uC3BC\uC3BD\uC461\uC462\uC463\uC464"+
-        "\uC465\uC466\uC467\uC468\uC469\uC46A\uC46B\uC46C"+
-        "\uC46D\uC46E\uC46F\uC470\uC471\uC473\uC474\uC475"+
-        "\uC476\uC477\uC478\uC479\uC47A\uC47B\uC47C\uC47D"+
-        "\uC481\uC482\uC483\uC484\uC485\uC486\uC487\uC488"+
-        "\uC489\uC48A\uC48B\uC48C\uC48D\uC48E\uC48F\uC490"+
-        "\uC491\uC493\uC494\uC495\uC496\uC497\uC498\uC499"+
-        "\uC49A\uC49B\uC49C\uC49D\uC4A1\uC4A2\uC4A3\uC4A4"+
-        "\uC4A5\uC4A6\uC4A7\uC4A8\uC4A9\uC4AA\uC4AB\uC4AC"+
-        "\uC4AD\uC4AE\uC4AF\uC4B0\uC4B1\uC4B3\uC4B4\uC4B5"+
-        "\uC4B6\uC4B7\uC4B8\uC4B9\uC4BA\uC4BB\uC4BC\uC4BD"+
-        "\uC4C1\uC4C2\uC4C3\uC4C4\uC4C5\uC4C6\uC4C7\uC4C8"+
-        "\uC4C9\uC4CA\uC4CB\uC4CC\uC4CD\uC4CE\uC4CF\uC4D0"+
-        "\uC4D1\uC4D3\uC4D4\uC4D5\uC4D6\uC4D7\uC4D8\uC4D9"+
-        "\uC4DA\uC4DB\uC4DC\uC4DD\uC4E1\uC4E2\uC4E3\uC4E4"+
-        "\uC4E5\uC4E6\uC4E7\uC4E8\uC4E9\uC4EA\uC4EB\uC4EC"+
-        "\uC4ED\uC4EE\uC4EF\uC4F0\uC4F1\uC4F3\uC4F4\uC4F5"+
-        "\uC4F6\uC4F7\uC4F8\uC4F9\uC4FA\uC4FB\uC4FC\uC4FD"+
-        "\uC541\uC542\uC543\uC544\uC545\uC546\uC547\uC548"+
-        "\uC549\uC54A\uC54B\uC54C\uC54D\uC54E\uC54F\uC550"+
-        "\uC551\uC553\uC554\uC555\uC556\uC557\uC558\uC559"+
-        "\uC55A\uC55B\uC55C\uC55D\uC561\uC562\uC563\uC564"+
-        "\uC565\uC566\uC567\uC568\uC569\uC56A\uC56B\uC56C"+
-        "\uC56D\uC56E\uC56F\uC570\uC571\uC573\uC574\uC575"+
-        "\uC576\uC577\uC578\uC579\uC57A\uC57B\uC57C\uC57D"+
-        "\uC581\uC582\uC583\uC584\uC585\uC586\uC587\uC588"+
-        "\uC589\uC58A\uC58B\uC58C\uC58D\uC58E\uC58F\uC590"+
-        "\uC591\uC593\uC594\uC595\uC596\uC597\uC598\uC599"+
-        "\uC59A\uC59B\uC59C\uC59D\uC5A1\uC5A2\uC5A3\uC5A4"+
-        "\uC5A5\uC5A6\uC5A7\uC5A8\uC5A9\uC5AA\uC5AB\uC5AC"+
-        "\uC5AD\uC5AE\uC5AF\uC5B0\uC5B1\uC5B3\uC5B4\uC5B5"+
-        "\uC5B6\uC5B7\uC5B8\uC5B9\uC5BA\uC5BB\uC5BC\uC5BD"+
-        "\uC5C1\uC5C2\uC5C3\uC5C4\uC5C5\uC5C6\uC5C7\uC5C8"+
-        "\uC5C9\uC5CA\uC5CB\uC5CC\uC5CD\uC5CE\uC5CF\uC5D0"+
-        "\uC5D1\uC5D3\uC5D4\uC5D5\uC5D6\uC5D7\uC5D8\uC5D9"+
-        "\uC5DA\uC5DB\uC5DC\uC5DD\uC5E1\uC5E2\uC5E3\uC5E4"+
-        "\uC5E5\uC5E6\uC5E7\uC5E8\uC5E9\uC5EA\uC5EB\uC5EC"+
-        "\uC5ED\uC5EE\uC5EF\uC5F0\uC5F1\uC5F3\uC5F4\uC5F5"+
-        "\uC5F6\uC5F7\uC5F8\uC5F9\uC5FA\uC5FB\uC5FC\uC5FD"+
-        "\uC641\uC642\uC643\uC644\uC645\uC646\uC647\uC648"+
-        "\uC649\uC64A\uC64B\uC64C\uC64D\uC64E\uC64F\uC650"+
-        "\uC651\uC653\uC654\uC655\uC656\uC657\uC658\uC659"+
-        "\uC65A\uC65B\uC65C\uC65D\uC661\uC662\uC663\uC664"+
-        "\uC665\uC666\uC667\uC668\uC669\uC66A\uC66B\uC66C"+
-        "\uC66D\uC66E\uC66F\uC670\uC671\uC673\uC674\uC675"+
-        "\uC676\uC677\uC678\uC679\uC67A\uC67B\uC67C\uC67D"+
-        "\uC681\uC682\uC683\uC684\uC685\uC686\uC687\uC688"+
-        "\uC689\uC68A\uC68B\uC68C\uC68D\uC68E\uC68F\uC690"+
-        "\uC691\uC693\uC694\uC695\uC696\uC697\uC698\uC699"+
-        "\uC69A\uC69B\uC69C\uC69D\uC6A1\uC6A2\uC6A3\uC6A4"+
-        "\uC6A5\uC6A6\uC6A7\uC6A8\uC6A9\uC6AA\uC6AB\uC6AC"+
-        "\uC6AD\uC6AE\uC6AF\uC6B0\uC6B1\uC6B3\uC6B4\uC6B5"+
-        "\uC6B6\uC6B7\uC6B8\uC6B9\uC6BA\uC6BB\uC6BC\uC6BD"+
-        "\uC6C1\uC6C2\uC6C3\uC6C4\uC6C5\uC6C6\uC6C7\uC6C8"+
-        "\uC6C9\uC6CA\uC6CB\uC6CC\uC6CD\uC6CE\uC6CF\uC6D0"+
-        "\uC6D1\uC6D3\uC6D4\uC6D5\uC6D6\uC6D7\uC6D8\uC6D9"+
-        "\uC6DA\uC6DB\uC6DC\uC6DD\uC6E1\uC6E2\uC6E3\uC6E4"+
-        "\uC6E5\uC6E6\uC6E7\uC6E8\uC6E9\uC6EA\uC6EB\uC6EC"+
-        "\uC6ED\uC6EE\uC6EF\uC6F0\uC6F1\uC6F3\uC6F4\uC6F5"+
-        "\uC6F6\uC6F7\uC6F8\uC6F9\uC6FA\uC6FB\uC6FC\uC6FD"+
-        "\uC741\uC742\uC743\uC744\uC745\uC746\uC747\uC748"+
-        "\uC749\uC74A\uC74B\uC74C\uC74D\uC74E\uC74F\uC750"+
-        "\uC751\uC753\uC754\uC755\uC756\uC757\uC758\uC759"+
-        "\uC75A\uC75B\uC75C\uC75D\uC761\uC762\uC763\uC764"+
-        "\uC765\uC766\uC767\uC768\uC769\uC76A\uC76B\uC76C"+
-        "\uC76D\uC76E\uC76F\uC770\uC771\uC773\uC774\uC775"+
-        "\uC776\uC777\uC778\uC779\uC77A\uC77B\uC77C\uC77D"+
-        "\uC781\uC782\uC783\uC784\uC785\uC786\uC787\uC788"+
-        "\uC789\uC78A\uC78B\uC78C\uC78D\uC78E\uC78F\uC790"+
-        "\uC791\uC793\uC794\uC795\uC796\uC797\uC798\uC799"+
-        "\uC79A\uC79B\uC79C\uC79D\uC7A1\uC7A2\uC7A3\uC7A4"+
-        "\uC7A5\uC7A6\uC7A7\uC7A8\uC7A9\uC7AA\uC7AB\uC7AC"+
-        "\uC7AD\uC7AE\uC7AF\uC7B0\uC7B1\uC7B3\uC7B4\uC7B5"+
-        "\uC7B6\uC7B7\uC7B8\uC7B9\uC7BA\uC7BB\uC7BC\uC7BD"+
-        "\uC861\uC862\uC863\uC864\uC865\uC866\uC867\uC868"+
-        "\uC869\uC86A\uC86B\uC86C\uC86D\uC86E\uC86F\uC870"+
-        "\uC871\uC873\uC874\uC875\uC876\uC877\uC878\uC879"+
-        "\uC87A\uC87B\uC87C\uC87D\uC881\uC882\uC883\uC884"+
-        "\uC885\uC886\uC887\uC888\uC889\uC88A\uC88B\uC88C"+
-        "\uC88D\uC88E\uC88F\uC890\uC891\uC893\uC894\uC895"+
-        "\uC896\uC897\uC898\uC899\uC89A\uC89B\uC89C\uC89D"+
-        "\uC8A1\uC8A2\uC8A3\uC8A4\uC8A5\uC8A6\uC8A7\uC8A8"+
-        "\uC8A9\uC8AA\uC8AB\uC8AC\uC8AD\uC8AE\uC8AF\uC8B0"+
-        "\uC8B1\uC8B3\uC8B4\uC8B5\uC8B6\uC8B7\uC8B8\uC8B9"+
-        "\uC8BA\uC8BB\uC8BC\uC8BD\uC8C1\uC8C2\uC8C3\uC8C4"+
-        "\uC8C5\uC8C6\uC8C7\uC8C8\uC8C9\uC8CA\uC8CB\uC8CC"+
-        "\uC8CD\uC8CE\uC8CF\uC8D0\uC8D1\uC8D3\uC8D4\uC8D5"+
-        "\uC8D6\uC8D7\uC8D8\uC8D9\uC8DA\uC8DB\uC8DC\uC8DD"+
-        "\uC8E1\uC8E2\uC8E3\uC8E4\uC8E5\uC8E6\uC8E7\uC8E8"+
-        "\uC8E9\uC8EA\uC8EB\uC8EC\uC8ED\uC8EE\uC8EF\uC8F0"+
-        "\uC8F1\uC8F3\uC8F4\uC8F5\uC8F6\uC8F7\uC8F8\uC8F9"+
-        "\uC8FA\uC8FB\uC8FC\uC8FD\uC941\uC942\uC943\uC944"+
-        "\uC945\uC946\uC947\uC948\uC949\uC94A\uC94B\uC94C"+
-        "\uC94D\uC94E\uC94F\uC950\uC951\uC953\uC954\uC955"+
-        "\uC956\uC957\uC958\uC959\uC95A\uC95B\uC95C\uC95D"+
-        "\uC961\uC962\uC963\uC964\uC965\uC966\uC967\uC968"+
-        "\uC969\uC96A\uC96B\uC96C\uC96D\uC96E\uC96F\uC970"+
-        "\uC971\uC973\uC974\uC975\uC976\uC977\uC978\uC979"+
-        "\uC97A\uC97B\uC97C\uC97D\uC981\uC982\uC983\uC984"+
-        "\uC985\uC986\uC987\uC988\uC989\uC98A\uC98B\uC98C"+
-        "\uC98D\uC98E\uC98F\uC990\uC991\uC993\uC994\uC995"+
-        "\uC996\uC997\uC998\uC999\uC99A\uC99B\uC99C\uC99D"+
-        "\uC9A1\uC9A2\uC9A3\uC9A4\uC9A5\uC9A6\uC9A7\uC9A8"+
-        "\uC9A9\uC9AA\uC9AB\uC9AC\uC9AD\uC9AE\uC9AF\uC9B0"+
-        "\uC9B1\uC9B3\uC9B4\uC9B5\uC9B6\uC9B7\uC9B8\uC9B9"+
-        "\uC9BA\uC9BB\uC9BC\uC9BD\uC9C1\uC9C2\uC9C3\uC9C4"+
-        "\uC9C5\uC9C6\uC9C7\uC9C8\uC9C9\uC9CA\uC9CB\uC9CC"+
-        "\uC9CD\uC9CE\uC9CF\uC9D0\uC9D1\uC9D3\uC9D4\uC9D5"+
-        "\uC9D6\uC9D7\uC9D8\uC9D9\uC9DA\uC9DB\uC9DC\uC9DD"+
-        "\uC9E1\uC9E2\uC9E3\uC9E4\uC9E5\uC9E6\uC9E7\uC9E8"+
-        "\uC9E9\uC9EA\uC9EB\uC9EC\uC9ED\uC9EE\uC9EF\uC9F0"+
-        "\uC9F1\uC9F3\uC9F4\uC9F5\uC9F6\uC9F7\uC9F8\uC9F9"+
-        "\uC9FA\uC9FB\uC9FC\uC9FD\uCA41\uCA42\uCA43\uCA44"+
-        "\uCA45\uCA46\uCA47\uCA48\uCA49\uCA4A\uCA4B\uCA4C"+
-        "\uCA4D\uCA4E\uCA4F\uCA50\uCA51\uCA53\uCA54\uCA55"+
-        "\uCA56\uCA57\uCA58\uCA59\uCA5A\uCA5B\uCA5C\uCA5D"+
-        "\uCA61\uCA62\uCA63\uCA64\uCA65\uCA66\uCA67\uCA68"+
-        "\uCA69\uCA6A\uCA6B\uCA6C\uCA6D\uCA6E\uCA6F\uCA70"+
-        "\uCA71\uCA73\uCA74\uCA75\uCA76\uCA77\uCA78\uCA79"+
-        "\uCA7A\uCA7B\uCA7C\uCA7D\uCA81\uCA82\uCA83\uCA84"+
-        "\uCA85\uCA86\uCA87\uCA88\uCA89\uCA8A\uCA8B\uCA8C"+
-        "\uCA8D\uCA8E\uCA8F\uCA90\uCA91\uCA93\uCA94\uCA95"+
-        "\uCA96\uCA97\uCA98\uCA99\uCA9A\uCA9B\uCA9C\uCA9D"+
-        "\uCAA1\uCAA2\uCAA3\uCAA4\uCAA5\uCAA6\uCAA7\uCAA8"+
-        "\uCAA9\uCAAA\uCAAB\uCAAC\uCAAD\uCAAE\uCAAF\uCAB0"+
-        "\uCAB1\uCAB3\uCAB4\uCAB5\uCAB6\uCAB7\uCAB8\uCAB9"+
-        "\uCABA\uCABB\uCABC\uCABD\uCAC1\uCAC2\uCAC3\uCAC4"+
-        "\uCAC5\uCAC6\uCAC7\uCAC8\uCAC9\uCACA\uCACB\uCACC"+
-        "\uCACD\uCACE\uCACF\uCAD0\uCAD1\uCAD3\uCAD4\uCAD5"+
-        "\uCAD6\uCAD7\uCAD8\uCAD9\uCADA\uCADB\uCADC\uCADD"+
-        "\uCAE1\uCAE2\uCAE3\uCAE4\uCAE5\uCAE6\uCAE7\uCAE8"+
-        "\uCAE9\uCAEA\uCAEB\uCAEC\uCAED\uCAEE\uCAEF\uCAF0"+
-        "\uCAF1\uCAF3\uCAF4\uCAF5\uCAF6\uCAF7\uCAF8\uCAF9"+
-        "\uCAFA\uCAFB\uCAFC\uCAFD\uCB41\uCB42\uCB43\uCB44"+
-        "\uCB45\uCB46\uCB47\uCB48\uCB49\uCB4A\uCB4B\uCB4C"+
-        "\uCB4D\uCB4E\uCB4F\uCB50\uCB51\uCB53\uCB54\uCB55"+
-        "\uCB56\uCB57\uCB58\uCB59\uCB5A\uCB5B\uCB5C\uCB5D"+
-        "\uCB61\uCB62\uCB63\uCB64\uCB65\uCB66\uCB67\uCB68"+
-        "\uCB69\uCB6A\uCB6B\uCB6C\uCB6D\uCB6E\uCB6F\uCB70"+
-        "\uCB71\uCB73\uCB74\uCB75\uCB76\uCB77\uCB78\uCB79"+
-        "\uCB7A\uCB7B\uCB7C\uCB7D\uCB81\uCB82\uCB83\uCB84"+
-        "\uCB85\uCB86\uCB87\uCB88\uCB89\uCB8A\uCB8B\uCB8C"+
-        "\uCB8D\uCB8E\uCB8F\uCB90\uCB91\uCB93\uCB94\uCB95"+
-        "\uCB96\uCB97\uCB98\uCB99\uCB9A\uCB9B\uCB9C\uCB9D"+
-        "\uCBA1\uCBA2\uCBA3\uCBA4\uCBA5\uCBA6\uCBA7\uCBA8"+
-        "\uCBA9\uCBAA\uCBAB\uCBAC\uCBAD\uCBAE\uCBAF\uCBB0"+
-        "\uCBB1\uCBB3\uCBB4\uCBB5\uCBB6\uCBB7\uCBB8\uCBB9"+
-        "\uCBBA\uCBBB\uCBBC\uCBBD\uCC61\uCC62\uCC63\uCC64"+
-        "\uCC65\uCC66\uCC67\uCC68\uCC69\uCC6A\uCC6B\uCC6C"+
-        "\uCC6D\uCC6E\uCC6F\uCC70\uCC71\uCC73\uCC74\uCC75"+
-        "\uCC76\uCC77\uCC78\uCC79\uCC7A\uCC7B\uCC7C\uCC7D"+
-        "\uCC81\uCC82\uCC83\uCC84\uCC85\uCC86\uCC87\uCC88"+
-        "\uCC89\uCC8A\uCC8B\uCC8C\uCC8D\uCC8E\uCC8F\uCC90"+
-        "\uCC91\uCC93\uCC94\uCC95\uCC96\uCC97\uCC98\uCC99"+
-        "\uCC9A\uCC9B\uCC9C\uCC9D\uCCA1\uCCA2\uCCA3\uCCA4"+
-        "\uCCA5\uCCA6\uCCA7\uCCA8\uCCA9\uCCAA\uCCAB\uCCAC"+
-        "\uCCAD\uCCAE\uCCAF\uCCB0\uCCB1\uCCB3\uCCB4\uCCB5"+
-        "\uCCB6\uCCB7\uCCB8\uCCB9\uCCBA\uCCBB\uCCBC\uCCBD"+
-        "\uCCC1\uCCC2\uCCC3\uCCC4\uCCC5\uCCC6\uCCC7\uCCC8"+
-        "\uCCC9\uCCCA\uCCCB\uCCCC\uCCCD\uCCCE\uCCCF\uCCD0"+
-        "\uCCD1\uCCD3\uCCD4\uCCD5\uCCD6\uCCD7\uCCD8\uCCD9"+
-        "\uCCDA\uCCDB\uCCDC\uCCDD\uCCE1\uCCE2\uCCE3\uCCE4"+
-        "\uCCE5\uCCE6\uCCE7\uCCE8\uCCE9\uCCEA\uCCEB\uCCEC"+
-        "\uCCED\uCCEE\uCCEF\uCCF0\uCCF1\uCCF3\uCCF4\uCCF5"+
-        "\uCCF6\uCCF7\uCCF8\uCCF9\uCCFA\uCCFB\uCCFC\uCCFD"+
-        "\uCD41\uCD42\uCD43\uCD44\uCD45\uCD46\uCD47\uCD48"+
-        "\uCD49\uCD4A\uCD4B\uCD4C\uCD4D\uCD4E\uCD4F\uCD50"+
-        "\uCD51\uCD53\uCD54\uCD55\uCD56\uCD57\uCD58\uCD59"+
-        "\uCD5A\uCD5B\uCD5C\uCD5D\uCD61\uCD62\uCD63\uCD64"+
-        "\uCD65\uCD66\uCD67\uCD68\uCD69\uCD6A\uCD6B\uCD6C"+
-        "\uCD6D\uCD6E\uCD6F\uCD70\uCD71\uCD73\uCD74\uCD75"+
-        "\uCD76\uCD77\uCD78\uCD79\uCD7A\uCD7B\uCD7C\uCD7D"+
-        "\uCD81\uCD82\uCD83\uCD84\uCD85\uCD86\uCD87\uCD88"+
-        "\uCD89\uCD8A\uCD8B\uCD8C\uCD8D\uCD8E\uCD8F\uCD90"+
-        "\uCD91\uCD93\uCD94\uCD95\uCD96\uCD97\uCD98\uCD99"+
-        "\uCD9A\uCD9B\uCD9C\uCD9D\uCDA1\uCDA2\uCDA3\uCDA4"+
-        "\uCDA5\uCDA6\uCDA7\uCDA8\uCDA9\uCDAA\uCDAB\uCDAC"+
-        "\uCDAD\uCDAE\uCDAF\uCDB0\uCDB1\uCDB3\uCDB4\uCDB5"+
-        "\uCDB6\uCDB7\uCDB8\uCDB9\uCDBA\uCDBB\uCDBC\uCDBD"+
-        "\uCDC1\uCDC2\uCDC3\uCDC4\uCDC5\uCDC6\uCDC7\uCDC8"+
-        "\uCDC9\uCDCA\uCDCB\uCDCC\uCDCD\uCDCE\uCDCF\uCDD0"+
-        "\uCDD1\uCDD3\uCDD4\uCDD5\uCDD6\uCDD7\uCDD8\uCDD9"+
-        "\uCDDA\uCDDB\uCDDC\uCDDD\uCDE1\uCDE2\uCDE3\uCDE4"+
-        "\uCDE5\uCDE6\uCDE7\uCDE8\uCDE9\uCDEA\uCDEB\uCDEC"+
-        "\uCDED\uCDEE\uCDEF\uCDF0\uCDF1\uCDF3\uCDF4\uCDF5"+
-        "\uCDF6\uCDF7\uCDF8\uCDF9\uCDFA\uCDFB\uCDFC\uCDFD"+
-        "\uCE41\uCE42\uCE43\uCE44\uCE45\uCE46\uCE47\uCE48"+
-        "\uCE49\uCE4A\uCE4B\uCE4C\uCE4D\uCE4E\uCE4F\uCE50"+
-        "\uCE51\uCE53\uCE54\uCE55\uCE56\uCE57\uCE58\uCE59"+
-        "\uCE5A\uCE5B\uCE5C\uCE5D\uCE61\uCE62\uCE63\uCE64"+
-        "\uCE65\uCE66\uCE67\uCE68\uCE69\uCE6A\uCE6B\uCE6C"+
-        "\uCE6D\uCE6E\uCE6F\uCE70\uCE71\uCE73\uCE74\uCE75"+
-        "\uCE76\uCE77\uCE78\uCE79\uCE7A\uCE7B\uCE7C\uCE7D"+
-        "\uCE81\uCE82\uCE83\uCE84\uCE85\uCE86\uCE87\uCE88"+
-        "\uCE89\uCE8A\uCE8B\uCE8C\uCE8D\uCE8E\uCE8F\uCE90"+
-        "\uCE91\uCE93\uCE94\uCE95\uCE96\uCE97\uCE98\uCE99"+
-        "\uCE9A\uCE9B\uCE9C\uCE9D\uCEA1\uCEA2\uCEA3\uCEA4"+
-        "\uCEA5\uCEA6\uCEA7\uCEA8\uCEA9\uCEAA\uCEAB\uCEAC"+
-        "\uCEAD\uCEAE\uCEAF\uCEB0\uCEB1\uCEB3\uCEB4\uCEB5"+
-        "\uCEB6\uCEB7\uCEB8\uCEB9\uCEBA\uCEBB\uCEBC\uCEBD"+
-        "\uCEC1\uCEC2\uCEC3\uCEC4\uCEC5\uCEC6\uCEC7\uCEC8"+
-        "\uCEC9\uCECA\uCECB\uCECC\uCECD\uCECE\uCECF\uCED0"+
-        "\uCED1\uCED3\uCED4\uCED5\uCED6\uCED7\uCED8\uCED9"+
-        "\uCEDA\uCEDB\uCEDC\uCEDD\uCEE1\uCEE2\uCEE3\uCEE4"+
-        "\uCEE5\uCEE6\uCEE7\uCEE8\uCEE9\uCEEA\uCEEB\uCEEC"+
-        "\uCEED\uCEEE\uCEEF\uCEF0\uCEF1\uCEF3\uCEF4\uCEF5"+
-        "\uCEF6\uCEF7\uCEF8\uCEF9\uCEFA\uCEFB\uCEFC\uCEFD"+
-        "\uCF41\uCF42\uCF43\uCF44\uCF45\uCF46\uCF47\uCF48"+
-        "\uCF49\uCF4A\uCF4B\uCF4C\uCF4D\uCF4E\uCF4F\uCF50"+
-        "\uCF51\uCF53\uCF54\uCF55\uCF56\uCF57\uCF58\uCF59"+
-        "\uCF5A\uCF5B\uCF5C\uCF5D\uCF61\uCF62\uCF63\uCF64"+
-        "\uCF65\uCF66\uCF67\uCF68\uCF69\uCF6A\uCF6B\uCF6C"+
-        "\uCF6D\uCF6E\uCF6F\uCF70\uCF71\uCF73\uCF74\uCF75"+
-        "\uCF76\uCF77\uCF78\uCF79\uCF7A\uCF7B\uCF7C\uCF7D"+
-        "\uCF81\uCF82\uCF83\uCF84\uCF85\uCF86\uCF87\uCF88"+
-        "\uCF89\uCF8A\uCF8B\uCF8C\uCF8D\uCF8E\uCF8F\uCF90"+
-        "\uCF91\uCF93\uCF94\uCF95\uCF96\uCF97\uCF98\uCF99"+
-        "\uCF9A\uCF9B\uCF9C\uCF9D\uCFA1\uCFA2\uCFA3\uCFA4"+
-        "\uCFA5\uCFA6\uCFA7\uCFA8\uCFA9\uCFAA\uCFAB\uCFAC"+
-        "\uCFAD\uCFAE\uCFAF\uCFB0\uCFB1\uCFB3\uCFB4\uCFB5"+
-        "\uCFB6\uCFB7\uCFB8\uCFB9\uCFBA\uCFBB\uCFBC\uCFBD"+
-        "\uD061\uD062\uD063\uD064\uD065\uD066\uD067\uD068"+
-        "\uD069\uD06A\uD06B\uD06C\uD06D\uD06E\uD06F\uD070"+
-        "\uD071\uD073\uD074\uD075\uD076\uD077\uD078\uD079"+
-        "\uD07A\uD07B\uD07C\uD07D\uD081\uD082\uD083\uD084"+
-        "\uD085\uD086\uD087\uD088\uD089\uD08A\uD08B\uD08C"+
-        "\uD08D\uD08E\uD08F\uD090\uD091\uD093\uD094\uD095"+
-        "\uD096\uD097\uD098\uD099\uD09A\uD09B\uD09C\uD09D"+
-        "\uD0A1\uD0A2\uD0A3\uD0A4\uD0A5\uD0A6\uD0A7\uD0A8"+
-        "\uD0A9\uD0AA\uD0AB\uD0AC\uD0AD\uD0AE\uD0AF\uD0B0"+
-        "\uD0B1\uD0B3\uD0B4\uD0B5\uD0B6\uD0B7\uD0B8\uD0B9"+
-        "\uD0BA\uD0BB\uD0BC\uD0BD\uD0C1\uD0C2\uD0C3\uD0C4"+
-        "\uD0C5\uD0C6\uD0C7\uD0C8\uD0C9\uD0CA\uD0CB\uD0CC"+
-        "\uD0CD\uD0CE\uD0CF\uD0D0\uD0D1\uD0D3\uD0D4\uD0D5"+
-        "\uD0D6\uD0D7\uD0D8\uD0D9\uD0DA\uD0DB\uD0DC\uD0DD"+
-        "\uD0E1\uD0E2\uD0E3\uD0E4\uD0E5\uD0E6\uD0E7\uD0E8"+
-        "\uD0E9\uD0EA\uD0EB\uD0EC\uD0ED\uD0EE\uD0EF\uD0F0"+
-        "\uD0F1\uD0F3\uD0F4\uD0F5\uD0F6\uD0F7\uD0F8\uD0F9"+
-        "\uD0FA\uD0FB\uD0FC\uD0FD\uD141\uD142\uD143\uD144"+
-        "\uD145\uD146\uD147\uD148\uD149\uD14A\uD14B\uD14C"+
-        "\uD14D\uD14E\uD14F\uD150\uD151\uD153\uD154\uD155"+
-        "\uD156\uD157\uD158\uD159\uD15A\uD15B\uD15C\uD15D"+
-        "\uD161\uD162\uD163\uD164\uD165\uD166\uD167\uD168"+
-        "\uD169\uD16A\uD16B\uD16C\uD16D\uD16E\uD16F\uD170"+
-        "\uD171\uD173\uD174\uD175\uD176\uD177\uD178\uD179"+
-        "\uD17A\uD17B\uD17C\uD17D\uD181\uD182\uD183\uD184"+
-        "\uD185\uD186\uD187\uD188\uD189\uD18A\uD18B\uD18C"+
-        "\uD18D\uD18E\uD18F\uD190\uD191\uD193\uD194\uD195"+
-        "\uD196\uD197\uD198\uD199\uD19A\uD19B\uD19C\uD19D"+
-        "\uD1A1\uD1A2\uD1A3\uD1A4\uD1A5\uD1A6\uD1A7\uD1A8"+
-        "\uD1A9\uD1AA\uD1AB\uD1AC\uD1AD\uD1AE\uD1AF\uD1B0"+
-        "\uD1B1\uD1B3\uD1B4\uD1B5\uD1B6\uD1B7\uD1B8\uD1B9"+
-        "\uD1BA\uD1BB\uD1BC\uD1BD\uD1C1\uD1C2\uD1C3\uD1C4"+
-        "\uD1C5\uD1C6\uD1C7\uD1C8\uD1C9\uD1CA\uD1CB\uD1CC"+
-        "\uD1CD\uD1CE\uD1CF\uD1D0\uD1D1\uD1D3\uD1D4\uD1D5"+
-        "\uD1D6\uD1D7\uD1D8\uD1D9\uD1DA\uD1DB\uD1DC\uD1DD"+
-        "\uD1E1\uD1E2\uD1E3\uD1E4\uD1E5\uD1E6\uD1E7\uD1E8"+
-        "\uD1E9\uD1EA\uD1EB\uD1EC\uD1ED\uD1EE\uD1EF\uD1F0"+
-        "\uD1F1\uD1F3\uD1F4\uD1F5\uD1F6\uD1F7\uD1F8\uD1F9"+
-        "\uD1FA\uD1FB\uD1FC\uD1FD\uD241\uD242\uD243\uD244"+
-        "\uD245\uD246\uD247\uD248\uD249\uD24A\uD24B\uD24C"+
-        "\uD24D\uD24E\uD24F\uD250\uD251\uD253\uD254\uD255"+
-        "\uD256\uD257\uD258\uD259\uD25A\uD25B\uD25C\uD25D"+
-        "\uD261\uD262\uD263\uD264\uD265\uD266\uD267\uD268"+
-        "\uD269\uD26A\uD26B\uD26C\uD26D\uD26E\uD26F\uD270"+
-        "\uD271\uD273\uD274\uD275\uD276\uD277\uD278\uD279"+
-        "\uD27A\uD27B\uD27C\uD27D\uD281\uD282\uD283\uD284"+
-        "\uD285\uD286\uD287\uD288\uD289\uD28A\uD28B\uD28C"+
-        "\uD28D\uD28E\uD28F\uD290\uD291\uD293\uD294\uD295"+
-        "\uD296\uD297\uD298\uD299\uD29A\uD29B\uD29C\uD29D"+
-        "\uD2A1\uD2A2\uD2A3\uD2A4\uD2A5\uD2A6\uD2A7\uD2A8"+
-        "\uD2A9\uD2AA\uD2AB\uD2AC\uD2AD\uD2AE\uD2AF\uD2B0"+
-        "\uD2B1\uD2B3\uD2B4\uD2B5\uD2B6\uD2B7\uD2B8\uD2B9"+
-        "\uD2BA\uD2BB\uD2BC\uD2BD\uD2C1\uD2C2\uD2C3\uD2C4"+
-        "\uD2C5\uD2C6\uD2C7\uD2C8\uD2C9\uD2CA\uD2CB\uD2CC"+
-        "\uD2CD\uD2CE\uD2CF\uD2D0\uD2D1\uD2D3\uD2D4\uD2D5"+
-        "\uD2D6\uD2D7\uD2D8\uD2D9\uD2DA\uD2DB\uD2DC\uD2DD"+
-        "\uD2E1\uD2E2\uD2E3\uD2E4\uD2E5\uD2E6\uD2E7\uD2E8"+
-        "\uD2E9\uD2EA\uD2EB\uD2EC\uD2ED\uD2EE\uD2EF\uD2F0"+
-        "\uD2F1\uD2F3\uD2F4\uD2F5\uD2F6\uD2F7\uD2F8\uD2F9"+
-        "\uD2FA\uD2FB\uD2FC\uD2FD\uD341\uD342\uD343\uD344"+
-        "\uD345\uD346\uD347\uD348\uD349\uD34A\uD34B\uD34C"+
-        "\uD34D\uD34E\uD34F\uD350\uD351\uD353\uD354\uD355"+
-        "\uD356\uD357\uD358\uD359\uD35A\uD35B\uD35C\uD35D"+
-        "\uD361\uD362\uD363\uD364\uD365\uD366\uD367\uD368"+
-        "\uD369\uD36A\uD36B\uD36C\uD36D\uD36E\uD36F\uD370"+
-        "\uD371\uD373\uD374\uD375\uD376\uD377\uD378\uD379"+
-        "\uD37A\uD37B\uD37C\uD37D\uD381\uD382\uD383\uD384"+
-        "\uD385\uD386\uD387\uD388\uD389\uD38A\uD38B\uD38C"+
-        "\uD38D\uD38E\uD38F\uD390\uD391\uD393\uD394\uD395"+
-        "\uD396\uD397\uD398\uD399\uD39A\uD39B\uD39C\uD39D"+
-        "\uD3A1\uD3A2\uD3A3\uD3A4\uD3A5\uD3A6\uD3A7\uD3A8"+
-        "\uD3A9\uD3AA\uD3AB\uD3AC\uD3AD\uD3AE\uD3AF\uD3B0"+
-        "\uD3B1\uD3B3\uD3B4\uD3B5\uD3B6\uD3B7\uD3B8\uD3B9"+
-        "\uD3BA\uD3BB\uD3BC\uD3BD\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uE0D0\uE0D6\uE0E7\uE1CF\uE1E8\uE23D\uE2FB\uE332"+
-        "\uE348\uE360\uE36D\uE3D4\uE3D5\uE3D8\uE3DB\uE3DC"+
-        "\uE3DD\uE3DE\uE3DF\uE3E0\uE3E2\uE3E3\uE3E4\uE3E5"+
-        "\uE3E6\uE3E8\uE3E9\uE3EA\uE3EB\uE3ED\uE3EF\uE3F0"+
-        "\uE3F2\uE3F6\uE3FA\uE3FC\uE3FD\uE3FE\uE432\uE433"+
-        "\uE437\uE438\uE439\uE43A\uE43B\uE43D\uE442\uE44E"+
-        "\uE452\uE453\uE454\uE456\uE457\uE458\uE459\uE45A"+
-        "\uE45B\uE45D\uE45E\uE45F\uE460\uE461\uE462\uE463"+
-        "\uE464\uE465\uE466\uE467\uE469\uE46A\uE46E\uE46F"+
-        "\uE471\uE472\uE474\uE475\uE476\uE477\uE478\uE479"+
-        "\uE47A\uE47B\uE492\uE493\uE494\uE495\uE496\uE497"+
-        "\uE499\uE49A\uE576\uE59E\uE5A5\uE5AB\uE5AE\uE648"+
-        "\uE65D\uE6CB\uE6E4\uE8C5\uE8E4\uE935\uE9A5\uE9D5"+
-        "\uE9F4\uEA9E\uEAA0\uEAB3\uEAE1\uEAE8\uEB93\uEBAD"+
-        "\uEBED\uECF5\uED31\uED39\uEDAE\uEDB1\uEDB2\uEDB9"+
-        "\uEDBB\uEDBC\uEDC4\uEDCE\uEDD0\uEDD2\uEDD6\uEDFA"+
-        "\uEDFB\uEDFC\uEDFE\uEE31\uEE34\uEE37\uEE3D\uEE3F"+
-        "\uEE40\uEE41\uEE43\uEE47\uEE48\uEE4C\uEE54\uEE56"+
-        "\uEE57\uEE5A\uEE62\uEE66\uEE69\uEE6C\uEE6F\uEE71"+
-        "\uEE74\uEE75\uEE76\uEE78\uEE7A\uEE7B\uEE7C\uEE91"+
-        "\uEE93\uEE94\uEE97\uEE98\uEE99\uEE9B\uEEA1\uEEA6"+
-        "\uEEA9\uEEAA\uEEAC\uEEAD\uEEB0\uEEBF\uEEC1\uEEC6"+
-        "\uEEC7\uEECB\uEECD\uEECF\uEED0\uEED3\uEEDF\uEEE4"+
-        "\uEEE6\uEEF7\uEF77\uEF78\uEF92\uEF93\uEF99\uEF9B"+
-        "\uEF9D\uEFA0\uEFA7\uEFAC\uEFCC\uEFF7\uF051\uF075"+
-        "\uF096\uF099\uF09E\uF0A0\uF0A4\uF0A7\uF0A9\uF0AA"+
-        "\uF0BA\uF0BB\uF0BD\uF0C1\uF0C2\uF0C6\uF0C7\uF0CC"+
-        "\uF0CF\uF0D0\uF0D1\uF0D2\uF0D8\uF136\uF137\uF13A"+
-        "\uF13F\uF140\uF141\uF142\uF145\uF148\uF14A\uF150"+
-        "\uF151\uF155\uF156\uF159\uF15A\uF165\uF16D\uF16E"+
-        "\uF171\uF174\uF177\uF178\uF199\uF19A\uF19C\uF1A1"+
-        "\uF1A2\uF1A3\uF1EE\uF26B\uF44D\uF49C\uF4B1\uF537";
-
-    private final static String innerIndex9=
-        "\uF57E\uF696\uF698\uF6B8\uF6C8\uF6D3\uF76B\uF792"+
-        "\uF831\uF832\uF876\uF939\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\uDA31\uDA32\uDA33\uDA34\uDA35\uDA36\uDA37"+
-        "\uDA38\uDA39\uDA3A\uDA3B\uDA3C\uDA3D\uDA3E\uDA3F"+
-        "\uDA40\uDA41\uDA42\uDA43\uDA44\uDA45\uDA46\uDA47"+
-        "\uDA48\uDA49\uDA4A\uDA4B\uDA4C\uDA4D\uDA4E\uDA4F"+
-        "\uDA50\uDA51\uDA52\uDA53\uDA54\uDA55\uDA56\uDA57"+
-        "\uDA58\uDA59\uDA5A\uDA5B\uDA5C\uDA5D\uDA5E\uDA5F"+
-        "\uDA60\uDA61\uDA62\uDA63\uDA64\uDA65\uDA66\uDA67"+
-        "\uDA68\uDA69\uDA6A\uDA6B\uD93C\uDA6D\uDA6E\uDA6F"+
-        "\uDA70\uDA71\uDA72\uDA73\uDA74\uDA75\uDA76\uDA77"+
-        "\uDA78\uDA79\uDA7A\uDA7B\uDA7C\uDA7D\uDA7E\uDA91"+
-        "\uDA92\uDA93\uDA94\uDA95\uDA96\uDA97\uDA98\uDA99"+
-        "\uDA9A\uDA9B\uDA9C\uDA9D\uDA9E\uDA9F\uD9A6\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\uD95B\uD95C\uD9A0\uDAA0\u0000\uD95D\uDA6C\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"+
-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
-
-    private final static short index1[] = {
-        1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        6, 7, 8, 9, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
-        19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
-        35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
-        51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
-        67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
-        83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 101, 102,
-        103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
-        119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
-        135, 136, 137, 138, 139, 140, 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 0, 0, 0, 0, 145
-    };
-
-    String index2[] = {
-        innerIndex0,
-        innerIndex1,
-        innerIndex2,
-        innerIndex3,
-        innerIndex4,
-        innerIndex5,
-        innerIndex6,
-        innerIndex7,
-        innerIndex8,
-        innerIndex9
-    };
 }
diff --git a/jdk/src/share/classes/sun/net/httpserver/Request.java b/jdk/src/share/classes/sun/net/httpserver/Request.java
index 80bc31d..542e8e8 100644
--- a/jdk/src/share/classes/sun/net/httpserver/Request.java
+++ b/jdk/src/share/classes/sun/net/httpserver/Request.java
@@ -52,6 +52,9 @@
         os = rawout;
         do {
             startLine = readLine();
+            if (startLine == null) {
+                return;
+            }
             /* skip blank lines */
         } while (startLine == null ? false : startLine.equals (""));
     }
diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
index cfff8dd..8f5c8be 100644
--- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
+++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
@@ -433,6 +433,7 @@
                         rawin = sslStreams.getInputStream();
                         rawout = sslStreams.getOutputStream();
                         engine = sslStreams.getSSLEngine();
+                        connection.sslStreams = sslStreams;
                     } else {
                         rawin = new BufferedInputStream(
                             new Request.ReadStream (
@@ -442,6 +443,8 @@
                             ServerImpl.this, chan
                         );
                     }
+                    connection.raw = rawin;
+                    connection.rawout = rawout;
                 }
                 Request req = new Request (rawin, rawout);
                 requestLine = req.requestLine();
diff --git a/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java
index 2735a5a..180238d 100644
--- a/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java
+++ b/jdk/src/share/classes/sun/nio/ch/AsynchronousFileChannelImpl.java
@@ -113,16 +113,16 @@
         }
     }
 
-    final void invalidateAllLocks() {
+    final void invalidateAllLocks() throws IOException {
         if (fileLockTable != null) {
-            try {
-                fileLockTable.removeAll( new FileLockTable.Releaser() {
-                    public void release(FileLock fl) {
-                        ((FileLockImpl)fl).invalidate();
+            for (FileLock fl: fileLockTable.removeAll()) {
+                synchronized (fl) {
+                    if (fl.isValid()) {
+                        FileLockImpl fli = (FileLockImpl)fl;
+                        implRelease(fli);
+                        fli.invalidate();
                     }
-                });
-            } catch (IOException e) {
-                throw new AssertionError(e);
+                }
             }
         }
     }
@@ -158,7 +158,21 @@
     }
 
     /**
-     * Invoked by FileLockImpl to release lock acquired by this channel.
+     * Releases the given file lock.
      */
-    abstract void release(FileLockImpl fli) throws IOException;
+    protected abstract void implRelease(FileLockImpl fli) throws IOException;
+
+    /**
+     * Invoked by FileLockImpl to release the given file lock and remove it
+     * from the lock table.
+     */
+    final void release(FileLockImpl fli) throws IOException {
+        try {
+            begin();
+            implRelease(fli);
+            removeFromFileLockTable(fli);
+        } finally {
+            end();
+        }
+    }
 }
diff --git a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
index 1d60e96..d0461b3 100644
--- a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
+++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java
@@ -33,8 +33,6 @@
 import java.nio.channels.*;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Iterator;
-import java.lang.reflect.Field;
 import java.security.AccessController;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
@@ -95,14 +93,16 @@
     // -- Standard channel operations --
 
     protected void implCloseChannel() throws IOException {
-        // Invalidate and release any locks that we still hold
+        // Release and invalidate any locks that we still hold
         if (fileLockTable != null) {
-            fileLockTable.removeAll( new FileLockTable.Releaser() {
-                public void release(FileLock fl) throws IOException {
-                    ((FileLockImpl)fl).invalidate();
-                    nd.release(fd, fl.position(), fl.size());
+            for (FileLock fl: fileLockTable.removeAll()) {
+                synchronized (fl) {
+                    if (fl.isValid()) {
+                        nd.release(fd, fl.position(), fl.size());
+                        ((FileLockImpl)fl).invalidate();
+                    }
                 }
-            });
+            }
         }
 
         nd.preClose(fd);
@@ -912,32 +912,33 @@
         FileLockImpl fli = new FileLockImpl(this, position, size, shared);
         FileLockTable flt = fileLockTable();
         flt.add(fli);
-        boolean i = true;
+        boolean completed = false;
         int ti = -1;
         try {
             begin();
             ti = threads.add();
             if (!isOpen())
                 return null;
-            int result = nd.lock(fd, true, position, size, shared);
-            if (result == FileDispatcher.RET_EX_LOCK) {
-                assert shared;
-                FileLockImpl fli2 = new FileLockImpl(this, position, size,
-                                                     false);
-                flt.replace(fli, fli2);
-                return fli2;
+            int n;
+            do {
+                n = nd.lock(fd, true, position, size, shared);
+            } while ((n == FileDispatcher.INTERRUPTED) && isOpen());
+            if (isOpen()) {
+                if (n == FileDispatcher.RET_EX_LOCK) {
+                    assert shared;
+                    FileLockImpl fli2 = new FileLockImpl(this, position, size,
+                                                         false);
+                    flt.replace(fli, fli2);
+                    fli = fli2;
+                }
+                completed = true;
             }
-            if (result == FileDispatcher.INTERRUPTED || result == FileDispatcher.NO_LOCK) {
-                flt.remove(fli);
-                i = false;
-            }
-        } catch (IOException e) {
-            flt.remove(fli);
-            throw e;
         } finally {
+            if (!completed)
+                flt.remove(fli);
             threads.remove(ti);
             try {
-                end(i);
+                end(completed);
             } catch (ClosedByInterruptException e) {
                 throw new FileLockInterruptionException();
             }
@@ -985,7 +986,6 @@
     }
 
     void release(FileLockImpl fli) throws IOException {
-        ensureOpen();
         int ti = threads.add();
         try {
             ensureOpen();
@@ -1005,7 +1005,7 @@
      */
     private static class SimpleFileLockTable extends FileLockTable {
         // synchronize on list for access
-        private List<FileLock> lockList = new ArrayList<FileLock>(2);
+        private final List<FileLock> lockList = new ArrayList<FileLock>(2);
 
         public SimpleFileLockTable() {
         }
@@ -1034,14 +1034,11 @@
             }
         }
 
-        public void removeAll(Releaser releaser) throws IOException {
+        public List<FileLock> removeAll() {
             synchronized(lockList) {
-                Iterator<FileLock> i = lockList.iterator();
-                while (i.hasNext()) {
-                    FileLock fl = i.next();
-                    releaser.release(fl);
-                    i.remove();
-                }
+                List<FileLock> result = new ArrayList<FileLock>(lockList);
+                lockList.clear();
+                return result;
             }
         }
 
diff --git a/jdk/src/share/classes/sun/nio/ch/FileLockImpl.java b/jdk/src/share/classes/sun/nio/ch/FileLockImpl.java
index 9efd153..8f12bcf 100644
--- a/jdk/src/share/classes/sun/nio/ch/FileLockImpl.java
+++ b/jdk/src/share/classes/sun/nio/ch/FileLockImpl.java
@@ -31,25 +31,24 @@
 public class FileLockImpl
     extends FileLock
 {
-    boolean valid;
+    private volatile boolean valid = true;
 
     FileLockImpl(FileChannel channel, long position, long size, boolean shared)
     {
         super(channel, position, size, shared);
-        this.valid = true;
     }
 
     FileLockImpl(AsynchronousFileChannel channel, long position, long size, boolean shared)
     {
         super(channel, position, size, shared);
-        this.valid = true;
     }
 
-    public synchronized boolean isValid() {
+    public boolean isValid() {
         return valid;
     }
 
-    synchronized void invalidate() {
+    void invalidate() {
+        assert Thread.holdsLock(this);
         valid = false;
     }
 
@@ -66,5 +65,4 @@
             valid = false;
         }
     }
-
 }
diff --git a/jdk/src/share/classes/sun/nio/ch/FileLockTable.java b/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
index 137ab88..39cee5a 100644
--- a/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
+++ b/jdk/src/share/classes/sun/nio/ch/FileLockTable.java
@@ -61,22 +61,11 @@
     public abstract void remove(FileLock fl);
 
     /**
-     * An implementation of this interface releases a given file lock.
-     * Used with removeAll.
-     */
-    public abstract interface Releaser {
-        void release(FileLock fl) throws IOException;
-    }
-
-    /**
      * Removes all file locks from the table.
-     * <p>
-     * The Releaser#release method is invoked for each file lock before
-     * it is removed.
      *
-     * @throws IOException if the release method throws IOException
+     * @return  The list of file locks removed
      */
-    public abstract void removeAll(Releaser r) throws IOException;
+    public abstract List<FileLock> removeAll();
 
     /**
      * Replaces an existing file lock in the table.
@@ -195,7 +184,7 @@
                 FileLockReference ref = list.get(index);
                 FileLock lock = ref.get();
                 if (lock == fl) {
-                    assert (lock != null) && (lock.channel() == channel);
+                    assert (lock != null) && (lock.acquiredBy() == channel);
                     ref.clear();
                     list.remove(index);
                     break;
@@ -206,7 +195,8 @@
     }
 
     @Override
-    public void removeAll(Releaser releaser) throws IOException {
+    public List<FileLock> removeAll() {
+        List<FileLock> result = new ArrayList<FileLock>();
         List<FileLockReference> list = lockMap.get(fileKey);
         if (list != null) {
             synchronized (list) {
@@ -216,13 +206,13 @@
                     FileLock lock = ref.get();
 
                     // remove locks obtained by this channel
-                    if (lock != null && lock.channel() == channel) {
-                        // invoke the releaser to invalidate/release the lock
-                        releaser.release(lock);
-
+                    if (lock != null && lock.acquiredBy() == channel) {
                         // remove the lock from the list
                         ref.clear();
                         list.remove(index);
+
+                        // add to result
+                        result.add(lock);
                     } else {
                         index++;
                     }
@@ -232,6 +222,7 @@
                 removeKeyIfEmpty(fileKey, list);
             }
         }
+        return result;
     }
 
     @Override
diff --git a/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
index 52fe5a2..fb82f33 100644
--- a/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
+++ b/jdk/src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
@@ -97,6 +97,9 @@
             // then it will throw ClosedChannelException
         }
 
+        // Invalidate and release any locks that we still hold
+        invalidateAllLocks();
+
         // signal any threads blocked on this channel
         nd.preClose(fdObj);
         threads.signalAndWait();
@@ -109,9 +112,6 @@
             closeLock.writeLock().unlock();
         }
 
-        // Invalidate and release any locks that we still hold
-        invalidateAllLocks();
-
         // close file
         nd.close(fdObj);
 
@@ -226,11 +226,9 @@
                         do {
                             n = nd.lock(fdObj, true, position, size, shared);
                         } while ((n == FileDispatcher.INTERRUPTED) && isOpen());
-                        if (n == FileDispatcher.LOCKED) {
+                        if (n == FileDispatcher.LOCKED && isOpen()) {
                             result.setResult(fli);
                         } else {
-                            if (n != FileDispatcher.INTERRUPTED)
-                                throw new AssertionError();
                             throw new AsynchronousCloseException();
                         }
                     } catch (IOException x) {
@@ -279,16 +277,16 @@
             do {
                 n = nd.lock(fdObj, false, position, size, shared);
             } while ((n == FileDispatcher.INTERRUPTED) && isOpen());
-            if (n != FileDispatcher.LOCKED) {
-                if (n == FileDispatcher.NO_LOCK)
-                    return null;    // locked by someone else
-                if (n == FileDispatcher.INTERRUPTED)
-                    throw new AsynchronousCloseException();
-                // should not get here
-                throw new AssertionError();
+            if (n == FileDispatcher.LOCKED && isOpen()) {
+                gotLock = true;
+                return fli;    // lock acquired
             }
-            gotLock = true;
-            return fli;
+            if (n == FileDispatcher.NO_LOCK)
+                return null;    // locked by someone else
+            if (n == FileDispatcher.INTERRUPTED)
+                throw new AsynchronousCloseException();
+            // should not get here
+            throw new AssertionError();
         } finally {
             if (!gotLock)
                 removeFromFileLockTable(fli);
@@ -298,14 +296,8 @@
     }
 
     @Override
-    void release(FileLockImpl fli) throws IOException {
-        try {
-            begin();
-            nd.release(fdObj, fli.position(), fli.size());
-            removeFromFileLockTable(fli);
-        } finally {
-            end();
-        }
+    protected void implRelease(FileLockImpl fli) throws IOException {
+        nd.release(fdObj, fli.position(), fli.size());
     }
 
     @Override
diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java
index 07c78e2..e036776 100644
--- a/jdk/src/share/classes/sun/security/krb5/Config.java
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java
@@ -736,6 +736,14 @@
         return name;
     }
 
+    private static String trimmed(String s) {
+        s = s.trim();
+        if (s.charAt(0) == '"' && s.charAt(s.length()-1) == '"' ||
+                s.charAt(0) == '\'' && s.charAt(s.length()-1) == '\'') {
+            s = s.substring(1, s.length()-1).trim();
+        }
+        return s;
+    }
     /**
      * Parses key-value pairs under a stanza name.
      */
@@ -747,7 +755,7 @@
             for (int j = 0; j < line.length(); j++) {
                 if (line.charAt(j) == '=') {
                     String key = (line.substring(0, j)).trim();
-                    String value = (line.substring(j + 1)).trim();
+                    String value = trimmed(line.substring(j + 1));
                     table.put(key, value);
                     break;
                 }
@@ -820,7 +828,7 @@
                     } else {
                         nameVector = table.get(key);
                     }
-                    nameVector.addElement((line.substring(j + 1)).trim());
+                    nameVector.addElement(trimmed(line.substring(j + 1)));
                     table.put(key, nameVector);
                     break;
                 }
@@ -1263,4 +1271,32 @@
         }
     }
 
+    @Override
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        toStringIndented("", stanzaTable, sb);
+        return sb.toString();
+    }
+    private static void toStringIndented(String prefix, Object obj,
+            StringBuffer sb) {
+        if (obj instanceof String) {
+            sb.append(prefix);
+            sb.append(obj);
+            sb.append('\n');
+        } else if (obj instanceof Hashtable) {
+            Hashtable tab = (Hashtable)obj;
+            for (Object o: tab.keySet()) {
+                sb.append(prefix);
+                sb.append(o);
+                sb.append(" = {\n");
+                toStringIndented(prefix + "    ", tab.get(o), sb);
+                sb.append(prefix + "}\n");
+            }
+        } else if (obj instanceof Vector) {
+            Vector v = (Vector)obj;
+            for (Object o: v.toArray()) {
+                toStringIndented(prefix + "    ", o, sb);
+            }
+        }
+    }
 }
diff --git a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java b/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java
index e9ff9cc..259aedd 100644
--- a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java
+++ b/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java
@@ -274,27 +274,31 @@
                                + ",Attempt =" + i
                                + ", #bytes=" + obuf.length);
                     }
-                    /*
-                     * Send the data to the kdc.
-                     */
+                    try {
+                        /*
+                         * Send the data to the kdc.
+                         */
 
                     kdcClient.send(obuf);
 
-                    /*
-                     * And get a response.
-                     */
-                    try {
-                        ibuf = kdcClient.receive();
-                        break;
-                    } catch (SocketTimeoutException se) {
-                        if (DEBUG) {
-                            System.out.println ("SocketTimeOutException with " +
-                                                "attempt: " + i);
+                        /*
+                         * And get a response.
+                         */
+                        try {
+                            ibuf = kdcClient.receive();
+                            break;
+                        } catch (SocketTimeoutException se) {
+                            if (DEBUG) {
+                                System.out.println ("SocketTimeOutException with " +
+                                                    "attempt: " + i);
+                            }
+                            if (i == DEFAULT_KDC_RETRY_LIMIT) {
+                                ibuf = null;
+                                throw se;
+                            }
                         }
-                        if (i == DEFAULT_KDC_RETRY_LIMIT) {
-                            ibuf = null;
-                            throw se;
-                        }
+                    } finally {
+                        kdcClient.close();
                     }
                 }
             }
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java b/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java
index c9e440f..670df92 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/UDPClient.java
@@ -93,4 +93,7 @@
         return data;
     }
 
+    public void close() {
+        dgSocket.close();
+    }
 }
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java b/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
index 701e104..1027df9 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
 import sun.security.pkcs11.wrapper.*;
 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
 
+import sun.security.rsa.RSAKeyFactory;
+
 /**
  * KeyPairGenerator implementation class. This class currently supports
  * RSA, DSA, DH, and EC.
@@ -66,7 +68,7 @@
     private AlgorithmParameterSpec params;
 
     // for RSA, selected or default value of public exponent, always valid
-    private BigInteger rsaPublicExponent;
+    private BigInteger rsaPublicExponent = RSAKeyGenParameterSpec.F4;
 
     // SecureRandom instance, if specified in init
     private SecureRandom random;
@@ -88,19 +90,19 @@
     public void initialize(int keySize, SecureRandom random) {
         token.ensureValid();
         try {
-            checkKeySize(keySize);
+            checkKeySize(keySize, null);
         } catch (InvalidAlgorithmParameterException e) {
             throw new InvalidParameterException(e.getMessage());
         }
         this.keySize = keySize;
         this.params = null;
         this.random = random;
-        this.rsaPublicExponent = RSAKeyGenParameterSpec.F4;
         if (algorithm.equals("EC")) {
             params = P11ECKeyFactory.getECParameterSpec(keySize);
             if (params == null) {
-                throw new InvalidParameterException
-                ("No EC parameters available for key size " + keySize + " bits");
+                throw new InvalidParameterException(
+                    "No EC parameters available for key size "
+                    + keySize + " bits");
             }
         }
     }
@@ -115,8 +117,10 @@
                         ("DHParameterSpec required for Diffie-Hellman");
             }
             DHParameterSpec dhParams = (DHParameterSpec)params;
-            this.keySize = dhParams.getP().bitLength();
-            this.params = params;
+            int tmpKeySize = dhParams.getP().bitLength();
+            checkKeySize(tmpKeySize, dhParams);
+            this.keySize = tmpKeySize;
+            this.params = dhParams;
             // XXX sanity check params
         } else if (algorithm.equals("RSA")) {
             if (params instanceof RSAKeyGenParameterSpec == false) {
@@ -124,7 +128,9 @@
                         ("RSAKeyGenParameterSpec required for RSA");
             }
             RSAKeyGenParameterSpec rsaParams = (RSAKeyGenParameterSpec)params;
-            this.keySize = rsaParams.getKeysize();
+            int tmpKeySize = rsaParams.getKeysize();
+            checkKeySize(tmpKeySize, rsaParams);
+            this.keySize = tmpKeySize;
             this.params = null;
             this.rsaPublicExponent = rsaParams.getPublicExponent();
             // XXX sanity check params
@@ -134,13 +140,16 @@
                         ("DSAParameterSpec required for DSA");
             }
             DSAParameterSpec dsaParams = (DSAParameterSpec)params;
-            this.keySize = dsaParams.getP().bitLength();
-            this.params = params;
+            int tmpKeySize = dsaParams.getP().bitLength();
+            checkKeySize(tmpKeySize, dsaParams);
+            this.keySize = tmpKeySize;
+            this.params = dsaParams;
             // XXX sanity check params
         } else if (algorithm.equals("EC")) {
             ECParameterSpec ecParams;
             if (params instanceof ECParameterSpec) {
-                ecParams = P11ECKeyFactory.getECParameterSpec((ECParameterSpec)params);
+                ecParams = P11ECKeyFactory.getECParameterSpec(
+                    (ECParameterSpec)params);
                 if (ecParams == null) {
                     throw new InvalidAlgorithmParameterException
                         ("Unsupported curve: " + params);
@@ -156,16 +165,17 @@
                 throw new InvalidAlgorithmParameterException
                     ("ECParameterSpec or ECGenParameterSpec required for EC");
             }
-            this.keySize = ecParams.getCurve().getField().getFieldSize();
+            int tmpKeySize = ecParams.getCurve().getField().getFieldSize();
+            checkKeySize(tmpKeySize, ecParams);
+            this.keySize = tmpKeySize;
             this.params = ecParams;
         } else {
             throw new ProviderException("Unknown algorithm: " + algorithm);
         }
         this.random = random;
-        checkKeySize(keySize);
     }
 
-    private void checkKeySize(int keySize)
+    private void checkKeySize(int keySize, AlgorithmParameterSpec params)
             throws InvalidAlgorithmParameterException {
         if (algorithm.equals("EC")) {
             if (keySize < 112) {
@@ -178,13 +188,28 @@
                     ("Key size must be at most 2048 bit");
             }
             return;
+        } else if (algorithm.equals("RSA")) {
+            BigInteger tmpExponent = rsaPublicExponent;
+            if (params != null) {
+                // Already tested for instanceof RSAKeyGenParameterSpec above
+                tmpExponent =
+                    ((RSAKeyGenParameterSpec)params).getPublicExponent();
+            }
+            try {
+                // This provider supports 64K or less.
+                RSAKeyFactory.checkKeyLengths(keySize, tmpExponent,
+                    512, 64 * 1024);
+            } catch (InvalidKeyException e) {
+                throw new InvalidAlgorithmParameterException(e.getMessage());
+            }
+            return;
         }
+
         if (keySize < 512) {
             throw new InvalidAlgorithmParameterException
                 ("Key size must be at least 512 bit");
         }
-        if (algorithm.equals("RSA") ||
-                (algorithm.equals("DH") && (params != null))) {
+        if (algorithm.equals("DH") && (params != null)) {
             // sanity check, nobody really wants keys this large
             if (keySize > 64 * 1024) {
                 throw new InvalidAlgorithmParameterException
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java b/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java
index 839a2f3..b0e2071 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11KeyStore.java
@@ -80,6 +80,8 @@
 import sun.security.pkcs11.wrapper.*;
 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
 
+import sun.security.rsa.RSAKeyFactory;
+
 final class P11KeyStore extends KeyStoreSpi {
 
     private static final CK_ATTRIBUTE ATTR_CLASS_CERT =
@@ -1328,6 +1330,15 @@
             BigInteger modulus = attrs[0].getBigInteger();
             keyLength = modulus.bitLength();
 
+            // This check will combine our "don't care" values here
+            // with the system-wide min/max values.
+            try {
+                RSAKeyFactory.checkKeyLengths(keyLength, null,
+                    -1, Integer.MAX_VALUE);
+            } catch (InvalidKeyException e) {
+                throw new KeyStoreException(e.getMessage());
+            }
+
             return P11Key.privateKey(session,
                                 oHandle,
                                 keyType,
diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java b/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java
index 5f3cbbf..1bd764d 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11RSAKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
 import sun.security.pkcs11.wrapper.*;
 import static sun.security.pkcs11.wrapper.PKCS11Constants.*;
 
+import sun.security.rsa.RSAKeyFactory;
+
 /**
  * RSA KeyFactory implemenation.
  *
@@ -131,6 +133,9 @@
         } catch (PKCS11Exception e) {
             throw new InvalidKeySpecException
                 ("Could not create RSA public key", e);
+        } catch (InvalidKeyException e) {
+            throw new InvalidKeySpecException
+                ("Could not create RSA public key", e);
         }
     }
 
@@ -175,11 +180,15 @@
         } catch (PKCS11Exception e) {
             throw new InvalidKeySpecException
                 ("Could not create RSA private key", e);
+        } catch (InvalidKeyException e) {
+            throw new InvalidKeySpecException
+                ("Could not create RSA private key", e);
         }
     }
 
     private PublicKey generatePublic(BigInteger n, BigInteger e)
-            throws PKCS11Exception {
+            throws PKCS11Exception, InvalidKeyException {
+        RSAKeyFactory.checkKeyLengths(n.bitLength(), e, -1, 64 * 1024);
         CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
             new CK_ATTRIBUTE(CKA_CLASS, CKO_PUBLIC_KEY),
             new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_RSA),
@@ -200,7 +209,8 @@
     }
 
     private PrivateKey generatePrivate(BigInteger n, BigInteger d)
-            throws PKCS11Exception {
+            throws PKCS11Exception, InvalidKeyException {
+        RSAKeyFactory.checkKeyLengths(n.bitLength(), null, -1, 64 * 1024);
         CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
             new CK_ATTRIBUTE(CKA_CLASS, CKO_PRIVATE_KEY),
             new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_RSA),
@@ -222,7 +232,9 @@
 
     private PrivateKey generatePrivate(BigInteger n, BigInteger e,
             BigInteger d, BigInteger p, BigInteger q, BigInteger pe,
-            BigInteger qe, BigInteger coeff) throws PKCS11Exception {
+            BigInteger qe, BigInteger coeff) throws PKCS11Exception,
+            InvalidKeyException {
+        RSAKeyFactory.checkKeyLengths(n.bitLength(), e, -1, 64 * 1024);
         CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
             new CK_ATTRIBUTE(CKA_CLASS, CKO_PRIVATE_KEY),
             new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_RSA),
diff --git a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
index b6eb1c2..6d0e045 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -120,11 +120,13 @@
     }
 
     /**
-     * @deprecated use new SunPKCS11(String) or new SunPKCS11(InputStream) instead
+     * @deprecated use new SunPKCS11(String) or new SunPKCS11(InputStream)
+     *         instead
      */
     @Deprecated
     public SunPKCS11(String configName, InputStream configStream) {
-        super("SunPKCS11-" + Config.getConfig(configName, configStream).getName(),
+        super("SunPKCS11-" +
+            Config.getConfig(configName, configStream).getName(),
             1.7d, Config.getConfig(configName, configStream).getDescription());
         this.configName = configName;
         this.config = Config.removeConfig(configName);
@@ -153,7 +155,8 @@
         //
         // If we are in Secmod mode and configured to use either the
         // nssKeyStore or the nssTrustAnchors module, we automatically
-        // switch to using the NSS trust attributes for trusted certs (KeyStore).
+        // switch to using the NSS trust attributes for trusted certs
+        // (KeyStore).
         //
 
         if (useSecmod) {
@@ -168,33 +171,40 @@
                 if (secmod.isInitialized()) {
                     if (nssSecmodDirectory != null) {
                         String s = secmod.getConfigDir();
-                        if ((s != null) && (s.equals(nssSecmodDirectory) == false)) {
+                        if ((s != null) &&
+                                (s.equals(nssSecmodDirectory) == false)) {
                             throw new ProviderException("Secmod directory "
                                 + nssSecmodDirectory
-                                + " invalid, NSS already initialized with " + s);
+                                + " invalid, NSS already initialized with "
+                                + s);
                         }
                     }
                     if (nssLibraryDirectory != null) {
                         String s = secmod.getLibDir();
-                        if ((s != null) && (s.equals(nssLibraryDirectory) == false)) {
+                        if ((s != null) &&
+                                (s.equals(nssLibraryDirectory) == false)) {
                             throw new ProviderException("NSS library directory "
                                 + nssLibraryDirectory
-                                + " invalid, NSS already initialized with " + s);
+                                + " invalid, NSS already initialized with "
+                                + s);
                         }
                     }
                 } else {
                     if (nssDbMode != DbMode.NO_DB) {
                         if (nssSecmodDirectory == null) {
-                            throw new ProviderException("Secmod not initialized and "
-                                + "nssSecmodDirectory not specified");
+                            throw new ProviderException(
+                                "Secmod not initialized and "
+                                 + "nssSecmodDirectory not specified");
                         }
                     } else {
                         if (nssSecmodDirectory != null) {
-                            throw new ProviderException
-                            ("nssSecmodDirectory must not be specified in noDb mode");
+                            throw new ProviderException(
+                                "nssSecmodDirectory must not be "
+                                + "specified in noDb mode");
                         }
                     }
-                    secmod.initialize(nssDbMode, nssSecmodDirectory, nssLibraryDirectory);
+                    secmod.initialize(nssDbMode, nssSecmodDirectory,
+                        nssLibraryDirectory);
                 }
             } catch (IOException e) {
                 // XXX which exception to throw
@@ -211,7 +221,8 @@
                 if (nssModule != null) {
                     moduleName = "fips";
                 } else {
-                    moduleName = (nssDbMode == DbMode.NO_DB) ? "crypto" : "keystore";
+                    moduleName = (nssDbMode == DbMode.NO_DB) ?
+                        "crypto" : "keystore";
                 }
             }
             if (moduleName.equals("fips")) {
@@ -253,10 +264,12 @@
                         + ": only " + k + " external NSS modules available");
                 }
             } else {
-                throw new ProviderException("Unknown NSS module: " + moduleName);
+                throw new ProviderException(
+                    "Unknown NSS module: " + moduleName);
             }
             if (nssModule == null) {
-                throw new ProviderException("NSS module not available: " + moduleName);
+                throw new ProviderException(
+                    "NSS module not available: " + moduleName);
             }
             if (nssModule.hasInitializedProvider()) {
                 throw new ProviderException("Secmod module already configured");
@@ -296,8 +309,9 @@
             initArgs.flags = CKF_OS_LOCKING_OK;
             PKCS11 tmpPKCS11;
             try {
-                tmpPKCS11 = PKCS11.getInstance
-                    (library, functionList, initArgs, config.getOmitInitialize());
+                tmpPKCS11 = PKCS11.getInstance(
+                    library, functionList, initArgs,
+                    config.getOmitInitialize());
             } catch (PKCS11Exception e) {
                 if (debug != null) {
                     debug.println("Multi-threaded initialization failed: " + e);
@@ -312,8 +326,8 @@
                 } else {
                     initArgs.flags = 0;
                 }
-                tmpPKCS11 = PKCS11.getInstance
-                    (library, functionList, initArgs, config.getOmitInitialize());
+                tmpPKCS11 = PKCS11.getInstance(library,
+                    functionList, initArgs, config.getOmitInitialize());
             }
             p11 = tmpPKCS11;
 
@@ -336,8 +350,10 @@
                     System.out.println("Slots with tokens: " + toString(slots));
                 }
                 if (slotID < 0) {
-                    if ((slotListIndex < 0) || (slotListIndex >= slots.length)) {
-                        throw new ProviderException("slotListIndex is " + slotListIndex
+                    if ((slotListIndex < 0)
+                            || (slotListIndex >= slots.length)) {
+                        throw new ProviderException("slotListIndex is "
+                            + slotListIndex
                             + " but token only has " + slots.length + " slots");
                     }
                     slotID = slots[slotListIndex];
@@ -575,12 +591,15 @@
         d(KF, "DH",             P11DHKeyFactory,        s("DiffieHellman"),
                 m(CKM_DH_PKCS_KEY_PAIR_GEN, CKM_DH_PKCS_DERIVE));
         d(KF, "EC",             P11DHKeyFactory,
-                m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE, CKM_ECDSA, CKM_ECDSA_SHA1));
+                m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE,
+                    CKM_ECDSA, CKM_ECDSA_SHA1));
 
         // AlgorithmParameters for EC.
         // Only needed until we have an EC implementation in the SUN provider.
-        d(AGP, "EC",            "sun.security.ec.ECParameters", s("1.2.840.10045.2.1"),
-                m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE, CKM_ECDSA, CKM_ECDSA_SHA1));
+        d(AGP, "EC",            "sun.security.ec.ECParameters",
+                                                s("1.2.840.10045.2.1"),
+                m(CKM_EC_KEY_PAIR_GEN, CKM_ECDH1_DERIVE,
+                    CKM_ECDSA, CKM_ECDSA_SHA1));
 
         d(KA, "DH",             P11KeyAgreement,        s("DiffieHellman"),
                 m(CKM_DH_PKCS_DERIVE));
@@ -654,12 +673,16 @@
         d(SIG, "SHA512withRSA", P11Signature,
                 m(CKM_SHA512_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
 
-        d(KG, "SunTlsRsaPremasterSecret", "sun.security.pkcs11.P11TlsRsaPremasterSecretGenerator",
+        d(KG, "SunTlsRsaPremasterSecret",
+                    "sun.security.pkcs11.P11TlsRsaPremasterSecretGenerator",
                 m(CKM_SSL3_PRE_MASTER_KEY_GEN, CKM_TLS_PRE_MASTER_KEY_GEN));
-        d(KG, "SunTlsMasterSecret", "sun.security.pkcs11.P11TlsMasterSecretGenerator",
+        d(KG, "SunTlsMasterSecret",
+                    "sun.security.pkcs11.P11TlsMasterSecretGenerator",
                 m(CKM_SSL3_MASTER_KEY_DERIVE, CKM_TLS_MASTER_KEY_DERIVE,
-                    CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_MASTER_KEY_DERIVE_DH));
-        d(KG, "SunTlsKeyMaterial", "sun.security.pkcs11.P11TlsKeyMaterialGenerator",
+                    CKM_SSL3_MASTER_KEY_DERIVE_DH,
+                    CKM_TLS_MASTER_KEY_DERIVE_DH));
+        d(KG, "SunTlsKeyMaterial",
+                    "sun.security.pkcs11.P11TlsKeyMaterialGenerator",
                 m(CKM_SSL3_KEY_AND_MAC_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE));
         d(KG, "SunTlsPrf", "sun.security.pkcs11.P11TlsPrfGenerator",
                 m(CKM_TLS_PRF, CKM_NSS_TLS_PRF_GENERAL));
@@ -773,6 +796,13 @@
             System.out.println(token.tokenInfo);
         }
         long[] supportedMechanisms = p11.C_GetMechanismList(slotID);
+
+        // Create a map from the various Descriptors to the "most
+        // preferred" mechanism that was defined during the
+        // static initialization.  For example, DES/CBC/PKCS5Padding
+        // could be mapped to CKM_DES_CBC_PAD or CKM_DES_CBC.  Prefer
+        // the earliest entry.  When asked for "DES/CBC/PKCS5Padding", we
+        // return a CKM_DES_CBC_PAD.
         final Map<Descriptor,Integer> supportedAlgs =
                                         new HashMap<Descriptor,Integer>();
         for (int i = 0; i < supportedMechanisms.length; i++) {
@@ -807,6 +837,9 @@
                     supportedAlgs.put(d, integerMech);
                     continue;
                 }
+                // See if there is something "more preferred"
+                // than what we currently have in the supportedAlgs
+                // map.
                 int intOldMech = oldMech.intValue();
                 for (int j = 0; j < d.mechanisms.length; j++) {
                     int nextMech = d.mechanisms[j];
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java b/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java
index 17ce8cd..d877f28 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.security.interfaces.*;
 import java.security.spec.*;
 
+import sun.security.action.GetPropertyAction;
+
 /**
  * KeyFactory for RSA keys. Keys must be instances of PublicKey or PrivateKey
  * and getAlgorithm() must return "RSA". For such keys, it supports conversion
@@ -68,6 +70,24 @@
     private final static Class<?> x509KeySpecClass  = X509EncodedKeySpec.class;
     private final static Class<?> pkcs8KeySpecClass = PKCS8EncodedKeySpec.class;
 
+    public final static int MIN_MODLEN = 512;
+    public final static int MAX_MODLEN = 16384;
+
+    /*
+     * If the modulus length is above this value, restrict the size of
+     * the exponent to something that can be reasonably computed.  We
+     * could simply hardcode the exp len to something like 64 bits, but
+     * this approach allows flexibility in case impls would like to use
+     * larger module and exponent values.
+     */
+    public final static int MAX_MODLEN_RESTRICT_EXP = 3072;
+    public final static int MAX_RESTRICTED_EXPLEN = 64;
+
+    private static final boolean restrictExpLen =
+        "true".equalsIgnoreCase(AccessController.doPrivileged(
+            new GetPropertyAction(
+                "sun.security.rsa.restrictRSAExponent", "true")));
+
     // instance used for static translateKey();
     private final static RSAKeyFactory INSTANCE = new RSAKeyFactory();
 
@@ -76,74 +96,79 @@
     }
 
     /**
-     * Static method to convert Key into a useable instance of
-     * RSAPublicKey or RSAPrivate(Crt)Key. Check the key and convert it
-     * to a SunRsaSign key if necessary. If the key is not an RSA key
-     * or cannot be used, throw an InvalidKeyException.
-     *
-     * The difference between this method and engineTranslateKey() is that
-     * we do not convert keys of other providers that are already an
-     * instance of RSAPublicKey or RSAPrivate(Crt)Key.
+     * Static method to convert Key into an instance of RSAPublicKeyImpl
+     * or RSAPrivate(Crt)KeyImpl. If the key is not an RSA key or cannot be
+     * used, throw an InvalidKeyException.
      *
      * Used by RSASignature and RSACipher.
      */
     public static RSAKey toRSAKey(Key key) throws InvalidKeyException {
-        if (key instanceof RSAKey) {
-            RSAKey rsaKey = (RSAKey)key;
-            checkKey(rsaKey);
-            return rsaKey;
+        if ((key instanceof RSAPrivateKeyImpl) ||
+            (key instanceof RSAPrivateCrtKeyImpl) ||
+            (key instanceof RSAPublicKeyImpl)) {
+            return (RSAKey)key;
         } else {
             return (RSAKey)INSTANCE.engineTranslateKey(key);
         }
     }
 
-    /**
-     * Check that the given RSA key is valid.
+    /*
+     * Single test entry point for all of the mechanisms in the SunRsaSign
+     * provider (RSA*KeyImpls).  All of the tests are the same.
+     *
+     * For compatibility, we round up to the nearest byte here:
+     * some Key impls might pass in a value within a byte of the
+     * real value.
      */
-    private static void checkKey(RSAKey key) throws InvalidKeyException {
-        // check for subinterfaces, omit additional checks for our keys
-        if (key instanceof RSAPublicKey) {
-            if (key instanceof RSAPublicKeyImpl) {
-                return;
-            }
-        } else if (key instanceof RSAPrivateKey) {
-            if ((key instanceof RSAPrivateCrtKeyImpl)
-                    || (key instanceof RSAPrivateKeyImpl)) {
-                return;
-            }
-        } else {
-            throw new InvalidKeyException("Neither a public nor a private key");
-        }
-        // RSAKey does not extend Key, so we need to do a cast
-        String keyAlg = ((Key)key).getAlgorithm();
-        if (keyAlg.equals("RSA") == false) {
-            throw new InvalidKeyException("Not an RSA key: " + keyAlg);
-        }
-        BigInteger modulus;
-        // some providers implement RSAKey for keys where the values are
-        // not accessible (although they should). Detect those here
-        // for a more graceful failure.
-        try {
-            modulus = key.getModulus();
-            if (modulus == null) {
-                throw new InvalidKeyException("Modulus is missing");
-            }
-        } catch (RuntimeException e) {
-            throw new InvalidKeyException(e);
-        }
-        checkKeyLength(modulus);
+    static void checkRSAProviderKeyLengths(int modulusLen, BigInteger exponent)
+            throws InvalidKeyException {
+        checkKeyLengths(((modulusLen + 7) & ~7), exponent,
+            RSAKeyFactory.MIN_MODLEN, Integer.MAX_VALUE);
     }
 
     /**
-     * Check the length of the modulus of an RSA key. We only support keys
-     * at least 505 bits long.
+     * Check the length of an RSA key modulus/exponent to make sure it
+     * is not too short or long.  Some impls have their own min and
+     * max key sizes that may or may not match with a system defined value.
+     *
+     * @param modulusLen the bit length of the RSA modulus.
+     * @param exponent the RSA exponent
+     * @param minModulusLen if > 0, check to see if modulusLen is at
+     *        least this long, otherwise unused.
+     * @param maxModulusLen caller will allow this max number of bits.
+     *        Allow the smaller of the system-defined maximum and this param.
+     *
+     * @throws InvalidKeyException if any of the values are unacceptable.
      */
-    static void checkKeyLength(BigInteger modulus) throws InvalidKeyException {
-        if (modulus.bitLength() < 505) {
-            // some providers may generate slightly shorter keys
-            // accept them if the encoding is at least 64 bytes long
-            throw new InvalidKeyException
-                ("RSA keys must be at least 512 bits long");
+     public static void checkKeyLengths(int modulusLen, BigInteger exponent,
+            int minModulusLen, int maxModulusLen) throws InvalidKeyException {
+
+        if ((minModulusLen > 0) && (modulusLen < (minModulusLen))) {
+            throw new InvalidKeyException( "RSA keys must be at least " +
+                minModulusLen + " bits long");
+        }
+
+        // Even though our policy file may allow this, we don't want
+        // either value (mod/exp) to be too big.
+
+        int maxLen = Math.min(maxModulusLen, MAX_MODLEN);
+
+        // If a RSAPrivateKey/RSAPublicKey, make sure the
+        // modulus len isn't too big.
+        if (modulusLen > maxLen) {
+            throw new InvalidKeyException(
+                "RSA keys must be no longer than " + maxLen + " bits");
+        }
+
+        // If a RSAPublicKey, make sure the exponent isn't too big.
+        if (restrictExpLen && (exponent != null) &&
+                (modulusLen > MAX_MODLEN_RESTRICT_EXP) &&
+                (exponent.bitLength() > MAX_RESTRICTED_EXPLEN)) {
+            throw new InvalidKeyException(
+                "RSA exponents can be no longer than " +
+                MAX_RESTRICTED_EXPLEN + " bits " +
+                " if modulus is greater than " +
+                MAX_MODLEN_RESTRICT_EXP + " bits");
         }
     }
 
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java b/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java
index f800dec..2898a3d 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@
     // public exponent to use
     private BigInteger publicExponent;
 
-    // size of the key to generate, >= 512
+    // size of the key to generate, >= RSAKeyFactory.MIN_MODLEN
     private int keySize;
 
     // PRNG to use
@@ -60,15 +60,16 @@
 
     // initialize the generator. See JCA doc
     public void initialize(int keySize, SecureRandom random) {
-        if (keySize < 512) {
-            throw new InvalidParameterException
-                ("Key size must be at least 512 bits");
+
+        // do not allow unreasonably small or large key sizes,
+        // probably user error
+        try {
+            RSAKeyFactory.checkKeyLengths(keySize, RSAKeyGenParameterSpec.F4,
+                512, 64 * 1024);
+        } catch (InvalidKeyException e) {
+            throw new InvalidParameterException(e.getMessage());
         }
-        if (keySize > 64 * 1024) {
-            // do not allow unreasonably large key sizes, probably user error
-            throw new InvalidParameterException
-                ("Key size must be 65536 bits or less");
-        }
+
         this.keySize = keySize;
         this.random = random;
         this.publicExponent = RSAKeyGenParameterSpec.F4;
@@ -77,35 +78,41 @@
     // second initialize method. See JCA doc.
     public void initialize(AlgorithmParameterSpec params, SecureRandom random)
             throws InvalidAlgorithmParameterException {
+
         if (params instanceof RSAKeyGenParameterSpec == false) {
             throw new InvalidAlgorithmParameterException
                 ("Params must be instance of RSAKeyGenParameterSpec");
         }
+
         RSAKeyGenParameterSpec rsaSpec = (RSAKeyGenParameterSpec)params;
-        keySize = rsaSpec.getKeysize();
-        publicExponent = rsaSpec.getPublicExponent();
-        this.random = random;
-        if (keySize < 512) {
-            throw new InvalidAlgorithmParameterException
-                ("Key size must be at least 512 bits");
-        }
-        if (keySize > 64 * 1024) {
-            // do not allow unreasonably large key sizes, probably user error
-            throw new InvalidAlgorithmParameterException
-                ("Key size must be 65536 bits or less");
-        }
-        if (publicExponent == null) {
-            publicExponent = RSAKeyGenParameterSpec.F4;
+        int tmpKeySize = rsaSpec.getKeysize();
+        BigInteger tmpPublicExponent = rsaSpec.getPublicExponent();
+
+        if (tmpPublicExponent == null) {
+            tmpPublicExponent = RSAKeyGenParameterSpec.F4;
         } else {
-            if (publicExponent.compareTo(RSAKeyGenParameterSpec.F0) < 0) {
+            if (tmpPublicExponent.compareTo(RSAKeyGenParameterSpec.F0) < 0) {
                 throw new InvalidAlgorithmParameterException
                         ("Public exponent must be 3 or larger");
             }
-            if (publicExponent.bitLength() > keySize) {
+            if (tmpPublicExponent.bitLength() > tmpKeySize) {
                 throw new InvalidAlgorithmParameterException
                         ("Public exponent must be smaller than key size");
             }
         }
+
+        // do not allow unreasonably large key sizes, probably user error
+        try {
+            RSAKeyFactory.checkKeyLengths(tmpKeySize, tmpPublicExponent,
+                512, 64 * 1024);
+        } catch (InvalidKeyException e) {
+            throw new InvalidAlgorithmParameterException(
+                "Invalid key sizes", e);
+        }
+
+        this.keySize = tmpKeySize;
+        this.publicExponent = tmpPublicExponent;
+        this.random = random;
     }
 
     // generate the keypair. See JCA doc
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
index ac296b4..640972a 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
      */
     RSAPrivateCrtKeyImpl(byte[] encoded) throws InvalidKeyException {
         decode(encoded);
-        RSAKeyFactory.checkKeyLength(n);
+        RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
     }
 
     /**
@@ -107,7 +107,8 @@
         this.pe = pe;
         this.qe = qe;
         this.coeff = coeff;
-        RSAKeyFactory.checkKeyLength(n);
+        RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
+
         // generate the encoding
         algid = rsaId;
         try {
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java
index 1f883f4..860e770 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
     RSAPrivateKeyImpl(BigInteger n, BigInteger d) throws InvalidKeyException {
         this.n = n;
         this.d = d;
-        RSAKeyFactory.checkKeyLength(n);
+        RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), null);
         // generate the encoding
         algid = RSAPrivateCrtKeyImpl.rsaId;
         try {
diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
index c500ca2..6db08f6 100644
--- a/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
+++ b/jdk/src/share/classes/sun/security/rsa/RSAPublicKeyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,10 +56,11 @@
      * Construct a key from its components. Used by the
      * RSAKeyFactory and the RSAKeyPairGenerator.
      */
-    public RSAPublicKeyImpl(BigInteger n, BigInteger e) throws InvalidKeyException {
+    public RSAPublicKeyImpl(BigInteger n, BigInteger e)
+            throws InvalidKeyException {
         this.n = n;
         this.e = e;
-        RSAKeyFactory.checkKeyLength(n);
+        RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
         // generate the encoding
         algid = RSAPrivateCrtKeyImpl.rsaId;
         try {
@@ -80,7 +81,7 @@
      */
     public RSAPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
         decode(encoded);
-        RSAKeyFactory.checkKeyLength(n);
+        RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e);
     }
 
     // see JCA doc
diff --git a/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java b/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java
index 2ad04c0..717e5bc 100644
--- a/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java
+++ b/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java
@@ -26,7 +26,8 @@
 package sun.security.util;
 
 import java.io.*;
-
+import java.math.BigInteger;
+import java.util.Arrays;
 
 /**
  * Represent an ISO Object Identifier.
@@ -44,105 +45,186 @@
  * hierarchy, and other organizations can easily acquire the ability
  * to assign such unique identifiers.
  *
- *
  * @author David Brownell
  * @author Amit Kapoor
  * @author Hemma Prafullchandra
  */
+
 final public
 class ObjectIdentifier implements Serializable
 {
-    /** use serialVersionUID from JDK 1.1. for interoperability */
+    /**
+     * We use the DER value (no tag, no length) as the internal format
+     * @serial
+     */
+    private byte[] encoding = null;
+
+    private transient volatile String stringForm;
+
+    /*
+     * IMPORTANT NOTES FOR CODE CHANGES (bug 4811968) IN JDK 1.7.0
+     * ===========================================================
+     *
+     * (Almost) serialization compatibility with old versions:
+     *
+     * serialVersionUID is unchanged. Old field "component" is changed to
+     * type Object so that "poison" (unknown object type for old versions)
+     * can be put inside if there are huge components that cannot be saved
+     * as integers.
+     *
+     * New version use the new filed "encoding" only.
+     *
+     * Below are all 4 cases in a serialization/deserialization process:
+     *
+     * 1. old -> old: Not covered here
+     * 2. old -> new: There's no "encoding" field, new readObject() reads
+     *    "components" and "componentLen" instead and inits correctly.
+     * 3. new -> new: "encoding" field exists, new readObject() uses it
+     *    (ignoring the other 2 fields) and inits correctly.
+     * 4. new -> old: old readObject() only recognizes "components" and
+     *    "componentLen" fields. If no huge components are involved, they
+     *    are serialized as legal values and old object can init correctly.
+     *    Otherwise, old object cannot recognize the form (component not int[])
+     *    and throw a ClassNotFoundException at deserialization time.
+     *
+     * Therfore, for the first 3 cases, exact compatibility is preserved. In
+     * the 4th case, non-huge OID is still supportable in old versions, while
+     * huge OID is not.
+     */
     private static final long serialVersionUID = 8697030238860181294L;
-    private static final int maxFirstComponent = 2;
-    private static final int maxSecondComponent = 39;
 
     /**
-     * Constructs an object identifier from a string.  This string
-     * should be of the form 1.23.34.45.56 etc.
+     * Changed to Object
+     * @serial
+     */
+    private Object      components   = null;          // path from root
+    /**
+     * @serial
+     */
+    private int         componentLen = -1;            // how much is used.
+
+    // Is the components field calculated?
+    transient private boolean   componentsCalculated = false;
+
+    private void readObject(ObjectInputStream is)
+            throws IOException, ClassNotFoundException {
+        is.defaultReadObject();
+
+        if (encoding == null) {  // from an old version
+            init((int[])components, componentLen);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream os)
+            throws IOException {
+        if (!componentsCalculated) {
+            int[] comps = toIntArray();
+            if (comps != null) {    // every one understands this
+                components = comps;
+                componentLen = comps.length;
+            } else {
+                components = HugeOidNotSupportedByOldJDK.theOne;
+            }
+            componentsCalculated = true;
+        }
+        os.defaultWriteObject();
+    }
+
+    static class HugeOidNotSupportedByOldJDK implements Serializable {
+        private static final long serialVersionUID = 1L;
+        static HugeOidNotSupportedByOldJDK theOne = new HugeOidNotSupportedByOldJDK();
+    }
+
+    /**
+     * Constructs, from a string.  This string should be of the form 1.23.56.
+     * Validity check included.
      */
     public ObjectIdentifier (String oid) throws IOException
     {
         int ch = '.';
-        int     start = 0;
+        int start = 0;
         int end = 0;
 
-        // Calculate length of oid
-        componentLen = 0;
-        while ((end = oid.indexOf(ch,start)) != -1) {
-            start = end + 1;
-            componentLen += 1;
-        }
-        componentLen += 1;
-        components = new int[componentLen];
+        int pos = 0;
+        byte[] tmp = new byte[oid.length()];
+        int first = 0, second;
+        int count = 0;
 
-        start = 0;
-        int i = 0;
-        String comp = null;
         try {
-            while ((end = oid.indexOf(ch,start)) != -1) {
-                comp = oid.substring(start,end);
-                components[i++] = Integer.valueOf(comp).intValue();
+            String comp = null;
+            do {
+                int length = 0; // length of one section
+                end = oid.indexOf(ch,start);
+                if (end == -1) {
+                    comp = oid.substring(start);
+                    length = oid.length() - start;
+                } else {
+                    comp = oid.substring(start,end);
+                    length = end - start;
+                }
+
+                if (length > 9) {
+                    BigInteger bignum = new BigInteger(comp);
+                    if (count == 0) {
+                        checkFirstComponent(bignum);
+                        first = bignum.intValue();
+                    } else {
+                        if (count == 1) {
+                            checkSecondComponent(first, bignum);
+                            bignum = bignum.add(BigInteger.valueOf(40*first));
+                        } else {
+                            checkOtherComponent(count, bignum);
+                        }
+                        pos += pack7Oid(bignum, tmp, pos);
+                    }
+                } else {
+                    int num = Integer.parseInt(comp);
+                    if (count == 0) {
+                        checkFirstComponent(num);
+                        first = num;
+                    } else {
+                        if (count == 1) {
+                            checkSecondComponent(first, num);
+                            num += 40 * first;
+                        } else {
+                            checkOtherComponent(count, num);
+                        }
+                        pos += pack7Oid(num, tmp, pos);
+                    }
+                }
                 start = end + 1;
-            }
-            comp = oid.substring(start);
-            components[i] = Integer.valueOf(comp).intValue();
+                count++;
+            } while (end != -1);
+
+            checkCount(count);
+            encoding = new byte[pos];
+            System.arraycopy(tmp, 0, encoding, 0, pos);
+            this.stringForm = oid;
+        } catch (IOException ioe) { // already detected by checkXXX
+            throw ioe;
         } catch (Exception e) {
             throw new IOException("ObjectIdentifier() -- Invalid format: "
                     + e.toString(), e);
         }
-        checkValidOid(components, componentLen);
-        this.stringForm = oid;
     }
 
     /**
-     * Check if the values make a legal OID. There must be at least 2
-     * components and they must be all non-negative. The first component
-     * should be 0,1 or 2. When the first component is 0 or 1, the
-     * second component should be less than or equal to 39
-     *
-     * @param values the components that will make the OID
-     * @param len the number of components to check. Note that the allocation
-     *        size of <code>values</code> may be longer than <code>len</code>.
-     *        In this case, only the first <code>len</code> items are checked.
-     * @exception IOException if this is not a legal OID
-     */
-    private void checkValidOid(int[] values, int len) throws IOException {
-        if (values == null || len < 2) {
-            throw new IOException("ObjectIdentifier() -- " +
-                    "Must be at least two oid components ");
-        }
-
-        for (int i=0; i<len; i++) {
-            if (values[i] < 0) {
-                throw new IOException("ObjectIdentifier() -- " +
-                        "oid component #" + (i+1) + " must be non-negative ");
-            }
-        }
-
-        if (values[0] > maxFirstComponent) {
-            throw new IOException("ObjectIdentifier() -- " +
-                    "First oid component is invalid ");
-        }
-
-        if (values[0] < 2 && values[1] > maxSecondComponent) {
-            throw new IOException("ObjectIdentifier() -- " +
-                    "Second oid component is invalid ");
-        }
-    }
-    /**
-     * Constructs an object ID from an array of integers.  This
-     * is used to construct constant object IDs.
+     * Constructor, from an array of integers.
+     * Validity check included.
      */
     public ObjectIdentifier (int values []) throws IOException
     {
-        checkValidOid(values, values.length);
-        components = values.clone();
-        componentLen = values.length;
+        checkCount(values.length);
+        checkFirstComponent(values[0]);
+        checkSecondComponent(values[0], values[1]);
+        for (int i=2; i<values.length; i++)
+            checkOtherComponent(i, values[i]);
+        init(values, values.length);
     }
 
     /**
-     * Constructs an object ID from an ASN.1 encoded input stream.
+     * Constructor, from an ASN.1 encoded input stream.
+     * Validity check NOT included.
      * The encoding of the ID in the stream uses "DER", a BER/1 subset.
      * In this case, that means a triple { typeId, length, data }.
      *
@@ -152,8 +234,7 @@
      * @param in DER-encoded data holding an object ID
      * @exception IOException indicates a decoding error
      */
-    public ObjectIdentifier (DerInputStream in)
-        throws IOException
+    public ObjectIdentifier (DerInputStream in) throws IOException
     {
         byte    type_id;
         int     bufferEnd;
@@ -174,215 +255,67 @@
                 + " (tag = " +  type_id + ")"
                 );
 
-        bufferEnd = in.available () - in.getLength () - 1;
-        if (bufferEnd < 0)
-            throw new IOException (
-                "ObjectIdentifier() -- not enough data");
-
-        initFromEncoding (in, bufferEnd);
+        encoding = new byte[in.getLength()];
+        in.getBytes(encoding);
+        check(encoding);
     }
 
     /*
-     * Build the OID from the rest of a DER input buffer; the tag
-     * and length have been removed/verified
+     * Constructor, from the rest of a DER input buffer;
+     * the tag and length have been removed/verified
+     * Validity check NOT included.
      */
     ObjectIdentifier (DerInputBuffer buf) throws IOException
     {
-        initFromEncoding (new DerInputStream (buf), 0);
+        DerInputStream in = new DerInputStream(buf);
+        encoding = new byte[in.available()];
+        in.getBytes(encoding);
+        check(encoding);
+    }
+
+    private void init(int[] components, int length) {
+        int pos = 0;
+        byte[] tmp = new byte[length*5+1];  // +1 for empty input
+
+        if (components[1] < Integer.MAX_VALUE - components[0]*40)
+            pos += pack7Oid(components[0]*40+components[1], tmp, pos);
+        else {
+            BigInteger big = BigInteger.valueOf(components[1]);
+            big = big.add(BigInteger.valueOf(components[0]*40));
+            pos += pack7Oid(big, tmp, pos);
+        }
+
+        for (int i=2; i<length; i++) {
+            pos += pack7Oid(components[i], tmp, pos);
+        }
+        encoding = new byte[pos];
+        System.arraycopy(tmp, 0, encoding, 0, pos);
     }
 
     /**
-     * Private constructor for use by newInternal(). Dummy argument
-     * to avoid clash with the public constructor.
-     */
-    private ObjectIdentifier(int[] components, boolean dummy) {
-        this.components = components;
-        this.componentLen = components.length;
-    }
-
-    /**
-     * Create a new ObjectIdentifier for internal use. The values are
+     * This method is kept for compatibility reasons. The new implementation
+     * does the check and conversion. All around the JDK, the method is called
+     * in static blocks to initialize pre-defined ObjectIdentifieies. No
+     * obvious performance hurt will be made after this change.
+     *
+     * Old doc: Create a new ObjectIdentifier for internal use. The values are
      * neither checked nor cloned.
      */
     public static ObjectIdentifier newInternal(int[] values) {
-        return new ObjectIdentifier(values, true);
-    }
-
-    /*
-     * Helper function -- get the OID from a stream, after tag and
-     * length are verified.
-     */
-    private void initFromEncoding (DerInputStream in, int bufferEnd)
-        throws IOException
-    {
-
-        /*
-         * Now get the components ("sub IDs") one at a time.  We fill a
-         * temporary buffer, resizing it as needed.
-         */
-        int             component;
-        boolean         first_subid = true;
-
-        for (components = new int [allocationQuantum], componentLen = 0;
-                in.available () > bufferEnd;
-        ) {
-            component = getComponent (in);
-            if (component < 0) {
-                throw new IOException(
-                    "ObjectIdentifier() -- " +
-                    "component values must be nonnegative");
-            }
-            if (first_subid) {
-                int     X, Y;
-
-                /*
-                 * NOTE:  the allocation quantum is large enough that we know
-                 * we don't have to reallocate here!
-                 */
-                if (component < 40)
-                    X = 0;
-                else if (component < 80)
-                    X = 1;
-                else
-                    X = 2;
-                Y = component - ( X * 40);
-                components [0] = X;
-                components [1] = Y;
-                componentLen = 2;
-
-                first_subid = false;
-
-            } else {
-
-                /*
-                 * Other components are encoded less exotically.  The only
-                 * potential trouble is the need to grow the array.
-                 */
-                if (componentLen >= components.length) {
-                    int         tmp_components [];
-
-                    tmp_components = new int [components.length
-                                        + allocationQuantum];
-                    System.arraycopy (components, 0, tmp_components, 0,
-                            components.length);
-                    components = tmp_components;
-                }
-                components [componentLen++] = component;
-            }
-        }
-
-        checkValidOid(components, componentLen);
-
-        /*
-         * Final sanity check -- if we didn't use exactly the number of bytes
-         * specified, something's quite wrong.
-         */
-        if (in.available () != bufferEnd) {
-            throw new IOException (
-                    "ObjectIdentifier() -- malformed input data");
+        try {
+            return new ObjectIdentifier(values);
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+            // Should not happen, internal calls always uses legal values.
         }
     }
 
-
     /*
      * n.b. the only public interface is DerOutputStream.putOID()
      */
     void encode (DerOutputStream out) throws IOException
     {
-        DerOutputStream bytes = new DerOutputStream ();
-        int i;
-
-        // According to ISO X.660, when the 1st component is 0 or 1, the 2nd
-        // component is restricted to be less than or equal to 39, thus make
-        // it small enough to be encoded into one single byte.
-        if (components[0] < 2) {
-            bytes.write ((components [0] * 40) + components [1]);
-        } else {
-            putComponent(bytes, (components [0] * 40) + components [1]);
-        }
-        for (i = 2; i < componentLen; i++)
-            putComponent (bytes, components [i]);
-
-        /*
-         * Now that we've constructed the component, encode
-         * it in the stream we were given.
-         */
-        out.write (DerValue.tag_ObjectId, bytes);
-    }
-
-    /*
-     * Tricky OID component parsing technique ... note that one bit
-     * per octet is lost, this returns at most 28 bits of component.
-     * Also, notice this parses in big-endian format.
-     */
-    private static int getComponent (DerInputStream in)
-    throws IOException
-    {
-        int retval, i, tmp;
-
-        for (i = 0, retval = 0; i < 4; i++) {
-            retval <<= 7;
-            tmp = in.getByte ();
-            retval |= (tmp & 0x07f);
-            if ((tmp & 0x080) == 0)
-                return retval;
-        }
-
-        throw new IOException ("ObjectIdentifier() -- component value too big");
-    }
-
-    /*
-     * Reverse of the above routine.  Notice it needs to emit in
-     * big-endian form, so it buffers the output until it's ready.
-     * (Minimum length encoding is a DER requirement.)
-     */
-    private static void putComponent (DerOutputStream out, int val)
-    throws IOException
-    {
-        int     i;
-        // TODO: val must be <128*128*128*128 here, otherwise, 4 bytes is not
-        // enough to hold it. Will address this later.
-        byte    buf [] = new byte [4] ;
-
-        for (i = 0; i < 4; i++) {
-            buf [i] = (byte) (val & 0x07f);
-            val >>>= 7;
-            if (val == 0)
-                break;
-        }
-        for ( ; i > 0; --i)
-            out.write (buf [i] | 0x080);
-        out.write (buf [0]);
-    }
-
-    // XXX this API should probably facilitate the JDK sort utility
-
-    /**
-     * Compares this identifier with another, for sorting purposes.
-     * An identifier does not precede itself.
-     *
-     * @param other identifer that may precede this one.
-     * @return true iff <em>other</em> precedes this one
-     *          in a particular sorting order.
-     */
-    public boolean precedes (ObjectIdentifier other)
-    {
-        int             i;
-
-        // shorter IDs go first
-        if (other == this || componentLen < other.componentLen)
-            return false;
-        if (other.componentLen < componentLen)
-            return true;
-
-        // for each component, the lesser component goes first
-        for (i = 0; i < componentLen; i++) {
-            if (other.components [i] < components [i])
-                return true;
-        }
-
-        // identical IDs don't precede each other
-        return false;
+        out.write (DerValue.tag_ObjectId, encoding);
     }
 
     /**
@@ -398,6 +331,7 @@
      *
      * @return true iff the names are identical.
      */
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
@@ -406,23 +340,71 @@
             return false;
         }
         ObjectIdentifier other = (ObjectIdentifier)obj;
-        if (componentLen != other.componentLen) {
-            return false;
-        }
-        for (int i = 0; i < componentLen; i++) {
-            if (components[i] != other.components[i]) {
-                return false;
-            }
-        }
-        return true;
+        return Arrays.equals(encoding, other.encoding);
     }
 
+    @Override
     public int hashCode() {
-        int h = componentLen;
-        for (int i = 0; i < componentLen; i++) {
-            h += components[i] * 37;
+        return Arrays.hashCode(encoding);
+    }
+
+    /**
+     * Private helper method for serialization. To be compatible with old
+     * versions of JDK.
+     * @return components in an int array, if all the components are less than
+     *         Integer.MAX_VALUE. Otherwise, null.
+     */
+    private int[] toIntArray() {
+        int length = encoding.length;
+        int[] result = new int[20];
+        int which = 0;
+        int fromPos = 0;
+        for (int i = 0; i < length; i++) {
+            if ((encoding[i] & 0x80) == 0) {
+                // one section [fromPos..i]
+                if (i - fromPos + 1 > 4) {
+                    BigInteger big = new BigInteger(pack(encoding, fromPos, i-fromPos+1, 7, 8));
+                    if (fromPos == 0) {
+                        result[which++] = 2;
+                        BigInteger second = big.subtract(BigInteger.valueOf(80));
+                        if (second.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) == 1) {
+                            return null;
+                        } else {
+                            result[which++] = second.intValue();
+                        }
+                    } else {
+                        if (big.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) == 1) {
+                            return null;
+                        } else {
+                            result[which++] = big.intValue();
+                        }
+                    }
+                } else {
+                    int retval = 0;
+                    for (int j = fromPos; j <= i; j++) {
+                        retval <<= 7;
+                        byte tmp = encoding[j];
+                        retval |= (tmp & 0x07f);
+                    }
+                    if (fromPos == 0) {
+                        if (retval < 80) {
+                            result[which++] = retval / 40;
+                            result[which++] = retval % 40;
+                        } else {
+                            result[which++] = 2;
+                            result[which++] = retval - 80;
+                        }
+                    } else {
+                        result[which++] = retval;
+                    }
+                }
+                fromPos = i+1;
+            }
+            if (which >= result.length) {
+                result = Arrays.copyOf(result, which + 10);
+            }
         }
-        return h;
+        return Arrays.copyOf(result, which);
     }
 
     /**
@@ -431,15 +413,52 @@
      * user-friendly descriptive strings, since those strings
      * will not be understood everywhere.
      */
+    @Override
     public String toString() {
         String s = stringForm;
         if (s == null) {
-            StringBuffer sb = new StringBuffer(componentLen * 4);
-            for (int i = 0; i < componentLen; i++) {
-                if (i != 0) {
-                    sb.append('.');
+            int length = encoding.length;
+            StringBuffer sb = new StringBuffer(length * 4);
+
+            int fromPos = 0;
+            for (int i = 0; i < length; i++) {
+                if ((encoding[i] & 0x80) == 0) {
+                    // one section [fromPos..i]
+                    if (fromPos != 0) {  // not the first segment
+                        sb.append('.');
+                    }
+                    if (i - fromPos + 1 > 4) { // maybe big integer
+                        BigInteger big = new BigInteger(pack(encoding, fromPos, i-fromPos+1, 7, 8));
+                        if (fromPos == 0) {
+                            // first section encoded with more than 4 bytes,
+                            // must be 2.something
+                            sb.append("2.");
+                            sb.append(big.subtract(BigInteger.valueOf(80)));
+                        } else {
+                            sb.append(big);
+                        }
+                    } else { // small integer
+                        int retval = 0;
+                        for (int j = fromPos; j <= i; j++) {
+                            retval <<= 7;
+                            byte tmp = encoding[j];
+                            retval |= (tmp & 0x07f);
+                        }
+                        if (fromPos == 0) {
+                            if (retval < 80) {
+                                sb.append(retval/40);
+                                sb.append('.');
+                                sb.append(retval%40);
+                            } else {
+                                sb.append("2.");
+                                sb.append(retval - 80);
+                            }
+                        } else {
+                            sb.append(retval);
+                        }
+                    }
+                    fromPos = i+1;
                 }
-                sb.append(components[i]);
             }
             s = sb.toString();
             stringForm = s;
@@ -447,15 +466,197 @@
         return s;
     }
 
-    /*
-     * To simplify, we assume no individual component of an object ID is
-     * larger than 32 bits.  Then we represent the path from the root as
-     * an array that's (usually) only filled at the beginning.
+    /**
+     * Repack all bits from input to output. On the both sides, only a portion
+     * (from the least significant bit) of the 8 bits in a byte is used. This
+     * number is defined as the number of useful bits (NUB) for the array. All the
+     * used bits from the input byte array and repacked into the output in the
+     * exactly same order. The output bits are aligned so that the final bit of
+     * the input (the least significant bit in the last byte), when repacked as
+     * the final bit of the output, is still at the least significant position.
+     * Zeroes will be padded on the left side of the first output byte if
+     * necessary. All unused bits in the output are also zeroed.
+     *
+     * For example: if the input is 01001100 with NUB 8, the output which
+     * has a NUB 6 will look like:
+     *      00000001 00001100
+     * The first 2 bits of the output bytes are unused bits. The other bits
+     * turn out to be 000001 001100. While the 8 bits on the right are from
+     * the input, the left 4 zeroes are padded to fill the 6 bits space.
+     *
+     * @param in        the input byte array
+     * @param ioffset   start point inside <code>in</code>
+     * @param ilength   number of bytes to repack
+     * @param iw        NUB for input
+     * @param ow        NUB for output
+     * @return          the repacked bytes
      */
-    private int         components [];                  // path from root
-    private int         componentLen;                   // how much is used.
+    private static byte[] pack(byte[] in, int ioffset, int ilength, int iw, int ow) {
+        assert (iw > 0 && iw <= 8): "input NUB must be between 1 and 8";
+        assert (ow > 0 && ow <= 8): "output NUB must be between 1 and 8";
 
-    private transient volatile String stringForm;
+        if (iw == ow) {
+            return in.clone();
+        }
 
-    private static final int allocationQuantum = 5;     // >= 2
+        int bits = ilength * iw;    // number of all used bits
+        byte[] out = new byte[(bits+ow-1)/ow];
+
+        // starting from the 0th bit in the input
+        int ipos = 0;
+
+        // the number of padding 0's needed in the output, skip them
+        int opos = (bits+ow-1)/ow*ow-bits;
+
+        while(ipos < bits) {
+            int count = iw - ipos%iw;   // unpacked bits in current input byte
+            if (count > ow - opos%ow) { // free space available in output byte
+                count = ow - opos%ow;   // choose the smaller number
+            }
+            // and move them!
+            out[opos/ow] |=                         // paste!
+                (((in[ioffset+ipos/iw]+256)         // locate the byte (+256 so that it's never negative)
+                    >> (iw-ipos%iw-count))          // move to the end of a byte
+                        & ((1 << (count))-1))       // zero out all other bits
+                            << (ow-opos%ow-count);  // move to the output position
+            ipos += count;  // advance
+            opos += count;  // advance
+        }
+        return out;
+    }
+
+    /**
+     * Repack from NUB 8 to a NUB 7 OID sub-identifier, remove all
+     * unnecessary 0 headings, set the first bit of all non-tail
+     * output bytes to 1 (as ITU-T Rec. X.690 8.19.2 says), and
+     * paste it into an existing byte array.
+     * @param out the existing array to be pasted into
+     * @param ooffset the starting position to paste
+     * @return the number of bytes pasted
+     */
+    private static int pack7Oid(byte[] in, int ioffset, int ilength, byte[] out, int ooffset) {
+        byte[] pack = pack(in, ioffset, ilength, 8, 7);
+        int firstNonZero = pack.length-1;   // paste at least one byte
+        for (int i=pack.length-2; i>=0; i--) {
+            if (pack[i] != 0) {
+                firstNonZero = i;
+            }
+            pack[i] |= 0x80;
+        }
+        System.arraycopy(pack, firstNonZero, out, ooffset, pack.length-firstNonZero);
+        return pack.length-firstNonZero;
+    }
+
+    /**
+     * Repack from NUB 7 to NUB 8, remove all unnecessary 0
+     * headings, and paste it into an existing byte array.
+     * @param out the existing array to be pasted into
+     * @param ooffset the starting position to paste
+     * @return the number of bytes pasted
+     */
+    private static int pack8(byte[] in, int ioffset, int ilength, byte[] out, int ooffset) {
+        byte[] pack = pack(in, ioffset, ilength, 7, 8);
+        int firstNonZero = pack.length-1;   // paste at least one byte
+        for (int i=pack.length-2; i>=0; i--) {
+            if (pack[i] != 0) {
+                firstNonZero = i;
+            }
+        }
+        System.arraycopy(pack, firstNonZero, out, ooffset, pack.length-firstNonZero);
+        return pack.length-firstNonZero;
+    }
+
+    /**
+     * Pack the int into a OID sub-identifier DER encoding
+     */
+    private static int pack7Oid(int input, byte[] out, int ooffset) {
+        byte[] b = new byte[4];
+        b[0] = (byte)(input >> 24);
+        b[1] = (byte)(input >> 16);
+        b[2] = (byte)(input >> 8);
+        b[3] = (byte)(input);
+        return pack7Oid(b, 0, 4, out, ooffset);
+    }
+
+    /**
+     * Pack the BigInteger into a OID subidentifier DER encoding
+     */
+    private static int pack7Oid(BigInteger input, byte[] out, int ooffset) {
+        byte[] b = input.toByteArray();
+        return pack7Oid(b, 0, b.length, out, ooffset);
+    }
+
+    /**
+     * Private methods to check validity of OID. They must be --
+     * 1. at least 2 components
+     * 2. all components must be non-negative
+     * 3. the first must be 0, 1 or 2
+     * 4. if the first is 0 or 1, the second must be <40
+     */
+
+    /**
+     * Check the DER encoding. Since DER encoding defines that the integer bits
+     * are unsigned, so there's no need to check the MSB.
+     */
+    private static void check(byte[] encoding) throws IOException {
+        int length = encoding.length;
+        if (length < 1 ||      // too short
+                (encoding[length - 1] & 0x80) != 0) {  // not ended
+            throw new IOException("ObjectIdentifier() -- " +
+                    "Invalid DER encoding, not ended");
+        }
+        for (int i=0; i<length; i++) {
+            // 0x80 at the beginning of a subidentifier
+            if (encoding[i] == (byte)0x80 &&
+                    (i==0 || (encoding[i-1] & 0x80) == 0)) {
+                throw new IOException("ObjectIdentifier() -- " +
+                        "Invalid DER encoding, useless extra octet detected");
+            }
+        }
+    }
+    private static void checkCount(int count) throws IOException {
+        if (count < 2) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "Must be at least two oid components ");
+        }
+    }
+    private static void checkFirstComponent(int first) throws IOException {
+        if (first < 0 || first > 2) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "First oid component is invalid ");
+        }
+    }
+    private static void checkFirstComponent(BigInteger first) throws IOException {
+        if (first.signum() == -1 ||
+                first.compareTo(BigInteger.valueOf(2)) == 1) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "First oid component is invalid ");
+        }
+    }
+    private static void checkSecondComponent(int first, int second) throws IOException {
+        if (second < 0 || first != 2 && second > 39) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "Second oid component is invalid ");
+        }
+    }
+    private static void checkSecondComponent(int first, BigInteger second) throws IOException {
+        if (second.signum() == -1 ||
+                first != 2 &&
+                second.compareTo(BigInteger.valueOf(39)) == 1) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "Second oid component is invalid ");
+        }
+    }
+    private static void checkOtherComponent(int i, int num) throws IOException {
+        if (num < 0) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "oid component #" + (i+1) + " must be non-negative ");
+        }
+    }
+    private static void checkOtherComponent(int i, BigInteger num) throws IOException {
+        if (num.signum() == -1) {
+            throw new IOException("ObjectIdentifier() -- " +
+                    "oid component #" + (i+1) + " must be non-negative ");
+        }
+    }
 }
diff --git a/jdk/src/share/classes/sun/swing/DefaultLookup.java b/jdk/src/share/classes/sun/swing/DefaultLookup.java
index af46f95..c5dccc5 100644
--- a/jdk/src/share/classes/sun/swing/DefaultLookup.java
+++ b/jdk/src/share/classes/sun/swing/DefaultLookup.java
@@ -27,6 +27,7 @@
 import java.awt.Color;
 import java.awt.Insets;
 import javax.swing.*;
+import javax.swing.border.Border;
 import javax.swing.plaf.ComponentUI;
 import sun.awt.AppContext;
 
@@ -137,6 +138,10 @@
         return ((Number)iValue).intValue();
     }
 
+    public static int getInt(JComponent c, ComponentUI ui, String key) {
+        return getInt(c, ui, key, -1);
+    }
+
     public static Insets getInsets(JComponent c, ComponentUI ui, String key,
                                    Insets defaultValue) {
         Object iValue = get(c, ui, key);
@@ -147,6 +152,10 @@
         return (Insets)iValue;
     }
 
+    public static Insets getInsets(JComponent c, ComponentUI ui, String key) {
+        return getInsets(c, ui, key, null);
+    }
+
     public static boolean getBoolean(JComponent c, ComponentUI ui, String key,
                                      boolean defaultValue) {
         Object iValue = get(c, ui, key);
@@ -157,6 +166,10 @@
         return ((Boolean)iValue).booleanValue();
     }
 
+    public static boolean getBoolean(JComponent c, ComponentUI ui, String key) {
+        return getBoolean(c, ui, key, false);
+    }
+
     public static Color getColor(JComponent c, ComponentUI ui, String key,
                                  Color defaultValue) {
         Object iValue = get(c, ui, key);
@@ -167,7 +180,35 @@
         return (Color)iValue;
     }
 
+    public static Color getColor(JComponent c, ComponentUI ui, String key) {
+        return getColor(c, ui, key, null);
+    }
 
+    public static Icon getIcon(JComponent c, ComponentUI ui, String key,
+            Icon defaultValue) {
+        Object iValue = get(c, ui, key);
+        if (iValue == null || !(iValue instanceof Icon)) {
+            return defaultValue;
+        }
+        return (Icon)iValue;
+    }
+
+    public static Icon getIcon(JComponent c, ComponentUI ui, String key) {
+        return getIcon(c, ui, key, null);
+    }
+
+    public static Border getBorder(JComponent c, ComponentUI ui, String key,
+            Border defaultValue) {
+        Object iValue = get(c, ui, key);
+        if (iValue == null || !(iValue instanceof Border)) {
+            return defaultValue;
+        }
+        return (Border)iValue;
+    }
+
+    public static Border getBorder(JComponent c, ComponentUI ui, String key) {
+        return getBorder(c, ui, key, null);
+    }
 
     public Object getDefault(JComponent c, ComponentUI ui, String key) {
         // basic
diff --git a/jdk/src/share/classes/sun/swing/FilePane.java b/jdk/src/share/classes/sun/swing/FilePane.java
index 71112b3..eae3d5a 100644
--- a/jdk/src/share/classes/sun/swing/FilePane.java
+++ b/jdk/src/share/classes/sun/swing/FilePane.java
@@ -265,6 +265,7 @@
     private Color   listViewBackground;
     private boolean listViewWindowsStyle;
     private boolean readOnly;
+    private boolean fullRowSelection = false;
 
     private ListSelectionModel listSelectionModel;
     private JList list;
@@ -448,6 +449,7 @@
         kiloByteString = UIManager.getString("FileChooser.fileSizeKiloBytes", l);
         megaByteString = UIManager.getString("FileChooser.fileSizeMegaBytes", l);
         gigaByteString = UIManager.getString("FileChooser.fileSizeGigaBytes", l);
+        fullRowSelection = UIManager.getBoolean("FileView.fullRowSelection");
 
         renameErrorTitleText = UIManager.getString("FileChooser.renameErrorTitleText", l);
         renameErrorText = UIManager.getString("FileChooser.renameErrorText", l);
@@ -991,6 +993,7 @@
         public DetailsTableCellEditor(JTextField tf) {
             super(tf);
             this.tf = tf;
+            tf.setName("Table.editor");
             tf.addFocusListener(editorFocusListener);
         }
 
@@ -1018,7 +1021,8 @@
         }
 
         public void setBounds(int x, int y, int width, int height) {
-            if (getHorizontalAlignment() == SwingConstants.LEADING) {
+        if (getHorizontalAlignment() == SwingConstants.LEADING &&
+                    !fullRowSelection) {
                 // Restrict width to actual text
                 width = Math.min(width, this.getPreferredSize().width+4);
             } else {
@@ -1039,9 +1043,9 @@
         public Component getTableCellRendererComponent(JTable table, Object value,
                               boolean isSelected, boolean hasFocus, int row, int column) {
 
-            if (table.convertColumnIndexToModel(column) != COLUMN_FILENAME ||
-                    (listViewWindowsStyle && !table.isFocusOwner())) {
-
+            if ((table.convertColumnIndexToModel(column) != COLUMN_FILENAME ||
+                    (listViewWindowsStyle && !table.isFocusOwner())) &&
+                    !fullRowSelection) {
                 isSelected = false;
             }
 
@@ -1338,6 +1342,7 @@
             Rectangle r = list.getCellBounds(index, index);
             if (editCell == null) {
                 editCell = new JTextField();
+                editCell.setName("Tree.cellEditor");
                 editCell.addActionListener(new EditActionListener());
                 editCell.addFocusListener(editorFocusListener);
                 editCell.setNextFocusableComponent(list);
@@ -1797,10 +1802,11 @@
                 Point p = evt.getPoint();
                 index = table.rowAtPoint(p);
 
-                if (SwingUtilities2.pointOutsidePrefSize(table,
-                                                         index,
-                                                         table.columnAtPoint(p), p)) {
+                boolean pointOutsidePrefSize =
+                        SwingUtilities2.pointOutsidePrefSize(
+                            table, index, table.columnAtPoint(p), p);
 
+                if (pointOutsidePrefSize && !fullRowSelection) {
                     return;
                 }
 
diff --git a/jdk/src/share/classes/sun/swing/plaf/GTKKeybindings.java b/jdk/src/share/classes/sun/swing/plaf/GTKKeybindings.java
new file mode 100644
index 0000000..3701d86
--- /dev/null
+++ b/jdk/src/share/classes/sun/swing/plaf/GTKKeybindings.java
@@ -0,0 +1,736 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.swing.plaf;
+
+import javax.swing.JTextField;
+import javax.swing.UIDefaults;
+import javax.swing.text.DefaultEditorKit;
+
+/**
+ * GTKKeybindings - The standard set of keymaps for the GTK Platform
+ *
+ * @author Jasper Potts
+ */
+public class GTKKeybindings {
+
+    /**
+     * Install all GTK keybindings into the provided UIDefaults table
+     *
+     * @param table The UiDefaults table to install into
+     */
+    public static void installKeybindings(UIDefaults table) {
+        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "ctrl C", DefaultEditorKit.copyAction,
+                "ctrl V", DefaultEditorKit.pasteAction,
+                "ctrl X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                "ctrl LEFT", DefaultEditorKit.previousWordAction,
+                "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
+                "ctrl RIGHT", DefaultEditorKit.nextWordAction,
+                "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
+                "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "ctrl A", DefaultEditorKit.selectAllAction,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "ENTER", JTextField.notifyAction,
+                "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+        Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "ctrl C", DefaultEditorKit.copyAction,
+                "ctrl V", DefaultEditorKit.pasteAction,
+                "ctrl X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                "ctrl LEFT", DefaultEditorKit.beginLineAction,
+                "ctrl KP_LEFT", DefaultEditorKit.beginLineAction,
+                "ctrl RIGHT", DefaultEditorKit.endLineAction,
+                "ctrl KP_RIGHT", DefaultEditorKit.endLineAction,
+                "ctrl shift LEFT", DefaultEditorKit.selectionBeginLineAction,
+                "ctrl shift KP_LEFT", DefaultEditorKit.selectionBeginLineAction,
+                "ctrl shift RIGHT", DefaultEditorKit.selectionEndLineAction,
+                "ctrl shift KP_RIGHT", DefaultEditorKit.selectionEndLineAction,
+                "ctrl A", DefaultEditorKit.selectAllAction,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "ENTER", JTextField.notifyAction,
+                "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "ctrl C", DefaultEditorKit.copyAction,
+                "ctrl V", DefaultEditorKit.pasteAction,
+                "ctrl X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                "ctrl LEFT", DefaultEditorKit.previousWordAction,
+                "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
+                "ctrl RIGHT", DefaultEditorKit.nextWordAction,
+                "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
+                "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "ctrl A", DefaultEditorKit.selectAllAction,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+
+                "UP", DefaultEditorKit.upAction,
+                "KP_UP", DefaultEditorKit.upAction,
+                "DOWN", DefaultEditorKit.downAction,
+                "KP_DOWN", DefaultEditorKit.downAction,
+                "PAGE_UP", DefaultEditorKit.pageUpAction,
+                "PAGE_DOWN", DefaultEditorKit.pageDownAction,
+                "shift PAGE_UP", "selection-page-up",
+                "shift PAGE_DOWN", "selection-page-down",
+                "ctrl shift PAGE_UP", "selection-page-left",
+                "ctrl shift PAGE_DOWN", "selection-page-right",
+                "shift UP", DefaultEditorKit.selectionUpAction,
+                "shift KP_UP", DefaultEditorKit.selectionUpAction,
+                "shift DOWN", DefaultEditorKit.selectionDownAction,
+                "shift KP_DOWN", DefaultEditorKit.selectionDownAction,
+                "ENTER", DefaultEditorKit.insertBreakAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "TAB", DefaultEditorKit.insertTabAction,
+                "ctrl BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "ctrl HOME", DefaultEditorKit.beginAction,
+                "ctrl END", DefaultEditorKit.endAction,
+                "ctrl shift HOME", DefaultEditorKit.selectionBeginAction,
+                "ctrl shift END", DefaultEditorKit.selectionEndAction,
+                "ctrl T", "next-link-action",
+                "ctrl shift T", "previous-link-action",
+                "ctrl SPACE", "activate-link-action",
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+
+        Object[] defaults = new Object[]{
+                "Button.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released",
+                        "ENTER", "pressed",
+                        "released ENTER", "released"
+                }),
+                "CheckBox.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "ComboBox.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "hidePopup",
+                        "PAGE_UP", "pageUpPassThrough",
+                        "PAGE_DOWN", "pageDownPassThrough",
+                        "HOME", "homePassThrough",
+                        "END", "endPassThrough",
+                        "DOWN", "selectNext",
+                        "KP_DOWN", "selectNext",
+                        "alt DOWN", "togglePopup",
+                        "alt KP_DOWN", "togglePopup",
+                        "alt UP", "togglePopup",
+                        "alt KP_UP", "togglePopup",
+                        "SPACE", "spacePopup",
+                        "ENTER", "enterPressed",
+                        "UP", "selectPrevious",
+                        "KP_UP", "selectPrevious"
+
+                }),
+                "EditorPane.focusInputMap", multilineInputMap,
+                "FileChooser.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "cancelSelection",
+                        "F2", "editFileName",
+                        "F5", "refresh",
+                        "BACK_SPACE", "Go Up",
+                        "ENTER", "approveSelection",
+                        "ctrl ENTER", "approveSelection"
+                }),
+                "FormattedTextField.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", DefaultEditorKit.copyAction,
+                        "ctrl V", DefaultEditorKit.pasteAction,
+                        "ctrl X", DefaultEditorKit.cutAction,
+                        "COPY", DefaultEditorKit.copyAction,
+                        "PASTE", DefaultEditorKit.pasteAction,
+                        "CUT", DefaultEditorKit.cutAction,
+                        "control INSERT", DefaultEditorKit.copyAction,
+                        "shift INSERT", DefaultEditorKit.pasteAction,
+                        "shift DELETE", DefaultEditorKit.cutAction,
+                        "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                        "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                        "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                        "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
+                        "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
+                        "ctrl RIGHT", DefaultEditorKit.nextWordAction,
+                        "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
+                        "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                        "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                        "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                        "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
+                        "ctrl A", DefaultEditorKit.selectAllAction,
+                        "HOME", DefaultEditorKit.beginLineAction,
+                        "END", DefaultEditorKit.endLineAction,
+                        "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                        "shift END", DefaultEditorKit.selectionEndLineAction,
+                        "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                        "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                        "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                        "DELETE", DefaultEditorKit.deleteNextCharAction,
+                        "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                        "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                        "RIGHT", DefaultEditorKit.forwardAction,
+                        "LEFT", DefaultEditorKit.backwardAction,
+                        "KP_RIGHT", DefaultEditorKit.forwardAction,
+                        "KP_LEFT", DefaultEditorKit.backwardAction,
+                        "ENTER", JTextField.notifyAction,
+                        "ctrl BACK_SLASH", "unselect",
+                        "control shift O", "toggle-componentOrientation",
+                        "ESCAPE", "reset-field-edit",
+                        "UP", "increment",
+                        "KP_UP", "increment",
+                        "DOWN", "decrement",
+                        "KP_DOWN", "decrement",
+                }),
+                "InternalFrame.windowBindings",
+                new Object[]{
+                        "shift ESCAPE", "showSystemMenu",
+                        "ctrl SPACE", "showSystemMenu",
+                        "ESCAPE", "hideSystemMenu"
+                },
+                "List.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "UP", "selectPreviousRow",
+                        "KP_UP", "selectPreviousRow",
+                        "shift UP", "selectPreviousRowExtendSelection",
+                        "shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl UP", "selectPreviousRowChangeLead",
+                        "ctrl KP_UP", "selectPreviousRowChangeLead",
+                        "DOWN", "selectNextRow",
+                        "KP_DOWN", "selectNextRow",
+                        "shift DOWN", "selectNextRowExtendSelection",
+                        "shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl DOWN", "selectNextRowChangeLead",
+                        "ctrl KP_DOWN", "selectNextRowChangeLead",
+                        "LEFT", "selectPreviousColumn",
+                        "KP_LEFT", "selectPreviousColumn",
+                        "shift LEFT", "selectPreviousColumnExtendSelection",
+                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl LEFT", "selectPreviousColumnChangeLead",
+                        "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                        "RIGHT", "selectNextColumn",
+                        "KP_RIGHT", "selectNextColumn",
+                        "shift RIGHT", "selectNextColumnExtendSelection",
+                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl RIGHT", "selectNextColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                        "HOME", "selectFirstRow",
+                        "shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl HOME", "selectFirstRowChangeLead",
+                        "END", "selectLastRow",
+                        "shift END", "selectLastRowExtendSelection",
+                        "ctrl shift END", "selectLastRowExtendSelection",
+                        "ctrl END", "selectLastRowChangeLead",
+                        "PAGE_UP", "scrollUp",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl PAGE_UP", "scrollUpChangeLead",
+                        "PAGE_DOWN", "scrollDown",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo"
+                }),
+                "List.focusInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "LEFT", "selectNextColumn",
+                        "KP_LEFT", "selectNextColumn",
+                        "shift LEFT", "selectNextColumnExtendSelection",
+                        "shift KP_LEFT", "selectNextColumnExtendSelection",
+                        "ctrl shift LEFT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
+                        "ctrl LEFT", "selectNextColumnChangeLead",
+                        "ctrl KP_LEFT", "selectNextColumnChangeLead",
+                        "RIGHT", "selectPreviousColumn",
+                        "KP_RIGHT", "selectPreviousColumn",
+                        "shift RIGHT", "selectPreviousColumnExtendSelection",
+                        "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
+                        "ctrl RIGHT", "selectPreviousColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
+                }),
+                "MenuBar.windowBindings", new Object[]{
+                        "F10", "takeFocus"
+                },
+                "OptionPane.windowBindings", new Object[]{
+                        "ESCAPE", "close"
+                },
+                "PasswordField.focusInputMap", passwordInputMap,
+                "PopupMenu.selectedWindowInputMapBindings",
+                new Object[]{
+                        "ESCAPE", "cancel",
+                        "DOWN", "selectNext",
+                        "KP_DOWN", "selectNext",
+                        "UP", "selectPrevious",
+                        "KP_UP", "selectPrevious",
+                        "LEFT", "selectParent",
+                        "KP_LEFT", "selectParent",
+                        "RIGHT", "selectChild",
+                        "KP_RIGHT", "selectChild",
+                        "ENTER", "return",
+                        "SPACE", "return"
+                },
+                "PopupMenu.selectedWindowInputMapBindings.RightToLeft",
+                new Object[]{
+                        "LEFT", "selectChild",
+                        "KP_LEFT", "selectChild",
+                        "RIGHT", "selectParent",
+                        "KP_RIGHT", "selectParent",
+                },
+                "RadioButton.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released",
+                        "RETURN", "pressed"
+                }),
+                // These bindings are only enabled when there is a default
+                // button set on the rootpane.
+                "RootPane.defaultButtonWindowKeyBindings", new Object[]{
+                        "ENTER", "press",
+                        "released ENTER", "release",
+                        "ctrl ENTER", "press",
+                        "ctrl released ENTER", "release"
+                },
+                "ScrollBar.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "positiveUnitIncrement",
+                        "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "positiveUnitIncrement",
+                        "KP_DOWN", "positiveUnitIncrement",
+                        "PAGE_DOWN", "positiveBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                        "KP_LEFT", "negativeUnitIncrement",
+                        "UP", "negativeUnitIncrement",
+                        "KP_UP", "negativeUnitIncrement",
+                        "PAGE_UP", "negativeBlockIncrement",
+                        "HOME", "minScroll",
+                        "END", "maxScroll"
+                }),
+                "ScrollBar.ancestorInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "negativeUnitIncrement",
+                        "KP_RIGHT", "negativeUnitIncrement",
+                        "LEFT", "positiveUnitIncrement",
+                        "KP_LEFT", "positiveUnitIncrement",
+                }),
+                "ScrollPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "unitScrollRight",
+                        "KP_RIGHT", "unitScrollRight",
+                        "DOWN", "unitScrollDown",
+                        "KP_DOWN", "unitScrollDown",
+                        "LEFT", "unitScrollLeft",
+                        "KP_LEFT", "unitScrollLeft",
+                        "UP", "unitScrollUp",
+                        "KP_UP", "unitScrollUp",
+                        "PAGE_UP", "scrollUp",
+                        "PAGE_DOWN", "scrollDown",
+                        "ctrl PAGE_UP", "scrollLeft",
+                        "ctrl PAGE_DOWN", "scrollRight",
+                        "ctrl HOME", "scrollHome",
+                        "ctrl END", "scrollEnd"
+                }),
+                "ScrollPane.ancestorInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl PAGE_UP", "scrollRight",
+                        "ctrl PAGE_DOWN", "scrollLeft",
+                }),
+                "Slider.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "positiveUnitIncrement",
+                        "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "negativeUnitIncrement",
+                        "KP_DOWN", "negativeUnitIncrement",
+                        "PAGE_DOWN", "negativeBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                        "KP_LEFT", "negativeUnitIncrement",
+                        "UP", "positiveUnitIncrement",
+                        "KP_UP", "positiveUnitIncrement",
+                        "PAGE_UP", "positiveBlockIncrement",
+                        "HOME", "minScroll",
+                        "END", "maxScroll"
+                }),
+                "Slider.focusInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "negativeUnitIncrement",
+                        "KP_RIGHT", "negativeUnitIncrement",
+                        "LEFT", "positiveUnitIncrement",
+                        "KP_LEFT", "positiveUnitIncrement",
+                }),
+                "Spinner.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "increment",
+                        "KP_UP", "increment",
+                        "DOWN", "decrement",
+                        "KP_DOWN", "decrement",
+                }),
+                "SplitPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "negativeIncrement",
+                        "DOWN", "positiveIncrement",
+                        "LEFT", "negativeIncrement",
+                        "RIGHT", "positiveIncrement",
+                        "KP_UP", "negativeIncrement",
+                        "KP_DOWN", "positiveIncrement",
+                        "KP_LEFT", "negativeIncrement",
+                        "KP_RIGHT", "positiveIncrement",
+                        "HOME", "selectMin",
+                        "END", "selectMax",
+                        "F8", "startResize",
+                        "F6", "toggleFocus",
+                        "ctrl TAB", "focusOutForward",
+                        "ctrl shift TAB", "focusOutBackward"
+                }),
+                "TabbedPane.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "navigateRight",
+                        "KP_RIGHT", "navigateRight",
+                        "LEFT", "navigateLeft",
+                        "KP_LEFT", "navigateLeft",
+                        "UP", "navigateUp",
+                        "KP_UP", "navigateUp",
+                        "DOWN", "navigateDown",
+                        "KP_DOWN", "navigateDown",
+                        "ctrl DOWN", "requestFocusForVisibleComponent",
+                        "ctrl KP_DOWN", "requestFocusForVisibleComponent",
+                        "SPACE", "selectTabWithFocus"
+                }),
+                "TabbedPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl TAB", "navigateNext",
+                        "ctrl shift TAB", "navigatePrevious",
+                        "ctrl PAGE_DOWN", "navigatePageDown",
+                        "ctrl PAGE_UP", "navigatePageUp",
+                        "ctrl UP", "requestFocus",
+                        "ctrl KP_UP", "requestFocus",
+                }),
+                "TableHeader.ancestorInputMap",
+                   new UIDefaults.LazyInputMap(new Object[] {
+                                    "SPACE", "toggleSortOrder",
+                                     "LEFT", "selectColumnToLeft",
+                                  "KP_LEFT", "selectColumnToLeft",
+                                    "RIGHT", "selectColumnToRight",
+                                 "KP_RIGHT", "selectColumnToRight",
+                                 "alt LEFT", "moveColumnLeft",
+                              "alt KP_LEFT", "moveColumnLeft",
+                                "alt RIGHT", "moveColumnRight",
+                             "alt KP_RIGHT", "moveColumnRight",
+                           "alt shift LEFT", "resizeLeft",
+                        "alt shift KP_LEFT", "resizeLeft",
+                          "alt shift RIGHT", "resizeRight",
+                       "alt shift KP_RIGHT", "resizeRight",
+                                   "ESCAPE", "focusTable",
+                   }),
+                "Table.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "RIGHT", "selectNextColumn",
+                        "KP_RIGHT", "selectNextColumn",
+                        "shift RIGHT", "selectNextColumnExtendSelection",
+                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl RIGHT", "selectNextColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                        "LEFT", "selectPreviousColumn",
+                        "KP_LEFT", "selectPreviousColumn",
+                        "shift LEFT", "selectPreviousColumnExtendSelection",
+                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl LEFT", "selectPreviousColumnChangeLead",
+                        "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                        "DOWN", "selectNextRow",
+                        "KP_DOWN", "selectNextRow",
+                        "shift DOWN", "selectNextRowExtendSelection",
+                        "shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl DOWN", "selectNextRowChangeLead",
+                        "ctrl KP_DOWN", "selectNextRowChangeLead",
+                        "UP", "selectPreviousRow",
+                        "KP_UP", "selectPreviousRow",
+                        "shift UP", "selectPreviousRowExtendSelection",
+                        "shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl UP", "selectPreviousRowChangeLead",
+                        "ctrl KP_UP", "selectPreviousRowChangeLead",
+                        "HOME", "selectFirstColumn",
+                        "shift HOME", "selectFirstColumnExtendSelection",
+                        "ctrl shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl HOME", "selectFirstRow",
+                        "END", "selectLastColumn",
+                        "shift END", "selectLastColumnExtendSelection",
+                        "ctrl shift END", "selectLastRowExtendSelection",
+                        "ctrl END", "selectLastRow",
+                        "PAGE_UP", "scrollUpChangeSelection",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
+                        "ctrl PAGE_UP", "scrollLeftChangeSelection",
+                        "PAGE_DOWN", "scrollDownChangeSelection",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollRightChangeSelection",
+                        "TAB", "selectNextColumnCell",
+                        "shift TAB", "selectPreviousColumnCell",
+                        "ENTER", "selectNextRowCell",
+                        "shift ENTER", "selectPreviousRowCell",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "ESCAPE", "cancel",
+                        "F2", "startEditing",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo",
+                        "F8", "focusHeader"
+                }),
+                "Table.ancestorInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "selectPreviousColumn",
+                        "KP_RIGHT", "selectPreviousColumn",
+                        "shift RIGHT", "selectPreviousColumnExtendSelection",
+                        "shift KP_RIGHT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
+                        "shift RIGHT", "selectPreviousColumnChangeLead",
+                        "shift KP_RIGHT", "selectPreviousColumnChangeLead",
+                        "LEFT", "selectNextColumn",
+                        "KP_LEFT", "selectNextColumn",
+                        "shift LEFT", "selectNextColumnExtendSelection",
+                        "shift KP_LEFT", "selectNextColumnExtendSelection",
+                        "ctrl shift LEFT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
+                        "ctrl LEFT", "selectNextColumnChangeLead",
+                        "ctrl KP_LEFT", "selectNextColumnChangeLead",
+                        "ctrl PAGE_UP", "scrollRightChangeSelection",
+                        "ctrl PAGE_DOWN", "scrollLeftChangeSelection",
+                        "ctrl shift PAGE_UP", "scrollRightExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
+                }),
+                "TextArea.focusInputMap", multilineInputMap,
+                "TextField.focusInputMap", fieldInputMap,
+                "TextPane.focusInputMap", multilineInputMap,
+                "ToggleButton.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "ToolBar.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "navigateUp",
+                        "KP_UP", "navigateUp",
+                        "DOWN", "navigateDown",
+                        "KP_DOWN", "navigateDown",
+                        "LEFT", "navigateLeft",
+                        "KP_LEFT", "navigateLeft",
+                        "RIGHT", "navigateRight",
+                        "KP_RIGHT", "navigateRight"
+                }),
+                "Tree.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "UP", "selectPrevious",
+                        "KP_UP", "selectPrevious",
+                        "shift UP", "selectPreviousExtendSelection",
+                        "shift KP_UP", "selectPreviousExtendSelection",
+                        "ctrl shift UP", "selectPreviousExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousExtendSelection",
+                        "ctrl UP", "selectPreviousChangeLead",
+                        "ctrl KP_UP", "selectPreviousChangeLead",
+                        "DOWN", "selectNext",
+                        "KP_DOWN", "selectNext",
+                        "shift DOWN", "selectNextExtendSelection",
+                        "shift KP_DOWN", "selectNextExtendSelection",
+                        "ctrl shift DOWN", "selectNextExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextExtendSelection",
+                        "ctrl DOWN", "selectNextChangeLead",
+                        "ctrl KP_DOWN", "selectNextChangeLead",
+                        "RIGHT", "selectChild",
+                        "KP_RIGHT", "selectChild",
+                        "LEFT", "selectParent",
+                        "KP_LEFT", "selectParent",
+                        "typed +", "expand",
+                        "typed -", "collapse",
+                        "BACK_SPACE", "moveSelectionToParent",
+                        "PAGE_UP", "scrollUpChangeSelection",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl PAGE_UP", "scrollUpChangeLead",
+                        "PAGE_DOWN", "scrollDownChangeSelection",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                        "HOME", "selectFirst",
+                        "shift HOME", "selectFirstExtendSelection",
+                        "ctrl shift HOME", "selectFirstExtendSelection",
+                        "ctrl HOME", "selectFirstChangeLead",
+                        "END", "selectLast",
+                        "shift END", "selectLastExtendSelection",
+                        "ctrl shift END", "selectLastExtendSelection",
+                        "ctrl END", "selectLastChangeLead",
+                        "F2", "startEditing",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "ctrl LEFT", "scrollLeft",
+                        "ctrl KP_LEFT", "scrollLeft",
+                        "ctrl RIGHT", "scrollRight",
+                        "ctrl KP_RIGHT", "scrollRight",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo"
+                }),
+                "Tree.focusInputMap.RightToLeft",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "selectParent",
+                        "KP_RIGHT", "selectParent",
+                        "LEFT", "selectChild",
+                        "KP_LEFT", "selectChild",
+                }),
+                "Tree.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "cancel"
+                }),
+        };
+        table.putDefaults(defaults);
+    }
+}
diff --git a/jdk/src/share/classes/sun/swing/plaf/WindowsKeybindings.java b/jdk/src/share/classes/sun/swing/plaf/WindowsKeybindings.java
new file mode 100644
index 0000000..48f93e7
--- /dev/null
+++ b/jdk/src/share/classes/sun/swing/plaf/WindowsKeybindings.java
@@ -0,0 +1,643 @@
+/*
+ * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.swing.plaf;
+
+import javax.swing.JTextField;
+import javax.swing.UIDefaults;
+import javax.swing.text.DefaultEditorKit;
+
+/**
+ * WindowsKeybindings - The standard set of keymaps for the Windows Platform
+ *
+ * @author Jasper Potts
+ */
+public class WindowsKeybindings {
+
+    /**
+     * Install all Windows keybindings into the provided UIDefaults table
+     *
+     * @param table The UiDefaults table to install into
+     */
+    public static void installKeybindings(UIDefaults table) {
+        // *** Text
+        Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "control C", DefaultEditorKit.copyAction,
+                "control V", DefaultEditorKit.pasteAction,
+                "control X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "control A", DefaultEditorKit.selectAllAction,
+                "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "control LEFT", DefaultEditorKit.previousWordAction,
+                "control RIGHT", DefaultEditorKit.nextWordAction,
+                "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "ENTER", JTextField.notifyAction,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+        Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "control C", DefaultEditorKit.copyAction,
+                "control V", DefaultEditorKit.pasteAction,
+                "control X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "control A", DefaultEditorKit.selectAllAction,
+                "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "control LEFT", DefaultEditorKit.beginLineAction,
+                "control RIGHT", DefaultEditorKit.endLineAction,
+                "control shift LEFT", DefaultEditorKit.selectionBeginLineAction,
+                "control shift RIGHT", DefaultEditorKit.selectionEndLineAction,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "ENTER", JTextField.notifyAction,
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+        Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[]{
+                "control C", DefaultEditorKit.copyAction,
+                "control V", DefaultEditorKit.pasteAction,
+                "control X", DefaultEditorKit.cutAction,
+                "COPY", DefaultEditorKit.copyAction,
+                "PASTE", DefaultEditorKit.pasteAction,
+                "CUT", DefaultEditorKit.cutAction,
+                "control INSERT", DefaultEditorKit.copyAction,
+                "shift INSERT", DefaultEditorKit.pasteAction,
+                "shift DELETE", DefaultEditorKit.cutAction,
+                "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                "control LEFT", DefaultEditorKit.previousWordAction,
+                "control RIGHT", DefaultEditorKit.nextWordAction,
+                "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                "control A", DefaultEditorKit.selectAllAction,
+                "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
+                "HOME", DefaultEditorKit.beginLineAction,
+                "END", DefaultEditorKit.endLineAction,
+                "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                "shift END", DefaultEditorKit.selectionEndLineAction,
+                "control HOME", DefaultEditorKit.beginAction,
+                "control END", DefaultEditorKit.endAction,
+                "control shift HOME", DefaultEditorKit.selectionBeginAction,
+                "control shift END", DefaultEditorKit.selectionEndAction,
+                "UP", DefaultEditorKit.upAction,
+                "DOWN", DefaultEditorKit.downAction,
+                "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                "DELETE", DefaultEditorKit.deleteNextCharAction,
+                "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                "RIGHT", DefaultEditorKit.forwardAction,
+                "LEFT", DefaultEditorKit.backwardAction,
+                "KP_RIGHT", DefaultEditorKit.forwardAction,
+                "KP_LEFT", DefaultEditorKit.backwardAction,
+                "PAGE_UP", DefaultEditorKit.pageUpAction,
+                "PAGE_DOWN", DefaultEditorKit.pageDownAction,
+                "shift PAGE_UP", "selection-page-up",
+                "shift PAGE_DOWN", "selection-page-down",
+                "ctrl shift PAGE_UP", "selection-page-left",
+                "ctrl shift PAGE_DOWN", "selection-page-right",
+                "shift UP", DefaultEditorKit.selectionUpAction,
+                "shift DOWN", DefaultEditorKit.selectionDownAction,
+                "ENTER", DefaultEditorKit.insertBreakAction,
+                "TAB", DefaultEditorKit.insertTabAction,
+                "control T", "next-link-action",
+                "control shift T", "previous-link-action",
+                "control SPACE", "activate-link-action",
+                "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
+        });
+        Object[] defaults = {
+                "TextField.focusInputMap", fieldInputMap,
+                "PasswordField.focusInputMap", passwordInputMap,
+                "TextArea.focusInputMap", multilineInputMap,
+                "TextPane.focusInputMap", multilineInputMap,
+                "EditorPane.focusInputMap", multilineInputMap,
+                "Button.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "CheckBox.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "hidePopup",
+                        "PAGE_UP", "pageUpPassThrough",
+                        "PAGE_DOWN", "pageDownPassThrough",
+                        "HOME", "homePassThrough",
+                        "END", "endPassThrough",
+                        "DOWN", "selectNext2",
+                        "KP_DOWN", "selectNext2",
+                        "UP", "selectPrevious2",
+                        "KP_UP", "selectPrevious2",
+                        "ENTER", "enterPressed",
+                        "F4", "togglePopup",
+                        "alt DOWN", "togglePopup",
+                        "alt KP_DOWN", "togglePopup",
+                        "alt UP", "togglePopup",
+                        "alt KP_UP", "togglePopup"
+                }),
+                "Desktop.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl F5", "restore",
+                        "ctrl F4", "close",
+                        "ctrl F7", "move",
+                        "ctrl F8", "resize",
+                        "RIGHT", "right",
+                        "KP_RIGHT", "right",
+                        "LEFT", "left",
+                        "KP_LEFT", "left",
+                        "UP", "up",
+                        "KP_UP", "up",
+                        "DOWN", "down",
+                        "KP_DOWN", "down",
+                        "ESCAPE", "escape",
+                        "ctrl F9", "minimize",
+                        "ctrl F10", "maximize",
+                        "ctrl F6", "selectNextFrame",
+                        "ctrl TAB", "selectNextFrame",
+                        "ctrl alt F6", "selectNextFrame",
+                        "shift ctrl alt F6", "selectPreviousFrame",
+                        "ctrl F12", "navigateNext",
+                        "shift ctrl F12", "navigatePrevious"
+                }),
+                "FileChooser.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "cancelSelection",
+                        "F2", "editFileName",
+                        "F5", "refresh",
+                        "BACK_SPACE", "Go Up",
+                        "ENTER", "approveSelection",
+                        "ctrl ENTER", "approveSelection"
+                }),
+                "InternalFrame.windowBindings", new Object[]{
+                        "shift ESCAPE", "showSystemMenu",
+                        "ctrl SPACE", "showSystemMenu",
+                        "ESCAPE", "hideSystemMenu"
+                },
+                "List.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "UP", "selectPreviousRow",
+                        "KP_UP", "selectPreviousRow",
+                        "shift UP", "selectPreviousRowExtendSelection",
+                        "shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl UP", "selectPreviousRowChangeLead",
+                        "ctrl KP_UP", "selectPreviousRowChangeLead",
+                        "DOWN", "selectNextRow",
+                        "KP_DOWN", "selectNextRow",
+                        "shift DOWN", "selectNextRowExtendSelection",
+                        "shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl DOWN", "selectNextRowChangeLead",
+                        "ctrl KP_DOWN", "selectNextRowChangeLead",
+                        "LEFT", "selectPreviousColumn",
+                        "KP_LEFT", "selectPreviousColumn",
+                        "shift LEFT", "selectPreviousColumnExtendSelection",
+                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl LEFT", "selectPreviousColumnChangeLead",
+                        "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                        "RIGHT", "selectNextColumn",
+                        "KP_RIGHT", "selectNextColumn",
+                        "shift RIGHT", "selectNextColumnExtendSelection",
+                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl RIGHT", "selectNextColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                        "HOME", "selectFirstRow",
+                        "shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl HOME", "selectFirstRowChangeLead",
+                        "END", "selectLastRow",
+                        "shift END", "selectLastRowExtendSelection",
+                        "ctrl shift END", "selectLastRowExtendSelection",
+                        "ctrl END", "selectLastRowChangeLead",
+                        "PAGE_UP", "scrollUp",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl PAGE_UP", "scrollUpChangeLead",
+                        "PAGE_DOWN", "scrollDown",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo"
+                }),
+                "MenuBar.windowBindings", new Object[]{
+                        "F10", "takeFocus"
+                },
+                "RadioButton.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "OptionPane.windowBindings", new Object[]{
+                        "ESCAPE", "close"
+                },
+                "FormattedTextField.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", DefaultEditorKit.copyAction,
+                        "ctrl V", DefaultEditorKit.pasteAction,
+                        "ctrl X", DefaultEditorKit.cutAction,
+                        "COPY", DefaultEditorKit.copyAction,
+                        "PASTE", DefaultEditorKit.pasteAction,
+                        "CUT", DefaultEditorKit.cutAction,
+                        "control INSERT", DefaultEditorKit.copyAction,
+                        "shift INSERT", DefaultEditorKit.pasteAction,
+                        "shift DELETE", DefaultEditorKit.cutAction,
+                        "shift LEFT", DefaultEditorKit.selectionBackwardAction,
+                        "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction,
+                        "shift RIGHT", DefaultEditorKit.selectionForwardAction,
+                        "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction,
+                        "ctrl LEFT", DefaultEditorKit.previousWordAction,
+                        "ctrl KP_LEFT", DefaultEditorKit.previousWordAction,
+                        "ctrl RIGHT", DefaultEditorKit.nextWordAction,
+                        "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction,
+                        "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                        "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction,
+                        "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction,
+                        "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction,
+                        "ctrl A", DefaultEditorKit.selectAllAction,
+                        "HOME", DefaultEditorKit.beginLineAction,
+                        "END", DefaultEditorKit.endLineAction,
+                        "shift HOME", DefaultEditorKit.selectionBeginLineAction,
+                        "shift END", DefaultEditorKit.selectionEndLineAction,
+                        "BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                        "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction,
+                        "ctrl H", DefaultEditorKit.deletePrevCharAction,
+                        "DELETE", DefaultEditorKit.deleteNextCharAction,
+                        "ctrl DELETE", DefaultEditorKit.deleteNextWordAction,
+                        "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction,
+                        "RIGHT", DefaultEditorKit.forwardAction,
+                        "LEFT", DefaultEditorKit.backwardAction,
+                        "KP_RIGHT", DefaultEditorKit.forwardAction,
+                        "KP_LEFT", DefaultEditorKit.backwardAction,
+                        "ENTER", JTextField.notifyAction,
+                        "ctrl BACK_SLASH", "unselect",
+                        "control shift O", "toggle-componentOrientation",
+                        "ESCAPE", "reset-field-edit",
+                        "UP", "increment",
+                        "KP_UP", "increment",
+                        "DOWN", "decrement",
+                        "KP_DOWN", "decrement",
+                }),
+                // These bindings are only enabled when there is a default
+                // button set on the rootpane.
+                "RootPane.defaultButtonWindowKeyBindings", new Object[]{
+                        "ENTER", "press",
+                        "released ENTER", "release",
+                        "ctrl ENTER", "press",
+                        "ctrl released ENTER", "release"
+                },
+                "ScrollBar.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "positiveUnitIncrement",
+                        "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "positiveUnitIncrement",
+                        "KP_DOWN", "positiveUnitIncrement",
+                        "PAGE_DOWN", "positiveBlockIncrement",
+                        "ctrl PAGE_DOWN", "positiveBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                        "KP_LEFT", "negativeUnitIncrement",
+                        "UP", "negativeUnitIncrement",
+                        "KP_UP", "negativeUnitIncrement",
+                        "PAGE_UP", "negativeBlockIncrement",
+                        "ctrl PAGE_UP", "negativeBlockIncrement",
+                        "HOME", "minScroll",
+                        "END", "maxScroll"
+                }),
+                "ScrollPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "unitScrollRight",
+                        "KP_RIGHT", "unitScrollRight",
+                        "DOWN", "unitScrollDown",
+                        "KP_DOWN", "unitScrollDown",
+                        "LEFT", "unitScrollLeft",
+                        "KP_LEFT", "unitScrollLeft",
+                        "UP", "unitScrollUp",
+                        "KP_UP", "unitScrollUp",
+                        "PAGE_UP", "scrollUp",
+                        "PAGE_DOWN", "scrollDown",
+                        "ctrl PAGE_UP", "scrollLeft",
+                        "ctrl PAGE_DOWN", "scrollRight",
+                        "ctrl HOME", "scrollHome",
+                        "ctrl END", "scrollEnd"
+                }),
+                "Slider.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "positiveUnitIncrement",
+                        "KP_RIGHT", "positiveUnitIncrement",
+                        "DOWN", "negativeUnitIncrement",
+                        "KP_DOWN", "negativeUnitIncrement",
+                        "PAGE_DOWN", "negativeBlockIncrement",
+                        "LEFT", "negativeUnitIncrement",
+                        "KP_LEFT", "negativeUnitIncrement",
+                        "UP", "positiveUnitIncrement",
+                        "KP_UP", "positiveUnitIncrement",
+                        "PAGE_UP", "positiveBlockIncrement",
+                        "HOME", "minScroll",
+                        "END", "maxScroll"
+                }),
+                "Spinner.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "increment",
+                        "KP_UP", "increment",
+                        "DOWN", "decrement",
+                        "KP_DOWN", "decrement",
+                }),
+                "SplitPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "negativeIncrement",
+                        "DOWN", "positiveIncrement",
+                        "LEFT", "negativeIncrement",
+                        "RIGHT", "positiveIncrement",
+                        "KP_UP", "negativeIncrement",
+                        "KP_DOWN", "positiveIncrement",
+                        "KP_LEFT", "negativeIncrement",
+                        "KP_RIGHT", "positiveIncrement",
+                        "HOME", "selectMin",
+                        "END", "selectMax",
+                        "F8", "startResize",
+                        "F6", "toggleFocus",
+                        "ctrl TAB", "focusOutForward",
+                        "ctrl shift TAB", "focusOutBackward"
+                }),
+                "TabbedPane.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "RIGHT", "navigateRight",
+                        "KP_RIGHT", "navigateRight",
+                        "LEFT", "navigateLeft",
+                        "KP_LEFT", "navigateLeft",
+                        "UP", "navigateUp",
+                        "KP_UP", "navigateUp",
+                        "DOWN", "navigateDown",
+                        "KP_DOWN", "navigateDown",
+                        "ctrl DOWN", "requestFocusForVisibleComponent",
+                        "ctrl KP_DOWN", "requestFocusForVisibleComponent",
+                }),
+                "TabbedPane.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl TAB", "navigateNext",
+                        "ctrl shift TAB", "navigatePrevious",
+                        "ctrl PAGE_DOWN", "navigatePageDown",
+                        "ctrl PAGE_UP", "navigatePageUp",
+                        "ctrl UP", "requestFocus",
+                        "ctrl KP_UP", "requestFocus",
+                }),
+                "TableHeader.ancestorInputMap",
+                   new UIDefaults.LazyInputMap(new Object[] {
+                                    "SPACE", "toggleSortOrder",
+                                     "LEFT", "selectColumnToLeft",
+                                  "KP_LEFT", "selectColumnToLeft",
+                                    "RIGHT", "selectColumnToRight",
+                                 "KP_RIGHT", "selectColumnToRight",
+                                 "alt LEFT", "moveColumnLeft",
+                              "alt KP_LEFT", "moveColumnLeft",
+                                "alt RIGHT", "moveColumnRight",
+                             "alt KP_RIGHT", "moveColumnRight",
+                           "alt shift LEFT", "resizeLeft",
+                        "alt shift KP_LEFT", "resizeLeft",
+                          "alt shift RIGHT", "resizeRight",
+                       "alt shift KP_RIGHT", "resizeRight",
+                                   "ESCAPE", "focusTable",
+                   }),
+                "Table.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "RIGHT", "selectNextColumn",
+                        "KP_RIGHT", "selectNextColumn",
+                        "shift RIGHT", "selectNextColumnExtendSelection",
+                        "shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
+                        "ctrl RIGHT", "selectNextColumnChangeLead",
+                        "ctrl KP_RIGHT", "selectNextColumnChangeLead",
+                        "LEFT", "selectPreviousColumn",
+                        "KP_LEFT", "selectPreviousColumn",
+                        "shift LEFT", "selectPreviousColumnExtendSelection",
+                        "shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
+                        "ctrl LEFT", "selectPreviousColumnChangeLead",
+                        "ctrl KP_LEFT", "selectPreviousColumnChangeLead",
+                        "DOWN", "selectNextRow",
+                        "KP_DOWN", "selectNextRow",
+                        "shift DOWN", "selectNextRowExtendSelection",
+                        "shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift DOWN", "selectNextRowExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextRowExtendSelection",
+                        "ctrl DOWN", "selectNextRowChangeLead",
+                        "ctrl KP_DOWN", "selectNextRowChangeLead",
+                        "UP", "selectPreviousRow",
+                        "KP_UP", "selectPreviousRow",
+                        "shift UP", "selectPreviousRowExtendSelection",
+                        "shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift UP", "selectPreviousRowExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousRowExtendSelection",
+                        "ctrl UP", "selectPreviousRowChangeLead",
+                        "ctrl KP_UP", "selectPreviousRowChangeLead",
+                        "HOME", "selectFirstColumn",
+                        "shift HOME", "selectFirstColumnExtendSelection",
+                        "ctrl shift HOME", "selectFirstRowExtendSelection",
+                        "ctrl HOME", "selectFirstRow",
+                        "END", "selectLastColumn",
+                        "shift END", "selectLastColumnExtendSelection",
+                        "ctrl shift END", "selectLastRowExtendSelection",
+                        "ctrl END", "selectLastRow",
+                        "PAGE_UP", "scrollUpChangeSelection",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
+                        "ctrl PAGE_UP", "scrollLeftChangeSelection",
+                        "PAGE_DOWN", "scrollDownChangeSelection",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollRightChangeSelection",
+                        "TAB", "selectNextColumnCell",
+                        "shift TAB", "selectPreviousColumnCell",
+                        "ENTER", "selectNextRowCell",
+                        "shift ENTER", "selectPreviousRowCell",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "ESCAPE", "cancel",
+                        "F2", "startEditing",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo",
+                        "F8", "focusHeader"
+                }),
+                "ToggleButton.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "SPACE", "pressed",
+                        "released SPACE", "released"
+                }),
+                "ToolBar.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "UP", "navigateUp",
+                        "KP_UP", "navigateUp",
+                        "DOWN", "navigateDown",
+                        "KP_DOWN", "navigateDown",
+                        "LEFT", "navigateLeft",
+                        "KP_LEFT", "navigateLeft",
+                        "RIGHT", "navigateRight",
+                        "KP_RIGHT", "navigateRight"
+                }),
+                "Tree.focusInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ADD", "expand",
+                        "SUBTRACT", "collapse",
+                        "ctrl C", "copy",
+                        "ctrl V", "paste",
+                        "ctrl X", "cut",
+                        "COPY", "copy",
+                        "PASTE", "paste",
+                        "CUT", "cut",
+                        "control INSERT", "copy",
+                        "shift INSERT", "paste",
+                        "shift DELETE", "cut",
+                        "UP", "selectPrevious",
+                        "KP_UP", "selectPrevious",
+                        "shift UP", "selectPreviousExtendSelection",
+                        "shift KP_UP", "selectPreviousExtendSelection",
+                        "ctrl shift UP", "selectPreviousExtendSelection",
+                        "ctrl shift KP_UP", "selectPreviousExtendSelection",
+                        "ctrl UP", "selectPreviousChangeLead",
+                        "ctrl KP_UP", "selectPreviousChangeLead",
+                        "DOWN", "selectNext",
+                        "KP_DOWN", "selectNext",
+                        "shift DOWN", "selectNextExtendSelection",
+                        "shift KP_DOWN", "selectNextExtendSelection",
+                        "ctrl shift DOWN", "selectNextExtendSelection",
+                        "ctrl shift KP_DOWN", "selectNextExtendSelection",
+                        "ctrl DOWN", "selectNextChangeLead",
+                        "ctrl KP_DOWN", "selectNextChangeLead",
+                        "RIGHT", "selectChild",
+                        "KP_RIGHT", "selectChild",
+                        "LEFT", "selectParent",
+                        "KP_LEFT", "selectParent",
+                        "PAGE_UP", "scrollUpChangeSelection",
+                        "shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl shift PAGE_UP", "scrollUpExtendSelection",
+                        "ctrl PAGE_UP", "scrollUpChangeLead",
+                        "PAGE_DOWN", "scrollDownChangeSelection",
+                        "shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
+                        "ctrl PAGE_DOWN", "scrollDownChangeLead",
+                        "HOME", "selectFirst",
+                        "shift HOME", "selectFirstExtendSelection",
+                        "ctrl shift HOME", "selectFirstExtendSelection",
+                        "ctrl HOME", "selectFirstChangeLead",
+                        "END", "selectLast",
+                        "shift END", "selectLastExtendSelection",
+                        "ctrl shift END", "selectLastExtendSelection",
+                        "ctrl END", "selectLastChangeLead",
+                        "F2", "startEditing",
+                        "ctrl A", "selectAll",
+                        "ctrl SLASH", "selectAll",
+                        "ctrl BACK_SLASH", "clearSelection",
+                        "ctrl LEFT", "scrollLeft",
+                        "ctrl KP_LEFT", "scrollLeft",
+                        "ctrl RIGHT", "scrollRight",
+                        "ctrl KP_RIGHT", "scrollRight",
+                        "SPACE", "addToSelection",
+                        "ctrl SPACE", "toggleAndAnchor",
+                        "shift SPACE", "extendTo",
+                        "ctrl shift SPACE", "moveSelectionTo"
+                }),
+                "Tree.ancestorInputMap",
+                new UIDefaults.LazyInputMap(new Object[]{
+                        "ESCAPE", "cancel"
+                }),
+        };
+        table.putDefaults(defaults);
+    }
+
+}
diff --git a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
index 84d5221..dde0068 100644
--- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java
@@ -183,14 +183,7 @@
         }
     }
 
-    ActionMap createActionMap() {
-        ActionMap map = new ActionMapUIResource();
-        map.put("approveSelection", getApproveSelectionAction());
-        map.put("cancelSelection", getCancelSelectionAction());
-        map.put("Go Up", getChangeToParentDirectoryAction());
-        map.put("fileNameCompletion", getFileNameCompletionAction());
-        return map;
-    }
+    protected abstract ActionMap createActionMap();
 
 
     protected void installDefaults(JFileChooser fc) {
diff --git a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
index 7069c39..a2a4b2e 100644
--- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
@@ -38,8 +38,7 @@
 import javax.swing.filechooser.FileFilter;
 import javax.swing.plaf.basic.*;
 import javax.swing.plaf.synth.*;
-
-import sun.swing.SwingUtilities2;
+import javax.swing.plaf.ActionMapUIResource;
 
 import sun.awt.shell.ShellFolder;
 import sun.swing.*;
@@ -286,9 +285,9 @@
         b.setAlignmentX(JComponent.LEFT_ALIGNMENT);
         b.setAlignmentY(JComponent.CENTER_ALIGNMENT);
         b.setMargin(shrinkwrap);
+        topButtonPanel.add(b);
+        topButtonPanel.add(Box.createRigidArea(hstrut5));
     }
-    topButtonPanel.add(b);
-    topButtonPanel.add(Box.createRigidArea(hstrut5));
 
     // View button group
     ButtonGroup viewButtonGroup = new ButtonGroup();
@@ -521,6 +520,9 @@
         }
     }
 
+    @Override public void rescanCurrentDirectory(JFileChooser fc) {
+        filePane.rescanCurrentDirectory();
+    }
 
     protected void doSelectedFileChanged(PropertyChangeEvent e) {
         super.doSelectedFileChanged(e);
@@ -635,6 +637,14 @@
     // ************ FileChooser UI PLAF methods **************
     // *******************************************************
 
+    protected ActionMap createActionMap() {
+        ActionMap map = new ActionMapUIResource();
+        // add standard actions
+        FilePane.addActionsToMap(map, filePane.getActions());
+        // add synth only actions
+        map.put("fileNameCompletion", getFileNameCompletionAction());
+        return map;
+    }
 
     // *****************************
     // ***** Directory Actions *****
@@ -649,32 +659,44 @@
     }
 
     protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer(JFileChooser fc) {
-        return new DirectoryComboBoxRenderer();
+        return new DirectoryComboBoxRenderer(directoryComboBox.getRenderer());
     }
 
     //
     // Renderer for DirectoryComboBox
     //
-    class DirectoryComboBoxRenderer extends DefaultListCellRenderer  {
+    // Synth has some odd behavior with regards to renderers. Renderers are styled
+    // in a specific manner by the SynthComboBoxUI. If we extend DefaultListCellRenderer
+    // here, then we get none of those benefits or behaviors, leading to poor
+    // looking combo boxes.
+    // So what we do here is delegate most jobs to the "real" or original renderer,
+    // and simply monkey with the icon and text of the renderer.
+    private class DirectoryComboBoxRenderer implements ListCellRenderer {
+        private ListCellRenderer delegate;
         IndentIcon ii = new IndentIcon();
-        public Component getListCellRendererComponent(JList list, Object value,
-                                                      int index, boolean isSelected,
-                                                      boolean cellHasFocus) {
 
-            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+        private DirectoryComboBoxRenderer(ListCellRenderer delegate) {
+            this.delegate = delegate;
+        }
 
+        @Override
+        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+            Component c = delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+
+            assert c instanceof JLabel;
+            JLabel label = (JLabel)c;
             if (value == null) {
-                setText("");
-                return this;
+                label.setText("");
+                return label;
             }
-            File directory = (File)value;
-            setText(getFileChooser().getName(directory));
+            File directory = (File) value;
+            label.setText(getFileChooser().getName(directory));
             Icon icon = getFileChooser().getIcon(directory);
             ii.icon = icon;
             ii.depth = directoryComboBoxModel.getDepth(index);
-            setIcon(ii);
+            label.setIcon(ii);
 
-            return this;
+            return label;
         }
     }
 
@@ -862,24 +884,33 @@
     // Renderer for Types ComboBox
     //
     protected FilterComboBoxRenderer createFilterComboBoxRenderer() {
-        return new FilterComboBoxRenderer();
+        return new FilterComboBoxRenderer(filterComboBox.getRenderer());
     }
 
     /**
      * Render different type sizes and styles.
      */
-    public class FilterComboBoxRenderer extends DefaultListCellRenderer {
-        public Component getListCellRendererComponent(JList list,
-            Object value, int index, boolean isSelected,
-            boolean cellHasFocus) {
+    public class FilterComboBoxRenderer implements ListCellRenderer {
+        private ListCellRenderer delegate;
+        private FilterComboBoxRenderer(ListCellRenderer delegate) {
+            this.delegate = delegate;
+        }
 
-            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+            Component c = delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
 
+            String text = null;
             if (value != null && value instanceof FileFilter) {
-                setText(((FileFilter)value).getDescription());
+                text = ((FileFilter) value).getDescription();
             }
 
-            return this;
+            //this should always be true, since SynthComboBoxUI's SynthComboBoxRenderer
+            //extends JLabel
+            assert c instanceof JLabel;
+            if (text != null) {
+                ((JLabel)c).setText(text);
+            }
+            return c;
         }
     }
 
diff --git a/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java
index 6198f14..117ca3d 100644
--- a/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java
+++ b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java
@@ -26,16 +26,23 @@
 
 import java.awt.Component;
 import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
 import javax.swing.*;
 import javax.swing.plaf.UIResource;
 import javax.swing.border.Border;
 import javax.swing.table.*;
+import sun.swing.DefaultLookup;
 
-/**
- */
+
 public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer
         implements UIResource {
     private boolean horizontalTextPositionSet;
+    private Icon sortArrow;
+    private EmptyIcon emptyIcon = new EmptyIcon();
 
     public DefaultTableCellHeaderRenderer() {
         setHorizontalAlignment(JLabel.CENTER);
@@ -58,8 +65,8 @@
                 Color fgColor = null;
                 Color bgColor = null;
                 if (hasFocus) {
-                    fgColor = UIManager.getColor("TableHeader.focusCellForeground");
-                    bgColor = UIManager.getColor("TableHeader.focusCellBackground");
+                    fgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellForeground");
+                    bgColor = DefaultLookup.getColor(this, ui, "TableHeader.focusCellBackground");
                 }
                 if (fgColor == null) {
                     fgColor = header.getForeground();
@@ -85,16 +92,16 @@
                 if (sortOrder != null) {
                     switch(sortOrder) {
                     case ASCENDING:
-                        sortIcon = UIManager.getIcon(
-                            "Table.ascendingSortIcon");
+                        sortIcon = DefaultLookup.getIcon(
+                            this, ui, "Table.ascendingSortIcon");
                         break;
                     case DESCENDING:
-                        sortIcon = UIManager.getIcon(
-                            "Table.descendingSortIcon");
+                        sortIcon = DefaultLookup.getIcon(
+                            this, ui, "Table.descendingSortIcon");
                         break;
                     case UNSORTED:
-                        sortIcon = UIManager.getIcon(
-                            "Table.naturalSortIcon");
+                        sortIcon = DefaultLookup.getIcon(
+                            this, ui, "Table.naturalSortIcon");
                         break;
                     }
                 }
@@ -103,13 +110,14 @@
 
         setText(value == null ? "" : value.toString());
         setIcon(sortIcon);
+        sortArrow = sortIcon;
 
         Border border = null;
         if (hasFocus) {
-            border = UIManager.getBorder("TableHeader.focusCellBorder");
+            border = DefaultLookup.getBorder(this, ui, "TableHeader.focusCellBorder");
         }
         if (border == null) {
-            border = UIManager.getBorder("TableHeader.cellBorder");
+            border = DefaultLookup.getBorder(this, ui, "TableHeader.cellBorder");
         }
         setBorder(border);
 
@@ -129,4 +137,60 @@
         }
         return rv;
     }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        boolean b = DefaultLookup.getBoolean(this, ui,
+                "TableHeader.rightAlignSortArrow", false);
+        if (b && sortArrow != null) {
+            //emptyIcon is used so that if the text in the header is right
+            //aligned, or if the column is too narrow, then the text will
+            //be sized appropriately to make room for the icon that is about
+            //to be painted manually here.
+            emptyIcon.width = sortArrow.getIconWidth();
+            emptyIcon.height = sortArrow.getIconHeight();
+            setIcon(emptyIcon);
+            super.paintComponent(g);
+            Point position = computeIconPosition(g);
+            sortArrow.paintIcon(this, g, position.x, position.y);
+        } else {
+            super.paintComponent(g);
+        }
+    }
+
+    private Point computeIconPosition(Graphics g) {
+        FontMetrics fontMetrics = g.getFontMetrics();
+        Rectangle viewR = new Rectangle();
+        Rectangle textR = new Rectangle();
+        Rectangle iconR = new Rectangle();
+        Insets i = getInsets();
+        viewR.x = i.left;
+        viewR.y = i.top;
+        viewR.width = getWidth() - (i.left + i.right);
+        viewR.height = getHeight() - (i.top + i.bottom);
+        SwingUtilities.layoutCompoundLabel(
+            this,
+            fontMetrics,
+            getText(),
+            sortArrow,
+            getVerticalAlignment(),
+            getHorizontalAlignment(),
+            getVerticalTextPosition(),
+            getHorizontalTextPosition(),
+            viewR,
+            iconR,
+            textR,
+            getIconTextGap());
+        int x = getWidth() - i.right - sortArrow.getIconWidth();
+        int y = iconR.y;
+        return new Point(x, y);
+    }
+
+    private class EmptyIcon implements Icon {
+        int width = 0;
+        int height = 0;
+        public void paintIcon(Component c, Graphics g, int x, int y) {}
+        public int getIconWidth() { return width; }
+        public int getIconHeight() { return height; }
+    }
 }
diff --git a/jdk/src/share/lib/management/jmxremote.access b/jdk/src/share/lib/management/jmxremote.access
index 765f118..ce80b47 100644
--- a/jdk/src/share/lib/management/jmxremote.access
+++ b/jdk/src/share/lib/management/jmxremote.access
@@ -8,7 +8,7 @@
 # passwords.  To be functional, a role must have an entry in
 # both the password and the access files.
 #
-# Default location of this file is $JRE/lib/management/jmxremote.access
+# The default location of this file is $JRE/lib/management/jmxremote.access
 # You can specify an alternate location by specifying a property in 
 # the management config file $JRE/lib/management/management.properties
 # (See that file for details)
@@ -16,7 +16,7 @@
 # The file format for password and access files is syntactically the same
 # as the Properties file format.  The syntax is described in the Javadoc
 # for java.util.Properties.load.
-# Typical access file has multiple  lines, where each line is blank,
+# A typical access file has multiple lines, where each line is blank,
 # a comment (like this one), or an access control entry.
 #
 # An access control entry consists of a role name, and an
@@ -29,10 +29,38 @@
 #                   role can read measurements but cannot perform any action
 #                   that changes the environment of the running program.
 #       "readwrite" grants access to read and write attributes of MBeans,
-#                   to invoke operations on them, and to create or remove them.
-#		    This access should be granted to only trusted clients, 
-#                   since they can potentially interfere with the smooth
-#		    operation of a running program 
+#                   to invoke operations on them, and optionally
+#                   to create or remove them. This access should be granted
+#                   only to trusted clients, since they can potentially
+#                   interfere with the smooth operation of a running program.
+#
+# The "readwrite" access level can optionally be followed by the "create" and/or
+# "unregister" keywords.  The "unregister" keyword grants access to unregister
+# (delete) MBeans.  The "create" keyword grants access to create MBeans of a
+# particular class or of any class matching a particular pattern.  Access
+# should only be granted to create MBeans of known and trusted classes.
+#
+# For example, the following entry would grant readwrite access
+# to "controlRole", as well as access to create MBeans of the class
+# javax.management.monitor.CounterMonitor and to unregister any MBean:
+#  controlRole readwrite \
+#              create javax.management.monitor.CounterMonitorMBean \
+#              unregister
+# or equivalently:
+#  controlRole readwrite unregister create javax.management.monitor.CounterMBean
+#
+# The following entry would grant readwrite access as well as access to create
+# MBeans of any class in the packages javax.management.monitor and
+# javax.management.timer:
+#  controlRole readwrite \
+#              create javax.management.monitor.*,javax.management.timer.* \
+#              unregister
+#
+# The \ character is defined in the Properties file syntax to allow continuation
+# lines as shown here.  A * in a class pattern matches a sequence of characters
+# other than dot (.), so javax.management.monitor.* matches
+# javax.management.monitor.CounterMonitor but not
+# javax.management.monitor.foo.Bar.
 #
 # A given role should have at most one entry in this file.  If a role
 # has no entry, it has no access.
@@ -42,7 +70,10 @@
 #
 # Default access control entries:
 # o The "monitorRole" role has readonly access.  
-# o The "controlRole" role has readwrite access.
+# o The "controlRole" role has readwrite access and can create the standard
+#   Timer and Monitor MBeans defined by the JMX API.
 
 monitorRole   readonly
-controlRole   readwrite
+controlRole   readwrite \
+              create javax.management.monitor.*,javax.management.timer.* \
+              unregister
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
index c78644c..a0d64dc 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,6 +94,7 @@
       assert(!valc->isMalloc);
     }
     xvs.init(u->rp, u->rplimit, valc);
+    CHECK;
     int X = xvs.getInt();
     if (valc->S() != 0) {
       assert(valc->min <= -256);
@@ -117,6 +118,7 @@
     byte XB_byte = (byte) XB;
     byte* XB_ptr = &XB_byte;
     cm.init(u->rp, u->rplimit, XB_ptr, 0, defc, length, null);
+    CHECK;
   } else {
     NOT_PRODUCT(byte* meta_rp0 = u->meta_rp);
     assert(u->meta_rp != null);
@@ -215,8 +217,19 @@
   if (length == 0)  return 0;
   if (total_memo > 0)  return total_memo-1;
   int total = getInt();
+  // overflow checks require that none of the addends are <0,
+  // and that the partial sums never overflow (wrap negative)
+  if (total < 0) {
+    abort("overflow detected");
+    return 0;
+  }
   for (int k = length-1; k > 0; k--) {
+    int prev_total = total;
     total += vs[0].getInt();
+    if (total < prev_total) {
+      abort("overflow detected");
+      return 0;
+    }
   }
   rewind();
   total_memo = total+1;
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp
index ecc45ce..097c51c 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/bytes.cpp
@@ -56,7 +56,7 @@
     return;
   }
   byte* oldptr = ptr;
-  ptr = (byte*)::realloc(ptr, len_+1);
+  ptr = (len_ >= PSIZE_MAX) ? null : (byte*)::realloc(ptr, len_+1);
   if (ptr != null)  {
     mtrace('r', oldptr, 0);
     mtrace('m', ptr, len_+1);
@@ -128,7 +128,7 @@
 // Make sure there are 'o' bytes beyond the fill pointer,
 // advance the fill pointer, and return the old fill pointer.
 byte* fillbytes::grow(size_t s) {
-  size_t nlen = b.len+s;
+  size_t nlen = add_size(b.len, s);
   if (nlen <= allocated) {
     b.len = nlen;
     return limit()-s;
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp
index dec681c..df02104 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/coding.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -814,6 +814,7 @@
     }
     band_rp = vs.rp;
   }
+  CHECK;
 
   // Get an accurate upper limit now.
   vs0.rplimit = band_rp;
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h b/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
index 0bf25d5..87ce338 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/defines.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2001-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,11 +47,13 @@
 #define NOT_PRODUCT(xxx)
 #define assert(p)
 #define PRINTCR(args)
+#define VERSION_STRING "%s version %s\n"
 #else
 #define IF_PRODUCT(xxx)
 #define NOT_PRODUCT(xxx) xxx
 #define assert(p) ((p) || assert_failed(#p))
 #define PRINTCR(args)  u->verbose && u->printcr_if_verbose args
+#define VERSION_STRING "%s version non-product %s\n"
 extern "C" void breakpoint();
 extern int assert_failed(const char*);
 #define BREAK (breakpoint())
@@ -79,9 +81,9 @@
 
 #define lengthof(array) (sizeof(array)/sizeof(array[0]))
 
-#define NEW(T, n)    (T*) must_malloc((int)(sizeof(T)*(n)))
-#define U_NEW(T, n)  (T*) u->alloc(sizeof(T)*(n))
-#define T_NEW(T, n)  (T*) u->temp_alloc(sizeof(T)*(n))
+#define NEW(T, n)    (T*) must_malloc((int)(scale_size(n, sizeof(T))))
+#define U_NEW(T, n)  (T*) u->alloc(scale_size(n, sizeof(T)))
+#define T_NEW(T, n)  (T*) u->temp_alloc(scale_size(n, sizeof(T)))
 
 
 // bytes and byte arrays
@@ -153,6 +155,8 @@
 #define CHECK_NULL_(y,p)        _CHECK_DO((p)==null, return y)
 #define CHECK_NULL_0(p)         _CHECK_DO((p)==null, return 0)
 
+#define CHECK_COUNT(t)          if (t < 0){abort("bad value count");} CHECK
+
 #define STR_TRUE   "true"
 #define STR_FALSE  "false"
 
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
index 789841d..104f38b 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/main.cpp
@@ -299,7 +299,7 @@
     case 'J':  argp += 1; break;  // skip ignored -Jxxx parameter
 
     case 'V':
-      fprintf(u.errstrm, "%s version %s\n", nbasename(argv[0]), sccsver);
+      fprintf(u.errstrm, VERSION_STRING, nbasename(argv[0]), sccsver);
       exit(0);
 
     case 'h':
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
index 90b9f72..a6f4ca0 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2001-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -523,15 +523,39 @@
   enum {
     MAGIC_BYTES = 4,
     AH_LENGTH_0 = 3,  //minver, majver, options are outside of archive_size
+    AH_LENGTH_0_MAX = AH_LENGTH_0 + 1,  // options might have 2 bytes
     AH_LENGTH   = 26, //maximum archive header length (w/ all fields)
     // Length contributions from optional header fields:
     AH_FILE_HEADER_LEN = 5, // sizehi/lo/next/modtime/files
+    AH_ARCHIVE_SIZE_LEN = 2, // sizehi/lo only; part of AH_FILE_HEADER_LEN
     AH_CP_NUMBER_LEN = 4,  // int/float/long/double
     AH_SPECIAL_FORMAT_LEN = 2, // layouts/band-headers
     AH_LENGTH_MIN = AH_LENGTH
         -(AH_FILE_HEADER_LEN+AH_SPECIAL_FORMAT_LEN+AH_CP_NUMBER_LEN),
+    ARCHIVE_SIZE_MIN = AH_LENGTH_MIN - (AH_LENGTH_0 + AH_ARCHIVE_SIZE_LEN),
     FIRST_READ  = MAGIC_BYTES + AH_LENGTH_MIN
   };
+
+  assert(AH_LENGTH_MIN    == 15); // # of UNSIGNED5 fields required after archive_magic
+  assert(ARCHIVE_SIZE_MIN == 10); // # of UNSIGNED5 fields required after archive_size
+  // An absolute minimum null archive is magic[4], {minver,majver,options}[3],
+  // archive_size[0], cp_counts[8], class_counts[4], for a total of 19 bytes.
+  // (Note that archive_size is optional; it may be 0..10 bytes in length.)
+  // The first read must capture everything up through the options field.
+  // This happens to work even if {minver,majver,options} is a pathological
+  // 15 bytes long.  Legal pack files limit those three fields to 1+1+2 bytes.
+  assert(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0 * B_MAX);
+
+  // Up through archive_size, the largest possible archive header is
+  // magic[4], {minver,majver,options}[4], archive_size[10].
+  // (Note only the low 12 bits of options are allowed to be non-zero.)
+  // In order to parse archive_size, we need at least this many bytes
+  // in the first read.  Of course, if archive_size_hi is more than
+  // a byte, we probably will fail to allocate the buffer, since it
+  // will be many gigabytes long.  This is a practical, not an
+  // architectural limit to Pack200 archive sizes.
+  assert(FIRST_READ >= MAGIC_BYTES + AH_LENGTH_0_MAX + 2*B_MAX);
+
   bool foreign_buf = (read_input_fn == null);
   byte initbuf[(int)FIRST_READ + (int)C_SLOP + 200];  // 200 is for JAR I/O
   if (foreign_buf) {
@@ -547,7 +571,7 @@
     // There is no way to tell the caller that we used only part of them.
     // Therefore, the caller must use only a bare minimum of read-ahead.
     if (inbytes.len > FIRST_READ) {
-      abort("too much pushback");
+      abort("too much read-ahead");
       return;
     }
     input.set(initbuf, sizeof(initbuf));
@@ -557,7 +581,7 @@
     rplimit += inbytes.len;
     bytes_read += inbytes.len;
   }
-  // Read only 19 bytes, which is certain to contain #archive_size fields,
+  // Read only 19 bytes, which is certain to contain #archive_options fields,
   // but is certain not to overflow past the archive_header.
   input.b.len = FIRST_READ;
   if (!ensure_input(FIRST_READ))
@@ -629,26 +653,25 @@
 #undef ORBIT
   if ((archive_options & ~OPTION_LIMIT) != 0) {
     fprintf(errstrm, "Warning: Illegal archive options 0x%x\n",
-            archive_options);
-    // Do not abort.  If the format really changes, version numbers will bump.
-    //abort("illegal archive options");
+        archive_options);
+    abort("illegal archive options");
+    return;
   }
 
   if ((archive_options & AO_HAVE_FILE_HEADERS) != 0) {
     uint hi = hdr.getInt();
     uint lo = hdr.getInt();
-    archive_size = band::makeLong(hi, lo);
+    julong x = band::makeLong(hi, lo);
+    archive_size = (size_t) x;
+    if (archive_size != x) {
+      // Silly size specified; force overflow.
+      archive_size = PSIZE_MAX+1;
+    }
     hdrVals += 2;
   } else {
     hdrValsSkipped += 2;
   }
 
-  if (archive_size != (size_t)archive_size) {
-    // Silly size specified.
-    abort("archive too large");
-    return;
-  }
-
   // Now we can size the whole archive.
   // Read everything else into a mega-buffer.
   rp = hdr.rp;
@@ -662,9 +685,18 @@
       abort("EOF reading fixed input buffer");
       return;
     }
-  } else if (archive_size > 0) {
-    input.set(U_NEW(byte, (size_t)(header_size_0 + archive_size + C_SLOP)),
-              (size_t) header_size_0 + (size_t)archive_size);
+  } else if (archive_size != 0) {
+    if (archive_size < ARCHIVE_SIZE_MIN) {
+      abort("impossible archive size");  // bad input data
+      return;
+    }
+    if (archive_size < header_size_1) {
+      abort("too much read-ahead");  // somehow we pre-fetched too much?
+      return;
+    }
+    input.set(U_NEW(byte, add_size(header_size_0, archive_size, C_SLOP)),
+              (size_t) header_size_0 + archive_size);
+    CHECK;
     assert(input.limit()[0] == 0);
     // Move all the bytes we read initially into the real buffer.
     input.b.copyFrom(initbuf, header_size);
@@ -673,17 +705,17 @@
   } else {
     // It's more complicated and painful.
     // A zero archive_size means that we must read until EOF.
-    assert(archive_size == 0);
     input.init(CHUNK*2);
     CHECK;
     input.b.len = input.allocated;
     rp = rplimit = input.base();
     // Set up input buffer as if we already read the header:
     input.b.copyFrom(initbuf, header_size);
+    CHECK;
     rplimit += header_size;
     while (ensure_input(input.limit() - rp)) {
       size_t dataSoFar = input_remaining();
-      size_t nextSize = dataSoFar + CHUNK;
+      size_t nextSize = add_size(dataSoFar, CHUNK);
       input.ensureSize(nextSize);
       CHECK;
       input.b.len = input.allocated;
@@ -715,8 +747,10 @@
 
   if ((archive_options & AO_HAVE_FILE_HEADERS) != 0) {
     archive_next_count = hdr.getInt();
+    CHECK_COUNT(archive_next_count);
     archive_modtime = hdr.getInt();
     file_count = hdr.getInt();
+    CHECK_COUNT(file_count);
     hdrVals += 3;
   } else {
     hdrValsSkipped += 3;
@@ -724,7 +758,9 @@
 
   if ((archive_options & AO_HAVE_SPECIAL_FORMATS) != 0) {
     band_headers_size = hdr.getInt();
+    CHECK_COUNT(band_headers_size);
     attr_definition_count = hdr.getInt();
+    CHECK_COUNT(attr_definition_count);
     hdrVals += 2;
   } else {
     hdrValsSkipped += 2;
@@ -744,13 +780,16 @@
       }
     }
     cp_counts[k] = hdr.getInt();
+    CHECK_COUNT(cp_counts[k]);
     hdrVals += 1;
   }
 
   ic_count = hdr.getInt();
+  CHECK_COUNT(ic_count);
   default_class_minver = hdr.getInt();
   default_class_majver = hdr.getInt();
   class_count = hdr.getInt();
+  CHECK_COUNT(class_count);
   hdrVals += 4;
 
   // done with archive_header
@@ -807,7 +846,6 @@
   bytes::of(band_headers.limit(), C_SLOP).clear(_meta_error);
 }
 
-
 void unpacker::finish() {
   if (verbose >= 1) {
     fprintf(errstrm,
@@ -973,12 +1011,12 @@
   // First band:  Read lengths of shared prefixes.
   if (len > PREFIX_SKIP_2)
     cp_Utf8_prefix.readData(len - PREFIX_SKIP_2);
-  NOT_PRODUCT(else cp_Utf8_prefix.readData(0));  // for asserts
+    NOT_PRODUCT(else cp_Utf8_prefix.readData(0));  // for asserts
 
   // Second band:  Read lengths of unshared suffixes:
   if (len > SUFFIX_SKIP_1)
     cp_Utf8_suffix.readData(len - SUFFIX_SKIP_1);
-  NOT_PRODUCT(else cp_Utf8_suffix.readData(0));  // for asserts
+    NOT_PRODUCT(else cp_Utf8_suffix.readData(0));  // for asserts
 
   bytes* allsuffixes = T_NEW(bytes, len);
   CHECK;
@@ -2117,6 +2155,7 @@
 
   field_descr.readData(field_count);
   read_attrs(ATTR_CONTEXT_FIELD, field_count);
+  CHECK;
 
   method_descr.readData(method_count);
   read_attrs(ATTR_CONTEXT_METHOD, method_count);
@@ -2124,6 +2163,7 @@
   CHECK;
 
   read_attrs(ATTR_CONTEXT_CLASS, class_count);
+  CHECK;
 
   read_code_headers();
 
@@ -2150,10 +2190,12 @@
   assert(endsWith(xxx_flags_hi.name, "_flags_hi"));
   if (haveLongFlags)
     xxx_flags_hi.readData(obj_count);
+  CHECK;
 
   band& xxx_flags_lo = ad.xxx_flags_lo();
   assert(endsWith(xxx_flags_lo.name, "_flags_lo"));
   xxx_flags_lo.readData(obj_count);
+  CHECK;
 
   // pre-scan flags, counting occurrences of each index bit
   julong indexMask = ad.flagIndexMask();  // which flag bits are index bits?
@@ -2176,11 +2218,13 @@
   assert(endsWith(xxx_attr_count.name, "_attr_count"));
   // There is one count element for each 1<<16 bit set in flags:
   xxx_attr_count.readData(ad.predefCount(X_ATTR_OVERFLOW));
+  CHECK;
 
   band& xxx_attr_indexes = ad.xxx_attr_indexes();
   assert(endsWith(xxx_attr_indexes.name, "_attr_indexes"));
   int overflowIndexCount = xxx_attr_count.getIntTotal();
   xxx_attr_indexes.readData(overflowIndexCount);
+  CHECK;
   // pre-scan attr indexes, counting occurrences of each value
   for (i = 0; i < overflowIndexCount; i++) {
     idx = xxx_attr_indexes.getInt();
@@ -2211,6 +2255,7 @@
     }
   }
   ad.xxx_attr_calls().readData(backwardCounts);
+  CHECK;
 
   // Read built-in bands.
   // Mostly, these are hand-coded equivalents to readBandData().
@@ -2219,42 +2264,53 @@
 
     count = ad.predefCount(CLASS_ATTR_SourceFile);
     class_SourceFile_RUN.readData(count);
+    CHECK;
 
     count = ad.predefCount(CLASS_ATTR_EnclosingMethod);
     class_EnclosingMethod_RC.readData(count);
     class_EnclosingMethod_RDN.readData(count);
+    CHECK;
 
     count = ad.predefCount(X_ATTR_Signature);
     class_Signature_RS.readData(count);
+    CHECK;
 
     ad.readBandData(X_ATTR_RuntimeVisibleAnnotations);
     ad.readBandData(X_ATTR_RuntimeInvisibleAnnotations);
 
     count = ad.predefCount(CLASS_ATTR_InnerClasses);
     class_InnerClasses_N.readData(count);
+    CHECK;
+
     count = class_InnerClasses_N.getIntTotal();
     class_InnerClasses_RC.readData(count);
     class_InnerClasses_F.readData(count);
+    CHECK;
     // Drop remaining columns wherever flags are zero:
     count -= class_InnerClasses_F.getIntCount(0);
     class_InnerClasses_outer_RCN.readData(count);
     class_InnerClasses_name_RUN.readData(count);
+    CHECK;
 
     count = ad.predefCount(CLASS_ATTR_ClassFile_version);
     class_ClassFile_version_minor_H.readData(count);
     class_ClassFile_version_major_H.readData(count);
+    CHECK;
     break;
 
   case ATTR_CONTEXT_FIELD:
 
     count = ad.predefCount(FIELD_ATTR_ConstantValue);
     field_ConstantValue_KQ.readData(count);
+    CHECK;
 
     count = ad.predefCount(X_ATTR_Signature);
     field_Signature_RS.readData(count);
+    CHECK;
 
     ad.readBandData(X_ATTR_RuntimeVisibleAnnotations);
     ad.readBandData(X_ATTR_RuntimeInvisibleAnnotations);
+    CHECK;
     break;
 
   case ATTR_CONTEXT_METHOD:
@@ -2266,15 +2322,18 @@
     method_Exceptions_N.readData(count);
     count = method_Exceptions_N.getIntTotal();
     method_Exceptions_RC.readData(count);
+    CHECK;
 
     count = ad.predefCount(X_ATTR_Signature);
     method_Signature_RS.readData(count);
+    CHECK;
 
     ad.readBandData(X_ATTR_RuntimeVisibleAnnotations);
     ad.readBandData(X_ATTR_RuntimeInvisibleAnnotations);
     ad.readBandData(METHOD_ATTR_RuntimeVisibleParameterAnnotations);
     ad.readBandData(METHOD_ATTR_RuntimeInvisibleParameterAnnotations);
     ad.readBandData(METHOD_ATTR_AnnotationDefault);
+    CHECK;
     break;
 
   case ATTR_CONTEXT_CODE:
@@ -2286,8 +2345,10 @@
       return;
     }
     code_StackMapTable_N.readData(count);
+    CHECK;
     count = code_StackMapTable_N.getIntTotal();
     code_StackMapTable_frame_T.readData(count);
+    CHECK;
     // the rest of it depends in a complicated way on frame tags
     {
       int fat_frame_count = 0;
@@ -2321,18 +2382,23 @@
       // deal completely with fat frames:
       offset_count += fat_frame_count;
       code_StackMapTable_local_N.readData(fat_frame_count);
+      CHECK;
       type_count += code_StackMapTable_local_N.getIntTotal();
       code_StackMapTable_stack_N.readData(fat_frame_count);
       type_count += code_StackMapTable_stack_N.getIntTotal();
+      CHECK;
       // read the rest:
       code_StackMapTable_offset.readData(offset_count);
       code_StackMapTable_T.readData(type_count);
+      CHECK;
       // (7) [RCH]
       count = code_StackMapTable_T.getIntCount(7);
       code_StackMapTable_RC.readData(count);
+      CHECK;
       // (8) [PH]
       count = code_StackMapTable_T.getIntCount(8);
       code_StackMapTable_P.readData(count);
+      CHECK;
     }
 
     count = ad.predefCount(CODE_ATTR_LineNumberTable);
@@ -2654,6 +2720,7 @@
   code_max_na_locals.readData();
   code_handler_count.readData();
   totalHandlerCount += code_handler_count.getIntTotal();
+  CHECK;
 
   // Read handler specifications.
   // Cf. PackageReader.readCodeHandlers.
@@ -2661,8 +2728,10 @@
   code_handler_end_PO.readData(totalHandlerCount);
   code_handler_catch_PO.readData(totalHandlerCount);
   code_handler_class_RCN.readData(totalHandlerCount);
+  CHECK;
 
   read_attrs(ATTR_CONTEXT_CODE, totalFlagsCount);
+  CHECK;
 }
 
 static inline bool is_in_range(uint n, uint min, uint max) {
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
index 8bad674..4f5965d 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.h
@@ -204,7 +204,7 @@
 
   // archive header fields
   int      magic, minver, majver;
-  julong   archive_size;
+  size_t   archive_size;
   int      archive_next_count, archive_options, archive_modtime;
   int      band_headers_size;
   int      file_count, attr_definition_count, ic_count, class_count;
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
index 9566e54..b812e73 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.cpp
@@ -46,14 +46,13 @@
 
 #include "unpack.h"
 
-void* must_malloc(int size) {
-  int msize = size;
-  assert(size >= 0);
+void* must_malloc(size_t size) {
+  size_t msize = size;
   #ifdef USE_MTRACE
-  if (msize < sizeof(int))
+  if (msize >= 0 && msize < sizeof(int))
     msize = sizeof(int);  // see 0xbaadf00d below
   #endif
-  void* ptr = malloc(msize);
+  void* ptr = (msize > PSIZE_MAX) ? null : malloc(msize);
   if (ptr != null) {
     memset(ptr, 0, size);
   } else {
diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.h b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.h
index 2fc1728..a4dc2c88 100644
--- a/jdk/src/share/native/com/sun/java/util/jar/pack/utils.h
+++ b/jdk/src/share/native/com/sun/java/util/jar/pack/utils.h
@@ -25,13 +25,31 @@
 
 //Definitions of our util functions
 
-void* must_malloc(int size);
+void* must_malloc(size_t size);
 #ifndef USE_MTRACE
 #define mtrace(c, ptr, size)
 #else
 void mtrace(char c, void* ptr, size_t size);
 #endif
 
+// overflow management
+#define OVERFLOW ((size_t)-1)
+#define PSIZE_MAX (OVERFLOW/2)  /* normal size limit */
+
+inline size_t scale_size(size_t size, size_t scale) {
+  return (size > PSIZE_MAX / scale) ? OVERFLOW : size * scale;
+}
+
+inline size_t add_size(size_t size1, size_t size2) {
+  return ((size1 | size2 | (size1 + size2)) > PSIZE_MAX)
+    ? OVERFLOW
+    : size1 + size2;
+}
+
+inline size_t add_size(size_t size1, size_t size2, int size3) {
+  return add_size(add_size(size1, size2), size3);
+}
+
 // These may be expensive, because they have to go via Java TSD,
 // if the optional u argument is missing.
 struct unpacker;
diff --git a/jdk/src/share/native/java/util/zip/ZipEntry.c b/jdk/src/share/native/java/util/zip/ZipEntry.c
deleted file mode 100644
index 94cd68e..0000000
--- a/jdk/src/share/native/java/util/zip/ZipEntry.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * Native method support for java.util.zip.ZipEntry
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "jlong.h"
-#include "jvm.h"
-#include "jni.h"
-#include "jni_util.h"
-#include "zip_util.h"
-
-#include "java_util_zip_ZipEntry.h"
-
-#define DEFLATED 8
-#define STORED 0
-
-static jfieldID nameID;
-static jfieldID timeID;
-static jfieldID crcID;
-static jfieldID sizeID;
-static jfieldID csizeID;
-static jfieldID methodID;
-static jfieldID extraID;
-static jfieldID commentID;
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_ZipEntry_initIDs(JNIEnv *env, jclass cls)
-{
-    nameID = (*env)->GetFieldID(env, cls, "name", "Ljava/lang/String;");
-    timeID = (*env)->GetFieldID(env, cls, "time", "J");
-    crcID = (*env)->GetFieldID(env, cls, "crc", "J");
-    sizeID = (*env)->GetFieldID(env, cls, "size", "J");
-    csizeID = (*env)->GetFieldID(env, cls, "csize", "J");
-    methodID = (*env)->GetFieldID(env, cls, "method", "I");
-    extraID = (*env)->GetFieldID(env, cls, "extra", "[B");
-    commentID = (*env)->GetFieldID(env, cls, "comment", "Ljava/lang/String;");
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_ZipEntry_initFields(JNIEnv *env, jobject obj, jlong zentry)
-{
-    jzentry *ze = jlong_to_ptr(zentry);
-    jstring name = (*env)->GetObjectField(env, obj, nameID);
-
-    if (name == 0) {
-        name = (*env)->NewStringUTF(env, ze->name);
-        if (name == 0) {
-            return;
-        }
-        (*env)->SetObjectField(env, obj, nameID, name);
-    }
-    (*env)->SetLongField(env, obj, timeID, (jlong)ze->time & 0xffffffffUL);
-    (*env)->SetLongField(env, obj, crcID, (jlong)ze->crc & 0xffffffffUL);
-    (*env)->SetLongField(env, obj, sizeID, (jlong)ze->size);
-    if (ze->csize == 0) {
-        (*env)->SetLongField(env, obj, csizeID, (jlong)ze->size);
-        (*env)->SetIntField(env, obj, methodID, STORED);
-    } else {
-        (*env)->SetLongField(env, obj, csizeID, (jlong)ze->csize);
-        (*env)->SetIntField(env, obj, methodID, DEFLATED);
-    }
-    if (ze->extra != 0) {
-        unsigned char *bp = (unsigned char *)&ze->extra[0];
-        jsize len = (bp[0] | (bp[1] << 8));
-        jbyteArray extra = (*env)->NewByteArray(env, len);
-        if (extra == 0) {
-            return;
-        }
-        (*env)->SetByteArrayRegion(env, extra, 0, len, &ze->extra[2]);
-        (*env)->SetObjectField(env, obj, extraID, extra);
-    }
-    if (ze->comment != 0) {
-        jstring comment = (*env)->NewStringUTF(env, ze->comment);
-        if (comment == 0) {
-            return;
-        }
-        (*env)->SetObjectField(env, obj, commentID, comment);
-    }
-}
diff --git a/jdk/src/share/native/java/util/zip/ZipFile.c b/jdk/src/share/native/java/util/zip/ZipFile.c
index 0c20536..d5cb1ec 100644
--- a/jdk/src/share/native/java/util/zip/ZipFile.c
+++ b/jdk/src/share/native/java/util/zip/ZipFile.c
@@ -141,12 +141,11 @@
 
 JNIEXPORT jlong JNICALL
 Java_java_util_zip_ZipFile_getEntry(JNIEnv *env, jclass cls, jlong zfile,
-                                    jstring name, jboolean addSlash)
+                                    jbyteArray name, jboolean addSlash)
 {
 #define MAXNAME 1024
     jzfile *zip = jlong_to_ptr(zfile);
-    jsize slen = (*env)->GetStringLength(env, name);
-    jsize ulen = (*env)->GetStringUTFLength(env, name);
+    jsize ulen = (*env)->GetArrayLength(env, name);
     char buf[MAXNAME+2], *path;
     jzentry *ze;
 
@@ -159,7 +158,7 @@
     } else {
         path = buf;
     }
-    (*env)->GetStringUTFRegion(env, name, 0, slen, path);
+    (*env)->GetByteArrayRegion(env, name, 0, ulen, (jbyte *)path);
     path[ulen] = '\0';
     if (addSlash == JNI_FALSE) {
         ze = ZIP_GetEntry(zip, path, 0);
@@ -186,34 +185,87 @@
                                         jint n)
 {
     jzentry *ze = ZIP_GetNextEntry(jlong_to_ptr(zfile), n);
-
     return ptr_to_jlong(ze);
 }
 
 JNIEXPORT jint JNICALL
-Java_java_util_zip_ZipFile_getMethod(JNIEnv *env, jclass cls, jlong zentry)
+Java_java_util_zip_ZipFile_getEntryMethod(JNIEnv *env, jclass cls, jlong zentry)
 {
     jzentry *ze = jlong_to_ptr(zentry);
-
     return ze->csize != 0 ? DEFLATED : STORED;
 }
 
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_ZipFile_getCSize(JNIEnv *env, jclass cls, jlong zentry)
+JNIEXPORT jint JNICALL
+Java_java_util_zip_ZipFile_getEntryFlag(JNIEnv *env, jclass cls, jlong zentry)
 {
     jzentry *ze = jlong_to_ptr(zentry);
+    return ze->flag;
+}
 
+JNIEXPORT jlong JNICALL
+Java_java_util_zip_ZipFile_getEntryCSize(JNIEnv *env, jclass cls, jlong zentry)
+{
+    jzentry *ze = jlong_to_ptr(zentry);
     return ze->csize != 0 ? ze->csize : ze->size;
 }
 
 JNIEXPORT jlong JNICALL
-Java_java_util_zip_ZipFile_getSize(JNIEnv *env, jclass cls, jlong zentry)
+Java_java_util_zip_ZipFile_getEntrySize(JNIEnv *env, jclass cls, jlong zentry)
 {
     jzentry *ze = jlong_to_ptr(zentry);
-
     return ze->size;
 }
 
+JNIEXPORT jlong JNICALL
+Java_java_util_zip_ZipFile_getEntryTime(JNIEnv *env, jclass cls, jlong zentry)
+{
+    jzentry *ze = jlong_to_ptr(zentry);
+    return (jlong)ze->time & 0xffffffffUL;
+}
+
+JNIEXPORT jlong JNICALL
+Java_java_util_zip_ZipFile_getEntryCrc(JNIEnv *env, jclass cls, jlong zentry)
+{
+    jzentry *ze = jlong_to_ptr(zentry);
+    return (jlong)ze->crc & 0xffffffffUL;
+}
+
+JNIEXPORT jbyteArray JNICALL
+Java_java_util_zip_ZipFile_getEntryBytes(JNIEnv *env, jclass cls, jlong zentry, jint type)
+{
+    jzentry *ze = jlong_to_ptr(zentry);
+    int len = 0;
+    jbyteArray jba = NULL;
+    switch (type) {
+    case java_util_zip_ZipFile_JZENTRY_NAME:
+        if (ze->name != 0) {
+            len = (int)strlen(ze->name);
+            if (len == 0 || (jba = (*env)->NewByteArray(env, len)) == NULL)
+                break;
+            (*env)->SetByteArrayRegion(env, jba, 0, len, (jbyte *)ze->name);
+        }
+        break;
+    case java_util_zip_ZipFile_JZENTRY_EXTRA:
+        if (ze->extra != 0) {
+            unsigned char *bp = (unsigned char *)&ze->extra[0];
+            len = (bp[0] | (bp[1] << 8));
+            if (len <= 0 || (jba = (*env)->NewByteArray(env, len)) == NULL)
+                break;
+            (*env)->SetByteArrayRegion(env, jba, 0, len, &ze->extra[2]);
+        }
+        break;
+    case java_util_zip_ZipFile_JZENTRY_COMMENT:
+        if (ze->comment != 0) {
+            len = (int)strlen(ze->comment);
+            if (len == 0 || (jba = (*env)->NewByteArray(env, len)) == NULL)
+                break;
+            (*env)->SetByteArrayRegion(env, jba, 0, len, (jbyte*)ze->comment);
+        }
+        break;
+    }
+    return jba;
+}
+
 JNIEXPORT jint JNICALL
 Java_java_util_zip_ZipFile_read(JNIEnv *env, jclass cls, jlong zfile,
                                 jlong zentry, jlong pos, jbyteArray bytes,
diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c
index 89f52ae..626d411 100644
--- a/jdk/src/share/native/java/util/zip/zip_util.c
+++ b/jdk/src/share/native/java/util/zip/zip_util.c
@@ -512,7 +512,6 @@
 
     /* Clear previous zip error */
     zip->msg = NULL;
-
     /* Get position of END header */
     if ((endpos = findEND(zip, endbuf)) == -1)
         return -1; /* no END header or system error */
@@ -520,7 +519,6 @@
     if (endpos == 0) return 0;  /* only END header present */
 
     freeCEN(zip);
-
    /* Get position and length of central directory */
     cenlen = ENDSIZ(endbuf);
     cenoff = ENDOFF(endbuf);
@@ -935,6 +933,7 @@
     ze->crc   = CENCRC(cen);
     locoff    = CENOFF(cen);
     ze->pos   = -(zip->locpos + locoff);
+    ze->flag  = CENFLG(cen);
 
     if ((ze->name = malloc(nlen + 1)) == NULL) goto Catch;
     memcpy(ze->name, cen + CENHDR, nlen);
diff --git a/jdk/src/share/native/java/util/zip/zip_util.h b/jdk/src/share/native/java/util/zip/zip_util.h
index 7ad1171..311a9fcd 100644
--- a/jdk/src/share/native/java/util/zip/zip_util.h
+++ b/jdk/src/share/native/java/util/zip/zip_util.h
@@ -168,6 +168,7 @@
     char *comment;        /* optional zip file comment */
     jbyte *extra;         /* optional extra data */
     jlong pos;            /* position of LOC header or entry data */
+    jint flag;            /* general purpose flag */
 } jzentry;
 
 /*
diff --git a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
index be91d3e..f20372f 100644
--- a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
+++ b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
@@ -722,6 +722,10 @@
     GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
 
     READ(GifFile, &CodeSize, 1);    /* Read Code size from file. */
+    if (CodeSize >= 12) {
+        /* Invalid initial code size: report failure */
+        return GIF_ERROR;
+    }
     BitsPerPixel = CodeSize;
 
     Private->Buf[0] = 0;    /* Input Buffer empty. */
@@ -964,10 +968,13 @@
 
     /* If code cannot fit into RunningBits bits, must raise its size. Note
      * however that codes above 4095 are used for special signaling.  */
-    if (++Private->RunningCode > Private->MaxCode1 &&
-        Private->RunningBits < LZ_BITS) {
-        Private->MaxCode1 <<= 1;
-        Private->RunningBits++;
+    if (++Private->RunningCode > Private->MaxCode1) {
+        if (Private->RunningBits < LZ_BITS) {
+            Private->MaxCode1 <<= 1;
+            Private->RunningBits++;
+        } else {
+            Private->RunningCode = Private->MaxCode1;
+        }
     }
     return GIF_OK;
 }
diff --git a/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c b/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c
index 1429931..893007f 100644
--- a/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c
+++ b/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c
@@ -191,6 +191,11 @@
     int passht = passinc;
     int len;
 
+    /* We have verified the initial code size on the java layer.
+     * Here we just check bounds for particular indexes. */
+    if (freeCode >= 4096 || maxCode >= 4096) {
+        return 0;
+    }
     if (blockh == 0 || raslineh == 0
         || prefixh == 0 || suffixh == 0
         || outCodeh == 0)
diff --git a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c
index 681f262..157827f 100644
--- a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c
+++ b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c
@@ -216,6 +216,16 @@
 
 #endif /* ! DEBUG */
 
+static int
+getMlibEdgeHint(jint edgeHint) {
+    switch (edgeHint) {
+    case java_awt_image_ConvolveOp_EDGE_NO_OP:
+        return MLIB_EDGE_DST_COPY_SRC;
+    case java_awt_image_ConvolveOp_EDGE_ZERO_FILL:
+    default:
+        return MLIB_EDGE_DST_FILL_ZERO;
+    }
+}
 
 /***************************************************************************
  *                          External Functions                             *
@@ -400,22 +410,10 @@
         }
     }
 
-    if (edgeHint == java_awt_image_ConvolveOp_EDGE_NO_OP) {
-        int kw2 = kwidth>>1;
-        int kh2 = kheight>>1;
-        int bsize = mlib_ImageGetChannels(src)*
-            (mlib_ImageGetType(src) == MLIB_BYTE ? 1 : 2);
-
-        void *dstDataP = mlib_ImageGetData(dst);
-        void *srcDataP = mlib_ImageGetData(src);
-        /* REMIND: Copy a smaller area */
-        memcpy(dstDataP, srcDataP, dst->width*dst->height*bsize);
-    }
-
     cmask = (1<<src->channels)-1;
     status = (*sMlibFns[MLIB_CONVMxN].fptr)(dst, src, kdata, w, h,
                                (w-1)/2, (h-1)/2, scale, cmask,
-                               MLIB_EDGE_DST_NO_WRITE);
+                               getMlibEdgeHint(edgeHint));
 
     if (status != MLIB_SUCCESS) {
         printMedialibError(status);
@@ -660,22 +658,10 @@
         }
     }
 
-    if (edgeHint == java_awt_image_ConvolveOp_EDGE_NO_OP) {
-        int kw2 = kwidth>>1;
-        int kh2 = kheight>>1;
-        int bsize = mlib_ImageGetChannels(src)*
-            (mlib_ImageGetType(src) == MLIB_BYTE ? 1 : 2);
-
-        void *dstDataP = mlib_ImageGetData(dst);
-        void *srcDataP = mlib_ImageGetData(src);
-        /* REMIND: Copy a smaller area */
-        memcpy(dstDataP, srcDataP, dst->width*dst->height*bsize);
-    }
-
     cmask = (1<<src->channels)-1;
     status = (*sMlibFns[MLIB_CONVMxN].fptr)(dst, src, kdata, w, h,
                                (w-1)/2, (h-1)/2, scale, cmask,
-                               MLIB_EDGE_DST_NO_WRITE);
+                               getMlibEdgeHint(edgeHint));
 
     if (status != MLIB_SUCCESS) {
         printMedialibError(status);
diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
index 1c55702..32f7d4e 100644
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
@@ -31,7 +31,7 @@
 /* here come some very simple macros */
 
 /* advance a pointer p by sizeof(type)*n bytes */
-#define INCPN(type,p,n) ((p) = (type*)(p)+n)
+#define INCPN(type,p,n) ((p) = (type*)(p)+(n))
 
 /* advance a pointer by sizeof(type) */
 #define INCP(type,p) INCPN(type,(p),1)
diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
index f6d9acb..f1651ab 100644
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c
@@ -62,6 +62,15 @@
     return rc;
 }
 
+/* These macro help to ensure that we only take part of frame that fits into
+   logical screen. */
+
+/* Ensure that p belongs to [pmin, pmax) interval. Returns fixed point (if fix is needed) */
+#define FIX_POINT(p, pmin, pmax) ( ((p) < (pmin)) ? (pmin) : (((p) > (pmax)) ? (pmax) : (p)))
+/* Ensures that line starting at point p does not exceed boundary pmax.
+   Returns fixed length (if fix is needed) */
+#define FIX_LENGTH(p, len, pmax) ( ((p) + (len)) > (pmax) ? ((pmax) - (p)) : (len))
+
 int
 SplashDecodeGif(Splash * splash, GifFileType * gif)
 {
@@ -70,6 +79,7 @@
     byte_t *pBitmapBits, *pOldBitmapBits;
     int i, j;
     int imageIndex;
+    int cx, cy, cw, ch; /* clamped coordinates */
     const int interlacedOffset[] = { 0, 4, 2, 1, 0 };   /* The way Interlaced image should. */
     const int interlacedJumps[] = { 8, 8, 4, 2, 1 };    /* be read - offsets and jumps... */
 
@@ -79,14 +89,31 @@
 
     SplashCleanup(splash);
 
+    if (!SAFE_TO_ALLOC(gif->SWidth, splash->imageFormat.depthBytes)) {
+        return 0;
+    }
     stride = gif->SWidth * splash->imageFormat.depthBytes;
     if (splash->byteAlignment > 1)
         stride =
             (stride + splash->byteAlignment - 1) & ~(splash->byteAlignment - 1);
 
+    if (!SAFE_TO_ALLOC(gif->SHeight, stride)) {
+        return 0;
+    }
+
+    if (!SAFE_TO_ALLOC(gif->ImageCount, sizeof(SplashImage*))) {
+        return 0;
+    }
     bufferSize = stride * gif->SHeight;
     pBitmapBits = (byte_t *) malloc(bufferSize);
+    if (!pBitmapBits) {
+        return 0;
+    }
     pOldBitmapBits = (byte_t *) malloc(bufferSize);
+    if (!pOldBitmapBits) {
+        free(pBitmapBits);
+        return 0;
+    }
     memset(pBitmapBits, 0, bufferSize);
 
     splash->width = gif->SWidth;
@@ -94,6 +121,11 @@
     splash->frameCount = gif->ImageCount;
     splash->frames = (SplashImage *)
         malloc(sizeof(SplashImage) * gif->ImageCount);
+    if (!splash->frames) {
+      free(pBitmapBits);
+      free(pOldBitmapBits);
+      return 0;
+    }
     memset(splash->frames, 0, sizeof(SplashImage) * gif->ImageCount);
     splash->loopCount = 1;
 
@@ -109,6 +141,11 @@
         int colorCount = 0;
         rgbquad_t colorMapBuf[SPLASH_COLOR_MAP_SIZE];
 
+        cx = FIX_POINT(desc->Left, 0, gif->SWidth);
+        cy = FIX_POINT(desc->Top, 0, gif->SHeight);
+        cw = FIX_LENGTH(desc->Left, desc->Width, gif->SWidth);
+        ch = FIX_LENGTH(desc->Top, desc->Height, gif->SHeight);
+
         if (colorMap) {
             if (colorMap->ColorCount <= SPLASH_COLOR_MAP_SIZE) {
                 colorCount = colorMap->ColorCount;
@@ -195,13 +232,22 @@
             for (; pass < npass; ++pass) {
                 int jump = interlacedJumps[pass];
                 int ofs = interlacedOffset[pass];
-                int numLines = (desc->Height + jump - 1 - ofs) / jump;
+                /* Number of source lines for current pass */
+                int numPassLines = (desc->Height + jump - ofs - 1) / jump;
+                /* Number of lines that fits to dest buffer */
+                int numLines = (ch + jump - ofs - 1) / jump;
 
                 initRect(&srcRect, 0, 0, desc->Width, numLines, 1,
                     desc->Width, pSrc, &srcFormat);
-                initRect(&dstRect, desc->Left, desc->Top + ofs, desc->Width,
-                    numLines, jump, stride, pBitmapBits, &splash->imageFormat);
-                pSrc += convertRect(&srcRect, &dstRect, CVT_ALPHATEST);
+
+                if (numLines > 0) {
+                    initRect(&dstRect, cx, cy + ofs, cw,
+                             numLines , jump, stride, pBitmapBits, &splash->imageFormat);
+
+                    pSrc += convertRect(&srcRect, &dstRect, CVT_ALPHATEST);
+                }
+                // skip extra source data
+                pSrc += (numPassLines - numLines) * srcRect.stride;
             }
         }
 
@@ -209,6 +255,12 @@
 
         splash->frames[imageIndex].bitmapBits =
             (rgbquad_t *) malloc(bufferSize);
+        if (!splash->frames[imageIndex].bitmapBits) {
+            free(pBitmapBits);
+            free(pOldBitmapBits);
+            /* Assuming that callee will take care of splash frames we have already allocated */
+            return 0;
+        }
         memcpy(splash->frames[imageIndex].bitmapBits, pBitmapBits, bufferSize);
 
         SplashInitFrameShape(splash, imageIndex);
@@ -224,27 +276,29 @@
             {
                 ImageRect dstRect;
                 rgbquad_t fillColor = 0;                        // 0 is transparent
-                if (transparentColor < 0) {
+
+                if (transparentColor > 0) {
                     fillColor= MAKE_QUAD_GIF(
                         colorMap->Colors[gif->SBackGroundColor], 0xff);
                 }
-                initRect(&dstRect, desc->Left, desc->Top,
-                    desc->Width, desc->Height, 1, stride,
-                    pBitmapBits, &splash->imageFormat);
+                initRect(&dstRect,
+                         cx, cy, cw, ch,
+                         1, stride,
+                         pBitmapBits, &splash->imageFormat);
                 fillRect(fillColor, &dstRect);
             }
             break;
         case GIF_DISPOSE_RESTORE:
             {
-
-                int lineSize = desc->Width * splash->imageFormat.depthBytes;
-
-                for (j = 0; j < desc->Height; j++) {
-                    int lineIndex = stride * (j + desc->Top) +
-                        desc->Left * splash->imageFormat.depthBytes;
-
-                    memcpy(pBitmapBits + lineIndex, pOldBitmapBits + lineIndex,
-                        lineSize);
+                int lineSize = cw * splash->imageFormat.depthBytes;
+                if (lineSize > 0) {
+                    int lineOffset = cx * splash->imageFormat.depthBytes;
+                    int lineIndex = cy * stride + lineOffset;
+                    for (j=0; j<ch; j++) {
+                        memcpy(pBitmapBits + lineIndex, pOldBitmapBits + lineIndex,
+                               lineSize);
+                        lineIndex += stride;
+                    }
                 }
             }
             break;
diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_impl.h b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_impl.h
index c6bad14..6f4e03e 100644
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_impl.h
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_impl.h
@@ -155,6 +155,10 @@
 
 void SplashInitFrameShape(Splash * splash, int imageIndex);
 
+#define SAFE_TO_ALLOC(c, sz)                                               \
+    (((c) > 0) && ((sz) > 0) &&                                            \
+     ((0xffffffffu / ((unsigned int)(c))) > (unsigned int)(sz)))
+
 #define dbgprintf printf
 
 #endif
diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
index f0926ec..abc54dc 100644
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
@@ -103,9 +103,17 @@
 
     rowbytes = png_get_rowbytes(png_ptr, info_ptr);
 
+    if (!SAFE_TO_ALLOC(rowbytes, height)) {
+        goto done;
+    }
+
     if ((image_data = (unsigned char *) malloc(rowbytes * height)) == NULL) {
         goto done;
     }
+
+    if (!SAFE_TO_ALLOC(height, sizeof(png_bytep))) {
+        goto done;
+    }
     if ((row_pointers = (png_bytepp) malloc(height * sizeof(png_bytep)))
             == NULL) {
         goto done;
@@ -121,13 +129,28 @@
     splash->width = width;
     splash->height = height;
 
+    if (!SAFE_TO_ALLOC(splash->width, splash->imageFormat.depthBytes)) {
+        goto done;
+    }
     stride = splash->width * splash->imageFormat.depthBytes;
 
+    if (!SAFE_TO_ALLOC(splash->height, stride)) {
+        goto done;
+    }
     splash->frameCount = 1;
     splash->frames = (SplashImage *)
         malloc(sizeof(SplashImage) * splash->frameCount);
+
+    if (splash->frames == NULL) {
+        goto done;
+    }
+
     splash->loopCount = 1;
     splash->frames[0].bitmapBits = malloc(stride * splash->height);
+    if (splash->frames[0].bitmapBits == NULL) {
+        free(splash->frames);
+        goto done;
+    }
     splash->frames[0].delay = 0;
 
     /* FIXME: sort out the real format */
diff --git a/jdk/src/share/sample/nio/file/Copy.java b/jdk/src/share/sample/nio/file/Copy.java
index e1d5d04..bcd3af0 100644
--- a/jdk/src/share/sample/nio/file/Copy.java
+++ b/jdk/src/share/sample/nio/file/Copy.java
@@ -52,7 +52,7 @@
 
     /**
      * Copy source file to target location. If {@code prompt} is true then
-     * prompted user to overwrite target if it exists. The {@code preserve}
+     * prompt user to overwrite target if it exists. The {@code preserve}
      * parameter determines if file attributes should be copied/preserved.
      */
     static void copyFile(Path source, Path target, boolean prompt, boolean preserve) {
@@ -63,7 +63,7 @@
             try {
                 source.copyTo(target, options);
             } catch (IOException x) {
-                System.err.format("Unable to create: %s: %s%n", target, x);
+                System.err.format("Unable to copy: %s: %s%n", source, x);
             }
         }
     }
@@ -124,13 +124,13 @@
         public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
             // fix up modification time of directory when done
             if (exc == null && preserve) {
+                Path newdir = target.resolve(source.relativize(dir));
                 try {
                     BasicFileAttributes attrs = Attributes.readBasicFileAttributes(dir);
-                    Path newdir = target.resolve(source.relativize(dir));
                     Attributes.setLastModifiedTime(newdir,
                         attrs.lastModifiedTime(), attrs.resolution());
                 } catch (IOException x) {
-                    // ignore
+                    System.err.format("Unable to copy all attributes to: %s: %s%n", newdir, x);
                 }
             }
             return CONTINUE;
@@ -191,6 +191,7 @@
         try {
             isDir = Attributes.readBasicFileAttributes(target).isDirectory();
         } catch (IOException x) {
+            // ignore (probably target does not exist)
         }
 
         // copy each source file/directory to target
@@ -201,7 +202,7 @@
                 // follow links when copying files
                 EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
                 TreeCopier tc = new TreeCopier(source[i], dest, prompt, preserve);
-                Files.walkFileTree(source[i], opts, -1, tc);
+                Files.walkFileTree(source[i], opts, Integer.MAX_VALUE, tc);
             } else {
                 // not recursive so source must not be a directory
                 try {
@@ -209,7 +210,9 @@
                         System.err.format("%s: is a directory%n", source[i]);
                         continue;
                     }
-                } catch (IOException x) { }
+                } catch (IOException x) {
+                    // assume not directory
+                }
                 copyFile(source[i], dest, prompt, preserve);
             }
         }
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
index 739713d..3fc5c9b 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
@@ -490,8 +490,7 @@
             // if the window manager or any other part of the windowing
             // system sets inappropriate size for this window, we can
             // do nothing but accept it.
-            Rectangle reqBounds = newDimensions.getBounds();
-            Rectangle newBounds = constrainBounds(reqBounds.x, reqBounds.y, reqBounds.width, reqBounds.height);
+            Rectangle newBounds = newDimensions.getBounds();
             Insets insets = newDimensions.getInsets();
             // Inherit isClientSizeSet from newDimensions
             if (newDimensions.isClientSizeSet()) {
@@ -619,46 +618,6 @@
     // This method gets overriden in XFramePeer & XDialogPeer.
     abstract boolean isTargetUndecorated();
 
-    @Override
-    Rectangle constrainBounds(int x, int y, int width, int height) {
-        // We don't restrict the setBounds() operation if the code is trusted.
-        if (!hasWarningWindow()) {
-            return new Rectangle(x, y, width, height);
-        }
-
-        // If it's undecorated or is not currently visible,
-        // apply the same constraints as for the Window.
-        if (!isVisible() || isTargetUndecorated()) {
-            return super.constrainBounds(x, y, width, height);
-        }
-
-        // If it's visible & decorated, constraint the size only
-        int newX = x;
-        int newY = y;
-        int newW = width;
-        int newH = height;
-
-        GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
-        Rectangle sB = gc.getBounds();
-        Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
-
-        Rectangle curBounds = getBounds();
-
-        int maxW = Math.max(sB.width - sIn.left - sIn.right, curBounds.width);
-        int maxH = Math.max(sB.height - sIn.top - sIn.bottom, curBounds.height);
-
-        // First make sure the size is withing the visible part of the screen
-        if (newW > maxW) {
-            newW = maxW;
-        }
-
-        if (newH > maxH) {
-            newH = maxH;
-        }
-
-        return new Rectangle(newX, newY, newW, newH);
-    }
-
     /**
      * @see java.awt.peer.ComponentPeer#setBounds
      */
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
index 892d7c9..4b9bcc9 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
@@ -196,12 +196,6 @@
         }
     }
 
-    @Override
-    Rectangle constrainBounds(int x, int y, int width, int height) {
-        // We don't constrain the bounds of the EmbeddedFrames
-        return new Rectangle(x, y, width, height);
-    }
-
     // don't use getBounds() inherited from XDecoratedPeer
     public Rectangle getBounds() {
         return new Rectangle(x, y, width, height);
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
index 8a5030c..967a285 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
@@ -568,6 +568,17 @@
     {
         XEvent ev = new XEvent();
         while(true) {
+            // Fix for 6829923: we should gracefully handle toolkit thread interruption
+            if (Thread.currentThread().isInterrupted()) {
+                // We expect interruption from the AppContext.dispose() method only.
+                // If the thread is interrupted from another place, let's skip it
+                // for compatibility reasons. Probably some time later we'll remove
+                // the check for AppContext.isDisposed() and will unconditionally
+                // break the loop here.
+                if (AppContext.getAppContext().isDisposed()) {
+                    break;
+                }
+            }
             awtLock();
             try {
                 if (loop == SECONDARY_LOOP) {
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java
index 6c517b1..5115f46 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java
@@ -156,11 +156,11 @@
     }
 
     XWindow(Component target, long parentWindow) {
-        this(target, parentWindow, target.getBounds());
+        this(target, parentWindow, new Rectangle(target.getBounds()));
     }
 
     XWindow(Component target) {
-        this(target, (target.getParent() == null) ? 0 : getParentWindowID(target), target.getBounds());
+        this(target, (target.getParent() == null) ? 0 : getParentWindowID(target), new Rectangle(target.getBounds()));
     }
 
     XWindow(Object target) {
@@ -198,7 +198,7 @@
             | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask);
 
         if (target != null) {
-            params.putIfNull(BOUNDS, target.getBounds());
+            params.putIfNull(BOUNDS, new Rectangle(target.getBounds()));
         } else {
             params.putIfNull(BOUNDS, new Rectangle(0, 0, MIN_SIZE, MIN_SIZE));
         }
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
index 41807db..e78d007 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
@@ -146,6 +146,13 @@
 
         params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect()));
 
+        SunToolkit.awtLock();
+        try {
+            windows.add(this);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+
         cachedFocusableWindow = isFocusableWindow();
 
         Font f = target.getFont();
@@ -173,9 +180,6 @@
 
         GraphicsConfiguration gc = getGraphicsConfiguration();
         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
-
-        Rectangle bounds = (Rectangle)(params.get(BOUNDS));
-        params.put(BOUNDS, constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height));
     }
 
     protected String getWMName() {
@@ -430,56 +434,6 @@
         return ownerPeer;
     }
 
-    // This method is overriden at the XDecoratedPeer to handle
-    // decorated windows a bit differently.
-    Rectangle constrainBounds(int x, int y, int width, int height) {
-        // We don't restrict the setBounds() operation if the code is trusted.
-        if (!hasWarningWindow()) {
-            return new Rectangle(x, y, width, height);
-        }
-
-        // The window bounds should be within the visible part of the screen
-        int newX = x;
-        int newY = y;
-        int newW = width;
-        int newH = height;
-
-        // Now check each point is within the visible part of the screen
-        GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
-        Rectangle sB = gc.getBounds();
-        Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
-
-        int screenX = sB.x + sIn.left;
-        int screenY = sB.y + sIn.top;
-        int screenW = sB.width - sIn.left - sIn.right;
-        int screenH = sB.height - sIn.top - sIn.bottom;
-
-
-        // First make sure the size is withing the visible part of the screen
-        if (newW > screenW) {
-            newW = screenW;
-        }
-
-        if (newH > screenH) {
-            newH = screenH;
-        }
-
-        // Tweak the location if needed
-        if (newX < screenX) {
-            newX = screenX;
-        } else if (newX + newW > screenX + screenW) {
-            newX = screenX + screenW - newW;
-        }
-
-        if (newY < screenY) {
-            newY = screenY;
-        } else if (newY + newH > screenY + screenH) {
-            newY = screenY + screenH - newH;
-        }
-
-        return new Rectangle(newX, newY, newW, newH);
-    }
-
     //Fix for 6318144: PIT:Setting Min Size bigger than current size enlarges
     //the window but fails to revalidate, Sol-CDE
     //This bug is regression for
@@ -488,13 +442,11 @@
     //Note that this function is overriden in XDecoratedPeer so event
     //posting is not changing for decorated peers
     public void setBounds(int x, int y, int width, int height, int op) {
-        Rectangle newBounds = constrainBounds(x, y, width, height);
-
         XToolkit.awtLock();
         try {
             Rectangle oldBounds = getBounds();
 
-            super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op);
+            super.setBounds(x, y, width, height, op);
 
             Rectangle bounds = getBounds();
 
diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java
index aa4b527..7cfa8b0 100644
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java
@@ -451,9 +451,7 @@
         }
     }
 
-    /*
     @Override
-    */
     public boolean isTranslucencyCapable() {
         return isTranslucencyCapable(getAData());
     }
diff --git a/jdk/src/windows/classes/sun/awt/Win32GraphicsConfig.java b/jdk/src/windows/classes/sun/awt/Win32GraphicsConfig.java
index 2eefb33..92bd3b8 100644
--- a/jdk/src/windows/classes/sun/awt/Win32GraphicsConfig.java
+++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsConfig.java
@@ -332,9 +332,7 @@
         // the rest of the flip actions are not supported
     }
 
-    /*
     @Override
-    */
     public boolean isTranslucencyCapable() {
         //XXX: worth checking if 8-bit? Anyway, it doesn't hurt.
         return true;
diff --git a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java
index 6ad6084..d5e4519 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java
@@ -970,11 +970,12 @@
      *
      * Conditions which could prevent hw acceleration include the toplevel
      * window containing this component being
-     * {@link com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT TRANSLUCENT}.
+     * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
+     * PERPIXEL_TRANSLUCENT}.
      *
      * @return {@code true} if this component is capable of being hw
      * accelerated, {@code false} otherwise
-     * @see com.sun.awt.AWTUtilities.Translucency#TRANSLUCENT
+     * @see GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT
      */
     public boolean isAccelCapable() {
         boolean isTranslucent =
diff --git a/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java
index 96cdb26..4424f1c 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java
@@ -114,12 +114,10 @@
     }
 
     public void reshape(int x, int y, int width, int height) {
-        Rectangle newBounds = constrainBounds(x, y, width, height);
-
         if (((Dialog)target).isUndecorated()) {
-            super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
+            super.reshape(x, y, width, height);
         } else {
-            reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
+            reshapeFrame(x, y, width, height);
         }
     }
 
diff --git a/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java b/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java
index 2e1e6e6..2ed17f6 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java
@@ -68,12 +68,6 @@
     public native void synthesizeWmActivate(boolean doActivate);
 
     @Override
-    Rectangle constrainBounds(int x, int y, int width, int height) {
-        // We don't constrain the bounds of the EmbeddedFrames
-        return new Rectangle(x, y, width, height);
-    }
-
-    @Override
     public boolean isAccelCapable() {
         // REMIND: Temp workaround for issues with using HW acceleration
         // in the browser on Vista when DWM is enabled
diff --git a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java
index 79bf6b7..86bde26 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java
@@ -89,12 +89,10 @@
     }
 
     public void reshape(int x, int y, int width, int height) {
-        Rectangle newBounds = constrainBounds(x, y, width, height);
-
         if (((Frame)target).isUndecorated()) {
-            super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
+            super.reshape(x, y, width, height);
         } else {
-            reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
+            reshapeFrame(x, y, width, height);
         }
     }
 
diff --git a/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java b/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java
index 10ca423..3b4af6d 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java
@@ -99,45 +99,4 @@
     public Insets insets() {
         return getInsets();
     }
-
-    private native void pRestack(Object[] peers);
-    private void restack(Container cont, Vector peers) {
-        for (int i = 0; i < cont.getComponentCount(); i++) {
-            Component comp = cont.getComponent(i);
-            if (!comp.isLightweight()) {
-                ComponentPeer peer = comp.getPeer();
-                if (peer != null && (peer instanceof WComponentPeer))
-                {
-                    peers.add(peer);
-                } else {
-                    if (log.isLoggable(Level.FINE)) {
-                        log.log(Level.FINE,
-                                "peer of a {0} is null or not a WComponentPeer: {1}.",
-                                new Object[]{comp, peer});
-                    }
-                }
-            }
-            if (comp.isLightweight() && comp instanceof Container) {
-                restack((Container)comp, peers);
-            }
-        }
-    }
-
-    /**
-     * @see java.awt.peer.ContainerPeer#restack
-     */
-    public void restack() {
-        Vector peers = new Vector();
-        peers.add(this);
-        Container cont = (Container)target;
-        restack(cont, peers);
-        pRestack(peers.toArray());
-    }
-
-    /**
-     * @see java.awt.peer.ContainerPeer#isRestackSupported
-     */
-    public boolean isRestackSupported() {
-        return true;
-    }
 }
diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java
index 3c62402..8de4390 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java
@@ -335,16 +335,14 @@
     }
 
     private void updateShape() {
-        // Shape shape = ((Window)target).getShape();
-        Shape shape = AWTAccessor.getWindowAccessor().getShape((Window)target);
+        Shape shape = ((Window)target).getShape();
         if (shape != null) {
             applyShape(Region.getInstance(shape, null));
         }
     }
 
     private void updateOpacity() {
-        // float opacity = ((Window)target).getOpacity();
-        float opacity = AWTAccessor.getWindowAccessor().getOpacity((Window)target);
+        float opacity = ((Window)target).getOpacity();
         if (opacity < 1.0f) {
             setOpacity(opacity);
         }
@@ -546,81 +544,16 @@
      private volatile int sysW = 0;
      private volatile int sysH = 0;
 
-     Rectangle constrainBounds(int x, int y, int width, int height) {
-         GraphicsConfiguration gc = this.winGraphicsConfig;
-
-         // We don't restrict the setBounds() operation if the code is trusted.
-         if (!hasWarningWindow() || gc == null) {
-             return new Rectangle(x, y, width, height);
-         }
-
-         int newX = x;
-         int newY = y;
-         int newW = width;
-         int newH = height;
-
-         Rectangle sB = gc.getBounds();
-         Insets sIn = Toolkit.getDefaultToolkit().getScreenInsets(gc);
-
-         int screenW = sB.width - sIn.left - sIn.right;
-         int screenH = sB.height - sIn.top - sIn.bottom;
-
-         // If it's undecorated or is not currently visible
-         if (!AWTAccessor.getComponentAccessor().isVisible_NoClientCode(
-                     (Component)target) || isTargetUndecorated())
-         {
-             // Now check each point is within the visible part of the screen
-             int screenX = sB.x + sIn.left;
-             int screenY = sB.y + sIn.top;
-
-             // First make sure the size is within the visible part of the screen
-             if (newW > screenW) {
-                 newW = screenW;
-             }
-             if (newH > screenH) {
-                 newH = screenH;
-             }
-
-             // Tweak the location if needed
-             if (newX < screenX) {
-                 newX = screenX;
-             } else if (newX + newW > screenX + screenW) {
-                 newX = screenX + screenW - newW;
-             }
-             if (newY < screenY) {
-                 newY = screenY;
-             } else if (newY + newH > screenY + screenH) {
-                 newY = screenY + screenH - newH;
-             }
-         } else {
-             int maxW = Math.max(screenW, sysW);
-             int maxH = Math.max(screenH, sysH);
-
-             // Make sure the size is withing the visible part of the screen
-             // OR less that the current size of the window.
-             if (newW > maxW) {
-                 newW = maxW;
-             }
-             if (newH > maxH) {
-                 newH = maxH;
-             }
-         }
-
-         return new Rectangle(newX, newY, newW, newH);
-     }
-
      public native void repositionSecurityWarning();
 
      @Override
      public void setBounds(int x, int y, int width, int height, int op) {
-         Rectangle newBounds = constrainBounds(x, y, width, height);
+         sysX = x;
+         sysY = y;
+         sysW = width;
+         sysH = height;
 
-         sysX = newBounds.x;
-         sysY = newBounds.y;
-         sysW = newBounds.width;
-         sysH = newBounds.height;
-
-         super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op);
+         super.setBounds(x, y, width, height, op);
      }
 
     @Override
@@ -675,11 +608,13 @@
     public void setOpaque(boolean isOpaque) {
         Window target = (Window)getTarget();
 
-        SunToolkit sunToolkit = (SunToolkit)target.getToolkit();
-        if (!sunToolkit.isWindowTranslucencySupported() ||
-            !sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration()))
-        {
-            return;
+        if (!isOpaque) {
+            SunToolkit sunToolkit = (SunToolkit)target.getToolkit();
+            if (!sunToolkit.isWindowTranslucencySupported() ||
+                !sunToolkit.isTranslucencyCapable(target.getGraphicsConfiguration()))
+            {
+                return;
+            }
         }
 
         boolean opaqueChanged = this.isOpaque != isOpaque;
@@ -713,9 +648,9 @@
             // its shape only. To restore the correct visual appearance
             // of the window (i.e. w/ the correct shape) we have to reset
             // the shape.
-            Shape shape = AWTAccessor.getWindowAccessor().getShape(target);
+            Shape shape = ((Window)target).getShape();
             if (shape != null) {
-                AWTAccessor.getWindowAccessor().setShape(target, shape);
+                ((Window)target).setShape(shape);
             }
         }
 
@@ -729,6 +664,11 @@
             return;
         }
 
+        Component target = (Component)this.target;
+        if (target.getWidth() <= 0 || target.getHeight() <= 0) {
+            return;
+        }
+
         TranslucentWindowPainter currentPainter = painter;
         if (currentPainter != null) {
             currentPainter.updateWindow(backBuffer);
diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
index ef66864..e08f460 100644
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
@@ -354,16 +354,9 @@
         }
     }
 
-    // invoke by FileFileImpl to release lock
     @Override
-    void release(FileLockImpl fli) throws IOException {
-        try {
-            begin();
-            nd.release(fdObj, fli.position(), fli.size());
-            removeFromFileLockTable(fli);
-        } finally {
-            end();
-        }
+    protected void implRelease(FileLockImpl fli) throws IOException {
+        nd.release(fdObj, fli.position(), fli.size());
     }
 
     /**
diff --git a/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java b/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
index 146d7c1..44dd25a 100644
--- a/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 import java.security.spec.RSAKeyGenParameterSpec;
 
 import sun.security.jca.JCAUtil;
+import sun.security.rsa.RSAKeyFactory;
 
 /**
  * RSA keypair generator.
@@ -43,8 +44,8 @@
 public final class RSAKeyPairGenerator extends KeyPairGeneratorSpi {
 
     // Supported by Microsoft Base, Strong and Enhanced Cryptographic Providers
-    private static final int KEY_SIZE_MIN = 512; // disallow MSCAPI min. of 384
-    private static final int KEY_SIZE_MAX = 16384;
+    static final int KEY_SIZE_MIN = 512; // disallow MSCAPI min. of 384
+    static final int KEY_SIZE_MAX = 16384;
     private static final int KEY_SIZE_DEFAULT = 1024;
 
     // size of the key to generate, KEY_SIZE_MIN <= keySize <= KEY_SIZE_MAX
@@ -59,7 +60,14 @@
     // random is always ignored
     public void initialize(int keySize, SecureRandom random) {
 
-        checkKeySize(keySize);
+        try {
+            RSAKeyFactory.checkKeyLengths(keySize, null,
+                KEY_SIZE_MIN, KEY_SIZE_MAX);
+        } catch (InvalidKeyException e) {
+            throw new InvalidParameterException(e.getMessage());
+        }
+
+        this.keySize = keySize;
     }
 
     // second initialize method. See JCA doc
@@ -67,21 +75,31 @@
     public void initialize(AlgorithmParameterSpec params, SecureRandom random)
             throws InvalidAlgorithmParameterException {
 
+        int tmpSize;
         if (params == null) {
-            checkKeySize(KEY_SIZE_DEFAULT);
-
+            tmpSize = KEY_SIZE_DEFAULT;
         } else if (params instanceof RSAKeyGenParameterSpec) {
 
             if (((RSAKeyGenParameterSpec) params).getPublicExponent() != null) {
                 throw new InvalidAlgorithmParameterException
                     ("Exponent parameter is not supported");
             }
-            checkKeySize(((RSAKeyGenParameterSpec) params).getKeysize());
+            tmpSize = ((RSAKeyGenParameterSpec) params).getKeysize();
 
         } else {
             throw new InvalidAlgorithmParameterException
                 ("Params must be an instance of RSAKeyGenParameterSpec");
         }
+
+        try {
+            RSAKeyFactory.checkKeyLengths(tmpSize, null,
+                KEY_SIZE_MIN, KEY_SIZE_MAX);
+        } catch (InvalidKeyException e) {
+            throw new InvalidAlgorithmParameterException(
+                "Invalid Key sizes", e);
+        }
+
+        this.keySize = tmpSize;
     }
 
     // generate the keypair. See JCA doc
@@ -95,18 +113,6 @@
         return new KeyPair(keys.getPublic(), keys.getPrivate());
     }
 
-    private void checkKeySize(int keySize) throws InvalidParameterException {
-        if (keySize < KEY_SIZE_MIN) {
-            throw new InvalidParameterException
-                ("Key size must be at least " + KEY_SIZE_MIN + " bits");
-        }
-        if (keySize > KEY_SIZE_MAX) {
-            throw new InvalidParameterException
-                ("Key size must be " + KEY_SIZE_MAX + " bits or less");
-        }
-        this.keySize = keySize;
-    }
-
     private static native RSAKeyPair generateRSAKeyPair(int keySize,
         String keyContainerName);
 }
diff --git a/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java b/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java
index 606423d..982e183 100644
--- a/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSASignature.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,9 @@
 import java.security.Signature;
 import java.security.SignatureSpi;
 import java.security.SignatureException;
+import java.math.BigInteger;
+
+import sun.security.rsa.RSAKeyFactory;
 
 /**
  * RSA signature implementation. Supports RSA signing using PKCS#1 v1.5 padding.
@@ -124,7 +127,16 @@
 
             // convert key to MSCAPI format
 
-            byte[] modulusBytes = rsaKey.getModulus().toByteArray();
+            BigInteger modulus = rsaKey.getModulus();
+            BigInteger exponent =  rsaKey.getPublicExponent();
+
+            // Check against the local and global values to make sure
+            // the sizes are ok.  Round up to the nearest byte.
+            RSAKeyFactory.checkKeyLengths(((modulus.bitLength() + 7) & ~7),
+                exponent, -1, RSAKeyPairGenerator.KEY_SIZE_MAX);
+
+            byte[] modulusBytes = modulus.toByteArray();
+            byte[] exponentBytes = exponent.toByteArray();
 
             // Adjust key length due to sign bit
             int keyBitLength = (modulusBytes[0] == 0)
@@ -132,8 +144,7 @@
                 : modulusBytes.length * 8;
 
             byte[] keyBlob = generatePublicKeyBlob(
-                keyBitLength, modulusBytes,
-                rsaKey.getPublicExponent().toByteArray());
+                keyBitLength, modulusBytes, exponentBytes);
 
             publicKey = importPublicKey(keyBlob, keyBitLength);
 
@@ -166,12 +177,11 @@
         }
         privateKey = (sun.security.mscapi.RSAPrivateKey) key;
 
-        // Determine byte length from bit length
-        int keySize = (privateKey.bitLength() + 7) >> 3;
-
-        if (keySize < 64)
-            throw new InvalidKeyException(
-                "RSA keys must be at least 512 bits long");
+        // Check against the local and global values to make sure
+        // the sizes are ok.  Round up to nearest byte.
+        RSAKeyFactory.checkKeyLengths(((privateKey.bitLength() + 7) & ~7),
+            null, RSAKeyPairGenerator.KEY_SIZE_MIN,
+            RSAKeyPairGenerator.KEY_SIZE_MAX);
 
         if (needsReset) {
             messageDigest.reset();
diff --git a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
index a65ad90..7b41d86 100644
--- a/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
+++ b/jdk/src/windows/native/sun/nio/ch/FileDispatcherImpl.c
@@ -414,7 +414,7 @@
     o.Offset = lowPos;
     o.OffsetHigh = highPos;
     result = UnlockFileEx(h, 0, lowNumBytes, highNumBytes, &o);
-    if (result == 0) {
+    if (result == 0 && GetLastError() != ERROR_NOT_LOCKED) {
         JNU_ThrowIOExceptionWithLastError(env, "Release failed");
     }
 }
diff --git a/jdk/src/windows/native/sun/security/krb5/NativeCreds.c b/jdk/src/windows/native/sun/security/krb5/NativeCreds.c
index e112b86..c910c62 100644
--- a/jdk/src/windows/native/sun/security/krb5/NativeCreds.c
+++ b/jdk/src/windows/native/sun/security/krb5/NativeCreds.c
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Portions Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,7 @@
  * Function prototypes for internal routines
  *
  */
+BOOL native_debug = 0;
 
 BOOL PackageConnectLookup(PHANDLE,PULONG);
 
@@ -113,208 +114,221 @@
 
     jclass cls;
     JNIEnv *env;
+    jfieldID fldDEBUG;
 
     if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2)) {
         return JNI_EVERSION; /* JNI version not supported */
     }
 
+    cls = (*env)->FindClass(env,"sun/security/krb5/internal/Krb5");
+    if (cls == NULL) {
+        printf("LSA: Couldn't find Krb5\n");
+        return JNI_ERR;
+    }
+    fldDEBUG = (*env)->GetStaticFieldID(env, cls, "DEBUG", "Z");
+    if (fldDEBUG == NULL) {
+        printf("LSA: Krb5 has no DEBUG field\n");
+        return JNI_ERR;
+    }
+    native_debug = (*env)->GetStaticBooleanField(env, cls, fldDEBUG);
+
     cls = (*env)->FindClass(env,"sun/security/krb5/internal/Ticket");
 
     if (cls == NULL) {
-        printf("Couldn't find Ticket\n");
+        printf("LSA: Couldn't find Ticket\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found Ticket\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found Ticket\n");
+    }
 
     ticketClass = (*env)->NewWeakGlobalRef(env,cls);
     if (ticketClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env, "sun/security/krb5/PrincipalName");
 
     if (cls == NULL) {
-        printf("Couldn't find PrincipalName\n");
+        printf("LSA: Couldn't find PrincipalName\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found PrincipalName\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found PrincipalName\n");
+    }
 
     principalNameClass = (*env)->NewWeakGlobalRef(env,cls);
     if (principalNameClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env,"sun/security/util/DerValue");
 
     if (cls == NULL) {
-        printf("Couldn't find DerValue\n");
+        printf("LSA: Couldn't find DerValue\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found DerValue\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found DerValue\n");
+    }
 
     derValueClass = (*env)->NewWeakGlobalRef(env,cls);
     if (derValueClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env,"sun/security/krb5/EncryptionKey");
 
     if (cls == NULL) {
-        printf("Couldn't find EncryptionKey\n");
+        printf("LSA: Couldn't find EncryptionKey\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found EncryptionKey\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found EncryptionKey\n");
+    }
 
     encryptionKeyClass = (*env)->NewWeakGlobalRef(env,cls);
     if (encryptionKeyClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env,"sun/security/krb5/internal/TicketFlags");
 
     if (cls == NULL) {
-        printf("Couldn't find TicketFlags\n");
+        printf("LSA: Couldn't find TicketFlags\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found TicketFlags\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found TicketFlags\n");
+    }
 
     ticketFlagsClass = (*env)->NewWeakGlobalRef(env,cls);
     if (ticketFlagsClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env,"sun/security/krb5/internal/KerberosTime");
 
     if (cls == NULL) {
-        printf("Couldn't find KerberosTime\n");
+        printf("LSA: Couldn't find KerberosTime\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found KerberosTime\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found KerberosTime\n");
+    }
 
     kerberosTimeClass = (*env)->NewWeakGlobalRef(env,cls);
     if (kerberosTimeClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     cls = (*env)->FindClass(env,"java/lang/String");
 
     if (cls == NULL) {
-        printf("Couldn't find String\n");
+        printf("LSA: Couldn't find String\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found String\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found String\n");
+    }
 
     javaLangStringClass = (*env)->NewWeakGlobalRef(env,cls);
     if (javaLangStringClass == NULL) {
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Made NewWeakGlobalRef\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Made NewWeakGlobalRef\n");
+    }
 
     derValueConstructor = (*env)->GetMethodID(env, derValueClass,
                                             "<init>", "([B)V");
     if (derValueConstructor == 0) {
-        printf("Couldn't find DerValue constructor\n");
+        printf("LSA: Couldn't find DerValue constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found DerValue constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found DerValue constructor\n");
+    }
 
     ticketConstructor = (*env)->GetMethodID(env, ticketClass,
                             "<init>", "(Lsun/security/util/DerValue;)V");
     if (ticketConstructor == 0) {
-        printf("Couldn't find Ticket constructor\n");
+        printf("LSA: Couldn't find Ticket constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found Ticket constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found Ticket constructor\n");
+    }
 
     principalNameConstructor = (*env)->GetMethodID(env, principalNameClass,
                                     "<init>", "([Ljava/lang/String;)V");
     if (principalNameConstructor == 0) {
-        printf("Couldn't find PrincipalName constructor\n");
+        printf("LSA: Couldn't find PrincipalName constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found PrincipalName constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found PrincipalName constructor\n");
+    }
 
     encryptionKeyConstructor = (*env)->GetMethodID(env, encryptionKeyClass,
                                             "<init>", "(I[B)V");
     if (encryptionKeyConstructor == 0) {
-        printf("Couldn't find EncryptionKey constructor\n");
+        printf("LSA: Couldn't find EncryptionKey constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found EncryptionKey constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found EncryptionKey constructor\n");
+    }
 
     ticketFlagsConstructor = (*env)->GetMethodID(env, ticketFlagsClass,
                                             "<init>", "(I[B)V");
     if (ticketFlagsConstructor == 0) {
-        printf("Couldn't find TicketFlags constructor\n");
+        printf("LSA: Couldn't find TicketFlags constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found TicketFlags constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found TicketFlags constructor\n");
+    }
 
     kerberosTimeConstructor = (*env)->GetMethodID(env, kerberosTimeClass,
                                     "<init>", "(Ljava/lang/String;)V");
     if (kerberosTimeConstructor == 0) {
-        printf("Couldn't find KerberosTime constructor\n");
+        printf("LSA: Couldn't find KerberosTime constructor\n");
         return JNI_ERR;
     }
-    #ifdef DEBUG
-    printf("Found KerberosTime constructor\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Found KerberosTime constructor\n");
+    }
 
     // load the setRealm method in PrincipalName
     setRealmMethod = (*env)->GetMethodID(env, principalNameClass,
                                     "setRealm", "(Ljava/lang/String;)V");
     if (setRealmMethod == 0) {
-        printf("Couldn't find setRealm in PrincipalName\n");
+        printf("LSA: Couldn't find setRealm in PrincipalName\n");
         return JNI_ERR;
     }
 
-    #ifdef DEBUG
-    printf("Finished OnLoad processing\n");
-    #endif /* DEBUG */
+    if (native_debug) {
+        printf("LSA: Finished OnLoad processing\n");
+    }
 
     return JNI_VERSION_1_2;
 }
@@ -389,16 +403,25 @@
 
         if (krbcredsConstructor == 0) {
             krbcredsConstructor = (*env)->GetMethodID(env, krbcredsClass, "<init>",
-                    "(Lsun/security/krb5/internal/Ticket;Lsun/security/krb5/PrincipalName;Lsun/security/krb5/PrincipalName;Lsun/security/krb5/EncryptionKey;Lsun/security/krb5/internal/TicketFlags;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/KerberosTime;Lsun/security/krb5/internal/HostAddresses;)V");
+                    "(Lsun/security/krb5/internal/Ticket;"
+                    "Lsun/security/krb5/PrincipalName;"
+                    "Lsun/security/krb5/PrincipalName;"
+                    "Lsun/security/krb5/EncryptionKey;"
+                    "Lsun/security/krb5/internal/TicketFlags;"
+                    "Lsun/security/krb5/internal/KerberosTime;"
+                    "Lsun/security/krb5/internal/KerberosTime;"
+                    "Lsun/security/krb5/internal/KerberosTime;"
+                    "Lsun/security/krb5/internal/KerberosTime;"
+                    "Lsun/security/krb5/internal/HostAddresses;)V");
             if (krbcredsConstructor == 0) {
-                printf("Couldn't find sun.security.krb5.Credentials constructor\n");
+                printf("LSA: Couldn't find sun.security.krb5.Credentials constructor\n");
                 break;
             }
         }
 
-        #ifdef DEBUG
-        printf("Found KrbCreds constructor\n");
-        #endif
+        if (native_debug) {
+            printf("LSA: Found KrbCreds constructor\n");
+        }
 
         //
         // Get the logon handle and package ID from the
@@ -407,9 +430,9 @@
         if (!PackageConnectLookup(&LogonHandle, &PackageId))
             break;
 
-        #ifdef DEBUG
-        printf("Got handle to Kerberos package\n");
-        #endif /* DEBUG */
+        if (native_debug) {
+            printf("LSA: Got handle to Kerberos package\n");
+        }
 
         // Get the MS TGT from cache
         CacheRequest.MessageType = KerbRetrieveTicketMessage;
@@ -426,9 +449,9 @@
                         &SubStatus
                         );
 
-        #ifdef DEBUG
-        printf("Response size is %d\n", rspSize);
-        #endif
+        if (native_debug) {
+            printf("LSA: Response size is %d\n", rspSize);
+        }
 
         if (!LSA_SUCCESS(Status) || !LSA_SUCCESS(SubStatus)) {
             if (!LSA_SUCCESS(Status)) {
@@ -467,9 +490,9 @@
         }
 
         if (ignore_cache) {
-            #ifdef DEBUG
-            printf("MS TGT in cache is invalid/not supported; request new ticket\n");
-            #endif /* DEBUG */
+            if (native_debug) {
+                printf("LSA: MS TGT in cache is invalid/not supported; request new ticket\n");
+            }
 
             // use domain to request Ticket
             Status = ConstructTicketRequest(msticket->TargetDomainName,
@@ -493,9 +516,9 @@
                         &SubStatus
                         );
 
-            #ifdef DEBUG
-            printf("Response size is %d\n", responseSize);
-            #endif /* DEBUG */
+            if (native_debug) {
+                printf("LSA: Response size is %d\n", responseSize);
+            }
 
             if (!LSA_SUCCESS(Status) || !LSA_SUCCESS(SubStatus)) {
                 if (!LSA_SUCCESS(Status)) {
@@ -788,7 +811,9 @@
     static WCHAR szMsgBuf[MAX_MSG_SIZE];
     DWORD dwRes;
 
-    printf("Error calling function %s: %lu\n", szAPI, dwError);
+    if (native_debug) {
+        printf("LSA: Error calling function %s: %lu\n", szAPI, dwError);
+    }
 
     dwRes = FormatMessage (
             FORMAT_MESSAGE_FROM_SYSTEM,
@@ -798,11 +823,13 @@
             szMsgBuf,
             MAX_MSG_SIZE,
             NULL);
-    if (0 == dwRes) {
-        printf("FormatMessage failed with %d\n", GetLastError());
-        // ExitProcess(EXIT_FAILURE);
-    } else {
-        printf("%S",szMsgBuf);
+    if (native_debug) {
+        if (0 == dwRes) {
+            printf("LSA: FormatMessage failed with %d\n", GetLastError());
+            // ExitProcess(EXIT_FAILURE);
+        } else {
+            printf("LSA: %S",szMsgBuf);
+        }
     }
 }
 
@@ -896,17 +923,19 @@
             ((domainName.Length)*sizeof(WCHAR) + sizeof(UNICODE_NULL)));
     wcsncpy(realm, domainName.Buffer, domainName.Length/sizeof(WCHAR));
 
-    #ifdef DEBUG
-    printf("Principal domain is %S\n", realm);
-    printf("Name type is %x\n", principalName->NameType);
-    printf("Name count is %x\n", principalName->NameCount);
-    #endif
+    if (native_debug) {
+        printf("LSA: Principal domain is %S\n", realm);
+        printf("LSA: Name type is %x\n", principalName->NameType);
+        printf("LSA: Name count is %x\n", principalName->NameCount);
+    }
 
     nameCount = principalName->NameCount;
     stringArray = (*env)->NewObjectArray(env, nameCount,
                             javaLangStringClass, NULL);
     if (stringArray == NULL) {
-        printf("Can't allocate String array for Principal\n");
+        if (native_debug) {
+            printf("LSA: Can't allocate String array for Principal\n");
+        }
         LocalFree(realm);
         return principal;
     }
@@ -941,6 +970,17 @@
     // First, need to build a byte array
     jbyteArray ary;
     jobject encryptionKey = NULL;
+    unsigned int i;
+
+    for (i=0; i<cryptoKey->Length; i++) {
+        if (cryptoKey->Value[i]) break;
+    }
+    if (i == cryptoKey->Length) {
+        if (native_debug) {
+            printf("LSA: Session key all zero. Stop.\n");
+        }
+        return NULL;
+    }
 
     ary = (*env)->NewByteArray(env,cryptoKey->Length);
     (*env)->SetByteArrayRegion(env, ary, (jsize) 0, cryptoKey->Length,
@@ -1005,9 +1045,9 @@
                 hour,
                 minute,
                 second );
-        #ifdef DEBUG
-        printf("%S\n", (wchar_t *)timeString);
-        #endif /* DEBUG */
+        if (native_debug) {
+            printf("LSA: %S\n", (wchar_t *)timeString);
+        }
         stringTime = (*env)->NewString(env, timeString,
                 (sizeof(timeString)/sizeof(WCHAR))-1);
         if (stringTime != NULL) { // everything's OK so far
diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp
index 9db8ec4..fb7ae4c 100644
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp
@@ -1843,8 +1843,13 @@
       case WM_AWT_SETALWAYSONTOP: {
         AwtWindow* w = (AwtWindow*)lParam;
         BOOL value = (BOOL)wParam;
+        UINT flags = SWP_NOMOVE | SWP_NOSIZE;
+        // transient windows shouldn't change the owner window's position in the z-order
+        if (w->IsRetainingHierarchyZOrder()) {
+            flags |= SWP_NOOWNERZORDER;
+        }
         ::SetWindowPos(w->GetHWnd(), (value != 0 ? HWND_TOPMOST : HWND_NOTOPMOST),
-                       0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
+                       0,0,0,0, flags);
         break;
       }
 
diff --git a/jdk/src/windows/native/sun/windows/awt_Window.cpp b/jdk/src/windows/native/sun/windows/awt_Window.cpp
index 88bcd8e..3b0b1d3 100644
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp
@@ -165,7 +165,6 @@
 int AwtWindow::ms_instanceCounter = 0;
 HHOOK AwtWindow::ms_hCBTFilter;
 AwtWindow * AwtWindow::m_grabbedWindow = NULL;
-HWND AwtWindow::sm_retainingHierarchyZOrderInShow = NULL;
 BOOL AwtWindow::sm_resizing = FALSE;
 UINT AwtWindow::untrustedWindowsCounter = 0;
 
@@ -341,23 +340,6 @@
 }
 
 MsgRouting AwtWindow::WmWindowPosChanging(LPARAM windowPos) {
-    /*
-     * See 6178004.
-     * Some windows shouldn't trigger a change in z-order of
-     * any window from the hierarchy.
-     */
-    if (IsRetainingHierarchyZOrder()) {
-        if (((WINDOWPOS *)windowPos)->flags & SWP_SHOWWINDOW) {
-            sm_retainingHierarchyZOrderInShow = GetHWnd();
-        }
-    } else if (sm_retainingHierarchyZOrderInShow != NULL) {
-        HWND ancestor = ::GetAncestor(sm_retainingHierarchyZOrderInShow, GA_ROOTOWNER);
-        HWND windowAncestor = ::GetAncestor(GetHWnd(), GA_ROOTOWNER);
-
-        if (windowAncestor == ancestor) {
-            ((WINDOWPOS *)windowPos)->flags |= SWP_NOZORDER;
-        }
-    }
     return mrDoDefault;
 }
 
@@ -369,19 +351,14 @@
     ::SetWindowPos(warningWindow, HWND_NOTOPMOST,
             rect.left, rect.top,
             rect.right - rect.left, rect.bottom - rect.top,
-            SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER
+            SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER |
+            SWP_NOOWNERZORDER
             );
 }
 
 MsgRouting AwtWindow::WmWindowPosChanged(LPARAM windowPos) {
     WINDOWPOS * wp = (WINDOWPOS *)windowPos;
 
-    if (IsRetainingHierarchyZOrder() && wp->flags & SWP_SHOWWINDOW) {
-        // By this time all the windows from the hierarchy are already notified about z-order change.
-        // Thus we may and we should reset the trigger in order not to affect other changes.
-        sm_retainingHierarchyZOrderInShow = NULL;
-    }
-
     // Reposition the warning window
     if (IsUntrusted() && warningWindow != NULL) {
         if (wp->flags & SWP_HIDEWINDOW) {
@@ -854,7 +831,7 @@
     if (securityAnimationKind == akShow) {
         ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
-                SWP_SHOWWINDOW);
+                SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
 
         ::SetLayeredWindowAttributes(warningWindow, RGB(0, 0, 0),
                 0xFF, LWA_ALPHA);
@@ -880,7 +857,7 @@
         case akPreHide:
             ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0,
                     SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE |
-                    SWP_HIDEWINDOW);
+                    SWP_HIDEWINDOW | SWP_NOOWNERZORDER);
             break;
         case akShow:
             RepaintWarningWindow();
@@ -1250,7 +1227,16 @@
         }
     }
     if (!done) {
-        ::ShowWindow(GetHWnd(), nCmdShow);
+        // transient windows shouldn't change the owner window's position in the z-order
+        if (IsRetainingHierarchyZOrder()){
+            UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER;
+            if (nCmdShow == SW_SHOWNA) {
+                flags |= SWP_NOACTIVATE;
+            }
+            ::SetWindowPos(GetHWnd(), HWND_TOPMOST, 0, 0, 0, 0, flags);
+        } else {
+            ::ShowWindow(GetHWnd(), nCmdShow);
+        }
     }
     env->DeleteLocalRef(target);
 }
diff --git a/jdk/src/windows/native/sun/windows/awt_Window.h b/jdk/src/windows/native/sun/windows/awt_Window.h
index bf43150..05282f7 100644
--- a/jdk/src/windows/native/sun/windows/awt_Window.h
+++ b/jdk/src/windows/native/sun/windows/awt_Window.h
@@ -248,7 +248,6 @@
     static int ms_instanceCounter;
     static HHOOK ms_hCBTFilter;
     static LRESULT CALLBACK CBTFilter(int nCode, WPARAM wParam, LPARAM lParam);
-    static HWND sm_retainingHierarchyZOrderInShow; // a referred window in the process of show
     static BOOL sm_resizing;        /* in the middle of a resizing operation */
 
     RECT m_insets;          /* a cache of the insets being used */
diff --git a/jdk/test/com/sun/awt/Translucency/TranslucentJAppletTest/TranslucentJAppletTest.java b/jdk/test/com/sun/awt/Translucency/TranslucentJAppletTest/TranslucentJAppletTest.java
deleted file mode 100644
index 08cbe406..0000000
--- a/jdk/test/com/sun/awt/Translucency/TranslucentJAppletTest/TranslucentJAppletTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * @test %I% %E%
- * @bug 6683728
- * @summary Tests that a JApplet in a translucent JFrame works properly
- * @author Kenneth.Russell@sun.com: area=Graphics
- * @compile -XDignore.symbol.file=true TranslucentJAppletTest.java
- * @run main/manual/othervm TranslucentJAppletTest
- */
-
-import java.awt.*;
-import java.awt.image.*;
-
-import javax.swing.*;
-
-public class TranslucentJAppletTest {
-
-    private static JFrame frame;
-    private static volatile boolean paintComponentCalled = false;
-
-    private static void initAndShowGUI() {
-        frame = new JFrame();
-        JApplet applet = new JApplet();
-        JPanel panel = new JPanel() {
-            protected void paintComponent(Graphics g) {
-                paintComponentCalled = true;
-                g.setColor(Color.RED);
-                g.fillOval(0, 0, getWidth(), getHeight());
-            }
-        };
-        panel.setDoubleBuffered(false);
-        panel.setOpaque(false);
-        applet.add(panel);
-        frame.add(applet);
-        frame.setBounds(100, 100, 200, 200);
-        frame.setUndecorated(true);
-        com.sun.awt.AWTUtilities.setWindowOpaque(frame, false);
-        frame.setVisible(true);
-    }
-
-    public static void main(String[] args)
-        throws Exception
-    {
-        sun.awt.SunToolkit tk = (sun.awt.SunToolkit)Toolkit.getDefaultToolkit();
-
-        Robot r = new Robot();
-        Color color1 = r.getPixelColor(100, 100); // (0, 0) in frame coordinates
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                initAndShowGUI();
-            }
-        });
-        tk.realSync();
-
-        if (!paintComponentCalled) {
-            throw new RuntimeException("Test FAILED: panel's paintComponent() method is not called");
-        }
-
-        Color newColor1 = r.getPixelColor(100, 100);
-        // unfortunately, robot.getPixelColor() doesn't work for some unknown reason
-        // Color newColor2 = r.getPixelColor(200, 200);
-        BufferedImage bim = r.createScreenCapture(new Rectangle(200, 200, 1, 1));
-        Color newColor2 = new Color(bim.getRGB(0, 0));
-
-        // Frame must be transparent at (100, 100) in screen coords
-        if (!color1.equals(newColor1)) {
-            System.err.println("color1 = " + color1);
-            System.err.println("newColor1 = " + newColor1);
-            throw new RuntimeException("Test FAILED: frame pixel at (0, 0) is not transparent");
-        }
-
-        // Frame must be RED at (200, 200) in screen coords
-        if (!newColor2.equals(Color.RED)) {
-            System.err.println("newColor2 = " + newColor2);
-            throw new RuntimeException("Test FAILED: frame pixel at (100, 100) is not red (transparent?)");
-        }
-
-        System.out.println("Test PASSED");
-    }
-}
diff --git a/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TSFrame.java b/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TSFrame.java
deleted file mode 100644
index 1e9cf74..0000000
--- a/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TSFrame.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-import com.sun.awt.AWTUtilities;
-import static com.sun.awt.AWTUtilities.Translucency.*;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Graphics;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsEnvironment;
-import java.awt.RenderingHints;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.Canvas;
-import java.awt.Component;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Paint;
-import java.util.Random;
-import java.awt.geom.Ellipse2D;
-import javax.swing.JApplet;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-
-public class TSFrame {
-
-    static volatile boolean done = false;
-
-    static final boolean useSwing = System.getProperty("useswing") != null;
-    static final boolean useShape = System.getProperty("useshape") != null;
-    static final boolean useTransl = System.getProperty("usetransl") != null;
-    static final boolean useNonOpaque = System.getProperty("usenonop") != null;
-
-    static final Random rnd = new Random();
-    private static void render(Graphics g, int w, int h, boolean useNonOpaque) {
-        if (useNonOpaque) {
-            Graphics2D g2d = (Graphics2D)g;
-            GradientPaint p =
-                new GradientPaint(0.0f, 0.0f,
-                                  new Color(rnd.nextInt(0xffffff)),
-                                  w, h,
-                                  new Color(rnd.nextInt(0xff),
-                                            rnd.nextInt(0xff),
-                                            rnd.nextInt(0xff), 0),
-                                  true);
-            g2d.setPaint(p);
-            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-                                 RenderingHints.VALUE_ANTIALIAS_ON);
-            g2d.fillOval(0, 0, w, h);
-        } else {
-            g.setColor(new Color(rnd.nextInt(0xffffff)));
-            g.fillRect(0, 0, w, h);
-        }
-    }
-
-    private static class MyCanvas extends Canvas {
-        @Override
-        public void paint(Graphics g) {
-            render(g, getWidth(), getHeight(), false);
-        }
-        @Override
-        public Dimension getPreferredSize() {
-            return new Dimension(200, 100);
-        }
-    }
-    private static class NonOpaqueJFrame extends JFrame {
-        NonOpaqueJFrame(GraphicsConfiguration gc) {
-            super("NonOpaque Swing JFrame", gc);
-            JPanel p = new JPanel() {
-                public void paintComponent(Graphics g) {
-                    super.paintComponent(g);
-                    render(g, getWidth(), getHeight(), true);
-                    g.setColor(Color.red);
-                    g.drawString("Non-Opaque Swing JFrame", 10, 15);
-                }
-            };
-            p.setDoubleBuffered(false);
-            p.setOpaque(false);
-            add(p);
-            setUndecorated(true);
-        }
-    }
-    private static class NonOpaqueJAppletFrame extends JFrame {
-        JPanel p;
-        NonOpaqueJAppletFrame(GraphicsConfiguration gc) {
-            super("NonOpaque Swing JAppletFrame", gc);
-            JApplet ja = new JApplet() {
-                public void paint(Graphics g) {
-                    super.paint(g);
-                    System.err.println("JAppletFrame paint called");
-                }
-            };
-            p = new JPanel() {
-                public void paintComponent(Graphics g) {
-                    super.paintComponent(g);
-                    render(g, getWidth(), getHeight(), true);
-                    g.setColor(Color.red);
-                    g.drawString("Non-Opaque Swing JFrame", 10, 15);
-                }
-            };
-            p.setDoubleBuffered(false);
-            p.setOpaque(false);
-            ja.add(p);
-            add(ja);
-            setUndecorated(true);
-        }
-    }
-    private static class NonOpaqueFrame extends Frame {
-        NonOpaqueFrame(GraphicsConfiguration gc) {
-            super("NonOpaque AWT Frame", gc);
-            // uncomment to test with hw child
-//            setLayout(null);
-//            Component c = new Panel() {
-//                public void paint(Graphics g) {
-//                    g.setColor(new Color(1.0f, 1.0f, 1.0f, 0.5f));
-//                    g.fillRect(0, 0, getWidth(), getHeight());
-//                }
-//            };
-//            c.setSize(100, 100);
-//            c.setBackground(Color.red);
-//            c.setForeground(Color.red);
-//            add(c);
-//            c.setLocation(130, 130);
-        }
-        @Override
-        public void paint(Graphics g) {
-            render(g, getWidth(), getHeight(), true);
-            g.setColor(Color.red);
-            g.drawString("Non-Opaque AWT Frame", 10, 15);
-        }
-    }
-
-    private static class MyJPanel extends JPanel {
-        @Override
-        public void paintComponent(Graphics g) {
-            render(g, getWidth(), getHeight(), false);
-        }
-    }
-
-    public static Frame createGui(GraphicsConfiguration gc,
-                                  final boolean useSwing,
-                                  final boolean useShape,
-                                  final boolean useTransl,
-                                  final boolean useNonOpaque,
-                                  final float factor)
-    {
-        Frame frame;
-        done = false;
-
-        if (gc == null) {
-            gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
-                    getDefaultScreenDevice().getDefaultConfiguration();
-        }
-
-        if (useNonOpaque) {
-            if (useSwing) {
-                frame = new NonOpaqueJFrame(gc);
-//                frame = new NonOpaqueJAppletFrame(gc);
-            } else {
-                frame = new NonOpaqueFrame(gc);
-            }
-            animateComponent(frame);
-        } else if (useSwing) {
-            frame = new JFrame("Swing Frame", gc);
-            JComponent p = new JButton("Swing!");
-            p.setPreferredSize(new Dimension(200, 100));
-            frame.add("North", p);
-            p = new MyJPanel();
-            animateComponent(p);
-            frame.add("Center", p);
-        } else {
-            frame = new Frame("AWT Frame", gc) {
-                public void paint(Graphics g) {
-                    g.setColor(Color.red);
-                    g.fillRect(0, 0, 100, 100);
-                }
-            };
-            frame.setLayout(new BorderLayout());
-            Canvas c = new MyCanvas();
-            frame.add("North", c);
-            animateComponent(c);
-            c = new MyCanvas();
-            frame.add("Center", c);
-            animateComponent(c);
-            c = new MyCanvas();
-            frame.add("South", c);
-            animateComponent(c);
-        }
-        final Frame finalFrame = frame;
-        frame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent e) {
-                finalFrame.dispose();
-                done = true;
-            }
-        });
-        frame.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                finalFrame.dispose();
-                done = true;
-            }
-        });
-        frame.setPreferredSize(new Dimension(800, 600));
-
-        if (useShape) {
-            frame.setUndecorated(true);
-        }
-
-        frame.setLocation(450, 10);
-        frame.pack();
-
-        if (useShape) {
-            if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSPARENT)) {
-                System.out.println("applying PERPIXEL_TRANSPARENT");
-                AWTUtilities.setWindowShape(frame,
-                    new Ellipse2D.Double(0, 0, frame.getWidth(),
-                                               frame.getHeight()/3));
-                frame.setTitle("PERPIXEL_TRANSPARENT");
-            } else {
-                System.out.println("Passed: PERPIXEL_TRANSPARENT unsupported");
-            }
-        }
-        if (useTransl) {
-            if (AWTUtilities.isTranslucencySupported(TRANSLUCENT)) {
-                System.out.println("applying TRANSLUCENT");
-                AWTUtilities.setWindowOpacity(frame, factor);
-                frame.setTitle("TRANSLUCENT");
-            } else {
-                System.out.println("Passed: TRANSLUCENT unsupported");
-            }
-        }
-        if (useNonOpaque) {
-            if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSLUCENT) &&
-                AWTUtilities.isTranslucencyCapable(gc))
-            {
-                System.out.println("applying PERPIXEL_TRANSLUCENT");
-                AWTUtilities.setWindowOpaque(frame, false);
-                frame.setTitle("PERPIXEL_TRANSLUCENT");
-            } else {
-                System.out.println("Passed: PERPIXEL_TRANSLUCENT unsupported");
-            }
-        }
-        frame.setVisible(true);
-        return frame;
-    }
-
-    public static void stopThreads() {
-        done = true;
-    }
-
-    private static void animateComponent(final Component comp) {
-        Thread t = new Thread(new Runnable() {
-            public void run() {
-                do {
-                    try {
-                        Thread.sleep(50);
-                    } catch (InterruptedException ex) {}
-                    comp.repaint();
-                } while (!done);
-            }
-        });
-        t.start();
-    }
-
-    public static void main(String[] args) throws Exception {
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                TSFrame.createGui(null, useSwing,
-                                  useShape,
-                                  useTransl,
-                                  useNonOpaque,
-                                  0.7f);
-            }
-        });
-    }
-}
diff --git a/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java b/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java
deleted file mode 100644
index edb58ff..0000000
--- a/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * @test %I% %E%
- * @bug 6655001 6670649 6687141
- * @summary Tests that hw acceleration doesn't affect translucent/shaped windows
- * @author Dmitri.Trembovetski@sun.com: area=Graphics
- * @compile -XDignore.symbol.file=true TranslucentShapedFrameTest.java
- * @compile -XDignore.symbol.file=true TSFrame.java
- * @run main/manual/othervm TranslucentShapedFrameTest
- * @run main/manual/othervm -Dsun.java2d.noddraw=true TranslucentShapedFrameTest
- * @run main/manual/othervm -Dsun.java2d.opengl=True TranslucentShapedFrameTest
- */
-import com.sun.awt.AWTUtilities;
-import static com.sun.awt.AWTUtilities.Translucency.*;
-import java.awt.Frame;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.Shape;
-import java.awt.geom.Ellipse2D;
-import java.util.concurrent.CountDownLatch;
-import javax.swing.JSlider;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-
-public class TranslucentShapedFrameTest extends javax.swing.JFrame {
-    Frame testFrame;
-    static CountDownLatch done;
-    static volatile boolean failed = false;
-    GraphicsConfiguration gcToUse = null;
-
-    /**
-     * Creates new form TranslucentShapedFrameTest
-     */
-    public TranslucentShapedFrameTest() {
-        // not necessary, but we just look nicer
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception ex) {}
-
-        initComponents();
-        checkEffects();
-
-        SwingUtilities.updateComponentTreeUI(this);
-    }
-
-    /** This method is called from within the constructor to
-     * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
-     */
-    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
-    private void initComponents() {
-        createDisposeGrp = new javax.swing.ButtonGroup();
-        jLabel1 = new javax.swing.JLabel();
-        transparencySld = new javax.swing.JSlider();
-        shapedCb = new javax.swing.JCheckBox();
-        nonOpaqueChb = new javax.swing.JCheckBox();
-        jScrollPane1 = new javax.swing.JScrollPane();
-        jTextArea1 = new javax.swing.JTextArea();
-        jLabel2 = new javax.swing.JLabel();
-        passedBtn = new javax.swing.JButton();
-        failedBtn = new javax.swing.JButton();
-        createFrameBtn = new javax.swing.JToggleButton();
-        disposeFrameBtn = new javax.swing.JToggleButton();
-        useSwingCb = new javax.swing.JCheckBox();
-
-        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
-        setTitle("TranslucentShapedFrameTest");
-        jLabel1.setText("Frame Opacity:");
-
-        transparencySld.setMajorTickSpacing(10);
-        transparencySld.setMinorTickSpacing(5);
-        transparencySld.setPaintLabels(true);
-        transparencySld.setPaintTicks(true);
-        transparencySld.setValue(100);
-        transparencySld.addChangeListener(new javax.swing.event.ChangeListener() {
-            public void stateChanged(javax.swing.event.ChangeEvent evt) {
-                transparencySldStateChanged(evt);
-            }
-        });
-
-        shapedCb.setText("Shaped Frame");
-        shapedCb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-        shapedCb.setMargin(new java.awt.Insets(0, 0, 0, 0));
-        shapedCb.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                shapedCbActionPerformed(evt);
-            }
-        });
-
-        nonOpaqueChb.setText("Non Opaque Frame");
-        nonOpaqueChb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-        nonOpaqueChb.setMargin(new java.awt.Insets(0, 0, 0, 0));
-        nonOpaqueChb.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                nonOpaqueChbActionPerformed(evt);
-            }
-        });
-
-        jTextArea1.setColumns(20);
-        jTextArea1.setRows(5);
-        jTextArea1.setText("Create translucent and/or shaped, or\nnon-opaque frame. Make sure it behaves\ncorrectly (no artifacts left on the screen\nwhen dragging - if dragging is possible).\nClick \"Passed\" if the test behaves correctly,\n\"Falied\" otherwise.");
-        jScrollPane1.setViewportView(jTextArea1);
-
-        jLabel2.setText("Instructions:");
-
-        passedBtn.setBackground(new java.awt.Color(129, 255, 100));
-        passedBtn.setText("Passed");
-        passedBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                passedBtnActionPerformed(evt);
-            }
-        });
-
-        failedBtn.setBackground(java.awt.Color.red);
-        failedBtn.setText("Failed");
-        failedBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                failedBtnActionPerformed(evt);
-            }
-        });
-
-        createDisposeGrp.add(createFrameBtn);
-        createFrameBtn.setText("Create Frame");
-        createFrameBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                createFrameBtnActionPerformed(evt);
-            }
-        });
-
-        createDisposeGrp.add(disposeFrameBtn);
-        disposeFrameBtn.setSelected(true);
-        disposeFrameBtn.setText("Dispose Frame");
-        disposeFrameBtn.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                disposeFrameBtnActionPerformed(evt);
-            }
-        });
-
-        useSwingCb.setText("Use JFrame");
-        useSwingCb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-        useSwingCb.setMargin(new java.awt.Insets(0, 0, 0, 0));
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
-        getContentPane().setLayout(layout);
-        layout.setHorizontalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(transparencySld, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
-                        .addContainerGap())
-                    .addComponent(jLabel1)
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(shapedCb)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(nonOpaqueChb)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(useSwingCb)
-                        .addContainerGap(102, Short.MAX_VALUE))
-                    .addGroup(layout.createSequentialGroup()
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addGroup(layout.createSequentialGroup()
-                                .addComponent(jLabel2)
-                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 314, javax.swing.GroupLayout.PREFERRED_SIZE))
-                            .addGroup(layout.createSequentialGroup()
-                                .addComponent(passedBtn)
-                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                                .addComponent(failedBtn)
-                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
-                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
-                            .addGroup(layout.createSequentialGroup()
-                                .addComponent(createFrameBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
-                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                                .addComponent(disposeFrameBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))
-                        .addContainerGap())))
-        );
-        layout.setVerticalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addContainerGap()
-                .addComponent(jLabel1)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(transparencySld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(shapedCb)
-                    .addComponent(nonOpaqueChb)
-                    .addComponent(useSwingCb))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(disposeFrameBtn)
-                    .addComponent(createFrameBtn))
-                .addGap(17, 17, 17)
-                .addComponent(jLabel2)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(passedBtn)
-                    .addComponent(failedBtn))
-                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-        );
-        pack();
-    }// </editor-fold>//GEN-END:initComponents
-
-    private void nonOpaqueChbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonOpaqueChbActionPerformed
-        if (testFrame != null) {
-            // REMIND: this path in the test doesn't work well (test bug)
-//            AWTUtilities.setWindowOpaque(testFrame, !nonOpaqueChb.isSelected());
-        }
-    }//GEN-LAST:event_nonOpaqueChbActionPerformed
-
-    private void shapedCbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shapedCbActionPerformed
-        if (testFrame != null) {
-            Shape s = null;
-            if (shapedCb.isSelected()) {
-                s = new Ellipse2D.Double(0, 0,
-                                         testFrame.getWidth(),
-                                         testFrame.getHeight());
-            }
-            AWTUtilities.setWindowShape(testFrame, s);
-        }
-    }//GEN-LAST:event_shapedCbActionPerformed
-
-    private void transparencySldStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_transparencySldStateChanged
-        JSlider source = (JSlider)evt.getSource();
-            int transl = transparencySld.getValue();
-            if (testFrame != null) {
-                AWTUtilities.setWindowOpacity(testFrame, (float)transl/100f);
-            }
-    }//GEN-LAST:event_transparencySldStateChanged
-
-    private void failedBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_failedBtnActionPerformed
-        disposeFrameBtnActionPerformed(evt);
-        dispose();
-        failed = true;
-        done.countDown();
-    }//GEN-LAST:event_failedBtnActionPerformed
-
-    private void disposeFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_disposeFrameBtnActionPerformed
-        TSFrame.stopThreads();
-        if (testFrame != null) {
-            testFrame.dispose();
-            testFrame = null;
-        }
-    }//GEN-LAST:event_disposeFrameBtnActionPerformed
-
-    private void createFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createFrameBtnActionPerformed
-        disposeFrameBtnActionPerformed(evt);
-        int transl = transparencySld.getValue();
-        testFrame = TSFrame.createGui(gcToUse,
-                useSwingCb.isSelected(), shapedCb.isSelected(),
-                (transl < 100), nonOpaqueChb.isSelected(),
-                (float)transl/100f);
-    }//GEN-LAST:event_createFrameBtnActionPerformed
-
-    private void passedBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passedBtnActionPerformed
-        disposeFrameBtnActionPerformed(evt);
-        dispose();
-        done.countDown();
-    }//GEN-LAST:event_passedBtnActionPerformed
-
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String args[]) {
-        done = new CountDownLatch(1);
-        java.awt.EventQueue.invokeLater(new Runnable() {
-            public void run() {
-                new TranslucentShapedFrameTest().setVisible(true);
-            }
-        });
-        try {
-            done.await();
-        } catch (InterruptedException ex) {}
-        if (failed) {
-            throw new RuntimeException("Test FAILED");
-        }
-        System.out.println("Test PASSED");
-    }
-
-    private void checkEffects() {
-        if (!AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSPARENT)) {
-            shapedCb.setEnabled(false);
-        }
-
-        if (!AWTUtilities.isTranslucencySupported(TRANSLUCENT)) {
-            transparencySld.setEnabled(false);
-        }
-
-        GraphicsConfiguration gc = null;
-        if (AWTUtilities.isTranslucencySupported(PERPIXEL_TRANSLUCENT)) {
-            gc = findGraphicsConfig();
-            if (gc == null) {
-                nonOpaqueChb.setEnabled(false);
-            }
-        }
-
-        gcToUse = gc;
-    }
-
-    private GraphicsConfiguration findGraphicsConfig() {
-        GraphicsDevice gd =
-            GraphicsEnvironment.getLocalGraphicsEnvironment().
-                getDefaultScreenDevice();
-        GraphicsConfiguration gcs[] = gd.getConfigurations();
-        for (GraphicsConfiguration gc : gcs) {
-            if (AWTUtilities.isTranslucencyCapable(gc)) {
-                return gc;
-            }
-        }
-        return null;
-    }
-
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.ButtonGroup createDisposeGrp;
-    private javax.swing.JToggleButton createFrameBtn;
-    private javax.swing.JToggleButton disposeFrameBtn;
-    private javax.swing.JButton failedBtn;
-    private javax.swing.JLabel jLabel1;
-    private javax.swing.JLabel jLabel2;
-    private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JTextArea jTextArea1;
-    private javax.swing.JCheckBox nonOpaqueChb;
-    private javax.swing.JButton passedBtn;
-    private javax.swing.JCheckBox shapedCb;
-    private javax.swing.JSlider transparencySld;
-    private javax.swing.JCheckBox useSwingCb;
-    // End of variables declaration//GEN-END:variables
-
-}
diff --git a/jdk/test/java/awt/FontClass/CreateFont/A.ttf b/jdk/test/java/awt/FontClass/CreateFont/A.ttf
new file mode 100644
index 0000000..f80f5c3
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/A.ttf
Binary files differ
diff --git a/jdk/test/java/awt/FontClass/CreateFont/BigFont.java b/jdk/test/java/awt/FontClass/CreateFont/BigFont.java
new file mode 100644
index 0000000..c148024
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/BigFont.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.io.*;
+import java.net.*;
+
+public class BigFont extends Applet {
+
+   static private class SizedInputStream extends InputStream {
+
+       int size;
+       int cnt = 0;
+
+       SizedInputStream(int size) {
+           this.size = size;
+       }
+
+       public int read() {
+           if (cnt < size) {
+              cnt++;
+              return 0;
+           } else {
+              return -1;
+           }
+       }
+
+       public int getCurrentSize() {
+           return cnt;
+       }
+   }
+
+    String id;
+    String fileName;
+
+    public void init() {
+        id = getParameter("number");
+        fileName = getParameter("font");
+
+        System.out.println("Applet " + id + " "+
+                           Thread.currentThread().getThreadGroup());
+        // Larger than size for a single font.
+        int fontSize = 64 * 1000 * 1000;
+        SizedInputStream sis = new SizedInputStream(fontSize);
+        try {
+             Font font = Font.createFont(Font.TRUETYPE_FONT, sis);
+        } catch (Throwable t) {
+            if (t instanceof FontFormatException ||
+                fontSize <= sis.getCurrentSize())
+            {
+                System.out.println(sis.getCurrentSize());
+                System.out.println(t);
+                throw new RuntimeException("Allowed file to be too large.");
+            }
+        }
+        // The following part of the test was verified manually but
+        // is impractical to enable  because it requires a fairly large
+        // valid font to be part of the test, and we can't easily include
+        // that, nor dependably reference one from the applet environment.
+        /*
+        if (fileName == null) {
+            return;
+        }
+        int size = getFileSize(fileName);
+        if (size == 0) {
+            return;
+        }
+        int fontCnt = 1000 * 1000 * 1000 / size;
+        loadMany(size, fontCnt, fileName);
+        System.gc(); System.gc();
+        fontCnt = fontCnt / 2;
+        System.out.println("Applet " + id + " load more.");
+        loadMany(size, fontCnt, fileName);
+        */
+        System.out.println("Applet " + id + " finished.");
+    }
+
+    int getFileSize(String fileName) {
+        try {
+            URL url = new URL(getCodeBase(), fileName);
+            InputStream inStream = url.openStream();
+            BufferedInputStream fontStream = new BufferedInputStream(inStream);
+            int size = 0;
+            while (fontStream.read() != -1) {
+                size++;
+            }
+            fontStream.close();
+            return size;
+        } catch (IOException e) {
+            return 0;
+        }
+
+    }
+    void loadMany(int oneFont, int fontCnt, String fileName) {
+        System.out.println("fontcnt= " + fontCnt);
+        Font[] fonts = new Font[fontCnt];
+        int totalSize = 0;
+        boolean gotException = false;
+        for (int i=0; i<fontCnt; i++) {
+            try {
+                URL url = new URL(getCodeBase(), fileName);
+                InputStream inStream = url.openStream();
+                BufferedInputStream fontStream =
+                    new BufferedInputStream(inStream);
+                fonts[i] = Font.createFont(Font.TRUETYPE_FONT, fontStream);
+                totalSize += oneFont;
+                fontStream.close();
+            } catch (Throwable t) {
+                gotException = true;
+                System.out.println("Applet " + id + " " + t);
+            }
+        }
+        if (!gotException) {
+          throw new RuntimeException("No expected exception");
+        }
+    }
+}
+
diff --git a/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java b/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java
new file mode 100644
index 0000000..361b0b4
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2004-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+import java.awt.*;
+
+public class DeleteFont {
+
+    public static void main(String args[]) throws Exception {
+
+        String font = "A.ttf";
+        String sep = System.getProperty("file.separator");
+        String testSrc = System.getenv("TESTSRC");
+        if (testSrc != null) {
+            font = testSrc + sep + font;
+        }
+        System.out.println("Using font file: " + font);
+        FileInputStream fis = new FileInputStream(font);
+        Font f = Font.createFont(Font.TRUETYPE_FONT, fis);
+        f.toString();
+        f.deriveFont(Font.BOLD);
+        f.canDisplay('X');
+
+       InputStream in = new InputStream() {
+            public int read() {
+                throw new RuntimeException();
+            }
+        };
+        boolean gotException = false;
+        try {
+           Font.createFont(java.awt.Font.TRUETYPE_FONT, in);
+        } catch (IOException e) {
+            gotException = true;
+        }
+        if (!gotException) {
+            throw new RuntimeException("No expected IOException");
+        }
+        badRead(-2, Font.TRUETYPE_FONT);
+        badRead(8193, Font.TRUETYPE_FONT);
+
+        badRead(-2, Font.TYPE1_FONT);
+        badRead(8193, Font.TYPE1_FONT);
+
+        // Make sure GC has a chance to clean up before we exit.
+        System.gc(); System.gc();
+    }
+
+    static void badRead(final int retval, int fontType) {
+        int num = 2;
+        byte[] buff = new byte[16*8192]; // Multiple of 8192 is important.
+        for (int ct=0; ct<num; ++ct) {
+            try {
+                Font.createFont(
+                    fontType,
+                    new ByteArrayInputStream(buff) {
+                        @Override
+                        public int read(byte[] buff, int off, int len) {
+                            int read = super.read(buff, off, len);
+                            return read<0 ? retval : read;
+                        }
+                    }
+                );
+            } catch (Throwable exc) {
+                //exc.printStackTrace();
+            }
+        }
+    }
+}
+
diff --git a/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.sh b/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.sh
new file mode 100644
index 0000000..ba67380
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/DeleteFont.sh
@@ -0,0 +1,66 @@
+# Copyright 2004-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+
+# @test
+# @bug 6189812 6380357 6632886
+# @summary Verify that temporary font files are deleted on exit.
+
+if [ -z "${TESTSRC}" ]; then
+  echo "TESTSRC undefined: defaulting to ."
+  TESTSRC=.
+fi
+
+if [ -z "${TESTCLASSES}" ]; then
+  echo "TESTCLASSES undefined: defaulting to ."
+  TESTCLASSES=.
+fi
+
+if [ -z "${TESTJAVA}" ]; then
+  echo "TESTJAVA undefined: can't continue."
+  exit 1
+fi
+
+echo "TESTJAVA=${TESTJAVA}"
+echo "TESTSRC=${TESTSRC}"
+echo "TESTCLASSES=${TESTCLASSES}"
+cd ${TESTSRC}
+${TESTJAVA}/bin/javac -d ${TESTCLASSES} DeleteFont.java
+
+cd ${TESTCLASSES}
+
+numfiles0=`ls ${TESTCLASSES} | wc -l`
+${TESTJAVA}/bin/java -Djava.io.tmpdir=${TESTCLASSES} DeleteFont
+
+if [ $? -ne 0 ]
+    then
+      echo "Test fails: exception thrown!"
+      exit 1
+fi
+
+numfiles1=`ls ${TESTCLASSES} | wc -l`
+
+if [ $numfiles0 -ne $numfiles1 ]
+    then
+      echo "Test fails: tmp file exists!"
+      ls ${TESTCLASSES}
+      exit 1
+fi
+exit 0
diff --git a/jdk/test/java/awt/FontClass/CreateFont/bigfont.html b/jdk/test/java/awt/FontClass/CreateFont/bigfont.html
new file mode 100644
index 0000000..523c61f
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/bigfont.html
@@ -0,0 +1,48 @@
+<!--
+
+ Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+ This code is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 2 only, as
+ published by the Free Software Foundation.
+
+ This code 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
+ version 2 for more details (a copy is included in the LICENSE file that
+ accompanied this code).
+
+ You should have received a copy of the GNU General Public License version
+ 2 along with this work; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+
+  @test
+  @bug 6522586
+  @run applet bigfont.html
+  @summary Enforce limits on font creation
+
+-->
+
+<html>
+  <head>
+      <title>Test Font Creation Limits</title>
+  </head>
+  <body>
+<hr>
+<APPLET CODE = BigFont.class WIDTH = 100 HEIGHT = 100 >
+<param name="number" value="1">
+<param name="font" value="A.ttf">
+</APPLET>
+<APPLET CODE = BigFont.class WIDTH = 100 HEIGHT = 100>
+<param name="number" value="2">
+<param name="font" value="A.ttf">
+</APPLET>
+<hr>
+  </body>
+</html>
+
diff --git a/jdk/test/java/awt/FontClass/CreateFont/fileaccess/FontFile.java b/jdk/test/java/awt/FontClass/CreateFont/fileaccess/FontFile.java
new file mode 100644
index 0000000..4441974
--- /dev/null
+++ b/jdk/test/java/awt/FontClass/CreateFont/fileaccess/FontFile.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6652929
+ * @summary verify handling of File.getPath()
+ */
+
+import java.awt.*;
+import java.io.*;
+
+public class FontFile {
+    public static void main(String[] args) throws Exception {
+        String sep = System.getProperty("file.separator");
+        String fname = ".." + sep + "A.ttf";
+        String dir = System.getProperty("test.src");
+        if (dir != null) {
+            fname = dir + sep + fname;
+        }
+        final String name = fname;
+        System.out.println("Will try to access " + name);
+        if (!(new File(name)).canRead()) {
+           System.out.println("File not available : can't run test");
+           return;
+        }
+        System.out.println("File is available. Verify no access under SM");
+
+        System.setSecurityManager(new SecurityManager());
+
+
+        // Check cannot read file.
+        try {
+            new FileInputStream(name);
+            throw new Error("Something wrong with test environment");
+        } catch (SecurityException exc) {
+            // Good.
+        }
+
+        try {
+            Font font = Font.createFont(Font.TRUETYPE_FONT,
+            new File("nosuchfile") {
+                    private boolean read;
+                    @Override public String getPath() {
+                        if (read) {
+                            return name;
+                        } else {
+                            read = true;
+                            return "somefile";
+                        }
+                    }
+                    @Override public boolean canRead() {
+                        return true;
+                    }
+               }
+            );
+          System.err.println(font.getFontName());
+          throw new RuntimeException("No expected exception");
+        }  catch (IOException e) {
+          System.err.println("Test passed.");
+        }
+    }
+}
diff --git a/jdk/test/java/awt/Mixing/MixingInHwPanel.java b/jdk/test/java/awt/Mixing/MixingInHwPanel.java
new file mode 100644
index 0000000..bafe7be
--- /dev/null
+++ b/jdk/test/java/awt/Mixing/MixingInHwPanel.java
@@ -0,0 +1,428 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+  @test %W% %E%
+  @bug 6829858
+  @summary Mixing should work inside heavyweight containers
+  @author anthony.petrov@sun.com: area=awt.mixing
+  @library ../regtesthelpers
+  @build Util
+  @run main MixingInHwPanel
+*/
+
+
+/**
+ * MixingInHwPanel.java
+ *
+ * summary: Mixing should work inside heavyweight containers
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import test.java.awt.regtesthelpers.Util;
+
+
+
+public class MixingInHwPanel
+{
+    static volatile boolean failed = true;
+
+    private static void init()
+    {
+        //*** Create instructions for the user here ***
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test, simply wait until it is done.",
+            "The result (passed or failed) will be shown in the",
+            "message window below."
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        // Create the components: frame -> hwPanel -> JDesktopPane ->
+        //    -> JInternalFrame -> hwButton
+        Frame frame = new Frame("Mixing in a heavyweight Panel");
+        frame.setBounds(100, 100, 640, 480);
+
+        Panel hwPanel = new Panel(new BorderLayout());
+        frame.add(hwPanel);
+
+        JDesktopPane desktop = new JDesktopPane();
+        hwPanel.add(desktop);
+
+        JInternalFrame iFrame = new JInternalFrame("one",
+                true, true, true, true);
+        iFrame.setPreferredSize(new Dimension(150, 55));
+        iFrame.setBounds(600, 100, 150, 55);
+        iFrame.setVisible(true);
+        desktop.add(iFrame);
+
+        Button button = new Button("HW Button");
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                failed = false;
+            }
+        });
+        iFrame.add(button);
+
+        // Show the frame with the hwButton slightly hidden initially
+        frame.setVisible(true);
+
+        Robot robot = Util.createRobot();
+        robot.setAutoDelay(20);
+
+        Util.waitForIdle(robot);
+
+        // Now resize the frame so that the button is fully visible
+        frame.setBounds(100, 100, 800, 480);
+        frame.validate();
+
+        Util.waitForIdle(robot);
+
+        // And click the part of the button that has been previously hidden
+        Point bLoc = button.getLocationOnScreen();
+        robot.mouseMove(bLoc.x + button.getWidth() - 6, bLoc.y + button.getHeight() / 2);
+
+        Util.waitForIdle(robot);
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        Util.waitForIdle(robot);
+
+        // If the click happens (the shape is reapplied), the button's action
+        // listener will make failed == false.
+        if (failed) {
+            MixingInHwPanel.fail("The HW button did not receive the click.");
+        } else {
+            MixingInHwPanel.pass();
+        }
+    }//End  init()
+
+
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+
+    private static Thread mainThread = null;
+
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    public static void main( String args[] ) throws InterruptedException
+    {
+        mainThread = Thread.currentThread();
+        try
+        {
+            init();
+        }
+        catch( TestPassedException e )
+        {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try
+        {
+            Thread.sleep( sleepTime );
+            //Timed out, so fail the test
+            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
+        }
+        catch (InterruptedException e)
+        {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if( ! testGeneratedInterrupt ) throw e;
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if ( theTestPassed == false )
+            {
+                throw new RuntimeException( failureMessage );
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo( int seconds )
+    {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass()
+    {
+        Sysout.println( "The test passed." );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //first check if this is executing in main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    public static synchronized void fail()
+    {
+        //test writer didn't specify why test failed, so give generic
+        fail( "it just plain failed! :-)" );
+    }
+
+    public static synchronized void fail( String whyFailed )
+    {
+        Sysout.println( "The test failed: " + whyFailed );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //check if this called from main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException( whyFailed );
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+
+}// class MixingInHwPanel
+
+//This exception is used to exit from any level of call nesting
+// when it's determined that the test has passed, and immediately
+// end the test.
+class TestPassedException extends RuntimeException
+{
+}
+
+//*********** End Standard Test Machinery Section **********
+
+
+//************ Begin classes defined for the test ****************
+
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+ {
+   static int newVar = 0;
+
+   public void eventDispatched(AWTEvent e)
+    {
+      //Counting events to see if we get enough
+      eventCount++;
+
+      if( eventCount == 20 )
+       {
+         //got enough events, so pass
+
+         MixingInHwPanel.pass();
+       }
+      else if( tries == 20 )
+       {
+         //tried too many times without getting enough events so fail
+
+         MixingInHwPanel.fail();
+       }
+
+    }// eventDispatched()
+
+ }// NewClass class
+
+*/
+
+
+//************** End classes defined for the test *******************
+
+
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+        System.out.println(messageIn);
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
+
+
diff --git a/jdk/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java b/jdk/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java
new file mode 100644
index 0000000..6999505
--- /dev/null
+++ b/jdk/test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test %I% %E%
+ * @bug 6683728
+ * @summary Tests that a JApplet in a translucent JFrame works properly
+ * @author Kenneth.Russell@sun.com: area=Graphics
+ * @compile -XDignore.symbol.file=true TranslucentJAppletTest.java
+ * @run main/manual/othervm TranslucentJAppletTest
+ */
+
+import java.awt.*;
+import java.awt.image.*;
+
+import javax.swing.*;
+
+public class TranslucentJAppletTest {
+
+    private static JFrame frame;
+    private static volatile boolean paintComponentCalled = false;
+
+    private static void initAndShowGUI() {
+        frame = new JFrame();
+        JApplet applet = new JApplet();
+        JPanel panel = new JPanel() {
+            protected void paintComponent(Graphics g) {
+                paintComponentCalled = true;
+                g.setColor(Color.RED);
+                g.fillOval(0, 0, getWidth(), getHeight());
+            }
+        };
+        panel.setDoubleBuffered(false);
+        panel.setOpaque(false);
+        applet.add(panel);
+        frame.add(applet);
+        frame.setBounds(100, 100, 200, 200);
+        frame.setUndecorated(true);
+        frame.setBackground(new Color(0, 0, 0, 0));
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args)
+        throws Exception
+    {
+        sun.awt.SunToolkit tk = (sun.awt.SunToolkit)Toolkit.getDefaultToolkit();
+
+        Robot r = new Robot();
+        Color color1 = r.getPixelColor(100, 100); // (0, 0) in frame coordinates
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                initAndShowGUI();
+            }
+        });
+        tk.realSync();
+
+        if (!paintComponentCalled) {
+            throw new RuntimeException("Test FAILED: panel's paintComponent() method is not called");
+        }
+
+        Color newColor1 = r.getPixelColor(100, 100);
+        // unfortunately, robot.getPixelColor() doesn't work for some unknown reason
+        // Color newColor2 = r.getPixelColor(200, 200);
+        BufferedImage bim = r.createScreenCapture(new Rectangle(200, 200, 1, 1));
+        Color newColor2 = new Color(bim.getRGB(0, 0));
+
+        // Frame must be transparent at (100, 100) in screen coords
+        if (!color1.equals(newColor1)) {
+            System.err.println("color1 = " + color1);
+            System.err.println("newColor1 = " + newColor1);
+            throw new RuntimeException("Test FAILED: frame pixel at (0, 0) is not transparent");
+        }
+
+        // Frame must be RED at (200, 200) in screen coords
+        if (!newColor2.equals(Color.RED)) {
+            System.err.println("newColor2 = " + newColor2);
+            throw new RuntimeException("Test FAILED: frame pixel at (100, 100) is not red (transparent?)");
+        }
+
+        System.out.println("Test PASSED");
+    }
+}
diff --git a/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TSFrame.java b/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TSFrame.java
new file mode 100644
index 0000000..fd86d9a
--- /dev/null
+++ b/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TSFrame.java
@@ -0,0 +1,299 @@
+/*
+ * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsDevice.WindowTranslucency;
+import java.awt.GraphicsEnvironment;
+import java.awt.RenderingHints;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.Canvas;
+import java.awt.Component;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.util.Random;
+import java.awt.geom.Ellipse2D;
+import javax.swing.JApplet;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+public class TSFrame {
+
+    static volatile boolean done = false;
+
+    static final boolean useSwing = System.getProperty("useswing") != null;
+    static final boolean useShape = System.getProperty("useshape") != null;
+    static final boolean useTransl = System.getProperty("usetransl") != null;
+    static final boolean useNonOpaque = System.getProperty("usenonop") != null;
+
+    static final Random rnd = new Random();
+    private static void render(Graphics g, int w, int h, boolean useNonOpaque) {
+        if (useNonOpaque) {
+            Graphics2D g2d = (Graphics2D)g;
+            GradientPaint p =
+                new GradientPaint(0.0f, 0.0f,
+                                  new Color(rnd.nextInt(0xffffff)),
+                                  w, h,
+                                  new Color(rnd.nextInt(0xff),
+                                            rnd.nextInt(0xff),
+                                            rnd.nextInt(0xff), 0),
+                                  true);
+            g2d.setPaint(p);
+            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                                 RenderingHints.VALUE_ANTIALIAS_ON);
+            g2d.fillOval(0, 0, w, h);
+        } else {
+            g.setColor(new Color(rnd.nextInt(0xffffff)));
+            g.fillRect(0, 0, w, h);
+        }
+    }
+
+    private static class MyCanvas extends Canvas {
+        @Override
+        public void paint(Graphics g) {
+            render(g, getWidth(), getHeight(), false);
+        }
+        @Override
+        public Dimension getPreferredSize() {
+            return new Dimension(200, 100);
+        }
+    }
+    private static class NonOpaqueJFrame extends JFrame {
+        NonOpaqueJFrame() {
+            super("NonOpaque Swing JFrame");
+            JPanel p = new JPanel() {
+                public void paintComponent(Graphics g) {
+                    super.paintComponent(g);
+                    render(g, getWidth(), getHeight(), true);
+                    g.setColor(Color.red);
+                    g.drawString("Non-Opaque Swing JFrame", 10, 15);
+                }
+            };
+            p.setDoubleBuffered(false);
+            p.setOpaque(false);
+            add(p);
+            setUndecorated(true);
+        }
+    }
+    private static class NonOpaqueJAppletFrame extends JFrame {
+        JPanel p;
+        NonOpaqueJAppletFrame() {
+            super("NonOpaque Swing JAppletFrame");
+            JApplet ja = new JApplet() {
+                public void paint(Graphics g) {
+                    super.paint(g);
+                    System.err.println("JAppletFrame paint called");
+                }
+            };
+            p = new JPanel() {
+                public void paintComponent(Graphics g) {
+                    super.paintComponent(g);
+                    render(g, getWidth(), getHeight(), true);
+                    g.setColor(Color.red);
+                    g.drawString("Non-Opaque Swing JFrame", 10, 15);
+                }
+            };
+            p.setDoubleBuffered(false);
+            p.setOpaque(false);
+            ja.add(p);
+            add(ja);
+            setUndecorated(true);
+        }
+    }
+    private static class NonOpaqueFrame extends Frame {
+        NonOpaqueFrame() {
+            super("NonOpaque AWT Frame");
+            // uncomment to test with hw child
+//            setLayout(null);
+//            Component c = new Panel() {
+//                public void paint(Graphics g) {
+//                    g.setColor(new Color(1.0f, 1.0f, 1.0f, 0.5f));
+//                    g.fillRect(0, 0, getWidth(), getHeight());
+//                }
+//            };
+//            c.setSize(100, 100);
+//            c.setBackground(Color.red);
+//            c.setForeground(Color.red);
+//            add(c);
+//            c.setLocation(130, 130);
+        }
+        @Override
+        public void paint(Graphics g) {
+            render(g, getWidth(), getHeight(), true);
+            g.setColor(Color.red);
+            g.drawString("Non-Opaque AWT Frame", 10, 15);
+        }
+    }
+
+    private static class MyJPanel extends JPanel {
+        @Override
+        public void paintComponent(Graphics g) {
+            render(g, getWidth(), getHeight(), false);
+        }
+    }
+
+    public static Frame createGui(
+                                  final boolean useSwing,
+                                  final boolean useShape,
+                                  final boolean useTransl,
+                                  final boolean useNonOpaque,
+                                  final float factor)
+    {
+        Frame frame;
+        done = false;
+
+        if (useNonOpaque) {
+            if (useSwing) {
+                frame = new NonOpaqueJFrame();
+//                frame = new NonOpaqueJAppletFrame(gc);
+            } else {
+                frame = new NonOpaqueFrame();
+            }
+            animateComponent(frame);
+        } else if (useSwing) {
+            frame = new JFrame("Swing Frame");
+            JComponent p = new JButton("Swing!");
+            p.setPreferredSize(new Dimension(200, 100));
+            frame.add("North", p);
+            p = new MyJPanel();
+            animateComponent(p);
+            frame.add("Center", p);
+        } else {
+            frame = new Frame("AWT Frame") {
+                public void paint(Graphics g) {
+                    g.setColor(Color.red);
+                    g.fillRect(0, 0, 100, 100);
+                }
+            };
+            frame.setLayout(new BorderLayout());
+            Canvas c = new MyCanvas();
+            frame.add("North", c);
+            animateComponent(c);
+            c = new MyCanvas();
+            frame.add("Center", c);
+            animateComponent(c);
+            c = new MyCanvas();
+            frame.add("South", c);
+            animateComponent(c);
+        }
+        final Frame finalFrame = frame;
+        frame.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                finalFrame.dispose();
+                done = true;
+            }
+        });
+        frame.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                finalFrame.dispose();
+                done = true;
+            }
+        });
+        frame.setPreferredSize(new Dimension(800, 600));
+
+        if (useShape) {
+            frame.setUndecorated(true);
+        }
+
+        frame.setLocation(450, 10);
+        frame.pack();
+
+        GraphicsDevice gd = frame.getGraphicsConfiguration().getDevice();
+        if (useShape) {
+            if (gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSPARENT)) {
+                System.out.println("applying PERPIXEL_TRANSPARENT");
+                frame.setShape(new Ellipse2D.Double(0, 0, frame.getWidth(),
+                                                    frame.getHeight()/3));
+                frame.setTitle("PERPIXEL_TRANSPARENT");
+            } else {
+                System.out.println("Passed: PERPIXEL_TRANSPARENT unsupported");
+            }
+        }
+        if (useTransl) {
+            if (gd.isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {
+                System.out.println("applying TRANSLUCENT");
+                frame.setOpacity(factor);
+                frame.setTitle("TRANSLUCENT");
+            } else {
+                System.out.println("Passed: TRANSLUCENT unsupported");
+            }
+        }
+        if (useNonOpaque) {
+            if (gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
+                System.out.println("applying PERPIXEL_TRANSLUCENT");
+                frame.setBackground(new Color(0, 0, 0, 0));
+                frame.setTitle("PERPIXEL_TRANSLUCENT");
+            } else {
+                System.out.println("Passed: PERPIXEL_TRANSLUCENT unsupported");
+            }
+        }
+        frame.setVisible(true);
+        return frame;
+    }
+
+    public static void stopThreads() {
+        done = true;
+    }
+
+    private static void animateComponent(final Component comp) {
+        Thread t = new Thread(new Runnable() {
+            public void run() {
+                do {
+                    try {
+                        Thread.sleep(50);
+                    } catch (InterruptedException ex) {}
+                    comp.repaint();
+                } while (!done);
+            }
+        });
+        t.start();
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                TSFrame.createGui(useSwing,
+                                  useShape,
+                                  useTransl,
+                                  useNonOpaque,
+                                  0.7f);
+            }
+        });
+    }
+}
diff --git a/jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TranslucentShapedFrameTest.form b/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.form
similarity index 100%
rename from jdk/test/com/sun/awt/Translucency/TranslucentShapedFrameTest/TranslucentShapedFrameTest.form
rename to jdk/test/java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.form
diff --git a/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java b/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java
new file mode 100644
index 0000000..bf58ba2
--- /dev/null
+++ b/jdk/test/java/awt/Window/TranslucentShapedFrameTest/TranslucentShapedFrameTest.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test %I% %E%
+ * @bug 6655001 6670649 6687141
+ * @summary Tests that hw acceleration doesn't affect translucent/shaped windows
+ * @author Dmitri.Trembovetski@sun.com: area=Graphics
+ * @compile -XDignore.symbol.file=true TranslucentShapedFrameTest.java
+ * @compile -XDignore.symbol.file=true TSFrame.java
+ * @run main/manual/othervm TranslucentShapedFrameTest
+ * @run main/manual/othervm -Dsun.java2d.noddraw=true TranslucentShapedFrameTest
+ * @run main/manual/othervm -Dsun.java2d.opengl=True TranslucentShapedFrameTest
+ */
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsDevice.WindowTranslucency;
+import java.awt.GraphicsEnvironment;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JSlider;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+public class TranslucentShapedFrameTest extends javax.swing.JFrame {
+    Frame testFrame;
+    static CountDownLatch done;
+    static volatile boolean failed = false;
+    GraphicsConfiguration gcToUse = null;
+
+    /**
+     * Creates new form TranslucentShapedFrameTest
+     */
+    public TranslucentShapedFrameTest() {
+        // not necessary, but we just look nicer
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception ex) {}
+
+        initComponents();
+        checkEffects();
+
+        SwingUtilities.updateComponentTreeUI(this);
+    }
+
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+    private void initComponents() {
+        createDisposeGrp = new javax.swing.ButtonGroup();
+        jLabel1 = new javax.swing.JLabel();
+        transparencySld = new javax.swing.JSlider();
+        shapedCb = new javax.swing.JCheckBox();
+        nonOpaqueChb = new javax.swing.JCheckBox();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jTextArea1 = new javax.swing.JTextArea();
+        jLabel2 = new javax.swing.JLabel();
+        passedBtn = new javax.swing.JButton();
+        failedBtn = new javax.swing.JButton();
+        createFrameBtn = new javax.swing.JToggleButton();
+        disposeFrameBtn = new javax.swing.JToggleButton();
+        useSwingCb = new javax.swing.JCheckBox();
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+        setTitle("TranslucentShapedFrameTest");
+        jLabel1.setText("Frame Opacity:");
+
+        transparencySld.setMajorTickSpacing(10);
+        transparencySld.setMinorTickSpacing(5);
+        transparencySld.setPaintLabels(true);
+        transparencySld.setPaintTicks(true);
+        transparencySld.setValue(100);
+        transparencySld.addChangeListener(new javax.swing.event.ChangeListener() {
+            public void stateChanged(javax.swing.event.ChangeEvent evt) {
+                transparencySldStateChanged(evt);
+            }
+        });
+
+        shapedCb.setText("Shaped Frame");
+        shapedCb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        shapedCb.setMargin(new java.awt.Insets(0, 0, 0, 0));
+        shapedCb.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                shapedCbActionPerformed(evt);
+            }
+        });
+
+        nonOpaqueChb.setText("Non Opaque Frame");
+        nonOpaqueChb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        nonOpaqueChb.setMargin(new java.awt.Insets(0, 0, 0, 0));
+        nonOpaqueChb.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                nonOpaqueChbActionPerformed(evt);
+            }
+        });
+
+        jTextArea1.setColumns(20);
+        jTextArea1.setRows(5);
+        jTextArea1.setText("Create translucent and/or shaped, or\nnon-opaque frame. Make sure it behaves\ncorrectly (no artifacts left on the screen\nwhen dragging - if dragging is possible).\nClick \"Passed\" if the test behaves correctly,\n\"Falied\" otherwise.");
+        jScrollPane1.setViewportView(jTextArea1);
+
+        jLabel2.setText("Instructions:");
+
+        passedBtn.setBackground(new Color(129, 255, 100));
+        passedBtn.setText("Passed");
+        passedBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                passedBtnActionPerformed(evt);
+            }
+        });
+
+        failedBtn.setBackground(Color.red);
+        failedBtn.setText("Failed");
+        failedBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                failedBtnActionPerformed(evt);
+            }
+        });
+
+        createDisposeGrp.add(createFrameBtn);
+        createFrameBtn.setText("Create Frame");
+        createFrameBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                createFrameBtnActionPerformed(evt);
+            }
+        });
+
+        createDisposeGrp.add(disposeFrameBtn);
+        disposeFrameBtn.setSelected(true);
+        disposeFrameBtn.setText("Dispose Frame");
+        disposeFrameBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                disposeFrameBtnActionPerformed(evt);
+            }
+        });
+
+        useSwingCb.setText("Use JFrame");
+        useSwingCb.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
+        useSwingCb.setMargin(new java.awt.Insets(0, 0, 0, 0));
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(transparencySld, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
+                        .addContainerGap())
+                    .addComponent(jLabel1)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(shapedCb)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(nonOpaqueChb)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(useSwingCb)
+                        .addContainerGap(102, Short.MAX_VALUE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addGroup(layout.createSequentialGroup()
+                                .addComponent(jLabel2)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 314, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addGroup(layout.createSequentialGroup()
+                                .addComponent(passedBtn)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(failedBtn)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
+                            .addGroup(layout.createSequentialGroup()
+                                .addComponent(createFrameBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(disposeFrameBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))
+                        .addContainerGap())))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jLabel1)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(transparencySld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(shapedCb)
+                    .addComponent(nonOpaqueChb)
+                    .addComponent(useSwingCb))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(disposeFrameBtn)
+                    .addComponent(createFrameBtn))
+                .addGap(17, 17, 17)
+                .addComponent(jLabel2)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(passedBtn)
+                    .addComponent(failedBtn))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+        pack();
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void nonOpaqueChbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonOpaqueChbActionPerformed
+        if (testFrame != null) {
+            // REMIND: this path in the test doesn't work well (test bug)
+            testFrame.setBackground(new Color(0, 0, 0, nonOpaqueChb.isSelected() ? 0 : 255));
+        }
+    }//GEN-LAST:event_nonOpaqueChbActionPerformed
+
+    private void shapedCbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shapedCbActionPerformed
+        if (testFrame != null) {
+            Shape s = null;
+            if (shapedCb.isSelected()) {
+                s = new Ellipse2D.Double(0, 0,
+                                         testFrame.getWidth(),
+                                         testFrame.getHeight());
+            }
+            testFrame.setShape(s);
+        }
+    }//GEN-LAST:event_shapedCbActionPerformed
+
+    private void transparencySldStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_transparencySldStateChanged
+        JSlider source = (JSlider)evt.getSource();
+            int transl = transparencySld.getValue();
+            if (testFrame != null) {
+                testFrame.setOpacity((float)transl/100f);
+            }
+    }//GEN-LAST:event_transparencySldStateChanged
+
+    private void failedBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_failedBtnActionPerformed
+        disposeFrameBtnActionPerformed(evt);
+        dispose();
+        failed = true;
+        done.countDown();
+    }//GEN-LAST:event_failedBtnActionPerformed
+
+    private void disposeFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_disposeFrameBtnActionPerformed
+        TSFrame.stopThreads();
+        if (testFrame != null) {
+            testFrame.dispose();
+            testFrame = null;
+        }
+    }//GEN-LAST:event_disposeFrameBtnActionPerformed
+
+    private void createFrameBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createFrameBtnActionPerformed
+        disposeFrameBtnActionPerformed(evt);
+        int transl = transparencySld.getValue();
+        testFrame = TSFrame.createGui(
+                useSwingCb.isSelected(), shapedCb.isSelected(),
+                (transl < 100), nonOpaqueChb.isSelected(),
+                (float)transl/100f);
+    }//GEN-LAST:event_createFrameBtnActionPerformed
+
+    private void passedBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_passedBtnActionPerformed
+        disposeFrameBtnActionPerformed(evt);
+        dispose();
+        done.countDown();
+    }//GEN-LAST:event_passedBtnActionPerformed
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[]) {
+        done = new CountDownLatch(1);
+        java.awt.EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                new TranslucentShapedFrameTest().setVisible(true);
+            }
+        });
+        try {
+            done.await();
+        } catch (InterruptedException ex) {}
+        if (failed) {
+            throw new RuntimeException("Test FAILED");
+        }
+        System.out.println("Test PASSED");
+    }
+
+    private void checkEffects() {
+        GraphicsDevice gd = getGraphicsConfiguration().getDevice();
+        if (!gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSPARENT)) {
+            shapedCb.setEnabled(false);
+        }
+        if (!gd.isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {
+            transparencySld.setEnabled(false);
+        }
+        if (!gd.isWindowTranslucencySupported(WindowTranslucency.PERPIXEL_TRANSLUCENT)) {
+            nonOpaqueChb.setEnabled(false);
+        }
+    }
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.ButtonGroup createDisposeGrp;
+    private javax.swing.JToggleButton createFrameBtn;
+    private javax.swing.JToggleButton disposeFrameBtn;
+    private javax.swing.JButton failedBtn;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JTextArea jTextArea1;
+    private javax.swing.JCheckBox nonOpaqueChb;
+    private javax.swing.JButton passedBtn;
+    private javax.swing.JCheckBox shapedCb;
+    private javax.swing.JSlider transparencySld;
+    private javax.swing.JCheckBox useSwingCb;
+    // End of variables declaration//GEN-END:variables
+
+}
diff --git a/jdk/test/java/awt/image/ConvolveOp/EdgeNoOpCrash.java b/jdk/test/java/awt/image/ConvolveOp/EdgeNoOpCrash.java
new file mode 100644
index 0000000..5e1d2eb
--- /dev/null
+++ b/jdk/test/java/awt/image/ConvolveOp/EdgeNoOpCrash.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug     6726779
+ * @summary Test verifies that ConvolveOp with the EDGE_NO_OP edge condition
+ *          does not cause JVM crash if size of source raster elements is
+ *          greather than size of the destination raster element.
+ *
+ * @run     main EdgeNoOpCrash
+ */
+import java.awt.Point;
+import java.awt.image.ConvolveOp;
+import java.awt.image.DataBuffer;
+import java.awt.image.ImagingOpException;
+import java.awt.image.Kernel;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import java.util.Arrays;
+
+public class EdgeNoOpCrash {
+    private static final int w = 3000;
+    private static final int h = 200;
+
+    public static void main(String[] args) {
+        crashTest();
+    }
+
+    private static void crashTest() {
+        Raster src = createSrcRaster();
+        WritableRaster dst = createDstRaster();
+        ConvolveOp op = createConvolveOp(ConvolveOp.EDGE_NO_OP);
+        try {
+            op.filter(src, dst);
+        } catch (ImagingOpException e) {
+            /*
+             * The test pair of source and destination rasters
+             * may cause failure of the medialib convolution routine,
+             * so this exception is expected.
+             *
+             * The JVM crash is the only manifestation of this
+             * test failure.
+             */
+        }
+        System.out.println("Test PASSED.");
+    }
+
+    private static Raster createSrcRaster() {
+        WritableRaster r = Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT,
+                w, h, 4, new Point(0, 0));
+
+        return r;
+    }
+
+    private static WritableRaster createDstRaster() {
+        WritableRaster r = Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                w, h, 4, new Point(0, 0));
+
+        return r;
+    }
+
+    private static ConvolveOp createConvolveOp(int edgeHint) {
+        final int kw = 3;
+        final int kh = 3;
+        float[] kdata = new float[kw * kh];
+        float v = 1f / kdata.length;
+        Arrays.fill(kdata, v);
+
+        Kernel k = new Kernel(kw, kh, kdata);
+        ConvolveOp op = new ConvolveOp(k, edgeHint, null);
+
+        return op;
+    }
+}
\ No newline at end of file
diff --git a/jdk/test/java/lang/Class/getEnclosingConstructor/EnclosingConstructorTests.java b/jdk/test/java/lang/Class/getEnclosingConstructor/EnclosingConstructorTests.java
index fe963fb..3eae773 100644
--- a/jdk/test/java/lang/Class/getEnclosingConstructor/EnclosingConstructorTests.java
+++ b/jdk/test/java/lang/Class/getEnclosingConstructor/EnclosingConstructorTests.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4962341
+ * @bug 4962341 6832557
  * @summary Check getEnclosingMethod method
  * @author Joseph D. Darcy
  */
@@ -57,8 +57,8 @@
     }
 
 
-    static int examine(Class enclosedClass, String constructorSig) {
-        Constructor c = enclosedClass.getEnclosingConstructor();
+    static int examine(Class<?> enclosedClass, String constructorSig) {
+        Constructor<?> c = enclosedClass.getEnclosingConstructor();
         if (c == null && constructorSig == null)
             return 0;
 
diff --git a/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh b/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh
index cab081a..f5cd234 100644
--- a/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh
+++ b/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh
@@ -23,6 +23,7 @@
 
 # @test
 # @bug 5088398
+# @ignore until bug 6835233 dealt with
 # @summary Test parallel class loading by parallel transformers.
 # @author Daniel D. Daugherty as modified from the code of Daryl Puryear @ Wily
 #
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadStateTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadStateTest.java
index 13f841c..46436a8 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadStateTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadStateTest.java
@@ -23,7 +23,8 @@
 
 /*
  * @test
- * @bug     4967283
+ * @bug     4967283 5080203
+ * @ignore  Due to 5080203, cannot rely on this test always passing.
  * @summary Basic unit test of thread states returned by
  *          ThreadMXBean.getThreadInfo.getThreadState().
  *          It also tests lock information returned by ThreadInfo.
diff --git a/jdk/test/java/nio/Buffer/Basic-X.java b/jdk/test/java/nio/Buffer/Basic-X.java
index d4e1a27..6612771 100644
--- a/jdk/test/java/nio/Buffer/Basic-X.java
+++ b/jdk/test/java/nio/Buffer/Basic-X.java
@@ -365,8 +365,11 @@
 
         b.position(2);
         ck(b, b.charAt(1), 'd');
-        CharBuffer c = (CharBuffer)b.subSequence(1, 4);
-        ck(b, b.subSequence(1, 4).toString().equals("def"));
+        CharBuffer c = b.subSequence(1, 4);
+        ck(c, c.capacity(), b.capacity());
+        ck(c, c.position(), b.position()+1);
+        ck(c, c.limit(), b.position()+4);
+        ck(c, b.subSequence(1, 4).toString().equals("def"));
 
         // 4938424
         b.position(4);
@@ -722,6 +725,8 @@
         ck(b, start, b.position());
         ck(b, end, b.limit());
         ck(b, s.length(), b.capacity());
+        b.position(6);
+        ck(b, b.subSequence(0,3).toString().equals("ghi"));
 
         // The index, relative to the position, must be non-negative and
         // smaller than remaining().
diff --git a/jdk/test/java/nio/Buffer/Basic.java b/jdk/test/java/nio/Buffer/Basic.java
index c0c420f..b8ed89b 100644
--- a/jdk/test/java/nio/Buffer/Basic.java
+++ b/jdk/test/java/nio/Buffer/Basic.java
@@ -25,7 +25,7 @@
  * @summary Unit test for buffers
  * @bug 4413135 4414911 4416536 4416562 4418782 4471053 4472779 4490253 4523725
  *      4526177 4463011 4660660 4661219 4663521 4782970 4804304 4938424 6231529
- *      6221101 6234263 6535542 6591971 6593946
+ *      6221101 6234263 6535542 6591971 6593946 6795561
  * @author Mark Reinhold
  */
 
diff --git a/jdk/test/java/nio/Buffer/BasicByte.java b/jdk/test/java/nio/Buffer/BasicByte.java
index 0f5ac6f..7e259a1 100644
--- a/jdk/test/java/nio/Buffer/BasicByte.java
+++ b/jdk/test/java/nio/Buffer/BasicByte.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final byte [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/Buffer/BasicChar.java b/jdk/test/java/nio/Buffer/BasicChar.java
index 28eb49f..a0df9fc 100644
--- a/jdk/test/java/nio/Buffer/BasicChar.java
+++ b/jdk/test/java/nio/Buffer/BasicChar.java
@@ -365,8 +365,11 @@
 
         b.position(2);
         ck(b, b.charAt(1), 'd');
-        CharBuffer c = (CharBuffer)b.subSequence(1, 4);
-        ck(b, b.subSequence(1, 4).toString().equals("def"));
+        CharBuffer c = b.subSequence(1, 4);
+        ck(c, c.capacity(), b.capacity());
+        ck(c, c.position(), b.position()+1);
+        ck(c, c.limit(), b.position()+4);
+        ck(c, b.subSequence(1, 4).toString().equals("def"));
 
         // 4938424
         b.position(4);
@@ -722,6 +725,8 @@
         ck(b, start, b.position());
         ck(b, end, b.limit());
         ck(b, s.length(), b.capacity());
+        b.position(6);
+        ck(b, b.subSequence(0,3).toString().equals("ghi"));
 
         // The index, relative to the position, must be non-negative and
         // smaller than remaining().
diff --git a/jdk/test/java/nio/Buffer/BasicDouble.java b/jdk/test/java/nio/Buffer/BasicDouble.java
index b2a1be6..a627d0e 100644
--- a/jdk/test/java/nio/Buffer/BasicDouble.java
+++ b/jdk/test/java/nio/Buffer/BasicDouble.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final double [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/Buffer/BasicFloat.java b/jdk/test/java/nio/Buffer/BasicFloat.java
index b6b5ea0..730dcbe 100644
--- a/jdk/test/java/nio/Buffer/BasicFloat.java
+++ b/jdk/test/java/nio/Buffer/BasicFloat.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final float [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/Buffer/BasicInt.java b/jdk/test/java/nio/Buffer/BasicInt.java
index 938ada2..b20e4bb 100644
--- a/jdk/test/java/nio/Buffer/BasicInt.java
+++ b/jdk/test/java/nio/Buffer/BasicInt.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final int [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/Buffer/BasicLong.java b/jdk/test/java/nio/Buffer/BasicLong.java
index 17537a7..0d4c568 100644
--- a/jdk/test/java/nio/Buffer/BasicLong.java
+++ b/jdk/test/java/nio/Buffer/BasicLong.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final long [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/Buffer/BasicShort.java b/jdk/test/java/nio/Buffer/BasicShort.java
index dc9c7db..58e5a3e 100644
--- a/jdk/test/java/nio/Buffer/BasicShort.java
+++ b/jdk/test/java/nio/Buffer/BasicShort.java
@@ -375,6 +375,9 @@
 
 
 
+
+
+
         // Compact
 
         relPut(b);
@@ -786,6 +789,8 @@
 
 
 
+
+
     public static void test(final short [] ba) {
         int offset = 47;
         int length = 900;
diff --git a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
index 5ffb42c..1f37d4b 100644
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4607272
+ * @bug 4607272 6822643 6830721
  * @summary Unit test for AsynchronousFileChannel
  */
 
@@ -51,7 +51,6 @@
         // run tests
         testUsingCompletionHandlers(ch);
         testUsingWaitOnResult(ch);
-        testLocking(ch);
         testInterruptHandlerThread(ch);
 
         // close channel and invoke test that expects channel to be closed
@@ -59,6 +58,7 @@
         testClosedChannel(ch);
 
         // these tests open the file themselves
+        testLocking(blah.toPath());
         testCustomThreadPool(blah.toPath());
         testAsynchronousClose(blah.toPath());
         testCancel(blah.toPath());
@@ -160,47 +160,54 @@
     }
 
     // exercise lock methods
-    static void testLocking(AsynchronousFileChannel ch)
-        throws IOException
-    {
+    static void testLocking(Path file) throws IOException {
         System.out.println("testLocking");
 
-        // test 1 - acquire lock and check that tryLock throws
-        // OverlappingFileLockException
+        AsynchronousFileChannel ch = AsynchronousFileChannel
+            .open(file, READ, WRITE);
         FileLock fl;
         try {
-            fl = ch.lock().get();
-        } catch (ExecutionException x) {
-            throw new RuntimeException(x);
-        } catch (InterruptedException x) {
-            throw new RuntimeException("Should not be interrupted");
-        }
-        if (!fl.acquiredBy().equals(ch))
-            throw new RuntimeException("FileLock#acquiredBy returned incorrect channel");
-        try {
-            ch.tryLock();
-            throw new RuntimeException("OverlappingFileLockException expected");
-        } catch (OverlappingFileLockException x) {
-        }
-        fl.release();
+            // test 1 - acquire lock and check that tryLock throws
+            // OverlappingFileLockException
+            try {
+                fl = ch.lock().get();
+            } catch (ExecutionException x) {
+                throw new RuntimeException(x);
+            } catch (InterruptedException x) {
+                throw new RuntimeException("Should not be interrupted");
+            }
+            if (!fl.acquiredBy().equals(ch))
+                throw new RuntimeException("FileLock#acquiredBy returned incorrect channel");
+            try {
+                ch.tryLock();
+                throw new RuntimeException("OverlappingFileLockException expected");
+            } catch (OverlappingFileLockException x) {
+            }
+            fl.release();
 
-        // test 2 - acquire try and check that lock throws OverlappingFileLockException
-        fl = ch.tryLock();
-        if (fl == null)
-            throw new RuntimeException("Unable to acquire lock");
-        try {
-            ch.lock(null, new CompletionHandler<FileLock,Void> () {
-                public void completed(FileLock result, Void att) {
-                }
-                public void failed(Throwable exc, Void att) {
-                }
-                public void cancelled(Void att) {
-                }
-            });
-            throw new RuntimeException("OverlappingFileLockException expected");
-        } catch (OverlappingFileLockException x) {
+            // test 2 - acquire try and check that lock throws OverlappingFileLockException
+            fl = ch.tryLock();
+            if (fl == null)
+                throw new RuntimeException("Unable to acquire lock");
+            try {
+                ch.lock(null, new CompletionHandler<FileLock,Void> () {
+                    public void completed(FileLock result, Void att) {
+                    }
+                    public void failed(Throwable exc, Void att) {
+                    }
+                    public void cancelled(Void att) {
+                    }
+                });
+                throw new RuntimeException("OverlappingFileLockException expected");
+            } catch (OverlappingFileLockException x) {
+            }
+        } finally {
+            ch.close();
         }
-        fl.release();
+
+        // test 3 - channel is closed so FileLock should no longer be valid
+        if (fl.isValid())
+            throw new RuntimeException("FileLock expected to be invalid");
     }
 
     // interrupt should not close channel
@@ -424,10 +431,11 @@
                 throw new RuntimeException("isCancelled not consistent");
             try {
                 res.get();
-                if (!cancelled)
+                if (cancelled)
                     throw new RuntimeException("CancellationException expected");
             } catch (CancellationException x) {
-                // expected
+                if (!cancelled)
+                    throw new RuntimeException("CancellationException not expected");
             } catch (ExecutionException x) {
                 throw new RuntimeException(x);
             } catch (InterruptedException x) {
@@ -435,9 +443,11 @@
             }
             try {
                 res.get(1, TimeUnit.SECONDS);
-                throw new RuntimeException("CancellationException expected");
+                if (cancelled)
+                    throw new RuntimeException("CancellationException expected");
             } catch (CancellationException x) {
-                // expected
+                if (!cancelled)
+                    throw new RuntimeException("CancellationException not expected");
             } catch (ExecutionException x) {
                 throw new RuntimeException(x);
             } catch (TimeoutException x) {
diff --git a/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java
index 38c0f7d..f8b55cc 100644
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java
@@ -23,7 +23,7 @@
 
 
 /* @test
- * @bug 4607272
+ * @bug 4607272 6814948
  * @summary Unit test for AsynchronousFileChannel#lock method
  */
 
diff --git a/jdk/test/java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java b/jdk/test/java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java
new file mode 100644
index 0000000..c7ed16a
--- /dev/null
+++ b/jdk/test/java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+ * @bug 6543863
+ * @summary Try to cause a deadlock between (Asynchronous)FileChannel.close
+ *   and FileLock.release
+ */
+
+import java.io.*;
+import java.nio.file.Path;
+import static java.nio.file.StandardOpenOption.*;
+import java.nio.channels.*;
+import java.util.concurrent.*;
+
+public class ReleaseOnCloseDeadlock {
+    private static final int LOCK_COUNT = 1024;
+
+    public static void main(String[] args) throws IOException {
+        File blah = File.createTempFile("blah", null);
+        blah.deleteOnExit();
+        for (int i=0; i<100; i++) {
+            test(blah.toPath());
+        }
+    }
+
+    static void test(Path file) throws IOException {
+        FileLock[] locks = new FileLock[LOCK_COUNT];
+
+        FileChannel fc = FileChannel.open(file, READ, WRITE);
+        for (int i=0; i<LOCK_COUNT; i++) {
+            locks[i] = fc.lock(i, 1, true);
+        }
+        tryToDeadlock(fc, locks);
+
+        AsynchronousFileChannel ch = AsynchronousFileChannel.open(file, READ, WRITE);
+        for (int i=0; i<LOCK_COUNT; i++) {
+            try {
+                locks[i] = ch.lock(i, 1, true, null, null).get();
+            } catch (InterruptedException x) {
+                throw new RuntimeException(x);
+            } catch (ExecutionException x) {
+                throw new RuntimeException(x);
+            }
+        }
+        tryToDeadlock(ch, locks);
+    }
+
+    static void tryToDeadlock(final Channel channel, FileLock[] locks)
+        throws IOException
+    {
+        // start thread to close the file (and invalidate the locks)
+        Thread closer = new Thread(
+            new Runnable() {
+                public void run() {
+                    try {
+                        channel.close();
+                    } catch (IOException ignore) {
+                        ignore.printStackTrace();
+                    }
+                }});
+        closer.start();
+
+        // release the locks explicitly
+        for (int i=0; i<locks.length; i++) {
+            try {
+                locks[i].release();
+            } catch (ClosedChannelException ignore) { }
+        }
+
+        // we are done when closer has terminated
+        while (closer.isAlive()) {
+            try {
+                closer.join();
+            } catch (InterruptedException ignore) { }
+        }
+    }
+}
diff --git a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.java b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.java
index b5938d1..3ab2280 100644
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.java
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.java
@@ -56,7 +56,7 @@
                         e.printStackTrace();
                     }
                 }
-            }
+            };
 
         Thread thread1 = new Thread(readObjectRunnable, "Read Object");
         Thread thread2 = new Thread(xmlRunnable, "XML");
diff --git a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
index 750e2a7..169819f 100644
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
@@ -26,6 +26,7 @@
 
 # @test
 # @bug 6440846
+# @ignore until 6203816 is dealt with.
 # @summary make sure we do not deadlock between ExtClassLoader and AppClassLoader
 # @author Valerie Peng
 # @run shell/timeout=20 Deadlock2.sh
diff --git a/jdk/test/java/util/logging/LoggerSubclass.java b/jdk/test/java/util/logging/LoggerSubclass.java
new file mode 100644
index 0000000..ba18fa3
--- /dev/null
+++ b/jdk/test/java/util/logging/LoggerSubclass.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2009 Google, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6830220 6278014
+ * @summary Test Logger subclasses
+ */
+
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.LogRecord;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class LoggerSubclass {
+    void test(String[] args) {
+        final String name = "myLogger";
+        final String message = "myMessage";
+        final AtomicInteger getHandlerCount = new AtomicInteger(0);
+        final AtomicLong lastSequenceNumber = new AtomicLong(-1L);
+        final AtomicInteger lastThreadID = new AtomicInteger(-1);
+        final Logger logger = new Logger(name, null) {
+            public Handler[] getHandlers() {
+                getHandlerCount.getAndIncrement();
+                return super.getHandlers();
+            }};
+        equal(logger.getName(), name);
+        equal(logger.getResourceBundle(), null);
+        equal(logger.getFilter(), null);
+        equal(logger.getLevel(), null);
+        check(logger.isLoggable(Level.WARNING));
+        logger.addHandler(new Handler() {
+            public void close() {}
+            public void flush() {}
+            public void publish(LogRecord l) {
+                equal(l.getLoggerName(), name);
+                equal(l.getMessage(), message);
+                equal(l.getResourceBundle(), null);
+                equal(l.getSourceClassName(), "LoggerSubclass");
+                equal(l.getSourceMethodName(), "test");
+                equal(l.getThrown(), null);
+                equal(l.getLevel(), Level.WARNING);
+
+                if (lastSequenceNumber.get() != -1) {
+                    equal(lastSequenceNumber.get() + 1,
+                          l.getSequenceNumber());
+                    equal(lastThreadID.get(),
+                          l.getThreadID());
+                    equal((int) Thread.currentThread().getId(),
+                          l.getThreadID());
+                }
+                lastSequenceNumber.set(l.getSequenceNumber());
+                lastThreadID.set(l.getThreadID());
+            }});
+        for (int i = 1; i < 4; i++) {
+            logger.warning(message); // Should invoke getHandlers()
+            equal(i, getHandlerCount.get());
+        }
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    volatile int passed = 0, failed = 0;
+    void pass() {passed++;}
+    void fail() {failed++; Thread.dumpStack();}
+    void fail(String msg) {System.err.println(msg); fail();}
+    void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    void check(boolean cond) {if (cond) pass(); else fail();}
+    void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        try {new LoggerSubclass().instanceMain(args);}
+        catch (Throwable e) {throw e.getCause();}}
+    public void instanceMain(String[] args) throws Throwable {
+        try {test(args);} catch (Throwable t) {unexpected(t);}
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+}
diff --git a/jdk/test/java/util/logging/LoggingDeadlock2.java b/jdk/test/java/util/logging/LoggingDeadlock2.java
index 50de62a..cf8d67f 100644
--- a/jdk/test/java/util/logging/LoggingDeadlock2.java
+++ b/jdk/test/java/util/logging/LoggingDeadlock2.java
@@ -23,10 +23,10 @@
 
 /*
  * @test
- * @bug     6467152
- * @ignore until 6716076 is fixed
+ * @bug     6467152 6716076 6829503
+ * @ignore Until made more stable, see 6829636.
  * @summary deadlock occurs in LogManager initialization and JVM termination
- * @author  Serguei Spitsyn / Hittachi
+ * @author  Serguei Spitsyn / Hitachi / Martin Buchholz
  *
  * @build    LoggingDeadlock2
  * @run  main/timeout=15 LoggingDeadlock2
@@ -47,43 +47,195 @@
  * This is a regression test for this bug.
  */
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.logging.LogManager;
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
 
-public class LoggingDeadlock2 implements Runnable {
-    static final java.io.PrintStream out = System.out;
-    static Object lock = new Object();
-    static int c = 0;
-    public static void main(String arg[]) {
-        out.println("\nThis test checks that there is no deadlock.");
-        out.println("If not crashed or timed-out then it is passed.");
+public class LoggingDeadlock2 {
+
+    public static void realMain(String arg[]) throws Throwable {
         try {
-            new Thread(new LoggingDeadlock2()).start();
-            synchronized(lock) {
-                c++;
-                if (c == 2) lock.notify();
-                else lock.wait();
-            }
+            System.out.println(javaChildArgs);
+            ProcessBuilder pb = new ProcessBuilder(javaChildArgs);
+            ProcessResults r = run(pb.start());
+            equal(r.exitValue(), 99);
+            equal(r.out(), "");
+            equal(r.err(), "");
+        } catch (Throwable t) { unexpected(t); }
+    }
+
+    public static class JavaChild {
+        public static void main(String args[]) throws Throwable {
+            final CyclicBarrier startingGate = new CyclicBarrier(2);
+            final Throwable[] thrown = new Throwable[1];
+
+            // Some random variation, to help tickle races.
+            final Random rnd = new Random();
+            final boolean dojoin = rnd.nextBoolean();
+            final int JITTER = 1024;
+            final int iters1 = rnd.nextInt(JITTER);
+            final int iters2 = JITTER - iters1;
+            final AtomicInteger counter = new AtomicInteger(0);
+
+            Thread exiter = new Thread() {
+                public void run() {
+                    try {
+                        startingGate.await();
+                        for (int i = 0; i < iters1; i++)
+                            counter.getAndIncrement();
+                        System.exit(99);
+                    } catch (Throwable t) {
+                        t.printStackTrace();
+                        System.exit(86);
+                    }
+                }};
+            exiter.start();
+
+            startingGate.await();
+            for (int i = 0; i < iters2; i++)
+                counter.getAndIncrement();
+            // This may or may not result in a first call to
+            // Runtime.addShutdownHook after shutdown has already
+            // commenced.
             LogManager log = LogManager.getLogManager();
-            out.println("Test passed");
-        }
-        catch(Exception e) {
-            e.printStackTrace();
-            out.println("Test FAILED"); // Not expected
+
+            if (dojoin) {
+                exiter.join();
+                if (thrown[0] != null)
+                    throw new Error(thrown[0]);
+                check(counter.get() == JITTER);
+            }
         }
     }
 
-    public void run() {
-        try {
-            synchronized(lock) {
-                c++;
-                if (c == 2) lock.notify();
-                else lock.wait();
-            }
-            System.exit(1);
+    //----------------------------------------------------------------
+    // The rest of this test is copied from ProcessBuilder/Basic.java
+    //----------------------------------------------------------------
+    private static final String javaExe =
+        System.getProperty("java.home") +
+        File.separator + "bin" + File.separator + "java";
+
+    private static final String classpath =
+        System.getProperty("java.class.path");
+
+    private static final List<String> javaChildArgs =
+        Arrays.asList(new String[]
+            { javaExe, "-classpath", classpath,
+              "LoggingDeadlock2$JavaChild"});
+
+    private static class ProcessResults {
+        private final String out;
+        private final String err;
+        private final int exitValue;
+        private final Throwable throwable;
+
+        public ProcessResults(String out,
+                              String err,
+                              int exitValue,
+                              Throwable throwable) {
+            this.out = out;
+            this.err = err;
+            this.exitValue = exitValue;
+            this.throwable = throwable;
         }
-        catch(Exception e) {
-            e.printStackTrace();
-            out.println("Test FAILED"); // Not expected
+
+        public String out()          { return out; }
+        public String err()          { return err; }
+        public int exitValue()       { return exitValue; }
+        public Throwable throwable() { return throwable; }
+
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("<STDOUT>\n" + out() + "</STDOUT>\n")
+                .append("<STDERR>\n" + err() + "</STDERR>\n")
+                .append("exitValue = " + exitValue + "\n");
+            if (throwable != null)
+                sb.append(throwable.getStackTrace());
+            return sb.toString();
         }
     }
+
+    private static class StreamAccumulator extends Thread {
+        private final InputStream is;
+        private final StringBuilder sb = new StringBuilder();
+        private Throwable throwable = null;
+
+        public String result () throws Throwable {
+            if (throwable != null)
+                throw throwable;
+            return sb.toString();
+        }
+
+        StreamAccumulator (InputStream is) {
+            this.is = is;
+        }
+
+        public void run() {
+            try {
+                Reader r = new InputStreamReader(is);
+                char[] buf = new char[4096];
+                int n;
+                while ((n = r.read(buf)) > 0) {
+                    sb.append(buf,0,n);
+                }
+            } catch (Throwable t) {
+                throwable = t;
+            } finally {
+                try { is.close(); }
+                catch (Throwable t) { throwable = t; }
+            }
+        }
+    }
+
+    private static ProcessResults run(Process p) {
+        Throwable throwable = null;
+        int exitValue = -1;
+        String out = "";
+        String err = "";
+
+        StreamAccumulator outAccumulator =
+            new StreamAccumulator(p.getInputStream());
+        StreamAccumulator errAccumulator =
+            new StreamAccumulator(p.getErrorStream());
+
+        try {
+            outAccumulator.start();
+            errAccumulator.start();
+
+            exitValue = p.waitFor();
+
+            outAccumulator.join();
+            errAccumulator.join();
+
+            out = outAccumulator.result();
+            err = errAccumulator.result();
+        } catch (Throwable t) {
+            throwable = t;
+        }
+
+        return new ProcessResults(out, err, exitValue, throwable);
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    static volatile int passed = 0, failed = 0;
+    static void pass() {passed++;}
+    static void fail() {failed++; Thread.dumpStack();}
+    static void fail(String msg) {System.out.println(msg); fail();}
+    static void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    static void check(boolean cond) {if (cond) pass(); else fail();}
+    static void check(boolean cond, String m) {if (cond) pass(); else fail(m);}
+    static void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        try {realMain(args);} catch (Throwable t) {unexpected(t);}
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
 }
diff --git a/jdk/test/java/util/zip/ZipCoding.java b/jdk/test/java/util/zip/ZipCoding.java
new file mode 100644
index 0000000..baedc44
--- /dev/null
+++ b/jdk/test/java/util/zip/ZipCoding.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 4244499 4532049 4700978 4820807 4980042
+ * @summary Test ZipInputStream, ZipOutputStream and ZipFile with non-UTF8 encoding
+ */
+
+import java.io.*;
+import java.nio.charset.*;
+import java.util.*;
+import java.util.zip.*;
+
+public class ZipCoding {
+
+    public static void main(String[] args) throws Exception {
+
+        test("MS932",
+             "\u4e00\u4e01", "\uff67\uff68\uff69\uff6a\uff6b\uff6c");
+
+        test("ibm437",
+             "\u00e4\u00fc", "German Umlaut \u00fc in comment");
+
+        test("utf-8",
+             "\u4e00\u4e01", "\uff67\uff68\uff69\uff6a\uff6b\uff6c");
+
+        test("utf-8",
+             "\u00e4\u00fc", "German Umlaut \u00fc in comment");
+
+        test("utf-8",
+             "Surrogate\ud801\udc01", "Surrogates \ud800\udc00 in comment");
+
+    }
+
+    static void testZipInputStream(InputStream is, Charset cs,
+                                   String name, String comment, byte[] bb)
+        throws Exception
+    {
+        ZipInputStream zis = new ZipInputStream(is, cs);
+        ZipEntry e = zis.getNextEntry();
+        if (e == null || ! name.equals(e.getName()))
+            throw new RuntimeException("ZipIS name doesn't match!");
+        byte[] bBuf = new byte[bb.length << 1];
+        int n = zis.read(bBuf, 0, bBuf.length);
+        if (n != bb.length ||
+            !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
+            throw new RuntimeException("ZipIS content doesn't match!");
+        }
+        zis.close();
+    }
+
+    static void testZipFile(File f, Charset cs,
+                            String name, String comment, byte[] bb)
+        throws Exception
+    {
+        ZipFile zf = new ZipFile(f, cs);
+        Enumeration<? extends ZipEntry> zes = zf.entries();
+        ZipEntry e = (ZipEntry)zes.nextElement();
+        if (! name.equals(e.getName()) ||
+            ! comment.equals(e.getComment()))
+            throw new RuntimeException("ZipFile: name/comment doesn't match!");
+        InputStream is = zf.getInputStream(e);
+        if (is == null)
+            throw new RuntimeException("ZipFile: getIS failed!");
+        byte[] bBuf = new byte[bb.length << 1];
+        int n = 0;
+        int nn =0;
+        while ((nn = is.read(bBuf, n, bBuf.length-n)) != -1) {
+            n += nn;
+        }
+        if (n != bb.length ||
+            !Arrays.equals(bb, Arrays.copyOf(bBuf, n))) {
+            throw new RuntimeException("ZipFile content doesn't match!");
+        }
+        zf.close();
+    }
+
+    static void test(String csn, String name, String comment)
+        throws Exception
+    {
+        byte[] bb = "This is the conent of the zipfile".getBytes("ISO-8859-1");
+        Charset cs = Charset.forName(csn);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ZipOutputStream zos = new ZipOutputStream(baos, cs);
+
+        ZipEntry e = new ZipEntry(name);
+        e.setComment(comment);
+        zos.putNextEntry(e);
+        zos.write(bb, 0, bb.length);
+        zos.closeEntry();
+        zos.close();
+        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
+        testZipInputStream(bis, cs, name, comment, bb);
+
+        if ("utf-8".equals(csn)) {
+            // EFS should be set
+            bis.reset();
+            testZipInputStream(bis, Charset.forName("MS932"), name, comment, bb);
+        }
+
+        File f = new File(new File(System.getProperty("test.dir", ".")),
+                          "zfcoding.zip");
+        FileOutputStream fos = new FileOutputStream(f);
+        baos.writeTo(fos);
+        fos.close();
+        testZipFile(f, cs, name, comment, bb);
+        if ("utf-8".equals(csn)) {
+            testZipFile(f, Charset.forName("MS932"), name, comment, bb);
+        }
+        f.delete();
+    }
+}
diff --git a/jdk/test/java/util/zip/zip.java b/jdk/test/java/util/zip/zip.java
new file mode 100644
index 0000000..33eccf9
--- /dev/null
+++ b/jdk/test/java/util/zip/zip.java
@@ -0,0 +1,743 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+import java.nio.charset.Charset;
+import java.util.*;
+import java.util.zip.*;
+import java.text.MessageFormat;
+
+/**
+ * A stripped-down version of Jar tool with a "-encoding" option to
+ * support non-UTF8 encoidng for entry name and comment.
+ */
+public class zip {
+    String program;
+    PrintStream out, err;
+    String fname;
+    String zname = "";
+    String[] files;
+    Charset cs = Charset.forName("UTF-8");
+
+    Map<String, File> entryMap = new HashMap<String, File>();
+    Set<File> entries = new LinkedHashSet<File>();
+    List<String> paths = new ArrayList<String>();
+
+    CRC32 crc32 = new CRC32();
+    /*
+     * cflag: create
+     * uflag: update
+     * xflag: xtract
+     * tflag: table
+     * vflag: verbose
+     * flag0: no zip compression (store only)
+     */
+    boolean cflag, uflag, xflag, tflag, vflag, flag0;
+
+    private static ResourceBundle rsrc;
+    static {
+        try {
+            // just use the jar message
+            rsrc = ResourceBundle.getBundle("sun.tools.jar.resources.jar");
+        } catch (MissingResourceException e) {
+            throw new Error("Fatal: Resource for jar is missing");
+        }
+    }
+
+    public zip(PrintStream out, PrintStream err, String program) {
+        this.out = out;
+        this.err = err;
+        this.program = program;
+    }
+
+    private boolean ok;
+
+    public synchronized boolean run(String args[]) {
+        ok = true;
+        if (!parseArgs(args)) {
+            return false;
+        }
+        try {
+            if (cflag || uflag) {
+                if (fname != null) {
+                    zname = fname.replace(File.separatorChar, '/');
+                    if (zname.startsWith("./")) {
+                        zname = zname.substring(2);
+                    }
+                }
+            }
+            if (cflag) {
+                OutputStream out;
+                if (fname != null) {
+                    out = new FileOutputStream(fname);
+                } else {
+                    out = new FileOutputStream(FileDescriptor.out);
+                    if (vflag) {
+                         vflag = false;
+                    }
+                }
+                expand(null, files, false);
+                create(new BufferedOutputStream(out, 4096));
+                out.close();
+            } else if (uflag) {
+                File inputFile = null, tmpFile = null;
+                FileInputStream in;
+                FileOutputStream out;
+                if (fname != null) {
+                    inputFile = new File(fname);
+                    String path = inputFile.getParent();
+                    tmpFile = File.createTempFile("tmp", null,
+                              new File((path == null) ? "." : path));
+                    in = new FileInputStream(inputFile);
+                    out = new FileOutputStream(tmpFile);
+                } else {
+                    in = new FileInputStream(FileDescriptor.in);
+                    out = new FileOutputStream(FileDescriptor.out);
+                    vflag = false;
+                }
+                expand(null, files, true);
+                boolean updateOk = update(in, new BufferedOutputStream(out));
+                if (ok) {
+                    ok = updateOk;
+                }
+                in.close();
+                out.close();
+                if (fname != null) {
+                    inputFile.delete();
+                    if (!tmpFile.renameTo(inputFile)) {
+                        tmpFile.delete();
+                        throw new IOException(getMsg("error.write.file"));
+                    }
+                    tmpFile.delete();
+                }
+            } else if (tflag) {
+                replaceFSC(files);
+                if (fname != null) {
+                    list(fname, files);
+                } else {
+                    InputStream in = new FileInputStream(FileDescriptor.in);
+                    try{
+                        list(new BufferedInputStream(in), files);
+                    } finally {
+                        in.close();
+                    }
+                }
+            } else if (xflag) {
+                replaceFSC(files);
+                if (fname != null && files != null) {
+                    extract(fname, files);
+                } else {
+                    InputStream in = (fname == null)
+                        ? new FileInputStream(FileDescriptor.in)
+                        : new FileInputStream(fname);
+                    try {
+                        extract(new BufferedInputStream(in), files);
+                    } finally {
+                        in.close();
+                    }
+                }
+            }
+        } catch (IOException e) {
+            fatalError(e);
+            ok = false;
+        } catch (Error ee) {
+            ee.printStackTrace();
+            ok = false;
+        } catch (Throwable t) {
+            t.printStackTrace();
+            ok = false;
+        }
+        out.flush();
+        err.flush();
+        return ok;
+    }
+
+
+    boolean parseArgs(String args[]) {
+        try {
+            args = parse(args);
+        } catch (FileNotFoundException e) {
+            fatalError(formatMsg("error.cant.open", e.getMessage()));
+            return false;
+        } catch (IOException e) {
+            fatalError(e);
+            return false;
+        }
+        int count = 1;
+        try {
+            String flags = args[0];
+            if (flags.startsWith("-")) {
+                flags = flags.substring(1);
+            }
+            for (int i = 0; i < flags.length(); i++) {
+                switch (flags.charAt(i)) {
+                case 'c':
+                    if (xflag || tflag || uflag) {
+                        usageError();
+                        return false;
+                    }
+                    cflag = true;
+                    break;
+                case 'u':
+                    if (cflag || xflag || tflag) {
+                        usageError();
+                        return false;
+                    }
+                    uflag = true;
+                    break;
+                case 'x':
+                    if (cflag || uflag || tflag) {
+                        usageError();
+                        return false;
+                    }
+                    xflag = true;
+                    break;
+                case 't':
+                    if (cflag || uflag || xflag) {
+                        usageError();
+                        return false;
+                    }
+                    tflag = true;
+                    break;
+                case 'v':
+                    vflag = true;
+                    break;
+                case 'f':
+                    fname = args[count++];
+                    break;
+                case '0':
+                    flag0 = true;
+                    break;
+                default:
+                    error(formatMsg("error.illegal.option",
+                                String.valueOf(flags.charAt(i))));
+                    usageError();
+                    return false;
+                }
+            }
+        } catch (ArrayIndexOutOfBoundsException e) {
+            usageError();
+            return false;
+        }
+        if (!cflag && !tflag && !xflag && !uflag) {
+            error(getMsg("error.bad.option"));
+            usageError();
+            return false;
+        }
+        /* parse file arguments */
+        int n = args.length - count;
+        if (n > 0) {
+            int k = 0;
+            String[] nameBuf = new String[n];
+            try {
+                for (int i = count; i < args.length; i++) {
+                    if (args[i].equals("-encoding")) {
+                        cs = Charset.forName(args[++i]);
+                    } else if (args[i].equals("-C")) {
+                        /* change the directory */
+                        String dir = args[++i];
+                        dir = (dir.endsWith(File.separator) ?
+                               dir : (dir + File.separator));
+                        dir = dir.replace(File.separatorChar, '/');
+                        while (dir.indexOf("//") > -1) {
+                            dir = dir.replace("//", "/");
+                        }
+                        paths.add(dir.replace(File.separatorChar, '/'));
+                        nameBuf[k++] = dir + args[++i];
+                    } else {
+                        nameBuf[k++] = args[i];
+                    }
+                }
+            } catch (ArrayIndexOutOfBoundsException e) {
+                e.printStackTrace();
+                usageError();
+                return false;
+            }
+            if (k != 0) {
+                files = new String[k];
+                System.arraycopy(nameBuf, 0, files, 0, k);
+            }
+        } else if (cflag || uflag) {
+            error(getMsg("error.bad.uflag"));
+            usageError();
+            return false;
+        }
+        return true;
+    }
+
+    void expand(File dir, String[] files, boolean isUpdate) {
+        if (files == null) {
+            return;
+        }
+        for (int i = 0; i < files.length; i++) {
+            File f;
+            if (dir == null) {
+                f = new File(files[i]);
+            } else {
+                f = new File(dir, files[i]);
+            }
+            if (f.isFile()) {
+                if (entries.add(f)) {
+                    if (isUpdate)
+                        entryMap.put(entryName(f.getPath()), f);
+                }
+            } else if (f.isDirectory()) {
+                if (entries.add(f)) {
+                    if (isUpdate) {
+                        String dirPath = f.getPath();
+                        dirPath = (dirPath.endsWith(File.separator)) ? dirPath :
+                            (dirPath + File.separator);
+                        entryMap.put(entryName(dirPath), f);
+                    }
+                    expand(f, f.list(), isUpdate);
+                }
+            } else {
+                error(formatMsg("error.nosuch.fileordir", String.valueOf(f)));
+                ok = false;
+            }
+        }
+    }
+
+    void create(OutputStream out) throws IOException
+    {
+        ZipOutputStream zos = new ZipOutputStream(out, cs);
+        if (flag0) {
+            zos.setMethod(ZipOutputStream.STORED);
+        }
+        for (File file: entries) {
+            addFile(zos, file);
+        }
+        zos.close();
+    }
+
+    boolean update(InputStream in, OutputStream out) throws IOException
+    {
+        ZipInputStream zis = new ZipInputStream(in, cs);
+        ZipOutputStream zos = new ZipOutputStream(out, cs);
+        ZipEntry e = null;
+        byte[] buf = new byte[1024];
+        int n = 0;
+        boolean updateOk = true;
+
+        // put the old entries first, replace if necessary
+        while ((e = zis.getNextEntry()) != null) {
+            String name = e.getName();
+            if (!entryMap.containsKey(name)) { // copy the old stuff
+                // do our own compression
+                ZipEntry e2 = new ZipEntry(name);
+                e2.setMethod(e.getMethod());
+                e2.setTime(e.getTime());
+                e2.setComment(e.getComment());
+                e2.setExtra(e.getExtra());
+                if (e.getMethod() == ZipEntry.STORED) {
+                    e2.setSize(e.getSize());
+                    e2.setCrc(e.getCrc());
+                }
+                zos.putNextEntry(e2);
+                while ((n = zis.read(buf, 0, buf.length)) != -1) {
+                    zos.write(buf, 0, n);
+                }
+            } else { // replace with the new files
+                File f = entryMap.get(name);
+                addFile(zos, f);
+                entryMap.remove(name);
+                entries.remove(f);
+            }
+        }
+
+        // add the remaining new files
+        for (File f: entries) {
+            addFile(zos, f);
+        }
+        zis.close();
+        zos.close();
+        return updateOk;
+    }
+
+    private String entryName(String name) {
+        name = name.replace(File.separatorChar, '/');
+        String matchPath = "";
+        for (String path : paths) {
+            if (name.startsWith(path) && (path.length() > matchPath.length())) {
+                matchPath = path;
+            }
+        }
+        name = name.substring(matchPath.length());
+
+        if (name.startsWith("/")) {
+            name = name.substring(1);
+        } else if (name.startsWith("./")) {
+            name = name.substring(2);
+        }
+        return name;
+    }
+
+    void addFile(ZipOutputStream zos, File file) throws IOException {
+        String name = file.getPath();
+        boolean isDir = file.isDirectory();
+        if (isDir) {
+            name = name.endsWith(File.separator) ? name :
+                (name + File.separator);
+        }
+        name = entryName(name);
+
+        if (name.equals("") || name.equals(".") || name.equals(zname)) {
+            return;
+        }
+
+        long size = isDir ? 0 : file.length();
+
+        if (vflag) {
+            out.print(formatMsg("out.adding", name));
+        }
+        ZipEntry e = new ZipEntry(name);
+        e.setTime(file.lastModified());
+        if (size == 0) {
+            e.setMethod(ZipEntry.STORED);
+            e.setSize(0);
+            e.setCrc(0);
+        } else if (flag0) {
+            e.setSize(size);
+            e.setMethod(ZipEntry.STORED);
+            crc32File(e, file);
+        }
+        zos.putNextEntry(e);
+        if (!isDir) {
+            byte[] buf = new byte[8192];
+            int len;
+            InputStream is = new BufferedInputStream(new FileInputStream(file));
+            while ((len = is.read(buf, 0, buf.length)) != -1) {
+                zos.write(buf, 0, len);
+            }
+            is.close();
+        }
+        zos.closeEntry();
+        /* report how much compression occurred. */
+        if (vflag) {
+            size = e.getSize();
+            long csize = e.getCompressedSize();
+            out.print(formatMsg2("out.size", String.valueOf(size),
+                        String.valueOf(csize)));
+            if (e.getMethod() == ZipEntry.DEFLATED) {
+                long ratio = 0;
+                if (size != 0) {
+                    ratio = ((size - csize) * 100) / size;
+                }
+                output(formatMsg("out.deflated", String.valueOf(ratio)));
+            } else {
+                output(getMsg("out.stored"));
+            }
+        }
+    }
+
+    private void crc32File(ZipEntry e, File f) throws IOException {
+        InputStream is = new BufferedInputStream(new FileInputStream(f));
+        byte[] buf = new byte[8192];
+        crc32.reset();
+        int r = 0;
+        int nread = 0;
+        long len = f.length();
+        while ((r = is.read(buf)) != -1) {
+            nread += r;
+            crc32.update(buf, 0, r);
+        }
+        is.close();
+        if (nread != (int) len) {
+            throw new ZipException(formatMsg(
+                        "error.incorrect.length", f.getPath()));
+        }
+        e.setCrc(crc32.getValue());
+    }
+
+    void replaceFSC(String files[]) {
+        if (files != null) {
+            for (String file : files) {
+                file = file.replace(File.separatorChar, '/');
+            }
+        }
+    }
+
+    Set<ZipEntry> newDirSet() {
+        return new HashSet<ZipEntry>() {
+            public boolean add(ZipEntry e) {
+                return (e == null || super.add(e));
+            }};
+    }
+
+    void updateLastModifiedTime(Set<ZipEntry> zes) throws IOException {
+        for (ZipEntry ze : zes) {
+            long lastModified = ze.getTime();
+            if (lastModified != -1) {
+                File f = new File(ze.getName().replace('/', File.separatorChar));
+                f.setLastModified(lastModified);
+            }
+        }
+    }
+
+    void extract(InputStream in, String files[]) throws IOException {
+        ZipInputStream zis = new ZipInputStream(in, cs);
+        ZipEntry e;
+        Set<ZipEntry> dirs = newDirSet();
+        while ((e = zis.getNextEntry()) != null) {
+            if (files == null) {
+                dirs.add(extractFile(zis, e));
+            } else {
+                String name = e.getName();
+                for (String file : files) {
+                    if (name.startsWith(file)) {
+                        dirs.add(extractFile(zis, e));
+                        break;
+                    }
+                }
+            }
+        }
+        updateLastModifiedTime(dirs);
+    }
+
+    void extract(String fname, String files[]) throws IOException {
+        ZipFile zf = new ZipFile(fname, cs);
+        Set<ZipEntry> dirs = newDirSet();
+        Enumeration<? extends ZipEntry> zes = zf.entries();
+        while (zes.hasMoreElements()) {
+            ZipEntry e = zes.nextElement();
+            InputStream is;
+            if (files == null) {
+                dirs.add(extractFile(zf.getInputStream(e), e));
+            } else {
+                String name = e.getName();
+                for (String file : files) {
+                    if (name.startsWith(file)) {
+                        dirs.add(extractFile(zf.getInputStream(e), e));
+                        break;
+                    }
+                }
+            }
+        }
+        zf.close();
+        updateLastModifiedTime(dirs);
+    }
+
+    ZipEntry extractFile(InputStream is, ZipEntry e) throws IOException {
+        ZipEntry rc = null;
+        String name = e.getName();
+        File f = new File(e.getName().replace('/', File.separatorChar));
+        if (e.isDirectory()) {
+            if (f.exists()) {
+                if (!f.isDirectory()) {
+                    throw new IOException(formatMsg("error.create.dir",
+                        f.getPath()));
+                }
+            } else {
+                if (!f.mkdirs()) {
+                    throw new IOException(formatMsg("error.create.dir",
+                        f.getPath()));
+                } else {
+                    rc = e;
+                }
+            }
+            if (vflag) {
+                output(formatMsg("out.create", name));
+            }
+        } else {
+            if (f.getParent() != null) {
+                File d = new File(f.getParent());
+                if (!d.exists() && !d.mkdirs() || !d.isDirectory()) {
+                    throw new IOException(formatMsg(
+                        "error.create.dir", d.getPath()));
+                }
+            }
+            OutputStream os = new FileOutputStream(f);
+            byte[] b = new byte[8192];
+            int len;
+            try {
+                while ((len = is.read(b, 0, b.length)) != -1) {
+                    os.write(b, 0, len);
+                }
+            } finally {
+                if (is instanceof ZipInputStream)
+                    ((ZipInputStream)is).closeEntry();
+                else
+                    is.close();
+                os.close();
+            }
+            if (vflag) {
+                if (e.getMethod() == ZipEntry.DEFLATED) {
+                    output(formatMsg("out.inflated", name));
+                } else {
+                    output(formatMsg("out.extracted", name));
+                }
+            }
+        }
+        long lastModified = e.getTime();
+        if (lastModified != -1) {
+            f.setLastModified(lastModified);
+        }
+        return rc;
+    }
+
+    void list(InputStream in, String files[]) throws IOException {
+        ZipInputStream zis = new ZipInputStream(in, cs);
+        ZipEntry e;
+        while ((e = zis.getNextEntry()) != null) {
+            zis.closeEntry();
+            printEntry(e, files);
+        }
+    }
+
+    void list(String fname, String files[]) throws IOException {
+        ZipFile zf = new ZipFile(fname, cs);
+        Enumeration<? extends ZipEntry> zes = zf.entries();
+        while (zes.hasMoreElements()) {
+            printEntry(zes.nextElement(), files);
+        }
+        zf.close();
+    }
+
+    void printEntry(ZipEntry e, String[] files) throws IOException {
+        if (files == null) {
+            printEntry(e);
+        } else {
+            String name = e.getName();
+            for (String file : files) {
+                if (name.startsWith(file)) {
+                    printEntry(e);
+                    return;
+                }
+            }
+        }
+    }
+
+    void printEntry(ZipEntry e) throws IOException {
+        if (vflag) {
+            StringBuilder sb = new StringBuilder();
+            String s = Long.toString(e.getSize());
+            for (int i = 6 - s.length(); i > 0; --i) {
+                sb.append(' ');
+            }
+            sb.append(s).append(' ').append(new Date(e.getTime()).toString());
+            sb.append(' ').append(e.getName());
+            output(sb.toString());
+        } else {
+            output(e.getName());
+        }
+    }
+
+    void usageError() {
+        error(
+        "Usage: zip {ctxu}[vf0] [zip-file] [-encoding encname][-C dir] files ...\n" +
+        "Options:\n" +
+        "   -c  create new archive\n" +
+        "   -t  list table of contents for archive\n" +
+        "   -x  extract named (or all) files from archive\n" +
+        "   -u  update existing archive\n" +
+        "   -v  generate verbose output on standard output\n" +
+        "   -f  specify archive file name\n" +
+        "   -0  store only; use no ZIP compression\n" +
+        "   -C  change to the specified directory and include the following file\n" +
+        "If any file is a directory then it is processed recursively.\n");
+    }
+
+    void fatalError(Exception e) {
+        e.printStackTrace();
+    }
+
+
+    void fatalError(String s) {
+        error(program + ": " + s);
+    }
+
+
+    protected void output(String s) {
+        out.println(s);
+    }
+
+    protected void error(String s) {
+        err.println(s);
+    }
+
+    private String getMsg(String key) {
+        try {
+            return (rsrc.getString(key));
+        } catch (MissingResourceException e) {
+            throw new Error("Error in message file");
+        }
+    }
+
+    private String formatMsg(String key, String arg) {
+        String msg = getMsg(key);
+        String[] args = new String[1];
+        args[0] = arg;
+        return MessageFormat.format(msg, (Object[]) args);
+    }
+
+    private String formatMsg2(String key, String arg, String arg1) {
+        String msg = getMsg(key);
+        String[] args = new String[2];
+        args[0] = arg;
+        args[1] = arg1;
+        return MessageFormat.format(msg, (Object[]) args);
+    }
+
+    public static String[] parse(String[] args) throws IOException
+    {
+        ArrayList<String> newArgs = new ArrayList<String>(args.length);
+        for (int i = 0; i < args.length; i++) {
+            String arg = args[i];
+            if (arg.length() > 1 && arg.charAt(0) == '@') {
+                arg = arg.substring(1);
+                if (arg.charAt(0) == '@') {
+                    newArgs.add(arg);
+                } else {
+                    loadCmdFile(arg, newArgs);
+                }
+            } else {
+                newArgs.add(arg);
+            }
+        }
+        return newArgs.toArray(new String[newArgs.size()]);
+    }
+
+    private static void loadCmdFile(String name, List<String> args) throws IOException
+    {
+        Reader r = new BufferedReader(new FileReader(name));
+        StreamTokenizer st = new StreamTokenizer(r);
+        st.resetSyntax();
+        st.wordChars(' ', 255);
+        st.whitespaceChars(0, ' ');
+        st.commentChar('#');
+        st.quoteChar('"');
+        st.quoteChar('\'');
+        while (st.nextToken() != st.TT_EOF) {
+            args.add(st.sval);
+        }
+        r.close();
+    }
+
+    public static void main(String args[]) {
+        zip z = new zip(System.out, System.err, "zip");
+        System.exit(z.run(args) ? 0 : 1);
+    }
+}
+
diff --git a/jdk/test/javax/print/attribute/MediaMappingsTest.java b/jdk/test/javax/print/attribute/MediaMappingsTest.java
new file mode 100644
index 0000000..16110d8
--- /dev/null
+++ b/jdk/test/javax/print/attribute/MediaMappingsTest.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6652463
+ * @summary Verify media size-> media mappings can't be altered
+ * @run main MediaMappingsTest
+*/
+
+import javax.print.attribute.standard.MediaSize;
+import javax.print.attribute.standard.MediaSizeName;
+
+public class MediaMappingsTest {
+
+    public static void main(String args[]) {
+        MediaSize sizeA = MediaSize.getMediaSizeForName(MediaSizeName.A);
+        new MediaSize(1.0f, 2.0f, MediaSize.MM, MediaSizeName.A);
+        if (!sizeA.equals(MediaSize.getMediaSizeForName(MediaSizeName.A))) {
+             throw new RuntimeException("mapping changed");
+        }
+        MediaSize sizeB = MediaSize.getMediaSizeForName(MediaSizeName.B);
+        new MediaSize(1, 2, MediaSize.MM, MediaSizeName.B);
+        if (!sizeB.equals(MediaSize.getMediaSizeForName(MediaSizeName.B))) {
+             throw new RuntimeException("mapping changed");
+        }
+    }
+}
diff --git a/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest.java b/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest.java
new file mode 100644
index 0000000..fdb3357
--- /dev/null
+++ b/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test SoftChannel noteOn/noteOff overflow test */
+
+import javax.sound.midi.MidiChannel;
+import javax.sound.midi.VoiceStatus;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+
+import com.sun.media.sound.AudioSynthesizer;
+import com.sun.media.sound.SoftSynthesizer;
+
+public class NoteOverFlowTest {
+
+    public static void main(String[] args) throws Exception
+    {
+        AudioSynthesizer synth = new SoftSynthesizer();
+        AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
+        AudioInputStream stream = synth.openStream(format, null);
+
+        // Make all voices busy, e.g.
+        // send midi on and midi off on all available voices
+        MidiChannel ch1 = synth.getChannels()[0];
+        ch1.programChange(48); // Use contionus instrument like string ensemble
+        for (int i = 0; i < synth.getMaxPolyphony(); i++) {
+            ch1.noteOn(64, 64);
+            ch1.noteOff(64);
+        }
+
+        // Now send single midi on, and midi off message
+        ch1.noteOn(64, 64);
+        ch1.noteOff(64);
+
+        // Read 10 sec from stream, by this time all voices should be inactvie
+        stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 20)));
+
+        // If no voice are active, then this test will pass
+        VoiceStatus[] v = synth.getVoiceStatus();
+        for (int i = 0; i < v.length; i++) {
+            if(v[i].active)
+            {
+                throw new RuntimeException("Not all voices are inactive!");
+            }
+        }
+
+        // Close the synthesizer after use
+        synth.close();
+    }
+}
diff --git a/jdk/test/javax/sound/midi/Gervill/SoftFilter/TestProcessAudio.java b/jdk/test/javax/sound/midi/Gervill/SoftFilter/TestProcessAudio.java
new file mode 100644
index 0000000..032f667
--- /dev/null
+++ b/jdk/test/javax/sound/midi/Gervill/SoftFilter/TestProcessAudio.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test SoftFilter processAudio method */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Random;
+
+import javax.sound.sampled.*;
+
+import com.sun.media.sound.*;
+
+public class TestProcessAudio {
+
+    public static void main(String[] args) throws Exception {
+        AudioFormat format = new AudioFormat(44100, 16, 2, true, false);
+        SoftAudioBuffer sbuffer = new SoftAudioBuffer(3600, format);
+        SoftFilter filter = new SoftFilter(format.getSampleRate());
+        Random random = new Random(42);
+
+
+        for (int t = 0; t <= 6; t++)
+        {
+            if(t == 0) filter.setFilterType(SoftFilter.FILTERTYPE_BP12);
+            if(t == 1) filter.setFilterType(SoftFilter.FILTERTYPE_HP12);
+            if(t == 2) filter.setFilterType(SoftFilter.FILTERTYPE_HP24);
+            if(t == 3) filter.setFilterType(SoftFilter.FILTERTYPE_LP12);
+            if(t == 4) filter.setFilterType(SoftFilter.FILTERTYPE_LP24);
+            if(t == 5) filter.setFilterType(SoftFilter.FILTERTYPE_LP6);
+            if(t == 6) filter.setFilterType(SoftFilter.FILTERTYPE_NP12);
+
+
+            // Try first by reseting always
+            for (int f = 1200; f < 3600; f+=100)
+                for (int r = 0; r <= 30; r+=5) {
+                    filter.reset();
+                    filter.setResonance(r);
+                    filter.setFrequency(f);
+                    float[] data = sbuffer.array();
+                    int len = sbuffer.getSize();
+                    for (int i = 0; i < len; i++)
+                        data[i] = random.nextFloat() - 0.5f;
+                    filter.processAudio(sbuffer);
+                }
+
+            // Now we skip reseting
+            // to test how changing frequency and resonance
+            // affect active filter
+            for (int f = 100; f < 12800; f+=1200)
+            for (int r = 0; r <= 30; r+=5) {
+                filter.setResonance(r);
+                filter.setFrequency(f);
+                float[] data = sbuffer.array();
+                int len = sbuffer.getSize();
+                for (int i = 0; i < len; i++)
+                    data[i] = random.nextFloat() - 0.5f;
+                filter.processAudio(sbuffer);
+            }
+            for (int f = 12800; f >= 100; f-=1200)
+                for (int r = 30; r >= 0; r-=5) {
+                    filter.setResonance(r);
+                    filter.setFrequency(f);
+                    float[] data = sbuffer.array();
+                    int len = sbuffer.getSize();
+                    for (int i = 0; i < len; i++)
+                        data[i] = random.nextFloat() - 0.5f;
+                    filter.processAudio(sbuffer);
+                }
+            filter.reset();
+        }
+
+    }
+
+}
diff --git a/jdk/test/javax/sound/midi/Gervill/SoftLowFrequencyOscillator/TestProcessControlLogic.java b/jdk/test/javax/sound/midi/Gervill/SoftLowFrequencyOscillator/TestProcessControlLogic.java
new file mode 100644
index 0000000..6289a88
--- /dev/null
+++ b/jdk/test/javax/sound/midi/Gervill/SoftLowFrequencyOscillator/TestProcessControlLogic.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+ @summary Test SoftLowFrequencyOscillator processControlLogic method */
+
+import com.sun.media.sound.AudioSynthesizerPropertyInfo;
+import com.sun.media.sound.SoftLowFrequencyOscillator;
+import com.sun.media.sound.SoftSynthesizer;
+
+public class TestProcessControlLogic {
+
+    private static float control_rate = 147f;
+    private static SoftSynthesizer synth = new SoftSynthesizer();
+    private static SoftLowFrequencyOscillator lfo = new SoftLowFrequencyOscillator();
+
+    private static void testLFO(boolean shared, int instance, float freq, float delay,
+            float delay2) throws Exception {
+        SoftLowFrequencyOscillator lfo =
+            shared?TestProcessControlLogic.lfo:new SoftLowFrequencyOscillator();
+        lfo.reset();
+        double[] lfo_freq = lfo.get(instance, "freq");
+        double[] lfo_delay = lfo.get(instance, "delay");
+        double[] lfo_delay2 = lfo.get(instance, "delay2");
+        double[] lfo_output = lfo.get(instance, null);
+        lfo_freq[0] = freq;
+        lfo_delay[0] = delay;
+        lfo_delay2[0] = delay2;
+        lfo.init(synth);
+
+        // For delayCount amount time, the output LFO should be 0.5
+        int delayCount = (int) ((Math.pow(2, delay / 1200.0) * control_rate));
+        delayCount += (int) ((delay2 * control_rate) / 1000.0);
+        for (int i = 0; i < delayCount; i++) {
+            if (Math.abs(0.5 - lfo_output[0]) > 0.000001)
+                throw new Exception("Incorrect LFO output ("
+                        +"0.5 != "+lfo_output[0]+")!");
+            lfo.processControlLogic();
+        }
+
+        // After the delay the LFO should start oscillate
+        // Let make sure output is accurate enough
+        double p_step = (440.0 / control_rate)
+        * Math.exp((freq - 6900.0) * (Math.log(2) / 1200.0));
+        double p = 0;
+        for (int i = 0; i < 30; i++) {
+            p += p_step;
+            double predicted_output = 0.5 + Math.sin(p * 2 * Math.PI) * 0.5;
+            if (Math.abs(predicted_output - lfo_output[0]) > 0.001)
+                throw new Exception("Incorrect LFO output ("
+                        +predicted_output+" != "+lfo_output[0]+")!");
+            lfo.processControlLogic();
+        }
+
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        // Get default control rate from synthesizer
+        AudioSynthesizerPropertyInfo[] p = synth.getPropertyInfo(null);
+        for (int i = 0; i < p.length; i++) {
+            if (p[i].name.equals("control rate")) {
+                control_rate = ((Float) p[i].value).floatValue();
+                break;
+            }
+        }
+
+        // Test LFO under various configurations
+        for (int instance = 0; instance < 3; instance++)
+            for (int d1 = -3000; d1 < 0; d1 += 1000)
+                for (int d2 = 0; d2 < 5000; d2 += 1000)
+                    for (int fr = -1000; fr < 1000; fr += 100) {
+                        testLFO(true, instance,
+                                (fr == -1000) ? Float.NEGATIVE_INFINITY : fr,
+                                (d1 == -3000) ? Float.NEGATIVE_INFINITY : d1,
+                                d2);
+                        testLFO(false, instance,
+                                (fr == -1000) ? Float.NEGATIVE_INFINITY : fr,
+                                (d1 == -3000) ? Float.NEGATIVE_INFINITY : d1,
+                                d2);
+                    }
+
+    }
+}
diff --git a/jdk/test/sun/security/krb5/ConfigWithQuotations.java b/jdk/test/sun/security/krb5/ConfigWithQuotations.java
new file mode 100644
index 0000000..c55e3cb
--- /dev/null
+++ b/jdk/test/sun/security/krb5/ConfigWithQuotations.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+/*
+ * @test
+ * @bug 6714845
+ * @summary Quotes in Kerberos configuration file are included in the values
+ */
+
+import sun.security.krb5.Config;
+
+public class ConfigWithQuotations {
+    public static void main(String[] args) throws Exception {
+        // This config file is generated using Kerberos.app on a Mac
+        System.setProperty("java.security.krb5.conf",
+                System.getProperty("test.src", ".") +"/edu.mit.Kerberos");
+        Config config = Config.getInstance();
+
+        System.out.println(config);
+
+        if (!config.getDefaultRealm().equals("MAC.LOCAL")) {
+            throw new Exception("Realm error");
+        }
+        if (!config.getKDCList("MAC.LOCAL").equals("kdc.mac.local:88")) {
+            throw new Exception("KDC error");
+        }
+    }
+}
diff --git a/jdk/test/sun/security/krb5/edu.mit.Kerberos b/jdk/test/sun/security/krb5/edu.mit.Kerberos
new file mode 100644
index 0000000..94d76a6
--- /dev/null
+++ b/jdk/test/sun/security/krb5/edu.mit.Kerberos
@@ -0,0 +1,15 @@
+[domain_realm]
+
+[libdefaults]
+	default_realm = "MAC.LOCAL"
+	dns_fallback = "no"
+
+[logging]
+	admin_server = "FILE:/var/log/krb5kdc/kadmin.log"
+	kdc = "FILE:/var/log/krb5kdc/kdc.log"
+
+[realms]
+	MAC.LOCAL = {
+		kdc = "kdc.mac.local:88"
+	}
+
diff --git a/jdk/test/sun/security/util/Oid/OidFormat.java b/jdk/test/sun/security/util/Oid/OidFormat.java
index 9de4a75..10b7fdd 100644
--- a/jdk/test/sun/security/util/Oid/OidFormat.java
+++ b/jdk/test/sun/security/util/Oid/OidFormat.java
@@ -63,9 +63,22 @@
             "1.2.3", "1.2.3445",
             "1.3.6.1.4.1.42.2.17",
             // 4811968: ASN.1 cannot handle huge OID components
-            //"2.16.764.1.3101555394.1.0.100.2.1",
-            //"1.2.2147483647.4",
-            //"1.2.268435456.4",
+            "2.16.764.1.3101555394.1.0.100.2.1",
+            "2.2726957624935694386592435",  // as huge as possible
+            "1.2.777777777777777777",
+            "1.2.888888888888888888.111111111111111.2222222222222.33333333333333333.44444444444444",
+            "1.2." +
+                "1111111111111111111111111111111111111111111111111111111111111." +
+                "2222222222222222222222222222222222222222222222222222222222222222." +
+                "333333333333333333333333333333333333333333333333333333333333333." +
+                "4444444444444444444444444444444444444444444444444444444." +
+                "55555555555555555555555555555555555555555555555555555555555555555555555." +
+                "666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666." +
+                "77777777777777777777777777777777777777777777777777777777777777777777777777." +
+                "8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888." +
+                "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999",
+            "1.2.2147483647.4",
+            "1.2.268435456.4",
         };
 
         for (String s: goodOids) {
diff --git a/jdk/test/sun/security/util/Oid/S11N.sh b/jdk/test/sun/security/util/Oid/S11N.sh
new file mode 100644
index 0000000..77341e8
--- /dev/null
+++ b/jdk/test/sun/security/util/Oid/S11N.sh
@@ -0,0 +1,164 @@
+#
+# Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+# @test
+# @bug 4811968
+# @summary Serialization compatibility with old versions
+# @author Weijun Wang
+#
+# set a few environment variables so that the shell-script can run stand-alone
+# in the source directory
+
+if [ "${TESTSRC}" = "" ] ; then
+  TESTSRC="."
+fi
+if [ "${TESTCLASSES}" = "" ] ; then
+  TESTCLASSES="."
+fi
+if [ "${TESTJAVA}" = "" ] ; then
+  echo "TESTJAVA not set.  Test cannot execute."
+  echo "FAILED!!!"
+  exit 1
+fi
+
+# set platform-dependent variables
+PF=""
+
+OS=`uname -s`
+case "$OS" in
+  SunOS )
+    FS="/"
+    ARCH=`isainfo`
+    case "$ARCH" in
+      sparc* )
+        PF="solaris-sparc"
+        ;;
+      i[3-6]86 )
+        PF="solaris-i586"
+        ;;
+      amd64* )
+        PF="solaris-amd64"
+        ;;
+      * )
+        echo "Unsupported System: Solaris ${ARCH}"
+        exit 0;
+        ;;
+    esac
+    ;;
+  Linux )
+    ARCH=`uname -m`
+    FS="/"
+    case "$ARCH" in
+      i[3-6]86 )
+        PF="linux-i586"
+        ;;
+      amd64* )
+        PF="linux-amd64"
+        ;;
+      * )
+        echo "Unsupported System: Linux ${ARCH}"
+        exit 0;
+        ;;
+    esac
+    ;;
+  Windows* )
+    FS="\\"
+    PF="windows-i586"
+
+    # 'uname -m' does not give us enough information -
+    #  should rely on $PROCESSOR_IDENTIFIER (as is done in Defs-windows.gmk),
+    #  but JTREG does not pass this env variable when executing a shell script.
+    #
+    #  execute test program - rely on it to exit if platform unsupported
+
+    ;;
+  * )
+    echo "Unsupported System: ${OS}"
+    exit 0;
+    ;;
+esac
+
+# the test code
+
+${TESTJAVA}${FS}bin${FS}javac -source 1.3 -target 1.3 -d . ${TESTSRC}${FS}SerialTest.java || exit 10
+
+OLDJAVA="
+    /java/re/j2se/1.6.0/latest/binaries/${PF}
+    /java/re/j2se/1.5.0/latest/binaries/${PF}
+    /java/re/j2se/1.4.2/latest/binaries/${PF}
+"
+
+SMALL="
+    0.0
+    1.1
+    2.2
+    1.2.3456
+    1.2.2147483647.4
+    1.2.268435456.4
+"
+
+HUGE="
+    2.16.764.1.3101555394.1.0.100.2.1
+    1.2.2147483648.4
+    2.3.4444444444444444444444
+    1.2.888888888888888888.111111111111111.2222222222222.33333333333333333.44444444444444
+"
+
+for oid in ${SMALL}; do
+    echo ${oid}
+    # new ->
+    ${TESTJAVA}${FS}bin${FS}java SerialTest out ${oid} > tmp.oid.serial || exit 1
+    # -> new
+    ${TESTJAVA}${FS}bin${FS}java SerialTest in ${oid} < tmp.oid.serial || exit 2
+    for oldj in ${OLDJAVA}; do
+        if [ -d ${oldj} ]; then
+            echo ${oldj}
+            # -> old
+            ${oldj}${FS}bin${FS}java SerialTest in ${oid} < tmp.oid.serial || exit 3
+            # old ->
+            ${oldj}${FS}bin${FS}java SerialTest out ${oid} > tmp.oid.serial.old || exit 4
+            # -> new
+            ${TESTJAVA}${FS}bin${FS}java SerialTest in ${oid} < tmp.oid.serial.old || exit 5
+        fi
+    done
+done
+
+for oid in ${HUGE}; do
+    echo ${oid}
+    # new ->
+    ${TESTJAVA}${FS}bin${FS}java SerialTest out ${oid} > tmp.oid.serial || exit 1
+    # -> new
+    ${TESTJAVA}${FS}bin${FS}java SerialTest in ${oid} < tmp.oid.serial || exit 2
+    for oldj in ${OLDJAVA}; do
+        if [ -d ${oldj} ]; then
+            echo ${oldj}
+            # -> old
+            ${oldj}${FS}bin${FS}java SerialTest badin < tmp.oid.serial || exit 3
+        fi
+    done
+done
+
+rm -f tmp.oid.serial
+rm -f tmp.oid.serial.old
+rm -f SerialTest.class
+
+exit 0
diff --git a/jdk/test/sun/security/util/Oid/SerialTest.java b/jdk/test/sun/security/util/Oid/SerialTest.java
new file mode 100644
index 0000000..2c8516e
--- /dev/null
+++ b/jdk/test/sun/security/util/Oid/SerialTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * read S11.sh
+ */
+import java.io.*;
+import sun.security.util.*;
+
+/**
+ * Test OID serialization between versions
+ *
+ * java SerialTest out oid  // write a OID into System.out
+ * java SerialTest in oid   // read from System.in and compare it with oid
+ * java SerialTest badin    // make sure *cannot* read from System.in
+ */
+class SerialTest {
+    public static void main(String[] args) throws Exception {
+        if (args[0].equals("out"))
+            out(args[1]);
+        else if (args[0].equals("in"))
+            in(args[1]);
+        else
+            badin();
+    }
+
+    static void in(String oid) throws Exception {
+        ObjectIdentifier o = (ObjectIdentifier) (new ObjectInputStream(System.in).readObject());
+        if (!o.toString().equals(oid))
+            throw new Exception("Read Fail " + o + ", not " + oid);
+    }
+
+    static void badin() throws Exception {
+        boolean pass = true;
+        try {
+            new ObjectInputStream(System.in).readObject();
+        } catch (Exception e) {
+            pass = false;
+        }
+        if (pass) throw new Exception("Should fail but not");
+    }
+
+    static void out(String oid) throws Exception {
+        new ObjectOutputStream(System.out).writeObject(new ObjectIdentifier(oid));
+    }
+}
diff --git a/jdk/test/tools/launcher/MultipleJRE.sh b/jdk/test/tools/launcher/MultipleJRE.sh
index b3e1cf7..a6dfaaa 100644
--- a/jdk/test/tools/launcher/MultipleJRE.sh
+++ b/jdk/test/tools/launcher/MultipleJRE.sh
@@ -1,14 +1,14 @@
 # @test MultipleJRE.sh
-# @bug 4811102 4953711 4955505 4956301 4991229 4998210 5018605 6387069
+# @bug 4811102 4953711 4955505 4956301 4991229 4998210 5018605 6387069 6733959
 # @build PrintVersion
 # @build UglyPrintVersion
+# @build ZipMeUp
 # @run shell MultipleJRE.sh
 # @summary Verify Multiple JRE version support
 # @author Joseph E. Kowalski
 
-
 #
-# Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -49,11 +49,26 @@
   exit 1
 fi
 
+JAVAEXE="$TESTJAVA/bin/java"
 JAVA="$TESTJAVA/bin/java -classpath $TESTCLASSES"
 JAR="$TESTJAVA/bin/jar"
 OS=`uname -s`;
 
 #
+# Tests whether we are on windows (true) or not.
+#
+IsWindows() {
+    case "$OS" in
+        Windows* | CYGWIN* )
+            printf "true"
+	;;
+	* )
+            printf "false"
+	;;
+    esac
+}
+
+#
 # Shell routine to test for the proper rejection of syntactically incorrect
 # version specifications.
 #
@@ -139,7 +154,6 @@
 	    $PACKAGE/UglyPrintVersion.class
 }
 
-
 #
 # Constructs a jar file with a fair number of "zip directory" entries and
 # the MANIFEST.MF entry at or near the end of that directory to validate
@@ -262,6 +276,29 @@
 	fi
 }
 
+# Tests very long Main-Class attribute in the jar
+TestLongMainClass() {
+    JVER=$1
+    if [ "$JVER" = "mklink" ]; then
+        JVER=XX
+        JDKXX=jdk/j2re$JVER
+        rm -rf jdk
+        mkdir jdk
+        ln -s $TESTJAVA $JDKXX
+        JAVA_VERSION_PATH="`pwd`/jdk"
+        export JAVA_VERSION_PATH
+    fi
+    $JAVAEXE -cp $TESTCLASSES ZipMeUp UglyBetty.jar 4097 
+    message="`$JAVAEXE -version:$JVER -jar UglyBetty.jar 2>&1`"
+    echo $message | grep "Error: main-class: attribute exceeds system limits" > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+        printf "Long manifest test did not get expected error"
+        exit 1
+    fi
+    unset JAVA_VERSION_PATH
+    rm -rf jdk
+}
+
 #
 # Main test sequence starts here
 #
@@ -280,14 +317,11 @@
 LaunchVM "" "${RELEASE}"
 CreateJar "" "0"
 LaunchVM "" "${RELEASE}"
-case "$OS" in
-	Windows* | CYGWIN* )
-		MAXIMUM_PATH=255;
-	;;
-	*)
-		MAXIMUM_PATH=1024;
-	;;
-esac
+if [ `IsWindows` = "true" ]; then
+    MAXIMUM_PATH=255;
+else
+    MAXIMUM_PATH=1024;
+fi
 
 PATH_LENGTH=`printf "%s" "$UGLYCLASS" | wc -c`
 if [ ${PATH_LENGTH} -lt ${MAXIMUM_PATH} ]; then
@@ -346,7 +380,6 @@
 	LaunchVM "" "${RELEASE}"
 fi
 
-
 #
 # Throw some syntactically challenged (illegal) version specifiers at
 # the interface.  Failure (of the launcher) is success for the test.
@@ -357,15 +390,28 @@
 TestSyntax "1.2+.3"				# Embedded modifier
 TestSyntax "1.2.4+&1.2*&1++"			# Long and invalid
 
+# On windows we see if there is another jre installed, usually
+# there is, then we test using that, otherwise links are created
+# to get through to SelectVersion.
+if [ `IsWindows` = "false" ]; then
+   TestLongMainClass "mklink"
+else
+    $JAVAEXE -version:1.0+
+    if [ $? -eq 0 ]; then
+        TestLongMainClass "1.0+"
+    else
+        printf  "Warning: TestLongMainClass skipped as there is no"
+	printf  "viable MJRE installed.\n"
+    fi
+fi
+
 #
 # Because scribbling in the registry can be rather destructive, only a
 # subset of the tests are run on Windows.
 #
-case "$OS" in
-	Windows* | CYGWIN* )
-		exit 0;
-	;;
-esac
+if [ `IsWindows` = "true" ]; then
+    exit 0;
+fi
 
 #
 # Additional version specifiers containing spaces.  (Sigh, unable to
diff --git a/jdk/test/tools/launcher/ZipMeUp.java b/jdk/test/tools/launcher/ZipMeUp.java
new file mode 100644
index 0000000..84d3f18
--- /dev/null
+++ b/jdk/test/tools/launcher/ZipMeUp.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * A simple class to create our erring Jar with a very long Main-Class
+ * attribute in the manifest.
+ */
+import java.io.ByteArrayOutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.zip.CRC32;
+import java.util.zip.CheckedOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+public class ZipMeUp {
+
+    static final CRC32 crc = new CRC32();
+
+    private static String SOME_KLASS = ".Some";
+
+    static byte[] getManifestAsBytes(int nchars) throws IOException {
+        crc.reset();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        CheckedOutputStream cos = new CheckedOutputStream(baos, crc);
+        PrintStream ps = new PrintStream(cos);
+        ps.println("Manifest-Version: 1.0");
+        ps.print("Main-Class: ");
+        for (int i = 0 ; i < nchars - SOME_KLASS.length() ; i++) {
+            ps.print(i%10);
+        }
+        ps.println(SOME_KLASS);
+        cos.flush();
+        cos.close();
+        ps.close();
+        return baos.toByteArray();
+    }
+
+    /**
+     * The arguments are: filename_to_create length
+     * @param args
+     * @throws java.lang.Exception
+     */
+    public static void main(String...args) throws Exception  {
+        FileOutputStream fos = new FileOutputStream(args[0]);
+        ZipOutputStream zos = new ZipOutputStream(fos);
+        byte[] manifest = getManifestAsBytes(Integer.parseInt(args[1]));
+        ZipEntry ze = new ZipEntry("META-INF/MANIFEST.MF");
+        ze.setMethod(ZipEntry.STORED);
+        ze.setSize(manifest.length);
+        ze.setCompressedSize(manifest.length);
+        ze.setCrc(crc.getValue());
+        ze.setTime(System.currentTimeMillis());
+        zos.putNextEntry(ze);
+        zos.write(manifest);
+        zos.flush();
+
+        // add a zero length class
+        ze = new ZipEntry(SOME_KLASS + ".class");
+        ze.setMethod(ZipEntry.STORED);
+        ze.setSize(0);
+        ze.setCompressedSize(0);
+        ze.setCrc(0);
+        ze.setTime(System.currentTimeMillis());
+        zos.putNextEntry(ze);
+        zos.flush();
+        zos.closeEntry();
+        zos.close();
+        System.exit(0);
+    }
+}
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 2392a20..241f51c 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -30,3 +30,4 @@
 dbdeb4a7581b2a8699644b91cae6793cb01953f7 jdk7-b53
 197a7f881937d406a01214aa9ded49c073f7d380 jdk7-b54
 7394a8694cedea574c7dbd38de87f4cbe0e27b8a jdk7-b55
+825f23a4f262eb06cfc94406140f3bfecb17ffe8 jdk7-b56
diff --git a/langtools/make/jprt.properties b/langtools/make/jprt.properties
index 26ffd61..f75871d 100644
--- a/langtools/make/jprt.properties
+++ b/langtools/make/jprt.properties
@@ -32,13 +32,13 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
 # The different build flavors we want
-jprt.build.flavors=product
+jprt.build.flavors=product,fastdebug
 
 # Explicitly designate what the 32bit match is for the 64bit build
 jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
diff --git a/make/jprt.config b/make/jprt.config
deleted file mode 100644
index aa16547..0000000
--- a/make/jprt.config
+++ /dev/null
@@ -1,379 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-#
-# Copyright 2006-2009 Sun Microsystems, Inc.  All Rights Reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Sun designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Sun in the LICENSE file that accompanied this code.
-#
-# This code 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
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-#############################################################################
-#
-# JPRT shell configuration for building.
-#
-# Input environment variables:
-#    ALT_BOOTDIR
-#    ALT_SLASH_JAVA
-#    ALT_JDK_IMPORT_PATH
-#    OPENJDK
-#    Windows Only:
-#      PATH
-#      VS71COMNTOOLS
-#      PROCESSOR_IDENTIFIER
-#      ROOTDIR
-#
-# Output variable settings:
-#    make            Full path to GNU make
-#    compiler_path   Path to compiler bin directory
-#    compiler_name   Unique name of this compiler
-#
-# Output environment variables:
-#    PATH
-#    ALT_COMPILER_PATH
-#    OPENJDK only:
-#      ALT_CLOSED_JDK_IMPORT_PATH
-#      ALT_JDK_DEVTOOLS_DIR
-#    Windows Only:
-#      ALT_MSDEVTOOLS_PATH
-#      ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
-#      LIB
-#      INCLUDE
-#
-# After JDK6, most settings will be found via ALT_SLASH_JAVA or
-#   by way of other system environment variables. If this was JDK5
-#   or an older JDK, you might need to export more ALT_* variables.
-#
-# On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at:
-#          C:/Program Files/Microsoft Platform SDK
-#
-#############################################################################
-
-#############################################################################
-# Error
-error() # message
-{
-  echo "ERROR: $1"
-  exit 6
-}
-# Directory must exist
-dirMustExist() # dir name
-{
-  if [ ! -d "$1" ] ; then
-    error "Directory for $2 does not exist: $1"
-  fi
-}
-# File must exist
-fileMustExist() # dir name
-{
-  if [ ! -f "$1" ] ; then
-    error "File for $2 does not exist: $1"
-  fi
-}
-#############################################################################
-
-# Should be set by JPRT as the 3 basic inputs
-bootdir="${ALT_BOOTDIR}"
-slashjava="${ALT_SLASH_JAVA}"
-jdk_import="${ALT_JDK_IMPORT_PATH}"
-
-# The /java/devtools items
-jdk_devtools="${slashjava}/devtools"
-share="${jdk_devtools}/share"
-
-# Needed for langtools, maybe other parts of the build
-ANT_HOME="${share}/ant/latest"
-export ANT_HOME
-
-# The 3 bin directories in common to all platforms
-sharebin="${share}/bin"
-antbin="${ANT_HOME}/bin"
-
-# Check input
-dirMustExist "${bootdir}"         ALT_BOOTDIR
-dirMustExist "${slashjava}"       ALT_SLASH_JAVA
-dirMustExist "${jdk_import}"      ALT_JDK_IMPORT_PATH
-dirMustExist "${ANT_HOME}"        ANT_HOME
-
-# If ALT_PREVIOUS_RELEASE_IMAGE not defined, set it to the bootdir area for
-#    any possible image comparisons.
-#    We assume bootdir is a previous jdk release image, valid for comparison
-#    reasons.
-if [ "${ALT_PREVIOUS_RELEASE_IMAGE}" = "" ] ; then
-   ALT_PREVIOUS_RELEASE_IMAGE="${bootdir}"
-   export ALT_PREVIOUS_RELEASE_IMAGE
-fi
-
-# Use the JDK import for now (FIXME: use the binary plugs?)
-if [ "${OPENJDK}" = true ] ; then
-  ALT_CLOSED_JDK_IMPORT_PATH="${jdk_import}"
-  export ALT_CLOSED_JDK_IMPORT_PATH
-fi
-
-# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
-osname=`uname -s`
-if [ "${osname}" = SunOS ] ; then
-   
-    # SOLARIS: Sparc or X86
-    osarch=`uname -p`
-    if [ "${osarch}" = sparc ] ; then
-	solaris_arch=sparc
-    else
-	solaris_arch=i386
-    fi
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
-        compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
-    else
-	compiler_name=SS12
-    fi
-    compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}
-
-    # Add basic solaris system paths
-    path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-
-    # Find GNU make
-    make=/usr/sfw/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=/opt/sfw/bin/gmake
-	if [ ! -f ${make} ] ; then
-	    make=${jdk_devtools}/${solaris_arch}/bin/gnumake
-        fi 
-    fi
-    fileMustExist "${make}" make
-
-    # File creation mask
-    umask 002
-
-elif [ "${osname}" = Linux ] ; then
-   
-    # LINUX: X86, AMD64
-    osarch=`uname -m`
-    if [ "${osarch}" = i686 ] ; then
-	linux_arch=i586
-    elif [ "${osarch}" = x86_64 ] ; then
-	linux_arch=amd64
-    fi
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    compiler_path=/usr/bin
-    compiler_name=usr_bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}
-    
-    # Add basic paths
-    path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-    
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-   
-    # Linux platform may be old, use motif files from the devtools area
-    if [ "${OPENJDK}" = true ] ; then
-      ALT_JDK_DEVTOOLS_DIR="${jdk_devtools}"
-      export ALT_JDK_DEVTOOLS_DIR
-    fi
-
-
-else
-
-    # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
-    #   Also, blanks in pathnames gives GNU make headaches, so anything placed
-    #   in any ALT_* variable should be the short windows dosname.
-   
-    # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
-    #   Assumption here is that you are in a shell window via MKS or cygwin.
-    #   MKS install should have defined the environment variable ROOTDIR.
-    #   We also need to figure out which one we have: X86, AMD64
-    if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
-	windows_arch=amd64
-    else
-	windows_arch=i586
-    fi
-    
-    # We need to determine if we are running a CYGWIN shell or an MKS shell
-    #    (if uname isn't available, then it will be unix_toolset=unknown)
-    unix_toolset=unknown
-    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
-        # We kind of assume ROOTDIR is where MKS is and it's ok
-        unix_toolset=MKS
-        mkshome=`dosname -s "${ROOTDIR}"`
-	# Utility to convert to short pathnames without spaces
-	dosname="${mkshome}/mksnt/dosname -s"
-        # Most unix utilities are in the mksnt directory of ROOTDIR
-        unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${sharebin};${antbin};${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-	devtools_path="${jdk_devtools}/win32/bin"
-	path4sdk="${devtools_path};${path4sdk}"
-	# Normally this need not be set, but on Windows it's default is C:/UTILS
-        ALT_DEVTOOLS_PATH="${devtools_path}"
-	export ALT_DEVTOOLS_PATH
-        dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
-        # Find GNU make
-        make="${devtools_path}/gnumake.exe"
-        fileMustExist "${make}" make
-    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
-        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
-        unix_toolset=CYGWIN
-	# Utility to convert to short pathnames without spaces
-	dosname="/usr/bin/cygpath -a -m -s"
-        # Most unix utilities are in the /usr/bin
-        unixcommand_path="/usr/bin"
-        path4sdk="${sharebin};${antbin};${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-        # Find GNU make
-        make="${unixcommand_path}/make.exe"
-        fileMustExist "${make}" make
-    else
-      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
-    fi
-
-    # WINDOWS: Compiler setup (nasty part)
-    #   NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
-    #   NOTE: CYGWIN has a link.exe too, make sure the compilers are first
-    if [ "${windows_arch}" = i586 ] ; then
-        # 32bit Windows compiler settings
-        # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
-        vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
-        # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
-        msdev_root="${vs_root}/Common7/Tools"
-        msdevtools_path="${msdev_root}/bin"
-        vc7_root="${vs_root}/Vc7"
-        compiler_path="${vc7_root}/bin"
-        compiler_name=VS2003
-        platform_sdk="${vc7_root}/PlatformSDK"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${vc7_root}/atlmfc/include"
-        include4sdk="${include4sdk};${vc7_root}/include"
-        include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
-        include4sdk="${include4sdk};${platform_sdk}/include"
-        include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
-        lib4sdk="${vc7_root}/atlmfc/lib"
-        lib4sdk="${lib4sdk};${vc7_root}/lib"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib"
-        lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
-	path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
-        path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
-	path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
-        path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
-	path4sdk="${compiler_path};${path4sdk}"
-    elif [ "${windows_arch}" = amd64 ] ; then
-        # AMD64 64bit Windows compiler settings
-	if [ "${MSSDK}" != "" ] ; then
-	    platform_sdk="${MSSDK}"
-	else
-	    platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
-	fi
-	compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
-        compiler_name=VS2005_PSDK
-	msdevtools_path="${platform_sdk}/Bin"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${platform_sdk}/Include"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
-	include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
-	include4sdk="${include4sdk};${platform_sdk}/Include/atl"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt"
-        lib4sdk="${platform_sdk}/Lib/AMD64"
-        lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${platform_sdk}/bin;${path4sdk}"
-        path4sdk="${compiler_path};${path4sdk}"
-    fi
-    # Export LIB and INCLUDE
-    unset lib
-    unset Lib
-    LIB="${lib4sdk}"
-    export LIB
-    unset include
-    unset Include
-    INCLUDE="${include4sdk}"
-    export INCLUDE
-    # Set the ALT variable
-    ALT_COMPILER_PATH=`${dosname} "${compiler_path}"`
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"`
-    export ALT_MSDEVTOOLS_PATH
-    dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH
-    
-    # WINDOWS: Get the previous JDK to be used to bootstrap the build
-    path4sdk="${bootdir}/bin;${path4sdk}"
-
-    # Turn all \\ into /, remove duplicates and trailing /
-    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
-    
-    # For windows, it's hard to know where the system is, so we just add this
-    #    to PATH.
-    path4sdk="${slash_path};${PATH}"
-    
-    # Convert path4sdk to cygwin style
-    if [ "${unix_toolset}" = CYGWIN ] ; then
-	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
-    fi
-
-    # Set special windows ALT variables
-    ALT_ISHIELDDIR="C:/ishield802"
-    export ALT_ISHIELDDIR
-
-    # Sponsors binaries
-    ALT_SPONSOR1DIR=C:/sponsor_binaries
-    export ALT_SPONSOR1DIR
-    ALT_SPONSOR2DIR=C:/sponsor_binaries 
-    export ALT_SPONSOR2DIR
-
-    # JPRT systems can never run msival2.exe, set this to avoid them
-    SKIP_MSIVAL2=true
-    export SKIP_MSIVAL2
-    # Not easy to do
-    SKIP_COMPARE_IMAGES=true
-    export SKIP_COMPARE_IMAGES
-
-fi
-
-# Export PATH setting
-PATH="${path4sdk}"
-export PATH
-
-# Things we need to unset
-unset LD_LIBRARY_PATH
-unset LD_LIBRARY_PATH_32
-unset LD_LIBRARY_PATH_64
-unset JAVA_HOME
-
diff --git a/make/jprt.properties b/make/jprt.properties
index 48f1a4a..7f2fffd 100644
--- a/make/jprt.properties
+++ b/make/jprt.properties
@@ -32,8 +32,8 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64